/* brand fonts for the approximate preview, bundled so they work offline (SIL Open Font License) */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Gochi Hand"; src: url("../fonts/gochihand-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
[hidden] { display: none !important; }
/* ════════════════════════════════════════════════════════════════════════════════════════
   Content Machine — design system (DRAFT, not yet approved by Jaye)
   Direction from her references: dark-first editing studio with a light mode; slim icon rail;
   tool panel · preview · inspector; multitrack timeline with track headers and colour-coded
   clips; project grid with thumbnails. Everything is a token so the look can be refined later.
   ════════════════════════════════════════════════════════════════════════════════════════ */

/* ── tokens ── */
:root, :root[data-theme="dark"] {
  --bg: #0e0f13; --bg-2: #14161c; --panel: #1a1d24; --panel-2: #222631; --panel-3: #2b303c; --line: #2c313c; --line-2: #3a4050;
  --ink: #eceef3; --ink-2: #a9afbd; --ink-3: #6f7686;
  --accent: #ff2e88; --accent-2: #ff4f9c; --accent-ink: #ffffff; --accent-soft: rgba(255, 46, 136, .16); --lime: #b8f227; --lime-ink: #b8f227;
  --ok: #33c27f; --ok-soft: rgba(51, 194, 127, .16); --warn: #f2b33d; --warn-soft: rgba(242, 179, 61, .16); --bad: #ff5d5d; --bad-soft: rgba(255, 93, 93, .16);
  --cut: #ff5d5d; --cut-bg: rgba(255, 93, 93, .18); --sugg: #f2b33d; --sugg-bg: rgba(242, 179, 61, .2); --info: #4c8dff;
  /* timeline track colours */
  --t-video: #2f80ed; --t-graphic: #e64980; --t-text: #14b8a6; --t-caption: #e8a33d; --t-audio: #2fb66f; --t-sfx: #e2589b; --t-scene: #64748b;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35); --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --radius: 12px; --radius-sm: 8px; --rail: 76px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef0f4; --bg-2: #f5f6f9; --panel: #ffffff; --panel-2: #f2f4f8; --panel-3: #e7eaf0; --line: #e1e4ea; --line-2: #cfd4dd;
  --ink: #161a22; --ink-2: #545c6b; --ink-3: #8a919e;
  --accent: #e0186f; --accent-2: #c40f5e; --accent-soft: rgba(224, 24, 111, .1); --lime: #8cc400; --lime-ink: #4d7300;
  --ok: #16a34a; --ok-soft: rgba(22, 163, 74, .1); --warn: #b7791f; --warn-soft: rgba(217, 119, 6, .12); --bad: #dc2626; --bad-soft: rgba(220, 38, 38, .1);
  --cut: #dc2626; --cut-bg: rgba(220, 38, 38, .12); --sugg: #b7791f; --sugg-bg: rgba(217, 119, 6, .16); --info: #2563eb;
  --shadow: 0 8px 30px rgba(20, 26, 40, .1); --shadow-sm: 0 1px 2px rgba(20, 26, 40, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #eef0f4; --bg-2: #f5f6f9; --panel: #ffffff; --panel-2: #f2f4f8; --panel-3: #e7eaf0; --line: #e1e4ea; --line-2: #cfd4dd;
    --ink: #161a22; --ink-2: #545c6b; --ink-3: #8a919e; --accent: #e0186f; --accent-2: #c40f5e; --accent-soft: rgba(224, 24, 111, .1); --lime: #8cc400; --lime-ink: #4d7300;
    --ok: #16a34a; --ok-soft: rgba(22, 163, 74, .1); --warn: #b7791f; --warn-soft: rgba(217, 119, 6, .12); --bad: #dc2626; --bad-soft: rgba(220, 38, 38, .1);
    --cut: #dc2626; --cut-bg: rgba(220, 38, 38, .12); --sugg: #b7791f; --sugg-bg: rgba(217, 119, 6, .16); --info: #2563eb;
    --shadow: 0 8px 30px rgba(20, 26, 40, .1); --shadow-sm: 0 1px 2px rgba(20, 26, 40, .08); color-scheme: light;
  }
}

