/*
 * Bordeaux Projects Tracker — Manuscript Console
 *
 * A dark, deep-navy interface matching the bordeauxvo.com brand:
 * midnight blue surfaces, warm cream text, single magenta/hot-pink
 * accent used sparingly. Fraunces for display, Manrope for body,
 * JetBrains Mono for system meta. Hairlines, no drop shadows. Depth
 * from value contrast. Palette swappable via the :root block below.
 */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT,WONK@0,9..144,400..700,0..100,0..1;1,9..144,400..700,0..100,0..1&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ============================================================
     PALETTE: bordeaux-v3 (active)
     Matches bordeauxvo.com — deep midnight navy with a vivid
     magenta/hot-pink single accent. No gold or second accent on
     the brand site; the --gold token is repurposed as a quieter
     desaturated rose so callsites (timeline chips etc.) keep
     working without inventing a foreign color.
     To revert: swap this block with the bordeaux-v1 block below.
     ============================================================ */

  /* surfaces — deep midnight navy with slight purple tilt */
  --surface-0: #161A3D;   /* page (deepest) */
  --surface-1: #1D2349;   /* card / panel face */
  --surface-2: #262C56;   /* elevated row / hover */
  --surface-3: #2F3563;   /* table header, pressed */
  --line:      #3A416E;   /* hairline borders */
  --line-soft: #232A52;   /* row dividers in dense tables */
  --surface-0-rgb: 22, 26, 61;

  /* ink — warm cream-white (matches the brand site) */
  --ink-0: #F5F2EA;       /* headlines on dark surface */
  --ink-1: #E2DDD0;       /* body text */
  --ink-2: #9BA0BA;       /* secondary, slightly blue-gray */
  --ink-3: #61678C;       /* tertiary, timestamps */

  /* primary accent — magenta/hot-pink (the brand pop) */
  --accent:        #E0488F;   /* magenta — primary brand */
  --accent-bright: #F25CA0;   /* hover / focus */
  --accent-soft:   #3A1A2D;   /* chip background tint */
  --accent-rgb: 224, 72, 143;

  /* "gold" slot — desaturated rose. No real gold in the brand;
     this is the quieter second-tier highlight for chips/badges
     where --accent would be too loud. */
  --gold:        #C58B9B;   /* desaturated rose */
  --gold-bright: #D9A6B0;   /* hover */
  --gold-soft:   #2E1A24;   /* dark chip background */
  --gold-rgb: 197, 139, 155;

  /* semantic states tuned for readability on navy */
  --good:      #6FB97A;       /* mint green — positive */
  --good-soft: #1F3525;
  --danger:    #E27A3F;       /* warm amber — distinct from magenta */
  --danger-soft: #3A2616;

  /* ============================================================
     PALETTE: bordeaux-v1 (preserved for revert)
     Original ink-red accent. To revert: replace the v2 block
     above with these values (variable names unchanged).
     ============================================================

     --surface-0: #161310;
     --surface-1: #1d1a16;
     --surface-2: #25211c;
     --surface-3: #2e2a24;
     --line:      #3a352d;
     --line-soft: #2a2620;
     --surface-0-rgb: 22, 19, 16;
     --ink-0: #faf8f1;
     --ink-1: #e8e3d6;
     --ink-2: #a8a08e;
     --ink-3: #6e6759;
     --accent:        #c8462a;
     --accent-bright: #e8694a;
     --accent-soft:   #3a201b;
     --accent-rgb: 200, 70, 42;
     --gold:        #c8462a;     (no gold in v1 — falls back to accent)
     --gold-bright: #e8694a;
     --gold-soft:   #3a201b;
     --gold-rgb: 200, 70, 42;
     --good:      #95a86b;
     --good-soft: #2a3220;
     --danger:    #d6883f;
     --danger-soft: #382716;
     ============================================================ */

  /* ---- type tokens ----------------------------------------------- */
  /* Display: Fraunces serif for headlines + project titles + italic
     emphasis (next-action text). Body: Manrope sans — serif body on
     dark surface rendered too thinly through Windows ClearType.
     Manrope is well-drawn, distinctive without being cliché, and
     stays crisp at 15-16px on dark. */
  --display: "Fraunces", "Times New Roman", serif;
  --body:    "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif:   "Fraunces", "Times New Roman", serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Variable-font feature settings for Fraunces */
  --fraunces-display: "opsz" 144, "SOFT" 50, "WONK" 0;
  --fraunces-body:    "opsz" 72,  "SOFT" 40, "WONK" 0;

  /* ---- spatial --------------------------------------------------- */
  --pad: 28px;
  --pad-tight: 18px;
  --pad-loose: 40px;
  --grain-url: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.92  0 0 0 0 0.92  0 0 0 0 1.0  0 0 0 0.022 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---- base ------------------------------------------------------- */

* { box-sizing: border-box; }

html { background: var(--surface-0); }

body {
  margin: 0;
  font-family: var(--body);
  font-feature-settings: "kern", "liga", "calt", "ss01";
  font-size: 16px;
  font-weight: 450;
  line-height: 1.55;
  color: var(--ink-0);
  background: var(--surface-0) var(--grain-url);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: var(--ink-0); }

a {
  color: var(--ink-0);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease, color 120ms ease;
}
a:hover { border-bottom-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--display);
  font-feature-settings: "kern", "liga", "calt", "onum";
  font-variation-settings: var(--fraunces-display);
  color: var(--ink-0);
  margin: 0;
  letter-spacing: -0.005em;
}
h1 { font-size: 36px; font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
h2 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  font-variation-settings: var(--fraunces-body);
}
h3 { font-size: 16px; font-weight: 600; }

p { margin: 0 0 10px; }
.meta {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 0;
}

code, pre, .num {
  font-family: var(--mono);
  font-size: 0.92em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--pad) 0;
}

/* ---- masthead --------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(var(--surface-0-rgb), 0.85);
  backdrop-filter: saturate(150%) blur(8px);
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px var(--pad);
  display: flex;
  align-items: center;
  gap: var(--pad);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  border: 0 !important;
  text-decoration: none;
}
.brand-name {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-display);
  font-feature-settings: "smcp" on, "c2sc" on, "kern", "liga";
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-0);
}
.brand-mark {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: translateY(-2px);
  margin: 0 2px;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.topnav {
  display: flex;
  gap: 22px;
  flex: 1 1 auto;
  align-items: center;
  margin-left: 12px;
}
.topnav > a, .topnav-more > summary {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.topnav > a:hover, .topnav-more > summary:hover { color: var(--ink-0); border-bottom-color: var(--accent); }
.topnav > a.is-active { color: var(--ink-0); border-bottom-color: var(--accent); }

.topnav-more { position: relative; list-style: none; }
.topnav-more > summary { cursor: pointer; list-style: none; }
.topnav-more > summary::-webkit-details-marker { display: none; }
.topnav-more > summary::after { content: " ◇"; color: var(--ink-3); font-size: 12px; margin-left: 4px; }
.topnav-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: 6px 0;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  z-index: 60;
}
.topnav-more-menu a {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 8px 16px;
}
.topnav-more-menu a:hover { background: var(--surface-2); color: var(--ink-0); border-bottom: 0; }

/* Studio ⇄ Booth mode toggle (studio-booth-toggle). The active segment is
   a filled, non-interactive span; the inactive segment is a POST button. */
.mode-switch { display:inline-flex; flex:0 0 auto; align-items:stretch; border:1px solid var(--line); border-radius:999px; overflow:hidden; background:var(--surface-1); margin-right:4px; white-space:nowrap; }
.mode-switch form { display:contents; }
.mode-seg { font-family:var(--mono); font-size:12px; letter-spacing:.08em; text-transform:uppercase; padding:6px 14px; margin:0; line-height:1; white-space:nowrap; color:var(--ink-2); text-decoration:none; border:0 !important; background:none; display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.mode-seg .dot { width:7px; height:7px; border-radius:999px; background:currentColor; opacity:.55; }
.mode-seg.is-active { background:var(--accent); color:#fff; }
.mode-seg.is-active .dot { opacity:1; background:#fff; }
.mode-seg:not(.is-active):hover { background:var(--surface-2); color:var(--ink-0); }

.topnav-search { display: flex; }
.topnav-search input[type=search] {
  font: inherit;
  font-family: var(--body);
  font-size: 13px;
  padding: 6px 10px;
  width: 200px;
  background: var(--surface-1);
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
}
.topnav-search input[type=search]:focus { border-color: var(--accent); }
.topnav-search input[type=search]::placeholder { color: var(--ink-3); }
/* Project-list client-side filter input. Same visual treatment as
   the nav search so it reads as a filter, not a primary action. */
.project-list-filter {
  font: inherit;
  font-family: var(--body);
  font-size: 13px;
  padding: 6px 10px;
  width: 240px;
  background: var(--surface-1);
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
}
.project-list-filter:focus { border-color: var(--accent); }
.project-list-filter::placeholder { color: var(--ink-3); }

.topnav-actor {
  display: flex; gap: 10px; align-items: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.logout-form { display: inline; }

.btn-link {
  background: none; border: 0; padding: 0;
  font: inherit; cursor: pointer;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.btn-link:hover { color: var(--accent-bright); }
.btn-link.danger { color: var(--danger); }
.btn-link:disabled,
.btn-link[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}
.btn-link:disabled:hover,
.btn-link[disabled]:hover { color: var(--ink-2); }

/* Locked principal / last super-admin role cell (admin/users). The
   role is shown read-only with a padlock so the UI matches the
   writer-level guard that forbids demoting these accounts. */
.role-locked {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  cursor: not-allowed;
  color: var(--ink-2);
}
.lock-badge { opacity: 0.7; font-size: 0.85em; }

/* ---- container -------------------------------------------------- */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--pad-loose) var(--pad);
  animation: paper-rise 220ms ease-out both;
}
/* paper-rise: opacity only — a `transform` here would make .container
   a containing block for `position: fixed` descendants (modals!), so
   `position: fixed; inset: 0` no longer covers the viewport. Modals
   would render at .container's top-left instead, often off-screen for
   a user who has scrolled down. Pure opacity animation avoids that. */
@keyframes paper-rise {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- card / empty / button ------------------------------------- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: var(--pad-tight) calc(var(--pad-tight) + 4px);
  margin-bottom: 18px;
  border-radius: 2px;
}

.empty {
  background: var(--surface-1);
  border: 1px dashed var(--line);
  padding: 36px 24px;
  text-align: center;
  color: var(--ink-2);
  font-family: var(--body);
  font-style: italic;
}

.btn {
  display: inline-block;
  padding: 8px 18px;
  background: var(--accent);
  color: var(--ink-0);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background 120ms ease;
}
/* On hover, only change colours — do NOT reset `border` to 0.
   Button modifiers (`.btn-advance`, `.btn-back`, `.btn-advance-gated`)
   add a 1px border for their secondary/tertiary styles. A `border: 0`
   here would override the border-width longhand on hover, shrinking
   the button by 2px in each axis and shaking every neighbour on the
   page (the stage-transition row sits in a flex header that re-flows
   on size change). Keep borders intact across the hover transition. */
.btn:hover { background: var(--accent-bright); }
.btn:active { background: var(--accent); }

/* ---- forms ------------------------------------------------------ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px 18px;
}
.field {
  display: flex; flex-direction: column; gap: 4px;
}
.field .label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}
.field input[type=text],
.field input[type=email],
.field input[type=url],
.field input[type=tel],
.field input[type=date],
.field input[type=number],
.field input[type=password],
.field select,
.field textarea,
.inline-edit input[type=text],
.inline-edit input[type=email],
.inline-edit input[type=url],
.inline-edit input[type=tel],
.inline-edit input[type=date],
.inline-edit input[type=number],
.inline-edit select,
.inline-edit textarea {
  font: inherit;
  font-family: var(--body);
  font-size: 14px;
  padding: 6px 8px;
  background: var(--surface-0);
  color: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-edit input:focus,
.inline-edit select:focus,
.inline-edit textarea:focus { border-color: var(--accent); }

.field-bool { flex-direction: row; align-items: center; gap: 8px; }
.field-bool .label { order: 2; }
.field-bool input[type=checkbox] { width: auto; }

.form-actions { margin-top: 18px; display: flex; gap: 14px; align-items: center; }

.fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px 20px;
}
.field-block { display: flex; flex-direction: column; gap: 4px; }
.field-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

.inline-edit textarea { resize: vertical; min-height: 40px; }

/* Project notes (#13) — promoted to a first-class card. The shared
   `_project_field.html` textarea is sized for the narrow Fields grid;
   give it full width and a comfortable height in the standalone card. */
.project-notes-card .inline-edit,
.project-notes-card .inline-edit.is-readonly { display: block; }
.project-notes-card .inline-edit textarea { width: 100%; min-height: 96px; }

.bool-cell { display: inline-flex; align-items: center; gap: 6px; }
.bool-cell span { display: none; }

/* ---- tables ----------------------------------------------------- */

table.data,
table.chapters,
table.schedule-grid,
table.todo-list,
table.proofing-table,
table.proofing-list {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  font-size: 14px;
}
table.data th, table.data td,
table.todo-list th, table.todo-list td,
table.schedule-grid th, table.schedule-grid td,
table.proofing-list th, table.proofing-list td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
table.data thead th,
table.todo-list thead th,
table.schedule-grid thead th,
table.proofing-list thead th {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  font-weight: 500;
  background: var(--surface-1);
  border-bottom: 1px solid var(--line);
}
table.data tbody tr:hover,
table.todo-list tbody tr:hover,
table.schedule-grid tbody tr:hover {
  background: var(--surface-2);
}

.table-scroll { overflow-x: auto; }

/* ---- stage chip + legacy badge -------------------------------- */

.stage {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-1);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 0;
}
.stage-unset { color: var(--ink-3); border-style: dashed; font-style: italic; }
.legacy { color: var(--ink-3); font-style: italic; font-size: 12px; }
.legacy-badge {
  margin-left: 12px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stage-form {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.detail-header h1 { line-height: 1.05; }
.detail-actions {
  display: flex; gap: 18px; align-items: center;
}
.detail-actions a {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}
.detail-actions a:hover { color: var(--accent-bright); }
.detail-actions .btn { color: var(--ink-0); }

/* ---- owner chip + schedule chip --------------------------------- */

/* One chip family. The person's NAME is the identifier; a tiny
   3px square introduces a visual rhythm without painting the whole
   chip a different color. */
.owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  background: var(--surface-2);
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 0;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.owner-chip::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  flex: 0 0 6px;
}
/* unassigned / team chips drop the accent dot and read as ghosted */
.owner-chip-unassigned-splicer,
.owner-chip-unassigned-proofer,
.owner-chip-unassigned-engineer,
.owner-chip-unassigned-narrator,
.owner-chip-bordeaux-team {
  color: var(--ink-3);
  font-style: italic;
  font-weight: 500;
  border-style: dashed;
}
.owner-chip-unassigned-splicer::before,
.owner-chip-unassigned-proofer::before,
.owner-chip-unassigned-engineer::before,
.owner-chip-unassigned-narrator::before,
.owner-chip-bordeaux-team::before {
  background: var(--ink-3);
}

.schedule-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  background: transparent;
  color: var(--ink-2);
  border: 1px dashed var(--line);
  border-radius: 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.schedule-chip::before {
  content: "◴";
  font-size: 13px;
  color: var(--ink-3);
}

/* ---- home page -------------------------------------------------- */

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.home-header h1 {
  font-size: 44px;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144, "SOFT" 70, "WONK" 0;
}
.home-quicknav { display: flex; gap: 22px; }
.home-quicknav a {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  padding-bottom: 2px;
}
.home-quicknav a:hover { color: var(--accent-bright); border-bottom-color: var(--accent); }

.stage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}
.stage-strip-badge {
  display: inline-flex;
  gap: 8px;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  border-right: 1px solid var(--line-soft);
}
.stage-strip-badge:last-child { border-right: 0; }
.stage-strip-badge:hover { color: var(--ink-0); border-bottom: 0; }

/* ---- stuck-book panel (dashboard) ------------------------------ */

.stuck-panel {
  margin-bottom: 24px;
  border: 1px solid var(--accent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 9%, transparent),
    transparent
  );
}
.stuck-panel-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 20px 8px;
}
.stuck-panel-mark {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-0);
  background: var(--accent);
  padding: 2px 8px;
}
.stuck-panel-head h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 40, "SOFT" 60, "WONK" 0;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink-0);
  margin: 0;
}
.stuck-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stuck-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(0, 1fr) minmax(120px, auto) minmax(150px, auto);
  align-items: baseline;
  gap: 14px;
  padding: 8px 20px;
  border-top: 1px solid var(--line-soft);
}
.stuck-title {
  font-family: var(--display);
  font-variation-settings: "opsz" 28, "SOFT" 40, "WONK" 0;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-0);
}
.stuck-author { color: var(--ink-3); font-size: 13px; }
.stuck-stage {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.stuck-days {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-bright);
  text-align: right;
}

/* ---- due-this-week panel (dashboard) --------------------------- */

.due-panel {
  margin-bottom: 24px;
  border: 1px solid var(--line);
  background: var(--surface-1);
}
.due-panel-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 20px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.due-panel-mark {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--surface-0);
  background: var(--ink-1);
  padding: 2px 8px;
}
.due-panel-head h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 40, "SOFT" 60, "WONK" 0;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink-0);
  margin: 0;
}
.due-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.due-row {
  display: grid;
  grid-template-columns: 90px 130px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 14px;
  padding: 8px 20px;
  border-top: 1px solid var(--line-soft);
}
.due-row:first-child { border-top: 0; }
.due-when {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-bright);
  text-transform: uppercase;
}
.due-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.due-title {
  font-family: var(--display);
  font-variation-settings: "opsz" 28, "SOFT" 40, "WONK" 0;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-0);
}
.due-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  text-align: right;
}

/* ---- cycle-time report ----------------------------------------- */

.report-cycle-table { width: 100%; }
.report-col-bar { width: 38%; }
.report-col-num { text-align: right; white-space: nowrap; }
.report-bar {
  display: inline-block;
  height: 12px;
  min-width: 2px;
  background: var(--accent);
  vertical-align: middle;
  border-radius: 1px;
}
.report-row.is-bottleneck .report-bar {
  background: var(--accent-bright);
}
.report-row.is-bottleneck {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.report-bar-empty {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.report-bottleneck-tag {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-0);
  background: var(--accent);
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: 1px;
}
.report-cycle-note { margin-top: 12px; }

/* Time-in-stage chip on the project detail page. */
.stage-age-chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 2px 9px;
  margin-left: 10px;
  vertical-align: 3px;
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.stage-age-chip.is-stuck {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.stage-strip-name { font-weight: 600; }
.stage-strip-count { color: var(--ink-3); }

.stage-group {
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface-1);
  margin-bottom: 18px;
}
.stage-group-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 22px 10px;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 120ms ease;
}
.stage-group-head::-webkit-details-marker { display: none; }
.stage-group-head::marker { content: ""; }
.stage-group[open] .stage-group-head {
  border-bottom-color: var(--line-soft);
}
.stage-group-head:hover {
  background: var(--surface-2);
}
.stage-group-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.stage-group-caret {
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(-45deg);
  transition: transform 160ms ease;
  margin-left: 4px;
  align-self: center;
  flex: 0 0 auto;
}
.stage-group[open] .stage-group-caret {
  transform: rotate(45deg);
}
.stage-group-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.stage-group-head h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 96, "SOFT" 60, "WONK" 0;
  font-weight: 500;
  font-size: 25px;
  color: var(--ink-0);
  text-transform: none;
  letter-spacing: -0.01em;
  flex: 1 1 auto;
}
.stage-group-count {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.stage-group-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Multi-stage meta-groups (e.g. "Intake & Booking") render a vertical
   lane layout — one row per canonical stage, full width, connected
   by a single continuous accent rail on the left. Active stages
   expand to show project rows beneath; empty stages compress to one
   thin line so the canonical pipeline stays visible without bulk. */
.stage-group-multi .stage-group-num {
  letter-spacing: 0.08em;
}
.lanes {
  list-style: none;
  margin: 0;
  padding: 4px 0 8px;
  position: relative;
}
/* The continuous left rail behind the dots. */
.lanes::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 33px;
  width: 1px;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}
.lane {
  position: relative;
}
.lane.is-empty .lane-head { opacity: 0.55; }
.lane-head {
  display: grid;
  grid-template-columns: 56px auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 22px 8px 0;
  min-height: 32px;
}
.lane-dot {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--surface-1);
  box-shadow: 0 0 0 3px var(--surface-1);
  transition: background 120ms ease;
}
.lane.is-active .lane-dot { background: var(--accent); }
.lane.is-empty .lane-dot {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.lane-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.12em;
  min-width: 22px;
}
.lane.is-active .lane-num { color: var(--accent); }
.lane-name {
  font-family: var(--display);
  font-variation-settings: "opsz" 32, "SOFT" 60, "WONK" 0;
  font-weight: 500;
  font-size: 16px;
  color: var(--ink-1);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lane.is-active .lane-name { color: var(--ink-0); }
.lane-count {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.lane.is-active .lane-count { color: var(--accent-bright); }
.lane-rows {
  list-style: none;
  margin: 0;
  padding: 0 0 6px 0;
}
/* Project rows under a lane sit indented past the rail dot. */
.lane-row {
  padding-left: 70px;
}

/* "Coming soon" TODO callout — sits between the rail and the rows so
   it lands exactly where future auto-imported inquiries will appear.
   Dashed border distinguishes it from the surrounding card surfaces. */
.meta-todo {
  margin: 10px 22px 14px;
  padding: 9px 14px;
  border: 1px dashed var(--accent);
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 7%, transparent),
    transparent
  );
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink-1);
  line-height: 1.55;
}
.meta-todo-mark {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  background: var(--accent);
  color: var(--ink-0);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 1px;
  vertical-align: 1px;
}
.meta-todo code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-1);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 1px;
}
.meta-todo strong {
  font-weight: 600;
  color: var(--ink-0);
}

.active-project-row {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) minmax(0, 3fr) minmax(150px, auto);
  align-items: center;
  gap: 18px;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 100ms ease;
}
.active-project-row:last-child { border-bottom: none; }
.active-project-row:hover { background: var(--surface-2); }

.active-project-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.active-project-title {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink-0);
  letter-spacing: -0.005em;
  border: 0;
}
.active-project-title:hover {
  color: var(--accent-bright);
  border: 0;
}
.active-project-author {
  font-family: var(--serif);
  font-variation-settings: var(--fraunces-body);
  font-size: 14px;
  color: var(--ink-2);
  font-style: italic;
}
.active-project-due {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}
.active-project-next-text {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-style: italic;
  color: var(--ink-1);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 400;
  display: block;
}
.active-project-owner { text-align: right; }

/* ---- home rollup (collapsible) --------------------------------- */

/* "Awaiting · post-delivery" panel — separates books that aren't
   actively being PRODUCED by Bordeaux (waiting on author CRX, or
   queued for release) from the headline active list. */
.home-awaiting {
  margin: 28px 0 12px;
  border: 1px solid var(--line);
  background: var(--surface-1);
}
.home-awaiting > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft);
}
.home-awaiting > summary::-webkit-details-marker { display: none; }
.home-awaiting > summary::before {
  content: "▸  ";
  color: var(--ink-3);
}
.home-awaiting[open] > summary::before {
  content: "▾  ";
  color: var(--accent);
}
.home-awaiting-label {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-1);
  font-weight: 600;
}
.home-awaiting-count {
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink-2);
  font-style: italic;
}
.home-awaiting .stage-group {
  border: 0;
  background: transparent;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line-soft);
}
.home-awaiting .stage-group:last-child { border-bottom: 0; }
.home-awaiting .stage-group.is-awaiting .active-project-row { opacity: 0.82; }
.home-awaiting .stage-group.is-awaiting .active-project-row:hover { opacity: 1; }

.home-rollup { margin-top: 32px; }
.home-rollup > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.home-rollup > summary::-webkit-details-marker { display: none; }
.home-rollup > summary::before { content: "▸  "; color: var(--ink-3); }
.home-rollup[open] > summary::before { content: "▾  "; color: var(--accent); }
.home-rollup > summary:hover { color: var(--ink-0); border-bottom-color: var(--accent); }

/* ---- KPI cards ------------------------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.kpi { padding: 16px 18px; }
.kpi-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}
.kpi-value {
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "SOFT" 60, "WONK" 0;
  font-size: 42px;
  font-weight: 500;
  color: var(--ink-0);
  margin: 8px 0;
  font-feature-settings: "lnum";
  font-variant-numeric: lining-nums;
  letter-spacing: -0.02em;
}
.kpi-value.is-warning { color: var(--accent); }
.kpi-list {
  padding-left: 0; margin: 6px 0 0;
  font-size: 13px;
  list-style: none;
}
.kpi-list li { padding: 2px 0; font-family: var(--body); }
.kpi progress {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
  background: var(--surface-2);
  border: 0;
}
.kpi progress::-webkit-progress-bar { background: var(--surface-2); }
.kpi progress::-webkit-progress-value { background: var(--accent); }
/* T3: per-narrator capacity card — Bridget magenta, Jake rose. */
.kpi-capacity .kpi-cap-narr { margin-top: 8px; }
.kpi-cap-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.kpi-cap-name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.kpi-cap-val { font-family: var(--mono); font-size: 12px; color: var(--ink-1); }
.kpi-cap-val.is-warning { color: var(--danger); }
.kpi-cap-jake progress { accent-color: var(--gold); }
.kpi-cap-jake progress::-webkit-progress-value { background: var(--gold); }

/* ---- recent activity ------------------------------------------- */

.recent-audit {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 1px;
}
.recent-audit li {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--ink-2);
  padding: 5px 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.recent-audit li:last-child { border-bottom: 0; }

/* ---- audit action pills (used in audit log + recent activity) -- */

.action {
  display: inline-block;
  padding: 1px 8px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 0;
}
.action-create        { color: var(--good);   border-color: var(--good); }
.action-update        { color: var(--ink-1);  border-color: var(--line); }
.action-stage_change  { color: var(--accent); border-color: var(--accent); }
.action-delete        { color: var(--danger); border-color: var(--danger); }

/* ---- stage workflow checklist (project detail) ----------------- */

.stage-checklist { margin-top: 14px; }
.stage-checklist-next {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
}
.stage-checklist-next-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-bright);
  font-weight: 600;
}
.stage-checklist-next-text {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-style: italic;
  color: var(--ink-0);
  font-size: 15px;
}

.stage-checklist-items {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.stage-checklist-item {
  padding: 7px 12px;
  border-left: 2px solid transparent;
  font-size: 15px;
}
.stage-checklist-item.is-next {
  background: var(--surface-2);
  border-left-color: var(--accent);
}
.stage-checklist-item.is-done .stage-checklist-text {
  text-decoration: line-through;
  color: var(--ink-3);
}
.stage-checklist-form label {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
}
.stage-checklist-form input[type=checkbox] { margin-top: 4px; accent-color: var(--accent); }
/* V36: three-state step mark (Not done / Done / N/A). The control is a
   button (a checkbox can't carry three states); clicking cycles the
   state server-side. The leading mark + the parent .is-na class style it. */
.stage-checklist-tristate {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; text-align: left;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
}
.stage-checklist-tristate:disabled { cursor: default; opacity: 0.6; }
/* Production thread tab: this manual "mark done" tristate is the tab's only
   action, so render it as a clear, hoverable button — the bare text-button
   look (background:none; border:0) read as un-clickable. The dense canonical
   checklist keeps the original look (this is scoped to .preprod-thread-form). */
.preprod-thread-form .stage-checklist-tristate:not(:disabled) {
  width: auto; align-items: center;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2);
  transition: background .12s ease, border-color .12s ease;
}
.preprod-thread-form .stage-checklist-tristate:not(:disabled):hover {
  background: var(--surface-3); border-color: var(--accent);
}
.preprod-thread-form .stage-checklist-tristate:not(:disabled):active {
  transform: translateY(1px);
}
.stage-checklist-tristate-mark {
  flex: 0 0 auto; margin-top: 1px; min-width: 22px;
  font-family: var(--mono); font-size: 13px;
  color: var(--ink-3); text-align: center;
}
.stage-checklist-tristate.state-done .stage-checklist-tristate-mark { color: var(--accent); }
.stage-checklist-tristate.state-na .stage-checklist-tristate-mark { color: var(--ink-2); }
.stage-checklist-item.is-na .stage-checklist-text {
  color: var(--ink-3);
  font-style: italic;
}
.stage-checklist-text { color: var(--ink-1); }
.stage-checklist-done-meta {
  display: block; margin-top: 2px; margin-left: 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
/* V15: auto-derived / automatable-later checklist metadata. */
.stage-checklist-item.is-auto { background: var(--surface-2); }
.stage-checklist-auto {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
}
.stage-checklist-auto-mark {
  font-family: var(--mono); color: var(--ink-3); width: 16px;
}
.stage-checklist-auto-mark.is-satisfied { color: var(--accent); }
.stage-checklist-auto-badge,
.stage-checklist-automatable-badge,
.stage-checklist-reference-badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
}
.stage-checklist-auto-badge {
  background: var(--accent); color: var(--surface-1);
}
.stage-checklist-automatable-badge {
  background: var(--surface-3, var(--surface-2));
  color: var(--ink-3);
  border: 1px dashed var(--ink-3);
}
.stage-checklist-item.is-reference { opacity: 0.78; }
.stage-checklist-reference {
  display: flex; align-items: baseline; gap: 8px;
}
.stage-checklist-reference-mark {
  font-family: var(--mono); color: var(--ink-3); width: 16px;
  font-style: italic; text-align: center;
}
.stage-checklist-reference-badge {
  background: transparent; color: var(--ink-3);
  border: 1px solid var(--ink-3);
}
.stage-checklist-auto-evidence { font-style: italic; }
.stage-checklist-automatable-note {
  display: block; margin-top: 2px; margin-left: 26px;
  font-style: italic; color: var(--ink-3);
}
.stage-checklist-empty {
  font-style: italic;
  color: var(--ink-3);
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
}

/* ---- First Fifteen: per-character voice-sample sub-list -------- */

