/* ======================================================================================================
   SCREENING ROOM (Ilyas picked direction A, 2026-10-09).
   CLAUDE-NOTE: a layer loaded AFTER styles.css: tokens, type, the left sidebar shell and the Review 3-column
   layout (shots | stage | inspector). Every older rule still applies underneath; this file only restyles and
   re-lays-out. Breakpoints: >=1600 three columns, 1024-1599 inspector drops under the video, <=1023 the
   sidebar becomes the top bar (phone/tablet). Remove this <link> to fall back to the previous look.
   ====================================================================================================== */
:root {
  --bg: #0f0e0c;
  --panel: #171614;
  --panel-2: #1f1d1a;
  --raised: #1b1916;
  --line: #2e2b26;
  --line-soft: #23201c;
  --text: #efe8da;
  --muted: #a39b8c;
  --gold: #c9a96a;
  --gold-2: #e0c48a;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
  --sidebar-w: 236px;
  --radius: 10px;
}
body { background: var(--bg); font-family: var(--sans); font-size: 14px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; }
.eyebrow { color: var(--muted); font-weight: 700; font-size: 10.5px; letter-spacing: .16em; }
.player-time, .tab-count, #scene-version, .scene-card-sub, .timeline, .trim-point { font-variant-numeric: tabular-nums; }
.player-time, .trim-point { font-family: var(--mono); font-size: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Buttons and fields: one consistent family */
.primary-btn, .ghost-btn, .danger-btn, .order-move { border-radius: 8px; min-height: 38px; padding: 0 14px; font-weight: 600; }
.primary-btn { background: var(--gold); border-color: var(--gold); color: #17140e; }
.ghost-btn:hover { border-color: var(--gold); background: rgba(201,169,106,.06); }
select, input[type="text"], input:not([type]), input[type="search"], textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
}

/* ---------- Sidebar shell (desktop) ---------- */
@media (min-width: 1024px) {
  body { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); align-items: start; }
  body.nav-collapsed { --sidebar-w: 68px; }
  .topbar.app-sidebar {
    grid-column: 1; grid-row: 1; position: sticky; top: 0; height: 100vh; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 20px;
    padding: 20px 14px; background: #141311; border-right: 1px solid var(--line); border-bottom: 0; backdrop-filter: none;
  }
  body > main { grid-column: 2; grid-row: 1; min-width: 0; }
  .sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; background: transparent; overflow: visible; }
  .sidebar-foot { margin-top: auto; flex-direction: column; align-items: stretch; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
  .sidebar-foot .source-chip { justify-content: flex-start; }
  body.nav-collapsed .topbar.app-sidebar { padding: 20px 10px; align-items: center; }
  body.nav-collapsed .brand-text, body.nav-collapsed .nav-label, body.nav-collapsed .sidebar-project,
  body.nav-collapsed .sidebar-foot { display: none; }
  body.nav-collapsed .brand-row { flex-direction: column; }
  body.nav-collapsed .nav-collapse svg { transform: rotate(180deg); }
  body.nav-collapsed .tab.nav-item { justify-content: center; padding: 0; width: 46px; }
  #plan-frame { height: calc(100vh - 24px); }
  /* the scene column used to pin under the old sticky header; there is no header now */
  .scene-list-panel { top: 0 !important; height: 100vh !important; }
}
.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-mark { flex: none; width: 38px; height: 38px; border: 1.5px solid var(--gold); border-radius: 9px; display: grid; place-items: center;
  color: var(--gold); font-family: var(--serif); font-size: 19px; }
