/* Aperture AVN — design system.
   Palette taken from the logo: a spectrum sweep (cyan → lime → amber → orange →
   rose → magenta → violet) burning on pure black. Everything is self-hosted; no
   external fonts or assets, so the strict CSP holds. */

:root {
  /* Design tokens. Every value here is the legacy look, exactly; a theme stylesheet
     (static/css/themes/<id>.css, loaded after this file, scoped to
     :root[data-theme="<id>"]) overrides them. portal/docs/themes-tokens.md lists
     every token and what it is for. */

  /* ---- surfaces */
  --surface-page: #000000;
  --surface-panel: #0a0a0c;
  --surface-raised: #101014;
  --surface-raised-2: #16161c;
  --surface-sunken: #06060a;
  --surface-well: #000000;
  --surface-sidebar: linear-gradient(180deg, #07070a, #000);
  --surface-glass: rgba(255, 255, 255, 0.045);
  --surface-appbar: rgba(6, 6, 9, .84);
  --surface-actionbar: rgba(6, 6, 9, .9);
  --surface-submitbar: rgba(5,5,8,.92);
  --surface-textbox: rgba(6, 6, 9, .88);
  --surface-sync: rgba(4, 4, 7, .97);
  --surface-popover: rgba(10,10,14,.96);

  /* ---- text */
  --text-primary: #f2f2f6;
  --text-secondary: #d5d5e2;
  --text-muted: #8b8b98;
  --text-strong: #fff;
  --text-inverse: #000000;
  --text-on-accent: #05050a;
  --text-missing-title: #d2d2de;
  --text-help-strong: #b9b9c8;
  --text-viewas: #ede4ff;

  /* ---- lines */
  --border: #23232c;
  --border-hover: #33334a;
  --border-active: #3a3a54;
  --border-card-hover: #3a3a46;

  /* ---- hues (the logo's spectrum). Roles below point at these; a theme may
     re-tune a hue or re-point a role. */
  --black: #000000;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --lime: #a3e635;
  --amber: #fde047;
  --orange: #fb923c;
  --rose: #f43f5e;
  --magenta: #e879f9;
  --violet: #a855f7;

  --spectrum: linear-gradient(100deg, var(--cyan), var(--lime), var(--amber),
                              var(--orange), var(--rose), var(--magenta), var(--violet), var(--cyan));
  --flame: linear-gradient(180deg, var(--lime), var(--amber), var(--orange), var(--rose));

  /* ---- accent, links, focus */
  --accent: var(--cyan);
  --accent-text: var(--text-on-accent);
  --link: var(--accent);
  --focus-ring: rgba(34,211,238,.14);

  /* ---- verdicts */
  --verdict-finalised: var(--lime);
  --verdict-changes: var(--orange);
  --verdict-changes-strong: var(--rose);
  --verdict-changes-text: #ffd9df;
  --verdict-carried: var(--violet);
  --verdict-unreviewed: var(--text-muted);

  /* ---- states */
  --danger: var(--rose);
  --danger-bg: rgba(244,63,94,.1);
  --danger-text: #ffd9df;
  --danger-button-text: #ffc2cc;
  --missing-text: #ffe3e8;
  --warning: var(--amber);
  --warning-bg: rgba(253,224,71,.07);
  --warning-bg-strong: rgba(253,224,71,.08);
  --warning-text: #f6e6b0;
  --success: var(--lime);
  --success-text: #e6f7c8;
  --look-approved: #3fb950;
  --look-proposed: #d29922;
  --disabled-opacity: .45;
  --unavailable-opacity: .5;

  /* ---- workflow state (requests, submissions, renders, threads) */
  --status-open: var(--amber);        /* open, new, claimed, queued, running */
  --status-done: var(--lime);         /* accepted, approved, rendered, published, fixed */
  --status-failed: var(--rose);       /* failed */
  --attention: var(--amber);          /* something waits on the author: urgent hub card, door with work, work in progress */
  --pending: var(--amber);            /* staged edits not yet applied (scene specs, post-processing) */
  --star: var(--amber);               /* a starred pill */
  --verdict-submission-changes: var(--amber);   /* a submitted face sent back for changes */
  /* ---- rule checks on a render submission */
  --check-pass: var(--lime);
  --check-flag: var(--orange);        /* worth a look, not blocking; also post-processing gaps and reasons, a superseded pass */
  --check-block: var(--rose);
  --flag-missing-textures: var(--check-flag); /* the "possible missing textures" tag, note and filter (Render Review) */
  /* ---- tools and categories */
  --markup: var(--rose);              /* the reviewer's drawn marks, the active drawing tool, the "marked" badge */
  --missing: var(--rose);             /* the red Missing button */
  --filter-hide: var(--rose);         /* a category chip set to hide */
  --hover-alt: var(--magenta);        /* hover border of style tags and variant buttons */
  --viewas: var(--violet);            /* the "viewing as artist" bar and its button */
  --tier-supporting: var(--violet);   /* the SUPPORTING character badge */
  --kind-environment: var(--magenta); /* request kinds */
  --kind-render: var(--violet);
  --kind-new: var(--amber);
  --kind-replaces: var(--magenta);    /* a submitted picture that replaces one */
  --pfx-need: var(--violet);          /* a post-processing preset that needs a render pass */
  --browse-match: var(--lime);       /* the share browser: a file of the kind being looked for, and the chosen one */
  --ai-request: var(--violet);        /* post processing: a request to the AI (panel, marks, open item) */
  --pfx-ok: #3fb950;                  /* post processing: an attempt that came out right */
  /* ---- sync (render-to-script timeline) */
  --sync: var(--violet);              /* the tool's own colour: button, heading, script tint */
  --sync-author: var(--violet);       /* links and cards the author placed */
  --sync-drag: var(--amber);          /* what is being dragged, and the hot tick under it */
  --sync-target: var(--lime);         /* the drop target, the winning angle, a fresh card */
  --sync-frames: var(--lime);         /* the frame count on a script line */
  --sync-parked: var(--rose);         /* the park lane and parked cards */

  /* ---- the neutral stage behind renders. Keep these neutral grey/black in every
     theme: the author judges colour on them. */
  --stage-viewer: rgba(0,0,0,.94);
  --stage-black: #000;
  --stage-mat: #07070b;
  --stage-mat-deep: #050507;
  --stage-compare: rgba(0,0,0,.96);
  --stage-caption: var(--muted); /* words drawn on a stage (the spec compare's captions) */
  --spec-bad-bg: color-mix(in srgb, var(--danger) 72%, #000); /* the red "no preset" / "hand-edited" chip */
  --spec-bad-text: var(--text-strong);
  --stage-postfx: rgba(0,0,0,.92);

  /* ---- overlays drawn over pictures and pages */
  --scrim: rgba(0, 0, 0, .72);
  --scrim-nav: rgba(0, 0, 0, .55);
  --scrim-sheet: rgba(0, 0, 0, .5);
  --scrim-dialog: rgba(0,0,0,.7);
  --overlay-chip: rgba(0,0,0,.72);
  --overlay-chip-soft: rgba(0,0,0,.7);
  --overlay-badge: rgba(0, 0, 0, .74);
  --overlay-strong: rgba(0,0,0,.78);
  --overlay-tag: rgba(0, 0, 0, .62);
  --overlay-hud: rgba(0,0,0,.75);
  --overlay-control: rgba(6, 6, 10, .82);
  --overlay-control-touch: rgba(8,8,12,.78);
  --overlay-caption: rgba(8, 8, 11, .82);
  --overlay-glass: rgba(8, 8, 12, .72);
  --overlay-hint: rgba(8, 8, 12, .86);
  --overlay-markbar: rgba(8, 8, 11, .9);

  /* ---- glows and shadows */
  --aurora-1: rgba(34, 211, 238, 0.10);
  --aurora-2: rgba(168, 85, 247, 0.10);
  --aurora-3: rgba(251, 146, 60, 0.07);
  --glow-accent: rgba(34,211,238,.55);
  --glow-stage: rgba(34,211,238,.4);
  --glow-logo: rgba(34,211,238,.45);
  --glow-logo-login: rgba(168,85,247,.5);
  --glow-hero-1: rgba(34,211,238,.16);
  --glow-hero-2: rgba(232,121,249,.14);
  --glow-hero-badge: rgba(34,211,238,.25);
  --glow-ring: rgba(34,211,238,.6);
  --glow-new-card: rgba(34, 211, 238, .14);
  --ripple: rgba(255,255,255,.55);
  --placeholder-stripe: rgba(255,255,255,.022);
  --placeholder-glow: rgba(168,85,247,.16);
  --shadow-ink: #000;
  --shadow-soft: rgba(0,0,0,.6);
  --shadow-drawer: rgba(0, 0, 0, .8);
  --shadow-mark: rgba(0, 0, 0, .85);
  --shadow-deep: rgba(0,0,0,.9);
  --shadow-popover: rgba(0,0,0,.95);

  /* ---- small parts with colours of their own */
  --dot-idle: #3a3a48;
  --sheet-grip: #3d3d4a;
  --script-thought: #cfd4e6;
  --script-narration: #d7d7e0;
  --script-dim: #55556a;
  --tick-mark: #2c2c3a;
  --tick-mark-major: #3b3b4d;
  --tick-mark-near: #8a8aa4;
  --tick-label: #4a4a5a;
  --tick-label-major: #6c6c80;
  --tick-label-near: #e2e2ec;
  --ring-track: rgba(255,255,255,.14);
  --spec-pending-text: #1a1400;
  --swatch-ring: rgba(255,255,255,.28);
  --swatch-inset: rgba(0,0,0,.35);
  --st-sub-text: #c7d7ff;
  --st-sub-failed-text: #fecaca;
  --ap-blade-fill: #111117;
  --ap-blade-edge: #2a2a33;
  --ap-core: #000;
  --ap-spark: #fff;

  /* The submit screen's six milestone colours and the background spark field's seven.
     Read by render_submit.js (as var()) and effects.js (getComputedStyle). */
  --progress-1: #22d3ee; --progress-2: #a3e635; --progress-3: #fde047;
  --progress-4: #fb923c; --progress-5: #f43f5e; --progress-6: #e879f9;
  --spark-palette: #22d3ee, #a3e635, #fde047, #fb923c, #f43f5e, #e879f9, #a855f7;
  /* The submit screen's ring gradient (_render_submission_body.html). */
  --ap-stop-1: #22d3ee; --ap-stop-2: #a3e635; --ap-stop-3: #fde047;
  --ap-stop-4: #fb923c; --ap-stop-5: #f43f5e; --ap-stop-6: #a855f7;

  /* ---- the logo (_logo.html) */
  --logo-1: #22d3ee; --logo-2: #3b82f6; --logo-3: #a855f7; --logo-4: #e879f9;
  --logo-5: #f43f5e; --logo-6: #fb923c; --logo-7: #a3e635;
  --logo-flame-1: #f43f5e; --logo-flame-2: #fb923c; --logo-flame-3: #fde047; --logo-flame-4: #a3e635;
  --logo-core: #05050a;

  /* ---- type */
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --font-mono-ui: ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-mono-code: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font-mono-spec: "Cascadia Mono", Consolas, monospace;
  --font-mono-plain: ui-monospace, monospace;
  --font-mono-bare: monospace;
  --font-system: system-ui;
  --font-system-sans: system-ui, sans-serif;
  --font-ring: "Segoe UI", system-ui, sans-serif;

  /* ---- shape and size */
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --sidebar-w: 268px;
  --page-pad: 30px 38px 60px;
  --ph-icon-size: 40px;
  --ph-icon-size-sm: 34px;
  --ph-icon-size-lg: 44px;
  --speed: 220ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* ---- legacy names, kept as aliases so every existing rule follows the roles */
  --panel: var(--surface-panel);
  --panel-2: var(--surface-raised);
  --panel-3: var(--surface-raised-2);
  --line: var(--border);
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --glass: var(--surface-glass);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--surface-page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100%;
}

/* Cursor-reactive aurora: --mx/--my are updated from JS. */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(680px circle at var(--mx, 50%) var(--my, 40%),
                    var(--aurora-1), transparent 62%),
    radial-gradient(520px circle at calc(var(--mx, 50%) + 12%) calc(var(--my, 40%) + 14%),
                    var(--aurora-2), transparent 60%),
    radial-gradient(900px circle at 50% 120%, var(--aurora-3), transparent 70%);
  transition: background 420ms var(--ease);
}

#spark-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1; opacity: 0.55;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { position: relative; z-index: 2; }

/* ---------------------------------------------------------------- chrome */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface-sidebar);
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 44px; height: 44px; filter: drop-shadow(0 0 12px var(--glow-logo)); }
.brand-text { line-height: 1.15; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800; letter-spacing: 3px; font-size: 17px;
  background: var(--spectrum); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sweep 9s linear infinite;
}
.brand-sub { font-size: 10px; letter-spacing: 4px; color: var(--accent); text-transform: uppercase; }

@keyframes sweep { to { background-position: 300% 0; } }

.nav-label {
  font-size: 10px; letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.nav { display: flex; flex-direction: column; gap: 8px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); position: relative; overflow: hidden;
  transition: transform var(--speed) var(--ease), border-color var(--speed), background var(--speed);
}
.nav-item .emoji { font-size: 18px; }
.nav-item::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--spectrum); background-size: 100% 400%;
  opacity: 0; transition: opacity var(--speed);
}
.nav-item:hover { transform: translateX(4px); border-color: var(--border-hover); background: var(--panel-2); text-decoration: none; }
.nav-item:hover::after, .nav-item.active::after { opacity: 1; }
.nav-item.active { background: var(--panel-2); border-color: var(--border-active); }
.nav-item.disabled { opacity: var(--disabled-opacity); pointer-events: none; }
.nav-item small { display: block; color: var(--muted); font-size: 11px; }

.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--muted); }
.sidebar-foot form { margin-top: 8px; }

/* Scoped to the shell's own <main>. `.main` is also the tier modifier on `.badge main`,
   so a bare `.main { padding }` was landing on every MAIN badge and inflating it into an
   84px oval - visible on the character page and on the sidebar's admin badge. */
.shell > .main { padding: var(--page-pad); min-width: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
h1 { font-family: var(--font-display); font-size: 30px; margin: 0 0 6px; letter-spacing: -0.4px; }
h2 { font-family: var(--font-display); font-size: 19px; margin: 34px 0 14px; letter-spacing: -0.2px; }
.sub { color: var(--muted); margin: 0; }

.gradient-text {
  background: var(--spectrum); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sweep 11s linear infinite;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-accent: var(--accent);
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font-size: 14px; font-weight: 600; font-family: inherit;
  position: relative; overflow: hidden;
  transition: transform 140ms var(--ease), box-shadow var(--speed), border-color var(--speed);
}
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--btn-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--btn-accent) 40%, transparent),
              0 10px 30px -12px var(--btn-accent);
}
.btn:active { transform: translateY(0) scale(.985); }
.btn.primary {
  background: var(--spectrum); background-size: 260% 100%;
  border-color: transparent; color: var(--accent-text); font-weight: 800;
  animation: sweep 7s linear infinite;
}
.btn.ghost { background: transparent; }
.btn.finalise { --btn-accent: var(--verdict-finalised); }
.btn.changes { --btn-accent: var(--verdict-changes); }
.btn.small { padding: 7px 12px; font-size: 12.5px; }
.btn[aria-pressed="true"] { border-color: var(--btn-accent); background: color-mix(in srgb, var(--btn-accent) 16%, var(--panel-2)); }

/* click ripple injected by JS */
.ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: radial-gradient(circle, var(--ripple), transparent 65%);
  animation: ripple 620ms var(--ease) forwards; pointer-events: none;
}
@keyframes ripple { to { transform: scale(3.4); opacity: 0; } }

/* ---------------------------------------------------------------- cards */
.grid { display: grid; gap: 16px; }
.grid.chars { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.grid.thumbs { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid.core { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  position: relative; color: var(--text);
  transition: transform var(--speed) var(--ease), border-color var(--speed), box-shadow var(--speed);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--spectrum); background-size: 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity var(--speed); pointer-events: none;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 22px 48px -26px var(--glow-accent); text-decoration: none; }
.card:hover::before { opacity: .9; animation: sweep 5s linear infinite; }

.card-media {
  aspect-ratio: 4 / 5; background: var(--stage-mat); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 620ms var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 13px 14px 15px; }
.card-title { font-weight: 700; font-size: 14.5px; }
.card-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }

.placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; color: var(--muted); text-align: center; padding: 14px;
  background:
    repeating-linear-gradient(45deg, var(--placeholder-stripe) 0 12px, transparent 12px 24px),
    radial-gradient(circle at 50% 42%, var(--placeholder-glow), transparent 68%);
}
.placeholder .ph-icon { font-size: 30px; opacity: .8; }
.placeholder .ph-text { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; }

/* count pill: finalised / wip */
.counts { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
}
.pill.zero { opacity: .6; }
.pill.has-final { color: var(--verdict-finalised); border-color: color-mix(in srgb, var(--verdict-finalised) 45%, transparent); }
.pill.has-wip { color: var(--attention); border-color: color-mix(in srgb, var(--attention) 40%, transparent); }
.pill.star { color: var(--star); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted);
}
.badge.main { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.badge.supporting { color: var(--tier-supporting); border-color: color-mix(in srgb, var(--tier-supporting) 40%, transparent); }

/* ---------------------------------------------------------------- tags */
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 0; padding: 0; list-style: none; }
.tag {
  font-size: 11.5px; padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--glass); border: 1px solid var(--line); color: var(--text-secondary);
  transition: transform 160ms var(--ease), border-color 160ms, color 160ms;
}
.tag:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text-strong); }
.tag.style:hover { border-color: var(--hover-alt); }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 22px;
}
.panel + .panel { margin-top: 16px; }
.panel h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------------------------------------------------------------- passes */
.pass-bar { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; }
.pass-btn {
  flex: 0 0 auto; text-align: left; min-width: 210px; max-width: 320px;
  padding: 11px 14px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-family: inherit; transition: transform var(--speed) var(--ease), border-color var(--speed);
  position: relative; overflow: hidden;
}
.pass-btn:hover { transform: translateY(-3px); border-color: var(--accent); }
.pass-btn.active { border-color: transparent; box-shadow: 0 0 0 1.5px var(--accent), 0 14px 34px -20px var(--accent); }
.pass-btn.active::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--spectrum); background-size: 300% 100%; animation: sweep 6s linear infinite;
}
.pass-n { font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.pass-title { font-weight: 700; font-size: 13.5px; margin: 2px 0 3px; }
.pass-label { font-size: 11.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pass-btn.superseded .pass-title::after { content: " ⚠"; color: var(--check-flag); }

/* decision state on a thumbnail */
.thumb { position: relative; cursor: pointer; }
.thumb .state {
  position: absolute; top: 8px; right: 8px; font-size: 15px;
  filter: drop-shadow(0 2px 6px var(--shadow-ink));
}
.thumb.is-finalised { box-shadow: 0 0 0 2px var(--verdict-finalised); }
.thumb.is-changes { box-shadow: 0 0 0 2px var(--verdict-changes); }
.thumb .vcount {
  position: absolute; bottom: 8px; left: 8px;
  font-size: 10.5px; padding: 2px 7px; border-radius: var(--radius-pill);
  background: var(--overlay-chip); border: 1px solid var(--line); color: var(--accent);
}

/* ---------------------------------------------------------------- viewer */
.viewer {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: var(--stage-viewer); backdrop-filter: blur(8px);
}
.viewer.open { display: grid; grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr); }
.viewer-col { padding: 26px 24px; overflow-y: auto; }
.viewer-stage {
  display: flex; align-items: center; justify-content: center;
  padding: 18px 8px; position: relative;
}
/* The "nothing delivered yet" placeholder. It carried an inline `width: 60%`, and the
   stage track is `auto` - sized to its content - so that percentage resolved against a
   width which depended on it, and collapsed to a sliver. Definite, and capped so it never
   outgrows a narrow window. This is the screen a requested variant is edited on now, so
   it has to be legible rather than merely present. */
.viewer-stage .stage-empty { width: 420px; max-width: 100%; }
.viewer-stage img {
  max-height: calc(100vh - 36px); max-width: 100%;
  border-radius: 12px; box-shadow: 0 0 0 1px var(--line), 0 30px 90px -30px var(--glow-stage);
  animation: pop 320ms var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.985); } }

.viewer h2 { margin: 0 0 4px; font-size: 22px; }
.viewer .vsub { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .4px; }
.block { margin-top: 20px; }
.block h4 {
  margin: 0 0 8px; font-size: 10.5px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent);
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.block ul { margin: 0; padding-left: 17px; }
.block li { margin-bottom: 5px; }
.block p { margin: 0 0 8px; }
.block.dim p, .block.dim li { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.viewer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.variant-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.variant-btn {
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  transition: transform 150ms var(--ease), border-color 150ms, box-shadow 150ms;
}
.variant-btn:hover { transform: translateY(-2px); border-color: var(--hover-alt); }
.variant-btn.active {
  border-color: transparent; color: var(--accent-text);
  background: var(--spectrum); background-size: 260% 100%; animation: sweep 6s linear infinite;
}
.nav-arrows { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.counter { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.viewer-close {
  position: absolute; top: 14px; right: 18px; z-index: 3;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 17px;
}
.viewer-close:hover { border-color: var(--danger); transform: rotate(90deg); }
.viewer-close { transition: transform var(--speed) var(--ease), border-color var(--speed); }

/* The controls that change how the picture is shown, in a row beside the close button so
   a third one does not need a hand-counted `right:` offset. */
.viewer-tools {
  position: absolute; top: 14px; right: 64px; z-index: 3;
  display: flex; gap: 8px; align-items: center;
}
.viewer-tool {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  height: 38px; padding: 0 14px; border-radius: var(--radius-pill); cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .3px;
  transition: border-color var(--speed), color var(--speed);
}
.viewer-tool:hover { border-color: var(--accent); color: var(--accent); }
.viewer-tool[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.viewer-tool[hidden] { display: none; }
/* Wide mode collapses the two reading columns, and below this width they are already
   stacked rather than flanking - there is nothing to collapse. Compare still works. */
@media (max-width: 1100px) { #viewer-wide { display: none; } }
/* While drawing, the pointer belongs to the drawing. Switching to a two-pane layout
   mid-stroke would move the surface out from under it. */
.viewer.marking #viewer-compare { display: none; }

/* ------------------------------------------- the revision this picture replaced, beside it

   Two panes, each labelled with the pass it came from. The caption is a chip *over* the
   picture rather than a line under it: a figure shrink-wraps to its image's max-content
   width, but the image renders narrower whenever the height cap is what binds - a portrait
   render, a short window - so a full-width caption under it would hang off the side. A
   chip pinned to the top-left is over the picture either way, and it keeps the panes out
   of the height-cap arithmetic entirely. */
/* Two panes want roughly twice the width one does, and the reading columns are the only
   place it can come from. Narrowed rather than hidden - the ask being answered is IN the
   left column, so collapsing it while comparing would hide the reason for the comparison.
   Wide mode is still there for an author who wants the whole window. */
@media (min-width: 1101px) {
  /* The middle track is `auto` normally, which sizes to the picture. Two panes want a
     *share* of the window instead: left as `auto` the stage is content-sized, the panes
     are 50% of that content, and the pair settles well below what the window could give
     them - 526px each in a 1500px window. A flexible track makes the width definite and
     the panes fill it. */
  .viewer.open.comparing {
    grid-template-columns: minmax(210px, .5fr) minmax(0, 3fr) minmax(210px, .5fr);
  }
}
.compare {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; width: 100%; min-width: 0;
}
.compare-pane { position: relative; margin: 0; min-width: 0; max-width: 50%; line-height: 0; }
.compare-pane img { max-width: 100%; }
.compare-pane figcaption {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap;
  max-width: calc(100% - 16px);
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--overlay-caption); backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  font-size: 11.5px; line-height: 1.5; color: var(--muted); letter-spacing: .2px;
}
.compare-pane figcaption .mono { color: var(--text); }
/* Which one is the delivery being reviewed. Without it the two panes are interchangeable
   and the author is one glance away from filing a verdict about the superseded picture. */
.compare-pane.is-now figcaption { border-color: var(--accent); color: var(--accent); }
.compare-pane.is-now figcaption b { color: var(--accent); }
@media (max-width: 720px) {
  .compare { gap: 6px; }
  .compare-pane figcaption { top: 4px; left: 4px; padding: 3px 8px; font-size: 10.5px; }
}

/* A verdict inherited from an earlier pass. Quiet: it is a real, current verdict, and the
   line only says where it was made - not a warning that something is wrong with it. */
#decision-state .inherited {
  display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.5;
  color: var(--muted); font-family: inherit; letter-spacing: 0;
}
#decision-state .inherited strong { color: var(--text); }

/* What the author asked for last time. Loud on purpose: it is the reason this picture was
   redone, and it is read before the judgement rather than after it. */
.block.ask { border-left: 3px solid var(--accent); padding-left: 12px; }
.block.ask.open { border-left-color: var(--verdict-changes); }
.block.ask .ask-note {
  font-size: 14.5px; line-height: 1.5; color: var(--text); margin: 0 0 6px;
  white-space: pre-wrap;
}
@media (min-width: 1101px) {
  .viewer.open.is-wide { grid-template-columns: 1fr; }
  .viewer.is-wide .viewer-col { display: none; }
  .viewer.is-wide .viewer-stage { padding: 10px 12px; }
  .viewer.is-wide .viewer-stage img { max-height: calc(100vh - 20px); }
}

.note-input {
  width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 13px; resize: vertical; min-height: 68px;
}
.note-input:focus { outline: none; border-color: var(--accent); }

/* The review viewer's decision note, on all three review screens and in every theme,
   legacy included (a behaviour fix, not a layout proposal). In the shared layout it is a
   flex item of the information column, and a flex item shrinks: once the column held
   more than fits (Render Review's thread and scene specs), the note was squeezed to its
   68px minimum - two lines with a scrollbar - and a drag on the resize corner set a
   height the column immediately squeezed back. `flex: none` keeps whatever height it is
   given; the column scrolls instead and the stage beside it never changes size.
   review.js (sizeNote) grows it with its content up to 45% of the window and remembers a
   hand-set height per user and browser; max-height bounds a drag. */
#viewer #decision-note {
  flex: none; display: block;
  line-height: 1.45; min-height: calc(5 * 1.45em + 22px); max-height: 70vh;
  resize: vertical; overflow-y: auto; scrollbar-width: auto;
}

/* ---------------------------------------------------------------- login */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card {
  width: 100%; max-width: 392px; padding: 34px 32px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  position: relative; overflow: hidden;
  box-shadow: 0 40px 120px -50px var(--glow-accent);
}
.login-card::before {
  content: ""; position: absolute; inset: 0; padding: 1.4px; border-radius: inherit;
  background: var(--spectrum); background-size: 300% 100%; animation: sweep 8s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-logo svg { width: 84px; height: 84px; filter: drop-shadow(0 0 22px var(--glow-logo-login)); }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 11px;
  background: var(--surface-sunken); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 14.5px; transition: border-color var(--speed), box-shadow var(--speed);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.error {
  padding: 10px 13px; border-radius: var(--radius-sm); margin-bottom: 15px; font-size: 13px;
  background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger-text);
}
.notice { color: var(--muted); font-size: 12px; margin-top: 16px; text-align: center; }

.empty {
  padding: 44px; text-align: center; border: 1px dashed var(--line);
  border-radius: var(--radius-lg); color: var(--muted);
}
.warnbar {
  margin-bottom: 18px; padding: 11px 15px; border-radius: 12px; font-size: 12.5px;
  background: var(--warning-bg); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
  color: var(--warning-text);
}
/* Toasts live in one stack, newest at the bottom, so two can be on screen without one
   covering the other's button. */
#toast-stack {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 9px;
  pointer-events: none;
}
#toast-stack > * { pointer-events: auto; }
.toast {
  transform: translateY(20px);
  padding: 12px 20px; border-radius: 12px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  opacity: 0; transition: opacity var(--speed), transform var(--speed) var(--ease);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-color: var(--success); }
.toast.bad { border-color: var(--danger); }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .viewer.open { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .viewer-stage img { max-height: 56vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  #spark-canvas { display: none; }
}

/* ---------------------------------------------------------------- registry controls */
.thumb-actions {
  position: absolute; top: 8px; left: 8px; display: flex; gap: 6px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity var(--speed), transform var(--speed) var(--ease);
}
.thumb:hover .thumb-actions, .thumb:focus-within .thumb-actions { opacity: 1; transform: none; }
.mini {
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 13px;
  background: var(--overlay-control); color: var(--text);
  border: 1px solid var(--line); font-family: inherit;
  transition: border-color 150ms, transform 150ms var(--ease);
}
.mini:hover { transform: translateY(-2px); border-color: var(--accent); }
.mini.danger:hover { border-color: var(--danger); }

.thumb .carried {
  position: absolute; bottom: 8px; right: 8px; max-width: 76%;
  font-size: 10px; padding: 2px 7px; border-radius: var(--radius-pill);
  background: var(--overlay-badge); color: var(--verdict-carried);
  border: 1px solid color-mix(in srgb, var(--verdict-carried) 45%, transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb.is-carried { opacity: .93; }
.thumb.is-carried .card-media { filter: saturate(.92); }
.thumb.is-requested { border-style: dashed; }
/* Outstanding work that is not a verdict: a variant the author asked for and nobody has
   authored yet. Cyan rather than the rose of a change request - it is new work, not a
   rejection - and it sits opposite the verdict badge so the two never collide. */
.thumb .requested-badge {
  position: absolute; bottom: 8px; right: 8px; z-index: 2;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; line-height: 1.6;
  background: var(--overlay-chip); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
}
.card.new-expr .placeholder {
  background: radial-gradient(circle at 50% 45%, var(--glow-new-card), transparent 70%);
}
.card.new-expr:hover .ph-icon { transform: scale(1.16) rotate(90deg); }
.card.new-expr .ph-icon { transition: transform var(--speed) var(--ease); }

/* Export controls sit above the pass bar: available, never competing with the passes. */
.pass-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; }
.pass-tools-label {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-right: 2px;
}
.pass-tools .btn[data-busy="1"] { opacity: .6; pointer-events: none; }
/* `.btn` sets a display, which outranks the [hidden] attribute's rule in the UA stylesheet
   - so `button.hidden = true` on a .btn does nothing at all and the control stays on
   screen. The same trap the pass-tools rows carry a comment about; stated once here so a
   button can be hidden the obvious way. */
.btn[hidden] { display: none; }

/* ------------------------------------------------- category chips ("filter for / out")

   Three states per chip, so the row has to say which is which at a glance: cyan and a tick
   for "showing only this", rose and a cross and a struck-through name for "hidden". The
   count is what makes an unfamiliar section legible before it is clicked. */
/* Bounded at every width, not only on a phone. The row sits directly above the gallery,
   so an unbounded one pushes the first card off the screen the moment a pass has more
   sections than usual - and the cap is what makes a "+N more" collapse unnecessary, which
   in turn removes the one rule such a collapse has to get right (never hide the chip that
   is doing the filtering). Nine is today's widest; this holds at thirty. */
.category-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  flex: 1 1 340px; min-width: 0;
  /* Three lines: nine sections - today's widest character, and Render Review's longest
     brief - fit whole, so the cap only ever bites on a pass with more than that. A cap
     that lands mid-chip reads as a rendering fault rather than as more to scroll. */
  max-height: 104px; overflow-y: auto;
}
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  font-family: inherit; font-size: 12px; line-height: 1.5; cursor: pointer;
  transition: border-color var(--speed), color var(--speed), background var(--speed);
}
.cat-chip:hover { border-color: var(--accent); color: var(--text); }
.cat-chip em {
  font-style: normal; font-size: 10.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cat-chip.is-show {
  border-color: var(--accent); color: var(--accent); font-weight: 700;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-2));
}
.cat-chip.is-show em { color: var(--accent); }
.cat-chip.is-hide {
  border-color: var(--filter-hide); color: var(--filter-hide); text-decoration: line-through;
  background: color-mix(in srgb, var(--filter-hide) 12%, var(--panel-2));
}
.cat-chip.is-hide em { color: var(--filter-hide); text-decoration: none; }
/* A three-step cycle is not discoverable from a tooltip, so it is written down once. */
.cat-hint { font-size: 11px; color: var(--muted); white-space: nowrap; }