.stage-checklist-rollup {
  display: flex; align-items: baseline; gap: 10px;
}
.stage-checklist-rollup-count {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.character-sample-list {
  list-style: none;
  margin: 6px 0 2px 26px;
  padding: 0;
  display: flex; flex-direction: column; gap: 1px;
  border-left: 1px solid var(--line);
}
.character-sample-row {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}
.character-sample-row:first-child { border-top: 0; }
.character-sample-main {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.character-sample-form { flex: none; }
.character-sample-form label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.character-sample-form input[type=checkbox] { accent-color: var(--accent); }
.character-sample-name { color: var(--ink-1); font-size: 14px; font-weight: 600; }
.character-sample-row.is-done .character-sample-name {
  text-decoration: line-through;
  color: var(--ink-3);
}
/* A1: the parsed-trait chips (kind · gender · POV · lines · dialogue wds). */
.character-sample-traits {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11px;
}
.character-sample-kind {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.character-sample-trait {
  color: var(--ink-2);
  white-space: nowrap;
}
.character-sample-pov {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
}
/* A1: the parsed description (or the empty-state affordance). */
.character-sample-desc {
  margin: 3px 0 0 26px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.4;
  max-width: 60ch;
}
.character-sample-desc-empty { color: var(--ink-3); font-style: italic; }
.character-sample-desc-edit { margin-left: 6px; }
/* A1: per-character sample status + (V57 placement fix) a deep-link to
   record on the Characters tab. The recorder itself no longer lives in
   the stage drawer; it lives in the Characters-tab voice-bible panel. */
.character-sample-clip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 6px 0 0 26px;
}
.character-sample-audio { height: 30px; max-width: 18rem; }
.character-sample-clip-locked { font-size: 12px; }
.character-sample-record-link { font-size: 12px; white-space: nowrap; }
.character-sample-hint {
  margin: 4px 0 0 26px;
  font-size: 13px;
}

/* ---- chapter table + bulk-step bar ----------------------------- */

.bulk-step-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
/* Only shown once at least one chapter row is selected (toggled by JS in
   _stage_workflow_production.html). The class+attr selector outranks the
   `.bulk-step-bar { display: flex }` rule above so `hidden` actually hides. */
.bulk-step-bar[hidden] { display: none; }
.bulk-step-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}
.bulk-step-pick select {
  font: inherit;
  font-family: var(--body);
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: var(--surface-0);
  color: var(--ink-1);
}
.bulk-step-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
}

table.chapters {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.chapters th {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  font-weight: 500;
  text-align: left;
  padding: 8px 8px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
table.chapters td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-1);
}
table.chapters .cell-bool { text-align: center; }
table.chapters .cell-textarea textarea { min-width: 200px; }
table.chapters .cell-text input { min-width: 100px; }
.cell-select { width: 30px; text-align: center; }
.cell-select input[type=checkbox] { accent-color: var(--accent); }
.cell-step.step-done {
  background: var(--good-soft);
  position: relative;
}
.cell-step.step-done::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-left: 2px solid var(--good);
  pointer-events: none;
}

.manuscript-pron-link { margin-top: 16px; }
.manuscript-pron-link a {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.manuscript-pron-link a:hover { color: var(--accent-bright); }

.add-chapter { margin-top: 18px; }
.add-chapter summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding: 8px 0;
}
.add-chapter summary:hover { color: var(--accent-bright); }
.chapter-add-form { margin-top: 14px; }

.audit-val {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  white-space: pre-wrap;
  max-width: 300px;
  color: var(--ink-2);
}

/* ---- calendar slots (Timeline month Forecast list) ------------- */
/* The V3 calendar year grid is retired; these `.cal-slot*` / `.cal-add*`
   rules now dress the editable CalendarSlot partials in the Timeline
   month view's Forecast section (see `.tl-slot-list` below). */

.cal-slot {
  display: grid;
  grid-template-columns: 24px 1fr 18px;
  gap: 6px;
  padding: 6px 8px;
  background: var(--surface-0);
  border: 1px solid var(--line);
  font-size: 12px;
}
.cal-slot-num {
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}
.cal-slot-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-slot-body input { width: 100%; }
.cal-slot-meta { display: flex; gap: 4px; }
.cal-slot-meta form { flex: 1 1 0; min-width: 0; }
.cal-slot-meta input { font-size: 13px; padding: 3px 5px; }
.cal-slot-author-form input { padding: 4px 6px; }
.cal-slot-link {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cal-slot-link a { color: var(--good); border: 0; }
.cal-slot-delete { display: flex; align-items: flex-start; }
.cal-slot-delete button {
  font-size: 14px; line-height: 1; padding: 0 4px;
  background: transparent; color: var(--ink-3); border: 0; cursor: pointer;
}
.cal-slot-delete button:hover { color: var(--danger); }

.cal-add { margin-top: 8px; text-align: center; }
.cal-add-form {
  background: var(--surface-2);
  border: 1px solid var(--accent);
  padding: 10px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cal-add-form input { width: 100%; }
.cal-add-form .form-actions { margin-top: 6px; gap: 10px; }

.bvo-add-form .form-actions { margin-top: 14px; }

/* ---- audit log ------------------------------------------------- */

/* Pager for the global /audit page (limit + offset query params).
   Disabled-step links render dimmed and unclickable; the "showing
   N–M" caption sits between prev / next. */
.audit-pager {
  display: flex;
  gap: 18px;
  align-items: baseline;
  margin-top: 14px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.audit-pager-disabled { color: var(--ink-3); cursor: default; }
.audit-pager-pos { font-family: var(--mono); font-size: 11px; }

.search-form, .filter-bar {
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.filter-bar { gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.daily-add-form .form-grid { gap: 12px; }

/* ---- templates / compose / messages ---------------------------- */

/* V25: .rclass / .rclass-* removed when the relationship_class
   taxonomy was dropped. Templates no longer carry a class. */

.required-fields { display: flex; gap: 10px; flex-wrap: wrap; padding-left: 16px; }
.template-edit-form { margin-bottom: 14px; }
.template-edit-form button { margin-top: 4px; }
.compose-pick-form { display: flex; gap: 16px; align-items: flex-end; }
.compose-form textarea {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  background: var(--surface-0);
  min-height: 180px;
}

.msg-status {
  display: inline-block;
  padding: 1px 8px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid var(--line);
  background: transparent;
}
.msg-status-draft           { color: var(--ink-3); border-style: dashed; }
.msg-status-ready           { color: var(--accent, var(--ink-1)); border-color: var(--accent, var(--ink-1)); }
.msg-status-sent            { color: var(--good); border-color: var(--good); }
.msg-status-failed          { color: var(--bad, #c0392b); border-color: var(--bad, #c0392b); }
.msg-status-logged_external { color: var(--ink-2); border-color: var(--ink-2); border-style: dotted; }

/* V24 outbox UI bits */
.compose-actions { gap: 12px; display: flex; flex-wrap: wrap; }
/* Item 19: recipient preset buttons (Author / Team-group) above the
   To field. Sit on a compact row; the To input stays full-width below. */
.recipient-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.recipient-presets .recipient-preset { font-size: 12px; padding: 3px 10px; }
.btn-primary { background: var(--accent, #d63384); color: #fff; }
.btn-secondary { background: var(--surface-1, #eee); color: var(--ink-1); }
.btn-danger { background: var(--bad, #c0392b); color: #fff; }
.cc-bcc-toggle summary { cursor: pointer; font-family: var(--mono); font-size: 12px; }
.attach-panel { border: 1px solid var(--line); padding: 12px; margin: 12px 0; }
.attach-panel legend { font-weight: 600; }
.checkbox-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.card-error { border-color: var(--bad, #c0392b); }
.kv-list dt { font-weight: 600; margin-top: 8px; }
.kv-list dd { margin: 0 0 4px 16px; }

.message-body {
  margin: 8px 0 0;
  padding: 14px;
  background: var(--surface-0);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--ink-1);
}

/* ---- schedule grid --------------------------------------------- */

table.schedule-grid th { white-space: nowrap; }
.schedule-quarter-picker { display: inline-flex; align-items: center; gap: 8px; }

/* ---- search ---------------------------------------------------- */

.search-form input[type=search] {
  flex: 1;
  padding: 9px 14px;
  background: var(--surface-0);
  color: var(--ink-0);
  border: 1px solid var(--line);
  font: inherit;
  font-family: var(--body);
  font-size: 15px;
}
.search-form input[type=search]:focus { border-color: var(--accent); outline: none; }
.search-group h2 { display: flex; align-items: center; gap: 10px; }
.search-count {
  display: inline-block;
  padding: 0 9px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  background: var(--accent-soft);
  color: var(--accent-bright);
  border: 1px solid var(--accent);
}
.search-group ul { list-style: none; padding: 0; margin: 0; }
.search-group li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }

/* Item 3: character search clusters matches per book. A light, on-brand
   treatment — each book is a soft-tinted block with its title as a
   subheading and the character hits listed beneath. */
.search-char-book {
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}
.search-char-book-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.search-char-book-title a { color: var(--accent-bright); }
.search-char-book-title .meta { font-weight: 400; }

/* ---- releases -------------------------------------------------- */

.release-flag {
  display: inline-block; padding: 1px 8px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid var(--line);
  color: var(--ink-3);
  margin-right: 6px;
}
.release-flag.is-on { color: var(--good); border-color: var(--good); }
.release-flags { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.release-edit { margin-bottom: 14px; }
.release-edit-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.release-cover-preview { margin: 0 0 14px; }

/* ---- inquiries kanban ----------------------------------------- */

.inquiry-kanban {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.inquiry-column {
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: 12px;
}
.inquiry-column h2 {
  font-size: 14px;
  margin-bottom: 12px;
  font-variation-settings: var(--fraunces-body);
}
.inquiry-column ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.inquiry-column li {
  background: var(--surface-2);
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid var(--line-soft);
}

.inquiry-form { display: flex; flex-direction: column; gap: 14px; }
.inquiry-edit { display: flex; flex-direction: column; gap: 4px; }
.inquiry-edit button { align-self: flex-start; }

/* ---- proofing (legacy markup may still appear) ----------------- */

.proofing-filters {
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex; flex-wrap: wrap; gap: 14px 20px;
  align-items: center; justify-content: space-between;
}
.proofing-filters-buckets { display: flex; gap: 6px; flex-wrap: wrap; }
.proofing-bucket {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.proofing-bucket.is-active { background: var(--accent); color: var(--ink-0); border-color: var(--accent); }
.proofing-bucket-count { color: var(--ink-3); }
.proofing-bucket.is-active .proofing-bucket-count { color: rgba(255,255,255,0.75); }
.proofing-pill {
  display: inline-block; padding: 1px 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
}
.proofing-pill-done { color: var(--good); border-color: var(--good); }
.proofing-pill-progress { color: var(--ink-1); border-color: var(--ink-2); }
.proofing-pill-needs { color: var(--accent); border-color: var(--accent); }
.proofing-pill-raw { color: var(--danger); border-color: var(--danger); }

/* ---- error / warning ------------------------------------------- */

.error {
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  padding: 8px 12px;
  font-family: var(--body);
  font-size: 14px;
}
.warning { color: var(--accent); }

/* ---- login ----------------------------------------------------- */

.login-card {
  max-width: 380px;
  margin: 80px auto;
  padding: var(--pad-loose);
  background: var(--surface-1);
  border: 1px solid var(--line);
}
.login-form .field { margin-bottom: 14px; }
.login-hint { margin-top: 16px; }

/* ---- V11 permissions surfaces ---------------------------------- */

/* One-time invite link callout (admin users page + project access). */
.invite-flash {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}
.invite-link {
  display: inline-block;
  word-break: break-all;
  padding: 6px 10px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  font-size: 13px;
}
/* Read-only project field rendered for non-admins. */
.inline-edit.is-readonly {
  color: var(--ink);
  padding: 4px 0;
}
.inline-edit.is-readonly .bool-cell { font-weight: 500; }
/* Admin link in the top nav. */
.topnav-admin-link {
  margin-right: 10px;
  font-size: 13px;
}
/* Project access panel add-form lays its fields out inline. */
.project-access-add { margin-top: 14px; }
.project-access-add .field { margin-right: 14px; }

/* ---- My Work --------------------------------------------------- */

.mywork-pick {
  max-width: 420px;
}
.mywork-pick form {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  justify-content: center;
}
.todo-priority {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.todo-priority-high { border-color: var(--accent); color: var(--accent-bright); }

/* ---- stage bar chart (dashboard rollup) ------------------------ */

.stage-chart { display: flex; flex-direction: column; gap: 6px; }
.stage-bar-row {
  display: grid;
  grid-template-columns: 200px 1fr 36px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.stage-bar-label {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stage-bar-track {
  background: var(--surface-2);
  height: 10px;
  overflow: hidden;
}
.stage-bar-fill { background: var(--accent); height: 100%; }
.stage-bar-count {
  text-align: right;
  font-weight: 600;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-1);
}

/* ================================================================
   STAGE WORKFLOW — per-family views (production / comms / delivery)
   ================================================================ */

/* Hint shown above the dispatcher when stored stage is `unset` but
   the home page derived something via legacy_status / first_fifteen. */
.stage-derived-hint {
  background: var(--surface-2);
  border-left: 2px solid var(--ink-3);
  padding: 10px 14px;
  margin: 0 0 16px;
  font-family: var(--body);
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--ink-1);
}
.stage-derived-hint strong { color: var(--accent-bright); font-weight: 600; }
.stage-derived-hint code {
  background: var(--surface-0);
  padding: 1px 6px;
  color: var(--ink-1);
}

/* Common header strip used by all three family views: stage tag +
   owner chip + advance button. Sits at the top of the section. */
.stage-prod-head,
.stage-comms-head,
.stage-delivery-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.stage-prod-head-meta,
.stage-comms-head-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stage-prod-stage-tag {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding: 4px 10px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
}
.btn-advance {
  background: transparent;
  color: var(--accent-bright);
  border: 1px solid var(--accent);
  font-weight: 600;
  padding: 8px 18px;
  /* Hover uses `transform: scale(...)` rather than padding/font-size
     changes, so the rest of the row never reflows when the user is
     just hovering the button. `transition` covers both the
     pre-existing background fade and the new scale. */
  transform-origin: center;
  transition: background 120ms ease, transform 120ms ease;
}
.btn-advance:hover {
  background: var(--accent);
  color: var(--ink-0);
  /* Explicitly restate the full border. The base `.btn:hover` selector
     ships `border: 0` (shorthand wipes width AND style), which has
     equal specificity to `.btn-advance:hover` but the per-property
     cascade lets `border-width: 0` from there win — so without this
     restatement the button silently shrinks 2px in each dimension on
     hover, which is what was nudging neighbouring controls. */
  border: 1px solid var(--accent);
  transform: scale(1.04);
}
.stage-advance-form { display: inline; }
.stage-move-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.btn-back {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
  font-weight: 500;
  padding: 7px 14px;
  font-size: 13px;
  transform-origin: center;
  transition: background 120ms ease, color 120ms ease,
              border-color 120ms ease, transform 120ms ease;
}
.btn-back:hover {
  color: var(--ink-0);
  /* Restate the full border (see `.btn-advance:hover` comment): the
     base `.btn:hover { border: 0 }` wipes border-width otherwise. */
  border: 1px solid var(--ink-3);
  background: var(--surface-2);
  transform: scale(1.04);
}

/* AC1 — a gated advance is no longer a dead disabled button. When the
   advance is blocked (e.g. Production needs chapters) the control is a
   PROMINENT primary CTA (rendered as an <a class="btn btn-advance">)
   that lands the user on the action that unblocks it, plus a one-line
   explanation of why. No dead-end. */
.stage-advance-blocked {
  flex-basis: 100%;
  text-align: right;
  margin: 2px 0 0;
  max-width: 360px;
  margin-left: auto;
}
.stage-advance-blocked strong { color: var(--ink-1); }

/* AC2 — manual "Set stage" override control. A collapsed escape hatch
   so the owner can move the project to ANY stage directly and is never
   stuck behind a gate. Sits under the Advance/Back pair, deliberately
   quiet until expanded. */
.stage-set-control {
  flex-basis: 100%;
  margin-top: 10px;
  font-size: 13px;
}
.stage-set-control > summary {
  cursor: pointer;
  list-style: none;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: right;
}
.stage-set-control > summary::-webkit-details-marker { display: none; }
.stage-set-control > summary::before { content: "⚙  "; color: var(--ink-3); }
.stage-set-control[open] > summary::before { content: "⚙  "; color: var(--accent); }
.stage-set-control > summary:hover { color: var(--ink-0); }
.stage-set-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 10px;
}
.stage-set-label { color: var(--ink-2); }
.stage-set-form select { font-size: 13px; padding: 4px 8px; }
.stage-set-warn {
  margin: 8px 0 0;
  max-width: 480px;
  margin-left: auto;
  text-align: right;
}
.stage-set-warn strong { color: var(--accent-bright); }
.stage-set-hint {
  margin: 6px 0 0;
  max-width: 480px;
  margin-left: auto;
  text-align: right;
  font-size: 11.5px;
}

/* Collapsible docx-checklist drawer at the bottom of each family
   view — reference material, never the headline. */
.stage-prod-checklist-drawer { margin-top: 28px; }
.stage-prod-checklist-drawer > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stage-prod-checklist-drawer > summary::-webkit-details-marker { display: none; }
.stage-prod-checklist-drawer > summary::before { content: "▸  "; color: var(--ink-3); }
.stage-prod-checklist-drawer[open] > summary::before { content: "▾  "; color: var(--accent); }
.stage-prod-checklist-drawer > summary:hover { color: var(--ink-0); }

/* ----------------------------------------------------------------
   FAMILY B — PRODUCTION VIEW (chapter-grain board)
   ---------------------------------------------------------------- */

.prod-board-wrap { margin-bottom: 22px; }
.prod-board-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}
.prod-board-title {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink-0);
  letter-spacing: -0.005em;
}
.prod-board-meta {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-transform: uppercase;
}
.prod-board-meta strong { color: var(--accent-bright); font-weight: 600; }

table.prod-board {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-1);
  border: 1px solid var(--line);
  font-size: 14px;
}
table.prod-board thead th {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  font-weight: 500;
  text-align: left;
  padding: 9px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.prod-board thead th.is-active-col {
  color: var(--accent-bright);
  background: var(--accent-soft);
  border-bottom: 2px solid var(--accent);
  position: relative;
}
table.prod-board th.prod-col-step { text-align: center; width: 72px; }
table.prod-board th.prod-col-chapter { width: 80px; }
table.prod-board th.prod-col-character { min-width: 120px; }
table.prod-board th.prod-col-length { width: 60px; text-align: right; }
table.prod-board th.prod-col-pickups { min-width: 200px; }
.prod-col-step-marker { display: inline-block; margin-left: 4px; color: var(--accent); }

table.prod-board tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.prod-board tbody tr:hover { background: var(--surface-2); }
table.prod-board tbody tr.is-next {
  background: rgba(var(--accent-rgb), 0.06);
}
table.prod-board tbody tr.is-next:hover { background: rgba(var(--accent-rgb), 0.10); }

/* Per-stage whole-chapter "done" (Stream B, spec #7/#8). A chapter that
   has cleared the CURRENT production sub-stage's lane gets a clear,
   whole-row mint-green wash + a leading accent bar — distinct from the
   per-tick step fills (which use the rec/spl/prf/crx palette) and louder
   than the `.is-next` accent tint. This reads the per-stage completion at
   a glance without touching the individual tick controls. The leading bar
   lands on the first body cell (the select checkbox column). */
/* Done = the app's neutral elevated-row surface (the same colour the other
   data tables use for a selected/pressed row), NOT a green wash — the
   muddy --good-soft over the dark theme read badly. A thin mint --good
   leading bar carries the "done" cue. */
table.prod-board tbody tr.prod-row.is-stage-done {
  background: var(--surface-3);
}
table.prod-board tbody tr.prod-row.is-stage-done:hover {
  background: var(--surface-3);
  filter: brightness(1.08);
}
table.prod-board tbody tr.prod-row.is-stage-done > td:first-child {
  box-shadow: inset 3px 0 0 0 var(--good);
}
/* A done chapter is, by definition, not the "next step here" row, but if
   both classes ever co-occur the done surface wins for an unambiguous read. */
table.prod-board tbody tr.prod-row.is-stage-done.is-next {
  background: var(--surface-3);
}

/* Agnostic per-chapter note as a quiet inline-editable COLUMN in the
   chapter row (no flow-breaking colour band — it sits like any other
   column). The textarea is borderless until hovered/focused so an empty
   note reads as plain whitespace, not a loud input. */
.prod-col-note { width: 22%; min-width: 160px; vertical-align: middle; }
.prod-note-form { margin: 0; }
.prod-note-input {
  width: 100%; resize: vertical; min-height: 1.6em;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  padding: 3px 6px; color: var(--ink-1); font: inherit; line-height: 1.4;
}
.prod-note-input:hover { border-color: var(--line-soft); }
.prod-note-input:focus { border-color: var(--accent); background: var(--surface-1); outline: none; }
.prod-note-input::placeholder { color: var(--ink-3); font-style: italic; }

/* ---- Production phases: the four-lane board (Stream B, spec #7/#8) ----
   Recording → Splicing → Proofing → Pickups as distinct lanes that
   advance independently. The lane accent colours reuse the per-chapter
   step palette (--rec/--spl/--prf/--crx) so the lanes and the tick
   board read as one family. Splicing is simply absent for non-duet. */
.prod-lanes { margin: 16px 0 22px; }
.prod-lanes-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.prod-lanes-title {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
}
.prod-lanes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.prod-lane {
  border: 1px solid var(--line);
  border-radius: var(--bvo-r);
  padding: 12px 14px;
  background: var(--surface-1);
  display: flex; flex-direction: column; gap: 8px;
}
.prod-lane.is-complete { border-color: var(--prf); background: rgba(95, 182, 166, 0.06); }
.prod-lane-top { display: flex; align-items: center; gap: 8px; }
.prod-lane-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
  background: var(--ink-3);
}
.prod-lane-dot.rec { background: var(--rec); }
.prod-lane-dot.spl { background: var(--spl); }
.prod-lane-dot.prf { background: var(--prf); }
.prod-lane-dot.crx { background: var(--crx); }
.prod-lane-name { font-weight: 600; color: var(--ink-1); }
.prod-lane-check { margin-left: auto; color: var(--prf); font-weight: 700; }
.prod-lane-count { font-size: 13px; color: var(--ink-2); }
.prod-lane-count strong { font-size: 18px; color: var(--ink-1); }
.prod-lane-bar {
  height: 6px; border-radius: 3px; background: var(--surface-2);
  overflow: hidden;
}
.prod-lane-fill { display: block; height: 100%; border-radius: 3px; background: var(--ink-3); }
.prod-lane-fill.rec { background: var(--rec); }
.prod-lane-fill.spl { background: var(--spl); }
.prod-lane-fill.prf { background: var(--prf); }
.prod-lane-fill.crx { background: var(--crx); }
.prod-lane-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; font-size: 11px;
}
.prod-lane-owner { color: var(--ink-2); }
.prod-lane-files {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
}
.prod-lane-files.in { color: var(--prf); }

/* Archive tag in the project chrome (V43, spec #11). */
.archive-control { display: inline-flex; align-items: center; gap: 8px; }
.archive-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px;
}
/* V70 archive outcome: an incomplete (ignored-everywhere) book reads
   visibly "set aside" — dashed edge; completed keeps the plain tag. */
.archive-tag-incomplete { border-style: dashed; }

/* V70 archive-outcome prompt: a <details> popover off the "Archive…"
   toggle in the project chrome (same no-JS drawer pattern as
   .inquiry-decline). Two stacked choice buttons, each with a one-line
   consequence, so the studio picks HOW the book ended in one click. */
.archive-prompt { position: relative; display: inline-block; }
.archive-prompt > summary.archive-prompt-toggle { list-style: none; cursor: pointer; }
.archive-prompt > summary::-webkit-details-marker { display: none; }
.archive-prompt-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 300px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-0);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex; flex-direction: column; gap: 8px;
  text-align: left; font-size: 13px;
}
.archive-prompt-panel form { display: flex; flex-direction: column; gap: 8px; }
.archive-prompt-lede { margin: 0; font-weight: 600; color: var(--ink-0); }
.archive-prompt-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; white-space: normal;
}
.archive-prompt-choice small {
  font-weight: 400; font-size: 11px; line-height: 1.3; color: var(--ink-2);
}

/* The step-dots. Empty by default, filled when done. Active stage
   column wraps the dot in a subtle ring. */
.prod-step-cell {
  text-align: center;
  width: 72px;
}
.prod-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--ink-3);
  background: transparent;
  border-radius: 50%;
  transition: background 100ms ease, border-color 100ms ease, transform 80ms ease;
}
.prod-dot-btn {
  background: transparent;
  border: 0;
  padding: 4px;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  outline-offset: 2px;
}
.prod-dot-btn:hover .prod-dot {
  border-color: var(--accent-bright);
  transform: scale(1.15);
}
.prod-dot-btn:focus-visible {
  outline: 2px solid var(--accent);
}
.prod-dot-btn:active .prod-dot { transform: scale(0.92); }
.prod-step-cell.is-done .prod-dot {
  background: var(--good);
  border-color: var(--good);
}
.prod-step-cell.is-active-col {
  background: rgba(var(--accent-rgb), 0.04);
}
.prod-step-cell.is-active-col .prod-dot {
  border-color: var(--accent);
  border-width: 2px;
}
.prod-step-cell.is-active-col.is-done .prod-dot {
  background: var(--good);
  border-color: var(--good);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.20);
}

.prod-pickups-flag {
  display: inline-block;
  color: var(--danger);
  margin-right: 6px;
}
.prod-pickups-text {
  font-family: var(--body);
  font-size: 12px;
  color: var(--ink-2);
  font-style: italic;
}

/* Proofing stage ONLY: the per-chapter Pickups cell becomes editable so
   the proofer captures pickups without leaving the board. The textarea
   reuses the quiet inline-edit idiom (borderless until hover/focus, like
   `.prod-note-input`) so an empty note reads as plain whitespace, and the
   Proofing-pack link sits beneath as a low-key mono affordance. Strictly
   additive + stage-gated — off-stage cells render the read-only flag/text
   above, unchanged. */
.prod-col-pickups-proofing { vertical-align: top; }
.prod-pickups-edit-form { margin: 6px 0 0; }
.prod-pickups-input {
  width: 100%; resize: vertical; min-height: 1.6em;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  padding: 3px 6px; color: var(--ink-1);
  font-family: var(--body); font-size: 12px; line-height: 1.4;
  /* Grow live as the proofer types in supporting browsers. The template
     sets an initial `rows` from the existing line count (the JS-free
     baseline); `field-sizing: content` is progressive enhancement on top.
     `max-height` + `overflow:auto` cap the growth (~6 lines) and act as
     the fallback in browsers that ignore `field-sizing`. */
  field-sizing: content;
  max-height: 9.4em; overflow: auto;
}
.prod-pickups-input:hover { border-color: var(--line-soft); }
.prod-pickups-input:focus {
  border-color: var(--accent); background: var(--surface-1); outline: none;
}
.prod-pickups-input::placeholder { color: var(--ink-3); font-style: italic; }

/* V30: per-chapter "pickups done" toggle inside the Production board's
   Pickups cell. Compact + uppercase + low-affordance until checked, so
   the cell still reads "pickups" not "form." accent-color picks up the
   theme tint on the box itself, so the checked state isn't just a
   generic browser blue. */
.prod-pickups-done-form {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}
.prod-pickups-done-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--body);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.prod-pickups-done-label input[type="checkbox"] {
  accent-color: var(--good);
  margin: 0;
  cursor: pointer;
}
.prod-pickups-done-label input[type="checkbox"]:checked + .prod-pickups-done-text {
  color: var(--good);
  font-weight: 600;
}

/* The dot's grow/shrink transition reads as a flash to users who asked
   for less motion (reduced-motion media query). Suppress it. */
@media (prefers-reduced-motion: reduce) {
  .prod-dot { transition: none; }
}

.prod-bootstrap {
  text-align: left;
  max-width: 520px;
  margin: 0 auto;
}
.prod-bootstrap-headline {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-style: normal;
  font-size: 17px;
  color: var(--ink-0);
  margin: 0 0 14px;
}
.prod-bootstrap-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  justify-content: center;
}
.prod-bootstrap-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prod-bootstrap-label input {
  font: inherit;
  font-family: var(--body);
  font-size: 18px;
  padding: 8px 12px;
  background: var(--surface-0);
  color: var(--ink-0);
  border: 1px solid var(--line);
  width: 140px;
}
.prod-bootstrap-label input:focus { border-color: var(--accent); outline: none; }
.prod-bootstrap-hint {
  margin-top: 14px;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink-2);
  font-style: italic;
}

/* Two-option bootstrap (manuscript upload + manual chapter count). */
.prod-bootstrap-pair {
  text-align: left;
  max-width: 880px;
  margin: 0 auto;
  padding: 24px;
}
.prod-bootstrap-pair .prod-bootstrap-headline {
  text-align: center;
  margin-bottom: 22px;
}
.prod-bootstrap-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}
/* When only one bootstrap option exists, collapse the two-up grid to a
   single centered column so the lone card reads as intentional rather
   than an auto-fit cell stretched edge to edge. */
.prod-bootstrap-options.is-single {
  grid-template-columns: minmax(0, 440px);
  justify-content: center;
}
.prod-bootstrap-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 18px 20px;
}
.prod-bootstrap-card-title {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-0);
  margin: 0 0 8px;
}
.prod-bootstrap-card-blurb {
  font-size: 14px;
  color: var(--ink-1);
  margin: 0 0 12px;
}
.prod-bootstrap-card-blurb em { font-style: italic; color: var(--accent-bright); }

.prod-upload-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prod-upload-form input[type=file] {
  font: inherit;
  font-family: var(--body);
  font-size: 13px;
  padding: 8px;
  background: var(--surface-0);
  color: var(--ink-1);
  border: 1px dashed var(--line);
  cursor: pointer;
}
.prod-upload-form input[type=file]::file-selector-button {
  background: var(--accent);
  color: var(--ink-0);
  border: 0;
  padding: 5px 10px;
  margin-right: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.prod-upload-form input[type=file]::file-selector-button:hover {
  background: var(--accent-bright);
}

/* ================================================================
   MANUSCRIPT PREVIEW PAGE
   ================================================================ */

.ms-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.ms-preview-head h1 {
  font-size: 36px;
  font-variation-settings: "opsz" 144, "SOFT" 70, "WONK" 0;
}
.ms-preview-actions { display: flex; gap: 18px; align-items: center; }
.btn-apply {
  background: var(--accent);
  color: var(--ink-0);
  border: 0;
}
.btn-apply:hover { background: var(--accent-bright); }
.btn-apply-large {
  padding: 12px 24px;
  font-size: 12px;
}

.ms-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.ms-summary-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ms-summary-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}
.ms-summary-value {
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "SOFT" 60, "WONK" 0;
  font-size: 42px;
  font-weight: 500;
  color: var(--ink-0);
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
  margin-top: 6px;
}

.ms-warning {
  background: var(--surface-2);
  border-left: 2px solid var(--danger);
  padding: 12px 16px;
  margin-bottom: 22px;
  font-size: 14px;
  color: var(--ink-1);
}
.ms-warning strong { color: var(--danger); }
.ms-warning em { color: var(--ink-0); font-style: italic; }

.ms-section { margin-bottom: 22px; }
.ms-section h2 {
  font-size: 22px;
  margin: 0 0 14px;
  font-variation-settings: var(--fraunces-body);
}

.ms-chapter-table .ms-col-num { width: 90px; }
.ms-chapter-table .ms-col-words,
.ms-chapter-table .ms-col-est { width: 100px; text-align: right; }
.ms-chapter-table td.num { font-family: var(--mono); font-feature-settings: "lnum"; }

.ms-character-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.ms-character-h {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-0);
}
.ms-character-h .meta {
  font-family: var(--body);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}
.ms-character-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ms-character-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.ms-character-name {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 16px;
  color: var(--ink-0);
  font-weight: 500;
}

