:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface2: #eef0f5;
  --line: #e9ebf1;
  --text: #1a1c22;
  --muted: #767c89;
  --accent: #6c5ce7;
  --accent-soft: #efeefe;
  --red: #ef4444;
  --green: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,22,30,.04), 0 6px 22px rgba(20,22,30,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.5;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }

/* общий вход + переключатель на аудио */
.vtop { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 8px; }
.vswitch {
  display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15;
  padding: 4px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px;
}
.vswitch:hover { border-color: var(--accent); }
.vswitch__sub { font-size: 10px; color: var(--muted); font-weight: 400; }
.vlogin {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 10px; background: var(--accent); color: #fff;
  text-decoration: none; font-weight: 600; font-size: 13px;
}
.vlogin:hover { filter: brightness(0.95); }
.vuser {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border: 1.5px solid var(--line); border-radius: 999px; color: var(--text);
  text-decoration: none; font-weight: 600; font-size: 13px;
}
.vuser:hover { border-color: var(--accent); }
.vuser__avatar { border-radius: 50%; display: block; }
@media (max-width: 560px) { .vswitch__sub { display: none; } }
.create-row { display: flex; gap: 10px; flex-wrap: wrap; }
.create-row .btn { flex: 1; min-width: 200px; }
/* соло: одна дорожка на весь кадр (в .stage три ребёнка — halfTop, halfBottom,
   rec-badge, поэтому :last-child не подходит, целимся по id) */
.stage--solo #halfBottom { display: none; }
.stage--solo #halfTop { flex: 1 1 100%; }