@media (max-width: 720px) {
  /* One scrolling line, not a wrapping block. A phone fits two chips per line, so nine
     sections wrap to five - 169px of chips on top of a page whose first card already sat
     at 713px of an 844px screen, which put the gallery below the fold. Swiping a row of
     chips is the ordinary phone idiom and costs one line instead of five.
     The hint goes with it: there is no room, and on touch the cycle is discovered by
     tapping, which is cheap and reversible. */
  .category-chips {
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
    max-height: none; padding-bottom: 2px;
    /* Basis 0, not auto: with `auto` the basis is the un-wrapped width of nine chips, the
       row claims the whole line, and Clear wraps below it - 44px of height for a button
       that fits beside them. */
    flex: 1 1 0; scrollbar-width: none;
  }
  .category-chips::-webkit-scrollbar { display: none; }
  .cat-chip { flex: 0 0 auto; }
  .cat-hint { display: none; }
}

/* ================================================================ mobile
   Additive: every rule is scoped to a phone width or to a coarse pointer, so the
   desktop screens keep the layout they already had.

   It fixes four things that made the portal unusable on a phone:
     1. the sidebar linearised into 422px of navigation above every page's content;
     2. the viewer stacked metadata / render / decision, so the image the author is
        meant to judge sat below the fold at 56vh;
     3. browsing and comparing were keyboard-only (arrows), which a phone has not got;
     4. .thumb-actions are revealed on :hover, which touch never fires.

   Motion is transform/opacity only so it stays on the compositor, and the existing
   prefers-reduced-motion rule already neutralises all of it. */

:root {
  --appbar-h: 54px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* Chrome that only exists on phones. Hidden by default so a desktop DOM carrying
   these elements looks exactly as it did before. */
.appbar, .nav-scrim, .vstrip, .mbar, .vdots, .sheet-grip, .swipe-hint,
.sheet-scrim { display: none; }

/* The sheet wraps the two viewer columns on every screen size, but above the phone
   breakpoint it must not exist as far as layout is concerned: `display: contents`
   promotes viewer-left / viewer-right back into .viewer's own grid, so the desktop
   layout is unchanged. */
.viewer-sheet { display: contents; }

/* Wrapping the two columns put viewer-right immediately after viewer-left in the DOM, so
   grid auto-placement would fill the three desktop tracks as metadata / decision / render
   and stand the render in the right-hand column. State the intended order instead of
   depending on source order. The phone block overrides .viewer-stage below. */
#viewer-left { order: 1; }
.viewer-stage { order: 2; }
#viewer-right { order: 3; }

/* ---------------------------------------------------------------- touch input */
/* Applies to any coarse pointer regardless of width - a tablet has the same problem. */
@media (hover: none) {
  /* Hover-revealed controls can never be reached. Show them, quietly. */
  .thumb-actions { opacity: 1; transform: none; }
  .thumb-actions .mini { background: var(--overlay-control-touch); backdrop-filter: blur(6px); }

  /* Hover transforms never fire, so give touch its own press feedback. */
  .card:hover, .nav-item:hover, .pass-btn:hover, .tag:hover,
  .variant-btn:hover, .mini:hover, .btn:hover { transform: none; }
  .card:active { transform: scale(.985); }
  .btn:active, .mini:active, .variant-btn:active, .pass-btn:active { transform: scale(.96); }
  .viewer-close:hover { transform: none; }

  /* 44px minimum, and no grey flash on tap. */
  a, button, .btn, .mini, .variant-btn, .card, .nav-item { -webkit-tap-highlight-color: transparent; }
  .mini { min-width: 44px; min-height: 44px; }
  .variant-btn { min-height: 44px; }
  .viewer-close { width: 44px; height: 44px; }
}

/* ---------------------------------------------------------------- phone shell */
@media (max-width: 760px) {
  .appbar {
    display: flex; align-items: center; gap: 4px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 70;
    height: calc(var(--appbar-h) + var(--safe-t));
    padding: var(--safe-t) calc(10px + var(--safe-r)) 0 calc(10px + var(--safe-l));
    background: var(--surface-appbar);
    backdrop-filter: blur(14px) saturate(1.3);
    border-bottom: 1px solid var(--line);
  }
  .appbar-btn {
    flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center;
    background: transparent; border: 0; border-radius: 12px; cursor: pointer;
    color: var(--text); padding: 0;
    transition: background var(--speed), transform var(--speed) var(--ease);
  }
  .appbar-btn:active { background: var(--panel-2); transform: scale(.92); }
  /* Three lines that become an X, driven by one class on <body>. */
  .burger { width: 20px; height: 14px; position: relative; display: block; }
  .burger i {
    position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px;
    background: currentColor;
    transition: transform 280ms var(--ease), opacity 180ms var(--ease);
  }
  .burger i:nth-child(1) { top: 0; }
  .burger i:nth-child(2) { top: 6px; }
  .burger i:nth-child(3) { top: 12px; }
  body.nav-open .burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.nav-open .burger i:nth-child(2) { opacity: 0; transform: scaleX(.4); }
  body.nav-open .burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .appbar-title {
    font-weight: 700; font-size: 15px; letter-spacing: -.2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  }
  .appbar-brand { margin-left: auto; flex: 0 0 auto; display: flex; align-items: center; }
  .appbar-brand svg { width: 26px; height: 26px; }

  /* The sidebar becomes a drawer. Transform-only so it slides at 60fps. */
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
    width: min(84vw, 320px); height: 100vh; height: 100dvh;
    padding: calc(20px + var(--safe-t)) 18px calc(20px + var(--safe-b));
    overflow-y: auto; overscroll-behavior: contain;
    border-right: 1px solid var(--line);
    transform: translate3d(-102%, 0, 0);
    transition: transform 320ms var(--ease);
    box-shadow: none;
  }
  body.nav-open .sidebar {
    transform: translate3d(0, 0, 0);
    box-shadow: 0 0 60px 0 var(--shadow-drawer);
  }
  .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 75;
    background: var(--scrim-nav); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity 300ms var(--ease);
  }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  /* The viewer is a fixed overlay at z-index 60 and the bar sits at 70, so the bar
     would float over the render. While the viewer is open there is nothing the bar is
     for - its own close button and the decision bar cover the screen. */
  body.viewer-open .appbar { display: none; }
  /* Gameplay and sync mode are the same: full-screen overlays inside the page's stacking
     context, so the bar was drawn over gameplay's Finalise, Changes and Exit and over sync
     mode's Done - and a phone has no Esc. Every look, legacy included (proposal B01). */
  body.gameplay-open .appbar, body.sync-open .appbar { display: none; }

  .shell > .main { padding: calc(var(--appbar-h) + var(--safe-t) + 16px) 14px 40px; }

  /* The bar already carries the page title. Repeating it costs ~90px of a 660px screen,
     so it goes - but only when the two strings are identical, which effects.js checks. */
  body.title-in-bar .main h1 { display: none; }
  body.title-in-bar .page-head { margin-bottom: 14px; }

  h1 { font-size: 23px; }
  h2 { font-size: 17px; margin: 26px 0 12px; }
  .page-head { margin-bottom: 18px; }

  /* Two columns of thumbnails reads far better than one giant card per screen. */
  .grid { gap: 11px; }
  .grid.chars { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .grid.thumbs { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); }
  .grid.core { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  /* A count pill is one token. In a 165px card it was breaking between the icon and the
     number, which turned a 24px pill into a 43px blob. */
  .pill { white-space: nowrap; }
  .counts { flex-wrap: wrap; row-gap: 5px; }

  .card-body { padding: 10px 11px 12px; }
  .card-title { font-size: 13px; }
  .card-meta { font-size: 11px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .pass-bar { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .pass-btn { scroll-snap-align: start; }

  /* ------------------------------------------------------------ viewer */
  /* Render first, everything else out of the way until asked for. */
  .viewer.open {
    display: flex; flex-direction: column;
    overscroll-behavior: contain;
    padding: 0;
  }
  .viewer-stage {
    order: -1; flex: 1 1 auto; min-height: 0;
    padding: calc(var(--safe-t) + 8px) 8px 4px;
    /* pinch-zoom, not none: the browser keeps zoom (reviewers do want to inspect a
       face at full resolution) while single-finger panning is left to the gesture
       layer. The handler bails out as soon as a second pointer arrives. */
    touch-action: pinch-zoom;
  }
  .viewer-stage img {
    max-height: 100%; max-width: 100%; width: auto; object-fit: contain;
    animation: none;                    /* JS drives directional enter/exit instead */
    will-change: transform, opacity;
  }
  .viewer-close {
    top: calc(var(--safe-t) + 10px); right: calc(var(--safe-r) + 12px);
    background: var(--overlay-glass); backdrop-filter: blur(8px);
  }

  /* Variant dots - the comparison indicator, iOS page-control style. */
  .vdots {
    display: flex; justify-content: center; align-items: center; gap: 9px;
    flex: 0 0 auto; padding: 6px 0 2px; min-height: 26px;
  }
  .vdot {
    width: 8px; height: 8px; border-radius: 50%; padding: 0; cursor: pointer;
    border: 0; background: var(--dot-idle);
    transition: transform 240ms var(--ease), background 240ms;
  }
  .vdot.active { background: var(--accent); transform: scale(1.5); }
  .vdot.finalised { background: var(--verdict-finalised); }
  .vdot.changes { background: var(--verdict-changes); }
  .vdot::after {                        /* 44px touch target around an 8px dot */
    content: ""; position: absolute; inset: -18px;
  }
  .vdot { position: relative; }

  /* Title strip: what you are looking at, and the way into the detail. */
  .vstrip {
    display: flex; align-items: center; gap: 12px; flex: 0 0 auto;
    padding: 8px 14px; border-top: 1px solid var(--line);
    background: var(--overlay-glass); backdrop-filter: blur(10px);
  }
  .vstrip-main { min-width: 0; flex: 1 1 auto; }
  .vstrip-title {
    font-weight: 700; font-size: 15px; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .vstrip-sub {
    font-size: 11px; letter-spacing: .6px; text-transform: uppercase;
    color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .vstrip-count {
    flex: 0 0 auto; font-size: 11px; color: var(--muted);
    font-variant-numeric: tabular-nums; letter-spacing: .3px;
  }
  .vstrip-more {
    flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
    background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
    border-radius: var(--radius-pill); padding: 9px 14px; font: inherit; font-size: 12.5px;
    font-weight: 700; cursor: pointer; min-height: 40px;
    transition: transform 200ms var(--ease), border-color 200ms;
  }
  .vstrip-more:active { transform: scale(.95); }
  .vstrip-more .chev { transition: transform 300ms var(--ease); }
  body.sheet-open .vstrip-more .chev { transform: rotate(180deg); }

  /* Decision bar: the point of the screen, permanently in thumb reach. */
  .mbar {
    display: grid; grid-template-columns: 46px 1fr 1fr 46px; gap: 8px;
    align-items: center; flex: 0 0 auto;
    padding: 8px calc(10px + var(--safe-r)) calc(8px + var(--safe-b)) calc(10px + var(--safe-l));
    background: var(--surface-actionbar); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .mbar-btn {
    min-height: 46px; border-radius: 13px; cursor: pointer; font: inherit;
    font-weight: 700; font-size: 13.5px; padding: 0 10px;
    border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: transform 160ms var(--ease), border-color 200ms, background 200ms;
  }
  .mbar-btn:active { transform: scale(.95); }
  .mbar-btn.finalise[aria-pressed="true"] {
    border-color: var(--verdict-finalised); background: color-mix(in srgb, var(--verdict-finalised) 20%, var(--panel-2));
  }
  .mbar-btn.changes[aria-pressed="true"] {
    border-color: var(--verdict-changes); background: color-mix(in srgb, var(--verdict-changes) 20%, var(--panel-2));
  }
  .mbar-nav { font-size: 19px; padding: 0; }

  /* Detail sheet. Holds the two desktop columns; slides over the render on request. */
  .viewer-sheet {
    display: block; position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
    max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--panel); border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -24px 60px -24px var(--shadow-deep);
    transform: translate3d(0, 100%, 0);
    transition: transform 360ms var(--ease);
    padding-bottom: calc(18px + var(--safe-b));
    will-change: transform;
  }
  body.sheet-open .viewer-sheet { transform: translate3d(0, 0, 0); }
  .viewer-sheet.dragging { transition: none; }
  .sheet-grip {
    display: block; position: sticky; top: 0; z-index: 2;
    padding: 10px 0 6px; background: var(--panel);
    border-radius: 20px 20px 0 0; cursor: grab; touch-action: none;
  }
  .sheet-grip::before {
    content: ""; display: block; width: 42px; height: 4px; margin: 0 auto;
    border-radius: 2px; background: var(--sheet-grip);
  }
  .viewer-sheet .viewer-col { padding: 4px 18px 0; overflow: visible; }
  .sheet-scrim {
    display: block;
    position: absolute; inset: 0; z-index: 3; background: var(--scrim-sheet);
    opacity: 0; pointer-events: none; transition: opacity 320ms var(--ease);
  }
  body.sheet-open .sheet-scrim { opacity: 1; pointer-events: auto; }

  /* The desktop nav row inside the sheet is redundant next to .mbar. */
  .viewer-sheet .nav-arrows { display: none; }

  /* One-time gesture hint. */
  .swipe-hint {
    display: flex; flex-direction: column; gap: 6px; align-items: center;
    position: absolute; left: 50%; top: 50%; z-index: 5;
    transform: translate(-50%, -50%);
    padding: 16px 22px; border-radius: 16px; pointer-events: none;
    background: var(--overlay-hint); backdrop-filter: blur(10px);
    border: 1px solid var(--line); font-size: 12.5px; color: var(--text);
    animation: hintFade 3200ms var(--ease) forwards;
  }
  .swipe-hint b { color: var(--accent); }
  @keyframes hintFade {
    0% { opacity: 0; transform: translate(-50%, -46%) scale(.96); }
    12%, 74% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -54%) scale(.98); }
  }
}

/* Narrow phones: the decision labels lose their words before they lose their meaning. */
@media (max-width: 380px) {
  .mbar { grid-template-columns: 44px 1fr 1fr 44px; gap: 6px; }
  .mbar-btn { font-size: 12px; }
  .mbar-btn .label { display: none; }
}

/* Landscape phone: keep the render tall by dropping the strip. */
@media (max-width: 900px) and (max-height: 480px) and (orientation: landscape) {
  .vstrip { display: none; }
  .viewer-stage { padding-top: 4px; }
  .mbar { grid-template-columns: 44px 1fr 1fr 44px; padding-top: 4px; padding-bottom: 4px; }
}

/* ================================================================ polish
   Added 2026-07-31. Four measured defects, in the order they were found. Everything
   below is additive: no existing rule is edited, and the desktop layout at 1280px is
   unchanged except where a defect was visible there too. */

/* ---------------------------------------------------------------- 1. character page
   The two-column profile layout was an inline `grid-template-columns: 300px 1fr` on the
   template, and an inline style outranks every media query - so it never collapsed and the
   whole right-hand column sat off the side of a 390px screen. It is a class now. */
.char-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start;
}
.kv-tally { grid-template-columns: 1fr auto; }

/* ---------------------------------------------------------------- 2. card interiors
   Cards in a row are already equal height - grid stretches them. What was ragged is the
   inside: a one-line role and a three-line role pushed their count pills to different
   heights, so a row of cards read as misaligned. Pin the pills to the bottom and cap the
   role at two lines, and every row lines up whatever the copy does. */
.card { display: flex; flex-direction: column; }
.card-media { flex: 0 0 auto; }
.card-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.card-meta {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-counts { margin-top: auto; padding-top: 9px; flex-wrap: wrap; }
.counts { flex-wrap: wrap; row-gap: 6px; }

/* ---------------------------------------------------------------- 3. keyboard focus
   There was no focus style on buttons, links, cards or nav items - only two inputs had
   one. Keyboard users got whatever the browser drew on near-black. `:focus-visible` keeps
   it off mouse clicks. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.card:focus-visible, .pass-btn:focus-visible, .nav-item:focus-visible {
  outline-offset: 3px;
}
.btn:focus-visible { outline-offset: 3px; }
.field input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

/* ---------------------------------------------------------------- 4. touch targets
   The existing coarse-pointer block lifted .mini, .variant-btn and .viewer-close to 44px
   but stopped there. Measured at 390px, these were still under it: the app-bar button at
   42px, .btn.small at 31px tall, the sidebar's text links at 14px, and the password
   fields at 42px. Height only - widths stay content-sized so nothing reflows. */
@media (hover: none) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .field input { min-height: 44px; }
  .pass-btn { min-height: 44px; }
  .tag { min-height: 32px; display: inline-flex; align-items: center; }
  /* Text links in a run of prose keep their size; standalone ones get a real hit area. */
  .sidebar-foot a, .page-head .sub > a { display: inline-block; padding: 11px 0; }
  .sidebar-foot form .btn { width: 100%; justify-content: center; }
}

/* ---------------------------------------------------------------- phone refinements */
@media (max-width: 760px) {
  /* The app-bar button was the one phone-only control that undershot the phone-only
     44px floor. */
  .appbar-btn { width: 44px; height: 44px; }

  /* Collapse the profile layout. 300px + gap + content does not fit in 390px. */
  .char-layout { grid-template-columns: 1fr; gap: 14px; }
  /* The portrait is the page's anchor, not a 300px column of it - but full width makes it
     a 480px-tall wall above the text. Cap it and centre it. */
  .char-layout > div:first-child .card { max-width: 320px; margin: 0 auto; }
  /* 140px of label against 150px of value is not a two-column layout. */
  .kv { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .kv dd { text-align: right; }

  /* Prose was set at the desktop size and ate the first screen before any content. */
  /* Keep the app-bar offset from the rule above; only the sides and foot change. */
  .shell > .main { padding-left: 16px; padding-right: 16px; padding-bottom: 48px; }
  .page-head { margin-bottom: 18px; gap: 12px; }
  h1 { font-size: 24px; }
  h2 { font-size: 17px; margin: 24px 0 12px; }
}

/* The last two measured targets: the app-bar mark is a link home, and the sidebar's
   "Change password" landed at 40px once it had padding. Both now clear 44 without the
   26px logo or the 14px type changing size. */
@media (hover: none) {
  .sidebar-foot a, .page-head .sub > a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 760px) {
  .appbar-brand { min-width: 44px; min-height: 44px; justify-content: center; }
}

/* ---------------------------------------------------------------- 5. line length
   Measured at 125 characters per line at 1280px and 147 at 1600px and wider. Comfortable
   reading is 45-75; past about 90 the eye loses the start of the next line. Capping the
   measure - not the page - keeps the grids full-width and only reins in prose. */
.sub, .panel > p, .warnbar { max-width: 78ch; }

/* The drawer opens underneath the fixed app bar, which left its brand mark tucked behind
   the bar. Clear the bar's height so the drawer starts below it. */
@media (max-width: 760px) {
  .sidebar { padding-top: calc(var(--appbar-h) + var(--safe-t) + 16px); }
}

/* ── Gameplay mode (Render Review) ───────────────────────────────────────────
   The part played as it will ship: render full-bleed, Ren'Py-style text box over it.
   Sits above .viewer (z-index 60) because the two are never open together, and the
   grid's fullscreen viewer must not surface through it. */
.gameplay {
  position: fixed; inset: 0; z-index: 70; display: none;
  background: var(--stage-black); cursor: pointer; user-select: none;
}
.gameplay.is-open { display: block; }
body.gameplay-open { overflow: hidden; }

.gp-stage { position: absolute; inset: 0; display: grid; place-items: center; }
/* contain, not cover: a render is being judged on its framing, so it must never be
   cropped to fit the window the way a decorative background would be. */
.gp-render { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.gp-noimage {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted); text-align: center;
}
.gp-noimage .ph-icon { font-size: 40px; opacity: .5; }

.gp-hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--overlay-hud), transparent);
}
.gp-hud-left, .gp-hud-right { display: flex; align-items: center; gap: 8px; }
.gp-chip {
  font-family: var(--font-mono-ui); font-size: 12px;
  padding: 5px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--glass); color: var(--accent);
}
.gp-chip.subtle { color: var(--muted); }

.gp-textbox {
  position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%);
  width: min(1000px, calc(100% - 48px)); z-index: 2;
  padding: 18px 22px 20px; border-radius: var(--radius-lg);
  border: 1px solid var(--line); background: var(--surface-textbox);
  backdrop-filter: blur(10px);
}
.gp-who {
  font-weight: 800; font-size: 14px; letter-spacing: .4px; margin-bottom: 6px;
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gp-line { font-size: 18px; line-height: 1.55; min-height: 1.55em; }
.gp-line.is-thought { font-style: italic; color: var(--script-thought); }
.gp-line.is-narration { color: var(--script-narration); }
.gp-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.gp-choice {
  padding: 9px 13px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text); font-size: 14px;
}
.gp-advance {
  position: absolute; right: 16px; bottom: 8px;
  color: var(--muted); font-size: 12px; animation: gp-bob 1.4s var(--ease) infinite;
}
@keyframes gp-bob { 0%, 100% { transform: translateY(0); opacity: .45; }
                    50% { transform: translateY(3px); opacity: 1; } }

.gp-help {
  position: absolute; left: 0; right: 0; bottom: 12px; z-index: 2;
  text-align: center; font-size: 11px; color: var(--muted);
}
.gp-help strong { color: var(--text-help-strong); }

@media (prefers-reduced-motion: reduce) {
  .gp-advance { animation: none; opacity: .7; }
}

/* Phone: the text box takes the full width and the help line goes, because a touch
   user has no keys to be told about. */
@media (max-width: 720px) {
  .gp-textbox { width: calc(100% - 20px); bottom: 16px; padding: 14px 16px 16px; }
  .gp-line { font-size: 16px; }
  .gp-help { display: none; }
  .gp-hud { padding: 10px 12px; }
}

/* ── Gameplay: status chip and progress strip (new themes) ──────────────────
   Layout proposals B01, B05, B06. Legacy keeps the help line and draws neither: both are
   `nl-only`. The picture is untouched - the chip sits in the existing top bar and the strip
   in the help line's own space at the bottom, so the stage and the render keep their size.
   Colours are the shared status tokens and the on-stage neutral greys; a theme restyles
   them through those tokens, not here. */
.gp-status, .gp-strip { display: none; }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-hud-left,
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-hud-right { min-width: 0; }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-chip,
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-hud .btn { white-space: nowrap; }

/* B05: the render's status, beside its number. Same chip, swatch and glyph as the gallery. */
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-status:not(.is-empty) {
  display: inline-flex; padding: 5px 10px; white-space: nowrap; cursor: default;
}

