/* The one stylesheet for every page the app owns. Rules and tokens: see DESIGN.md. */
:root {
  --ink: #0a0a0a;
  --bone: #d8d8d4;
  --paper: #ededea;
  --accent: #ff4f00;
  --muted: #4a4a47;
  --band-orange: #ff7a00;
  --band-red: #ff3d00;
  --band-teal: #00857f;
  --band-navy: #0d2238;
  --band-navy-text: #e9e8e2;
  --up: #08602a;
  --down: #a8100d;
  --rule: 2px;
  --sans: 'Inter Tight', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--ink); font-family: var(--sans); font-weight: 600; line-height: 1.3; }
h1, h2, h3, p, ul, ol { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.on-accent :focus-visible, .cell--accent :focus-visible, .cell--accent:focus-visible { outline-color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Anything marked hidden stays hidden, whatever display a class gives it. */
[hidden] { display: none !important; }

/* Page frame: one edge-to-edge grid. Cells are split by 2px ink rules (the gaps). */
.frame { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: var(--rule); border: var(--rule) solid var(--ink); background: var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: var(--rule); }
.row--grow { flex: 1; }
.grid { display: grid; gap: var(--rule); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
/* Four cells: 4 across, 2 across or stacked, never 3 + 1 with an empty hole. */
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid--4 { grid-template-columns: 1fr; } }
/* Numbers size to their cell, so a long one ("12:59 PM") never runs into the border. */
.grid--4 > .cell { container-type: inline-size; }
.grid--4 .num { font-size: clamp(64px, 36cqi, 168px); }
.grid--4 .num--md { font-size: clamp(48px, 25cqi, 124px); }
.stack { display: flex; flex-direction: column; gap: var(--rule); }
.grow { flex: 1; }
.wide { flex: 999 1 560px; min-width: 0; }
.side { flex: 1 1 340px; min-width: 0; }

/* Cells */
.cell { background: var(--bone); color: var(--ink); padding: 12px 16px 16px; min-width: 0; }
.cell--ink { background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 var(--rule) var(--bone); }
.cell--accent { background: var(--accent); }
.cell--teal { background: var(--band-teal); }
.cell--navy { background: var(--band-navy); color: var(--band-navy-text); }
.cell--orange { background: var(--band-orange); }
.cell--red { background: var(--band-red); }
.cell--hero { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 250px; text-decoration: none; }
.cell--flush { padding: 0; display: flex; flex-direction: column; }
.cell-head { display: flex; justify-content: space-between; gap: 12px; }
.cell--flush > .cell-head { padding: 10px 16px; }

/* Type */
.label { font-family: var(--mono); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.3; }
.label--muted { color: var(--muted); }
.num { font-size: clamp(96px, 13vw, 168px); font-weight: 800; letter-spacing: -0.04em; line-height: 0.8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num--md { font-size: clamp(64px, 7.5vw, 116px); }
/* Units (/30, %, PM) sit apart from the digits, never touching them. */
.num small { font-size: 0.34em; letter-spacing: -0.02em; font-weight: 800; margin-left: 0.12em; }
.num--accent { color: var(--accent); }
.display { font-size: clamp(56px, 11.5vw, 150px); font-weight: 800; letter-spacing: -0.075em; line-height: 0.82; }
.title { font-size: clamp(48px, 7.5vw, 96px); font-weight: 800; letter-spacing: -0.07em; line-height: 0.85; }
.big { font-size: clamp(26px, 3.4vw, 44px); font-weight: 800; letter-spacing: -0.055em; line-height: 0.95; }
.mid { font-size: 24px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.body { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; max-width: 64ch; }
.body + .body { margin-top: 10px; }
.body a { text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Top bar */
.bar { display: flex; flex-wrap: wrap; gap: var(--rule); }
.bar > *, .bar nav > * { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 18px; background: var(--bone); color: var(--ink); text-decoration: none; }
.bar nav { display: contents; }
.bar .brand { background: var(--bone); padding: 0 16px; }
.bar .brand img { display: block; height: 30px; width: auto; }
.brand-lg img { display: block; height: 45px; width: auto; }
.bar [aria-current='page'] { background: var(--accent); }
.bar .fill { flex: 1 1 120px; justify-content: flex-end; }
.bar a:hover, .bar button:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.bar form { padding: 0; }
.bar button { font: inherit; text-transform: inherit; letter-spacing: inherit; border: 0; background: none; color: inherit; cursor: pointer; min-height: 52px; padding: 0 18px; }
.count { background: var(--ink); color: var(--bone); padding: 2px 7px; }
/* Account menu: the places people visit now and then. "Account" on wide screens, "Menu" on narrow ones. */
.topbar { position: relative; }
.bar > .acct { padding: 0; background: none; }
.acct summary { flex: 1; list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 18px; background: var(--bone); }
.acct summary::-webkit-details-marker { display: none; }
.acct summary::after { content: ''; width: 10px; height: 10px; box-shadow: inset 0 0 0 2px currentColor; }
.acct summary[aria-current='page'] { background: var(--accent); }
.acct[open] summary { background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 var(--rule) var(--bone); }
.acct[open] summary::after { background: var(--accent); box-shadow: none; }
.acct summary:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.acct-narrow, .nav-narrow { display: none !important; }
.bar .acct-panel { position: absolute; right: 0; top: calc(100% + var(--rule)); z-index: 20; width: 300px; display: flex; flex-direction: column; gap: var(--rule); background: var(--ink); border: var(--rule) solid var(--ink); border-top: 0; }
/* A closed panel takes no room at all (Chrome still lays out closed details content). */
.bar .acct:not([open]) .acct-panel { display: none; }
.acct-panel > a, .acct-panel > span, .acct-panel button { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 18px; background: var(--bone); color: var(--ink); text-decoration: none; }
.acct-panel > a[aria-current='page'] { background: var(--accent); }
.acct-panel .acct-status { background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 var(--rule) var(--bone); }
.bar .acct-panel form { padding: 0; }
.acct-panel button { width: 100%; font: inherit; text-transform: inherit; letter-spacing: inherit; border: 0; cursor: pointer; }
/* Narrow screens: Songs and Stats move into the menu, so the bar stays one row. */
@media (max-width: 900px) {
  .topbar .nav-more, .topbar > .fill { display: none; }
  .acct-panel .nav-narrow { display: flex !important; }
  .acct-wide { display: none; }
  .acct-narrow { display: inline !important; }
  .topbar > .brand { flex: 1 1 auto; }
  .bar .acct-panel { left: 0; width: auto; }
}
/* Phones: the logo is the way Home, so the bar is logo, Review and Menu. */
@media (max-width: 520px) {
  .topbar .nav-home { display: none; }
  .topbar > .brand { padding: 0 12px; }
}
@media (max-width: 380px) {
  .bar .brand img { height: 24px; }
  .bar.topbar > :not(.acct), .bar.topbar nav > *, .bar.topbar .acct summary { padding: 0 10px; }
}
.dot { width: 10px; height: 10px; background: var(--accent); flex: none; }
.dot--off { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }

/* Meters: blocks, never curves */
.meter { display: flex; gap: 3px; height: 44px; }
.meter--sm { height: 28px; }
.meter i { flex: 1; box-shadow: inset 0 0 0 2px currentColor; }
.meter i.on { background: currentColor; }
.meter i.gain { background: var(--accent); box-shadow: inset 0 0 0 2px var(--ink); }

/* Rows inside a flush cell */
.line { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: var(--rule) solid var(--ink); padding: 10px 16px; min-height: 60px; }
.line--muted { color: var(--muted); }
.line--indexed { padding: 0; justify-content: flex-start; align-items: stretch; gap: 0; }
.line--indexed > .idx { width: 44px; flex: none; }
.line--indexed > .mid { padding: 10px 14px; align-self: center; }
.tag { font-family: var(--mono); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 8px; white-space: nowrap; }
.tag--on { background: var(--accent); color: var(--ink); }
.tag--off { box-shadow: inset 0 0 0 2px currentColor; }

/* Poster bands: one per song or list item, stacked with no gaps */
.bands { flex: 1; display: flex; flex-direction: column; gap: var(--rule); }
.band { flex: 1 0 auto; display: flex; align-items: stretch; min-height: 64px; background: var(--bone); color: var(--ink); text-decoration: none; }
.band--orange { background: var(--band-orange); }
.band--red { background: var(--band-red); }
.band--teal { background: var(--band-teal); }
.band--navy { background: var(--band-navy); color: var(--band-navy-text); }
.idx { width: 64px; flex: none; background: var(--ink); color: var(--bone); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.band-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 20px; padding: 8px 16px; }
.band-body .end { margin-left: auto; }

/* Actions */
.btn { font: inherit; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; min-height: 60px; padding: 8px 14px; border: 0; border-radius: 0; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; text-decoration: none; background: var(--ink); color: var(--bone); }
.btn--accent { background: var(--accent); color: var(--ink); }
.btn--line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--lg { font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -0.045em; min-height: 96px; }
.btn:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.btn svg { flex: none; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 8px; }
.form label { margin-top: 6px; }
.input { font: inherit; font-size: 22px; font-weight: 600; width: 100%; min-height: 56px; padding: 12px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 14px) 50%; background-size: 8px 8px; background-repeat: no-repeat; padding-right: 40px; }
.input::placeholder { color: var(--muted); opacity: 1; }
.fields { display: grid; gap: 8px 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.fields > div { display: flex; flex-direction: column; gap: 6px; }

/* Messages */
.notice { background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 var(--rule) var(--bone); padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.notice--error { box-shadow: inset 0 0 0 var(--rule) var(--accent); }
.notice ul { padding: 0; list-style: none; }
.notice .mid { color: var(--accent); }
.notice a { color: var(--accent); }

/* Steps under a poster headline */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: var(--rule) solid var(--ink); }
.steps > div { padding: 10px 12px 0; border-left: var(--rule) solid var(--ink); }
.steps > div:first-child { padding-left: 0; border-left: 0; }
.steps .mid { margin-top: 4px; }

.poster { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 14px 20px 18px; }
.brand-lg { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 900; letter-spacing: -0.03em; }

/* Public homepage (home.blade.php) */
.home-lead { margin-top: 4px; }
.home-cta { justify-content: space-between; gap: 24px; padding: 14px 20px 20px; }
.home-cta .label a { color: inherit; }
.home-gap { margin-top: 8px; }
.home-step { display: flex; flex-direction: column; gap: 8px; padding-bottom: 20px; }
.home-step .body { font-size: 16px; }
.home-panel { display: flex; flex-direction: column; gap: 12px; padding: 14px 20px 20px; }
.home-panel .body { font-size: 16px; }
.home-panel .body + .body { margin-top: 0; }
.home-plats { list-style: none; padding: 0; display: flex; flex-direction: column; }
.home-plats li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: var(--rule) solid currentColor; }
.label--dim { opacity: 0.6; }

@media (max-width: 640px) {
  .cell--hero { min-height: 200px; }
  .bar > *, .bar nav > *, .bar button { padding: 0 12px; }
  .bar .fill { display: none; }
  .bar > *, .bar nav > *, .bar > form { flex: 1 1 auto; }
  .bar nav { display: contents; }
  .bar form > button { width: 100%; text-align: left; }
  .steps--promo { display: none; }
  .poster > .cell-head { flex-wrap: wrap; }
  .steps { grid-template-columns: 1fr; }
  .steps > div { border-left: 0; padding: 8px 0; border-top: var(--rule) solid var(--ink); }
  .steps > div:first-child { border-top: 0; }
  .idx { width: 48px; }
  .label { font-size: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .bar a { transition: none; }
}

/* Song upload */
.bands--songs > .band { max-height: 180px; }
.drop { cursor: pointer; position: relative; }
.drop.is-over { box-shadow: inset 0 0 0 6px var(--ink); }
.drop.is-error { background: var(--ink); color: var(--accent); }
.drop.is-error .btn { background: var(--accent); color: var(--ink); }
.drop.is-done { background: var(--band-teal); }
.drop-progress { display: block; height: 14px; box-shadow: inset 0 0 0 2px currentColor; visibility: hidden; }
.drop.is-busy .drop-progress { visibility: visible; }
.drop-progress i { display: block; height: 100%; width: 0; background: currentColor; }
.drop:focus-within { outline: 3px solid var(--ink); outline-offset: -3px; }
.list-rows > div { padding: 8px 0; border-top: var(--rule) solid currentColor; }
.list-rows { margin-top: 10px; }
.check { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.check input { accent-color: var(--ink); width: 26px; height: 26px; margin: 4px 0 0; flex: none; }
textarea.input { font-size: 22px; }

/* Timing editor */
.timeline { gap: 0; }
.wave { position: relative; display: flex; align-items: center; gap: 2px; height: 120px; padding: 0 16px; cursor: pointer; }
.wave canvas { display: block; width: 100%; height: 100%; }
.playhead { position: absolute; top: 0; bottom: 0; left: 16px; width: 3px; background: var(--accent); pointer-events: none; }
.tl-blocks { position: relative; height: 34px; margin: 0 16px 14px; }
.tl-block { position: absolute; top: 0; height: 100%; min-width: 6px; padding: 0 6px; border: 0; background: var(--bone); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; cursor: grab; box-shadow: inset -2px 0 0 var(--ink); touch-action: none; }
.tl-block.is-hook { background: var(--accent); }
.tl-block.is-active, .tl-block:focus-visible { background: var(--paper); outline: 3px solid var(--accent); outline-offset: -3px; }
.tl-block.is-dragging { cursor: grabbing; }
.tl-num { display: none; }
@media (max-width: 640px) {
  /* Phone: a shorter waveform, clear space above the line blocks, and line numbers instead of clipped words. */
  .wave { height: 64px; }
  .tl-blocks { height: 40px; margin: 18px 16px 18px; }
  .tl-block { padding: 0; text-align: center; text-overflow: clip; box-shadow: inset 2px 0 0 var(--ink), inset -2px 0 0 var(--ink); }
  .tl-text { display: none; }
  .tl-num { display: inline; }
}
/* Hook range on the timeline: a box with a handle at each end. */
.hk-range { position: absolute; top: 0; bottom: 0; box-shadow: inset 0 0 0 3px var(--accent); cursor: grab; touch-action: none; }
.hk-range.is-dragging { cursor: grabbing; }
.hk-handle { position: absolute; top: 0; bottom: 0; width: 22px; padding: 0; border: 0; background: var(--accent); cursor: ew-resize; touch-action: none; display: flex; align-items: center; justify-content: center; }
.hk-handle::after { content: ''; width: 8px; height: 36px; max-height: 60%; box-shadow: inset 2px 0 0 var(--ink), inset -2px 0 0 var(--ink); }
.hk-handle--start { left: -11px; }
.hk-handle--end { right: -11px; }
.hk-handle:focus-visible { outline: 3px solid var(--bone); outline-offset: 2px; }
@media (max-width: 640px) {
  /* Phone: slimmer handles just outside the box, so a short hook stays visible between them. */
  .hk-handle { width: 16px; }
  .hk-handle::after { width: 6px; }
  .hk-handle--start { left: -16px; }
  .hk-handle--end { right: -16px; }
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hook-play { width: auto; align-self: flex-start; max-width: 100%; min-height: 56px; font-size: 20px; }
.hook-play[aria-pressed='true'] { background: var(--accent); color: var(--ink); }
.hook-save { font-size: 18px; min-height: 52px; }
.chips button { font: inherit; font-family: var(--mono); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; min-height: 52px; padding: 0 16px; border: 0; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); cursor: pointer; }
.chips button[aria-pressed='true'] { background: var(--accent); }
.chip-custom[hidden] { display: none; }
.chip-custom { min-height: 52px; display: flex; align-items: center; padding: 0 16px; background: var(--accent); }
.song-line.is-hook { background: var(--band-orange); }
.song-line.is-active { background: var(--paper); }
.song-line .idx { border: 0; font: inherit; font-family: var(--mono); font-size: 13px; font-weight: 700; cursor: pointer; }
.song-line .idx:hover { color: var(--accent); }
.song-line-note { margin-left: auto; padding: 0 16px; align-self: center; text-align: right; }

/* Song deck: stays at the bottom of the window while the page scrolls. Play, the line being sung
   (one at a time, the word being sung in an accent block), and the timing save. */
.deck { position: sticky; bottom: 0; z-index: 6; display: grid; grid-template-columns: 124px minmax(0, 1fr) minmax(300px, 27%); grid-template-rows: auto minmax(116px, auto); gap: var(--rule); background: var(--ink); color: var(--bone); }
.deck-meter { grid-column: 1 / -1; display: flex; gap: 3px; height: 12px; margin: 10px 16px 8px; }
.deck-meter i { flex: 1; background: var(--muted); }
.deck-meter i.hk { background: none; box-shadow: inset 0 0 0 2px var(--accent); }
.deck-meter i.on { background: var(--bone); box-shadow: none; }
.deck-meter i.hk.on { background: var(--accent); }
.deck-play { font: inherit; border: 0; border-radius: 0; padding: 14px 14px 12px; background: var(--bone); color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; text-align: left; }
.deck-play svg { width: 44px; height: 44px; }
.deck-play:hover .label { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.deck-play[aria-pressed='true'] { background: var(--accent); }
.deck-play:focus-visible { outline-color: var(--ink); }
.deck-now { min-width: 0; padding: 10px 16px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; overflow: hidden; }
.deck-meta { display: flex; align-items: center; min-height: 17px; }
.deck-meta .live { color: var(--accent); }
.deck-line { padding-bottom: 6px; font-size: 56px; font-weight: 800; letter-spacing: -0.055em; line-height: 1; white-space: nowrap; min-height: 76px; display: flex; flex-wrap: wrap; align-content: flex-end; column-gap: 0.14em; }
.deck-line .w { display: block; flex: none; padding: 0.02em 0.1em 0.08em; }
.deck-line .w.is-now { background: var(--accent); color: var(--ink); }
.deck-save { display: flex; flex-direction: column; gap: var(--rule); min-width: 0; }
.deck-save .btn { flex: 1; }
.deck-error { padding: 8px 16px; background: var(--bone); color: var(--ink); }
.deck-save .btn { font-size: clamp(22px, 2.3vw, 32px); letter-spacing: -0.04em; align-items: flex-end; padding: 14px 16px; }
.deck-save .btn svg { align-self: flex-end; }
.deck-checked, .deck-done { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 10px 16px 14px; }
.deck-checked { box-shadow: inset 2px 0 0 var(--bone); }
.deck-done { background: var(--band-teal); color: var(--bone); }
.deck-done:has(+ .deck-next) { flex: none; padding-bottom: 10px; }
.deck-next { flex: 1; display: flex; min-width: 0; }
@media (max-width: 900px) {
  .deck { grid-template-columns: 96px minmax(0, 1fr) minmax(230px, 30%); }
}
@media (max-width: 640px) {
  .deck { grid-template-columns: 72px minmax(0, 1fr); grid-template-rows: auto minmax(84px, auto) auto; }
  .deck-meter { height: 8px; margin: 8px 12px 6px; gap: 2px; }
  .deck-play { padding: 10px; }
  .deck-play svg { width: 28px; height: 28px; }
  .deck-now { padding: 8px 12px 8px; }
  .deck-line { min-height: 40px; padding-bottom: 4px; font-size: 28px; }
  .deck-save { grid-column: 1 / -1; }
  .deck-save .btn { min-height: 56px; font-size: 22px; align-items: center; padding: 8px 12px; }
  .deck-save .btn svg { align-self: center; }
  .deck-checked, .deck-done { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 10px 12px; min-height: 56px; }
  .deck-checked { box-shadow: inset 0 2px 0 var(--bone); }
  .deck-checked .mid, .deck-done .mid { font-size: 18px; }
}
.btn[aria-pressed='true'] { background: var(--accent); color: var(--ink); box-shadow: none; }

/* Review queue */
.review { flex: 1; align-items: stretch; }
.review-preview { flex: 0 0 auto; width: clamp(240px, calc((100dvh - 112px) * 0.5625), 440px); }
/* The frame is exactly 9:16, like the video, and as tall as the window allows, so the video fills
   it with no black around it. */
.preview { position: sticky; top: 0; align-self: start; width: 100%; aspect-ratio: 9 / 16; background: var(--ink); box-shadow: inset 0 0 0 var(--rule) var(--bone); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.preview video { display: block; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.preview-tag { position: absolute; left: 0; top: 0; background: var(--bone); color: var(--ink); }
.preview-len { position: absolute; right: 0; bottom: 0; }
.review-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 24px; }
.review-when { text-align: right; margin-left: auto; }
.style-grid { margin: 0; display: grid; gap: var(--rule); grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.style-grid .cell { padding: 8px 12px 10px; }
.style-grid dd { margin: 2px 0 0; }
.review-caption { flex: 1; min-height: 120px; font-size: 24px; letter-spacing: -0.02em; line-height: 1.2; resize: vertical; }
.review-tags { font-family: var(--mono); font-size: 17px; font-weight: 500; min-height: 48px; }
.review-actions > .btn { width: auto; }
.review-approve { flex: 3 1 300px; font-size: clamp(26px, 2.6vw, 40px); }
.review-new { flex: 1 1 150px; background: var(--bone); color: var(--ink); font-size: 22px; letter-spacing: -0.02em; }
.review-reject { flex: 1 1 120px; font-size: 22px; letter-spacing: -0.02em; box-shadow: inset 0 0 0 var(--rule) var(--bone); }
.review-sub { display: block; margin-top: 4px; }
.review { position: relative; }
/* One big button on the video: play with sound. While it plays, it shrinks to a corner Pause. */
.big-play { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: var(--bone); cursor: pointer; font: inherit; }
.big-play-icon { width: 104px; height: 104px; display: grid; place-items: center; background: var(--accent); color: var(--ink); box-shadow: 0 0 0 var(--rule) var(--ink); }
.big-play-icon svg { margin-left: 6px; }
.big-play .label { background: var(--ink); padding: 4px 8px; }
.big-play:hover .label { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.big-play:focus-visible { outline: none; }
.big-play:focus-visible .big-play-icon { outline: 3px solid var(--bone); outline-offset: 3px; }
.big-play.is-on { inset: auto auto 0 0; margin: 0; flex-direction: row; gap: 0; }
.big-play.is-on .big-play-icon { width: 44px; height: 44px; }
.big-play.is-on .big-play-icon svg { width: 18px; height: 18px; margin: 0; }
.big-play.is-on .label { align-self: stretch; display: flex; align-items: center; padding: 0 12px; }
/* How it was made: one row; the eight style boxes open under it. */
.made { display: block; }
.made .style-grid { margin-top: var(--rule); }
.made summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 12px 16px; }
.made summary::-webkit-details-marker { display: none; }
.made summary:hover .made-more { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.made-sum { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; flex: 1 1 260px; min-width: 0; }
.made-more { margin-left: auto; box-shadow: inset 0 0 0 2px currentColor; padding: 4px 8px; }
.made-close, .made[open] .made-open { display: none; }
.made[open] .made-close { display: inline; }
/* Reject pop-up */
.pop { width: min(560px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: var(--rule); border: 0; background: var(--ink); color: var(--ink); }
.pop::backdrop { background: rgba(10, 10, 10, 0.78); }
.pop-body { display: grid; gap: var(--rule); }
.pop-head { background: var(--bone); padding: 18px 18px 14px; display: grid; gap: 6px; }
.pop-title { font-size: clamp(30px, 4vw, 44px); font-weight: 900; letter-spacing: -0.045em; line-height: 1; }
.pop-opts { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--rule); }
.pop-opt { background: var(--paper); min-height: 76px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; cursor: pointer; }
.pop-opt input { accent-color: var(--ink); width: 20px; height: 20px; margin: 0; flex: none; }
.pop-opt:has(input:checked) { background: var(--accent); }
.pop-opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: -3px; }
.pop-opt:has(input:checked:focus-visible) { outline-color: var(--ink); }
.pop-foot { display: grid; grid-template-columns: 1fr 2fr; gap: var(--rule); }
.pop-foot .btn { min-height: 72px; }
.pop-cancel { background: var(--bone); color: var(--ink); }
/* "Change this video": a wide pop-up. The head and the buttons stay put, the middle scrolls. */
.pop--wide { width: min(1040px, calc(100% - 32px)); overflow: hidden; }
.pop--wide .pop-body { grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 32px - 2 * var(--rule)); }
.chg { display: grid; grid-template-columns: clamp(220px, calc((100dvh - 250px) * 0.5625), 380px) minmax(0, 1fr); gap: var(--rule); min-height: 0; overflow: auto; }
/* The look preview: a 9:16 frame that plays a few lines in the picked style, colors, position
   and font. Used in "Change it" and beside "Your look" on the Settings page (look.js). */
.look { position: sticky; top: 0; align-self: start; aspect-ratio: 9 / 16; min-width: 0; background: var(--look-bg, var(--ink)); overflow: hidden; }
.look-tag { position: absolute; left: 0; top: 0; background: var(--bone); color: var(--ink); }
.look-safe { position: absolute; inset: 9% 6% 14%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16); pointer-events: none; }
.look-text { position: absolute; left: 8%; right: 8%; margin: 0; text-align: center; font-size: clamp(28px, 4.4dvh, 44px); line-height: 1.1; color: var(--look-text, var(--bone)); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 2px 0 0 rgba(0, 0, 0, 0.35), -2px 0 0 rgba(0, 0, 0, 0.35), 0 -2px 0 rgba(0, 0, 0, 0.35); overflow-wrap: anywhere; }
.look[data-pos="upper_third"] .look-text { top: 20%; }
.look[data-pos="center"] .look-text { top: 50%; transform: translateY(-50%); }
.look[data-pos="lower_third"] .look-text { bottom: 18%; }
.look-text .w { display: inline-block; margin: 0 0.12em; }
.look-text .w.is-on { color: var(--look-hi, var(--accent)); }
.look-text .row { display: block; }
.look-text .row.is-old { opacity: 0.45; font-size: 0.82em; }
.look-read { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px 10px; background: var(--ink); color: var(--bone); }
.look-read:empty { display: none; }
/* Groups of choices for a look: big tiles, the picked one in accent. */
.look-set { border: 0; margin: 0; display: grid; gap: 12px; min-width: 0; }
.look-set legend { padding: 0; float: left; width: 100%; display: flex; justify-content: space-between; gap: 12px; }
.look-set legend + * { clear: both; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.picks label { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px; min-height: 86px; box-shadow: inset 0 0 0 2px var(--ink); cursor: pointer; background: var(--paper); }
.picks label:has(input:checked) { box-shadow: inset 0 0 0 4px var(--ink); background: var(--accent); }
.picks label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.picks label:has(input:disabled) { opacity: 0.35; cursor: default; }
.picks input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.picks b { font-size: 26px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.picks b mark { background: var(--ink); color: var(--bone); padding: 0 0.12em; }
.picks--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.picks--3 label, .picks--row label { min-height: 0; }
.picks--row label { flex-direction: row; align-items: center; gap: 12px; }
.pos { width: 27px; height: 48px; box-shadow: inset 0 0 0 3px var(--ink); position: relative; flex: none; }
.pos::after { content: ""; position: absolute; left: 6px; right: 6px; height: 7px; background: var(--ink); }
.pos--top::after { top: 9px; }
.pos--mid::after { top: 20px; }
.pos--low::after { bottom: 9px; }
.pos--any { background: repeating-linear-gradient(180deg, var(--ink) 0 4px, transparent 4px 9px); }
.pos--any::after { display: none; }
.look-set .swatches { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.look-set .sw { height: 52px; font-size: 20px; }
.look-set .fonts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.look-set .fonts .s { font-size: 26px; }
.look-every { background: var(--bone); padding: 14px 16px; }
/* Settings: the preview stays beside the choices while they scroll. */
.look-grid { display: grid; grid-template-columns: clamp(200px, 24vw, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.look-grid .look { top: 16px; }
.look-grid .look-text { font-size: clamp(24px, 2.6vw, 34px); }
.look-opts { display: grid; gap: 18px; min-width: 0; }
.look-opts .look-set { padding: 0; gap: 6px; }
.look-opts .look-set legend { margin-bottom: 6px; }
.chg-opts { display: grid; gap: var(--rule); align-content: start; min-width: 0; background: var(--ink); }
.chg-len { display: grid; gap: 12px; }
.chg-n { font-size: 84px; font-weight: 800; letter-spacing: -0.05em; line-height: 0.8; font-variant-numeric: tabular-nums; }
.chg-n small { font-size: 0.34em; letter-spacing: -0.02em; margin-left: 0.14em; }
.chg-last { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
/* A slider made of blocks: a square thumb on a flat track, filled in accent up to the thumb. */
.slide { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 48px; margin: 0; padding: 0; background: transparent; cursor: pointer; --fill: 0%; }
.slide::-webkit-slider-runnable-track { height: 20px; background: linear-gradient(90deg, var(--accent) 0 var(--fill), var(--paper) var(--fill) 100%); box-shadow: inset 0 0 0 2px var(--ink); }
.slide::-moz-range-track { height: 20px; background: linear-gradient(90deg, var(--accent) 0 var(--fill), var(--paper) var(--fill) 100%); box-shadow: inset 0 0 0 2px var(--ink); }
.slide::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 30px; height: 48px; margin-top: -14px; border: 0; border-radius: 0; background: var(--ink); }
.slide::-moz-range-thumb { width: 30px; height: 48px; border: 0; border-radius: 0; background: var(--ink); }
.slide:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
  .chg { grid-template-columns: 1fr; }
  .look { aspect-ratio: auto; height: 190px; z-index: 2; box-shadow: 0 var(--rule) 0 var(--ink); }
  .look-text { font-size: 24px; }
  .look[data-pos="upper_third"] .look-text { top: 34px; }
  .look[data-pos="lower_third"] .look-text { bottom: 40px; }
  .look-safe { display: none; }
  .picks, .picks--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .picks b { font-size: 22px; }
  .look-set .fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .look-set .fonts .s { font-size: 22px; }
  .look-grid { grid-template-columns: 1fr; gap: 12px; }
  .look-grid .look { top: 0; margin: 0 -16px; }
  .look-grid .look-text { font-size: 24px; }
  .chg-n { font-size: 64px; }
  .chg-len .meter i:nth-child(even) { display: none; }
}
@media (max-width: 560px) { .pop-opts { grid-template-columns: 1fr; } .pop-opt { min-height: 60px; } }
/* Approved or rejected: the page stamps the answer while the next video loads. */
.review-stamp { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; gap: 20px; }
.review-stamp .tick { width: 72px; height: 72px; flex: none; background: var(--bone); color: var(--ink); display: grid; place-items: center; font-family: var(--mono); font-size: 40px; font-weight: 700; }
@media (max-width: 640px) {
  .review-preview { flex-basis: 100%; min-width: 0; }
  .review-preview { width: auto; }
  .preview { position: relative; }
  .review-when { text-align: left; margin-left: 0; }
}

/* Stats */
.range { display: grid; grid-template-columns: repeat(4, auto) 1fr; gap: var(--rule); }
.range > * { min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 0 18px; background: var(--bone); color: var(--ink); text-decoration: none; }
.range [aria-current='true'] { background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 var(--rule) var(--bone); }
.range a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.range .range-note { justify-content: flex-end; }
.headline { letter-spacing: -0.045em; max-width: 15ch; font-size: clamp(44px, 6.4vw, 88px); }
.ww { display: grid; gap: var(--rule); grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.ww .cell { display: flex; flex-direction: column; gap: 10px; }
.ww .big { letter-spacing: -0.035em; }
.opts { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.opt { display: grid; grid-template-columns: 112px 1fr 52px; align-items: center; gap: 10px; }
.opt > span:last-child { text-align: right; }
.blk { display: flex; gap: 2px; height: 18px; }
.blk i { flex: 1; box-shadow: inset 0 0 0 2px var(--ink); }
.blk i.on { background: var(--ink); }
.opt.win .blk i.on { background: var(--accent); box-shadow: inset 0 0 0 2px var(--ink); }
.chart { display: flex; flex-direction: column; gap: 12px; }
.cols { flex: 1; display: flex; align-items: flex-end; gap: 6px; min-height: 220px; }
.cols > div { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 6px; }
.cols .stack-b { display: flex; flex-direction: column-reverse; gap: 2px; }
.cols .stack-b i { height: 8px; background: var(--ink); }
.cols .now .stack-b i { background: var(--accent); box-shadow: inset 0 0 0 2px var(--ink); }
.cols .val { text-align: center; }
.axis { display: flex; gap: 6px; padding-top: 6px; border-top: var(--rule) solid var(--ink); }
.axis > span { flex: 1; min-width: 0; text-align: center; overflow: hidden; }
.tiles { display: grid; gap: var(--rule); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 140px; container-type: inline-size; }
.tile .num { font-size: clamp(36px, 24cqi, 80px); }
/* Change vs the period before: green up, red down, always with an arrow and the words. */
.delta { display: flex; align-items: flex-start; gap: 6px; font-family: var(--mono); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.delta svg { flex: none; margin-top: 1px; }
.delta--up { color: var(--up); }
.delta--down { color: var(--down); }
.vrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) repeat(3, 120px); align-items: stretch; min-height: 72px; background: var(--bone); color: var(--ink); text-decoration: none; }
.vrow > * { display: flex; flex-direction: column; justify-content: center; padding: 8px 14px; min-width: 0; }
.vrow .idx { padding: 0; }
.vrow:first-of-type { background: var(--band-orange); }
.vrow:hover .vrow-title { text-decoration: underline; text-decoration-thickness: 3px; }
.vrow-title { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.sm-num { font-size: 34px; font-weight: 800; letter-spacing: -0.025em; line-height: 0.9; font-variant-numeric: tabular-nums; white-space: nowrap; }
.style-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.style-grid .cell { display: flex; flex-direction: column; align-items: flex-start; }
.style-grid .tag { margin-top: 6px; }
.empty-chart { flex: 1; display: flex; align-items: center; min-height: 160px; }
@media (max-width: 760px) {
  .range { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .range > * { padding: 0 6px; }
  .range .range-note { display: none; }
}
@media (max-width: 640px) {
  .vrow { grid-template-columns: 56px minmax(0, 1fr) 108px; }
  .vrow .hide-p { display: none; }
  .vrow .sm-num { font-size: 28px; }
  .opt { grid-template-columns: 96px 1fr 48px; }
  .cols { min-height: 150px; gap: 4px; }
  .cols .stack-b i { height: 6px; }
  .axis > span { font-size: 11px; }
  .tiles--3, .style-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Posting page (spec 5.2) */
.ask { display: flex; flex-direction: column; gap: 2px; border-top: 2px solid var(--ink); padding-top: 10px; }
.muted-note { color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px 24px; }
.note-box { box-shadow: inset 0 0 0 2px var(--ink); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.plat { display: flex; flex-direction: column; }
.plat-row { display: flex; align-items: stretch; border-top: var(--rule) solid var(--ink); min-height: 72px; }
.plat-row .idx { width: 56px; }
.idx--alert { background: var(--accent); color: var(--ink); }
.plat-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 20px; padding: 10px 16px; }
.pname { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pico { flex: none; }
.plat-act { display: flex; align-items: center; padding: 10px 16px 10px 0; }
.btn--sm { font-size: 16px; min-height: 44px; width: auto; padding: 8px 14px; }
.legal { padding: 10px 16px; }
.legal a { color: inherit; }

/* Working states: a pressed button says what it is doing, and the worm inches along beside it.
   The worm is img/worm-inch.svg (made by scripts/gen-worm.mjs): it inches on the spot, one stride
   per --worm-cycle. A track slides a row of them forward at that same speed, so each worm's feet
   stay planted. A tile is 252 by 44 and 9 strides wide; sizes are multiples of 22px so tiles land
   on whole pixels. */
:root { --worm-cycle: 0.6s; }
.btn[aria-busy='true'] { cursor: progress; text-decoration: none; }
.btn[aria-busy='true'] > svg { display: none; }
.worm { --worm-h: 22px; display: inline-block; flex: none; width: calc(var(--worm-h) * 92 / 44); height: var(--worm-h); background: url('../img/worm-inch.svg') center / calc(var(--worm-h) * 252 / 44) var(--worm-h) no-repeat; }
.worm-track { --worm-h: 44px; display: block; height: var(--worm-h); overflow: hidden; position: relative; flex: none; }
.worm-track::before { content: ''; position: absolute; top: 0; bottom: 0; right: 0; left: calc(var(--worm-h) * -252 / 44); background: url('../img/worm-inch.svg') 0 100% / calc(var(--worm-h) * 252 / 44) var(--worm-h) repeat-x; animation: worm-march calc(var(--worm-cycle) * 9) linear infinite; }
@keyframes worm-march { to { transform: translateX(calc(var(--worm-h) * 252 / 44)); } }
/* On orange the worm is pink, like the logo on the sign-in page. */
.btn--accent .worm, .cell--accent .worm, [aria-current='page'] .worm { background-image: url('../img/worm-inch-pink.svg'); }
.cell--accent .worm-track::before { background-image: url('../img/worm-inch-pink.svg'); }
.strip { --worm-h: 22px; height: 26px; background: var(--ink); }
.strip::before { top: 2px; bottom: 2px; }
/* A row decided in place turns into its answer, then folds away. */
.is-sending { opacity: 0.6; }
.row-done { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 16px; overflow: hidden; animation: work-fold 0.25s steps(4) 1.6s forwards; }
.row-done--good { background: var(--band-teal); color: var(--bone); }
.row-done--off { background: var(--ink); color: var(--bone); }
.row-done .tick { width: 28px; height: 28px; flex: none; background: var(--bone); color: var(--ink); display: grid; place-items: center; font-family: var(--mono); font-weight: 700; }
.row-done .label { margin-left: auto; overflow-wrap: anywhere; }
.is-done { min-height: 0 !important; }
.row-error { flex: 1 1 100%; padding: 8px 16px; background: var(--accent); color: var(--ink); }
@keyframes work-fold { to { padding-top: 0; padding-bottom: 0; height: 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .worm-track::before { animation: none; transform: translateX(calc(var(--worm-h) * 92 / 44)); }
  .worm, .worm-track::before { background-image: url('../img/worm.svg'); }
  .btn--accent .worm, .cell--accent .worm, [aria-current='page'] .worm, .cell--accent .worm-track::before { background-image: url('../img/worm-pink.svg'); }
  .row-done { animation: none; }
}

/* Admin: Health and Footage tabs */
.tabs { display: flex; gap: var(--rule); }
.tabs a { flex: 0 0 auto; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 20px; background: var(--bone); color: var(--ink); text-decoration: none; }
.tabs a[aria-current='page'] { background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 var(--rule) var(--bone); }
.tabs .fill { flex: 1; background: var(--bone); }
.tiles--6 { display: grid; gap: var(--rule); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile .meter { margin-top: auto; }
.trow { max-width: none; display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 12px; padding: 10px 16px; border-top: var(--rule) solid var(--ink); align-items: baseline; }
.trow > :not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.trow--head { border-top: 0; padding-top: 4px; }
.alert-row { display: flex; align-items: stretch; border-top: var(--rule) solid var(--ink); min-height: 72px; }
.alert-row .idx { width: 56px; }
.alert-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 10px 16px; }
.alert-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 260px; }
.alert-text .body { overflow-wrap: anywhere; }
.alert-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.job-details { flex: 1 1 100%; }
.job-details summary { cursor: pointer; }
.job-details pre { margin-top: 8px; padding: 10px 12px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); font-family: var(--mono); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.switches { display: flex; flex-direction: column; gap: 10px; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; box-shadow: inset 0 0 0 2px var(--ink); background: var(--paper); }
.switch > div { display: flex; flex-direction: column; gap: 2px; }
.switch--off { background: var(--accent); }
@media (max-width: 900px) { .tiles--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .trow { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); padding: 10px 12px; } .alert-row .idx { width: 40px; } .tabs a { padding: 0 14px; } }

/* Admin: footage library */
.lib-filters { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 220px 220px; align-items: end; }
.lib-filters .field { display: flex; flex-direction: column; gap: 6px; }
.moodbar { display: flex; flex-wrap: wrap; gap: 6px; }
.moodbar a { font-family: var(--mono); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; min-height: 44px; padding: 0 12px; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); display: inline-flex; gap: 8px; align-items: center; text-decoration: none; }
.moodbar a[aria-current='true'] { background: var(--ink); color: var(--bone); }
.moodbar .n { opacity: 0.7; }
.moodbar .thin .n { color: var(--accent); opacity: 1; }
.lib-grid { display: grid; gap: var(--rule); grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); background: var(--ink); border-top: var(--rule) solid var(--ink); }
.lib-shot { background: var(--bone); display: flex; flex-direction: column; min-width: 0; }
.lib-frame { position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: var(--ink); border: 0; padding: 0; display: block; width: 100%; cursor: pointer; color: var(--bone); }
.lib-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lib-frame--big { cursor: default; }
.lib-dur { position: absolute; right: 10px; top: 10px; background: var(--ink); color: var(--bone); font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 4px 7px; }
.lib-new { position: absolute; left: 10px; top: 10px; background: var(--accent); color: var(--ink); font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 4px 7px; text-transform: uppercase; }
.lib-play { position: absolute; left: 10px; bottom: 10px; background: var(--bone); color: var(--ink); padding: 5px 8px; }
.lib-play::before { content: '▶ '; }
.is-playing .lib-play::before { content: '❚❚ '; }
.lib-gone { position: absolute; left: 10px; right: 10px; top: 50%; transform: translateY(-50%); text-align: center; color: var(--muted); }
.lib-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lib-info .mid { font-size: 18px; overflow-wrap: anywhere; }
.lib-act { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.lib-act > * { flex: 1; display: flex; }
.lib-act .btn { justify-content: center; font-size: 15px; min-height: 40px; padding: 6px 8px; width: 100%; }
.lib-shot.is-done .row-done { flex-direction: column; align-items: flex-start; justify-content: center; aspect-ratio: 9 / 16; }
.lib-shot.is-done .row-done .label { margin-left: 0; }
.row-done--stay { animation: none; }
.row-undo { background: var(--bone); color: var(--ink); width: auto; }
.lib-more { display: flex; justify-content: center; padding: 16px; border-top: var(--rule) solid var(--ink); }
.lib-panel { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--rule); border-top: var(--rule) solid var(--ink); }
.lib-title { font-size: clamp(32px, 4vw, 56px); overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; align-items: baseline; }
.kv dt { font-family: var(--mono); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.kv a { color: inherit; }
@media (max-width: 900px) { .lib-filters { grid-template-columns: 1fr 1fr; } .lib-filters .field:first-child { grid-column: 1 / -1; } .lib-panel { grid-template-columns: 1fr; } .lib-frame--big { max-width: 320px; } }
@media (max-width: 640px) { .lib-filters { grid-template-columns: 1fr; } .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lib-info .mid { font-size: 16px; } .kv { grid-template-columns: 100px minmax(0, 1fr); } }

/* Footage pages */
.thumbs { display: flex; gap: 3px; flex: none; }
.thumbs i, .thumbs img { display: block; width: 44px; height: 78px; object-fit: cover; box-shadow: inset 0 0 0 2px var(--ink); background: var(--paper); }
.thumbs img { box-shadow: none; outline: 2px solid var(--ink); outline-offset: -2px; }
.clip-row { display: flex; align-items: stretch; border-top: var(--rule) solid var(--ink); min-height: 96px; }
.clip-row .idx { width: 56px; flex: none; }
.clip-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 10px 16px; }
.clip-text { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.clip-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.moods { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 24px; }
.moods > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 2px solid var(--ink); }
.moods .meter { grid-column: 1 / -1; }
.drop-box { box-shadow: inset 0 0 0 2px var(--ink); padding: 20px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.facts .num + .label { margin-top: 18px; }
.btn--line:disabled { color: var(--muted); box-shadow: inset 0 0 0 2px var(--muted); cursor: default; text-decoration: none; }

/* Settings */
.pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.pick label { display: flex; gap: 14px; align-items: flex-start; padding: 14px; box-shadow: inset 0 0 0 2px var(--ink); background: var(--paper); cursor: pointer; }
.pick label:has(input:checked) { background: var(--accent); }
.pick input { accent-color: var(--ink); width: 24px; height: 24px; margin: 4px 0 0; flex: none; }
.pick .txt { display: flex; flex-direction: column; gap: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.days label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; box-shadow: inset 0 0 0 2px var(--ink); font-family: var(--mono); font-size: 14px; font-weight: 700; text-transform: uppercase; cursor: pointer; background: var(--paper); }
.days label:has(input:checked) { background: var(--ink); color: var(--bone); }
.days input, .swatches input, .fonts input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days label:has(input:focus-visible), .swatches label:has(input:focus-visible), .fonts label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.swatches label, .fonts label { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; box-shadow: inset 0 0 0 2px var(--ink); cursor: pointer; background: var(--paper); }
.swatches label:has(input:checked), .fonts label:has(input:checked) { box-shadow: inset 0 0 0 4px var(--ink); background: var(--accent); }
.sw { height: 64px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 22px; letter-spacing: -0.02em; }
.sw--mix { background: repeating-linear-gradient(90deg, #ffd400 0 25%, #ff2e88 25% 50%, #00e5ff 50% 75%, #b6ff00 75%); color: var(--ink); }
.fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.fonts .s { font-size: 30px; line-height: 1.1; white-space: nowrap; overflow: hidden; }
.tagchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tagchips span { font-family: var(--mono); font-size: 14px; font-weight: 700; padding: 6px 10px; box-shadow: inset 0 0 0 2px var(--ink); background: var(--paper); }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 var(--rule) var(--bone); }
.savebar .btn { width: auto; min-width: 220px; }
@media (max-width: 640px) {
  .fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fonts .s { font-size: 22px; }
  .pair { grid-template-columns: 1fr; }
  .days label { min-height: 46px; font-size: 12px; }
  .savebar .btn { width: 100%; }
}

/* Home: the one thing that matters now, the five steps, the latest videos */
.now-cell { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; padding: 14px 20px 20px; min-height: 320px; text-decoration: none; }
.now-cell .display { font-size: clamp(44px, 7.2vw, 104px); letter-spacing: -0.065em; line-height: 0.86; max-width: 13ch; text-wrap: balance; }
.now-cell .body { max-width: 52ch; }
.now--making .body, .now--making .label { color: var(--bone); }
.now-foot { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; }
.now-foot .btn { width: auto; flex: 0 1 400px; min-height: 84px; font-size: 30px; letter-spacing: -0.04em; }
a.now-cell:hover .btn { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.now-thumbs { display: flex; flex-direction: column; gap: 8px; }
.peek-row { display: flex; gap: 8px; }
.now-thumbs .frame916 { width: 96px; box-shadow: 0 0 0 2px var(--ink); }
.peek-tag { display: flex; align-items: center; }
.frame916 { aspect-ratio: 9 / 16; background: var(--ink); position: relative; flex: none; overflow: hidden; display: block; }
.frame916 img, .frame916 video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.making { display: flex; flex-direction: column; gap: 10px; flex: 1 1 320px; max-width: 520px; }
/* A waiting screen's worm walks along its own ground line. Worms and line dither in at the left
   end and out at the right, in the page change's block pattern, so nothing is cut off. */
.worm-ground { --edge: calc(var(--worm-h) * 96 / 44); border-bottom: 2px solid currentColor;
  -webkit-mask: url('../img/dither-left.svg') 0 0 / var(--edge) calc(var(--edge) / 3) repeat-y, url('../img/dither-right.svg') 100% 0 / var(--edge) calc(var(--edge) / 3) repeat-y, linear-gradient(#000, #000) center / calc(100% - var(--edge) * 2 + 2px) 100% no-repeat;
  mask: url('../img/dither-left.svg') 0 0 / var(--edge) calc(var(--edge) / 3) repeat-y, url('../img/dither-right.svg') 100% 0 / var(--edge) calc(var(--edge) / 3) repeat-y, linear-gradient(#000, #000) center / calc(100% - var(--edge) * 2 + 2px) 100% no-repeat; }
.live { display: inline-block; width: 10px; height: 10px; background: currentColor; margin-right: 8px; flex: none; }
.next-cell { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; container-type: inline-size; }
.next-cell .num { font-size: clamp(64px, 30cqi, 124px); }

.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--rule); }
.flow a { background: var(--bone); color: var(--ink); text-decoration: none; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 14px; min-height: 148px; justify-content: space-between; }
.flow .flow-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.flow .n { display: block; font-size: clamp(44px, 5.4vw, 76px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.8; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.flow .mid { display: block; }
.flow .arrow { font-family: var(--mono); font-weight: 700; }
.flow a.is-on { background: var(--accent); }
.flow a.is-busy { background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 var(--rule) var(--bone); }
.flow a:hover, .flow a:focus-visible { background: var(--ink); color: var(--bone); box-shadow: inset 0 0 0 var(--rule) var(--bone); }
.flow a.is-on:hover { color: var(--accent); }

.hlist { display: flex; flex-direction: column; gap: var(--rule); flex: 1; }
.hrow { display: flex; align-items: stretch; background: var(--bone); color: var(--ink); text-decoration: none; min-height: 92px; }
.hrow .frame916 { height: 92px; width: 52px; }
.hrow-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px; padding: 8px 16px; }
.hrow .v-what { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hrow .v-what .big { overflow-wrap: anywhere; }
.hrow .v-go { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.hrow.is-on { background: var(--accent); }
a.hrow:hover .big { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
a.hrow:hover { box-shadow: inset 0 0 0 4px var(--ink); }
a.hrow:hover .frame916 { width: 92px; }
.empty-list { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 200px; }

.make-cell { display: flex; flex-direction: column; gap: 12px; }
.make-cell .body { max-width: none; }
.make-form { margin-top: auto; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--rule); }
.duo .cell { display: flex; flex-direction: column; gap: 14px; justify-content: space-between; min-height: 160px; }
.duo .n { font-size: 64px; font-weight: 800; letter-spacing: -0.05em; line-height: 0.8; font-variant-numeric: tabular-nums; }
.duo .n small { font-size: 0.4em; margin-left: 0.1em; }

@media (max-width: 900px) {
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow a { min-height: 118px; }
  .flow a:last-child { grid-column: span 2; min-height: 96px; }
  .now-cell { min-height: 0; }
  .now-thumbs { display: none; }
  .now-foot .btn { flex: 1 1 100%; }
}
@media (max-width: 640px) {
  .now-foot .btn { font-size: 26px; min-height: 72px; }
  .now-cell .cell-head > span { display: none; }
  .hrow { min-height: 80px; }
  .hrow .frame916 { height: 80px; width: 45px; }
  a.hrow:hover .frame916 { width: 45px; }
  .hrow-body { padding: 8px 12px; }
  .hrow .v-go { margin-left: 0; }
  .duo .n { font-size: 52px; }
}

/* Motion. Rules: DESIGN.md, "Motion". Everything moves in steps, never eases, and ends exactly where
   the still page is. None of it runs when the browser asks for less motion. */
@keyframes m-stamp { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes look-pop { from { scale: 0.8; } to { scale: 1; } }
@keyframes look-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes m-drop { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes m-word { from { opacity: 0; transform: translateY(0.18em); } to { opacity: 1; transform: none; } }
@keyframes m-blink { 50% { opacity: 0; } }
@keyframes m-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }
@keyframes m-flash { 0%, 49% { background: var(--ink); color: var(--bone); } 50%, 100% { background: var(--accent); color: var(--ink); } }
@keyframes m-ring { 0%, 24%, 50%, 74% { outline-color: var(--accent); } 25%, 49%, 75%, 100% { outline-color: transparent; } }
@keyframes m-grow { from { max-height: 0; min-height: 0; } to { max-height: 200px; } }
@keyframes m-scrim { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  /* 01 Page arrives: cells stamp in left to right, the bar drops in. Hidden only until the script starts it. */
  .is-arriving main, .is-arriving .topbar > * { visibility: hidden; }
  .arrive [data-in] { animation: m-stamp 0.32s steps(5) both; animation-delay: calc(var(--i, 0) * 55ms); }
  .arrive .topbar > [data-in] { animation: m-drop 0.2s steps(3) both; animation-delay: calc(var(--i, 0) * 40ms); }
  /* 02 Headline lands one word at a time */
  .arrive [data-words] > span { display: inline-block; animation: m-word 0.12s steps(2) both; animation-delay: calc(380ms + var(--w, 0) * 95ms); }
  /* 05 Blocks you can tap; 06 video rows */
  .flow a:hover .arrow, a.hrow:hover .v-go b { display: inline-block; animation: m-nudge 0.5s steps(2) infinite; }
  .hrow .frame916 { transition: width 0.18s steps(3); }
  .flow a.is-flash { animation: m-flash 0.24s steps(1) 2 both; }
  .hrow.is-new { overflow: hidden; animation: m-grow 0.24s steps(4) both; }
  /* 07 Buttons: the arrow slides on hover, the button presses in */
  .btn svg { transition: transform 0.16s steps(3); }
  .btn:hover svg { transform: translateX(10px); }
  .btn:active { transform: translate(3px, 3px); }
  /* 08 Changing pages: the old page dithers out to ink and the next shows through (app.js draws the
     blocks on one canvas, a pixel per block). Ink covers the next page until its script takes over. */
  .dither { position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none; image-rendering: pixelated; }
  .is-shut body::after { content: ''; position: fixed; inset: 0; z-index: 100; background: var(--ink); }
  /* 09 A video being made */
  .live { animation: m-blink 1s steps(1) infinite; }
  /* 13 Menus: items drop in one after another */
  .acct[open] .acct-panel > * { animation: m-drop 0.14s steps(3) both; animation-delay: calc(var(--i, 0) * 60ms); }
  /* 15 Something is missing: the field rings twice and the message stamps in. No shake. */
  .is-bad { outline: 4px solid transparent !important; outline-offset: 0; animation: m-ring 0.5s steps(1) both; }
  /* 12 Pop-ups: the backdrop darkens in steps, the pop-up drops open */
  .pop[open] { animation: m-drop 0.26s steps(5) 0.1s both; }
  .look-text.is-pop { animation: look-pop 0.12s steps(3); }
  .look-text.is-fade { animation: look-fade 0.24s steps(4); }
  .look-text .row.is-new { animation: m-stamp 0.2s steps(4); }
  .pop[open]::backdrop { animation: m-scrim 0.15s steps(3) both; }
  /* 11 Approving: the answer stamps across the page */
  .review-stamp { animation: m-stamp 0.24s steps(4) both; }
  /* 17 Messages drop in from under the bar; an error stamps in instead */
  .notice { animation: m-drop 0.2s steps(4) both; }
  .notice--error { animation: m-stamp 0.2s steps(4) both; }
  /* 18 Song deck: each line stamps in as it is sung; the word being sung flips to an accent block */
  .deck-line.is-in { animation: m-stamp 0.2s steps(4); }
  .deck-done { animation: m-stamp 0.24s steps(4) both; }
}