.brand-text { min-width: 0; flex: 1; }
.topbar .brand-text h1 { margin: 0; white-space: nowrap; font-family: var(--serif); font-weight: 400; font-size: 21px; line-height: 1; letter-spacing: 0; }
.brand-text .eyebrow { margin-top: 4px; font-size: 9.5px; }
.nav-collapse { flex: none; width: 32px; height: 32px; display: grid; place-items: center; background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: 8px; }
.nav-collapse:hover { border-color: var(--line); color: var(--text); }
.nav-collapse svg, .nav-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-project { display: flex; flex-direction: column; gap: 6px; }
.sidebar-project .project-select { width: 100%; margin: 0; min-height: 40px; font-weight: 600; }
.tab.nav-item {
  display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 8px;
  color: #c7bfb1; background: transparent; font-size: 14px; text-align: left; white-space: nowrap;
}
.tab.nav-item:hover { background: #1c1a17; color: var(--text); }
.tab.nav-item.active { background: #221f1a; color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--gold); border-bottom-color: transparent; }
.tab.nav-item.active .nav-ico { color: var(--gold); }

/* ---------- Shot list column ---------- */
.scene-list-panel { background: #121110; border-right: 1px solid var(--line); }
.panel-heading { align-items: center; padding: 18px 16px 12px; border-bottom: 0; }
.panel-heading h2, .list-title { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 2px 0 0; letter-spacing: 0; }
/* CLAUDE-NOTE (Ilyas 2026-10-14: "the filter buttons ... isn't even visible anymore"): the shot column is a flex column,
   so the chip row shrank to ~14 px (scrollbar only) once the search box was added. Never shrink; wrap instead of a
   sideways scroll so every bucket is visible at once. */
.status-chips { display: flex; flex-wrap: wrap; flex-shrink: 0; gap: 6px; padding: 0 16px 12px; border-bottom: 1px solid var(--line); }
.tab.status-chip {
  flex: none; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: #c7bfb1; font-size: 12.5px; white-space: nowrap;
}
.tab.status-chip:hover { border-color: var(--gold); }
.tab.status-chip.active { background: var(--text); color: #0f0e0c; border-color: var(--text); font-weight: 600; }
.scene-filter-row { border-bottom: 1px solid var(--line-soft); }
.scene-card { border-radius: 9px; padding: 11px 12px; }
.scene-card.active { background: #221f1a; border-color: rgba(201,169,106,.55); box-shadow: inset 2px 0 0 var(--gold); }
.scene-card-title { font-weight: 600; }

/* ---------- Review: stage + inspector ---------- */
.viewer-panel { padding: 22px 26px; }
.viewer-head h2, #scene-title { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; letter-spacing: 0; }
.video-stage { border-radius: 12px; border: 1px solid var(--line-soft); }
.submission-panel { border-radius: var(--radius); }
.inspector { display: flex; flex-direction: column; min-width: 0; background: #141311; border: 1px solid var(--line); border-radius: 12px; }
.inspector-tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
.inspector-tab {
  min-height: 42px; padding: 0 14px; background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent;
  font-weight: 600;
}
.inspector-tab:hover { color: var(--text); }
.inspector-tab.active { color: var(--text); border-bottom-color: var(--gold); }
.tab-count { font-family: var(--mono); font-size: 11px; color: var(--gold); margin-left: 2px; }
.inspector-pane { padding: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.inspector-pane[hidden] { display: none; }
.inspector .take-panel, .inspector .note-composer, .inspector .scene-notes-section {
  margin: 0; border: 0; padding: 0; background: transparent; box-shadow: none;
}
.inspector .set-link-row { margin: 0; padding: 12px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); }
.inspector .set-link-row[hidden] { display: none; }
.inspector .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inspector .scene-meta-grid { grid-template-columns: 1fr; margin: 0; }
.inspector .references { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stage-col { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.stage-col > * { margin-top: 0 !important; margin-bottom: 0 !important; }

@media (min-width: 1600px) {
  .scene-viewer-grid:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); gap: 22px; align-items: start; }
  .inspector { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }
}
@media (min-width: 1024px) and (max-width: 1599px) {
  .scene-viewer-grid:not([hidden]) { display: flex; flex-direction: column; gap: 18px; }
}

/* ---------- Phone / tablet: sidebar becomes the top bar ---------- */
@media (max-width: 1023px) {
  .topbar.app-sidebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px; min-height: 0; }
  .brand-row { flex: 1 1 auto; }
  .nav-collapse { display: none; }
  .brand-text .eyebrow { display: none; }
  .sidebar-project { flex: 1 1 180px; flex-direction: row; align-items: center; }
  .sidebar-project .eyebrow { display: none; }
  .sidebar-nav { order: 5; flex: 1 1 100%; display: flex; gap: 2px; overflow-x: auto; padding: 0; border: 0; background: transparent; }
  .tab.nav-item { flex: none; min-height: 40px; padding: 0 12px; }
  .tab.nav-item.active { box-shadow: inset 0 -2px 0 var(--gold); }
  .sidebar-foot { order: 4; flex-direction: row; gap: 8px; }
  .sidebar-foot .chop-switch span, .sidebar-foot .source-chip { display: none; }
  .scene-viewer-grid:not([hidden]) { display: flex; flex-direction: column; gap: 16px; }
  .viewer-panel { padding: 14px; }
  #scene-title { font-size: 26px; }
}

/* ---------- refinements after the first look (2026-10-09) ---------- */
@media (min-width: 761px) {
  #review-tab.active, #compare-tab.active, #sets-tab.active { grid-template-columns: minmax(240px, 284px) minmax(0, 1fr); }
}
.viewer-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.viewer-head > div:first-child { flex: 1 1 360px; min-width: 0; }
.viewer-head #plan-shot { margin: 0; }
.viewer-head select { min-height: 38px; }
#scene-sequence { font-family: var(--mono); letter-spacing: .04em; text-transform: none; font-weight: 500; }
#scene-version { font-size: 12.5px; margin-top: 4px; }
.submission-panel { padding: 10px 12px; gap: 12px; }
.player-bar { gap: 10px; }
#player-play { width: 44px; height: 44px; border-radius: 50%; background: var(--text); color: #0f0e0c; border-color: var(--text); padding: 0; }
@media (min-width: 1024px) and (max-width: 1599px) {
  .inspector-pane[data-pane="take"] .take-panel { display: grid; gap: 12px; }
  .inspector .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.status-chips { scrollbar-width: thin; scrollbar-color: #3a362f transparent; }
.status-chips::-webkit-scrollbar { height: 6px; }
.status-chips::-webkit-scrollbar-track { background: transparent; }
.status-chips::-webkit-scrollbar-thumb { background: #3a362f; border-radius: 3px; }
@media (max-width: 1023px) {
  .topbar.app-sidebar { gap: 8px 10px; padding: 8px 12px 0; }
  .brand-row { flex: none; }
  .brand-text { display: none; }
  .brand-mark { width: 34px; height: 34px; font-size: 17px; }
  .sidebar-project .project-select { min-height: 36px; }
  .sidebar-nav { margin: 0 -12px; padding: 0 8px; }
  .tab.nav-item { min-height: 38px; font-size: 13.5px; }
}

/* Review buckets (2026-10-11): chip counts + the pinned shot that has moved to another tab */
.chip-count { font-family: var(--mono); font-size: 11px; opacity: .65; margin-left: 2px; }
.chip-count:empty { display: none; }
.scene-card.moved { opacity: .78; border-style: dashed; }
.status-pill.moved-pill { border-color: var(--gold); color: var(--gold-2); }

/* CLAUDE-NOTE (Ilyas 2026-10-12): Inbox shot peek. Desktop = right-hand panel and the Inbox makes room for it;
   phones (<=760px, same breakpoint as the rest of the app) = full-screen popup with ✕ and Back/Next. */
.shot-peek {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 44vw); z-index: 70;
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(0,0,0,.45);
}
.shot-peek[hidden] { display: none; }
.shot-peek-head { display: flex; align-items: flex-start; gap: 10px; }
.shot-peek-titles { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.shot-peek video { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }
.shot-peek-nav { display: flex; gap: 8px; justify-content: space-between; }
.shot-peek-nav button:disabled { opacity: .35; cursor: default; }
@media (min-width: 761px) {
  body.shot-peek-open #questions-tab { padding-right: min(560px, 44vw); }
}
@media (max-width: 760px) {
  .shot-peek { left: 0; width: auto; border-left: 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); justify-content: center; }
  .shot-peek video { max-height: 60vh; }
  .shot-peek-nav button { flex: 1; }
}
