/* HOA Ad Studio. One accent, 8px grid, one type scale (12 / 13 / 14 / 16 / 20 / 28), inline SVG icons only. */
:root {
  --bg: #000000; --panel: #050506; --raised: #0b0c0e; --raised2: #131417; --line: rgba(255,255,255,.16); --line2: rgba(255,255,255,.30);
  --text: #e9ebef; --mute: #9298a4; --faint: #626977;
  --accent: #8b97ff; --accent-ink: #0a0c1c; --accent-soft: rgba(139, 151, 255, .14); --accent-line: rgba(139, 151, 255, .45);
  --ok: #62c08d; --warn: #dcaa4a; --bad: #e86a73; --ok-soft: rgba(98, 192, 141, .13); --warn-soft: rgba(220, 170, 74, .13); --bad-soft: rgba(232, 106, 115, .13);
  --r: 8px; --r-sm: 6px; --shadow: 0 8px 32px rgba(0, 0, 0, .45);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif; --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f6f8; --panel: #ffffff; --raised: #f0f1f4; --raised2: #e7e9ee; --line: #e2e4ea; --line2: #cfd2da;
  --text: #16181d; --mute: #5d6472; --faint: #8a91a0;
  --accent: #4452e0; --accent-ink: #ffffff; --accent-soft: rgba(68, 82, 224, .09); --accent-line: rgba(68, 82, 224, .4);
  --ok: #1f8a57; --warn: #a76e0a; --bad: #c8333f; --ok-soft: rgba(31, 138, 87, .1); --warn-soft: rgba(167, 110, 10, .1); --bad-soft: rgba(200, 51, 63, .09);
  --shadow: 0 8px 32px rgba(20, 24, 40, .14); color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); display: grid; grid-template-rows: 48px auto minmax(0, 1fr); overflow: hidden; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 20px; line-height: 28px; font-weight: 600; }