/* ── base ── */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; margin: 0; } h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; } h3 { font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 12.5px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .spacer { flex: 1; } .grow { flex: 1; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── shell: icon rail + main ── */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: max(14px, env(safe-area-inset-top)) 8px max(14px, env(safe-area-inset-bottom)); background: var(--bg-2); border-right: 1px solid var(--line); z-index: 30; }
.rail a.logo, .logo { width: 38px; min-height: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #ff4f9c, #e0186f); color: #fff; margin-bottom: 14px; text-decoration: none; border-radius: 11px; }
.rail a.logo:hover { background: linear-gradient(135deg, #ff4f9c, #e0186f); color: #fff; }
.logo svg { width: 20px; height: 20px; }
.rail a, .rail button.rbtn { width: 60px; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 12px;
  text-decoration: none; color: var(--ink-2); font-size: 11px; border: 0; background: none; cursor: pointer; }
.rail a svg, .rail button.rbtn svg { width: 20px; height: 20px; }
.rail a:hover, .rail button.rbtn:hover { background: var(--panel); color: var(--ink); }
.rail a.active { background: var(--accent-soft); color: var(--accent); }
.rail a.locked { opacity: .45; }
.rail .sep { width: 36px; height: 1px; background: var(--line); margin: 8px 0; }
.rail .bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 18px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .title h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--ink); }
.status { display: flex; gap: 6px; align-items: center; }
main#view { flex: 1; min-width: 0; padding: 18px; outline: none; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 6px max(6px, env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); }
  .rail .logo, .rail .sep, .rail .bottom .hide-sm { display: none; } .rail .bottom { margin: 0; flex-direction: row; }
  main#view { padding: 12px 12px 96px; } .topbar { padding: 10px 12px; }
}

/* ── controls ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; font-weight: 500; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--panel-2); } .btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn.primary:hover { background: var(--accent-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); } .btn.ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; } .btn.icon { width: 36px; padding: 0; } .btn.sm.icon { width: 30px; }
@media (pointer: coarse) { .btn { min-height: 42px; } .btn.sm { min-height: 36px; } .btn.icon { width: 42px; } .btn.sm.icon { width: 36px; } }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button, .seg a { border: 0; background: transparent; padding: 0 12px; min-height: 30px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button.on, .seg a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.seg a.locked { opacity: .45; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; } .field > span { font-size: 12px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 36px; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); }
textarea.input { min-height: 70px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.pill.on::before { background: var(--ok); } .pill.off::before { background: var(--bad); } .pill.busy::before { background: var(--accent); }
.pill.warn { border-color: var(--warn); color: var(--ink); } .pill.warn::before { background: var(--warn); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.accent { background: var(--accent-soft); color: var(--accent); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; }
.panel > .ph { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); } .panel > .ph h2 { margin: 0; font-size: 14px; }
.panel > .pb { padding: 12px 14px; overflow: auto; min-height: 0; }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--bg-2); }
.item:hover { border-color: var(--line-2); } .item.active { border-color: var(--accent); background: var(--accent-soft); }
.item .why { font-size: 12.5px; color: var(--ink-2); grid-column: 1 / -1; }
.empty { padding: 48px 24px; text-align: center; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; } .kv dt { color: var(--ink-2); } .kv dd { margin: 0; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 32px); }
#toast .t { background: var(--panel-3); color: var(--ink); border: 1px solid var(--line-2); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); }
@media (max-width: 760px) { #toast { bottom: 92px; } }
.spin { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
dialog.modal { border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel); color: var(--ink); padding: 0; width: min(640px, calc(100% - 32px)); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .5); }
dialog.modal .mh { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; } dialog.modal .mh h2 { margin: 0; }
dialog.modal .mb { padding: 16px 18px; max-height: 70vh; overflow: auto; } dialog.modal .mf { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; font-size: 13px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ── dashboard ── */
.dash { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .dash { grid-template-columns: 1fr; } .dash .side { display: none; } }
.side .nav { display: flex; flex-direction: column; gap: 2px; }
.side .nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.side .nav button:hover { background: var(--panel-2); color: var(--ink); } .side .nav button.on { background: var(--panel-2); color: var(--ink); font-weight: 600; }
.side .nav .count { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.pgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--line-2); transform: translateY(-1px); }
.pcard .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--panel-3) center / cover no-repeat; display: block; }
.pcard .thumb .dur { position: absolute; right: 8px; top: 8px; background: rgba(0, 0, 0, .65); color: #fff; font: 600 11.5px var(--mono); padding: 2px 6px; border-radius: 5px; }
.pcard .thumb .stg { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.7); color: #fff; }
.pcard .thumb .stg::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: none; }
.pcard .thumb .off { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 5px; }
.pcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard h2 { margin: 0; font-size: 14.5px; } .pcard .meta { font-size: 12.5px; color: var(--ink-2); }
.pcard .tags { display: flex; gap: 5px; flex-wrap: wrap; }
.pcard .acts { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.steps { display: flex; gap: 3px; } .steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--panel-3); }
.steps span.done { background: var(--ok); } .steps span.now { background: var(--accent); }
.newcard { border: 1.5px dashed var(--line-2); border-radius: var(--radius); display: grid; place-items: center; min-height: 230px; color: var(--ink-2); cursor: pointer; background: transparent; }
.newcard:hover { border-color: var(--accent); color: var(--accent); }

