/* Motivy: data-theme na <html> (graphite = výchozí, daylight, signal). Barvy jen přes proměnné. */
:root, [data-theme="graphite"] {
  --bg: #0b0b0d; --panel-solid: #121215; --card: #1a1a1f; --surface-2: #0e0e11; --input: #0e0e11; --top: #0b0b0d;
  --line: #26262c; --line-strong: #34343c; --text: #f2f2f4; --muted: #8d8d97;
  --accent: #3b82f6; --accent-2: #60a5fa; --accent-ink: #fff; --accent-soft: rgba(59, 130, 246, .14); --accent-hover: #2f74e6;
  --good: #22c55e; --warn: #f59e0b; --bad: #ef4444; --danger-ink: #fca5a5; --danger-line: #5b1d1d;
  --tl-bg: #0e0e11; --tl-rec: #24242b; --sel: rgba(59, 130, 246, .30); --marker: #fbbf24; --clip: #14b8a6; --head: #ef4444;
  --hit: rgba(251, 191, 36, .35); --cur: rgba(239, 68, 68, .35); --hover-w: rgba(59, 130, 246, .25); --wave: rgba(255, 255, 255, .26);
  --shadow: 0 10px 30px rgba(0, 0, 0, .5); --backdrop: rgba(0, 0, 0, .65); --login-glow: rgba(59, 130, 246, .18);
  --radius: 10px; --radius-sm: 7px; --pill-radius: 7px; --io-ink: #fff;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
[data-theme="daylight"] {
  --bg: #f4f5f7; --panel-solid: #ffffff; --card: #ffffff; --surface-2: #f7f8fa; --input: #ffffff; --top: #ffffff;
  --line: #e3e5ea; --line-strong: #cfd3da; --text: #0f1115; --muted: #6b7280;
  --accent: #111318; --accent-2: #2563eb; --accent-ink: #fff; --accent-soft: rgba(37, 99, 235, .08); --accent-hover: #2a2d35;
  --good: #16a34a; --warn: #d97706; --bad: #dc2626; --danger-ink: #b91c1c; --danger-line: #f3c4c4;
  --tl-bg: #fafbfc; --tl-rec: #e4e7ec; --sel: rgba(37, 99, 235, .22); --marker: #d97706; --clip: #0d9488; --head: #dc2626;
  --hit: rgba(217, 119, 6, .25); --cur: rgba(220, 38, 38, .18); --hover-w: rgba(37, 99, 235, .15); --wave: rgba(15, 17, 21, .28);
  --shadow: 0 8px 30px rgba(15, 17, 21, .10); --backdrop: rgba(15, 17, 21, .35); --login-glow: rgba(37, 99, 235, .10);
  --radius: 12px; --radius-sm: 8px; --pill-radius: 99px; --io-ink: #fff;
  color-scheme: light;
}
[data-theme="signal"] {
  --bg: #070909; --panel-solid: #0d1011; --card: #12171a; --surface-2: #0a0d0e; --input: #0a0d0e; --top: #070909;
  --line: #1c2427; --line-strong: #2a3438; --text: #e8eeeb; --muted: #7c8a86;
  --accent: #b6f23d; --accent-2: #c9f56b; --accent-ink: #0b0f05; --accent-soft: rgba(182, 242, 61, .12); --accent-hover: #a5e12c;
  --good: #b6f23d; --warn: #fbbf24; --bad: #ff3b3b; --danger-ink: #ff8a8a; --danger-line: #4a1616;
  --tl-bg: #0a0d0e; --tl-rec: #1a2225; --sel: rgba(182, 242, 61, .22); --marker: #fbbf24; --clip: #38bdf8; --head: #ff3b3b;
  --hit: rgba(251, 191, 36, .3); --cur: rgba(255, 59, 59, .3); --hover-w: rgba(182, 242, 61, .2); --wave: rgba(182, 242, 61, .35);
  --shadow: 0 10px 30px rgba(0, 0, 0, .6); --backdrop: rgba(0, 0, 0, .7); --login-glow: rgba(182, 242, 61, .10);
  --radius: 4px; --radius-sm: 3px; --pill-radius: 3px; --io-ink: #0b0f05;
  --font: "Inter", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { display: grid; place-items: center; height: 100vh; opacity: .6; }

/* ---------- prvky */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { border-color: var(--danger-line); color: var(--danger-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn kbd { font-size: 10px; opacity: .6; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--input); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
label.f { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--pill-radius); background: var(--card); border: 1px solid var(--line); font-size: 12px; font-weight: 500; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.good { background: var(--good); box-shadow: 0 0 8px var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.dot.live { background: var(--bad); box-shadow: 0 0 8px var(--bad); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.card { background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
h1, h2, h3 { margin: 0; font-weight: 650; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.err { color: #fca5a5; }

/* ---------- horní lišta */
.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--top); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .3px; text-decoration: none; color: var(--text); }
.brand img { width: 28px; height: 28px; }
.top .user { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1000px 500px at 50% -10%, var(--login-glow), transparent); }
.login .card { width: min(380px, 100%); }
.login .logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 12px; }
.login .logo img { width: 72px; }

/* ---------- přehled akcí */
.page { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.events { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 16px; }
.event-card { display: block; text-decoration: none; color: inherit; }
.event-card:hover { border-color: var(--accent); }
.event-card .meta { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- pracovní plocha akce */
.ws { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 26vw, 400px); grid-template-rows: auto 1fr; height: 100vh; }
.ws > .top { grid-column: 1 / -1; }
.ws-main { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 10px 12px; gap: 8px; }
.ws-main > * { flex-shrink: 0; }
.ws-side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--top); }
.statusbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
/* video zabere jen zbylou výšku (vše ostatní se musí vejít bez scrollu); obraz 16:9 je uvnitř vycentrovaný */
.ws-main > .video-wrap { flex: 0 1 auto; height: min(calc((100vw - clamp(320px, 26vw, 400px) - 24px) * 9 / 16), 62vh); min-height: 150px; }
.video-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; width: 100%; }
.video-wrap video { width: 100%; height: 100%; display: block; background: #000; }
.video-wrap .overlay { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; pointer-events: none; }
.video-wrap .tc { position: absolute; left: 10px; top: 10px; font-family: var(--mono); background: #000a; padding: 3px 8px; border-radius: 6px; font-size: 15px; }
.video-wrap .live-badge { position: absolute; right: 10px; top: 10px; }
.video-wrap .sound-btn { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 7px; height: 34px; min-width: 34px; justify-content: center;
  padding: 0 9px; border-radius: 999px; border: 1px solid #ffffff33; background: #000a; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
.video-wrap .sound-btn:hover { background: #000c; }
.video-wrap .sound-btn.off { padding: 0 13px 0 11px; background: #fff; color: #000; border-color: #fff; box-shadow: 0 2px 10px #0006; }
.video-wrap .sound-btn.off:hover { background: #e9e9ee; }
.video-wrap .lock-badge { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; cursor: pointer; font-family: var(--mono); background: var(--accent-2); border-color: var(--accent-2); color: var(--io-ink); gap: 6px; }
.btn.on { background: var(--accent-2); border-color: var(--accent-2); color: var(--io-ink); }
.transport { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.transport .tc-big { font-family: var(--mono); font-size: 18px; min-width: 120px; }
.tl-wrap { position: relative; }
.tl-wrap canvas { width: 100%; height: 110px; display: block; border-radius: 8px; border: 1px solid var(--line); touch-action: none; }
.tl-tools { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
@media (max-width: 1700px) { .tl-tools .btn kbd { display: none; } .tl-tools .btn.sm { padding: 4px 7px; } }
@media (max-width: 1400px) { .crop-hint { display: none !important; } .tl-tools { gap: 3px; } .tl-tools .btn.sm { padding: 4px 6px; } }
.tl-tip { position: absolute; bottom: 116px; width: 170px; display: none; pointer-events: none; background: #000d; border: 1px solid var(--line); border-radius: 6px; padding: 3px; text-align: center; font-family: var(--mono); font-size: 12px; z-index: 5; }
.tl-tip img { width: 100%; display: none; border-radius: 4px; aspect-ratio: 16/9; object-fit: cover; background: #111; }
.clipbox { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; }
.clip-head { display: flex; gap: 10px; align-items: center; }
.clip-head input { padding-top: 6px; padding-bottom: 6px; }
.clip-btns { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.clip-btns .btn { justify-content: center; }
.clipbox .io { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.io-time { font-family: var(--mono); padding: 5px 8px; border-radius: var(--radius-sm); background: var(--input); border: 1px solid var(--line); min-width: 104px; text-align: center; cursor: pointer; }
.io-time.set { border-color: var(--accent-2); color: var(--accent-2); }
.opts { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; align-items: center; }
.opts select { padding-top: 5px; padding-bottom: 5px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; padding: 10px; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; color: var(--muted); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent-2); }
.tabs .count { font-size: 11px; background: var(--card); border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.tabpane { flex: 1; overflow: auto; min-height: 0; }
.tabhead { padding: 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--top); z-index: 2; }

/* přepis */
.tr-line { display: grid; grid-template-columns: 62px 1fr; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.tr-line .t { font-family: var(--mono); font-size: 11px; color: var(--muted); cursor: pointer; padding-top: 2px; }
.tr-line .t:hover { color: var(--accent-2); }
.tr-line .txt { user-select: text; }
.tr-line.now { background: var(--accent-soft); }
.w { cursor: pointer; border-radius: 3px; }
.w:hover { background: var(--hover-w); }
.w.cur { background: var(--cur); }
.w.insel { background: var(--sel); }
.w.hit { background: var(--hit); }
.tr-partial { padding: 6px 10px 6px 80px; color: var(--muted); font-style: italic; }
.sel-pop { position: fixed; z-index: 50; display: none; gap: 4px; background: var(--panel-solid); border: 1px solid var(--accent); border-radius: 8px; padding: 4px; box-shadow: var(--shadow); }
.follow { position: sticky; bottom: 8px; margin: 8px auto; display: none; }

/* klipy */
.clip { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); }
.clip.active { background: var(--accent-soft); }
.clip .poster { width: 112px; aspect-ratio: 16/9; border-radius: 6px; background: #000 center/cover; display: grid; place-items: center; color: var(--muted); font-size: 11px; cursor: pointer; }
.clip .title { font-weight: 600; word-break: break-word; }
.clip .sub { font-size: 12px; color: var(--muted); }
.clip .acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent-2); transition: width .4s; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); }
.badge.requested { border-color: var(--warn); color: var(--warn); }
.badge.done { border-color: var(--good); color: var(--good); }
.badge.failed { border-color: var(--bad); color: var(--bad); }
.badge.processing, .badge.queued { border-color: var(--accent-2); color: var(--accent-2); }

/* značky */
.mk { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); align-items: center; }
.mk .t { font-family: var(--mono); font-size: 12px; cursor: pointer; }
.mk input { padding: 4px 6px; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); color: var(--text); padding: 0; width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
dialog .dh { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
dialog .db { padding: 6px 16px 16px; max-height: 70vh; overflow: auto; }
dialog .df { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.codebox { font-family: var(--mono); font-size: 12px; background: var(--input); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; word-break: break-all; display: flex; gap: 8px; align-items: center; }
.codebox span { flex: 1; }
table.t { width: 100%; border-collapse: collapse; }
table.t td, table.t th { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.t th { color: var(--muted); font-weight: 500; font-size: 12px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel-solid); border: 1px solid var(--line); border-left: 3px solid var(--accent-2); padding: 10px 14px; border-radius: 8px; max-width: 360px; box-shadow: var(--shadow); }
.toast.err { border-left-color: var(--bad); color: var(--text); }

/* ---------- mobil */
@media (max-width: 900px) {
  .ws { display: block; height: auto; }
  .ws-side { border-left: 0; border-top: 1px solid var(--line); height: 75vh; }
  .ws > .top { position: static; }
  .ws-main { overflow: visible; padding: 10px; }
  .video-wrap { max-height: none; }
  .clipbox { grid-template-columns: 1fr; }
  .clip-head { flex-wrap: wrap; }
  .ws-main > .video-wrap { height: auto; aspect-ratio: 16 / 9; min-height: 0; }
  .top { padding: 8px 12px; flex-wrap: wrap; }
  .hide-m { display: none !important; }
  .tl-wrap canvas { height: 90px; }
  .tl-tip { bottom: 96px; }
}

/* ---------- ikony, logo, přepínač motivu */
.ic { display: inline-flex; line-height: 0; }
.logo-mark { color: var(--accent-2); display: inline-flex; }
[data-theme="daylight"] .logo-mark { color: var(--accent); }
.brand { font-weight: 700; letter-spacing: -.01em; }
h1, h2, h3 { letter-spacing: -.015em; }
.tc-big, .tc, .io-time, .tr-line .t, .mk .t { font-variant-numeric: tabular-nums; }
.btn.icon { padding: 7px 9px; }
.btn.sm.icon { padding: 5px 7px; }
.video-wrap { background: #000; border: 1px solid var(--line); }
.tl-wrap canvas { background: var(--tl-bg); }
.theme-pick { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.theme-pick button { border: 0; background: none; padding: 3px 8px; border-radius: calc(var(--radius-sm) - 2px); cursor: pointer; color: var(--muted); font-size: 12px; }
.theme-pick button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
[data-theme="signal"] .tabs button, [data-theme="signal"] label.f, [data-theme="signal"] .tabhead h3 { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
[data-theme="signal"] .pill { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
[data-theme="daylight"] .video-wrap { border-color: #d6d9df; }
[data-theme="daylight"] .top { box-shadow: 0 1px 0 var(--line); }
[data-theme="daylight"] .ws-side, [data-theme="daylight"] .tabhead { background: #fff; }

/* ---------- kompaktní horní lišta */
.top { flex-wrap: nowrap; gap: 10px; min-height: 56px; }
.top > h2 { flex: 0 1 auto; min-width: 0; }
.statusbar { flex-wrap: nowrap; overflow: hidden; min-width: 0; flex: 0 1 auto; }
.top .row { flex-wrap: nowrap; }
.top .user { flex: none; gap: 6px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar { overflow: hidden; cursor: pointer; padding: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-2); border: 1px solid var(--line); flex: none; }
[data-theme="daylight"] .avatar { color: var(--accent-2); }
.btn.primary kbd, .btn.on kbd { background: transparent; border-color: currentColor; color: inherit; opacity: .65; }
.video-wrap .tc { color: #fff; }
.video-wrap .overlay { color: #c8c8cf; }
.video-wrap .pill { background: rgba(0, 0, 0, .55); border-color: rgba(255, 255, 255, .15); color: #fff; }
.video-wrap .lock-badge { background: var(--accent-2); border-color: var(--accent-2); color: var(--io-ink); }
@media (max-width: 1250px) { .top .theme-pick, .top .user .muted { display: none; } }
@media (max-width: 900px) { .top { flex-wrap: wrap; } .statusbar { flex-wrap: wrap; } .top .row { flex-wrap: wrap; } }
@media (max-width: 900px) {
  .transport { gap: 5px; }
  .transport .tc-big { font-size: 16px; min-width: 0; }
  .tl-tools .btn kbd, .transport .btn kbd { display: none; }
}

/* ---------- výstup klipu: formáty, výřez a náhled titulků */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 5px 11px; cursor: pointer; color: var(--muted); font-size: 13px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-2); color: var(--io-ink); }
.opts.variant { padding: 5px 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); align-items: center; }
.crop-ov { position: absolute; inset: 0; pointer-events: none; }
.crop-shade { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .62); }
.crop-win { position: absolute; top: 0; bottom: 0; outline: 2px solid var(--accent-2); outline-offset: -2px; pointer-events: auto; touch-action: none; overflow: hidden; }
.logo-prev { position: absolute; opacity: .92; pointer-events: none; }
.kf-tools { display: inline-flex; gap: 2px; align-items: center; padding-left: 6px; margin-left: 2px; border-left: 1px solid var(--line); }
.kf-dia { width: 8px; height: 8px; background: var(--accent-2); transform: rotate(45deg); display: inline-block; margin: 0 2px; }
.tl-wrap.kf canvas { height: 128px; }
.tl-wrap.kf .tl-tip { bottom: 134px; }
.ease-pop { position: absolute; z-index: 6; display: none; align-items: center; gap: 8px; padding: 5px 8px; background: var(--panel-solid); border: 1px solid var(--accent-2); border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 12px; white-space: nowrap; }
.ease-pop .seg button { padding: 3px 9px; font-size: 12px; }
.kf-badge { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; pointer-events: none;
  background: rgba(0, 0, 0, .6); color: #ddd; border: 1px solid rgba(255, 255, 255, .2); }
.kf-badge.on { background: #fff; color: #000; border-color: var(--accent-2); box-shadow: 0 0 0 2px var(--accent-2); }
.toast .toast-act { margin-left: 10px; }
.sty-adv { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 4px; }
.sty-adv summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cue-list { max-height: 55vh; overflow: auto; margin-top: 10px; }
.cue-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cue-row textarea { resize: vertical; min-height: 44px; }

/* ---------- vzhled titulků: živý náhled a ovládání */
.sub-live { display: none; z-index: 2; }
.sty-wrap { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.15fr); gap: 20px; align-items: start; }
.sty-preview { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; }
.sub-frame { position: relative; height: min(62vh, 640px); max-width: 100%; background: #111; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.sub-frame .sub-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sub-frame .guide { position: absolute; display: none; background: var(--accent-2); opacity: .8; pointer-events: none; }
.sub-frame .guide.v { left: 50%; top: 0; bottom: 0; width: 1px; }
.sub-frame .guide.h { top: 50%; left: 0; right: 0; height: 1px; }
.sub-frame .sub-live { display: block; }
.sty-panel { display: flex; flex-direction: column; gap: 12px; max-height: 66vh; overflow: auto; padding-right: 4px; }
.sty-group { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.sty-group h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.sty-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.sty-row > label { color: var(--muted); }
.sty-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sty-ctl input[type=range] { flex: 1; min-width: 120px; accent-color: var(--accent-2); }
.sty-ctl input[type=color] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.sty-ctl select { width: auto; }
.sty-val { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 64px; text-align: right; }
@media (max-width: 900px) { .sty-wrap { grid-template-columns: 1fr; } .sub-frame { height: 46vh; } .sty-panel { max-height: none; } }

.archive-note { font-size: 13px; color: var(--muted); background: var(--accent-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