/* B06: the strip. Labels above the rail, ticks across it, "?" for the keys at its end. */
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-help { display: none; }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-strip {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 2;
  width: min(1000px, calc(100% - 48px)); height: 32px;
  align-items: flex-end; gap: 14px; cursor: default;
}
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-track {
  position: relative; flex: 1 1 auto; min-width: 0; height: 32px; cursor: pointer; outline: none;
}
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-rail,
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-fill {
  position: absolute; left: 0; bottom: 8px; height: 3px; border-radius: 2px;
}
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-rail { right: 0; background: rgba(255, 255, 255, .18); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-fill { background: var(--accent); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-ticks { position: absolute; inset: 0; pointer-events: none; }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-tick {
  position: absolute; bottom: 5px; width: 2px; height: 9px; margin-left: -1px;
  background: rgba(255, 255, 255, .38);
}
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-tick.done { background: var(--accent); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-tick.now {
  bottom: 2px; width: 4px; height: 15px; margin-left: -2px; background: #fff;
}
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-marks { position: absolute; inset: 0; pointer-events: none; }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: auto;
  display: flex; align-items: center; gap: 4px; height: 16px; padding: 0 3px; margin: 0;
  background: none; border: 0; border-radius: 3px; cursor: pointer;
  font: 600 10.5px/1 var(--font-mono-ui); color: var(--rv-caption-text); white-space: nowrap;
}
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark:hover,
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark:focus-visible { color: var(--rv-caption-now); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark.no-label .gp-mark-label { display: none; }
/* Reached with Tab and worked with Space / Enter, so the focus must show (neutral, on the stage). */
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark:focus-visible,
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-keys > summary:focus-visible {
  outline: 2px solid var(--rv-caption-now); outline-offset: 2px;
}
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark { --st: var(--muted); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark.st-changes_artist { --st: var(--st-changes-artist); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark.st-changes_ai { --st: var(--st-changes-ai); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark.st-erroneous { --st: var(--st-erroneous); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark.st-ready { --st: var(--st-ready); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark.st-final_done { --st: var(--st-final); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark.st-production { --st: var(--st-production); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--st);
}
/* The gallery's own swatch language: draft hollow, AI dashed, nothing uploaded dotted. */
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark.st-draft .gp-dot { background: transparent; border: 1px solid var(--rv-caption-text); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark.st-changes_ai .gp-dot { background: transparent; border: 2px dashed var(--st); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark.is-missing .gp-dot { background: transparent; border: 1px dotted var(--rv-caption-text); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-keys { position: relative; flex: 0 0 auto; margin-bottom: 0; }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-keys > summary {
  list-style: none; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--glass);
  color: var(--rv-caption-text); font-size: 12px; font-weight: 700; cursor: pointer;
}
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-keys > summary::-webkit-details-marker { display: none; }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-keys[open] > summary { color: var(--rv-caption-now); border-color: var(--rv-caption-text); }
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-keys-pop {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 3;
  width: max-content; max-width: min(520px, calc(100vw - 32px));
  padding: 10px 14px; font-size: 12px; line-height: 1.6; color: var(--text);
  background: var(--surface-textbox); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(10px);
}
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-keys-pop strong { color: var(--text-help-strong); }
@media (min-width: 721px) {
  :root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-strip { display: flex; }
}
/* B01: on a phone the top bar's controls must fit, in Ukrainian too. A behaviour fix, so
   every look, legacy included: no label wraps inside its button or chip (legacy's Finalise
   spilled out of its box at 390), and when the two groups cannot sit side by side they
   stack instead of squeezing. The new themes also tighten the padding. The strip stays
   off, as the help line is today (no keys to point at). */
@media (max-width: 720px) {
  #gameplay .gp-hud { flex-wrap: wrap; row-gap: 8px; }
  #gameplay .gp-hud-left, #gameplay .gp-hud-right { flex-wrap: wrap; }
  #gameplay .gp-hud-right { margin-left: auto; }
  #gameplay .gp-chip, #gameplay .gp-hud .btn { white-space: nowrap; }
  :root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-hud { padding: 10px; gap: 6px; }
  :root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-hud-left,
  :root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-hud-right { gap: 6px; }
  :root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-hud .btn { padding-inline: 9px; }
  :root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-chip { padding-inline: 8px; }
}

/* ── Gameplay: the shot's angles ─────────────────────────────────────────────
   A shot delivered from several camera angles shows a count chip and one numbered button
   per angle in the top bar (gameplay.js). Every look, legacy and phones included: legacy
   has no strip and a phone hides it, so this is the one place the angles show. The dot is
   the angle's status in the gallery's colours; ✓ marks an approved angle, ★ the one the
   script plays when no angle is approved yet. Chrome only - the picture is untouched. */
#gameplay .gp-angles { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
#gameplay .gp-angles[hidden] { display: none; }
/* The buttons are the top bar's own `.btn.ghost.small`, so each look draws them as it draws
   Finalise and Exit (riso's paper keys, win2000's raised face); only the size and the
   on-state are set here. The on-state is a ring in the button's own text colour, so it
   holds its contrast in every look. */
#gameplay .gp-angle { --st: var(--muted); gap: 4px; min-width: 34px; padding-inline: 8px;
                      font-variant-numeric: tabular-nums; white-space: nowrap; }
#gameplay .gp-angle.is-on { box-shadow: inset 0 0 0 2px currentColor; font-weight: 800; }
#gameplay .gp-angle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
#gameplay .gp-angle-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--st);
}
#gameplay .gp-angle.st-draft .gp-angle-dot { background: transparent; border: 1px solid currentColor; }
#gameplay .gp-angle.st-changes_artist { --st: var(--st-changes-artist); }
#gameplay .gp-angle.st-changes_ai { --st: var(--st-changes-ai); }
#gameplay .gp-angle.st-changes_ai .gp-angle-dot { background: transparent; border: 2px dashed var(--st); }
#gameplay .gp-angle.st-erroneous { --st: var(--st-erroneous); }
#gameplay .gp-angle.st-ready { --st: var(--st-ready); }
#gameplay .gp-angle.st-final_done { --st: var(--st-final); }
#gameplay .gp-angle.st-production { --st: var(--st-production); }
#gameplay .gp-angle.st-none .gp-angle-dot { background: transparent; border: 1px dotted currentColor; }
/* The strip's dots say how many angles a shot has, beside its number. */
:root[data-theme]:not([data-theme="legacy"]) #gameplay .gp-mark-angles {
  margin-left: 3px; font-weight: 500;
}

/* ── Render Review catalogue: slim empty parts, episode progress (new themes) ──
   Layout proposals B08 and B09. Legacy draws none of it: the new markup is `nl-only` and
   every rule here is scoped to the new themes.

   B08, the episode page (renders_episode.html): a part with no delivery (`.card.is-empty`,
   "briefed" or "script only") is one slim line - a small icon in the cover column, its
   name, its state and its count - and stays the one link to its part. Parts with renders
   keep their picture. Each theme's parts list is its own grid (`--pl-cols`); a theme whose
   rows are not already four columns gives slim rows `--pl-slim-cols` in its own end
   section, so the name column starts where the full rows' does. */
@media (min-width: 761px) {
  :root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty { grid-template-columns: var(--pl-slim-cols, var(--pl-cols)); row-gap: 0; }
  :root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .card-media { grid-column: 1; grid-row: 1; }
  :root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .card-title { grid-column: 2; grid-row: 1; align-self: center; }
  :root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .card-meta { grid-column: 3; grid-row: 1; align-self: center; }
  :root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .card-counts { grid-column: 4; grid-row: 1; align-self: center; }
}
@media (max-width: 760px) {
  :root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty { grid-template-columns: var(--pl-cover) minmax(0, 1fr) auto; row-gap: 2px; align-items: center; }
  :root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .card-media { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  :root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .card-title { grid-column: 2; grid-row: 1; align-self: end; }
  :root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .card-meta { grid-column: 2; grid-row: 2; align-self: start; }
  :root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .card-counts { grid-column: 3; grid-row: 1 / span 2; align-self: center; justify-content: flex-end; padding-top: 0; }
}
:root[data-theme]:not([data-theme="legacy"]) .parts-list > .card-wrap:has(> .card.is-empty) { padding-block: 6px; }
:root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .card-media {
  aspect-ratio: auto; height: 24px; margin-block: 0; background: none; border: 0; box-shadow: none;
}
:root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .placeholder { height: 100%; min-height: 0; padding: 0; background: none; border: 0; }
:root[data-theme]:not([data-theme="legacy"]) .parts-list .card.is-empty .placeholder .ph-text { display: none; }

/* B09, the episodes index (renders.html): each episode says its numbers in words and draws
   one bar - a segment per render in its status colour, frames not yet delivered dashed -
   with a key under it. All from the counts the card already had; the pills those numbers
   were (`ep-in-bar`, the status pills) are not drawn here. The bar sits under the card's
   text, never on the picture. The verdict count and the replaced-picture flag stay. */
:root[data-theme]:not([data-theme="legacy"]) .card-counts > .ep-in-bar,
:root[data-theme]:not([data-theme="legacy"]) .card-counts > .st-pill:not(.st-replaced_other),
:root[data-theme]:not([data-theme="legacy"]) .card-counts.ep-counts-in-bar { display: none; }
:root[data-theme]:not([data-theme="legacy"]) .ep-progress-facts { display: block; margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
:root[data-theme]:not([data-theme="legacy"]) .ep-progress { display: flex; gap: 2px; height: 8px; margin-top: 10px; border-radius: var(--radius-pill); overflow: hidden; }
:root[data-theme]:not([data-theme="legacy"]) .ep-progress .ep-seg { flex: 1 1 0; min-width: 4px; background: var(--st); }
:root[data-theme]:not([data-theme="legacy"]) .ep-progress .st-awaiting { background: transparent; border: 1px dashed var(--muted); border-radius: inherit; }
/* Delivered, but no card resolved for it: neutral, hatched, never a status colour. */
:root[data-theme]:not([data-theme="legacy"]) .ep-progress .st-unsorted { background: repeating-linear-gradient(135deg, var(--muted) 0 2px, transparent 2px 5px); }
/* No frames at all: the same bar, an empty track, so every card has the same parts. */
:root[data-theme]:not([data-theme="legacy"]) .ep-progress.is-empty { border: 1px dashed var(--line); background: transparent; }
:root[data-theme]:not([data-theme="legacy"]) .ep-progress-key {
  display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; padding: 0; list-style: none;
  font-size: 11.5px; line-height: 1.4; color: var(--muted);
}
:root[data-theme]:not([data-theme="legacy"]) .ep-progress-key li { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
:root[data-theme]:not([data-theme="legacy"]) .ep-progress-key em { font-style: normal; color: var(--text); font-variant-numeric: tabular-nums; }
:root[data-theme]:not([data-theme="legacy"]) .ep-progress-key .ep-swatch { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
:root[data-theme]:not([data-theme="legacy"]) .ep-progress-key .st-awaiting .ep-swatch { background: transparent; border: 1px dashed var(--muted); }
:root[data-theme]:not([data-theme="legacy"]) .ep-progress-key .st-unsorted .ep-swatch { border-radius: 2px; background: repeating-linear-gradient(135deg, var(--muted) 0 2px, transparent 2px 4px); }
:root[data-theme]:not([data-theme="legacy"]) :is(.ep-progress, .ep-progress-key) .st-draft { --st: var(--muted); }
:root[data-theme]:not([data-theme="legacy"]) :is(.ep-progress, .ep-progress-key) .st-changes_artist { --st: var(--st-changes-artist); }
:root[data-theme]:not([data-theme="legacy"]) :is(.ep-progress, .ep-progress-key) .st-changes_ai { --st: var(--st-changes-ai); }
:root[data-theme]:not([data-theme="legacy"]) :is(.ep-progress, .ep-progress-key) .st-erroneous { --st: var(--st-erroneous); }
:root[data-theme]:not([data-theme="legacy"]) :is(.ep-progress, .ep-progress-key) .st-ready { --st: var(--st-ready); }
:root[data-theme]:not([data-theme="legacy"]) :is(.ep-progress, .ep-progress-key) .st-final_done { --st: var(--st-final); }
:root[data-theme]:not([data-theme="legacy"]) :is(.ep-progress, .ep-progress-key) .st-production { --st: var(--st-production); }

/* ── Merge picker (Render Review) ────────────────────────────────────────────
   "Merge as alternative of which render?" — a grid of the scene's other renders,
   picked by eye. Sits inside .viewer and above it, because the author is choosing
   against the picture they already have open. */
.picker {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center; padding: 24px;
  background: var(--overlay-strong); backdrop-filter: blur(6px);
}
.picker-panel {
  width: min(920px, 100%); max-height: 100%;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--panel); overflow: hidden;
}
.picker-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.picker-head h4 {
  margin: 0; font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--accent);
}
.picker-grid {
  display: grid; gap: 10px; padding: 14px; overflow-y: auto;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  /* Rows size to their content and the grid scrolls, rather than being stretched to fill
     the panel. */
  align-content: start;
}
/* No `overflow: hidden` here, however much the rounded corners want it: on a grid item it
   zeroes the automatic minimum height, and Chromium then sized these auto rows to 46px -
   short enough to clip every label away and leave a wall of unlabelled thumbnails. The
   image rounds its own top corners instead. Measured: 46px rows with it, 164px without. */
.picker-item {
  display: flex; flex-direction: column; gap: 7px; padding: 0 0 9px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2); color: var(--text);
  text-align: left; cursor: pointer;
  transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.picker-item:hover, .picker-item:focus-visible {
  border-color: var(--accent); transform: translateY(-2px); outline: none;
}
.picker-item img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.picker-blank {
  width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center;
  background: var(--panel-3); color: var(--muted); font-size: 11px;
  letter-spacing: 1.2px; text-transform: uppercase;
}
.picker-label { padding: 0 10px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.picker-label strong { color: var(--text); font-size: 13px; }

@media (max-width: 720px) {
  .picker { padding: 12px; }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* An entry with nothing delivered. Dashed, so a gap in a delivery reads as a gap at a
   glance rather than as a card that failed to load, and it carries the brief's own
   description — an outstanding render is only actionable if you can see what was ordered. */
.thumb.is-missing { border-style: dashed; }
.thumb.is-missing .card-title { color: var(--text-missing-title); }
.card-desc {
  margin-top: 7px; font-size: 11.5px; line-height: 1.45; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------------------------------------------------------- artist accounts */
/* The Missing button. Rose rather than the site's cyan, and unmuted: it is the only
   control an artist has, and a request they do not file costs a whole authoring pass. */
.btn.missing {
  --btn-accent: var(--missing);
  border-color: color-mix(in srgb, var(--missing) 60%, transparent);
  background: color-mix(in srgb, var(--missing) 16%, var(--panel-2));
  color: var(--missing-text); font-weight: 700;
}
.btn.missing:hover {
  border-color: var(--missing);
  background: color-mix(in srgb, var(--missing) 28%, var(--panel-2));
  box-shadow: 0 14px 34px -18px var(--missing);
}

.nav-badge { margin-left: 6px; vertical-align: middle; }

.filterbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px;
}
.filterbar .note-input { margin-top: 0; min-height: 0; width: auto; flex: 1 1 320px; max-width: 420px; }
.filterbar select.note-input { flex: 0 0 auto; }

/* The preset id, as a control rather than a caption: it is what an artist pastes into a
   brief, so copying it is the point of showing it. */
.preset-id {
  margin-top: 8px; padding: 3px 8px; border-radius: 7px; cursor: pointer;
  font-family: var(--font-mono-ui); font-size: 11px;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--muted);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color var(--speed), color var(--speed);
}
.preset-id:hover { border-color: var(--accent); color: var(--text); }
.expr-card { margin: 0; cursor: zoom-in; }

/* ------------------------------------------------------------------ dialogs */
.dialog, .lightbox {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--panel); color: var(--text); padding: 0;
}
.dialog::backdrop, .lightbox::backdrop { background: var(--scrim); }
.dialog { width: min(560px, 92vw); padding: 26px 28px 22px; }
.dialog h2 { font-size: 19px; }
.dialog .note-input { margin-top: 0; }
.dialog select.note-input { min-height: 0; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.dialog-error {
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin: 0 0 4px;
  background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger-text);
}
/* Refresh script (script_refresh.js): ids, line numbers and counts - long lists wrap. */
.script-refresh-body { max-height: 60vh; overflow-y: auto; color: var(--text); overflow-wrap: anywhere; }
.script-refresh-list { margin: 10px 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; }
/* Download part (part_download.js): tokens only, so every theme restyles it. */
.pd-options { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 10px 0;
  display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-primary); }
.pd-options legend { color: var(--text-muted); font-size: 12px; padding: 0 4px; }
.pd-options label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.pd-plan { color: var(--text-primary); overflow-wrap: anywhere; }
.pd-subhead { margin: 14px 0 6px; font-size: 14px; color: var(--text-secondary); }
.pd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 40vh; overflow-y: auto; }
.pd-row { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-sunken);
  color: var(--text-primary); overflow-wrap: anywhere; display: grid; gap: 4px; }
.pd-row.pd-ready { border-color: var(--accent); }
.pd-row.pd-failed { border-color: var(--rose); }
.pd-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pd-path code { font-size: 12px; overflow-wrap: anywhere; }
.pd-warn { color: var(--orange); }
.pd-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pd-progress { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.pd-progress span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.lightbox { width: min(1100px, 94vw); max-height: 92vh; overflow: hidden; }
.lightbox img { display: block; width: 100%; max-height: 82vh; object-fit: contain; background: var(--stage-black); }
.lightbox-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 16px; font-size: 13px; border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ requests */
.reqlist { display: flex; flex-direction: column; gap: 14px; }
.req { margin: 0; border-left: 3px solid var(--line); }
.req.req-open { border-left-color: var(--status-open); }
.req.req-accepted { border-left-color: var(--status-done); }
.req.req-declined { border-left-color: var(--muted); }
.req.req-withdrawn { border-left-color: var(--line); opacity: .65; }
.req-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.req-body { margin: 10px 0 0; white-space: pre-wrap; line-height: 1.55; }
.req-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
/* A translated button label can be longer than the English: the button keeps its width and
   the footer wraps instead of squeezing it. */
.req-foot { flex-wrap: wrap; }
.req-foot > .btn { flex: none; }
.req-answer {
  margin-top: 12px; padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.req-triage { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.req-triage .note-input { margin-top: 0; min-height: 0; flex: 1 1 260px; }
.pill.status-open { color: var(--status-open); border-color: color-mix(in srgb, var(--status-open) 45%, transparent); }
.pill.status-accepted { color: var(--status-done); border-color: color-mix(in srgb, var(--status-done) 45%, transparent); }
.pill.status-declined, .pill.status-withdrawn { opacity: .7; }

@media (max-width: 720px) {
  .filterbar .note-input { flex: 1 1 100%; }
  .dialog { width: 94vw; padding: 20px 18px 18px; }
  .req-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* --------------------------------------------------- faces submitted from Blender
   A submitted face is a request with a picture attached, so these read as requests do -
   a coloured spine for the state, the artist's words in the body - with the artist's own
   viewport grab beside it. That picture is the whole reason the layout is two columns:
   it is what the lab render gets compared against, and a caption nobody can see next to
   the thing it describes is a caption nobody reads. */
.subs { display: flex; flex-direction: column; gap: 14px; }
.sub-card {
  margin: 0; display: grid; grid-template-columns: 220px 1fr; gap: 18px;
  border-left: 3px solid var(--line);
}
.sub-card.status-new, .sub-card.status-claimed { border-left-color: var(--status-open); }
.sub-card.status-rendering { border-left-color: var(--accent); }
.sub-card.status-rendered { border-left-color: var(--status-done); }
.sub-card.status-failed { border-left-color: var(--status-failed); }
.sub-card.status-withdrawn { border-left-color: var(--line); opacity: .6; }

.sub-shot { position: relative; }
.sub-shot img {
  width: 100%; border-radius: var(--radius-sm); display: block;
  border: 1px solid var(--line); background: var(--panel-2);
}
.shot-tag {
  position: absolute; left: 8px; bottom: 8px; font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; padding: 3px 7px; border-radius: var(--radius-pill);
  background: var(--overlay-tag); color: var(--muted);
}
.shot-empty {
  display: grid; place-items: center; text-align: center; aspect-ratio: 4 / 5;
  border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--muted);
  font-size: 12px; line-height: 1.5;
}

.sub-body { min-width: 0; }
.sub-head {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  margin-bottom: 10px;
}
.sub-label { font-size: 15px; }
.sub-note { margin: 8px 0 0; line-height: 1.55; }
.field { display: block; margin-top: 10px; }
.field-label {
  display: block; font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 3px;
}
.sub-actions { display: flex; gap: 8px; margin-top: 12px; }
.sub-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 12px; flex-wrap: wrap;
}

/* The two boxes that must not be skimmed past. A warning about a lossy capture is the
   difference between a render the author trusts and one they should not. */
.sub-warn, .sub-error {
  margin-top: 12px; padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.sub-warn { border-left: 3px solid var(--warning); }
.sub-error { border-left: 3px solid var(--danger); }
.sub-warn ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.55; }
.sub-warn li { margin-bottom: 4px; }
.sub-error code {
  display: block; margin: 6px 0 0; padding: 8px 10px; border-radius: 8px;
  background: var(--surface-well); color: var(--danger); font-size: 12px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.sub-warn p.sub, .sub-error p.sub { margin: 8px 0 0; }

/* `subbatch`, not `batchbar`: Render Review already owns .batchbar, and its rule is
   `position: fixed; display: none` until the bar is opened - so a second, unrelated
   element wearing that class renders as nothing at all, with no error anywhere. */
.subbatch { margin-bottom: 16px; }
.subbatch p.sub { margin: 4px 0 10px; }
.subbatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* A pass name plus a translated count can be wider than a phone: let it wrap in the pill. */
.subbatch-row .pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* The door from a character to the faces artists have sent in for her. Deliberately not
   a `.btn`: it sits between the profile and the pass bar carrying a sentence, and it has
   to be findable at a glance on a page that is otherwise a wall of thumbnails. */
.submissions-door {
  display: flex; align-items: center; gap: 14px; margin: 22px 0 6px;
  padding: 14px 18px; border-radius: 14px; text-decoration: none;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.submissions-door:hover {
  transform: translateY(-2px); border-color: var(--border-active); background: var(--panel-3);
  text-decoration: none;
}
.submissions-door.has-work { border-color: color-mix(in srgb, var(--attention) 45%, transparent); }
.door-emoji { font-size: 26px; line-height: 1; }
.door-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.door-text small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.door-go { color: var(--accent); font-size: 18px; }

/* One row of answers under a submitted face. */
.sub-verdict {
  margin-top: 12px; padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-left: 3px solid var(--verdict-finalised);
}
.sub-verdict.is-changes { border-left-color: var(--verdict-submission-changes); }
.sub-verdict.is-declined { border-left-color: var(--muted); }
.sub-judge { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.sub-judge .note-input { margin-top: 0; min-height: 0; flex: 1 1 260px; }

.pill.status-declined { opacity: .75; }
.pill.status-approved { color: var(--status-done); border-color: color-mix(in srgb, var(--status-done) 45%, transparent); }

.pill.status-new, .pill.status-claimed { color: var(--status-open); border-color: color-mix(in srgb, var(--status-open) 45%, transparent); }
.pill.status-rendering { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pill.status-rendered { color: var(--status-done); border-color: color-mix(in srgb, var(--status-done) 45%, transparent); }
.pill.status-failed { color: var(--status-failed); border-color: color-mix(in srgb, var(--status-failed) 45%, transparent); }

@media (max-width: 860px) {
  /* The picture goes on top rather than shrinking: at 220px wide beside text it is
     already the smallest a face can usefully be. */
  .sub-card { grid-template-columns: 1fr; }
  .sub-shot img, .shot-empty { max-width: 320px; }
  .sub-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ── Sync mode (Render Review) ───────────────────────────────────────────────
   The renders on a ruler of script lines. Everything that moves says what it means:
   a card lifts when you pick it up, the tick it will land on lights up, the connector
   redraws as you drag, and the hold-to-open ring fills at exactly the speed of the
   hold it is measuring. */
.sync-btn {
  --btn-accent: var(--sync);
  background: linear-gradient(120deg,
              color-mix(in srgb, var(--sync) 22%, var(--panel-2)),
              color-mix(in srgb, var(--accent) 18%, var(--panel-2)));
  border-color: color-mix(in srgb, var(--sync) 45%, var(--line));
}
.sync-btn-glyph { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.sync-btn-glyph i {
  width: 3px; border-radius: 2px; background: var(--spectrum); background-size: 100% 300%;
  animation: sync-bob 1.8s var(--ease) infinite;
}
.sync-btn-glyph i:nth-child(1) { height: 7px; animation-delay: 0s; }
.sync-btn-glyph i:nth-child(2) { height: 13px; animation-delay: .18s; }
.sync-btn-glyph i:nth-child(3) { height: 9px; animation-delay: .36s; }
@keyframes sync-bob { 0%, 100% { transform: scaleY(.7); } 50% { transform: scaleY(1); } }

.sync {
  position: fixed; inset: 0; z-index: 75; display: none;
  background: var(--surface-sync); backdrop-filter: blur(10px);
  flex-direction: column;
}
.sync.is-open { display: flex; }
body.sync-open { overflow: hidden; }

.sync-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px 24px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.sync-head h3 {
  margin: 0; font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--sync);
}

/* ---- the script band ----
   The line under the cursor, at a size worth reading, directly above the renders it
   places. Its height is FIXED whether or not anything is hovered: `layout()` measures the
   card area at draw time, so a band that grew as text arrived would relayout the lanes
   under the pointer. Two lines of 19px plus the meta row is what 96px buys. */
.sync-script {
  flex: 0 0 auto; height: 96px; padding: 10px 24px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg,
              color-mix(in srgb, var(--sync) 7%, transparent), transparent);
}
.sync-script-hint { font-size: 12.5px; color: var(--muted); }
.sync-script-meta {
  display: flex; align-items: baseline; justify-content: center; gap: 12px;
  font-size: 12px; min-height: 15px;
}
.sync-script-meta b {
  font-family: var(--font-mono-ui);
  font-size: 13px; color: var(--accent);
}
.sync-script-meta .who {
  font-weight: 800; letter-spacing: .3px;
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sync-script-meta .kind {
  font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted);
}
/* The renders on this line. "Is this picture on the right line" is the doubt this screen
   answers, so the answer sits inline with the line's own identity - pushed to the far
   right of a 1600px band it was 1500px from the words it belongs to. */
.sync-script-meta .frames {
  font-family: var(--font-mono-ui);
  font-size: 11.5px; color: var(--sync-frames);
  padding: 1px 8px; border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--sync-frames) 40%, var(--line));
  background: color-mix(in srgb, var(--sync-frames) 10%, transparent);
}
.sync-script-line {
  font-size: 19px; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.sync-script.is-thought .sync-script-line { font-style: italic; color: var(--script-thought); }
.sync-script .dim { color: var(--script-dim); }
.sync-head-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.sync-head-actions .btn:disabled { opacity: .38; cursor: default; transform: none; }

/* The strip scrolls horizontally; the rail and the cards share its coordinate space so
   they can never drift apart. */
.sync-stage { flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; position: relative; }
.sync-stage.is-panning { cursor: grabbing; }
.sync-strip { position: relative; height: 100%; min-width: 100%; }
.sync-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sync-links path {
  fill: none; stroke: color-mix(in srgb, var(--accent) 50%, transparent); stroke-width: 1.5;
}
.sync-links path.is-author { stroke: color-mix(in srgb, var(--sync-author) 80%, transparent); }
.sync-links path.is-dragging { stroke: var(--sync-drag); stroke-width: 2.5; }
.sync-links path.is-missing { stroke-dasharray: 4 5; opacity: .45; }

/* ---- the rail: a ruler with a tick for every script line ----
   Three weights, so the ruler carries the one fact this screen exists to show - where the
   pictures fall - without the numbers crowding out the shape:

     is-render   a line that carries a render: bold, cyan, always numbered
     is-major    every tenth line: numbered, the way a ruler numbers its centimetres
     is-beat     any other line with something on it

   A blank line gets no tick at all, but is still spaced for - x comes from the line
   number, so the gaps in the ruler ARE the blank lines and distance stays honest.

   Every mark has the SAME layout height and differs only by `scaleY`, which is why the
   numbers share one baseline. Sizing them by real height instead put the four weights on
   four different baselines, and a magnified mark grew straight down through its own label.

   `--m` is the lens, 0..1, written by sync.js on every pointer move. Everything it drives
   is a transform or an opacity: no layout, no transition, so the ruler answers the cursor
   in the same frame. */
.sync-rail { position: absolute; left: 0; right: 0; bottom: 0; height: 132px; }
.sync-rail::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 3%, var(--line) 97%, transparent);
}
.sync-tick {
  --m: 0;          /* the lens, 0..1 */
  --h: .15;        /* this weight's share of the mark's height */
  position: absolute; top: 0; width: 0;
  display: flex; flex-direction: column; align-items: center;
}
.sync-tick .mark {
  width: 1px; height: 34px;            /* layout height: identical for every weight */
  background: var(--tick-mark); transform-origin: top center;
  transform: scaleY(calc(var(--h) * (1 + var(--m) * .45)))
             scaleX(calc(1 + var(--m)));
}
.sync-tick .label {
  margin-top: 6px;                     /* one baseline for every number on the ruler */
  font-family: var(--font-mono-ui);
  font-size: 9.5px; line-height: 1; white-space: nowrap; color: var(--tick-label);
  transform-origin: top center;
  transform: scale(calc(1 + var(--m) * .5));
}

/* an ordinary line of script: a short mark, numbered only as the cursor reaches it */
.sync-tick.is-beat { --h: .3; }
.sync-tick.is-beat .label { opacity: calc(var(--m) * var(--m)); }

/* the ruler's numbered gradations */
.sync-tick.is-major { --h: .45; }
.sync-tick.is-major .mark { background: var(--tick-mark-major); }
.sync-tick.is-major .label { opacity: calc(.55 + var(--m) * .45); color: var(--tick-label-major); }

/* a line that carries a render - the point of the whole screen */
.sync-tick.is-render { --h: .68; }
.sync-tick.is-render .mark {
  width: 2px; background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent);
}
.sync-tick.is-render .label {
  opacity: 1; color: var(--accent); font-weight: 700; font-size: 11px;
}

/* the tick directly under the cursor, and the one a drop would land on */
.sync-tick.is-near .mark { background: var(--tick-mark-near); }
.sync-tick.is-near.is-render .mark { background: var(--accent); }
.sync-tick.is-near .label { color: var(--tick-label-near); }
.sync-tick.is-hot { --h: 1; }
.sync-tick.is-hot .mark {
  width: 2px; background: var(--sync-drag); box-shadow: 0 0 14px var(--sync-drag);
}
.sync-tick.is-hot .label { opacity: 1; color: var(--sync-drag); font-weight: 700; }

/* ---- cards ---- */
.sync-cards { position: absolute; left: 0; right: 0; top: 0; bottom: 132px; }
.sync-card {
  position: absolute; width: 120px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--panel-2); cursor: grab;
  transition: transform 260ms var(--ease), box-shadow var(--speed), border-color var(--speed);
  will-change: transform;
}
.sync-card:hover { border-color: var(--border-active); }
.sync-card.is-author { border-color: color-mix(in srgb, var(--sync-author) 60%, var(--line)); }
.sync-card.is-separate { border-style: dashed; }
.sync-card.is-missing { border-style: dashed; opacity: .75; }
.sync-card.is-dragging {
  cursor: grabbing; z-index: 6; transition: none;
  box-shadow: 0 22px 50px -18px var(--shadow-deep); border-color: var(--sync-drag);
}
/* the card whose angles are unfolded - so the tray is visibly *its* tray */
.sync-card.is-open { border-color: var(--accent); }
.sync-card.is-target {
  border-color: var(--sync-target);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sync-target) 45%, transparent);
}
/* Where an edit just put something. Without it, a card that moves several hundred pixels
   or merges into another reads as having vanished. */
.sync-card.is-fresh { animation: sync-fresh 1400ms var(--ease); }
@keyframes sync-fresh {
  0%   { border-color: var(--sync-target); box-shadow: 0 0 0 6px color-mix(in srgb, var(--sync-target) 30%, transparent); }
  100% { border-color: var(--line); box-shadow: 0 0 0 0 transparent; }
}
.sync-card img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
  border-radius: var(--radius-sm) 10px 0 0;
}
.sync-card .blank {
  aspect-ratio: 16/9; display: grid; place-items: center; border-radius: var(--radius-sm) 10px 0 0;
  background: var(--panel-3); color: var(--muted); font-size: 9px;
  letter-spacing: 1.1px; text-transform: uppercase;
}
.sync-card .cap {
  padding: 5px 8px 7px; font-size: 10.5px; line-height: 1.3;
  display: flex; align-items: baseline; gap: 5px;
}
.sync-card .cap b { color: var(--text); }
.sync-card .cap span {
  color: var(--muted); font-size: 9.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sync-card .angles {
  position: absolute; top: 5px; right: 5px; padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--overlay-chip-soft); border: 1px solid var(--line);
  font-size: 10px; color: var(--accent);
}

/* ---- the unfolded angles ---- */
.sync-fan { position: absolute; z-index: 7; display: flex; gap: 8px; padding: 8px;
  border-radius: 14px; background: var(--surface-popover); border: 1px solid var(--line);
  box-shadow: 0 26px 60px -24px var(--shadow-popover);
  animation: fan-in 260ms var(--ease) both; }
@keyframes fan-in {
  from { opacity: 0; transform: translateY(8px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
.sync-angle {
  width: 108px; border-radius: 9px; cursor: grab;
  border: 1px solid var(--line); background: var(--panel-2);
  transition: transform 180ms var(--ease), border-color var(--speed);
}
.sync-angle:hover { transform: translateY(-3px); border-color: var(--accent); }
.sync-angle.is-dragging { cursor: grabbing; border-color: var(--sync-drag); }
.sync-angle img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
  border-radius: 8px 8px 0 0;
}
.sync-angle .cap { padding: 4px 7px 6px; font-size: 10.5px; color: var(--muted); }
.sync-angle.is-winner { border-color: var(--sync-target); }

/* ---- hold-to-open ring, drawn at the cursor ---- */
.sync-ring {
  position: fixed; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  pointer-events: none; opacity: 0; z-index: 80;
  transition: opacity 140ms var(--ease);
}
.sync-ring.is-on { opacity: 1; }
.sync-ring circle { fill: none; stroke-width: 3; }
.sync-ring .ring-track { stroke: var(--ring-track); }
.sync-ring .ring-fill {
  stroke: var(--accent); stroke-linecap: round;
  /* r=19 -> circumference 119.38 */
  stroke-dasharray: 119.38; stroke-dashoffset: 119.38;
  transform: rotate(-90deg); transform-origin: 50% 50%;
}
.sync-ring.is-filling .ring-fill {
  transition: stroke-dashoffset 1s linear;
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: reduce) {
  .sync-btn-glyph i { animation: none; }
  .sync-fan { animation: none; }
  .sync-card { transition: none; }
  .sync-card.is-fresh { animation: none; border-color: var(--sync-target); }
  .sync-ring.is-filling .ring-fill { transition: stroke-dashoffset 1s steps(2, end); }
}

/* A toast that carries an action (Sync Mode's Undo). */
.toast { display: flex; align-items: center; gap: 12px; }
.toast-action {
  flex: 0 0 auto; padding: 4px 11px; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); font: inherit; font-size: 12px; font-weight: 700;
  transition: background var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.toast-action:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); transform: translateY(-1px); }

/* Renders with no script line, parked past the end of the ruler. */
.sync-park {
  position: absolute; top: 0; bottom: 132px; border-left: 1px dashed var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--sync-parked) 6%, transparent), transparent 60%);
  pointer-events: none;
}
.sync-park::before {
  content: "no script line yet — drag onto the ruler";
  position: absolute; left: 12px; bottom: 14px;
  font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted);
}
.sync-card.is-parked { border-color: color-mix(in srgb, var(--sync-parked) 45%, var(--line)); }