/* ── workspace (audio) ── */
.ae { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "wave side" "text side"; }
@media (max-width: 1100px) { .ae { grid-template-columns: 1fr; grid-template-areas: "wave" "side" "text"; } }
.ae-wave { grid-area: wave; } .ae-text { grid-area: text; } .ae-side { grid-area: side; display: flex; flex-direction: column; gap: 12px; }
.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; max-height: 52vh; margin: 0 auto; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; }
.transport { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 10px; }
.timecode { font-family: var(--mono); font-size: 13px; min-width: 140px; color: var(--ink-2); }
.wavebox { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.wavebox canvas { display: block; width: 100%; }
.overview { height: 34px; border-bottom: 1px solid var(--line); cursor: pointer; } .zoomed { height: 140px; cursor: crosshair; }
.wave-hint { padding: 6px 10px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.transcript { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; line-height: 2.1; font-size: 16px; max-height: 62vh; overflow: auto; -webkit-user-select: none; user-select: none; }
.w { padding: 3px 1px; border-radius: 4px; cursor: pointer; } .w:hover { background: var(--panel-2); }
.w.cut { color: var(--cut); text-decoration: line-through; text-decoration-thickness: 2px; background: var(--cut-bg); }
.w.sugg { background: var(--sugg-bg); box-shadow: inset 0 -2px 0 var(--sugg); }
.w.sel { background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.w.now { outline: 2px solid var(--info); outline-offset: 1px; }
.gap { display: inline-block; min-width: 18px; text-align: center; color: var(--cut); font-size: 11.5px; font-family: var(--mono); padding: 0 4px; border-radius: 4px; cursor: pointer; vertical-align: 1px; background: var(--cut-bg); line-height: 1.6; }
.gap.pending { color: var(--sugg); background: var(--sugg-bg); } .gap.kept { color: var(--ink-3); background: var(--panel-2); } .gap.sel { background: var(--accent); color: var(--accent-ink); }
.selbar { position: sticky; top: 70px; z-index: 5; display: none; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; background: var(--panel-2); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); }
.selbar.show { display: flex; }
.approve.done { border-color: var(--ok); background: linear-gradient(0deg, var(--ok-soft), var(--ok-soft)), var(--panel); }
.nudge { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.side-scroll { max-height: 340px; overflow: auto; }

/* ── visual editor (studio layout) ── */
.studio { display: grid; gap: 12px; grid-template-columns: 300px minmax(0, 1fr) 320px; grid-template-rows: minmax(360px, 1fr) auto; grid-template-areas: "tools stage insp" "tl tl tl"; height: calc(100dvh - 60px - 36px); min-height: 640px; }
.studio .tools { grid-area: tools; } .studio .stagewrap { grid-area: stage; } .studio .insp { grid-area: insp; } .studio .tl { grid-area: tl; }
@media (max-width: 1200px) { .studio { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "stage insp" "tl tl" "tools tools"; height: auto; } .studio .stagebox { min-height: 560px; } }
@media (max-width: 760px) { .studio { grid-template-columns: 1fr; grid-template-areas: "stage" "insp" "tl" "tools"; } }
.stagewrap { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stagebox { flex: 1; min-height: 300px; position: relative; display: grid; place-items: center; background: repeating-conic-gradient(var(--bg-2) 0 25%, var(--panel-2) 0 50%) 0 0 / 16px 16px; overflow: hidden; }
.stagebar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.stage { position: absolute; left: 50%; top: 50%; width: 1080px; height: 1920px; transform-origin: center; background: #F5F0E6; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.stage .el, .mini .el { position: absolute; }
.stage .el.selected { outline: 6px solid var(--accent); outline-offset: 6px; }
.stage .el.hoverable:hover { outline: 4px dashed var(--accent); outline-offset: 6px; cursor: pointer; }
.approx { position: absolute; left: 10px; top: 10px; z-index: 5; }
.tl { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.tl-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tl-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); overflow: auto; max-height: 300px; position: relative; }
.tl-heads { position: sticky; left: 0; z-index: 3; background: var(--panel); border-right: 1px solid var(--line); }
.tl-head { height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.tl-head .sw { width: 8px; height: 22px; border-radius: 3px; } .tl-head.ruler { height: 28px; }
.tl-lanes { position: relative; }
.tl-ruler { height: 28px; border-bottom: 1px solid var(--line); position: relative; font: 11px var(--mono); color: var(--ink-3); }
.tl-ruler span { position: absolute; top: 7px; padding-left: 4px; border-left: 1px solid var(--line-2); height: 21px; }
.lane { height: 44px; border-bottom: 1px solid var(--line); position: relative; }
.clip { position: absolute; top: 6px; height: 32px; border-radius: 7px; padding: 0 8px; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #fff;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; border: 2px solid transparent; touch-action: none; user-select: none; -webkit-user-select: none; }
.clip.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.clip .h { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; } .clip .h.l { left: 0; } .clip .h.r { right: 0; }
.clip .h::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 3px; width: 3px; border-radius: 2px; background: rgba(255, 255, 255, .7); }
.clip.k-video { background: var(--t-video); } .clip.k-graphic { background: var(--t-graphic); } .clip.k-text { background: var(--t-text); }
.clip.k-caption { background: var(--t-caption); color: #1b1300; font-weight: 500; } .clip.k-sfx { background: var(--t-sfx); } .clip.k-scene { background: var(--t-scene); }
.lane canvas { position: absolute; inset: 6px 0; height: 32px; width: 100%; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); z-index: 4; pointer-events: none; }
.playhead::before { content: ""; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: var(--bad); }
.insp .pb { display: flex; flex-direction: column; gap: 4px; }
.ai-box svg, .ph svg, .badge svg { width: 15px; height: 15px; vertical-align: -2px; }
.ai-box { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.toolgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.toolgrid button { aspect-ratio: 1; border: 1px solid var(--line); background: var(--bg-2); border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; font-size: 11px; color: var(--ink-2); }
.toolgrid button:hover { border-color: var(--accent); color: var(--ink); }
.toolgrid img, .toolgrid svg { width: 46px; height: 46px; }

/* ── storyboard ── */
.sb { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.scene { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.scene.sel { border-color: var(--accent); }
.scene .frame { height: 300px; background: var(--bg-2); position: relative; overflow: hidden; }
.scene .frame .mini { position: absolute; left: 50%; top: 0; width: 1080px; height: 1920px; transform-origin: 0 0; pointer-events: none; overflow: hidden; }
.scene .sh { display: flex; align-items: center; gap: 8px; padding: 10px 12px 0; }
.scene .num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2); font-weight: 700; font-size: 12px; }
.scene .sbody { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.scene .quote { color: var(--ink-2); font-style: italic; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.scene .refs { display: flex; gap: 6px; flex-wrap: wrap; } .scene .refs img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ── visual editor v2: library · preview · properties · resizable timeline (DRAFT design) ── */
.vtop { margin-bottom: 10px; }
.studio2 { --left-w: 280px; --right-w: 320px; --tl-h: 300px; display: grid; gap: 0;
  grid-template-columns: var(--left-w) 8px minmax(0, 1fr) 8px var(--right-w);
  grid-template-rows: minmax(140px, 1fr) 8px var(--tl-h);
  grid-template-areas: "lib vl stage vr insp" "hs hs hs hs hs" "tl tl tl tl tl";
  height: calc(100dvh - 60px - 36px - 46px); min-height: 620px; }
.studio2 .lib { grid-area: lib; min-width: 0; overflow: hidden; } .studio2 .stagewrap { grid-area: stage; }
.studio2 .insp { grid-area: insp; min-width: 0; overflow: hidden; } .studio2 .tl { grid-area: tl; min-height: 0; }
.studio2 [data-split=left] { grid-area: vl; } .studio2 [data-split=right] { grid-area: vr; } .studio2 [data-split=tl] { grid-area: hs; }
.studio2.left-closed { grid-template-columns: 0 0 minmax(0, 1fr) 8px var(--right-w); }
.studio2.right-closed { grid-template-columns: var(--left-w) 8px minmax(0, 1fr) 0 0; }
.studio2.left-closed.right-closed { grid-template-columns: 0 0 minmax(0, 1fr) 0 0; }
.studio2.left-closed .lib, .studio2.left-closed [data-split=left], .studio2.right-closed .insp, .studio2.right-closed [data-split=right] { display: none; }
.vsplit, .hsplit { position: relative; touch-action: none; }
.vsplit { cursor: col-resize; } .hsplit { cursor: row-resize; }
.vsplit::after, .hsplit::after { content: ""; position: absolute; border-radius: 2px; background: var(--line-2); opacity: 0; transition: opacity .15s; }
.vsplit::after { top: 40%; bottom: 40%; left: 3px; width: 2px; } .hsplit::after { left: 45%; right: 45%; top: 3px; height: 2px; }
.vsplit:hover::after, .hsplit:hover::after { opacity: 1; background: var(--accent); }
.opentab { display: none; }
.opentab.left { order: -1; }
.studio2.left-closed .opentab.left, .studio2.right-closed .opentab.right { display: inline-flex; }
.studio2 .stagebox { min-height: 0; }
.studio2 .lib .pb { flex: 1; }
.libtabs { width: 100%; } .libtabs button { flex: 1; justify-content: center; }
.studio2 .toolgrid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.studio2 .list .item { text-align: left; font: inherit; color: inherit; width: 100%; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0 10px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tl { display: flex; flex-direction: column; }
.tl .tl-body { flex: 1; max-height: none; grid-template-columns: 190px minmax(0, 1fr); }
.tl-head { gap: 4px; padding: 0 6px 0 4px; border-bottom: 1px solid var(--line); height: auto; align-items: flex-start; padding-top: 9px; }
.tl-head.ruler { padding-top: 0; }
.tl-head.collapsed { padding-top: 2px; align-items: center; }
.tl-head .tname { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.tl-head .sw { width: 6px; height: 16px; margin-top: 1px; flex: none; }
.tl-head.collapsed .sw { height: 12px; }
.ticon { width: 24px; height: 22px; border: 0; background: transparent; color: var(--ink-3); border-radius: 5px; cursor: pointer; display: inline-grid; place-items: center; padding: 0; font-size: 12px; flex: none; }
.ticon svg { width: 14px; height: 14px; } .ticon:hover { background: var(--panel-2); color: var(--ink); }
.ticon.on { color: var(--warn); } .ticon.off { color: var(--ink-3); opacity: .6; }
@media (pointer: coarse) { .ticon { width: 32px; height: 30px; } }
.lane { position: relative; height: auto; }
.lane.collapsed .clip .cl, .lane.collapsed .clip .h { display: none; }
.lane.dim { opacity: .4; } .lane.locked { background: repeating-linear-gradient(135deg, transparent 0 8px, var(--panel-2) 8px 9px); }
.lane.locked .clip { cursor: not-allowed; }
.clip { height: 28px; top: 5px; }
.clip .cl { overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.clip.ro { opacity: .85; cursor: default; }
.clip.k-text { background: var(--t-text); } .clip.k-graphic { background: var(--t-graphic); } .clip.k-caption { background: var(--t-caption); color: #1b1300; }
.clip.k-video { background: var(--t-video); }
.clip.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-soft); z-index: 2; }
@media (pointer: coarse) { .clip .h { width: 18px; } }
.snapline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--warn); z-index: 5; pointer-events: none; box-shadow: 0 0 0 1px rgba(242, 179, 61, .35); }
.lane canvas { position: absolute; inset: 6px 0 auto 0; }
@media (max-width: 1200px) {
  .studio2 { height: calc(100dvh - 60px - 36px - 46px); min-height: 560px; }
  .studio2 .lib { position: absolute; z-index: 15; width: min(320px, 80vw); height: calc(100% - 20px); margin: 10px; box-shadow: var(--shadow); }
  .studio2:not(.left-closed) { grid-template-columns: 0 0 minmax(0, 1fr) 8px var(--right-w); position: relative; }
  .studio2:not(.left-closed) [data-split=left] { display: none; }
}
@media (max-width: 760px) {
  .studio2, .studio2.left-closed, .studio2.right-closed, .studio2.left-closed.right-closed, .studio2:not(.left-closed) {
    grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "stage" "insp" "tl"; height: auto; }
  .studio2 .stagebox { min-height: 420px; } .studio2 .vsplit, .studio2 .hsplit { display: none; }
  .studio2 .tl { height: 320px; } .studio2 .insp { max-height: 420px; }
  .hide-sm { display: none; }
}
.studio2 .insp { display: flex; flex-direction: column; } .studio2 .insp > .pb { flex: 1; min-height: 0; overflow: auto; }
details.ai-box > summary { cursor: pointer; list-style: none; } details.ai-box > summary::-webkit-details-marker { display: none; }
details.ai-box:not([open]) { padding-top: 10px; padding-bottom: 10px; }
.tl .tl-body { grid-template-columns: 212px minmax(0, 1fr); }

@media (pointer: coarse) { .tl .tl-body { grid-template-columns: 236px minmax(0, 1fr); } }

.tl .tl-body { grid-template-columns: 236px minmax(0, 1fr); }
.tl-head .tname { font-size: 12px; letter-spacing: -.01em; }


/* ── wide labelled sidebar (studio pages) · DRAFT design from Jaye's studio reference ── */
.shell.wide { grid-template-columns: 264px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  padding: max(20px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); background: var(--bg-2); border-right: 1px solid var(--line); z-index: 30; }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; text-decoration: none; color: var(--ink); }
.sb-brand .mark { width: 40px; height: 40px; flex: none; }
.sb-brand b { display: block; font-size: 18px; line-height: 1.05; letter-spacing: -.01em; }
.sb-brand small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav a, .sb-nav button { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--ink-2);
  text-decoration: none; border: 0; background: none; font: inherit; font-size: 14.5px; cursor: pointer; text-align: left; width: 100%; }
.sb-nav a svg, .sb-nav button svg { width: 19px; height: 19px; flex: none; }
.sb-nav a:hover, .sb-nav button:hover { background: var(--panel); color: var(--ink); }
.sb-nav a.active { background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(255, 46, 136, .3); }
.sb-nav .soon { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 7px; }
.sb-nav .tag { margin-left: auto; font-size: 10.5px; color: var(--ink-3); }
.sb-sec { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 18px 12px 6px; border-top: 1px solid var(--line); margin-top: 14px; }
.sb-foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.storage { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.storage b { display: block; font-size: 13.5px; } .storage .small { color: var(--ink-2); margin: 4px 0 10px; }
.bar { height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.bar.accent > i { background: var(--accent); }
@media (max-width: 1100px) { .shell.wide { grid-template-columns: var(--rail) minmax(0, 1fr); } .shell.wide .sidebar { display: none; } .shell.wide .rail { display: flex; } }
@media (min-width: 1101px) { .shell.wide .rail { display: none; } }

/* ── Studio home ── */
.studio-home { display: flex; flex-direction: column; gap: 28px; max-width: 1480px; margin: 0 auto; padding-bottom: 32px; }
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 34px 36px; min-height: 150px; display: flex; align-items: center;
  background: radial-gradient(120% 140% at 85% 0%, rgba(255, 46, 136, .35), transparent 55%), radial-gradient(60% 90% at 60% 120%, rgba(184, 242, 39, .12), transparent 60%), linear-gradient(120deg, var(--panel) 0%, var(--bg-2) 60%); border: 1px solid var(--line); }
.hero h1 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; letter-spacing: -.02em; }
.hero h1 u { text-decoration: none; color: var(--accent); }
.hero p { margin: 8px 0 0; color: var(--ink-2); font-size: 15.5px; max-width: 52ch; }
.hero .art { position: absolute; right: 28px; top: 50%; transform: translateY(-50%) rotate(3deg); width: 300px; aspect-ratio: 16 / 9; border-radius: 12px;
  background: var(--panel-3) center / cover; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); border: 3px solid rgba(255, 255, 255, .08); }
.hero .art::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 30px; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
@media (max-width: 1250px) { .hero .art { display: none; } }
.actions { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }

@media (max-width: 800px) { .actions { grid-template-columns: 1fr; } }
.act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 112px; padding: 16px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; text-align: center; position: relative; }
.act svg { width: 28px; height: 28px; } .act:hover { border-color: var(--accent); }
.act.off { color: var(--ink-3); cursor: default; } .act.off:hover { border-color: var(--line); }
.act .soon { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 600; border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 7px; color: var(--ink-3); }
.act.big { flex-direction: row; justify-content: flex-start; gap: 18px; padding: 20px 26px; background: linear-gradient(135deg, #ff4f9c, #e0186f); border: 0; color: #fff;
  box-shadow: 0 12px 34px rgba(255, 90, 31, .32); }
.act.big .plus { width: 54px; height: 54px; flex: none; border-radius: 50%; background: #fff; color: #e0186f; display: grid; place-items: center; }
.act.big .plus svg { width: 26px; height: 26px; } .act.big b { display: block; font-size: 22px; text-align: left; } .act.big small { display: block; font-weight: 400; opacity: .9; margin-top: 2px; text-align: left; }
.two { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
@media (max-width: 1250px) { .two { grid-template-columns: 1fr; } }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.box.glow { position: relative; overflow: hidden; border-color: rgba(255, 46, 136, .55); box-shadow: 0 0 0 1px rgba(255, 46, 136, .12), 0 10px 40px rgba(255, 46, 136, .08); }
.box.glow .waves { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; pointer-events: none; opacity: .55; }
.box-h { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; } .box-h h2 { margin: 0; font-size: 19px; font-weight: 700; } .box-h svg { width: 22px; height: 22px; color: var(--accent); }
.ovw { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }

.stat { border: 1px solid var(--line); border-radius: 14px; padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--bg-2); }
.stat svg { width: 26px; height: 26px; color: var(--ink-2); } .stat b { font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; } .stat span { color: var(--ink-2); font-size: 13.5px; }
.stat.ok svg, .stat.ok span { color: var(--ok); }
.week { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; }
.week h3 { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); margin: 0; width: 100%; }
.week h3 svg { width: 18px; height: 18px; color: var(--accent); }
.week div { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.week i.dot { width: 16px; height: 16px; border-radius: 50%; background: var(--ok); display: inline-grid; place-items: center; flex: none; }
.week i.dot svg { width: 11px; height: 11px; color: #fff; }
.week i.dot.zero { background: var(--panel-3); }
.prog-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pc { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; }
.pc .th { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--panel-3) center / cover; }
.pc .th .chip { position: absolute; left: 10px; top: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; display: inline-flex; gap: 5px; align-items: center; }
.pc .th .chip svg { width: 13px; height: 13px; } .pc .th .chip.green { background: var(--ok); }
.pc .th .dur { position: absolute; right: 10px; bottom: 12px; background: rgba(0, 0, 0, .7); color: #fff; font: 600 12px var(--mono); padding: 3px 7px; border-radius: 6px; }
.pc .th .pbar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0, 0, 0, .45); } .pc .th .pbar i { display: block; height: 100%; background: var(--accent); }
.pc b { font-size: 15px; } .pc .small { color: var(--ink-2); }
.sec-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sec-h h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; display: flex; gap: 10px; align-items: center; } .sec-h h2 svg { width: 24px; height: 24px; color: var(--accent); }
.fchips { display: flex; gap: 10px; flex-wrap: wrap; }
.fchip { min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.fchip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.ptile { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.ptile .th { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--panel-3) center / cover; }
.ptile .th .dur { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .7); color: #fff; font: 600 12px var(--mono); padding: 3px 7px; border-radius: 6px; }
.ptile .th .off { position: absolute; left: 10px; bottom: 10px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 6px; }
.ptile .bd { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.ptile .bd .top { display: flex; align-items: flex-start; gap: 8px; } .ptile .bd b { font-size: 15.5px; flex: 1; }
.ptile .st { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.ptile .st i { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--info); flex: none; }
.ptile .st i svg { width: 11px; height: 11px; color: #fff; } .ptile .st.ok i { background: var(--ok); } .ptile .st.warn i { background: var(--warn); }
.more { position: relative; } .more > button { width: 32px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 18px; line-height: 1; }
.more > button:hover { background: var(--panel-2); }
.menu { position: absolute; right: 0; top: 32px; z-index: 20; min-width: 210px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.menu a, .menu button { text-align: left; padding: 9px 10px; border-radius: 8px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13.5px; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--panel-3); }
.pgrid.big { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.plist { display: flex; flex-direction: column; gap: 10px; }
.plist .ptile { flex-direction: row; align-items: center; } .plist .ptile .th { width: 180px; flex: none; } .plist .ptile .bd { flex: 1; }
.empty-note { padding: 26px; text-align: center; color: var(--ink-2); border: 1.5px dashed var(--line-2); border-radius: 14px; }
.topsearch { min-height: 38px; width: min(320px, 40vw); padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); }

.shell > .rail, .shell > .sidebar { grid-column: 1; grid-row: 1; }
.shell > .main { grid-column: 2; grid-row: 1; }
@media (max-width: 760px) { .shell > .main { grid-column: 1; } .shell.wide .sidebar { display: none; } }
.sb-nav button:disabled { cursor: default; opacity: .75; } .sb-nav button:disabled:hover { background: none; color: var(--ink-2); }

.seg button svg { width: 16px; height: 16px; }
.stat { padding: 20px 12px; }

.act.story { flex-direction: row; justify-content: flex-start; gap: 18px; padding: 22px 28px; border: 1.5px solid var(--lime); background: var(--panel); }
.act.story .ic { width: 54px; height: 54px; flex: none; display: grid; place-items: center; color: var(--lime); }
.act.story .ic svg { width: 40px; height: 40px; }
.act.story b { display: block; font-size: 22px; text-align: left; } .act.story small { display: block; font-weight: 400; color: var(--ink-2); margin-top: 2px; text-align: left; }
.act .chev { margin-left: auto; font-size: 26px; opacity: .85; }
.act.story:hover { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(184, 242, 39, .15); }
.pc .th .chip.green { background: var(--lime); color: #1a2400; }
.pc .pb2 { height: 5px; border-radius: 3px; background: var(--panel-3); overflow: hidden; } .pc .pb2 i { display: block; height: 100%; background: var(--accent); }

.box.glow { padding-bottom: 64px; }
.storage .bar > i { background: var(--accent); }
.act.big small, .act.story small { font-size: 14.5px; }
@media (max-width: 760px) {
  .shell.wide { grid-template-columns: 1fr; }
  .shell.wide .rail { display: flex; }
  .hero { padding: 24px 20px; } .studio-home { gap: 20px; }
  .ovw { gap: 8px; } .stat { padding: 14px 6px; } .stat b { font-size: 26px; } .stat span { font-size: 12px; text-align: center; }
  .box { padding: 18px; } .topsearch { width: 46vw; }
  .act.big, .act.story { padding: 18px 20px; } .act.big b, .act.story b { font-size: 19px; }
}

/* header band: open, full width; a header image (when Jaye supplies one) sits on the right and fades
   into the page. Until then: an abstract pink/lime glow — no project footage, no faces. */
.hero { border: 0; border-radius: 20px; min-height: 190px; padding: 40px 44px;
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 85%, transparent) 38%, transparent 70%),
    var(--hero-img, none) right center / cover no-repeat,
    radial-gradient(40% 120% at 88% 30%, rgba(255, 46, 136, .55), transparent 70%),
    radial-gradient(30% 90% at 72% 110%, rgba(184, 242, 39, .28), transparent 70%),
    radial-gradient(28% 80% at 98% 100%, rgba(255, 46, 136, .35), transparent 70%),
    var(--panel); }
.hero .hero-in { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(32px, 4vw, 52px); font-weight: 900; letter-spacing: -.03em; color: var(--ink); }
.hero h1::after { content: ""; display: block; width: 190px; height: 6px; margin-top: 6px; border-radius: 6px; background: var(--lime); transform: rotate(-1.5deg); }
.hero p { font-size: 17px; }

/* timeline tools: track heights, scrubbing playhead, cut tool */
.tl-head { position: relative; }
.tl-head.on .tname { color: var(--accent); }
.trz { position: absolute; left: 0; right: 0; bottom: -4px; height: 8px; cursor: row-resize; z-index: 2; touch-action: none; }
.trz::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 28px; height: 3px; margin-left: -14px; border-radius: 3px; background: var(--line-2); opacity: 0; transition: opacity .15s; }
.tl-head:hover .trz::after, .trz:hover::after { opacity: 1; background: var(--accent); }
@media (pointer: coarse) { .trz { height: 16px; bottom: -8px; } .trz::after { opacity: .7; } }
body.rz-row, body.rz-row * { cursor: row-resize !important; user-select: none; }
.tl-ruler { cursor: ew-resize; touch-action: none; }
.playhead .grip { position: absolute; top: 0; left: -9px; width: 20px; height: 28px; pointer-events: auto; cursor: ew-resize; touch-action: none; }
.playhead::before { border-width: 8px; left: -7px; }
.playhead::after { content: ""; position: absolute; top: 0; left: -5px; width: 12px; height: 12px; border-radius: 3px 3px 6px 6px; background: var(--bad); }
body.scrubbing, body.scrubbing * { cursor: ew-resize !important; user-select: none; }
.tl-lanes { touch-action: pan-y; }
#lanes.blade, #lanes.blade .clip, #lanes.blade .clip .h { cursor: crosshair; }
.tools button { display: inline-flex; align-items: center; gap: 5px; }
.tools svg, #split svg, #tdel svg, #addtrack svg { width: 14px; height: 14px; }
#tools button.on[data-tool="blade"] { background: var(--accent); color: #fff; }
.tl-head .lnum { flex: none; min-width: 16px; height: 16px; border-radius: 5px; background: var(--t-graphic); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; margin-top: 1px; }
input[type=range] { accent-color: var(--accent); }

/* demo: simulated vs real */
.simtag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px;
  color: #3a2a00; background: repeating-linear-gradient(135deg, #ffd166 0 6px, #ffc23d 6px 12px); vertical-align: middle; }
.simnote { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; border: 1px dashed #ffc23d; background: color-mix(in srgb, #ffc23d 10%, transparent); font-size: 13.5px; }
.simnote b:first-child { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px; background: #ffc23d; color: #3a2a00; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.simbox { position: relative; margin: 8px 0; padding: 8px; border-radius: 12px; border: 1px dashed #ffc23d; }
.simbox video { width: 100%; max-height: 420px; background: #000; border-radius: 8px; margin-top: 6px; display: block; }
.pill.demo-info { cursor: pointer; text-decoration: underline dotted; }
.steps { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.steps li { color: var(--ink-3); } .steps li.now { color: var(--ink); font-weight: 600; } .steps li.now::after { content: " …"; }
.steps li.done { color: var(--ok, #2fb36a); } .steps li.done::after { content: " ✓"; }
.realgrid { display: grid; gap: 14px; font-size: 13.5px; line-height: 1.5; } .realgrid h3 { font-size: 14px; margin: 0 0 6px; } .realgrid ul { margin: 0; padding-left: 18px; }

/* the timeline scrolls up/down when tracks are taller than the panel — keep that visible */
#tlbody { overflow: auto; scrollbar-gutter: stable; }
#tlbody::-webkit-scrollbar { width: 10px; height: 10px; } #tlbody::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 2px solid var(--panel); }
.hsplit { cursor: row-resize; }

.sbrow { display: flex; align-items: center; gap: 10px; transition: border-color .15s, transform .15s; }
.sbrow .bd { flex: 1; min-width: 0; cursor: pointer; } .sbrow:hover { border-color: var(--accent); }
.sbacts { display: flex; gap: 6px; padding-right: 14px; } .menu .danger { color: var(--bad); }

/* brand kits */
.bkcard { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; } .bkcard:hover { border-color: var(--accent); transform: translateY(-2px); }
.bkcard .chev { font-size: 22px; color: var(--ink-3); }
.bklogo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: var(--panel-2); border: 1px solid var(--line); flex: none; }
.bklogo.empty { display: grid; place-items: center; font-weight: 800; color: var(--accent); }
.bklogo.big { width: 72px; height: 72px; border-radius: 14px; font-size: 26px; }
.sw2 { display: inline-block; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); vertical-align: middle; }
.bk { display: grid; gap: 16px; max-width: 980px; } .bk .card h2 { margin: 0 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } @media (max-width: 760px) { .grid3 { grid-template-columns: 1fr; } }
.row.wrap { flex-wrap: wrap; }
.colchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.colchip input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; border-radius: 6px; cursor: pointer; }
.suggest { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px dashed var(--accent); }
.btn.pulse { box-shadow: 0 0 0 3px var(--accent-soft); }
.clip:not(.k-caption) .cl::first-letter { text-transform: uppercase; }
.clip .cl { display: inline-block; }

/* stage bar stays one row: in a narrow preview, labels give way to icons */
.stagewrap { container-type: inline-size; }
.stagebar { flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.stagebar .opentab .ico { display: none; }
@container (max-width: 760px) { #coverinfo { display: none; } #setcover .lbl, .stagebar .opentab .lbl { display: none; } .stagebar .opentab .ico { display: inline; } .stagebar .opentab.left .lbl { display: none; } }
@container (max-width: 560px) { .stagebar .timecode { font-size: 11px; } #focus button { padding-inline: 8px; } }
.stage.centreline::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--accent); opacity: .7; z-index: 99; pointer-events: none; }
#els [data-beat] { touch-action: none; } .stage .el.hoverable { cursor: grab; } .stage .el.hoverable:active { cursor: grabbing; }
.looks .seg { margin-top: 6px; } .sw2.pick { cursor: pointer; padding: 0; } .sw2.pick.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.looks input[type=color] { width: 30px; height: 28px; border: 0; padding: 0; background: none; cursor: pointer; }

#rzh { position: absolute; z-index: 98; background: #fff; border: 2px solid var(--accent); border-radius: 4px; cursor: nwse-resize; touch-action: none; box-sizing: border-box; }

/* audio: the transcript scrolls inside its box; on phones a play/pause button floats within thumb reach */
.ae-text .transcript { max-height: min(62vh, 640px); overscroll-behavior: contain; position: relative; }
.fab-play { display: none; }
@media (max-width: 760px) {
  .ae-text .transcript { max-height: 42vh; }
  .fab-play { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; width: 58px; height: 58px; border-radius: 50%;
    border: 0; background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
  .fab-play svg { width: 24px; height: 24px; }
}
/* export: even square cards across the page, details in a panel */
.xgrid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.xtile { all: unset; box-sizing: border-box; cursor: pointer; aspect-ratio: 1 / 1; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: border-color .15s, transform .15s; }
.xtile:hover, .xtile:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.xtile .th { position: relative; flex: 1; min-height: 0; background: var(--panel-3) center 25% / cover; display: grid; place-items: center; }
.xtile .th.has .ph-ic { display: none; } .xtile .th .ph-ic svg { width: 34px; height: 34px; color: var(--ink-3); }
.xtile .th .tag { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.7); color: #fff; font: 700 11.5px var(--mono); padding: 3px 8px; border-radius: 6px; }
.xtile .bd { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.xtile .bd b { font-size: 14.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xtile .badge { align-self: flex-start; }
.xdlg { width: min(940px, 94vw); } .xdlg .mh { display: flex; align-items: center; gap: 8px; }
.xbody { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.xvid video { width: 100%; max-height: 60vh; background: #000; border-radius: 10px; margin-top: 8px; display: block; }
.xside { display: grid; gap: 12px; align-content: start; } .xstep { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.xstep h3 { font-size: 13.5px; margin: 0 0 8px; } .xcover { width: 64px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
@media (max-width: 760px) { .xbody { grid-template-columns: 1fr; } .xgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── No-camera video: scenes · preview · look & sound ─────────────────────────── */
.gx { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(240px, 360px) minmax(260px, 340px); gap: 14px; align-items: start; }
.gx h2 { font-size: 15px; margin: 14px 0 8px; } .gx h2:first-child { margin-top: 0; }
.gx-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; } .gx-h h2 { margin: 0; }
.gx-scenes { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#gx-list { display: flex; flex-direction: column; gap: 10px; }
.gx-sc { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); padding: 10px; cursor: pointer; }
.gx-sc.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.gx-sch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.gx-sch select { width: auto; min-width: 110px; } .gx-n { width: 22px; text-align: center; color: var(--ink-2); }
.gx-dur { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ink-2); } .gx-dur input { width: 68px; }
.gx-fields .field { margin-bottom: 8px; } .gx-fields textarea { resize: vertical; }
.gx-item { display: grid; grid-template-columns: 1fr minmax(90px, 40%) auto; gap: 6px; margin-bottom: 6px; }
.gx-add { display: flex; gap: 8px; } .gx-add select { flex: 1; }
.gx-view { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gx-stage { position: relative; width: 100%; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); }
.gx-stage iframe { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; border: 0; transform-origin: 0 0; pointer-events: none; }
.gx-ctl { display: flex; align-items: center; gap: 8px; } .gx-ctl input[type=range] { flex: 1; } .mono { font-variant-numeric: tabular-nums; }
.gx-note { margin: 0; }
.gx-side { min-width: 0; } .gx-side .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.gx-side .check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; padding: 3px 0; }
.gx-colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 6px; }
.gx-colors label { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--ink-2); }
.gx-colors input[type=color] { width: 100%; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }
.gx-colors input:disabled { opacity: .7; cursor: default; }
.gx-roles summary { cursor: pointer; font-size: 13.5px; font-weight: 600; padding: 4px 0 8px; }
.gx-role { display: grid; grid-template-columns: 92px 1fr auto; gap: 6px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.gx-role select { min-width: 0; }
.gx-file { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--bg-2); }
.warn-t { color: var(--warn); margin: 0 0 6px; }
.gx-render { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.gx-render video { width: 100%; max-height: 360px; background: #000; border-radius: 10px; } .gx-render .btn { margin-left: 6px; }
@media (max-width: 1180px) { .gx { grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); } .gx-side { grid-column: 1 / -1; } }
@media (max-width: 760px) { .gx { grid-template-columns: minmax(0, 1fr); } .gx-view { position: static; order: -1; } .gx-stage { max-width: 250px; margin: 0 auto; } .gx-side { grid-column: auto; } }

/* ── Sound Library ─────────────────────────────────────────────────────────── */
.snd-set h2 { margin: 0 0 4px; font-size: 17px; } .snd-set h3 { margin: 10px 0 2px; font-size: 14.5px; }
.snd-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.snd-roles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-top: 8px; }
.snd-role { display: grid; grid-template-columns: 96px 1fr auto; gap: 6px; align-items: center; font-size: 13.5px; } .snd-role.dim { opacity: .55; }
.snd-lib { margin-top: 18px; } .snd-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .snd-filters select { width: auto; } .snd-filters h2 { margin: 0; font-size: 17px; }
.snd-cat { font-size: 14.5px; margin: 16px 0 8px; }
.snd-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.snd-it { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); min-width: 0; }
.snd-it .grow { min-width: 0; display: flex; flex-direction: column; } .snd-it b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snd-it.fav { border-color: var(--accent); } .snd-it.never { opacity: .5; }
@media (max-width: 640px) { .snd-row { grid-template-columns: 1fr; } }

/* ── Several clips joined into one recording ─────────────────────────────── */
.cl-list { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; margin: -4px 0 10px; background: var(--bg-2); }
.cl-h { margin-bottom: 6px; color: var(--ink-2); }
.cl-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto auto; gap: 6px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line); }
.cl-n { text-align: center; color: var(--ink-2); } .cl-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.cl-t { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-2); } .cl-t input { width: 66px; min-height: 30px; padding: 4px 6px; }
.cl-b { display: inline-flex; }
@media (max-width: 560px) { .cl-row { grid-template-columns: 22px minmax(0, 1fr) auto; } .cl-t { grid-column: 2; } .cl-b { grid-column: 3; grid-row: 1; } }
#tx .seam { display: inline-block; margin: 6px 4px; padding: 2px 10px; border-radius: 999px; border: 1px dashed var(--accent); color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; }

/* ── Log in ─────────────────────────────────────────────────────────────── */
.login-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: min(100%, 380px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; text-align: left; }
.login-card h1 { margin: 10px 0 2px; font-size: 22px; } .login-card .btn { width: 100%; margin-top: 6px; }
.login-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #ff4f9c, #e0186f); }
.login-err { color: var(--bad); margin: 0 0 6px; } .login-note { background: var(--warn-soft); color: var(--warn); padding: 8px 10px; border-radius: 8px; font-size: 13px; }

/* Settings page */
.set-page { display: grid; gap: 16px; max-width: 820px; }
.set-sec h2 { margin: 0 0 10px; font-size: 17px; }
.set-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .set-two { grid-template-columns: 1fr; } }
.set-rowu { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.set-rowu:first-child { border-top: 0; }
.set-rowu select { width: auto; }
.set-link { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--accent-soft); }
.set-link p { margin: 0 0 8px; }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
