/* The video work page (#/desk/<desk>/<video>). Phone: the title, the video and the three buttons fit the first
   screen. Wide screen: the lane's cards | the player | the buttons and the thread, each scrolling on its own. */

/* --stage-h caps the player so the buttons under it stay on the first screen (top bar, bottom bar, and what sits
   around the player: the back row, a two-line title, the draft row and the buttons). */
main.vw { padding-top: var(--s2); }
.vwork { --around: 278px; --stage-h: max(200px, calc(100dvh - var(--top-h) - var(--bar-h) - var(--around))); }
.banner:not([hidden]) ~ main .vwork { --around: 342px; } /* the "viewing as" line takes room too */

/* ---- the top row: back to the desk, pin, previous / next ---- */
.vw-nav { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); }
.vw-nav .back { min-width: 0; }
.vw-nav .back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-step { display: flex; align-items: center; flex: none; margin-left: auto; }
.vw-step [data-count] { min-width: 3.4em; text-align: center; white-space: nowrap; }
.vw-step [data-count]:empty { min-width: 0; }
.vw-step a[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.vw-step [aria-pressed="true"] { color: var(--brass-ink); background: var(--brass-soft); }
.vw-step [aria-pressed="true"] .i { fill: currentColor; }
.vwork > .asleep { align-items: center; margin: var(--s1) 0 var(--s3); padding: 10px var(--s4); font-size: var(--t-small); }
.vwork > .asleep .i { margin-top: 0; }
.vwork > .asleep b { display: inline; font: 700 var(--t-small)/1.4 var(--sans); letter-spacing: 0; }
.vwork > .card.empty { margin-top: var(--s4); }

/* ---- title, pill, who has it ---- */
.vw-body { display: grid; gap: var(--s3); }
.vw-head { min-width: 0; }
.vw-head h1 {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  font-size: 1.375rem; line-height: 1.2; overflow-wrap: anywhere;
}
.vw-meta { display: flex; align-items: center; gap: var(--s2); min-height: 24px; margin-top: 6px; }
.vw-meta .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- the player and the draft row ---- */
.vw-stage { display: grid; gap: var(--s2); min-width: 0; }
.vw-stage .player video { max-height: var(--stage-h); }
.vw-stage.wide .player video { aspect-ratio: 16 / 9; }
.vw-nodraft {
  display: grid; place-content: center; justify-items: center; gap: 4px; min-height: var(--stage-h); padding: var(--s5);
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--muted); text-align: center;
}
.vw-stage.over .vw-nodraft { min-height: 148px; }
.vw-nodraft .i { width: 28px; height: 28px; margin-bottom: var(--s2); color: var(--line-strong); }
.vw-nodraft h3 { color: var(--ink); }
.vw-nodraft p { font-size: var(--t-small); }
.vw-drafts { display: flex; align-items: center; justify-content: center; gap: var(--s2); }
.vw-drafts[hidden] { display: none; }
.vw-drafts select { width: auto; min-width: 190px; min-height: 38px; padding: 0 12px; }
.ap-drafts {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s4)); padding: 2px var(--s4);
}
.ap-drafts::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--muted); font-size: var(--t-small); white-space: nowrap;
}
.chip b { color: var(--ink); font-weight: 700; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #D9CFB8; }
.chip[aria-pressed="true"] b { color: var(--bg); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); }
@media (pointer: coarse) { .chip { min-height: var(--tap); } }

/* ---- the buttons ---- */
.vw-side { display: grid; gap: var(--s3); align-content: start; min-width: 0; }
.vw-acts { display: flex; gap: var(--s2); }
.vw-acts .btn { flex: 1 1 auto; min-width: 0; padding: 0 10px; font-size: .9375rem; }
.vw-acts .btn:first-child { flex-grow: 1.6; }
.vw-acts .btn + .btn .i { display: none; }
.btn.kill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.kill:hover { background: #87301F; }
.vw-line { padding: 10px 14px; border-radius: var(--r-md); background: var(--brass-soft); font-size: var(--t-small); font-weight: 500; }
.vw-take { justify-self: start; align-self: flex-start; }
.vw-status { display: grid; gap: 6px; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--paper);
  border: 1px solid var(--line); }
.vw-status .row { min-height: 32px; }
.vw-status b { font-size: .9375rem; font-weight: 600; overflow-wrap: anywhere; }