h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
h4 { font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mute { color: var(--mute); } .faint { color: var(--faint); } .small { font-size: 13px; } .cap { font-size: 12px; line-height: 16px; } .mono { font-family: var(--mono); font-size: 12px; }
.grow { flex: 1 1 auto; min-width: 0; } .row { display: flex; align-items: center; gap: 8px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; } .stack8 { display: flex; flex-direction: column; gap: 8px; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-track { background: transparent; }

/* ---- shell */
#top { display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); min-width: 0; }
#top .brand { white-space: nowrap; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; margin-right: 8px; }
#top .brand i { width: 16px; height: 16px; border-radius: 5px; background: var(--accent); display: inline-block; }
#top .brand .brand-logo { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; display: block; background: #000; }
.strip { display: flex; align-items: center; gap: 8px; min-width: 0; }
.strip .chip { cursor: pointer; }
#main { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr) var(--dock); min-height: 0; }
:root { --rail: 248px; --dock: 352px; }
body.rail-off { --rail: 0px; } body.dock-off { --dock: 0px; }
@media (max-width: 1360px) { :root { --rail: 232px; --dock: 320px; } }

body.rail-off #rail, body.dock-off #director { display: none; }
#rail { grid-column: 1; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
#rail .rail-scroll { flex: 1 1 auto; overflow: auto; padding: 8px 8px 16px; min-height: 0; }
#rail .rail-head { padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--r); background: var(--raised); border: 1px solid var(--line); }
.avatar { position: relative; overflow: hidden; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.person select { background: transparent; border: 0; padding: 0; width: 100%; color: var(--text); cursor: pointer; }
.person select option { background: var(--raised); color: var(--text); }
.rail-sec { padding: 16px 8px 8px; display: flex; align-items: center; justify-content: space-between; }
.navitem { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border-radius: var(--r-sm); color: var(--text); border: 0; background: transparent; cursor: pointer; text-align: left; min-height: 32px; }
.navitem:hover { background: var(--raised); text-decoration: none; } .navitem.on { background: var(--accent-soft); color: var(--accent); }
.navitem .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navitem .ring { flex: none; }
.needs-item { align-items: flex-start; } .needs-item .sub { color: var(--mute); font-size: 12px; line-height: 16px; }
#center { grid-column: 2; overflow: auto; min-width: 0; position: relative; scroll-behavior: auto; }
#director { grid-column: 3; border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.page { padding: 24px 32px 80px; max-width: 1240px; margin: 0 auto; }
.page.narrow { max-width: 760px; } .page.mid { max-width: 960px; }
.dock-open-btn { position: fixed; right: 16px; bottom: 16px; z-index: 30; box-shadow: var(--shadow); }
.tray { border-top: 1px solid var(--line); padding: 8px 16px; background: var(--panel); }
.tray-h { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 24px; }
.tray-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; max-height: 160px; overflow: auto; }
.tray-row { font-size: 12px; line-height: 16px; } .tray-row b { font-weight: 600; display: block; }
.pausebar { background: var(--warn-soft); color: var(--warn); padding: 8px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* ---- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--raised); color: var(--text); cursor: pointer; white-space: nowrap; font-size: 13px; font-weight: 500; text-decoration: none; }
.btn:hover { background: var(--raised2); text-decoration: none; } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; } .btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--mute); } .btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn.bad { color: var(--bad); } .btn.good { border-color: var(--ok); color: var(--ok); }
.btn.sm { height: 24px; padding: 0 8px; font-size: 12px; } .btn.lg { height: 40px; padding: 0 24px; font-size: 14px; }
.btn.icon { width: 32px; padding: 0; } .btn.sm.icon { width: 24px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.input, .select, .area { width: 100%; background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 0 8px; height: 32px; color: var(--text); }
.area { height: auto; padding: 8px; resize: vertical; min-height: 96px; line-height: 20px; }
.select { cursor: pointer; padding-right: 4px; } .select option { background: var(--raised); color: var(--text); }
.input:focus, .select:focus, .area:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm, .select.sm { height: 24px; font-size: 12px; }
label.f { display: block; font-size: 12px; line-height: 16px; color: var(--mute); margin: 16px 0 4px; font-weight: 500; }
label.f:first-child { margin-top: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line2); background: var(--raised); font-size: 12px; color: var(--mute); white-space: nowrap; max-width: 100%; }
.chip.accent { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); } .chip.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.chip.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; } .chip.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
button.chip { cursor: pointer; } button.chip:hover { color: var(--text); border-color: var(--accent-line); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 24px; padding: 0 8px; border-radius: 12px; font-size: 12px; font-weight: 500; background: var(--raised); color: var(--mute); }
.pill.approved { color: var(--ok); background: var(--ok-soft); } .pill.needs_review { color: var(--warn); background: var(--warn-soft); } .pill.in_progress { color: var(--accent); background: var(--accent-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); flex: none; display: inline-block; }
.dot.approved { background: var(--ok); } .dot.needs_review { background: var(--warn); } .dot.in_progress { background: var(--accent); } .dot.running { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r-sm); overflow: hidden; background: var(--bg); }
.seg button { height: 24px; padding: 0 8px; border: 0; background: transparent; color: var(--mute); cursor: pointer; font-size: 12px; border-right: 1px solid var(--line); } .seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); } .seg button:hover:not(.on) { color: var(--text); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card.flat { background: transparent; }
.card h3 { margin-bottom: 8px; }
.kbd { display: inline-block; min-width: 20px; padding: 0 4px; height: 20px; line-height: 18px; text-align: center; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; font: 11px var(--mono); color: var(--mute); background: var(--raised); }
table { width: 100%; border-collapse: collapse; font-size: 13px; } th { text-align: left; font-weight: 500; color: var(--mute); font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); } td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; } tr:last-child td { border-bottom: 0; }
.pre { font: 12px/18px var(--mono); white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; max-height: 280px; overflow: auto; }

