:root {
  --bg: #0b0b0c;
  --panel: #121214;
  --panel-2: #17171a;
  --line: #242428;
  --line-2: #2e2e33;
  --text: #ecebe7;
  --muted: #8f8a82;
  --faint: #847f77; /* 4.5:1 on every dark surface (was #5f5b55, 2.9:1) */
  --accent: #e9e4da;
  --accent-ink: #0c0c0d;
  --ok: #a3b8c9;
  --warn: #d9b26f;
  --bad: #e07a6e;
  --radius: 12px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --side-bg: #0d0d0f;
  --top-bg: rgba(11, 11, 12, 0.88);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 { font-size: 24px; letter-spacing: -0.02em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
code, pre { font-family: var(--mono); font-size: 12px; }
pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; max-height: 420px; white-space: pre-wrap; word-break: break-word; }

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side-bg); }
.mark { display: flex; gap: 10px; align-items: center; padding: 0 8px 18px; }
.mark strong { display: block; font-size: 15px; letter-spacing: 0.02em; }
.mark small { display: block; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.mark-dot { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #8f8a82); }
nav .grp { margin: 14px 8px 4px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
nav a { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 13px; }
nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
nav a.on { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
nav .badge { font-size: 10px; background: var(--line-2); color: var(--text); padding: 1px 6px; border-radius: 99px; }
.side-foot { margin: 18px 8px 0; font-size: 11px; color: var(--faint); }

main { min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--top-bg); backdrop-filter: blur(8px); z-index: 5; }
.crumb { color: var(--muted); font-size: 13px; }
.brand-switch { display: flex; align-items: center; gap: 10px; }
.brand-switch label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.view { padding: 26px 28px 60px; max-width: 1280px; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .view { padding: 18px 16px; } .top { padding: 12px 16px; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.card + .card, .section { margin-top: 14px; }
.grid > .card, .grid > .section { margin-top: 0; }
.row select { width: auto; min-width: 180px; }
.kpi .v { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.kpi .l { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.note { border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.note strong { color: var(--text); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.tbl { overflow-x: auto; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(163, 184, 201, 0.4); }
.pill.warn { color: var(--warn); border-color: rgba(217, 178, 111, 0.4); }
.pill.bad { color: var(--bad); border-color: rgba(224, 122, 110, 0.45); }
.pill.acc { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.chip { display: inline-block; font-size: 11px; padding: 1px 7px; margin: 2px 4px 2px 0; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }

button, .btn { font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.sm { padding: 3px 9px; font-size: 12px; }
input, select, textarea { font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; width: 100%; }
textarea { min-height: 80px; resize: vertical; font-family: var(--font); }
textarea.code { font-family: var(--mono); font-size: 12px; min-height: 200px; }
input[type="checkbox"], input[type="radio"] { width: auto; }
label.f { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 10px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; margin-right: 14px; font-size: 13px; }
select#brandSel { width: auto; min-width: 210px; }

.stepper { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 14px; }
.stepper span { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--faint); }
.stepper span.done { color: var(--muted); }
.stepper span.cur { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 120px; }
.col h3 { display: flex; justify-content: space-between; }
.item { display: block; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 8px; color: var(--text); font-size: 13px; }
.item:hover { border-color: var(--muted); text-decoration: none; }
.item .blk { color: var(--warn); font-size: 11px; margin-top: 4px; }

.agent { display: flex; flex-direction: column; gap: 6px; }
.agent .num { font-family: var(--mono); color: var(--faint); font-size: 11px; }
details summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 6px; }
.swatch { display: inline-block; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line-2); margin-right: 6px; vertical-align: middle; }
.bar { height: 6px; background: var(--line); border-radius: 99px; position: relative; overflow: hidden; min-width: 120px; }
.bar i { position: absolute; top: 0; bottom: 0; background: var(--muted); opacity: 0.45; border-radius: 99px; }
.bar b { position: absolute; top: -2px; width: 3px; height: 10px; background: var(--accent); border-radius: 2px; }
.dialogue p { margin: 0 0 8px; }
.dialogue .sp { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-right: 6px; }
.empty { color: var(--muted); padding: 28px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); }

#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: 420px; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: in 0.25s ease-out; }
.toast.bad { border-left-color: var(--bad); }
.toast ul { margin: 6px 0 0; padding-left: 18px; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.prompter { position: fixed; inset: 0; background: #000; color: #f4f1ea; z-index: 40; overflow: hidden; }
.prompter .txt { font-size: 54px; line-height: 1.45; padding: 45vh 12vw; font-weight: 500; letter-spacing: -0.01em; }
.prompter .txt .dir { color: #8f8a82; font-size: 30px; display: block; }
.prompter .ctl { position: fixed; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 41; }
.prompter .guide { position: fixed; left: 0; right: 0; top: 45vh; height: 2px; background: rgba(233, 228, 218, 0.25); }

/* ---- Milestone 3 ---- */
.today-h { font-size: 18px; margin-top: 28px; }
.script-card .hook { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 6px 0 10px; }
.beats { display: flex; gap: 4px; flex-wrap: wrap; }
.btn.primary-link { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
a.btn:hover { text-decoration: none; }
.range-bar { gap: 8px; padding: 10px 12px; }
.range-bar select, .range-bar input { width: auto; }
.kpi small { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .chg { font-size: 12px; margin-top: 4px; color: var(--muted); }
.kpi .chg.up { color: var(--ok); }
.kpi .chg.down { color: var(--bad); }
.kpi .cav { font-size: 11px; color: var(--faint); margin-top: 6px; line-height: 1.35; }
.kpi .src { font-size: 10px; color: var(--faint); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }
.legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.contrib { display: grid; grid-template-columns: 90px 1fr 120px; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
#bell a { color: var(--warn); display: block; margin-bottom: 6px; }
.demo-banner { background: #3a2a0f; color: #f3d9a4; border-bottom: 1px solid #6b4f1d; padding: 8px 28px; font-size: 12px; letter-spacing: 0.04em; position: sticky; top: 0; z-index: 6; }

/* ---- command center (M4) ---- */
.top-mid { flex: 1; display: flex; gap: 10px; align-items: center; margin: 0 18px; position: relative; }
.top-mid input[type=search] { max-width: 460px; }
.top-mid select { width: auto; }
#liveStatus { white-space: nowrap; font-size: 12px; }
.gresults { position: absolute; top: 40px; left: 0; width: min(560px, 90vw); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; z-index: 30; box-shadow: 0 16px 40px rgba(0,0,0,.45); max-height: 60vh; overflow: auto; }
.gresults .gr { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.gresults a.gr:hover { background: var(--panel); text-decoration: none; }
.action-card { display: block; color: var(--text); transition: border-color .15s; }
.action-card:hover { border-color: var(--accent); text-decoration: none; }
.action-card.hot { border-color: var(--accent); }
.action-card .v { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; }
.action-card .l { font-size: 15px; margin-bottom: 6px; }
.action-card .go { margin-top: 10px; color: var(--accent); font-weight: 600; }
.exc { border-color: rgba(224,122,110,.5); }
.agent-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.adot { font-size: 11px; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 8px; color: var(--muted); }
.adot i { display: block; font-style: normal; font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.adot.ok { border-color: rgba(163,184,201,.6); color: var(--ok); }
.adot.warn { border-color: rgba(217,178,111,.5); }
.adot.bad { border-color: rgba(224,122,110,.5); }
.agent-metrics { gap: 14px; font-size: 12px; color: var(--muted); }
.agent-metrics strong { color: var(--text); }
.colbad { border-color: rgba(224,122,110,.5); }
.item .thumb { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; margin-bottom: 6px; max-height: 160px; }
.renders { display: flex; flex-wrap: wrap; gap: 14px; }
.render { width: 240px; }
.render video { width: 240px; aspect-ratio: 9/16; background: #000; border-radius: 10px; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 70px; }
.spark i { flex: 1; max-width: 18px; background: var(--accent); opacity: .7; border-radius: 2px 2px 0 0; min-height: 2px; }
@media (max-width: 1000px) { .top { flex-wrap: wrap; gap: 8px; } .top-mid { order: 3; flex-basis: 100%; margin: 0; flex-wrap: wrap; } }

/* ---- Milestone 5: light mode, mobile navigation, intelligence pages, assistant ---- */
:root[data-theme="light"] {
  --bg: #f6f5f2; --panel: #ffffff; --panel-2: #f0eee9; --line: #e3e0d9; --line-2: #d4d0c7;
  --text: #19181a; --muted: #6b665e; --faint: #6e6961; --accent: #2a2826; --accent-ink: #fbfaf7;
  --ok: #3f6f8f; --warn: #9a6a14; --bad: #b4473a; --side-bg: #efede8; --top-bg: rgba(246, 245, 242, 0.9);
  color-scheme: light;
}
.theme-btn, .nav-toggle { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.nav-toggle { display: none; }
.who { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1000px) {
  .nav-toggle { display: inline-block; }
  .side nav, .side .side-foot { display: none; }
  .side.open nav, .side.open .side-foot { display: block; }
  .side { padding: 12px 14px; }
  .mark { padding-bottom: 6px; justify-content: space-between; }
}
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.vcard .thumb { aspect-ratio: 16/9; background: var(--panel-2); display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; overflow: hidden; }
.vcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.vcard .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.vcard .t { font-weight: 600; font-size: 13px; line-height: 1.35; }
.vcard label.pick { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.bar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 6px; } }
.ask-fab { position: fixed; right: 20px; bottom: 20px; z-index: 30; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 99px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.ask-panel { position: fixed; right: 20px; bottom: 70px; z-index: 31; width: min(420px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 100px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.ask-panel[hidden] { display: none; }
.ask-log { padding: 12px 14px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.ask-log .me { align-self: flex-end; background: var(--panel-2); padding: 6px 10px; border-radius: 10px; max-width: 85%; }
.ask-log .bot { max-width: 95%; }
.ask-log .bot .src { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.ask-panel form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.ask-panel input { flex: 1; }
@media (max-width: 1000px) {
  .side .who { display: none; }
  .side.open .who { display: flex; }
  html, body { overflow-x: hidden; }
  .shell, main, .view { max-width: 100vw; min-width: 0; }
  .view .row { flex-wrap: wrap; gap: 8px; }
  .view table { display: block; overflow-x: auto; }
}
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .top, .top-mid, .brand-switch { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  .top-mid input, .brand-switch select { min-width: 0; max-width: 100%; }
  .mark .nav-toggle { margin-left: auto; }
}

/* ---- AI Director Studio & Style Presets ---- */
.studio-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.studio-head h1 { margin: 4px 0; }
.studio-head select { max-width: 240px; }
.stages { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.stage { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 11px; text-transform: capitalize; color: var(--muted); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stage small { text-transform: none; color: var(--faint); }
.stage .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.stage.ok .dot { background: var(--ok); } .stage.warn .dot { background: var(--warn); } .stage.bad .dot { background: var(--bad); }
.stage.warn { color: var(--text); border-color: var(--warn); }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.studio-side { position: sticky; top: 70px; display: flex; flex-direction: column; }
.player video { width: 100%; max-height: 62vh; background: #000; border-radius: 10px; display: block; margin: 0 auto 6px; aspect-ratio: 9/16; max-width: 360px; }
.player .ph { aspect-ratio: 16/6; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--faint); background: var(--panel-2); border-radius: 10px; padding: 20px; }
.board { display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 12px; scroll-snap-type: x proximity; }
.scene { flex: 0 0 220px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; scroll-snap-align: start; display: flex; flex-direction: column; }
.scene.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.scene.dropped { opacity: 0.5; }
.scene .frame { aspect-ratio: 9/16; background: #000; display: flex; align-items: center; justify-content: center; color: #8f8a82; font-size: 12px; overflow: hidden; }
.scene .frame img { width: 100%; height: 100%; object-fit: contain; } /* the whole frame, exactly as rendered */
.sc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.sc-body .dlg { font-style: italic; margin: 0; color: var(--text); }
.plan { display: grid; grid-template-columns: 64px 1fr; gap: 2px 8px; margin: 0; }
.plan dt { color: var(--faint); font-size: 11px; }
.plan dd { margin: 0; overflow-wrap: anywhere; }
.sc-body button { font-size: 11px; padding: 4px 8px; }
.timeline { display: flex; gap: 2px; height: 30px; margin-top: 6px; }
.tl-seg { background: var(--line-2); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; cursor: pointer; min-width: 18px; }
.tl-seg.sel { background: var(--accent); color: var(--accent-ink); }
.tl-seg.dropped { background: repeating-linear-gradient(45deg, var(--panel-2), var(--panel-2) 4px, var(--line) 4px, var(--line) 8px); color: var(--faint); }
.tl-legend { font-size: 11px; margin-top: 6px; }
.vlist { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.vrow { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; font-size: 12px; }
.vrow.cur { background: var(--panel-2); }
.vrow button { font-size: 11px; padding: 3px 8px; }
.chat .clog { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: 12px; margin-bottom: 8px; }
.chat .me { align-self: flex-end; background: var(--panel-2); padding: 5px 9px; border-radius: 10px; max-width: 90%; }
.chat .bot { max-width: 95%; } .chat .bot.unrecognized, .chat .bot.rejected { color: var(--warn); }
.cform { display: flex; gap: 6px; } .cform input { flex: 1; min-width: 0; }
.ex { margin-top: 8px; } .ex .chip { cursor: pointer; }
.small { font-size: 12px; }
.feed { max-height: 360px; overflow-y: auto; font-size: 12px; display: flex; flex-direction: column; gap: 5px; }
.ev { position: relative; padding-right: 60px; } .ev .t { position: absolute; right: 0; top: 0; color: var(--faint); font-size: 11px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.pcard.def { border-color: var(--accent); }
.pthumb { height: 120px; background: linear-gradient(135deg, #1a1916, #2c2924 60%, #4a3f31); display: flex; align-items: center; justify-content: center; color: #d9d2c4; font-size: 12px; overflow: hidden; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.pbody { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.pbody button { font-size: 11px; padding: 4px 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack textarea { font-family: var(--mono); font-size: 12px; width: 100%; }
.own { color: var(--accent); font-size: 9px; }
@media (max-width: 1100px) { .studio-grid { grid-template-columns: minmax(0, 1fr); } .studio-side { position: static; } .stages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } .scene { flex-basis: 78vw; } }
.runs { display: inline-flex; gap: 3px; } .runs i { width: 8px; height: 16px; border-radius: 2px; background: var(--line-2); display: inline-block; }
.runs i.ok { background: var(--ok); } .runs i.warn { background: var(--warn); } .runs i.bad { background: var(--bad); }

/* ---- help, glossary, tour ---- */
.term { border-bottom: 1px dotted var(--muted); cursor: help; }
.whatis { margin-left: 12px; font-size: 11px; padding: 3px 9px; vertical-align: middle; font-weight: 500; letter-spacing: 0; }
.whatis-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: -4px 0 14px; font-size: 13px; max-width: 760px; }
.tour { position: fixed; z-index: 60; right: 24px; bottom: 84px; width: min(380px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.tour h3 { color: var(--text); font-size: 15px; text-transform: none; letter-spacing: 0; margin: 6px 0; }
.tour-prog { height: 4px; background: var(--panel-2); border-radius: 2px; overflow: hidden; margin-bottom: 8px; } .tour-prog i { display: block; height: 100%; background: var(--accent); }
.tour-hl { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.guide summary { cursor: pointer; } .guide p { margin-top: 8px; }

/* ---- Creative Inbox / Footage Vault ---- */
.drop { border-style: dashed; } .drop.over { border-color: var(--accent); background: var(--panel-2); }
.linklike { text-decoration: underline; cursor: pointer; color: var(--accent); }
.upl { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 12px; margin-top: 6px; } .upl .bar { grid-column: 1 / -1; }
.bad-t { color: var(--bad); }
.ok-t { color: var(--ok, #3fa66b); }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.asset { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.asset.failed { border-color: var(--bad); }
.aprev { position: relative; aspect-ratio: 1; background: var(--panel-2); display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; overflow: hidden; }
.aprev img { width: 100%; height: 100%; object-fit: cover; } .aprev p { padding: 10px; font-size: 12px; color: var(--text); margin: 0; }
.aprev .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.abody { padding: 8px 9px; display: flex; flex-direction: column; gap: 4px; }
.sugg { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.thumbs { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; } .thumbs img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.vres { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.vres img, .vph { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; }
.moment { font-size: 12px; margin-top: 4px; } .moment code { color: var(--accent); }

/* ---- Post & Story Studio ---- */
.chip.acc { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; }
.pick-grid label { position: relative; cursor: pointer; } .pick-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.pick-grid input { position: absolute; top: 4px; left: 4px; } .pick-grid input:checked + img { outline: 3px solid var(--accent); }
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.dcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--text); }
.dcard:hover { text-decoration: none; border-color: var(--muted); }
.dthumb { aspect-ratio: 4/5; background: var(--panel-2); display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; overflow: hidden; }
.dthumb.story { aspect-ratio: 9/16; } .dthumb.ig_square { aspect-ratio: 1; } .dthumb img { width: 100%; height: 100%; object-fit: cover; }
.slides { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; } .slides img { height: 420px; border-radius: 10px; border: 1px solid var(--line); }
.slides.story img { height: 520px; }
.slide-edit { display: grid; grid-template-columns: 24px 1fr 1.6fr 1.6fr auto auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.slide-edit input { min-width: 0; }
@media (max-width: 900px) { .slide-edit { grid-template-columns: 24px 1fr; } .slides img { height: 300px; } }

/* ---- Content Planner ---- */
.cal { display: grid; gap: 8px; } .cal.week { grid-template-columns: repeat(7, minmax(0, 1fr)); } .cal.month { grid-template-columns: repeat(7, minmax(0, 1fr)); } .cal.day { grid-template-columns: minmax(0, 1fr); }
.cal-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); padding: 0 6px; }
.cal-day { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-day.today { border-color: var(--accent); } .cal-day.past { opacity: 0.6; } .cal-day.pad { background: transparent; border: 0; } .cal-day.over { background: var(--panel-2); border-style: dashed; }
.cal.month .cal-day { min-height: 92px; } .cal.month .pslot a.small, .cal.month .pslot .chip { display: none; }
.cal-date { font-size: 12px; font-weight: 600; color: var(--muted); }
.pslot { position: relative; background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: 8px; padding: 6px 8px 6px; font-size: 12px; cursor: grab; display: flex; flex-direction: column; gap: 3px; }
.pslot.reel, .pslot.tiktok, .pslot.short { border-left-color: #8a7bd1; } .pslot.carousel { border-left-color: #c79a4a; } .pslot.static_post { border-left-color: #4f9a8a; } .pslot.story { border-left-color: #c06a8e; }
.pslot .x { position: absolute; right: 4px; bottom: 2px; color: var(--faint); font-size: 14px; } .pslot .pill { font-size: 9px; }
.cal-day .add { display: flex; gap: 4px; margin-top: auto; } .cal-day .add select { flex: 1; min-width: 0; font-size: 11px; padding: 2px; } .cal-day .add button { padding: 2px 8px; }
@media (max-width: 900px) { .cal.week, .cal.month { grid-template-columns: minmax(0, 1fr); } .cal-h, .cal-day.pad { display: none; } .cal-day { min-height: 0; } }
.brframe { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 10px; background: #f3f1ec; margin-top: 8px; }

/* ---- Hook Lab / Format Mixer ---- */
.hookc { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); } .hookc.cur { background: var(--panel-2); padding: 12px; border-radius: 10px; }
.score { margin-top: 6px; } .score strong { font-size: 20px; margin-right: 6px; }
.factors { display: flex; gap: 4px; align-items: flex-end; height: 44px; margin-top: 4px; }
.factors span { width: 30px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.factors i { display: block; width: 14px; background: var(--accent); border-radius: 2px; min-height: 2px; } .factors b { font-size: 9px; font-weight: 500; color: var(--faint); }
.mix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; } .mix .big { font-size: 22px; font-weight: 700; }
.ba { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.formulas { max-height: 520px; overflow-y: auto; } .formulas details { padding: 6px 0; border-bottom: 1px solid var(--line); } .formulas summary { cursor: pointer; }
.feedbox { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; white-space: pre-wrap; font-size: 13px; }

.warnbox { border-color: var(--warn, #c98a00); margin: 8px 0; }