/* ---- what the card is waiting on: a note that came with it, a problem, a question ---- */
.vw-ask { display: grid; gap: var(--s3); }
.vw-from, .vw-q, .vw-err { padding: var(--s3) var(--s4); border-radius: var(--r-md); overflow-wrap: anywhere; }
.vw-from { background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--brass); }
.vw-from p + p { margin-top: 4px; }
.vw-err { display: flex; align-items: center; gap: var(--s3); background: var(--bad-soft); color: var(--bad); font-weight: 500; }
.vw-err .btn { flex: none; margin-left: auto; border-color: var(--bad); background: transparent; color: var(--bad); }
.vw-q { display: grid; gap: var(--s3); background: var(--brass-soft); border: 1px solid var(--brass); }
.vw-q h3 { margin-top: -6px; font-size: 1.125rem; }
.opts { display: grid; gap: var(--s2); }
.opts .opt { display: flex; align-items: center; gap: 6px; }
.opts .opt .btn {
  flex: 1; justify-content: flex-start; min-width: 0; padding: 8px 16px; border-radius: var(--r-md); background: var(--paper);
  white-space: normal; text-align: left;
}
.opts .opt .btn small {
  margin-left: auto; padding-left: var(--s2); font: 700 .6875rem/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  color: var(--brass-ink); white-space: nowrap;
}
.opts .opt .btn[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opts .opt .iconbtn { flex: none; background: var(--paper); border: 1px solid var(--line-strong); color: var(--ink); }
.vw-free { display: flex; gap: var(--s2); }
.vw-free .input { flex: 1; min-width: 0; }

/* ---- the thread: Claude | People ---- */
.vw-talk { display: grid; gap: var(--s3); min-width: 0; }
.seg { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; padding: 3px; border-radius: var(--r-pill); background: var(--line); }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border-radius: var(--r-pill);
  color: #5F5644; font-size: var(--t-small); font-weight: 600;
}
.seg button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(29, 26, 19, .16); }
.seg b {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brass-ink); color: #fff;
  font-size: .6875rem; line-height: 18px;
}
@media (pointer: coarse) { .seg button { min-height: var(--tap); } }
.vw-pane { display: grid; gap: var(--s3); min-width: 0; }
.chat {
  display: flex; flex-direction: column; gap: 6px; max-height: 46dvh; overflow-y: auto; padding: var(--s3);
  border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line);
}
.chat-none { margin: auto; padding: var(--s4) var(--s2); color: var(--muted); font-size: var(--t-small); text-align: center; }
.turn { display: grid; align-self: flex-start; justify-items: start; gap: 2px; max-width: 88%; }
.turn.me { align-self: flex-end; justify-items: end; }
.t-text {
  padding: 8px 12px; border-radius: 14px; background: var(--bg); font-size: .9375rem; line-height: 1.45; white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.turn.claude .t-text, .turn.them .t-text { border-top-left-radius: 4px; }
.turn.me .t-text { border-top-right-radius: 4px; background: var(--brass-soft); }
.t-text.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.t-text code { padding: 1px 4px; border-radius: 4px; background: rgba(29, 26, 19, .07); font-size: .875em; }
.t-label { margin-top: 4px; font: 700 .6875rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.t-time { margin-bottom: 4px; font-size: .75rem; color: var(--muted); }
.t-more { min-height: 32px; color: var(--brass-ink); font-size: var(--t-small); font-weight: 600; text-decoration: underline; }
.composer { display: grid; gap: var(--s2); }
.composer.side { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.composer textarea { min-height: 64px; resize: vertical; }
.composer .row { min-height: var(--tap); gap: var(--s2); }
.composer [data-msg] { grid-column: 1 / -1; color: var(--brass-ink); font-weight: 600; }
.composer [data-msg]:empty { display: none; }
.composer .btn { flex: none; padding: 0 16px; }
.stamp { min-height: var(--tap); color: var(--brass-ink); font-size: var(--t-small); font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px; }
.stamp[disabled] { opacity: .5; }
.vw-details summary {
  display: inline-flex; align-items: center; min-height: var(--tap); color: var(--muted); font-size: var(--t-small);
  font-weight: 600; cursor: pointer;
}
.vw-brain { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-bottom: var(--s3); }
.vw-log {
  max-height: 240px; margin: 0; padding: var(--s3); overflow: auto; border-radius: var(--r-md); background: #14110B; color: #E9E1CF;
  font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---- the PC is asleep: the player and the buttons go grey; what was typed stays ---- */
.vwork.pc-off .vw-stage, .vwork.pc-off .vw-status, .vwork.pc-off .vw-ask {
  opacity: .5; filter: grayscale(1); pointer-events: none;
}
.vwork.pc-off .vw-acts, .vwork.pc-off .vw-take { filter: grayscale(1); }

/* ---- panels ---- */
.sheet-sub { margin: calc(-1 * var(--s1)) 0 var(--s4); }
.sheet .field textarea { min-height: 84px; }
.sheet.approve h2 { margin-bottom: var(--s3); overflow-wrap: anywhere; }
.ap-drafts { margin-bottom: var(--s3); }
.ap-cover { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.ap-big { position: relative; display: grid; place-items: center; aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--r-md);
  background: #14110B; color: #B9AE96; font-size: var(--t-small); text-align: center; }
.ap-big img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ap-side { display: grid; gap: 6px; min-width: 0; }
.ap-lbl { font-size: var(--t-small); font-weight: 700; }
.ap-lbl span { margin-left: 4px; color: var(--muted); font-weight: 400; }
.ap-strip { display: flex; gap: 6px; overflow-x: auto; padding: 3px; margin: -3px; scrollbar-width: thin; }
.ap-strip button {
  position: relative; flex: none; width: 44px; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 6px; background: #14110B;
}
.ap-strip img { width: 100%; height: 100%; object-fit: cover; }
.ap-strip button[aria-pressed="true"] { outline: 3px solid var(--green); outline-offset: 1px; }
.ap-strip b {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 2px 0; background: var(--green); color: #fff;
  font-size: .625rem; font-weight: 700; text-align: center;
}
.ap-side input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--green); }
.ap-more { margin-top: var(--s3); }
.ap-more summary {
  display: inline-flex; align-items: center; min-height: var(--tap); color: var(--muted); font-size: var(--t-small);
  font-weight: 600; cursor: pointer;
}
.ap-opts { display: grid; gap: 2px; }
.check { display: flex; align-items: flex-start; gap: var(--s3); min-height: var(--tap); padding: 8px 0; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); }
.check b { display: block; font-weight: 600; }
.check small { display: block; color: var(--muted); font-size: var(--t-small); }
.ap-msg { margin-top: var(--s3); color: var(--bad); font-size: var(--t-small); font-weight: 500; }
.sheet.approve .actions { margin-top: var(--s4); }
.sheet.approve .actions .btn.green { flex: 1.6; }

@media (min-width: 700px) {
  .ap-cover { grid-template-columns: 150px minmax(0, 1fr); }
  .ap-strip button { width: 52px; }
}

/* ---- wide screens: three columns that fill the window ---- */
@media (min-width: 900px) {
  main.vw { padding-top: var(--s4); padding-bottom: var(--s4); }
  .vwork { --body-h: max(540px, calc(100dvh - var(--top-h) - 108px)); --stage-h: calc(var(--body-h) - 54px); }
  .vw-body {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "stage head" "stage side"; gap: var(--s3) var(--s5); height: var(--body-h); margin-top: var(--s2);
  }
  .vw-head { grid-area: head; }
  .vw-head h1 { font-size: 1.625rem; }
  .vw-stage { grid-area: stage; align-content: start; }
  .vw-stage .player video { width: auto; max-width: 100%; }
  .vw-stage.wide .player video { width: 100%; }
  .vw-side { grid-area: side; display: flex; flex-direction: column; min-height: 0; }
  .vw-side > * { flex: none; }
  .vw-acts .btn + .btn .i { display: block; }
  .vw-ask { max-height: 40%; overflow: auto; }
  .vw-side > .vw-talk { display: flex; flex: 1; flex-direction: column; min-height: 0; }
  .vw-talk > * { flex: none; }
  .vw-talk > .vw-pane:not([hidden]) { display: flex; flex: 1; flex-direction: column; min-height: 0; }
  .vw-pane > * { flex: none; }
  .vw-pane > .chat { flex: 1; min-height: 96px; max-height: none; }
  .vw-log { max-height: 160px; }
}

/* ---- big screens (Devin 2026-11-18): the whole width. Left = the title and the buttons, middle = the video, big and
   dead centre at one fixed size (it never jumps when it starts playing), right = the chat and its text box. ---- */
@media (min-width: 1280px) {
  main.wide.vw { max-width: 2400px; }
  .vw-body {
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr) minmax(380px, 520px);
    grid-template-rows: repeat(11, auto) minmax(0, 1fr); grid-template-areas: none; gap: var(--s3) var(--s6);
  }
  .vw-side { display: contents; }
  .vw-head, .vw-side > * { grid-area: auto; grid-column: 1; min-width: 0; }
  .vw-side > .vw-acts { flex-wrap: wrap; }
  .vw-side > .vw-acts .btn { flex: 1 1 100%; min-height: 52px; font-size: 1rem; }
  .vw-side > .vw-ask { max-height: none; overflow: auto; }
  .vw-stage { grid-area: auto; grid-column: 2; grid-row: 1 / -1; justify-items: center; align-content: start; }
  .vw-stage .player { width: auto; max-width: 100%; }
  .vw-stage .player video { height: var(--stage-h); max-height: none; width: auto; max-width: 100%; }
  .vw-stage.wide .player { width: 100%; }
  .vw-stage.wide .player video { width: 100%; height: auto; max-height: var(--stage-h); }
  .vw-side > .vw-talk { grid-column: 3; grid-row: 1 / -1; display: flex; flex-direction: column; min-height: 0; }
}
.vw-brain { margin-bottom: 0; }

/* The video page is a dark room whatever the look switch says: see dark.css. */

/* ---- the B-roll section (Devin 2026-11-19): under the video, reached by scrolling. One tile per shot laid over the
   talking: a small still of that moment, its time, Keep and Swap. Nothing here is pinned; it scrolls with the page. ---- */
.vw-broll { display: grid; gap: var(--s4); margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); }
.vw-broll[hidden] { display: none; }
.br-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.br-head h2 { font-size: var(--t-h2); }
.br-none { padding: var(--s4); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s4); }
.br-grid:empty { display: none; }
.br-tile {
  display: grid; gap: var(--s2); align-content: start; min-width: 0; padding: var(--s2); border: 2px solid var(--line);
  border-radius: var(--r-lg); background: var(--paper);
}
.br-tile.keep { border-color: #3F9272; }
.br-tile.swap { border-color: #D4654F; }
.br-pic {
  position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; padding: 0; border: 0; border-radius: var(--r-md);
  overflow: hidden; background: #000; cursor: pointer;
}
.vw-broll.wide .br-pic { aspect-ratio: 16 / 9; }
.br-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.br-pic:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.br-at, .br-kind {
  position: absolute; bottom: 6px; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .72); color: #fff;
  font: 600 var(--t-small)/1.4 var(--sans);
}
.br-at { left: 6px; }
.br-kind { right: 6px; font-weight: 500; }
.br-btns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.br-btns .btn {
  min-width: 0; min-height: var(--tap); padding: 0 6px; border-color: var(--line-strong); background: transparent; font-weight: 600;
}
.br-btns .br-keep[aria-pressed="true"] { border-color: #3F9272; background: #2F7358; color: #fff; }
.br-btns .br-swap[aria-pressed="true"] { border-color: #D4654F; background: #B94F3B; color: #fff; }
.br-note { min-height: 40px; padding: 0 10px; font-size: var(--t-small); }
.br-note[hidden], .br-sent[hidden] { display: none; }
.br-sent { color: var(--muted); }
.br-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3) var(--s4); padding-bottom: var(--s5); }
.br-foot[hidden] { display: none; }
.vwork.pc-off .vw-broll { opacity: .55; }

@media (min-width: 700px) {
  .br-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}
@media (min-width: 1280px) {
  .br-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 230px)); }
  .vw-broll.wide .br-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 340px)); }
}
/* A pressed Keep / Swap keeps its colour under the mouse too (the dark look's own hover rule is a strong one). */
.vw-broll .br-btns .btn.br-keep[aria-pressed="true"], .vw-broll .br-btns .btn.br-keep[aria-pressed="true"]:hover { background: #2F7358; }
.vw-broll .br-btns .btn.br-swap[aria-pressed="true"], .vw-broll .br-btns .btn.br-swap[aria-pressed="true"]:hover { background: #B94F3B; }