/* ---- skeleton and empty */
.sk { background: linear-gradient(90deg, var(--raised) 25%, var(--raised2) 50%, var(--raised) 75%); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: var(--r-sm); }
@keyframes sk { to { background-position: -200% 0; } }
.sk.row24 { height: 24px; } .sk.row40 { height: 40px; } .sk.card160 { height: 160px; border-radius: var(--r); } .sk.tall { aspect-ratio: 9 / 16; border-radius: var(--r); }
.empty { border: 1px dashed var(--line2); border-radius: var(--r); padding: 40px 24px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--mute); }
.empty b { color: var(--text); font-size: 16px; font-weight: 600; } .empty p { max-width: 460px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--accent); animation: rot .8s linear infinite; flex: none; } @keyframes rot { to { transform: rotate(360deg); } }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 16px; border-radius: var(--r); background: var(--raised); border: 1px solid var(--line); font-size: 13px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); } .notice.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); } .notice.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.notice > .btn:first-of-type { margin-left: auto; } .notice { align-items: center; }

/* ---- overlays */
.menu { position: fixed; z-index: 60; min-width: 208px; max-width: 280px; background: var(--raised); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow: auto; }
.menu .mi { display: flex; align-items: center; gap: 8px; padding: 0 8px; min-height: 32px; border-radius: var(--r-sm); border: 0; background: transparent; cursor: pointer; text-align: left; font-size: 13px; width: 100%; }
.menu .mi:hover { background: var(--raised2); } .menu .mi.on { color: var(--accent); } .menu .mi[disabled] { opacity: .4; cursor: not-allowed; }
.menu .sep { height: 1px; background: var(--line); margin: 4px 0; } .menu .mh { padding: 4px 8px; font-size: 12px; color: var(--faint); }
.menu .mr { padding: 4px 8px; display: flex; flex-direction: column; gap: 4px; }
#overlay { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px 16px; overflow: auto; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; width: 100%; max-width: 520px; box-shadow: var(--shadow); padding: 24px; }
.modal.wide { max-width: 880px; } .modal h2 { margin-bottom: 16px; } .modal .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.sheet { position: fixed; top: 48px; right: 0; bottom: 0; width: 432px; max-width: 100vw; z-index: 55; background: var(--panel); border-left: 1px solid var(--line2); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.sheet .sh { padding: 16px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; } .sheet .sb { padding: 24px; overflow: auto; flex: 1 1 auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--raised2); border: 1px solid var(--line2); border-radius: var(--r); padding: 8px 16px; box-shadow: var(--shadow); max-width: min(560px, 92vw); font-size: 13px; }
.toast.bad { border-color: var(--bad); }

/* ---- uploads (one component) */
.uz { border: 1px dashed var(--line2); border-radius: var(--r); padding: 16px; text-align: center; color: var(--mute); cursor: pointer; font-size: 13px; transition: border-color .12s, background .12s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; }
.uz:hover, .uz.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.uz.compact { padding: 8px; min-height: 32px; flex-direction: row; gap: 8px; } .uz.busy { opacity: .6; pointer-events: none; }
.uz b { color: var(--text); font-weight: 500; }

