/* ============================================================
   STORYBOARD DIRECTOR — "Director's Cut"
   A cinema-grade interface: warm-black grading suite, tungsten
   accents, editorial serif titling over production-equipment
   mono labels. Letterboxed previews, tally lights, slate cues.
   ============================================================ */

:root {
  color-scheme: dark;

  --rail-width: 276px;
  --topbar-h: 64px;
  --chat-max: 820px;
  --wall-width: clamp(420px, 34vw, 580px);

  /* Warm black grading-suite palette */
  --bg: #0b0908;
  --bg-2: #121009;
  --surface: #16130f;
  --surface-2: #1d1914;
  --surface-3: #242019;
  --surface-glass: rgba(22, 19, 15, 0.84);
  --line: rgba(228, 209, 182, 0.12);
  --line-strong: rgba(234, 218, 192, 0.26);

  --ink: #f0e9dc;
  --muted: #a89e8c;
  --dim: #6f675a;

  --gold: #e3a94f;
  --gold-bright: #f4cd7e;
  --gold-deep: #b97f2e;
  --gold-soft: rgba(227, 169, 79, 0.13);
  --rec: #ff4b3c;
  --rec-soft: rgba(255, 75, 60, 0.14);
  --ok: #a4cf72;
  --ok-soft: rgba(164, 207, 114, 0.13);
  --info: #92b8d8;
  --info-soft: rgba(146, 184, 216, 0.12);
  --danger: #ff7263;

  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 14px 44px rgba(0, 0, 0, 0.38);
}

/* ---------- Reset & base ---------- */

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(227, 169, 79, 0.07), transparent 46%),
    radial-gradient(90% 120% at 100% 110%, rgba(146, 184, 216, 0.04), transparent 40%),
    linear-gradient(165deg, #0d0b09 0%, #0b0908 55%, #080705 100%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Film grain over everything, very faint */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

::selection {
  background: rgba(227, 169, 79, 0.32);
  color: #fff8ec;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
textarea {
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--gold-bright);
  text-decoration-color: rgba(227, 169, 79, 0.4);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--gold-bright);
}

/* Thin warm scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 158, 140, 0.28) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(168, 158, 140, 0.24);
  border-radius: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* Mono label utility look (used by many chips) */
.output-pill,
.status-chip,
.mini-status,
.tally,
.panel-number,
.attachment-kind,
.hero-kicker,
.workflow-next-kicker,
.workflow-thread-kicker,
.stage-tc,
.stage-rec,
.latest-meta,
.production-action-index {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Drag overlay ---------- */

body.file-drag-active::after {
  content: "DROP TO ATTACH";
  position: fixed;
  inset: 14px;
  z-index: 2100;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(227, 169, 79, 0.75);
  border-radius: var(--radius-lg);
  background: rgba(8, 6, 4, 0.72);
  backdrop-filter: blur(6px);
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.3em;
  opacity: 1;
  mix-blend-mode: normal;
  pointer-events: none;
}

/* ---------- App shell ---------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  transform-origin: center;
  transition:
    grid-template-columns 0.22s cubic-bezier(0.5, 0, 0.2, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease;
}

body.rail-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

/* ---------- Left rail ---------- */

.left-rail {
  grid-row: 1 / 3;
  display: grid;
  /* brand · credits · help · productions (scrolls) — explicit rows so the optional credits/help
     never spill into each other or steal the scrolling row from the productions list */
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.92), rgba(13, 11, 9, 0.96));
}

body.rail-collapsed .left-rail {
  border-right-color: transparent;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line);
  min-width: var(--rail-width);
}

/* The rail brand block doubles as the home link back to the Previsto landing. */
a.brand-home { text-decoration: none; color: inherit; }
a.brand-home:hover .brand-mark { box-shadow: 0 0 0 1px var(--gold-deep); }

/* Dogfood #16: the pre-generation AUTO view offers the live documents as chips. */
.preview-empty-chips {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin-top: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(-45deg, rgba(227, 169, 79, 0.85) 0 7px, rgba(10, 8, 6, 0.9) 7px 14px) top / 100% 9px no-repeat,
    var(--surface-2);
  color: var(--gold-bright);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding-top: 8px;
}

.brand-block h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.02;
  letter-spacing: 0.01em;
}

.brand-block span {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.rail-nav {
  grid-row: 4;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 14px 18px;
  min-height: 0;
  min-width: var(--rail-width);
  overflow-y: auto;
}

.rail-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 0 4px;
}

.rail-section.muted p {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.6;
  padding: 0 4px;
}

#projectSelect {
  width: 100%;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 19px) 55% / 5px 5px no-repeat,
    linear-gradient(-45deg, transparent 50%, var(--muted) 50%) calc(100% - 14px) 55% / 5px 5px no-repeat,
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13px;
  padding: 9px 34px 9px 12px;
  transition: border-color 0.15s ease;
}

#projectSelect:focus {
  outline: none;
  border-color: var(--gold);
}

.project-rail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail-project {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rail-project span {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.rail-project small {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.rail-project:hover {
  background: rgba(227, 169, 79, 0.06);
}

.rail-project.selected {
  background: var(--gold-soft);
  border-left-color: var(--gold);
}

.rail-project.selected small {
  color: var(--gold-deep);
}

/* ---------- Topbar ---------- */

.topbar {
  grid-row: 1;
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar-title span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

/* per-production spend: a total under the name, in the kicker's voice; never a pool colour */
.topbar-spend {
  display: block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-spend.unavailable {
  color: var(--muted);
}

.topbar-title strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

.status-chip strong {
  color: var(--muted);
  font-weight: 500;
}

/* Engine tally light */
.tally {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--surface);
}

.tally em {
  font-style: normal;
  color: var(--dim);
  letter-spacing: 0.14em;
}

.tally-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 0 transparent;
}

.tally-rec {
  display: none;
  color: var(--rec);
  font-weight: 600;
}

body.codex-running .tally {
  border-color: rgba(255, 75, 60, 0.5);
  background: var(--rec-soft);
}

body.codex-running .tally-standby {
  display: none;
}

body.codex-running .tally-rec {
  display: inline;
}

body.codex-running .tally-dot {
  background: var(--rec);
  animation: tallyPulse 1.1s ease-in-out infinite;
}

@keyframes tallyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 75, 60, 0.55); }
  55% { box-shadow: 0 0 0 6px rgba(255, 75, 60, 0); }
}

/* ---------- Buttons ---------- */

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-button:hover {
  color: var(--ink);
  background: rgba(227, 169, 79, 0.08);
}

.icon-button.is-active {
  color: var(--ink);
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  background: transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.text-button:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--gold);
  background: var(--gold-soft);
}

.text-button:active:not(:disabled) {
  transform: translateY(1px);
}

.text-button.compact {
  padding: 6px 11px;
  font-size: 10px;
}

.text-button.primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-color: var(--gold);
  color: #221708;
  font-weight: 600;
  box-shadow: 0 2px 14px rgba(227, 169, 79, 0.25);
}

.text-button.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffe2a2, var(--gold-bright));
  color: #221708;
}

.text-button.danger {
  color: var(--danger);
  border-color: rgba(255, 114, 99, 0.4);
}

.text-button.danger:hover:not(:disabled) {
  background: rgba(255, 114, 99, 0.1);
  border-color: var(--danger);
  color: #ffd9d3;
}

.text-button.return-live {
  border-color: rgba(255, 75, 60, 0.55);
  color: var(--rec);
  gap: 6px;
}

.text-button.return-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rec);
  animation: recBlink 1s steps(2, jump-none) infinite;
}

.text-button.return-live:hover:not(:disabled) {
  background: rgba(255, 75, 60, 0.12);
  border-color: var(--rec);
  color: #ffd9d3;
}

.text-button.return-live.is-board {
  border-color: rgba(227, 169, 79, 0.5);
  color: var(--gold-bright);
}

.text-button.return-live.is-board i {
  background: var(--gold-bright);
  animation: none;
}

.text-button.return-live.is-board:hover:not(:disabled) {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.text-button.is-live {
  border-color: var(--gold);
  color: var(--gold-bright);
  animation: liveNudge 2.4s ease-in-out infinite;
}

@keyframes liveNudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 169, 79, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(227, 169, 79, 0); }
}

/* ---------- Workspace ---------- */

.workspace {
  grid-row: 2;
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  min-height: 0;
  transition: grid-template-columns 0.26s cubic-bezier(0.5, 0, 0.2, 1);
}

body.workbench-open .workspace {
  grid-template-columns: minmax(0, 1fr) var(--wall-width);
}

/* ---------- Chat stage ---------- */

.chat-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.stage-watermark {
  position: absolute;
  right: -4%;
  bottom: -12%;
  z-index: 0;
  font-family: var(--font-display);
  font-size: clamp(220px, 36vw, 460px);
  line-height: 0.8;
  color: rgba(227, 169, 79, 0.025);
  pointer-events: none;
  user-select: none;
}

body.has-conversation .stage-watermark {
  display: none;
}

/* Hero (empty state) */
.chat-hero {
  position: relative;
  z-index: 1;
  margin: auto;
  max-width: 640px;
  padding: 24px 32px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: riseIn 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

body.has-conversation .chat-hero {
  display: none;
}

.hero-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(-45deg, rgba(227, 169, 79, 0.85) 0 8px, rgba(10, 8, 6, 0.9) 8px 16px) top / 100% 11px no-repeat,
    var(--surface-2);
  padding-top: 10px;
  color: var(--gold-bright);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 16px;
  animation: riseIn 0.7s 0.05s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-kicker {
  font-size: 10px;
  color: var(--gold-deep);
  letter-spacing: 0.3em;
  animation: riseIn 0.7s 0.12s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.chat-hero h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 4.6vw, 54px);
  line-height: 1.04;
  letter-spacing: 0.005em;
  animation: riseIn 0.7s 0.18s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.chat-hero h2 em {
  font-style: italic;
  color: var(--gold-bright);
}

.chat-hero > p:last-of-type {
  max-width: 470px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  animation: riseIn 0.7s 0.26s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Motion dock (running departments) */
.motion-dock {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 10px 24px 0;
}

.motion-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
  border: 1px solid rgba(227, 169, 79, 0.32);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 6px 12px;
  animation: riseIn 0.4s ease both;
}

.motion-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: tallyPulse 1.4s ease-in-out infinite;
}

/* ---------- Command thread ---------- */

.command-thread {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px clamp(18px, 4vw, 48px) 18px;
  scroll-behavior: smooth;
}

body:not(.has-conversation) .command-thread {
  flex: 0 0 auto;
}

.command-message {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  max-width: var(--chat-max);
  margin: 0 auto;
  animation: msgIn 0.34s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.command-message time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  padding-top: 8px;
  white-space: nowrap;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.command-message.from-user .message-avatar {
  background: var(--gold-soft);
  border-color: rgba(227, 169, 79, 0.4);
  color: var(--gold-bright);
}

.message-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 4px 0;
}

.message-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.message-body {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  overflow-wrap: break-word;
}

.message-body p {
  margin: 0 0 9px;
}

.message-body p:last-child {
  margin-bottom: 0;
}

/* Collapsed Codex process narration — the director sees the payoff; the working notes are one click away. */
.working-notes {
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.working-notes summary {
  cursor: pointer;
  list-style: none;
  padding: 7px 12px;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
}

.working-notes summary::-webkit-details-marker {
  display: none;
}

.working-notes summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 7px;
  color: var(--gold);
  transition: transform 0.15s ease;
}

.working-notes[open] summary::before {
  transform: rotate(90deg);
}

.working-notes summary:hover {
  color: var(--ink);
}

.working-notes-body {
  padding: 4px 12px 12px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere; /* dogfood #19: nothing inside a disclosure escapes the border */
}

.working-notes.paper-trail {
  /* the record, footnoted: one collapsed line AFTER the reply instead of a wall of file chips */
  margin: 10px 0 0;
}

.reply-heading {
  /* dogfood #23: the contract's section headings ("Decisions I need", "Worth knowing") in the
     design system's kicker voice — never literal asterisks. */
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin: 16px 0 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}

.message-body strong {
  font-weight: 600;
  color: var(--ink);
}

.paper-trail-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.command-message.from-user .message-body {
  background: linear-gradient(180deg, rgba(227, 169, 79, 0.1), rgba(227, 169, 79, 0.05));
  border: 1px solid rgba(227, 169, 79, 0.2);
  border-radius: var(--radius);
  padding: 11px 15px;
}

.command-message.is-activity .message-body {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* status-coded left edge for failed/blocked */
.command-message.status-failed .message-body,
.command-message.status-blocked .message-body {
  border-left: 2px solid var(--danger);
  padding-left: 13px;
}

/* Mini status chips */
.mini-status {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  border-radius: 4px;
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}

.mini-status.working {
  color: var(--gold-bright);
  border-color: rgba(227, 169, 79, 0.45);
  background: var(--gold-soft);
  animation: workingGlow 1.8s ease-in-out infinite;
}

@keyframes workingGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 169, 79, 0.25); }
  50% { box-shadow: 0 0 10px 0 rgba(227, 169, 79, 0.18); }
}

.mini-status.ready {
  color: var(--gold-bright);
  border-color: rgba(227, 169, 79, 0.45);
  background: var(--gold-soft);
}

.mini-status.approved,
.mini-status.done,
.mini-status.completed {
  color: var(--ok);
  border-color: rgba(164, 207, 114, 0.4);
  background: var(--ok-soft);
}
/* wave-4: planned coverage rides the range row — dashed like the Room's coverage chips */
.mini-status.coverage { border-style: dashed; border-color: rgba(227, 169, 79, 0.5); color: var(--gold); }
.gate-coverage-line { display: block; width: 100%; font-family: var(--mono); font-size: 10px; color: var(--gold); opacity: 0.85; margin: 4px 0 2px; }

.mini-status.needs_director,
.mini-status.needs_input,
.mini-status.needs_review,
.mini-status.review {
  color: #ffc46b;
  border-color: rgba(255, 196, 107, 0.45);
  background: rgba(255, 196, 107, 0.1);
}

.mini-status.failed,
.mini-status.danger,
.mini-status.rejected {
  color: var(--danger);
  border-color: rgba(255, 114, 99, 0.45);
  background: rgba(255, 114, 99, 0.1);
}

.mini-status.blocked {
  color: var(--dim);
  border-style: dashed;
}

.mini-status.open {
  color: var(--info);
  border-color: rgba(146, 184, 216, 0.4);
  background: var(--info-soft);
}

/* Thinking cue */
.thinking-cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}

.thinking-dots {
  display: inline-flex;
  gap: 4px;
}

.thinking-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  animation: thinkBlink 1.2s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) { animation-delay: 0.18s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.36s; }

@keyframes thinkBlink {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

/* Activity details */
.activity-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(13, 11, 9, 0.6);
  overflow: hidden;
}

.activity-details summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 8px 12px;
  transition: color 0.15s ease;
}

.activity-details summary::-webkit-details-marker {
  display: none;
}

.activity-details summary::before {
  content: "▸ ";
  color: var(--gold-deep);
}

.activity-details[open] summary::before {
  content: "▾ ";
}

.activity-details summary:hover {
  color: var(--muted);
}

.activity-details ul {
  list-style: none;
  margin: 0;
  padding: 2px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 230px;
  overflow-y: auto;
}

.activity-details li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
  border-left: 2px solid var(--line-strong);
  padding-left: 10px;
}

.activity-details li.completed { border-left-color: var(--ok); }
.activity-details li.failed { border-left-color: var(--danger); }
.activity-details li.working,
.activity-details li.running { border-left-color: var(--gold); }

.activity-details li strong {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.activity-details li span {
  color: var(--dim);
}

.activity-details li small {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  overflow-wrap: anywhere;
}

/* Message artifacts */
.message-artifacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.message-artifact-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px 14px;
  max-width: 460px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.message-artifact-card:hover {
  border-color: var(--gold);
  background: var(--surface-3);
}

.message-artifact-card span strong {
  display: block;
  font-size: 13px;
}

.message-artifact-card span small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  overflow-wrap: anywhere;
}

.message-artifact-card b {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
  white-space: nowrap;
}

.message-artifact-newtab {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.message-artifact-newtab:hover {
  color: var(--gold-bright);
}

.attachment-kind {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  font-size: 10px;
  font-weight: 600;
  color: var(--gold-deep);
}

/* Message attachments */
.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 7px 12px 7px 7px;
  max-width: 300px;
}

.attachment-preview {
  width: 52px;
  height: 38px;
  border-radius: 5px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  flex: none;
}

.attachment-preview img,
.attachment-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-card strong {
  display: block;
  font-size: 12px;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-card > div:last-child span {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
}

/* ---------- Workflow next-step (thread + cards) ---------- */

.workflow-thread-cue {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  max-width: var(--chat-max);
  margin: 0 auto;
  animation: msgIn 0.34s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.workflow-thread-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.workflow-thread-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 16px;
}

.workflow-thread-kicker {
  font-size: 9.5px;
  color: var(--gold-deep);
}

.workflow-thread-panel strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
}

.workflow-thread-panel p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.workflow-thread-panel small {
  font-size: 12px;
  color: var(--dim);
  font-style: italic;
}

.workflow-thread-panel .text-button {
  align-self: flex-start;
  margin-top: 4px;
}

.workflow-next-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-next-chips span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.workflow-next-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
}

.workflow-next-card strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
}

.workflow-next-card p {
  font-size: 13px;
  color: var(--muted);
}

.workflow-next-card em {
  font-size: 12px;
  color: var(--dim);
}

.workflow-next-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workflow-next-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px 14px;
}

.workflow-next-strip strong {
  display: block;
  font-size: 14px;
  margin-top: 4px;
}

.workflow-next-strip p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Approval dock (director gates) ---------- */

.approval-dock {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px clamp(18px, 4vw, 48px) 4px;
  max-height: 46vh;
  min-height: 0;
  flex: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.approval-card {
  flex: none;
}

.approval-card {
  position: relative;
  width: 100%;
  max-width: var(--chat-max);
  margin: 0 auto;
  border: 1px solid rgba(255, 196, 107, 0.34);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(36, 28, 16, 0.94), rgba(24, 19, 12, 0.94));
  padding: 16px 16px 14px;
  overflow: hidden;
  animation: msgIn 0.34s ease both;
}

/* clapperboard stripe */
.approval-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: repeating-linear-gradient(-45deg, rgba(255, 196, 107, 0.9) 0 9px, rgba(12, 9, 6, 0.95) 9px 18px);
}

.approval-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 8px;
}

.approval-head strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
}

.approval-head span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.approval-copy {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.6;
}

.approval-copy pre {
  font-family: var(--mono);
  font-size: 11.5px;
  background: rgba(8, 6, 4, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 9px 0 0;
}

.approval-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.approval-inputs label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.approval-inputs label span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.approval-inputs label small {
  font-size: 12.5px;
  color: var(--muted);
}

.approval-inputs textarea,
.approval-inputs select {
  background: rgba(8, 6, 4, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13px;
  padding: 9px 11px;
  resize: vertical;
}

.approval-inputs textarea:focus,
.approval-inputs select:focus {
  outline: none;
  border-color: var(--gold);
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

/* ---------- Queued composer ---------- */

.queued-composer {
  padding: 4px clamp(18px, 4vw, 48px) 0;
}

.queued-command-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: var(--chat-max);
  margin: 0 auto;
  border: 1px dashed rgba(227, 169, 79, 0.4);
  border-radius: var(--radius);
  background: rgba(227, 169, 79, 0.05);
  padding: 10px 14px;
}

.queued-command-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.queued-command-copy {
  min-width: 0;
}

.queued-command-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.queued-command-title strong {
  font-size: 12.5px;
}

.queued-command-title span {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-deep);
}

.queued-command-copy p {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queued-command-copy small {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.queued-command-actions {
  display: flex;
  gap: 6px;
}

/* ---------- Composer ---------- */

.director-composer {
  position: relative;
  z-index: 3;
  padding: 12px clamp(18px, 4vw, 48px) 18px;
}

.drop-zone {
  position: relative;
  width: 100%;
  max-width: var(--chat-max);
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.drop-zone:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(227, 169, 79, 0.35), var(--shadow-soft);
}

.drop-zone.drag-over {
  border-color: var(--gold-bright);
  border-style: dashed;
}

body.composer-queue-mode .drop-zone {
  border-color: rgba(227, 169, 79, 0.5);
  background: linear-gradient(180deg, rgba(30, 24, 15, 0.9), rgba(22, 18, 12, 0.9));
}

.file-input {
  display: none;
}

.composer-body {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 10px 10px 12px;
}

.attach-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.attach-button:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: var(--gold-soft);
}

.composer-input {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-tray {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* KW#6 — citation chips riding the tray next to file cards match their height,
   keeping the dashed-pill identity (a citation is a claim, a card is a file) */
.attachment-tray .citation-chip {
  min-height: 52px;
  padding: 6px 10px 6px 14px;
}

.attachment-tray.has-files {
  display: flex;
}

#directorCommand {
  width: 100%;
  min-height: 28px;
  max-height: 180px;
  background: transparent;
  border: none;
  resize: none;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  padding: 4px 0;
}

#directorCommand:focus {
  outline: none;
}

#directorCommand::placeholder {
  color: var(--dim);
}

.send-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #221708;
  box-shadow: 0 2px 14px rgba(227, 169, 79, 0.3);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(227, 169, 79, 0.4);
}

.send-button:active:not(:disabled) {
  transform: translateY(0);
}

body.composer-queue-mode .send-button {
  background: var(--surface-3);
  color: var(--gold-bright);
  border: 1px solid rgba(227, 169, 79, 0.5);
  box-shadow: none;
}

/* ---------- Output wall (right panel) ---------- */

.output-wall {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 13, 10, 0.96), rgba(11, 9, 7, 0.98));
  padding: 16px 16px 18px;
}

.output-wall[hidden] {
  display: none;
}

.latest-output {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: none;
}

.output-toolbar {
  /* dogfood #20: one calm row — the label reads in full and grows; the actions sit right as ONE
     group. When space runs out the whole action group drops to its own right-aligned row instead
     of scattering buttons around the label. */
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.output-pill {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold-bright);
  border: 1px solid rgba(227, 169, 79, 0.36);
  background: var(--gold-soft);
  border-radius: 4px;
  padding: 5px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: min(100%, max-content); /* dogfood #20: never "PROJECT…" with free space beside it */
}

.output-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* dogfood #18: crowded toolbars flow to a second row instead of crushing labels */
  justify-content: flex-end;
  gap: 6px 8px;
  margin-left: auto;
}

.output-toolbar .text-button {
  white-space: nowrap; /* dogfood #18: "NEEDS REVIEW · 1" wrapped into a three-line blob */
}

.icon-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* The letterboxed frame */
.latest-preview {
  position: relative;
  min-height: 200px;
  max-height: 52vh;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #060504;
}

/* viewfinder corner brackets */
.latest-preview::after {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  z-index: 4;
  opacity: 0.65;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) left 0 top 0 / 16px 1px,
    linear-gradient(var(--line-strong), var(--line-strong)) left 0 top 0 / 1px 16px,
    linear-gradient(var(--line-strong), var(--line-strong)) right 0 top 0 / 16px 1px,
    linear-gradient(var(--line-strong), var(--line-strong)) right 0 top 0 / 1px 16px,
    linear-gradient(var(--line-strong), var(--line-strong)) left 0 bottom 0 / 16px 1px,
    linear-gradient(var(--line-strong), var(--line-strong)) left 0 bottom 0 / 1px 16px,
    linear-gradient(var(--line-strong), var(--line-strong)) right 0 bottom 0 / 16px 1px,
    linear-gradient(var(--line-strong), var(--line-strong)) right 0 bottom 0 / 1px 16px;
  background-repeat: no-repeat;
}

.latest-preview.is-document-preview::after,
.latest-preview.is-workflow-preview::after,
.latest-preview.is-stage::after {
  /* dogfood #13 (real fix): these modes scroll and carry their own stage framing — the outer
     viewfinder brackets float at the visible box edge and collide with pills/chips mid-card. */
  display: none;
}

.latest-preview.is-image-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px 0;
}

.latest-preview.is-image-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.latest-preview.is-empty-preview {
  display: grid;
  place-items: center;
}

/* transfer-in flash on the primary frame */
.latest-output.is-receiving-workbench-item .latest-preview {
  animation: receiveFlash 1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes receiveFlash {
  0% { box-shadow: 0 0 0 2px rgba(227, 169, 79, 0.9), 0 0 40px rgba(227, 169, 79, 0.25); }
  100% { box-shadow: 0 0 0 1px transparent, 0 0 0 transparent; }
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 38px 24px;
  color: var(--muted);
}

.preview-empty strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: var(--ink);
}

.preview-empty span {
  font-size: 12.5px;
  color: var(--dim);
  max-width: 260px;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

/* mono caption rail under the frame */
.latest-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  color: var(--dim);
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.latest-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.latest-workflow-next {
  flex: none;
}

/* ---------- Active workbench (Codex working stage) ---------- */

.active-workbench {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 16px 18px;
  min-height: 300px;
  overflow: hidden;
}

.workbench-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(45% 38% at 50% 32%, rgba(227, 169, 79, 0.12), transparent 60%);
  pointer-events: none;
  animation: glowDrift 7s ease-in-out infinite alternate;
}

@keyframes glowDrift {
  from { transform: translateY(-2%) scale(1); opacity: 0.8; }
  to { transform: translateY(3%) scale(1.06); opacity: 1; }
}

.workbench-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
}

.workbench-status-line small {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Universal cinematic stage: aperture + scanline in a framed slate */
.workbench-stage.stage-slate {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-frame {
  position: relative;
  overflow: hidden; /* dogfood #13: content must stay inside the corner brackets */
  height: 170px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(0deg, rgba(6, 5, 4, 0.92) 0 12%, transparent 12% 88%, rgba(6, 5, 4, 0.92) 88%),
    radial-gradient(60% 70% at 50% 50%, rgba(227, 169, 79, 0.06), transparent 70%),
    #0a0807;
  overflow: hidden;
}

.frame-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--gold);
  border-style: solid;
  border-width: 0;
  opacity: 0.85;
  z-index: 3;
}

.frame-corner.tl { top: 7px; left: 7px; border-top-width: 1.5px; border-left-width: 1.5px; }
.frame-corner.tr { top: 7px; right: 7px; border-top-width: 1.5px; border-right-width: 1.5px; }
.frame-corner.bl { bottom: 7px; left: 7px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.frame-corner.br { bottom: 7px; right: 7px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

.stage-aperture {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
}

.aperture-ring {
  position: absolute;
  left: 0;
  top: 0;
  animation: apertureSpin 9s linear infinite;
}

.aperture-ring i {
  position: absolute;
  left: -1px;
  top: -6px;
  width: 2px;
  height: 11px;
  border-radius: 1px;
  background: var(--gold);
  opacity: calc(0.25 + (var(--i) / 40));
  transform: rotate(calc(var(--i) * 15deg)) translateY(-52px);
}

@keyframes apertureSpin {
  to { transform: rotate(360deg); }
}

.aperture-core {
  position: absolute;
  left: -23px;
  top: -23px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(227, 169, 79, 0.55);
  background: radial-gradient(circle, rgba(227, 169, 79, 0.22), rgba(227, 169, 79, 0.04) 70%);
  animation: corePulse 1.8s ease-in-out infinite;
}

@keyframes corePulse {
  0%, 100% { transform: scale(0.94); opacity: 0.75; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* Developing frame: newest generated panel resolves out of the dark */
.stage-develop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  animation: developFrame 3.2s cubic-bezier(0.3, 0, 0.2, 1) both;
}

@keyframes developFrame {
  0% { opacity: 0; filter: blur(26px) brightness(0.4) contrast(0.8); transform: scale(1.06); }
  30% { opacity: 1; }
  100% { opacity: 1; filter: blur(0) brightness(1) contrast(1); transform: scale(1); }
}

/* Look re-render: the target frame develops in place with the signature blur-up while the worker
   regenerates it, then refreshes automatically on land. Reuses the developFrame keyframe verbatim so
   it sharpens in identically to the "develop latest frame" feature; a slower curve reads as "cooking". */
.stage-rerender-img {
  animation: developFrame 3.6s cubic-bezier(0.3, 0, 0.2, 1) both;
}

.stage-rerender-caption {
  border-color: rgba(244, 205, 126, 0.5);
  box-shadow: 0 0 0 1px rgba(227, 169, 79, 0.14), 0 6px 22px rgba(6, 5, 3, 0.5);
}

.stage-rerender-caption span {
  color: var(--gold-bright);
}

.stage-rerender-caption strong {
  color: var(--gold-bright);
}

.stage-take-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  animation: developFrame 1.6s ease both;
}

.stage-develop-caption {
  position: absolute;
  left: 10px;
  bottom: 9px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(8, 6, 4, 0.74);
  border: 1px solid rgba(227, 169, 79, 0.32);
  border-radius: 5px;
  padding: 5px 10px;
  backdrop-filter: blur(5px);
  animation: riseIn 0.5s 0.9s ease both;
}

.stage-develop-caption span {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.stage-develop-caption strong {
  font-size: 11.5px;
  color: var(--ink);
}

/* Assembling board: approved frames tiling together during bookkeeping */
.stage-assemble {
  position: absolute;
  inset: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  align-content: center;
}

.stage-assemble-count {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(6, 5, 3, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 9px;
  pointer-events: none;
}

.stage-assemble-tile {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #060504;
  animation: tileAssemble 5.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.45s);
  opacity: 0.35;
}

.stage-assemble-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes tileAssemble {
  0%, 100% { opacity: 0.3; transform: translateY(2px); border-color: var(--line); }
  18%, 55% { opacity: 1; transform: translateY(0); border-color: rgba(227, 169, 79, 0.55); }
  75% { opacity: 0.55; }
}

.project-file-video {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: block;
  background: #000;
}

.stage-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 36px;
  background: linear-gradient(180deg, transparent, rgba(227, 169, 79, 0.07) 55%, rgba(227, 169, 79, 0.16));
  border-bottom: 1px solid rgba(227, 169, 79, 0.32);
  animation: scanSweep 3.4s cubic-bezier(0.4, 0, 0.4, 1) infinite;
  z-index: 2;
}

@keyframes scanSweep {
  0% { transform: translateY(-40px); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateY(176px); opacity: 0; }
}

/* Owner: the gold scan kept sweeping OVER the light table. The reel has its own life —
   lamp, develop pass, loupe — the generic stage shimmer only muddies it. */
.stage-frame:has(.lt-stage) .stage-scanline { display: none; }

.stage-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.still-recovery-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.still-recovery-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(227, 169, 79, 0.38);
  border-radius: var(--radius-sm);
  background: rgba(30, 22, 13, 0.88);
}

.still-recovery-bar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.still-recovery-bar strong {
  color: var(--gold-bright);
  font-size: 12px;
}

.still-recovery-bar span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.still-recovery-context {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.still-recovery-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

@media (max-width: 720px) {
  .still-recovery-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .still-recovery-actions {
    flex-wrap: wrap;
  }
}

/* Live reel: frames landed in the active run */
.live-reel {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 2px 1px 4px;
}

.live-reel-tick {
  position: relative;
  flex: none;
  width: 52px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #060504;
  opacity: 0.62;
  transition: opacity 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.live-reel-tick:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.live-reel-tick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.live-reel-tick.is-current {
  opacity: 1;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(227, 169, 79, 0.4);
}

.live-reel-tick.is-latest::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rec);
  animation: recBlink 1s steps(2, jump-none) infinite;
}

.stage-tc {
  font-size: 10px;
  color: var(--muted);
}

.stage-rec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--rec);
}

.stage-rec i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rec);
  animation: recBlink 1s steps(2, jump-none) infinite;
}

@keyframes recBlink {
  50% { opacity: 0.2; }
}

.workbench-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workbench-copy strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
}

.workbench-copy p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.workbench-chips {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workbench-chips span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold-bright);
  border: 1px solid rgba(227, 169, 79, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
  animation: riseIn 0.4s both;
  animation-delay: var(--delay, 0ms);
}

.workbench-log {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.workbench-log span {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workbench-log span:first-child {
  color: var(--muted);
}

/* Orchestra rail */
.orchestra-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.orchestra-dept {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 9px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  background: rgba(13, 11, 9, 0.55);
}

.orchestra-dept span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  align-self: center;
}

.orchestra-dept.active span {
  background: var(--gold);
  animation: tallyPulse 1.3s ease-in-out infinite;
}

.orchestra-dept.queued span {
  background: var(--info);
}

.orchestra-dept.needs-director span {
  background: #ffc46b;
}

.orchestra-dept strong {
  font-size: 12px;
  font-weight: 600;
}

.orchestra-dept small {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Document / file previews in the frame ---------- */

.file-back-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  margin: 12px 16px 0;
  width: calc(100% - 32px);
  padding: 8px 12px;
  border: 1px solid rgba(227, 169, 79, 0.5);
  border-radius: 9px;
  background: var(--gold-soft);
  color: var(--gold-bright);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.file-back-bar:hover {
  border-color: var(--gold);
  background: rgba(227, 169, 79, 0.22);
}

.file-back-arrow {
  font-size: 13px;
  line-height: 1;
}

.file-back-bar strong {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.file-back-bar kbd {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
}

.review-document-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.review-document-preview header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.review-doc-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  width: 100%;
  justify-content: flex-end;
  order: 10;
}

.review-document-preview header > div {
  flex: 1 1 220px;
  min-width: 0;
}

.review-document-preview header strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.2;
}

.review-document-preview header small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.review-document-note {
  font-size: 12.5px;
  color: var(--muted);
  border-left: 2px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 9px 12px;
  line-height: 1.55;
}

.preview-status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workbench-transfer-cue {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border: 1px solid rgba(227, 169, 79, 0.5);
  background: var(--gold-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  animation: transferCue 1.1s ease both;
}

.workbench-transfer-cue span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  white-space: nowrap;
}

.workbench-transfer-cue strong {
  font-size: 12.5px;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes transferCue {
  0% { opacity: 0; transform: translateY(-6px) scale(0.98); }
  18% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 1; }
}

.project-file-image {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: block;
}

.project-file-body {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  background: rgba(8, 6, 4, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.project-file-frame-wrap {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.project-file-frame {
  display: block;
  width: 100%;
  height: 46vh;
  border: none;
  background: #fff;
}

.project-file-actions {
  display: flex;
  justify-content: flex-end;
}

.project-file-actions a {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-file-actions a:hover {
  color: var(--gold-bright);
}

.markdown-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.preview-boundary {
  display: flex;
  justify-content: center;
  border-top: 1px dashed var(--line-strong);
  margin-top: 14px;
  padding-top: 10px;
}

.preview-boundary span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.preview-boundary.is-truncated span {
  color: #ffc46b;
}

/* ---------- Markdown typography ---------- */

.markdown-preview {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
}

.markdown-preview h1,
.markdown-preview h2 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 18px 0 8px;
}

.markdown-preview h1 { font-size: 24px; }
.markdown-preview h2 { font-size: 20px; }

.markdown-preview h3,
.markdown-preview h4 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 16px 0 6px;
  color: var(--gold-bright);
}

.markdown-preview h1:first-child,
.markdown-preview h2:first-child,
.markdown-preview h3:first-child {
  margin-top: 0;
}

.markdown-preview p {
  margin: 0 0 10px;
}

.markdown-preview ul,
.markdown-preview ol {
  margin: 0 0 10px;
  padding-left: 22px;
}

.markdown-preview li {
  margin-bottom: 4px;
}

.markdown-preview li::marker {
  color: var(--gold-deep);
}

.markdown-preview code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(227, 169, 79, 0.1);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--gold-bright);
}

.markdown-code-block {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  background: rgba(8, 6, 4, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0 0 12px;
  white-space: pre;
}

.markdown-code-block code {
  background: none;
  padding: 0;
  color: var(--muted);
}

.markdown-table-wrap {
  overflow-x: auto;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.markdown-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.markdown-table-wrap th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: var(--gold-deep);
  background: rgba(227, 169, 79, 0.06);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-strong);
}

.markdown-table-wrap td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: top;
}

.markdown-table-wrap tr:last-child td {
  border-bottom: none;
}

.message-markdown {
  font-size: 14px;
}

/* Wide production tables keep readable columns and one keyboard-scrollable surface. */
.markdown-table-hint { font-size: 11px; color: var(--muted); }
.markdown-table-wrap.is-wide { max-width: 100%; overscroll-behavior-x: contain; }
.markdown-table-wrap.is-wide:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.markdown-table-wrap.is-wide table { min-width: calc(var(--table-columns) * 9rem); table-layout: fixed; }
.markdown-table-wrap.is-wide th,
.markdown-table-wrap.is-wide td { overflow-wrap: break-word; word-break: normal; }
.markdown-table-wrap.has-row-ids th:first-child,
.markdown-table-wrap.has-row-ids td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); width: 7.5rem; }

