/* The renderer's own fonts (DejaVu Bold, Latin/Greek/Cyrillic subsets) so burned-in texts, captions and the news bar
   look the same in the preview as in the export. Other scripts fall back as before (the renderer uses Noto for them). */
@font-face { font-family: "DejaVu Sans"; font-weight: 600 900; font-display: swap; src: url("/studio/fonts/DejaVuSans-Bold.woff2") format("woff2"); unicode-range: U+0020-007E, U+00A0-024F, U+0300-03FF, U+0400-04FF, U+1E00-1EFF, U+2000-21FF; }
@font-face { font-family: "DejaVu Serif"; font-weight: 600 900; font-display: swap; src: url("/studio/fonts/DejaVuSerif-Bold.woff2") format("woff2"); unicode-range: U+0020-007E, U+00A0-024F, U+0300-03FF, U+0400-04FF, U+1E00-1EFF, U+2000-21FF; }
@font-face { font-family: "DejaVu Sans Mono"; font-weight: 600 900; font-display: swap; src: url("/studio/fonts/DejaVuSansMono-Bold.woff2") format("woff2"); unicode-range: U+0020-007E, U+00A0-024F, U+0300-03FF, U+0400-04FF, U+1E00-1EFF, U+2000-21FF; }
:root {
  --red: #d71920; --red-dark: #b0121a; --red-soft: #fdecec;
  --ink: #15161a; --ink-2: #4a4d57; --muted: #8a8e99; --line: #e7e8ec; --bg: #ffffff; --bg-2: #f7f7f9;
  --radius: 12px; --shadow: 0 1px 2px rgba(20,20,30,.06), 0 8px 24px rgba(20,20,30,.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--red); }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
.muted { color: var(--muted); }
.hint { color: var(--ink-2); font-size: 13px; }
.danger { color: var(--red-dark); }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }

/* header */
.bar { display: flex; align-items: center; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; min-height: 58px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo-dot { flex: none; width: 14px; height: 14px; border-radius: 4px; background: var(--red); box-shadow: 4px 4px 0 var(--ink); }
.logo-sub { font-weight: 600; color: var(--red); }
.name { flex: 1; min-width: 80px; text-overflow: ellipsis; border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; font-weight: 600; background: transparent; }
.name:hover, .name:focus { border-color: var(--line); outline: none; background: var(--bg-2); }
.bar-actions { display: flex; align-items: center; gap: 8px; }
.save-state { font-size: 12px; color: var(--muted); min-width: 52px; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 14px; min-height: 40px; cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: #cfd1d8; background: var(--bg-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { border-color: transparent; background: transparent; font-size: 18px; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn.big { min-height: 52px; padding: 12px 26px; font-size: 17px; }
.btn.round { width: 48px; height: 48px; border-radius: 50%; padding: 0; font-size: 18px; }
.btn.danger { color: var(--red-dark); }
.btn.chip { border-radius: 999px; min-height: 36px; font-size: 13px; }
.btn.chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.btn:focus-visible, .tab:focus-visible, .clip:focus-visible, .word:focus-visible { outline: 3px solid rgba(215,25,32,.35); outline-offset: 2px; }
.input, .select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--bg); min-height: 40px; width: 100%; }
.input:focus, .select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(215,25,32,.12); }
.bar .select { width: auto; }
/* language menus: every language named in itself (never a flag) */
/* letter-spacing breaks Arabic joining and Devanagari shaping */
/* Other languages run longer than the English this UI was set for: buttons and button rows may wrap there. */
:root:not([lang="en"]) .btn { white-space: normal; text-align: center; }
:root:not([lang="en"]) .media-item .row { flex-wrap: wrap; }
@media (max-width: 360px) {
  /* a long "Export" label (e.g. Exportieren) leaves no room for the wordmark: keep the mark, drop the word */
  :root:not([lang="en"]) .editor-bar .logo { font-size: 0; gap: 0; }
}
:root[lang="ar"] *, :root[lang="hi"] * { letter-spacing: 0 !important; }
.lang-select.compact { font-size: 13px; padding-inline: 8px 26px; min-width: 9.5em; } /* fits the longest native name beside the arrow */
.lang-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang-picker label { font-size: 13px; color: var(--ink-2); }
.lang-picker .select { width: auto; min-width: 9em; }
.lang-picker.full { display: grid; gap: 6px; max-width: 28em; }
.lang-picker.full .hint { margin: 0; }
input[type=range] { accent-color: var(--red); }
input[type=checkbox] { accent-color: var(--red); width: 18px; height: 18px; }
input[type=color] { width: 36px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--bg); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); margin: 10px 0; }
.field.inline { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0; }
.check { display: flex; gap: 10px; align-items: center; margin: 10px 0; font-size: 14px; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 100; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--red-dark); }