/* ---- productions home */
.ph-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.prod { display: flex; flex-direction: column; gap: 8px; cursor: pointer; padding: 16px; min-height: 128px; } .prod:hover { border-color: var(--accent-line); }
.prod .sub { color: var(--mute); font-size: 13px; }
.ring { width: 24px; height: 24px; position: relative; flex: none; } .ring svg { width: 24px; height: 24px; transform: rotate(-90deg); } .ring circle { fill: none; stroke-width: 3; } .ring .bg { stroke: var(--line2); } .ring .fg { stroke: var(--accent); stroke-linecap: round; }
.ring.done .fg { stroke: var(--ok); }
.stagedots { display: flex; gap: 4px; margin-top: auto; }
.stagedots i { height: 4px; flex: 1; border-radius: 2px; background: var(--line2); } .stagedots i.approved { background: var(--ok); } .stagedots i.needs_review { background: var(--warn); } .stagedots i.in_progress { background: var(--accent); }
.needs-home { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.needs-row { display: flex; align-items: center; gap: 16px; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; } .needs-row:hover { border-color: var(--accent-line); }

/* ---- start screen */
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.fmt { text-align: left; display: flex; flex-direction: column; gap: 8px; min-height: 160px; padding: 24px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--text); }
.fmt:hover { border-color: var(--accent-line); background: var(--raised); } .fmt .d { color: var(--mute); font-size: 13px; flex: 1; } .fmt .cost { color: var(--text); font-size: 13px; font-weight: 500; }
.cost-card { position: sticky; top: 24px; } .cost-card .line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--mute); } .cost-card .total { color: var(--text); font-weight: 600; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; font-size: 16px; }
.start-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }

/* ---- production page */
.prod-head { margin-bottom: 16px; }
.prod-head h1 { max-width: 720px; }
.prod-head h1 { font-size: 20px; line-height: 28px; }
.sticky-zone { position: sticky; top: 0; z-index: 20; background: var(--bg); margin: 0 -32px; padding: 0 32px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; flex-wrap: nowrap; gap: 0; }
.tab { display: flex; align-items: flex-start; gap: 4px; flex: 1 1 auto; white-space: normal; min-width: min-content; min-height: 40px; padding: 8px 6px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--mute); cursor: pointer; font-size: 12px; line-height: 16px; font-weight: 500; text-align: left; }
.tab .dot { margin-top: 4px; }
.tab:hover { color: var(--text); } .tab.on { color: var(--text); border-bottom-color: var(--accent); } .tab .turn { display: block; color: var(--warn); font-weight: 400; font-size: 12px; }
.tl { display: flex; gap: 2px; height: 40px; margin: 8px 0; align-items: stretch; }
.tl .seg1 { position: relative; min-width: 4px; border-radius: 4px; overflow: hidden; background: var(--raised); border: 1px solid var(--line); cursor: pointer; display: flex; align-items: flex-end; }
.tl .seg1 img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; } .tl .seg1:hover { border-color: var(--accent-line); }
.tl .seg1.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); } .tl .seg1.flag { border-color: var(--bad); }
.tl .seg1 span { position: relative; font-size: 10px; line-height: 12px; padding: 0 2px; color: #fff; text-shadow: 0 1px 2px #000; }
.stagebar { display: flex; align-items: center; gap: 8px; margin: 16px 0; flex-wrap: wrap; } .stagebar h2 { margin-right: 8px; }
.stagebar .sp { flex: 1 1 auto; }
.issues { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.issue-detail { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.ibanner { display: flex; align-items: center; gap: 16px; padding: 8px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.ibanner .lab { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--warn); flex: none; } .ibanner.ER .lab, .ibanner.CF .lab { color: var(--bad); }
.pipe { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; } .pipe .n { flex: 1 1 0; min-width: 96px; padding: 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); } .pipe .n b { display: block; font-size: 12px; font-weight: 600; } .pipe .n span { font-size: 12px; color: var(--mute); } .pipe .n.approved { border-color: var(--ok-soft); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.shot { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; min-width: 0; position: relative; }
.shot.flag { border-color: var(--bad); } .shot.hl { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); } .shot.sel { border-color: var(--accent-line); }
.shot .im { position: relative; aspect-ratio: 9 / 16; background: var(--bg); display: grid; place-items: center; color: var(--faint); font-size: 12px; overflow: hidden; }
.shot .im img, .shot .im video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot .chk { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(0, 0, 0, .5); border-radius: 4px; padding: 2px; display: grid; }
.shot .badges { position: absolute; bottom: 8px; left: 8px; right: 8px; z-index: 2; display: flex; gap: 4px; flex-wrap: wrap; pointer-events: none; }
.shot .badges .chip { background: rgba(0, 0, 0, .65); border-color: transparent; color: #fff; height: 20px; font-size: 11px; }
.shot .meta { overflow-wrap: anywhere; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-height: 88px; }
.shot .meta .t { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--mute); gap: 4px; white-space: nowrap; } .shot .meta .t span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.shot .meta .ln { font-size: 13px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shot.dens8 .meta .ln { -webkit-line-clamp: 1; } .shot.dens8 .meta { min-height: 64px; padding: 4px 8px; }
.takes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; } .tk { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px; font-size: 12px; } .tk.sel { border-color: var(--ok); }
.tk img, .tk video { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 4px; display: block; background: var(--bg); }
.shotrow { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); } .shotrow.flag { border-left: 2px solid var(--bad); padding-left: 8px; } .shotrow.hl { background: var(--accent-soft); }
.shotrow .line { font-weight: 600; margin-bottom: 8px; } .shotrow h4 { margin: 8px 0 4px; }
.phone { width: 270px; max-width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 16px; overflow: hidden; border: 1px solid var(--line2); position: relative; }
.phone video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.finals { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.vo-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.castgrp { margin-bottom: 32px; } .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 144px)); gap: 16px; } .cards > div > .uz { height: 100%; min-height: 160px; }
.ref { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); } .ref .im { aspect-ratio: 9 / 16; background: var(--bg); } .ref .im img { width: 100%; height: 100%; object-fit: cover; display: block; } .ref .cp { padding: 8px; font-size: 12px; }
.ref.pickable { cursor: pointer; } .ref.pickable:hover { border-color: var(--accent-line); } .ref.picked { border-color: var(--ok); }
.steps { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; } .steps .st { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--mute); } .steps .st.done { color: var(--text); } .steps .st svg { margin-top: 2px; }
.checklist li { margin-bottom: 8px; }
.warnline { font-size: 12px; color: var(--warn); overflow-wrap: anywhere; }