/* ---------- Director choice comparison ---------- */

.director-choice-comparison {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.director-choice-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.director-choice-head strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
}

.director-choice-head small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.director-choice-note {
  font-size: 12.5px;
  color: var(--muted);
  border-left: 2px solid #ffc46b;
  padding-left: 11px;
}

.director-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.director-choice-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.director-choice-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.director-choice-card.primary {
  border-color: rgba(227, 169, 79, 0.5);
}

.director-choice-image {
  display: block;
  aspect-ratio: 16 / 9;
  background: #060504;
}

.director-choice-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.director-choice-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
}

.director-choice-copy span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.director-choice-copy strong {
  font-size: 13px;
}

.director-choice-copy small {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
  overflow-wrap: anywhere;
}

.director-choice-options {
  border: 1px dashed rgba(255, 196, 107, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(255, 196, 107, 0.05);
  padding: 12px 14px;
  font-size: 13px;
}

.director-choice-options strong {
  font-size: 13px;
}

.director-choice-options ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.director-choice-options li {
  margin-bottom: 4px;
}

/* ---------- Primary workbench dock (connected items) ---------- */

.primary-workbench-dock {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px 14px;
  margin-top: 12px;
}

.primary-workbench-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.primary-workbench-action strong {
  display: block;
  font-size: 14px;
  margin-top: 5px;
}

.primary-workbench-action p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.primary-workbench-related {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.primary-workbench-related-head,
.workbench-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.primary-workbench-related-head span,
.workbench-section-title span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.primary-workbench-related-head small,
.workbench-section-title small {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
}

.primary-workbench-chip-grid,
.workbench-artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.workbench-artifact-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 9px 11px;
  min-width: 0;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.workbench-artifact-chip:hover {
  border-color: var(--gold);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.workbench-artifact-chip span {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.workbench-artifact-chip strong {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* chip flying to the preview */
.workbench-artifact-chip.is-moving-to-preview,
.artifact-chip.is-moving-to-preview {
  border-color: var(--gold-bright);
  animation: chipDuck 0.9s cubic-bezier(0.3, 0, 0.2, 1) both;
}

@keyframes chipDuck {
  0% { transform: translateY(0) scale(1); box-shadow: 0 0 0 0 rgba(227, 169, 79, 0.5); }
  35% { transform: translateY(-7px) scale(1.03); box-shadow: 0 8px 22px rgba(227, 169, 79, 0.28); }
  100% { transform: translateY(0) scale(1); box-shadow: 0 0 0 0 transparent; }
}

.workbench-artifact-chip.loading {
  opacity: 0.6;
}

/* ---------- Dynamic workbench tray / related files ---------- */

.dynamic-workbench-tray {
  display: flex;
  flex-direction: column;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  grid-column: 1 / -1;
}

.workbench-tray-head strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  margin-top: 6px;
}

.workbench-tray-head p {
  font-size: 12px;
  color: var(--dim);
  margin-top: 2px;
}

.workbench-primary-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(227, 169, 79, 0.3);
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  padding: 10px 12px;
}

.workbench-primary-card strong {
  display: block;
  font-size: 13px;
}

.workbench-primary-card small {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
  overflow-wrap: anywhere;
}

.workbench-primary-card em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-deep);
  white-space: nowrap;
}

.workbench-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 11px 13px;
}

.workbench-action-card strong {
  display: block;
  font-size: 13.5px;
  margin-top: 4px;
}

.workbench-action-card p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.workbench-related-files {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.workbench-fold {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(13, 11, 9, 0.5);
  overflow: hidden;
}

.workbench-fold summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 9px 12px;
  transition: color 0.15s ease;
}

.workbench-fold summary::-webkit-details-marker {
  display: none;
}

.workbench-fold summary::before {
  content: "▸";
  color: var(--gold-deep);
}

.workbench-fold[open] summary::before {
  content: "▾";
}

.workbench-fold summary:hover {
  color: var(--muted);
}

.workbench-fold summary small {
  font-size: 9px;
  color: var(--gold-deep);
}

.workbench-fold > :not(summary) {
  padding: 0 12px 12px;
}

.workbench-fold .workbench-progress-strip {
  border-top: none;
  padding-top: 0;
}

.workbench-progress-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.workbench-progress-strip > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workbench-progress-strip strong {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.workbench-progress-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workbench-progress-steps span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workbench-progress-steps span.done { color: var(--ok); }
.workbench-progress-steps span.is-next { color: var(--gold-bright); }
.workbench-progress-steps span.needs_director { color: #ffc46b; }

/* ---------- Board strip (living filmstrip) ---------- */

.board-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.board-strip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.board-strip-head span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.board-strip-head small {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-strip-rail {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 2px 1px 5px;
}

.board-tick {
  position: relative;
  flex: none;
  width: 56px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  overflow: hidden;
  background: #060504;
  display: grid;
  place-items: center;
  opacity: 0.72;
  transition: opacity 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.board-tick:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.board-tick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.board-tick span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
}

.board-tick.approved,
.board-tick.accepted_with_notes {
  border-bottom-color: var(--ok);
}

.board-tick.candidate {
  border-bottom-color: var(--gold);
  border-style: solid solid dashed;
}

.board-tick.rejected {
  border-bottom-color: var(--danger);
}

.board-tick.is-open {
  border-style: dashed;
  opacity: 0.45;
}

.board-tick.is-current {
  opacity: 1;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(227, 169, 79, 0.45);
}

.board-tick.has-look {
  opacity: 0.92;
}

.board-tick.has-look::after,
.range-tick.has-look span::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 6px rgba(227, 169, 79, 0.7);
}

.range-tick.has-look span::after {
  position: static;
  display: inline-block;
  margin-left: 4px;
  box-shadow: none;
}

.panel-slot.has-look {
  border-color: rgba(227, 169, 79, 0.5);
}

.panel-slot.has-look .slot-footer small {
  color: var(--gold-bright);
}

/* ---------- Sequence panel ---------- */

.sequence-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: none;
}

.sequence-panel[hidden] {
  display: none;
}

.sequence-head {
  position: sticky;
  top: -17px;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 0 10px;
  background: linear-gradient(180deg, rgba(14, 11, 9, 0.97) 78%, rgba(14, 11, 9, 0));
}

.sequence-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
}

.sequence-head p {
  font-size: 12px;
  color: var(--dim);
  margin-top: 3px;
  line-height: 1.55;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-rows: max-content;
  gap: 12px;
  align-content: start;
  padding-bottom: 6px;
}

/* Shot cards */
.panel-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  text-align: left;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.panel-slot:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

.panel-slot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  flex: none;
  object-fit: cover;
  display: block;
}

.panel-slot.empty-slot {
  border-style: dashed;
  background: rgba(16, 13, 10, 0.5);
}

.panel-number {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--gold-bright);
  background: rgba(8, 6, 4, 0.78);
  border: 1px solid rgba(227, 169, 79, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
  backdrop-filter: blur(4px);
}

.slot-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 84px;
  flex: none;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.slot-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  background: rgba(10, 8, 6, 0.85);
}

.slot-footer strong {
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-footer small {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

/* status edges */
.panel-slot.approved {
  border-color: rgba(164, 207, 114, 0.45);
}

.panel-slot.approved .slot-footer small {
  color: var(--ok);
}

.panel-slot.accepted_with_notes {
  border-color: rgba(164, 207, 114, 0.3);
}

.panel-slot.accepted_with_notes .slot-footer small {
  color: var(--ok);
}

.panel-slot.candidate {
  border-color: rgba(227, 169, 79, 0.5);
  border-style: dashed;
}

.panel-slot.candidate .slot-footer small {
  color: var(--gold-bright);
}

.panel-slot.rejected {
  border-color: rgba(255, 114, 99, 0.4);
}

.panel-slot.rejected .slot-footer small {
  color: var(--danger);
}

.panel-slot.selected {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(227, 169, 79, 0.5), 0 10px 26px rgba(0, 0, 0, 0.4);
}

/* Sequence empty state */
.storyboard-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px 18px;
  color: var(--muted);
}

.storyboard-empty strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  color: var(--ink);
}

.storyboard-empty span {
  font-size: 12.5px;
  color: var(--dim);
  max-width: 300px;
}

.storyboard-empty.full {
  padding: 60px 24px;
}

/* ---------- Workflow map ---------- */

.workflow-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  width: 100%;
}

.workflow-map.rail {
  grid-template-columns: 1fr;
  max-width: 320px;
  margin-top: 8px;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 9px 11px;
  position: relative;
}

.workflow-map.rail .workflow-step {
  flex-direction: row;
  align-items: baseline;
  gap: 9px;
  padding: 7px 11px;
}

.workflow-step span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.workflow-step strong {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.workflow-step small {
  font-size: 10.5px;
  color: var(--dim);
  line-height: 1.45;
}

.workflow-step.done {
  border-color: rgba(164, 207, 114, 0.3);
}

.workflow-step.done span,
.workflow-step.done strong {
  color: var(--ok);
}

.workflow-step.current,
.workflow-step.active {
  border-color: rgba(227, 169, 79, 0.55);
  background: var(--gold-soft);
}

.workflow-step.current span,
.workflow-step.current strong,
.workflow-step.active span,
.workflow-step.active strong {
  color: var(--gold-bright);
}

.workflow-step.working {
  border-color: rgba(227, 169, 79, 0.55);
  background: var(--gold-soft);
  animation: workingGlow 1.8s ease-in-out infinite;
}

.workflow-step.working strong {
  color: var(--gold-bright);
}

/* ---------- Production action registry ---------- */

.production-action-registry {
  display: flex;
  flex-direction: column;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 15px;
  grid-column: 1 / -1;
}

.production-action-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.production-action-head strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  margin-top: 6px;
}

.production-action-head p {
  font-size: 12px;
  color: var(--dim);
  margin-top: 3px;
  max-width: 420px;
  line-height: 1.55;
}

.production-action-counts {
  display: flex;
  gap: 6px;
  flex: none;
}

.production-action-counts span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}

.production-action-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.production-action-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px 13px;
  transition: border-color 0.15s ease;
}

.production-action-row.is-next {
  border-color: rgba(227, 169, 79, 0.55);
  background: linear-gradient(180deg, rgba(227, 169, 79, 0.08), rgba(227, 169, 79, 0.03));
}

.production-action-row.done {
  opacity: 0.66;
}

.production-action-row.blocked {
  opacity: 0.5;
}

.production-action-index {
  font-size: 11px;
  color: var(--dim);
  padding-top: 2px;
}

.production-action-row.is-next .production-action-index {
  color: var(--gold-bright);
}

.production-action-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.production-action-titleline {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.production-action-titleline strong {
  font-size: 13.5px;
}

.production-action-copy > p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.production-action-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.production-action-chips span {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
}

.production-action-artifacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.artifact-chip {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-2);
  padding: 4px 8px;
  transition: color 0.15s ease, border-color 0.15s ease;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artifact-chip:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.production-action-controls {
  display: flex;
  align-items: flex-start;
}

/* ---------- Workflow surface / file inspection cards ---------- */

.workflow-surface-card,
.review-artifact-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.review-artifact-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-artifact-head strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
}

.review-artifact-head small {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  overflow-wrap: anywhere;
}

.file-inspection-card p {
  font-size: 12.5px;
  color: var(--muted);
}

.file-inspection-next {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid var(--gold);
  padding-left: 11px;
}

.file-inspection-next span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.file-inspection-next strong {
  font-size: 13px;
}

.file-inspection-next small {
  font-size: 11.5px;
  color: var(--muted);
}

.file-inspection-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.project-file-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold-bright);
  /* dogfood #19: long unbroken paths must wrap inside the message border, never punch through it */
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}

/* ---------- Full storyboard dialog ---------- */

dialog {
  border: none;
  padding: 0;
  background: transparent;
  color: inherit;
  max-width: none;
  max-height: none;
}

dialog::backdrop {
  background: rgba(5, 4, 3, 0.78);
  backdrop-filter: blur(10px);
}

.storyboard-dialog {
  width: min(1240px, calc(100vw - 48px));
  height: min(86vh, 980px);
  margin: auto;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #14110d, #0c0a08);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  overflow: hidden;
}

.storyboard-dialog[open] {
  display: flex;
}

.storyboard-dialog[open],
.project-dialog[open] {
  animation: dialogIn 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dialog-top h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
}

.dialog-top p {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 4px;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.full-storyboard-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-auto-rows: max-content;
  gap: 14px;
  align-content: start;
  padding-right: 4px;
}

.full-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.full-panel.is-candidate {
  border-style: dashed;
  border-color: rgba(227, 169, 79, 0.45);
}

.full-panel-image {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: #060504;
}

.full-panel-download {
  /* dogfood #29: one-click save for any rendered panel — quiet until the panel is hovered */
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 5, 4, 0.82);
  color: var(--gold-bright);
  font-size: 14px;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.full-panel:hover .full-panel-download,
.full-panel-download:focus-visible {
  opacity: 1;
}

.full-panel-download:hover {
  border-color: var(--gold);
}

.full-panel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.full-panel-image > span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.full-panel-flag {
  position: absolute;
  top: 7px;
  right: 7px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(8, 6, 4, 0.8);
  border: 1px solid rgba(227, 169, 79, 0.45);
  border-radius: 4px;
  padding: 3px 7px;
  backdrop-filter: blur(4px);
}

.full-panel-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}

.full-panel-copy strong {
  font-size: 12.5px;
}

.full-panel-copy span {
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Range Builder ---------- */

.range-builder-dialog {
  width: min(880px, calc(100vw - 40px));
  max-height: 90vh;
  margin: auto;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #14110d, #0b0907);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  overflow: hidden;
}

.range-builder-dialog[open] {
  display: flex;
  animation: dialogIn 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.range-builder-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.range-builder-hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  border-left: 2px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 9px 12px;
}

.range-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px 1px 6px;
}

.range-tick {
  position: relative;
  flex: none;
  width: 118px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #060504;
  opacity: 0.6;
  transition: opacity 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.range-tick:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.range-tick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.range-tick span {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--gold-bright);
  background: rgba(8, 6, 4, 0.78);
  border-radius: 3px;
  padding: 1px 5px;
}

.range-tick.in-span {
  opacity: 1;
  border-color: rgba(227, 169, 79, 0.55);
}

.range-tick.is-start,
.range-tick.is-end {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(227, 169, 79, 0.5);
}

.range-span-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.range-warnings {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.range-warnings span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--rec);
  border-left: 2px solid var(--rec);
  background: rgba(255, 75, 60, 0.07);
  border-radius: 0 4px 4px 0;
  padding: 5px 9px;
}

.range-billing {
  margin-left: auto;
  color: var(--gold-deep) !important;
}

.range-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 11px;
}

.range-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.range-form-wide {
  grid-column: 1 / -1;
}

.range-form span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.range-form input,
.range-form select,
.range-form textarea {
  background: rgba(8, 6, 4, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13px;
  padding: 8px 11px;
  resize: vertical;
}

.range-form textarea {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
}

.range-form input:focus,
.range-form select:focus,
.range-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.range-builder-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-builder-actions small {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.range-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.range-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 12px;
}

.range-row-strip {
  display: flex;
  gap: 3px;
  flex: none;
}

.range-row-strip img {
  width: 44px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--line);
  display: block;
}

.range-row-copy strong {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
}

.range-row-copy small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.range-guardrails {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.range-guardrails label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.range-guardrails span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.range-guardrails textarea {
  background: rgba(8, 6, 4, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  padding: 8px 11px;
  resize: vertical;
}

.range-guardrails textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.sequence-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* ---------- Project dialog ---------- */

.project-dialog {
  width: min(440px, calc(100vw - 48px));
  margin: auto;
}

.project-dialog-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #14110d, #0c0a08);
  box-shadow: var(--shadow);
  padding: 22px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.field-label input {
  background: rgba(8, 6, 4, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  padding: 10px 12px;
}

.field-label input:focus {
  outline: none;
  border-color: var(--gold);
}

.project-dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.project-archive-confirmation {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(255, 114, 99, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 114, 99, 0.06);
  padding: 14px;
}

.project-archive-confirmation[hidden] {
  display: none;
}

.project-archive-confirmation > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.project-archive-confirmation strong {
  color: var(--ink);
}

.project-archive-status {
  min-height: 1.45em;
}

.project-archive-status.danger {
  color: var(--danger);
}

.engine-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 16px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.engine-option:hover {
  border-color: var(--gold);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.engine-option strong {
  font-size: 14px;
  color: var(--gold-bright);
}

.engine-option span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.look-engine-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(58vh, 520px);
  overflow-y: auto;
}

.engine-option.compact {
  padding: 10px 14px;
  gap: 2px;
}

.engine-model-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.engine-model-row em {
  font-style: normal;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--gold);
  white-space: nowrap;
}

.engine-back {
  align-self: flex-start;
}

.engine-preflight,
.engine-confirmation {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.engine-preflight strong,
.engine-confirmation strong {
  color: var(--gold-bright);
  font-size: 14px;
}

.engine-preflight span,
.engine-confirmation span,
.engine-confirmation small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.engine-option.is-confirm {
  border-color: rgba(227, 169, 79, 0.55);
}

.lane-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.lane-toggle:hover {
  border-color: var(--gold);
}

.lane-toggle input {
  margin-top: 2px;
  accent-color: var(--gold);
}

.lane-toggle strong {
  color: var(--gold-bright);
}

/* ---------- Project rail (thread-style) ---------- */

#projectSelect {
  display: none;
}

.rail-project-row {
  position: relative;
  display: flex;
  align-items: stretch;
}

.rail-project-row .rail-project {
  flex: 1;
  min-width: 0;
}

.rail-project-row .rail-project small em {
  font-style: normal;
  color: var(--line-strong);
}

.rail-project-row .rail-project-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-project-menu {
  flex: none;
  width: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.rail-project-menu svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
}

.rail-project-row:hover .rail-project-menu,
.rail-project-row.selected .rail-project-menu {
  opacity: 1;
}

.rail-project-menu:hover {
  color: var(--gold-bright);
}

.rail-expand-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
  padding: 7px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.rail-expand-toggle:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.rail-expand-toggle i {
  font-style: normal;
}

/* ---------- Reference intake stage ---------- */

.stage-ref-tray {
  /* dogfood #15 (real fix): the frame is 170px tall — an uncapped auto-fill grid crushed 7 cards
     into slivers. One row, at most 3 cards (JS caps + adds a "+N" chip), each tile full height. */
  position: absolute;
  inset: 14px;
  display: grid;
  grid-template-columns: repeat(var(--tray-cols, 3), 1fr);
  grid-auto-rows: 100%;
  gap: 10px;
  overflow: hidden;
}

.stage-ref-tray.has-count {
  bottom: 34px; /* lane for the rotation counter — it must never sit on a caption */
}

.stage-ref-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  opacity: 0;
  animation: riseIn 0.5s ease forwards;
  animation-delay: calc(var(--i) * 90ms);
}

.stage-ref-card img {
  display: block;
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain; /* dogfood #15: show the whole reference, letterboxed */
  background: #080606;
}

.stage-ref-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 8px;
}

.stage-ref-card figcaption strong {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-ref-card figcaption span {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-ref-card.is-candidate {
  border-color: rgba(227, 169, 79, 0.55);
}

.stage-ref-card .ref-card-pip {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-bright);
  animation: tallyPulse 1.8s ease-in-out infinite;
}

.stage-ref-card.is-locked {
  border-color: rgba(164, 207, 114, 0.5);
}

.stage-ref-card .ref-card-lock {
  position: absolute;
  top: 2px;
  right: 6px;
  font-style: normal;
  font-size: 10px;
  color: var(--ok);
}

/* ---------- Workbench stage tabs + galleries ---------- */

.stage-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
}

.stage-tabs-toolbar {
  display: flex;
  width: 100%;
  margin: 0 0 10px;
}

.stage-tabs-toolbar .stage-tab {
  flex: 1;
}

.stage-tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.stage-tab:hover {
  color: var(--ink);
}

.stage-tab.is-active {
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.stage-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.stage-card {
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}

.stage-card.is-current {
  border-color: var(--gold);
}

.stage-card-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-3);
  cursor: pointer;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.stage-card-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.stage-card-main:hover img {
  transform: scale(1.04);
}

.stage-card-hole,
.stage-card-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.stage-card-play {
  font-size: 22px;
  color: var(--gold-bright);
}

.stage-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 9px;
}

.stage-card figcaption strong {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-card figcaption span {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-card-action {
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--gold-bright);
  font-size: 11px;
  padding: 2px 7px;
  cursor: pointer;
}

.stage-card-action:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.stage-card-action-wide {
  width: auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stage-doclist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stage-doc-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px 12px;
  cursor: pointer;
}

.stage-doc-row:hover {
  border-color: var(--gold);
}

.stage-doc-row strong {
  font-size: 12px;
  color: var(--ink);
}

.stage-doc-row span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.stage-gallery-empty {
  padding: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}

/* MM7: text-lock continuity nudge on the reference bench */
.refs-continuity-hint {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  padding: 9px 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  background: var(--gold-soft);
  border: 1px solid rgba(227, 169, 79, 0.28);
  border-radius: var(--radius-sm);
}

.refs-continuity-hint strong {
  color: var(--gold-bright);
  font-weight: 600;
}

.refs-hint-mark {
  color: var(--gold);
  font-size: 9px;
  transform: translateY(-1px);
}

/* ---------- Stage groups (binder dividers) ---------- */

.stage-group {
  margin-bottom: 10px;
}

.stage-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(240, 233, 220, 0.035), rgba(240, 233, 220, 0.01));
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.stage-group-header:hover {
  border-color: var(--gold);
}

.stage-group.is-open .stage-group-header {
  border-color: var(--line-strong);
  background: var(--gold-soft);
  border-radius: 10px 10px 0 0;
  border-bottom-color: transparent;
}

.stage-group-tick {
  flex: none;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--gold-deep);
}

.stage-group.is-open .stage-group-tick {
  background: var(--gold-bright);
}

.stage-group-header strong {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-group-count {
  flex: none;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--gold-bright);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 1.5;
}

.stage-group-strip {
  display: flex;
  margin-left: auto;
  flex: none;
}

.stage-group-strip img {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  margin-left: -8px;
  background: var(--surface-2);
}

.stage-group-strip img:first-child {
  margin-left: 0;
}

.stage-group-chevron {
  flex: none;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}

.stage-group-strip + .stage-group-chevron {
  margin-left: 10px;
}

.stage-group .stage-gallery,
.stage-group .stage-doclist {
  border: 1px solid var(--line-strong);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.14);
}

/* ---------- Director's Cue (the one next action) ---------- */

.director-cue {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 0 0 10px;
  border: 1px solid rgba(227, 169, 79, 0.35);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(227, 169, 79, 0.07), rgba(227, 169, 79, 0.02));
}

.director-cue .cue-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px rgba(227, 169, 79, 0.6);
}

.director-cue .cue-dot.working {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(255, 114, 99, 0.6);
  animation: tallyPulse 1.6s ease-in-out infinite;
}

.director-cue .cue-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.director-cue .cue-text strong {
  /* dogfood #18: the artifact NAME is the payload — wrap to two lines, never ellipsize it away */
  font-size: 13px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.director-cue .cue-text span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Review Room ---------- */

.review-room {
  width: min(1480px, calc(100vw - 32px));
  height: min(94vh, 1060px);
  margin: auto;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(227, 169, 79, 0.05), transparent 60%),
    linear-gradient(180deg, #110e0b, #090807);
  box-shadow: var(--shadow);
  padding: 18px 22px 20px;
  overflow: hidden;
}

.review-room[open] {
  display: flex;
  animation: dialogIn 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.review-room-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: none;
}

.review-room-kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.review-room-top h2,
.review-summary h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  margin-top: 2px;
}

.review-room-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.review-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.review-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}

.review-tag.approved {
  color: var(--ok);
  border-color: rgba(164, 207, 114, 0.4);
  background: var(--ok-soft);
}

.review-tag.noted,
.review-tag.accepted_with_notes {
  color: var(--gold-bright);
  border-color: rgba(227, 169, 79, 0.45);
  background: var(--gold-soft);
}

.review-tag.revise,
.review-tag.rejected {
  color: var(--danger);
  border-color: rgba(255, 114, 99, 0.45);
  background: rgba(255, 114, 99, 0.1);
}

.review-tag.rendering {
  color: var(--gold-bright);
  border-color: rgba(227, 169, 79, 0.45);
  background: var(--gold-soft);
  animation: tallyPulse 2.4s ease-in-out infinite;
}

.review-tag.skipped {
  color: var(--dim);
  border-style: dashed;
}

.review-room-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 380px);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
}

/* The screen */
.review-stage {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(0deg, rgba(4, 3, 2, 0.96) 0 6%, transparent 6% 94%, rgba(4, 3, 2, 0.96) 94%),
    #060504;
}

.review-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  display: block;
}

.review-stage > img {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.review-stage.zoomed {
  display: block;
  overflow: auto;
  place-items: unset;
}

.review-stage.zoomed img {
  max-width: none;
  max-height: none;
  width: 170%;
  height: auto;
  cursor: zoom-out;
}

.review-stage-empty {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* The director's side card */
.review-side {
  grid-row: 1;
  grid-column: 2;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.review-shot-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-shot-index {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--gold-deep);
}

.review-shot-head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
  line-height: 1.05;
}

.review-shot-head small {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.review-camera-line {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  background: var(--bg-2);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.review-action-line {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}

.review-qa {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 2px solid var(--ok);
  background: var(--ok-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 9px 12px;
}

.review-qa.is-notes {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.review-qa.is-candidate {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.review-qa.is-fail {
  border-left-color: var(--danger);
  background: rgba(255, 114, 99, 0.08);
}

.review-qa.is-pending {
  border-left-color: var(--muted);
  background: rgba(128, 128, 128, 0.08);
}

.review-qa span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.review-qa p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}

.review-decided {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.review-decided p {
  font-size: 12.5px;
  color: var(--muted);
}

.review-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.review-controls .text-button {
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 14px;
}

/* Re-tiered look/panel review: the three decisions are primary; Compare/Skip/Re-render are quieter tools. */
.review-guide {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.review-guide strong {
  color: var(--ink);
  font-weight: 600;
}

.review-decisions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-decisions .text-button {
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 14px;
}

/* Tools = a full-size amber button (peer of the decisions) that drops down Compare/Skip/Re-render. */
.review-tools-menu {
  position: relative;
}

.tools-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.tools-toggle:hover,
.review-tools-menu.is-open .tools-toggle {
  background: rgba(227, 169, 79, 0.2);
  border-color: var(--gold-bright);
}

.tools-caret {
  font-size: 11px;
  color: var(--gold);
}

/* Each tool is a clean bordered box, spaced + styled like the decision buttons above (no tight panel). */
.review-tools-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.review-tool-item:hover {
  color: var(--ink);
  border-color: var(--gold);
  background: var(--gold-soft);
}

.review-tool-item.is-live {
  color: var(--gold-bright);
  border-color: var(--gold-deep);
  background: var(--gold-soft);
}

/* Rich tool item (Manual re-render): an uppercase title + a sentence-case descriptor line. */
.review-tool-item.rich {
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  text-transform: none;
  letter-spacing: normal;
}

.review-tool-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink);
}

.review-tool-cost {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted);
}

.review-tool-desc {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}

/* Manual re-render is a caution action (spends credits + overwrites the frame) — red like Request revision. */
.review-tool-item.danger {
  border-color: rgba(255, 114, 99, 0.4);
}

.review-tool-item.danger .review-tool-head {
  color: var(--danger);
}

.review-tool-item.danger:hover {
  border-color: var(--danger);
  background: rgba(255, 114, 99, 0.1);
}

/* Persistent re-render error (replaces the vanishing toast) + the in-progress busy panel. */
.review-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 114, 99, 0.5);
  border-radius: var(--radius-sm);
  background: rgba(255, 114, 99, 0.1);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.review-error span {
  flex: 1;
}

.review-busy {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
  padding: 26px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.review-busy-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  animation: reviewBusyPulse 1.1s ease-in-out infinite;
}

@keyframes reviewBusyPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

.review-busy-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold-bright);
  margin: 0;
}

.review-busy small {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 260px;
}

/* VP — Versions strip (model shootout): variant thumbnails, primary marked, Set-as-primary. */
.review-versions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.review-versions-label {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 8px;
}

.review-versions-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.review-version {
  flex: 0 0 auto;
  width: 118px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.review-version-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  cursor: zoom-in;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.review-version-thumb:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-deep);
  transform: translateY(-1px);
}

.review-version-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.review-version.is-primary .review-version-thumb {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.review-version.is-previewing .review-version-thumb {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold), 0 6px 18px rgba(0, 0, 0, 0.45);
}

.review-version-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1206;
  background: var(--gold);
  border-radius: 3px;
  padding: 1px 5px;
}

.review-version-label {
  display: block;
  width: 100%;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-version .text-button {
  padding: 4px 8px;
  font-size: 9px;
}

/* Enlarged variant preview — overlay banner on the review stage */
.review-stage.is-preview {
  position: relative;
}

.review-preview-banner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(8, 6, 3, 0.92), rgba(8, 6, 3, 0));
  pointer-events: none;
}

.review-preview-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.review-preview-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-2);
}

.text-button.primary kbd {
  color: #221708;
  border-color: rgba(34, 23, 8, 0.4);
  background: rgba(255, 255, 255, 0.22);
}

.text-button.danger kbd {
  color: var(--danger);
  border-color: rgba(255, 114, 99, 0.45);
}

.review-kbd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding-top: 4px;
}

.review-kbd-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.review-note-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.review-note-editor label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.review-note-editor textarea {
  background: rgba(8, 6, 4, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
}

.review-note-editor textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.review-note-actions {
  display: flex;
  gap: 8px;
}

/* ---- MM5: inline image-model re-render picker ---- */
.rerender-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.rerender-engines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rerender-engine {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.rerender-engine.is-selected {
  border-color: var(--gold);
  background: var(--surface-3);
  box-shadow: 0 0 0 1px var(--gold-soft);
}

.rerender-engine-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 11px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.rerender-engine-head:hover {
  background: var(--gold-soft);
}

.rerender-engine-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.rerender-engine-top strong {
  font-size: 13px;
  color: var(--gold-bright);
}

.rerender-badge {
  font-style: normal;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.rerender-badge.is-default {
  color: var(--gold);
  border-color: rgba(227, 169, 79, 0.4);
  background: var(--gold-soft);
}

.rerender-engine-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.rerender-engine-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--dim);
}

.rerender-more {
  align-self: flex-start;
  margin: 0 14px 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0;
}

.rerender-more:hover {
  color: var(--gold-bright);
}

.rerender-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 14px 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.rerender-field-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.rerender-model-picker {
  position: relative;
}

.rerender-model-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(8, 6, 4, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12.5px;
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color 0.12s;
}

.rerender-model-trigger:hover,
.rerender-model-picker.is-open .rerender-model-trigger {
  border-color: var(--gold);
}

.rerender-model-current {
  font-weight: 500;
}

.rerender-model-caret {
  color: var(--gold);
  font-size: 11px;
}

.rerender-model-menu {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 268px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 5px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.rerender-model-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.rerender-model-option:hover {
  background: var(--surface-3);
}

.rerender-model-option.is-selected {
  background: var(--gold-soft);
  border-color: var(--gold-deep);
}

.rerender-model-option-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.rerender-model-option-head strong {
  font-weight: 600;
}

.rerender-model-cost {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.rerender-model-check {
  margin-left: auto;
  color: var(--gold-bright);
}

.rerender-model-tag {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-deep);
  background: var(--gold-soft);
  border-radius: 4px;
  padding: 1px 5px;
}

.rerender-model-tag.alt {
  color: #9db98a;
  border-color: #45532f;
  background: rgba(120, 150, 90, 0.12);
}

.rerender-model-blurb {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
}

.rerender-aspects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rerender-chip {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 5px 11px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.rerender-chip:hover {
  color: var(--ink);
  border-color: var(--gold);
}

.rerender-chip.is-selected {
  color: #221708;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-color: var(--gold);
  font-weight: 600;
}

.rerender-quality {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
}

.rerender-quality-lock {
  font-size: 11px;
  filter: grayscale(1) opacity(0.7);
}

.rerender-actions {
  display: flex;
  gap: 8px;
}

.rerender-empty {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* Filmstrip */
.review-strip {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 2px;
  flex: none;
}

.review-thumb {
  position: relative;
  flex: none;
  width: 104px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #060504;
  display: grid;
  place-items: center;
  opacity: 0.62;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.review-thumb:hover {
  opacity: 1;
}

.review-thumb.is-current {
  opacity: 1;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(227, 169, 79, 0.5);
  transform: translateY(-2px);
}

.review-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.review-thumb span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.review-thumb-mark {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(8, 6, 4, 0.8);
}

.review-thumb-mark.approved { background: var(--ok); }
.review-thumb-mark.accepted_with_notes { background: var(--gold); }
.review-thumb-mark.rejected { background: var(--danger); }

.review-thumb.decided-approved { border-color: rgba(164, 207, 114, 0.5); }
.review-thumb.decided-accepted_with_notes { border-color: rgba(227, 169, 79, 0.55); }
.review-thumb.decided-rejected { border-color: rgba(255, 114, 99, 0.5); }

/* Continuity compare */
.review-stage.is-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  place-items: stretch;
}

.review-compare-frame {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
}

.review-compare-frame img,
.review-compare-frame video {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  cursor: default;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #040302;
}

.review-stage-video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  background: #000;
}

.review-compare-frame.is-candidate img {
  border-color: rgba(227, 169, 79, 0.5);
}

.review-compare-frame figcaption {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
  flex: none;
}

.review-compare-frame.is-candidate figcaption {
  color: var(--gold-bright);
}

/* Revision markup canvas */
.review-stage.is-marking {
  display: flex;
  flex-direction: column;
  gap: 0;
  place-items: unset;
}

.review-annotate-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.review-annotate-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: default;
}

.review-annotate-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: crosshair;
  touch-action: none;
}

.review-annotate-hint {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 75, 60, 0.35);
  background: rgba(255, 75, 60, 0.07);
  padding: 8px 12px;
}

.review-annotate-hint span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rec);
}

/* Summary */
.review-summary {
  grid-column: 1 / -1;
  grid-row: 1 / 3;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 28px 20px;
}

.review-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(560px, 100%);
  text-align: left;
}

.review-summary-row {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 14px;
}

.review-summary-row strong {
  font-size: 13.5px;
}

.review-summary-row p {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
}

.review-summary-note {
  max-width: 540px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.review-summary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Read-only quality records need room for the saved observation sentences. */
.panel-qa-record .review-summary-list { width: min(820px, 100%); }
.panel-qa-record .review-summary-note { max-width: 760px; }
.panel-qa-record .review-summary-row p { font-size: 14px; line-height: 1.5; }
.panel-qa-record .review-summary-row strong { font-size: 14px; }
.panel-qa-record .review-qa-report .markdown-preview { overflow-wrap: anywhere; }
.panel-qa-repair { align-items: stretch; text-align: left; padding: 20px; }
.panel-qa-repair h3, .panel-qa-repair h4, .panel-qa-repair p { margin: 0; }
.panel-qa-repair > [data-review-action="repair-back"] { align-self: flex-start; }
.panel-qa-repair .review-note-editor { margin-top: 0; width: 100%; }
.panel-qa-repair .review-summary-list { width: 100%; }
.panel-qa-repair .review-summary-actions { justify-content: flex-start; }
.panel-qa-repair .review-qa-report { width: 100%; text-align: left; }
.panel-qa-repair .review-qa-report summary { cursor: pointer; }
.panel-qa-repair .review-qa-report[open] .review-summary-list { margin-top: 12px; }
.panel-qa-repair .markdown-preview pre { white-space: pre-wrap; overflow-wrap: anywhere; }


@media (max-width: 900px) {
  .review-room-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1.2fr) auto auto;
  }

  .review-stage {
    grid-column: 1;
  }

  .review-side {
    grid-row: 2;
    grid-column: 1;
    max-height: 38vh;
  }

  .review-strip {
    grid-row: 3;
  }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 2200;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: rgba(24, 20, 15, 0.95);
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 11px 16px;
  max-width: min(520px, calc(100vw - 40px));
  animation: toastIn 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.toast[hidden] {
  display: none;
}

/* ---------- Responsive ---------- */