.ms-ai-stubs { opacity: 0.7; }
.ms-ai-stub-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.ms-ai-stub-buttons .btn[disabled] {
  background: var(--surface-2);
  color: var(--ink-3);
  cursor: not-allowed;
  border: 1px dashed var(--line);
}

.ms-apply-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 22px;
  align-items: center;
}

/* ---- V9 manuscript revamp: POV, modes, cues, estimates ---- */

/* POV confidence + narration-mode chips. */
.ms-conf,
.ms-mode {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 6px;
  border: 1px solid var(--line);
}
.ms-conf-high {
  color: var(--accent-bright);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.ms-conf-low {
  color: #8a5a00;
  border-color: #d8b878;
  background: #fcf3df;
}
/* `mixed` — a mid-chapter POV switch, the chapter that most needs a
   studio review. Distinct from `low`: a stronger warning tone so it
   never reads as a clean parse. */
.ms-conf-mixed {
  color: #7a1f00;
  border-color: #c9622e;
  background: #fbe3d6;
  font-weight: 600;
}
.ms-mode { color: var(--ink-2); }
.ms-mode-1st { border-color: var(--accent); color: var(--accent-bright); }
.ms-mode-2nd { border-color: #8a5a00; color: #8a5a00; }

/* Advisory parser flags (Chapter.flags) — surfaced on the preview so
   the studio reviews a flagged chapter before applying. Same chip
   styling as the POV pills; warning tone. */
.ms-flag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 0 6px;
  margin-left: 6px;
  border: 1px solid var(--line);
}
.ms-flag-review {
  color: #7a1f00;
  border-color: #c9622e;
  background: #fbe3d6;
  font-weight: 600;
}
/* A row carrying any parser flag gets a faint warning wash. */
.ms-row-flagged { background: #fdf1ea; }

.ms-chapter-table .ms-col-pov { width: 170px; }
.ms-chapter-table .ms-col-mode { width: 120px; }
.ms-chapter-table .ms-col-split { width: 150px; }

/* Narr / Dlg split: counts and percentages each on their own
   non-wrapping line so a thousands-scale chapter never goes "derpy". */
.ms-col-split .ms-split-counts,
.ms-col-split .ms-split-pct { display: block; white-space: nowrap; }
.ms-col-split .ms-split-pct { font-size: 12px; color: var(--ink-2); }

/* Editable POV select + narration-mode toggle on the parse preview. */
.ms-pov-select {
  font: inherit;
  font-size: 13px;
  padding: 2px 4px;
  max-width: 130px;
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--ink-0);
}
.ms-mode-toggle { display: inline-flex; gap: 8px; }
.ms-mode-opt {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-1);
}

/* Inline delete (×) control for droppable cue / pronunciation rows. */
.ms-del-control {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.ms-del-control .ms-del-check {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ms-del-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1;
  border-radius: 2px;
}
.ms-del-control:hover .ms-del-x {
  border-color: #c9622e;
  color: #7a1f00;
  background: #fbe3d6;
}
/* A checked delete row gets a struck-through, faded look so it is
   visibly "will not be applied" before the form is submitted. */
.ms-del-check:checked ~ .ms-del-x {
  border-color: #7a1f00;
  color: #fff;
  background: #7a1f00;
}
.ms-cue-item:has(.ms-del-check:checked),
.ms-pron-table tr:has(.ms-del-check:checked) {
  opacity: 0.5;
  text-decoration: line-through;
}
.ms-pron-table .ms-col-del { width: 28px; }

/* Per-character word-count table + column toggle. */
.ms-col-toggle { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ms-col-toggle label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.ms-character-table td.num,
.ms-character-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ms-character-table .ms-cell-sum { font-family: var(--mono); }

/* Narrator-estimate panels. */
.ms-estimate-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.ms-estimate-total td { border-top: 2px solid var(--line); }

/* Vocal-cue list. */
.ms-cue-group { margin-bottom: 16px; }
.ms-cue-chapter {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--ink-0);
}
.ms-cue-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ms-cue-item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.ms-cue-word {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-bright);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  padding: 0 6px;
  white-space: nowrap;
}
.ms-cue-snippet { color: var(--ink-1); font-size: 14px; }
.ms-cue-snippet u {
  text-decoration: underline;
  text-decoration-color: var(--accent-bright);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  font-weight: 600;
  color: var(--ink-0);
}

@media (max-width: 880px) {
  .ms-character-cols { grid-template-columns: 1fr; }
  .ms-estimate-cols { grid-template-columns: 1fr; }
}

/* ================================================================
   CHARACTERS SECTION ON PROJECT DETAIL
   ================================================================ */

.characters-section h2 .meta {
  font-family: var(--body);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}
.characters-table { font-size: 14px; }
.characters-table .character-col-kind { width: 90px; }
.characters-table .character-col-name { width: 180px; }
.characters-table .character-col-stats { width: 180px; }
.characters-table .character-col-description,
.characters-table .character-col-notes { min-width: 220px; }
/* Actions column (Delete + Merge-into). Without an explicit width it
   would otherwise collapse to nothing because the description / notes
   columns claim a 220px minimum each and the row exceeds the table
   width — squeezing the actions cell so the verbose "Merge into…"
   summary and the select dropdown render as a column of ellipses.
   Reserve enough room for the Delete button and the merge widget. */
.characters-table .character-col-actions { width: 150px; }
.character-row td.character-actions {
  white-space: normal;
  overflow: visible;
}
.character-row td.character-actions .character-delete-form button { white-space: nowrap; }

.character-kind-pill {
  display: inline-block;
  padding: 1px 9px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.character-kind-pill.character-kind-major {
  color: var(--accent-bright);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.character-kind-pill.character-kind-minor {
  color: var(--ink-1);
  border-color: var(--ink-2);
}

.characters-table .character-col-narrator { width: 130px; }

/* Narrator-assignment cell: a select plus, when unset, the muted
   gender-default hint below it. Internal surface — real names. */
.character-narrator select {
  font: inherit;
  font-family: var(--body);
  font-size: 13px;
  padding: 5px 6px;
  background: var(--surface-0);
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 0;
  width: 100%;
}
.character-narrator select:focus { border-color: var(--accent); outline: none; }
.character-narrator-auto {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-style: italic;
  color: var(--ink-3);
}

/* Persisted narrator-estimate panel on the project detail page. */
.narrator-estimate-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.narrator-estimate-panel table.data { max-width: 480px; }

/* Pronunciation-candidate table — confirm/dismiss workflow (V12). */
.ms-pron-table td.num,
.ms-pron-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Status pill: new / ask_author / va_known / dismissed (V62). */
.ms-pron-status-pill {
  display: inline-block;
  padding: 1px 8px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  color: var(--ink-2);
}
/* `ask_author` is the actionable "queued for the author" state — accent it
   the way the old `confirmed` pill was accented. `new` / `va_known` ride the
   neutral base pill above. */
.ms-pron-status-ask_author {
  border-color: var(--accent);
  color: var(--accent);
}
.ms-pron-status-dismissed {
  color: var(--ink-3);
  text-decoration: line-through;
}
/* A dismissed row reads as de-emphasised, not deleted. */
.ms-pron-row.ms-pron-dismissed td { opacity: 0.55; }
.ms-pron-actions { white-space: nowrap; }
.ms-pron-action-form {
  display: inline;
  margin-right: 8px;
}
.ms-pron-action-form:last-child { margin-right: 0; }

/* Re-parse diff panel on the manuscript preview (Task 9). */
.ms-diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 10px 0 6px;
}
.ms-diff-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ms-diff-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}
.ms-diff-value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink-0);
  font-variant-numeric: lining-nums;
}
.ms-diff-detail { font-size: 12px; }

/* Per-chapter narrator column — Dual/Duet chapter tracker (Task 5). */
.cell-chapter-narrator { white-space: nowrap; }

/* Character-merge control on the character row (Task 7). */
.character-merge { margin-top: 6px; }
.character-merge > summary {
  cursor: pointer;
  font-size: 12px;
}
.character-merge-form {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.character-merge-form select {
  font: inherit;
  font-size: 13px;
  padding: 4px 6px;
  background: var(--surface-0);
  border: 1px solid var(--line);
}

/* Annotated-manuscript export block on the preview page. */
.ms-export .btn { margin-top: 6px; }

.character-row td { vertical-align: top; padding: 8px 10px; }
.character-row textarea {
  width: 100%;
  font: inherit;
  font-family: var(--body);
  font-size: 13px;
  padding: 6px 8px;
  background: var(--surface-0);
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 0;
  resize: vertical;
  min-height: 38px;
}
.character-row textarea:focus { border-color: var(--accent); outline: none; }
.characters-ai-hint {
  margin: 14px 0 0;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--body);
  font-style: italic;
  font-size: 12px;
}

/* ----------------------------------------------------------------
   INTAKE & BOOKING WIZARD (6-step guided workflow)
   ----------------------------------------------------------------
   A vertical spine of 6 stages; past = checkmark trail, current
   stage expands a "Right Now" panel, future stages render as
   ghosted previews. Mirrors the dashboard's vertical-lane rail so
   clicking into a project feels like zooming in, not jumping. */

.stage-workflow-intake {
  margin-top: 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: 16px 0 8px;
  position: relative;
}
.intake-wizard-head {
  padding: 0 24px 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 10px;
}
.intake-wizard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.intake-wizard-stage-tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 2px 8px;
  border: 1px solid var(--accent);
}
.intake-wizard-fact {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  padding: 2px 8px;
  background: var(--surface-2);
  border-radius: 2px;
}

.intake-spine {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
/* Continuous left rail behind the dots — matches `.lanes::before`
   from the dashboard so the visual grammar is consistent. */
.intake-spine::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 41px;
  width: 1px;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}
.spine-node {
  position: relative;
}
.spine-node-head {
  display: grid;
  grid-template-columns: 56px auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 24px 10px 0;
  min-height: 36px;
}
.spine-mark {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  background: var(--surface-1);
  box-shadow: 0 0 0 4px var(--surface-1);
}
.spine-node-past .spine-mark {
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
  color: color-mix(in srgb, var(--accent) 80%, var(--ink-1));
}
.spine-node-current .spine-mark {
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: var(--ink-0);
  font-size: 8px;
}
.spine-node-future .spine-mark {
  border: 1.5px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: transparent;
}
.spine-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.12em;
  min-width: 22px;
}
.spine-node-current .spine-num { color: var(--accent); }
.spine-name {
  font-family: var(--display);
  font-variation-settings: "opsz" 36, "SOFT" 60, "WONK" 0;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink-1);
  letter-spacing: -0.005em;
  margin: 0;
}
.spine-node-current .spine-name {
  color: var(--ink-0);
  font-size: 22px;
}
.spine-node-past .spine-name,
.spine-node-future .spine-name { opacity: 0.55; }
.spine-status {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.spine-node-current .spine-status { color: var(--accent-bright); }

/* Right Now panel — the focused work for the current step. */
.right-now-panel {
  margin: 4px 24px 18px 86px;
  padding: 18px 22px;
  background: var(--surface-2);
  border-left: 2px solid var(--accent);
  border-radius: 0 2px 2px 0;
}
.right-now-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.right-now-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 4px;
}
.right-now-prompt {
  font-family: var(--body);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-0);
  margin: 0 0 14px 0;
  line-height: 1.4;
}
.right-now-action {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.right-now-action-label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.inquiry-action-state {
  display: block;
  margin: 8px 0 0;
  padding-left: 12px;
  border-left: 3px solid var(--ink-3);
}
.inquiry-action-state-pending { border-left-color: var(--ink-3); }
.inquiry-action-state-waiting { border-left-color: var(--accent); }
.inquiry-action-state-applied { border-left-color: #4a8a4a; color: var(--ink-1); }

/* Scheduling stage — capacity strip + date pills + author timeframe */
.scheduling-timeframe-quote {
  font-style: italic;
  color: var(--ink-1);
  margin: 4px 0 0;
  padding-left: 12px;
  border-left: 3px solid var(--ink-3);
}
.scheduling-strip-meta { margin: 4px 0 10px; }
.capacity-strip {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
}
.capacity-cell { margin: 0; position: relative; }
.capacity-cell-radio {
  position: absolute; opacity: 0; pointer-events: none;
}
.capacity-cell-btn {
  width: 100%;
  display: flex; flex-direction: column; align-items: stretch;
  gap: 2px;
  padding: 8px 6px;
  background: var(--surface-2, var(--surface-1));
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.capacity-cell-btn:hover { background: var(--surface-1); border-color: var(--accent); }
.capacity-cell-radio:focus + .capacity-cell-btn {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
/* Selected (radio is :checked): strong burgundy border + inset highlight */
.capacity-cell-radio:checked + .capacity-cell-btn {
  border-color: var(--accent); border-width: 2px; padding: 7px 5px;
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.scheduling-pick-actions {
  margin-top: 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.scheduling-strip-nav {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 8px 0 12px;
}
.scheduling-strip-window-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  flex: 1 1 auto;
  text-align: center;
}
.btn-disabled {
  opacity: 0.4; cursor: not-allowed;
  pointer-events: none;
}
.btn-link-quiet {
  background: transparent; border: 1px dashed var(--line);
  color: var(--ink-2);
}

/* Contract download links — these are real actions (grab the .docx),
   not just inline hints. Promote them from muted .btn-link text to a
   clearly clickable pill so the studio can find the file from the
   Generated contracts table at a glance. */
.contract-download,
.contract-executed-download {
  display: inline-block;
  padding: 3px 10px;
  margin-left: 6px;
  background: var(--accent);
  color: var(--ink-0);
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.6;
}
.contract-download:hover,
.contract-executed-download:hover {
  background: var(--accent-bright, var(--accent));
  color: var(--ink-0);
  text-decoration: none;
}

/* Contracts stage — inline contract-field editor */
.contract-fill-summary {
  margin: 12px 0;
  padding: 12px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.contract-fill-missing-note { margin: 8px 0 0; }
.contract-field-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 2fr) auto;
  gap: 6px 12px;
  align-items: center;
  margin: 12px 0;
}
.contract-field-row {
  display: contents;
}
.contract-field-label {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.04em; color: var(--ink-2);
}
.contract-field-edit input {
  width: 100%;
  padding: 5px 8px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  color: var(--ink-0);
  font: inherit;
}
.contract-field-edit input:focus {
  outline: 2px solid var(--accent); outline-offset: -1px;
}
.contract-field-row-missing .contract-field-edit input {
  border-color: #b07a3a;
}
.contract-field-marker {
  font-family: var(--mono); font-size: 11px;
  color: #b07a3a; white-space: nowrap;
}
.contract-field-marker-ok { color: #4a8a4a; }
.contract-field-marker-optional {
  color: var(--ink-3);
  font-style: italic;
}
.contract-field-row-optional { opacity: 0.75; }
.contract-generate-form {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px;
}
.scheduling-booking-month-empty {
  padding: 6px 8px;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 2px;
  display: flex; align-items: baseline; gap: 8px;
}
.capacity-cell-month {
  font-weight: 600; font-size: 13px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.capacity-cell-numbers,
.capacity-cell-add {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
}
.capacity-cell-add { color: var(--ink-1); }
.capacity-cell-status {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 2px;
}
.capacity-cell-over .capacity-cell-btn {
  border-color: #b07a3a; border-style: dashed;
}
.capacity-cell-over .capacity-cell-status { color: #b07a3a; }
.capacity-cell-over .capacity-cell-add { color: #b07a3a; font-weight: 600; }

.scheduling-date-list { list-style: none; padding: 0; margin: 0; }
.scheduling-date-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--line);
}
.scheduling-date-row:last-child { border-bottom: 0; }
.scheduling-date-label {
  flex: 0 0 140px;
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2);
}
.scheduling-clear-form { margin-top: 12px; }
.btn-small { font-size: 12px; padding: 4px 10px; }

.capacity-cell-booked-count {
  font-size: 10px; margin-top: 4px;
  border-top: 1px dotted var(--line); padding-top: 4px;
}
.scheduling-bookings { margin-top: 12px; }
.scheduling-booking-months { list-style: none; padding: 0; margin: 0; }
.scheduling-booking-month { margin: 6px 0; }
.scheduling-booking-month summary {
  cursor: pointer; padding: 6px 8px;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 2px;
}
.scheduling-booking-month summary:hover { background: var(--surface-2, var(--surface-1)); }
.scheduling-booking-month-label {
  font-weight: 600; margin-right: 8px;
}
.scheduling-booked-list {
  list-style: none; padding: 8px 12px; margin: 0;
  border-left: 2px solid var(--line); margin-left: 8px;
}
.scheduling-booked-book { padding: 4px 0; }
.scheduling-booked-title { font-weight: 600; }
.scheduling-booked-window {
  display: block; margin-top: 2px;
  font-family: var(--mono); font-size: 11px;
}
.scheduling-booked-empty {
  padding: 8px 12px; margin: 0;
  border-left: 2px solid var(--line); margin-left: 8px;
  font-style: italic;
}
.btn-primary-action {
  background: var(--accent);
  color: var(--ink-0);
  border: 1px solid var(--accent);
  font-weight: 600;
  padding: 9px 18px;
  display: inline-block;
}
.btn-primary-action:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}
.right-now-template-alts {
  margin-top: 8px;
}
.right-now-template-alts summary {
  font-family: var(--body);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}
.right-now-template-list {
  list-style: none;
  padding: 6px 0 0;
  margin: 0;
}
.right-now-template-list li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}
.right-now-no-template {
  margin-bottom: 16px;
}
.right-now-activities {
  margin-bottom: 16px;
}
.right-now-activities-label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.right-now-activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.right-now-activity-list li {
  position: relative;
  padding: 5px 0 5px 18px;
  font-size: 13px;
  color: var(--ink-1);
  line-height: 1.45;
  border-bottom: 1px dashed var(--line-soft);
}
.right-now-activity-list li:last-child { border-bottom: 0; }
.right-now-activity-list li::before {
  content: "·";
  position: absolute;
  left: 6px;
  top: 5px;
  color: var(--accent);
  font-weight: 700;
}
.right-now-history {
  margin-bottom: 14px;
}
.right-now-history > summary {
  font-family: var(--body);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  padding: 6px 0;
}
.right-now-foot {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

/* ----------------------------------------------------------------
   FAMILY A — COMMS VIEW (templates + threads + context)
   ---------------------------------------------------------------- */

/* Two columns since the embedded message history was cut (2026-08): the
   Suggested-templates picker and the Context sidebar. */
.comms-grid {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(220px, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}
/* Releases finished-resting lane drops the Suggested-templates column (no
   actionable comms), leaving Context on its own. */
.comms-grid-resting {
  grid-template-columns: minmax(220px, 1fr);
}
.comms-section-h {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 500;
}

.comms-template-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comms-template-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.comms-template-card:hover {
  border-color: var(--accent);
}
.comms-template-name {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-0);
  border: 0;
}
.comms-template-name:hover {
  color: var(--accent-bright);
  border: 0;
}
.comms-template-subject {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-2);
  font-style: italic;
  font-family: var(--serif);
}
.comms-compose-cta {
  margin-top: 14px;
  margin-bottom: 0;
}

.comms-message-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comms-message {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 10px 14px;
}
.comms-message-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.comms-message-to {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}
.comms-message-subject {
  margin: 4px 0;
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 15px;
  color: var(--ink-0);
}
/* `.comms-message-body-wrap` rules deleted (2026-08): the comms-history
   <details> block was their only consumer. The sibling `.comms-message*`
   rules above stay — the Intake wizard's drawer still renders that markup. */

.comms-context-list {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 13px;
}
.comms-context-list dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  align-self: center;
}
.comms-context-list dd {
  margin: 0;
  color: var(--ink-1);
}

@media (max-width: 1080px) {
  .comms-grid { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------
   FAMILY C — DELIVERY VIEW (handoff checklist)
   ---------------------------------------------------------------- */

.delivery-activities {
  margin: 0 0 28px;
}
.delivery-mark-form button.btn-advance {
  background: var(--accent);
  color: var(--ink-0);
  border-color: var(--accent);
  padding: 10px 22px;
  font-size: 12px;
}
.delivery-mark-form button.btn-advance:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

.delivery-template-pick { margin-bottom: 18px; }

/* ----------------------------------------------------------------
   STAGE WORKFLOW — generic fallback
   ---------------------------------------------------------------- */
.stage-workflow-generic { /* inherits default stage-form + checklist */ }

/* ---- legibility on small screens ------------------------------- */

@media (max-width: 880px) {
  .home-header { flex-direction: column; align-items: flex-start; }
  .active-project-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .active-project-owner { text-align: left; }
  .stage-strip { overflow-x: auto; }
  .stage-strip-badge { flex: 0 0 auto; }
}

/* ----------------------------------------------------------------
   TIMELINE — 3-level calendar-quarter drill-down (V11).

   Year (4 quarter cards) -> Quarter (3 month cards) -> Month (day
   grid). The two-bar bucket card is the core component: a Load track
   (outlined, neutral fill, amber overflow) and a Progress bar (solid
   mint). Extends the existing palette tokens; no new colors.
   ---------------------------------------------------------------- */

.tl-header { align-items: flex-start; }
.tl-header-meta {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-weight: 400;
  color: var(--ink-2);
  font-size: 0.65em;
  margin-left: 8px;
}
.tl-header-stats { margin-top: 6px; }

/* ---- visually-hidden text equivalent ----------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- breadcrumb -------------------------------------------------- */
.tl-breadcrumb {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tl-crumb-sep { color: var(--ink-3); }
.tl-crumb-up {
  color: var(--ink-2);
  border-bottom: 1px solid transparent;
}
.tl-crumb-up:hover { color: var(--accent-bright); border-bottom-color: var(--accent); }
.tl-crumb-here { color: var(--accent); font-weight: 600; }
.tl-crumb-inert { color: var(--ink-3); }

.tl-archived-badge {
  display: inline-block;
  margin-left: 12px;
  padding: 2px 9px;
  background: var(--surface-3);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  vertical-align: middle;
}

.tl-actions {
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.tl-aux-link {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.tl-aux-link:hover { color: var(--accent-bright); }

.tl-quarter-picker, .tl-year-picker {
  display: flex; gap: 8px; align-items: center;
}

/* Year stepper: prev/next arrows flanking the year picker so forward
   navigation into future years is always one click away. */
.tl-year-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tl-year-nav a { color: var(--ink-2); }
.tl-year-nav a:hover { color: var(--accent-bright); }
.tl-year-nav-disabled { color: var(--ink-3); opacity: 0.4; cursor: default; }

/* ---- bucket card grid (year = 4, quarter = 3) -------------------- */

.tl-bucket-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}
.tl-bucket-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tl-bucket-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .tl-bucket-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tl-bucket-grid-4,
  .tl-bucket-grid-3 { grid-template-columns: 1fr; }
}

/* ---- the two-bar bucket card ------------------------------------- */

.tl-bucket-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 16px 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: inset 0 -3px 0 var(--line);
  color: var(--ink-1);
  text-decoration: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.tl-bucket-card:hover {
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}
.tl-bucket-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tl-bucket-current {
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent),
              inset 0 0 0 1px var(--accent-soft);
}
.tl-bucket-closed {
  opacity: 0.6;
  background: transparent;
}
/* Closed (past) month view — muted, read-only. Mirrors the quarter
   view's ARCHIVED treatment and the .tl-bucket-closed card style. */
.tl-month-closed { opacity: 0.62; }
.tl-bucket-over { border-color: var(--danger); }
.tl-bucket-over:hover { border-color: var(--danger); box-shadow: inset 0 -3px 0 var(--danger); }
/* Muted (#7): a near-empty bucket recedes so active buckets pop. Lighter
   than .tl-bucket-closed (which marks the PAST); a muted card is just a
   quiet/empty future or present bucket. Hover restores full presence so
   it's still clearly clickable. A muted card that is ALSO closed keeps the
   closed treatment (closed is stronger). */
.tl-bucket-muted:not(.tl-bucket-closed):not(.tl-bucket-current) {
  opacity: 0.66;
  background: transparent;
  box-shadow: inset 0 -3px 0 var(--line-soft);
}
.tl-bucket-muted:not(.tl-bucket-closed):hover { opacity: 1; }

.tl-bucket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.tl-bucket-title { display: flex; flex-direction: column; gap: 1px; }
.tl-bucket-name {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 22px;
  color: var(--ink-0);
  line-height: 1.1;
}
.tl-bucket-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tl-bucket-foot {
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.tl-bucket-foot .meta { font-size: 12px; }
/* #6: the span-weighted "active book-months" figure, shown only when it
   differs from the distinct headline; quieter than the headline. */
.tl-bucket-foot-span { font-size: 10.5px; opacity: .72; font-style: italic; }

/* ---- tags (CURRENT / CLOSED / peak) ------------------------------ */

.tl-tag {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tl-tag-current {
  color: var(--ink-0);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.tl-tag-closed {
  color: var(--ink-3);
  background: transparent;
  border-style: dashed;
}
.tl-peak-tag {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---- the two bars ------------------------------------------------ */

.tl-bars { display: flex; flex-direction: column; gap: 12px; }
.tl-bar-block { display: flex; flex-direction: column; gap: 4px; }
.tl-bar-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.tl-bar-name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
/* #8: the "(est.)" qualifier on the Progress label — quieter than the
   label, with a help cursor so the tooltip is discoverable. */
.tl-bar-est {
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  font-size: 10px;
  cursor: help;
}
.tl-bar-stat {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-0);
}
.tl-bar-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.tl-warn { color: var(--danger); margin-right: 2px; }

/* LOAD — an OUTLINED track filled toward a ceiling. Neutral ink
   fill; the segment past 100% is amber (over-capacity). */
.tl-load-bar {
  display: flex;
  height: 12px;
  border: 1px solid var(--line);
  background: var(--surface-0);
  overflow: hidden;
}
.tl-load-fill {
  height: 100%;
  background: var(--ink-3);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0, transparent 3px,
    rgba(var(--surface-0-rgb), 0.35) 3px,
    rgba(var(--surface-0-rgb), 0.35) 6px
  );
}
.tl-load-overflow {
  height: 100%;
  background: var(--danger);
}
.tl-load-bar-over { border-color: var(--danger); }

/* ---- per-narrator Load gauges (T3) ------------------------------
   Bridget and Jake have SEPARATE monthly capacity but mostly share the
   same books, so the single combined Load target (~672k by default) is
   split into one gauge per principal — mirroring the Capacity dashboard. Bridget tints
   magenta (--accent), Jake rose (--gold), matching the calendar. */
.tl-bar-block-narrators { gap: 8px; }
.tl-narr-gauges {
  display: grid;
  /* Two-up where there's room (month header, quarter cards); folds to
     one column automatically in the narrower 4-up year cards so the
     persona name + booked/cap line never get crushed. */
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px 12px;
}
.tl-narr-gauge { display: flex; flex-direction: column; gap: 4px; }
.tl-narr-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.tl-narr-name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-1);
}
.tl-narr-stat {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-0);
}
.tl-narr-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.tl-narr-over-tag { color: var(--danger); }
/* Tint each narrator's fill, overriding the neutral default. The
   hatch overlay stays for texture; the base colour carries the persona. */
.tl-narr-bridget .tl-load-fill { background-color: var(--accent); }
.tl-narr-jake .tl-load-fill { background-color: var(--gold); }
/* An over-capacity gauge keeps the amber overflow segment but the
   percent + name read in the danger hue so it can't be missed. */
.tl-narr-over .tl-narr-name,
.tl-narr-over .tl-narr-stat { color: var(--danger); }

/* PROGRESS — a SOLID mint bar completing a job; never over 100%. */
.tl-progress-bar {
  height: 12px;
  background: var(--surface-0);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.tl-progress-fill {
  height: 100%;
  background: var(--good);
}

/* ---- month two-bar block ----------------------------------------- */

.tl-month-bars {
  margin-bottom: 18px;
  padding: 16px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  max-width: 520px;
}

/* ---- month grid (7 × N) ------------------------------------------ */

.tl-month-nav {
  display: flex;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tl-month-nav a { color: var(--ink-2); }
.tl-month-nav a:hover { color: var(--accent-bright); }

.tl-month-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 18px;
}
.tl-month-grid-wrap { min-width: 0; }

table.tl-month-grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-1);
  table-layout: fixed;
}
table.tl-month-grid th {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  font-weight: 500;
}
.tl-day {
  vertical-align: top;
  padding: 6px 6px 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-0);
  min-height: 90px;
  width: 14.28%;
  height: 90px;
}
.tl-day-blank {
  background: var(--surface-1);
  border-color: var(--line-soft);
}
.tl-day-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.tl-day-has-events .tl-day-num { color: var(--ink-1); font-weight: 600; }
.tl-day-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tl-day-ev {
  font-size: 13px;
  line-height: 1.25;
}
.tl-day-ev a {
  display: flex;
  gap: 4px;
  align-items: baseline;
  padding: 2px 4px;
  background: var(--surface-1);
  border-left: 2px solid var(--ink-3);
  color: var(--ink-1);
  text-decoration: none;
  border-bottom: 0;
}
.tl-day-ev a:hover { background: var(--surface-2); border-bottom: 0; }
.tl-day-ev-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: 0 0 auto;
}
.tl-day-ev-title {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-day-ev-first_fifteen_start_date a { border-left-color: var(--good); }
.tl-day-ev-recording_due_date a { border-left-color: var(--accent); }
.tl-day-ev-pickup_deadline a { border-left-color: var(--danger); }
.tl-day-ev-delivery_due_date a {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.tl-day-today {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.tl-day-more {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* ---- BVO spans above the month grid ----------------------------- */

.tl-bvo-spans { margin-bottom: 12px; }
.tl-bvo-spans-label { margin-bottom: 4px; }
.tl-bvo-spans-track {
  position: relative;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tl-bvo-span {
  position: relative;
  min-height: 26px;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--danger) 22%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  border-left: 3px solid var(--danger);
  border-radius: 3px;
  color: var(--ink-0);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  white-space: nowrap;
  /* The bar is positioned by date-range via inline left/right margins, so a
     short BVO run makes a narrow bar. Let the LABEL overflow it (visible)
     rather than clip to a single unreadable letter. */
  overflow: visible;
  margin: 0;
}
.tl-bvo-span-label { color: var(--ink-0); }

/* ---- month sidebar ----------------------------------------------- */

.tl-month-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tl-side-section {
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: 12px;
}
.tl-side-section h3 {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--ink-1);
}
.tl-side-subhead {
  margin: 12px 0 5px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.tl-side-subhead:first-of-type { margin-top: 4px; }
.tl-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tl-side-item {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.tl-side-item:last-child { border-bottom: 0; }
.tl-side-title { color: var(--ink-1); }
/* Editable CalendarSlot list in the Timeline month sidebar — stacks
   the `_calendar_slot.html` partials (the partial's own `.cal-slot`
   grid handles each row's internal layout). */
.tl-slot-list { display: flex; flex-direction: column; gap: 6px; }
.tl-slot-add { margin-top: 8px; }
.tl-side-prefix {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--good);
}

@media (max-width: 1000px) {
  .tl-month-layout { grid-template-columns: 1fr; }
}

/* ---- V9: Contracts stage --------------------------------------- */
.contracts-stage { margin-top: 18px; }
.contract-block {
  margin-bottom: 22px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-left: 2px solid var(--line);
}
.contract-block h4 {
  margin: 0 0 6px;
  font-size: 15px;
}
.contract-warning {
  background: var(--surface-1);
  border-left: 2px solid var(--danger);
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 14px;
}
.contract-warning strong { color: var(--danger); }
.contract-missing-list { margin: 6px 0 4px 18px; }
.contract-missing-flag { color: var(--danger); font-size: 13px; }
.contract-complete { color: var(--ink-2); font-size: 14px; }
/* Narrator cards (Contracts stage). The 10 free-form fields per
   narrator do not fit a table at studio screen widths — each row
   becomes a card, with the narrator's name in the header and a
   labeled-grid of inputs below. See _project_narrator_row.html and
   docs/redesign-contracts.md §2.3. */
.narrator-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}
.narrator-card {
  background: var(--surface-1);
  border: 1px solid var(--border, var(--surface-2));
  border-radius: 4px;
  padding: 12px 14px;
}
.narrator-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.narrator-card-name {
  margin: 0;
  margin-right: auto;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-1);
}
.narrator-card-status {
  /* Inherits .contract-status mono uppercase styling; the per-status
     color (generated / sent / signed) comes from .contract-status-*. */
  font-size: 11px;
}
.narrator-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 12px;
  margin-bottom: 10px;
}
.narrator-card-field { display: block; }
.narrator-card-label {
  display: block;
  font-size: 11px;
  color: var(--ink-2);
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}
.narrator-card-field input[type="text"] { width: 100%; }
.narrator-card-actions {
  display: flex;
  justify-content: flex-end;
}
.narrator-empty {
  padding: 8px 0;
  font-style: italic;
}
.narrator-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.narrator-add-field span {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 2px;
}
.contract-status {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
/* Allowed-types hint on the countersigned-file uploader. Sits inline
   with the bare file input so a studio user knows what extensions
   the route accepts before they click. Dimmed mono to match the
   surrounding .meta tone; no visual weight competition with the
   upload button. */
.contract-executed-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3, var(--ink-2));
  margin-left: 6px;
  letter-spacing: 0.04em;
}
/* Narrator email under the name in the contracts log "For" column.
   Surfaces the e-sign destination so the studio can copy it without
   re-opening the narrator card. Dimmed mono per the established
   meta-row tone. */