/* ------------------------------------------- artists: environments, renders, changes */
.grid.hub { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.hubcard { display: block; margin: 0; transition: transform var(--speed) var(--ease), border-color var(--speed); }
.hubcard:hover { transform: translateY(-4px); border-color: var(--border-hover); text-decoration: none; }
.hubcard h3 { margin-bottom: 8px; }
/* The one card that can have work waiting on it. Amber, and across the full width. */
.hubcard.urgent {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; margin-bottom: 18px;
  border-color: color-mix(in srgb, var(--attention) 45%, transparent);
  background: color-mix(in srgb, var(--attention) 7%, var(--panel));
}

/* One deliverable and its angles: a row, so alternatives of the same shot read as a set
   rather than as unrelated cards in a wall. */
.framerow { margin-bottom: 26px; }
.framerow-head {
  /* Wraps: a version header carries a number, a date, a build label and a render count,
     and "Business Building Exterior" alone is wider than half a phone. Without this the
     row pushed 64px past the viewport. */
  display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap;
  margin-bottom: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line);
}
.framerow-head strong { font-size: 15px; letter-spacing: .5px; }

.verdict { margin-top: 9px; font-size: 12px; line-height: 1.5; }
.verdict p { margin: 4px 0 0; white-space: pre-wrap; }
.verdict.change { color: var(--verdict-changes-text); }
.verdict.change strong { color: var(--verdict-changes-strong); }
.verdict.final strong { color: var(--verdict-finalised); }
.verdict.none { color: var(--verdict-unreviewed); font-style: italic; }
/* A render needing work is bordered, not tinted: the picture is the thing being judged
   and a colour wash over it would change what the artist is looking at. */
.angle-card.needs-change { border-color: color-mix(in srgb, var(--verdict-changes-strong) 55%, transparent); }
.angle-card.is-final { border-color: color-mix(in srgb, var(--verdict-finalised) 40%, transparent); }

.pill.kind-character { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.pill.kind-environment { color: var(--kind-environment); border-color: color-mix(in srgb, var(--kind-environment) 40%, transparent); }
.pill.kind-render { color: var(--kind-render); border-color: color-mix(in srgb, var(--kind-render) 40%, transparent); }

@media (max-width: 720px) {
  .hubcard.urgent { flex-direction: column; align-items: flex-start; }
}

/* Game renders are 16:9. The default card is 4:5 with `object-fit: cover`, which is right
   for a portrait of a face and wrong for a frame: it centre-crops a landscape shot to a
   vertical slice, so an artist judging "is this the right composition?" cannot see the
   composition. Wider columns for the same reason - a 190px render is not reviewable. */
.grid.renders { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
/* A version's cover is a game render like any other, so it gets the same treatment: the
   default 4:5 centre-crops a landscape frame to a vertical slice and throws away the
   composition the card exists to show. */
.angle-card .card-media, .version-card .card-media { aspect-ratio: 16 / 9; }
@media (max-width: 720px) {
  .grid.renders { grid-template-columns: 1fr; }
}

/* The two kinds that name nothing, because the point is that it does not exist yet. */
.pill.kind-new_character, .pill.kind-new_environment {
  color: var(--kind-new); border-color: color-mix(in srgb, var(--kind-new) 45%, transparent);
}
/* A version's renders sit under its own header, so the rows need room to breathe more
   than the deliverable rows on a render part do. */
.framerow .grid.renders { margin-top: 2px; }

/* ------------------------------------------------- the change conversation panel */
/* A render being judged next to the words about it: the picture has to be big enough to
   see what "lower her hand" refers to, so this dialog is wider than the Missing one. */
.dialog.wide { width: min(1000px, 94vw); padding: 22px 24px 20px; }
.change-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.change-body {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px; margin-top: 16px; align-items: start;
}
/* `align-self: start` via align-items above: the grid would otherwise stretch this cell to
   the height of the conversation beside it, leaving a black band under the render. */
.change-shot { background: var(--stage-black); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.change-shot img { display: block; width: 100%; max-height: 62vh; object-fit: contain; }
.change-side { min-width: 0; display: flex; flex-direction: column; }
.change-side .block { margin-bottom: 14px; }
.change-side h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--muted); }
.change-note { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.state-open { color: var(--status-open); }
.state-fixed { color: var(--status-done); }

.thread { max-height: 30vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.post { padding: 9px 12px; border-radius: var(--radius-sm); background: var(--panel-2);
  border: 1px solid var(--line); font-size: 13px; }
.post-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.post p { margin: 5px 0 0; white-space: pre-wrap; line-height: 1.5; }
/* The two events that change who is waiting, tinted so the loop is readable at a glance. */
.post-fixed { border-color: color-mix(in srgb, var(--status-done) 40%, transparent); }
.post-reopened { border-color: color-mix(in srgb, var(--status-open) 40%, transparent); }

/* A re-delivered change is not a rejected one; green border, not red. */
.angle-card.is-fixed { border-color: color-mix(in srgb, var(--status-done) 45%, transparent); }
.verdict.fixed strong { color: var(--status-done); }
.change-card .open-change { margin-top: 9px; width: 100%; }

@media (max-width: 860px) {
  .change-body { grid-template-columns: 1fr; }
  .change-shot img { max-height: 34vh; }
  .thread { max-height: 26vh; }
}

/* A requested change the artist has re-delivered: waiting on the author, not on them.
   Lime rather than the amber of an outstanding change - the work has moved sides. */
.thumb.has-redelivery { border-color: color-mix(in srgb, var(--status-done) 55%, transparent); }
.thread-banner {
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 10px;
  line-height: 1.45;
}
.thread-banner.fixed {
  background: color-mix(in srgb, var(--success) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 40%, transparent); color: var(--success-text);
}

/* ------------------------------------------------- one environment version, opened */
.version-card { cursor: pointer; }
.version-card .card-title { display: flex; align-items: center; gap: 8px; }
/* A version can hold two dozen renders, so the panel scrolls rather than growing past
   the viewport and putting its own Close button off-screen. */
#version-body { max-height: 82vh; overflow-y: auto; padding-right: 4px; }
.vd-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  position: sticky; top: 0; z-index: 2; padding-bottom: 12px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.vd-facts { margin: 16px 0 18px; grid-template-columns: 116px 1fr; font-size: 13px; }
.vd-facts dd { min-width: 0; overflow-wrap: anywhere; }
.vd-facts .preset-id { margin-top: 0; white-space: normal; text-align: left; }
.vd-renders { margin-top: 4px; }

@media (max-width: 720px) {
  .vd-facts { grid-template-columns: 1fr; gap: 2px 0; }
  .vd-facts dt { margin-top: 8px; }
}

/* ------------------------------------------------------- batch: the gallery is the picker

   Batch mode is a layer over the cards review.js already drew, not a second gallery. The
   overlay it replaced made the author find the same render twice, in two different
   orders, and hid the verdicts and the filter they had just set. */
.batchbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: none; flex-direction: column; gap: 10px;
  padding: 14px 24px 18px;
  background: color-mix(in srgb, var(--surface-page) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -24px 60px -30px var(--shadow-deep);
  animation: batch-rise 220ms var(--ease);
}
.batchbar.open { display: flex; }
@keyframes batch-rise { from { transform: translateY(100%); } }
.batchbar-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.batchbar-main { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.batchbar .note-input { margin-top: 0; flex: 1 1 340px; min-height: 54px; }
.batch-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Room for the bar, so the last row of cards is reachable rather than sitting under it.
   The height comes from the bar itself (batch.js measures it): it is one row on a desktop
   and three on a phone, and a guess was wrong on one of them whichever way it was set.
   `scroll-margin-bottom` is the other half — padding lets you scroll far enough, and this
   is what makes a card scrolled to programmatically land above the bar rather than under
   it. */
body.batch-mode #review-root { padding-bottom: calc(var(--batch-bar-h, 190px) + 28px); }
body.batch-mode .thumb { scroll-margin-bottom: calc(var(--batch-bar-h, 190px) + 16px); }
/* A ticked card grows a fold-out, and without this every card in its row grows with it. */
body.batch-mode .grid.thumbs { align-items: start; }
body.batch-mode .thumb { cursor: pointer; }
/* Nothing was delivered here, so there is no picture to say anything about - the server
   would refuse it. Dimmed rather than hidden: the card still says what was briefed. */
body.batch-mode .thumb.batch-off { opacity: .4; cursor: default; }
/* The card actions open other flows; in batch mode a click on the card means one thing. */
body.batch-mode .thumb-actions { display: none; }

.batch-check {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700; line-height: 1;
  background: var(--overlay-chip); color: var(--text-inverse);
  border: 2px solid var(--line);
  transition: background var(--speed), border-color var(--speed), transform var(--speed) var(--ease);
}
.batch-check.is-on { background: var(--accent); border-color: var(--accent); transform: scale(1.08); }
.thumb.is-picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* The angles of one card, offered once it is ticked. Ticking the card alone is already a
   valid pick, so this is a refinement and never a question that has to be answered. */
.batch-variants {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 10px 10px; border-top: 1px solid var(--line);
}
.batch-variants-label {
  width: 100%; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted);
}
.batch-chip {
  display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px;
  border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--panel-2);
  color: var(--muted); font-family: inherit; font-size: 11.5px; cursor: pointer;
  transition: border-color var(--speed), color var(--speed);
}
.batch-chip img { width: 26px; height: 20px; object-fit: cover; border-radius: var(--radius-pill); }
.batch-chip:hover { border-color: var(--accent); color: var(--text); }
.batch-chip.is-on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
/* In variant mode the ask is about the entry, so which angle is ticked changes nothing. */
body.batch-variant .batch-variants { display: none; }

/* Take the same angle across the whole pass in one click. The number on each button is
   how many cards actually have that angle, so an ordinal that would select almost
   nothing says so before it is pressed. */
.batch-quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.batch-quick-label { font-size: 11.5px; color: var(--muted); }
.batch-quick em { font-style: normal; color: var(--muted); font-size: 10.5px; }

/* The two asks. Chosen before the note is written, because "request changes" is a verdict
   on what exists and "request another variant" is work that does not exist yet - and the
   note means a different thing in each. */
.batch-modes { display: flex; gap: 8px; }
.batch-modes .btn.is-mode {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel-2));
  color: var(--text);
}

@media (max-width: 720px) {
  /* On a phone the bar's rows wrap - three or more, more again in Ukrainian - and uncapped
     it covered half the screen or more, so a card could not be tapped clear of it. Capped
     under half the window, the bar scrolls its own controls instead, and batch.js reserves
     only the height it actually takes. `flex-shrink: 0` keeps each row its full height, so
     the bar scrolls rather than squashing them. */
  .batchbar {
    padding: 12px 14px 16px;
    max-height: 42vh; max-height: 42dvh;
    overflow-y: auto; overscroll-behavior: contain;
  }
  .batchbar > * { flex-shrink: 0; }
  .batch-actions { width: 100%; justify-content: space-between; }
}

/* --------------------------------------- one change request, and everything it covers */
.changegroup { margin: 0 0 16px; border-left: 3px solid var(--line); }
.changegroup.is-open { border-left-color: var(--status-open); }
.changegroup.is-fixed { border-left-color: var(--status-done); }
.cg-head {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.cg-where { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
/* The message is the thing the group exists to say once, so it is set as prose rather
   than as a caption under each picture. */
.cg-note {
  margin: 10px 0 14px; white-space: pre-wrap; line-height: 1.55; font-size: 14px;
}
/* Denser than a standalone render wall. Most change requests are about one picture, and
   at the full 290px a single-render group ran to 450px of screen for one thumbnail —
   more scrolling than the flat list it replaced. */
/* `.grid.cg-renders`, not `.cg-renders`: `.grid.renders` above is two classes, so a
   single-class selector loses to it and the override silently does nothing. */
.grid.cg-renders {
  margin: 0; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
}
.cg-renders .card-body { padding: 9px 10px 10px; }
.cg-renders .card-title { font-size: 13px; }
.cg-renders .open-change { margin-top: 7px; width: 100%; }
.cg-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.cg-foot .sub { font-size: 11.5px; }
.change-card .card-meta { font-size: 11.5px; }

@media (max-width: 720px) {
  .cg-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* A <figure> carries a 40px UA side margin, so a card built on one sits 80px narrower
   than its grid track. `.expr-card` happened to zero it, which is why only the cards
   without that class — the render scene, the change groups, a version's renders — were
   inset. Reset it where the card is defined instead of per screen. */
figure.card { margin: 0; }

/* ── Visual marks ────────────────────────────────────────────────────────────
   What the reviewer drew on the picture. Vector shapes in a 0..1 space, so one
   drawing renders on the 2560px viewer, a grid thumbnail and the artist's panel
   from the same stored geometry. */

/* The picture and its overlay share one box. The stage is letterboxed and the
   picture inside it is not, so an overlay sized to the stage would sit at an
   offset that changes with the window. */
/* No `max-height` on either: the box shrink-wraps the picture, and the picture's height is
   governed by `.viewer-stage img` and its two responsive overrides, exactly as it was
   before this wrapper existed. A cap here outranks all three (same specificity, later in
   the file) and, against a shrink-wrapped parent with no definite height, resolves to
   nothing at all — which is how a tall render came to be drawn at natural size and run off
   the bottom of the screen. `max-width` stays, or the inline-block resolves to max-content
   and a wide render blows out the middle grid column. */
.shot-box { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.shot-box img { display: block; max-width: 100%; }

.marks-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible;
}
/* One weight for every shape. A mark is a pointing gesture, not an illustration,
   and a stroke thin enough to be missed is a mark that failed. Non-scaling-stroke
   keeps it the same width whatever size the picture is drawn at. */
.marks-layer polyline, .marks-layer line, .marks-layer ellipse {
  fill: none; stroke: var(--markup); stroke-width: 3;
  vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 3px var(--shadow-mark));
}
.marks-layer marker path { fill: var(--markup); stroke: none; }
.marks-draw { pointer-events: auto; cursor: crosshair; touch-action: none; }

.markbar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--overlay-markbar);
  backdrop-filter: blur(8px);
}
.markbar:empty { display: none; }
.markbar-tools { display: flex; gap: 4px; }
.markbar-note { font-size: 11.5px; color: var(--muted); padding-right: 4px; }
.btn.is-tool {
  border-color: var(--markup);
  background: color-mix(in srgb, var(--markup) 20%, var(--panel-2));
}
/* While drawing, the viewer's own click-to-close and swipe handlers must not fight
   the pointer that is drawing. */
.viewer.marking .viewer-col { opacity: .35; pointer-events: none; }
/* While editing, the stored drawing is hidden and the editable copy stands in its place.
   Both on screen would double every stroke the moment a save repainted the viewer. */
.viewer.marking .marks-layer:not(.marks-draw) { display: none; }

/* On the card: this one has been drawn on. */
.thumb .marked {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px;
  background: var(--overlay-chip-soft); color: var(--markup);
  border: 1px solid color-mix(in srgb, var(--markup) 55%, var(--line));
}

@media (max-width: 720px) {
  .markbar { bottom: 10px; gap: 6px; padding: 6px 8px; }
  .markbar-note { display: none; }
}


/* The author's marks on the artist's copy of the picture. `.change-shot` is the artist
   panel's image box; the overlay is absolutely placed inside it, so it tracks the picture
   at whatever size the dialog gives it. */
.change-shot { position: relative; }
.change-shot .marks-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
/* --------------------------------------------------- viewing as an artist */
/* Unmissable and always on screen. A borrowed view that looks like your own account is
   how somebody ends up reading an artist's request list believing it is the queue. */
