/* 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-bottom: 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); }
/* The audio lane (voice-overs and sounds over the video), right under the clips. */
.tl-track .audio-lane { position: relative; height: 38px; margin-top: 6px; border-radius: 8px; background: #eef7f6; }
.audio-lane.drop-over { outline: 2px dashed #0f766e; }
body.dragging-media .audio-lane { outline: 1px dashed #99c9c3; }
.au-item { position: absolute; top: 3px; bottom: 3px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 6px; background: #d5efeb; border: 1px solid #8cc9c0; overflow: hidden; touch-action: none; cursor: grab; min-width: 18px; font-size: 11px; font-weight: 700; color: #134e48; }
.au-item.vo { background: #cdeee8; box-shadow: inset 3px 0 0 #0f766e; }
.au-item.muted { background: #eceef1; border-color: #c7cbd3; color: var(--muted); }
.au-item.past-end { border-right-style: dashed; }
.au-item.selected { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.au-item.dragging { z-index: 3; box-shadow: var(--shadow); cursor: grabbing; }
.au-wave { position: absolute; inset: 4px 0; width: 100%; height: calc(100% - 8px); opacity: .55; pointer-events: none; }
.au-name { position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; pointer-events: none; }
.au-vol { position: relative; margin-inline-start: auto; font-variant-numeric: tabular-nums; font-weight: 600; pointer-events: none; }
.au-item .ov-edge { z-index: 1; background: transparent; }
.au-item.selected .ov-edge, .au-item:hover .ov-edge { background: rgba(15,118,110,.3); }
@media (pointer: coarse) { .au-item { padding: 0 18px; } }
.au-bar { background: #eef7f6; }
.au-bar .au-field { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; }
.au-bar input[type=range] { width: 110px; }
.au-pct { min-width: 38px; font-variant-numeric: tabular-nums; }
.au-title { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-sep { flex-basis: 100%; height: 0; }
.au-bar .btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.vo-standalone { margin: 6px 0; font-size: 13px; }
/* 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; }
.ai-box[hidden] { display: none; }
.ai-box { border-bottom: 1px solid var(--line); }
.ai-box .ai-bar { border-bottom: 0; }
.ai-chips { display: flex; gap: 6px; padding: 0 20px 8px 46px; overflow-x: auto; scrollbar-width: none; }
.ai-chips[hidden] { display: none; }
.ai-chips .chip, .ai-choices .chip { flex: none; border: 1px solid var(--line); background: var(--bg); color: inherit; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.ai-chips .chip:hover, .ai-choices .chip:hover { border-color: var(--red); color: var(--red); }
.ai-status { position: relative; margin: 0 20px 10px 46px; padding: 10px 40px 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 14px; }
.ai-status[hidden] { display: none; }
.ai-status p { margin: 0 0 6px; }
.ai-x { position: absolute; inset-inline-end: 6px; top: 6px; }
.ai-steps { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0; padding: 0; color: var(--muted, #777); }
.ai-steps li.done { color: inherit; }
.ai-steps li.now { color: var(--red); font-weight: 600; }
.ai-steps li.now::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; border-radius: 50%; background: var(--red); animation: ai-pulse 1s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .ai-steps li.now::before { animation: none; } }
.ai-done { font-weight: 600; }
.ai-err { color: var(--red); }
.ai-actions, .ai-choices, .ai-free { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.ai-free .input { flex: 1; min-width: 160px; }
.ai-story { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.ai-story h3 { margin: 0 0 4px; font-size: 17px; }
.ai-story ul { margin: 6px 0; padding-inline-start: 18px; }
.ai-story li { margin: 4px 0; }
@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; }
  .ai-chips { padding: 0 12px 8px; }
  .ai-status { margin: 0 12px 10px; }
  .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; } }

/* Speech to text (2026-11-20): one big, unmistakable record button, a sound level bar, the words. */
.stt-dialog { width: min(560px, calc(100vw - 32px)); }
.stt-body { display: grid; gap: 12px; }
.stt-big { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 64px; border: 0; border-radius: 14px; background: #c8102e; color: #fff; font: 800 1.15rem/1.2 system-ui, sans-serif; cursor: pointer; box-shadow: 0 6px 18px rgba(200,16,46,.28); }
.stt-big:hover:not(:disabled) { background: #a50d26; }
.stt-big:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.stt-big--stop { background: #16120f; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.stt-dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; flex: none; }
.stt-big--stop .stt-dot { border-radius: 3px; animation: stt-pulse 1s ease-in-out infinite; }
@keyframes stt-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .stt-big--stop .stt-dot { animation: none; } }
.stt-meter { height: 10px; border-radius: 999px; background: var(--line, #e5e1da); overflow: hidden; }
.stt-level { height: 100%; width: 0; background: linear-gradient(90deg, #1f9d55, #f2c230 70%, #c8102e); transition: width .08s linear; }
.stt-status { margin: 0; font-weight: 600; }
.stt-text { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--line, #d9d3ca); border-radius: 10px; font: 400 1rem/1.5 Georgia, serif; resize: vertical; }
.stt-open--wide { width: 100%; margin-bottom: 10px; }
.stt-live { min-height: 4.5em; max-height: 10em; overflow-y: auto; padding: 10px 12px; border-radius: 10px; background: #fbf8f3; border: 1px dashed var(--line, #d9d3ca); font: 400 1rem/1.5 Georgia, serif; color: #16120f; }

/* ==== Studio (2026-11-21): capture in the top bar, drop anywhere, filmstrips, playhead chip, shortcuts, preview view
   tools (grid, full screen), tab icons, refined buttons and panels, dark Studio theme. Same red accent and tokens. ==== */
:root { --red-fill: #d71920; --chip: #15161a; --chip-ink: #fff; --ease: cubic-bezier(.2, .7, .2, 1); --ring: 0 0 0 3px rgba(215,25,32,.28); }

/* buttons: one system (height, radius, weight), quiet hover lift, a clear focus ring */
.btn { border-radius: 10px; transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease); }
.btn.primary { background: var(--red-fill); border-color: var(--red-fill); box-shadow: 0 1px 2px rgba(215,25,32,.25), 0 4px 12px rgba(215,25,32,.18); }
.btn.primary:hover { box-shadow: 0 2px 4px rgba(215,25,32,.3), 0 8px 18px rgba(215,25,32,.22); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.small { border-radius: 8px; }
.btn:focus-visible, .tab:focus-visible, .qa:focus-visible, .view-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn .icon svg { width: 18px; height: 18px; }

/* top bar: Record · Speech to text · Add media, next to the title */
.editor-bar { gap: 10px; }
.bar-quick { display: flex; align-items: center; gap: 6px; flex: none; }
.qa { gap: 6px; min-height: 36px; padding: 6px 12px; font-size: 13px; }
.qa-ic { display: inline-grid; place-items: center; width: 18px; height: 18px; font-size: 14px; line-height: 1; }
.qa-record { border-color: rgba(215,25,32,.35); color: var(--red-dark); }
.qa-record .qa-ic { color: var(--red); font-size: 13px; animation: qa-live 2.4s ease-in-out infinite; }
@keyframes qa-live { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.qa-record:hover { background: var(--red-soft); border-color: var(--red); }
.qa-add .qa-ic { font-size: 18px; font-weight: 700; }
.editor-bar .save-template { font-size: 14px; }
@media (min-width: 821px) { .editor-bar .name { min-width: 100px; } }
/* Laptop widths share the header with the format, undo / redo, language and Export: where the words don't fit (the
   editor measures it, in every language), Speech to text and Add media become icons, then Record too (named on hover
   and to screen readers); under 900 px all three are icons. */
.editor-bar.qa-compact .qa-stt .qa-label, .editor-bar.qa-compact .qa-add .qa-label, .editor-bar.qa-icons .qa-label { display: none; }
.editor-bar.qa-compact .qa-stt, .editor-bar.qa-compact .qa-add, .editor-bar.qa-icons .qa { padding: 6px 9px; }
@media (max-width: 1024px) and (min-width: 821px) { .editor-bar .bar-actions .lang-select { display: none; } }
@media (max-width: 900px) and (min-width: 821px) { .qa-label, .editor-bar .save-state { display: none; } .qa { padding: 6px 9px; } }
@media (max-width: 820px) {
  /* phones: the three capture buttons get their own row under the title, with their words */
  .editor-bar .bar-quick { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .editor-bar .qa { min-height: 38px; padding: 4px 6px; font-size: 12px; white-space: normal; line-height: 1.15; }
}

/* preview view tools: grid, full screen, dark theme */
.view-tools { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.view-btn { min-height: 34px; min-width: 34px; padding: 4px 7px; color: var(--ink-2); }
.view-btn.on { background: var(--red-soft); color: var(--red); border-color: transparent; }
.stage-wrap { position: relative; }
.fs-bar { display: none; }
.stage-wrap.is-full { background: #000; padding: 24px 24px 84px; container-type: size; }
.stage-wrap.is-full .stage { width: min(100cqw, calc(100cqh * var(--ar, 1.7778))); border-radius: 0; box-shadow: none; }
.stage-wrap.faux-full { position: fixed; inset: 0; z-index: 200; min-height: 0; }
.stage-wrap.is-full .fs-bar { display: flex; align-items: center; gap: 14px; position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 8px 10px 8px 8px; border-radius: 999px; background: rgba(20,20,26,.82); color: #fff; backdrop-filter: blur(8px); box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.fs-time { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 110px; }
.fs-bar .fs-exit { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.fs-bar .fs-exit:hover { background: rgba(255,255,255,.12); }
/* thirds grid, centre cross and the platform-safe area over the video (never in the export) */
.stage.show-guides::before { content: ""; position: absolute; z-index: 8; pointer-events: none; left: var(--safe-l, 5%); right: var(--safe-r, 5%); top: var(--safe-t, 5%); bottom: var(--safe-b, 5%); border: 1.5px dashed rgba(255,214,10,.85); border-radius: 4px; }
.stage.show-guides::after { content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(33.333% - .5px), rgba(255,255,255,.55) calc(33.333% - .5px), rgba(255,255,255,.55) calc(33.333% + .5px), transparent calc(33.333% + .5px)),
    linear-gradient(to right, transparent calc(66.666% - .5px), rgba(255,255,255,.55) calc(66.666% - .5px), rgba(255,255,255,.55) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
    linear-gradient(to bottom, transparent calc(33.333% - .5px), rgba(255,255,255,.55) calc(33.333% - .5px), rgba(255,255,255,.55) calc(33.333% + .5px), transparent calc(33.333% + .5px)),
    linear-gradient(to bottom, transparent calc(66.666% - .5px), rgba(255,255,255,.55) calc(66.666% - .5px), rgba(255,255,255,.55) calc(66.666% + .5px), transparent calc(66.666% + .5px));
  filter: drop-shadow(0 0 1px rgba(0,0,0,.6)); }
/* alignment guides while a picture or text is dragged */
.align-guide { position: absolute; z-index: 9; pointer-events: none; background: #ff2d8a; box-shadow: 0 0 0 .5px rgba(255,255,255,.6); }
.align-guide.align-v { top: 0; bottom: 0; width: 1px; margin-left: -.5px; }
.align-guide.align-h { left: 0; right: 0; height: 1px; margin-top: -.5px; }
.align-guide.centre { background: #00d2ff; }
/* resize handles: bigger, always visible on a selected or hovered picture / text */
.overlay-handle, .text-handle { width: 16px; height: 16px; right: -8px; bottom: -8px; border-radius: 5px; box-shadow: 0 1px 4px rgba(0,0,0,.35); transition: transform .12s var(--ease); }
.overlay-handle:hover, .text-handle:hover { transform: scale(1.2); }
.overlay-pic:hover:not(.selected) { outline: 1.5px dashed rgba(255,255,255,.85); }
.stage .overlay-text.editing { outline: 2px solid #00d2ff; outline-offset: 3px; cursor: text; user-select: text; -webkit-user-select: text; z-index: 6; caret-color: currentColor; }
/* the empty video: what to do next (on the editor's own surface, readable whatever the project's background) */
.stage-empty { background: var(--bg-2); box-shadow: inset 0 0 0 2px var(--line); border-radius: inherit; }
.stage-empty.stage-paused { box-shadow: none; }
.stage-empty-next { margin-top: 6px; font-weight: 600; color: var(--ink); }
.stage-empty-actions { display: inline-flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

/* drop anywhere */
.drop-veil { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: grid; place-items: center; background: rgba(215,25,32,.06); box-shadow: inset 0 0 0 3px var(--red); animation: veil-in .14s ease-out; }
.drop-veil[hidden] { display: none; }
.drop-veil-card { display: grid; justify-items: center; gap: 6px; max-width: min(460px, calc(100vw - 32px)); padding: 22px 26px; border-radius: 18px; background: var(--bg); color: var(--ink); text-align: center; box-shadow: 0 20px 60px rgba(20,20,30,.25); border: 1px solid var(--line); }
.drop-veil-card strong { font-size: 20px; letter-spacing: -.01em; }
.drop-veil-card span:last-child { font-size: 13px; color: var(--ink-2); }
.drop-veil-plus { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--red-fill); color: #fff; font-size: 26px; font-weight: 700; }
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
body.dragging-files .stage { outline: 3px dashed var(--red); outline-offset: 4px; }
.stage-drop-label { position: absolute; z-index: 20; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; padding: 6px 12px; border-radius: 999px; background: var(--red-fill); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: 0 6px 18px rgba(215,25,32,.35); }
.stage-drop-label[hidden] { display: none; }

/* timeline clips: rounded, filmstrip inside, clear selection, real trim handles */
.tl-track .clip { border-radius: 10px; background: linear-gradient(180deg, var(--bg), var(--bg-2)); }
.tl-track .clip::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); transition: box-shadow .12s var(--ease); }
.tl-track .clip.selected::before { box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3px rgba(255,255,255,.55); }
.clip-film { position: absolute; left: 0; right: 0; top: 24px; bottom: 24px; display: flex; overflow: hidden; pointer-events: none; background: #0e0f13; }
.clip-film.film-image { background-color: #0e0f13; background-repeat: repeat-x; background-size: auto 100%; background-position: left center; }
.film-slot { display: block; flex: 1 1 0; min-width: 0; height: 100%; }
.film-slot + .film-slot { box-shadow: inset 1px 0 0 rgba(0,0,0,.35); }
.clip.has-film .clip-tiles { display: none; }
.clip.has-film .clip-head { padding-inline-end: 44px; }
.clip.has-film .clip-dur { position: absolute; top: 5px; right: 12px; margin: 0; }
.clip.has-film .clip-wave { position: absolute; left: 0; right: 0; bottom: 3px; height: 18px; width: 100%; }
.trim-h { width: 12px; z-index: 4; }
.trim-h.l { border-radius: 10px 0 0 10px; }
.trim-h.r { border-radius: 0 10px 10px 0; }
.trim-h::before { width: 3px; height: 22px; background: var(--red); box-shadow: none; }
.clip:hover:not(.selected) .trim-h { background: rgba(215,25,32,.14); }
.clip.selected .trim-h, .clip.trimming .trim-h { background: var(--red-fill); }
.clip.selected .trim-h::before, .clip.trimming .trim-h::before { background: #fff; width: 2px; }
/* the playhead's time, in a chip beside its knob; a faint line where a click on the ruler would put it */
.ph-time { position: absolute; top: 1px; left: 14px; padding: 2px 7px; border-radius: 6px; background: var(--red-fill); color: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 6px rgba(215,25,32,.3); }
.playhead.flip .ph-time { left: auto; right: 14px; }
.tl-hover { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid rgba(21,22,26,.35); z-index: 5; pointer-events: none; }
.tl-hover[hidden] { display: none; }
.tl-hover-time { position: absolute; top: 2px; left: 4px; padding: 1px 5px; border-radius: 5px; background: var(--chip); color: var(--chip-ink); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-ruler:hover { background: linear-gradient(180deg, transparent, rgba(215,25,32,.04)); }
.tl-keys { font-weight: 800; min-width: 32px; }
.tl-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }

/* keyboard shortcuts sheet */
.keys-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.keys-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.keys-head h2 { margin: 0; }
.keys-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 28px; }
.keys-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.keys-group dl { margin: 0; display: grid; gap: 2px; }
.keys-row { display: grid; grid-template-columns: minmax(118px, auto) 1fr; gap: 12px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.keys-row dt { display: flex; }
.keys-row dd { margin: 0; font-size: 14px; color: var(--ink); }
.keys { display: inline-flex; flex-wrap: wrap; gap: 4px; }
kbd { display: inline-block; min-width: 24px; padding: 2px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--bg-2); color: var(--ink); font: 600 12px/1.5 var(--font); text-align: center; white-space: nowrap; }
:root[lang="ar"] .keys-row dt { justify-content: flex-end; }

/* panel: tabs with icons, quieter section headers, empty states */
.panel-tabs { gap: 4px; padding: 10px 12px; }
.panel-tabs .tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; transition: background .15s var(--ease), color .15s var(--ease); }
.panel-tabs .tab:hover:not(.on) { background: var(--bg-2); color: var(--ink); }
.tab .icon svg { width: 16px; height: 16px; }
.tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.panel-head h2 { font-size: 17px; letter-spacing: -.01em; }
.panel-body > h3, .panel-body > .h3, .panel-body > h4 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.panel-body > h3:first-child { border-top: 0; padding-top: 0; margin-top: 4px; }
:root[lang="ar"] .panel-body > h3, :root[lang="hi"] .panel-body > h3, :root[lang="ja"] .panel-body > h3, :root[lang="ko"] .panel-body > h3, :root[lang="zh-CN"] .panel-body > h3 { text-transform: none; letter-spacing: 0; font-size: 13px; }
.empty-state { margin: 10px 0; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); color: var(--ink-2); font-size: 14px; text-align: center; border: 1px dashed var(--line); }
.drop { border-radius: 14px; transition: border-color .15s var(--ease), background .15s var(--ease); }
.drop strong { font-size: 15px; }
@media (max-width: 820px) {
  .tabs .tab { display: grid; justify-items: center; align-content: center; gap: 2px; padding: 6px 2px; }
  .tabs .tab .icon svg { width: 20px; height: 20px; }
  .tabs .tab.on { background: transparent; color: var(--red); }
  /* the view tools sit beside the time; the editing tools take the next row */
  .transport .view-tools { order: 1; margin-inline-start: auto; }
  .transport .tools { order: 2; }
}
@media (forced-colors: active) { .btn:focus-visible, .tab:focus-visible, .qa:focus-visible, .view-btn:focus-visible { outline: 2px solid; } }

/* captions progress */
.cap-progress { display: grid; gap: 6px; margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); }
.cap-progress-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
.cap-progress-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-progress .bar-track { height: 8px; border-radius: 999px; }
.cap-progress .bar-fill { border-radius: 999px; transition: width .4s var(--ease); }
.cap-progress small { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { .qa-record .qa-ic, .drop-veil { animation: none; } }

/* ---- dark Studio theme (the editor only; saved on this device). Text colours keep at least 4.5:1 on their surfaces. */
:root.studio-dark {
  color-scheme: dark;
  --bg: #121317; --bg-2: #1a1c22; --line: #2c2f38; --ink: #eceef3; --ink-2: #b9bdc9; --muted: #9196a4;
  --red: #ff5a60; --red-dark: #ff7a7f; --red-soft: #3a1519; --red-fill: #c8161d; --chip: #2a2d36; --chip-ink: #fff;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --ring: 0 0 0 3px rgba(255,90,96,.45);
}
.studio-dark body { background: var(--bg); }
.studio-dark .viewer { background: #0c0d10; }
.studio-dark .btn:hover { border-color: #3a3e49; }
.studio-dark .btn.primary:hover { background: #a91218; border-color: #a91218; }
.studio-dark .btn.chip.on, .studio-dark .seg button.on, .studio-dark .word.sel, .studio-dark .tl-range-grip, .studio-dark .tl-empty-plus, .studio-dark .app-dialog .btn.danger { background: var(--red-fill); border-color: var(--red-fill); color: #fff; }
.studio-dark .toast, .studio-dark .tl-tip, .studio-dark .clip-speed, .studio-dark .tl-plus, .studio-dark .tl-endchip, .studio-dark .avatar-link { background: var(--chip); color: #fff; }
.studio-dark .toast.bad { background: #a91218; }
.studio-dark .tl-select.on, .studio-dark .au-bar .btn.on { background: #eceef3; border-color: #eceef3; color: #121317; }
.studio-dark .tl-plus { border-color: var(--bg); }
.studio-dark .tl-plus:hover { background: var(--red-fill); }
.studio-dark .tile { background: #1d1f25; }
.studio-dark .tile-empty { background: #16181d; border-color: #3a3d47; }
.studio-dark .tile-open:hover, .studio-dark .tile-open:focus-visible { background: #2a1517; }
.studio-dark .tile-badge { background: rgba(14,15,19,.86); color: #e6e8ee; }
.studio-dark .clip.active { background: #1f2128; }
.studio-dark .tl-track .clip { background: linear-gradient(180deg, #20232a, #1a1c22); }
.studio-dark .tl-track .clip::before { box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.studio-dark .tl-track .clip.selected::before { box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3px rgba(0,0,0,.4); }
.studio-dark .tl-track .clip::after { background: var(--bg); }
.studio-dark .clip-tiles i { border-left-color: #3a3d47; }
.studio-dark .clip.gap { background: repeating-linear-gradient(135deg, #1a1c22, #1a1c22 6px, #22252c 6px, #22252c 12px); border-color: #3a3d47; }
.studio-dark .tl-ruler .tick { background: #3a3d47; }
.studio-dark .tl-ruler .tick.major { background: #5d6270; }
.studio-dark .tl-hover { border-left-color: rgba(236,238,243,.4); }
.studio-dark .ov-item, .studio-dark .tx-item { background: #22252c; }
.studio-dark .tl-track .audio-lane, .studio-dark .au-bar { background: #0f211e; }
.studio-dark .au-item { background: #164039; border-color: #2c6f66; color: #d4f1eb; }
.studio-dark .au-item.vo { background: #17473f; }
.studio-dark .au-item.muted { background: #23262d; border-color: #3a3d47; color: var(--muted); }
.studio-dark .drop, .studio-dark .tl-empty { border-color: #3a3d47; }
.studio-dark .layout-btn svg { fill: #4a4e5a; }
.studio-dark .layout-btn.on svg { fill: var(--red); }
.studio-dark .device-alert { background: #13203a; border-bottom-color: #26406e; }
.studio-dark .paused-notice { background: #2a2210; border-color: #6b5313; }
.studio-dark .policy-notice { background: #2a2210; border-bottom-color: #6b5313; color: #f3e2b5; }
.studio-dark .stt-live { background: #1d1b17; color: #eceef3; }
.studio-dark .stt-text, .studio-dark textarea { background: var(--bg); color: var(--ink); }
.studio-dark .picker-dialog, .studio-dark .app-dialog { background: var(--bg); color: var(--ink); border-color: var(--line); }
.studio-dark .picker-dialog::backdrop, .studio-dark .app-dialog::backdrop { background: rgba(0,0,0,.6); }
.studio-dark .drop-veil-card { background: #1a1c22; }
.studio-dark .stage-empty strong, .studio-dark .stage-empty-next { color: var(--ink); }
.studio-dark .ctx-menu { background: #1a1c22; }
.studio-dark .logo-dot { box-shadow: 4px 4px 0 #eceef3; }
.studio-dark .timeline, .studio-dark .panel, .studio-dark .bar { background: var(--bg); }
.studio-dark .ai-bar { background: linear-gradient(90deg, var(--red-soft), var(--bg) 60%); }
.studio-dark .media-item.picked, .studio-dark .split-maker { background: var(--red-soft); }
.studio-dark .export-dock { background: var(--bg); }
@media (pointer: coarse) { .trim-h { width: 18px; } } /* finger-sized on touch screens (the Studio rule above is for mice) */

/* ---- the first screen (owner 2026-11-21: "the timeline and video in the first viewport"). On computers the editor
   fills the window exactly: the video takes the space left, the timeline keeps at least its ruler and first video
   track, nothing scrolls the page, and the side panel scrolls on its own. Phones keep scrolling as before. */
.ai-bar { padding: 6px 20px; gap: 8px; }
.ai-input { min-height: 34px; padding-block: 5px; }
.ai-more { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.ai-more[aria-expanded="true"] { background: var(--bg-2); color: var(--ink); }
.ai-chips { padding-top: 2px; }
@media (max-width: 600px) { .ai-more-label { display: none; } .ai-more { padding-inline: 8px; } .ai-bar { padding-inline: 12px; } }
@media (min-width: 821px) {
  #app:has(> main.editor) { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  #app:has(> main.editor) > * { flex: none; }
  #app:has(> main.editor) > main.editor { flex: 1 1 auto; min-height: 0; height: auto; }
  .editor .viewer { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 10px; overflow: auto; }
  .editor .stage-wrap { flex: 1 1 0; min-height: 150px; }
  .editor .stage { width: min(100cqw, calc(100cqh * var(--ar, 1.7778))); }
  .editor .transport { flex: none; gap: 8px 10px; }
  .editor .transport .btn.round { width: 42px; height: 42px; }
  .editor .transport .scrub { min-width: 60px; }
  .editor .transport .tools .btn { min-height: 36px; padding: 5px 10px; font-size: 13px; }
  .editor .director { flex: none; }
  .editor .timeline { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 8px 10px 6px; }
  .editor .timeline > * { flex: none; }
  .editor .timeline > .tl-scroll { flex: 1 1 auto; min-height: 150px; overflow-y: auto; padding-top: 12px; }
  .editor .timeline-bar { margin-bottom: 6px; }
  .editor .timeline-bar .btn.small { min-height: 32px; }
  .editor .tl-rangebar { margin-bottom: 6px; padding: 4px 8px; }
  .device-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 20px; }
  .device-alert[hidden] { display: none; }
  .device-alert p, .device-alert ul { margin: 0; }
  .device-alert ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
  .editor .panel { min-height: 0; overflow: hidden; }
}
/* laptop heights: slimmer lanes so the video keeps a good size */
@media (min-width: 821px) and (max-height: 820px) {
  .editor .tl-track .lane { height: 70px; }
  .editor .tl-track .overlay-lane, .editor .tl-track .text-lane { height: 28px; margin-top: 4px; }
  .editor .tl-track .audio-lane { height: 32px; margin-top: 4px; }
  .editor .clip-film { top: 22px; bottom: 20px; }
  .editor .clip.has-film .clip-wave { height: 14px; bottom: 2px; }
  .editor .tl-empty { padding: 12px 16px; }
}

/* ---------------------------------------------------------------- reels (2026-11-21): formats, framing, reel captions */
/* Format chips in the editor header: the shape of each format, its name and ratio; the chosen one in red. */
.fmt-chips { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); flex: none; }
.fmt-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 4px 10px 4px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fmt-chip:hover { background: var(--bg); color: var(--ink); }
.fmt-chip.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px rgba(215,25,32,.35); }
.fmt-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.fmt-shape { display: inline-block; height: 16px; border: 2px solid currentColor; border-radius: 3px; opacity: .7; flex: none; }
.fmt-chip.on .fmt-shape { border-color: var(--red); background: rgba(215,25,32,.12); opacity: 1; }
.fmt-ratio { font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.editor-bar.fmt-compact .fmt-label { display: none; }
.editor-bar.fmt-compact .fmt-chip { padding-inline: 7px; gap: 5px; }
.make-reel { gap: 7px; font-weight: 700; border-color: rgba(215,25,32,.35); color: var(--red-dark); white-space: nowrap; }
.make-reel:hover { background: var(--red-soft); border-color: var(--red); }
.make-reel-ic { display: inline-block; width: 9px; height: 15px; border: 2px solid currentColor; border-radius: 3px; font-size: 0; }
.editor-bar.reel-icon .make-reel-label { display: none; }
@media (max-width: 820px) {
  .editor-bar { grid-template-columns: minmax(0, 1fr) auto auto auto auto; }
  .editor-bar .bar-actions .fmt-chips { grid-column: 2 / 6; grid-row: 2; justify-self: end; }
  .editor-bar .fmt-label, .editor-bar .make-reel-label { display: none; }
  .editor-bar .fmt-chip { padding-inline: 6px; gap: 4px; min-height: 30px; }
}
.studio-dark .fmt-chips { background: #15171c; border-color: #2a2d34; }
.studio-dark .fmt-chip.on, .studio-dark .fmt-chip:hover { background: #23262d; color: #f3f4f6; }

/* A tall or square canvas: the canvas and, beside it, the framing rail (the timeline stays where it is). */
.stage-wrap.with-rail { display: flex; align-items: center; justify-content: center; gap: 22px; }
.stage-wrap.with-rail > .stage { flex: none; width: min(calc(100cqw - 290px), calc(100cqh * var(--ar, 1))); }
.reel-rail { flex: none; width: 252px; align-self: center; display: grid; align-content: start; gap: 9px; max-height: 100%; overflow: auto; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow); font-size: 13px; }
.reel-rail[hidden] { display: none; }
.reel-rail hr { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
.rail-title { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rail-offer { display: grid; gap: 8px; padding: 10px; border-radius: 10px; background: var(--red-soft); }
.rail-offer p { margin: 0; font-weight: 600; color: var(--ink); }
.rail-make { justify-content: center; width: 100%; }
.studio-dark .reel-rail { background: #17191e; border-color: #2a2d34; }
.studio-dark .rail-offer { background: rgba(215,25,32,.16); }
.studio-dark .rail-offer p { color: #f3f4f6; }

/* Framing controls (rail and Scene panel). */
.framing { display: grid; gap: 8px; }
.fit-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.fit-seg button { display: grid; justify-items: center; gap: 4px; padding: 7px 4px; font-size: 12px; line-height: 1.15; white-space: normal; }
.fit-seg button:focus-visible { outline: none; box-shadow: inset var(--ring); }
.fit-ic { position: relative; display: block; width: 14px; height: 22px; border: 1.5px solid currentColor; border-radius: 3px; overflow: hidden; }
.fit-ic::after { content: ""; position: absolute; background: currentColor; opacity: .55; }
.fit-fill::after { inset: 0; }
.fit-fit::after { left: 0; right: 0; top: 35%; height: 30%; }
.fit-blur { background: linear-gradient(180deg, currentColor 0, transparent 100%); background-clip: padding-box; }
.fit-blur::after { left: 0; right: 0; top: 35%; height: 30%; opacity: .9; }
.seg button.on .fit-ic { color: #fff; }
.zoom-field { display: grid; gap: 4px; }
.zoom-field > span { display: flex; justify-content: space-between; font-weight: 600; }
.zoom-field output { color: var(--muted); font-variant-numeric: tabular-nums; }
.framing-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.framing-actions .btn { justify-content: center; padding-inline: 6px; }
.framing-actions .btn.ghost { grid-column: 1 / -1; min-height: 28px; padding-block: 2px; font-size: 12px; color: var(--muted); }
.reel-rail .rail-offer { padding: 8px 10px; gap: 6px; }
.reel-rail .rail-offer p { font-size: 12px; }
.framing-panel { margin: 6px 0; }
.tile-pick { width: 100%; }

/* Framing on the canvas: drag the picture; a rule-of-thirds grid shows while framing. */
.tile.reframing { outline: 2px solid var(--red); outline-offset: -2px; z-index: 2; }
.reframe-handle { position: absolute; inset: 0; cursor: grab; touch-action: none; z-index: 3; }
.reframe-handle.dragging { cursor: grabbing; }
.reframe-handle:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.reframe-thirds { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, transparent calc(33.333% - .5px), rgba(255,255,255,.55) calc(33.333% - .5px), rgba(255,255,255,.55) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255,255,255,.55) calc(66.666% - .5px), rgba(255,255,255,.55) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
  linear-gradient(180deg, transparent calc(33.333% - .5px), rgba(255,255,255,.55) calc(33.333% - .5px), rgba(255,255,255,.55) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255,255,255,.55) calc(66.666% - .5px), rgba(255,255,255,.55) calc(66.666% + .5px), transparent calc(66.666% + .5px)); }
.stage.playing .reframe-thirds { display: none; }
/* Fit + blur: the blurred copy behind the picture (drawn from the same player). */
.tile-backdrop { position: absolute; display: block; pointer-events: none; }
.tile > video, .tile > img { position: relative; }

/* Where the apps put their interface over a vertical video (editor only). */
.platform-zones { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.pz { position: absolute; background: repeating-linear-gradient(135deg, rgba(255,255,255,.16) 0 6px, rgba(255,255,255,.06) 6px 12px); border: 1px dashed rgba(255,255,255,.7); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); display: grid; place-items: center; }
.pz span { padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pz-right span { writing-mode: vertical-rl; padding: 7px 2px; }

/* Reel caption looks as swatches. */
.reel-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.rs { display: grid; justify-items: center; gap: 4px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font: inherit; color: var(--ink-2); }
.rs small { font-size: 11px; font-weight: 600; line-height: 1.1; text-align: center; }
.rs:hover { border-color: var(--ink-2); }
.rs.on { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); color: var(--ink); }
.rs:focus-visible { outline: none; box-shadow: var(--ring); }
.rs-sample { display: inline-flex; align-items: baseline; gap: 1px; padding: 3px 7px; border-radius: 5px; font-weight: 800; font-size: 15px; line-height: 1.1; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.rs-off .rs-sample { background: var(--red); color: #fff; text-shadow: none; }
.reel-picker { display: grid; gap: 6px; margin: 10px 0; }
.studio-dark .rs { background: #17191e; border-color: #2a2d34; color: #c9ccd3; }
.studio-dark .rs.on { color: #f3f4f6; }

/* Make a Reel. */
.reel-dialog { width: min(520px, calc(100vw - 32px)); }
.reel-dialog .field { display: grid; gap: 6px; margin: 12px 0; }
.reel-length.warn { color: var(--red-dark); font-weight: 600; }

/* Export all formats. */
.all-formats { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.all-formats-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fmt-check { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.fmt-check .fmt-shape { height: 18px; }
.all-formats-done { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

/* Template sketches: a vertical template's opening text; reel captions. */
.sk-hook { position: absolute; transform: translate(-50%, -50%); padding: .15em .45em; font-weight: 800; line-height: 1.15; border-radius: .15em; max-width: 78%; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.sk-caption.sk-reel { text-shadow: 0 .06em .12em rgba(0,0,0,.6); -webkit-text-stroke: .02em rgba(0,0,0,.6); }

/* ---------------------------------------------------------------- DailyCut Newsroom */
/* Several clips selected: each one outlined, the toolbar in the timeline's own tone. */
.tl-track .clip.multi { box-shadow: inset 0 0 0 2px var(--red), 0 0 0 3px rgba(215,25,32,.16); background: var(--red-soft); }
.tl-selbar { background: var(--bg-2); border: 1px solid var(--line); }
.tl-box { position: absolute; top: 24px; bottom: 0; z-index: 8; pointer-events: none; border: 1.5px dashed var(--red); background: rgba(215,25,32,.07); border-radius: 6px; }
/* Ripple: a quiet switch in the toolbar. */
.tl-ripple { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; min-height: 32px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; }
.tl-ripple input { appearance: none; -webkit-appearance: none; width: 26px; height: 15px; margin: 0; border-radius: 999px; background: #c9ccd3; position: relative; cursor: pointer; transition: background .15s ease; }
.tl-ripple input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: transform .15s ease; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.tl-ripple input:checked { background: var(--red); }
.tl-ripple input:checked::after { transform: translateX(11px); }
.tl-ripple input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.tl-ripple.on { color: var(--ink); border-color: #d6d7dd; }
.tl-vo { font-weight: 700; }
/* Transitions: a chip on every cut (below the clips), and a band showing what the transition covers. */
.tl-tr { position: absolute; bottom: -9px; z-index: 7; width: 20px; height: 20px; margin-left: -10px; padding: 0; border-radius: 50%; border: 2px solid var(--bg); background: #c9ccd3; color: #fff; font-size: 10px; line-height: 1; display: grid; place-items: center; cursor: pointer; transform: scale(.8); opacity: 0; transition: opacity .12s ease, transform .12s ease, background .12s ease; box-shadow: var(--shadow); }
.tl-track .lane:hover .tl-tr, .tl-tr:focus-visible, .tl-tr.on { opacity: 1; transform: none; }
.tl-tr.on { background: var(--ink); }
.tl-tr:hover { background: var(--red); }
.tl-trband { position: absolute; bottom: 2px; height: 5px; z-index: 5; border-radius: 4px; background: linear-gradient(90deg, rgba(21,22,26,.12), rgba(21,22,26,.55)); pointer-events: none; }
.tl-trband.fade-black { background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,.75) 50%, rgba(0,0,0,.05)); }
.tl-trband.fade-white { background: linear-gradient(90deg, rgba(255,255,255,.1), #fff 50%, rgba(255,255,255,.1)); box-shadow: inset 0 0 0 1px #c9ccd3; }
.tl-trband.slide { background: repeating-linear-gradient(90deg, rgba(21,22,26,.5) 0 3px, transparent 3px 6px); }
.tl-trgrip { position: absolute; right: -5px; top: -5px; width: 10px; height: 15px; opacity: 0; transition: opacity .12s ease; border-radius: 4px; background: var(--ink); border: 2px solid var(--bg); cursor: ew-resize; pointer-events: auto; touch-action: none; }
.tl-trgrip:hover { background: var(--red); }
.tl-track .lane:hover .tl-trgrip, .tl-trgrip:active { opacity: 1; }
/* Sound fades on a clip: a slope at each end, with a small handle at the top corner. */
.fade-shape { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 1; }
.fade-shape.l { left: 0; background: linear-gradient(to top right, rgba(215,25,32,.18) 50%, transparent 50.5%); }
.fade-shape.r { right: 0; background: linear-gradient(to top left, rgba(215,25,32,.18) 50%, transparent 50.5%); }
.fade-h { position: absolute; top: -5px; z-index: 3; width: 11px; height: 11px; margin: 0 -5.5px; border-radius: 50%; background: var(--bg); border: 2px solid var(--red); cursor: ew-resize; touch-action: none; opacity: 0; transition: opacity .12s ease; }
.fade-h.l { left: 0; } .fade-h.r { right: 0; }
.fade-h.l:not(.on) { margin-left: 4px; } .fade-h.r:not(.on) { margin-right: 4px; }
.clip:hover .fade-h, .clip.selected .fade-h, .fade-h.on, .mu-item:hover .fade-h { opacity: 1; }
@media (pointer: coarse) { .fade-h { width: 18px; height: 18px; margin: 0 -9px; } }
/* The music lane. */
.tl-track .mu-lane { position: relative; height: 30px; margin-top: 6px; border-radius: 8px; background: #f3effb; }
.mu-item { position: absolute; left: 0; top: 5px; bottom: 3px; display: flex; align-items: center; padding: 0 16px; border-radius: 6px; background: #e4dcf7; border: 1px solid #b9a8e8; color: #3d2d7a; font-size: 11px; font-weight: 700; }
.mu-item .au-name { position: relative; z-index: 2; }
.mu-item .fade-shape.l { background: linear-gradient(to top right, rgba(61,45,122,.22) 50%, transparent 50.5%); }
.mu-item .fade-shape.r { background: linear-gradient(to top left, rgba(61,45,122,.22) 50%, transparent 50.5%); }
.mu-item .fade-h { border-color: #6b5bd6; top: -6px; }
/* Proposed cuts (pauses, filler words) on the clips, until applied. */
.tl-cut { position: absolute; top: 0; bottom: 0; z-index: 4; pointer-events: none; border-radius: 3px; background: repeating-linear-gradient(135deg, rgba(215,25,32,.55) 0 3px, rgba(215,25,32,.22) 3px 6px); min-width: 2px; }
.tl-cut.filler { background: repeating-linear-gradient(135deg, rgba(245,166,35,.85) 0 3px, rgba(245,166,35,.35) 3px 6px); }
.tl-cut.off { background: transparent; border: 1px dashed rgba(138,142,153,.8); }
/* Magic: best moments and the clean-up list. */
.magic-sec { display: grid; gap: 10px; }
.magic-sec h3 { margin: 0; font-size: 16px; }
.hl-list { display: grid; gap: 10px; }
.hl-card { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow); }
.hl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hl-rank { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 800; font-size: 13px; }
.hl-time { border: 0; background: var(--bg-2); border-radius: 999px; padding: 3px 10px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; font-size: 13px; }
.hl-time:hover { background: var(--red-soft); color: var(--red-dark); }
.hl-len { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.hl-ai { margin-inline-start: auto; font-size: 11px; font-weight: 700; color: #6b5bd6; background: #f0edfc; border-radius: 999px; padding: 2px 8px; }
.hl-reason { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hl-title { font-weight: 700; }
.hl-text { margin: 0; font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hl-thinking { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: #6b5bd6; }
.clean-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.clean-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; font-size: 13px; }
.clean-item:hover { background: var(--bg-2); }
.clean-item.off { opacity: .55; }
.clean-kind { flex: none; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--red-soft); color: var(--red-dark); }
.clean-kind.filler { background: #fff3dc; color: #8a5a00; }
.clean-time { border: 0; background: none; padding: 0; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; color: var(--ink); }
.clean-time:hover { color: var(--red); text-decoration: underline; }
.clean-len { color: var(--muted); font-variant-numeric: tabular-nums; }
.clean-text { color: var(--ink-2); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clean-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clean-adv summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
/* Translated captions. */
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* Voice-over dialog. */
.vo-dialog { width: min(560px, calc(100vw - 32px)); }
.vo-dialog .vo-box > summary { display: none; }
/* Publish: one clear step after an export. */
.publish-card { display: grid; gap: 8px; margin: 10px 0 4px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--bg), var(--bg-2)); }
.publish-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.publish-step { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; }
.publish-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.publish-opt { width: 100%; display: flex; align-items: center; gap: 10px; text-align: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; font: inherit; color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease; }
.publish-opt:hover { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.publish-opt:disabled { opacity: .6; cursor: progress; }
.publish-glyph { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 16px; }
.publish-opt.share .publish-glyph { background: var(--red); }
.publish-words { display: grid; gap: 1px; min-width: 0; }
.publish-words small { color: var(--ink-2); font-size: 12px; }
.publish-note { margin: 0; }
/* Dark theme. */
.studio-dark .tl-selbar { background: #17191e; border-color: #2a2d34; }
.studio-dark .tl-track .clip.multi { background: #2a1416; }
.studio-dark .tl-ripple { border-color: #2a2d34; color: #c9ccd3; }
.studio-dark .tl-ripple input { background: #3a3d45; }
.studio-dark .tl-tr { border-color: #0f1013; background: #4a4d57; }
.studio-dark .tl-tr.on { background: #e6e7ea; color: #15161a; }
.studio-dark .tl-trgrip { border-color: #0f1013; background: #e6e7ea; }
.studio-dark .fade-h { background: #0f1013; }
.studio-dark .tl-track .mu-lane { background: #1a1630; }
.studio-dark .mu-item { background: #2b2350; border-color: #4b3f8f; color: #ddd6ff; }
.studio-dark .hl-card, .studio-dark .publish-opt { background: #17191e; border-color: #2a2d34; color: #e6e7ea; }
.studio-dark .publish-card { background: linear-gradient(180deg, #121317, #17191e); border-color: #2a2d34; }
.studio-dark .hl-time { background: #23262d; color: #e6e7ea; }
.studio-dark .hl-rank { background: #e6e7ea; color: #15161a; }
.studio-dark .hl-ai { background: #231f3d; color: #b9adff; }
.studio-dark .clean-list { border-color: #2a2d34; }
.studio-dark .clean-item:hover { background: #1d1f25; }
.studio-dark .clean-time { color: #e6e7ea; }
.studio-dark .clean-kind { background: #3a1517; color: #ffb3b6; }
.studio-dark .clean-kind.filler { background: #3a2a0c; color: #ffd27a; }
.vo-dialog textarea { font: inherit; font-size: 15px; line-height: 1.45; width: 100%; }
.vo-dialog .vo-box { border: 0; padding: 0; background: none; }
.magic-sec .field.inline > span { white-space: nowrap; }

/* A project reopened with files on this device: one big button over the empty preview (2026-11-29). */
.stage-wrap { position: relative; }
.stage-reconnect { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; border: 0; background: rgba(20, 17, 15, .72); color: #fff; font: inherit; text-align: center; cursor: pointer; }
.stage-reconnect[hidden] { display: none; }
.stage-reconnect strong { padding: 14px 28px; border-radius: 999px; background: var(--red, #d92d20); font-size: 1.15rem; font-weight: 700; }
.stage-reconnect span { max-width: 44ch; font-size: .95rem; opacity: .92; }
.stage-reconnect:hover strong, .stage-reconnect:focus-visible strong { filter: brightness(1.08); }