.contract-for-email {
  font-size: 11px;
  font-family: var(--mono);
  margin-top: 2px;
}
.contract-status-generated { color: var(--ink-2); }
.contract-status-sent { color: var(--accent); }
.contract-status-signed { color: var(--ok, #3a7d44); }
.btn-small { font-size: 12px; padding: 3px 8px; }

/* ---- V17: public author-intake form ------------------------------ */
/* Standalone author-facing page — no internal nav. Reuses the .card,
   .field and .btn primitives; these classes only add layout + the few
   public-page-specific touches (lede, hints, inline field errors). */
.public-page { padding-top: 32px; }
.intake-public { max-width: 640px; }
.intake-card { padding: 28px 32px; }
.intake-head h1 { margin: 12px 0 6px; }
.intake-lede { color: var(--ink-2); line-height: 1.5; }
.intake-note {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin: 12px 0;
}
.intake-form .field { margin-bottom: 18px; }
.field-hint { display: block; font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.field-error select,
.field-error input,
.field-error textarea { border-color: var(--accent-bright); }
.field-error-msg { display: block; font-size: 12px; color: var(--accent-bright); margin-top: 3px; }
.intake-foot { text-align: center; margin-top: 16px; }
.intake-thanks { text-align: center; }

/* ---- Item 16: full public Interest Form ------------------------- */
/* Inline yes/no(/maybe) radio choices and the side-by-side per-narrator
   % split. Built on the same .field primitive the rest of the form uses;
   these classes only add layout. */
.intake-form fieldset.field {
  border: none;
  margin: 0 0 18px;
  padding: 0;
}
.intake-form fieldset.field > .label { display: block; }
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}
.choice-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.choice-row input[type=radio] { width: auto; }
.field-split {
  display: flex;
  gap: 16px;
}
.field-split .field-split-col { flex: 1 1 0; }
.field-split .field-split-col input { width: 100%; }

/* Read-only "Narration Styles Offered" descriptions block — sits above
   the style question on the public Interest Form. Quiet, reference-style
   copy: tighter line height, the term in bold, no input affordances. */
.intake-form .styles-block {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: 6px;
}
.intake-form .styles-block-head {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.intake-form .styles-block p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
}
.intake-form .styles-block p:last-child { margin-bottom: 0; }

/* Inquiry Response stage panel — form link + submission status. */
.intake-form-panel { margin-top: 14px; }
.intake-form-status-received { color: var(--ok, #3a7d44); }
.intake-form-status-waiting { color: var(--ink-2); }
.intake-submission-detail { margin: 8px 0; }
.intake-submission-detail dt { font-weight: 600; font-size: 12px; color: var(--ink-2); }
.intake-submission-detail dd { margin: 0 0 6px; }
.intake-form-link { word-break: break-all; }

/* ---- Part 2: collapsed Production stage ------------------------- */

/* Four-segment distribution bar — the honest book-level status when
   there is no single true production stage. */
.prod-dist {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 10px;
  flex: 1 1 320px;
  min-width: 260px;
}
.prod-dist-seg { display: flex; flex-direction: column; gap: 4px; }
.prod-dist-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.prod-dist-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 180ms ease;
}
.prod-dist-label {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.78rem;
}
.prod-dist-name { color: var(--ink-1); font-weight: 600; }
.prod-dist-count { color: var(--ink-3); font-variant-numeric: tabular-nums; }

.prod-mostly-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.8rem;
  white-space: nowrap;
}
.prod-mostly-chip strong { color: var(--accent-bright); }

/* Gated advance button — present but secondary, opens the confirm
   modal instead of advancing. The base `.btn:hover` selector resets
   `border: 0` (shorthand also wipes width); restate the dashed
   border on hover so the button doesn't visually shrink 2px in each
   dimension when hovered. Same transform-scale polish as the sibling
   stage-move buttons. */
.btn-advance-gated {
  background: var(--surface-2);
  color: var(--ink-1);
  border: 1px dashed var(--accent);
  transform-origin: center;
  transition: background 120ms ease, color 120ms ease,
              transform 120ms ease;
}
.btn-advance-gated:hover {
  background: var(--accent-soft);
  color: var(--ink-0);
  border: 1px dashed var(--accent);
  transform: scale(1.04);
}

/* Chapter-board row filter. */
.prod-filter { display: flex; align-items: center; gap: 6px; }
.prod-filter-label { color: var(--ink-3); font-size: 0.82rem; }
.prod-filter select {
  background: var(--surface-2);
  color: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 0.82rem;
}
.prod-filter-empty { text-align: center; padding: 18px 8px; }

/* First-unfinished-step "next here" row marker — replaces the old
   single-stage active-column ring. */
.prod-next-marker {
  color: var(--accent);
  font-weight: 700;
  margin-right: 3px;
}

/* Four-section Production checklist drawer. */
.prod-checklist-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.prod-checklist-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface-1);
}
.prod-checklist-section-head {
  margin: 0 0 6px;
  font-size: 0.86rem;
  color: var(--accent-bright);
}
.prod-checklist-section-items {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.prod-checklist-section-items li { margin: 2px 0; }
.prod-checklist-note { margin-top: 10px; }

/* Forced-advance confirm modal. */
.prod-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(var(--surface-0-rgb), 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.prod-modal {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  max-width: 520px;
  width: calc(100% - 48px);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.prod-modal-title { margin: 0 0 10px; font-size: 1.05rem; color: var(--ink-0); }
.prod-modal-body { color: var(--ink-1); font-size: 0.9rem; line-height: 1.5; }
.prod-modal-chapter-list {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-0);
  padding: 8px 12px;
}
.prod-modal-chapter-head { margin: 0 0 4px; }
.prod-modal-chapter-list ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.84rem;
  color: var(--ink-1);
}
.prod-modal-chapter-num { font-weight: 600; }
.prod-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.prod-modal-audit-note { margin-top: 10px; text-align: right; }

/* ---- V23 integrations page flash banners ----------------------- */

/* A one-shot status message rendered above the connection list.
   Success uses the mint-green `--good` palette so a positive state
   reads as positive (the brand magenta on a dark surface reads as
   red-pink and was being misread as an error). Error stays amber. */
.flash-success {
  background: var(--good-soft);
  border: 1px solid var(--good);
}
.flash-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
}
.flash-success p,
.flash-error p { margin: 0; }

/* Generic top-of-page flash stack (Flask `flash()` -> base.html).
   The integrations page uses `.flash-success` / `.flash-error` as
   `.card` modifiers; the global stack also needs padding so a
   standalone flash banner is readable without inheriting `.card`. */
.flash-stack {
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flash {
  padding: 12px 16px;
  border-radius: 2px;
  font-family: var(--body);
}
.flash p { margin: 0; }
.flash-warning {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
}
.flash-info {
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ---- LLM annotation ingest (pass-2 preview + landing) ---------- */

.annotation-picker code,
.annotation-preview-meta code,
.annotation-orphan-list code {
  font-size: 12px;
  color: var(--ink-1);
}

.annotation-preview-meta th {
  text-align: left;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  vertical-align: top;
  width: 220px;
}

.annotation-warn {
  color: var(--danger);
}

.annotation-row-change td {
  background: var(--danger-soft);
}

.annotation-row-orphan td {
  color: var(--ink-2);
  font-style: italic;
}

.annotation-cell-summary {
  max-width: 380px;
  white-space: normal;
  line-height: 1.45;
}

.annotation-new-character-table .annotation-checkbox-col {
  width: 70px;
  text-align: center;
}

.annotation-new-character-table label {
  cursor: pointer;
}

.annotation-mapped-list,
.annotation-orphan-list {
  margin: 8px 0 0;
  padding-left: 20px;
  columns: 3;
  column-gap: 24px;
}

.annotation-mapped-list li,
.annotation-orphan-list li {
  break-inside: avoid;
  margin: 2px 0;
}

.annotation-apply-card {
  background: var(--surface-2);
  border: 1px solid var(--accent);
}

.annotation-apply-blurb {
  margin: 0 0 14px;
}

.annotation-apply-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.annotation-cancel-link {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.annotation-cancel-link:hover { color: var(--accent-bright); }

.annotation-path-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.annotation-path-form input[type=text] {
  min-width: 420px;
}

/* Ticket #29: zipped parsed-folder upload card. Sits between the
   picker and the Advanced disclosure; same .card styling as the
   picker, with a tighter form-row layout matched to the existing
   path-form so the two affordances feel like siblings. */
.annotation-upload-card {
  margin-bottom: 18px;
}
.annotation-upload-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.annotation-upload-form input[type=file] {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-1);
}

/* Item 1: latest-folder badge in the landing picker. Reuses the
   accent-bright token so the brand pop is recognisable; no new
   color introduced. */
.annotation-latest-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  border: 1px solid var(--accent);
  border-radius: 999px;
}

/* Item 2: per-row help text under a disabled Preview button. */
.annotation-help-text {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-3);
  font-style: italic;
}

/* Item 4: collapsed Advanced disclosure for the type-a-path card. */
.annotation-advanced {
  margin-bottom: 18px;
}
.annotation-advanced > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 10px 0;
}
.annotation-advanced > summary::-webkit-details-marker { display: none; }
.annotation-advanced > summary::before {
  content: "▸  ";
  color: var(--ink-3);
}
.annotation-advanced[open] > summary::before {
  content: "▾  ";
  color: var(--accent);
}
.annotation-advanced > summary:hover { color: var(--ink-0); }
.annotation-advanced-card { margin-top: 6px; }

/* Item 5: top-of-page banner used for validation warnings on the
   preview page (and reusable elsewhere). Distinct from .card so it
   reads as alarm-state, distinct from .flash-* so it's a persistent
   page-state banner rather than a one-shot session flash. */
.banner {
  padding: 14px 18px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--ink-1);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
}
.banner strong {
  color: var(--ink-0);
  font-weight: 600;
}
.banner-danger {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--ink-0);
}
.banner-danger strong { color: var(--danger); }

/* Item 6: technical "What gets deleted" details block inside the
   apply card. Sits below the human-voice blurb. */
.annotation-apply-detail {
  margin-top: 8px;
}
.annotation-apply-detail > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 4px 0;
}
.annotation-apply-detail > summary::-webkit-details-marker { display: none; }
.annotation-apply-detail > summary::before {
  content: "▸  ";
  color: var(--ink-3);
}
.annotation-apply-detail[open] > summary::before {
  content: "▾  ";
  color: var(--accent);
}
.annotation-apply-detail > summary:hover { color: var(--ink-1); }
.annotation-apply-detail p {
  margin: 6px 0 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* Item 7: sticky bottom action bar on the preview page. Single
   primary action (Apply) + a quiet Cancel link. Pinned to the
   viewport so the operator never has to scroll to the bottom of a
   long diff to commit / abandon. */
.annotation-sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface-1);
  border-top: 1px solid var(--line);
  padding: 14px var(--pad);
  margin: 18px calc(var(--pad) * -1) 0;
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 10;
}

/* Project-detail Overview card: Manuscript upload.

   Replaced the LLM Annotation summary card (its styles went with it).
   The file input is `.visually-hidden` — clipped, NOT display:none — so
   it keeps its place in the tab order; the <label> beside it carries the
   button styling. Because the input itself is invisible, its focus ring
   would be too, so paint one on the label when the input has focus. */
.ms-upload-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ms-upload-btn { cursor: pointer; }
.ms-upload-input:focus-visible + .ms-upload-btn {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}
.ms-upload-hint { margin: 0; }

/* htmx's stock indicator styling is opacity-based, so the hidden
   "Uploading…" span would still hold a slot (+ the flex gap) at rest.
   htmx adds `htmx-request` to the indicator element while the POST is
   in flight; collapse it otherwise. */
.ms-upload-indicator { display: none; }
.ms-upload-indicator.htmx-request { display: inline; }

/* Chosen-file readout, between the "Upload Manuscript" picker label and
   the submit button. Both cases (fresh book / re-analysis) render the
   same three-element row; only the submit's label and weight differ. */
.ms-upload-filename {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  max-width: 26ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-upload-error { color: var(--danger); }

/* `[hidden]` is a UA rule (`display:none`) and loses to ANY class rule
   that sets `display` — `.btn` is `display:inline-block`, so the submit
   button would stay visible with the attribute set. Restate it. */
.ms-upload-go[hidden],
.ms-upload-error[hidden] { display: none !important; }

/* In-flight: the label is the only mouse target for the file input, so
   neutralise it while the POST is running (the input itself is
   `disabled` by the card's script, which covers the keyboard path). */
.ms-upload-btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

/* ============================================================
   PASS-3: LLM annotation read-only view surfaces
   (chapter Lines view, Voice bible, Annotation runs index)
   Palette stays on midnight-navy + cream + magenta accent.
   ============================================================ */

/* --- shared filter-chip row (lines view + voice bible) ---------- */

.ch-lines-filters,
.voice-bible-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--surface-1);
  text-decoration: none;
}
.filter-chip:hover {
  border-color: var(--accent);
  color: var(--ink-1);
}
.filter-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink-0);
}
/* A11y blocker fix: keyboard users need a visible focus indicator
   on the primary nav chips on every annotation surface, and on the
   prev/next chevrons in the chapter Lines header. The global `a`
   :focus-visible at the top of this file paints an outline, but
   .filter-chip carries a 1px border that visually competes; lift the
   outline width + offset so it sits cleanly outside the pill. */
.filter-chip:focus-visible,
a.btn-link:focus-visible,
.btn-link:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

/* --- chapter Lines view ----------------------------------------- */

.ch-lines-title {
  margin-bottom: 4px;
}
.ch-lines-title .meta {
  font-size: 14px;
  font-weight: 400;
  font-family: var(--mono);
  margin-left: 12px;
}
.ch-lines-meta {
  margin: 0 0 8px;
}
.ch-lines-summary {
  font-style: italic;
  color: var(--ink-1);
  max-width: 720px;
  line-height: 1.5;
  margin: 6px 0 0;
}

.ch-lines-table {
  font-size: 13px;
}
.ch-lines-table th {
  white-space: nowrap;
}
.ch-lines-table .ch-lines-ordinal {
  color: var(--ink-3);
  font-family: var(--mono);
  width: 48px;
}
.ch-lines-table .ch-lines-quote {
  max-width: 360px;
  line-height: 1.5;
}
.ch-lines-quote-text {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  color: var(--ink-0);
}
.ch-lines-state,
.ch-lines-delivery,
.ch-lines-note,
.ch-lines-evidence {
  max-width: 220px;
  line-height: 1.45;
  vertical-align: top;
}
.ch-lines-bullets {
  margin: 0;
  padding-left: 16px;
}
.ch-lines-bullets li {
  margin: 1px 0;
}
.ch-lines-evidence-body {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 4px 0 0;
}

/* Item 10: compact-mode Direction cell. Each of State / Delivery /
   Note / Evidence renders as a small inline-block <details> "chip"
   that the user expands on demand. Chips wrap so the cell never
   stretches the table. */
.ch-lines-direction {
  max-width: 320px;
  vertical-align: top;
}
.ch-lines-direction .ch-lines-detail-chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  vertical-align: top;
  max-width: 100%;
}
.ch-lines-direction .ch-lines-detail-chip > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--surface-2);
}
.ch-lines-direction .ch-lines-detail-chip > summary::-webkit-details-marker {
  display: none;
}
.ch-lines-direction .ch-lines-detail-chip > summary:hover {
  border-color: var(--accent);
  color: var(--ink-0);
}
.ch-lines-direction .ch-lines-detail-chip[open] > summary {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink-0);
}
.ch-lines-direction .ch-lines-detail-chip[open] {
  display: block;
}
.ch-lines-direction .ch-lines-detail-chip ul,
.ch-lines-direction .ch-lines-detail-chip p {
  margin-top: 6px;
  font-size: 12px;
}
.ch-lines-speaker-link {
  color: var(--ink-1);
  border-bottom: 1px dotted var(--accent);
  text-decoration: none;
}
.ch-lines-speaker-link:hover {
  color: var(--accent-bright);
}
.ch-lines-speaker-unmatched {
  color: var(--ink-2);
  font-style: italic;
}

/* Confidence chips. High = mint, medium = rose, low = amber.
   Background tints stay subtle so the row stays scannable. */
.conf-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface-1);
}
.conf-chip-high {
  color: var(--good);
  background: var(--good-soft);
  border-color: var(--good);
}
.conf-chip-medium {
  color: var(--gold);
  background: var(--gold-soft);
  border-color: var(--gold);
}
.conf-chip-low {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger);
}

/* Item 9: row-level confidence indicator. The .ch-lines-row-low /
   .ch-lines-row-medium classes were previously declared but unused;
   apply a 2px left border in the matching color so scanning a long
   table reveals low-confidence rows at a glance without relying on
   the chip alone (color-blind users still get the chip text). High-
   confidence rows get no border (default = trustworthy). */
.ch-lines-row-low > td:first-child {
  border-left: 2px solid var(--danger);
}
.ch-lines-row-medium > td:first-child {
  border-left: 2px solid var(--gold);
}
.ch-lines-row-high > td:first-child {
  border-left: 2px solid transparent;
}

/* Ticket #28: inline-edit on Lines view.
   - `edited` badge marks a row whose attribution / direction the
     studio has overridden. Subtle: kept compact + secondary so the
     primary cell content (quote + speaker) still dominates.
   - The "see LLM original" expander sits inline with the quote so the
     reviewer can reveal the original without leaving the row. */
.ch-lines-row-edited > td:first-child {
  border-left: 2px solid var(--accent-bright);
}
.ch-lines-edited-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-bright);
  background: var(--accent-soft, rgba(232, 79, 156, 0.08));
  border: 1px solid var(--accent-bright);
  border-radius: 3px;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}
.ch-lines-llm-original {
  margin-top: 4px;
  font-size: 12px;
}
.ch-lines-llm-original > summary {
  cursor: pointer;
  color: var(--ink-3);
}
.ch-lines-llm-original-list {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: var(--surface-2, rgba(0, 0, 0, 0.02));
  border-left: 2px solid var(--line);
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 10px;
  row-gap: 2px;
}
.ch-lines-llm-original-list > dt {
  color: var(--ink-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ch-lines-llm-original-list > dd {
  margin: 0;
  color: var(--ink-1);
}
.ch-lines-edit-btn {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: underline dotted;
  cursor: pointer;
}
.ch-lines-edit-btn:hover {
  color: var(--accent-bright);
}
.ch-lines-edit-cell {
  background: var(--surface-2, rgba(0, 0, 0, 0.02));
  padding: 14px 18px;
}
.ch-lines-edit-form .ch-lines-edit-quote {
  margin: 0 0 10px;
  font-size: 13px;
}
.ch-lines-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
}
.ch-lines-edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--ink-3);
}
.ch-lines-edit-grid label > span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}
.ch-lines-edit-grid label.ch-lines-edit-full {
  grid-column: 1 / -1;
}
.ch-lines-edit-grid input,
.ch-lines-edit-grid textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-1);
  color: var(--ink-1);
}
.ch-lines-edit-grid textarea {
  resize: vertical;
}
.ch-lines-edit-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Ticket #31: Accept-LLM-POV button on the Lines view chapter header.
   Inline with the POV line; uses the accent color so it reads as a
   one-click promotion of the LLM's chapter_meta value into the
   studio's parser-canonical `chapter_segments.character`. */
.ch-lines-pov-promote-form {
  display: inline;
  margin-left: 8px;
}
.ch-lines-pov-promote-form > button {
  font-size: 12px;
  padding: 2px 8px;
  background: transparent;
  color: var(--accent-bright);
  border: 1px solid var(--accent-bright);
  border-radius: 3px;
  cursor: pointer;
}
.ch-lines-pov-promote-form > button:hover {
  background: var(--accent-bright);
  color: var(--cream, white);
}

/* Register cues below the dialogue table. Compact list — paragraph,
   register, optional note, collapsed evidence. */
.register-cue-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.register-cue-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}
.register-cue-para {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}
.register-cue-kind {
  color: var(--accent-bright);
  font-weight: 500;
}
.register-cue-note {
  color: var(--ink-1);
}
.register-cue-evidence {
  flex-basis: 100%;
}

/* --- Voice bible card grid -------------------------------------- */

.voice-bible-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.voice-bible-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.voice-bible-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.voice-bible-card-name {
  margin: 0;
  font-size: 18px;
  font-family: 'Fraunces', Georgia, serif;
  color: var(--ink-0);
}
.voice-bible-card-chips {
  display: flex;
  gap: 6px;
}
.kind-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface-2);
}
.kind-chip-major {
  color: var(--accent-bright);
  border-color: var(--accent);
  background: var(--accent-soft);
}
/* Item 11: minor characters get an explicit muted-gray chip rather
   than falling through to .kind-chip's defaults. Distinct from major
   but readable, no surprise color. */
.kind-chip-minor {
  color: var(--ink-2);
  border-color: var(--line);
  background: var(--surface-2);
}

/* Item 11: head-count summary above the filter chips. */
.voice-bible-headcount {
  margin: 0 0 14px;
}

/* Item 12: client-side text search input inside the filter chip row. */
.voice-bible-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.voice-bible-search-label {
  white-space: nowrap;
}
.voice-bible-search input[type=search] {
  font: inherit;
  font-family: var(--body);
  font-size: 13px;
  padding: 4px 10px;
  background: var(--surface-0);
  color: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  width: 180px;
}
.voice-bible-search input[type=search]:focus {
  border-color: var(--accent);
}
.voice-bible-shown {
  margin-left: auto;
}
.line-count-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface-2);
}
.voice-bible-card-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 14px;
  row-gap: 6px;
  margin: 4px 0 0;
}
.voice-bible-card-grid dt {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.voice-bible-card-grid dd {
  margin: 0;
  color: var(--ink-1);
}
.voice-bible-trait-list {
  margin: 0;
  padding-left: 18px;
}
.voice-bible-trait-list li {
  margin: 1px 0;
}
.voice-bible-note {
  margin: 6px 0 0;
  color: var(--ink-1);
  line-height: 1.5;
}
.voice-bible-evidence summary {
  cursor: pointer;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.voice-bible-evidence-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

/* --- Annotation runs index ------------------------------------- */

.annotation-run-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 6px;
  margin: 0;
}
.annotation-run-grid dt {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.annotation-run-grid dd {
  margin: 0;
  color: var(--ink-1);
}
.annotation-run-counts-h {
  margin: 18px 0 8px;
  font-size: 14px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.annotation-run-counts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
}
.annotation-run-counts li {
  color: var(--ink-1);
}
.annotation-run-counts strong {
  color: var(--ink-0);
  font-size: 18px;
  font-family: 'Fraunces', Georgia, serif;
  display: inline-block;
  margin-right: 6px;
}
.annotation-orphan-count strong {
  color: var(--danger);
}
.annotation-run-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}
.annotation-run-delete-card {
  border: 1px solid var(--danger);
}

/* Item 13: "Danger zone" disclosure wrapping the delete card on the
   annotation runs index. Collapsed by default so the destructive
   surface doesn't sit open while the operator is reviewing run
   metadata. */
.annotation-danger-disclosure {
  margin-top: 18px;
}
.annotation-danger-disclosure > summary.danger-disclosure {
  cursor: pointer;
  list-style: none;
  padding: 10px 14px;
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 2px;
}
.annotation-danger-disclosure > summary.danger-disclosure::-webkit-details-marker {
  display: none;
}
.annotation-danger-disclosure > summary.danger-disclosure::before {
  content: "▸  ";
}
.annotation-danger-disclosure[open] > summary.danger-disclosure::before {
  content: "▾  ";
}
.annotation-danger-disclosure[open] > summary.danger-disclosure {
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
}
.annotation-danger-disclosure .annotation-run-delete-card {
  border-top: 0;
  border-radius: 0 0 2px 2px;
  margin-top: 0;
}

/* Item 14: two-step delete confirmation inside the run-delete card.
   Step 1 reveals step 2 in-place via a small JS toggle (cleaner UX
   than confirm() and discoverable on touch / keyboard). */
.annotation-delete-step2 {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--danger);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.annotation-delete-step2-prompt {
  margin: 0;
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-0);
}
.annotation-delete-cancel {
  align-self: flex-start;
}
.btn-danger {
  background: var(--danger);
  color: var(--ink-0);
  border-color: var(--danger);
}
.btn-danger:hover {
  background: var(--accent-bright);
  border-color: var(--accent);
}

/* --- Chapter table: Lines (LLM) column ------------------------- */

.cell-lines-llm-h {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cell-lines-llm {
  white-space: nowrap;
  text-align: center;
}
.lines-llm-link {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  text-decoration: none;
}
.lines-llm-link:hover {
  background: var(--accent-soft);
}
.lines-llm-link.is-empty {
  /* A11y regression fix: opacity 0.55 dropped contrast below WCAG AA
     against the row background. Use --ink-2 (cream-blue secondary)
     against --line border so it still reads as "secondary" but
     remains legible to low-vision users. */
  border-color: var(--line);
  color: var(--ink-2);
}
.lines-llm-link.is-empty:hover {
  background: var(--surface-2);
}
.lines-llm-count {
  margin-left: 4px;
  color: var(--ink-1);
}
.lines-llm-link.is-empty .lines-llm-count {
  color: var(--ink-3);
}

/* --- Ticket #32: Agent-direct card ----------------------------- */

.agent-direct-card {
  /* same baseline as the other annotation-landing cards */
}
.agent-direct-status {
  margin: 8px 0;
}
.agent-direct-status-ok {
  color: var(--accent-bright);
}
.agent-direct-status-disabled {
  color: var(--ink-2);
}
.agent-direct-error-message {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  margin: 12px 0;
}

/* ================================================================
   REDESIGN — shared shell (2026-05 project-workflow redesign)

   Promotes the component language from docs/ux/redesign/shell.css into
   the live stylesheet. The mockups were authored against THIS palette
   (identical tokens), so we reuse the existing surface/ink/accent
   variables and the existing .btn / .card rather than the mockup's
   stand-alone copies — the redesigned surfaces must feel like the same
   product as the topbar above them and every not-yet-redesigned page.

   What's genuinely new and added here:
     - the four per-chapter STEP colours (--rec/--spl/--prf/--crx)
     - project chrome: .bvo-top / .bvo-rail / .bvo-tabs
     - the two "liked" components: the segmented .prog bar and the
       per-chapter .ticktable
     - small shared primitives the stage bodies lean on: .pill, .hint,
       .avatar, .btn.ghost, .btn.sm, .toolbar, .bulkbar, .pstat
   ================================================================ */

:root {
  /* Per-chapter production STEP colours. recorded = periwinkle blue,
     spliced = the brand rose (--gold), proofed = teal, crx = the brand
     magenta (--accent). spl/crx alias the brand tokens so the four read
     as one family; rec/prf are new hues distinct enough to scan. */
  --rec: #5b6bd6;
  --spl: #c58b9b;
  --prf: #5fb6a6;
  --crx: #e0488f;
  /* Slightly softer corner for the new interactive chips/cells than the
     2px structural cards — friendlier on a dense grid without drifting
     into the mockup's 12px pill look. */
  --bvo-r: 7px;
}

/* ---- button modifiers (harmonised with the existing sharp/mono .btn) ---- */
/* The base .btn (defined far above) is the brand's uppercase mono pill;
   these modifiers keep that identity. .ghost = secondary outline,
   .sm = compact. Reused by the chrome actions and every stage body. */
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-1);
}
.btn.ghost:hover {
  background: var(--surface-2);
  border-color: var(--ink-3);
}
.btn.sm {
  padding: 5px 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
}

/* ---- small primitives ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border-radius: var(--bvo-r);
  padding: 3px 9px;
  font-size: 12px;
  color: var(--ink-1);
  border: 1px solid transparent;
}
.pill.on  { background: var(--good-soft); color: var(--good); }
.pill.off { background: var(--surface-2); color: var(--ink-3); }
.pill.warn { background: var(--danger-soft); color: var(--danger); }

.hint {
  cursor: help;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  font-family: var(--body);
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  font-family: var(--mono);
  background: var(--surface-3);
  flex: none;
}

/* ================================================================
   PROJECT CHROME — consistent identity bar + 10-stage rail + tabs
   (rendered by _project_chrome.html). Lives full-bleed inside the
   .container; the per-stage body and tab panels render beneath it.
   ================================================================ */
.bvo {
  /* the chrome + body wrapper; cancels the container's centered max
     so the rail can breathe, but keeps a sane outer max-width */
  margin: 0 auto;
}
.bvo-top {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  /* A magenta top rule + breathing room separates the project chrome
     from the near-identical navy global topbar above it, so "app nav"
     vs "this project's header" read as two distinct planes. */
  border-top: 2px solid var(--accent);
  margin-top: 6px;
  padding: 14px 0 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.bvo-id .by .due-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-soft);
  color: var(--gold-bright);
  border-radius: var(--bvo-r);
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 600;
}
.bvo-id { min-width: 0; }
.bvo-id .crumb {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bvo-id h1 {
  font-size: 28px;
  margin: 3px 0 2px;
  line-height: 1.05;
}
.bvo-id .by { color: var(--ink-2); font-size: 13px; }
.bvo-id .by b { color: var(--ink-1); font-weight: 600; }
.bvo-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-self: center;
  flex-wrap: wrap;
}