.viewas-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin: -6px 0 20px; padding: 11px 16px; border-radius: 12px;
  font-size: 13px; line-height: 1.5;
  background: color-mix(in srgb, var(--viewas) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--viewas) 50%, transparent);
  color: var(--text-viewas);
}
.viewas-bar strong { color: var(--text-strong); }
.viewas-form { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.viewas-form .note-input { margin-top: 0; min-height: 0; padding: 6px 9px; font-size: 12px; }
/* The control that starts it is violet too, so the button and the banner it produces
   read as one thing. */
.viewas-form .btn { --btn-accent: var(--viewas); }

@media (max-width: 720px) {
  .viewas-bar { flex-direction: column; align-items: flex-start; gap: 9px; }
}

/* ------------------------------------------- curating the environment sets (staff) */
.envrow { margin-bottom: 26px; }
.envrow-tools { margin-left: auto; display: flex; gap: 8px; }
/* A version set aside is dimmed rather than hidden: it is still on the share, and the
   control that brings it back has to be on the same row that says it is gone. */
.envrow.is-discarded { opacity: .5; }
.envrow.is-discarded .framerow-head { border-bottom-style: dashed; }
.envrow.is-discarded:hover { opacity: .78; }
.env-render .card-body { padding: 9px 10px 10px; }
.env-render .env-cover { margin-top: 7px; width: 100%; }
/* The picture that stands for the set, marked where it lives rather than only in a
   header — the question is always "which one is it", asked while looking at them. */
.env-render.is-cover { border-color: var(--accent); }
.env-render.is-cover .card-media .state { background: none; font-size: 15px; }
.card.is-empty { opacity: .62; }
/* The current cover carries a ring; only a *pinned* one carries the pin. The newest
   render is the cover by default, and saying so with the same marker made "clear the
   pin" fire on a pin that was never set. */
.env-render.is-pinned { border-color: var(--accent); }
.env-render.is-cover:not(.is-pinned) { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
/* An environment's cover is a 16:9 game render, not a portrait. The default 4:5 card
   centre-crops it to a vertical slice and throws away the composition - which is the
   whole reason one render was chosen over another. Same fix as the version cards. */
.card.env-card .card-media { aspect-ratio: 16 / 9; }

/* ------------------------------------------------------------ scene specs */
/* Render Review only (scene_specs.js): an inspector in the viewer's left column (inside
   Details on a phone), filters in the pass tools, a Compare overlay above the viewer, and
   three small dialogs (review changes, pending changes, batch change).

   Rules the layout keeps, because the first version broke each of them:
   - nothing scrolls sideways: every value cell is `min-width: 0` and either truncates
     with an ellipsis (full value on hover) or wraps where it is a path or a list;
   - numbers are tabular, so a column of focal lengths lines up;
   - three tones for a value and never more: observed (plain), staged in this browser
     (cyan, "to review"), pending on the server (amber, the observed value struck). A
     pending value is never drawn as if the picture showed it. */
.spec-select, .spec-input {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 4px 10px; font-size: 12.5px; max-width: 100%;
}
.spec-input { min-width: 160px; }
.specs-pending-open em { font-style: normal; color: var(--muted); margin-left: 3px; }
.specs-pending-open.has-pending { border-color: color-mix(in srgb, var(--pending) 55%, transparent); }
.specs-pending-open.has-pending em { color: var(--pending); font-weight: 700; }
#specs-pending-filter[aria-pressed="true"] { --btn-accent: var(--pending); }

.spec-panel {
  --spec-staged: var(--accent);
  --spec-pending: var(--pending);
  border-top: 1px solid var(--line); padding-top: 14px; min-width: 0; max-width: 100%;
  font-variant-numeric: tabular-nums;
}
.spec-panel * { min-width: 0; }
.spec-dim { color: var(--muted); }
.spec-code {
  font: 600 10.5px/1 var(--font-mono);
  color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px;
  white-space: nowrap;
}

/* The head: what this is, when it was made, and the three facts that change a verdict. */
.spec-top { margin-bottom: 10px; }
.spec-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.spec-top h4 {
  margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.spec-pending-badge {
  font-size: 11.5px; font-weight: 700; color: var(--spec-pending-text); background: var(--spec-pending);
  border-radius: var(--radius-pill); padding: 2px 9px; white-space: nowrap;
}
.spec-when { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 6px 0 8px; }
.spec-when-k { font-size: 12px; color: var(--muted); }
.spec-when strong { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.spec-when-src { font-size: 11.5px; color: var(--warning); width: 100%; }
.spec-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.spec-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  font-size: 11.5px; line-height: 1.35; padding: 2px 8px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); color: var(--text); background: var(--panel-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spec-chip.is-good { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.spec-chip.is-warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.spec-chip.is-bad {
  color: var(--spec-bad-text); background: var(--spec-bad-bg); border-color: var(--danger);
}
.spec-chip.is-fg { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.spec-chip.is-dim { color: var(--muted); }
/* A face that is an older approved version of its expression ("Exact match - OUTDATED",
   lab_pictures.py). Filled, and in the theme's own orange, so it never reads as the amber
   "probable" or the red "bad". The orange is read HERE, not through a :root alias, so a
   theme whose panels sit on another ground (Blueprint's sheet) gives the one that is
   readable on it; `--match-outdated` lets a theme name another. */
.spec-chip.is-outdated {
  color: var(--match-outdated, var(--orange)); font-weight: 600;
  border-color: var(--match-outdated, var(--orange));
  background: color-mix(in srgb, var(--match-outdated, var(--orange)) 7%, var(--panel-2));
}
/* the set's final version (environments.set_final), on the render's Environment row */
.spec-chip.is-final { color: var(--verdict-finalised); border-color: color-mix(in srgb, var(--verdict-finalised) 45%, transparent); }

/* "Possible missing textures" (missing_textures_flag.js): a flag, never a status, so it
   reads --flag-missing-textures, which is --check-flag in legacy (like a flagged submission
   check); "likely" is the same hue, stronger. */
.mt-flag {
  /* wraps on a narrow phone card rather than clipping: the words are the point */
  align-self: flex-start; margin-top: 6px; max-width: 100%; padding: 1px 8px;
  font-size: 11px; font-weight: 650; line-height: 1.5; color: var(--flag-missing-textures);
  border: 1px solid color-mix(in srgb, var(--flag-missing-textures) 45%, transparent);
  border-radius: var(--radius-sm); overflow-wrap: anywhere;
}
.mt-flag.above-chip { margin-bottom: 22px; }
.mt-flag.is-likely {
  color: var(--text-strong); background: color-mix(in srgb, var(--flag-missing-textures) 30%, transparent);
  border-color: var(--flag-missing-textures); font-weight: 750;
}
.mt-flag.is-error { color: var(--text-muted); border-color: var(--border); border-style: dashed; }
.mt-flag-note {
  display: flex; flex-direction: column; gap: 3px; margin: 0 0 12px; padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--flag-missing-textures) 45%, transparent);
  border-left: 3px solid var(--flag-missing-textures); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--flag-missing-textures) 8%, transparent); font-size: 12px;
}
.mt-flag-note .mt-flag-head { color: var(--flag-missing-textures); font-weight: 700; }
.mt-flag-note.is-likely { background: color-mix(in srgb, var(--flag-missing-textures) 16%, transparent); }
.mt-flag-note .mt-flag-why { color: var(--muted); }
.mt-filter em { font-style: normal; color: var(--muted); margin-left: 3px; }
#mt-filter[aria-pressed="true"] { --btn-accent: var(--flag-missing-textures); }

/* Character Development: the model behind the picture, its .blend first (development_specs.js). */
.dev-specs .dev-blend {
  margin: 4px 0 10px; padding: 8px 10px; border: 1px solid var(--accent);
  border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.dev-specs .dev-blend.is-none { border-color: var(--line); background: transparent; }
.dev-blend-head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.dev-blend-line { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 4px; }
.dev-blend-path {
  max-width: 100%; font-family: var(--font-mono-spec); font-size: 12.5px; font-weight: 650;
  color: var(--text-strong, var(--text)); overflow-wrap: anywhere; user-select: all;
}
.dev-blend-note { margin-top: 4px; font-size: 12px; color: var(--muted); }
.dev-blend-gone { margin-top: 4px; font-size: 12px; color: var(--warning); }
.dev-specs .dev-blend.is-missing { border-color: var(--danger); background: var(--danger-bg); }
.dev-blend-missing {
  display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 700;
  color: var(--danger); border: 1px solid var(--danger); text-transform: uppercase; letter-spacing: .06em;
}
.dev-blend-also.is-missing .dev-blend-path { text-decoration: line-through; color: var(--muted); }
.dev-blend-dl { display: inline-block; margin-top: 4px; font-size: 12px; }
.dev-blend-none, .dev-specs-note { font-size: 12px; color: var(--muted); }

/* Cards. */
.spec-card {
  border: 1px solid var(--line); border-radius: 12px; margin: 8px 0;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.spec-card > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; user-select: none;
}
.spec-card > summary::-webkit-details-marker { display: none; }
.spec-card-title { font-size: 13px; font-weight: 650; letter-spacing: .01em; }
.spec-card-meta { font-size: 12px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spec-card-meta .is-warn { color: var(--warning); }
.spec-card-chev { margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform var(--speed) var(--ease); flex: none; }
.spec-card[open] > summary .spec-card-chev { transform: rotate(45deg); }
.spec-card-body { padding: 0 12px 10px; }

/* "More details": everything technical, collapsed until asked for. */
.spec-more { margin-top: 6px; }
.spec-more > summary {
  list-style: none; cursor: pointer; font-size: 12px; color: var(--accent);
  padding: 4px 0; display: inline-flex; align-items: center; gap: 6px;
}
.spec-more > summary::-webkit-details-marker { display: none; }
.spec-more > summary::before { content: "+"; font-weight: 700; width: 10px; }
.spec-more[open] > summary::before { content: "−"; }
.spec-more-body { border-left: 2px solid var(--line); padding: 2px 0 2px 10px; margin: 2px 0 4px 3px; }
.spec-subhead { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 10px 0 2px; }

/* Rows: label | value | action. */
.spec-row {
  display: grid; grid-template-columns: minmax(78px, 35%) minmax(0, 1fr) auto;
  align-items: center; gap: 2px 8px; font-size: 12.5px; padding: 3px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.spec-row:last-child { border-bottom: 0; }
.spec-k { color: var(--muted); overflow-wrap: anywhere; line-height: 1.3; }
.spec-v {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}
.spec-v.is-wrap { white-space: normal; overflow-wrap: anywhere; }
.spec-v.mono { font-family: var(--font-mono-spec); font-size: 11.5px; color: var(--text); }
.spec-act { display: inline-flex; align-items: center; gap: 2px; }
.spec-pen, .spec-x {
  width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 7px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 0;
}
.spec-pen:hover, .spec-pen:focus-visible { color: var(--accent); border-color: var(--line); background: var(--panel-3); }
.spec-x:hover, .spec-x:focus-visible { color: var(--text); border-color: var(--line); background: var(--panel-3); }
.spec-farm {
  font-size: 9.5px; padding: 0 5px; border-radius: var(--radius-pill); vertical-align: 1px;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
/* A keyframed field (edited at this picture's frame only), and one Modify cannot key. */
.spec-farm.spec-keyed { cursor: help; }
.spec-farm.spec-anim-blocked {
  cursor: help; color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 45%, transparent);
}
.spec-line { margin: 2px 0 4px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-line.is-wrap { white-space: normal; overflow-wrap: anywhere; }
.spec-line .spec-chip { vertical-align: 1px; }
.spec-note { color: var(--muted); font-size: 12px; margin: 4px 0; overflow-wrap: anywhere; }
.spec-note.is-bad { color: var(--danger); }
.spec-todo { color: var(--warning); }

/* A changed value. */
/* Wraps rather than truncates: a change is the one value that must be read in full. The
   old value sits on its own line, struck, and the new one with its flag below it. */
.spec-change { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 5px; white-space: normal; overflow-wrap: anywhere; }
.spec-change b { font-weight: 650; }
.spec-was { color: var(--muted); text-decoration-thickness: 1.5px; flex: 1 1 100%; font-size: 11.5px; }
.spec-arrow { color: var(--muted); flex: none; }
.spec-flag {
  flex: none; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 4px;
}
.spec-change.is-staged b { color: var(--spec-staged); }
.spec-change.is-staged .spec-flag { color: var(--spec-staged); border: 1px dashed var(--spec-staged); }
.spec-change.is-pending b { color: var(--spec-pending); }
.spec-change.is-pending .spec-flag { color: var(--spec-pending-text); background: var(--spec-pending); }
.spec-change.is-pending .spec-was { text-decoration-color: color-mix(in srgb, var(--spec-pending) 70%, transparent); }

/* The inline editor. */
.spec-row.is-editing { grid-template-columns: minmax(84px, 40%) minmax(0, 1fr); align-items: start;
  background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 8px; padding: 6px; margin: 2px -6px; }
.spec-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.spec-input-edit {
  background: var(--surface-well); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; max-width: 100%;
}
.spec-input-edit:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }
.spec-num { display: inline-flex; align-items: center; gap: 5px; }
.spec-num input { width: 96px; font-variant-numeric: tabular-nums; }
.spec-unit { color: var(--muted); font-size: 12px; }
input[type="color"].spec-input-edit { width: 46px; height: 30px; padding: 2px; }
.spec-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.spec-toggle button { background: transparent; color: var(--muted); border: 0; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.spec-toggle button.is-on { background: color-mix(in srgb, var(--accent) 22%, var(--panel-2)); color: var(--text); }
.spec-edit-err { color: var(--danger); font-size: 12px; width: 100%; }
.spec-edit-err:empty { display: none; }

/* Characters. */
.spec-char { padding: 10px 0 8px; border-top: 1px solid var(--line); }
.spec-char:first-child { border-top: 0; padding-top: 2px; }
.spec-char-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.spec-char-head strong { font-size: 14.5px; letter-spacing: -.005em; }
.spec-expr {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-well);
}
.spec-expr.is-bad { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.spec-expr-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.spec-expr-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.spec-expr-name { margin: 4px 0 2px; font-size: 14px; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.spec-expr-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-expr.is-bad .spec-expr-name strong { color: var(--danger); }
.spec-expr-change { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin: 4px 0; }
.spec-expr-change .spec-change { flex: 1; }
.spec-expr-actions { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.spec-expr-actions .btn.small { padding: 3px 9px; font-size: 11.5px; }
.spec-expr-edit { margin-top: 6px; }
.spec-picker { flex-direction: column; align-items: stretch; }
.spec-picker-q { width: 100%; }
.spec-picker-list {
  display: flex; flex-direction: column; max-height: 232px; overflow-y: auto; overflow-x: hidden;
  border: 1px solid var(--line); border-radius: 8px;
}
.spec-preset-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text);
  text-align: left; padding: 7px 10px; font: inherit; font-size: 12.5px; cursor: pointer; min-height: 34px;
}
.spec-preset-opt span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-preset-opt:hover, .spec-preset-opt:focus-visible { background: var(--panel-3); }
.spec-preset-opt.is-on { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.spec-effects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 8px 0 4px; }
.spec-effect {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 12px;
  background: var(--panel-2); color: var(--text); text-align: left; overflow: hidden;
}
.spec-effect[disabled] { cursor: default; }
.spec-effect.is-editable { cursor: pointer; }
.spec-effect.is-editable:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
/* A longer translated name wraps onto a second line inside the chip rather than pushing
   the value out of it. When it fits on one line - every English name - nothing changes. */
.spec-effect-name { color: var(--muted); flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.spec-effect-v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; flex: none; max-width: 60%; }
.spec-effect.is-off .spec-effect-v { color: var(--muted); font-weight: 400; font-style: italic; }
.spec-effect.is-on .spec-effect-v { color: var(--success); }
.spec-effect.is-staged { border-color: var(--spec-staged); border-style: dashed; }
.spec-effect.is-staged .spec-effect-v { color: var(--spec-staged); }
.spec-effect.is-pending { border-color: var(--spec-pending); }
.spec-effect.is-pending .spec-effect-v { color: var(--spec-pending); }
.spec-hair .spec-v { display: flex; align-items: center; gap: 6px; }
.spec-also { margin-top: 2px; }
.spec-swatch {
  display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--swatch-ring); vertical-align: -2px; margin-right: 5px;
  box-shadow: inset 0 0 0 1px var(--swatch-inset);
}

/* Lights and nodes. */
.spec-lights { margin: 6px 0; font-size: 12px; }
.spec-light {
  display: grid; grid-template-columns: minmax(0, 1fr) 48px 70px 44px; gap: 6px; align-items: center;
  padding: 2px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.spec-light.is-head { color: var(--muted); font-size: 11px; }
.spec-light.is-off { opacity: .55; }
.spec-trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.spec-numcell { text-align: right; }
.spec-nodes { list-style: none; margin: 6px 0; padding: 0; font-size: 12px; }
.spec-nodes li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 2px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }

/* Source. */
.spec-path { display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 4px; }
.spec-path code {
  flex: 1; font-size: 12px; overflow-wrap: anywhere; background: var(--surface-well);
  padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); line-height: 1.45;
}
.spec-path .btn { flex: none; }

/* "N changes not saved yet". Sticky so it stays in reach while the column scrolls. */
.spec-stagebar {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: 0 -12px 28px -14px var(--shadow-ink);
}
.spec-stagebar { flex-wrap: wrap; justify-content: flex-end; }
.spec-stagebar > span { flex: 1 1 100%; font-size: 12.5px; }
.spec-stagebar[hidden] { display: none; }

/* The inspector needs a real column. The viewer's side tracks are `minmax(240px, 1fr)`
   beside an `auto` stage that sizes to the picture, so on a desktop the picture took all
   but 240px and every spec value was crushed into ~190px - the overflow the author saw.
   With specs showing (scene_specs.js sets .has-specs), the stage becomes a flexible track
   and gives the left column a definite share; the picture scales down to fit, as it does
   in Compare. Phones and narrow windows stack the columns, so this is desktop-only. */
@media (min-width: 1101px) {
  .viewer.open.has-specs:not(.is-wide) {
    grid-template-columns: minmax(330px, 24vw) minmax(0, 1fr) minmax(240px, 18vw);
  }
  .viewer.open.has-specs.comparing:not(.is-wide) {
    grid-template-columns: minmax(330px, 22vw) minmax(0, 3fr) minmax(210px, .5fr);
  }
  .viewer.open.has-specs .viewer-stage { min-width: 0; }
}

/* Dialogs: review changes, pending changes, batch change. Above the viewer (60) and the
   batch bar (55); below the toast stack (90). */
.spec-dialog {
  position: fixed; inset: 0; z-index: 72; display: none; align-items: center; justify-content: center;
  background: var(--scrim); backdrop-filter: blur(6px); padding: 20px;
}
.spec-dialog.open { display: flex; }
.spec-dialog-box {
  width: min(640px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 30px 80px -20px var(--shadow-ink); overflow: hidden;
}
.spec-dialog-head { display: flex; align-items: baseline; gap: 10px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); position: relative; }
.spec-dialog-head h3 { margin: 0; font-size: 17px; }
.spec-dialog-close { position: absolute; top: 8px; right: 8px; }
.spec-dialog-body { padding: 8px 18px; overflow-y: auto; overflow-x: hidden; font-variant-numeric: tabular-nums; }
.spec-dialog-foot { padding: 10px 18px 16px; border-top: 1px solid var(--line); }
.spec-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.spec-review-pic { padding: 10px 0; border-bottom: 1px solid var(--line); }
.spec-review-pic:last-child { border-bottom: 0; }
.spec-pic-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.spec-pic-head img, .spec-pic-ph { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: none; background: var(--panel-3); }
.spec-pic-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
/* One change: what it is on its own line, then Before → Pending side by side. Values wrap
   rather than truncate - this is the screen where the author checks them. */
.spec-review-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: end; gap: 2px 10px; padding: 8px 0; font-size: 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.spec-review-row:last-child { border-bottom: 0; }
.spec-review-k { grid-column: 1 / -1; color: var(--text); font-weight: 600; font-size: 12.5px; overflow-wrap: anywhere; }
.spec-review-before, .spec-review-after { overflow-wrap: anywhere; }
.spec-review-row .spec-x { align-self: center; }
/* Re-render (Modify): the panel card and the plan dialog (scene_specs.js). */
.spec-modify-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.spec-modify-req { border-top: 1px solid var(--line, rgba(255,255,255,.08)); padding: 6px 0; }
.spec-modify-req:first-child { border-top: 0; }
.spec-modify-list { margin: 2px 0 4px; padding-left: 18px; font-size: 12px; overflow-wrap: anywhere; }
.spec-modify-route { margin: 4px 0 6px; }
.spec-modify-route .spec-mini { display: block; margin-bottom: 2px; }
#spec-modify-note { width: 100%; box-sizing: border-box; resize: vertical; }
.spec-review-before { color: var(--muted); }
.spec-review-before s { text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent); }
.spec-review-before .spec-mini, .spec-review-after .spec-mini { display: block; }
.spec-review-after { color: var(--spec-pending, var(--pending)); font-weight: 650; }
#spec-review .spec-review-after, #spec-batch .spec-review-after { color: var(--pending); }
.spec-mini { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.spec-batch-field { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; align-items: center; margin: 8px 0; font-size: 13px; }
.spec-batch-field select { width: 100%; }
#spec-batch .spec-row.is-editing { margin: 6px 0; }

.specs-compare {
  position: fixed; inset: 0; z-index: 70; display: none;
  background: var(--stage-compare); padding: 48px 20px 20px;
}
.specs-compare.open { display: flex; align-items: center; justify-content: center; }
.specs-compare-body { display: flex; gap: 14px; width: 100%; max-height: 100%; justify-content: center; }
.spec-figure { flex: 1 1 0; min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; }
.spec-figure img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; border-radius: 8px; }
.spec-figure figcaption { font-size: 12.5px; color: var(--stage-caption); margin-top: 6px; text-align: center; }
/* a picture whose approval can't be proven unchanged (lab_pictures / picture_proof): said
   under that very picture, in the stage's own caption colour */
.spec-figure-caveat { display: block; margin-top: 3px; font-size: 12px; font-style: italic; }
.spec-empty {
  display: flex; align-items: center; justify-content: center; min-height: 240px; width: 100%;
  border: 1px dashed var(--line); border-radius: 8px; color: var(--muted);
}
.spec-figure .spec-empty, .spec-figure .spec-note, .spec-figure figcaption .mono { color: var(--stage-caption); }
/* Compare with nothing to show on one side: said in words, never an empty frame. The
   stage-caption colour is the one each theme tunes for legibility on its own stage. */
.spec-compare-notice {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 240px; width: 100%; max-width: 560px; padding: 24px; box-sizing: border-box;
  border: 1px solid var(--stage-caption); border-radius: 8px; text-align: center;
  color: var(--stage-caption); font-size: 14px; line-height: 1.45;
}
.spec-compare-notice strong { font-size: 16px; font-weight: 600; }
.specs-compare-body.is-three .spec-figure img { max-height: calc(100vh - 150px); }
@media (max-width: 760px) {
  .spec-input { min-width: 0; flex: 1 1 140px; }
  .specs-compare-body { flex-direction: column; overflow-y: auto; }
  .spec-figure img { max-height: 42vh; }
  .spec-row { grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) auto; font-size: 13px; }
  .spec-pen, .spec-x { width: 34px; height: 34px; font-size: 15px; }
  .spec-effect { min-height: 38px; }
  .spec-dialog { padding: 0; align-items: flex-end; }
  .spec-dialog-box { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; padding-bottom: var(--safe-b, 0px); }
  .spec-stagebar { bottom: 0; }
}

/* ------------------------------------------------------------------ admin: people and keys */
.admin-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.admin-status { min-height: 1.2em; margin: 0 0 10px; color: var(--danger); font-size: 13px; }
.btn.danger { --btn-accent: var(--danger); color: var(--danger-button-text); }
.btn.danger:hover { border-color: var(--danger); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.acct-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); }
.acct { margin: 0; border-left: 3px solid var(--accent); display: flex; flex-direction: column; gap: 12px; }
.acct + .acct { margin-top: 0; }
.acct.is-off { border-left-color: var(--line); opacity: .7; }
.acct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.acct-who { display: flex; flex-direction: column; min-width: 0; }
.acct-who strong { font-size: 16px; }
.acct-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.acct-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.acct-facts dt { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.acct-facts dd { margin: 2px 0 0; font-size: 13px; }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.key-group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.key-group-head h3 { margin: 0; }
.key-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.key-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.key-pick { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; cursor: pointer; }
.key-pick input { width: 18px; height: 18px; accent-color: var(--accent); }
.key-name strong { word-break: break-all; }
.key-meta { font-size: 12.5px; margin-top: 2px; }
.key-why { font-size: 12.5px; margin-top: 4px; color: var(--warning); }

.admin-audit { margin-top: 22px; }
.audit-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 420px; overflow-y: auto; }
.audit-list li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.audit-at { color: var(--muted); font-variant-numeric: tabular-nums; }

.admin-form .field { margin-top: 0; margin-bottom: 14px; }
.admin-form .note-input { width: 100%; }
.check { display: flex; gap: 9px; align-items: center; font-size: 14px; margin: 6px 0 12px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.pw-choice { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 6px; margin: 4px 0 0; }
.pw-choice legend { padding: 0 6px; }
.pw-choice .check { margin: 6px 0; }
.pw-choice .note-input { margin: 4px 0 10px; }
.secret-row { display: flex; gap: 10px; align-items: stretch; margin-top: 12px; }
.secret-row .note-input { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono-code); font-size: 14px; }
.secret-warn {
  margin: 14px 0 0; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px;
  background: var(--warning-bg-strong); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
}

@media (max-width: 640px) {
  .acct-facts { grid-template-columns: 1fr 1fr; }
  .audit-list li { grid-template-columns: 1fr; gap: 2px; }
  .key-row { grid-template-columns: auto minmax(0, 1fr); }
  .key-row > .btn { grid-column: 2; justify-self: start; }
  .secret-row { flex-direction: column; }
}
.key-group > .sub + .sub, .admin-audit > .sub + .sub { margin-top: 10px; }
.root-form { margin: 0; }
.root-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.root-row .note-input { margin: 0; min-height: 0; flex: 1 1 auto; min-width: 0;
  font-family: var(--font-mono-code); font-size: 13px; }
.root-help { font-size: 12px; margin-top: 4px; }
.root-help.is-error { color: var(--danger); }

/* ---------------------------------------------------------------- render status
   Render Review's lifecycle colours (render_status.py). Each status differs by hue AND by
   ring style and glyph, because orange vs pink and sky vs cyan sit close on black:

     changes · artist   orange  #fb923c   solid ring   🔧   (the existing request colour)
     changes · AI       pink    #f9a8d4   dashed ring  🤖   (pastel: far from rose #f43f5e)
     erroneous          red     #dc2626   thick ring   ⛔   (deeper than the artist
                                                            screen's rose "needs change")
     ready for final    blue    #2563eb   solid ring   🎬   (dark blue)
     final rendered     sky     #7dd3fc   double ring  🎞   (cyan #22d3ee stays "selected")
     production ready   lime    #a3e635   solid ring   ✅   (the existing approved colour) */
:root {
  --st-changes-artist: var(--orange);
  --st-changes-ai: #f9a8d4;
  --st-erroneous: #dc2626;
  --st-ready: #2563eb;
  --st-final: #7dd3fc;
  --st-production: var(--lime);
  /* An artist upload that replaced a picture that was not that artist's own last upload
     (render_replacements.py, rule 4). Staff only. Its own hue: no status uses yellow. */
  --st-replaced-other: #facc15;
}
.thumb.st-changes_artist { box-shadow: 0 0 0 2px var(--st-changes-artist); }
.thumb.st-changes_ai { box-shadow: none; outline: 2px dashed var(--st-changes-ai); outline-offset: 1px; }
.thumb.st-erroneous { box-shadow: 0 0 0 4px var(--st-erroneous); }
.thumb.st-ready { box-shadow: 0 0 0 3px var(--st-ready); }
.thumb.st-final_done { box-shadow: 0 0 0 2px var(--st-final), 0 0 0 4px var(--surface-page), 0 0 0 6px var(--st-final); }
.thumb.st-production { box-shadow: 0 0 0 2px var(--st-production); }
.thumb.st-draft { box-shadow: none; }
.thumb .st-sub {
  position: absolute; top: 8px; left: 8px; font-size: 10.5px; padding: 2px 7px;
  border-radius: var(--radius-pill); background: var(--overlay-strong); border: 1px solid var(--st-ready);
  color: var(--st-sub-text); display: inline-flex; gap: 5px; align-items: center;
}
.thumb .st-sub.failed { border-color: var(--st-erroneous); color: var(--st-sub-failed-text); }
.st-spin {
  width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--st-sub-text);
  border-right-color: transparent; animation: st-spin 900ms linear infinite;
}
@keyframes st-spin { to { transform: rotate(360deg); } }

/* chips, pills, the legend: one swatch rule per status */
.st-chip, .st-pill { --st: var(--muted); }
.st-chip.st-changes_artist, .st-pill.st-changes_artist { --st: var(--st-changes-artist); }
.st-chip.st-changes_ai, .st-pill.st-changes_ai { --st: var(--st-changes-ai); }
.st-chip.st-erroneous, .st-pill.st-erroneous { --st: var(--st-erroneous); }
.st-chip.st-ready, .st-pill.st-ready { --st: var(--st-ready); }
.st-chip.st-final_done, .st-pill.st-final_done { --st: var(--st-final); }
.st-chip.st-production, .st-pill.st-production { --st: var(--st-production); }
.st-pill { border-color: var(--st) !important; color: var(--text); }
.st-pill.st-changes_ai { border-style: dashed !important; }
.status-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.st-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); cursor: default;
}
.st-chip em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--st); }
.st-chip.st-draft .st-swatch { background: transparent; border: 1px solid var(--muted); }
.st-chip.st-changes_ai .st-swatch { background: transparent; border: 2px dashed var(--st); }
.st-chip.st-final_done .st-swatch { background: transparent; box-shadow: inset 0 0 0 2px var(--st), inset 0 0 0 3px var(--surface-page), inset 0 0 0 5px var(--st); }
button.st-chip { cursor: pointer; }
button.st-chip[aria-pressed="true"] { border-color: var(--st); background: color-mix(in srgb, var(--st) 18%, var(--panel-2)); }
button.st-chip[aria-pressed="true"] em { color: var(--text); }  /* the count stays readable on the tint (muted was 3.8:1) */
button.st-chip.st-hide { text-decoration: line-through; opacity: .6; }