/* ---- director chat */
.dh { padding: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.dm { flex: 1 1 auto; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.msg-u { align-self: flex-end; max-width: 88%; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 12px 12px 4px 12px; padding: 8px 12px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.msg-a { align-self: flex-start; max-width: 96%; font-size: 13px; line-height: 20px; white-space: pre-wrap; word-break: break-word; }
.msg-a .acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.msg-a .typing { display: inline-flex; gap: 4px; } .msg-a .typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--mute); animation: pulse 1s infinite; } .msg-a .typing i:nth-child(2) { animation-delay: .15s; } .msg-a .typing i:nth-child(3) { animation-delay: .3s; }
.di { border-top: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.di .area { min-height: 56px; max-height: 160px; }
.ctxrow { display: flex; gap: 4px; flex-wrap: wrap; min-height: 24px; align-items: center; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; }
.meter { width: 40px; height: 4px; border-radius: 2px; background: var(--line2); overflow: hidden; } .meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .06s; }
.mic.rec { color: var(--bad); border-color: var(--bad); }
.attach { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line2); border-radius: var(--r-sm); font-size: 12px; background: var(--raised); }
#director.dropping { outline: 2px dashed var(--accent); outline-offset: -8px; }

/* ---- review overlay */
.rvbg { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; }
.rvbar { display: flex; align-items: center; gap: 16px; padding: 8px 24px; border-bottom: 1px solid var(--line); background: var(--panel); min-height: 48px; }
.rvmain { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; } .rvmedia { display: flex; align-items: stretch; justify-content: center; padding: 24px; min-height: 0; } .rvmedia img, .rvmedia video { height: 100%; aspect-ratio: 9 / 16; max-width: 100%; object-fit: contain; border-radius: var(--r); background: #000; }
.rvside { border-left: 1px solid var(--line); padding: 24px; overflow: auto; background: var(--panel); display: flex; flex-direction: column; gap: 16px; }
.rvnb { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .rvnb .th { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px; font-size: 12px; cursor: pointer; text-align: center; color: var(--mute); } .rvnb .th img, .rvnb .th video { width: 100%; height: 112px; object-fit: cover; border-radius: 4px; display: block; background: var(--bg); }
.vd { font-size: 12px; padding: 0 8px; border-radius: 12px; height: 24px; display: inline-flex; align-items: center; background: var(--raised); } .vd.flag { color: var(--bad); background: var(--bad-soft); } .vd.ok { color: var(--ok); background: var(--ok-soft); }

/* ---- sign in */
.out #rail, .out #director { display: none; } .out #main { grid-template-columns: minmax(0, 1fr) !important; } .out #center { grid-column: 1; }
.signin { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.signin .box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.people { display: flex; flex-direction: column; gap: 8px; }
.person-btn { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; text-align: left; color: var(--text); } .person-btn:hover { border-color: var(--accent-line); }
.kv { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); } .kv:last-child { border-bottom: 0; }
.qopt { display: flex; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; cursor: pointer; align-items: flex-start; } .qopt.on { border-color: var(--accent-line); background: var(--accent-soft); }
.sec { margin-bottom: 32px; }
.sec > h2 { margin-bottom: 16px; }

@media (max-width: 1180px) {
  #main { grid-template-columns: var(--rail) minmax(0, 1fr) 0; }
  #director { position: fixed; top: 48px; right: 0; bottom: 0; width: 320px; z-index: 40; box-shadow: var(--shadow); } body.dock-off #director { display: none; } body:not(.dock-force) #director { display: none; }
  body.dock-force #director { display: flex; }
  .page { padding: 24px 24px 80px; } .sticky-zone { margin: 0 -24px; padding: 0 24px; }
}
@media (max-width: 880px) {
  #main { grid-template-columns: 0 minmax(0, 1fr) 0 !important; } body { --rail: 0px; } #rail { display: none; } body.rail-force #rail { display: flex; position: fixed; top: 48px; bottom: 0; left: 0; width: 264px; z-index: 40; box-shadow: var(--shadow); }
  .start-grid { grid-template-columns: 1fr; } .two, .three { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; gap: 4px; }
  .page { padding: 16px 16px 80px; } .sticky-zone { margin: 0 -16px; padding: 0 16px; } .rvmain { grid-template-columns: 1fr; }
}

.tk, .th { position: relative; }
.shot .im video.tap { cursor: pointer; }

.msg-a .chip { white-space: normal; height: auto; min-height: 24px; padding: 4px 8px; text-align: left; line-height: 16px; border-radius: 12px; }
.msg-a .acts { max-width: 100%; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---- phones (375 px): the sidebar is a drawer (see 880px), the shot grid is 2 columns, tap targets are 44 px, nothing scrolls sideways ---- */
html, body { max-width: 100%; overflow-x: hidden; }
@media (max-width: 600px) {
  .btn, .chip[data-a], button.chip, .navitem, select.select, .input { min-height: 44px; }
  .btn.icon, .btn.sm { min-width: 44px; min-height: 44px; }
  .cards, .shots, .grid-shots { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .grid-cards { grid-template-columns: 1fr; }
  .page { padding: 12px 12px 80px; } .sticky-zone { margin: 0 -12px; padding: 0 12px; }
  .strip { flex-wrap: nowrap; gap: 4px; flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; } .strip::-webkit-scrollbar { display: none; } .strip .chip { font-size: 11px; flex: none; white-space: nowrap; }
  #top .grow { display: none; }
  .row.wrap, .row { min-width: 0; } .pre, pre, table { max-width: 100%; overflow-x: auto; }
  #modal-root .modal, .sheet { max-width: 100vw; width: 100vw; }
  body.rail-force::after { content: ""; position: fixed; inset: 48px 0 0 264px; background: rgba(0,0,0,.45); z-index: 39; }
}