/* compact, scrollable 10-stage rail */
.bvo-rail {
  display: flex;
  align-items: center;
  gap: 0;
  flex-basis: 100%;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.bvo-rail .st {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 3px 10px;
  position: relative;
  border-bottom: 2px solid transparent;
}
.bvo-rail a.st:hover { color: var(--ink-1); }
.bvo-rail .st .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-3);
  flex: none;
}
.bvo-rail .st.done { color: var(--ink-2); }
.bvo-rail .st.done .dot { background: var(--good); }
.bvo-rail .st.cur {
  color: var(--ink-0);
  font-weight: 600;
  /* fill the current node so "where am I" reads in one glance */
  background: var(--accent-soft);
  border-radius: 20px;
}
.bvo-rail .st.cur .dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}
.bvo-rail .st:not(:last-child)::after {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--line);
  margin-left: 4px;
}

/* progressive tabs */
.bvo-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.bvo-tabs .tab {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  font-family: var(--body);
}
.bvo-tabs a.tab:hover { color: var(--ink-0); }
.bvo-tabs .tab.active {
  color: var(--ink-0);
  border-bottom-color: var(--accent);
}
.bvo-tabs .tab .badge {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--surface-2);
  border-radius: 20px;
  padding: 0 7px;
  color: var(--ink-2);
}
/* A locked tab is no longer inert: it links to the stage surface (where
   advancing unlocks it) and carries a visible reason, so it reads as
   "here's why, and here's the way out" rather than "broken". */
.bvo-tabs .tab.locked {
  color: var(--ink-3);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  cursor: pointer;
}
.bvo-tabs .tab.locked:hover { color: var(--ink-1); }
.bvo-tabs .tab.locked .lock-glyph {
  font-size: 9px;
  filter: grayscale(1);
  opacity: 0.8;
}
.bvo-tabs .tab .newdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ================================================================
   LIKED COMPONENT 1 — segmented progress bar (_progress_bar.html)
   ================================================================ */
.prog-wrap { margin: 4px 0; }
.prog {
  height: 10px;
  border-radius: var(--bvo-r);
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
}
.prog i { display: block; height: 100%; }
.prog .rec { background: var(--rec); }
.prog .spl { background: var(--spl); }
.prog .prf { background: var(--prf); }
.prog .crx { background: var(--crx); }
.prog-legend {
  display: flex;
  gap: 16px;
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
  align-items: center;
}
.prog-legend span { display: inline-flex; align-items: center; gap: 6px; }
.prog-legend .sw {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}
.prog-legend .sw.rec { background: var(--rec); }
.prog-legend .sw.spl { background: var(--spl); }
.prog-legend .sw.prf { background: var(--prf); }
.prog-legend .sw.crx { background: var(--crx); }
.prog-legend .rest { margin-left: auto; color: var(--ink-3); }
/* compact mini-bar for dashboard book cards — bar only, no legend */
.prog.mini { height: 6px; border-radius: 4px; }

/* ================================================================
   LIKED COMPONENT 2 — per-chapter tick-off (_chapter_ticktable.html)
   ================================================================ */
.ticktable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ticktable th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.ticktable td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); }
.ticktable tr:hover td { background: var(--surface-2); }
.ticktable tr.is-next td { background: rgba(var(--accent-rgb), 0.07); }
.ticktable .num { font-family: var(--mono); color: var(--ink-3); }
.tickrow { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
/* A step is a labeled mini-control: the colored toggle + a short caption
   beneath it, so the board names each step without a hover. */
.tickcell { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.tickcell .tick-cap {
  font-size: 8.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1;
  white-space: nowrap;
}
.tickcell .tick.on ~ .tick-cap,
.tickcell:has(.tick.on) .tick-cap { color: var(--ink-1); }
.tick {
  width: 26px;
  height: 22px;
  border-radius: var(--bvo-r);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  cursor: pointer;
  background: none;
  padding: 0;
  font-family: var(--body);
  transition: background 100ms ease, border-color 100ms ease, color 100ms ease;
}
.tick:hover { border-color: var(--ink-1); }
/* OFF state — tinted by step so an open step still reads as its step
   (the letter takes the step colour; on-state fills the background). The
   class names match the .prog palette (rec/spl/prf/crx/up), fixing the
   long-standing .r/.s/.p/.c selector mismatch that left ticks colourless. */
.tick.rec { color: var(--rec); border-color: var(--rec); }
.tick.spl { color: var(--spl); border-color: var(--spl); }
.tick.prf { color: var(--prf); border-color: var(--prf); }
.tick.crx { color: var(--crx); border-color: var(--crx); }
.tick.up,
.tick.pkp { color: var(--ink-2); border-color: var(--ink-3); }
.tick.on { color: #fff; border-color: transparent; }
.tick.on.rec { background: var(--rec); color: #fff; }
.tick.on.spl { background: var(--spl); color: #241018; }
.tick.on.prf { background: var(--prf); color: #06241d; }
.tick.on.crx { background: var(--crx); color: #fff; }
.tick.on.up  { background: var(--ink-2); color: #fff; }
.tick.on.pkp { background: var(--ink-1); color: var(--surface-0); }
/* NOT-NEEDED state (Item 22 tri-state recording). A resolved-but-not-done
   marker: muted, dashed border, struck-through glyph (a centred en-dash),
   visually distinct from both the tinted "open" outline and the filled
   "on" state so all three recording states read at a glance. */
.tick.naught {
  color: var(--ink-3);
  border-style: dashed;
  border-color: var(--line);
  background: var(--surface-1, transparent);
  opacity: 0.65;
  text-decoration: line-through;
}
.tick.naught:hover { border-color: var(--ink-2); }
.tickcell:has(.tick.naught) .tick-cap { color: var(--ink-3); opacity: 0.7; }
.tick:disabled { cursor: default; opacity: 0.5; }
/* DISPLAY-DERIVED N/A (recording_na / splice_na). Softer than the stored
   not-needed `.naught`: no strike-through (it isn't a recorded decision,
   just a "doesn't apply here" default) and a touch fainter. Recording
   derived-N/A stays a clickable button (a stored value then wins, so the
   hover lift applies); the Splicing N/A is a `disabled` button (Splicing
   is Duet-only — no valid override), which `.tick:disabled` already gives
   a default cursor + reduced opacity. */
.tick.naught-auto {
  text-decoration: none;
  opacity: 0.5;
  border-style: dashed;
}
.tick.naught-auto:not(:disabled):hover { border-color: var(--ink-2); opacity: 0.85; }
.prod-pickups-done-form { display: inline; margin: 0; }
/* Wild-line expander (Duet board). A quiet inline chevron + count badge in
   the Character cell; opens the sibling detail row below the chapter. */
.prod-col-character .prod-char-name { margin-right: 6px; }
.prod-wild-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--bvo-r);
  background: var(--surface-1, transparent);
  color: var(--ink-2);
  font: inherit;
  font-size: 10.5px;
  padding: 1px 6px;
  cursor: pointer;
  vertical-align: middle;
}
.prod-wild-toggle:hover { border-color: var(--ink-3); color: var(--ink-1); }
.prod-wild-toggle .chev { font-size: 9px; line-height: 1; }
.prod-wild-toggle .prod-wild-badge { letter-spacing: 0.02em; }
.prod-row-detail > td { background: var(--surface-1, var(--surface-2)); padding: 8px 12px; }
.prod-wild-detail { display: flex; flex-direction: column; gap: 6px; }
.prod-wild-detail-head { display: flex; align-items: baseline; gap: 8px; }
.prod-wild-detail-title { font-size: 12px; font-weight: 600; color: var(--ink-1); }
.prod-wild-line { display: flex; flex-direction: column; gap: 4px; }
.prod-wild-who { font-size: 12px; color: var(--ink-2); }
.prod-wild-chips { margin: 0; }

/* ================================================================
   Recording-stage Narrator Work Queue (Option A redesign)
   ----------------------------------------------------------------
   Ported from the approved wireframe (docs/ux/recording-redesign/
   option-a-work-queue.html). EVERY selector is scoped under
   `.recording-queue` so the queue's `.qhead`/`.qempty`/`.avatar`/`.chip`
   never collide with the dashboard work-queue widget's globals
   (.queue/.qhead/.qitems/.qempty, ~line 8383) or the base `.avatar`.
   Uses the live palette tokens (--rec/--spl/--good/--accent-rgb/…),
   not the wireframe's inline copies. RECORDING STAGE ONLY surface. */
.recording-queue { margin-top: 14px; }
.recording-queue .na-banner {
  font-size: 12.5px; color: var(--ink-3); background: var(--surface-1);
  border: 1px dashed var(--line); border-radius: 8px;
  padding: 9px 14px; margin: 14px 0 0;
}
.recording-queue .na-banner b { color: var(--ink-2); }

/* ---- chapter-ALIGNED grid -----------------------------------------
   One ROW per chapter (board order), Bridget's cell left and Jake's
   right with a narrow centre "spine" carrying the chapter label once so
   both narrator cells anchor to the same row. A narrator who is N/A for a
   chapter gets a quiet DEADSPACE cell so the columns stay aligned down the
   page. Solo collapses to a single column (spine + the solo narrator). */
.recording-queue .qgrid {
  margin-top: 20px; border: 1px solid var(--line);
  background: var(--surface-1); border-radius: 12px; overflow: hidden;
}
/* spine width tracks the chapter label; equal narrator columns flank it. */
.recording-queue .qgrid-duo .qgrid-head-duo,
.recording-queue .qgrid-duo .qrow-duo {
  display: grid; grid-template-columns: 1fr 64px 1fr; align-items: stretch;
}
.recording-queue .qgrid-solo .qgrid-head-solo,
.recording-queue .qgrid-solo .qrow-solo {
  display: grid; grid-template-columns: 64px 1fr; align-items: stretch;
}
.recording-queue .qgrid-head { border-bottom: 1px solid var(--line); }
.recording-queue .qgrid-head .qhead { border-bottom: 0; }
.recording-queue .qgrid-head-duo .qhead-cell:first-child .qhead {
  border-right: 1px solid var(--line);
}
/* the centre spine: thin column carrying the chapter number, header + rows */
.recording-queue .qspine,
.recording-queue .qhead-spine {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border-left: 1px solid var(--line);
  border-right: 1px solid var(--line); text-align: center;
}
.recording-queue .qhead-spine {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3);
}
.recording-queue .qrow { border-top: 1px solid var(--line-soft); }
.recording-queue .qrow:first-of-type { border-top: 0; }
.recording-queue .qspine .qch { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.recording-queue .qhead {
  display: flex; align-items: center; gap: 11px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
  height: 100%; box-sizing: border-box;
  /* Each duo header lives in a half-width grid column. When that column
     gets narrow (small window / browser zoom), let the progress block
     drop onto its own full-width line rather than cramming beside the
     name — where it used to wrap mid-token ("recorded" / "CHS" dangling)
     or clip under `.qgrid`'s overflow:hidden. */
  flex-wrap: wrap; row-gap: 4px;
}
.recording-queue .avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid;
  place-items: center; font-family: var(--display); font-size: 15px;
  color: #fff; flex: 0 0 auto;
}
.recording-queue .avatar.av-b { background: linear-gradient(135deg, #6b7ce0, #4a5ac0); }
.recording-queue .avatar.av-j { background: linear-gradient(135deg, #e0488f, #b53a78); }
/* V72 (owner item 4): the OUTSIDE lane — a third column, right of Jake's,
   for every performer who is not Bridget or Jake. Read-only cells (no
   recording-marker column exists for an outside voice actor). */
.recording-queue .avatar.av-o { background: linear-gradient(135deg, #8a8f9a, #5f6672); }
.recording-queue .qgrid-trio .qgrid-head-trio,
.recording-queue .qgrid-trio .qrow-trio {
  display: grid; grid-template-columns: 1fr 64px 1fr 1fr; align-items: stretch;
}
.recording-queue .qgrid-head-trio .qhead-cell:first-child .qhead { border-right: 1px solid var(--line); }
.recording-queue .qgrid-head-trio .qhead-outside .qhead { border-left: 1px solid var(--line); }
.recording-queue .qrow-trio .qcell:last-child { border-left: 1px solid var(--line); }
.recording-queue .qcell .qperf { margin-left: 6px; font-size: 11.5px; }
.recording-queue .qhead .qoutside-names { font-size: 12px; }
.recording-queue .qhead .who {
  font-family: var(--display); font-size: 18px; color: var(--ink-0);
  font-weight: 500; min-width: 0;
}
/* Header progress block. Renamed from `.prog` — a global `.prog` progress-BAR
   component (display:flex; height:10px; overflow:hidden) was bleeding in and
   collapsing this into a clipped 10px flex row. Stack explicitly. */
.recording-queue .qhead .qprog {
  margin-left: auto; display: flex; flex-direction: column;
  align-items: flex-end; gap: 2px; text-align: right;
}
/* Keep each count line whole so it never wraps mid-token; if it can't sit
   beside the name, `.qhead`'s flex-wrap drops the whole block to the line
   below, where the full column width is available. */
.recording-queue .qhead .qprog .big {
  font-family: var(--mono); font-size: 15px; color: var(--ink-0);
  white-space: nowrap;
}
.recording-queue .qhead .qprog .big b { color: var(--good); }
.recording-queue .qhead .qprog .sub {
  font-size: 11px; color: var(--ink-3); font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.recording-queue .qmini {
  height: 4px; background: var(--surface-3); border-radius: 2px;
  overflow: hidden; margin-top: 5px; width: 118px; margin-left: auto;
}
.recording-queue .qmini i { display: block; height: 100%; background: var(--good); }

/* section label (the "Needs POV — unassigned" footer) */
.recording-queue .qsec {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3); padding: 12px 18px 6px;
}
.recording-queue .qsec-warn { color: var(--danger, var(--accent-bright)); }

/* a single narrator's grid cell for one chapter */
.recording-queue .qcell {
  display: flex; align-items: flex-start; gap: 12px; padding: 11px 18px;
  height: 100%; box-sizing: border-box;
}
.recording-queue .qitem:hover { background: var(--surface-2); }
/* DEADSPACE: this narrator is N/A for the chapter. Quiet + empty, NOT a
   control — a faint hatched fill keeps the columns visually aligned. */
.recording-queue .qcell-dead {
  background: repeating-linear-gradient(
    -45deg, transparent, transparent 7px,
    var(--line-soft) 7px, var(--line-soft) 8px);
  opacity: 0.5;
}
/* a recorded chapter, shown checked-off IN PLACE (no separate Done strip) */
.recording-queue .qitem-done { background: var(--surface-2); }
.recording-queue .qitem-done .qcheck {
  border-color: var(--good); background: var(--good-soft); color: var(--good);
}
.recording-queue .qitem-done .qchar {
  color: var(--ink-2); font-weight: 500;
  text-decoration: line-through; text-decoration-color: var(--ink-3);
}
.recording-queue .qcheck {
  width: 26px; height: 26px; border-radius: 8px;
  border: 1.5px solid var(--ink-3); background: transparent; display: grid;
  place-items: center; color: var(--ink-3); font-size: 14px; flex: 0 0 auto;
  cursor: pointer; margin-top: 1px; padding: 0;
}
.recording-queue button.qcheck:hover { border-color: var(--ink-1); color: var(--ink-1); }
.recording-queue .qbody { flex: 1; min-width: 0; }
.recording-queue .qtop { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.recording-queue .qch { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.recording-queue .qchar { font-weight: 600; color: var(--ink-0); font-size: 15px; }
.recording-queue .qchar-wild { color: var(--spl); font-weight: 600; }
.recording-queue .qwords { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.recording-queue .qnote { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; font-style: italic; }
/* Inline-editable per-chapter note (editors). Borderless until hovered /
   focused so an empty note reads as quiet whitespace, not a loud input —
   adapts the Production board's .prod-note-input aesthetic to the queue. */
.recording-queue .qnote-form { margin: 3px 0 0; }
.recording-queue .qnote-input {
  width: 100%; resize: vertical; min-height: 1.5em;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  padding: 2px 5px; color: var(--ink-2); font: inherit; font-size: 12.5px;
  line-height: 1.4;
}
.recording-queue .qnote-input:hover { border-color: var(--line-soft); }
.recording-queue .qnote-input:focus {
  border-color: var(--accent); background: var(--surface-1);
  color: var(--ink-1); outline: none;
}
.recording-queue .qnote-input::placeholder { color: var(--ink-3); font-style: italic; }
/* wild-line pickup chip-list inside an item */
.recording-queue .qwild { margin-top: 8px; border-left: 2px solid var(--spl); padding: 6px 0 4px 11px; }
.recording-queue .qwild .wl { font-size: 12px; color: var(--ink-2); margin-bottom: 5px; }
.recording-queue .qwild .wl b { color: var(--ink-1); }
.recording-queue .chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.recording-queue .chip {
  font-family: var(--body); font-size: 12px; color: var(--ink-1);
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 9px; cursor: default; white-space: nowrap;
}
.recording-queue .chip .w { color: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.recording-queue a.qchip-link { text-decoration: none; cursor: pointer; }
.recording-queue a.qchip-link:hover { border-color: var(--ink-3); color: var(--ink-0); }
/* quiet secondary affordance: mark a queued chapter not-needed for this
   narrator. Visually muted so it never competes with the ✓. */
.recording-queue .qna {
  flex: 0 0 auto; align-self: center; border: 1px solid transparent;
  background: transparent; color: var(--ink-3); font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 6px; cursor: pointer;
  /* Hover-reveal: a persistent "N/A" on every row read as a status (esp. on a
     Solo book where the narrator records everything). Hidden until the row is
     hovered/focused; still reserves layout so the columns stay aligned. */
  opacity: 0; transition: opacity 100ms ease;
}
.recording-queue .qitem:hover .qna,
.recording-queue .qna:focus { opacity: 0.6; }
.recording-queue .qna:hover {
  opacity: 1; color: var(--ink-1); border-color: var(--line);
}
/* empty state when the grid has no rows */
/* `font-style`/`font-size` reset: a bare `.qempty` rule for the dashboard
   work-queue widget would otherwise bleed italic + 12.5px in here. */
.recording-queue .qempty { padding: 26px 18px; text-align: center; color: var(--ink-3); font-style: normal; font-size: 13px; }
.recording-queue .qempty .big { font-family: var(--display); font-size: 17px; color: var(--ink-1); margin-bottom: 4px; }
/* "Needs POV — unassigned" footer block */
.recording-queue .qunassigned {
  margin-top: 18px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-1); padding: 4px 16px 14px;
}
.recording-queue .qunassigned p { color: var(--ink-3); font-size: 12.5px; margin: 4px 0 10px; }

/* ---- daily recording chunks: per-actor "finish in N days" day-ribbon ----
   The viewer picks a day count; their own workload is split into day bands.
   The chapter spine + the viewer's column take the day colour (a vertical
   ribbon that changes at each day boundary); the other narrator dims to
   context. Only the LOGGED-IN actor's column is banded (`data-rdp-side`). */
.recording-queue .rec-dayplan {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 4px;
}
.recording-queue .rdp-label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-3);
}
.recording-queue .rdp-btns {
  display: inline-flex; gap: 4px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 9px; padding: 3px;
}
.recording-queue .rdp-btn {
  font-family: var(--mono); font-size: 13px; color: var(--ink-2);
  background: transparent; border: none; border-radius: 6px;
  padding: 5px 12px; cursor: pointer; min-width: 34px;
}
.recording-queue .rdp-btn:hover { color: var(--ink-0); }
.recording-queue .rdp-btn.active { color: #fff; background: var(--accent); }
.recording-queue .rdp-pace {
  margin-left: auto; font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-3);
}

/* day-colour palette (cycled per band; reuses live tokens where they fit) */
.recording-queue .qday-0 { --dc: var(--rec); }
.recording-queue .qday-1 { --dc: var(--prf); }
.recording-queue .qday-2 { --dc: var(--spl); }
.recording-queue .qday-3 { --dc: #d8a657; }
.recording-queue .qday-4 { --dc: #7a8cff; }
.recording-queue .qday-5 { --dc: var(--good); }
.recording-queue .qday-6 { --dc: var(--accent); }

/* the centre spine becomes the day ribbon */
.recording-queue .qrow[class*="qday-"] .qspine { background: var(--dc); }
.recording-queue .qrow[class*="qday-"] .qspine .qch { color: #fff; font-weight: 600; }

/* duo: dim the non-viewer column; rail + wash the viewer's cells */
.recording-queue[data-rdp-side="left"] .qrow-duo .qcell:last-child { opacity: 0.5; }
.recording-queue[data-rdp-side="right"] .qrow-duo .qcell:first-child { opacity: 0.5; }
.recording-queue[data-rdp-side="left"] .qrow-duo[class*="qday-"] .qcell:first-child { border-right: 3px solid var(--dc); }
.recording-queue[data-rdp-side="right"] .qrow-duo[class*="qday-"] .qcell:last-child { border-left: 3px solid var(--dc); }
.recording-queue[data-rdp-side="left"] .qrow-duo[class*="qday-"] .qcell.qitem:first-child { background: color-mix(in srgb, var(--dc) 8%, transparent); }
.recording-queue[data-rdp-side="right"] .qrow-duo[class*="qday-"] .qcell.qitem:last-child { background: color-mix(in srgb, var(--dc) 8%, transparent); }
/* Same side-dimming / band accents on the V72 three-column grid: Bridget is
   the 1st cell, Jake the 3rd (after the spine), the outside lane the 4th. */
.recording-queue[data-rdp-side="left"] .qrow-trio .qcell:not(:first-child) { opacity: 0.5; }
.recording-queue[data-rdp-side="right"] .qrow-trio .qcell:first-child,
.recording-queue[data-rdp-side="right"] .qrow-trio .qcell:last-child { opacity: 0.5; }
.recording-queue[data-rdp-side="left"] .qrow-trio[class*="qday-"] .qcell:first-child { border-right: 3px solid var(--dc); }
.recording-queue[data-rdp-side="right"] .qrow-trio[class*="qday-"] .qcell:nth-child(3) { border-left: 3px solid var(--dc); }
.recording-queue[data-rdp-side="left"] .qrow-trio[class*="qday-"] .qcell.qitem:first-child { background: color-mix(in srgb, var(--dc) 8%, transparent); }
.recording-queue[data-rdp-side="right"] .qrow-trio[class*="qday-"] .qcell.qitem:nth-child(3) { background: color-mix(in srgb, var(--dc) 8%, transparent); }

/* solo: single column, no dimming */
.recording-queue .qrow-solo[class*="qday-"] .qcell { border-left: 3px solid var(--dc); }
.recording-queue .qrow-solo[class*="qday-"] .qcell.qitem { background: color-mix(in srgb, var(--dc) 8%, transparent); }

/* recorded cells keep their checked-off surface (over the day wash) — the
   wash selectors are more specific, so this needs !important to win */
.recording-queue .qrow .qcell.qitem-done { background: var(--surface-2) !important; }

/* the per-day band, dropped where the viewer's day starts */
.recording-queue .dband {
  display: flex; align-items: center; gap: 12px; padding: 8px 18px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--dc) 16%, var(--surface-1));
}
.recording-queue[data-rdp-side="left"] .dband { border-left: 4px solid var(--dc); }
.recording-queue[data-rdp-side="right"] .dband { border-right: 4px solid var(--dc); }
.recording-queue .dband-num {
  font-family: var(--display); font-size: 13px; color: #fff;
  background: var(--dc); border-radius: 6px; padding: 2px 10px;
}
.recording-queue .dband-rng { font-weight: 600; color: var(--ink-0); font-size: 13.5px; }
.recording-queue .dband-goal {
  margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2);
}
.recording-queue .dband-done { color: var(--good); font-family: var(--mono); font-size: 11px; }

/* Caption under the bar that explains the chapter-progress segments. */
.prog-caption { margin: 6px 0 0; font-size: 11.5px; }
.prog-caption b { color: var(--ink-1); font-weight: 600; }

/* ================================================================
   shared stage-body primitives (reused across per-stage views)
   ================================================================ */
.pstat {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.pstat .big {
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink-0);
  line-height: 1.1;
}
.pstat .big b { color: var(--accent-bright); }
.pstat .pks {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 10px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.toolbar .seg {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: var(--bvo-r);
  padding: 2px;
  gap: 2px;
}
.toolbar .seg b,
.toolbar .seg a {
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 500;
}
.toolbar .seg b.sel,
.toolbar .seg a.sel { background: var(--surface-3); color: var(--ink-0); font-weight: 600; }
.toolbar .spacer { margin-left: auto; }

.bulkbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: var(--bvo-r);
  padding: 9px 14px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-1);
}
.bulkbar select {
  background: var(--surface-1);
  color: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  font-family: var(--body);
  font-size: 12.5px;
}
.bulkbar .n { font-family: var(--mono); color: var(--accent-bright); font-weight: 600; }

@media (max-width: 720px) {
  .bvo-id h1 { font-size: 23px; }
  .bvo-actions { margin-left: 0; flex-basis: 100%; }
}

/* ---- Overview tab ---- */
.overview-next {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px 22px;
  margin: 6px 0 0;
}
.facts-grid > div { min-width: 0; }
.facts-grid dt {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.facts-grid dd {
  margin: 2px 0 0;
  color: var(--ink-0);
  font-size: 15px;
}

/* ================================================================
   DASHBOARD PIPELINE BOARD (Chunk 4 — dashboard.html)

   The studio home: a horizontally-scrolling kanban of book cards,
   one column per canonical pipeline stage, with a capacity strip and
   client-side filter chips on top. Ported from the "Option 1 —
   Pipeline Board" wireframe (docs/ux/redesign/dashboard.html), reusing
   the live palette tokens, .prog / .avatar / .pill / --rec…--crx
   primitives already defined above. Avatar/days red uses #e07a7a (the
   wireframe's warn hue) consistently.
   ================================================================ */

/* ---- capacity strip ---- */
.capstrip {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.capstrip .cnum {
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink-0);
  line-height: 1;
}
.capstrip .cnum b { color: var(--accent); }
.capstrip .cnum .cnum-sub {
  font-size: 12px;
  color: var(--ink-2);
  font-family: var(--body);
}
.capstrip .cbar { flex: 1; min-width: 220px; max-width: 420px; }
.capstrip .cbar .prog { height: 12px; }
.capstrip .cbar .prog i.book { background: var(--rec); }
.capstrip .cbar .lbl {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 6px;
  font-family: var(--mono);
}
.capstrip .cmonths { margin-left: auto; display: flex; gap: 10px; }
.capstrip .cm {
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-3);
  font-family: var(--mono);
}
.capstrip .cm b { display: block; font-size: 13px; color: var(--ink-1); }
.capstrip .cm.hot b { color: var(--gold-bright); }
.capstrip .cm.over b { color: #e07a7a; }

/* ---- per-narrator capacity (T3) ---------------------------------
   Bridget and Jake have SEPARATE monthly capacity but mostly share the
   same books, so the single combined headline (~672k by default) is split
   into one gauge per principal — mirroring the Capacity dashboard. Bridget tints
   magenta (--accent), Jake rose (--gold), matching the calendar. */
.capstrip .cap-narr-pair {
  flex: 1;
  min-width: 260px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 18px;
}
.capstrip .cap-narr { display: flex; flex-direction: column; gap: 5px; }
.capstrip .cap-narr-num {
  font-family: var(--display);
  font-size: 19px;
  color: var(--ink-0);
  line-height: 1;
}
.capstrip .cap-narr-name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-right: 6px;
}
.capstrip .cap-narr-num b { color: var(--accent); }
.capstrip .cap-narr-jake .cap-narr-num b { color: var(--gold); }
.capstrip .cap-narr-bar {
  height: 10px;
  background: var(--surface-0);
  border: 1px solid var(--line);
  overflow: hidden;
}
.capstrip .cap-narr-bar .book { display: block; height: 100%; background: var(--accent); }
.capstrip .cap-narr-jake .cap-narr-bar .book { background: var(--gold); }
.capstrip .cap-narr-over .cap-narr-bar { border-color: var(--danger); }
.capstrip .cap-narr-over .cap-narr-bar .book { background: var(--danger); }
.capstrip .cap-narr-lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-2);
}
.capstrip .cap-narr-overtag { color: var(--danger); }
/* Per-month mini-columns now read "B / J" per-narrator pct (inline). */
.capstrip .cm .cm-narr { display: inline-flex; gap: 3px; align-items: baseline; margin-top: 2px; }
.capstrip .cm .cm-narr b { display: inline; font-size: 12px; }
.capstrip .cm .cm-b { color: var(--accent); }
.capstrip .cm .cm-j { color: var(--gold); }
.capstrip .cm .cm-sep { color: var(--ink-3); }
.capstrip .cap-inflight { margin-left: auto; align-self: center; white-space: nowrap; }

/* ---- filter chips ---- */
.chiprow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.chiprow .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 11px;
  cursor: pointer;
  color: var(--ink-2);
  white-space: nowrap;
  user-select: none;
}
.chiprow .chip:hover { border-color: var(--ink-3); color: var(--ink-1); }
.chiprow .chip.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.chiprow .chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chiprow .chip-clear { color: var(--ink-3); }
/* Owner filter: one pill that behaves as a single dropdown control. A
   transparent, full-size <select> is laid over a styled face (caption +
   selected value + caret) so a click ANYWHERE on the pill opens the native
   menu — not just the select's own box. `color-scheme: dark` + explicit
   option colours theme the native popup so it matches the app instead of
   rendering as a bright, out-of-place OS menu. */
.chiprow .chip-select {
  position: relative;
  gap: 5px;
  padding-right: 10px;
}
.chiprow .chip-select-cap { color: var(--ink-3); }
.chiprow .chip-select-val {
  color: var(--ink-1);
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chiprow .chip-select-caret { color: var(--ink-3); font-size: 9px; line-height: 1; }
.chiprow .chip-select.on { background: var(--accent-soft); border-color: var(--accent); }
.chiprow .chip-select.on .chip-select-cap { color: var(--accent); }
.chiprow .chip-select.on .chip-select-val,
.chiprow .chip-select.on .chip-select-caret { color: var(--accent); }
.chiprow .chip-select:focus-within { border-color: var(--accent); }
.chiprow .chip-select select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  color: transparent;   /* hide the native closed-state text; the face shows it */
  cursor: pointer;
  color-scheme: dark;
}
.chiprow .chip-select select:focus { outline: none; }
.chiprow .chip-select select option {
  background: var(--surface-1);
  color: var(--ink-1);
}

/* ---- primary-month board filter (server-side; parity with /projects) ---- */
.board-month-filter { margin: 14px 0 0; }
.board-month-filter a.chip { text-decoration: none; }
.board-month-filter .month-form { display: inline-flex; margin: 0; }
.board-month-filter .month-form label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.board-month-filter .month-form input[type="month"] {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-1);
}

/* ---- narration-style chip on a card ---- */
.styletag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.styletag.dual { color: #d9a6b0; border-color: rgba(197, 139, 155, 0.55); }
.styletag.solo { color: #8fb3d8; border-color: rgba(91, 107, 214, 0.5); }
.styletag.duet { color: #8fd8c8; border-color: rgba(95, 182, 166, 0.5); }

/* ---- the board ---- */
.board {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  /* Full-bleed: the kanban board is a wide surface, so let it use the
     whole window width instead of the 1400px reading column that
     `.container` imposes on prose. Break out symmetrically with a
     viewport-width box + centring negative margin, and re-pad to the
     page gutter so cards don't kiss the window edge. This is what lets
     all stage columns share real estate before the scroll fallback. */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 16px var(--pad) 8px;
  align-items: flex-start;
}
.board .col {
  /* Fill the row: every stage column shares the available width equally
     (flex-grow) and shrinks only down to a floor (min-width). While the
     floors fit, the board uses the full width with NO horizontal scroll
     regardless of column count; past the floor, `.board { overflow-x }`
     scrolls so every stage stays reachable. Column-count-agnostic — no
     magic per-stage numbers. See docs/design/board-sizing.md. */
  flex: 1 1 0;
  min-width: 112px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  /* Grow with the viewport instead of a hard pixel cap. The board sits
     below a tall, wrapping chrome stack, so we subtract a conservative
     (tunable) chrome allowance rather than a measured offset; min-height
     keeps columns comfortable on short windows. */
  min-height: 360px;
  max-height: calc(100vh - var(--board-vh-chrome, 320px));
}
/* Production ("busy") columns carry per-book progress mini-bars/legends;
   give them a slightly larger floor so those stay legible at the board's
   narrowest before the scroll fallback engages. */
.board .col.busy { min-width: 124px; }
.board .col.col-filtered-empty { opacity: 0.4; }
.board .colh {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface-1);
  border-radius: 12px 12px 0 0;
  z-index: 2;
}
.board .colh .cn { display: flex; align-items: center; gap: 7px; }
.board .colh .cn .nm { font-size: 12px; font-weight: 600; color: var(--ink-0); }
.board .colh .cn .ct {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-2);
  margin-left: auto;
  background: var(--surface-2);
  border-radius: 20px;
  padding: 1px 7px;
}
.board .colh .agg {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 5px;
  font-family: var(--mono);
}
.board .colh .stbar {
  height: 3px;
  border-radius: 2px;
  margin-top: 7px;
  background: var(--surface-3);
  overflow: hidden;
}
.board .cards {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
}

/* ---- book card ---- */
.bcard {
  display: block;
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  cursor: pointer;
  position: relative;
  color: inherit;
}
.bcard:hover { border-color: var(--accent); background: var(--surface-3); }
.bcard .bt { font-size: 12.5px; color: var(--ink-0); font-weight: 600; line-height: 1.25; }
.bcard .ba { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.bcard .bmeta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.bcard .days {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  margin-left: auto;
}
.bcard .days.stuck { color: #e07a7a; }
.bcard .crew { display: flex; margin-top: 7px; }
.bcard .crew .avatar {
  width: 20px;
  height: 20px;
  font-size: 9px;
  border: 1.5px solid var(--surface-2);
  margin-left: -5px;
}
.bcard .crew .avatar:first-child { margin-left: 0; }
.bcard .minibar { margin-top: 7px; }
.bcard .minibar .prog { height: 6px; }
.bcard .minibar .mlbl {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  margin-top: 3px;
}
.bcard.is-stuck { border-color: rgba(224, 122, 122, 0.5); }
.bcard .stuckflag {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e07a7a;
}

/* ITEM 4(b): a new self-submitted lead riding the "Inquiry" lane.
   Distinct from book cards (it's a pre-project lead) via a left accent
   stripe and a "New lead" tag. */
.bcard.is-inquiry {
  border-left: 3px solid var(--accent);
  background: var(--surface-3);
}
.styletag.inquiry-tag {
  color: var(--accent);
  border-color: rgba(120, 130, 230, 0.5);
}
.bcard .bowner {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  margin-left: auto;
}

/* ---- legacy below-the-fold drawer ---- */
.home-detail-drawer { margin-top: 18px; }

@media (max-width: 900px) {
  /* Tighter floor on small screens: let columns shrink a little further
     before the horizontal-scroll fallback engages, so more stages stay
     on-screen on phones/narrow tablets. */
  .board .col { min-width: 104px; }
  .board .col.busy { min-width: 116px; }
}

/* ================================================================
   CHUNK 5 — per-stage working surfaces (2026-05 redesign)

   Reskins the remaining stage-tab bodies to their wireframes in
   docs/ux/redesign/. Every rule reuses the live palette tokens and
   the shared primitives above (.btn/.pill/.hint/.avatar/.prog/
   .ticktable) so the surfaces read as one product with the chrome.
   The wireframes' `--ok` maps to the live `--good`/`--good-soft`.

   Surfaces, in pipeline order:
     1. Inquiry Response  — Right-Now action card
     2. Scheduling        — capacity-first strip + dates + compose
     3. Contracts         — field-filler + per-narrator status track
     4. Pre-Production    — setup-wizard stepper
     5. First Fifteen     — readiness checklist + upload-and-send
     6. Mastering         — handoff tracker (linear flow + run-time aside)
     7. Releases          — release-watch banner + grouped checklist
   ================================================================ */

/* ---- shared step glyph (Pre-Prod / Mastering / Releases) ---- */
.sdot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.sdot.ok   { background: var(--good-soft); color: var(--good); border: 1px solid rgba(111, 185, 122, 0.4); }
.sdot.pend { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.sdot.man  { background: var(--accent-soft); color: var(--accent-bright); border: 1px solid rgba(var(--accent-rgb), 0.4); }

/* persona / real-name chips reused across author-facing + internal copy */
.bvo-persona {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: var(--bvo-r);
  padding: 1px 8px;
  font-size: 11px;
  color: var(--accent-bright);
  font-weight: 600;
}
.bvo-realname {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(91, 107, 214, 0.16);
  border: 1px solid rgba(91, 107, 214, 0.4);
  border-radius: var(--bvo-r);
  padding: 1px 8px;
  font-size: 11px;
  color: #aab3ee;
}
.bvo-sectlabel {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 700;
  margin: 20px 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bvo-sectlabel:first-child { margin-top: 0; }

/* ---- compose-email card (Inquiry / Scheduling / First Fifteen) ---- */
.bvo-compose {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-1);
  overflow: hidden;
  margin-top: 14px;
}
.bvo-compose .chead {
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-1);
}
.bvo-compose .chead .as { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.bvo-compose .cbody { padding: 13px 16px; font-size: 13px; color: var(--ink-1); line-height: 1.6; }
.bvo-compose .cbody .sub { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-bottom: 8px; }
.bvo-compose .cfoot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.bvo-compose .cfoot .auditnote {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* =====================  1. INQUIRY — Right-Now action card  ===================== */
.inq-now {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 820px) { .inq-now { grid-template-columns: 1fr; } }
.inq-bignow {
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.10), rgba(var(--accent-rgb), 0.02));
  border-radius: 14px;
  padding: 20px;
}
.inq-bignow .eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-bright);
  font-weight: 700;
  margin-bottom: 6px;
}
.inq-bignow h3 { font-size: 20px; margin: 0 0 4px; line-height: 1.15; }
.inq-bignow .lede { color: var(--ink-2); margin: 0 0 16px; font-size: 13px; max-width: 52ch; }
.inq-linkrow {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-0);
  border: 1px dashed var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  margin-top: 14px;
  font-size: 12.5px;
}
.inq-linkrow .mono {
  font-family: var(--mono);
  color: var(--gold-bright);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inq-statusline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 14px;
}
.inq-statusline .dotpulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(var(--gold-rgb), 0.18);
  flex: none;
}
.inq-statusline.applied .dotpulse { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.inq-readout { display: flex; flex-direction: column; gap: 10px; }
.inq-readout .subhead {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 700;
}
.inq-readout .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-1);
}
.inq-readout .row .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inq-readout .row .v { font-family: var(--mono); color: var(--ink-0); font-size: 15px; text-align: right; }
.inq-readout .row .v small { color: var(--ink-2); font-size: 11px; font-family: var(--body); }
.inq-readout .row .v.pending { color: var(--ink-3); font-style: italic; font-family: var(--body); font-size: 13px; }
/* Inline-editable PFH rate: reads as a quiet mono value (matching .v) with a
   subtle inset so it's discoverable as editable; native spinners removed. */
.inq-readout .inq-pfh-input {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--ink-0);
  text-align: right;
  width: 4.5ch;
  padding: 2px 6px;
  margin: 0 1px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-0);
  -moz-appearance: textfield;
  appearance: textfield;
}
.inq-readout .inq-pfh-input::-webkit-outer-spin-button,
.inq-readout .inq-pfh-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inq-readout .inq-pfh-input::placeholder { color: var(--ink-3); }
.inq-readout .inq-pfh-input:hover { border-color: var(--ink-3); }
.inq-readout .inq-pfh-input:focus { border-color: var(--accent); background: var(--surface-2); outline: none; }
.inq-submission-summary { margin-top: 14px; }

/* Instant quote estimate (Inquiry Response, Suggestion 1). Display-only
   price quote card; spans the full .inq-now grid so it reads as its own
   band beneath the action tile + readout. */
.inq-quote {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--surface-0);
}
.inq-quote .subhead {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  font-weight: 700;
  margin-bottom: 12px;
}
.inq-quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 560px) { .inq-quote-grid { grid-template-columns: 1fr; } }
.inq-quote-cell { display: flex; flex-direction: column; gap: 4px; }
.inq-quote-k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
}
.inq-quote-v { font-family: var(--mono); color: var(--ink-0); font-size: 18px; }
.inq-quote-v small { color: var(--ink-2); font-size: 11px; font-family: var(--body); }
.inq-quote-v.pending {
  color: var(--ink-3);
  font-style: italic;
  font-family: var(--body);
  font-size: 13px;
}
.inq-quote-cell-total .inq-quote-v { color: var(--gold-bright); }
.inq-quote-basis { margin: 12px 0 4px; font-size: 12px; }
.inq-quote-caveat { margin: 0; font-size: 11.5px; color: var(--ink-3); font-style: italic; }