/* the viewer's status controls */
.status-block .st-now { margin: 8px 0; font-size: 13px; }
.status-block .st-now .st-chip { cursor: default; }
.status-block .viewer-actions { flex-wrap: wrap; }
/* The border IS the status, so it wins over every theme's own .btn, .btn.ghost and pressed
   rule (blueprint's pressed rule painted all five selected buttons amber; darkroom's, riso's
   and win2000's .btn rules greyed them). Same rule as .st-pill. A theme changes the colour
   through --st-*, never by restyling this border. */
.btn.st-btn { border: 1px solid var(--st); --btn-accent: var(--st); }  /* a theme's pressed tint follows the status */
.btn.st-btn, .btn.st-btn:hover, .btn.st-btn[aria-pressed="true"] { border-color: var(--st) !important; }
.btn.st-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--st) 22%, transparent); }
.st-assign { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.st-assign select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
/* "Request changes from": any number of artists, the deliverer ticked to begin with. */
.st-artists { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.st-artist { display: inline-flex; gap: 4px; align-items: center; font-size: 0.9em; white-space: nowrap; }
.st-artist em { font-style: normal; opacity: 0.75; }
.st-who { flex-basis: 100%; }
.batch-share { margin-top: 6px; display: block; }
.batch-share > summary { cursor: pointer; font-size: 0.9em; }
.batch-share[open] { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.batch-share[open] > summary { flex-basis: 100%; }
.st-warn { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--warning); color: var(--warning); font-size: 12.5px; }
.st-history { font-size: 12px; margin: 6px 0 0; padding-left: 16px; }
.st-history li { margin: 3px 0; color: var(--muted); }
.st-history li strong { color: var(--text); font-weight: 600; }
.variant-btn.st-mark { box-shadow: inset 0 -3px 0 var(--st); }
.vdot.st-dot { background: var(--st) !important; }
.vdot.st-dot.st-changes_ai { background: transparent !important; box-shadow: inset 0 0 0 2px var(--st); }
.st-changes_artist { --st: var(--st-changes-artist); }
.st-changes_ai { --st: var(--st-changes-ai); }
.st-erroneous { --st: var(--st-erroneous); }
.st-ready { --st: var(--st-ready); }
.st-final_done { --st: var(--st-final); }
.st-production { --st: var(--st-production); }

/* ---------------------------------------------------------------- final-render queue */
.card-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-wrap > .card { flex: 1 1 auto; }
.card-wrap > .final-queue { align-self: stretch; border-color: var(--st-ready); }
.final-queue { border: 1px solid var(--st-ready); }
.final-episode-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.final-episode-row .status-legend { flex: 1 1 auto; }
.fq-dialog {
  position: fixed; inset: 0; z-index: 90; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.fq-dialog[hidden] { display: none; }
.fq-box {
  width: min(640px, 100%); max-height: 86vh; overflow-y: auto; background: var(--panel-2);
  border: 1px solid var(--st-ready); border-radius: var(--radius); padding: 20px 22px;
}
.fq-box h3 { margin: 0 0 8px; }
.fq-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.fq-list li { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--panel-3); }

/* ---------------------------------------------------------------- post processing */
.pfx-h2 { font-size: 16px; margin: 26px 0 10px; letter-spacing: .3px; }
.grid.pfx-presets { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-media.pfx-wide { aspect-ratio: 16 / 9; position: relative; }
.pfx-version, .pfx-vbadge {
  font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--overlay-chip-soft); border: 1px solid var(--line); color: var(--accent);
}
.pfx-version { position: absolute; top: 8px; right: 8px; }
.pfx-vbadge { vertical-align: middle; font-size: 14px; }
.pfx-steps-mini { margin: 8px 0 10px; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.pfx-steps-mini .more { list-style: none; margin-left: -18px; opacity: .8; }
.pill.pfx-need { color: var(--pfx-need); border-color: color-mix(in srgb, var(--pfx-need) 40%, transparent); }
.pill.pfx-bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.pfx-quiet { background: var(--panel-2); border-color: var(--line); color: var(--muted); }
.pfx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pfx-table th, .pfx-table td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pfx-table th { color: var(--muted); font-weight: 600; }
.pfx-table tr.pfx-gap td { color: var(--check-flag); }
.pfx-table small, .pfx-history .muted, .pfx-shot .muted { color: var(--muted); }

.pfx-layout { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 26px; align-items: start; }
@media (max-width: 1100px) { .pfx-layout { grid-template-columns: 1fr; } }
.pfx-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pfx-step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.pfx-step.is-off { opacity: .55; }
.pfx-step-head { display: flex; gap: 11px; align-items: flex-start; }
.pfx-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: var(--panel-3); color: var(--accent);
}
.pfx-step-words { flex: 1; min-width: 0; }
.pfx-step-title { font-weight: 700; font-size: 14.5px; }
.pfx-step-blurb { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pfx-toggle { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); }
.pfx-params { display: grid; gap: 8px; margin: 10px 0 0 35px; }
.pfx-param { display: grid; grid-template-columns: 140px 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.pfx-param label { color: var(--muted); }
.pfx-param.is-changed label, .pfx-toggle.is-changed { color: var(--pending); font-weight: 700; }
.pfx-number { display: grid; grid-template-columns: 1fr 76px 26px; gap: 8px; align-items: center; }
.pfx-number input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 28px; }
.pfx-number input[type="number"], .pfx-colour input[type="color"] {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 6px; font: inherit; width: 100%;
}
.pfx-colour { display: flex; gap: 10px; align-items: center; }
.pfx-colour input[type="color"] { width: 52px; height: 32px; padding: 2px; }
.pfx-unit { color: var(--muted); font-size: 12px; }
.pfx-pending {
  position: sticky; bottom: 12px; margin-top: 14px; padding: 14px; border-radius: var(--radius);
  background: var(--panel-2); border: 1px solid color-mix(in srgb, var(--pending) 50%, var(--line));
  box-shadow: 0 18px 40px -20px var(--shadow-deep);
}
.pfx-pending h3 { margin: 0 0 8px; font-size: 14px; color: var(--pending); }
.pfx-pending ul { margin: 0 0 10px; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.pfx-before { color: var(--muted); text-decoration: line-through; }
.pfx-after { color: var(--pending); font-weight: 700; }
.pfx-pending textarea { width: 100%; }
.pfx-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pfx-error { margin-top: 10px; color: var(--danger); font-size: 13px; }
.pfx-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13px; }
.pfx-history li { padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.pfx-history li.is-current { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pfx-history ul { margin: 5px 0 0; padding-left: 18px; color: var(--text); }
.pfx-note { color: var(--muted); font-style: italic; margin-top: 4px; }
.pfx-results-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.pfx-compare-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 14px; }
.grid.pfx-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pfx-shot { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pfx-shot.is-paired { grid-column: span 2; }
@media (max-width: 700px) { .pfx-shot.is-paired { grid-column: auto; } }
.pfx-pair { display: grid; grid-template-columns: 1fr; gap: 2px; }
.pfx-shot.is-paired .pfx-pair { grid-template-columns: 1fr 1fr; }
.pfx-frame { position: relative; aspect-ratio: 16 / 9; background: var(--stage-mat); }
.pfx-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfx-main { cursor: zoom-in; }
.pfx-frame.is-missing::after { content: "not rendered"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.pfx-tag { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--overlay-chip); color: var(--accent); }
.pfx-other .pfx-tag { color: var(--muted); }
.pfx-shot figcaption { padding: 8px 10px 10px; font-size: 12.5px; display: grid; gap: 2px; }
.pfx-reason { color: var(--check-flag); }
.pfx-viewer { position: fixed; inset: 0; z-index: 60; background: var(--stage-postfx); display: grid; place-items: center; padding: 18px; }
.pfx-viewer[hidden] { display: none; }
.pfx-close { position: absolute; top: 14px; right: 14px; }
.pfx-viewer-body { display: grid; gap: 10px; width: min(1800px, 100%); }
.pfx-viewer-body.is-pair { grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .pfx-viewer-body.is-pair { grid-template-columns: 1fr; } }
.pfx-viewer figure { margin: 0; }
.pfx-viewer img { width: 100%; max-height: 82vh; object-fit: contain; display: block; }
.pfx-viewer figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; text-align: center; }
@media (max-width: 700px) {
  .pfx-params { margin-left: 0; }
  .pfx-param { grid-template-columns: 1fr; gap: 4px; }
  .pfx-number { grid-template-columns: 1fr 84px 26px; }
}
.pfx-queue-thumb { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; display: block; }

/* post processing, phase 2: requests to the AI, batch apply, per-shot results */
.pfx-request-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.pfx-lut { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pfx-lut-warning { flex-basis: 100%; font-size: 12px; color: var(--warning); line-height: 1.4; }
.pfx-request { padding: 14px; margin: 0 0 14px; border-radius: var(--radius); background: var(--panel-2);
  border: 1px solid color-mix(in srgb, var(--ai-request) 50%, var(--line)); }
.pfx-request h3 { margin: 0 0 6px; font-size: 14px; color: var(--ai-request); }
.pfx-request textarea, .pfx-shot-note, .pfx-verdict textarea, .pfx-batch-confirm textarea { width: 100%; }
.pfx-grid.is-requesting .pfx-main { cursor: crosshair; outline: 2px dashed color-mix(in srgb, var(--ai-request) 60%, transparent); outline-offset: -2px; }
svg.pfx-marks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
svg.pfx-marks ellipse { fill: none; stroke: var(--ai-request); stroke-width: .006; cursor: pointer; vector-effect: non-scaling-stroke; stroke-width: 3px; }
.pfx-requests { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; font-size: 13px; }
.pfx-requests li { padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); display: grid; gap: 3px; }
.pfx-requests li.is-open { border-color: color-mix(in srgb, var(--ai-request) 45%, var(--line)); }
.pfx-requests li button { justify-self: start; }
.pfx-answered { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius); background: var(--panel-2);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); font-size: 13.5px; display: grid; gap: 3px; }
.pfx-queue-form .pfx-actions { align-items: center; }
.pfx-actions select, .pfx-batch-pick select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; }
.pfx-batch-pick { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; font-size: 13px; }
.pfx-batch-summary { font-size: 13px; margin-bottom: 12px; }
.pfx-batch { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 14px; }
.pfx-batch-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.pfx-batch-row header { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
.pfx-batch-row .pfx-pair { grid-template-columns: 1fr 1fr; }
.pfx-batch-row figure.pfx-frame { margin: 0; }
.pfx-batch-row.is-gap, .pfx-batch-row.is-left-out { opacity: .6; }
.pfx-include { display: inline-flex; gap: 8px; align-items: center; }
.pfx-source { font-size: 12.5px; margin: 0; }
.pfx-row-pending { position: static; box-shadow: none; margin-top: 0; }
.pfx-tweaks summary { cursor: pointer; font-size: 13px; color: var(--accent); padding: 4px 0; }
.pfx-tweaks .pfx-steps { margin: 8px 0; }
.pfx-batch-confirm { margin-top: 16px; }
a.pfx-shot-link { color: inherit; text-decoration: none; display: block; }
.pfx-shot-panels { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.pfx-shot-panels[data-mode="previous"] [data-panel="raw"],
.pfx-shot-panels[data-mode="raw"] [data-panel="previous"] { display: none; }
.pfx-shot-panels[data-mode="both"] { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px) { .pfx-shot-panels, .pfx-shot-panels[data-mode="both"] { grid-template-columns: 1fr; } }
.pfx-panel { margin: 0; background: var(--stage-mat); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.pfx-panel img { width: 100%; display: block; }
.pfx-panel .placeholder { aspect-ratio: 16 / 9; }
.pfx-panel figcaption { color: var(--muted); font-size: 12.5px; padding: 6px 10px; }
.pfx-attempt-info, .pfx-verdict { max-width: 900px; font-size: 13.5px; }
.pfx-ok { color: var(--pfx-ok); font-style: normal; }
.pill.pfx-st-final { color: var(--st-final); border-color: color-mix(in srgb, var(--st-final) 45%, transparent); }
.pfx-redo { margin-top: 12px; }

/* ---------------------------------------------------------------- Look Versions (/looks) */
.looks-table { width: 100%; border-collapse: collapse; }
.looks-table th, .looks-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.look-version.is-merged, .look-version.is-rejected { opacity: .72; }
.look-head h3 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.look-num { color: var(--muted); font-weight: 500; }
.look-status.s-approved { color: var(--look-approved); }
.look-status.s-proposed { color: var(--look-proposed); }
.look-samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.look-samples img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; display: block; }
.look-dev.is-warn { color: var(--look-proposed); }
.look-changes { font-family: var(--font-mono-bare); font-size: .92em; overflow-wrap: anywhere; }
.look-parts dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; }
.look-parts dd { margin: 0; overflow-wrap: anywhere; }
.look-renders { columns: 2 240px; margin: 8px 0; }
.look-actions { flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.look-actions .look-name { min-width: 0; flex: 1 1 180px; }
.look-actions .look-into { max-width: 100%; }
.spec-look-link { color: inherit; text-decoration: underline dotted; }
.looks-scroll { overflow-x: auto; max-width: 100%; }

/* ---------------------------------------------------------------- the logo
   _logo.html names its colours by class; the values are the --logo-* tokens. */
.logo .logo-1 { stop-color: var(--logo-1); }
.logo .logo-2 { stop-color: var(--logo-2); }
.logo .logo-3 { stop-color: var(--logo-3); }
.logo .logo-4 { stop-color: var(--logo-4); }
.logo .logo-5 { stop-color: var(--logo-5); }
.logo .logo-6 { stop-color: var(--logo-6); }
.logo .logo-7 { stop-color: var(--logo-7); }
.logo .logo-flame-1 { stop-color: var(--logo-flame-1); }
.logo .logo-flame-2 { stop-color: var(--logo-flame-2); }
.logo .logo-flame-3 { stop-color: var(--logo-flame-3); }
.logo .logo-flame-4 { stop-color: var(--logo-flame-4); }
.logo .logo-core { fill: var(--logo-core); }

/* ---------------------------------------------------------------- icons
   Every emoji that is the only icon of something carries `ico ico-<name>`, so a theme can
   hide the glyph (`.ico { font-size: 0 }` or `color: transparent`) and draw its own with
   a ::before. Legacy draws the emoji, so the only rule is the one that keeps it exact:

   A span that merely *wraps* a leading emoji (in a pill, chip or button label) must not
   become a box of its own. Several of those containers are flex with a gap, so a boxed
   span turned the 4px space after the emoji into a 6px gap. `display: contents` keeps the
   element for a theme to target (it can set its own display) and lays out exactly as the
   bare emoji did. Only a pure wrapper - a span whose class *starts* `ico ico-` - is
   flattened; an element that holds the emoji as itself (.emoji, .state, .door-emoji,
   .ph-icon, .empty-ico, .bs-type-icon) lists its own class first and keeps its box. */
span[class^="ico ico-"]:not([aria-hidden]) { display: contents; }

/* ---------------------------------------------------------------- utilities
   These replaced inline style="" attributes in the templates. They carry !important so
   they win exactly where the inline style used to - an inline style beats every
   stylesheet rule that is not itself !important. A theme changes the tokens they read
   (--ph-icon-size, --danger ...) rather than fighting the !important. */
.crumb { margin-bottom: 4px !important; }
.panel-gap { margin-bottom: 18px !important; }
.empty-ico { font-size: var(--ph-icon-size) !important; }
.empty-ico-sm { font-size: var(--ph-icon-size-sm) !important; }
.empty-ico-lg { font-size: var(--ph-icon-size-lg) !important; }
.tone-danger { color: var(--danger) !important; }
.tone-warning { color: var(--warning) !important; }
.tone-muted { color: var(--text-muted) !important; }
.warnbar.is-quiet {
  background: var(--surface-raised) !important; border-color: var(--border) !important;
  color: var(--text-muted) !important;
}
.is-unavailable { pointer-events: none !important; opacity: var(--unavailable-opacity) !important; }
.btn-block { width: 100% !important; justify-content: center !important; }
.w-100 { width: 100% !important; }
.btn-xl { padding: 14px !important; font-size: 16px !important; }
.list-plain { list-style: none !important; padding: 0 !important; }
.text-center { text-align: center !important; }
.fs-11-5 { font-size: 11.5px !important; }
.fs-13 { font-size: 13px !important; }
.fs-21 { font-size: 21px !important; }
.fs-24 { font-size: 24px !important; }
.fw-400 { font-weight: 400 !important; }
.m-0 { margin: 0 !important; }
.m-0-0-4 { margin: 0 0 4px !important; }
.m-0-0-8 { margin: 0 0 8px !important; }
.m-0-0-10 { margin: 0 0 10px !important; }
.m-2-0-0 { margin: 2px 0 0 !important; }
.m-8-0-0 { margin: 8px 0 0 !important; }
.m-10-0 { margin: 10px 0 !important; }
.m-10-0-0 { margin: 10px 0 0 !important; }
.m-12-0 { margin: 12px 0 !important; }
.m-n6-0-14 { margin: -6px 0 14px !important; }
.mt-0 { margin-top: 0 !important; }
.mt-n8 { margin-top: -8px !important; }
.mt-6 { margin-top: 6px !important; }
.mt-8 { margin-top: 8px !important; }
.mt-10 { margin-top: 10px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-14 { margin-top: 14px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-18 { margin-top: 18px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-22 { margin-top: 22px !important; }
.mt-26 { margin-top: 26px !important; }
.mt-28 { margin-top: 28px !important; }
.mb-16 { margin-bottom: 16px !important; }
.ml-10 { margin-left: 10px !important; }
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.gap-7 { gap: 7px !important; }
.gap-8 { gap: 8px !important; }
.gap-10 { gap: 10px !important; }
.gap-12 { gap: 12px !important; }
.cursor-pointer { cursor: pointer !important; }

/* ======================================================== the shared review layout
   The layout of the review screens under the new themes: one toolbar over the gallery, and
   a viewer with a top bar, two collapsible side columns and a stage that holds nothing but
   the picture. portal/docs/review_layout.md says why each rule is what it is.

   Legacy keeps today's layout exactly. Every rule below that changes what is drawn is
   scoped to `NL` - an html element that HAS a data-theme and it is not "legacy" (master
   before the theme plumbing sets no data-theme at all, which must read as legacy too) - and
   anchored on `#viewer` inside the viewer, so no legacy state rule can out-rank it. The only
   unscoped rules are the ones that keep the new markup out of legacy's way: `display: none`
   for what only this layout draws, `display: contents` for the wrappers it adds.

   The layout tokens. Declared on a plain :root so a theme's `:root[data-theme="x"]` can
   override any of them without a specificity fight; legacy never reads them. */
:root {
  --rv-topbar-h: 58px;          /* the viewer's top bar, including its quiet bottom edge */
  --rv-control-h: 30px;         /* a control in the top bar */
  --rv-col-left: 260px;         /* the information column (I hides it) */
  --rv-col-right: 290px;        /* the decision column */
  --rv-col-left-xl: 300px;      /* both, from 1920px */
  --rv-col-right-xl: 320px;
  --rv-col-left-specs: 340px;   /* the information column while Render Review's inspector shows */
  --rv-col-side: 300px;         /* 761-1100px: one side track holding both columns */
  --rv-col-pad: 18px;           /* inside a side column; >= 18px keeps text out of the band */
  --rv-stage-pad: 6px;          /* the neutral band round the picture: 0-6px */
  --rv-compare-gap: 6px;        /* between the two pictures in Compare */
  --rv-caption-h: 38px;         /* Compare's pass captions, above the pictures: an 18px
                                   line, then 18px+ of empty stage before the picture */
  --rv-toolbar-gap: 8px;        /* the gallery's review toolbar */
  --rv-stage-bg: var(--stage-black);     /* opaque and neutral, always */
  --rv-chrome-bg: var(--surface-panel);  /* top bar and side columns, next to the stage */
  --rv-caption-text: #b8b8b8;   /* on the stage, so neutral grey, never a hue */
  --rv-caption-now: #ffffff;
}

/* Out of legacy's way. */
.nl-only { display: none; }
.viewer-top, .review-toolbar, .vt-lbl { display: contents; }

/* ---------------------------------------------------------------- the review toolbar */
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--rv-toolbar-gap) calc(var(--rv-toolbar-gap) * 2);
  margin: 0 0 18px; padding: 0 0 12px; border-bottom: 1px solid var(--line);
  min-width: 0;
}
/* What the pass is, above the row of things to do with it. */
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar > #pass-summary { order: -1; flex: 1 1 100%; min-width: 0; margin: 0 0 4px !important; }
/* The pass buttons become one picker (#pass-select); the buttons stay, hidden, because
   other readers find the pass through them. */
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar > .pass-bar { display: none; }
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar > .pass-tools { margin: 0; min-width: 0; max-width: 100%; }
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar .pass-tools-label { white-space: nowrap; }
:root[data-theme]:not([data-theme="legacy"]) .rt-pass { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; order: 0; }
:root[data-theme]:not([data-theme="legacy"]) .rt-pass select { min-width: 0; max-width: min(52ch, 100%); }
:root[data-theme]:not([data-theme="legacy"]) #filter-tools { order: 1; }
:root[data-theme]:not([data-theme="legacy"]) #category-tools { order: 2; }
:root[data-theme]:not([data-theme="legacy"]) #gameplay-tools { order: 3; }
:root[data-theme]:not([data-theme="legacy"]) #specs-tools { order: 4; }
:root[data-theme]:not([data-theme="legacy"]) #status-tools { order: 5; }
:root[data-theme]:not([data-theme="legacy"]) .rt-batch { order: 6; }
:root[data-theme]:not([data-theme="legacy"]) .rt-export { order: 8; margin-left: auto; }
:root[data-theme]:not([data-theme="legacy"]) .rt-keys { order: 9; display: block; position: relative; }
:root[data-theme]:not([data-theme="legacy"]) .rt-keys > summary { list-style: none; }
:root[data-theme]:not([data-theme="legacy"]) .rt-keys > summary::-webkit-details-marker { display: none; }
:root[data-theme]:not([data-theme="legacy"]) .rt-keys-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px;
  width: max-content; max-width: min(380px, calc(100vw - 32px));
  margin: 0; padding: 12px 14px; font-size: 12.5px;
  background: var(--surface-panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
:root[data-theme]:not([data-theme="legacy"]) .rt-keys-pop dt { margin: 0; text-align: right; font-family: var(--font-mono); color: var(--text); }
:root[data-theme]:not([data-theme="legacy"]) .rt-keys-pop dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
@media (hover: none) { :root[data-theme]:not([data-theme="legacy"]) .rt-keys { display: none; } }

/* ---------------------------------------------------------------- the part page toolbar
   Render Review's part page (`.rt-part`, renders_review.html; part_toolbar.js), so the
   renders start on the first screen (layout proposals B02 desktop, B03 phone):
     summary, one line
     delivery picker ............................ Post-process · Queue final renders
     Mode: Gameplay  Sync  Batch  [Filters · 2 on · 3 hidden]  flags ...........  Keys
     (Filters open: the spec selects and text, then the category chips)
     Status: the chips, a row of their own - one sideways-scrolling line on a phone
   #status-tools is `display: contents` here, so its queue button can sit beside the picker
   while staying the same element in the same row for final_queue.js and the checks. The
   rows keep their ids and their inline display:none. */
:root[data-theme]:not([data-theme="legacy"]) .rt-howto { display: none; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > .rt-break { display: block; flex: 0 0 100%; height: 0; margin: 0; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > #pass-summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 9px 14px;
}
:root[data-theme]:not([data-theme="legacy"]) .rt-part > #pass-summary > * { margin: 0 !important; min-width: 0; overflow-wrap: anywhere; }
/* The picker gives way first when the delivery line is full (Ukrainian), so Keys and the
   two actions keep their line. */
:root[data-theme]:not([data-theme="legacy"]) .rt-part > .rt-pass { order: 0; flex: 1 1 240px; max-width: 34em; min-width: min(240px, 100%); }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > .rt-pass select { flex: 1 1 auto; width: 0; min-width: 0; max-width: none; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > #status-tools { display: contents; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part #rt-postfx { order: 1; display: flex; min-width: 0; max-width: 100%; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part #rt-postfx:empty { display: none; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > .final-queue { order: 1; margin-left: auto; max-width: 100%; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > .final-queue[hidden] ~ #rt-postfx { margin-left: auto; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > .rt-break-modes { order: 2; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > #gameplay-tools { order: 3; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > #rt-filters { order: 4; display: inline-flex; align-items: center; gap: 8px; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > #filter-tools { order: 5; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > #specs-tools { order: 6; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > .rt-keys { order: 1; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > #category-tools { order: 8; flex: 1 1 100%; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part > .rt-break-status { order: 19; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > .pass-tools-label { order: 20; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > #status-chips { order: 21; flex: 1 1 320px; min-width: 0; max-width: 100%; margin: 0; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > #status-clear { order: 22; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > #status-counts { order: 23; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > #status-counts:empty { display: none; }
/* Open, the spec filters are a row of their own; folded, only their flag buttons are left. */
:root[data-theme]:not([data-theme="legacy"]) .rt-part:not(.is-folded) > #specs-tools { flex: 1 1 100%; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part.is-folded #specs-tools > .rt-fold,
:root[data-theme]:not([data-theme="legacy"]) .rt-part.is-folded > #category-tools { display: none !important; }
:root[data-theme]:not([data-theme="legacy"]) .rt-part.is-folded > #specs-tools:not(:has(> button:not([hidden]):not(.rt-fold))) { display: none; }
/* The button says what the fold hides: how many filters are on, and the renders they hide. */
:root[data-theme]:not([data-theme="legacy"]) .rt-filters-n {
  font-style: normal; font-size: 11.5px; font-weight: 650; white-space: nowrap;
  padding: 1px 8px; border-radius: var(--radius-pill);
  color: var(--accent-ink, var(--text)); background: color-mix(in srgb, var(--accent) 22%, var(--panel-2));
  border: 1px solid var(--accent);
}
:root[data-theme]:not([data-theme="legacy"]) .rt-filters.is-active { border-color: var(--accent); }
:root[data-theme]:not([data-theme="legacy"]) .rt-filters[aria-expanded="true"] { border-color: var(--accent); }
/* Short names are for the phone. */
:root[data-theme]:not([data-theme="legacy"]) .rt-part .rt-short { display: none; }
/* An edge cue on whatever scrolls sideways (part_toolbar.js): a fade on the side with more.
   A mask, not a layer: nothing is laid over the chips, so they stay what a tap lands on. */
:root[data-theme]:not([data-theme="legacy"]) .rt-part .rt-scroller.rt-more-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
:root[data-theme]:not([data-theme="legacy"]) .rt-part .rt-scroller.rt-more-start { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
:root[data-theme]:not([data-theme="legacy"]) .rt-part .rt-scroller.rt-more-start.rt-more-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
@media (max-width: 760px) {
  :root[data-theme]:not([data-theme="legacy"]) .rt-part { column-gap: 8px; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part > #pass-summary { padding: 7px 12px; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part > #pass-summary > :not(.mono) { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part > #pass-summary > .mono { font-size: 11.5px; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part > .rt-pass { flex: 1 1 100%; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part > .rt-pass select { flex: 1 1 auto; max-width: none; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part #rt-postfx,
  :root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > .final-queue,
  :root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > .final-queue[hidden] ~ #rt-postfx { margin-left: 0; order: 24; }
  /* One line where it fits; on a narrow phone, in Ukrainian, a second line, never a
     page that scrolls sideways. */
  :root[data-theme]:not([data-theme="legacy"]) .rt-part > #gameplay-tools { flex-wrap: wrap; gap: 6px; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part > #gameplay-tools > .pass-tools-label,
  :root[data-theme]:not([data-theme="legacy"]) .rt-part > #gameplay-tools > #gameplay-hint:empty { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part > #gameplay-tools .btn,
  :root[data-theme]:not([data-theme="legacy"]) .rt-part > #rt-filters { white-space: nowrap; padding-inline: 10px; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part .rt-long { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part .rt-short { display: inline; }
  /* On a phone the pending-changes buttons fold too (part_toolbar.js counts a pressed one
     as on). The two warnings - missing textures and a replaced picture - stay out. */
  :root[data-theme]:not([data-theme="legacy"]) .rt-part.is-folded #specs-tools > :is(#specs-pending-filter, #specs-pending-open) { display: none !important; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part.is-folded > #specs-tools:not(:has(> :is(#mt-filter, #rr-filter):not([hidden]))) { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > .pass-tools-label { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > #status-chips {
    flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; padding-bottom: 2px;
  }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part #status-tools > #status-chips::-webkit-scrollbar { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) .rt-part #status-chips > * { flex: 0 0 auto; white-space: nowrap; }
}

/* ---------------------------------------------------------------- the viewer
   One grid, defined once from variables. Breakpoints only set the column widths; the I and
   W toggles only zero them, at a higher specificity, so no breakpoint and no order of
   toggling can bring a column back (Darkroom's >=1920px bug was a breakpoint re-stating
   the template after the toggle had). */
:root[data-theme]:not([data-theme="legacy"]) #viewer {
  --rv-left: var(--rv-col-left); --rv-right: var(--rv-col-right);
  background: var(--rv-stage-bg); backdrop-filter: none;
}
@media (min-width: 1920px) {
  :root[data-theme]:not([data-theme="legacy"]) #viewer { --rv-left: var(--rv-col-left-xl); --rv-right: var(--rv-col-right-xl); }
}
@media (min-width: 1101px) {
  :root[data-theme]:not([data-theme="legacy"]) #viewer.has-specs { --rv-left: var(--rv-col-left-specs); }
}
@media (min-width: 761px) and (max-width: 1100px) {
  :root[data-theme]:not([data-theme="legacy"]) #viewer { --rv-left: 0px; --rv-right: var(--rv-col-side); }
}
:root[data-theme]:not([data-theme="legacy"]) #viewer.open.no-info { --rv-left: 0px; }
:root[data-theme]:not([data-theme="legacy"]) #viewer.open.is-wide { --rv-left: 0px; --rv-right: 0px; }

@media (min-width: 761px) {
  :root[data-theme]:not([data-theme="legacy"]) #viewer.open {
    display: grid;
    grid-template-columns: var(--rv-left) minmax(0, 1fr) var(--rv-right);
    grid-template-rows: auto minmax(0, 1fr);
  }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-top { grid-column: 1 / -1; grid-row: 1; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-left { grid-column: 1; grid-row: 2; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-stage { grid-column: 2; grid-row: 2; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right { grid-column: 3; grid-row: 2; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer.open.no-info #viewer-left,
  :root[data-theme]:not([data-theme="legacy"]) #viewer.open.is-wide #viewer-left,
  :root[data-theme]:not([data-theme="legacy"]) #viewer.open.is-wide #viewer-right { display: none; }
  /* The variants are chips in the top bar; the column's copy is for the phone sheet. */
  :root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-left .block:has(> #variant-switch) { display: none; }
}
/* 761-1100px: two side columns would leave the stage a sliver, so both share one track -
   the decision on top, the information under it. */
@media (min-width: 761px) and (max-width: 1100px) {
  :root[data-theme]:not([data-theme="legacy"]) #viewer.open { grid-template-rows: auto minmax(0, 3fr) minmax(0, 2fr); }
  :root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right { grid-column: 3; grid-row: 2; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-left { grid-column: 3; grid-row: 3; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-stage { grid-row: 2 / span 2; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer.open.no-info #viewer-right { grid-row: 2 / span 2; }
}

/* ----------------------------------------------------------- the top bar
   Its controls are vertically centred with (topbar - control) / 2 of empty bar under them:
   with the stage's 6px band that keeps every non-neutral pixel at least 18px from the
   picture, which is how far out the harness samples the surround. */
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-top {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  min-width: 0; min-height: var(--rv-topbar-h);
  padding: calc((var(--rv-topbar-h) - var(--rv-control-h)) / 2) 10px;
  background: var(--rv-chrome-bg);
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-top button { flex: 0 0 auto; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-close {
  position: static; width: var(--rv-control-h); height: var(--rv-control-h);
  display: inline-grid; place-items: center; padding: 0; font-size: 14px;
  border-radius: var(--radius-sm);
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-close:hover { transform: none; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-where { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-title, :root[data-theme]:not([data-theme="legacy"]) #viewer .vt-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-title { font-weight: 700; font-size: 14px; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-sub { font-size: 12px; color: var(--muted); }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-nav { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-btn, :root[data-theme]:not([data-theme="legacy"]) #viewer .vt-chip {
  height: var(--rv-control-h); min-width: var(--rv-control-h); padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: transparent; color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer;
  white-space: nowrap;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-btn { font-size: 17px; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 4px; white-space: nowrap; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-vars { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-chip[aria-current="true"] { border-color: var(--accent); color: var(--accent); }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-verdict { width: 7px; height: 7px; border-radius: 50%; background: var(--dot-idle); flex: 0 0 auto; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-chip.is-finalised .vt-verdict { background: var(--verdict-finalised); }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-chip.is-changes .vt-verdict { background: var(--verdict-changes); }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-chip.st-mark .vt-verdict { background: var(--st); }
/* The toast slot is the bar's flexible middle, so it is also what pushes the tools right. */
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-toasts { display: flex; justify-content: center; align-items: center; flex: 1 1 0; min-width: 0; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-toasts #toast-stack {
  position: static; transform: none; z-index: auto;
  display: flex; flex-direction: row; justify-content: center; max-width: 100%; min-width: 0;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-toasts #toast-stack > :not(:last-child) { display: none; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-toasts .toast {
  transform: none; min-width: 0; max-width: 100%; height: var(--rv-control-h);
  padding: 0 12px; font-size: 12.5px; border-radius: var(--radius-sm);
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-toasts .toast > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-tools {
  position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-left: auto; min-width: 0;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-tool {
  height: var(--rv-control-h); padding: 0 10px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-sm); font-size: 12.5px; white-space: nowrap;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-tool[hidden] { display: none; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-lbl { display: inline; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-mark { display: flex; align-items: center; min-width: 0; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-mark .markbar {
  position: static; transform: none; z-index: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 0; border: 0; border-radius: 0; background: none; backdrop-filter: none;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-mark .markbar:empty { display: none; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-top .btn {
  height: var(--rv-control-h); min-height: 0; padding: 0 10px; gap: 6px;
  font-size: 12.5px; border-radius: var(--radius-sm); white-space: nowrap;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .vt-mark .markbar-note { display: inline; white-space: nowrap; }
/* No glow out of the bar's quiet edge (legacy's .btn hover shadow is cyan). */
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-top .btn, :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-top .btn:hover { box-shadow: none; }
/* While drawing, the bar is the drawing tools. */
:root[data-theme]:not([data-theme="legacy"]) #viewer.marking .vt-nav, :root[data-theme]:not([data-theme="legacy"]) #viewer.marking .vt-vars,
:root[data-theme]:not([data-theme="legacy"]) #viewer.marking #viewer-info, :root[data-theme]:not([data-theme="legacy"]) #viewer.marking #viewer-wide,
:root[data-theme]:not([data-theme="legacy"]) #viewer.marking #viewer-compare { display: none; }
@media (min-width: 761px) {
  :root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-info, :root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-wide { display: inline-flex; }
}
/* A short bar keeps the glyphs and drops the words. */
@media (min-width: 761px) and (max-width: 1360px) {
  :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-tools .vt-lbl { display: none; }
}

/* ----------------------------------------------------------- the side columns */
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-col {
  padding: var(--rv-col-pad); overflow-y: auto; overflow-x: hidden;
  min-width: 0; min-height: 0; background: var(--rv-chrome-bg);
}
/* The decision first. Its block is not closed until the end of the column (the thread,
   grouping and library blocks are inside it), so it is flattened and its own parts are
   ordered ahead of everything else. */
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right { display: flex; flex-direction: column; gap: 12px; }
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right > *, :root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .block-decision > * { margin-top: 0; }
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .block-decision { display: contents; }
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .block-decision > h4,
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .block-decision > #decision-state,
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .block-decision > .note-input,
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .block-decision > .decision-note,
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .block-decision > .viewer-actions,
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .block-decision > #status-block,
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .block-decision > p.sub { order: -1; }
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .block h4 { margin-bottom: 8px; }
/* Render Review: ▶ Play from here (gameplay.js), straight after the verdict controls.
   `nl-only`, so legacy's column is unchanged; G works in every theme. */
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .gp-here.nl-only { display: flex; }
/* Render Review: what the brief asks for, first in the information column (review.js,
   layout proposal B04). Its right-column copy is shown only while that column is off. */
:root[data-theme]:not([data-theme="legacy"]) #viewer .brief-first {
  margin: 14px 0 4px; padding: 10px 12px; border-left: 3px solid var(--accent);
  background: var(--panel-2); border-radius: var(--radius-sm);
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .brief-first p { margin: 0; color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .brief-fallback { display: none; }
@media (min-width: 761px) {
  :root[data-theme]:not([data-theme="legacy"]) #viewer.open.no-info .brief-fallback { display: block; }
}
/* The top bar has the browsing controls. */
:root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-right .nav-arrows { display: none; }
/* Verdict buttons stacked full width: label, glyph and any hint always fit. */
:root[data-theme]:not([data-theme="legacy"]) #viewer .block-decision > .viewer-actions,
:root[data-theme]:not([data-theme="legacy"]) #viewer #status-block .viewer-actions {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 0;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .block-decision > .viewer-actions .btn,
:root[data-theme]:not([data-theme="legacy"]) #viewer #status-block .viewer-actions .btn {
  width: 100%; min-height: 40px; justify-content: flex-start; text-align: left; white-space: normal;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer #status-block { display: grid; gap: 10px; }
:root[data-theme]:not([data-theme="legacy"]) #viewer #status-block .st-assign { margin-top: 0; }
:root[data-theme]:not([data-theme="legacy"]) #viewer #status-block .st-assign select { min-width: 0; max-width: 100%; }

/* ----------------------------------------------------------- the stage
   The picture is sized by layout alone: the stage is a size container, and the image is
   capped at its content box in container units, so the browser's own min/max resolution
   for a replaced element gives the contain-fit - never larger than the file - on every
   switch, toggle, resize and late load. No script measures anything. */
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-stage {
  position: relative; display: grid; place-items: center;
  /* legacy's flex `justify-content: center` would stop the grid track stretching, and
     Compare's two panes would collapse to nothing */
  justify-content: stretch; align-content: stretch;
  min-width: 0; min-height: 0; overflow: hidden;
  padding: var(--rv-stage-pad); background: var(--rv-stage-bg);
  container-type: size;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-stage .shot-box { display: block; position: relative; line-height: 0; max-width: none; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-stage img {
  display: block; width: auto; height: auto; max-width: 100cqw; max-height: 100cqh;
  border-radius: 0; box-shadow: none; animation: none;
}
/* Compare: two equal panes, each its own size container. The pass captions sit in the
   stage's top padding, above the pictures, so they never cover one and never take height
   from it - and they are neutral grey because they sit on the stage. */
:root[data-theme]:not([data-theme="legacy"]) #viewer.comparing .viewer-stage { padding-top: var(--rv-caption-h); }
:root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-stage > .compare {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--rv-compare-gap);
  align-items: stretch;
  width: 100%; height: 100%; min-width: 0; min-height: 0; place-self: stretch;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .compare-pane {
  position: relative; margin: 0; min-width: 0; min-height: 0; max-width: none;
  display: grid; place-items: center; line-height: 0; container-type: size;
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .compare-pane img { max-width: 100cqw; max-height: 100cqh; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .compare-pane figcaption {
  position: absolute; top: calc(-1 * var(--rv-caption-h)); left: 0; right: 0; z-index: 1;
  display: block; height: var(--rv-caption-h); max-width: none; padding: 2px 8px 0;
  line-height: 18px; text-align: center; font-size: 12px; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 0; border-radius: 0; background: none; backdrop-filter: none;
  color: var(--rv-caption-text);
}
:root[data-theme]:not([data-theme="legacy"]) #viewer .compare-pane figcaption .mono { color: inherit; }
:root[data-theme]:not([data-theme="legacy"]) #viewer .compare-pane.is-now figcaption,
:root[data-theme]:not([data-theme="legacy"]) #viewer .compare-pane.is-now figcaption b { color: var(--rv-caption-now); }

/* ----------------------------------------------------------- phone (<= 760px)
   The verdict bar is its own row at the bottom and nothing is laid over it: Mark up lives
   in the top bar. The gestures are review.js's, unchanged. */
@media (max-width: 760px) {
  :root[data-theme]:not([data-theme="legacy"]) #viewer { --rv-topbar-h: 64px; --rv-control-h: 36px; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer.open { display: flex; flex-direction: column; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-top {
    order: -2; flex: 0 0 auto; position: relative; flex-wrap: nowrap;
    padding-top: calc(var(--safe-t) + (var(--rv-topbar-h) - var(--rv-control-h)) / 2);
    padding-left: calc(8px + var(--safe-l)); padding-right: calc(8px + var(--safe-r));
  }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-stage { order: -1; flex: 1 1 auto; padding: var(--rv-stage-pad); }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .vt-where, :root[data-theme]:not([data-theme="legacy"]) #viewer .vt-nav, :root[data-theme]:not([data-theme="legacy"]) #viewer .vt-vars,
  :root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-info, :root[data-theme]:not([data-theme="legacy"]) #viewer #viewer-wide { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-close { background: var(--panel-2); backdrop-filter: none; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-tools { flex-wrap: nowrap; }
  /* A toast covers the bar for its 2.6s rather than the picture or the verdicts. */
  :root[data-theme]:not([data-theme="legacy"]) #viewer .vt-toasts {
    position: absolute; left: 8px; right: 8px; top: var(--safe-t); bottom: 0; z-index: 2;
    pointer-events: none;
  }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .vt-toasts #toast-stack { width: 100%; height: 100%; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .vt-toasts .toast {
    pointer-events: auto; flex: 1 1 auto; justify-content: center; height: 100%;
    border-radius: 0; background: var(--rv-chrome-bg);
  }
  :root[data-theme]:not([data-theme="legacy"]) #viewer.marking .viewer-close { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer.marking .viewer-top { flex-wrap: wrap; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer.marking .viewer-tools { flex-wrap: wrap; margin-left: 0; }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .vt-mark .markbar-note { display: none; }
  /* Whatever sits under the stage keeps its first 13px empty and borderless, for the
     same reason as the top bar's quiet edge: the picture's surround is sampled 18px out. */
  :root[data-theme]:not([data-theme="legacy"]) #viewer .vdots { padding-top: 14px; min-height: 30px; }
  /* The one-time swipe hint (review.js puts it right after the stage under this layout):
     a strip between the stage and the dots, never over the picture. Its top 14px stay
     empty, like the dots row's, because the surround is sampled 18px out. */
  :root[data-theme]:not([data-theme="legacy"]) #viewer > .swipe-hint {
    position: static; order: -1; flex: 0 0 auto; transform: none;
    display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 2px 14px; margin: 0; padding: 14px 12px 6px;
    border: 0; border-radius: 0; background: var(--rv-chrome-bg); backdrop-filter: none;
    animation: rv-hint 3200ms var(--ease) forwards;
  }
  @keyframes rv-hint { 0% { opacity: 0; } 10%, 78% { opacity: 1; } 100% { opacity: 0; } }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .vdots[style*="none"] + .vstrip { border-top: 0; padding-top: 14px; }
}

/* The viewer takes focus back from the Re-render form when nothing nearer can (scene_specs.js
   restoreModifyFocus adds the tabindex). A focus ring round the whole screen would sit in
   the picture's neutral surround, so the container draws none; its controls keep theirs. */
.viewer[tabindex="-1"]:focus { outline: none; }

/* ---- Re-render (Modify) beside the picture (scene_specs.js placeDock, layout proposal B07).
   Opened from the viewer at 1101px and up with the information column showing, the form
   sits over that column instead of dimming and blurring the whole screen: no scrim, no
   blur, and nothing over the stage. A taller note box, because there is room for one. */
:root[data-theme]:not([data-theme="legacy"]) .spec-dialog.open.is-docked {
  inset: auto; left: var(--dock-l); top: var(--dock-t); width: var(--dock-w); height: var(--dock-h);
  padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  align-items: stretch; justify-content: stretch;
}
:root[data-theme]:not([data-theme="legacy"]) .spec-dialog.is-docked .spec-dialog-box {
  width: 100%; height: 100%; max-height: none; border-radius: 0; border-width: 0 1px 0 0; box-shadow: none;
}
:root[data-theme]:not([data-theme="legacy"]) .spec-dialog.is-docked .spec-dialog-body { flex: 1 1 auto; min-height: 0; }
:root[data-theme]:not([data-theme="legacy"]) .spec-dialog.is-docked .spec-batch-field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
:root[data-theme]:not([data-theme="legacy"]) .spec-dialog.is-docked #spec-modify-note { min-height: 140px; }

/* ---- the replacement rules on Render Review (render_replacements.js). Staff only. */
.rr-badge {
  position: absolute; left: 8px; bottom: 8px; z-index: 3; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--overlay-strong); font-size: 11px; font-weight: 700; letter-spacing: .3px; pointer-events: auto;
}
.rr-badge.second { bottom: 32px; }
.rr-flagged { color: var(--st-replaced-other); border: 1px solid var(--st-replaced-other); }
.rr-answers { color: var(--accent); border: 1px solid var(--accent); }
.rr-filter em { font-style: normal; color: var(--muted); margin-left: 3px; }
#rr-filter { border-color: color-mix(in srgb, var(--st-replaced-other) 55%, transparent); }
#rr-filter[aria-pressed="true"] { --btn-accent: var(--st-replaced-other); color: var(--st-replaced-other); }
.rr-versions { border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: var(--radius); padding: 8px 10px; margin: 0 0 10px; }
.rr-head { margin: 0 0 6px; font-size: 12.5px; }
.rr-head em { font-style: normal; color: var(--muted); margin-left: 4px; }
.rr-none { margin: 0; font-size: 12px; }
.rr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.rr-ver { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.rr-ver img { width: 64px; height: 40px; object-fit: cover; border-radius: 4px; background: var(--surface-page); }
.rr-ver.is-current img { outline: 2px solid var(--accent); }
.rr-title { font-weight: 600; }
.rr-meta .sub { overflow-wrap: anywhere; }
.rr-chip { font-size: 10.5px; padding: 0 6px; border-radius: var(--radius-pill); margin-left: 4px; }
.rr-flagged-chip { color: var(--st-replaced-other); border: 1px solid var(--st-replaced-other); }
.rr-compare-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.rr-compare-pics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rr-compare-pics figure { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rr-compare-pics img { width: 100%; max-height: 72vh; object-fit: contain; background: var(--surface-page); border-radius: 6px; }
.rr-compare-pics figcaption { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .rr-compare-pics { grid-template-columns: 1fr; } }
/* the catalogue's chip and count for the same flag */
.st-chip.st-replaced_other, .st-pill.st-replaced_other { --st: var(--st-replaced-other); }
.rr-cat-row { margin: -4px 0 12px; }
.rr-cat-chip { text-decoration: none; }
.rr-cat-chip.is-on { outline: 2px solid var(--st-replaced-other); outline-offset: 1px; }
.final-episode-row .rr-cat-chip { align-self: center; }
/* the artist's change requests: request number, Upload replacement, what was answered */
.change-req-no { color: var(--muted); }
.answered-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

/* Per-light editors in the Lighting card (scene_specs.js lightEditors). */
.spec-light-edits { margin: 6px 0; }
.spec-light-edit { border-top: 1px solid var(--line, rgba(255,255,255,.08)); padding: 3px 0; }
.spec-light-edit > summary { cursor: pointer; overflow-wrap: anywhere; font-size: 12.5px; }

/* ---------------------------------------------------------------- scoped access
   The admin's per-artist "what else may they see" setting (_access_scope.html,
   access_scopes.py) and an artist's own-version edit box (_own_version.html). Roles only,
   so every theme restyles them by overriding tokens. */
.scope-group { display: flex; flex-direction: column; gap: 10px; }
.scope-form { margin: 0; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px); background: var(--surface-raised); }
.scope-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.scope-switch { display: flex; gap: 9px; align-items: center; font-size: 14px; cursor: pointer; color: var(--text-primary); }
.scope-switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.scope-help { font-size: 12px; margin: 6px 0 0; }
.scope-body { margin-top: 8px; }
.scope-mode { border: 0; padding: 0; margin: 0 0 6px; }
.scope-mode .check { margin: 4px 0; }
.scope-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.scope-tools .scope-find { flex: 1 1 140px; min-width: 0; margin: 0; min-height: 0; }
.scope-list { list-style: none; margin: 8px 0 0; padding: 4px 8px; max-height: 220px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); background: var(--surface-sunken);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); column-gap: 10px; }
.scope-list .check { margin: 4px 0; font-size: 13px; overflow-wrap: anywhere; }
.scope-list .scope-gone { color: var(--text-muted); }
.scope-form .root-row { margin-top: 8px; }

.own-version { margin: 10px 0 14px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px); background: var(--surface-raised); display: flex; flex-direction: column; gap: 8px; }
.own-version .field { margin: 0; }
.own-version .note-input { width: 100%; }
.own-version-head { margin: 0; }
.own-version-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dev-variation { margin: 16px 0 6px; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- arriving from a link
   The render specs panel links a character to its closest Character Development card and
   a set to its Environments row; the target is marked for a moment so the eye finds it.
   An outline in the theme's own accent: chrome, never the picture, in every theme. */
.is-arrived {
  outline: 3px solid var(--accent); outline-offset: 3px;
  animation: arrive-mark 2.4s ease-out forwards;
}
.envrow, .look-version { scroll-margin-top: 72px; }
@keyframes arrive-mark {
  0%, 60% { outline-color: var(--accent); }
  100% { outline-color: transparent; }
}
/* Scene specs: what a render's look differs in from its closest development picture. */
.spec-diff { margin: 2px 0 4px; padding-left: 18px; font-size: 12.5px; overflow-wrap: anywhere; }
.spec-diff li { margin: 1px 0; }

/* ------------------------------------------------- admin-errors batch (C07, C08)
   C07 - "that page isn't available" (templates/_unavailable.html). A behaviour fix, so it
   is drawn in every theme, legacy included; it only exists when the home page was reached
   through web.unavailable_redirect, so a plain home page is unchanged. Colours are tokens
   every theme already sets.
   C08 - "View as them" on an artist's People card (templates/admin_users.html). Layout,
   so new themes only: the form is `nl-only` and shown here. */
.unavailable-notice {
  display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; margin: 0 0 18px; padding: 14px 18px;
  border: 1px solid var(--line); border-left: 3px solid var(--attention);
  border-radius: 10px; background: var(--panel); color: var(--text);
}
.unavailable-text { flex: 1 1 260px; min-width: 0; }
.unavailable-text strong { display: block; margin-bottom: 4px; color: var(--text-strong); }
.unavailable-text p { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.unavailable-text code { color: var(--text-strong); }

:root[data-theme]:not([data-theme="legacy"]) .acct-viewas.nl-only { display: inline-flex; margin: 0; }
:root[data-theme]:not([data-theme="legacy"]) .acct-viewas .btn { --btn-accent: var(--viewas); }

/* ================================================================ review grid (layout batch
   "review-grid": A03, A06, A07, A08, C10). The shared layout of the new themes only; legacy
   draws none of it. portal/docs/review_layout.md, "The review grid". */

/* The toolbar and summary rules below are for the review grid pages (expressions, Character
   Development). Render Review's part page lays out its own toolbar (`.rt-part`, "the part page
   toolbar" above), so they skip it; the loading placeholders, the card buttons and the batch
   bar further down apply there too. */

/* A06 / A07: the header is the crumb and the title. The key list is behind Keys on a
   desktop, and a phone has no keyboard. */
:root[data-theme]:not([data-theme="legacy"]) .page-head .review-keys { display: none; }
:root[data-theme]:not([data-theme="legacy"]) .page-head:has(.review-keys) { margin-bottom: 12px; }
/* The pass summary is one line, not a box: name, description, counts. It wraps, never
   truncates, so a long description or Ukrainian counts stay whole. */
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > #pass-summary.panel {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px;
  padding: 0 !important; border: 0; border-radius: 0; background: none; box-shadow: none;
  min-height: 22px; margin: 0 0 2px !important;
}
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > #pass-summary.panel::before,
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > #pass-summary.panel::after { display: none; }
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > #pass-summary .pass-title { font-weight: 600; margin: 0; }
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > #pass-summary .pass-label { color: var(--muted); margin: 0; }
:root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > #pass-summary .mono { margin-top: 0 !important; color: var(--muted); }
@media (max-width: 760px) {
  /* Name and description, then the counts on a line of their own; loading, the counts'
     place is held by the bars, so the line is the same height either way. */
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > #pass-summary .mono { flex: 1 1 100%; font-size: 12px; }
  :root[data-theme]:not([data-theme="legacy"]) #pass-summary.is-loading .skel-bar { flex: 0 0 auto; margin: 4px 0; }
  :root[data-theme]:not([data-theme="legacy"]) #pass-summary.is-loading .skel-w1 { margin-right: 40%; }
  :root[data-theme]:not([data-theme="legacy"]) #pass-summary.is-loading .pass-title { flex: 1 1 100%; }
}

/* A07: a phone's tools in three short rows - the pass picker; revised-only and the
   category chips; batch and export. Rows that run longer than the screen scroll sideways
   and show a fade at the edge while there is more. */
@media (max-width: 760px) {
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) { row-gap: 10px; }
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) .rt-pass { flex: 1 1 100%; }
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) .rt-pass .pass-tools-label,
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) #filter-tools .pass-tools-label,
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) #category-tools .pass-tools-label,
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) .rt-batch .pass-tools-label { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) .rt-pass select { flex: 1 1 auto; width: 100%; max-width: 100%; }
  /* Room for a chip or two beside revised-only (Ukrainian's longer label included), then
     it grows; Render Review's own rows, which follow, wrap after it. */
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > #category-tools { flex: 1 1 8rem; min-width: 0; flex-wrap: nowrap; }
  /* The line break before batch and export, so they share the last row. Only where there
     is an export row (expression review): Render Review orders its own rows. */
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part):has(> .rt-export)::after {
    content: ""; order: 5; flex: 0 0 100%; height: 0; margin-top: -10px;
  }
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > .rt-export {
    order: 7; flex: 1 1 10rem; min-width: 0; margin-left: 0;
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > .rt-export::-webkit-scrollbar { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > .rt-export > * { flex: 0 0 auto; }
  /* The edge cue: a fade pinned to the right edge of the scroller. It sits after the last
     control, so once the row is scrolled to its end it lies over empty space and is
     gone; while there is more it is pinned over the cut-off control. It takes no
     clicks. */
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) > .rt-export::after,
  :root[data-theme]:not([data-theme="legacy"]) .review-toolbar:not(.rt-part) .category-chips::after {
    content: ""; position: sticky; right: 0; flex: 0 0 28px; align-self: stretch;
    margin-left: -6px; pointer-events: none;
    background: linear-gradient(to right, transparent, var(--surface-page) 85%);
  }
}

/* The batch bar on a phone. It is fixed over the bottom of the screen, and with Ukrainian
   wording and a roomy theme (Riso, Aurora) it grew to 320-360px of an 844px screen, over
   the picture the author was picking. Here it is compact in every new theme: the two modes
   and the "same variant on every card" chips share one row that scrolls sideways (with
   the edge fade), the note takes the full width at a smaller height, and the actions
   follow. Render Review's bar carries more (assignees, re-render, the AI request, sharing),
   so the bar is capped at 36% of the screen and scrolls inside, with a fade at its bottom
   edge while there is more: whatever it holds, the middle of the screen - where a picked
   card sits - stays clear. The theme still draws the bar; only its layout is set here. */
@media (max-width: 760px) {
  :root[data-theme]:not([data-theme="legacy"]) #batch.batchbar {
    gap: 8px; padding: 10px 14px 0; max-height: 36vh; overflow-y: auto; overscroll-behavior: contain;
  }
  :root[data-theme]:not([data-theme="legacy"]) #batch.batchbar > * { flex: 0 0 auto; }
  :root[data-theme]:not([data-theme="legacy"]) #batch.batchbar::after {
    content: ""; position: sticky; bottom: 0; flex: 0 0 18px; margin: -8px -14px 0;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--surface-page));
  }
  :root[data-theme]:not([data-theme="legacy"]) #batch .batchbar-top {
    flex-wrap: nowrap; gap: 8px; min-width: 0;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  :root[data-theme]:not([data-theme="legacy"]) #batch .batchbar-top::-webkit-scrollbar { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) #batch .batchbar-top > *,
  :root[data-theme]:not([data-theme="legacy"]) #batch .batch-quick > *,
  :root[data-theme]:not([data-theme="legacy"]) #batch .batch-modes > * { flex: 0 0 auto; white-space: nowrap; }
  :root[data-theme]:not([data-theme="legacy"]) #batch .batch-quick,
  :root[data-theme]:not([data-theme="legacy"]) #batch .batch-modes { flex-wrap: nowrap; }
  :root[data-theme]:not([data-theme="legacy"]) #batch .batchbar-top::after {
    content: ""; position: sticky; right: 0; flex: 0 0 28px; align-self: stretch;
    margin-left: -6px; pointer-events: none;
    background: linear-gradient(to right, transparent, var(--surface-page) 85%);
  }
  :root[data-theme]:not([data-theme="legacy"]) #batch .batchbar-main { gap: 8px; }
  :root[data-theme]:not([data-theme="legacy"]) #batch .note-input { flex: 1 1 100%; min-height: 44px; }
  :root[data-theme]:not([data-theme="legacy"]) #batch .batch-actions { gap: 6px 8px; }
}

/* A08: the card's buttons at the end of the name line (review.js writes `.card-head` under
   this layout only). The name is never cut: where it does not fit beside the buttons (a
   long name, or a phone's two columns with touch-sized buttons) the buttons drop to the
   next line, still at the right. Batch mode still hides them. */
:root[data-theme]:not([data-theme="legacy"]) #gallery .thumb .card-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 8px; min-width: 0;
}
:root[data-theme]:not([data-theme="legacy"]) #gallery .thumb .card-head .card-title { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
:root[data-theme]:not([data-theme="legacy"]) #gallery .thumb .card-head .thumb-actions {
  position: static; display: flex; gap: 4px; flex: 0 0 auto;
  margin: -5px -4px -5px auto; opacity: 1; transform: none;
}
:root[data-theme]:not([data-theme="legacy"]) body.batch-mode #gallery .thumb .card-head .thumb-actions { display: none; }
:root[data-theme]:not([data-theme="legacy"]) #gallery .thumb .card-meta.is-repeat { display: none; }

/* C10: while a pass loads, the summary line names the pass that is coming and the grid
   holds plain card-shaped blanks (review.js drawLoading). Flat, neutral, no picture. */
:root[data-theme]:not([data-theme="legacy"]) .skel-bar {
  display: inline-block; height: 10px; border-radius: 5px; vertical-align: middle;
  background: var(--surface-raised);
}
:root[data-theme]:not([data-theme="legacy"]) .skel-w1 { width: 9rem; }
:root[data-theme]:not([data-theme="legacy"]) .skel-w2 { width: 14rem; max-width: 40%; }
:root[data-theme]:not([data-theme="legacy"]) .skel-chip { width: 5.5rem; height: 24px; border-radius: 12px; flex: 0 0 auto; }
:root[data-theme]:not([data-theme="legacy"]) .skel-card { pointer-events: none; }
:root[data-theme]:not([data-theme="legacy"]) .skel-card .card-body { display: flex; flex-direction: column; gap: 8px; }
:root[data-theme]:not([data-theme="legacy"]) .skel-w3 { width: 60%; height: 12px; }
:root[data-theme]:not([data-theme="legacy"]) .skel-w4 { width: 40%; }
@media (prefers-reduced-motion: no-preference) {
  :root[data-theme]:not([data-theme="legacy"]) .skel-bar,
  :root[data-theme]:not([data-theme="legacy"]) .skel-card .card-media { animation: rv-skel 1.6s ease-in-out infinite alternate; }
}
@keyframes rv-skel { to { opacity: .55; } }

/* A03: phone Compare stacks the earlier picture above the current one when review.js finds
   that makes both larger (`.is-stacked`). The gap between them holds the lower picture's
   caption, with 18px of empty stage on each side of its text, like the top caption. */
@media (max-width: 760px) {
  :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-stage > .compare { row-gap: calc(var(--rv-caption-h) + 18px); }
  :root[data-theme]:not([data-theme="legacy"]) #viewer .viewer-stage > .compare.is-stacked {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------- the home page (layout A04, A09, A10)
   index.html: "Waiting for you" - one box per thing that needs the author's decision, each a
   link to it (A04 desktop, A09 phone: two per row) - and, on a phone, the workflow tiles as
   one-line rows (A10, `.workflow-grid`). The new markup is `nl-only` and legacy has no rule
   for `.workflow-grid`, so legacy keeps today's page. Theme flavour (the number's accent, the
   icon size) is in a marked "home page" section at the end of each theme file. */
:root[data-theme]:not([data-theme="legacy"]) .home-waiting { display: block; margin: 0 0 8px; }
:root[data-theme]:not([data-theme="legacy"]) .home-waiting > h2 { margin-top: 0; }
:root[data-theme]:not([data-theme="legacy"]) .home-workflows-head { display: block; }
:root[data-theme]:not([data-theme="legacy"]) .home-waiting-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 12px;
}
:root[data-theme]:not([data-theme="legacy"]) .home-waiting-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 2px;
  min-width: 0; min-height: 64px; padding: 12px 14px;
  border: var(--hw-border, 1px solid var(--line)); border-radius: var(--hw-radius, var(--radius-lg));
  background: var(--hw-bg, var(--panel)); box-shadow: var(--hw-shadow, none);
  color: var(--hw-text, var(--text)); text-decoration: none;
}
/* A theme flavours the boxes through these --hw-* properties, set on its :root. */
:root[data-theme]:not([data-theme="legacy"]) .home-waiting-item:hover {
  border-color: var(--hw-hover-border, var(--hw-accent, var(--accent))); box-shadow: var(--hw-hover-shadow, var(--hw-shadow, none));
}
:root[data-theme]:not([data-theme="legacy"]) .home-waiting-item:active { box-shadow: var(--hw-active-shadow, var(--hw-hover-shadow, var(--hw-shadow, none))); }
:root[data-theme]:not([data-theme="legacy"]) .home-waiting-item .hw-n {
  grid-row: 1 / span 2; font-size: 30px; line-height: 1; font-weight: 700;
  color: var(--hw-accent, var(--accent)); font-variant-numeric: tabular-nums;
}
:root[data-theme]:not([data-theme="legacy"]) .home-waiting-item .hw-l { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
:root[data-theme]:not([data-theme="legacy"]) .home-waiting-item .hw-go { font-size: 12px; color: var(--hw-go, var(--muted)); }
:root[data-theme]:not([data-theme="legacy"]) .home-waiting-item .hw-go::after { content: " \2192"; }
@media (max-width: 760px) {
  :root[data-theme]:not([data-theme="legacy"]) .home-waiting-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  :root[data-theme]:not([data-theme="legacy"]) .home-waiting-item { min-height: 56px; padding: 10px 12px; column-gap: 10px; }
  :root[data-theme]:not([data-theme="legacy"]) .home-waiting-item .hw-n { grid-row: auto; font-size: 24px; }
  :root[data-theme]:not([data-theme="legacy"]) .home-waiting-item .hw-l { font-size: 13px; }
  :root[data-theme]:not([data-theme="legacy"]) .home-waiting-item .hw-go { display: none; }

  /* A10: each workflow is one row - icon, name, its whole description (wrapped, never cut). */
  :root[data-theme]:not([data-theme="legacy"]) .grid.chars.workflow-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  :root[data-theme]:not([data-theme="legacy"]) .workflow-grid > a.card {
    display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; min-height: 56px;
  }
  :root[data-theme]:not([data-theme="legacy"]) .workflow-grid > a.card > .card-media {
    aspect-ratio: auto !important; height: 100%; min-height: 0; background: none;
  }
  :root[data-theme]:not([data-theme="legacy"]) .workflow-grid .placeholder { background: none; padding: 0; }
  :root[data-theme]:not([data-theme="legacy"]) .workflow-grid .placeholder .ph-text { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) .workflow-grid .placeholder .ph-icon { font-size: 22px; }
  :root[data-theme]:not([data-theme="legacy"]) .workflow-grid .card-body { padding: 10px 12px 10px 0; min-width: 0; }
  :root[data-theme]:not([data-theme="legacy"]) .workflow-grid .card-meta { display: block; -webkit-line-clamp: none; overflow: visible; overflow-wrap: anywhere; }
}

/* ── Artist pages: home numbers, phone bottom bar, renders list (new themes) ─────
   Layout proposals C01, C02, C03 and C05. Legacy draws none of it: the new markup is
   `nl-only` and every rule here is scoped to the new themes. The count fix behind the
   numbers (artists.artist_scenes) applies everywhere, legacy included.

   C01/C02, the artist home (artist_index.html): four numbers first - to redo, waiting for
   the author, my requests, notifications - the same values the menu shows. The tiles take
   the staff home's --hw-* properties, so each theme's flavour of those boxes reaches them
   with no rule of its own. The orange "to redo" banner is the first tile now, so it is not
   drawn, and the Submit box is one slim row under the tiles. */
:root[data-theme]:not([data-theme="legacy"]) .work-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px;
}
:root[data-theme]:not([data-theme="legacy"]) .work-tile {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px;
  border: var(--hw-border, 1px solid var(--line)); border-radius: var(--hw-radius, var(--radius-lg));
  background: var(--hw-bg, var(--panel)); box-shadow: var(--hw-shadow, none);
  color: var(--hw-text, var(--text)); text-decoration: none;
}
:root[data-theme]:not([data-theme="legacy"]) .work-tile:hover {
  border-color: var(--hw-hover-border, var(--hw-accent, var(--accent)));
  box-shadow: var(--hw-hover-shadow, var(--hw-shadow, none)); text-decoration: none;
}
:root[data-theme]:not([data-theme="legacy"]) .work-tile:active { box-shadow: var(--hw-active-shadow, var(--hw-hover-shadow, var(--hw-shadow, none))); }
:root[data-theme]:not([data-theme="legacy"]) .work-tile .n {
  font-size: 28px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--hw-text, var(--text));
}
:root[data-theme]:not([data-theme="legacy"]) .work-tile.on-you .n { color: var(--hw-accent, var(--accent)); }
:root[data-theme]:not([data-theme="legacy"]) .work-tile.zero .n { color: var(--hw-go, var(--muted)); }
:root[data-theme]:not([data-theme="legacy"]) .work-tile .lbl { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
:root[data-theme]:not([data-theme="legacy"]) .work-tile .sub { font-size: 12px; line-height: 1.35; color: var(--hw-go, var(--muted)); overflow-wrap: anywhere; }
:root[data-theme]:not([data-theme="legacy"]) .work-strip ~ .hubcard.urgent { display: none; }
/* The three reference cards stand level: `.panel + .panel` gave the second and third a top
   margin the first did not have. */
:root[data-theme]:not([data-theme="legacy"]) .work-strip ~ .grid.hub > .hubcard { margin-top: 0; }
:root[data-theme]:not([data-theme="legacy"]) .work-strip ~ .submit-hero { padding: 14px 20px; }
:root[data-theme]:not([data-theme="legacy"]) .work-strip ~ .submit-hero h2 { font-size: 18px; }
:root[data-theme]:not([data-theme="legacy"]) .work-strip ~ .submit-hero p { font-size: 13px; }
:root[data-theme]:not([data-theme="legacy"]) .work-strip ~ .submit-hero .go { padding: 10px 18px; font-size: 14px; }
@media (max-width: 760px) {
  /* C02: two by two, and the Submit text reads as lines above a full-width button. */
  :root[data-theme]:not([data-theme="legacy"]) .work-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  :root[data-theme]:not([data-theme="legacy"]) .work-tile { padding: 10px 12px; gap: 2px; }
  :root[data-theme]:not([data-theme="legacy"]) .work-tile .n { font-size: 24px; }
  :root[data-theme]:not([data-theme="legacy"]) .work-tile .lbl { font-size: 13px; }
  :root[data-theme]:not([data-theme="legacy"]) .work-strip ~ .submit-hero { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
  :root[data-theme]:not([data-theme="legacy"]) .work-strip ~ .submit-hero .go { text-align: center; }
}

/* C03, every artist page on a phone (_artist_tabbar.html): five places along the bottom.
   It sits under everything that opens over a page - the viewers (60), the batch bar (55),
   the app bar and the menu (70-80), and every <dialog>, Missing included, which opens with
   showModal() into the top layer - and steps aside entirely while a viewer, gameplay, sync
   or the menu is open, so it never covers a picture or the verdict bar - and while Submit's
   own selection bar (`.rs-bar.show`, render_submit.css) holds Send and Replace, the way a
   phone's tab bar gives way to a selection toolbar. Only the artist
   shell carries it, so only artist pages get the extra room at the bottom. */
:root[data-theme]:not([data-theme="legacy"]) .artist-tabbar { display: none; }
@media (max-width: 760px) {
  :root[data-theme]:not([data-theme="legacy"]) .artist-tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 6px calc(4px + var(--safe-r)) calc(6px + var(--safe-b)) calc(4px + var(--safe-l));
    background: var(--surface-appbar); backdrop-filter: blur(14px) saturate(1.3);
    border-top: 1px solid var(--line);
  }
  :root[data-theme]:not([data-theme="legacy"]) .artist-tabbar > :is(a, button) {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; min-width: 0; min-height: 48px; margin: 0; padding: 5px 2px;
    border: 0; border-radius: var(--radius, 10px); background: transparent; box-shadow: none;
    font: inherit; font-size: 11px; line-height: 1.15; color: var(--muted);
    text-align: center; text-decoration: none; cursor: pointer;
  }
  :root[data-theme]:not([data-theme="legacy"]) .artist-tabbar .tab-ico {
    display: inline-flex; align-items: center; justify-content: center; height: 20px;
    font-size: 18px; line-height: 1;
    /* each theme's own icon size property, so its drawn icons match the plain glyph */
    --dr-ico: 20px; --bp-ico: 20px; --au-ico: 20px; --ri-ico: 20px; --ns-ico: 20px;
  }
  :root[data-theme]:not([data-theme="legacy"]) .artist-tabbar .tab-lbl { max-width: 100%; overflow-wrap: anywhere; }
  :root[data-theme]:not([data-theme="legacy"]) .artist-tabbar > .on {
    color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent);
  }
  :root[data-theme]:not([data-theme="legacy"]) .artist-tabbar .tab-n {
    position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: var(--accent); color: var(--text-inverse);
    font-size: 10px; font-weight: 700; line-height: 16px; font-variant-numeric: tabular-nums;
  }
  :root[data-theme]:not([data-theme="legacy"]) .artist-tabbar > :is(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  :root[data-theme]:not([data-theme="legacy"]) body:is(.viewer-open, .gameplay-open, .sync-open, .nav-open) .artist-tabbar,
  :root[data-theme]:not([data-theme="legacy"]) body:has(.rv.open, .spec-dialog.open, .fq-dialog:not([hidden]), .pfx-viewer:not([hidden]), .rs-bar.show) .artist-tabbar { display: none; }
  :root[data-theme]:not([data-theme="legacy"]) .shell:has(> .artist-tabbar) > .main {
    padding-bottom: calc(40px + 64px + var(--safe-b));
  }
}

/* C05, the artist renders list (artist_renders.html): a part's cover is the whole frame,
   never a slice - contained in the 16:9 cell each theme's parts list already gives it - and
   its counts are words. Every part on this list has renders (an artist sees no empty part),
   so B08's slim lines never occur here. */
:root[data-theme]:not([data-theme="legacy"]) .artist-parts .card-media img { object-fit: contain; }
:root[data-theme]:not([data-theme="legacy"]) .artist-parts .card-counts-icons { display: none; }
:root[data-theme]:not([data-theme="legacy"]) .artist-parts .card-counts-words { display: flex; flex-wrap: wrap; gap: 4px 6px; }
:root[data-theme]:not([data-theme="legacy"]) .artist-parts .card-counts-words .pill { white-space: nowrap; }

/* ---------------------------------------------------------------- character development:
   one variant at a time (portal/docs/development_versioning.md). The picker's cards, the
   strip of variants and the strip of one variant's versions, all as pictures; the
   expression-lab model marked on each. Tokens only, so every theme restyles it. */
.variant-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (max-width: 640px) { .variant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.variant-card .card-media { position: relative; }
.variant-card .card-title { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.variant-card.is-lab, .version-card.is-lab, .variant-chip.is-lab {
  box-shadow: 0 0 0 2px var(--verdict-finalised);
}
.lab-badge {
  position: absolute; left: 6px; top: 6px; z-index: 1; max-width: calc(100% - 12px);
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px;
  border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.3;
  background: var(--panel); color: var(--verdict-finalised);
  border: 1px solid var(--verdict-finalised); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lab-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.lab-panel.lab-matched { border-color: var(--verdict-finalised); }
.lab-panel .lab-source { max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.lab-panel .lab-source.copied { border-color: var(--verdict-finalised); }
.lab-line { display: flex; gap: 5px; align-items: baseline; overflow-wrap: anywhere; }
.lab-line.lab-matched { color: var(--verdict-finalised); }

.variant-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 0 6px;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; max-width: 100%;
}
.variant-chip {
  flex: 0 0 auto; width: 96px; display: flex; flex-direction: column; gap: 3px;
  padding: 5px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); color: var(--text); text-decoration: none; scroll-snap-align: start;
}
.variant-chip:hover { border-color: var(--accent); text-decoration: none; }
.variant-chip.active { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.variant-chip.active.is-lab { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 4px var(--verdict-finalised); }
.variant-chip img, .variant-chip .vc-ph {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: calc(var(--radius) / 2);
  background: var(--stage-mat); display: flex; align-items: center; justify-content: center;
}
.variant-chip .vc-name { font-size: 11.5px; font-weight: 700; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.variant-chip .vc-n { font-size: 10.5px; color: var(--muted); }

.dv-history-head { margin: 14px 0 6px; font-size: 15px; }
.version-strip { align-items: stretch; }
.pass-btn.version-card { display: flex; gap: 10px; align-items: stretch; min-width: 260px; max-width: 340px; padding: 8px; }
.version-card .vcard-media {
  position: relative; flex: 0 0 84px; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: calc(var(--radius) / 2); background: var(--stage-mat);
}
.version-card .vcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard-pills .lab-badge { position: static; max-width: 100%; }
.version-card .vcard-body { display: flex; flex-direction: column; min-width: 0; }
.version-card .pass-title { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.version-card .vcard-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 4px; }
@media (max-width: 640px) {
  .pass-btn.version-card { min-width: 78vw; max-width: 86vw; }
  .version-card .vcard-media { flex-basis: 72px; }
}

/* ------------------------------------------------------------------ managing variations
   (development_manage.js; "Managing variations" in portal/docs/development_versioning.md):
   the variation page's tools panel, the live pill, the Removed list and the History (the
   last two reuse the environment page's list classes). Tokens only, so every theme
   restyles it; nothing is ever drawn over a picture. */
.dv-manage-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.dv-live-line { margin: 6px 0 0; overflow-wrap: anywhere; }
.dv-tools { margin-top: 10px; }
.dv-tools .btn { white-space: normal; }
.dv-manage .env-tool-form .field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 6px; }
.dv-manage .env-tool-form input.note-input { width: 100%; }
.dv-blend-now { overflow-wrap: anywhere; }
.dv-share { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--line); }
.dv-share #dv-shared-now { overflow-wrap: anywhere; }
/* a pill may wrap: on a phone two picker cards share the row */
.dv-live { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.version-card .dv-shared { overflow-wrap: anywhere; }
.dv-note, .dv-published-as { overflow-wrap: anywhere; margin: 2px 0 0; }
.dv-character summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.dv-character .field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.dv-character .field input, .dv-character .field textarea { width: 100%; }
.bs-joins { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; overflow-wrap: anywhere; }
@media (hover: none) {
  .dv-tools .btn, .dv-manage .env-tool-form .btn, .dv-share .btn, .dv-removed .btn,
  .dv-character .btn, #bs-joins-cancel { min-height: 44px; }
}

/* ------------------------------------------------------------------ deleting wrong pictures
   (picture_removals.js): the viewer's button, the confirm dialog and the Removed list.
   Tokens only, so every theme restyles it; the picture thumbnails sit on the stage mat. */
.pr-viewer { margin: 4px 0 10px; }
.pr-viewer .btn { width: 100%; justify-content: center; }
.pr-removed-open em { font-style: normal; font-weight: 700; margin-left: 2px; }
.pr-dialog .sub { margin: 4px 0 10px; }
.pr-delete-list, .pr-removed-body { max-height: 46vh; overflow-y: auto; overflow-wrap: anywhere; }
.pr-picks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.pr-picks li { display: grid; gap: 4px; font-size: 12.5px; align-content: start; }
.pr-picks img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  border-radius: var(--radius-sm, 6px); background: var(--stage-mat); }
.pr-reason-label { display: block; font-weight: 700; font-size: 13px; margin: 6px 0 4px; }
.pr-removal { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; }
.pr-removal-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.pr-reason { margin: 6px 0 10px; color: var(--muted); font-size: 13px; }
.pr-back { font-style: normal; font-size: 12px; color: var(--verdict-finalised); }
.pr-restore.is-armed { border-color: var(--danger); color: var(--danger-text); }
@media (max-width: 640px) {
  .pr-dialog .dialog-actions { flex-wrap: wrap; }
  .pr-dialog .dialog-actions .btn { flex: 1 1 auto; }
  .pr-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Touch screens: 44px targets for these controls in every theme (a theme may shrink
   .btn.small for the desktop - darkroom does - which outranks the shared touch rule). */
@media (hover: none) {
  #pr-viewer .btn, #pr-delete-dialog .btn, #pr-removed-dialog .btn,
  #pr-batch-delete, #pr-removed-open { min-height: 44px; }
}

/* ------------------------------------------------------------------ environments, staff:
   the version gallery, the final version, variants (environment.html, environments.html,
   environments.js; portal/docs/environments.md). The artists' cards, plus a ring and a
   badge for the final version and the tools in the opened version. Tokens only, so every
   theme restyles it; the pictures sit on the stage mat. */
.grid.renders.env-gallery { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.env-version { cursor: pointer; }
.env-version:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.env-version .card-media { position: relative; }
.env-version .card-title { flex-wrap: wrap; }
.env-version .card-counts { align-items: center; }
.env-version .env-share-label { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; }
/* Set aside: dimmed rather than hidden - the control that brings it back is inside it. */
.env-version.is-discarded { opacity: .55; }
.env-version.is-discarded:hover { opacity: .8; }
.env-version.is-discarded .card-body { border-top: 1px dashed var(--line); }
/* The final version: the same green ring the expression lab's model wears, drawn outside
   the card, and a "★ Final" pill in its title - never anything painted over the render. */
/* An outline, not a box-shadow: several themes clear a card's shadow on hover, and the
   final version must stay marked while the pointer is on it. */
.card.thumb.env-version.is-final, .card.thumb.version-card.is-final, .card.env-card.is-final {
  outline: 2px solid var(--verdict-finalised); outline-offset: 2px;
}
.env-chip.is-final { box-shadow: 0 0 0 2px var(--verdict-finalised); }
.env-chip.active.is-final { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 4px var(--verdict-finalised); }
.env-final-pill { text-decoration: none; }
.env-variant-of { margin: 2px 0 4px; }
.env-variants-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.env-chip { width: 150px; }
.env-chip img, .env-chip .vc-ph { aspect-ratio: 16 / 9; }

/* The opened version: tools, then any form a tool needs, then facts and renders. */
.env-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.env-compare-pick { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.env-compare-pick select { width: auto; min-width: 9em; padding: 5px 8px; }
.env-tool-form { margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2, var(--panel)); }
.env-tool-form .note-input { width: 100%; }
.env-fieldset { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.env-fieldset legend { font-weight: 700; font-size: 13px; margin-bottom: 4px; padding: 0; }
.env-radio { display: flex; gap: 6px; align-items: baseline; font-size: 13px; }
.env-compare { margin: 6px 0 14px; }
.env-compare-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 8px; }
.env-compare-head strong { font-size: 14px; }
.env-compare-cell { margin: 0; }
.env-compare-cell img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--radius) / 2); background: var(--stage-mat); cursor: zoom-in; }
.env-render .card-media img { cursor: zoom-in; }

/* Removed versions, the splits, and the log: lists under the gallery. */
.env-removed summary, .env-splits summary, .env-history summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.env-removed-list, .env-split-list, .env-log { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.env-removed-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; scroll-margin-top: 72px; }
.env-removed-row img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--radius) / 2); background: var(--stage-mat); }
.env-removed-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; overflow-wrap: anywhere; }
.env-split-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.env-split-list li.is-undone { color: var(--muted); }
.env-log li { font-size: 13px; overflow-wrap: anywhere; }

/* The overview: a variant family is one box spanning the row, its sets inside. */
.env-family {
  grid-column: 1 / -1; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 10px 12px 12px; background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.env-family-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 10px; }
.env-family-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.env-suggest { display: flex; flex-direction: column; gap: 8px; }
.env-suggest-row, #env-split-suggestion .counts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.env-version, .env-removed-row { scroll-margin-top: 72px; }

@media (max-width: 720px) {
  .grid.renders.env-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .env-gallery .card-body { padding: 8px 9px 9px; }
  .env-gallery .card-meta { font-size: 11.5px; overflow-wrap: anywhere; }
  .env-gallery .env-who { display: none; }
  .env-compare-pick { margin-left: 0; width: 100%; }
  .env-compare-pick select { flex: 1; }
  .env-chip { width: 128px; }
  .env-family { padding: 8px; }
  .env-family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* The live version's .blend download (artist_downloads.py): the link, its size and what it
   stands in for, wrapping on a phone. Artist pages (_artist_download.html) and staff pages
   (_download_staff.html). */
.artist-download, .staff-download { display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px 8px; }
.artist-download { margin-top: 6px; }
.staff-download { margin: 4px 0 8px; }
.staff-download-error, .staff-download-lighting { flex-basis: 100%; }