/* landing */
.wrap { max-width: 640px; margin: 0 auto; padding: 56px 20px; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.logo { width: 56px; height: 56px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 28px; }
h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.lead { color: var(--text); margin: 18px 0 24px; }
.note { margin-top: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius); border: none;
  background: var(--surface2); color: var(--text); font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: .15s;
}
.btn:hover:not(:disabled) { background: #e3e6ee; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(108,92,231,.32); }
.btn-primary:hover:not(:disabled) { background: #5b4bd6; }
.btn-rec { background: var(--red); color: #fff; }
.btn-stop { background: var(--surface2); }
.btn-dl { background: var(--green); color: #fff; }
.dl-row { display: flex; gap: 10px; flex-wrap: wrap; }
.dl-row .btn { flex: 1; min-width: 160px; }
.vfoot { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 20px; }
.agent-cta { display: inline-flex; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; }
.agent-cta:hover { border-color: var(--accent); }
.btn-secondary { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--muted); padding: 8px 14px; font-size: 14px; }
.btn-ghost:hover { background: var(--surface2); color: var(--red); }

.card { background: var(--surface); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 20px; margin-top: 20px; }
.role-links { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.link-input { width: 100%; margin-top: 6px; padding: 11px 13px; border-radius: 10px;
  border: none; background: var(--surface2); color: var(--text); font-size: 13px; }

/* выбор формата */
.fmt-pick { display: flex; flex-direction: column; gap: 10px; margin: 22px 0; }
.fmt-opt { display: flex; align-items: center; gap: 14px; cursor: pointer; background: var(--surface);
  box-shadow: var(--shadow); border-radius: var(--radius); padding: 14px 16px; transition: .15s; }
.fmt-opt:has(input:checked) { box-shadow: 0 0 0 2px var(--accent), var(--shadow); background: var(--accent-soft); }
.fmt-opt input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.fmt-icon { flex: none; background: var(--surface2); border-radius: 4px; }
.fmt-icon--v { width: 18px; height: 30px; }
.fmt-icon--h { width: 34px; height: 20px; }
.fmt-opt:has(input:checked) .fmt-icon { background: var(--accent); }

/* room */
.room-wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px; }
.studio { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 28px; align-items: start; }
@media (max-width: 680px) { .studio { grid-template-columns: 1fr; } }

.stage {
  position: relative; aspect-ratio: 9 / 16; width: 100%; max-width: 320px;
  background: #0f1115; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.half { position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; }
.half + .half { box-shadow: 0 -1px 0 rgba(255,255,255,.14); }
.stage--16x9 { aspect-ratio: 16 / 9; flex-direction: row; max-width: 560px; }
.stage--16x9 .half + .half { box-shadow: -1px 0 0 rgba(255,255,255,.14); }
.cam { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam.remote { transform: none; }
.placeholder { color: rgba(255,255,255,.55); display: grid; place-items: center; gap: 4px; }
.placeholder span { font-size: 40px; opacity: .55; }
.placeholder small { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

.rec-badge { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.6); color: #fff; padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.rec-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

.panel { padding-top: 4px; }

/* живой статус — акцентный, с пульсирующей точкой */
.status { font-size: 14px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border-radius: 12px; padding: 11px 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 9px; }
.status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  flex: none; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.65); } }

.quality { font-size: 13px; color: var(--text); background: var(--surface2);
  border-radius: 10px; padding: 8px 11px; margin-bottom: 10px; display: inline-block; }
.live-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; margin-bottom: 4px; }
.live-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.live-hint { font-size: 12px; margin-bottom: 16px; }
.controls { display: flex; gap: 12px; margin-bottom: 16px; }
.controls .btn { font-size: 16px; padding: 14px 24px; }
.post { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 8px; }

/* topbar */
.topbar { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.brand-mini { display: flex; align-items: center; gap: 8px; color: var(--text);
  text-decoration: none; font-weight: 800; font-size: 17px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.room-badge { font-family: ui-monospace, monospace; font-size: 13px; color: var(--muted);
  background: var(--surface2); padding: 6px 11px; border-radius: 9px; }

.role-line { font-size: 15px; margin-bottom: 14px; }
.role-line b { color: var(--accent); }

/* peers */
.peers { display: flex; gap: 10px; margin-bottom: 16px; }
.peer { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--surface2); padding: 6px 12px; border-radius: 999px; transition: .2s; }
.peer .led { width: 9px; height: 9px; border-radius: 50%; background: #c2c6d2; transition: .2s; }
.peer.on { color: #0d7a3a; background: #e6f7ee; }
.peer.on .led { background: var(--green); }

/* invite */
.invite { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px;
  background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); padding: 14px; }
.invite-link { text-align: left; width: 100%; cursor: pointer; font-size: 13px;
  font-family: ui-monospace, monospace; color: var(--accent); background: var(--surface2);
  border: none; border-radius: 9px; padding: 11px 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invite-link:hover { background: #e6e8f0; }
.copied { color: var(--green); font-size: 13px; font-weight: 600; }

/* steps */
.steps { margin: 18px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.steps li { margin-bottom: 6px; }

/* finalize */
.finalize { width: 100%; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px;
  display: flex; flex-direction: column; gap: 14px; }
.fin-title { font-weight: 700; font-size: 15px; }
.fin-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fin-row > label { font-size: 14px; min-width: 84px; }
.fin-row b { color: var(--accent); }
.fin-hint { font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 140px;
  height: 6px; border-radius: 6px; outline: none;
  background: linear-gradient(to right, var(--accent) var(--fill, 0%), var(--surface2) var(--fill, 0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%;
  background: #fff; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }

.clip-row { display: flex; gap: 12px; flex-wrap: wrap; }
.clip { flex: 1; min-width: 170px; background: var(--surface); box-shadow: var(--shadow);
  border-radius: 12px; padding: 11px 13px; display: flex; align-items: center; gap: 8px; transition: .15s; }
.clip.filled { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.clip-name { font-size: 13px; font-weight: 600; }
.clip-pick { font-size: 13px; color: var(--accent); cursor: pointer; background: var(--accent-soft);
  border-radius: 8px; padding: 5px 10px; }
.clip-pick:hover { background: #e4e2fc; }
.clip-x { margin-left: auto; background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 13px; }
.clip-x:hover { color: var(--red); }

/* AI / транскрипция / заметки */
.ai-block { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; }
.shownotes { margin-top: 18px; background: var(--surface); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 18px; }
.sn-h { font-weight: 700; font-size: 13px; margin-bottom: 10px; color: var(--muted); }
.sn-title { font-weight: 800; font-size: 18px; line-height: 1.3; margin-bottom: 8px; letter-spacing: -0.01em; }
.sn-desc { font-size: 14px; color: var(--text); line-height: 1.5; margin-bottom: 14px; }
.sn-block { margin-bottom: 12px; }
.sn-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.sn-list { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.55; color: var(--text); }
.sn-list li { margin-bottom: 4px; }

/* нарезка на клипы */
.cutter { width: 100%; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 14px;
  display: flex; flex-direction: column; gap: 12px; }
.cut-help { font-size: 13px; }
.cut-player { width: 100%; max-width: 320px; border-radius: 14px; background: #0f1115; box-shadow: var(--shadow); }
.cut-row { display: flex; align-items: center; gap: 12px; }
.timeline { position: relative; width: 100%; height: 14px; background: var(--surface2); border-radius: 7px; cursor: pointer; }
.tl-playhead { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); left: 0; pointer-events: none; }
.tl-mark { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--accent); border-radius: 2px;
  transform: translateX(-1px); pointer-events: none; }
.marks-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mark-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 999px; }
.mark-chip button { border: none; background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; padding: 0; }
.clips-out { display: flex; flex-direction: column; gap: 12px; }
.clip-card { display: flex; align-items: center; gap: 14px; background: var(--surface); box-shadow: var(--shadow);
  border-radius: 12px; padding: 10px; }
.clip-card video { width: 120px; max-height: 220px; flex: none; border-radius: 8px; background: #0f1115; }
.clip-info { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.clip-meta { font-size: 14px; color: var(--text); }
.clip-dl { padding: 8px 14px; font-size: 14px; }

/* progress */
.progress { width: 100%; display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.progress-track { width: 100%; height: 8px; border-radius: 6px; background: var(--surface2); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .3s ease; }
.progress-text { font-size: 13px; color: var(--muted); }