/* home */
.home { max-width: 1080px; margin: 0 auto; padding: 56px 24px 80px; }
.hero { max-width: 760px; }
.eyebrow { color: var(--red); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.hero h1 { font-size: clamp(32px, 6vw, 56px); letter-spacing: -.03em; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 640px; }
.start { display: flex; gap: 10px; margin: 28px 0; flex-wrap: wrap; }
.start .input { flex: 1; min-width: 220px; min-height: 52px; font-size: 16px; }
.feature-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 32px 0 0; }
.feature-list li { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); border-inline-start: 4px solid var(--red); font-weight: 600; }
.recent { margin-top: 56px; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.recent-card { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.recent-card:hover { border-color: var(--red); }
.recent-card span { font-size: 12px; color: var(--muted); }

/* share */
.share { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.share-video { width: 100%; max-height: 78vh; background: #000; border-radius: var(--radius); }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: calc(100dvh - 58px); }
.viewer { display: flex; flex-direction: column; min-width: 0; padding: 16px 20px; gap: 12px; background: var(--bg-2); overflow: auto; }
.stage-wrap { flex: 1; min-height: 220px; display: grid; place-items: center; container-type: size; }
/* The canvas is ALWAYS exactly the export's shape (--ar = width / height, set from the project): the largest box of
   that ratio that fits. Clamping only one side would stretch it, and every tile is placed in % of it. */
.stage { position: relative; width: min(100cqw, calc(min(100cqh, 62vh) * var(--ar, 1.7778))); height: auto; aspect-ratio: var(--ar, 1.7778); background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); container-type: size; }
.tile { position: absolute; overflow: hidden; background: #f0f0f3; border-radius: 6px; }
.tile video, .tile img { width: 100%; height: 100%; display: block; }
.tile-empty { display: grid; place-items: center; border: 2px dashed #d6d7dd; background: #fafafb; }
.tile-badge { position: absolute; left: 8px; top: 8px; background: rgba(255,255,255,.92); color: var(--ink-2); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.tile-empty .tile-badge { position: static; }
.overlay-text { position: absolute; transform: translate(-50%, -50%); font-weight: 800; white-space: pre-wrap; text-align: center; padding: .1em .35em; border-radius: .15em; max-width: 92%; line-height: 1.15; pointer-events: none; }
/* Left-aligned text (the news bar): the text starts at x, its box reaches .35em before it — as the export's box border does. */
.overlay-text.left { transform: translate(-.35em, -50%); text-align: left; white-space: pre; padding: .35em; line-height: 1.164; border-radius: 0; }
/* Captions: a canvas over the whole stage, painted by the export's own painter (studio/src/captiondraw.ts). */
canvas.caption { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.stage-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; padding: 20px; color: var(--ink-2); }
.stage-empty strong { font-size: 20px; color: var(--ink); }
.transport { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-2); min-width: 120px; }
.scrub { flex: 1; min-width: 160px; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.director { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-height: 0; }
.director:empty { display: none; }
.director-label { font-size: 12px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .06em; }
.timeline { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; overflow-x: auto; }
.lane { position: relative; min-width: 100%; cursor: pointer; }
.strip { display: flex; gap: 3px; min-height: 74px; }
.clip { flex-basis: 0; min-width: 56px; display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line); background: var(--bg-2); border-radius: 8px; padding: 6px 8px; cursor: pointer; overflow: hidden; }
.clip.active { background: #fff; }
.clip.selected { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.clip-head { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-head b { color: var(--red); margin-right: 5px; }
.clip-tiles { display: flex; flex-direction: column; gap: 2px; }
.clip-tiles i { font-style: normal; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 6px; border-left: 3px solid #d6d7dd; }
.clip-tiles i.on { color: var(--ink); border-left-color: var(--red); }
.clip-dur { font-size: 10px; color: var(--muted); margin-top: auto; font-variant-numeric: tabular-nums; }
.playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--red); left: 0; pointer-events: none; border-radius: 1px; }
.playhead::before { content: ""; position: absolute; top: -4px; left: -5px; border: 6px solid transparent; border-top-color: var(--red); }

/* side panel */
.panel { border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 4px; }
.panel-head h2 { font-size: 18px; margin: 0; }
.panel-body { flex: 1; overflow: auto; padding: 8px 18px 24px; }
.panel-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 10px 12px; border-top: 1px solid var(--line); }
.tab { border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.tab.on { background: var(--red-soft); color: var(--red); }
.icon { display: inline-flex; line-height: 0; }
.tabs { display: none; }
.sheet-close { display: none; }

.drop { display: grid; gap: 4px; text-align: center; padding: 22px 14px; border: 2px dashed #d6d7dd; border-radius: var(--radius); cursor: pointer; margin-bottom: 12px; }
.drop span { font-size: 13px; color: var(--muted); }
.drop:hover, .drop.over { border-color: var(--red); background: var(--red-soft); }
.upload { display: grid; gap: 4px; font-size: 13px; margin: 8px 0; }
.bar-track { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--red); transition: width .2s; }
.media-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.media-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.media-item.picked { border-color: var(--red); background: var(--red-soft); }
.media-list.compact .media-item { grid-template-columns: 1fr auto; align-items: center; }
.pick { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.kind { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--bg-2); color: var(--red); font-size: 13px; flex: none; }
.media-name { display: grid; min-width: 0; font-weight: 600; font-size: 14px; word-break: break-word; }
.media-name small { font-weight: 400; color: var(--muted); }
.split-maker { border: 1px solid var(--red); background: var(--red-soft); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.split-maker .row { flex-wrap: wrap; }
.layouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.layout-btn { min-width: 0; overflow-wrap: anywhere; } /* long layout names in other languages wrap */
.layout-btn { display: grid; gap: 4px; justify-items: center; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 4px; cursor: pointer; font-size: 10px; color: var(--ink-2); line-height: 1.2; text-align: center; }
.layout-btn svg { width: 44px; height: 25px; fill: #d6d7dd; }
.layout-btn.on { border-color: var(--red); color: var(--red); }
.layout-btn.on svg { fill: var(--red); }
.tiles { display: grid; gap: 10px; }
.tile-edit { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.tile-edit .row { flex-wrap: wrap; } /* longer labels in other languages wrap instead of widening the panel */
.tile-edit legend { font-weight: 700; font-size: 13px; padding: 0 4px; color: var(--red); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--bg); padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 13px; flex: 1; }
.seg button.on { background: var(--red); color: #fff; }
.text-list { list-style: none; padding: 0; display: grid; gap: 10px; margin: 14px 0; }
.text-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.text-list .row { flex-wrap: wrap; }
.transcript { display: flex; flex-wrap: wrap; gap: 2px; max-height: 320px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; line-height: 1.6; }
.word { border: 0; background: transparent; padding: 1px 3px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.word:hover { background: var(--bg-2); }
.word.filler { color: var(--red); text-decoration: underline dotted; }
.word.sel { background: var(--red); color: #fff; text-decoration: line-through; }
.renders { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.render { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.render.done { border-color: var(--red); }
.render-head { display: flex; justify-content: space-between; font-size: 13px; }
.render-head span { color: var(--muted); }

/* tablet */
@media (max-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr) 330px; } }

/* phone: single column, player on top, tabs fixed at the bottom, panel as a sheet */
@media (max-width: 820px) {
  .bar { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .bar-actions { margin-inline-start: auto; }
  /* editor header: logo · undo · redo · Export, then name · format */
  .editor-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; column-gap: 4px; row-gap: 6px; }
  .editor-bar .bar-actions { display: contents; }
  .editor-bar .name { grid-column: 1; grid-row: 2; min-width: 0; }
  .editor-bar .bar-actions .select { grid-column: 2 / 5; grid-row: 2; width: auto; min-width: 0; }
  /* phones: no room for a second menu in the editor header; the language is changed in Account or the footer */
  .editor-bar .bar-actions .lang-select { display: none; }
  .editor-bar .btn.ghost { padding: 8px; }
  .director-label { flex-basis: 100%; }
  .plans .btn { flex: 1 1 100%; }
  .save-state { display: none; }
  .home { padding: 32px 16px 64px; }
  .editor { display: block; height: auto; padding-bottom: 72px; }
  .viewer { padding: 10px 12px; overflow: visible; }
  .stage-wrap { min-height: 0; container-type: inline-size; }
  .stage { width: min(100cqw, calc(60vh * var(--ar, 1.7778))); height: auto; max-height: none; }
  .stage[style*="1080 / 1920"], .stage[style*="1080 / 1350"] { width: min(100cqw, calc(56vh * var(--ar))); height: auto; }
  .transport { gap: 8px; }
  .scrub { order: 5; flex-basis: 100%; }
  .tools { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tools .btn { padding: 6px 4px; font-size: 12px; white-space: normal; line-height: 1.15; overflow-wrap: anywhere; } /* longer labels wrap inside the button */
  .tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); gap: 2px; }
  .tabs .tab { padding: 9px 2px; font-size: 12px; line-height: 1.2; text-align: center; white-space: normal; min-height: 44px; overflow-wrap: anywhere; hyphens: auto; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; top: 18vh; z-index: 40; border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.18); transform: translateY(105%); transition: transform .22s ease; padding-bottom: env(safe-area-inset-bottom); }
  body.sheet-open .panel { transform: none; }
  .sheet-close { display: inline-flex; }
  .layouts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .tabs .tab { font-size: 11px; letter-spacing: -0.01em; }
  .editor-bar .logo { font-size: 16px; }
  .editor-bar .logo-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.storage { display: grid; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); } .storage small { color: var(--muted); font-size: 12px; }
.foot { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 28px 16px 40px; border-top: 1px solid var(--line); font-size: 13px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--red); }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--bg-2); border-inline-start: 4px solid var(--ink-2); }
.notice.bad { background: var(--red-soft); border-inline-start-color: var(--red); }
.bar .account { margin-inline-start: auto; }
.report { display: grid; gap: 10px; margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); max-width: 640px; }
.report h2 { font-size: 18px; margin: 0; }
textarea.input { resize: vertical; }
.render.critical { border-color: var(--red); border-width: 2px; }
.legal { max-width: 760px; margin: 0 auto; padding: 40px 20px 60px; }
.legal h1 { font-size: 34px; letter-spacing: -.02em; }
.legal h2 { font-size: 20px; margin-top: 32px; }
.legal li { margin: 6px 0; }
.legal .updated { color: var(--muted); font-size: 13px; }
.policy-notice { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 20px; background: #fff8e6; border-bottom: 1px solid #f0d9b5; color: #3d2a00; }
.policy-notice p { margin: 2px 0 0; font-size: 14px; }
.legal-review { margin: 0 0 24px; padding: 14px 16px; border-radius: 10px; background: #fff4e5; border: 1px solid #f0d9b5; color: #3d2a00; font-size: 14px; }
.review-note { display: block; margin-top: 6px; padding: 6px 10px; border-inline-start: 3px solid #e0a43a; background: #fffaf2; color: #5c4200; font-size: 13px; }
.steps-list { margin: 22px 0 6px; padding-inline-start: 22px; display: grid; gap: 12px; font-size: 16px; color: var(--ink-2); max-width: 640px; }
.steps-list strong { color: var(--ink); }

/* Signed-out entry and unpaid subscription screens only; editor styles are unchanged. */
.entry { max-width: 1120px; padding: 56px 32px 64px; }
.entry .hero { max-width: none; }
.entry h1 { max-width: 16ch; font-size: clamp(38px, 5.2vw, 68px); line-height: 1.02; letter-spacing: -.045em; margin: 18px 0 24px; }
.entry .eyebrow { letter-spacing: .12em; }
.entry .signature { font-size: clamp(23px, 3vw, 32px); font-weight: 650; letter-spacing: -.025em; line-height: 1.2; max-width: 25ch; margin: 0 0 20px; }
.entry .lede { max-width: 680px; font-size: 17px; line-height: 1.65; }
.entry .btn { border-radius: 6px; }
.entry .btn.primary { background: var(--ink); border-color: var(--ink); }
.entry .btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.entry .btn:focus-visible, .entry a:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
.entry .start { margin: 28px 0; }
.entry .hint { max-width: 820px; line-height: 1.75; }
.entry-evidence { margin: 36px 0 0; max-width: 820px; border-top: 1px solid var(--line); padding-top: 24px; }
.entry-evidence img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 6px; }
.entry-evidence figcaption { font-size: 12px; color: var(--ink-2); margin-top: 12px; }
.entry .steps-list { max-width: 780px; padding-inline-start: 24px; display: grid; gap: 18px; font-size: 16px; line-height: 1.7; }
.entry .steps-list li { padding-inline-start: 8px; }
.entry .steps-list li::marker { color: var(--red); font-weight: 700; }
.entry .steps-list strong { display: block; color: var(--ink); }
.entry .plans { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; gap: 20px; }
.subscription-plan { padding: 28px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.subscription-plan:last-child { border-top: 3px solid var(--red); background: #f6f6f4; padding-top: 26px; }
.plan-period { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.plan-price { font-size: clamp(27px,3vw,40px); font-weight: 750; letter-spacing: -.035em; margin: 18px 0 8px; }
.plan-detail { font-size: 14px; color: var(--ink-2); margin: 0 0 24px; }
.subscription-plan .btn { width: 100%; font-size: 15px; padding: 12px; white-space: normal; }
#app:has(.entry) { min-height: 100dvh; display: flex; flex-direction: column; }
#app:has(.entry) > .bar { padding: 18px max(24px,calc((100vw - 1056px)/2)); }
#app:has(.entry) > .foot { margin-top: auto; background: var(--ink); padding: 28px 24px; border: 0; }
#app:has(.entry) > .foot a { color: #e1e1e4; display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 1100px) {
 .entry:has(.entry-evidence) .hero { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
 .entry:has(.entry-evidence) .hero > :not(.entry-evidence) { grid-column: 1; }
 .entry:has(.entry-evidence) h1 { font-size: 58px; }
 .entry-evidence { grid-column: 2; grid-row: 1 / 7; align-self: center; margin: 0; padding: 0; border: 0; }
}
@media (max-width: 600px) {
 .entry { padding: 32px 20px 40px; width: 100%; }.entry h1 { font-size: clamp(36px,10vw,48px); }
 .entry .start { gap: 12px; }.entry .start > .btn { width: 100%; font-size: 15px; }
 .entry .plans { grid-template-columns: 1fr; gap: 16px; }.subscription-plan { padding: 22px; }.subscription-plan:last-child { padding-top: 20px; }
 .entry .lede { font-size: 16px; }.entry .steps-list { font-size: 15px; }
 #app:has(.entry) > .bar { padding: 16px; gap: 8px; flex-wrap: wrap; }
 #app:has(.entry) .logo { font-size: 16px; }.entry-evidence { margin-top: 24px; }
 .entry .signature { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) { .entry *, #app:has(.entry) .bar * { transition: none; } }

/* ---- accounts, plan, projects (standard plan, 2026-10-06) ---- */
.navlink { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 8px; border-radius: 8px; }
.navlink:hover { color: var(--red); background: var(--bg-2); }
.bar .account { margin-inline-start: auto; flex-wrap: wrap; justify-content: flex-end; }
.auth { display: grid; place-items: start center; padding: 56px 20px 80px; min-height: 60vh; }
.auth-card { width: min(460px, 100%); }
.auth-card h1 { font-size: clamp(28px, 6vw, 36px); letter-spacing: -.02em; }
.auth-card .lede { font-size: 16px; }
.auth-form { display: grid; gap: 14px; margin: 22px 0 18px; }
.auth-form .btn { width: 100%; }
.big-input { min-height: 52px; font-size: 16px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-card > .btn { width: 100%; }
.small-print { font-size: 12px; color: var(--muted); margin-top: 22px; }
.h3 { font-size: 18px; margin: 22px 0 6px; }
.plan-card { border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 8px; padding: 26px; max-width: 560px; margin: 24px 0; }
.plan-name { font-weight: 800; font-size: 18px; margin: 0; }
.plan-card .plan-price { font-size: 40px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; }
.plan-card .plan-price small { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.or-price { display: block; font-size: 16px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.included { margin: 14px 0 20px; padding-inline-start: 20px; display: grid; gap: 4px; }
.plan-buttons .btn { flex: 1 1 200px; white-space: normal; }
.fine { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; margin-top: 16px; }
.enterprise-line { margin-top: 8px; }
.usage-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 8px 0 24px; display: grid; gap: 14px; max-width: 640px; }
.meter-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; margin-bottom: 6px; }
.meter-head span:first-child { font-weight: 700; }
.meter .bar-track { height: 6px; }
.meter.near .bar-fill { background: #c98a00; }
.meter.full .bar-fill { background: var(--red-dark); }
.usage-foot { margin: 0; font-size: 13px; color: var(--ink-2); }
.recent-card { position: relative; }
.recent-link { display: grid; gap: 4px; text-decoration: none; color: var(--ink); }
.recent-card .deletes { font-size: 12px; color: var(--muted); }
.recent-card.expiring { border-color: #e7b84a; background: #fffaf0; }
.recent-card .btn { justify-self: start; margin-top: 6px; }
.account-page { max-width: 760px; }
.panel-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 16px 0; display: grid; gap: 10px; justify-items: start; }
.panel-card .usage-card { border: 0; padding: 0; margin: 0; width: 100%; }
.panel-card .recent.data { width: 100%; }
.linkish { border: 0; background: none; padding: 0; color: var(--red); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.signal { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) {
  .hide-narrow { display: none; }
  .bar { padding: 10px 14px; gap: 8px; }
  .navlink { padding: 6px 4px; }
  .plan-card { padding: 20px; }
  .plan-card .plan-price { font-size: 34px; }
}
.sub-list { display: grid; gap: 12px; }
.sub-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.sub-card p { margin: 4px 0; word-break: break-word; }

/* templates and brand */
.brand-logo { position: absolute; object-fit: contain; pointer-events: none; z-index: 4; }
.logo-place { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 12px; align-items: center; margin: 8px 0; }
.logo-place-side { display: grid; gap: 6px; justify-items: start; }
.logo-picker { position: relative; width: 100%; max-height: 220px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; justify-self: center; }
.logo-picker .safe { position: absolute; border: 1px dashed #c5c7cf; border-radius: 4px; pointer-events: none; }
.logo-picker .spot { position: absolute; width: 30px; height: 22px; border: 1px solid var(--line); background: #fff; border-radius: 5px; cursor: pointer; padding: 0; z-index: 1; }
.logo-picker .spot.on { background: var(--red); border-color: var(--red); }
.logo-picker .spot:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.logo-picker .spot.top { top: 8%; } .logo-picker .spot.bottom { bottom: 8%; }
.logo-picker .spot.left { left: 8%; } .logo-picker .spot.right { right: 8%; } .logo-picker .spot.center { left: calc(50% - 15px); }
.btn.on { border-color: var(--red); color: var(--red-dark); background: var(--red-soft); }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.seg.wrap { flex-wrap: wrap; }
.new-video { margin-top: 8px; }
.tpl-picker { margin: 12px 0 4px; display: grid; gap: 8px; }
.tpl-picker h3 { font-size: 14px; margin: 6px 0 0; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tpl-grid.compact { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tpl-card { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.tpl-meta { display: grid; gap: 2px; min-width: 0; } .tpl-meta small { color: var(--muted); font-size: 12px; }
.tpl-pick { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; text-align: start; font-size: 13px; font-weight: 600; min-width: 0; }
.tpl-pick:hover, .tpl-pick:focus-visible { border-color: var(--red); }
.tpl-sketch { position: relative; margin: 0 auto; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; container-type: size; }
.tpl-pick .tpl-sketch, .tpl-card .tpl-sketch { max-width: 100%; }
.sk-tile { position: absolute; background: #dfe1e6; border-radius: 3px; }
.sk-caption { position: absolute; left: 50%; transform: translate(-50%, -50%); font-weight: 800; padding: .1em .4em; border-radius: .2em; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.tpl-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 28px; align-items: start; }
.tpl-preview-col { position: sticky; top: 76px; display: grid; gap: 6px; }
.tpl-form { display: grid; gap: 10px; min-width: 0; }
.tpl-form h3 { margin: 14px 0 0; font-size: 16px; }
.tpl-actions { margin-top: 12px; }
.asset-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.asset { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.asset img { width: 56px; height: 40px; object-fit: contain; background: var(--bg-2) repeating-conic-gradient(#eceef2 0% 25%, transparent 0% 50%) 50% / 12px 12px; border-radius: 6px; }
@media (max-width: 820px) {
  .tpl-editor { grid-template-columns: 1fr; }
  .tpl-preview-col { position: static; }
}
@media (max-width: 380px) { .logo-place { grid-template-columns: 1fr; } }
/* Staff lists: long account IDs and dates wrap instead of pushing the page sideways on phones. */
.render-head { flex-wrap: wrap; column-gap: 12px; }
.render-head > *, .renders code, .sub-card code, .access-admin code { min-width: 0; overflow-wrap: anywhere; }
/* Editor-only "Waiting" labels disappear while playing: playback shows exactly what exports. */
.stage.playing .tile:not(.tile-empty) .tile-badge { display: none; }
/* Directing controls (Layout panel) and the owner's usage summary. */
.direct { display: grid; gap: 10px; margin: 6px 0 4px; }
.direct .seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 1px; background: var(--line); }
.direct .seg button { min-width: 0; min-height: 40px; white-space: normal; line-height: 1.2; }
.direct-label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0; }
.owner-usage-list { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.usage-title { margin: 0; }
/* The canvas as a media target: open positions are clickable, the exact receiving tile is outlined while dragging. */
.tile-open { cursor: pointer; align-content: center; gap: 4px; text-align: center; }
.tile-open:hover, .tile-open:focus-visible { border-color: var(--red); background: #fff5f5; outline: none; }
.tile-open-hint { font-size: 11px; color: var(--ink-2); }
.stage.drop-over .tile { transition: none; }
.tile.drop-target, .tile.drop-next { outline: 3px solid var(--red); outline-offset: -3px; z-index: 6; }
.tile.drop-next { outline-style: dashed; }
.tile.drop-target::after, .tile.drop-next::after, .tile.tile-uploading::after { content: attr(data-drop); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--red); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tile.drop-next::after { background: rgba(0,0,0,.7); }
.tile.tile-uploading::after { content: attr(data-progress); background: rgba(0,0,0,.72); }
.capacity { font-size: 12px; color: var(--ink-2); flex-basis: 100%; }
/* The logo on the editor canvas: select, then drag; the dashed box is the platform-safe area it stays inside. */
.stage .brand-logo { pointer-events: auto; cursor: grab; touch-action: auto; outline: none; }
.stage .brand-logo.selected { outline: 2px solid var(--red); outline-offset: 2px; touch-action: none; }
.stage .brand-logo.dragging { cursor: grabbing; }
.safe-guide { position: absolute; border: 2px dashed rgba(215, 25, 32, .85); border-radius: 4px; pointer-events: none; z-index: 3; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .12); }
.layout-count { display: block; font-size: 10px; color: var(--ink-2); font-weight: 600; }

/* ---- library milestone: navigation, Projects home, Videos, Exports (2026-10-07) ---- */
.nav-links { display: flex; align-items: center; gap: 2px; min-width: 0; }
.navlink.active { color: var(--ink); background: var(--bg-2); }
.new-video-btn { white-space: nowrap; }
.avatar-link { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; flex: none; outline-offset: 2px; }
.avatar-link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-link.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--red); }
.formats { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.format-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); cursor: pointer; font-size: 14px; }
.format-chip.on { border-color: var(--red); background: var(--red-soft); }
.format-chip:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.format-shape { display: inline-block; height: 22px; border: 2px solid currentColor; border-radius: 3px; opacity: .75; }
.format-chip strong { font-variant-numeric: tabular-nums; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.templates-row { margin: 24px 0 32px; }
.start-templates { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tpl-pick small { font-weight: 400; font-size: 12px; line-height: 1.35; }
.list-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }
.list-toolbar .search { flex: 1 1 220px; min-width: 0; min-height: 44px; }
.list-toolbar .select { width: auto; min-height: 44px; }
.project-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.project-card { padding: 10px 10px 14px; align-content: start; }
.project-card.selected { border-color: var(--red); background: var(--red-soft); }
.card-thumb { position: relative; display: grid; place-items: center; width: 100%; max-height: 220px; border-radius: 8px; overflow: hidden; background: var(--bg-2); margin-bottom: 6px; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb-empty { color: var(--muted); font-size: 13px; font-weight: 700; }
.card-duration { position: absolute; inset-block-end: 6px; inset-inline-end: 6px; background: rgba(0,0,0,.72); color: #fff; font-size: 12px !important; font-weight: 700; padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.card-name { overflow-wrap: anywhere; }
.card-check { position: absolute; inset-block-start: 16px; inset-inline-start: 16px; width: 22px; height: 22px; z-index: 2; accent-color: var(--red); }
.card-menu { position: absolute; inset-block-start: 14px; inset-inline-end: 14px; z-index: 3; }
.card-menu summary { list-style: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.92); border: 1px solid var(--line); cursor: pointer; font-weight: 800; line-height: 1; }
.card-menu summary::-webkit-details-marker { display: none; }
.card-menu .menu { position: absolute; inset-inline-end: 0; top: 40px; min-width: 170px; display: grid; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.card-menu .menu button { text-align: start; background: none; border: 0; padding: 10px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; min-height: 40px; }
.card-menu .menu button:hover, .card-menu .menu button:focus-visible { background: var(--bg-2); }
.card-menu .menu button.danger { color: var(--red-dark); }
.rename-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rename-form .input { flex: 1 1 140px; min-width: 0; }
.bulk-bar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--red); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow); }
.bulk-bar span { font-weight: 700; margin-inline-end: auto; }
.pager { display: flex; gap: 8px; justify-content: center; margin: 18px 0 6px; flex-wrap: wrap; }
.pager:empty { display: none; }
.library .lead { color: var(--ink-2); max-width: 720px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lib-card { display: grid; gap: 6px; align-content: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.lib-card .row.wrap { flex-wrap: wrap; gap: 6px; }
.lib-media { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #111; display: grid; place-items: center; }
.lib-media video, .lib-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lib-audio { color: #fff; font-size: 40px; }
.linkish.small { font-size: 13px; }
.lib-logos { margin-top: 32px; }
.logo-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.logo-strip img { height: 56px; max-width: 140px; object-fit: contain; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.picker-dialog { width: min(480px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.picker-dialog::backdrop { background: rgba(10,10,20,.4); }
.picker-dialog .input { width: 100%; margin: 8px 0; }
.picker-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; margin-bottom: 10px; }
.picker-item { display: grid; gap: 2px; text-align: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; min-height: 48px; }
.picker-item:hover, .picker-item:focus-visible { border-color: var(--red); }
@media (max-width: 820px) {
  .bar .account { gap: 6px; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .bar:has(.nav-links) { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .new-video-btn { padding-inline: 10px; }
  .project-grid, .lib-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .project-card, .lib-card { padding: 8px; }
  .card-menu { inset-block-start: 10px; inset-inline-end: 10px; }
  .format-chip { padding-inline: 10px 12px; }
}
@media (max-width: 360px) { .project-grid, .lib-grid { grid-template-columns: 1fr; } }
.bulk-bar[hidden] { display: none; }
.section-head .list-toolbar { flex: 1 1 460px; justify-content: flex-end; margin: 0; }
.section-head .list-toolbar .search { flex: 0 1 320px; }
.sk-lt { position: absolute; transform: translate(-.35em, -50%); padding: .1em .35em; font-weight: 800; white-space: nowrap; line-height: 1.15; border-radius: .15em; max-width: 80%; overflow: hidden; text-overflow: ellipsis; }
.news-bar-section { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.news-bar-section summary { font-weight: 700; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.news-bar-fields { display: grid; gap: 8px; margin-top: 8px; }
.from-library { margin: 8px 0 4px; width: 100%; }
.lib-pick { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.lib-pick .muted { grid-column: 1; font-size: 12px; }
.lib-pick .btn { grid-column: 2; grid-row: 1 / span 2; }
.news-bar-section .check { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.picture-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar-big { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: var(--ink); color: #fff; font-size: 28px; font-weight: 700; flex: none; }
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }

/* ---- human editing (2026-10-07): timeline tools, pauses, waveforms, drag to reorder, overlay lane, canvas swap,
   sound tiles, speaking order, recorder ---- */
.timeline-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.timeline-bar .btn.small { min-height: 36px; }
.clip { touch-action: pan-x; user-select: none; -webkit-user-select: none; position: relative; }
.clip.gap { background: repeating-linear-gradient(135deg, var(--bg-2), var(--bg-2) 6px, #ececf0 6px, #ececf0 12px); border-style: dashed; }
.clip.gap .clip-head b { color: var(--muted); }
.clip.dragging { opacity: .55; cursor: grabbing; }
.clip.lifting { transform: translateY(-3px); box-shadow: var(--shadow); }
.clip-wave { display: block; width: 100%; height: 22px; color: var(--red); opacity: .55; }
.strip { position: relative; }
.drop-marker { position: absolute; top: -4px; bottom: -4px; width: 4px; border-radius: 2px; background: var(--red); pointer-events: none; z-index: 3; }
.overlay-lane { position: relative; height: 34px; margin-top: 6px; border-radius: 8px; background: var(--bg-2); }
.ov-item { position: absolute; top: 3px; bottom: 3px; display: flex; align-items: center; gap: 4px; padding: 0 2px; border-radius: 6px; background: #fff; border: 1px solid var(--line); overflow: hidden; touch-action: none; cursor: grab; min-width: 18px; }
.ov-item.selected { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.ov-item img { height: 24px; width: auto; max-width: 60px; object-fit: contain; pointer-events: none; }
.ov-edge { flex: none; width: 8px; align-self: stretch; cursor: ew-resize; background: var(--line); border-radius: 3px; }
.ov-item.selected .ov-edge { background: var(--red); }
.overlay-pic { position: absolute; z-index: 2; touch-action: none; cursor: grab; outline-offset: 2px; }
.overlay-pic img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.overlay-pic.selected { outline: 2px solid var(--red); }
.overlay-handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--red); border: 2px solid #fff; cursor: nwse-resize; display: none; }
.overlay-pic.selected .overlay-handle { display: block; }
.stage.playing .overlay-pic { outline: none; cursor: default; }
.stage.playing .overlay-handle { display: none; }
.tile-audio { background: #111; }
.tile-audio .viz { width: 100%; height: 100%; display: block; }
.tile-audio .viz-source { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.stage .tile { touch-action: manipulation; }
.stage .tile.lifting { transform: scale(.98); }
.stage .tile.swap-source { opacity: .6; outline: 2px dashed var(--red); }
.stage .tile.swap-target { outline: 3px solid var(--red); outline-offset: -3px; }
.tile-extras { display: grid; gap: 6px; margin-top: 6px; }
.tile-extras .check small { font-size: 12px; }
.select.small { min-height: 34px; padding-block: 2px; width: auto; }
.speaking-order { display: grid; gap: 8px; margin: 10px 0; }
.order-chips { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.order-chip { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: grab; min-height: 44px; }
.order-chip.dragging { opacity: .5; }
.order-chip .grip { color: var(--muted); letter-spacing: -2px; }
.order-chip b { color: var(--red); }
.order-chip .chip-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-chip .btn.small { min-width: 36px; min-height: 36px; padding: 0; }
.capture-row { margin: 8px 0 0; }
.recorder { width: min(640px, calc(100vw - 24px)); }
.rec-body { display: grid; gap: 10px; }
.rec-live, .rec-review video, .rec-review img { width: 100%; max-height: 52vh; background: #000; border-radius: 10px; display: block; object-fit: contain; }
.rec-review audio { width: 100%; }
.rec-status { font-variant-numeric: tabular-nums; margin: 0; }
.suggested { color: inherit; opacity: .85; font-weight: 600; }
.ov-pics { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.ov-pick { justify-items: center; text-align: center; }
.ov-pick img { width: 100%; height: 70px; object-fit: contain; background: var(--bg-2); border-radius: 6px; }
@media (max-width: 820px) {
  .timeline-bar .btn.small { min-height: 40px; }
  .ov-edge { width: 14px; }
}
.avatar-menu { position: relative; }
.avatar-menu summary { list-style: none; cursor: pointer; }
.avatar-menu summary::-webkit-details-marker { display: none; }
.avatar-menu .menu { position: absolute; inset-inline-end: 0; top: 42px; min-width: 210px; display: grid; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.avatar-menu .menu a, .avatar-menu .menu button { display: block; text-align: start; background: none; border: 0; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; min-height: 40px; }
.avatar-menu .menu a:hover, .avatar-menu .menu button:hover, .avatar-menu .menu a:focus-visible, .avatar-menu .menu button:focus-visible { background: var(--bg-2); }
.avatar-menu .menu-email { margin: 4px 12px 6px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

/* ---- milestone completion: home quick start, pager, library summary, previews, recorder countdown, drops ---- */
.format-chip { align-items: center; text-align: start; }
.format-text { display: grid; line-height: 1.2; }
.format-text small { color: var(--muted); font-size: 12px; font-weight: 500; }
.quick-start { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -14px 0 8px; }
.card-exported { position: absolute; inset-block-end: 6px; inset-inline-start: 6px; background: rgba(4, 120, 87, .92); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.untitled-when { font-weight: 500; color: var(--muted); font-size: 12px; }
.pager { align-items: center; }
.pager-n { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 5em; text-align: center; }
.library-summary { display: grid; gap: 24px; margin-top: 40px; }
.lib-grid.compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.lib-card.mini { padding: 6px; gap: 4px; text-decoration: none; color: var(--ink); font-size: 13px; }
.lib-card { position: relative; }
.lib-preview { all: unset; display: block; cursor: pointer; border-radius: 8px; }
.lib-preview:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.watch-dialog { width: min(900px, calc(100vw - 24px)); }
.watch-dialog video, .watch-dialog img { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; display: block; object-fit: contain; }
.watch-dialog audio { width: 100%; }
.rec-stage { position: relative; }
.rec-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; font-weight: 800; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); pointer-events: none; }
.rec-count[hidden] { display: none; }
.rec-modes { flex-wrap: wrap; }
.still-host { position: fixed; left: -10000px; top: 0; width: 640px; pointer-events: none; opacity: 0; }
.still-host .stage { width: 640px; }
.clip.drop-into { outline: 3px solid var(--red); outline-offset: -3px; background: var(--red-soft); }
.lane-hint { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); pointer-events: none; padding: 0 8px; text-align: center; }
.overlay-lane.drop-over { outline: 2px dashed var(--red); }
body.dragging-media .overlay-lane, body.dragging-media .timeline .lane { outline: 1px dashed var(--line); }
.tile-moves .btn.small { min-width: 36px; min-height: 36px; padding: 0; }
.media-item[draggable="true"] { cursor: grab; }
@media (max-width: 820px) { .editor-bar .save-template { display: none; } }
/* The overlay's edges are drag handles at its two ends (wider on touch). */
.ov-item { padding: 0 12px; }
.ov-edge { position: absolute; top: 0; bottom: 0; width: 10px; border-radius: 3px; }
.ov-edge.l { left: 0; }
.ov-edge.r { right: 0; }
@media (pointer: coarse) { .ov-item { padding: 0 18px; } .ov-edge { width: 16px; } }
/* Closed menus take no space (a closed <details> keeps a layout box in Chrome, only unpainted). */
.avatar-menu:not([open]) .menu, .card-menu:not([open]) .menu { display: none; }
/* Sketch texts wrap inside the sketch instead of running past it. */
.tpl-sketch .sk-caption { white-space: normal; max-width: 92%; overflow-wrap: anywhere; }
.tpl-sketch .sk-lt { white-space: normal; max-width: 72%; overflow-wrap: anywhere; }
.list-toolbar .select { min-width: 13.5em; } /* fits the longest sort label in every language, with its arrow */
@media (max-width: 1180px) { .editor-bar .save-template { display: none; } }
@media (max-width: 820px) {
  /* The account bar takes its own full row and may shrink; its links scroll inside it (long labels, e.g. Spanish). */
  .bar:has(.nav-links) .account { flex: 1 1 100%; min-width: 0; }
  .nav-links { min-width: 0; }
}
/* Speaking-order chips shrink with the panel: long file names are cut short inside the chip, never widening it. */
.speaking-order, .order-chips { grid-template-columns: minmax(0, 1fr); }
.order-chip { min-width: 0; }
@media (max-width: 820px) {
  /* Narrow screens: the four links wrap onto a second line rather than hiding behind a sideways scroll. */
  .nav-links { flex-wrap: wrap; overflow: visible; row-gap: 2px; }
}
/* Export progress: the card in the Export panel and the dock shown on every other tab (and on phones). The moving
   stripes mean "working, position not known yet" — a percentage appears only once the renderer reports one. */
.export-job { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; background: var(--bg); }
.export-job.done { border-color: var(--red); }
.export-job.failed { border-color: var(--red-dark); }
.export-job .export-detail { color: var(--muted); font-variant-numeric: tabular-nums; }
.export-elapsed { font-variant-numeric: tabular-nums; }
.bar-track.indeterminate .bar-fill { width: 40%; animation: export-stripe 1.2s ease-in-out infinite; }
@keyframes export-stripe { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.export-dock { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: min(380px, calc(100vw - 32px)); box-shadow: var(--shadow); border-radius: 12px; background: var(--bg); }
.export-dock[hidden] { display: none; }
.export-dock .export-job { padding-right: 36px; }
.export-dock .dock-close { position: absolute; top: 4px; right: 4px; min-width: 32px; padding: 4px 8px; }
.export-dock .dock-open { position: absolute; top: 8px; right: 40px; padding: 2px 8px; font-size: 12px; display: none; }
/* Phones: a compact pill under the header — never over the timeline or the tab bar; a tap opens the Export sheet. */
.export-dock.compact { top: calc(64px + env(safe-area-inset-top)); bottom: auto; left: auto; right: 12px; width: auto; max-width: calc(100vw - 24px); border-radius: 999px; cursor: pointer; }
.export-dock.compact .export-job { padding: 6px 40px 6px 14px; border-radius: 999px; gap: 4px; }
.export-dock.compact .export-job > :not(.render-head):not(.bar-track) { display: none; }
.export-dock.compact .render-head { gap: 10px; font-size: 13px; }
.export-dock.compact .bar-track { height: 3px; }
.export-dock.compact .dock-open { display: none; }
.export-dock.compact .dock-close { top: 50%; transform: translateY(-50%); padding: 2px 8px; }
@media (prefers-reduced-motion: reduce) { .bar-track.indeterminate .bar-fill { animation: none; width: 100%; opacity: .35; } }
.export-dock.in-panel { position: relative; right: auto; bottom: auto; width: auto; box-shadow: none; margin: 0 0 10px; z-index: auto; }
/* The app's own confirmation dialog (never the browser's). */
.app-dialog { border: 0; border-radius: var(--radius); padding: 24px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(20,20,30,.25); color: var(--ink); background: var(--bg); }
.app-dialog::backdrop { background: rgba(20,20,30,.45); }
.app-dialog h2 { margin: 0 0 10px; }
.app-dialog p { white-space: pre-line; color: var(--ink-2); line-height: 1.5; margin: 0 0 20px; }
.app-dialog .dialog-actions { justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.app-dialog .btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.project-card.deleting { opacity: .45; pointer-events: none; transition: opacity .2s; }
/* Replace media */
.replace-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.replace-dialog h3 { margin: 18px 0 8px; font-size: 14px; color: var(--ink-2); }
.replace-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.replace-pick { display: grid; gap: 2px; text-align: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font: inherit; color: var(--ink); }
.replace-pick:hover, .replace-pick:focus-visible { border-color: var(--red); }
.replace-pick strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replace-pick small { color: var(--muted); }
.replace-choice { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; margin: 0 0 12px; }
.replace-choice legend { padding: 0 4px; }
.replace-notes { margin: 0 0 12px; padding-inline-start: 18px; color: var(--ink-2); }
.tile-edit .replace-media { justify-self: start; }

/* Metered-spending lock (src/studio/spendlock.ts): one calm notice; uploads, recording and export shown as unavailable. */
.paused-notice { display: grid; gap: 4px; margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; background: #fff8e6; border: 1px solid #f0d58c; border-inline-start: 4px solid #c99700; color: var(--ink); }
.paused-notice strong { font-size: 15px; }
.paused-notice p { margin: 0; font-size: 14px; color: var(--ink-2); }
.paused-notice .paused-sub { font-size: 13px; }
.editor-bar + .paused-notice { margin: 0; border-radius: 0; border-inline: 0; border-top: 0; padding: 8px 20px; }
.editor-bar + .paused-notice p { font-size: 13px; }
.drop.drop-paused { cursor: default; border-style: solid; border-color: var(--line); background: var(--bg-2); }
.drop.drop-paused:hover { border-color: var(--line); background: var(--bg-2); }
.stage-empty.stage-paused { cursor: default; }

/* Export on this device (studio/src/localexport.ts). */
.local-export { display: grid; gap: 10px; padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.local-export h3 { margin: 0; }
.local-export .notice ul { margin: 6px 0 0; padding-inline-start: 18px; }
.local-progress { display: grid; gap: 8px; }
.local-progress p { margin: 0; }
.local-actions { display: grid; gap: 10px; justify-items: start; }
.cloud-export-title { margin: 4px 0 0; }

/* Media from this device (studio/src/localfiles.ts). */
.device-badge { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #e8f3ec; color: #1d6b3a; }
.device-badge.missing { background: #fdecea; color: #a1281c; }
.device-alert { padding: 8px 20px; background: #eef4ff; border-bottom: 1px solid #c9d8f5; font-size: 14px; }
.device-alert p { margin: 4px 0; }
.device-alert ul { margin: 4px 0; padding-inline-start: 18px; }

/* Transitions in the preview (model.ts fadeAt): a veil over the scene, under the logo. */
.fade-veil { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.caption-effects, .music-box { margin-top: 8px; }
.music-box { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.correct-box { display: grid; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.correct-box h4 { margin: 0; }
.correct-box .input[type=number] { width: 90px; }

/* Dissolve in the preview (preview.ts syncUnder): the previous scene under this one, which fades in over it. */
.scene-bg { position: absolute; inset: 0; pointer-events: none; }
.dissolve-under { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.dissolve-under .u-tile { position: absolute; overflow: hidden; }
.dissolve-under .u-tile video, .dissolve-under .u-tile img { width: 100%; height: 100%; display: block; }

/* ---- the timeline you can grab (2026-10-28): zoomable track, ruler, trim handles, snapping, selection, lanes, "+"
   between clips, right-click menus, toast with Undo, text on the canvas. Same tokens as the rest of the editor. */
.timeline { overflow: visible; padding: 10px 10px 8px; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; padding: 12px 12px 6px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.tl-track { position: relative; min-width: 100%; padding-top: 2px; }
.tl-ruler { position: relative; height: 24px; margin-bottom: 4px; cursor: ew-resize; border-bottom: 1px solid var(--line); touch-action: none; user-select: none; -webkit-user-select: none; }
.timeline.select-mode .tl-ruler, .timeline.select-mode .clip { cursor: crosshair; }
.tl-ruler .tick { position: absolute; bottom: 0; width: 1px; height: 5px; background: #cfd1d8; pointer-events: none; }
.tl-ruler .tick.major { height: 9px; background: #a9acb5; }
.tl-ruler .tick i { position: absolute; bottom: 9px; left: 3px; font-style: normal; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-track .lane { cursor: default; height: 86px; }
.tl-track .strip { position: relative; display: block; height: 100%; min-height: 0; }
.tl-track .clip { position: absolute; top: 0; bottom: 0; min-width: 6px; flex: none; padding: 6px 12px; border-radius: 9px; transition: box-shadow .12s ease, background .12s ease; }
.tl-track .clip::after { content: ""; position: absolute; inset: 0 auto 0 -2px; width: 2px; background: var(--bg); pointer-events: none; } /* a hairline between neighbouring clips */
.tl-track .clip:hover { box-shadow: 0 0 0 1px #cfd1d8, var(--shadow); }
.tl-track .clip.selected { box-shadow: inset 0 0 0 2px var(--red), 0 4px 14px rgba(215,25,32,.14); }
.tl-track .clip.trimming { z-index: 4; box-shadow: inset 0 0 0 2px var(--red), 0 6px 18px rgba(215,25,32,.2); }
.tl-track .clip.muted .clip-wave { opacity: .18; }
.clip-speed { font-style: normal; margin-inline-start: 6px; padding: 0 5px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 10px; }
/* Trim handles: a grip on each edge; large enough for a finger. */
.trim-h { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 2; touch-action: none; display: grid; place-items: center; opacity: 0; transition: opacity .12s ease; }
.trim-h.l { left: 0; border-radius: 9px 0 0 9px; }
.trim-h.r { right: 0; border-radius: 0 9px 9px 0; }
.trim-h::before { content: ""; width: 3px; height: 26px; border-radius: 2px; background: var(--red); box-shadow: 0 0 0 2px #fff; }
.clip:hover .trim-h, .clip.selected .trim-h, .clip.trimming .trim-h { opacity: 1; }
.trim-h:hover { background: rgba(215,25,32,.10); }
/* The playhead spans every lane; its knob (and the whole line) can be grabbed. */
.tl-track .playhead { top: 0; bottom: 0; z-index: 6; }
.tl-track .playhead::before { top: 8px; left: -6px; border-width: 7px; }
.ph-grab { position: absolute; top: 0; left: -9px; width: 20px; height: 24px; pointer-events: auto; cursor: grab; touch-action: none; }
.ph-grab:active { cursor: grabbing; }
.ph-grab::after { content: ""; position: absolute; left: 3px; top: 2px; width: 14px; height: 14px; border-radius: 4px 4px 7px 7px; background: var(--red); box-shadow: 0 1px 4px rgba(215,25,32,.4); }
/* Magnetic snapping: a thin line where the edge (or playhead) caught. */
.tl-snap { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed #f5a623; z-index: 7; pointer-events: none; }
.tl-snap::before { content: ""; position: absolute; top: 2px; left: -5px; width: 8px; height: 8px; border-radius: 50%; background: #f5a623; }
.tl-drop { position: absolute; top: 24px; bottom: 0; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--red); z-index: 7; pointer-events: none; box-shadow: 0 0 0 3px rgba(215,25,32,.18); }
.tl-tip { position: fixed; z-index: 120; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 8px; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); }
.tl-tip:empty { display: none; }
/* A selected stretch across all lanes; drag its handle (in the ruler) to move it. */
.tl-range { position: absolute; top: 0; bottom: 0; z-index: 5; background: rgba(215,25,32,.08); border-left: 2px solid var(--red); border-right: 2px solid var(--red); pointer-events: none; }
.tl-range.moving { background: rgba(215,25,32,.16); box-shadow: 0 10px 30px rgba(215,25,32,.2); }
.tl-range-grip { position: absolute; top: 1px; left: 50%; transform: translateX(-50%); pointer-events: auto; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border: 0; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; cursor: grab; touch-action: none; white-space: nowrap; box-shadow: 0 2px 8px rgba(215,25,32,.35); }
.tl-range-grip:active { cursor: grabbing; }
.tl-rangebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; padding: 6px 8px; border-radius: 10px; background: var(--red-soft); font-size: 13px; }
.tl-rangebar strong { font-variant-numeric: tabular-nums; }
.tl-rangebar .select.small { width: auto; min-height: 32px; padding: 4px 8px; }
/* "+" at every clip edge: insert something exactly there. */
.tl-plus { position: absolute; top: -11px; z-index: 6; width: 22px; height: 22px; margin-left: -11px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: var(--ink); color: #fff; font-size: 15px; font-weight: 700; line-height: 1; display: grid; place-items: center; cursor: pointer; opacity: 0; transform: scale(.8); transition: opacity .12s ease, transform .12s ease, background .12s ease; box-shadow: var(--shadow); }
.tl-track .lane:hover .tl-plus, .tl-plus:focus-visible { opacity: 1; transform: none; }
.tl-plus:hover { background: var(--red); transform: scale(1.12); }
/* lanes under the clips */
.tl-track .overlay-lane, .text-lane { position: relative; height: 32px; margin-top: 6px; border-radius: 8px; background: var(--bg-2); padding-inline-start: 0; }
.lane-label { position: sticky; left: 0; z-index: 1; display: inline-grid; place-items: center; width: 20px; height: 100%; font-size: 11px; font-weight: 800; color: var(--muted); pointer-events: none; }
.tx-item { position: absolute; top: 3px; bottom: 3px; display: flex; align-items: center; padding: 0 12px; border-radius: 6px; background: #fff; border: 1px solid var(--line); overflow: hidden; touch-action: none; cursor: grab; min-width: 18px; font-size: 11px; font-weight: 700; color: var(--ink-2); box-shadow: inset 3px 0 0 #6b5bd6; }
.tx-item.selected, .ov-item.selected { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.tx-item.dragging, .ov-item.dragging { z-index: 3; box-shadow: var(--shadow); cursor: grabbing; }
.tx-name, .ov-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ov-name { font-size: 11px; color: var(--ink-2); }
.tx-item .ov-edge { background: transparent; }
.tx-item.selected .ov-edge, .tx-item:hover .ov-edge { background: rgba(107,91,214,.25); }
/* An empty timeline: one big place to start. */
.tl-empty { display: grid; justify-items: center; gap: 4px; width: 100%; padding: 22px 16px; border: 2px dashed #d6d7dd; border-radius: var(--radius); background: var(--bg-2); color: var(--ink-2); cursor: pointer; text-align: center; transition: border-color .12s ease, background .12s ease; }
.tl-empty:hover, .tl-empty.over { border-color: var(--red); background: var(--red-soft); }
.tl-empty strong { font-size: 17px; color: var(--ink); }
.tl-empty-plus { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; font-size: 24px; font-weight: 700; margin-bottom: 4px; box-shadow: 0 6px 16px rgba(215,25,32,.3); }
/* toolbar */
.timeline-bar { align-items: center; }
.tl-select.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tl-zoom-box { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.tl-zoom-box .btn.ghost { font-size: 16px; min-height: 32px; padding: 2px 8px; }
.tl-zoom { width: 110px; accent-color: var(--red); }
/* right-click menus */
.ctx-menu { position: fixed; z-index: 130; color: var(--ink); min-width: 220px; max-width: min(320px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; padding: 6px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(20,20,30,.08), 0 18px 48px rgba(20,20,30,.18); backdrop-filter: blur(8px); animation: ctx-in .09s ease-out; }
@keyframes ctx-in { from { transform: translateY(-3px) scale(.98); } to { transform: none; } }
.ctx-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 10px 6px 8px; border: 0; border-radius: 8px; background: transparent; text-align: start; cursor: pointer; font-size: 14px; color: var(--ink); }
.ctx-item:hover:not(:disabled), .ctx-item:focus-visible, .ctx-item.open { background: var(--bg-2); outline: none; }
.ctx-item:focus-visible { box-shadow: inset 0 0 0 2px rgba(215,25,32,.35); }
.ctx-item:disabled { opacity: .4; cursor: default; }
.ctx-item.danger { color: var(--red-dark); }
.ctx-item.danger:hover:not(:disabled) { background: var(--red-soft); }
.ctx-icon { text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); }
.ctx-item.danger .ctx-icon { color: var(--red-dark); }
.ctx-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-key { font: 11px/1 var(--font); color: var(--muted); letter-spacing: .02em; }
.ctx-sep { height: 1px; margin: 5px 6px; background: var(--line); }
/* toast with an action (Undo) */
.toast { display: flex; align-items: center; gap: 14px; border-radius: 12px; padding: 10px 12px 10px 18px; animation: toast-in .16s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast-action { border: 0; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.toast-action:hover { background: rgba(255,255,255,.26); }
/* texts on the canvas: grab, move, resize */
.stage .overlay-text.editable { pointer-events: auto; cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage .overlay-text.editable:hover { outline: 1.5px dashed rgba(255,255,255,.9); outline-offset: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.stage .overlay-text.editable.selected { outline: 2px solid var(--red); outline-offset: 3px; z-index: 2; }
.stage .overlay-text.dragging { opacity: .92; }
.text-handle { position: absolute; right: -9px; bottom: -9px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--red); cursor: nwse-resize; display: none; }
.overlay-text.selected .text-handle { display: block; }
.stage.playing .overlay-text.editable { outline: none; cursor: default; }
.stage.playing .text-handle { display: none; }
/* speed, voice-over, translation, export options, AI bar */
.speed-seg button { min-width: 52px; font-variant-numeric: tabular-nums; }
.vo-box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
.vo-box summary { cursor: pointer; font-weight: 700; }
.vo-box[open] { display: grid; gap: 8px; }
.tr-box { margin-top: 16px; }
.export-opts { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; display: grid; gap: 6px; }
.export-opts legend { font-weight: 700; font-size: 13px; padding: 0 4px; }
.ai-bar { display: flex; align-items: center; gap: 8px; padding: 8px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--red-soft), var(--bg) 60%); }
.ai-bar[hidden] { display: none; }
.ai-spark { color: var(--red); font-size: 18px; }
.ai-input { flex: 1; border-radius: 999px; }
.ai-bar.busy { opacity: .6; pointer-events: none; }
@media (pointer: coarse) {
  .trim-h { width: 18px; opacity: 1; }
  .trim-h::before { height: 30px; width: 4px; }
  .tl-plus { opacity: 1; transform: none; width: 26px; height: 26px; margin-left: -13px; top: -13px; }
  .tx-item { padding: 0 18px; }
  .ctx-item { min-height: 44px; font-size: 15px; }
  .ctx-item:not(.has-sub) .ctx-key { display: none; } /* no keyboard shortcuts on a touch screen */
  .ph-grab { left: -14px; width: 30px; }
}
@media (max-width: 820px) {
  .tl-track .lane { height: 78px; }
  .tl-zoom { width: 80px; }
  .tl-zoom-box { margin-inline-start: 0; }
  .ai-bar { padding: 8px 12px; }
  .tl-rangebar { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .ctx-menu, .toast { animation: none; } }
.tl-fit[hidden] { display: none; }
/* Sub-menus (Speed ▸): the same solid surface as the menu, above it; no entrance fade (never see-through). */
.ctx-menu.sub { z-index: 131; min-width: 160px; animation: none; opacity: 1; }
.ctx-item.has-sub.open .ctx-key { color: var(--ink); }
.ctx-inline { margin: 2px 0 4px 26px; padding-left: 6px; border-left: 2px solid var(--line); }
.ctx-inline .ctx-item { min-height: 40px; }
.ctx-item { -webkit-tap-highlight-color: transparent; }
.ctx-item.has-sub[aria-expanded="true"] .ctx-key { display: inline-block; transform: rotate(90deg); }
/* The playhead: a big red head on the ruler you grab and drag, its line through every lane. */
.tl-track .playhead { width: 2px; margin-left: -1px; box-shadow: 0 0 0 .5px rgba(255,255,255,.8); }
.tl-track .playhead::before { display: none; }
.ph-grab { top: -2px; left: -12px; width: 26px; height: 30px; }
.ph-grab::after { left: 2px; top: 0; width: 22px; height: 22px; border-radius: 6px 6px 11px 11px; background: var(--red); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(215,25,32,.45); }
.ph-grab:hover::after { transform: scale(1.08); }
/* The thin bar under the video is secondary: the timeline is the control. */
.transport .scrub { height: 4px; opacity: .55; accent-color: var(--red); }
/* Empty spaces are objects: hatched, with what you can do. */
.clip.gap { border-color: #cfd1d8; }
.clip.gap:hover { border-color: var(--ink-2); }
.gap-hint { font-size: 11px; color: var(--ink-2); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.clip.gap.selected .gap-hint { color: var(--ink); }
.tl-endchip { position: absolute; bottom: 6px; right: 6px; z-index: 6; max-width: calc(100% - 12px); padding: 4px 10px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; box-shadow: var(--shadow); }
.tl-endchip:hover { background: var(--red); }
@media (pointer: coarse) { .ph-grab { left: -16px; width: 34px; height: 34px; } }
/* Voice-over from text: progress and errors stay in the panel (never only a passing toast). */
.vo-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.vo-status[hidden] { display: none; }
.vo-status.bad { color: var(--red-dark); background: var(--red-soft); border-radius: 8px; padding: 8px 10px; }
.vo-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--red); animation: vo-spin .9s linear infinite; }
@keyframes vo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vo-spin { animation: none; } }