/* Accept / Decline triage (Inquiry Response, Suggestion 2). Accept is
   the primary action; Decline is a quieter disclosure beside it so the
   destructive path is deliberate but never hidden. */
.inquiry-triage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.inquiry-decline summary { cursor: pointer; display: inline-block; }
.inquiry-decline summary.inquiry-decline-toggle { list-style: none; }
.inquiry-decline summary::-webkit-details-marker { display: none; }
.inquiry-decline[open] summary.inquiry-decline-toggle { margin-bottom: 10px; }
.inquiry-decline-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface-0);
}
.inquiry-decline-label { font-size: 12px; color: var(--ink-2); }
.inquiry-decline-reason {
  width: 100%;
  font-family: var(--body);
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--ink-0);
  resize: vertical;
}
.inquiry-decline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* =====================  2. SCHEDULING — capacity-first  ===================== */
/* The 6-month strip is the hero. Reskins the existing .capacity-strip /
   .capacity-cell radio-group markup into the wireframe's gauge cells. */
.scheduling-capacity-strip .capacity-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 8px 0 6px;
  padding: 0;
  list-style: none;
}
@media (max-width: 820px) { .scheduling-capacity-strip .capacity-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .scheduling-capacity-strip .capacity-strip { grid-template-columns: repeat(2, 1fr); } }
.scheduling-capacity-strip .capacity-cell { position: relative; margin: 0; }
.scheduling-capacity-strip .capacity-cell-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.scheduling-capacity-strip .capacity-cell-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 12px 13px;
  background: var(--surface-1);
  cursor: pointer;
  min-height: 92px;
}
.scheduling-capacity-strip .capacity-cell-btn:hover { border-color: var(--ink-3); }
.scheduling-capacity-strip .capacity-cell-radio:checked + .capacity-cell-btn {
  border-color: var(--accent);
  /* No-jiggle: hold the SAME border-width + padding as an unselected cell
     so selection never resizes the box. The unscoped base
     `:checked + .capacity-cell-btn` rule sets border-width:2px + padding:
     7px 5px (for the legacy strip); without these explicit overrides it
     leaked in here and shrank the selected tile's chrome by ~9px, jiggling
     the row when the selection moved. Selection now reads purely from the
     burgundy border colour + the box-shadow ring. */
  border-width: 1px;
  padding: 12px 12px 13px;
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}
.scheduling-capacity-strip .capacity-cell-radio:focus-visible + .capacity-cell-btn {
  outline: 2px solid var(--accent-bright);
  outline-offset: 1px;
}
.scheduling-capacity-strip .capacity-cell-month {
  font-size: 12px;
  color: var(--ink-1);
  font-weight: 600;
}
/* Combined load readout: a big compact number (6.0M) + a quiet "/ 672k"
   denominator (the combined default; tracks edited caps), with an inline
   "+N over" tag only when over-cap. Matches
   the Calendar gauge's number-over-denominator rhythm. */
.scheduling-capacity-strip .capacity-cell-numbers {
  display: flex;
  align-items: baseline;
  /* No-jiggle: keep the load + denominator + over-tag on ONE line so the
     row height is constant whether or not the over-tag is showing. With
     flex-wrap the over-tag could wrap to a second line in a narrow cell,
     changing that cell's height when selection flips it fits→over. */
  flex-wrap: nowrap;
  gap: 5px;
}
.scheduling-capacity-strip .capacity-cell-load {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-0);
  line-height: 1.1;
}
.scheduling-capacity-strip .capacity-cell-of {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
}
.scheduling-capacity-strip .capacity-cell-overtag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: 4px;
  padding: 0 5px;
  white-space: nowrap;
}
/* No-jiggle: the over-tag slot is rendered in EVERY cell (empty when the
   month fits). The empty placeholder is invisible but still occupies its
   line, so the numbers row keeps the same height as a cell flips
   fits<->over when the selection moves. Strip the pill chrome off the
   empty one so it reads as truly blank, not an empty box. */
.scheduling-capacity-strip .capacity-cell-overtag[aria-hidden="true"] {
  visibility: hidden;
  background: none;
  border: 0;
  padding: 0;
}
/* the gauge: a flex bar with committed + this-book segments. The track
   clips (overflow:hidden) so an over-cap committed segment can never run
   past the cell; over-cap adds a magenta wash + a notch nub at the end. */
.scheduling-capacity-strip .capacity-cell-gauge {
  position: relative;
  height: 7px;
  border-radius: 5px;
  background: var(--surface-3);
  overflow: hidden;
  display: flex;
}
.scheduling-capacity-strip .capacity-cell-gauge i { display: block; height: 100%; }
.scheduling-capacity-strip .capacity-cell-gauge i.committed { background: var(--rec); }
.scheduling-capacity-strip .capacity-cell-gauge i.adding { background: var(--gold); }
.scheduling-capacity-strip .capacity-cell-gauge.is-over i.committed { background: var(--accent); }
/* over nub: a short, deliberately-distinct cap at the track's right edge
   that says "this fill is clamped — there's more beyond" without a
   full-width shout. */
.scheduling-capacity-strip .capacity-cell-gauge .overnub {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--danger);
  border-left: 1px solid var(--surface-1);
}
/* This-book add line ("+N with this book → projected"). Rendered in EVERY
   cell at a FIXED two-line height so moving the selection from one month to
   another never changes a tile's height — the strip row stays perfectly
   still as the studio clicks across months (no jiggle). The populated text
   ("+95k with this book → 855k") can wrap to two lines in a narrow cell, so
   the reserved slot is sized for two lines in every cell (selected tile has
   text, the others hold an invisible placeholder of the same height). */
.scheduling-capacity-strip .capacity-cell-add {
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.25;
  /* exactly two text lines @ 9.5px * 1.25 ≈ 11.9px each */
  min-height: 24px;
  color: var(--gold-bright);
}
.scheduling-capacity-strip .capacity-cell-add-empty { visibility: hidden; }
.scheduling-capacity-strip .capacity-cell-booked-count { font-size: 10px; color: var(--ink-3); }
/* Per-voice-actor estimate inside each month cell — Bridget magenta,
   Jake rose, matching the Calendar / Timeline / Dashboard. Two stacked
   mini-gauges so the strip says WHO is full, not just a combined total.
   Each row is name · gauge · booked/cap FH. */
.scheduling-capacity-strip .capacity-cell-narrators {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
}
/* Each narrator: a labelled row (name + FH readout on one line) OVER a
   fully-contained, clamped bar. The name lives in its own flex row, never
   underneath the bar — so the fill can never cover the label or value.
   Mirrors the Calendar .cap-gauge name-over-bar rhythm. */
.scheduling-capacity-strip .cap-narr {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.scheduling-capacity-strip .cap-narr-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.scheduling-capacity-strip .cap-narr-name {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.scheduling-capacity-strip .cap-narr-bridget .cap-narr-name { color: var(--accent); }
.scheduling-capacity-strip .cap-narr-jake .cap-narr-name { color: var(--gold-bright); }
.scheduling-capacity-strip .cap-narr-fh {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  white-space: nowrap;
}
.scheduling-capacity-strip .cap-narr-fh b { color: var(--ink-1); font-weight: 600; }
.scheduling-capacity-strip .cap-narr-fh small { font-size: 9px; color: var(--ink-3); }
/* contained, clamped bar — overflow:hidden clips any >100% segment */
.scheduling-capacity-strip .cap-narr-gauge {
  position: relative;
  height: 6px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
  display: flex;
}
.scheduling-capacity-strip .cap-narr-gauge i { display: block; height: 100%; }
.scheduling-capacity-strip .cap-narr-bridget .cap-narr-gauge i.booked { background: var(--accent); }
.scheduling-capacity-strip .cap-narr-jake .cap-narr-gauge i.booked { background: var(--gold); }
.scheduling-capacity-strip .cap-narr-gauge i.adding {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--ink-3);
  opacity: 0.9;
}
/* over-own-cap: danger fill + the same end-of-track over nub the combined
   gauge uses, so "this narrator is full" reads at a glance */
.scheduling-capacity-strip .cap-narr-gauge.is-over i.booked { background: var(--danger); }
.scheduling-capacity-strip .cap-narr-gauge .overnub {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--danger);
  border-left: 1px solid var(--surface-1);
}
.scheduling-capacity-strip .cap-narr-over .cap-narr-name { color: var(--danger); }
.scheduling-capacity-strip .cap-narr-over .cap-narr-fh b { color: var(--danger); }
.scheduling-strip-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 12px;
}
.scheduling-strip-window-label { font-family: var(--mono); color: var(--ink-2); }
.scheduling-pick-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
/* Selected month tile (redesign): the chosen cell carries an emphasis
   ring on top of the :checked treatment so the selection reads at a
   glance while the studio clicks around comparing months. */
.scheduling-capacity-strip .capacity-cell-selected .capacity-cell-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}
/* Selected-month load readout — the projected ADDED load for the month
   the studio currently has selected, sitting between the picker and the
   editable preview dates. Updates on every tile click (the cell re-fetch
   re-renders this fragment), so months stay easy to compare. */
.scheduling-selected-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 12px 0 4px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-1);
  font-size: 13px;
}
.scheduling-selected-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.scheduling-selected-month { font-weight: 600; color: var(--ink-0); }
.scheduling-selected-load { color: var(--ink-2); }
.scheduling-selected-load strong { color: var(--ink-0); font-family: var(--mono); }
.scheduling-selected-over { color: var(--danger); font-weight: 600; }
/* Editable preview date inputs (un-booked phase). They reuse the
   `.scheduling-dates` card grid; these rules make the bare <input> fill
   its card the same way the persisted inline-edit pills do. */
.scheduling-dates-preview .scheduling-date-row input[type="date"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* date pills (T4)
   The four production dates (First Fifteen / Recording Due / Pickup /
   Delivery) render as a responsive grid of cards, each stacking its
   label ABOVE a full-width date input. These rules are SCOPED under
   `.scheduling-dates` so they fully override the flat-list
   `.scheduling-date-row` / `.scheduling-date-label` rules defined
   earlier for other surfaces — without the scope the earlier
   `display:flex; flex:0 0 140px` bled in here, sitting the label
   beside the input and squeezing the date field until it clipped
   ("07/06", "mm/d") and collided with the neighbouring card. */
.scheduling-dates .scheduling-date-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.scheduling-dates .scheduling-date-row {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-1);
  min-width: 0;
}
.scheduling-dates .scheduling-date-label {
  display: block;
  flex: none;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
/* The inline-edit form + its date input fill the card so the value is
   never clipped. `min-width:0` lets the input shrink inside the grid
   cell instead of forcing the card wider than its column. */
.scheduling-dates .scheduling-date-row .inline-edit { display: block; min-width: 0; }
.scheduling-dates .scheduling-date-row .inline-edit input[type="date"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.scheduling-timeframe-quote { color: var(--ink-1); font-style: italic; margin: 4px 0 0; }

/* =====================  3. CONTRACTS — field-filler + status track  ===================== */
.contract-narrator-track {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-1);
  overflow: hidden;
  margin-bottom: 14px;
}
.contract-narrator-track .nhead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.contract-narrator-track .nhead .who { font-weight: 600; color: var(--ink-0); }
.contract-narrator-track .nhead .leg { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.contract-statusline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 14px 12px;
}
.contract-statusline .sstep {
  flex: 1;
  text-align: center;
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--ink-3);
  position: relative;
  padding-top: 18px;
}
.contract-statusline .sstep::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface-3);
  z-index: 2;
}
.contract-statusline .sstep::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--surface-3);
  z-index: 1;
}
.contract-statusline .sstep:last-child::after { display: none; }
.contract-statusline .sstep.done { color: var(--ink-1); }
.contract-statusline .sstep.done::before { background: var(--good); }
.contract-statusline .sstep.done::after { background: var(--good); }
.contract-statusline .sstep.cur { color: var(--accent-bright); font-weight: 700; }
.contract-statusline .sstep.cur::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* =====================  4. PRE-PRODUCTION — setup wizard stepper  ===================== */
.preprod-wiz {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-1);
}
@media (max-width: 820px) { .preprod-wiz { grid-template-columns: 1fr; } }
.preprod-wiz .wnav { background: var(--surface-0); border-right: 1px solid var(--line); padding: 10px 0; }
@media (max-width: 820px) { .preprod-wiz .wnav { border-right: 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; padding: 6px; } }
.preprod-wiz .wstep {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  color: var(--ink-2);
  border-left: 2px solid transparent;
}
.preprod-wiz .wstep.done { color: var(--ink-2); }
.preprod-wiz .wstep.cur { color: var(--ink-0); font-weight: 600; background: var(--surface-1); border-left-color: var(--accent); }
.preprod-wiz .wstep .n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-2);
  color: var(--ink-3);
}
.preprod-wiz .wstep.done .n { background: var(--good-soft); color: var(--good); }
.preprod-wiz .wstep.cur .n { background: var(--accent); color: #fff; }
.preprod-wiz .wpanel { padding: 22px 24px; min-width: 0; }
.preprod-wiz .wpanel .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.preprod-wiz .wpanel h3 { font-family: var(--display); font-size: 21px; margin: 6px 0 4px; }
.preprod-wiz .wpanel .lede { color: var(--ink-2); font-size: 13px; max-width: 54ch; margin-bottom: 16px; }
.preprod-wiz .wpanel .wfoot {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  flex-wrap: wrap;
}
.preprod-readybar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.08);
  flex-wrap: wrap;
}
.preprod-readybar.ready { border-color: rgba(111, 185, 122, 0.45); background: var(--good-soft); }
.preprod-readybar .lead { flex: 1; min-width: 200px; }
.preprod-readybar .lead b { color: var(--ink-0); }

/* Item C — Pre-Production four-tab surface. A nested tab construct inside
   the Stage tab's working surface: a clickable strip (4 tabs, each with a
   live done-dot) over the active tab body. Switching tabs and performing
   actions both re-render the whole #preprod-tabs wrapper over HTMX, so the
   dots and body stay in lockstep. */
.preprod-tabs {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-1);
}
.preprod-tabstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  background: var(--surface-0);
  border-bottom: 1px solid var(--line);
  padding: 6px 6px 0;
}
.preprod-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  cursor: pointer;
  position: relative;
  bottom: -1px;
}
.preprod-tab:hover { color: var(--ink-0); background: var(--surface-1); }
.preprod-tab.is-active {
  color: var(--ink-0);
  font-weight: 600;
  background: var(--surface-1);
  border-color: var(--line);
  border-bottom: 1px solid var(--surface-1);
}
.preprod-tab .dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: var(--surface-2);
  color: var(--ink-3);
  border: 1px solid var(--line);
}
.preprod-tab .dot.ok {
  background: var(--good-soft);
  color: var(--good);
  border-color: rgba(111, 185, 122, 0.4);
}
.preprod-tabpanel { padding: 22px 24px; min-width: 0; }
.preprod-tab-head { margin-bottom: 16px; }
.preprod-tab-head h3 { font-family: var(--display); font-size: 21px; margin: 0 0 4px; }
.preprod-tab-head .meta { max-width: 60ch; }
.preprod-tabpanel .preprod-readybar { margin-top: 0; }
.preprod-tabs > .preprod-readybar {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-0);
}
.preprod-tabs > .preprod-readybar.ready {
  border-top-color: rgba(111, 185, 122, 0.45);
  background: var(--good-soft);
}
.preprod-provision-state {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  margin: 0 0 14px;
}
.preprod-provision-state.ok { color: var(--good); }
.preprod-provision-state.pending { color: var(--ink-2); }
.preprod-folder-form input[type=text] { min-width: 320px; max-width: 100%; }
.preprod-folder-suggest { margin-top: 12px; }
.preprod-thread-slot {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-0);
}
.preprod-ms-summary { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; }
.preprod-ms-stat { display: flex; flex-direction: column; gap: 2px; }
.preprod-ms-stat .n { font-family: var(--display); font-size: 26px; color: var(--ink-0); line-height: 1; }
.preprod-ms-stat .k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* V54 — manuscript LLM-parse job states (Pre-Production manuscript tab). */
.preprod-ms-job { display: flex; flex-direction: column; gap: 12px; }
.preprod-ms-running-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--ink-0);
}
.preprod-ms-elapsed {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  margin: 0;
}

/* Manuscript-parse progress bar. Rendered for the WHOLE run: it is
   indeterminate while the structural pass is still finding chapters (no
   `value` attribute) and determinate once the worker reports a chapter
   total. Same element, same box, both states — the bar must not jump
   when it flips.

   `<progress>` needs three separate paint surfaces: `::-webkit-progress-
   bar` (the track) and `::-webkit-progress-value` (the fill) on
   Blink/WebKit, and `::-moz-progress-bar` (the fill) on Gecko, whose
   track is the element's own background. */
.preprod-ms-progress {
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
  /* Gecko's track, and the fallback wherever neither pseudo-element
     paints. */
  background: var(--surface-3);
  color: var(--accent);
}
.preprod-ms-progress::-webkit-progress-bar {
  background: var(--surface-3);
  border-radius: 999px;
}
.preprod-ms-progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
  transition: width 240ms ease;
}
.preprod-ms-progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

/* Indeterminate. TWO traps here, both verified in Chromium rather than
   assumed:

   1. The moment `::-webkit-progress-bar` carries a custom background,
      Chrome stops painting its built-in indeterminate animation and the
      bar sits there as a dead pill — which reads exactly like the frozen
      spinner this change exists to fix. So the motion has to be ours.
   2. Chrome does NOT run CSS animations on `::-webkit-progress-*`. A
      keyframed `background-position` declared on the pseudo-element
      paints its first frame and never moves (measured: 4 identical
      screenshots across one period).

   So the sliding band lives on the HOST element, which animates like any
   normal element, and both fill pseudo-elements go transparent in this
   state so the host shows through. Gecko's own indeterminate chunk is
   suppressed the same way, so both engines show the same thing. */
.preprod-ms-progress:indeterminate {
  background-image: linear-gradient(
    90deg,
    var(--surface-3) 0%,
    var(--surface-3) 32%,
    var(--accent) 50%,
    var(--surface-3) 68%,
    var(--surface-3) 100%
  );
  background-size: 260% 100%;
  animation: bvo-ms-progress-slide 1.5s linear infinite;
}
/* Two rules, NOT one comma list: a selector list with one pseudo-element
   the engine doesn't know (`::-moz-…` in Chromium) drops the WHOLE rule,
   which left the track opaque over the animated host in Chrome. */
.preprod-ms-progress:indeterminate::-webkit-progress-bar { background: transparent; }
.preprod-ms-progress:indeterminate::-moz-progress-bar { background: transparent; }
@keyframes bvo-ms-progress-slide {
  from { background-position: 160% 0; }
  to   { background-position: -60% 0; }
}
/* The motion is decoration — the label above the bar already says what is
   happening — so drop it for anyone who asked for less of it. Removing
   the gradient falls back to the host's solid `--surface-3`, so the track
   stays visible rather than going transparent. */
@media (prefers-reduced-motion: reduce) {
  .preprod-ms-progress:indeterminate {
    animation: none;
    background-image: none;
  }
  .preprod-ms-progress::-webkit-progress-value { transition: none; }
}

.preprod-ms-progress-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}
.preprod-ms-progress-label .meta { display: inline; }