/* Medium tier: keep chat + wall side by side, slim everything */
@media (max-width: 1380px) {
  :root {
    --wall-width: clamp(330px, 31vw, 440px);
    --chat-max: 700px;
    --rail-width: 248px;
  }

  .panel-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* Compact tier: wall and rail become drawers over a dimmed stage */
@media (max-width: 1100px) {
  body.workbench-open .workspace {
    grid-template-columns: minmax(0, 1fr) 0;
  }

  .output-wall {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    width: min(520px, 92vw);
    z-index: 60;
    box-shadow: var(--shadow);
    border-left: 1px solid var(--line-strong);
    transform: translateX(102%);
    transition: transform 0.26s cubic-bezier(0.5, 0, 0.2, 1);
  }

  body.workbench-open .output-wall {
    transform: translateX(0);
  }

  /* lt-expanded must escape the drawer: the wall's transform makes it the containing
     block for the fixed stage, and its stacking context sits UNDER the body-level
     .lt-backdrop. transform:none is positionally identical to translateX(0) here, and
     z-index 76 lifts the wall (and the stage inside it, z 75) above the backdrop (74). */
  .output-wall:has(.lt-stage.lt-expanded) {
    transform: none;
    z-index: 76;
  }

  /* scrim so the chat clearly reads as "behind the drawer" */
  body.workbench-open .workspace::after {
    content: "";
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    background: rgba(6, 5, 3, 0.55);
    backdrop-filter: blur(1.5px);
    pointer-events: none;
  }

  .left-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-width);
    z-index: 70;
    box-shadow: var(--shadow);
    transform: translateX(0);
    transition: transform 0.24s ease;
  }

  body.rail-collapsed .left-rail {
    transform: translateX(-103%);
  }

  body:not(.rail-collapsed) .topbar::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(6, 5, 3, 0.45);
    pointer-events: none;
  }

  .app-shell {
    grid-template-columns: 0 minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .status-chip {
    display: none;
  }

  .chat-hero h2 {
    font-size: 34px;
  }
}

/* Phone header: retain the production name and every action without overlap. */
@media (max-width: 760px) {
  :root { --topbar-h: 112px; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; grid-template-rows: 1fr 44px; gap: 6px 8px; padding: 7px 12px; }
  .topbar-left { grid-column: 1 / 3; grid-row: 1; }
  .topbar-title strong { font-size: 18px; }
  .topbar-title > span:first-child { display: none; }
  .topbar-spend { font-size: 8px; letter-spacing: .05em; }
  .topbar-status { display: contents; }
  .topbar-status .tally { grid-column: 3; grid-row: 1; justify-self: end; padding: 5px 7px; }
  .topbar-status .tally em { display: none; }
  .topbar-status .office-door { display: flex; grid-column: 1; grid-row: 2; min-width: 0; width: 100%; height: 44px; justify-content: center; padding: 5px; }
  .topbar-status .office-door-mark { display: none; }
  .topbar-status .office-door-copy strong { font-size: 14px; white-space: normal; line-height: 1.1; }
  .topbar-status .office-door-copy small { display: none; }
  #outputToggleButton { grid-column: 2; grid-row: 2; min-width: 0; height: 44px; padding: 5px; font-size: 9px; letter-spacing: .03em; }
  #signOutButton { grid-column: 3; grid-row: 2; height: 44px; padding: 5px 7px; font-size: 9px; letter-spacing: .03em; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.stage-card.is-cut {
  opacity: 0.45;
}

.stage-card-cut {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.stage-look-badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-soft);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  white-space: nowrap;
}

/* ---------- W40: gate-attached range span editor ---------- */
.range-edit-dialog {
  width: min(880px, 92vw);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  padding: 18px;
}

.range-edit-dialog::backdrop { background: rgba(5, 4, 3, 0.7); backdrop-filter: blur(6px); }

.range-edit-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }

.range-edit-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.range-edit-row.is-picking { border-color: var(--gold); }
.range-edit-row.is-dirty { border-color: rgba(122, 197, 141, 0.5); }
.range-edit-copy { flex: 1 1 180px; min-width: 0; align-self: center; }
.range-edit-copy strong { font-family: var(--mono); font-size: 11.5px; display: block; }
.range-edit-copy small { color: var(--muted); font-size: 11px; }

.range-edit-duration {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.range-edit-duration input {
  width: 52px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: inherit;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 6px;
}

.range-edit-resolution,
.range-edit-transition,
.range-edit-direction {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.range-edit-resolution { flex: 0 1 112px; }
.range-edit-transition { flex: 0 1 180px; }
.range-edit-direction { flex: 1 1 260px; }

.range-edit-resolution select,
.range-edit-transition select,
.range-edit-direction input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-3);
  color: inherit;
  font: inherit;
  padding: 5px 7px;
}

.range-edit-direction input::placeholder { color: var(--dim); }
.range-edit-target { display: block; margin-top: 2px; color: var(--gold) !important; }

.range-edit-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.range-edit-board.is-picking { border-color: var(--gold); }
.range-edit-frame { margin: 0; border-radius: 6px; overflow: hidden; position: relative; opacity: 0.85; transition: opacity 0.12s ease; }
.range-edit-board.is-picking .range-edit-frame { cursor: pointer; opacity: 0.4; }
.range-edit-board.is-picking .range-edit-frame:hover { opacity: 1; outline: 1px solid var(--gold); }
/* W54: the chosen span reads like a selected calendar range — bright, filled, unmistakable. */
.range-edit-frame.is-inrange,
.range-edit-frame.is-preview {
  opacity: 1;
  outline: 2px solid var(--gold-bright);
  outline-offset: -2px;
  box-shadow: 0 0 14px rgba(227, 169, 79, 0.35);
}
.range-edit-frame.is-inrange::before,
.range-edit-frame.is-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(227, 169, 79, 0.16);
  pointer-events: none;
  z-index: 1;
}
.range-edit-frame.is-preview { outline-style: dashed; }
/* P8: while drawing a TAKE span, frames outside the owning range are off the table */
.range-edit-board.is-picking .range-edit-frame.is-outside { opacity: 0.12; cursor: not-allowed; }
.range-edit-board.is-picking .range-edit-frame.is-outside:hover { opacity: 0.12; outline: none; }
.range-edit-mode { display: inline-flex; gap: 2px; border: 1px solid var(--line-dim, rgba(227,169,79,.14)); border-radius: 7px; padding: 2px; flex: none; }
.range-edit-mode .text-button { border: none; }
.range-edit-takeflag {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  border: 1px solid rgba(244, 205, 126, 0.5);
  border-radius: 3px;
  padding: 1px 5px;
  margin-right: 4px;
}
.range-edit-of { color: var(--dim); }
.range-edit-row.is-take.is-dirty { border-left: 2px solid var(--gold-bright); padding-left: 8px; }
.range-edit-frame.is-anchor {
  opacity: 1;
  outline: 2px solid var(--gold-bright);
  outline-offset: -2px;
  box-shadow: 0 0 18px rgba(227, 169, 79, 0.5);
}
.range-edit-frame.is-anchor::after,
.range-edit-frame.is-start::after,
.range-edit-frame.is-end::after {
  content: "START";
  position: absolute;
  top: 3px;
  right: 4px;
  z-index: 2;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: #0d0a07;
  background: var(--gold-bright);
}
.range-edit-frame.is-end::after { content: "END"; }
.range-edit-was { color: var(--muted); }
.range-edit-now { color: var(--gold-bright); font-weight: 600; }
.range-edit-row.is-dirty { border-color: rgba(227, 169, 79, 0.5); }
.range-edit-row.is-focus { border-color: rgba(227, 169, 79, 0.35); }
.range-edit-frame img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.range-edit-frame figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  background: rgba(5, 4, 3, 0.75);
  color: var(--gold);
  border-top-right-radius: 4px;
}

.range-edit-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.range-edit-hint { flex: 1; font-size: 11.5px; color: var(--muted); }

@media (max-width: 680px) {
  .range-edit-resolution,
  .range-edit-transition,
  .range-edit-direction { flex-basis: 100%; }
}

/* Owner bug: the credits pill stretched into a giant alarm box. The left rail is a GRID —
   items stretch to their row by default, so the fix is align-self, not flex. */
.credits-meter { flex: none; align-self: start; }
.credits-meter span { display: block; }
.credits-meter .meter-sub { margin-top: 2px; color: var(--gold-bright); letter-spacing: 0.08em; }

/* Edge printing between the frame and the bottom perfs. */
.film-edgeprint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px;
  background: #14100c;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: rgba(244, 205, 126, 0.85);
}

/* Edge printing is a single line by definition — it truncates, never wraps. */
.film-edgeprint span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.film-edgeprint strong { color: var(--gold-bright); font-weight: 600; flex: none; white-space: nowrap; }
.film-edgeprint em { margin-left: auto; font-style: normal; color: var(--muted); flex: none; white-space: nowrap; }

/* ---------- THE LIGHT TABLE (owner-approved v5.3, 2026-07-06) ----------
   AI frames with photochemical manners: a daylight puck lamp BEHIND the strip (light
   through genuinely transparent perforations, never over the image), one smooth pull,
   negative -> printer-head develop, true loupe during QA, drawn grease verdicts, house
   lights, tap a frame to review. Cell width is law: text can never widen a cell. */
.lt-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 108%, rgba(227, 169, 79, 0.04), transparent 60%),
    #080502;
  transition: background 1.4s ease;
}
.lt-stage.lt-lit {
  background:
    radial-gradient(90% 70% at 50% 50%, rgba(214, 228, 255, 0.06), transparent 70%),
    #080502;
}
.lt-stage.lt-house {
  background:
    radial-gradient(140% 110% at 50% 50%, rgba(244, 226, 190, 0.16), transparent 74%),
    #0d0905;
}
/* The reel needs headroom the 170px slate never gives it: perf rows + rebate + status + caption
   around a readable print. Only when the light table is the act (W71). */
.stage-frame:has(.lt-stage) { height: 236px; }

.lt-lamp {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  background:
    radial-gradient(circle,
      #f6faff 0%,
      #f6faff 42%,
      rgba(214, 228, 255, 0.9) 55%,
      rgba(214, 228, 255, 0.35) 64%,
      transparent 72%);
  filter: blur(4px);
  transition: left 1.1s cubic-bezier(0.35, 0, 0.25, 1), opacity 0.9s ease, transform 1.1s cubic-bezier(0.35, 0, 0.25, 1);
  pointer-events: none;
}
.lt-lamp.lt-warm  { opacity: 0.8; transform: translate(-50%, -50%) scale(1.2); }
.lt-lamp.lt-on    { opacity: 1;   transform: translate(-50%, -50%) scale(1.5); }
.lt-lamp.lt-housed{ opacity: 0.9; transform: translate(-50%, -50%) scale(2.2); filter: blur(10px); }
.lt-lamp.lt-strike { animation: ltStrike 0.7s steps(1, end); }
@keyframes ltStrike {
  0% { opacity: 0; } 12% { opacity: 0.8; } 22% { opacity: 0.1; }
  38% { opacity: 0.65; } 52% { opacity: 0.25; } 68% { opacity: 1; }
}

/* v6: the camera. One gauge of film; translate+scale does ALL the sizing (owner design). */
.lt-cam {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  transition: transform 1.15s cubic-bezier(0.3, 0, 0.2, 1);
  will-change: transform;
  z-index: 2;
}
.lt-cam.lt-cut { transition: none; }
.lt-strip {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: stretch;
  width: max-content;
  background: transparent; /* base paints per-part: the punched holes are REAL openings */
}