.preprod-ms-error {
  padding: 11px 13px;
  border: 1px solid var(--danger, #c0392b);
  border-radius: 8px;
  background: var(--danger-tint, #fcefee);
}
.preprod-ms-error b { color: var(--danger, #c0392b); }
.preprod-ms-retry-upload {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--accent, #8a6d3b);
  border-radius: 50%;
  animation: bvo-spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes bvo-spin { to { transform: rotate(360deg); } }

/* =====================  5. FIRST FIFTEEN — readiness + upload-and-send  ===================== */
.ff-ready { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.ff-ready .item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-1);
}
.ff-ready .item .mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex: none;
}
.ff-ready .item.ok .mark   { background: var(--good-soft); color: var(--good); }
.ff-ready .item.warn .mark { background: var(--accent-soft); color: var(--accent-bright); }
.ff-ready .item .txt { flex: 1; }
.ff-ready .item .txt b { color: var(--ink-0); font-weight: 600; display: block; font-size: 13.5px; }
.ff-ready .item .txt span { color: var(--ink-2); font-size: 12px; }
.ff-ready .item .go { font-size: 11.5px; color: var(--accent-bright); font-family: var(--mono); margin-left: auto; }
.ff-readiness-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 700;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ff-readiness-head .ct {
  font-family: var(--mono);
  background: var(--surface-2);
  border-radius: 20px;
  padding: 0 8px;
  font-size: 10.5px;
  color: var(--ink-2);
}

/* =====================  6. MASTERING — Dropbox reference  =====================
   2026-06-04 (studio request): the Mastering "handoff tracker" (.mast-flow /
   .mast-rtpanel / .mast-steptag and their .stop/.rail/.line/.meat/.side/.rtgrid
   children) was removed along with its template block. The stage now renders
   only the Dropbox folder reference below, so just `.mast-deliverbox` remains.
   `.sdot` is intentionally NOT removed — it's a shared status glyph used by the
   Pre-Prod tabs and the comms-stage checklist, not scoped to this tracker. */
.mast-deliverbox {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
}
.mast-deliverbox .mono { font-family: var(--mono); font-size: 11.5px; color: var(--ink-1); }
.mast-deliverbox .count { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }

/* =====================  7. RELEASES — finished resting state  ===================== */
/* The terminal stage carries no steps: a book that reaches Releases is finished
   and parks here until it's archived. A calm "done" card, NOT a task surface. */
.rel-finished {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(111, 185, 122, 0.4);
  background: var(--good-soft);
}
.rel-finished .glyph {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(111, 185, 122, 0.18);
}
.rel-finished-text { flex: 1; min-width: 0; }
.rel-finished-text h3 { font-family: var(--body); font-size: 15px; font-weight: 600; color: var(--ink-0); margin: 0; }
.rel-finished-text p { color: var(--ink-2); font-size: 12.5px; margin: 5px 0 0; line-height: 1.5; }
.rel-finished-text p b { color: var(--ink-1); }
.rel-finished-text p.meta { color: var(--ink-3); font-size: 11.5px; margin-top: 7px; }

/* the Releases / Mastering checklist drawer stays available below as the
   audit-backed source of truth; demote it visually under the surface */
.stage-comms-extras { margin-top: 18px; }

/* ================================================================
   CHARACTER BROWSER — roster table + voice-bible detail (chunk 6, §5)

   Reshapes the flat Characters table into Option 2's roster+detail.
   Reuses the redesign shared-shell primitives above (.avatar, .pill,
   .hint, palette tokens, --rec/--spl/--prf/--crx, --bvo-r). The legacy
   character cell classes (.character-narrator, .character-voice-actor,
   .character-kind-pill, .character-merge, .character-row textarea) are
   defined further up and reused as-is — not redefined here.
   ================================================================ */

/* Persona-vs-real-name UI note (the open-question flag, spec §9). */
.characters-persona-note {
  margin: 4px 0 12px;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--body);
  font-size: 12px;
  line-height: 1.5;
  max-width: 720px;
}
.characters-persona-note em { font-style: normal; font-weight: 600; color: var(--ink-1); }
.voiced-q-inline { color: var(--accent); font-weight: 700; }

/* The split: dense roster left, sticky voice-bible EDITOR right. The
   editor needs room (full-width prose textareas), so it gets a wider
   minimum than the old read-only panel did. */
.character-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(380px, 1fr);
  gap: 20px;
  align-items: start;
}
.character-roster { overflow-x: auto; }

/* Sortable table headers (shared: Characters roster #5 + Projects list #23,
   wired by static/js/table_sort.js). Any table.data header carrying
   data-sort-key is click-to-sort, with a .sort-ar direction indicator. */
.data thead th[data-sort-key] { cursor: pointer; white-space: nowrap; user-select: none; }
.data thead th[data-sort-key]:hover { color: var(--ink-0); }
.data .sort-ar { color: var(--accent-bright); font-size: 9px; margin-left: 2px; }

/* Roster table — dense columns. Builds on .characters-table. */
.characters-table .character-col-pov,
.characters-table .character-col-gender,
.characters-table .character-col-sample { width: 52px; text-align: center; }
.characters-table .character-col-num { width: 64px; text-align: right; }
.characters-table .character-col-voiced-by { width: 96px; }

.character-row.crow { cursor: pointer; }
.character-row.crow:hover > td { background: var(--surface-2); }
.character-row.crow.sel > td { background: var(--accent-soft); }
/* Selected row gets an accent rail under the first cell — Direction A. */
.character-row.crow.sel > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.character-row.crow > td { vertical-align: middle; }
.crow-num { text-align: right; font-family: var(--mono); color: var(--ink-2); }
.crow-pov, .crow-gender, .crow-sample { text-align: center; }
.crow-dash { color: var(--ink-3); }

.pov-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  color: var(--accent-bright);
}

/* Voiced-by persona chip. Confirmed = solid; default (unconfirmed) =
   outlined + a trailing "?" so an unconfirmed gender-default reads as a
   suggestion, never a settled fact. */
.voiced-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--bvo-r);
  cursor: default;
}
.voiced-chip.confirmed { background: var(--accent-soft); color: var(--accent-bright); border: 1px solid var(--accent); }
.voiced-chip.default { background: transparent; color: var(--ink-2); border: 1px dashed var(--ink-3); }
/* V72: an OUTSIDE voice actor (not Bridget / Jake) reads neutral, never in
   the principals' accent. */
.voiced-chip.outside { background: var(--surface-2); color: var(--ink-1); border: 1px solid var(--line); }
.voiced-q { color: var(--accent); font-weight: 800; }
.voiced-unassigned {
  font-size: 11px;
  font-style: italic;
  color: var(--ink-3);
  border: 1px dashed var(--line);
  border-radius: var(--bvo-r);
  padding: 2px 8px;
}

/* Sample chip (recorded / missing) — reuses the step palette feel. */
.sample-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.sample-chip.rec { background: var(--prf); color: #06241d; }
.sample-chip.miss { background: var(--surface-2); color: var(--ink-3); }

/* Direction A: the roster row is DISPLAY-ONLY (no inline-edit column).
   All editing happens in the panel on the right, so clicking a row never
   reshapes it — it just paints + wires the panel. */

/* ---- voice-bible EDITOR panel (right) ---- */
.character-detail {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: sticky;
  top: 14px;
  overflow: hidden;
}
.character-detail-empty { padding: 18px 16px; }
.character-detail .cd-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.character-detail .cd-avatar { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
.character-detail .cd-name {
  font-family: var(--display);
  font-size: 19px;
  color: var(--ink-0);
  line-height: 1.1;
}
.character-detail .cd-tags {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.character-detail .cd-gender { text-transform: capitalize; }
.character-detail .cd-body { padding: 16px 18px 18px; }

/* Each editable field sits in its own block. */
.character-detail .cd-block { margin-bottom: 16px; }
.character-detail .cd-block:last-child { margin-bottom: 0; }
.character-detail .cd-lab {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Surface tag (persona / real name / read-only) on a field label. */
.character-detail .cd-surface {
  font-size: 9px;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--ink-3);
  text-transform: none;
}
/* "✓ saved" tick, pushed to the right of the label, fades in on save. */
.character-detail .cd-saved {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--prf);
  opacity: 0;
  transition: opacity 0.2s;
  text-transform: none;
}
.character-detail .cd-saved.show { opacity: 1; }

/* EDITABLE controls — full width, spacious (the point of Direction A). */
.character-detail .fld textarea,
.character-detail .fld input[type="text"] {
  width: 100%;
  font: inherit;
  font-family: var(--body);
  font-size: 14px;
  padding: 9px 11px;
  background: var(--surface-0);
  color: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  resize: vertical;
}
/* The description box reads like a clean paragraph: comfortable line
   height and a roomy floor. It's autofilled from the voice bible on LLM
   ingest (can be a full paragraph), and bvoAutosize() (project_detail.html)
   grows it to fit on select + input — but the CSS floor keeps it generous
   even before JS runs / with no content. */
.character-detail .fld textarea {
  min-height: 120px;
  line-height: 1.55;
}
.character-detail .fld textarea.cd-autosize {
  min-height: 132px;
  overflow-y: hidden;  /* grows to fit; no inner scrollbar */
}
.character-detail .fld textarea:focus,
.character-detail .fld input[type="text"]:focus { border-color: var(--accent); }

/* Auto / default hint under a real-name field. */
.character-detail .cd-auto {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.character-detail .cd-auto:empty { display: none; }

/* Voiced-by display row (persona chip + a one-line note). */
.character-detail .cd-voiced-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Kind toggle — two buttons; the active one reads accent. */
.character-detail .cd-kindrow { display: flex; gap: 8px; }
/* V72 Voiced-by quick-picks (Bridget / Jake) reuse the kind-toggle look. */
.character-detail .cd-voiced-picks { display: flex; gap: 8px; margin: 6px 0 8px; }
.character-detail .cd-kind-btn {
  font: inherit;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface-0);
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 6px 16px;
  cursor: pointer;
  border-radius: 0;
}
.character-detail .cd-kind-btn:hover { color: var(--ink-0); }
.character-detail .cd-kind-btn.on {
  background: var(--accent-soft);
  color: var(--accent-bright);
  border-color: var(--accent);
}

/* Parser provenance — read-only stats grid. */
.character-detail .prov {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft, var(--line));
  border: 1px solid var(--line);
}
.character-detail .prov > div { background: var(--surface-1); padding: 8px 10px; }
.character-detail .prov .n {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--ink-0);
  text-transform: capitalize;
}
.character-detail .prov .k {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

/* Footer — delete + merge. */
.character-detail .cd-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.character-detail .cd-foot .cd-merge-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.character-detail .cd-foot .cd-merge-form select {
  font: inherit;
  font-family: var(--body);
  font-size: 13px;
  padding: 5px 8px;
  background: var(--surface-0);
  color: var(--ink-1);
  border: 1px solid var(--line);
}
.character-detail .cd-flag-wrap { padding: 0 18px 16px; }
.character-detail .cd-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  border: 1px dashed var(--line);
  padding: 3px 9px;
  border-radius: 2px;
  cursor: help;
}
.character-detail .cd-flag b { color: var(--accent-bright); font-weight: 600; }

/* V68: the character voice sample is a TAKE LIST, not a single player, so
   the old `.cd-player` chrome (one <audio> + a fake waveform) is gone. The
   list reuses the pronunciation take-list markup (`.rec-block` / `.rec-take`
   / `.rec-who` / `.rec-del`), whose styles live scoped to `.pron-tab` in
   `_pronunciations_tab.html` — so the same visual language is restated here
   scoped to `.character-detail`. Keep the two in step if either moves. */
.character-detail .rec-list {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line);
}
.character-detail .rec-take {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-1); padding: 9px 11px; flex-wrap: wrap;
}
.character-detail .rec-audio { height: 30px; max-width: 190px; }
.character-detail .rec-who {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 3px; flex: none;
}
.character-detail .rec-who.bridget {
  background: var(--accent-soft); color: var(--accent-bright);
  border: 1px solid var(--accent);
}
.character-detail .rec-who.jake {
  background: rgba(91, 107, 214, .16); color: #9aa6ee;
  border: 1px solid var(--rec);
}
.character-detail .rec-who.staff {
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.character-detail .rec-when,
.character-detail .rec-label {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
}
.character-detail .rec-meta {
  margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none;
}
.character-detail .rec-del-form { display: inline; margin: 0; }
.character-detail .rec-del {
  background: none; border: 0; color: var(--ink-3); font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer;
}
.character-detail .rec-del:hover { color: var(--danger); }
.character-detail .rec-empty {
  background: var(--surface-0); border: 1px dashed var(--line);
  padding: 13px; text-align: center; color: var(--ink-3);
  font-style: italic; font-size: 13px;
}
.character-detail .cd-sample-state {
  margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--ink-2);
}
/* Per-character take count on the roster row (mirrors the Pronunciations
   tab's Takes badge, which is scoped to `.pron-tab`). */
.characters-table .takes-badge {
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
  margin-left: 6px;
}
.characters-table .takes-badge.zero { color: var(--ink-3); }
/* V57 placement fix: per-character recorder on the Characters tab. The
   record / stop / upload controls reuse the global `.btn` / `.btn.ghost`
   treatment so they match the pronunciation recorder (Stop clearly
   visible); only the row layout is scoped here. */
.character-detail .cd-sample-block .cd-rec {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px;
}
.character-detail .cd-rec-status { min-height: 1em; font-size: 12px; }
.character-detail .cd-rec-upload { margin-top: 8px; }

@media (max-width: 880px) {
  .character-split { grid-template-columns: 1fr; }
  .character-detail { position: static; }
}

/* ================================================================
   REDESIGN Chunk 7 — three new surfaces
   (work queue §6a, Author-CRX §6b, Delivery "Ship it" §6c).
   Lane / form / ship classes promoted from the approved mockups,
   re-pointed at the LIVE palette tokens + .btn / .card / fonts.
   ================================================================ */

/* ---- Work queue (§6a, docs/ux/redesign/work_queue.html) ---- */
.wq { max-width: 1000px; margin: 0 auto; }
.wq .crumb {
  font-family: var(--mono); font-size: 11.5px;
  letter-spacing: 0.08em; color: var(--ink-3);
}
.wq h1 { font-size: 28px; margin: 4px 0 4px; }
.wq .wq-sub { color: var(--ink-2); margin: 0 0 8px; }

.lanetabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 20px; }
.lanetabs .lt {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface-1);
  border-radius: 30px; padding: 6px 13px; font-size: 12.5px;
  color: var(--ink-2);
}
.lanetabs .lt.on {
  border-color: var(--accent); color: var(--ink-0);
  background: var(--accent-soft);
}
.lanetabs .lt .ct {
  font-family: var(--mono); font-size: 11px;
  background: var(--surface-3); border-radius: 20px;
  padding: 0 7px; color: var(--ink-1);
}

.queue {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-1); margin-top: 14px; overflow: hidden;
}
.qhead {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.qhead .who { display: flex; align-items: center; gap: 11px; }
.qhead .who .nm { font-weight: 600; color: var(--ink-0); font-size: 14px; }
.qhead .who .role { font-size: 11px; color: var(--ink-3); }
.qhead .qcount {
  margin-left: auto; font-family: var(--mono);
  font-size: 12px; color: var(--ink-2);
}
.qitems { list-style: none; margin: 0; padding: 4px 0; }
.qitems li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; border-bottom: 1px solid var(--line);
}
.qitems li:last-child { border-bottom: 0; }
.qitems li:hover { background: var(--surface-2); }
.qitems .qbook { font-size: 13px; color: var(--ink-0); flex: 1; min-width: 0; }
.qitems .qbook .sub {
  display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px;
}
.qitems .qstage {
  font-size: 11px; color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}
.qempty { padding: 16px; color: var(--ink-3); font-style: italic; font-size: 12.5px; }
.wq .scopehint { margin-top: 18px; color: var(--ink-3); font-size: 12px; }

/* Merged Work tab — Mine ⇄ Everyone scope toggle (pills in the header). */
.work-scope { display: inline-flex; gap: 6px; align-items: center; }
.work-scope .ws {
  display: inline-flex; align-items: center; line-height: 1;
  border: 1px solid var(--line); background: var(--surface-1);
  border-radius: 30px; padding: 7px 16px; font-size: 13px;
  color: var(--ink-2); text-decoration: none;
}
.work-scope .ws:hover { color: var(--ink-0); border-color: var(--ink-3); }
.work-scope .ws.on {
  border-color: var(--accent); color: var(--ink-0);
  background: var(--accent-soft); font-weight: 600;
}

/* Work tab — plates. The Mine/Everyone scopes share one plate card
   (.queue.plate); to-dos fold in as plate items with the same row
   rhythm as the project rows. */
.wq.plates { max-width: 1000px; }
.plate-empty { color: var(--ink-3); }
.plate-unassigned .qhead .avatar { opacity: 0.6; }

/* A to-do rendered inside a plate. Inline controls stay flat (look like
   text + small chips) so the plate doesn't read like a spreadsheet. */
.plate-todo { gap: 10px; border-left: 3px solid transparent; }
.plate-todo.priority-high { border-left-color: var(--accent); }
.plate-todo.priority-medium { border-left-color: var(--line); }
.plate-todo.priority-low { border-left-color: transparent; }
.plate-todo-check { display: flex; align-items: center; margin: 0; }
.plate-todo-check input { cursor: pointer; }
.plate-todo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.plate-todo-text-form { margin: 0; }
.plate-todo-text {
  width: 100%; background: transparent; border: 1px solid transparent;
  color: var(--ink-0); font: inherit; font-size: 13px;
  padding: 2px 5px; border-radius: 6px;
}
.plate-todo-text:hover { border-color: var(--line); }
.plate-todo-text:focus {
  border-color: var(--accent); background: var(--surface-1); outline: none;
}
.plate-todo-prio { margin: 0; }
.plate-todo-prio select {
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 11px; border-radius: 20px; padding: 2px 9px;
}
/* Optional due date — same quiet pill treatment as the priority select. */
.plate-todo-due { margin: 0; }
.plate-todo-due input[type="date"] {
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 11px; border-radius: 20px; padding: 2px 9px;
  font-family: inherit;
}
.plate-todo-del { margin: 0; display: flex; }
.plate-todo-del .btn-link.danger {
  color: var(--ink-3); font-size: 17px; line-height: 1;
}
.plate-todo-del .btn-link.danger:hover { color: var(--bad, #e0607a); }

/* Check-off / delete feedback: the row collapses UP and out so the
   active list visibly shrinks before the board re-renders (the item
   itself lands in the completed drawer below). JS fixes the row's
   current height on htmx:beforeRequest, then adds `.todo-leaving` to
   transition it to 0; the form's `swap:220ms` holds the board swap until
   the collapse finishes. Without this the whole-board swap is instant +
   scroll-pinned, so a removed row reads as "nothing moved". */
.plate-todo.todo-leaving {
  height: 0 !important;
  opacity: 0;
  overflow: hidden;
  padding-top: 0; padding-bottom: 0;
  margin-top: 0; margin-bottom: 0;
  border-width: 0;
  transition: height .2s ease, opacity .16s ease,
              padding .2s ease, margin .2s ease;
}

.todo-add { margin-top: 24px; }
.todo-add h2 { font-size: 15px; margin: 0 0 12px; }

/* Inline confirmation after adding a to-do over HTMX (the no-JS path
   uses a flash instead). Mirrors the flash-success treatment. */
.work-notice {
  margin: 0 0 14px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--ok, #2e7d5b);
  background: color-mix(in srgb, var(--ok, #2e7d5b) 12%, transparent);
  color: var(--ink-1); font-size: 13px;
}

/* Completed-to-do drawer — collapsed by default, untick a row to reopen. */
.completed-todos {
  margin-top: 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-1); overflow: hidden;
}
.completed-todos > summary {
  cursor: pointer; padding: 11px 16px; font-size: 12.5px; color: var(--ink-2);
  list-style: none; user-select: none;
}
.completed-todos > summary::-webkit-details-marker { display: none; }
.completed-todos > summary::before { content: "▸ "; color: var(--ink-3); }
.completed-todos[open] > summary::before { content: "▾ "; }
.completed-todos > summary:hover { color: var(--ink-0); }
.completed-todos .plate-todo.is-done { opacity: 0.72; }
.completed-todos .plate-todo.is-done .plate-todo-body s { color: var(--ink-3); }

/* Owner-avatar colour families — keyed to the production STEP colours
   so the lanes read as one family with the .prog bar + dashboard
   avatars. accent = comms persona, gold = Releases (Molly). */
.avatar.avatar-spl { background: var(--spl); }
.avatar.avatar-prf { background: var(--prf); }
.avatar.avatar-crx { background: var(--crx); }
.avatar.avatar-accent { background: var(--accent); }
.avatar.avatar-gold { background: var(--gold); }

/* ---- Author-CRX studio tracker (§6b, internal, on the comms stage) ---- */
.crx-studio { margin: 16px 0 4px; }
.crx-roundhead {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 10px;
}
.crx-roundhead h3 { margin: 0; font-size: 15px; }
.crx-share {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin: 8px 0 16px;
}
.crx-share input {
  flex: 1; min-width: 260px; background: var(--surface-0);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px;
  color: var(--ink-1); font-family: var(--mono); font-size: 12px;
}
.crx-items { width: 100%; border-collapse: collapse; margin: 8px 0 4px; }
.crx-items th {
  text-align: left; font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3);
  border-bottom: 1px solid var(--line); padding: 6px 8px;
}
.crx-items td {
  border-bottom: 1px solid var(--line); padding: 7px 8px;
  font-size: 13px; color: var(--ink-1); vertical-align: top;
}
.crx-items td .ts { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.crx-items td.crx-statuscell { white-space: nowrap; }
.crx-items select { font-size: 12px; padding: 3px 6px; }
.crx-empty { color: var(--ink-3); font-style: italic; font-size: 12.5px; padding: 10px 0; }
.crx-archived { margin-top: 18px; }
.crx-archived summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }

/* ---- Author-CRX "Triage Queue" redesign (Wireframe C) ---- */
/* Progress readout in the round head (display only). */
.crx-progress { display: inline-flex; align-items: center; gap: 9px; margin-left: 4px; }
.crx-progress-track {
  width: 130px; height: 7px; border-radius: 999px;
  background: var(--surface-3); overflow: hidden;
}
.crx-progress-fill { display: block; height: 100%; background: var(--good); }
.crx-progress-lbl { font-family: var(--mono); font-size: 11px; color: var(--ink-2); white-space: nowrap; }

.crx-list { margin: 6px 0 4px; }
.crx-sec-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); margin: 16px 0 9px;
}
.crx-sec-label.important { color: var(--danger); }
.crx-sec-label.important + .crx-item { margin-top: 0; }

.crx-item {
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 14px; margin-bottom: 9px;
}
.crx-item.important { border-left: 3px solid var(--danger); }
.crx-item.is-verified { opacity: 0.72; }
.crx-item-top { display: flex; align-items: flex-start; gap: 12px; }
.crx-item-top .crx-ch {
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
  white-space: nowrap; padding-top: 2px;
}
.crx-item-top .crx-ch .ts { color: var(--ink-3); }
.crx-item-top .crx-note { flex: 1; font-size: 13.5px; line-height: 1.45; color: var(--ink-0); }
.crx-sev {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 5px; align-self: center;
}
.crx-sev.important { background: var(--danger-soft); color: var(--danger); }
.crx-sev.minor { background: var(--surface-3); color: var(--ink-3); }
/* The author's own attribution ("who/what they think caused it") — read
   only, distinct from the studio assignee control below the row. */
.crx-cause {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 5px; align-self: center;
  background: var(--surface-3); color: var(--ink-2);
  border: 1px dashed var(--line); white-space: nowrap;
}

.crx-item-controls {
  display: flex; flex-direction: column; gap: 10px; margin-top: 11px;
}
.crx-item-controls form { margin: 0; }
.crx-steprow-wrap {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.crx-assign { display: inline-flex; align-items: center; gap: 8px; }
.crx-assign-form { display: inline-flex; align-items: center; }
.crx-ctl-lbl {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-3);
}
/* Assignee dropdown — themed to the dark UI with a custom chevron so it
   reads as a deliberate control, not raw browser chrome. */
.crx-triage select {
  font-family: var(--body); font-size: 12.5px; color: var(--ink-0);
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.25l4 4 4-4' fill='none' stroke='%239BA0BA' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 11px;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 28px 5px 10px; min-width: 134px; cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.crx-triage select:hover { border-color: var(--ink-2); background-color: var(--surface-3); }
.crx-triage select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* The native option list: dark on browsers that honour it (Firefox). */
.crx-triage select option { background: var(--surface-1); color: var(--ink-1); }

/* Check-off progress steps — mirrors the Splicing tick idiom: one labelled
   pill per stage, filled once the item has reached it. Each is a submit
   button that POSTs the target status to crx_item_status; clicking a filled
   step unchecks it (drops back a stage). */
.crx-steps { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crx-step {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 7px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-2); font-family: var(--body); font-size: 12px;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
button.crx-step { cursor: pointer; }
button.crx-step:hover { border-color: var(--accent); color: var(--ink-0); }
.crx-step-box {
  width: 15px; height: 15px; border-radius: 4px; flex: none;
  border: 1px solid var(--line); background: var(--surface-0);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; color: transparent;
}
.crx-step.on {
  background: var(--good-soft); border-color: var(--good); color: var(--good);
}
.crx-step.on .crx-step-box {
  background: var(--good); border-color: var(--good); color: #0b140d;
}
.crx-step-lbl { white-space: nowrap; }

/* Per-item studio note (team-only working note; distinct from the author's
   request). Inline-editable textarea that saves on blur over HTMX. */
.crx-note-form { width: 100%; }
.crx-note-input {
  width: 100%; resize: vertical; min-height: 34px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-0); color: var(--ink-1);
  font-family: var(--body); font-size: 12.5px; line-height: 1.45;
  padding: 7px 10px;
}
.crx-note-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.crx-note-input::placeholder { color: var(--ink-3); }
.crx-note-ro {
  margin: 0; font-size: 12.5px; color: var(--ink-2);
  border-left: 2px solid var(--line); padding-left: 10px;
}
.crx-close-form { margin-top: 14px; }

/* ---- Author-CRX public form (§6b, author-facing, standalone) ---- */
.crx-public .crx-rows { display: flex; flex-direction: column; gap: 14px; }

/* The compose "notes box": one bordered card holding the fields and, at
   its bottom, the primary "Add to my list" button (crx-author-touchups —
   the submit lives INSIDE the box, not adrift below it). */
.crx-entry {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; background: var(--surface-1);
}
.crx-entry .crx-row {
  border: 0; padding: 0; background: none; border-radius: 0;
}
.crx-row-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px;
}
.crx-row .field-note { grid-column: 1 / -1; }
.crx-entry-foot {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end;
}
.crx-row-actions { margin-top: 8px; }
.crx-add-row { margin: 4px 0 18px; }

/* Mistake-kind toggle: Voice acting / Other, with a free-text field that
   JS reveals only for "Other" (visible always when JS is off). */
.crx-kind { border: 0; padding: 0; margin: 0; min-width: 0; }
.crx-kind-opts { display: flex; gap: 18px; margin: 2px 0 8px; }
.crx-kind-opt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-1); cursor: pointer;
}
.crx-kind-opt input { margin: 0; }
.crx-kind-other { max-width: 340px; }
.crx-kind-other[hidden] { display: none; }

/* ---- Author-CRX worklist: saved notes + delete + finish (public) ---- */
.crx-added {
  border-left: 3px solid var(--good);
}
.crx-saved { margin: 6px 0 22px; }
.crx-saved-h {
  font-size: 14px; margin: 0 0 10px; color: var(--ink-1);
}
.crx-saved-list { list-style: none; margin: 0; padding: 0; }
.crx-saved-item {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; background: var(--surface-1);
}
.crx-saved-main { flex: 1; min-width: 0; }
.crx-saved-ch {
  display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 2px;
}
.crx-saved-ts { color: var(--ink-3); }
.crx-saved-note {
  display: block; font-size: 13.5px; line-height: 1.45; color: var(--ink-0);
}
.crx-saved-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.crx-saved-sev,
.crx-saved-who,
.crx-saved-kind {
  font-size: 11px; padding: 1px 7px; border-radius: 5px;
  background: var(--surface-3); color: var(--ink-2);
}
.crx-saved-del { margin: 0; flex: none; }
.crx-saved-empty { margin: 0; }

.crx-done {
  margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line);
}
.crx-done-lede { margin: 0 0 8px; }
.crx-done-note { border-left: 3px solid var(--good); }

/* ---- Delivery "Ship it" (§6c, docs/ux/redesign/stage_delivery_shipit.html) ---- */
.ship { max-width: 1080px; }
.ship h2 { font-size: 19px; margin: 0 0 3px; }
.ship .ship-sub { color: var(--ink-2); font-size: 13px; margin: 0 0 18px; }