.lt-cell { position: relative; flex: none; width: 300px; background: transparent; transition: opacity 0.5s ease; }
.lt-cell.lt-ghost { opacity: 0; }
/* tap = expand (owner: never a verdict room) */
.lt-stage { cursor: zoom-in; }
.lt-stage.lt-expanded {
  cursor: zoom-out;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(94vw, 1400px);
  height: min(84vh, 880px);
  aspect-ratio: auto;
  z-index: 75;
  border-radius: 14px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.85);
}
.lt-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 2, 0.74);
  backdrop-filter: blur(2px);
  z-index: 74;
}
.lt-cell + .lt-cell { border-left: 3px solid #140d06; }
.lt-cell.lt-spliced::before {
  content: "";
  position: absolute;
  left: -3px; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  animation: ltGlint 0.5s ease-out forwards;
  z-index: 5;
}
@keyframes ltGlint { 0% { opacity: 0.9; } 100% { opacity: 0; } }

.lt-perfs {
  height: 20px;
  background:
    radial-gradient(9px 6.5px at 13px 50%, transparent 52%, rgba(255, 244, 220, 0.18) 58%, #1c130a 67%) left center / 28px 100% repeat-x;
}
.lt-cell.lt-litcell .lt-perfs {
  background:
    radial-gradient(9px 6.5px at 13px 50%, rgba(214, 228, 255, 0.65) 22%, rgba(214, 228, 255, 0.25) 44%, transparent 56%, rgba(255, 248, 230, 0.5) 60%, #1c130a 67%) left center / 28px 100% repeat-x;
}
.lt-cell.lt-nearcell .lt-perfs {
  background:
    radial-gradient(9px 6.5px at 13px 50%, rgba(214, 228, 255, 0.22) 30%, transparent 54%, rgba(255, 248, 230, 0.3) 60%, #1c130a 67%) left center / 28px 100% repeat-x;
}
.lt-stage.lt-house .lt-perfs {
  background:
    radial-gradient(9px 6.5px at 13px 50%, rgba(214, 228, 255, 0.4) 26%, transparent 54%, rgba(255, 248, 230, 0.4) 60%, #1c130a 67%) left center / 28px 100% repeat-x;
}

.lt-window {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.6);
}
.lt-art, .lt-print {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lt-art { filter: brightness(0.34) contrast(1.2) saturate(0.75); }
.lt-cell.lt-negative .lt-art {
  filter: invert(1) hue-rotate(160deg) brightness(0.9) contrast(0.85) sepia(0.55) saturate(1.4);
}
.lt-cell.lt-negative .lt-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #c96f2e;
  mix-blend-mode: multiply;
  opacity: 0.75;
  z-index: 2;
}
.lt-cell.lt-developing .lt-window::after { transition: opacity 4.2s ease; opacity: 0; }
.lt-print {
  filter: brightness(0.34) contrast(1.2) saturate(0.75);
  clip-path: inset(0 100% 0 0);
  z-index: 2;
  transition: filter 1s ease;
}
.lt-cell.lt-developing .lt-print { animation: ltPrintPass 4.2s linear forwards; }
.lt-cell.lt-printed .lt-print { clip-path: inset(0 0 0 0); }
.lt-cell.lt-litcell .lt-print { filter: brightness(1) contrast(1.02) saturate(1); }
.lt-cell.lt-nearcell .lt-print { filter: brightness(0.62) contrast(1.1) saturate(0.9); }
@keyframes ltPrintPass { to { clip-path: inset(0 0% 0 0); } }
.lt-printhead {
  position: absolute;
  top: 0; bottom: 0;
  left: -12%;
  width: 10%;
  background: linear-gradient(90deg, transparent, rgba(255, 246, 224, 0.55), rgba(255, 246, 224, 0.12) 70%, transparent);
  filter: blur(2px);
  opacity: 0;
  z-index: 3;
  pointer-events: none;
}
.lt-cell.lt-developing .lt-printhead { animation: ltHeadPass 4.2s linear forwards; }
@keyframes ltHeadPass {
  0% { left: -12%; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { left: 102%; opacity: 0; }
}

.lt-rebate {
  position: relative;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px;
  background: #1c130a;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  color: rgba(244, 205, 126, 0.9);
  white-space: nowrap;
}
.lt-rebate .lt-code {
  clip-path: inset(0 100% 0 0);
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-cell.lt-litcell .lt-rebate .lt-code, .lt-stage.lt-house .lt-rebate .lt-code { animation: ltExpose 0.9s cubic-bezier(0.4, 0, 0.3, 1) forwards; }
@keyframes ltExpose { to { clip-path: inset(0 0 0 0); } }
.lt-rebate .lt-feet { color: var(--dim); font-variant-numeric: tabular-nums; flex: none; }
/* Owner: "PREVIS…" chopped mid-word reads sloppy — narrow cells swap to the short code. */
.lt-code-compact { display: none; }
.lt-cell.lt-compact .lt-code-full { display: none; }
.lt-cell.lt-compact .lt-code-compact { display: inline; }

.lt-cell.lt-leader .lt-window {
  background: repeating-linear-gradient(135deg, #0a0806 0 8px, #141009 8px 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.lt-leader-label { font-family: var(--mono); font-size: 8px; letter-spacing: 0.2em; color: var(--muted); }

.lt-loupe {
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid rgba(244, 205, 126, 0.9);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.7), inset 0 0 14px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 4;
  pointer-events: none;
  animation: ltSetdown 0.5s cubic-bezier(0.2, 1.2, 0.3, 1) forwards;
}
@keyframes ltSetdown {
  0% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.lt-loupe .lt-glass {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
  object-fit: cover; /* match the source print exactly — default `fill` skewed the magnified region */
  filter: blur(3px) brightness(1.1);
  animation: ltRack 0.6s ease 0.3s forwards;
}
@keyframes ltRack { to { filter: blur(0) brightness(1.12); } }
.lt-loupe-tag {
  position: absolute;
  z-index: 5;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(10, 7, 4, 0.82);
  border: 1px solid rgba(244, 205, 126, 0.5);
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.18em;
  pointer-events: none;
  animation: ltQaPulse 1.6s ease-in-out infinite;
}
@keyframes ltQaPulse { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }

.lt-grease {
  position: absolute;
  top: 5px; right: 6px;
  width: 30px; height: 30px;
  z-index: 3;
  transform: rotate(-8deg);
  opacity: 0;
}
.lt-grease.lt-show { opacity: 1; }
.lt-grease path {
  fill: none;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
}
.lt-grease path.lt-under { stroke-width: 6; opacity: 0.35; }
.lt-grease.lt-show path { animation: ltPen 0.5s cubic-bezier(0.3, 0, 0.4, 1) forwards; }
.lt-grease.lt-show path.lt-under { animation-delay: 0.04s; }
.lt-grease circle { fill: currentColor; opacity: 0; }
.lt-grease.lt-show circle { animation: ltSmudge 0.2s ease 0.48s forwards; }
@keyframes ltPen { to { stroke-dashoffset: 0; } }
@keyframes ltSmudge { to { opacity: 0.5; } }
.lt-grease.lt-pass { color: var(--gold-bright); } .lt-grease.lt-pass path { stroke: var(--gold-bright); }
.lt-grease.lt-flag { color: #e06c5a; } .lt-grease.lt-flag path { stroke: #e06c5a; }
/* W75 (owner): marks must read on ANY print. The color rules above also painted the
   "dark" underlay gold/red — gold-on-gold halo, invisible on warm frames. The underlay is
   now truly dark (higher specificity beats the color rules) and an in-SVG grease-shadow
   puddle backs the whole mark (::before never renders on SVG elements — verified live). */
.lt-grease.lt-pass path.lt-under, .lt-grease.lt-flag path.lt-under { stroke: #140d07; opacity: 0.9; stroke-width: 7.5; }
.lt-grease { overflow: visible; }
.lt-grease .lt-puddle { fill: rgba(12, 8, 4, 0.5); filter: blur(4px); opacity: 0; }
.lt-grease.lt-show .lt-puddle { opacity: 1; transition: opacity 0.3s ease 0.1s; }
.lt-cell.lt-pressing .lt-window { animation: ltPress 0.35s ease; }
@keyframes ltPress { 40% { transform: translateY(1px); } }

.lt-status {
  position: absolute;
  top: 10px; left: 12px; right: 12px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: uppercase;
  z-index: 4;
}
.lt-status .lt-right { color: var(--dim); font-variant-numeric: tabular-nums; }
.lt-caption {
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  z-index: 4;
  transition: color 0.5s ease;
}
.lt-stage.lt-house .lt-caption { color: var(--gold-bright); }
.lt-cell.lt-decided { cursor: pointer; }
.lt-cell.lt-decided:hover .lt-print { filter: brightness(1.08) contrast(1.02); }

@media (prefers-reduced-motion: reduce) {
  .lt-lamp, .lt-strip, .lt-print, .lt-art { transition: none !important; }
  .lt-lamp.lt-strike, .lt-cell.lt-pressing .lt-window, .lt-cell.lt-spliced::before { animation: none !important; }
  .lt-cell.lt-developing .lt-print, .lt-cell.lt-developing .lt-printhead { animation-duration: 0.01s !important; }
  .lt-grease.lt-show path, .lt-grease.lt-show circle { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .lt-loupe, .lt-loupe .lt-glass { animation: none; }
  .lt-loupe .lt-glass { filter: blur(0); }
  .lt-loupe-tag { animation: none; opacity: 1; }
  .lt-cam { transition: none !important; } /* camera cuts instead of moves */
  .lt-rebate .lt-code { animation: none !important; clip-path: inset(0 0 0 0) !important; }
}

/* The tool-backed QA report, expandable inside the review room. */
.review-qa-report { margin-top: 8px; }

.review-qa-report summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  list-style: none;
}

.review-qa-report summary::before { content: "▸ "; }
.review-qa-report[open] summary::before { content: "▾ "; }

.review-qa-report .markdown-preview {
  margin-top: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

/* P6 (W46): video thumbs in the review strip paint their first frame (faststart). */
.review-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

/* P4: the grab bar under a playing take in revision mode — scrub, grab, mark up. */
.review-grab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(227, 169, 79, 0.06);
}

.review-grab-bar span {
  font-size: 11.5px;
  color: var(--muted);
}

/* W28: provider request ids read as quiet support tokens, not dev noise. */
.request-id {
  font-family: var(--mono);
  font-size: 0.85em;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(227, 169, 79, 0.08);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  cursor: help;
}

/* Take QA: the take screens in the same film base as dailies — perfs, edge print, scan. */
.stage-takeqa {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 6px;
  background: #0b0908;
}

.takeqa-window {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #050403;
}

.takeqa-window video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* W60: the take is never cropped either — slack is film base */
}

.stage-takeqa .film-perfs { flex: 0 0 12px; }

.takeqa-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 36px;
  background: linear-gradient(180deg, transparent, rgba(227, 169, 79, 0.07) 55%, rgba(227, 169, 79, 0.16));
  border-bottom: 1px solid rgba(227, 169, 79, 0.32);
  animation: scanSweep 3.4s cubic-bezier(0.4, 0, 0.4, 1) infinite;
  pointer-events: none;
}

.takeqa-checks {
  position: absolute;
  top: 6px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
}

.takeqa-checks span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--gold);
  background: rgba(5, 4, 3, 0.7);
  border: 1px solid rgba(227, 169, 79, 0.3);
  border-radius: 3px;
  padding: 2px 6px;
  animation: takeqaPulse 2.8s ease-in-out infinite;
}

.takeqa-checks span:nth-child(2) { animation-delay: 0.7s; }
.takeqa-checks span:nth-child(3) { animation-delay: 1.4s; }
.takeqa-checks span:nth-child(4) { animation-delay: 2.1s; }

@keyframes takeqaPulse {
  0%, 100% { opacity: 0.45; }
  18% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .takeqa-scan { animation: none; opacity: 0.4; }
  .takeqa-checks span { animation: none; opacity: 0.8; }
}

/* W41: the session-expired interstitial — dead auth must never look like lost work. */
#sessionExpired {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  background: rgba(6, 5, 4, 0.88);
  backdrop-filter: blur(8px);
}

.session-expired-card {
  max-width: 420px;
  padding: 28px 30px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
}

.session-expired-card strong {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.session-expired-card p {
  margin: 12px 0 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* Gate identity: a take gate and a look gate read differently at a glance. */
.open-ask.is-take-gate { border-left: 2px solid rgba(224, 108, 90, 0.55); padding-left: 12px; }
.open-ask.is-look-gate { border-left: 2px solid rgba(227, 169, 79, 0.55); padding-left: 12px; }
.open-ask.is-take-gate .open-ask-kind { color: #e08a7a; }
.open-ask.is-look-gate .open-ask-kind { color: var(--gold); }
.open-ask.is-delivery-gate { border-left: 2px solid rgba(126, 200, 149, 0.55); padding-left: 12px; }
.open-ask.is-delivery-gate .open-ask-kind { color: #7ec895; }
.open-ask.is-roll-gate { border-left: 2px solid rgba(224, 108, 90, 0.75); padding-left: 12px; }
.open-ask.is-roll-gate .open-ask-kind { color: #e06c5a; }

/* Gate details: paths live behind a disclosure, not in the director's face. */
.open-ask-headline { font-size: 14px; line-height: 1.55; }

.gate-details { margin-top: 8px; }

.gate-details summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  list-style: none;
}

.gate-details summary::before { content: "▸ "; }
.gate-details[open] summary::before { content: "▾ "; }

.gate-details-paths { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }

.gate-details-paths button {
  all: unset;
  cursor: pointer;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

.gate-details-paths button:hover { background: var(--surface-2); }

.gate-details-paths button span {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* W13: needs-review picker — the chip lists everything waiting instead of teleporting. */
.needs-review-picker {
  position: fixed;
  z-index: 400;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.needs-review-picker button {
  all: unset;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: inherit;
  overflow-wrap: anywhere;
}

.needs-review-picker button:hover {
  background: var(--surface-3);
}

/* W29: review docs render their frames inline — the packet shows the work. */
.markdown-preview .markdown-image {
  margin: 14px 0;
}

.markdown-preview .markdown-image img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.markdown-preview .markdown-image img:hover { border-color: var(--gold); }

.markdown-preview .markdown-image figcaption {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
}

.stage-look-badge.is-approved {
  color: #7ac58d;
  border-color: rgba(122, 197, 141, 0.45);
}

/* Stage-browsing mode: the primary slot becomes a scrollable gallery */
.latest-preview.is-stage {
  aspect-ratio: auto;
  height: auto;
  max-height: 62vh;
  overflow-y: auto;
  padding: 12px;
  background: var(--surface-1, transparent);
  align-items: start;
  justify-items: normal;
  display: block;
}

.latest-preview.is-stage .stage-gallery {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* ── render-credit meter (Track B4): the money, always visible ─────────── */
.credits-meter {
  margin: 10px 14px 0;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: center;
  background: var(--surface-2);
}
.credits-meter.warn { color: var(--gold-bright); border-color: rgba(227, 169, 79, 0.55); }
.credits-meter.out { color: #ff9b8f; border-color: rgba(255, 114, 99, 0.5); }

.rail-help-link {
  display: block;
  margin: 8px 14px 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-decoration: none;
  text-transform: uppercase;
}
.rail-help-link:hover { color: var(--gold-bright); }

/* D6/P2 — Open Asks card (chat): the answerable "waiting on you" list. */
.open-ask-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.open-ask {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.open-ask:first-child {
  padding-top: 0;
  border-top: 0;
}
.open-ask-kind {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.open-ask[data-ask-kind="gate"] .open-ask-kind {
  color: var(--gold);
}
.open-ask p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.open-ask-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.open-ask-actions .text-button.ghost {
  color: var(--muted);
}

/* Compact questions stay beside the composer, independently from its draft. */
.guided-question-dock {
  position: relative;
  z-index: 2;
  flex: none;
  padding: 0 clamp(18px, 4vw, 48px);
}
.guided-questions {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--chat-max);
  max-height: min(46dvh, 360px);
  min-width: 0;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .12);
  overflow: hidden;
}
.question-header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 0;
  color: var(--muted);
  font-size: 12px;
}
.question-brief-link, .question-custom-toggle {
  border: 0;
  background: none;
  color: var(--gold-bright);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  padding: 9px 0;
}
.question-brief-link:hover, .question-custom-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }
.question-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px; }
.guided-questions h3 { margin: 3px 0 12px; font: inherit; font-size: 15px; font-weight: 500; line-height: 1.5; }
.question-options { display: flex; flex-wrap: wrap; gap: 7px; }
.question-option {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 100%; min-height: 38px; text-align: left;
  border: 1px solid var(--line-strong); border-radius: 7px;
  padding: 8px 12px; background: transparent; color: var(--ink); font: inherit;
  font-size: 13px; line-height: 1.4; cursor: pointer; overflow-wrap: anywhere;
}
.question-option:hover { background: rgba(255, 255, 255, .035); border-color: var(--muted); }
.question-choice-mark {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border: 1px solid var(--muted); border-radius: 50%; font-size: 10px;
}
.question-option.is-selected { border-color: var(--gold); background: rgba(227, 169, 79, .08); }
.question-option.is-selected .question-choice-mark { color: var(--bg); background: var(--gold-bright); border-color: var(--gold-bright); }
.guided-questions button:focus-visible, .question-custom:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
.guided-questions button:disabled { cursor: default; opacity: .4; }
.question-custom-toggle { color: var(--muted); margin-top: 2px; }
.question-custom-label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.question-custom {
  display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 60px; max-height: 140px;
  padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit;
  font-size: 14px; line-height: 1.5; color: inherit; background: var(--bg);
}
.question-navigation { display: flex; flex: none; align-items: center; gap: 6px; padding: 8px 12px 12px; }
.question-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 34px; padding: 7px 10px; border: 1px solid transparent; border-radius: 7px;
  background: none; color: var(--muted); font: inherit; font-size: 12px; line-height: 1.4; cursor: pointer;
}
.question-button:hover:not(:disabled) { background: rgba(255, 255, 255, .04); color: var(--ink); }
.question-button.is-primary { margin-left: auto; padding-inline: 15px; background: var(--gold-bright); color: var(--bg); font-weight: 600; }
.question-button.is-primary:hover:not(:disabled) { background: #f7d798; color: var(--bg); }
.question-answer-summary { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.question-answer-summary li { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.question-answer-summary li:last-child { border-bottom: 0; }
.question-answer-summary li > div { flex: 1; min-width: 0; }
.question-answer-summary span { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; }
.question-answer-summary strong { display: block; margin-top: 4px; font-size: 13px; font-weight: 500; white-space: pre-wrap; overflow-wrap: anywhere; }
.question-saved { margin: 4px 0; font-size: 14px; line-height: 1.5; }
.question-error { color: #f3bd88; font-size: 13px; line-height: 1.5; margin: 10px 0 0; }
.project-file-link.is-reading-link { text-decoration: underline; text-underline-offset: 4px; }
.written-review { margin-top: 8px; }
.written-review h3 { margin-bottom: 4px; font-weight: 550; }
.written-review-summary { margin: 0 0 3px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.written-review .question-navigation { padding-top: 10px; }
.written-review-selector { display: flex; align-items: center; gap: 6px; min-width: 0; }
.written-review-selector select { min-width: 0; max-width: 260px; padding: 5px; border: 0; border-radius: 5px; color: var(--ink); background: var(--surface); font: inherit; }
.written-review-history { border-top: 1px solid var(--line); padding: 8px 16px; font-size: 12px; color: var(--muted); }
.written-review-history summary { cursor: pointer; }
.written-review-history > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.written-review-history button { text-align: left; }
/* Written review requests never append a wall of duplicate gates to the conversation. */
.compact-document-review { max-height: min(35dvh, 280px); }
.compact-review-current { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; flex: none; }
.compact-review-current > div { min-width: 0; }
.compact-review-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.compact-review-current strong { display: block; font-size: 15px; line-height: 1.35; font-weight: 550; overflow-wrap: anywhere; }
.compact-review-current > button { flex: none; white-space: nowrap; }
.compact-review-others { min-height: 0; overflow: auto; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); overscroll-behavior: contain; }
.compact-review-others summary { padding: 9px 16px; cursor: pointer; }
.compact-review-list { max-height: 150px; overflow-y: auto; padding: 0 16px 6px; }
.compact-review-list > div { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.compact-review-list button { text-align: left; min-width: 0; overflow-wrap: anywhere; }
.compact-document-review .written-review-history { flex: none; max-height: 110px; overflow-y: auto; }
@media (max-width: 480px) {
  .compact-review-current { padding: 10px 12px; gap: 8px; }
  .compact-review-current strong { font-size: 14px; }
  .compact-review-current > button { font-size: 12px; padding: 8px; }
}
/* Additive presentation; uses the Studio's existing black/gold tokens. */
.review-queue { border-left: 3px solid var(--gold); }
.review-queue .question-header { padding-bottom: 8px; }
.review-queue-picker { flex: 1; flex-wrap: wrap; }
.review-queue-picker > span { color: var(--gold-bright); white-space: nowrap; }
.review-queue-picker select { max-width: min(100%, 330px); }
.review-queue-navigation { display: flex; flex: none; gap: 2px; }
.review-queue-navigation .question-button { min-width: 34px; }
.review-queue-actions { padding-inline: 0; flex-wrap: wrap; }
.review-queue-actions .question-button { border-color: var(--line-strong); }
.review-queue-actions .question-button.is-primary { margin-left: 0; }
.review-queue-actions .review-queue-quiet { border-color: transparent; }
.review-queue-editor .question-navigation { padding-inline: 0; }
.review-queue-editor .is-primary { margin-left: 0; }
.review-queue-working { margin: 0; padding: 0 16px 8px; }
.review-queue-deferred { color: var(--muted); font-size: 12px; font-weight: 400; }
.review-queue .written-review-history { max-height: 110px; flex: none; overflow-y: auto; }
@media (max-width: 480px) {
  .review-queue-picker { display: grid; gap: 2px; }
  .review-queue-picker select { width: 100%; }
  .review-queue-actions .question-button { flex: 1 1 auto; }
}
@media (pointer: coarse) {
  .review-queue .question-button, .review-queue select { min-height: 44px; }
  .review-queue textarea { font-size: 16px; }
}

.written-review-status { font-size: 13px; color: var(--muted); padding: 7px 4px; }
.script-check-status { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.script-check-status > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 7px 0; }
.script-check-status > summary::-webkit-details-marker { display: none; }
.script-check-status > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.script-check-dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.script-check-disclosure { margin-left: auto; transition: transform .15s; }
.script-check-status[open] .script-check-disclosure { transform: rotate(180deg); }
.script-check-details { padding: 1px 0 5px 13px; }
.script-check-details p { margin: 3px 0 7px; }
.script-check-finding { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 9px; overflow-wrap: anywhere; }
.script-check-finding strong { color: var(--ink); font-weight: 550; }
.script-check-evidence { font-size: 11px; }
.script-check-evidence > span { color: var(--ink); }
.review-queue > .review-queue-actions { flex: none; padding-inline: 16px; border-top: 1px solid var(--line); }
.review-queue .script-check-details { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .question-header { padding: 4px 12px 0; }
  .question-content { padding: 0 12px; }
  .question-navigation { padding: 6px 8px 8px; gap: 2px; }
  .question-option, .question-button, .question-brief-link, .question-custom-toggle { min-height: 44px; }
  .question-custom { font-size: 16px; }
}

.video-roll-receipt {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 7px 12px;
  margin: 2px 0 4px;
  padding: 10px;
  border: 1px solid rgba(224, 108, 90, 0.35);
  border-radius: 8px;
  background: rgba(224, 108, 90, 0.045);
}
.video-roll-receipt div { min-width: 0; }
.video-roll-receipt span,
.video-roll-receipt strong { display: block; }
.video-roll-receipt span {
  margin-bottom: 2px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.video-roll-receipt strong {
  overflow-wrap: anywhere;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink);
}
.video-roll-receipt small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.4;
}
.video-roll-unavailable {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(224, 108, 90, 0.35);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .video-roll-receipt { grid-template-columns: 1fr; }
  .video-roll-receipt small { grid-column: auto; }
}

/* P3 — single dismissable nudge line (suggestion asks). Never blocking, one at a time. */
.turn-ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pv-nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: var(--chat-max);
  margin: 10px auto 0;
  padding: 8px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}
.pv-nudge-text {
  flex: 1;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.pv-nudge-dismiss {
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}
.pv-nudge-dismiss:hover {
  color: var(--ink);
}

/* R1 — filmstrip chooser: the gold ring IS the selection state. */
.review-version.is-chosen .review-version-thumb {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 8px;
}
.review-version .review-version-thumb:not([disabled]):hover {
  outline: 2px solid var(--line-strong);
  outline-offset: 2px;
  border-radius: 8px;
}
.review-version-tag {
  background: var(--gold);
  color: #1a1408;
}

/* R2 — the two-option re-render sheet. */
.rerender-quick-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rerender-quick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.rerender-quick:hover:not([disabled]) {
  border-color: var(--gold-deep);
  background: var(--surface-3);
}
.rerender-quick.is-premium strong {
  color: var(--gold-bright);
}
.rerender-quick span {
  font-size: 11.5px;
  color: var(--muted);
}
.rerender-quick[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* ── Doc focus reader (walkthrough request): rail documents expand to a front layer; the
   studio stays visible but blurred behind (dialog::backdrop already blurs). Read-only —
   approve/revise stay in the rail and chat. ─────────────────────────────────────────── */
.doc-focus-dialog {
  width: min(1240px, calc(100vw - 48px));
  height: min(88vh, 1040px);
  margin: auto;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #14110d, #0c0a08);
  box-shadow: var(--shadow);
  padding: 22px 26px;
  overflow: hidden;
}
.doc-focus-dialog[open] {
  display: flex;
  animation: dialogIn 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.doc-focus-dialog .dialog-top > div:first-child { min-width: 0; }
.doc-focus-dialog .dialog-actions { flex-shrink: 0; }
#docFocusTitle, #docFocusMeta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-focus-body {
  min-width: 0;
  overflow-y: auto;
  padding-right: 10px;
}
.doc-focus-body .file-back-bar,
.doc-focus-body .review-doc-actions,
.doc-focus-body .project-file-actions {
  display: none;
}
.doc-focus-body .has-compact-review-actions .review-doc-actions { display: flex; flex-wrap: wrap; }
.doc-focus-body .review-document-preview {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.doc-focus-body .review-document-preview,
.doc-focus-body .markdown-preview-wrap,
.doc-focus-body .markdown-preview {
  width: 100%;
  max-width: none;
}
.doc-focus-body .markdown-preview {
  font-size: 15px;
  line-height: 1.68;
}
.doc-focus-body .markdown-preview table {
  font-size: 13.5px;
}
.doc-expand-button {
  margin-left: auto;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .doc-focus-dialog { width: calc(100vw - 24px); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); padding: 16px; }
  .doc-focus-body { padding-right: 2px; }
  #docFocusTitle { font-size: 21px; }
  #closeDocFocusDialog { min-width: 44px; min-height: 44px; }
}

/* W19: long unbroken file paths in ask/gate text escaped the decision card's box. Wrap
   anywhere — a path may be pasted into ask text verbatim and must never overflow the card. */
.open-ask,
.open-ask-list,
.workflow-thread-copy {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

/* ── Previz Phase A/B — the camera-move door (motion references) ─────────────────────── */
.motion-ref-dialog {
  width: min(760px, 92vw);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  padding: 18px;
}
.motion-ref-dialog::backdrop { background: rgba(5, 4, 3, 0.7); backdrop-filter: blur(6px); }

.motion-section-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 14px 0 8px;
}
.motion-section-kicker span {
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
  margin-left: 8px;
}

.motion-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  max-height: 44vh;
  overflow-y: auto;
  padding: 2px;
}
.motion-lib-note { color: var(--muted); font-size: 12px; margin: 4px 0; }

.motion-move {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.motion-move:hover { border-color: var(--gold); }
.motion-move.is-suggested { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-deep); }
.motion-move.is-busy { opacity: 0.65; }
.motion-move video,
.motion-move .motion-move-blank {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  background: #26241f;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.motion-move-label { font-size: 12px; font-weight: 600; }
.motion-move-hint { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.motion-move-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--gold);
  color: #221a0d;
}
.motion-move-tag.busy { background: var(--surface-3); color: var(--ink); }

.motion-upload-zone {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
}
.motion-upload-zone:hover { border-color: var(--gold); background: var(--gold-soft); }
.motion-upload-zone strong { font-size: 12.5px; }
.motion-upload-zone span { font-size: 11px; color: var(--muted); }

.motion-uploading { display: flex; flex-direction: column; gap: 8px; padding: 24px 8px; align-items: center; }
.motion-upload-name { font-family: var(--mono); font-size: 11.5px; }
.motion-upload-bar {
  width: min(420px, 90%);
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.motion-upload-bar i { display: block; height: 100%; background: var(--gold); transition: width 0.25s ease; }
.motion-upload-pct { font-family: var(--mono); font-size: 11px; color: var(--gold-bright); }
.motion-upload-note { font-size: 11.5px; color: var(--muted); }

/* ── Previz C1a — THE ROOM (pv3d namespace) ─────────────────────────────────── */
.pv3d-portal {
  position: fixed; inset: 0; z-index: 2600; overflow: hidden; pointer-events: none;
  opacity: 0; visibility: hidden;
  background:
    radial-gradient(80% 46% at 50% 72%, rgba(76, 207, 188, 0.12), transparent 62%),
    #060807;
  transition: opacity 0.34s ease, visibility 0s linear 0.34s;
}
.pv3d-portal.is-active { opacity: 1; visibility: visible; pointer-events: auto; cursor: progress; transition: opacity 0.32s ease, visibility 0s; }
.pv3d-portal-status {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: min(80vw, 24rem); margin: 0; padding: 12px 16px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(111, 241, 221, 0.38); border-radius: 999px;
  background: rgba(10, 18, 16, 0.9); color: #d9fff8;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.36), inset 0 0 24px rgba(84, 218, 198, 0.08);
  font-family: var(--mono); font-size: clamp(12px, 1.2vw, 15px); line-height: 1.4;
  letter-spacing: 0.04em; text-align: center; white-space: normal;
}
.pv3d-room-launch-status {
  position: absolute; inset: 0; z-index: 8;
  display: grid; place-items: center; padding: 24px;
  background: #060807; color: #d9fff8;
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; text-align: center;
}
.pv3d-portal-grid, .pv3d-sync-grid {
  position: absolute; left: -18%; right: -18%; top: -35%; bottom: 4%;
  background-image:
    linear-gradient(rgba(84, 218, 198, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 218, 198, 0.24) 1px, transparent 1px);
  background-size: 48px 48px;
  transform-origin: center bottom;
  transform: perspective(520px) rotateX(62deg) scale(1.22);
  opacity: 0;
}
.pv3d-portal.is-active .pv3d-portal-grid { animation: pv3dPortalGrid 0.72s cubic-bezier(0.22, 1, 0.36, 1) both; }
.pv3d-portal-scan {
  position: absolute; left: -10%; right: -10%; height: 28%; bottom: -30%;
  background: linear-gradient(180deg, transparent 0%, rgba(111, 241, 221, 0.05) 28%, rgba(111, 241, 221, 0.18) 45%, rgba(135, 255, 237, 0.42) 50%, rgba(111, 241, 221, 0.12) 57%, transparent 82%);
  opacity: 0;
}
.pv3d-portal.is-active .pv3d-portal-scan { animation: pv3dPortalScan 0.82s 0.08s cubic-bezier(0.3, 0, 0.1, 1) both; }
body.pv3d-room-launching .app-shell {
  transform: scale(0.988);
  opacity: 0.12;
}

.pv3d-room {
  --pv3d-origin-x: 50%; --pv3d-origin-y: 58%;
  width: 96vw; height: 92vh; max-width: none; border: 1px solid var(--line-strong);
  border-radius: 14px; background: #14120e; color: var(--ink); padding: 0; overflow: hidden;
}
.pv3d-room::backdrop { background: rgba(5, 4, 3, 0.8); backdrop-filter: blur(6px); }
.pv3d-sync {
  position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; opacity: 0;
}
.pv3d-sync-veil {
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--pv3d-origin-x) var(--pv3d-origin-y),
    rgba(2, 8, 7, 0) 0 10%, rgba(2, 8, 7, 0.14) 20%, rgba(2, 8, 7, 0.48) 54%, rgba(2, 8, 7, 0.7) 100%);
}
.pv3d-sync-scan {
  position: absolute; left: var(--pv3d-origin-x); top: var(--pv3d-origin-y);
  width: clamp(124px, 17vw, 250px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(144, 255, 238, 0.82);
  background: radial-gradient(circle, rgba(106, 237, 217, 0.13) 0 3%, transparent 4% 61%, rgba(122, 249, 230, 0.18) 63%, transparent 67%);
  box-shadow: 0 0 0 1px rgba(95, 229, 209, 0.14), inset 0 0 28px rgba(84, 218, 198, 0.12), 0 0 34px rgba(84, 218, 198, 0.2);
  opacity: 0; transform: translate(-50%, -50%) scale(0.34);
}
.pv3d-sync::after {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background-image:
    radial-gradient(circle at 16% 71%, rgba(139, 255, 237, 0.55) 0 1px, transparent 1.5px),
    radial-gradient(circle at 68% 28%, rgba(139, 255, 237, 0.42) 0 1px, transparent 1.5px),
    radial-gradient(circle at 83% 63%, rgba(139, 255, 237, 0.45) 0 1px, transparent 1.5px),
    linear-gradient(rgba(84, 218, 198, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 218, 198, 0.14) 1px, transparent 1px);
  background-size: 173px 131px, 211px 157px, 149px 191px, 96px 72px, 96px 72px;
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 42%, transparent 88%);
  mask-image: linear-gradient(to top, #000 0%, #000 42%, transparent 88%);
}
.pv3d-room.is-entering { animation: pv3dRoomEnter 0.46s cubic-bezier(0.22, 1, 0.36, 1) both; }
.pv3d-room.is-entering::backdrop { animation: pv3dBackdropEnter 0.52s ease-out both; }
.pv3d-room.is-entering .pv3d-body canvas { animation: pv3dWorldResolve 1.62s ease-out both; }
.pv3d-room.is-entering .pv3d-hud { animation: pv3dHudResolve 0.3s 0.72s ease-out both; }
.pv3d-room.is-entering .pv3d-sync { animation: pv3dSyncClear 1.68s linear both; }
.pv3d-room.is-entering .pv3d-sync-veil { animation: pv3dVeilResolve 1.55s ease-out both; }
.pv3d-room.is-entering .pv3d-sync-grid { animation: pv3dRoomGrid 1.46s 0.04s cubic-bezier(0.22, 1, 0.36, 1) both; }
.pv3d-room.is-entering .pv3d-sync-scan { animation: pv3dRoomScan 0.78s 0.04s cubic-bezier(0.22, 1, 0.36, 1) both; }
.pv3d-room.is-entering .pv3d-sync::after { animation: pv3dCageResolve 1.44s 0.06s ease-out both; }
.pv3d-room.is-closing { pointer-events: none; animation: pv3dRoomExit 0.28s cubic-bezier(0.55, 0, 1, 0.45) both; }
.pv3d-room.is-closing::backdrop { animation: pv3dBackdropExit 0.28s ease-in both; }
.pv3d-room.is-closing .pv3d-body canvas { animation: pv3dWorldReturn 0.28s ease-in both; }
.pv3d-room.is-closing .pv3d-hud,
.pv3d-room.is-closing .pv3d-top { transition: opacity 0.16s ease; opacity: 0; }
.pv3d-room.is-closing .pv3d-sync { animation: pv3dSyncReturn 0.28s ease-in both; }
.pv3d-room.is-closing .pv3d-sync-grid { animation: pv3dExitGrid 0.28s ease-in both; }

@keyframes pv3dPortalGrid {
  0% { opacity: 0; transform: perspective(520px) rotateX(62deg) scale(1.35) translateY(12%); }
  48% { opacity: 0.55; }
  100% { opacity: 0.22; transform: perspective(520px) rotateX(62deg) scale(1.18) translateY(0); }
}
@keyframes pv3dPortalScan {
  0% { opacity: 0; transform: translateY(0); }
  18% { opacity: 0.9; }
  82% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-115vh); }
}
@keyframes pv3dRoomEnter {
  0% { opacity: 1; transform: scale(0.982); }
  62% { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes pv3dBackdropEnter {
  0% { background: rgba(4, 8, 7, 0.98); }
  100% { background: rgba(5, 4, 3, 0.8); }
}
@keyframes pv3dWorldResolve {
  0% { opacity: 0.96; filter: saturate(0.72) contrast(1.08); transform: scale(1.006); }
  58% { opacity: 1; filter: saturate(0.9) contrast(1.03); }
  100% { opacity: 1; filter: none; transform: scale(1); }
}
@keyframes pv3dHudResolve {
  0% { opacity: 0; transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes pv3dSyncClear { 0%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pv3dVeilResolve {
  0%, 14% { opacity: 1; }
  62% { opacity: 0.44; }
  100% { opacity: 0; }
}
@keyframes pv3dRoomGrid {
  0% { opacity: 0.24; transform: perspective(520px) rotateX(62deg) scale(1.28) translateY(7%); }
  22% { opacity: 0.58; }
  72% { opacity: 0.26; }
  100% { opacity: 0; transform: perspective(520px) rotateX(62deg) scale(1.14) translateY(-2%); }
}
@keyframes pv3dRoomScan {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.32); }
  10% { opacity: 0.92; }
  42% { opacity: 0.2; }
  70%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}
@keyframes pv3dCageResolve {
  0% { opacity: 0.12; }
  24% { opacity: 0.42; }
  74% { opacity: 0.16; }
  100% { opacity: 0; }
}
@keyframes pv3dRoomExit {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.986); }
}
@keyframes pv3dBackdropExit {
  0% { background: rgba(5, 4, 3, 0.8); }
  100% { background: rgba(4, 8, 7, 0); }
}
@keyframes pv3dWorldReturn {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.08; transform: scale(1.015); }
}
@keyframes pv3dSyncReturn { 0% { opacity: 0; } 100% { opacity: 0.92; } }
@keyframes pv3dExitGrid { 0% { opacity: 0; } 48% { opacity: 0.36; } 100% { opacity: 0.12; } }

@media (prefers-reduced-motion: reduce) {
  .pv3d-portal { transition: none; background: rgba(6, 8, 7, 0.72); }
  .pv3d-portal-grid, .pv3d-portal-scan { display: none; }
  body.pv3d-room-launching .app-shell { transform: none; opacity: 1; }
  .pv3d-room.is-entering,
  .pv3d-room.is-closing,
  .pv3d-room.is-entering .pv3d-body canvas,
  .pv3d-room.is-closing .pv3d-body canvas,
  .pv3d-room.is-entering .pv3d-hud,
  .pv3d-room.is-entering .pv3d-top { animation: none !important; clip-path: none; filter: none; opacity: 1; transform: none; }
  .pv3d-sync { display: none; }
}

.pv3d-top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 16px; pointer-events: none; }
.pv3d-top > * { pointer-events: auto; }
.pv3d-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.pv3d-top h2 { font-size: 22px; font-weight: 400; margin-top: 2px; }
.pv3d-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 3px; max-width: 420px; }
.pv3d-body { position: absolute; inset: 0; }
.pv3d-body canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.pv3d-body canvas.dragging { cursor: grabbing; }
.pv3d-floor-note { position: absolute; top: 76px; left: 16px; z-index: 4; font-size: 11.5px; color: var(--muted); max-width: 320px; background: color-mix(in srgb, #1d1a15 88%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.pv3d-hud { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.pv3d-hud > * { pointer-events: auto; }
.pv3d-chips { position: absolute; top: 76px; right: 16px; display: flex; flex-wrap: wrap; gap: 5px; max-width: 240px; justify-content: flex-end; }
.pv3d-chips button, .pv3d-poses button { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: color-mix(in srgb, #1d1a15 88%, transparent); color: var(--ink); cursor: pointer; }
.pv3d-chips button.active, .pv3d-poses button.active { border-color: var(--gold); color: var(--gold-bright); }
.pv3d-poses { position: absolute; top: 120px; right: 16px; display: flex; flex-wrap: wrap; gap: 5px; max-width: 240px; justify-content: flex-end; }
.pv3d-bar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: color-mix(in srgb, #1d1a15 90%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px; }
.pv3d-seg { display: flex; flex: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pv3d-seg button { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; padding: 6px 12px; background: transparent; border: 0; color: var(--muted); cursor: pointer; white-space: nowrap; }
.pv3d-seg button.active { background: var(--gold); color: #221a0d; }
.pv3d-bar > span { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 110px; text-align: center; }
#pv3dReset { font-family: var(--mono); font-size: 10px; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
#pv3dCapture { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; padding: 8px 15px; border-radius: 8px; border: 1px solid var(--gold); background: transparent; color: var(--gold-bright); cursor: pointer; }
#pv3dCapture:hover:not(:disabled) { background: var(--gold); color: #221a0d; }
#pv3dCapture:disabled { opacity: .45; cursor: default; }
.pv3d-labels { position: absolute; inset: 0; pointer-events: none; }
.pv3d-labels span { position: absolute; transform: translate(-50%, -100%); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: rgba(139,133,120,.9); }
.pv3d-labels span.sel { color: var(--gold-bright); }
/* W79 — review/QA records readable inside the panel room */
.review-gate-docs { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.review-gate-docs span { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.review-gate-docs button { text-align: left; font-size: 12px; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.review-gate-docs button:hover { border-color: var(--gold); }
.full-panel-block { margin-top: 6px; align-self: flex-start; }
/* walkthrough notes: organized side panel, real frame lines, capture print */
.pv3d-side { position: absolute; top: 64px; right: 16px; width: 250px; display: flex; flex-direction: column; gap: 7px; background: color-mix(in srgb, #1d1a15 90%, transparent); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.pv3d-side h3 { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.pv3d-side .pv3d-chips, .pv3d-side .pv3d-poses { position: static; max-width: none; justify-content: flex-start; }
/* GROUND GLASS — the gold frame is the exact 16:9 lens extraction (setViewOffset); the
   lightened surround is genuine off-frame world, content rather than letterbox. */
.pv3d-frame { position: absolute; pointer-events: none; border: 1px solid rgba(227, 169, 79, 0.85); box-shadow: 0 0 0 9999px rgba(10, 9, 7, 0.38); }
.pv3d-frame .pvg-c { position: absolute; width: 12px; height: 12px; border: 2px solid #f4cd7e; }
.pv3d-frame .pvg-c.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.pv3d-frame .pvg-c.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.pv3d-frame .pvg-c.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.pv3d-frame .pvg-c.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.pv3d-frame .pvg-grid { display: none; position: absolute; inset: 0; background:
  linear-gradient(rgba(244, 205, 126, .20) 0 0) 33.33% 0 / 1px 100% no-repeat,
  linear-gradient(rgba(244, 205, 126, .20) 0 0) 66.67% 0 / 1px 100% no-repeat,
  linear-gradient(rgba(244, 205, 126, .20) 0 0) 0 33.33% / 100% 1px no-repeat,
  linear-gradient(rgba(244, 205, 126, .20) 0 0) 0 66.67% / 100% 1px no-repeat; }
.pv3d-frame[data-g^="thirds"] .pvg-grid { display: block; }
.pv3d-frame .pvg-cross { display: none; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; transform: translate(-50%, -50%); opacity: .55; background:
  linear-gradient(#f4cd7e 0 0) 50% 0 / 1px 100% no-repeat,
  linear-gradient(#f4cd7e 0 0) 0 50% / 100% 1px no-repeat; }
.pv3d-frame[data-g="thirds-cross"] .pvg-cross { display: block; }
/* the slate under the frame speaks the deck's readout grammar: label · tabular value · muted unit */
.pv3d-frame .pvg-slate { position: absolute; top: 100%; left: 0; right: 0; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-family: var(--mono); font-size: 10.5px; line-height: 1; letter-spacing: .02em; color: var(--muted); }
.pv3d-frame .pvg-slate #pvgGuides { margin-left: auto; }
.pv3d-frame .pvg-slate s { text-decoration: none; opacity: .35; }
.pv3d-frame .pvg-slate .grow { flex: 1; }
.pv3d-frame .pvg-slate span { position: static; display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.pv3d-frame .pvg-slate em { font-style: normal; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim, #6f675a); }
.pv3d-frame .pvg-slate b { font-weight: 600; color: rgba(244, 205, 126, 0.9); font-variant-numeric: tabular-nums; }
.pv3d-frame .pvg-slate #pvgId b { text-transform: uppercase; }
.pv3d-frame .pvg-slate u { text-decoration: none; font-size: 9px; color: var(--muted); }
.pv3d-frame .pvg-slate #pv3dBurnin { color: var(--gold); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
/* T53: the wild-walls tag — a wall stands on the set but left the frame for the lens */
.pv3d-frame .pvg-slate #pvgWild { color: #f0c9a8; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.pv3d-frame .pvg-slate #pvgWild:empty { display: none; }
.pv3d-frame .pvg-slate button { pointer-events: auto; height: 22px; padding: 0 8px; background: none; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--muted); font: inherit; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.pv3d-frame .pvg-slate button:hover { border-color: var(--gold); color: var(--gold-bright); }
.pv3d-frame.op-live { box-shadow: none; border-color: rgba(227, 169, 79, 0.5); }
.pv3d-label-cam { color: rgba(244, 205, 126, 0.6) !important; }
.pv3d-print { position: absolute; bottom: 148px; left: 50%; transform: translateX(-50%); z-index: 5; background: #1d1a15; border: 1px solid var(--gold); border-radius: 10px; padding: 10px; width: 320px; text-align: center; }
.pv3d-print img { width: 100%; border-radius: 6px; display: block; }
.pv3d-print p { font-size: 11px; color: var(--muted); margin-top: 7px; line-height: 1.45; }
.pv3d-print a { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--gold-bright); }
.pv3d-hint { font-size: 11px; color: var(--muted); }
.pv3d-help { position: absolute; left: 16px; bottom: 16px; }
#pv3dHelpToggle { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); background: color-mix(in srgb, #1d1a15 90%, transparent); color: var(--gold-bright); font-family: var(--mono); font-size: 14px; cursor: pointer; }
#pv3dHelpToggle:hover { border-color: var(--gold); }
.pv3d-help-card { position: absolute; left: 0; bottom: 38px; width: 300px; background: color-mix(in srgb, #1d1a15 94%, transparent); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; }
.pv3d-help-card h4 { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.pv3d-help-card p { font-size: 11.5px; color: var(--ink); line-height: 1.6; margin: 2px 0; }
.pv3d-help-card b { display: inline-block; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg-2, #121009); color: var(--gold-bright); font-family: var(--mono); font-size: 10.5px; font-weight: 600; line-height: 1.5; }
.pv3d-help-note { color: var(--muted) !important; margin-top: 6px !important; }
/* long review-record filenames stay inside their button */
.review-gate-docs button { overflow-wrap: anywhere; word-break: break-all; line-height: 1.35; }
/* C2 motion bar */
.pv3d-motionbar { position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; background: color-mix(in srgb, #1d1a15 92%, transparent); border: 1px solid var(--gold-deep); border-radius: 12px; padding: 9px 13px; max-width: 92%;   z-index: 6;
}
.pv3d-motion-label { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--gold); white-space: nowrap; }
.pv3d-motionbar input[type="range"] { width: 220px; accent-color: var(--gold); }
#pv3dTime { font-family: var(--mono); font-size: 11px; color: var(--gold-bright); min-width: 42px; }
.pv3d-motionbar select { font-family: var(--mono); font-size: 10.5px; background: var(--surface-3, #26221b); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 5px 7px; }
#pv3dSetKey, #pv3dPlay { font-family: var(--mono); font-size: 10.5px; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
#pv3dRecord { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; padding: 7px 12px; border-radius: 7px; border: 1px solid #c23b2e; background: transparent; color: #e88479; cursor: pointer; }
#pv3dRecord:hover:not(:disabled) { background: #c23b2e; color: #fff; }

/* #28 — revision-history strip in the look room */
.review-revision .review-version-thumb { position: relative; }
.review-revision.is-comparing .review-version-thumb {
  outline: 2px solid var(--gold, #c9a75a);
  outline-offset: 2px;
}
.review-revision-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold, #c9a75a);
  color: #14110a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* W85 — the range group's motion-mode door */
.stage-group-door {
  display: block;
  width: 100%;
  margin: 2px 0 6px;
  text-align: left;
}


/* W87 — the camera gets a camera department: lock pill, hint chips, legible motion bar */
.pv3d-motionbar { gap: 10px; }
.pv3d-motionbar .pv3d-motion-label { font-size: 11.5px; letter-spacing: .08em; }
.pv3d-motionbar select,
.pv3d-motionbar button {
  font-size: 12.5px;
  padding: 9px 14px;
  min-height: 36px;
  border: 1px solid rgba(227, 169, 79, 0.45);
  border-radius: 6px;
  background: #2e2820;
  color: var(--ink, #f0e9dc);
  cursor: pointer;
}
.pv3d-motionbar select.armed { border-color: #e3a94f; box-shadow: 0 0 0 1px rgba(227, 169, 79, 0.5); }
.pv3d-motionbar #pv3dRecord { border-color: rgba(224, 90, 78, 0.7); color: #f0b0a8; font-weight: 700; }
.pv3d-motionbar #pv3dRecord:hover { background: rgba(224, 90, 78, 0.18); }
.pv3d-motionbar #pv3dTime { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pv3d-motionbar input[type="range"] { accent-color: #e3a94f; min-width: 180px; }
#pv3dLock {
  font-size: 11.5px;
  letter-spacing: .06em;
  padding: 7px 12px;
  border: 1px solid var(--line, rgba(240, 233, 220, 0.14));
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #a89e8c);
  cursor: pointer;
}
#pv3dLock.locked { border-color: #e3a94f; color: #e3a94f; background: rgba(227, 169, 79, 0.1); }
.pv3d-hints {
  position: absolute;
  bottom: 128px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}
.pv3d-hints span {
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--muted, #a89e8c);
  background: rgba(20, 17, 12, 0.72);
  border: 1px solid rgba(240, 233, 220, 0.1);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.pv3d-hints b { color: var(--ink, #f0e9dc); font-weight: 600; }
.pv3d-side { z-index: 4; }

/* W87 — the assist strip: the room hears a sentence of direction */
.pv3d-assist {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
  width: min(560px, 60%);
}
.pv3d-assist input {
  flex: 1;
  font-size: 12.5px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(240, 233, 220, 0.16);
  background: rgba(20, 17, 12, 0.8);
  color: var(--ink, #f0e9dc);
}
.pv3d-assist input::placeholder { color: var(--muted, #a89e8c); opacity: 0.7; }
.pv3d-assist input:focus { border-color: rgba(227, 169, 79, 0.55); outline: none; }
.pv3d-assist button {
  font-size: 11.5px;
  letter-spacing: .06em;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(227, 169, 79, 0.45);
  background: rgba(227, 169, 79, 0.12);
  color: #e3c68f;
  cursor: pointer;
}
.pv3d-assist button:disabled { opacity: 0.6; cursor: wait; }


/* W88 — layout truth: hints above the bar, print above the hints, one control height */
.pv3d-hints { bottom: 140px; }
.pv3d-print { bottom: 210px !important; }
.pv3d-print img[hidden] { display: none; }
.pv3d-bar > button, .pv3d-bar .pv3d-seg { min-height: 34px; }
#pv3dLock { border-radius: 8px; padding: 8px 13px; min-height: 34px; }
#pv3dReset { min-height: 34px; border-radius: 8px; }
#pv3dCapture { min-height: 34px; }
.pv3d-scrubwrap { position: relative; display: inline-flex; align-items: center; flex: 1; min-width: 180px; }
.pv3d-scrubwrap input[type="range"] { width: 100%; min-width: 0; }
#pv3dKeyDots { position: absolute; inset: 0; pointer-events: none; }
#pv3dTimelinePlayhead { display: none; }
#pv3dKeyDots i {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: #e3a94f;
  box-shadow: 0 0 0 2px rgba(20, 17, 12, 0.9);
}
#pv3dKeyDots i[data-kind="semantic"] { top: calc(50% - 10px); }
#pv3dDur {
  width: 44px;
  font: inherit;
  font-size: 12px;
  text-align: right;
  background: #2e2820;
  border: 1px solid rgba(227, 169, 79, 0.45);
  border-radius: 5px;
  color: var(--ink, #f0e9dc);
  padding: 2px 4px;
}
#pv3dClearKeys { min-height: 30px !important; padding: 4px 10px !important; font-size: 11px !important; }

/* C3 — action marks: green dots beside the gold camera keys */
#pv3dKeyDots i.mark { background: #8fd08f; }

/* W89 — measured layout: nothing wraps, nothing hides, numbers fit */
.pv3d-motionbar { flex-wrap: nowrap; max-width: min(92%, 1100px); }
.pv3d-motionbar select, .pv3d-motionbar button { white-space: nowrap; flex: 0 0 auto; }
.pv3d-motionbar .pv3d-motion-label { white-space: nowrap; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
#pv3dDur { width: 5ch; padding: 2px 2px; text-align: center; }
#pv3dLock, #pv3dReset, #pv3dCapture, .pv3d-seg button { white-space: nowrap; }
.pv3d-bar { flex-wrap: nowrap; }
.pv3d-hints { bottom: 152px; z-index: 7; max-width: min(90%, 900px); }
.pv3d-print { bottom: 224px !important; }
.pv3d-constraint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 2px;
  font-size: 11px;
  color: var(--muted, #a89e8c);
}
.pv3d-constraint button {
  font-size: 10.5px;
  letter-spacing: .05em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(227, 169, 79, 0.45);
  background: transparent;
  color: #e3c68f;
  cursor: pointer;
  white-space: nowrap;
}
.pv3d-director-action-card {
  display: grid !important;
  gap: 7px !important;
  width: min(100%, 520px);
  padding: 10px 11px;
  border: 1px solid rgba(227, 169, 79, 0.38);
  border-radius: 9px;
  background: rgba(27, 23, 17, 0.82);
  color: var(--muted, #a89e8c);
}
.pv3d-director-action-card strong {
  color: var(--ink, #f0e9dc);
  font-size: 12px;
  letter-spacing: 0;
}
.pv3d-director-action-card.is-armed {
  border-color: rgba(126, 222, 232, 0.72);
  box-shadow: inset 0 0 0 1px rgba(126, 222, 232, 0.12);
}
.pv3d-director-action-card.is-empty,
.pv3d-director-action-card.is-locked { border-style: dashed; }
.pv3d-director-action-buttons {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px !important;
}
.pv3d-director-action-buttons button:first-child {
  border-color: rgba(227, 169, 79, 0.72);
  background: rgba(227, 169, 79, 0.12);
  color: #f0d29d;
}
.pv3d-relationship-advanced {
  width: min(100%, 700px);
  color: var(--dim, #7f776a);
}
.pv3d-relationship-advanced summary {
  cursor: pointer;
  font-size: 10px;
  letter-spacing: .04em;
}
.pv3d-relationship-advanced > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}
.pv3d-attachment-chooser {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px !important;
  width: min(100%, 680px);
  padding: 7px;
  border: 1px solid rgba(126, 222, 232, 0.24);
  border-radius: 8px;
  background: rgba(15, 18, 18, 0.45);
  flex: 1 1 100%;
}
.pv3d-constraint:has(.pv3d-attachment-chooser) { flex-wrap: wrap; max-width: min(94vw, 900px); }
.pv3d-attachment-chooser label {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pv3d-attachment-chooser select {
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid rgba(240, 233, 220, 0.18);
  border-radius: 5px;
  background: #191713;
  color: var(--ink, #f0e9dc);
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv3d-attachment-chooser > button,
.pv3d-attachment-chooser > b { grid-column: 1 / -1; justify-self: start; }
.pv3d-attachment-chooser > b {
  color: #7edee8;
  font-size: 10px;
  overflow-wrap: anywhere;
}
.pv3d-attachment-chooser button:disabled { cursor: not-allowed; opacity: .45; }
.pv3d-attachment-events {
  display: grid !important;
  gap: 7px !important;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(126, 222, 232, 0.28);
  border-radius: 8px;
  background: rgba(10, 17, 18, 0.58);
}
.pv3d-attachment-event-row,
.pv3d-attachment-event-times {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px !important;
}
.pv3d-attachment-event-row span { overflow-wrap: anywhere; }
.pv3d-attachment-event-card label {
  display: grid !important;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 6px !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 9px;
}
.pv3d-attachment-event-card select {
  min-width: 0;
  width: 100%;
  padding: 4px 5px;
  border: 1px solid rgba(240, 233, 220, 0.18);
  border-radius: 5px;
  background: #191713;
  color: var(--ink, #f0e9dc);
}
.pv3d-attachment-event-card button:disabled { cursor: not-allowed; opacity: .45; }
.pv3d-attachment-event-warning {
  padding: 6px;
  border-left: 2px solid rgba(255, 196, 96, .72);
  color: #ffd99b;
  background: rgba(92, 58, 12, .24);
}
.pv3d-attachment-event-card .danger {
  color: #ffaaa0;
  border-color: rgba(255, 112, 96, .52);
}
.pv3d-attachment-event-delete {
  display: grid !important;
  gap: 6px !important;
  padding: 7px;
  border: 1px solid rgba(255, 112, 96, .45);
  border-radius: 6px;
  background: rgba(72, 18, 15, .32);
}

/* C4b — the assist reads the world: context chips under the ask */
.pv3d-assist-ctx {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 5;
  font-size: 10.5px;
  color: var(--muted, #a89e8c);
  white-space: nowrap;
}
.pv3d-assist-ctx .ctx-chip, .pv3d-assist-ctx #pv3dCtxSteal {
  font-size: 10.5px;
  letter-spacing: .04em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 233, 220, 0.14);
  background: rgba(20, 17, 12, 0.7);
  color: var(--muted, #a89e8c);
  cursor: pointer;
  white-space: nowrap;
}
.pv3d-assist-ctx .ctx-chip.on { border-color: rgba(227, 169, 79, 0.55); color: #e3c68f; background: rgba(227, 169, 79, 0.1); }
.pv3d-assist-ctx #pv3dCtxSteal { border-style: dashed; }

/* C4c — the location's room: scene picker + shot chips, top-left under the meta */
.pv3d-scenes {
  position: absolute;
  top: 14px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 5;
  max-width: 300px;
}
.pv3d-scenes select {
  font-size: 11.5px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(240, 233, 220, 0.16);
  background: rgba(20, 17, 12, 0.85);
  color: var(--ink, #f0e9dc);
  max-width: 100%;
}
.pv3d-shots { display: flex; gap: 6px; flex-wrap: wrap; }
.pv3d-shot-chip {
  font-size: 10.5px;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 233, 220, 0.14);
  background: rgba(20, 17, 12, 0.7);
  color: var(--muted, #a89e8c);
  cursor: pointer;
}
.pv3d-shot-chip.on { border-color: rgba(227, 169, 79, 0.6); color: #e3c68f; background: rgba(227, 169, 79, 0.12); }
.pv3d-shot-chip.staged { text-decoration: underline; text-underline-offset: 3px; }

/* W90 — SHOT CAM is the lens: staging furniture lives in FLOOR */
.pv3d-hud.mode-shot .pv3d-scenes,
.pv3d-hud.mode-shot .pv3d-assist-ctx,
.pv3d-hud.mode-shot .pv3d-side { display: none; }

/* ============ D1 — THE ROOM v2 CHROME: four zones, nothing floats over the stage ============ */
/* zone 1 — top bar */
.pv3d-topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 48px; z-index: 6;
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: color-mix(in srgb, #1d1a15 94%, transparent);
  border-bottom: 1px solid var(--line);
}
.pv3d-topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pv3d-zone-cap { font-family: var(--mono); font-size: 9px; letter-spacing: .13em; color: var(--muted); white-space: nowrap; }
.pv3d-topbar #pv3dScene {
  height: 32px; max-width: 210px; background: var(--surface-3, #26221b); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; font-size: 12px; padding: 0 6px;
}
.pv3d-topbar .pv3d-shots { display: flex; gap: 5px; }
.pv3d-assist { position: static; transform: none; flex: 1; display: flex; gap: 8px; max-width: 560px; margin: 0 auto; width: auto; }
.pv3d-ask-wrap { flex: 1; position: relative; display: flex; align-items: center; }
.pv3d-ask-wrap input { width: 100%; padding-right: 74px; }
#pv3dCtxBtn {
  position: absolute; right: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px dashed rgba(227, 169, 79, 0.5); background: transparent; color: #e3c68f;
  font-size: 11px; cursor: pointer; white-space: nowrap;
}
.pv3d-ctx-pop {
  position: absolute; top: 52px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; align-items: center; z-index: 8;
  background: #1d1a15; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
/* zone 2 — inspector (floor only; slim handle in shot cam) */
.pv3d-inspector {
  position: absolute; top: 48px; right: 0; bottom: 100px; width: 228px; z-index: 5;
  background: color-mix(in srgb, #1d1a15 92%, transparent);
  border-left: 1px solid var(--line); padding: 14px; overflow: auto;
  transition: transform 0.22s ease;
}
.pv3d-inspector h3 { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--gold); margin: 14px 0 8px; }
.pv3d-inspector h3:first-child { margin-top: 0; }
.pv3d-hud.mode-shot .pv3d-inspector { transform: translateX(calc(100% - 7px)); }
.pv3d-hud.mode-shot .pv3d-inspector::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px;
  background: #26221b; border-left: 2px solid rgba(227, 169, 79, 0.45);
}
.pv3d-hud.mode-shot .pv3d-topbar-left { visibility: hidden; }
/* wave-2 (fresh-eyes): the 📎 button shows in shot cam, so its popover must too — hiding
   only the popover made the first screen's most visible button a dead click */
/* zone 3 — dock */
.pv3d-dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; }
.pv3d-timeline {
  display: flex; align-items: center; gap: 11px; height: 56px; padding: 0 16px;
  background: color-mix(in srgb, #1d1a15 95%, transparent);
  border-top: 1px solid rgba(227, 169, 79, 0.4);
}
.pv3d-timeline .pv3d-motion-label { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--gold); white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.pv3d-timeline select, .pv3d-timeline button {
  font-size: 12px; padding: 0 13px; height: 32px; white-space: nowrap; flex: 0 0 auto;
  border: 1px solid rgba(227, 169, 79, 0.45); border-radius: 8px;
  background: #2e2820; color: var(--ink); cursor: pointer;
}
.pv3d-timeline select.armed { border-color: #e3a94f; box-shadow: 0 0 0 1px rgba(227, 169, 79, 0.5); }
.pv3d-timeline #pv3dRecord { border-color: rgba(224, 90, 78, 0.7); color: #f0b0a8; font-weight: 700; }
.pv3d-timeline #pv3dRecord:hover { background: rgba(224, 90, 78, 0.18); }
.pv3d-timeline #pv3dTime { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.pv3d-exact-time {
  display: inline-flex; align-items: center; flex: 0 0 auto;
}
.pv3d-exact-time > span {
  position: absolute; inline-size: 1px; block-size: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
#pv3dExactTime {
  box-sizing: border-box; inline-size: calc(7ch + 10px); min-inline-size: calc(7ch + 10px); height: 26px;
  padding: 2px 4px; text-align: right; font-family: var(--mono); font-size: 11px;
  font-variant-numeric: tabular-nums; color: var(--gold-bright, #f4cd7e); background: #2e2820;
  border: 1px solid rgba(227, 169, 79, 0.45); border-radius: 6px;
}
#pv3dExactTime:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#pv3dExactTime[aria-invalid="true"] { border-color: rgba(224, 90, 78, 0.9); }
.pv3d-timeline:not(.is-strict-v2-timeline) .pv3d-exact-time { display: none; }
.pv3d-timeline #pv3dDur { width: 5ch; height: 26px; text-align: center; background: #2e2820; border: 1px solid rgba(227, 169, 79, 0.45); border-radius: 6px; color: var(--ink); font-size: 12px; }
.pv3d-timeline #pv3dClearKeys { height: 26px !important; padding: 0 9px !important; font-size: 10.5px !important; }
.pv3d-timeline .pv3d-timeline-control-slot { display: contents; }
.pv3d-timeline.is-strict-v2-timeline {
  --pv3d-semantic-marker-hit-target: 24px;
  --pv3d-semantic-marker-rail-gap: 12px;
  --pv3d-native-range-thumb-size: 16px;
}
.pv3d-timeline.is-strict-v2-timeline .pv3d-scrubwrap {
  min-width: 220px; padding: 0; border: 0;
}
.pv3d-timeline.is-strict-v2-timeline .pv3d-set-key-slot:not(.is-semantic) {
  --pv3d-nonsemantic-key-label-inline-size: 10ch;
  --pv3d-nonsemantic-key-control-inline-size: calc(var(--pv3d-nonsemantic-key-label-inline-size) + 28px);
  display: inline-flex; align-items: center;
  inline-size: var(--pv3d-nonsemantic-key-control-inline-size);
  min-inline-size: var(--pv3d-nonsemantic-key-control-inline-size);
  max-inline-size: var(--pv3d-nonsemantic-key-control-inline-size);
  flex: 0 0 var(--pv3d-nonsemantic-key-control-inline-size);
}
.pv3d-timeline.is-strict-v2-timeline .pv3d-set-key-slot:not(.is-semantic) #pv3dSetKey {
  box-sizing: border-box; inline-size: 100%; min-inline-size: 100%; max-inline-size: 100%;
}
.pv3d-timeline.is-strict-v2-timeline .pv3d-delete-key-slot {
  --pv3d-delete-key-control-inline-size: 34px;
  display: inline-flex; align-items: center;
  inline-size: var(--pv3d-delete-key-control-inline-size);
  min-inline-size: var(--pv3d-delete-key-control-inline-size);
  max-inline-size: var(--pv3d-delete-key-control-inline-size);
  flex: 0 0 var(--pv3d-delete-key-control-inline-size);
}
.pv3d-timeline.is-strict-v2-timeline .pv3d-delete-key-slot #pv3dDelKey {
  box-sizing: border-box; inline-size: 100%; min-inline-size: 100%; max-inline-size: 100%;
}
.pv3d-timeline.is-strict-v2-timeline .pv3d-timeline-status {
  display: none;
}
/* A selected semantic subject carries the longest truthful key label. Admit the established
   two-row layout before that authoring lane can push CLEAR TAKE through the Room edge. */
@media (max-width: 1500px) {
  .pv3d-timeline.is-strict-v2-timeline.has-selected-semantic-subject {
    box-sizing: border-box; flex-wrap: wrap; align-content: center;
    height: auto; min-height: 88px; padding-block: 8px; gap: 6px 8px;
  }
  .pv3d-timeline.is-strict-v2-timeline.has-selected-semantic-subject .pv3d-motion-label {
    flex: 0 1 150px; max-width: 150px;
  }
  .pv3d-timeline.is-strict-v2-timeline.has-selected-semantic-subject .pv3d-scrubwrap {
    flex: 1 1 360px; min-width: 220px;
  }
  .pv3d-hud:has(.pv3d-timeline.is-strict-v2-timeline.has-selected-semantic-subject) .pv3d-inspector { bottom: 132px; }
  .pv3d-hud:has(.pv3d-timeline.is-strict-v2-timeline.has-selected-semantic-subject) .pv3d-operator { bottom: 148px; }
}
@media (max-width: 1100px) {
  .pv3d-timeline.is-strict-v2-timeline {
    box-sizing: border-box; flex-wrap: wrap; align-content: center;
    height: auto; min-height: 88px; padding-block: 8px; gap: 6px 8px;
  }
  .pv3d-timeline.is-strict-v2-timeline .pv3d-motion-label {
    flex: 0 1 150px; max-width: 150px;
  }
  .pv3d-timeline.is-strict-v2-timeline .pv3d-scrubwrap {
    flex: 1 1 360px; min-width: 220px;
  }
  .pv3d-hud:has(.pv3d-timeline.is-strict-v2-timeline) .pv3d-inspector { bottom: 132px; }
  .pv3d-hud:has(.pv3d-timeline.is-strict-v2-timeline) .pv3d-operator { bottom: 148px; }
}
.pv3d-timeline.is-strict-v2-timeline #pv3dTimelinePlayhead {
  display: block; position: absolute; z-index: 1; top: -10px; bottom: -10px;
  left: var(--pv3d-timeline-playhead-position, 0%); width: 2px;
  transform: translateX(-50%); pointer-events: none;
  background: var(--gold-bright, #f4cd7e); box-shadow: 0 0 0 1px rgba(20, 17, 12, 0.9);
}
.pv3d-timeline.is-strict-v2-timeline #pv3dTimelinePlayhead::after {
  content: ""; position: absolute; left: 50%; top: -7px; transform: translateX(-50%);
  width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 8px solid var(--gold-bright, #f4cd7e);
}
.pv3d-timeline.is-strict-v2-timeline #pv3dScrub {
  -webkit-appearance: none; appearance: none; display: block; flex: 1 1 auto;
  box-sizing: border-box; width: 100%; min-width: 0; height: 20px;
  margin: 0; padding: 0; border: 0;
  background: transparent; accent-color: transparent; cursor: pointer; outline: none;
  background-image: linear-gradient(to right, rgba(240, 233, 220, 0.26), rgba(240, 233, 220, 0.26));
  background-position: center;
  background-repeat: no-repeat;
  background-size: calc(100% - var(--pv3d-native-range-thumb-size)) 4px;
}
.pv3d-timeline.is-strict-v2-timeline #pv3dScrub::-webkit-slider-runnable-track {
  height: 4px; border: 0; border-radius: 999px; background: transparent;
}
.pv3d-timeline.is-strict-v2-timeline #pv3dScrub::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: var(--pv3d-native-range-thumb-size); height: var(--pv3d-native-range-thumb-size);
  margin-top: -6px; border: 0; border-radius: 50%; background: transparent; box-shadow: none;
}
.pv3d-timeline.is-strict-v2-timeline #pv3dScrub::-moz-range-track {
  height: 4px; border: 0; border-radius: 999px; background: transparent;
}
.pv3d-timeline.is-strict-v2-timeline #pv3dScrub::-moz-range-progress {
  height: 4px; border: 0; background: transparent;
}
.pv3d-timeline.is-strict-v2-timeline #pv3dScrub::-moz-range-thumb {
  width: var(--pv3d-native-range-thumb-size); height: var(--pv3d-native-range-thumb-size);
  border: 0; border-radius: 50%; background: transparent; box-shadow: none;
}
.pv3d-timeline.is-strict-v2-timeline #pv3dScrub:focus-visible ~ #pv3dTimelinePlayhead {
  box-shadow: 0 0 0 1px rgba(20, 17, 12, 0.9), 0 0 0 4px rgba(126, 222, 232, 0.72);
}
.pv3d-timeline.is-strict-v2-timeline #pv3dScrub:focus-visible ~ #pv3dTimelinePlayhead::after {
  filter: drop-shadow(0 0 2px rgba(126, 222, 232, 0.95));
}
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots { z-index: 2; }
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots button[data-kind="semantic"] {
  position: absolute; z-index: 3;
  top: calc(50% - (var(--pv3d-semantic-marker-hit-target) / 2 + var(--pv3d-semantic-marker-rail-gap)));
  left: 0; width: var(--pv3d-semantic-control-width, var(--pv3d-semantic-marker-hit-target));
  height: var(--pv3d-semantic-marker-hit-target); margin: 0;
  transform: translate(-50%, -50%);
  padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  appearance: none; cursor: pointer; pointer-events: auto;
}
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots button[data-pv3d-timeline-marker]::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px;
  transform: translate(-50%, -50%) rotate(45deg); border-radius: 1px;
  background: #e3a94f; box-shadow: 0 0 0 2px rgba(20, 17, 12, 0.9);
}
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots button[data-pv3d-marker-kind="action"]::before {
  border-radius: 50%;
  background: #8fd08f;
  transform: translate(-50%, -50%);
}
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots button[data-pv3d-timeline-marker]:hover::before,
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots button[data-pv3d-timeline-marker]:focus-visible::before {
  box-shadow: 0 0 0 2px rgba(20, 17, 12, 0.9), 0 0 0 4px rgba(227, 169, 79, 0.55);
}
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots .pv3d-timeline-cluster {
  --pv3d-semantic-control-width: var(--pv3d-timeline-cluster-width);
  display: inline-flex; align-items: center; justify-content: flex-end;
  padding-inline: 6px; border: 1px solid rgba(227, 169, 79, 0.82); border-radius: 999px;
  background: #1b1813; color: #f4cd7e; font-family: var(--mono); font-size: 10px;
  font-weight: 800; font-variant-numeric: tabular-nums;
}
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots .pv3d-timeline-cluster::before,
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots .pv3d-timeline-cluster::after {
  content: ""; position: absolute; left: 9px; top: 50%; width: 8px; height: 8px;
  border: 1px solid #e3a94f; border-radius: 1px; background: #1b1813;
  transform: translate(-50%, -50%) rotate(45deg);
}
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots .pv3d-timeline-cluster::after {
  left: 13px; top: calc(50% - 3px); background: #e3a94f;
}
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots .pv3d-timeline-cluster:focus-visible,
.pv3d-timeline.is-strict-v2-timeline #pv3dKeyDots .pv3d-timeline-cluster[aria-expanded="true"] {
  outline: 2px solid #7edee8; outline-offset: 2px;
}
#pv3dTimelineClusterSurface[hidden] { display: none; }
.pv3d-timeline.is-strict-v2-timeline #pv3dTimelineClusterSurface {
  position: absolute; z-index: 8; left: 50%;
  bottom: calc(50% + var(--pv3d-semantic-marker-rail-gap) + var(--pv3d-semantic-marker-hit-target) + 8px);
  transform: translateX(-50%); display: grid; gap: 6px;
  width: min(360px, calc(100% - 16px)); max-height: 250px; padding: 8px;
  border: 1px solid rgba(227, 169, 79, 0.72); border-radius: 9px;
  background: #161310; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.58);
}
.pv3d-timeline-cluster-heading {
  display: block; color: #f4cd7e; font-family: var(--mono); font-size: 10px;
  font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.pv3d-timeline-cluster-list {
  display: grid; gap: 4px; max-height: 204px; overflow: auto; overscroll-behavior: contain;
}
.pv3d-timeline.is-strict-v2-timeline .pv3d-timeline-cluster-list button {
  width: 100%; min-height: 36px; height: auto; padding: 7px 9px;
  border: 1px solid rgba(240, 233, 220, 0.18); border-radius: 6px;
  background: #242019; color: #f0e9dc; text-align: left; white-space: normal;
  overflow-wrap: anywhere; font-family: var(--mono); font-size: 10px; line-height: 1.35;
}
.pv3d-timeline.is-strict-v2-timeline .pv3d-timeline-cluster-list button.is-current::before {
  content: "CURRENT · "; color: #7edee8; font-weight: 800;
}
.pv3d-timeline.is-strict-v2-timeline .pv3d-timeline-cluster-list button:focus-visible {
  outline: 2px solid #7edee8; outline-offset: 1px; border-color: #7edee8;
}
@media (any-pointer: coarse) {
  .pv3d-timeline.is-strict-v2-timeline { --pv3d-semantic-marker-hit-target: 44px; }
  .pv3d-timeline.is-strict-v2-timeline .pv3d-timeline-cluster-list button { min-height: 44px; }
}
/* Instrument Deck footer (owner-approved 2026-09-14) — one control grammar: 28px controls,
   7px radius, stroke icons, printed readout cells, switches with both words always visible.
   The timeline row above this bar is a separate instrument and is not styled here. */
.pv3d-status {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px;
  background: #161310; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
}
.pv3d-status button, .pv3d-status #pv3dLock, .pv3d-status #pv3dWalls, .pv3d-status #pv3dReset,
.pv3d-status #pv3dCapture, .pv3d-status #pv3dHelpToggle, .pv3d-status #pv3dOperator, .pv3d-status #pv3dTakes {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 28px; min-height: 0; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-family: var(--mono); font-size: 10px; line-height: 1;
  letter-spacing: .08em; text-transform: uppercase; cursor: pointer; white-space: nowrap;
}
.pv3d-status button svg, .pv3d-modechip svg { flex: none; width: 14px; height: 14px; stroke-width: 1.5; } /* the global svg rule says 1.8 */
.pv3d-status #pv3dWalls .pv3d-cell:nth-child(2) > svg { stroke-width: 2; }
/* the same icon set outside the deck (take cards, the inspector's mount cue) sizes to its text */
.pv3d-take-name svg, .pv3d-mount-cue svg { width: 12px; height: 12px; stroke-width: 1.5; vertical-align: -2px; margin-right: 3px; }
.pv3d-status button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.pv3d-status button:disabled, .pv3d-status #pv3dCapture:disabled, .pv3d-status #pv3dOperator:disabled, .pv3d-status #pv3dTakes:disabled,
.pv3d-status #pv3dLock:disabled, .pv3d-status #pv3dReset:disabled, .pv3d-status #pv3dWalls:disabled { opacity: .45; cursor: default; }
.pv3d-status button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
/* mode indicator — a chip, not a button: Still, or Move (tinted, never red; red is recording) */
.pv3d-modechip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 22px; padding: 0 8px;
  border-radius: 5px; border: 1px solid var(--line-strong); color: var(--ink);
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; cursor: default;
}
.pv3d-modechip svg { width: 13px; height: 13px; }
.pv3d-modechip.is-move {
  border-color: color-mix(in srgb, var(--info, #92b8d8) 55%, transparent); color: var(--info, #92b8d8);
  background: color-mix(in srgb, var(--info, #92b8d8) 12%, transparent);
}
/* view tabs — a recessed tray; the active tab is a lit cell, not a gold slab */
.pv3d-status .pv3d-seg {
  display: inline-flex; align-items: center; gap: 2px; flex: none; height: 28px; padding: 2px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--bg-2, #121009); overflow: visible;
}
.pv3d-status .pv3d-seg button {
  height: 22px; min-height: 0; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; color: var(--muted);
}
.pv3d-status .pv3d-seg button:hover { color: var(--ink); }
.pv3d-status .pv3d-seg button.active {
  background: var(--gold-soft, rgba(227, 169, 79, 0.13)); color: var(--gold-bright, #f4cd7e);
  box-shadow: inset 0 0 0 1px var(--gold-deep, #b97f2e);
}
/* switches — Free|Lock and Wild|Hard: both words stay on screen, the live one is lit */
.pv3d-status #pv3dLock, .pv3d-status #pv3dWalls { gap: 2px; padding: 2px; background: var(--bg-2, #121009); }
.pv3d-status #pv3dLock.locked { border-color: var(--line); color: var(--muted); background: var(--bg-2, #121009); }
.pv3d-status #pv3dLock:hover, .pv3d-status #pv3dWalls:hover { border-color: var(--line-strong); }
.pv3d-status .pv3d-cell {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 5px;
  color: var(--dim, #6f675a);
}
.pv3d-status .pv3d-cell.is-on {
  background: var(--gold-soft, rgba(227, 169, 79, 0.13)); color: var(--gold-bright, #f4cd7e);
  box-shadow: inset 0 0 0 1px var(--gold-deep, #b97f2e);
}
/* the readout — printed cells with tabular numerals and muted units, never an ellipsized sentence */
.pv3d-readout {
  display: inline-flex; align-items: stretch; flex: 0 1 auto; min-width: 0; height: 28px; overflow: visible;
  border: 1px solid var(--line); border-radius: 7px; background: var(--bg-2, #121009);
}
.pv3d-ro-cell {
  display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 0 10px; min-width: 0;
  border-right: 1px solid var(--line); white-space: nowrap;
}
/* only the camera cell gives way when the bar is tight; lens and frame are never crushed */
.pv3d-ro-cell.pv3d-ro-cam { flex: 0 1 auto; min-width: 64px; overflow: hidden; }
.pv3d-ro-cell:last-of-type { border-right: 0; }
.pv3d-ro-cell em { font-style: normal; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim, #6f675a); }
.pv3d-ro-cell b { min-width: 0; font-weight: 600; font-size: 11px; letter-spacing: .02em; color: var(--ink); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.pv3d-ro-cell u { text-decoration: none; font-size: 9px; color: var(--muted); }
.pv3d-ro-lamp { align-self: center; flex: none; width: 6px; height: 6px; margin: 0 9px 0 8px; border-radius: 50%; background: var(--ok, #a4cf72); }
.pv3d-ro-lamp.is-moved { background: var(--gold); }
.pv3d-ro-lamp.is-floor { background: var(--info, #92b8d8); }
.pv3d-status-spacer { flex: 1 1 0; min-width: 4px; }
.pv3d-status-divider { flex: none; width: 1px; height: 18px; background: var(--line-strong); }
/* tiers: Rebuild set is tertiary, Takes and Operator secondary, Capture still primary only in Still mode */
.pv3d-status #pv3dTakes, .pv3d-status #pv3dOperator, .pv3d-status #pv3dCapture { border-color: var(--line-strong); color: var(--ink); }
.pv3d-status #pv3dCapture:not(.is-primary):hover:not(:disabled) { background: transparent; color: var(--ink); border-color: var(--line-strong); } /* the legacy #pv3dCapture:hover gold slab is the Still-mode primary only */
.pv3d-status #pv3dCapture.is-primary { border-color: var(--gold); color: var(--gold-bright, #f4cd7e); background: var(--gold-soft, rgba(227, 169, 79, 0.13)); }
.pv3d-status #pv3dCapture.is-primary:hover:not(:disabled) { background: var(--gold); color: #221a0d; border-color: var(--gold); }
.pv3d-status #pv3dHelpToggle { width: 28px; padding: 0; justify-content: center; border-radius: 7px; font-size: 10px; }
.pv3d-status #pv3dHelpToggle:hover { border-color: var(--gold); color: var(--gold-bright, #f4cd7e); }
/* Move mode seats Takes and Operator, so Rebuild set goes icon-only (the design's move-mode tier) */
.pv3d-status.is-move .pv3d-rebuild-ask > span { display: none; }
/* width tiers (measured against the real bar: Move mode with Reset, Takes and Operator seated) —
   the actions lose their words first, the view tabs / Reset / Capture and the readout labels next;
   the switches keep both words at every tier */
@media (max-width: 1500px) {
  .pv3d-status .pv3d-rebuild-ask > span, .pv3d-status #pv3dTakes > span, .pv3d-status #pv3dOperator > span, .pv3d-status #pv3dReset > span { display: none; }
}
@media (max-width: 1320px) {
  .pv3d-status { gap: 8px; padding: 0 10px; }
  .pv3d-status .pv3d-seg button > span, .pv3d-status #pv3dReset > span, .pv3d-status #pv3dCapture > span { display: none; }
  .pv3d-ro-cell em { display: none; }
}
/* the operator handoff card — sits above the dock like the receipt */
/* the Operator and Takes panels share the deck's grammar: 10px radius, line borders, 28px controls */
.pv3d-operator {
  position: absolute; right: 14px; bottom: 116px; z-index: 8; width: 268px;
  background: rgba(11, 9, 8, 0.94); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 14px; backdrop-filter: blur(12px); pointer-events: auto;
  font-family: var(--mono); color: var(--ink, #f0e9dc);
}
.pv3d-op-close {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; padding: 0; border-radius: 7px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; line-height: 1;
}
.pv3d-op-close:hover { border-color: var(--line-strong); color: var(--ink); }
.pv3d-operator h4 {
  margin: 4px 0 12px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold, #e3a94f); font-weight: normal;
}
.pv3d-op-qr { text-align: center; }
.pv3d-op-qr svg { width: 100%; max-width: 200px; height: auto; background: #fff; border-radius: 8px; padding: 8px; }
.pv3d-op-url { font-size: 10px; word-break: break-all; color: var(--muted); }
.pv3d-op-who { font-size: 10px; line-height: 1.7; color: var(--muted); margin: 12px 0 10px; }
.pv3d-op-status {
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding: 8px 0 2px; border-top: 1px solid var(--line);
}
.pv3d-op-follow {
  display: block; width: 100%; margin: 8px 0 4px; height: 28px; padding: 0 10px; border-radius: 7px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink, #f0e9dc);
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
}
.pv3d-op-follow:hover { border-color: var(--gold); color: var(--gold-bright, #f4cd7e); }
.pv3d-op-follow.on { border-color: var(--gold); background: var(--gold-soft, rgba(227, 169, 79, 0.13)); color: var(--gold-bright, #f4cd7e); }
.pv3d-op-takes { margin-top: 4px; }
/* walk-12 TAKES redesign — a take is a CARD: name left, at most two actions right */
.pv3d-take-card {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 8px; margin: 5px 0; border: 1px solid var(--line);
  border-radius: 7px; background: var(--surface-2, #1d1914);
  font-size: 10.5px; color: var(--ink, #f0e9dc); line-height: 1.5;
}
.pv3d-take-card.primary { border-color: var(--gold); background: var(--gold-soft, rgba(227, 169, 79, 0.13)); }
.pv3d-take-card.flash { animation: pv3dTakeFlash 1.5s ease-out; }
@keyframes pv3dTakeFlash {
  0% { background: rgba(227, 169, 79, 0.5); box-shadow: 0 0 0 3px rgba(227, 169, 79, 0.35); }
  100% { background: rgba(227, 169, 79, 0.12); box-shadow: none; }
}
.pv3d-take-name { min-width: 0; }
.pv3d-take-name small { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: 0.02em; margin-top: 2px; }
.pv3d-take-acts { display: flex; gap: 5px; align-items: center; flex: none; }
/* :where() keeps the ancestor weightless, so the per-class rules below (USE, ✕, ▶) still win */
:where(.pv3d-take-acts) button { height: 28px; min-width: 28px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink, #f0e9dc); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; cursor: pointer; }
:where(.pv3d-take-acts) button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-bright, #f4cd7e); }
.pv3d-take-use {
  height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--gold);
  background: var(--gold-soft, rgba(227, 169, 79, 0.13)); color: var(--gold-bright, #f4cd7e); font-family: var(--mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; cursor: pointer; white-space: nowrap;
}
.pv3d-take-use:hover:not(:disabled) { background: var(--gold); color: #221a0d; }
.pv3d-take-use:disabled { opacity: 0.45; cursor: default; }
.pv3d-take-use.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink, #f0e9dc); font-weight: normal; }
.pv3d-take-ref {
  display: inline-flex; align-items: center; height: 22px; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  color: var(--gold-bright, #f4cd7e); border-radius: 5px; padding: 0 8px; background: var(--gold-soft, rgba(227, 169, 79, 0.13));
  box-shadow: inset 0 0 0 1px var(--gold-deep, #b97f2e);
}
.pv3d-take-x {
  width: 28px; height: 28px; padding: 0; border-radius: 7px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 10px;
}
.pv3d-take-x:hover { border-color: var(--line-strong); color: var(--ink, #f0e9dc); }
.pv3d-take-dl { color: var(--muted); text-decoration: none; }
.pv3d-take-dl:hover { color: var(--gold-bright, #f4cd7e); }
.pv3d-take-empty { font-size: 10.5px; line-height: 1.7; color: var(--muted); }
/* walk-16: the attachments are READABLE where they're toggled */
.ctx-eye {
  padding: 3px 7px; border-radius: 6px; border: 1px solid rgba(227, 169, 79, 0.3);
  background: transparent; color: var(--gold-bright, #f4cd7e); cursor: pointer; font-size: 11px;
}
.ctx-eye:hover { border-color: var(--gold); }
.pv3d-doc-view {
  position: absolute; top: 52px; left: 50%; transform: translateX(-50%); z-index: 45;
  width: min(72%, 680px); max-height: min(62%, 520px); display: flex; flex-direction: column;
  background: rgba(12, 9, 4, 0.97); border: 1px solid var(--gold); border-radius: 10px; padding: 12px 14px;
}
.pv3d-doc-view[hidden] { display: none; }
.pv3d-doc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex: none; }
.pv3d-doc-head b { font-size: 11px; letter-spacing: 0.08em; color: var(--gold-bright, #f4cd7e); font-weight: normal; }
.pv3d-doc-head button {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(227, 169, 79, 0.4);
  background: transparent; color: var(--gold-bright, #f4cd7e); cursor: pointer; font-size: 13px;
}
.pv3d-doc-view pre {
  margin: 10px 0 0; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 11px; line-height: 1.7; color: var(--bone, #e8e0d2);
}
/* walk-14: toasts mirrored INSIDE the top-layer Room modal — page toasts paint under it */
.pv3d-toast {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 130px; z-index: 40;
  max-width: min(70%, 560px); background: rgba(12, 9, 4, 0.95); border: 1px solid var(--gold);
  border-radius: 10px; padding: 9px 14px; font-family: var(--mono); font-size: 11px;
  color: var(--gold-bright, #f4cd7e); line-height: 1.5; pointer-events: none;
}
/* the assist's own persistent line — progress, result, questions, failures */
.pv3d-assist-note {
  position: absolute; top: 52px; right: 14px; z-index: 39; max-width: 400px; pointer-events: none;
  background: rgba(12, 9, 4, 0.94); border: 1px solid rgba(227, 169, 79, 0.4); border-radius: 9px;
  padding: 8px 11px; font-family: var(--mono); font-size: 10.5px; line-height: 1.6;
  color: var(--gold-bright, #f4cd7e);
}
.pv3d-assist-note.ok { border-color: rgba(127, 195, 131, 0.7); color: #cfe8c9; }
.pv3d-note-x {
  pointer-events: auto; margin-left: 8px; width: 20px; height: 20px; border-radius: 6px;
  border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer;
  font-size: 10px; vertical-align: middle; opacity: 0.8;
}
.pv3d-note-x:hover { opacity: 1; }
/* T54: a refusal that says "reset the camera" carries the reset — a real button, block-level
   under the message so it never crowds the dismiss ✕ */
.pv3d-note-action {
  pointer-events: auto; display: block; margin-top: 7px; padding: 4px 12px; border-radius: 6px;
  border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.05em; opacity: 0.9;
}
.pv3d-note-action:hover { opacity: 1; background: rgba(201, 138, 90, 0.18); }
.pv3d-assist-note.warn { border-color: rgba(201, 138, 90, 0.7); color: #f0c9a8; }
/* walk-14: SET IT must never hug the dialog's ✕ — a misclick closes the whole Room */
.pv3d-room .pv3d-topbar { padding-right: 56px; }
/* walk-13: section headers + the collapsed versions shelf */
.pv3d-take-sect { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim, #6f675a); margin: 12px 0 4px; }
.pv3d-take-sect:first-child { margin-top: 2px; }
.pv3d-tk-shelf {
  display: block; width: 100%; text-align: left; margin-top: 10px; padding: 6px 9px;
  border: 1px dashed rgba(227, 169, 79, 0.3); border-radius: 8px; background: transparent;
  color: var(--gold-bright, #f4cd7e); opacity: 0.75; font-family: var(--mono);
  font-size: 9.5px; letter-spacing: 0.06em; cursor: pointer;
}
.pv3d-tk-shelf:hover { opacity: 1; }
.pv3d-tk-shelf-body { border-left: 2px dashed rgba(227, 169, 79, 0.25); padding-left: 8px; margin: 4px 0 0 4px; }
.pv3d-tk-shelf-note { font-size: 9px; opacity: 0.6; line-height: 1.6; color: var(--gold-bright, #f4cd7e); margin: 4px 0; }
.pv3d-tk-shelf-body > .pv3d-take-use.ghost { display: block; width: 100%; margin-top: 5px; }
/* the panel's narrator — printing progress, the landed confirmation, honest failures */
.pv3d-takes-note {
  font-size: 10.5px; line-height: 1.6; border: 1px solid var(--line-strong); border-radius: 7px;
  padding: 8px 10px; margin: 0 0 8px; color: var(--ink, #f0e9dc); background: var(--surface-2, #1d1914);
}
.pv3d-takes-note.ok { border-color: rgba(127, 195, 131, 0.7); color: #cfe8c9; background: rgba(110, 190, 120, 0.08); }
.pv3d-takes-note.warn { border-color: rgba(201, 138, 90, 0.7); color: #f0c9a8; background: rgba(201, 138, 90, 0.08); }
.pv3d-takes-note button {
  display: block; margin-top: 7px; width: 100%; padding: 8px; border-radius: 8px;
  border: 1px solid currentColor; background: transparent; color: inherit;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; cursor: pointer;
}
.pv3d-takes-note button:hover { background: rgba(255, 255, 255, 0.06); }
/* the takes panel runs wider than the operator card; the BIN scrolls, never the panel —
   the ✕, the title, and the note strip must stay visible however long the bin grows.
   Bounded flex column: on short windows the bin gives way first, the strip second —
   an unbounded stack clipped the title and ✕ past the dialog top (fleet-reproduced) */
#pv3dTakesPanel { width: 324px; max-height: calc(100% - 132px); display: flex; flex-direction: column; }
#pv3dTakesPanel h4, #pv3dTakesPanel .pv3d-takes-note { flex: none; }
#pv3dTakesPanel .pv3d-op-takes { flex: 0 1 auto; min-height: 64px; max-height: min(46vh, 400px); overflow-y: auto; }
#pv3dTakesPanel .pv3d-cov-strip { flex: none; max-height: 132px; overflow-y: auto; }
/* one print at a time — the ⤓ links dim and stop clicking with everything else */
.pv3d-op-takes.printing .pv3d-take-dl { pointer-events: none; opacity: 0.35; }
#pv3dTakesPanel .pv3d-op-close { font-size: 12px; }
.pv3d-op-playbtn {
  width: 26px; height: 22px; padding: 0; border-radius: 6px; border: 1px solid var(--gold);
  background: transparent; color: var(--gold-bright, #f4cd7e); font-size: 11px; cursor: pointer;
  vertical-align: middle;
}
.pv3d-op-playbtn.on { background: rgba(227, 169, 79, 0.22); }
.pv3d-op-legend { font-size: 9px; opacity: 0.65; color: var(--gold-bright, #f4cd7e); margin-top: 3px; letter-spacing: 0.03em; }
/* anchored just below the 48px topbar — in-flow it would center inside the bar and clip */
.pv3d-board-peek { position: absolute; top: 52px; left: 8px; max-width: 200px; cursor: zoom-in; z-index: 5; }
.pv3d-board-peek img { width: 100%; display: block; border: 1px solid var(--gold); border-radius: 6px; }
.pv3d-peek-cap { font-size: 9px; color: var(--gold-bright, #f4cd7e); opacity: 0.75; line-height: 1.5; margin-top: 2px; }
.pv3d-board-peek.big {
  position: fixed; inset: 0; margin: auto; max-width: min(70vw, 900px); height: fit-content;
  z-index: 60; cursor: zoom-out; background: rgba(12, 9, 4, 0.94); padding: 12px; border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}
.pv3d-board-peek.big .pv3d-peek-cap { font-size: 12px; }
/* COVERAGE MODE — dashed = coverage (extra angles), solid = board shots */
.pv3d-cov-chip { border-style: dashed; }
.pv3d-cov-add { border-color: rgba(227, 169, 79, 0.45); color: rgba(244, 205, 126, 0.75); }
.pv3d-cov-add:hover { border-color: var(--gold); color: var(--gold-bright, #f4cd7e); }
.pv3d-cov-builder {
  position: absolute; top: 52px; left: 8px; z-index: 6; max-width: 660px;
  background: rgba(12, 9, 4, 0.96); border: 1px solid var(--gold); border-radius: 8px; padding: 10px 12px;
}
.pv3d-cov-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 4px 0; font-size: 10px; }
.pv3d-cov-row > span { width: 46px; letter-spacing: 0.12em; opacity: 0.6; }
.pv3d-cov-row b { color: var(--gold-bright, #f4cd7e); letter-spacing: 0.06em; }
.pv3d-cov-row em { opacity: 0.5; font-style: normal; }
.pv3d-cov-tag {
  font-size: 9px; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(227, 169, 79, 0.35);
  background: transparent; color: var(--gold-bright, #f4cd7e); cursor: pointer;
}
.pv3d-cov-tag.on { border-color: var(--gold); background: rgba(227, 169, 79, 0.2); }
.pv3d-cov-tag:disabled { opacity: 0.3; cursor: default; }
.pv3d-cov-go {
  margin-left: auto; font-size: 10px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--gold);
  background: rgba(227, 169, 79, 0.14); color: var(--gold-bright, #f4cd7e); cursor: pointer;
}
.pv3d-cov-go:disabled { opacity: 0.35; cursor: default; }
.pv3d-op-sethead { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim, #6f675a); margin-top: 8px; }
/* wave-3: the live timeline reads as a mutable working copy, not a filed take.
   It carries three actions (▶ / USE / SAVE AS TAKE), so the name takes the full first
   line and the actions sit on their own row — never a squeezed 4-line left column */
.pv3d-take-card.pv3d-working-row { border-style: dashed; background: transparent; flex-wrap: wrap; }
.pv3d-take-card.pv3d-working-row .pv3d-take-name { flex: 1 1 100%; }
.pv3d-take-card.pv3d-working-row .pv3d-take-acts { margin-left: auto; }
.pv3d-cov-strip { margin-top: 6px; }
.pv3d-cov-cap { font-size: 9px; letter-spacing: 0.16em; color: var(--gold-bright, #f4cd7e); opacity: 0.6; margin-bottom: 4px; }
.pv3d-cov-pill {
  display: inline-flex; gap: 5px; align-items: center; font-size: 10px; color: var(--gold-bright, #f4cd7e);
  border: 1px dashed rgba(227, 169, 79, 0.45); border-radius: 999px; padding: 2px 9px; margin: 0 4px 4px 0;
}
.pv3d-cov-promote {
  font-size: 9px; color: var(--gold-bright, #f4cd7e); opacity: 0.75; background: none; border: none;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px; padding: 0;
}
.pv3d-cov-promote:hover { opacity: 1; }
/* owner call: coverage setups collapse into a dropdown — chips overflowed the bar */
.pv3d-cov-sel {
  max-width: 230px; font-family: var(--mono); font-size: 10px; padding: 4px 8px;
  color: var(--gold-bright, #f4cd7e); background: rgba(12, 9, 4, 0.7);
  border: 1px dashed rgba(227, 169, 79, 0.5); border-radius: 8px; cursor: pointer;
}
/* wave-4: the covered board shots light in a SECONDARY state while their setup is toggled */
.pv3d-shot-chip.covered { border-style: dashed; border-color: rgba(227, 169, 79, 0.7); background: rgba(227, 169, 79, 0.08); }
.pv3d-shot-chip small, .pv3d-cov-pill small { font-size: 8px; opacity: 0.65; letter-spacing: 0.02em; }
.pv3d-cov-badge { font-size: 8px; color: var(--gold); letter-spacing: 0.06em; }
.pv3d-cov-pill.promoted { border-style: solid; border-color: var(--gold); }
.full-panel-flag.coverage { top: auto; bottom: 7px; border-style: dashed; }
/* wave-5 THE SHAPE — every seam is a door, and nothing vanishes without a forwarding address */
.pv3d-cam-summary {
  display: none; font-family: var(--mono), monospace; font-size: 10px; color: var(--gold-bright, #f4cd7e);
  border: 1px dashed rgba(227, 169, 79, 0.5); border-radius: 999px; padding: 4px 12px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34%; flex: none;
}
.pv3d-hud.mode-shot .pv3d-cam-summary { display: inline-block; }
.pv3d-hud.mode-shot .pv3d-inspector { transform: translateX(calc(100% - 22px)); cursor: pointer; }
.pv3d-hud.mode-shot .pv3d-inspector::before { width: 22px; }
.pv3d-hud.mode-shot .pv3d-inspector::after {
  content: "STAGE ›"; position: absolute; left: 4px; top: 12px; writing-mode: vertical-rl;
  font-size: 9px; letter-spacing: 0.14em; color: var(--gold);
}
.pv3d-orient {
  position: absolute; top: 54px; left: 50%; transform: translateX(-50%); z-index: 9;
  display: flex; gap: 12px; align-items: center; max-width: 80%;
  background: rgba(12, 9, 4, 0.95); border: 1px solid var(--gold); border-radius: 8px; padding: 8px 14px;
  font-size: 10px; color: var(--gold-bright, #f4cd7e); line-height: 1.6;
}
.pv3d-orient button {
  flex: none; font-size: 9px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--gold);
  background: rgba(227, 169, 79, 0.14); color: var(--gold-bright, #f4cd7e); cursor: pointer; letter-spacing: 0.08em;
}
/* wave-2: empty-room CTA + the distinct clear-take confirm */
.pv3d-build-ask {
  margin-top: 8px; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--gold);
  background: rgba(227, 169, 79, 0.14); color: var(--gold-bright, #f4cd7e);
  font-size: 11px; letter-spacing: 0.08em; cursor: pointer;
}
.pv3d-build-ask:hover { background: rgba(227, 169, 79, 0.24); }
.pv3d-status .pv3d-rebuild-ask { border-color: var(--line); color: var(--muted); background: transparent; }
.pv3d-status .pv3d-rebuild-ask:hover { border-color: var(--line-strong); color: var(--ink); }
/* 0-3-0 specificity — the legacy .pv3d-timeline .pv3d-keynav rule (15px) must lose here */
.pv3d-timeline .pv3d-keynav.pv3d-clear-take { font-size: 9px; letter-spacing: 0.05em; padding: 0 8px; line-height: 1.2; }
.pv3d-op-circleask { font-size: 10px; color: var(--gold-bright, #f4cd7e); line-height: 2; margin: -2px 0 6px 8px; }
.pv3d-op-circleask button {
  height: 22px; padding: 0 8px; margin-right: 4px; border-radius: 6px; border: 1px solid var(--gold);
  background: transparent; color: var(--gold-bright, #f4cd7e); font-size: 9px; cursor: pointer;
}
/* the key hints moved from the bar into the "?" drawer (Instrument Deck footer) */
.pv3d-help-card .pv3d-help-now { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pv3d-help-card .pv3d-help-now span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pv3d-help-card { left: auto; right: 0; bottom: 0; width: 368px; }
/* the receipt sits above the dock, clear of everything */
.pv3d-print { bottom: 116px !important; }
.pv3d-floor-note { top: 60px; }
.pv3d-help { position: absolute; right: 14px; bottom: 48px; z-index: 9; }
.pv3d-hud:has(.pv3d-timeline) .pv3d-help { bottom: 116px; }
@media (max-width: 1500px) { .pv3d-hud:has(.pv3d-timeline.is-strict-v2-timeline.has-selected-semantic-subject) .pv3d-help { bottom: 148px; } }
@media (max-width: 1100px) { .pv3d-hud:has(.pv3d-timeline.is-strict-v2-timeline) .pv3d-help { bottom: 148px; } }

/* D1b — the dialog header re-homes to the top bar's right; the inspector's children go static */
.pv3d-room .pv3d-top {
  position: absolute; top: 0; right: 0; height: 48px; z-index: 8;
  display: flex; align-items: center; gap: 10px; padding: 0 10px 0 16px;
  background: transparent; border: 0;
}
.pv3d-room .pv3d-top .pv3d-kicker { display: none; }
.pv3d-room .pv3d-top h2 { font-size: 13px; font-weight: 650; margin: 0; white-space: nowrap; }
.pv3d-room .pv3d-top .pv3d-meta { display: block; margin: 0; font-family: var(--mono); font-size: 9px; color: var(--muted); white-space: nowrap; }
.pv3d-room .pv3d-top > div { display: flex; align-items: baseline; gap: 8px; }
.pv3d-inspector .pv3d-chips, .pv3d-inspector .pv3d-poses {
  position: static; max-width: none; justify-content: flex-start;
}
.pv3d-inspector .pv3d-constraint { flex-direction: column; align-items: flex-start; }
.pv3d-inspector .pv3d-constraint > * { display: flex; align-items: center; gap: 8px; }

/* D1d — the header hugs the right and never eats a click */
.pv3d-room .pv3d-top { left: auto; width: auto; pointer-events: none; }
.pv3d-room .pv3d-top #closePrevizRoom { pointer-events: auto; }

/* W92 — the header text retires: the bar belongs to the assist; FLOOR's scene
   caption carries the location name; the burn-in carries the panel */
.pv3d-room .pv3d-top > div { display: none; }

/* W91 — the popover's chips look like the buttons they are */
.pv3d-ctx-pop .ctx-chip, .pv3d-ctx-pop #pv3dCtxSteal {
  font-size: 11px; letter-spacing: .04em; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(20, 17, 12, 0.7);
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.pv3d-ctx-pop .ctx-chip.on { border-color: rgba(227, 169, 79, 0.6); color: #e3c68f; background: rgba(227, 169, 79, 0.12); }
.pv3d-ctx-pop .ctx-chip:hover, .pv3d-ctx-pop #pv3dCtxSteal:hover { border-color: rgba(227, 169, 79, 0.5); }
.pv3d-ctx-pop #pv3dCtxSteal { border-style: dashed; color: #e3c68f; }

/* W95 — key dots are live controls */
#pv3dKeyDots { pointer-events: none; }
#pv3dKeyDots i { pointer-events: auto; cursor: pointer; transition: transform 0.1s; }
#pv3dKeyDots i:hover { transform: scale(1.7); }

/* W96 — Room captures ride the composer as chips */
.citation-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border: 1px dashed rgba(227, 169, 79, 0.55);
  border-radius: 999px;
  background: rgba(227, 169, 79, 0.08);
  color: #e3c68f;
  font-size: 12px;
  white-space: nowrap;
}
.citation-chip button {
  border: 0;
  background: transparent;
  color: var(--muted, #a89e8c);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}
.citation-chip button:hover { color: #e3c68f; }

/* W97 — the keyframe transport */
.pv3d-timeline .pv3d-keynav { padding: 0 9px; font-size: 15px; line-height: 1; }
.pv3d-timeline #pv3dSetKey.is-semantic {
  /* Reviewed semantic label budget: 29 monospace glyphs. Compact path/turn/lift combinations
     stay within it. Reserve content + the existing 10px inline padding and 1px borders so label
     changes cannot resize the flexible native range while its pointer mapping is active. */
  --pv3d-semantic-key-label-inline-size: 29ch;
  --pv3d-semantic-key-control-inline-size: calc(var(--pv3d-semantic-key-label-inline-size) + 22px);
  box-sizing: border-box;
  padding-inline: 10px;
  inline-size: var(--pv3d-semantic-key-control-inline-size);
  min-inline-size: var(--pv3d-semantic-key-control-inline-size);
  max-inline-size: var(--pv3d-semantic-key-control-inline-size);
  flex: 0 0 var(--pv3d-semantic-key-control-inline-size);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pv3d-timeline #pv3dSetKey.armed { border-color: #e3a94f; box-shadow: 0 0 0 1px rgba(227, 169, 79, 0.5); color: var(--gold-bright, #f4cd7e); }
.pv3d-timeline #pv3dDelKey { border-color: rgba(224, 90, 78, 0.55); color: #f0b0a8; padding: 0 9px; }
.pv3d-timeline #pv3dResetTake { margin-left: 2px; opacity: 0.75; }
.pv3d-timeline #pv3dResetTake.armed-reset { border-color: rgba(224, 90, 78, 0.8); color: #f0b0a8; opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════════════════════
   PRODUCTION OFFICE (PR 1) — a distinct room inside the same app. Daylight, paper on a cool desk,
   ink and pencil; the only Previsto accent is one gold action. Tokens are scoped to the dialog so
   the Studio's warm-black palette is untouched. Class prefix `po-` is reserved for this room.
   ═══════════════════════════════════════════════════════════════════════════════════════════ */
.po-office {
  --po-desk: #dcd9d2; --po-paper: #faf8f2; --po-ink: #1a1917; --po-ink-2: #3d3b37; --po-grey: #6f6c66;
  --po-pencil: #8a8783; --po-rule: #cfcbc2; --po-rule-strong: #a9a49a; --po-chrome: #f2f0ea; --po-chrome-line: #d9d5cc;
  --po-gold: #c8902f; --po-gold-ink: #221708; --po-ok: #4f7a2f; --po-amber: #b7791f;
  color-scheme: light;
  width: 96vw; height: 92vh; max-width: none; max-height: none;
  border: 1px solid #c9c5bc; border-radius: 14px; padding: 0; overflow: hidden;
  background: var(--po-desk); color: var(--po-ink);
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  box-shadow: 0 30px 80px rgba(20, 18, 14, 0.4);
  display: grid; grid-template-rows: 52px minmax(0, 1fr);
}
.po-office:not([open]) { display: none; }
.po-office::backdrop { background: rgba(5, 4, 3, 0.78); backdrop-filter: blur(6px); }
.po-office[open] { animation: dialogIn 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.po-office *, .po-office *::before, .po-office *::after { box-sizing: border-box; }
.po-office h2, .po-office h3, .po-office h4, .po-office p { margin: 0; }
.po-office button { font: inherit; cursor: pointer; }
.po-office button:disabled { cursor: not-allowed; opacity: 0.45; }
.po-office ::selection { background: rgba(200, 144, 47, 0.28); }

.po-topbar { display: flex; align-items: center; gap: 14px; padding: 0 12px 0 16px; background: var(--po-chrome); border-bottom: 1px solid var(--po-chrome-line); }
.po-mark { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--po-rule-strong);
  background: repeating-linear-gradient(-45deg, rgba(26,25,23,0.85) 0 5px, transparent 5px 10px) top / 100% 7px no-repeat, #fff;
  font-family: var(--font-body); font-weight: 700; font-size: 10.5px; letter-spacing: 0.04em; padding-top: 6px; color: var(--po-ink); }
.po-wordmark { font-family: var(--font-display); font-weight: 400; font-size: 19px; color: var(--po-ink); white-space: nowrap; }
.po-sep { width: 1px; height: 20px; background: var(--po-chrome-line); }
.po-project { font-size: 13.5px; color: var(--po-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-meta { margin-left: auto; font-size: 12px; color: var(--po-grey); white-space: nowrap; }
.po-close { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 6px; color: var(--po-grey); border: 1px solid transparent; background: transparent; }
.po-close:hover, .po-close:focus-visible { color: var(--po-ink); background: #fff; border-color: var(--po-rule); outline: none; }
.po-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.po-body { min-height: 0; display: grid; grid-template-columns: 188px minmax(280px, 360px) minmax(0, 1fr); }
@media (max-width: 1100px) { .po-body { grid-template-columns: 168px minmax(240px, 300px) minmax(0, 1fr); } }

/* spine */
.po-spine { background: var(--po-chrome); border-right: 1px solid var(--po-chrome-line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.po-cap { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--po-grey); padding: 0 8px 10px; }
.po-doc { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 9px; align-items: center; padding: 8px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--po-ink-2); text-align: left; width: 100%; }
.po-doc:hover { background: rgba(255,255,255,0.55); }
.po-doc:focus-visible { outline: none; border-color: var(--po-gold); }
.po-doc i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--po-rule-strong); background: transparent; }
.po-doc.is-ready i { background: var(--po-ink); border-color: var(--po-ink); }
.po-doc.is-half i { background: linear-gradient(90deg, var(--po-ink) 50%, transparent 50%); border-color: var(--po-ink); }
.po-doc.is-on { background: #fff; color: var(--po-ink); box-shadow: inset 0 0 0 1px var(--po-chrome-line); }
.po-doc strong { display: block; font-size: 13px; font-weight: 500; }
.po-doc small { display: block; font-size: 10.5px; color: var(--po-grey); margin-top: 1px; }
.po-spine-foot { margin-top: auto; padding: 12px 8px 0; font-size: 11px; color: var(--po-grey); line-height: 1.5; border-top: 1px solid var(--po-chrome-line); }

/* Previsto column */
.po-talk { border-right: 1px solid var(--po-chrome-line); background: #efece5; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.po-talk-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--po-chrome-line); }
.po-talk-head .po-who { font-size: 13.5px; font-weight: 600; color: var(--po-ink); }
.po-talk-head .po-who span { font-weight: 400; color: var(--po-grey); }
.po-talk-head .po-sub { font-size: 11.5px; color: var(--po-grey); margin-top: 2px; }
.po-thread { flex: 1; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 14px; }
.po-m { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
.po-m .po-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; background: #fff; border: 1px solid var(--po-rule-strong); color: var(--po-ink-2); }
.po-m .po-msg { min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.55; color: var(--po-ink); }
.po-m .po-msg p + p { margin-top: 8px; }
.po-m .po-msg .po-pen { color: var(--po-pencil); font-style: italic; }
.po-m .po-msg ul { margin: 6px 0 0 16px; color: var(--po-ink-2); padding: 0; }
.po-m .po-msg li + li { margin-top: 2px; }
.po-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.po-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 7px; padding: 8px 13px;
  border: 1px solid var(--po-rule-strong); background: #fff; color: var(--po-ink); text-decoration: none; }
.po-btn:hover, .po-btn:focus-visible { border-color: var(--po-ink); outline: none; }
.po-btn.is-gold { background: var(--po-gold); border-color: var(--po-gold); color: var(--po-gold-ink); }
.po-btn.is-gold:hover, .po-btn.is-gold:focus-visible { background: #d9a03a; }
.po-btn.is-ghost { background: transparent; border-color: transparent; color: var(--po-grey); font-weight: 500; }
.po-btn.is-ghost:hover, .po-btn.is-ghost:focus-visible { border-color: var(--po-ink); color: var(--po-ink); }
.po-btn.is-busy { position: relative; color: transparent; }
.po-btn.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border: 2px solid rgba(34,23,8,0.35); border-top-color: var(--po-gold-ink); border-radius: 50%; animation: poSpin 0.8s linear infinite; }
@keyframes poSpin { to { transform: rotate(360deg); } }
.po-composer { margin: 10px 14px 16px; background: #fff; border: 1px solid var(--po-rule); border-radius: 12px; display: flex; align-items: center; gap: 8px; padding: 9px 12px 9px 14px; color: var(--po-grey); font-size: 12.5px; }
.po-composer i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px dashed var(--po-pencil); flex: none; }

/* desk + document */
.po-desk { min-width: 0; min-height: 0; overflow: auto; padding: 20px 26px 34px; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; align-content: start; gap: 12px; }
/* Desk header: source identity on the left, the document's tools grouped on the right. Rows never
   shrink below their content (grid-auto-rows: max-content), so the paper can never spill under
   whatever follows it. */
.po-desk-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; }
.po-desk-actions .po-source { font-size: 11.5px; color: var(--po-grey); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-desk-actions .po-shot-source { display: grid; min-width: 0; gap: 3px; grid-column: 1 / -1; }
.po-desk-actions .po-shot-source + .po-tools { grid-column: 1 / -1; justify-content: flex-start; }
.po-desk-actions .po-shot-source [data-po-shot-requirements-status] { white-space: normal; }
.po-breakdown-actions { grid-template-columns: minmax(0, 1fr); }
.po-breakdown-source { display: grid; gap: 4px; min-width: 0; }
.po-breakdown-source .po-source { white-space: normal; overflow: visible; }
.po-breakdown-actions .po-tools { justify-content: flex-start; }
.po-desk-actions .po-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.po-desk-actions .po-tools .po-btn { padding: 6px 10px; font-size: 11.5px; }
@media (max-width: 1100px) { .po-desk-actions { grid-template-columns: 1fr; } .po-desk-actions .po-tools { justify-content: flex-start; } }
.po-desk-actions .po-source code { font-family: var(--mono); font-size: 10.5px; color: var(--po-ink-2); }
.po-desk-actions .po-source b { color: var(--po-ok); font-weight: 600; }
.po-paper { position: relative; width: 100%; background: var(--po-paper); color: var(--po-ink);
  box-shadow: 0 1px 0 rgba(0,0,0,0.14), 0 18px 40px rgba(20,18,14,0.16), 0 2px 6px rgba(20,18,14,0.08); min-height: 320px; overflow-x: auto; overflow-y: hidden; }
/* Paper behaves like paper: it keeps its natural letter-landscape width (a narrow desk scrolls it
   sideways instead of crushing columns) and it is exactly as tall as the document — never shorter
   than the desk, and the DESK scrolls when the document is longer. The module sizes the iframe to
   its content on load and on desk resize; the CSS height is only the pre-load fallback. */
.po-paper iframe { display: block; width: 100%; min-width: 760px; height: max(520px, calc(92vh - 232px)); border: 0; background: #fff; }
.po-paper.is-sized iframe { height: var(--po-paper-height, auto); }
/* Keep the call sheet at a readable paper width; its own clipping contains the watermark. */
.po-call-sheet-viewport { min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.po-call-sheet-viewport > .po-paper { min-width: 760px; }
.po-call-sheet-viewport:focus-visible { outline: 2px solid var(--po-gold); outline-offset: 2px; }
.po-paper.is-loading::after { content: "Fetching the paper…"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--po-grey); }
.po-blank { padding: 44px 40px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.po-blank .po-blank-cap { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--po-grey); }
.po-blank h3 { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.15; color: var(--po-ink); max-width: 30ch; }
.po-blank p { font-size: 13.5px; color: var(--po-ink-2); max-width: 60ch; }
.po-blank .po-why { border-left: 2px solid var(--po-rule-strong); padding: 6px 12px; color: var(--po-ink-2); font-size: 13px; }
/* A long run (a breakdown can take ten minutes) must read as ALIVE, not hung. An indeterminate bar —
   never a fake percentage, because the worker does not report one — plus the stage it last named and a
   live elapsed clock. Motion indicates an outstanding request, not measured work or completion. */
/* The band sits ABOVE the paper and never displaces it: a job in flight must not take the director's
   board, register or cut pages off the desk — that was the 3am bug. It spans the desk so progress is
   visible on every section from one place, rather than per-paper where a section gets forgotten. */
.po-working-band { display: grid; gap: 10px; padding: 10px 16px 12px; border-bottom: 1px solid var(--po-rule); background: rgba(200,144,47,0.05); } /* a faint wash of the room gold — no phantom token */
.po-working-band .po-working { max-width: none; margin: 0; }
.po-working-band .po-working + .po-working { border-top: 1px solid var(--po-rule); padding-top: 10px; }
.po-working { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 46ch; margin: 2px 0 4px; }
.po-working-bar { position: relative; height: 3px; border-radius: 2px; background: var(--po-rule); overflow: hidden; }
.po-working-bar span { position: absolute; inset: 0 auto 0 0; width: 38%; border-radius: 2px; background: var(--po-gold); animation: poWorking 1.5s ease-in-out infinite; }
.po-working-line { font-size: 12.5px; color: var(--po-ink-2); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.po-working-line b { font-weight: 600; color: var(--po-ink); }
.po-working-status { min-width: 0; }
.po-working-clock { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--po-grey); letter-spacing: 0.04em; }
.po-working-note { margin: -2px 0 0; font-size: 11.5px; color: var(--po-grey); }
.po-working.is-stale .po-working-stale { color: var(--po-pencil); font-style: italic; }
/* A quiet worker is still an outstanding request. Keep waiting motion until a terminal status;
   reduced-motion preferences below continue to provide a static, partial indicator. */
.po-working.is-stale .po-working-bar span { opacity: 0.65; }
@keyframes poWorking { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) {
  .po-working-bar span { animation: none; width: 38%; left: 31%; opacity: 0.55; } /* still PARTIAL — a full bar reads as finished, which is the opposite of what this says. The clock still ticks. */
}
.po-blank .po-why.is-later { border-left-style: dashed; border-left-color: var(--po-pencil); color: var(--po-grey); font-style: italic; }
/* The Production Book paper (Gap 5, PR A): the readiness pass and the contents, set like the other papers on the desk. */
.po-book-paper { padding: 0; }
.po-book { padding: 36px 40px 44px; display: grid; gap: 22px; max-width: 78ch; }
.po-book-head { display: grid; gap: 4px; }
.po-book-cap { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--po-grey); }
.po-book-head h3 { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.15; color: var(--po-ink); }
.po-book-status { font-size: 13.5px; color: var(--po-ink-2); }
.po-book-rechecking { color: var(--po-grey); font-style: italic; }
.po-book-empty { font-size: 13.5px; color: var(--po-ink-2); }
.po-book-pass { display: grid; gap: 18px; }
.po-book-part h4, .po-book-contents h4 { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--po-ink-2); margin: 0 0 8px; }
.po-book-part ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.po-book-line { border-left: 2px solid var(--po-rule-strong); padding: 2px 0 2px 12px; font-size: 13.5px; line-height: 1.5; color: var(--po-ink); overflow-wrap: anywhere; }
.po-book-part.is-gates .po-book-line { border-left-color: var(--po-gold); }
.po-book-part.is-unknown .po-book-line { border-left-style: dashed; color: var(--po-ink-2); }
.po-book-fixes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.po-book-fixes .po-btn { font-size: 12px; min-height: 28px; padding: 4px 10px; }
.po-book-fixes .po-muted, .po-book-next { font-size: 12.5px; color: var(--po-grey); }
.po-book-visits { margin-top: 4px; font-size: 12.5px; color: var(--po-ink-2); }
.po-book-visits ul { margin: 4px 0 0 16px; padding: 0; }
.po-book-toc, .po-book-days { list-style: none; margin: 0; padding: 0; display: grid; }
.po-book-toc > li, .po-book-days > li { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 12px; padding: 6px 0; border-top: 1px solid var(--po-rule); font-size: 13px; }
.po-book-toc > li > b, .po-book-days > li > b { font-weight: 600; color: var(--po-ink); }
.po-book-toc > li > span, .po-book-days > li > span { color: var(--po-ink-2); }
.po-book-sheets .po-book-days { grid-column: 1 / -1; padding-left: 14px; }
.po-book-days > li { font-size: 12.5px; padding: 4px 0; }
/* PR B: the book itself — what was last made, the press, what changed since, the pencils line and the change loop */
.po-book-make { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--po-rule); border-radius: 6px; background: var(--po-chrome); }
.po-book-made { font-size: 13px; font-weight: 600; color: var(--po-ink); }
.po-book-press { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.po-book-edition { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.po-book-edition .po-chip { font-size: 12px; }
.po-book-make > .po-muted, .po-book-loop > .po-muted { font-size: 12.5px; color: var(--po-grey); }
.po-book-waits, .po-book-pencils > p { font-size: 13px; line-height: 1.5; color: var(--po-ink-2); overflow-wrap: anywhere; }
.po-book-since h4, .po-book-loop h4 { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--po-ink-2); margin: 0 0 6px; }
.po-book-since ul { margin: 0; padding-left: 16px; display: grid; gap: 4px; font-size: 13px; line-height: 1.5; color: var(--po-ink); overflow-wrap: anywhere; }
.po-book-loop ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (max-width: 640px) {
  .po-book { padding: 24px 16px 32px; }
  .po-book-make { padding: 12px; }
  .po-book-toc > li, .po-book-days > li { grid-template-columns: 1fr; gap: 2px; }
}
.po-blank .po-blank-foot { margin-top: 12px; font-size: 11px; color: var(--po-grey); }
.po-margin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; font-size: 11px; color: var(--po-grey); line-height: 1.45; }
.po-mn { position: relative; padding: 0 0 12px 12px; border-left: 1px solid var(--po-rule-strong); }
.po-mn::before { content: ""; position: absolute; left: -4px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--po-ink); }
.po-mn.is-pencil::before { background: var(--po-paper); border: 1.5px solid var(--po-pencil); left: -4.5px; }
.po-mn.is-hold::before { background: var(--po-paper); border: 1.5px dashed var(--po-grey); left: -4.5px; }
.po-mn b { display: block; color: var(--po-ink); font-weight: 600; font-size: 11px; }
.po-mn.is-pencil b { color: var(--po-pencil); font-style: italic; }
.po-mn small { display: block; font-size: 10px; color: var(--po-grey); margin-top: 1px; }
@media (max-width: 900px) { .po-margin { grid-template-columns: 1fr; } }

/* ── PR 2: the Coordinator listens — live composer, the director's lines, the pencil card ── */
.po-m.is-me .po-av { background: var(--po-ink); border-color: var(--po-ink); color: var(--po-paper); font-size: 9px; }
.po-m.is-me .po-msg { color: var(--po-ink-2); }
.po-m.is-engine .po-av { border-style: dashed; border-color: var(--po-pencil); color: var(--po-pencil); }
.po-engine-cap { margin-bottom: 5px; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--po-pencil); font-style: italic; }
.po-engine-copy { overflow-wrap: anywhere; color: var(--po-ink); }
.po-engine-copy > p + p { margin-top: 8px; }
.po-engine-copy h5 { margin: 10px 0 5px; color: var(--po-ink); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.po-engine-copy strong { font-weight: 650; }
.po-m .po-msg .po-engine-copy ol, .po-m .po-msg .po-engine-copy ul { margin: 8px 0 0 20px; padding: 0; color: var(--po-ink); }
.po-engine-copy li + li { margin-top: 8px; }
.po-engine-claim { padding: 1px 2px; border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.po-engine-claim.is-proposing { color: var(--po-pencil); font-style: italic; background: rgba(120,112,99,0.08); border-bottom: 1px dashed var(--po-pencil); }
.po-engine-claim.is-asserting { color: var(--po-pencil); font-style: italic; background: rgba(120,112,99,0.08); border-bottom: 1px solid var(--po-pencil); }
.po-engine-claim-label { display: inline-block; margin: 0 5px 0 1px; padding: 0 3px; border: 1px solid currentColor; border-radius: 3px; font-size: 8.5px; line-height: 1.45; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-style: normal; vertical-align: 0.08em; }
.po-engine-grounded { display: grid; gap: 4px; margin: 7px 0 0; padding: 0; list-style: none; }
.po-engine-grounded li { display: flex; flex-wrap: wrap; gap: 4px 7px; align-items: baseline; padding: 4px 6px; border-left: 2px solid var(--po-ok); background: rgba(43,113,74,0.06); color: var(--po-ink); font-size: 10px; line-height: 1.35; }
.po-engine-grounded b { color: var(--po-ok); font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.po-typing { display: inline-flex; gap: 4px; align-items: center; height: 22px; }
.po-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--po-pencil); animation: poDots 1.1s ease-in-out infinite; }
.po-typing i:nth-child(2) { animation-delay: 0.15s; } .po-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes poDots { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.po-composer.is-live { padding: 6px 6px 6px 14px; align-items: flex-end; color: var(--po-ink); cursor: text; }
.po-composer.is-live:focus-within { border-color: var(--po-ink); }
.po-composer.is-live.is-off { opacity: 0.6; }
.po-saved-script { margin: 0 16px 10px; padding: 10px 12px; border-left: 2px solid var(--po-gold); background: var(--po-chrome); color: var(--po-ink-2); font-size: 12px; line-height: 1.5; max-height: 160px; overflow-y: auto; }
.po-saved-script p { margin: 0; }
.po-saved-script .po-actions, .po-saved-script > .po-btn { margin-top: 8px; }
.po-saved-script .po-btn { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.po-composer.is-live textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; font: inherit; font-size: 13px; line-height: 1.45; color: var(--po-ink); padding: 3px 0; height: 22px; max-height: 140px; overflow-y: auto; }
.po-composer.is-live textarea::placeholder { color: var(--po-grey); }
.po-composer.is-live .po-send { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--po-rule-strong); background: #fff; color: var(--po-ink-2); }
.po-composer.is-live .po-send svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.po-composer.is-live .po-send:hover, .po-composer.is-live .po-send:focus-visible { background: var(--po-gold); border-color: var(--po-gold); color: var(--po-gold-ink); outline: none; }
.po-composer.is-live .po-send:disabled { opacity: 0.4; }
.po-card { margin-top: 10px; background: #fff; border: 1px dashed var(--po-pencil); border-radius: 10px; padding: 10px 12px 12px; }
.po-card .po-card-cap { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--po-pencil); font-style: italic; margin-bottom: 6px; }
.po-fact { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.4fr) auto; align-items: baseline; gap: 6px 10px; padding: 5px 0; border-top: 1px solid var(--po-rule); font-size: 12.5px; }
.po-fact:first-of-type { border-top: 0; }
.po-fact .po-fact-label { color: var(--po-ink); font-weight: 600; min-width: 0; }
.po-fact .po-fact-label small { display: block; font-weight: 400; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--po-grey); }
.po-fact .po-fact-value { min-width: 0; overflow-wrap: anywhere; }
.po-fact.is-clear .po-fact-value { color: var(--po-grey); }
.po-fact .po-fact-tools { display: inline-flex; gap: 2px; }
.po-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--po-grey); font-size: 13px; line-height: 1; }
.po-icon:hover, .po-icon:focus-visible { border-color: var(--po-rule-strong); color: var(--po-ink); background: var(--po-chrome); outline: none; }
/* Fixing a pencil: the edit takes its own full-width row under the fact — a real box you can read,
   showing the value the way it reads on the sheet; Enter sets, Esc cancels. */
/* a pencil the schedule moved under: its reason reads under the row, across both columns */
.po-fact.is-stale .po-fact-value { color: var(--po-grey); }
.po-fact.is-stale .po-fact-detail { grid-column: 1 / -1; }
.po-fact.is-editing { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.4fr); background: var(--po-chrome); margin: 0 -8px; padding: 8px 8px 10px; border-radius: 8px; border-top-color: transparent; }
.po-fact.is-editing .po-fact-value { text-decoration: line-through; text-decoration-color: var(--po-rule-strong); }
.po-fact-edit { grid-column: 1 / -1; display: grid; gap: 6px; margin-top: 4px; }
.po-fact-edit textarea { display: block; width: 100%; min-width: 0; resize: none; font: inherit; font-size: 13.5px; line-height: 1.4; padding: 8px 10px; min-height: 36px; border: 1px solid var(--po-ink); border-radius: 7px; background: #fff; color: var(--po-ink); outline: none; }
.po-fact-edit textarea:focus { box-shadow: 0 0 0 3px rgba(200, 144, 47, 0.25); border-color: var(--po-gold); }
.po-fact-edit .po-fact-edit-row { display: flex; align-items: center; gap: 6px; }
.po-fact-edit .po-fact-edit-row small { flex: 1; min-width: 0; font-size: 10.5px; color: var(--po-grey); }
.po-fact-edit .po-btn { padding: 5px 10px; font-size: 11.5px; }
.po-pv { color: var(--po-pencil); font-style: italic; border-bottom: 1px dotted var(--po-pencil); }
.po-desk-actions .po-source b.is-pencil { color: var(--po-pencil); font-style: italic; letter-spacing: 0.1em; }
.po-daychips { display: inline-flex; gap: 4px; margin-right: 4px; }
.po-chip { font-size: 11px; font-weight: 600; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--po-rule-strong); background: transparent; color: var(--po-ink-2); }
.po-chip.is-on { background: var(--po-ink); border-color: var(--po-ink); color: var(--po-paper); }
.po-chip:hover, .po-chip:focus-visible { border-color: var(--po-ink); outline: none; }
.po-daypick { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px; }
.po-daypick .po-icon { width: 26px; height: 26px; border-color: var(--po-rule-strong); font-size: 15px; }
.po-daypick .po-icon:disabled { opacity: 0.35; }
.po-daypick small { font-size: 10.5px; color: var(--po-grey); margin-left: 2px; white-space: nowrap; }
.po-select { font: inherit; font-size: 11.5px; font-weight: 600; color: var(--po-ink); background: #fff; border: 1px solid var(--po-rule-strong); border-radius: 7px; padding: 5px 26px 5px 9px; max-width: 260px; text-overflow: ellipsis;
  appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6c66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 8px center; background-size: 12px; }
.po-select:hover, .po-select:focus-visible { border-color: var(--po-ink); outline: none; }
/* PR 3a — the shapes: unit tabs, episode selector, sectioned pencil cards, strip colours on the sheet */
.po-unittabs { display: inline-flex; gap: 4px; margin-right: 8px; padding-right: 8px; border-right: 1px solid var(--po-rule); }
/* Label the document and version choices; reserve buttons for actions on the paper. */
.po-schedule-toolbar { min-width: 0; }
.po-schedule-actions { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.po-schedule-actions .po-source { white-space: normal; }
.po-schedule-actions .po-tools { justify-content: flex-start; align-items: flex-end; gap: 10px; }
.po-schedule-picker { display: grid; flex: 1 1 160px; max-width: 220px; min-width: 0; gap: 4px; font-size: 10.5px; color: var(--po-grey); }
.po-schedule-picker .po-select { width: 100%; max-width: none; min-width: 0; min-height: 32px; font: 500 12px/1.25 var(--font-body); border-radius: 5px; }
.po-schedule-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.po-schedule-actions .po-btn { min-height: 32px; white-space: nowrap; }
.po-episode { display: grid; gap: 4px; padding: 0 8px 12px; }
.po-episode .po-cap { padding: 0; }
.po-episode .po-select { width: 100%; max-width: none; }
.po-sect { border-top: 1px solid var(--po-rule); padding-top: 6px; margin-top: 6px; }
.po-sect:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.po-sect-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 2px 0 6px; }
.po-sect-head b { flex: 1 1 180px; min-width: 0; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--po-ink); }
.po-sect-head small { flex: none; font-size: 10px; color: var(--po-grey); }
.po-sect-head .po-sect-tools { flex: none; margin-left: auto; display: inline-flex; gap: 6px; }
.po-sect-head .po-btn { flex: none; min-height: 28px; padding: 3px 8px; font-size: 10.5px; white-space: nowrap; }
.po-more { display: block; width: 100%; text-align: left; font: inherit; font-size: 11.5px; color: var(--po-grey); background: transparent; border: 0; padding: 6px 0 2px; cursor: pointer; }
.po-more:hover, .po-more:focus-visible { color: var(--po-ink); outline: none; text-decoration: underline; }
table.po-g tr.s-white td { background: #fff; }
table.po-g tr.s-yellow td { background: #f6e27a; }
table.po-g tr.s-blue td { background: #9cc3e6; }
table.po-g tr.s-green td { background: #a9d68a; }
table.po-g tr.tot td { font-weight: 700; border-bottom: 1.5px solid var(--po-ink); }
.po-key { display: flex; gap: 10px; font-size: 7.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--po-grey); margin-top: 4px; }
.po-key i { display: inline-block; width: 9px; height: 9px; border: 1px solid var(--po-rule-strong); vertical-align: -1px; margin-right: 4px; }
table.po-g tr.is-pencil-row td { color: var(--po-pencil); font-style: italic; }
.po-chip.is-pencil { border-style: dashed; color: var(--po-pencil); font-style: italic; }
/* Step 2 — script import: the attach control and the pile rows */
.po-composer.is-live .po-attach { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--po-grey); margin: 0 2px 0 -6px; }
.po-composer.is-live .po-attach svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.po-composer.is-live .po-attach:hover, .po-composer.is-live .po-attach:focus-visible { color: var(--po-ink); border-color: var(--po-rule-strong); background: var(--po-chrome); outline: none; }
.po-composer.is-live .po-attach.is-busy { color: var(--po-gold); animation: poPulse 1.2s ease-in-out infinite; }
@keyframes poPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.po-fact.is-bundle { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.4fr) auto; }
.po-fact.is-bundle .po-fact-detail { grid-column: 1 / -1; }
.po-bundle { list-style: none; margin: 4px 0 0; padding: 6px 0 0; border-top: 1px dotted var(--po-rule); font-size: 11.5px; color: var(--po-ink-2); max-height: 96px; overflow: hidden; }
.po-bundle.is-open { max-height: none; }
.po-bundle li { padding: 2px 0; line-height: 1.4; }
.po-bundle li b { color: var(--po-ink); font-variant-numeric: tabular-nums; }

/* ── the call sheet DRAFT on the desk — the concept's paper voice (Helvetica AD sheet), PRELIM
   watermark, pencil italics, dotted blanks. Rendered client-side; the print copies these rules. ── */
.po-paper.is-draft { overflow: hidden; container-type: inline-size; }
.po-sheet { --po-doc: "Helvetica Neue", Helvetica, Arial, sans-serif; position: relative; width: 100%; padding: 34px 40px 40px; font-family: var(--po-doc); font-size: 10px; line-height: 1.35; color: var(--po-ink); background: var(--po-paper); }
.po-sheet::before { content: "PRELIM"; position: absolute; left: 50%; top: min(45%, 220px); width: 80%; height: 1.2em; display: block; text-align: center; line-height: 1.2; pointer-events: none; font-family: var(--po-doc); font-weight: 800; font-size: 18cqw; letter-spacing: 0.06em; color: rgba(26,25,23,0.05); transform: translate(-50%, -50%) rotate(-24deg); }
.po-sheet > * { position: relative; }
.po-cs-h { display: grid; grid-template-columns: 1.05fr 1.2fr 1fr; gap: 16px; padding-bottom: 10px; border-bottom: 1.5px solid var(--po-ink); }
.po-cs-co { font-size: 9px; color: var(--po-ink-2); }
.po-cs-co > b { display: block; font-size: 11px; letter-spacing: 0.06em; color: var(--po-ink); margin-bottom: 4px; text-transform: uppercase; }
.po-kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 9px; }
.po-kv > span:nth-child(odd) { color: var(--po-grey); text-transform: uppercase; letter-spacing: 0.06em; font-size: 8px; padding-top: 1px; }
.po-cs-mid { text-align: center; }
.po-cs-title { font-size: 18px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.1; }
.po-cs-ep { font-size: 9px; color: var(--po-grey); margin-top: 2px; letter-spacing: 0.06em; text-transform: uppercase; }
.po-cs-gcc { margin-top: 10px; font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--po-grey); }
.po-cs-gcc-t { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; min-height: 34px; }
.po-cs-gcc-t .po-pv { border-bottom-width: 2px; }
.po-cs-safety { margin-top: 8px; font-size: 8.5px; color: var(--po-ink-2); }
.po-cs-right { text-align: right; }
.po-cs-date { font-size: 11.5px; font-weight: 700; }
.po-cs-dayx { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--po-grey); margin-top: 1px; }
.po-kt { margin-top: 8px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 9px; text-align: left; }
.po-kt span:nth-child(odd) { color: var(--po-grey); text-transform: uppercase; letter-spacing: 0.06em; font-size: 8px; }
.po-kt span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.po-office .po-cs-right .po-kt { grid-template-columns: max-content minmax(0, 1fr); }
.po-office .po-cs-right .po-kt span:nth-child(even) { min-width: 0; overflow-wrap: anywhere; }
.po-office .po-cs-weather-row { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; }
.po-office .po-cs-weather-row > span:first-child { flex: none; }
.po-office .po-cs-weather-row > span:last-child { flex: 1; }
.po-blank-line { display: inline-block; min-width: 54px; border-bottom: 1px dotted var(--po-rule-strong); vertical-align: baseline; }
.po-blank-line::after { content: "—"; visibility: hidden; }
.po-cs-sec { margin-top: 12px; }
.po-cs-st { font-size: 8px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--po-ink); font-weight: 700; padding-bottom: 3px; border-bottom: 1px solid var(--po-ink); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 12px; }
.po-cs-st small { font-weight: 400; color: var(--po-grey); letter-spacing: 0.06em; text-transform: none; }
.po-cs-loc { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; font-size: 9px; }
.po-cs-loc div b { display: inline-block; min-width: 96px; margin-right: 6px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 8px; color: var(--po-grey); }
.po-cs-operations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 8px 0 0; padding: 0 13px; font-size: 9px; line-height: 1.4; }
.po-cs-operations > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; align-items: baseline; break-inside: avoid; }
.po-cs-operations dt { font-weight: 600; color: var(--po-grey); white-space: nowrap; }
.po-cs-operations dt small { display: block; font-size: 7.5px; font-weight: 400; }
.po-cs-operations dd { display: grid; gap: 1px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.po-cs-operations dd > span { min-width: 0; }

table.po-g { width: 100%; border-collapse: collapse; font-size: 9px; }
table.po-g th { font-size: 7.5px; letter-spacing: 0.1em; text-transform: uppercase; text-align: left; color: var(--po-ink); padding: 3px 5px; border-bottom: 1px solid var(--po-ink); font-weight: 700; white-space: nowrap; }
table.po-g td { padding: 4px 5px; border-bottom: 1px solid var(--po-rule); vertical-align: top; font-variant-numeric: tabular-nums; }
table.po-g td.c, table.po-g th.c { text-align: center; }
table.po-g tr.ban td { background: #e7e4dc; font-weight: 600; letter-spacing: 0.06em; font-size: 7.5px; text-transform: uppercase; text-align: center; color: var(--po-ink-2); }
table.po-g td.po-cs-empty { color: var(--po-grey); font-style: italic; }
.po-cs-appr { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--po-rule); font-size: 8px; color: var(--po-grey); letter-spacing: 0.06em; text-transform: uppercase; }
.po-cs-appr span b { display: inline-block; width: 110px; border-bottom: 1px solid var(--po-rule-strong); margin-left: 6px; vertical-align: -2px; }
.po-cs-foot { margin-top: 6px; font-size: 7.5px; color: var(--po-grey); display: flex; justify-content: space-between; gap: 12px; }

/* Step 3 — the stripboard on the desk: paper strips in the four industry colours, black day breaks,
   grey banners, flags on the left edge, the DOOD tally clipped beside the board, ASSUMED list visible.
   Pencil = graphite outline + hatched wash; ink = solid. Same paper, same type as the call sheet. */
.po-board-paper { min-width: 0; }
.po-sb, .po-ol { font-size: 9.5px; padding: 26px 30px 30px; }
.po-sheet.po-sb::before, .po-sheet.po-ol::before, .po-sheet.po-ss::before, .po-sheet.po-bd::before, .po-sheet.po-prep::before { content: none; }
.po-sheet.po-sb.is-pencil::before, .po-sheet.po-ol.is-pencil::before, .po-sheet.po-ss.is-pencil::before, .po-sheet.po-bd.is-pencil::before, .po-sheet.po-prep.is-pencil::before { content: "PENCIL"; }
.po-ss, .po-bd, .po-prep { font-size: 9.5px; padding: 26px 30px 30px; }
.po-sb-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; align-items: end; padding-bottom: 8px; border-bottom: 1.5px solid var(--po-ink); margin-bottom: 8px; }
.po-sb-h > div { min-width: 0; }
.po-sb-h .po-sb-state { grid-column: 2; grid-row: 1; }
.po-sb-h .po-sb-stats { grid-column: 1 / -1; grid-row: 2; }
.po-sb-h h1 { overflow-wrap: anywhere; }
.po-sb-h h1 { margin: 2px 0 0; font-size: 17px; letter-spacing: 0.02em; text-transform: uppercase; font-weight: 700; }
.po-sb-kicker { margin: 0; font-size: 8px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--po-gold); font-weight: 600; }
.po-sb-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 8.5px; color: var(--po-grey); text-transform: uppercase; letter-spacing: 0.06em; }
.po-sb-stats b { color: var(--po-ink); font-size: 12px; font-variant-numeric: tabular-nums; margin-right: 3px; }
.po-sb-state { font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase; border: 1px solid var(--po-ink); padding: 3px 7px; white-space: nowrap; }
.po-sb-state.is-pencil { border-style: dashed; color: var(--po-pencil); font-style: italic; }
.po-sb-key { margin: 0 0 8px; align-items: center; }
.po-sb-key span { display: inline-flex; align-items: center; gap: 4px; }
.po-sb-key span::before { content: ""; display: inline-block; width: 12px; height: 8px; border: 1px solid var(--po-rule-strong); }
.po-sb-key .s-white::before { background: #fff; } .po-sb-key .s-yellow::before { background: #f6e27a; } .po-sb-key .s-blue::before { background: #9cc3e6; } .po-sb-key .s-green::before { background: #a9d68a; }
.po-sb-key .k-bar::before { background: var(--po-ink); } .po-sb-key .k-ban::before { background: #e7e4dc; } .po-sb-key .k-flag::before { display: none; }
.po-sb { container: office-board / inline-size; }
.po-sb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.po-sb-strips { min-width: 0; }
.po-daybar { display: grid; grid-template-columns: 72px 112px repeat(3, minmax(0, 1fr)) 56px; grid-template-areas: "day date location location location flags" "load load clock clock cast cast"; gap: 5px 8px; align-items: start; background: var(--po-ink); color: var(--po-paper); padding: 7px 8px; margin-top: 8px; font-size: 8.5px; letter-spacing: 0.02em; cursor: pointer; }
.po-daybar > span { min-width: 0; overflow-wrap: anywhere; }
.po-daybar .db-n { grid-area: day; } .po-daybar .db-date { grid-area: date; }
.po-daybar .db-loc { grid-area: location; } .po-daybar .db-flags { grid-area: flags; }
.po-daybar .db-load { grid-area: load; } .po-daybar .db-clock { grid-area: clock; } .po-daybar .db-cast { grid-area: cast; }
.po-daybar:first-child { margin-top: 0; }
.po-daybar.is-night { background: #0e1a2b; }
.po-daybar .db-n { font-weight: 700; font-size: 10px; } .po-daybar .db-n small { font-weight: 400; opacity: 0.7; margin-left: 3px; }
.po-daybar .db-loc { text-transform: uppercase; letter-spacing: 0.04em; white-space: normal; }
.po-daybar .db-flags { text-align: right; }
.po-daybar .db-flags i, .po-strip .st-flag i, .po-flags i, .po-daysum i { font-style: normal; font-weight: 700; margin-right: 2px; }
.f-STOP { color: #c0392b; } .f-RED { color: #d35400; } .f-AMBER { color: var(--po-amber); } .f-NOTE { color: var(--po-grey); }
.po-daybar .db-flags i.f-STOP, .po-daybar .db-flags i.f-RED { color: #ff9c8a; } .po-daybar .db-flags i.f-AMBER { color: #f0c26b; } .po-daybar .db-flags i.f-NOTE { color: #cfcbc2; }
.po-daybar:hover { background: #2a2825; } .po-daybar.is-night:hover { background: #17283f; }
.po-daybar:focus-visible { outline: 2px solid var(--po-gold); outline-offset: 1px; }
.po-strip { display: grid; grid-template-columns: 16px 52px 28px minmax(0, 1fr) 50px 36px 84px 34px; grid-template-areas: "flag scene ie set dn pages time estimate" "flag synopsis synopsis synopsis synopsis cast cast cast"; gap: 6px; align-items: start; padding: 7px 6px; border-bottom: 1px solid var(--po-rule); font-size: 9px; line-height: 1.4; }
.po-strip > span { min-width: 0; overflow-wrap: anywhere; }
.po-strip .st-flag { grid-area: flag; } .po-strip .st-sc { grid-area: scene; }
.po-strip .st-ie { grid-area: ie; } .po-strip .st-set { grid-area: set; }
.po-strip .st-dn { grid-area: dn; } .po-strip .st-pg { grid-area: pages; }
.po-strip .st-syn { grid-area: synopsis; } .po-strip .st-cast { grid-area: cast; }
.po-strip .st-time { grid-area: time; } .po-strip .st-est { grid-area: estimate; }
.po-strip.s-white { background: #fff; } .po-strip.s-yellow { background: #f6e27a; } .po-strip.s-blue { background: #9cc3e6; } .po-strip.s-green { background: #a9d68a; }
.po-strip.is-dawn, .po-strip.is-dusk { box-shadow: inset 4px 0 0 #e8b34c; }
.po-strip .st-sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.po-strip .st-ie, .po-strip .st-dn { text-transform: uppercase; letter-spacing: 0.04em; font-size: 8px; }
.po-strip .st-set { text-transform: uppercase; letter-spacing: 0.02em; white-space: normal; }
.po-strip .st-set small, .po-strip .st-dn small, .po-strip .st-time small { text-transform: none; letter-spacing: 0; color: var(--po-ink-2); font-size: 8px; }
.po-strip .st-pg { text-align: right; font-variant-numeric: tabular-nums; }
.po-strip .st-syn { white-space: normal; color: var(--po-ink-2); }
.po-strip .st-syn small { display: block; margin-top: 3px; }
.po-strip .st-cast { font-variant-numeric: tabular-nums; white-space: normal; }
.po-strip .st-cast b { display: block; font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.po-strip .st-time { font-variant-numeric: tabular-nums; font-size: 8px; color: var(--po-ink-2); white-space: normal; }
.po-strip .st-est { text-align: right; font-variant-numeric: tabular-nums; font-size: 8px; color: var(--po-ink-2); }
.po-strip .st-est sup { color: var(--po-pencil); }
.po-strip.is-banner { grid-template-columns: 1fr; grid-template-areas: none; background: #e7e4dc; color: var(--po-ink-2); font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; }
.po-strip.is-banner.is-move { background: #ddd8cc; }
.po-dayend { padding: 3px 8px 6px; font-size: 7.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--po-grey); text-align: center; border-bottom: 1px solid var(--po-rule-strong); }
.po-daysum { border: 1px dashed var(--po-rule-strong); border-top: 0; padding: 6px 10px; font-size: 8.5px; color: var(--po-ink-2); background: var(--po-chrome); display: grid; gap: 3px; }
.po-daysum ul { margin: 2px 0 0; padding-left: 14px; } .po-daysum li { margin: 0; }
.po-boneyard { margin-top: 10px; border: 1px solid var(--po-rule-strong); padding: 6px 10px; font-size: 8.5px; color: var(--po-ink-2); background: var(--po-chrome); }
.po-boneyard.is-empty { color: var(--po-grey); border-style: dashed; }
.po-tally { position: static; min-width: 0; top: 8px; border: 1px solid var(--po-rule-strong); padding: 8px 10px; background: var(--po-chrome); font-size: 8.5px; }
.po-tally h4, .po-flags h4, .po-assumed h4 { margin: 0 0 4px; font-size: 8px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--po-grey); font-weight: 600; }
.po-tally-total { margin-bottom: 6px; color: var(--po-ink-2); } .po-tally-total b { font-size: 14px; color: var(--po-ink); }
.po-tally table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 8px; }
.po-tally th, .po-tally td { overflow-wrap: anywhere; vertical-align: top; }
.po-tally th:first-child { width: 20px; }
.po-tally th:nth-child(3), .po-tally th:nth-child(5) { width: 22px; }
.po-tally th:nth-child(4) { width: 34px; }
.po-tally th { text-align: left; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 7px; border-bottom: 1px solid var(--po-ink); padding: 2px 3px; color: var(--po-grey); }
.po-tally td { padding: 2px 3px; border-bottom: 1px solid var(--po-rule); font-variant-numeric: tabular-nums; }
.po-tally td:nth-child(3), .po-tally td:nth-child(5), .po-tally th:nth-child(3), .po-tally th:nth-child(5) { text-align: right; }
.po-tally tr.is-hot td:last-child { color: #d35400; font-weight: 700; }
.po-tally-more { margin-top: 4px; font-size: 7.5px; color: var(--po-grey); }
.po-flags, .po-assumed { margin-top: 12px; font-size: 8.5px; color: var(--po-ink-2); }
.po-flags ul, .po-assumed ul { margin: 0; padding-left: 14px; columns: 2; column-gap: 24px; }
.po-flags li, .po-assumed li { margin: 0 0 2px; break-inside: avoid; }
.po-sb-foot { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--po-rule); font-size: 7.5px; color: var(--po-grey); }
/* pencil: graphite outline, hatched wash, hand-set numbers */
.po-sb.is-pencil .po-strip, .po-ol.is-pencil tr td { background-image: repeating-linear-gradient(-45deg, rgba(26,25,23,0.035) 0 3px, transparent 3px 8px); }
.po-sb.is-pencil .po-strip { border-bottom-style: dashed; }
.po-sb.is-pencil .po-daybar { background: repeating-linear-gradient(-45deg, #1a1917 0 6px, #2f2d2a 6px 9px); }
.po-sb.is-pencil .po-dayend, .po-sb.is-pencil .po-strip .st-time, .po-sb.is-pencil .po-strip .st-est { font-style: italic; color: var(--po-pencil); }
/* the one-liner */
.po-ol-t { width: 100%; }
.po-ol-t th:nth-child(5), .po-ol-t td.ol-pg { text-align: right; }
.po-ol-t td.ol-sc { font-weight: 700; }
.po-ol-t td small { color: var(--po-ink-2); }
.po-ol-t tr.ol-day td { background: var(--po-ink); color: var(--po-paper); font-size: 8.5px; letter-spacing: 0.03em; padding: 4px 6px; }
.po-ol-t tr.ol-day td b { font-size: 9.5px; }
.po-ol.is-pencil tr.ol-day td { background: repeating-linear-gradient(-45deg, #1a1917 0 6px, #2f2d2a 6px 9px); }
.po-bundle-note { margin-top: 4px; font-size: 11px; color: var(--po-grey); font-style: italic; }
.po-blank .po-why.is-busy { border-left-color: var(--po-gold); font-style: italic; }
/* the shooting schedule, breakdown sheets, prep schedule */
.po-ss-t tr.ss-detail td { border-bottom: 1px solid var(--po-rule-strong); padding: 2px 6px 6px; background: var(--po-paper); }
.po-ss-t .ss-syn { color: var(--po-ink-2); margin-bottom: 2px; }
.po-ss-t .ss-kv { font-size: 8px; color: var(--po-ink-2); } .po-ss-t .ss-kv b { color: var(--po-grey); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 7px; margin-right: 3px; }
.po-ss-t tr.ss-scene td { border-bottom: 0; }
.po-bd-sheet { border: 1px solid var(--po-ink); margin: 10px 0; padding: 10px 12px; break-inside: avoid; page-break-inside: avoid; }
.po-bd-h { display: flex; justify-content: space-between; align-items: end; gap: 12px; border-bottom: 1.5px solid var(--po-ink); padding-bottom: 6px; margin-bottom: 8px; }
.po-bd-h h2 { margin: 2px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; }
.po-bd-meta { display: flex; gap: 12px; font-size: 8px; color: var(--po-grey); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.po-bd-meta b { color: var(--po-ink); font-size: 11px; }
.po-bd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; }
.po-bd-cell h4 { margin: 0 0 2px; font-size: 7px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--po-grey); font-weight: 600; border-bottom: 1px solid var(--po-rule); }
.po-bd-cell p, .po-bd-cell ul { margin: 0; font-size: 9px; color: var(--po-ink-2); } .po-bd-cell ul { padding-left: 12px; } .po-bd-cell li { margin: 0; }
.po-bd-cell.po-bd-wide { grid-column: 1 / -1; }
.po-bd-cell .po-bd-blank { color: var(--po-pencil); font-style: italic; }
.po-bd-cell.po-bd-el h4 { color: var(--po-ink-2); border-bottom-color: var(--el-color, var(--po-rule)); }
.po-bd-cell.po-bd-el h4 .po-el-dot { width: 7px; height: 7px; margin-right: 5px; }
.po-bd-cell li small { color: var(--po-grey); font-style: italic; }
.po-bd-cell.po-bd-el.is-empty h4 { color: var(--po-grey); } .po-bd-cell .po-bd-q { display: block; font-size: 7.5px; }
/* Step 5a — the breakdown: elements register, by scene, the piles paper */
.po-el-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--el-color, #9a9a9a); vertical-align: -1px; margin-right: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); flex: 0 0 auto; }
.po-fact-label .po-el-dot { width: 8px; height: 8px; margin-right: 5px; }
.po-el-block { margin: 12px 0 0; } /* a long department flows across pages — never a blank page to keep a block whole */
.po-el-block .po-el-h { break-after: avoid; } .po-el-t thead { display: table-header-group; } .po-el-t tr { break-inside: avoid; }
.po-el-block.is-pencil-block { border: 1px dashed var(--po-rule-strong); padding: 6px 8px 8px; background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(0,0,0,.018) 14px 15px); }
.po-el-h { display: flex; align-items: baseline; gap: 8px; border-bottom: 1.5px solid var(--el-color, var(--po-ink)); padding-bottom: 3px; margin-bottom: 4px; }
.po-el-h .po-el-dot { align-self: center; }
.po-el-h h3 { margin: 0; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.po-el-h small { color: var(--po-grey); font-size: 8.5px; margin-right: auto; }
.po-el-h .po-tools { display: flex; gap: 6px; }
.po-el-h .po-btn { padding: 2px 9px; font-size: 10px; min-height: 0; }
.po-el-t { width: 100%; }
.po-el-t th:nth-child(2), .po-el-t td.po-el-sc { width: 22%; }
.po-el-t th:last-child, .po-el-t td.po-el-x { width: 24px; text-align: right; }
.po-el-t td.po-el-name { font-weight: 600; } .po-el-t td.po-el-name small { display: block; font-weight: 400; color: var(--po-grey); font-style: italic; }
.po-el-t td.po-el-q small { color: var(--po-ink-2); font-style: italic; }
.po-el-t td.po-el-q small { display: block; }
.po-el-t td, .po-bd-cell { overflow-wrap: anywhere; min-width: 0; }
.po-el-t td.po-el-x .po-icon { width: 18px; height: 18px; font-size: 12px; opacity: .55; } .po-el-t tr:hover td.po-el-x .po-icon { opacity: 1; }
.po-el-row.is-busy { opacity: .45; }
.po-el-cell { line-height: 1.7; }
.po-el-chipgroup { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; margin: 0 10px 2px 0; }
.po-el-chipgroup b { font-size: 7px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--po-grey); margin-right: 2px; }
.po-el-chip { display: inline-block; font-size: 8.5px; padding: 0 5px; border: 1px solid var(--po-rule-strong); border-left: 3px solid var(--el-color, var(--po-rule-strong)); background: var(--po-paper); white-space: nowrap; }
.po-el-key { flex-wrap: wrap; } .po-el-key span { display: inline-flex; align-items: center; }
.po-el-scene-t td:nth-child(2) small { color: var(--po-grey); }
.po-el-title p { margin: 4px 0; font-size: 10px; }
.po-piles .po-actions { margin-top: 14px; }
.po-piles .po-el-block { margin-top: 14px; }
.po-piles-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding: 6px 10px; margin: 0 0 8px; border: 1px dashed var(--po-rule-strong); background: var(--po-chrome); font-size: 12px; color: var(--po-ink-2); }
.po-piles-bar.is-on { border-style: solid; }
.po-piles-bar .po-piles-cap b.is-pencil { font-style: italic; color: var(--po-pencil); letter-spacing: 0.1em; font-size: 10px; margin-right: 4px; }
.po-piles-bar .po-tools { display: flex; gap: 6px; flex-wrap: wrap; }
/* Step 6 — the front door (/office): one sheet of paper on the desk-grey field */
.po-door { display: block; width: auto; height: auto; max-width: none; max-height: none; overflow: auto; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; } /* escapes .po-office's 52px-row grid box; the paper centres itself */
.po-door::backdrop { background: #0b0908; }
.po-door .po-door-paper { width: min(680px, calc(100vw - 48px)); margin: 8vh auto 0; background: var(--po-paper, #fff); color: var(--po-ink, #1a1917); padding: 40px 48px 34px; box-shadow: 0 30px 80px rgba(0,0,0,.45); font-family: var(--po-sans, "Inter", system-ui, sans-serif); }
.po-door-kicker { margin: 0 0 8px; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--po-gold, #c8902f); font-weight: 600; }
.po-door h1 { margin: 0 0 10px; font-family: var(--po-serif, Georgia, serif); font-weight: 400; font-size: 30px; line-height: 1.15; letter-spacing: -0.005em; text-wrap: balance; }
.po-door-lede { margin: 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--po-ink-2, #3d3b37); max-width: 56ch; }
.po-door-list { display: grid; gap: 6px; margin: 26px 0 22px; }
.po-door-list:empty { display: none; }
.po-door-list .po-door-cap { margin: 0 0 4px; }
.po-door-prod { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--po-rule, #cfcbc2); background: var(--po-paper, #fff); cursor: pointer; font: inherit; color: inherit; }
.po-door-prod:hover, .po-door-prod:focus-visible { border-color: var(--po-ink, #1a1917); outline: none; }
.po-door-prod b { font-size: 14px; } .po-door-prod small { color: var(--po-grey, #6f6c66); font-size: 11.5px; grid-column: 1; }
.po-door-prod b { grid-column: 1; }
.po-door-prod .po-door-go { grid-column: 2; grid-row: 1 / span 2; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--po-gold-ink, #221708); background: var(--po-gold, #c8902f); padding: 4px 9px; }
.po-door-cap { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--po-grey, #6f6c66); margin: 0 0 8px; }
.po-door-form { border-top: 1px solid var(--po-rule, #cfcbc2); padding-top: 18px; }
.po-door-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.po-door-field { display: grid; gap: 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--po-grey, #6f6c66); }
.po-door-field.po-door-grow { flex: 1 1 260px; }
.po-door-field input, .po-door-field select { font: inherit; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--po-ink, #1a1917); background: var(--po-paper, #fff); border: 0; border-bottom: 1.5px solid var(--po-rule-strong, #a9a49a); padding: 6px 2px; min-width: 160px; }
.po-door-field input:focus, .po-door-field select:focus { outline: none; border-bottom-color: var(--po-ink, #1a1917); }
.po-door-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.po-door-status { font-size: 12px; color: var(--po-grey, #6f6c66); font-style: italic; }
.po-door-foot { margin: 22px 0 0; font-size: 11.5px; color: var(--po-grey, #6f6c66); }
/* Step 7 — budget quantities */
.po-bq-sec { margin-top: 12px; break-inside: avoid; }
.po-bq-sec h3 { margin: 0 0 4px; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--po-grey); font-weight: 600; border-bottom: 1.5px solid var(--po-ink); padding-bottom: 3px; }
.po-bq-t { width: 100%; } .po-bq-t td.num, .po-bq-t th:not(:first-child):not(:last-child) { text-align: right; font-variant-numeric: tabular-nums; }
.po-bq-t td small { color: var(--po-grey); } .po-bq-t tr.tot td { border-top: 1.5px solid var(--po-ink); font-weight: 700; }
.po-bq-t td .po-el-dot { width: 7px; height: 7px; margin-right: 5px; }
.po-bq-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.po-bq-line { margin: 6px 0 0; font-size: 9px; color: var(--po-ink-2); }
.po-bq-note { margin: 6px 0 2px; font-size: 8.5px; color: var(--po-pencil); font-style: italic; }
.rail-project-kind { display: inline-block; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--po-gold, #c8902f); margin-left: 6px; vertical-align: 1px; }
.po-prep-t td:first-child { white-space: nowrap; font-weight: 600; } .po-prep-t td:nth-child(2) { white-space: nowrap; }
.po-prep-t td div { margin: 0 0 1px; }
/* Step 4 — the call sheet as pages, issued colours, printable lists */
.po-cs-page { position: relative; }
.po-cs-page.is-p2 { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--po-rule-strong); }
.po-cs-run { display: flex; justify-content: space-between; gap: 12px; font-size: 7px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--po-grey); margin-bottom: 6px; }
.po-cs-holds { margin-top: 4px; font-size: 8.5px; color: var(--po-ink-2); } .po-cs-holds b { font-size: 7px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--po-grey); margin-right: 4px; }
.po-sheet.is-issued::before { content: none; }
.po-paper.is-issuing { display: none; }
.po-issued-paper { display: grid; grid-template-rows: auto 1fr; }
.po-issue-band { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 6px 12px; font-size: 11px; color: var(--po-ink); border-bottom: 1px solid var(--po-rule-strong); background: #fff; }
.po-issue-band b { letter-spacing: 0.14em; }
.po-issue-band.is-white { background: #ffffff; } .po-issue-band.is-blue { background: #d9e8f7; } .po-issue-band.is-pink { background: #f9dbe4; } .po-issue-band.is-yellow { background: #f7eec0; } .po-issue-band.is-green { background: #d9efd3; } .po-issue-band.is-goldenrod { background: #f2dc9e; } .po-issue-band.is-buff { background: #efe1c6; } .po-issue-band.is-salmon { background: #f6d5c8; } .po-issue-band.is-cherry { background: #f0bfc6; }
.po-issue-changes { color: var(--po-ink-2); font-size: 10.5px; }
.po-chip.is-issue { border-color: var(--po-ink); }
.po-list-t { width: 100%; } .po-list-t td, .po-list-t th { font-size: 8.5px; }
@media print { .po-cs-page.is-p2 { page-break-before: always; border-top: 0; margin-top: 0; padding-top: 0; } .po-cs-page { page-break-after: auto; } .po-sb-h { grid-template-columns: minmax(0, 1fr) auto; } .po-sb-h .po-sb-state { grid-column: 2; grid-row: 1; } .po-sb-stats { grid-column: 1 / -1; } .po-daybar { break-inside: avoid; page-break-inside: avoid; break-after: avoid; } .po-strip { break-inside: avoid; } .po-bd-sheet { break-inside: avoid; } }
/* the Day out of Days */
.po-dood { font-size: 9px; padding: 26px 30px 30px; }
.po-sheet.po-dood::before { content: none; } .po-sheet.po-dood.is-pencil::before { content: "PENCIL"; }
.po-sheet.po-el::before, .po-sheet.po-bq::before { content: none; } .po-sheet.po-el.is-pencil::before { content: "PENCIL"; } /* the register / piles paper: no PRELIM — it is ink or pencil, never a draft sheet */
.po-dood-page { margin-top: 10px; } /* a long DOOD breaks across pages with its header row repeated — never a blank first page */
.po-dood-t thead { display: table-header-group; } .po-dood-t tr { break-inside: avoid; page-break-inside: avoid; }
.po-dood-pg { font-size: 7.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--po-grey); margin: 0 0 3px; }
.po-dood-t { width: 100%; table-layout: fixed; }
.po-dood-t th, .po-dood-t td { padding: 2px 2px; text-align: center; font-variant-numeric: tabular-nums; }
.po-dood-t th.dd-cast, .po-dood-t td.dd-cast { text-align: left; width: 150px; padding-left: 4px; white-space: normal; overflow-wrap: anywhere; }
.po-dood-t td.dd-cast small { color: var(--po-grey); }
.po-dood-t tr.dd-head th.dd-day { font-size: 8px; border-bottom: 0; }
.po-dood-t tr.dd-head th.dd-day.is-night { background: #0e1a2b; color: var(--po-paper); }
.po-dood-t tr.dd-date th { font-size: 6.5px; font-weight: 400; color: var(--po-grey); border-bottom: 1px solid var(--po-ink); letter-spacing: 0; text-transform: none; }
.po-dood-t td.dd-c { font-size: 7.5px; border-right: 1px solid var(--po-rule); }
.po-dood-t td.dd-c.is-w, .po-dood-t td.dd-c.is-sw, .po-dood-t td.dd-c.is-wf, .po-dood-t td.dd-c.is-swf { font-weight: 700; }
.po-dood-t td.dd-c.is-h { color: var(--po-grey); background: #f3f1eb; }
.po-dood-t td.dd-c.is-wd, .po-dood-t td.dd-c.is-pw, .po-dood-t td.dd-c.is-swd, .po-dood-t td.dd-c.is-pwf { font-weight: 700; color: var(--po-gold-ink); background: #f3ead6; }
.po-dood-t th.dd-tot, .po-dood-t td.dd-tot { width: 34px; border-left: 1px solid var(--po-ink); letter-spacing: 0; }
.po-dood-t th.dd-sf, .po-dood-t td.dd-sf { width: 96px; font-size: 7px; white-space: normal; line-height: 1.15; }
.po-dood-t td.dd-tot.is-hot { color: #d35400; font-weight: 700; }
.po-dood-notes { margin-top: 10px; font-size: 8px; color: var(--po-ink-2); } .po-dood-notes p { margin: 0 0 3px; }
/* the director's hand: a lifted strip, a day break that will take it, the pin it leaves */
.po-strip[draggable="true"] { cursor: grab; }
.po-strip.is-lifted { opacity: 0.55; box-shadow: 0 6px 14px rgba(26,25,23,0.25); transform: translateY(-1px); cursor: grabbing; }
.po-daybar.is-drop-here { outline: 2px solid var(--po-gold); outline-offset: -2px; }
.po-strip.is-drop-here { box-shadow: inset 0 -2px 0 var(--po-gold); }
.po-boneyard.is-drop-here { border-color: var(--po-gold); border-style: solid; background: #f3ead6; }
.po-strip .st-pin { color: var(--po-gold); font-style: normal; font-weight: 700; margin-right: 2px; }
.po-strip.is-pinned { box-shadow: inset 3px 0 0 var(--po-gold); }
.po-sb-delta { margin: 0 0 8px; padding: 5px 8px; border-left: 3px solid var(--po-gold); background: var(--po-chrome); font-size: 9px; color: var(--po-ink-2); }
.po-sb-trade { margin: 0 0 8px; padding: 5px 8px; border-left: 3px dashed var(--po-pencil); background: var(--po-chrome); font-size: 9px; color: var(--po-ink-2); }
.po-sb-trade ul { margin: 3px 0 0; padding-left: 14px; }
/* Gap 2 — a proposal is its own block beside the notes: pencil-dashed, never under "Accepted schedule notes". */
.po-proposal { margin-top: 10px; padding: 8px 10px 10px; border: 1px dashed var(--po-pencil); border-radius: 8px; background: var(--po-paper); overflow-wrap: anywhere; }
.po-proposal .po-proposal-head { margin: 0 0 6px; }
.po-proposal-label { margin: 0 0 4px; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--po-pencil); font-style: italic; }
.po-proposal-trade + .po-proposal-trade { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--po-rule); }
.po-proposal .po-proposal-gate, .po-proposal .po-proposal-marker { color: var(--po-grey); font-style: italic; }
.po-proposal-pin { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
/* The proposal as a gist with its reasoning in a dropdown (gap 2.1). Labels never wrap: the dropdown's rows are one grid
   whose label column is as wide as its widest label (max-content), and a card narrower than about 22em stacks each label
   above its text. The container is the card, not the viewport: the block lives in the chat column at any window width. */
.po-proposal-trade { container: po-proposal / inline-size; }
.po-proposal .po-proposal-relation { margin: 0 0 4px; color: var(--po-grey); font-style: italic; }
.po-proposal .po-proposal-gist { margin: 2px 0 4px; font-weight: 600; color: var(--po-ink); }
.po-proposal ul.po-proposal-gist-list { list-style: none; margin: 0 0 8px; padding: 0; color: var(--po-ink); }
.po-proposal .po-proposal-gist-list li + li { margin-top: 2px; }
.po-proposal .po-proposal-gist-list b { font-weight: 600; margin-right: 0.35em; }
.po-proposal-details { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--po-rule); }
.po-proposal-details > summary { cursor: pointer; color: var(--po-pencil); }
.po-proposal-details dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 6px 0 0; }
.po-proposal-details dl > div { display: contents; }
.po-proposal-details dt { font-weight: 600; white-space: nowrap; color: var(--po-ink-2); }
.po-proposal-details dd { margin: 0; min-width: 0; }
@container po-proposal (max-width: 22em) {
  .po-proposal-details dl { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .po-proposal-details dl > div + div > dt { margin-top: 6px; }
}
.po-fact-kept { display: block; color: var(--po-grey); font-style: italic; }
.po-bone { font: inherit; font-weight: 700; color: var(--po-ink); background: #fff; border: 1px solid var(--po-rule-strong); border-radius: 2px; padding: 0 5px; margin: 0 2px; cursor: pointer; }
.po-bone:hover { border-color: var(--po-gold); }
/* The paper, not the browser window, determines whether a side tally fits. */
@container office-board (min-width: 960px) {
  .po-sb-grid { grid-template-columns: minmax(0, 1fr) 190px; }
  .po-tally { position: sticky; }
}

/* Studio-side: the post-board three-way fork and the office-mode strip. Studio palette (dark). */
.post-board-fork { display: grid; gap: 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-2); padding: 14px 16px; }
.post-board-fork .fork-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.post-board-fork strong { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--ink); }
.post-board-fork p { margin: 0; font-size: 12.5px; color: var(--muted); }
.post-board-fork .fork-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.post-board-fork .fork-choices .text-button { justify-content: center; }
.workflow-thread-cue.is-fork .workflow-thread-panel { border-left-color: var(--gold); }
.office-mode-strip { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 8px 12px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--muted); }
.office-mode-strip strong { color: var(--gold-bright); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.office-mode-strip .text-button { margin-left: auto; }

/* Production Office door (topbar) — the one control on the page that reads as "go here for
   paperwork & exports": PV mark, serif name, live status line. Distinct from the status chips. */
.office-door { display: inline-grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 9px; height: 40px;
  padding: 0 14px 0 8px; margin-right: 6px; border: 1px solid rgba(227, 169, 79, 0.6); border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(227,169,79,0.14), rgba(227,169,79,0.05)); color: var(--ink); text-align: left; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(227,169,79,0.08) inset; transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease; }
.office-door:hover, .office-door:focus-visible { border-color: var(--gold-bright); background: linear-gradient(180deg, rgba(227,169,79,0.22), rgba(227,169,79,0.08)); transform: translateY(-1px); outline: none; }
.office-door:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.office-door-mark { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; padding-top: 5px;
  background: repeating-linear-gradient(-45deg, rgba(227,169,79,0.9) 0 4px, rgba(10,8,6,0.9) 4px 8px) top / 100% 6px no-repeat, var(--surface-2);
  color: var(--gold-bright); font-family: var(--mono); font-weight: 600; font-size: 9.5px; letter-spacing: 0.04em; }
.office-door-copy { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.office-door-copy strong { font-family: var(--font-display); font-weight: 400; font-size: 15px; color: var(--ink); white-space: nowrap; }
.office-door-copy small { margin-top: 2px; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
@media (max-width: 1100px) { .office-door-copy small { display: none; } .office-door { height: 34px; } }

/* Productions rail — a thread list: full list, most recent first, grouped by when, quiet meta,
   the open production marked by a thin gold rule. Film-office vocabulary, no shouting. */
.project-rail-list { gap: 2px; }
.rail-group-head { margin: 10px 4px 4px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.rail-group-head:first-child { margin-top: 2px; }
.rail-project { gap: 2px; padding: 8px 10px 8px 12px; border-left: 2px solid transparent; border-radius: 6px; }
.rail-project span.rail-project-name { font-size: 13.5px; font-weight: 500; color: var(--ink); letter-spacing: 0; }
.rail-project small { font-family: var(--font-body); font-size: 11px; letter-spacing: 0; text-transform: none; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-project small em { font-style: normal; color: var(--dim); }
.rail-project small b { font-weight: 500; color: var(--muted); }
.rail-project:hover { background: rgba(255, 255, 255, 0.035); }
.rail-project.selected { background: rgba(227, 169, 79, 0.08); border-left-color: var(--gold); }
.rail-project.selected small { color: var(--muted); }
.rail-project.selected small b { color: var(--gold-bright); }
/* Saved-script preparation stays with the composer; opening it never sends. */

/* T99 — the dock leads to the panel room: one frame gate, then the written reviews */
.frame-decision-count { opacity: 0.7; }
.frame-gate-summary { margin: 0 0 10px; }
.frame-gate-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; }
.frame-decision-nav { justify-content: space-between; }
.frame-decision-return { display: flex; width: 100%; max-width: var(--chat-max); margin: 0 auto 6px; }

/* One shared decision surface replaces the chat composer in Studio and Office. */
.decision-composer { flex:none; position:relative; z-index:3; width:100%; padding:0 clamp(18px,4vw,48px); }
.decision-composer.is-reviewing { padding-bottom:18px; }
.decision-composer > div { max-width:var(--chat-max); margin-inline:auto; }
.decision-composer .guided-question-dock,.decision-composer .approval-dock { padding:0; max-height:none; overflow:visible; }
.decision-composer [hidden],.decision-card[hidden],#directorCommandForm[hidden] { display:none !important; }
.decision-card { display:flex; flex-direction:column; width:100%; min-width:0; max-width:var(--chat-max); max-height:min(52dvh,440px); margin:0 auto; padding:0; border:1px solid #755c36; border-radius:17px; background:linear-gradient(135deg,#1c1812,#15120e); color:var(--ink); box-shadow:0 10px 35px #0003; overflow:hidden; }
.decision-main { min-height:0; padding:20px 23px 18px; overflow-y:auto; overscroll-behavior:contain; }
.decision-topline { display:flex; align-items:center; gap:10px; margin-bottom:11px; font-size:11px; }
.decision-type { display:flex; align-items:center; gap:7px; color:var(--gold-bright); font-weight:500; }
.decision-type:before { content:""; flex:none; width:5px; height:5px; border-radius:50%; background:var(--gold); }
.decision-scope { margin-left:auto; color:var(--muted); }
.decision-card h3,.decision-card .decision-title { margin:0 0 6px; font:550 18px/1.4 "Instrument Sans",sans-serif; letter-spacing:-.02em; overflow-wrap:anywhere; }
.decision-card p { font-size:13px; line-height:1.55; }
.decision-card .question-content { padding:0; overflow:visible; }
.decision-footer { display:flex; align-items:center; flex:none; flex-wrap:wrap; gap:9px; padding:13px 18px; border-top:1px solid var(--line); }
.decision-spacer { flex:1; }
.decision-chat { border:0; background:none; color:var(--muted); padding:8px 0; font:inherit; font-size:12px; cursor:pointer; white-space:nowrap; }
.decision-footer .question-button,.decision-footer .text-button { margin:0; white-space:nowrap; font-size:12px; min-height:36px; border-radius:8px; padding:8px 12px; }
.decision-footer .question-button:not(.is-primary),.decision-footer .text-button:not(.primary) { border:1px solid var(--line-strong); background:transparent; }
.decision-footer .question-button.is-primary,.decision-footer .text-button.primary { background:linear-gradient(180deg,#f4cd7e,#e3a94f); border:1px solid #c99649; color:#2a200f; font-weight:650; }
.decision-footer .question-button.review-queue-quiet { border-color:transparent; }
.decision-card button:disabled { opacity:.4; cursor:default; }
.decision-card button:focus-visible,.decision-switcher button:focus-visible,.decision-document-link:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
.decision-card .decision-view-link { margin-top:10px; padding:0; }
.decision-card .question-options { display:grid; gap:5px; margin-top:13px; }
.decision-card .question-option { border-color:transparent; width:100%; background:transparent; }
.decision-card .question-option.is-selected { border-color:#6b522c; background:#2a2215; }
.decision-card .question-custom { margin-top:8px; border-radius:9px; }
.decision-card .written-review-status { padding:0; margin:8px 0 0; font-size:12px; }
.decision-card .open-ask-kind { display:none; }
.decision-card .open-ask-headline { font-size:17px; font-weight:500; margin:0 0 12px; }
.decision-card .approval-copy { margin:0 0 10px; padding:0; }
.decision-card pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; }
.decision-card .question-navigation { padding:9px 0 0; }
.decision-switcher { position:relative; margin:0 2px 10px; color:var(--muted); font-size:12px; }
.decision-switcher summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:4px 2px; list-style:none; cursor:pointer; }
.decision-switcher summary::-webkit-details-marker { display:none; }
.decision-switcher summary>span:last-child { display:flex; gap:6px; align-items:center; color:#d7c29f; font-size:11px; }
.decision-switcher summary svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.4; }
.decision-choices { position:absolute; z-index:10; bottom:calc(100% + 9px); left:0; right:0; padding:8px; max-height:min(44dvh,330px); overflow:auto; background:#211c15; border:1px solid #655031; border-radius:12px; box-shadow:0 10px 40px #0009; }
.decision-choices>p { font-size:10px; margin:4px 10px 7px; }
.decision-choices>button { display:flex; align-items:center; justify-content:space-between; width:100%; gap:14px; text-align:left; padding:10px; border:1px solid transparent; border-radius:7px; background:none; color:var(--ink); font:inherit; cursor:pointer; }
.decision-choices>button:hover { background:#332819; }
.decision-choices>button[aria-current=true] { border-color:#6b522c; background:#30271a; }
.decision-choices strong { display:block; font-size:12px; font-weight:550; }
.decision-choices small { display:block; font-size:11px; color:var(--muted); margin-top:2px; }
.decision-choices>button>span:last-child { font-size:10px; color:#d2b379; }
.decision-reminder { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 4px 10px; color:var(--muted); font-size:12px; }
.decision-reminder button { border:0; background:none; color:var(--gold-bright); font:inherit; padding:2px; cursor:pointer; }
.decision-artifacts { width:100%; max-width:var(--chat-max); margin:18px auto; display:grid; gap:12px; }
.decision-document-link { display:flex; align-items:center; gap:18px; width:100%; text-align:left; border:1px solid var(--line-strong); border-radius:14px; padding:20px 23px; background:transparent; color:var(--ink); cursor:pointer; }
.decision-document-link>svg { width:25px; height:30px; flex:none; fill:none; stroke:#ae8e51; stroke-width:1.25; }
.decision-document-link strong { display:block; font:550 17px/1.4 "Instrument Sans",sans-serif; }
.decision-document-link small { display:block; color:var(--muted); font-size:13px; margin-top:4px; }
.decision-document-link .decision-document-arrow { margin-left:auto; width:23px; height:23px; stroke:var(--muted); }
.decision-document-link:hover { border-color:#ae8e51; background:#e3a94f05; }
.decision-artifacts .written-review-history { border:0; padding:4px; }
.doc-focus-body .review-document-preview { max-width:900px; margin-inline:auto; }
#needsReviewChip { background:transparent; color:var(--muted); box-shadow:none; border-color:var(--line-strong); }
/* Office keeps its paper palette while using the same card, switcher and reminder. */
.po-office .po-decision-composer { padding:12px 14px; z-index:2; }
.po-office .decision-card { max-height:min(58dvh,490px); border-color:var(--po-rule-strong); background:var(--po-paper); color:var(--po-ink); box-shadow:0 6px 20px #39332812; }
.po-office .decision-main { padding:16px; }
.po-office .decision-topline { margin-bottom:10px; }
.po-office .decision-type { color:#90601c; }
.po-office .decision-type:before { background:var(--po-gold); }
.po-office .decision-scope,.po-office .decision-chat,.po-office .decision-reminder { color:var(--po-grey); }
.po-office .decision-card h3 { margin-bottom:10px; font-size:17px; }
.po-office .decision-card p+p { margin-top:9px; }
.po-office .decision-footer { padding:10px 14px; border-color:var(--po-rule); gap:8px; }
.po-office .decision-switcher { color:var(--po-grey); }
/* The chooser occupies the composer while open, so it cannot escape above the Office dialog. */
.po-office .decision-switcher[open] + .decision-card { display:none; }
.po-office .decision-switcher[open] .decision-choices { position:static; margin-top:8px; max-height:max(60px,min(48dvh,420px,calc(92dvh - 245px))); }
.po-office .po-decision-composer { flex:0 1 auto; min-height:0; overflow-y:auto; }

.po-office .decision-switcher summary>span:last-child { color:var(--po-ink-2); }
.po-office .decision-choices { background:var(--po-paper); border-color:var(--po-rule-strong); box-shadow:0 8px 25px #2a251d25; }
.po-office .decision-choices>button { color:var(--po-ink); }
.po-office .decision-choices>button:hover,.po-office .decision-choices>button[aria-current=true] { background:#f2e9d8; border-color:var(--po-rule); }
.po-office .decision-choices small,.po-office .decision-choices>button>span:last-child { color:var(--po-grey); }
.po-office .decision-reminder button { color:#90601c; }
.po-office .decision-document-link { border-color:var(--po-rule); color:var(--po-ink); padding:14px; margin-top:10px; gap:12px; }
.po-office .decision-document-link strong { font-size:14px; }
.po-office .decision-document-link small { color:var(--po-grey); font-size:12px; }
.po-office .po-decision-card .po-sect { border:0; padding:0; margin:0; }
.po-office .po-decision-card .po-fact { grid-template-columns:minmax(0,1fr) auto; align-items:start; }
.po-office .po-decision-card .po-fact>.po-fact-label { grid-column:1; grid-row:1; overflow-wrap:anywhere; }
.po-office .po-decision-card .po-fact>.po-fact-tools { grid-column:2; grid-row:1; }
.po-office .po-decision-card .po-fact>.po-fact-value { grid-column:1/-1; grid-row:2; }
.po-office .po-decision-card .po-fact-tools { flex-wrap:nowrap; }
.po-office .po-decision-card .po-btn { white-space:nowrap; flex-shrink:0; }
.render-attempt-outcome { border-left: 3px solid var(--danger, #e67f70); }
.render-attempt-outcome strong { display: block; color: var(--text, #eee6d8); }
.render-attempt-outcome p { margin: .65rem 0 0; }
.render-preparation-note { margin-top: 1rem; min-width: 0; }
.render-preparation-note > summary { padding: .8rem 0; cursor: pointer; color: var(--muted, #a99f8b); }

/* Office readability: conversation widths and readers are local presentation state. */
.po-office .po-body { grid-template-columns:188px var(--po-chat-width,470px) 8px minmax(440px,1fr); }
.po-office .po-talk { background:#f7f6f0; border-right:0; }
.po-office .po-talk-head { padding:15px 23px 13px; }
.po-office .po-thread { padding:22px 24px 18px; gap:23px; }
.po-office .po-m { grid-template-columns:25px minmax(0,1fr); gap:10px; }
.po-office .po-m .po-av { width:25px; height:25px; font-size:9px; }
.po-office .po-m .po-msg { font-size:14px; line-height:1.75; color:#30362b; overflow-wrap:break-word; }
.po-office .po-m.is-me .po-msg { padding:11px 14px; background:#eceee5; border:1px solid #e0e2d6; border-radius:12px 12px 3px 12px; }
.po-office .po-engine-cap { color:#736644; font-size:10px; line-height:1.6; font-style:normal; letter-spacing:0; text-transform:none; margin-bottom:12px; }
.po-office .po-engine-copy > p+p { margin-top:13px; }
.po-office .po-engine-copy h5 { font-size:16px; line-height:1.4; letter-spacing:0; text-transform:none; margin:17px 0 9px; }
.po-office .po-engine-claim.is-proposing,.po-office .po-engine-claim.is-asserting { color:inherit; font-style:normal; background:none; border:0; padding:0; }
.po-office .po-engine-claim-label { color:#775521; background:#f5ecd8; border:1px solid #d8bc85; font-size:9px; line-height:1.7; font-weight:600; padding:0 5px; margin:0 6px 0 0; letter-spacing:.035em; }
.po-office .po-engine-grounded { margin-top:14px; gap:7px; }
.po-office .po-engine-grounded li { padding:7px 10px; font-size:11px; line-height:1.5; }
.po-office .po-response-excerpt { color:#706f65; font-size:11px; margin-top:14px; }
.po-office .po-response-open { margin-top:8px; background:#fffefa; border-color:#a9b09e; min-height:36px; }
.po-office .po-resize { display:flex; align-items:center; justify-content:center; background:#e6e5dc; cursor:col-resize; touch-action:none; min-height:0; }
.po-office .po-resize span { width:2px; height:38px; border-radius:2px; background:#adb5a0; }
.po-office .po-resize:hover,.po-office .po-resize:focus-visible { background:#d9dece; outline:2px solid #ac7c29; outline-offset:-2px; }
.po-office .po-mobile-docs,.po-office .po-mobile-open { display:none; }
.po-office .po-document-heading { display:flex; gap:12px; align-items:center; justify-content:space-between; color:var(--po-ink-2); font-size:12px; }
.po-office .po-document-heading .po-btn { flex:none; font-size:11px; }
.po-office .po-decision-composer { padding:12px 20px 17px; }
.po-office .decision-card { border:1.5px solid #b17b28; border-radius:15px; background:#fffefa; max-height:min(65dvh,570px); box-shadow:0 5px 18px #57402012; }
.po-office .decision-main { padding:18px 20px; }
.po-office .decision-type { color:#76501a; background:#f8e9c6; padding:5px 9px; border:1px solid #d8b370; border-radius:5px; font-weight:650; }
.po-office .decision-scope { font-size:10px; }
.po-office .decision-card h3 { font-size:19px; margin:0 0 14px; }
.po-office .decision-footer { background:#fffefa; padding:13px 16px; border-top:1px solid #d8cfbd; }
.po-office .decision-footer .is-gold { min-height:41px; border-color:#ab761e; font-weight:650; }
.po-office .decision-reminder { font-size:12px; margin:0 2px 11px; }
.po-office .decision-reminder button { color:#2c200b; background:#d29a35; border:1px solid #ad781d; border-radius:7px; padding:8px 13px; font-weight:650; min-height:36px; }
.po-office .decision-reminder button:hover { background:#e0aa48; }
.po-office .decision-document-link { border-color:#afa98e; background:#faf9f3; border-radius:10px; }
.po-office .decision-document-link:hover { background:#f4eddb; border-color:#a07831; }
.po-office .po-talk .po-pv { font-style:normal; color:var(--po-ink-2); border-bottom:0; background:none; }
.po-office .po-talk .po-fact-label small { overflow-wrap:anywhere; line-height:1.4; }
.po-office .po-bundle-note { font-style:normal; color:#76613c; line-height:1.6; margin-top:12px; }
.po-office .po-review-days { margin:0; padding:0; list-style:none; }
.po-office .po-review-day { display:grid; grid-template-columns:42px minmax(0,1fr) 54px; align-items:start; gap:9px; padding:12px 0; border-top:1px solid #dedfd3; font-size:11px; line-height:1.45; }
.po-office .po-review-day strong { display:block; font-size:11px; font-weight:550; }
.po-office .po-review-day small { display:block; font-size:10px; color:#6b735f; margin-top:5px; line-height:1.45; }
.po-office .po-review-day-time { text-align:right; white-space:nowrap; }
.po-office .po-view-days { width:100%; justify-content:space-between; border-color:#afb49f; background:#f4f6ec; margin-top:4px; padding:10px 12px; }
.po-office .po-talk .po-bundle { max-height:none; overflow:visible; }
.po-office .po-talk .po-bundle.is-open { max-height:300px; overflow:auto; }
.po-office .po-talk .po-more { border:1px solid #aaa99b; border-radius:7px; background:#fffefa; padding:8px 12px; margin:9px 0; color:#3d4433; font-weight:550; width:100%; text-align:center; }
.po-office .po-body.is-narrow { grid-template-columns:minmax(0,1fr); }
.po-office .po-body.is-narrow .po-spine,.po-office .po-body.is-narrow .po-resize,.po-office .po-body.is-narrow:not(.is-document-reading) .po-desk { display:none; }
.po-office .po-body.is-narrow .po-talk-head { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px 12px; }
.po-office .po-body.is-narrow .po-talk-head .po-sub { grid-column:1; }
.po-office .po-body.is-narrow .po-mobile-docs { display:block; grid-column:1; font-size:10px; color:#747468; margin-top:5px; }
.po-office .po-body.is-narrow .po-mobile-docs select { margin-left:8px; max-width:230px; font:inherit; font-size:12px; color:#343b2b; background:#fffefa; padding:6px; border:1px solid #bfc3b3; border-radius:6px; }
.po-office .po-body.is-narrow .po-mobile-open { display:inline-flex; grid-column:2; grid-row:1/4; align-self:center; font-size:11px; }
.po-office .po-body.is-narrow .po-talk { min-height:0; }
.po-office .po-body.is-document-reading .po-desk,.po-office .po-response-reader { position:absolute; inset:52px 0 0; z-index:6; background:#eeeee5; padding:20px 30px 35px; }
.po-office .po-body.is-document-reading .po-desk { display:grid; min-width:0; border-top:1px solid #d2d4c6; }
.po-office .po-body.is-document-reading .po-document-heading { position:sticky; top:-20px; z-index:5; background:#eeeee5; padding:12px 0; border-bottom:1px solid #d2d4c6; font-size:16px; }
/* Documents retain their authored page width. The reader scrolls rather than compressing columns. */
.po-office .po-desk .po-paper > .po-sheet { min-width:760px; }
.po-office .po-body.is-document-reading .po-paper { max-width:1180px; justify-self:center; }
.po-office .po-response-reader { display:flex; flex-direction:column; padding:0; }
.po-office .po-response-reader>header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 28px; border-bottom:1px solid #d2d4c6; }
.po-office .po-response-reader>header small { font-size:11px; color:#727766; }
.po-office .po-response-reader>header h3 { font-size:19px; }
.po-office .po-response-reader-content { overflow:auto; min-height:0; flex:1; padding:28px; }
.po-office .po-response-reader-content>.po-m { display:block; max-width:820px; margin:auto; background:#fffefa; border:1px solid #d8ddce; padding:32px 40px; }
.po-office .po-response-reader-content .po-av { display:none; }
.po-office .po-response-reader-content .po-msg { font-size:16px; line-height:1.8; }
.po-office .po-response-reader button:focus-visible,.po-office .po-document-heading button:focus-visible { outline:3px solid #b78329; outline-offset:2px; }
@media(max-height:850px) { .po-office .po-talk:has(.po-decision-card) .po-thread { flex:1 1 90px; min-height:0; } .po-office .po-talk:has(.po-decision-card) .po-decision-composer { flex:1 1 570px; display:flex; flex-direction:column; overflow:hidden; } .po-office .po-decision-card { flex:1; min-height:0; max-height:none; } .po-office .po-decision-card .decision-main { flex:1; min-height:0; overflow:auto; } .po-office .po-decision-card .decision-footer { flex:none; } }
@media(max-width:600px) { .po-office .po-talk-head { padding:12px 15px; } .po-office .po-body.is-narrow .po-mobile-docs select { max-width:160px; } .po-office .po-body.is-narrow .po-mobile-open { grid-column:2; max-width:110px; white-space:normal; } .po-office .po-thread { padding:18px; } .po-office .po-decision-composer { padding:10px 14px; } .po-office .decision-main { padding:15px; } .po-office .decision-footer { padding:11px 13px; } .po-office .po-review-day { grid-template-columns:39px minmax(0,1fr) 50px; gap:7px; } .po-office .po-body.is-document-reading .po-desk { padding:12px 14px 25px; } .po-office .po-body.is-document-reading .po-document-heading { top:-12px; font-size:13px; } .po-office .po-response-reader>header { padding:14px; } .po-office .po-response-reader-content { padding:14px; } .po-office .po-response-reader-content>.po-m { padding:22px; } .po-office .po-response-reader-content .po-msg { font-size:14px; } }
/* During review the decision owns the composer space; no clipped sliver of chat competes with it. */
.po-office .po-talk:has(.po-decision-card) .po-thread { display:none; }
.po-office .po-talk:has(.po-decision-card) .po-decision-composer { flex:1; display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.po-office .po-talk .po-decision-card { flex:1; min-height:0; max-height:none; }
.po-office .po-talk .po-decision-card .decision-main { flex:1; min-height:0; overflow:auto; }
.po-office .po-talk .po-decision-card .decision-footer { flex:none; }
/* A grid child's intrinsic paper width must not widen the entire room on phones. */
.po-office { grid-template-columns:minmax(0,1fr); }
.po-office .po-body,.po-office .po-topbar { min-width:0; }
@media(max-width:600px) { .po-office .po-project { display:none; } .po-office .po-meta { min-width:0; white-space:normal; font-size:10px; line-height:1.35; } .po-office .po-topbar { gap:9px; padding-inline:12px; } }

/* Four open corners indicate same-window document expansion. */
.po-office .po-expand-icon { width:17px; height:17px; flex:none; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }

/* The full response is a saved reading surface; decisions stay in the Office composer. */
.po-office .po-response-reader>header { padding:22px 36px; gap:24px; }
.po-office .po-response-reader>header h3 { margin:0; font-size:20px; line-height:1.3; letter-spacing:-.035em; font-weight:650; }
.po-office .po-response-reader>header small { display:block; margin-top:7px; color:#747b69; font-size:12px; }
.po-office .po-response-reader-content { padding:32px 36px 54px; scrollbar-color:#b6beaa transparent; }
.po-office .po-response-page { max-width:1080px; margin:0 auto; padding:36px 48px 32px; color:#282b25; background:#fffefa; border:1px solid #d8ddce; border-radius:3px; box-shadow:0 2px 4px #42473504; }
.po-office .po-response-top { display:flex; justify-content:space-between; align-items:center; gap:20px; padding-bottom:28px; border-bottom:1px solid #d8ddce; }
.po-office .po-response-top h3 { margin:0; font-size:29px; line-height:1.25; letter-spacing:-.04em; font-weight:650; }
.po-office .po-response-original-toggle { flex:none; padding:7px 10px; background:transparent; border:1px solid #d3d9c8; border-radius:5px; color:#647057; white-space:nowrap; font:inherit; font-size:12px; cursor:pointer; }
.po-office .po-response-original-toggle:hover { border-color:#969f89; background:#f5f6ef; }
.po-office .po-response-body { font-size:16px; line-height:1.72; color:#4c5346; overflow-wrap:anywhere; }
.po-office .po-response-prose { max-width:74ch; padding-top:25px; }
.po-office .po-response-prose p { margin:0; }
.po-office .po-response-prose p+p { margin-top:18px; }
.po-office .po-response-section { display:grid; grid-template-columns:152px minmax(0,1fr); gap:26px; padding:29px 0; border-bottom:1px solid #d8ddce; }
.po-office .po-response-section:last-child { border-bottom:0; padding-bottom:10px; }
.po-office .po-response-section>h4 { margin:3px 0 0; font-size:15px; line-height:1.4; color:#556348; font-weight:650; }
.po-office .po-response-section-content { color:#4c5346; }
.po-office .po-response-section-content p { margin:0; }
.po-office .po-response-section-content p+p { margin-top:15px; }
.po-office .po-response-section-content ul,.po-office .po-response-section-content ol { margin:0; padding-left:22px; }
.po-office .po-response-section-content li+li { margin-top:12px; }
.po-office .po-response-section-content ol { list-style-type:decimal-leading-zero; }
.po-office .po-response-section-content ol li { padding-left:6px; }
.po-office .po-response-section-content ol li::marker { color:#7e876f; font-size:12px; font-weight:600; }
.po-office .po-response-section.is-notes>h4 { color:#9a6a22; }
.po-office .po-response-section.is-notes>.po-response-section-content { border-left:3px solid #c49546; padding-left:20px; }
.po-office .po-response-body strong { color:#282b25; font-weight:650; }
.po-office .po-response-original { margin-top:25px; white-space:pre-wrap; font-size:16px; line-height:1.82; }
.po-office .po-response-provenance { margin:18px 0 0; font-size:12px; color:#747b69; }
.po-office .po-response-records { margin-top:24px; padding-top:20px; border-top:1px solid #d8ddce; }
.po-office .po-response-records h4 { margin:0 0 10px; font-size:13px; color:#556348; }
.po-office .po-response-foot { border-top:1px solid #d8ddce; padding-top:22px; margin-top:19px; font-size:12px; line-height:1.6; color:#747b69; }
@media(min-width:1650px) {
  .po-office .po-response-reader-content { padding-top:42px; }
  .po-office .po-response-page { padding:42px 54px; }
  .po-office .po-response-body { font-size:17px; }
}
@media(max-width:900px) {
  .po-office .po-response-reader>header { padding:20px 24px; }
  .po-office .po-response-reader-content { padding:24px; }
  .po-office .po-response-page { padding:28px; }
  .po-office .po-response-section { grid-template-columns:115px minmax(0,1fr); gap:22px; }
  .po-office .po-response-top h3 { font-size:26px; }
}
@media(max-width:640px) {
  .po-office .po-response-reader>header { padding:16px; align-items:flex-start; gap:10px; }
  .po-office .po-response-reader>header h3 { font-size:17px; }
  .po-office .po-response-reader>header small { font-size:11px; line-height:1.5; }
  .po-office .po-response-reader>header .po-btn { padding:8px 10px; min-height:38px; font-size:12px; }
  .po-office .po-response-reader-content { padding:12px 12px 28px; }
  .po-office .po-response-page { padding:22px 18px; }
  .po-office .po-response-top { align-items:flex-start; gap:15px; flex-wrap:wrap; padding-bottom:22px; }
  .po-office .po-response-top h3 { font-size:24px; }
  .po-office .po-response-original-toggle { font-size:11px; }
  .po-office .po-response-body,.po-office .po-response-original { font-size:15px; line-height:1.72; }
  .po-office .po-response-section { display:block; padding:24px 0; }
  .po-office .po-response-section>h4 { margin:0 0 14px; }
  .po-office .po-response-section.is-notes>.po-response-section-content { padding-left:15px; }
}
.po-office .po-cs-route-title { font-weight: 700; margin: 8px 0; }
/* Keep source links legible in Office and in the call-sheet print rule subset. */
.po-office [data-po-research-credits] a, .po-office .po-cs-loc [data-po-research-credits] a { color: var(--po-ink, #1a1917); text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 3px; }
.po-office [data-po-research-credits] a:focus-visible, .po-office .po-cs-loc [data-po-research-credits] a:focus-visible { outline: 2px solid #98611d; outline-offset: 2px; }
.po-office .po-fact.is-weather { grid-template-columns:minmax(0,1fr) auto; }
.po-office .po-fact.is-weather .po-fact-label, .po-office .po-fact.is-weather .po-fact-detail { grid-column:1 / -1; }
.po-office .po-weather-summary { display:grid; gap:7px; }
.po-office .po-weather-summary > span { display:grid; grid-template-columns:110px minmax(0,1fr); gap:12px; align-items:baseline; }
.po-office .po-weather-summary small { color:var(--po-ink-2); font-size:11px; }
.po-office .po-weather-summary strong { color:var(--po-ink); font-weight:600; }
.po-office .po-research-detail { font-size:11px; line-height:1.5; color:var(--po-ink-2); margin-top:8px; }
.po-office .po-research-detail summary { cursor:pointer; }
@media print { .po-office .po-sheet[data-po-research-paper-blocked] { display:none !important; } }
.po-office .po-cs-stop { border: 1px solid #c8c5b9; padding: 12px; margin: 10px 0; break-inside: avoid; }
.po-office .po-cs-stop h4 { font-size: 12px; margin: 0 0 6px; }
.po-office .po-cs-stop p { margin: 6px 0; }
.po-office .po-cs-stop-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
.po-office .po-cs-stop-fields > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; overflow-wrap: anywhere; }
.po-office .po-cs-route-note, .po-office .po-cs-strip-time { font-size: 10px; }
.po-office .po-cs-route-error { color: #85341d; font-weight: 600; }
/* held, carried and re-cut lines can hold one long unbroken value (a maps link, a single-word site): wrap it on the paper */
.po-office .po-cs-stop-held, .po-office .po-cs-stop-carried, .po-office .po-cs-recut p { overflow-wrap: anywhere; }
.po-office .po-cs-stop-entry { margin: 10px 0; }
.po-office .po-cs-stop-entry summary, .po-office .po-cs-stop-entry button { display: inline-block; border: 1px solid #b89a5e; border-radius: 6px; background: #f5edda; padding: 9px 12px; cursor: pointer; font: inherit; }
.po-office .po-cs-stop-entry form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.po-office .po-cs-stop-entry form p { grid-column: 1 / -1; }
.po-office .po-cs-stop-entry label { display: grid; gap: 4px; }
.po-office .po-cs-stop-entry input { width: 100%; min-width: 0; box-sizing: border-box; padding: 8px; background: #fffefa; border: 1px solid #aaa99d; border-radius: 4px; color: #272b23; font: inherit; }
.po-office .po-cs-stop-entry input[readonly] { background: #e9e7df; }
.po-office .po-cs-cover-entry { margin: 10px 13px; }
.po-office .po-cs-cover-entry select { width: 100%; min-width: 0; box-sizing: border-box; padding: 8px; background: #fffefa; border: 1px solid #aaa99d; border-radius: 4px; color: #272b23; font: inherit; }
.po-office .po-cs-cover-entry .po-cs-cover-ready { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 18px; }
.po-office .po-cs-cover-entry .po-cs-cover-ready label { display: flex; align-items: flex-start; gap: 8px; }
.po-office .po-cs-cover-entry .po-cs-cover-ready input { flex: 0 0 auto; width: 15px; height: 15px; min-width: 15px; padding: 0; border: 0; background: none; margin: 3px 0 0; }
.po-office .po-cs-cover-entry .po-cs-cover-ready small { display: block; margin-top: 2px; color: var(--po-grey); font-size: 11px; line-height: 1.35; }
.po-office button.po-cs-cover-go { display: inline-block; margin: 0 13px 10px; border: 1px solid #b89a5e; border-radius: 6px; background: #f5edda; padding: 9px 12px; cursor: pointer; font: inherit; }
.po-office .po-daysum button.po-cs-cover-go { margin: 0 0 0 6px; padding: 2px 8px; border-radius: 4px; }
.po-office .po-cs-stop-entry :focus-visible { outline: 2px solid #98611d; outline-offset: 2px; }
@media print {
  .po-office .po-cs-stop-entry { display: none !important; }
  .po-office .po-cs-stop h4 { font-size: 10pt !important; }
  .po-office .po-cs-stop-fields, .po-office .po-cs-route-note, .po-office .po-cs-strip-time { font-size: 8pt !important; }
}
/* the DOOD desk's Deals card (gap 4): office only, below the DOOD, never printed and never in a book */
.po-office .po-deals-card { margin: 14px 0 6px; padding: 12px 14px; border: 1px solid #d8cfb8; border-radius: 6px; background: #fffdf6; color: #272b23; }
.po-office .po-deals-card h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: .02em; }
.po-office .po-deals-rows, .po-office .po-deals-q { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.po-office .po-deals-rows > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; overflow-wrap: anywhere; }
.po-office .po-deal-line { flex: 1 1 320px; min-width: 0; }
.po-office .po-deals-card button { border: 1px solid #b89a5e; border-radius: 6px; background: #f5edda; padding: 4px 10px; cursor: pointer; font: inherit; }
.po-office .po-deal-form { flex: 1 1 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 4px 0 8px; }
.po-office .po-deal-form label { display: grid; gap: 4px; }
.po-office .po-deal-form input, .po-office .po-deal-form select { width: 100%; min-width: 0; box-sizing: border-box; padding: 7px; background: #fffefa; border: 1px solid #aaa99d; border-radius: 4px; color: #272b23; font: inherit; }
.po-office .po-deal-form .po-deal-terms, .po-office .po-deal-form .po-deal-actions { grid-column: 1 / -1; margin: 0; }
.po-office .po-deals-q-head { margin: 12px 0 6px; font-weight: 600; }
.po-office .po-deals-rule { margin: 10px 0 0; color: #5a5446; }
.po-office .po-deals-card :focus-visible { outline: 2px solid #98611d; outline-offset: 2px; }
@media print { .po-office .po-deals-card { display: none !important; } }
@media (max-width: 640px) { .po-office .po-deal-form { grid-template-columns: minmax(0, 1fr); } }

.po-office .po-response-reader-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
@media (max-width: 640px) {
  .po-office .po-response-reader > header { flex-wrap: wrap; }
  .po-office .po-response-reader-actions { width: 100%; justify-content: flex-start; }
}

/* Auto rail: the exact approved candidate wears its saved status on the frame (owner report 2026-09-13) */
.latest-preview .preview-frame-status {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid rgba(164, 207, 114, 0.45);
  background: rgba(6, 5, 4, 0.82);
  color: var(--ok);
  pointer-events: none;
}

.latest-preview .preview-frame-status.is-rejected {
  color: #ffc46b;
  border-color: rgba(255, 196, 107, 0.45);
}

/* A decided frame packet's header chip shares the amber of the pending-review chip */
.mini-status.revision_requested {
  color: #ffc46b;
  border-color: rgba(255, 196, 107, 0.45);
  background: rgba(255, 196, 107, 0.1);
}

/* The paperwork cue names its destination. The cue title keeps most of the row; a long action label
   wraps inside its button instead of squeezing the title, and short "Go" cues never move
   (review findings 2026-09-14) */
.director-cue .cue-text {
  min-width: 50%;
}

.director-cue > .text-button {
  flex: 0 1 auto;
  min-width: 0;
  padding-inline: 8px;
  white-space: normal;
  line-height: 1.3;
  text-align: center;
}

/* The quiet secondary exit (leaving paperwork mode) sits under the cue's detail line, or on the
   decision composer's reminder line while pending decisions hide the cue */
.cue-secondary {
  align-self: flex-start;
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cue-secondary:hover {
  color: var(--gold-bright);
}

/* A historical review chip carries its saved verdict; the message text stays history */
.project-file-link .link-saved-status {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(164, 207, 114, 0.4);
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.project-file-link .link-saved-status.is-rejected {
  border-color: rgba(255, 196, 107, 0.45);
  background: rgba(255, 196, 107, 0.1);
  color: #ffc46b;
}
/* GAP4 PR D: the rate lines on the Deals card (never printed: the card is hidden in print) and the form's Rate row */
.po-office .po-deal-rate { flex: 1 1 100%; margin: 0; color: #3d3a30; }
.po-office .po-deal-rate.is-pencil { color: #8a5a14; font-style: italic; }
.po-office .po-deals-rate-foot { margin: 8px 0 0; color: #5a5446; font-size: 12px; }
.po-office .po-deal-form .po-deal-rate-f { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.po-office .po-deal-hint { color: #5a5446; font-size: 12px; }
@media (max-width: 640px) { .po-office .po-deal-form .po-deal-rate-f { grid-template-columns: minmax(0, 1fr); } }