.dest { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.dest .opt {
  flex: 1; min-width: 210px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface-1); padding: 14px 16px;
  cursor: pointer; position: relative; display: block;
}
.dest .opt:hover { border-color: var(--ink-3); }
.dest .opt.sel {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.dest .opt input { position: absolute; opacity: 0; pointer-events: none; }
.dest .opt .dn { font-family: var(--display, var(--body)); font-size: 17px; color: var(--ink-0); }
.dest .opt .dd { color: var(--ink-2); font-size: 12px; margin-top: 3px; line-height: 1.35; }
.dest .opt .radio {
  position: absolute; top: 14px; right: 14px; width: 16px; height: 16px;
  border-radius: 50%; border: 1px solid var(--ink-3);
}
.dest .opt.sel .radio {
  border-color: var(--accent);
  background: radial-gradient(circle at center, var(--accent) 0 5px, transparent 6px);
}
.dest-hint { color: var(--ink-3); font-size: 12px; margin: 0 0 22px; }

.destcfg {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-1); padding: 18px 20px; margin-bottom: 22px;
}
.destcfg h3 {
  font-size: 13px; color: var(--ink-1); font-weight: 600;
  margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.destcfg .legalnote {
  background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 10px; padding: 10px 13px; font-size: 12.5px;
  color: var(--ink-1); margin: 0 0 14px;
}
.destcfg .legalnote b { color: var(--accent-bright); }
.destcfg .kv {
  display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px;
  font-size: 13px; align-items: center; margin: 0;
}
.destcfg .kv dt {
  color: var(--ink-3); font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.destcfg .kv dd { margin: 0; color: var(--ink-0); }
.destcfg .linkgen { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.destcfg .linkgen input {
  flex: 1; min-width: 240px; background: var(--surface-0);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px;
  color: var(--ink-1); font-family: var(--mono); font-size: 12px;
}

.deliv { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.dpill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 13px; font-size: 12.5px; color: var(--ink-1);
}
.dpill .ic {
  width: 18px; height: 18px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px;
  font-weight: 700; flex: none;
}
.dpill.ok .ic { background: var(--good-soft); color: var(--good); }
.dpill.miss { border-color: rgba(var(--accent-rgb), 0.0); border-color: var(--danger); }
.dpill.miss .ic { background: var(--danger-soft); color: var(--danger); }
.dpill a { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 2px; }
.dpill .sub { color: var(--ink-3); font-size: 11px; }

.ship .gate {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line);
}
.ship .gate .gatemsg { color: var(--ink-2); font-size: 12.5px; }
.ship .gate .gatemsg b { color: var(--good); }
.ship .gate .btn.gated { opacity: 0.55; }

.beta {
  margin-top: 26px; border: 1px dashed var(--line);
  border-radius: 14px; padding: 14px 18px;
}
.beta h3 { font-size: 13px; color: var(--ink-1); font-weight: 600; margin: 0 0 4px; }
.beta p { color: var(--ink-2); font-size: 12.5px; margin: 0 0 10px; max-width: 64ch; }
.beta .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.ship .sectlabel {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink-3); margin: 22px 0 8px;
}

/* Per-company delivery-conversion plan panel (delivery_specs.py). The
   rename preview maps each parsed chapter to its company target name;
   the checklist carries the human-only rules. Scoped under .destcfg so it
   inherits the same card chrome as the ACX / Private panels. */
.destcfg .delivspec-rename {
  list-style: none; margin: 0 0 4px; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.destcfg .delivspec-rename li {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px;
}
.destcfg .delivspec-rename .src { color: var(--ink-2); min-width: 9ch; }
.destcfg .delivspec-rename .arrow { color: var(--ink-3); }
.destcfg .delivspec-rename .tgt {
  font-family: var(--mono); font-size: 12px; color: var(--ink-0);
}
.destcfg .delivspec-rename li.extra .src { color: var(--ink-3); font-style: italic; }
.destcfg .delivspec-checklist {
  margin: 0; padding-left: 18px; color: var(--ink-1);
  font-size: 12.5px; display: flex; flex-direction: column; gap: 5px;
}
.destcfg .delivspec-checklist.cond { color: var(--ink-2); }
.destcfg code {
  font-family: var(--mono); font-size: 0.92em;
  background: var(--surface-0); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px;
}

/* ============================================================
   F1 — Notification system (V38)
   Topbar bell + dropdown, plus the three on-site unread
   indicator styles (list-row highlight, in-project section
   color, top-right "@" badge).
   ============================================================ */

/* --- topbar bell + dropdown --- */
.notif-bell {
  position: relative;
  margin-left: auto;
}
.notif-bell > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 8px;
  user-select: none;
}
.notif-bell > summary::-webkit-details-marker { display: none; }
.notif-bell > summary:hover { background: var(--accent-soft); }
.notif-bell-icon { font-size: 1.05rem; line-height: 1; }
/* No unread: gray the bell so a glance says there's nothing new. Still
   clickable — the inbox stays reachable; hover restores most contrast. */
.notif-bell > summary.notif-bell-idle .notif-bell-icon {
  filter: grayscale(1);
  opacity: 0.4;
}
.notif-bell > summary.notif-bell-idle:hover .notif-bell-icon {
  opacity: 0.7;
}
.notif-count {
  min-width: 1.1em;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
.notif-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 340px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  padding: 10px 12px;
  z-index: 60;
}
.notif-loading { margin: 4px 0; }
.notif-menu-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.notif-menu-title { font-weight: 700; color: var(--ink-0); }
.notif-empty { margin: 6px 0; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line-soft);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.is-unread {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
  border-radius: 6px;
}
.notif-link,
.notif-body-btn {
  display: block;
  color: var(--ink-1);
  text-decoration: none;
  font-size: 0.9rem;
  text-align: left;
}
.notif-link:hover,
.notif-body-btn:hover { color: var(--accent-bright); }
.notif-meta { display: block; margin-top: 3px; font-size: 0.72rem; }
.notif-menu-foot { margin: 8px 0 0; font-size: 0.82rem; }
.notif-read-form,
.notif-mark-all-form { margin: 0; }

/* --- settings page --- */
.notif-settings { margin-bottom: 18px; }
.notif-setting-row {
  display: block;
  margin: 10px 0;
}
.notif-demo-form {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.notif-list-page .notif-item { padding: 12px 8px; }

/* --- indicator (a): project-list row highlight --- */
.notify-unread-row { background: var(--accent-soft); }
.notify-dot {
  color: var(--accent);
  margin-right: 4px;
  font-size: 0.7rem;
  vertical-align: middle;
}

/* --- indicator (b): in-project section color until read --- */
.notify-section-unread {
  border-left: 4px solid var(--accent);
  background: linear-gradient(
    90deg,
    var(--accent-soft) 0%,
    transparent 60%
  );
  border-radius: 8px;
}

/* --- indicator (c): top-right "@" badge --- */
.notify-at-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  line-height: 1;
}
.notify-at-badge:hover { background: var(--accent-bright); }

/* --- ITEM 14: @-mention highlight (note surface + board + list) ---
   A direct @-mention in a note flags the project for the mentioned
   user until they open it. Always-on (not gated by the generic
   indicator style); derives from unread mention notifications. */

/* the highlighted notes card on the project Overview. The notes
   surface is a <section class="card project-notes-card …"> — NOT a
   .field-block — so the highlight rule must target that card or the
   border/background accent never paints. */
.project-notes-card.note-mention-hl {
  border-left: 4px solid var(--accent);
  background: linear-gradient(
    90deg,
    var(--accent-soft) 0%,
    transparent 70%
  );
  border-radius: 8px;
  padding-left: 10px;
}
.note-mention-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

/* Notes @mention helpers: the "Mentionable:" handle hint + the post-save
   feedback (who was notified, which handle named nobody). Turns the old
   silent no-op into a visible signal so the writer knows their mention
   actually pinged a teammate. */
.notes-mentionable {
  margin-top: 4px;
  font-size: 0.78rem;
}
.notes-mentionable code {
  margin-right: 2px;
}
.notes-mention-feedback {
  margin-top: 6px;
  font-size: 0.82rem;
}
.notes-mention-feedback p { margin: 2px 0; }
.notes-mention-ok {
  color: var(--good);
  font-weight: 600;
}
.notes-mention-warn {
  color: var(--danger);
  font-weight: 600;
}
.notes-mention-warn code,
.notes-mention-ok strong { white-space: nowrap; }

/* the board card "@" flag (top-right corner, like the stuck flag) */
.bcard.has-mention { box-shadow: inset 0 0 0 1px var(--accent); }
.bcard-mention {
  position: absolute;
  top: 6px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  line-height: 1;
}

/* the project-list "@" marker */
.notify-mention-dot {
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 0 5px;
  margin-right: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  vertical-align: middle;
}

/* #25 — daily-output monthly pacing overview + auto-estimate */
.daily-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: .75rem;
}
.daily-overview-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  background: var(--surface-0);
  border-left: 4px solid var(--ink-2);
}
.daily-overview-card.on-track { border-left-color: var(--good); }
.daily-overview-card.behind { border-left-color: var(--danger); }
.daily-overview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
}
.daily-overview-name { font-size: 1.15rem; font-weight: 800; }
.daily-overview-gauge { margin: .6rem 0; }
.daily-overview-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.daily-overview-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .3s ease;
}
.daily-overview-card.on-track .daily-overview-fill { background: var(--good); }
.daily-overview-gauge-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25em;
  margin-top: .3rem;
  font-size: .85rem;
  color: var(--ink-2);
}
/* Inline monthly-target editor — the FH number reads as text until you
   click into it, then edits in place (mirrors the capacity-override
   number field). Sized to the value so the line stays compact. */
.daily-target-form { display: inline; margin: 0; }
.daily-target-input {
  width: 4.5em;
  font: inherit;
  font-weight: 700;
  color: var(--ink-0);
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--surface-2, transparent);
  text-align: right;
}
.daily-target-input:hover { border-color: var(--line); }
.daily-target-input:focus {
  outline: none;
  border-color: var(--accent, var(--good));
  background: var(--surface-0);
}
.daily-overview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem .75rem;
  margin: .5rem 0 0;
}
.daily-overview-stats > div { margin: 0; }
.daily-overview-stats dt {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-2);
}
.daily-overview-stats dd { margin: .1rem 0 0; font-weight: 700; }
.daily-overview-needed { color: var(--accent-bright); }
.daily-overview-card.on-track .daily-overview-needed { color: var(--good); }
.daily-overview-verdict {
  margin: .7rem 0 0;
  font-size: .9rem;
  font-weight: 600;
}
.daily-overview-card.behind .daily-overview-verdict { color: var(--danger); }
.daily-overview-card.on-track .daily-overview-verdict { color: var(--good); }

/* Item H — daily-output quick-add bar. One prefilled line; the cursor
   lands in the single measure cell. Reuses the app's form primitives
   (.field/.label) so only the bar layout is bespoke. */
.daily-quickadd .qa-intro { margin-bottom: .4rem; }
.daily-quickadd .qa-intro h2 { margin-bottom: .25rem; }
.daily-quickadd .qa-intro .meta { max-width: 60ch; }

.qa-bar {
  display: grid;
  grid-template-columns:
    minmax(130px, 0.8fr)   /* date */
    minmax(120px, 0.7fr)   /* narrator */
    minmax(160px, 1.2fr)   /* project */
    minmax(150px, 1fr)     /* measure */
    auto;                  /* action */
  gap: 12px 14px;
  align-items: end;
  margin-top: .75rem;
}
.qa-bar .qa-cell { min-width: 0; }
/* The measure region is a grouping wrapper, but its child measure fields
   need to participate in the bar grid directly (the active field sits in
   the 4th column). `display: contents` lifts the wrapper's box away so the
   children are grid items of .qa-bar. */
.qa-bar .qa-measure-wrap { display: contents; }
/* Item H no-JS fallback: both measure fields render so a no-JS user can
   log either narrator. With JS the form carries .js-on and the field that
   doesn't match the active narrator's kind is hidden (single-field look). */
.daily-add-form.js-on .qa-measure.is-inactive { display: none; }
.qa-bar .qa-measure {
  grid-column: 4 / 5;
  min-width: 0;
}
.qa-bar .qa-action {
  grid-column: 5 / 6;
  align-self: end;
}
.qa-bar .qa-action .btn { white-space: nowrap; }
/* the "More" disclosure takes its own full-width row */
.qa-bar .qa-more {
  grid-column: 1 / -1;
  margin-top: .35rem;
}
.qa-bar .qa-narr select,
.qa-bar .qa-proj input,
.qa-bar .qa-cell input,
.qa-bar .qa-measure input { width: 100%; }

/* highlight the single measure cell so it reads as the one thing to fill */
.qa-measure .label { color: var(--accent-bright); }
.qa-measure input {
  border-color: var(--accent);
}

.qa-more summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  list-style: none;
}
.qa-more summary::-webkit-details-marker { display: none; }
.qa-more summary::before { content: "▸ "; color: var(--ink-3); }
.qa-more[open] summary::before { content: "▾ "; color: var(--accent); }
.qa-more-body {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 760px) {
  .qa-bar {
    grid-template-columns: 1fr 1fr;
  }
  .qa-bar .qa-measure,
  .qa-bar .qa-action,
  .qa-bar .qa-proj { grid-column: 1 / -1; }
  .qa-bar .qa-action .btn { width: 100%; justify-content: center; }
}

/* ====================================================================
   CALENDAR — capacity dashboard (F-rebuild, Direction C).

   Replaces the retired 12-month forecast grid. Three stacked regions:
   two big per-narrator load gauges, a 12-month sparkline strip, and a
   dense bookings table. Uses the shared bordeaux-v3 :root tokens — the
   design mockup re-declared identical values, so these reference the
   live palette instead. All classes namespaced `cap-` (calendar slots
   keep their own `.cal-*` namespace; no collision).
   ==================================================================== */

/* --- header + controls --- */
.cap-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px;
  margin: 4px 0 18px;
}
.cap-head h1 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink-0);
  font-size: 30px;
  margin: 0 0 4px;
  line-height: 1.05;
}
.cap-head-focus { color: var(--accent-bright); }
.cap-head .meta { margin: 0; max-width: 64ch; }
.cap-controls {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.cap-controls form { margin: 0; }
.cap-field { display: flex; flex-direction: column; gap: 4px; }
.cap-field-lab {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cap-field select {
  background: var(--surface-1);
  color: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px 10px;
  letter-spacing: .04em;
}

/* --- (1) two per-narrator gauges --- */
.cap-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 820px) { .cap-gauges { grid-template-columns: 1fr; } }
.cap-gauge {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 18px 20px;
}
.cap-gauge-over { border-color: var(--danger); }
.cap-gauge-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.cap-gauge-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  color: var(--ink-0);
}
.cap-gauge-state {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 2px;
}
.cap-state-over { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.cap-state-ok { background: var(--good-soft); color: var(--good); border: 1px solid var(--good); }
.cap-state-under { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold); }

.cap-gauge-big {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.cap-gauge-num {
  font-family: var(--display);
  font-weight: 600;
  font-size: 40px;
  color: var(--ink-0);
  line-height: 1;
}
.cap-gauge-of { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.cap-gauge-pct { margin-left: auto; font-family: var(--mono); font-size: 22px; }
.cap-gauge-over .cap-gauge-pct { color: var(--danger); }
.cap-gauge-ok .cap-gauge-pct { color: var(--good); }
.cap-gauge-under .cap-gauge-pct { color: var(--gold); }
.cap-gauge-fh {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .04em;
  margin-bottom: 12px;
}
.cap-fh-over { color: var(--danger); }
.cap-fh-room { color: var(--good); }

/* V60: inline capacity editing (baseline on the year strip, per-month
   override on the focus-month gauges). Quiet, admin-only controls that
   sit alongside the read-only gauge numbers. */
.cap-override-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 2px;
  padding: 1px 5px;
}
.cap-gauge-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 10px 0 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.cap-override-field,
.cap-baseline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cap-override-lab,
.cap-baseline-name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink-2);
}
.cap-override-field input[type="number"],
.cap-baseline-field input[type="number"] {
  width: 8.5em;
  font-family: var(--mono);
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-0);
  color: var(--ink-0);
  text-align: right;
}
.cap-override-field input[type="number"]:focus,
.cap-baseline-field input[type="number"]:focus {
  outline: none;
  border-color: var(--accent, var(--good));
}
.cap-baseline-unit {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.cap-override-hint { font-size: 11px; }
.cap-revert-btn {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
}
.cap-override-revert { display: inline; }

.cap-baseline-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.cap-baseline-lab {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.cap-baseline-form { display: inline; }

.cap-bar {
  position: relative;
  height: 16px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.cap-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 3px;
}
.cap-fill-over { background: var(--danger); }
.cap-fill-ok { background: var(--good); }
.cap-fill-under { background: var(--gold); }
/* Per-narrator gauge fill: Bridget = magenta (--accent), Jake = rose
   (--gold) — the SAME colours the split column + year strip use, so a
   narrator's bar reads the same colour EVERYWHERE. Capacity state
   (under / over) is carried by the state chip + the amber over-segment,
   not by the hue. */
.cap-fill-bridget { background: var(--accent); }
.cap-fill-jake { background: var(--gold); }
.cap-bar-capline {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 2px;
  background: var(--ink-0);
  opacity: .6;
}
/* Over-cap "second lap" (#9): the base fill pins full and this amber
   over-segment overlays it from the LEFT edge, its width the overage as a
   fraction of capacity — so an over month reads as a full bar plus a
   left-anchored overflow that grows with the overage. A subtle hatch keeps
   the over zone legible even on a narrow sliver. */
.cap-bar-over {
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  background: var(--danger);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(0, 0, 0, 0) 0 3px,
    rgba(0, 0, 0, .22) 3px 6px
  );
  border-radius: 3px 0 0 3px;
}
.cap-bar-foot {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

/* Per-narrator estimated progress bar inside each gauge tile (replaces the
   old combined top Progress bar). Mint fill = stage-weighted done-line. */
.cap-gauge-prog { margin: 12px 0 2px; }
.cap-gauge-prog-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  color: var(--ink-2); margin-bottom: 4px;
}
.cap-gauge-prog-est { color: var(--ink-3); }
.cap-gauge-prog-pct { color: var(--good); font-weight: 600; }
.cap-gauge-prog-bar {
  position: relative; height: 8px; background: var(--surface-3);
  border-radius: 3px; overflow: hidden;
}
.cap-gauge-prog-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--good); border-radius: 3px;
}
.cap-gauge-prog-foot { margin-top: 4px; font-size: 10px; }

.cap-gauge-books {
  list-style: none;
  margin: 14px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cap-gauge-books li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.cap-gauge-books a, .cap-book-title {
  color: var(--ink-0);
  text-decoration: none;
  font-weight: 600;
}
.cap-gauge-books a:hover { color: var(--accent-bright); }
.cap-book-au { color: var(--ink-3); font-size: 11px; }
.cap-book-w {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-2);
}
.cap-book-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 5px;
}
.cap-gauge-empty { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
/* Phase-3: top-3 gauge book list + "N more" pointer to the full table. */
.cap-gauge-more {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--ink-3);
  font-style: italic;
}
/* Standardized split-badge variants (one grammar across surfaces). */
.cap-splitlab {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cap-splitlab-solo { color: var(--accent-bright); }
.cap-splitlab-duet { color: var(--ink-2); }
/* The split-badge sits inside the table's split cell next to the bar. */
.cap-bk-tbl .cap-split { margin-right: 8px; }

/* --- (3) bookings table --- */
.cap-bk {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}
.cap-bk-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.cap-bk-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink-0);
  margin: 0;
}
.cap-bk-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .05em;
}
table.cap-bk-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.cap-bk-tbl thead th {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 500;
}
.cap-bk-tbl th.r, .cap-bk-tbl td.r { text-align: right; }
.cap-bk-tbl tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.cap-bk-tbl tbody tr:hover { background: var(--surface-2); }
.cap-bk-title { color: var(--ink-0); text-decoration: none; font-weight: 600; }
a.cap-bk-title:hover { color: var(--accent-bright); }
.cap-bk-au { color: var(--ink-3); font-size: 11.5px; }
.cap-bk-num { font-family: var(--mono); font-size: 11.5px; color: var(--ink-1); }
.cap-styletag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 6px;
}
.cap-split {
  display: inline-flex;
  height: 10px;
  width: 74px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--line);
  vertical-align: middle;
}
.cap-sb { background: var(--accent); }
.cap-sj { background: var(--gold); }
.cap-split-solo {
  background: repeating-linear-gradient(45deg, var(--surface-3), var(--surface-3) 4px, var(--surface-2) 4px, var(--surface-2) 8px);
}
.cap-splitlab {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  margin-left: 7px;
  letter-spacing: .03em;
}
.cap-assign {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent-bright);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
.cap-bk-empty { padding: 16px 18px; margin: 0; }

/* --- not-yet-scheduled --- */
.cap-unsched {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px 18px 16px;
}
.cap-unsched-head {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink-0);
  margin: 0 0 10px;
}
.cap-unsched-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cap-unsched-list li { font-size: 13px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.cap-unsched-list a { color: var(--ink-0); text-decoration: none; font-weight: 600; }
.cap-unsched-list a:hover { color: var(--accent-bright); }
/* Deep-link cue: "schedule in <Month> →" — quiet, pushed to the right. */
.cap-unsched-cue { margin-left: auto; font-size: 11px; color: var(--ink-3); }

/* ---- First Fifteen: pick-an-existing-or-upload source selector ---- */
.first-fifteen-source {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 12px 12px;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.first-fifteen-source > legend.label { padding: 0 4px; }
.first-fifteen-source-opt {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.first-fifteen-source-opt:hover { background: var(--surface-2); }
.first-fifteen-source-opt input[type="radio"] { margin: 0; flex: none; }
.first-fifteen-source-meta {
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.first-fifteen-source-meta code { color: var(--ink-1); }
.first-fifteen-source-new-opt { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 8px; }
/* The new-file input only matters once "Upload a new file" is chosen;
   hide it until then so a chosen prior sample submits cleanly. */
.first-fifteen-source-new { display: none; }
.first-fifteen-source-form:has(.ff-source-new-radio:checked) .first-fifteen-source-new {
  display: flex;
}
/* =====================================================================
   V69 PAYMENTS — the ledger card (v2) + the split dashboard (v3)
   =====================================================================
   Two surfaces, one vocabulary. Colour has exactly one job each here:
     --good   mint   = money in / settled / Paid
     --danger amber  = aging, or a bill we owe that is in hand
     --ink-3  grey   = nothing has started (Pending, unknown amount)
   Brand magenta is deliberately NOT used as an alert. In this app it
   means "current stage"; overloading it here would break the meaning of
   every other screen. Magenta stays what it always is: the focus ring.

   Both surfaces are dense tables of live inputs. The inputs are drawn as
   underlines, not boxes — a form-control border on every cell turns a
   40-row ledger into a wall of chrome. Hover reveals the underline;
   focus turns it magenta. Empty date cells carry a dashed underline so a
   gap reads as "click here", not as "nothing here".
   ===================================================================== */

/* ---- shared: the state toggle ------------------------------------
   One control per row on BOTH surfaces: Pending -> Invoiced -> Paid,
   advanced by clicking, wrapping back to Pending so a mis-click is
   undoable. It reports a state; it is not an instruction, which is why
   it reads as a chip rather than as a call-to-action button.

   The three states are told apart by weight of colour, not by hue
   alone: Pending is the quietest thing on the row, Invoiced borrows the
   aging amber (something is in flight), Paid is the same mint that
   already means "settled" everywhere else on these screens.        */

.pay-state { margin: 0; display: inline-block; }
.pay-state .state {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--bvo-r);
  cursor: pointer;
  white-space: nowrap;
}
.pay-state .state:hover { border-color: var(--accent); color: var(--accent-bright); }
.pay-state .state.invoiced {
  border-color: rgba(226, 122, 63, 0.55);
  color: var(--danger);
  background: var(--danger-soft);
}
.pay-state .state.invoiced:hover { border-color: var(--danger); }
.pay-state .state.paid {
  border-color: rgba(93, 191, 155, 0.5);
  color: var(--good);
  background: var(--good-soft);
}
.pay-state .state.paid:hover { border-color: var(--good); }

/* ---- the ledger card (project detail, v2) ----------------------- */

.led-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 4px; }
.led-head h2 { margin: 0; }
.led-net { margin-left: auto; text-align: right; }
.led-net .n {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-display);
  font-size: 30px;
  line-height: 1;
  color: var(--good);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.02em;
  display: block;
}
.led-net .n.owing { color: var(--danger); }
.led-net .u {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* The table scrolls inside the card rather than pushing the page wide:
   six columns of money data do not fit a narrow window, and a page that
   scrolls sideways loses the nav. */
.payments-card { overflow-x: auto; }
.led { width: 100%; min-width: 720px; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.led thead th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  text-align: left;
  padding: 0 10px 7px;
  border-bottom: 1px solid var(--line);
}
.led thead th.r { text-align: right; }
.led .c-party { width: 19%; }
.led .c-role { width: 14%; }
.led .c-dt { width: 118px; }
.led .c-amt { width: 130px; }
.led .c-act { width: 104px; }
.led tbody td { padding: 0 10px; height: 38px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.led tbody tr:hover td { background: var(--surface-2); }

/* Settled rows fade instead of carrying a "paid" chip — the dates
   already say it, and printing the same fact twice is what made the
   first mockup noisy. */
.led tbody tr.settled { color: var(--ink-3); }
.led tbody tr.settled .party,
.led tbody tr.settled .amt { color: var(--ink-3); font-weight: 500; }
#payments-card .led tbody tr.settled .inline-edit input { color: var(--ink-3); }

.led .party { font-weight: 700; color: var(--ink-0); font-size: 13.5px; }
.led .inline-edit { margin: 0; }
#payments-card .led .inline-edit input {
  font: inherit;
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink-1);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 3px 0;
  width: 100%;
  outline: none;
}
#payments-card .led .inline-edit input:hover { border-bottom-color: var(--line); }
#payments-card .led .inline-edit input:focus { border-bottom-color: var(--accent); color: var(--ink-0); }
#payments-card .led .party .inline-edit input { font-weight: 700; color: var(--ink-0); }
#payments-card .led .role .inline-edit input,
#payments-card .led .note .inline-edit input { color: var(--ink-2); font-size: 12.5px; }
#payments-card .led .note .inline-edit input::placeholder { color: transparent; }
#payments-card .led tr:hover .note .inline-edit input::placeholder { color: var(--ink-3); }

#payments-card .led .dt .inline-edit input {
  font-family: var(--mono);
  font-size: 12px;
  color-scheme: dark;
}
#payments-card .led .dt.empty .inline-edit input { border-bottom: 1px dashed var(--line); }
#payments-card .led .dt.empty .inline-edit input:hover { border-bottom-color: var(--ink-3); }
/* The picker glyph is noise on every row — reveal it on hover / focus. */
.led input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }
.led tr:hover input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.5; }
.led input[type="date"]:focus::-webkit-calendar-picker-indicator { opacity: 0.9; }

.led .amt { text-align: right; white-space: nowrap; }
.led .amt .sg { color: var(--ink-3); font-family: var(--mono); font-size: 13px; padding-right: 1px; }
.led .amt .sg.in { color: var(--good); }
.led .amt .inline-edit { display: inline-block; width: calc(100% - 12px); }
#payments-card .led .amt .inline-edit input {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-0);
  text-align: right;
}
#payments-card .led .amt.due .inline-edit input { color: var(--danger); }
#payments-card .led .amt.soft .inline-edit input { color: var(--ink-3); font-weight: 500; }

.led .act { text-align: right; white-space: nowrap; }
.led .act form { display: inline-block; margin: 0; }
/* The remove control stays invisible until the row is hovered or the
   button itself is focused — a row of × glyphs reads as a demolition
   site, and deleting a money record should take a deliberate move. */
.led .pay-del { margin-left: 6px; opacity: 0; transition: opacity 0.12s ease; }
.led tr:hover .pay-del,
.led .pay-del:focus-within { opacity: 1; }
.led .pay-del button { font-size: 15px; line-height: 1; padding: 0 2px; }

.led tfoot td {
  padding: 9px 10px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
}
.led tfoot .led-legs { text-align: right; }
.led tfoot .amt { text-align: right; color: var(--ink-0); font-size: 13px; font-weight: 600; }
.led-unknown { color: var(--danger); }
.led-empty td { color: var(--ink-2); font-style: italic; }

/* Seed chips + the inline add row. */
.led-add td { padding-top: 12px; padding-bottom: 4px; }
.seed-form { display: inline-block; margin: 0 6px 6px 0; }
.seed {
  background: var(--surface-2);
  border: 1px dashed var(--line);
  color: var(--ink-2);
  border-radius: var(--bvo-r);
  padding: 4px 11px;
  font-family: var(--body);
  font-size: 12.5px;
  cursor: pointer;
}
.seed:hover { border-color: var(--accent); color: var(--ink-0); border-style: solid; }
.seed-other { display: inline-block; vertical-align: top; }
.seed-other > summary { display: inline-block; list-style: none; }
.seed-other > summary::-webkit-details-marker { display: none; }
.pay-add-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.pay-add-form label { margin: 0; }
.pay-add-form input,
.pay-add-form select {
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: var(--bvo-r);
  color: var(--ink-1);
  font-family: var(--body);
  font-size: 13px;
  padding: 5px 8px;
}
.pay-add-form input:focus,
.pay-add-form select:focus { outline: none; border-color: var(--accent); }

/* Derived legacy flags in the Overview field stack. */
.inline-edit.is-derived { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.derived-legacy {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--bvo-r);
  padding: 0 6px;
}
.derived-src { font-size: 12px; color: var(--ink-3); }
.derived-src:hover { color: var(--accent-bright); }

/* ---- the split dashboard (/payments, v3) ------------------------ */

.pay-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.pay-head h1 { margin: 0; }
.pay-head .net { margin-left: auto; text-align: right; }
.pay-head .net .n {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-display);
  font-size: 40px;
  line-height: 1;
  color: var(--good);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.02em;
  display: block;
}
.pay-head .net .n.owing { color: var(--danger); }
.pay-head .net .u {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.sp { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 0 40px; margin-top: 30px; }
.sp-rule { background: var(--line); }
.sp-col { min-width: 0; }
.sp-colhead { display: flex; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sp-colhead .w {
  font-family: var(--display);
  font-variation-settings: var(--fraunces-body);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink-0);
}
.sp-colhead .c { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.sp-colhead .t {
  margin-left: auto;
  font-family: var(--display);
  font-variation-settings: var(--fraunces-display);
  font-size: 26px;
  line-height: 1;
  color: var(--ink-0);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.02em;
}
.sp-col.in .sp-colhead .t { color: var(--good); }

.ent {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  align-items: baseline;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 2px;
}
.ent:hover { background: var(--surface-2); }
.ent .nm {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-0);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ent .nm a { color: inherit; }
.ent .amt {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-0);
  text-align: right;
  white-space: nowrap;
}
.ent .amt.soft { color: var(--ink-3); font-weight: 500; }
.ent .sub {
  grid-column: 1;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ent .sub a { color: inherit; }
.ent .flow { grid-column: 2; display: flex; align-items: center; gap: 9px; justify-self: end; white-space: nowrap; }
.ent .flow form { margin: 0; }

.slot { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
#payments-dash .slot .inline-edit input, #payments-settled-body .slot .inline-edit input {
  font: inherit;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 1px 0;
  outline: none;
  width: 104px;
  color-scheme: dark;
}
#payments-dash .slot .inline-edit input:hover, #payments-settled-body .slot .inline-edit input:hover { border-bottom-color: var(--line); }
#payments-dash .slot .inline-edit input:focus, #payments-settled-body .slot .inline-edit input:focus { border-bottom-color: var(--accent); color: var(--ink-0); }
#payments-dash .slot.blank .inline-edit input, #payments-settled-body .slot.blank .inline-edit input { border-bottom: 1px dashed var(--line); }
#payments-dash .slot.blank .inline-edit input:hover, #payments-settled-body .slot.blank .inline-edit input:hover { border-bottom-color: var(--ink-3); }
.slot input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }
.ent:hover .slot input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.5; }
.slot input[type="date"]:focus::-webkit-calendar-picker-indicator { opacity: 0.9; }
.arrow { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.elapsed {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  width: 46px;
  display: inline-block;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.elapsed.mid { color: var(--ink-1); font-weight: 600; }
.elapsed.hot { color: var(--danger); font-weight: 700; }
.state-slot { width: 88px; display: inline-block; text-align: right; }

.pay-empty { color: var(--ink-2); font-style: italic; padding: 16px 8px; }
.pay-caveat { margin-top: 18px; font-size: 12.5px; color: var(--ink-2); }

.pay-settled { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 16px; }
.pay-settled > summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  list-style: none;
}
.pay-settled > summary::-webkit-details-marker { display: none; }
.pay-settled > summary::before { content: "\25B8  "; }
.pay-settled[open] > summary::before { content: "\25BE  "; }
.pay-settled .sp { margin-top: 18px; opacity: 0.6; }
.pay-settled .sp:hover { opacity: 1; }
#payments-dash .pay-settled .ent .slot .inline-edit input { color: var(--good); }

/* The reachability line under the settled section. Quiet, but never
   absent — it is what proves a page is not the whole history. */
.pay-settled-more { margin-top: 16px; font-size: 12.5px; color: var(--ink-2); }
.pay-settled-more a { color: var(--accent-bright); }

/* Search sits ABOVE the swappable region, in the page frame, so a
   keystroke never re-renders the field being typed into. */
.pay-search { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; }
.pay-search label { flex: 1 1 auto; margin: 0; max-width: 420px; }
.pay-search input[type="search"] {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--bvo-r);
  color: var(--ink-0);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 11px;
}
.pay-search input[type="search"]:focus { border-color: var(--accent); outline: none; }
.pay-search input[type="search"]::placeholder { color: var(--ink-3); }

/* Narrow windows: the two columns stack and the rule turns into a
   divider. The mockups only ever showed a wide studio monitor; a laptop
   at 1000px would otherwise squeeze both columns into ellipses. */
@media (max-width: 1000px) {
  .sp { grid-template-columns: 1fr; gap: 0; }
  .sp-rule { height: 1px; margin: 26px 0; }
  .sp-col.out { margin-top: 6px; }
}
@media (max-width: 620px) {
  .pay-head .net { margin-left: 0; text-align: left; }
  .ent .flow { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
}

/* The shared `.inline-edit` form wrapper carries page-form spacing;
   inside a dense ledger cell it has to be a bare container, and the
   app's global `.inline-edit input[type=...]` rule (a boxed, padded
   form control) has to lose to these — hence the id-scoped selectors
   above. A 40-row ledger drawn as 240 form boxes is unreadable; the
   cells are underlines that appear on hover and turn magenta on
   focus. */
#payments-card .led .inline-edit,
#payments-dash .inline-edit,
#payments-settled-body .inline-edit { margin: 0; padding: 0; border: 0; display: block; }

/* The amount cell keeps its sign glyph and its input on ONE line —
   the sign is a fact of the row's direction, not a separate field, and
   a wrapped sign would double every row's height. */
#payments-card .led td.amt { white-space: nowrap; }
#payments-card .led td.amt .inline-edit {
  display: inline-block;
  width: calc(100% - 14px);
  vertical-align: baseline;
}
#payments-card .led td.amt .sg { display: inline-block; width: 10px; }
