@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/SourceSerif4-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("/fonts/CourierPrime-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("/fonts/CourierPrime-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---- paper & ink (warm page = worst-case bg for contrast) ---- */
  --bg: #f5f1e8;
  --surface: #fffdf7;            /* the coverage sheet */
  --screen: #101412;            /* dark rooms (login + loading) — untouched */
  --on-screen: #f0ede2;
  --screen-dim: #9aa39a;
  --screen-hairline: rgba(240, 237, 226, 0.16);
  /* ---- gold: the single accent, AA-checked on paper ---- */
  --gold: #876931;              /* AA-safe gold TEXT on paper (4.55:1): links, active slug */
  --gold-soft: #c9a86a;         /* lamp gold — DARK ROOMS + focus ring ONLY, never text on paper */
  --gold-display: #876931;      /* unified with --gold: one paper gold for ticks/rules/display */
  --gold-wash: #f1e6cf;         /* gold field fill (producer band, active gate ground); never text */
  /* the rail is ink and gold only — old review-color tints repoint to gold */
  --rev-blue: var(--gold-display);
  --rev-pink: var(--gold-display);
  --rev-yellow: var(--gold-display);
  --rev-green: var(--gold-display);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --ink: #1a1a1a;               /* primary ink, 15.4:1 on paper */
  --body: #33302a;              /* serif body copy — warm near-ink (no green cast) */
  --muted: #5d564b;             /* mono labels/dt — warm neutral gray, AA normal */
  --faint: #645d51;             /* registration ticks/meta — warm gray, AA normal at small sizes */
  --border: #cfd4cb;            /* 1px HAIRLINE: ledger rows, dl separators */
  --border-strong: #1a1a1a;     /* THICK INK RULE (= --ink): field/section/frame edges */
  /* green-SaaS chrome killed — repoint to ink so legacy consumers degrade to ink-on-paper */
  --accent: var(--ink);
  --accent-strong: var(--ink);
  --accent-soft: transparent;
  /* ---- verdicts: AA-safe on both papers, used as stamp border + text ---- */
  --green: #2e7c57;             /* advance / greenlit (4.50:1) */
  --green-soft: #e4f0e7;        /* wash fill only, never text */
  --yellow: #966418;            /* conditions — ochre-amber (4.51:1); true yellow can't hit AA on paper */
  --yellow-soft: #f7eed6;       /* wash fill only */
  --red: #cc3525;               /* hold / pass — brick (4.54:1) */
  --red-soft: #f6e3df;          /* wash fill only */
  --locked: #5d564b;            /* held / locked — warm neutral (matches muted) */
  --locked-soft: #eceee9;       /* wash fill only */
  /* blue chrome killed — repoint to ink / gold-wash */
  --blue: var(--ink);
  --blue-soft: var(--gold-wash);
  /* ---- structure: brutalist hard corners, no soft shadow ---- */
  --radius: 0;
  --radius-sm: 0;
  --radius-stamp: 2px;          /* the one survivor — a rubber stamp has a hair of round */
  --shadow-sm: none;
  --shadow-md: none;
  --offset: 6px 6px 0 var(--ink);   /* the only depth cue: hard ink offset, no blur, reserved */
  /* ---- fluid type scale ---- */
  --fs-display: clamp(2.4rem, 6vw, 4.6rem);
  --fs-h2: clamp(1.7rem, 3.4vw, 2.7rem);
  --fs-h3: clamp(1.25rem, 2vw, 1.55rem);
  --fs-lead: clamp(1.1rem, 1.7vw, 1.3rem);
  --fs-slug: clamp(0.72rem, 1.1vw, 0.82rem);
  --fs-drop: clamp(2.6rem, 6vw, 4.4rem);
  --fs-micro: 0.7rem;
  /* ---- fonts (two-font law: serif + mono, no system sans) ---- */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --brand: "Courier Prime", "Courier New", Courier, ui-monospace, monospace;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--body);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--serif);
  text-wrap: balance;
}

p,
li,
dd {
  text-wrap: pretty;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* Visually hidden but kept in the DOM, focusable-by-script, and (critically)
   still fillable: the #material textarea is hidden from users — file upload is
   the visible primary input — but the server reads body.material, the upload
   flow writes parsed text into it, and the test harness fills it. NOT
   display:none (that would make it unfillable / non-submittable in some flows);
   a 1px clipped box keeps it laid out, editable, and Playwright-visible. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* The slug-header: a mono coverage label + a 44x2 gold tick. Opens every section,
   echoing the homepage .step-slug / .slug-tick — the shared screenplay vocabulary. */
.eyebrow {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-family: var(--brand);
  font-size: var(--fs-slug);
  font-weight: 700;
  gap: 14px;
  letter-spacing: 0.16em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.eyebrow::before {
  background: var(--gold-display);
  content: "";
  flex: none;
  height: 2px;
  width: 44px;
}

.muted {
  color: var(--muted);
}

/* ---------- Buttons & form controls ---------- */

/* Buttons are mono labels struck into ink — no fills, no rounds, no soft shadow. */
.primary-button,
.primary-inline-button {
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--bg);
  font-family: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  padding: 13px 24px;
  text-transform: uppercase;
  transition: background 0.15s ease, color 0.15s ease;
}

.primary-button:hover,
.primary-inline-button:hover {
  background: transparent;
  color: var(--ink);
}

.primary-button:active,
.primary-inline-button:active {
  transform: translateY(1px);
}

.primary-inline-button {
  padding: 11px 20px;
}

.primary-inline-button.yellow {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--surface);
}

.primary-inline-button.yellow:hover {
  background: transparent;
  color: var(--yellow);
}

.primary-inline-button.red {
  background: var(--red);
  border-color: var(--red);
  color: var(--surface);
}

.primary-inline-button.red:hover {
  background: transparent;
  color: var(--red);
}

.secondary-button {
  background: transparent;
  border: 2px solid var(--border-strong);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 11px 18px;
  text-transform: uppercase;
  transition: box-shadow 0.12s ease, transform 0.12s ease;
}

.secondary-button:hover {
  background: var(--surface);
}

@media (prefers-reduced-motion: no-preference) {
  .secondary-button:hover {
    box-shadow: 4px 4px 0 var(--ink);
    transform: translate(-2px, -2px);
  }
}

.ghost-button {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  font-family: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 9px 12px;
  text-transform: uppercase;
}

.ghost-button:hover {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: var(--gold-display);
  text-underline-offset: 4px;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

label {
  color: var(--muted);
  display: block;
  font-family: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: #ece6d8;
  border: 2px solid var(--border-strong);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--serif);
  padding: 11px 13px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 2px var(--gold-display);
  outline: none;
}

textarea {
  line-height: 1.55;
  min-height: 230px;
  resize: vertical;
}

/* The logline is a few sentences, not a paste box. */
#logline {
  min-height: 84px;
}

.form-error {
  color: var(--red);
  font-family: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin: 10px 0 0;
  min-height: 1.2em;
}

/* ---------- Shared app header (every view) ---------- */
/* One slim bar across login, projects, workbench, and read. Mirrors the
   marketing header's wordmark treatment but is account-aware. Driven by
   body[data-view]: login shows wordmark + back link; signed-in views show the
   account menu + a thin secondary action row (Projects / Create project). */

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-header-bar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
  min-height: 60px;
  padding: 12px clamp(18px, 4vw, 40px);
}

.app-wordmark {
  color: var(--ink);
  font-family: var(--brand);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-wordmark:hover { color: var(--gold); }

.app-header-home {
  color: var(--muted);
  font-family: var(--brand);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-header-home:hover { color: var(--ink); }

.app-header-account {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-end;
}

/* Per-view header state. Default (signed-in views): account row, no back link. */
.app-header-home { display: none; }

/* Login threshold: invert to read on the dark --screen, show only the
   wordmark + back link. */
body[data-view="login"] .app-header {
  background: var(--screen);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
body[data-view="login"] .app-wordmark { color: var(--on-screen); }
body[data-view="login"] .app-wordmark:hover { color: var(--gold-soft, #d9b96f); }
body[data-view="login"] .app-header-home { display: inline-block; color: var(--screen-dim); }
body[data-view="login"] .app-header-home:hover { color: var(--on-screen); }
body[data-view="login"] .app-header-account { display: none; }

/* Secondary view actions: "Create project" only on the projects list,
   "Projects" switch only away from the projects list. */
.app-header-create,
.app-header-projects { display: none; }
body[data-view="projects"] .app-header-create { display: inline-flex; }
body[data-view="workbench"] .app-header-projects,
body[data-view="read"] .app-header-projects { display: inline-flex; }

/* A simple section heading replaces the old per-view topbars. */
.view-head {
  padding: 26px 0 18px;
}
.view-head .eyebrow { margin-bottom: 2px; }
.view-head h1 {
  font-family: var(--brand);
  font-size: 1.55rem;
  letter-spacing: 0.09em;
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
}
.view-head #engine-chip { margin-top: 8px; }

@media (max-width: 720px) {
  .app-header-bar { gap: 10px; min-height: 52px; padding: 10px 16px; }
  .app-wordmark { font-size: 0.74rem; letter-spacing: 0.14em; }
  .app-header-account { gap: 6px; }
  .app-header-projects,
  .app-header-create { font-size: 0.72rem; }
}

/* ---------- Login ---------- */

/* The login fills the space between the (sticky 60px) app header and the
   footer, centered, without forcing the page past one viewport. */
.login-view {
  display: grid;
  min-height: calc(100dvh - 60px);
  padding: 40px 24px;
  place-items: center;
}

/* One clean column: heading, fields, button pair, divider, Google, foot line.
   The shell ships neutral (no form) and only reveals a form once
   [data-login-ready] is set after /api/config resolves — fixes the FOUC. */
.login-shell {
  text-align: left;
  width: min(380px, 100%);
}

.login-panel {
  background: transparent;
  border: 0;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  width: 100%;
}

/* Neutral until config resolves: a tiny skeleton placeholder reserves the
   column so nothing flashes and the layout does not jump. */
.login-shell:not([data-login-ready]) .login-panel::before {
  background: var(--screen-hairline);
  content: "";
  display: block;
  height: 168px;
}

.login-title {
  font-family: var(--brand);
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  line-height: 1.15;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.platform-login,
.legacy-login {
  display: grid;
  gap: 14px;
}

.platform-login.hidden,
.legacy-login.hidden {
  display: none;
}

.login-field {
  display: grid;
  gap: 0;
}

.login-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.login-actions .primary-button,
.login-actions .secondary-button {
  width: 100%;
}

/* "or" divider: a hairline rule with a centered mono token. */
.login-divider {
  align-items: center;
  color: var(--screen-dim);
  display: grid;
  font-family: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  letter-spacing: 0.12em;
  margin: 2px 0;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  background: var(--screen-hairline);
  content: "";
  height: 1px;
}

.google-button {
  align-items: center;
  background: transparent;
  border: 2px solid var(--border-strong);
  color: var(--ink);
  display: flex;
  font-family: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0.07em;
  min-height: 46px;
  padding: 11px 18px;
  text-transform: uppercase;
  width: 100%;
}

.google-button::before {
  content: "G";
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  margin-right: 10px;
}

.google-button:hover {
  background: var(--surface);
}

/* Foot line: a quiet "Reset password" link on the left, the subtle inline
   auth status on the right. No prominent standing banner. */
.login-foot {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: space-between;
  margin-top: 2px;
  min-height: 1.4em;
}

.login-link {
  background: transparent;
  border: 0;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.84rem;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-link:hover {
  text-decoration-thickness: 2px;
}

.auth-status {
  color: var(--faint);
  font-size: 0.8rem;
  margin: 0;
}

.auth-status.error {
  color: var(--red);
  font-family: var(--brand);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.login-support {
  color: var(--faint);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 18px 0 0;
}

/* ---------- First-run intro modal (replaces the orientation page) ---------- */

.intro-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 200;
}

.intro-backdrop {
  background: rgba(20, 18, 15, 0.55);
  inset: 0;
  position: absolute;
}

.intro-card {
  background: var(--bg);
  border: 1px solid var(--ink);
  box-shadow: 0 18px 60px rgba(20, 18, 15, 0.28);
  max-height: calc(100vh - 48px);
  max-width: 560px;
  overflow-y: auto;
  padding: 34px 34px 30px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.intro-card::before {
  background: var(--gold-display);
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  top: 0;
  width: 64px;
}

.intro-close {
  background: none;
  border: 0;
  color: var(--faint);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px 8px;
  position: absolute;
  right: 10px;
  top: 8px;
}

.intro-close:hover { color: var(--ink); }

.intro-card h2 {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  margin: 6px 0 14px;
}

.intro-lead {
  color: var(--body);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 18px;
}

.intro-steps {
  counter-reset: intro;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.intro-steps li {
  border-top: 1px solid var(--border);
  color: var(--body);
  counter-increment: intro;
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.55;
  padding: 12px 0 12px 30px;
  position: relative;
}

.intro-steps li::before {
  color: var(--gold);
  content: counter(intro);
  font-family: var(--brand);
  font-weight: 700;
  left: 0;
  position: absolute;
  top: 12px;
}

.intro-steps strong { color: var(--ink); }

.intro-privacy {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--brand);
  font-size: 0.78rem;
  line-height: 1.6;
  margin: 0 0 22px;
  padding-top: 16px;
}

.intro-privacy a { color: var(--gold); text-decoration: none; }
.intro-privacy a:hover { text-decoration: underline; }

/* ---------- App footer (site nav from inside the workbench) ---------- */

.app-footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 32px 24px 44px;
  text-align: center;
}

/* On the dark login threshold the footer inverts to read on --screen, so the
   marketing-style fine print + nav stays present on every view (incl. login). */
body[data-view="login"] .app-footer {
  background: var(--screen);
  border-top-color: rgba(255, 255, 255, 0.12);
  margin-top: 0;
}
body[data-view="login"] .app-footer-nav a { color: var(--screen-dim); }
body[data-view="login"] .app-footer-nav a:hover { color: var(--on-screen); }
body[data-view="login"] .app-footer-fine { color: var(--screen-dim); }

.app-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: center;
  margin: 0 0 16px;
}

.app-footer-nav a {
  color: var(--muted);
  font-family: var(--brand);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.18s ease;
}

.app-footer-nav a:hover { color: var(--ink); }

.app-footer-fine {
  color: var(--faint);
  font-family: var(--brand);
  font-size: 0.72rem;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 64ch;
}

/* ---------- Projects ---------- */

.projects-view {
  margin: 0 auto;
  max-width: 1120px;
  min-height: 100vh;
  padding: 0 24px 80px;
}

.projects-lede {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 6px 0 28px;
  max-width: 62ch;
}

.account-notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold-display);
  color: var(--muted);
  font-family: var(--serif);
  line-height: 1.45;
  margin: 0 0 18px;
  max-width: 720px;
  padding: 12px 14px;
}

.account-notice[data-tone="success"] {
  border-left-color: var(--green);
  color: var(--ink);
}

.account-notice[data-tone="warning"],
.account-notice[data-tone="loading"] {
  border-left-color: var(--yellow);
}

.account-notice[data-tone="error"] {
  border-left-color: var(--red);
  color: var(--red);
}

.activation-panel {
  align-items: end;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 0 24px;
  padding: 24px;
}

.activation-panel h2 {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.12;
  margin: 0 0 8px;
}

.activation-panel p:not(.eyebrow) {
  color: var(--muted);
  margin: 0;
  max-width: 64ch;
}

.activation-actions {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.projects-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin: 0 0 26px;
}

.projects-grid .support-empty {
  grid-column: 1 / -1;
  text-align: center;
}

.project-card h3,
.draft-card h3 {
  font-family: var(--serif);
  font-size: 1.18rem;
  margin: 4px 0 10px;
}

.project-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.project-create-card input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  margin: 10px 0 4px;
  padding: 10px 12px;
  width: 100%;
}

.draft-history .draft-history-note {
  font-size: 0.92rem;
  margin: 0 0 14px;
}

.saved-read-line {
  color: var(--gold);
}

/* ---------- Workbench frame ---------- */

.workbench {
  margin: 0 auto;
  max-width: 1120px;
  padding: 0 24px 80px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 26px 0 22px;
  position: relative;
}

.topbar .eyebrow {
  margin-bottom: 2px;
}

.topbar h1 {
  font-family: var(--brand);
  font-size: 1.55rem;
  letter-spacing: 0.09em;
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
}

.topbar #engine-chip {
  margin-top: 8px;
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-end;
}

.account-menu {
  position: relative;
  z-index: 20;
}

.account-menu > summary {
  list-style: none;
}

.account-menu > summary::-webkit-details-marker {
  display: none;
}

.account-menu-trigger {
  background: var(--surface);
  border: 2px solid var(--border-strong);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  min-width: 112px;
  padding: 10px 15px;
  text-align: center;
  text-transform: uppercase;
}

.account-menu[open] .account-menu-trigger,
.account-menu-trigger:hover {
  background: var(--ink);
  color: var(--bg);
}

.account-menu-panel {
  background: var(--surface);
  border: 2px solid var(--border-strong);
  box-shadow: 6px 6px 0 var(--ink);
  display: grid;
  gap: 8px;
  min-width: 280px;
  padding: 16px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
}

.account-menu-label {
  color: var(--faint);
  font-family: var(--brand);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0;
  text-transform: uppercase;
}

.account-menu-email,
.account-menu-credit {
  color: var(--ink);
  font-family: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}

.account-menu-credit {
  color: var(--gold);
}

.account-menu-panel .secondary-button,
.account-menu-panel .ghost-button,
.account-menu-link {
  justify-self: stretch;
  text-align: left;
}

.account-promo {
  display: flex;
  gap: 6px;
  justify-self: stretch;
}
.account-promo-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--brand);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  padding: 7px 9px;
}
.account-promo-input::placeholder { color: var(--faint); }
.account-promo .ghost-button { flex: 0 0 auto; }

.account-menu-link {
  color: var(--ink);
  font-family: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 9px 12px;
  text-decoration: none;
  text-transform: uppercase;
}

.account-menu-link:hover {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.mode-chip {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  display: inline-flex;
  font-family: var(--brand);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 11px;
  text-transform: uppercase;
}

.mode-chip.model {
  background: var(--gold-wash);
  border-color: var(--border-strong);
  color: var(--ink);
}

.mode-chip.cached {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--muted);
}

.mode-chip.demo {
  background: var(--yellow-soft);
  border-color: var(--yellow);
  color: var(--yellow);
}

.account-chip,
.credit-chip {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Flow strip ---------- */

/* The flow strip is a screenplay slug sequence, ruled top and bottom — not cards. */
.flow-strip {
  border-bottom: 2px solid var(--border-strong);
  border-top: 2px solid var(--border-strong);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 30px;
}

.flow-step {
  align-items: start;
  background: transparent;
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--border);
  box-shadow: none;
  column-gap: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  opacity: 1;
  padding: 14px 18px;
}

.flow-step:last-child {
  border-right: 0;
}

.flow-step span {
  align-self: start;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--faint);
  display: block;
  font-family: var(--brand);
  font-size: 1.45rem;
  font-weight: 700;
  grid-row: span 2;
  height: auto;
  line-height: 1;
  width: auto;
}

.flow-step strong {
  color: var(--faint);
  font-family: var(--brand);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.flow-step small {
  color: var(--faint);
  font-size: 0.8rem;
}

.flow-step.active {
  box-shadow: inset 0 -3px 0 var(--gold-display);
}

.flow-step.active span {
  color: var(--gold);
}

.flow-step.active strong {
  color: var(--ink);
}

.flow-step.complete span,
.flow-step.complete strong {
  color: var(--ink);
}

/* ---------- Intake ---------- */

.intake-details {
  background: transparent;
  border: 2px solid var(--border-strong);
  border-radius: 0;
  box-shadow: none;
  margin: 0 0 18px;
}

.intake-details > summary {
  align-items: baseline;
  cursor: pointer;
  display: flex;
  gap: 14px;
  padding: 18px 22px;
}

.intake-details > summary > span {
  color: var(--faint);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.intake-details > summary > strong {
  color: var(--ink);
  font-weight: 650;
}

.intake-details[open] > summary {
  border-bottom: 1px solid var(--border);
}

.sample-panel,
.intake-card {
  padding: 20px 22px;
}

.sample-backup {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0;
}

.sample-backup > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 16px 22px;
}

.sample-backup > summary::-webkit-details-marker {
  display: none;
}

/* Hide the native disclosure triangle on every sample/draft panel — the custom
   summary content is the affordance; a bare ▶ reads as broken markup. */
.sample-panel > summary {
  cursor: pointer;
  list-style: none;
}

.sample-panel > summary::-webkit-details-marker {
  display: none;
}

.sample-backup > summary strong {
  color: var(--ink);
  display: block;
  font-size: 0.98rem;
}

.sample-backup .sample-grid {
  border-top: 1px solid var(--border);
  padding: 18px 22px 22px;
}

.section-heading {
  align-items: end;
  border-bottom: 2px solid var(--border-strong);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  margin: 0 0 22px;
  padding-bottom: 12px;
}

.section-heading h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0;
}

.compact-heading {
  margin-bottom: 14px;
}

.sample-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sample-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  padding: 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sample-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.sample-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.sample-card h3 {
  font-size: 1.1rem;
  margin: 0;
}

.sample-card .secondary-button {
  justify-self: start;
}

.support-empty {
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--faint);
  padding: 16px;
}

.field-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 14px;
}

.field-group {
  min-width: 0;
}

.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 6px 0 0;
}

.intent-hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin: -4px 0 16px;
}

/* Material is the hero input; everything else is optional context. */
.field-required {
  color: var(--gold);
  font-family: var(--brand);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.intent-details {
  border-top: 1px solid var(--border);
  margin: 16px 0 0;
}

.intent-details .intent-row {
  margin-top: 16px;
}

.field-optional {
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.intent-row input {
  width: 100%;
}

.field-label {
  color: var(--muted);
  display: block;
  font-family: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.format-toggle {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.format-option {
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: 0;
  color: var(--body);
  cursor: pointer;
  font-family: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-left: -2px;
  min-height: 44px;
  padding: 9px 8px;
  text-transform: uppercase;
}

.format-option:first-child {
  margin-left: 0;
}

.format-option:hover {
  background: var(--bg);
}

.format-option.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
  position: relative;
  z-index: 1;
}

.intake-card form > .field-group {
  margin-bottom: 14px;
}

.intake-actions {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-top: 4px;
}

.sample-source {
  color: var(--faint);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
}

.credit-use-note {
  color: var(--muted);
  font-family: var(--brand);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  max-width: 46ch;
  text-transform: uppercase;
}

.upload-status {
  align-items: center;
  background: var(--blue-soft);
  border: 1px solid rgba(61, 90, 115, 0.28);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 10px;
  padding: 14px 16px;
}

.upload-status h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.upload-status p {
  margin: 0 0 4px;
}

/* ---------- Loading & error ---------- */

.error-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 0 0 18px;
  padding: 30px;
  text-align: center;
}

.loading-panel {
  align-items: center;
  background: rgba(16, 20, 18, 0.55);
  display: grid;
  inset: 0;
  padding: 24px;
  place-items: center;
  position: fixed;
  z-index: 40;
}

.loading-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 560px;
  padding: 30px;
  text-align: center;
  width: min(100%, 560px);
}

.loading-panel h2,
.error-panel h2 {
  margin: 0 0 8px;
}

.loading-panel .muted {
  margin: 0 auto 12px;
  max-width: 520px;
}

.progress-track {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0;
  height: 10px;
  margin: 18px 0 12px;
  overflow: hidden;
}

.progress-track span {
  background: linear-gradient(90deg, var(--accent), var(--blue));
  display: block;
  height: 100%;
  transition: width 0.35s ease;
  width: 0;
}

.loading-timer {
  color: var(--accent);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  margin: 0 0 16px;
}

.loading-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.loading-steps span {
  animation: pulse 1.6s ease-in-out infinite;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 14px;
  text-transform: uppercase;
}

.loading-steps span:nth-child(2) { animation-delay: 0.2s; }
.loading-steps span:nth-child(3) { animation-delay: 0.4s; }
.loading-steps span:nth-child(4) { animation-delay: 0.6s; }
.loading-steps span:nth-child(5) { animation-delay: 0.8s; }

@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.error-panel {
  border-color: rgba(179, 54, 42, 0.4);
  border-left: 4px solid var(--red);
  text-align: left;
}

.error-panel.waiting {
  border-color: rgba(176, 129, 38, 0.38);
  border-left-color: var(--yellow);
}

.error-panel.needs-credit {
  border-color: rgba(176, 129, 38, 0.38);
  border-left-color: var(--gold-display);
}

.error-panel .decision-actions {
  margin-top: 16px;
}

/* ---------- Report ---------- */

.report {
  display: grid;
  gap: 56px;
}

.report-summary {
  align-items: end;
  background: var(--surface);
  border: 3px solid var(--border-strong);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: clamp(22px, 3vw, 34px);
}

.report-summary h2 {
  font-family: var(--brand);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  letter-spacing: 0.08em;
  line-height: 1.08;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.report-summary .coverage-verdict {
  margin: 0 0 16px;
}

.report-summary-headline {
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-lead);
  line-height: 1.45;
  margin: 0 0 12px;
  max-width: 72ch;
}

.report-summary-meta {
  color: var(--muted);
  font-family: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin: 0;
  text-transform: uppercase;
}

.report-summary-actions {
  display: grid;
  gap: 10px;
  min-width: 220px;
}

/* Sections are flat regions of one document, divided by their heading rule — not cards. */
.report-section {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

/* The diagnosis is the document's framed master header — the one true sheet. */
.diagnosis-card {
  background: var(--surface);
  border: 3px solid var(--border-strong);
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.diagnosis-card h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  line-height: 1.25;
  margin: 0 0 14px;
}

.thesis-body {
  color: var(--body);
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.65;
  margin: 0 0 12px;
}

.diagnosis-card .muted {
  margin: 0 0 12px;
}

.primary-question {
  border-left: 3px solid var(--border-strong);
  color: var(--muted);
  font-style: italic;
  margin: 0 0 14px;
  padding-left: 14px;
}

.gate-policy {
  color: var(--faint);
  font-size: 0.9rem;
  margin: 0 0 6px;
}

.headline-grid {
  border-top: 2px solid var(--border-strong);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
  padding-top: 18px;
}

.headline-card {
  background: transparent;
  border-radius: 0;
  padding: 0 22px 0 0;
}

.headline-card.creative {
  border-right: 1px solid var(--border);
}

.headline-card.commercial {
  padding: 0 0 0 22px;
}

.headline-card h3 {
  font-family: var(--serif);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
  margin: 6px 0 0;
}

.engine-line {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin: 20px 0 0;
  padding-top: 16px;
}

.engine-line.model { color: var(--gold); }
.engine-line.cached { color: var(--muted); }
.engine-line.demo { color: var(--yellow); }

.diagnosis-card .secondary-button {
  margin-top: 14px;
}

/* ---------- Gate review ---------- */

.journey-line {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 14px;
}

.journey-line strong {
  color: var(--ink);
}

.gate-rail {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 16px;
}

/* The four phases as a stack of collapsible coverage cards (the read, not a drive-task). */
.gate-intro {
  color: var(--muted);
  font-family: var(--serif);
  margin: 0 0 22px;
  max-width: 66ch;
}

/* §2: one-at-a-time advancement control beneath the revealed phase. */
.gate-advance {
  align-items: flex-start;
  border-top: 2px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 2px;
  padding-top: 26px;
}

.gate-advance .muted {
  font-family: var(--serif);
  margin: 0;
  max-width: 66ch;
}

.gate-advance.stalled {
  border-top-color: var(--gold);
}

.gate-stall-line {
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.55;
  margin: 0;
  max-width: 66ch;
}

.gate-advance-button {
  align-self: flex-start;
}

/* The single most obvious action at the end of a pass: bring the next draft. */
.upload-new-pass {
  align-self: stretch;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  padding: 18px 24px;
  text-align: center;
  width: 100%;
}

/* ---------- Tabbed stage-ledger read ----------
   The read is one document split into stage tabs. #report-body[data-tabbed]
   shows exactly one panel group at a time, keyed off data-active-tab:
     - a phase tab ("phase-N") shows #gate-section (with only the matching
       .gate-card.tab-active visible) and hides the synthesis family;
     - the Verdict tab shows the synthesis family and hides #gate-section.
   This is a class/attribute toggle over the existing sections — the section
   DOM is never restructured, so the verdict-first DOM order (and the print /
   Download-PDF linear document, which expands everything) is preserved. */

/* Phase tab: only the gate section shows; synthesis sections hide. */
#report-body[data-tabbed]:not([data-active-tab="verdict"]) > section:not(#gate-section) {
  display: none;
}
/* Within the gate section, only the active phase's card shows. */
#report-body[data-tabbed]:not([data-active-tab="verdict"]) #gate-report .gate-card:not(.tab-active) {
  display: none;
}
/* Verdict tab: the gate section hides; the synthesis family shows (each section
   still respects its own .hidden class when its renderer left it empty). */
#report-body[data-tabbed][data-active-tab="verdict"] > #gate-section {
  display: none;
}

.gate-replay {
  align-self: flex-start;
  margin-top: 18px;
}

.gate-card {
  border-top: 1px solid var(--border);
}

.gate-card:first-of-type {
  border-top: 2px solid var(--border-strong);
}

.gate-card:last-of-type {
  border-bottom: 2px solid var(--border-strong);
}

.gate-card[open] {
  background: transparent;
}

.gate-card > summary {
  align-items: baseline;
  column-gap: 16px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  list-style: none;
  padding: 18px 44px 18px 16px;
  position: relative;
}

.gate-card > summary::-webkit-details-marker {
  display: none;
}

.gate-card > summary::after {
  color: var(--faint);
  content: "+";
  font-family: var(--brand);
  font-size: 1.2rem;
  position: absolute;
  right: 18px;
  top: 16px;
}

.gate-card[open] > summary::after {
  content: "\2013";
}

.gate-card > summary:hover {
  background: var(--bg);
}

.gate-card[open] > summary:hover {
  background: transparent;
}

.gate-card .gate-number {
  align-self: start;
  grid-row: span 2;
}

.gate-card[open] .gate-number {
  color: var(--gold);
}

.gate-card .gate-name {
  align-self: baseline;
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-h3);
  font-weight: 600;
  grid-column: 2;
}

.gate-card .gate-pov {
  grid-column: 2;
}

.gate-card .status {
  align-self: center;
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
}

.gate-card-body {
  padding: 0 16px 28px 72px;
}

.gate-card.locked {
  opacity: 0.72;
}

/* C1: the phase verdict is the headline — large and prominent at the very top
   of the phase read, above the prose. */
.gate-card .verdict-stamp {
  font-size: 1.9rem;
  margin: 2px 0 18px;
  padding: 14px 22px 12px;
}
@media (max-width: 560px) {
  .gate-card .verdict-stamp { font-size: 1.2rem; padding: 11px 16px 10px; }
}

.gate-card .gate-notes {
  border-left: 0;
  margin-top: 18px;
  padding-left: 0;
}

/* Cosmetic / clerical items: set aside from the read, flagged for cleanup. */
.gate-cleanup {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 16px;
}

.cleanup-note {
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
  margin: 0 0 12px;
}

/* On narrow screens the phase name gets the full column; the status chip drops below it. */
@media (max-width: 560px) {
  .gate-card > summary {
    column-gap: 12px;
    grid-template-columns: 38px minmax(0, 1fr);
    padding-right: 36px;
  }
  .gate-card .status {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
    margin-top: 6px;
  }
  .gate-card-body {
    padding-left: 18px;
  }
}

.gate-step {
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  column-gap: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 14px 16px;
  text-align: left;
  transition: background 0.15s ease;
}

.gate-step:hover {
  background: var(--bg);
}

.gate-step.active {
  background: var(--gold-wash);
}

.gate-step.locked {
  opacity: 0.7;
}

/* Phase number as a hung mono drop-figure — the rail reads like a script's scene index. */
.gate-number {
  align-items: start;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--faint);
  display: block;
  font-family: var(--brand);
  font-size: 1.7rem;
  font-weight: 700;
  grid-row: span 3;
  height: auto;
  justify-content: start;
  line-height: 1;
  width: auto;
}

.gate-step.active .gate-number {
  background: transparent;
  border-color: transparent;
  color: var(--gold);
}

.gate-name {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.gate-pov {
  color: var(--faint);
  font-family: var(--brand);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.mini-status,
.status {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  text-transform: uppercase;
  width: fit-content;
}

.status {
  font-size: 0.78rem;
  padding: 5px 13px;
}

.mini-status.green, .status.green { background: var(--green-soft); color: var(--green); }
.mini-status.yellow, .status.yellow { background: var(--yellow-soft); color: var(--yellow); }
.mini-status.red, .status.red { background: var(--red-soft); color: var(--red); }
.mini-status.locked, .status.locked { background: var(--locked-soft); color: var(--locked); }

.gate-panel {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
  margin: 0 0 16px;
}

.stage-topline {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin: 0 0 8px;
}

.stage-topline h3 {
  font-family: var(--serif);
  font-size: var(--fs-h3);
  margin: 0;
}

.score-line {
  color: var(--faint);
  font-size: 0.85rem;
  font-weight: 650;
  margin: 0 0 10px;
}

.gate-question {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 10px;
}

.item-body {
  color: var(--body);
  margin: 0 0 10px;
}

.evidence-line {
  color: var(--faint);
  font-size: 0.85rem;
  margin: 0;
}

/* C2: attribution / system lines ("Independent … perspective completed …") label
   the read above — they are NOT the agent's voice. Set them apart: parenthetical,
   de-emphasized, ruled off from the prose. */
.attribution-line {
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.78rem;
  font-style: italic;
  letter-spacing: 0.01em;
  margin: 14px 0 0;
  padding-top: 10px;
}

/* C3: Creative Attachments speaks as three distinct chairs — Director / Lead /
   Supporting each get their own paragraph with a bold role tag so the reader
   always knows who is talking. (Studio Development's DISTRIBUTION LANE call is
   tagged the same way.) */
.item-body.role-line {
  margin: 0 0 12px;
}
.item-body.role-line:last-of-type {
  margin-bottom: 0;
}
.role-tag {
  display: inline-block;
  font-family: var(--brand);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  margin-right: 6px;
  text-transform: uppercase;
  color: var(--gold);
}

.gate-notes {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

.gate-list {
  color: var(--body);
  display: grid;
  font-size: 0.93rem;
  gap: 8px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.gate-list li {
  padding-left: 18px;
  position: relative;
}

.gate-list li::before {
  color: var(--accent);
  content: "—";
  left: 0;
  position: absolute;
}

.note-meta {
  color: var(--faint);
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  margin-top: 3px;
}

.tier-conditions {
  margin: 4px 0 14px;
}

.tier-conditions summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.tier-conditions ul {
  margin-top: 10px;
}

/* ---------- Revision read: draft over draft ---------- */

.coverage-flag {
  color: var(--yellow);
}

.revision-delta {
  display: grid;
  gap: 6px 22px;
  grid-template-columns: 190px minmax(0, 1fr);
  margin: 0 0 22px;
}

.revision-delta dt {
  color: var(--muted);
  font-family: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding-top: 2px;
}

.revision-delta dd {
  color: var(--body);
  line-height: 1.6;
  margin: 0 0 8px;
}

.revision-scores {
  margin-bottom: 22px;
}

.persists-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

/* ---------- v0.4: disposition, tier, writer-facing, proofread, notes ---------- */

.takeaway-eyebrow {
  margin: 0 0 10px;
}

.stamp.disposition {
  border-radius: 3px;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  padding: 8px 16px;
  rotate: -1deg;
}

.tier-chip {
  align-self: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--brand);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  text-transform: uppercase;
}

.threshold-line {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 10px;
}

/* Tier & budget section */
#tier-panel .tier-line { color: var(--ink); font-size: 1.02rem; margin: 0 0 10px; }
.tier-intent li { line-height: 1.6; }

/* Craft rankings — a number table, kept apart from any phase's prose. */
.craft-overall {
  align-items: baseline;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}
.craft-overall-label {
  color: var(--muted);
  font-family: var(--brand);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.craft-overall-score { color: var(--ink); font-family: var(--brand); }
.craft-overall-score strong { font-size: 2rem; line-height: 1; }
.craft-scale { color: var(--muted); font-size: 0.9rem; }
.craft-note { margin: 0 0 16px; }
.craft-rankings {
  border-top: 2px solid var(--border-strong);
  list-style: none;
  margin: 0;
  padding: 0;
}
.craft-row {
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px 0;
}
.craft-phase {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
}
.craft-score {
  color: var(--ink);
  font-family: var(--brand);
  white-space: nowrap;
}
.craft-score strong { font-size: 1.25rem; }
.craft-delta {
  font-family: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 8px;
  text-transform: uppercase;
}
.craft-delta.up { color: var(--green); }
.craft-delta.down { color: var(--red); }

/* Admin debug detail — readable, not pretty. In-session only, admin-only. */
.admin-debug-toggle.on {
  border-color: var(--gold-display);
  color: var(--gold);
}
.debug-section { border-top: 2px dashed var(--border-strong); }
.debug-note { margin: 0 0 14px; }
.debug-block,
.debug-phase {
  border: 1px solid var(--border);
  margin: 0 0 8px;
}
.debug-block > summary,
.debug-phase > summary {
  cursor: pointer;
  font-family: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 8px 10px;
}
.debug-phase-body { padding: 0 10px 8px; }
.debug-pre {
  background: #f3efe4;
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--brand);
  font-size: 0.74rem;
  line-height: 1.5;
  margin: 0 10px 10px;
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.debug-craft-list {
  list-style: none;
  margin: 0 10px 8px;
  padding: 0;
}
.debug-craft-list li {
  border-bottom: 1px solid var(--border);
  display: flex;
  font-family: var(--brand);
  font-size: 0.82rem;
  justify-content: space-between;
  padding: 6px 0;
}
.debug-meta { margin: 8px 10px 4px; font-size: 0.78rem; }

/* Writer-facing mentor card */
.writer-facing-section .wf-frame {
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  margin: 0 0 18px;
  max-width: 64ch;
}
/* The producer note is the one warm field on the page — gold stock, ink margin rule. */
.wf-card {
  background: var(--gold-wash);
  border: 0;
  border-left: 3px solid var(--border-strong);
  border-radius: 0;
  box-shadow: none;
  padding: 26px 30px;
}
.wf-headline { margin: 0 0 16px; }
.wf-prose {
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-lead);
  line-height: 1.55;
  margin: 0 0 14px;
}
.wf-scope {
  border-left: 2px solid var(--border-strong);
  color: var(--muted);
  font-style: italic;
  margin: 0 0 20px;
  padding-left: 14px;
}
/* Conversational memo beats — a producer talking, not labeled blocks. */
.wf-beat {
  color: var(--body);
  font-family: var(--serif);
  font-size: 1.04rem;
  line-height: 1.65;
  margin: 0 0 12px;
}
.wf-lead {
  color: var(--ink);
  font-weight: 650;
}
.wf-gold-wrap {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
  padding-top: 16px;
}
.wf-gold-label {
  color: var(--gold);
  font-family: var(--brand);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.wf-gold {
  color: var(--body);
  font-family: var(--serif);
  list-style: none;
  margin: 0;
  padding: 0;
}
.wf-gold li {
  line-height: 1.55;
  margin: 0 0 4px;
  padding-left: 14px;
  position: relative;
}
.wf-gold li::before { color: var(--gold); content: "—"; left: 0; position: absolute; }

/* Proofread — one expand, grouped category tabs */
.proofread-all > summary,
.proofread-group > summary {
  cursor: pointer;
  font-family: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.proofread-all > summary { color: var(--ink); margin-bottom: 14px; }
.proofread-groups { display: grid; gap: 0; }
.proofread-group {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 4px;
}
.proofread-group:first-of-type { border-top: 2px solid var(--border-strong); }
.proofread-group > summary { display: flex; gap: 10px; align-items: center; }
.proofread-cat { font-family: var(--brand); letter-spacing: 0.04em; text-transform: uppercase; }
.proofread-count {
  background: var(--ink);
  border-radius: 0;
  color: var(--bg);
  font-family: var(--brand);
  font-size: 0.7rem;
  padding: 1px 8px;
}
.proofread-list { display: grid; gap: 10px; list-style: none; margin: 14px 0 0; padding: 0; }
.proofread-row { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
.proofread-loc { color: var(--faint); font-family: var(--brand); font-size: 0.8rem; }
.proofread-body { display: grid; gap: 3px; }
.proofread-found { color: var(--muted); font-size: 0.9rem; }
.proofread-fix { color: var(--green); font-size: 0.9rem; }

/* Structured 4-field notes */
.structured-notes { gap: 14px; }
.structured-note { display: grid; gap: 5px; }
.note-head { color: var(--ink); }
.note-detail-fields { display: grid; gap: 2px; }
.note-field { color: var(--muted); font-size: 0.9rem; }
.note-field strong { color: var(--body); }
.note-badge {
  border: 1px solid var(--border-strong);
  border-radius: 0;
  font-family: var(--brand);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  margin-left: 6px;
  padding: 1px 7px;
  text-transform: uppercase;
}
.note-badge.keystone { border-color: var(--gold); color: var(--gold); }
.note-badge.luxury { border-color: var(--green); color: var(--green); }
.note-badge.carried { border-color: var(--border-strong); color: var(--muted); }

#revision-panel .support-list {
  display: grid;
  gap: 10px;
  margin-bottom: 6px;
}

#revision-panel > .eyebrow {
  margin: 0 0 10px;
}

.context-panel {
  align-content: start;
  border-left: 1px solid var(--border);
  display: grid;
  gap: 12px;
  padding-left: 24px;
}

.context-note {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.context-note h4 {
  font-size: 0.82rem;
  margin: 0 0 4px;
}

.context-note p {
  color: var(--body);
  font-size: 0.88rem;
  margin: 0 0 4px;
}

.context-note span {
  color: var(--faint);
  font-size: 0.78rem;
}

.context-note.muted-note p {
  color: var(--faint);
}

/* ---------- Decision box ---------- */

.decision-box {
  border-radius: var(--radius);
  padding: 20px 22px;
}

.decision-box.green { background: var(--green-soft); }
.decision-box.yellow { background: var(--yellow-soft); }
.decision-box.red { background: var(--red-soft); }
.decision-box.locked { background: var(--locked-soft); }

.decision-kicker {
  color: var(--faint);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.decision-box > p:not(.decision-kicker) {
  color: var(--ink);
  font-weight: 550;
  margin: 0 0 8px;
}

.journey-log {
  border-left: 2px solid rgba(28, 38, 32, 0.15);
  color: var(--muted);
  font-size: 0.86rem;
  list-style: none;
  margin: 10px 0 4px;
  padding: 0 0 0 14px;
}

.journey-log li {
  margin: 0 0 4px;
}

.decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* ---------- Rewrite plan ---------- */

.support-list {
  display: grid;
  gap: 12px;
}

/* The rewrite plan is a ranked ledger — rows butt and share rules. */
#rewrite-plan {
  gap: 0;
}

.rewrite-item {
  align-items: start;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  display: block;
  overflow: visible;
  padding: 0;
}

.rewrite-item:first-of-type {
  border-top: 2px solid var(--border-strong);
}

.rewrite-item > summary {
  align-items: baseline;
  cursor: pointer;
  display: grid;
  gap: 4px 18px;
  grid-template-columns: 54px minmax(0, 1fr) auto 24px;
  padding: 18px 4px;
}

/* The rank is a hung mono drop-figure — the page reads like a numbered call sheet. */
.rank {
  align-items: start;
  background: transparent;
  border-radius: 0;
  color: var(--faint);
  display: block;
  font-family: var(--brand);
  font-size: 2.1rem;
  font-weight: 700;
  height: auto;
  justify-content: start;
  line-height: 0.85;
  width: auto;
}

.item-title {
  font-family: var(--serif);
  font-size: 1.14rem;
  margin: 0 0 4px;
}

.tag {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--brand);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.note-disclosure > summary {
  list-style: none;
}

.note-disclosure > summary::-webkit-details-marker {
  display: none;
}

.note-disclosure > summary::after {
  color: var(--faint);
  content: "+";
  font-weight: 800;
  justify-self: end;
}

.rewrite-item > summary::after {
  align-self: start;
  grid-column: 4;
  grid-row: 1;
}

.note-disclosure[open] > summary::after {
  content: "-";
}

.note-detail {
  border-top: 1px solid var(--border);
  color: var(--body);
  display: grid;
  gap: 8px;
  padding: 14px 18px 16px;
}

.note-detail p {
  margin: 0;
}

.note-detail strong {
  color: var(--ink);
}

/* ---------- Support sections ---------- */

.support-section {
  display: grid;
  gap: 12px;
}

.support-disclosure {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.support-disclosure > summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
  padding: 14px 18px;
}

.support-disclosure[open] > summary {
  border-bottom: 1px solid var(--border);
}

.support-disclosure > div,
.support-disclosure > .section-heading,
.support-disclosure > .muted,
.support-disclosure > .comparison-grid,
.support-disclosure > .trust-list {
  padding: 14px 18px;
}

.role-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.role-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0;
}

.role-item > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.role-item h3 {
  font-size: 1rem;
  margin: 0;
}

.role-evidence {
  color: var(--faint);
  font-size: 0.88rem;
}

.evidence-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0 0 10px;
  overflow: hidden;
  padding: 14px 16px;
}

.evidence-item:last-child {
  margin-bottom: 0;
}

.evidence-item.note-disclosure {
  padding: 0;
}

.evidence-item.note-disclosure > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.evidence-item .item-title {
  font-size: 0.98rem;
}

.comparison-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.comparison-item h3 {
  font-size: 0.95rem;
  margin: 0 0 6px;
}

.trust-list {
  display: grid;
  gap: 8px;
}

.trust-list span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--body);
  display: block;
  font-size: 0.9rem;
  padding: 10px 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .workbench,
  .projects-view {
    padding: 0 16px 60px;
  }

  .topbar {
    align-items: center;
    gap: 12px;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .activation-panel,
  .report-summary {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .activation-actions {
    justify-content: flex-start;
  }

  .account-menu-panel {
    max-width: calc(100vw - 32px);
    min-width: min(300px, calc(100vw - 32px));
  }

  .flow-strip,
  .field-row,
  .headline-grid,
  .sample-grid,
  .comparison-grid,
  .role-grid {
    grid-template-columns: 1fr;
  }

  /* Stacked headlines: a hairline between, not a stray vertical rule or indent. */
  .headline-card.creative {
    border-bottom: 1px solid var(--border);
    border-right: 0;
    padding: 0 0 16px;
  }

  .headline-card.commercial {
    padding: 16px 0 0;
  }

  .gate-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gate-panel {
    grid-template-columns: 1fr;
  }

  .gate-notes,
  .context-panel {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 16px;
  }

  .diagnosis-card {
    padding: 24px;
  }

  .rewrite-item {
    grid-template-columns: none;
  }

  .rewrite-item > summary {
    grid-template-columns: 40px minmax(0, 1fr) 20px;
  }

  .rewrite-item .tag {
    grid-column: 2;
    width: fit-content;
  }

  .rewrite-item > summary::after {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 560px) {
  .login-view {
    padding: 16px;
  }

  .login-actions {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: space-between;
    margin-left: 0;
    width: 100%;
  }

  .topbar-actions > .secondary-button,
  .topbar-actions > .ghost-button,
  .account-menu {
    flex: 1 1 auto;
  }

  .account-menu-trigger {
    width: 100%;
  }

  .account-menu-panel {
    left: auto;
    right: 0;
  }

  .activation-actions,
  .report-summary-actions {
    display: grid;
    width: 100%;
  }

  .gate-rail {
    grid-template-columns: 1fr;
  }

  .revision-delta {
    gap: 2px;
    grid-template-columns: 1fr;
  }

  .revision-delta dd {
    margin-bottom: 12px;
  }

  .intake-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .intent-details > summary {
    line-height: 1.45;
    letter-spacing: 0.03em;
  }

  .primary-button {
    width: 100%;
  }

  .upload-status {
    align-items: stretch;
    flex-direction: column;
  }
}

.upload-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 10px;
}

.upload-note {
  color: var(--faint);
  font-size: 0.82rem;
  margin: 0;
}

.home-link {
  color: var(--faint);
  display: inline-block;
  font-family: var(--brand);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  text-decoration: none;
  text-transform: uppercase;
}

.home-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.topbar-actions .home-link {
  margin-bottom: 0;
  padding: 9px 6px;
}

/* ---------- Brand handoff: the dark threshold and the room ---------- */

.login-view {
  background: var(--screen);
  color: var(--on-screen);
  position: relative;
}

.login-view::before {
  background-image: var(--grain);
  content: "";
  inset: 0;
  opacity: 0.055;
  pointer-events: none;
  position: absolute;
}

.login-shell { position: relative; }

/* On the dark threshold the single column reads on --screen: light heading,
   light field labels, hairline divider, an inverted ink button pair that stays
   legible, and the Google/secondary outlines drawn in the light hairline. */
.login-view .login-title { color: var(--on-screen); }
.login-view label { color: var(--screen-dim); }
.login-view .login-support { color: var(--screen-dim); }

.login-view input {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--screen-hairline);
  color: var(--on-screen);
}
.login-view input::placeholder { color: var(--screen-dim); }
.login-view input:focus { box-shadow: 0 0 0 2px var(--gold-soft); }

.login-view .primary-button {
  background: var(--on-screen);
  border-color: var(--on-screen);
  color: var(--screen);
}
.login-view .primary-button:hover {
  background: transparent;
  color: var(--on-screen);
}

.login-view .secondary-button,
.login-view .google-button {
  border-color: var(--screen-hairline);
  color: var(--on-screen);
}
.login-view .secondary-button:hover,
.login-view .google-button:hover {
  background: rgba(255, 255, 255, 0.06);
}
.login-view .google-button::before { color: var(--gold-soft); }

.login-view .login-divider { color: var(--screen-dim); }
.login-view .login-divider::before,
.login-view .login-divider::after { background: var(--screen-hairline); }

.login-view .login-link { color: var(--gold-soft); }
.login-view .auth-status { color: var(--screen-dim); }

/* The staged wait is the dark room: the page the chairs are reading. */
.loading-panel {
  background: var(--screen);
  border-color: var(--screen);
  color: var(--on-screen);
  position: relative;
}

.loading-panel::before {
  background-image: var(--grain);
  content: "";
  inset: 0;
  opacity: 0.055;
  pointer-events: none;
  position: absolute;
}

.loading-dialog { position: relative; }

.loading-panel h2 {
  color: var(--on-screen);
  font-family: var(--serif);
}

.loading-panel .eyebrow,
.loading-panel .muted,
.loading-panel .loading-timer { color: var(--screen-dim); }

.loading-panel .progress-track {
  background: rgba(240, 237, 226, 0.12);
}

.loading-panel #loading-progress { background: var(--gold-soft); }

.chair-board {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 22px auto 18px;
  max-width: 480px;
  padding: 0;
  text-align: left;
}

.chair-board li {
  align-items: baseline;
  border-top: 1px solid var(--screen-hairline);
  display: flex;
  font-family: var(--brand);
  justify-content: space-between;
  padding: 12px 4px;
}

.chair-board li:last-child { border-bottom: 1px solid var(--screen-hairline); }

.chair-name {
  color: var(--on-screen);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chair-state {
  color: var(--screen-dim);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chair-state[data-state="reading"] {
  color: var(--gold-soft);
  animation: chair-reading 1.4s ease-in-out infinite;
}

@keyframes chair-reading {
  50% { opacity: 0.45; }
}

.chair-state[data-state="green"] { color: var(--green); text-shadow: 0 0 18px currentColor; }
.chair-state[data-state="yellow"] { color: var(--yellow); text-shadow: 0 0 18px currentColor; }
.chair-state[data-state="red"] { color: var(--red); text-shadow: 0 0 18px currentColor; }
.chair-state[data-state="skipped"] { color: var(--screen-dim); text-decoration: line-through; }
.chair-state[data-state="failed"] { color: var(--red); }

.loading-panel #cancel-run {
  border: 1px solid var(--screen-hairline);
  color: var(--screen-dim);
  margin-top: 8px;
}

.loading-panel #cancel-run:hover {
  background: rgba(240, 237, 226, 0.07);
  color: var(--on-screen);
}

/* ---------- Verdict stamps ---------- */

.verdict-stamp {
  border: 3px solid;
  border-radius: 3px;
  display: inline-flex;
  flex-direction: column;
  font-family: var(--brand);
  font-size: 1.5rem;
  font-weight: 700;
  gap: 2px;
  letter-spacing: 0.18em;
  line-height: 1;
  margin: 0 0 16px;
  padding: 10px 18px 9px;
  rotate: -2deg;
  text-transform: uppercase;
  transform-origin: center;
}

.verdict-stamp .stamp-term {
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  opacity: 0.85;
}

.verdict-stamp.green { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.verdict-stamp.yellow { border-color: var(--yellow); color: var(--yellow); background: var(--yellow-soft); }
.verdict-stamp.red { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.verdict-stamp.held { border-color: var(--locked); color: var(--locked); background: var(--locked-soft); font-size: 1rem; rotate: 1.5deg; }

/* The disposition stamp is uppercase at 1.5rem; on a phone "ADVANCE WITH
   CONDITIONS" runs ~440px and pushes the page sideways. Shrink it and let it
   wrap so it sits inside a 375px column. */
@media (max-width: 560px) {
  .verdict-stamp {
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    max-width: 100%;
  }
  .verdict-stamp .stamp-term { white-space: normal; }
}

/* Each phase carries its own topline verdict stamp (A5/C1); they're visible the
   moment a phase tab opens — no reveal gating (the old combined-verdict stamp-
   drop is gone with the recombined verdict). */

/* Diagnosis is the framed master sheet — a notarized coverage form. */
.diagnosis-card {
  overflow: visible;
  padding: 0 0 24px;
  position: relative;
}

.diagnosis-card .stripe {
  display: none;
}

/* Loose content sits in from the frame; the slug head and the ledger run full-bleed. */
.diagnosis-card > .takeaway-eyebrow,
.diagnosis-card > .coverage-verdict,
.diagnosis-card > .gate-policy,
.diagnosis-card > .headline-grid,
.diagnosis-card > .engine-line,
.diagnosis-card > .sample-upgrade {
  margin-left: clamp(20px, 3vw, 32px);
  margin-right: clamp(20px, 3vw, 32px);
}

.diagnosis-card .coverage-head {
  border-bottom: 2px solid var(--border-strong);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--brand);
  font-size: 0.76rem;
  gap: 6px 24px;
  letter-spacing: 0.06em;
  margin: 0 0 20px;
  padding: 14px clamp(20px, 3vw, 32px);
}

.coverage-flag { color: var(--gold); }

.takeaway-eyebrow { margin-top: 0; }

.coverage-verdict {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.sample-upgrade {
  background: var(--gold-wash);
  border: 2px solid var(--border-strong);
  border-radius: 0;
  margin-top: 18px;
  padding: 16px 18px;
}
.sample-upgrade .muted { color: var(--ink); margin: 0 0 12px; }

.stamp {
  border: 2px solid;
  border-radius: var(--radius-stamp);
  display: inline-block;
  font-family: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 7px 18px;
  rotate: -2deg;
  text-transform: uppercase;
}

.stamp + .stamp { rotate: 1.5deg; }
.stamp.green { border-color: var(--green); color: var(--green); }
.stamp.yellow { border-color: var(--yellow); color: var(--yellow); }
.stamp.red { border-color: var(--red); color: var(--red); }

/* The thesis/read/asks ledger: a ruled register, full-bleed across the sheet. */
.diagnosis-card .coverage-body {
  border-top: 2px solid var(--border-strong);
  display: grid;
  gap: 0;
  grid-template-columns: 120px minmax(0, 1fr);
  margin: 0 0 22px;
}

.diagnosis-card .coverage-body dt {
  align-self: stretch;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--brand);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0;
  padding: 14px 14px 14px clamp(20px, 3vw, 32px);
}

.diagnosis-card .coverage-body dd {
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  margin: 0;
  padding: 14px clamp(20px, 3vw, 32px) 14px 20px;
}

.diagnosis-card .coverage-body dd:first-of-type {
  font-family: var(--serif);
  font-size: var(--fs-lead);
  line-height: 1.45;
}

/* The rail is ink and gold only: active = ink rule + gold figure, locked = dashed. */
.gate-step { border-top: 3px solid var(--border); }
.gate-step.active { border-top-color: var(--border-strong); }
.gate-step.locked { border-top-color: var(--locked); border-top-style: dashed; }

.gate-panel {
  border-left: 3px solid var(--border-strong);
  padding-left: clamp(16px, 2.5vw, 28px);
}

/* Phase status reads as a flat, squared mono verdict chip struck on paper (no glow). */
.mini-status,
.status {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  font-family: var(--brand);
  text-transform: uppercase;
}

.mini-status.green, .status.green { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.mini-status.yellow, .status.yellow { background: var(--yellow-soft); border-color: var(--yellow); color: var(--yellow); }
.mini-status.red, .status.red { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.mini-status.locked, .status.locked { background: var(--locked-soft); border-color: var(--locked); color: var(--locked); }

/* Journey as a call sheet strip. */
.journey-wrap {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.journey-log {
  font-family: var(--brand);
  font-size: 0.82rem;
}

.journey-copy {
  font-size: 0.72rem;
  padding: 4px 10px;
}

/* Gold focus ring everywhere (brand accent in the workbench). */
:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}

/* Inside the dark room the dialog is part of the dark, not a paper card. */
.loading-panel .loading-dialog {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.loading-panel #loading-title { color: var(--on-screen); }

/* ---------- Upload preparation states ---------- */

.upload-status.preparing {
  background: var(--screen);
  border: 0;
  border-radius: var(--radius);
  color: var(--on-screen);
  padding: 22px 24px;
  position: relative;
}

.upload-status.preparing::before {
  background-image: var(--grain);
  border-radius: var(--radius);
  content: "";
  inset: 0;
  opacity: 0.055;
  pointer-events: none;
  position: absolute;
}

.upload-prep { position: relative; }

.upload-status.preparing .eyebrow { color: var(--screen-dim); }

.upload-status.preparing h3 {
  color: var(--on-screen);
  font-family: var(--brand);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.upload-track {
  background: rgba(240, 237, 226, 0.14);
  border-radius: 0;
  height: 6px;
  margin: 0 0 10px;
  overflow: hidden;
}

.upload-track span {
  background: var(--gold-soft);
  border-radius: 0;
  display: block;
  height: 100%;
  transition: width 0.25s ease;
  width: 3%;
}

.upload-status.preparing .score-line { color: var(--gold-soft); }

.upload-warning {
  color: var(--screen-dim);
  font-size: 0.85rem;
  margin: 6px 0 14px;
}

.upload-status.preparing #cancel-upload {
  border: 1px solid var(--screen-hairline);
  color: var(--screen-dim);
}

.upload-status.preparing #cancel-upload:hover {
  background: rgba(240, 237, 226, 0.07);
  color: var(--on-screen);
}

.upload-status.failed {
  border-color: rgba(179, 54, 42, 0.5);
  border-left: 4px solid var(--red);
}

/* While a file is preparing, the rest of the intake politely steps back. */
body.upload-pending .sample-panel,
body.upload-pending .format-toggle,
body.upload-pending #material {
  opacity: 0.45;
  pointer-events: none;
}

#update-notice {
  align-items: center;
  background: var(--screen);
  border-top: 1px solid var(--gold);
  bottom: 0;
  color: var(--on-screen);
  display: flex;
  flex-wrap: wrap;
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: 0.9rem;
  gap: 10px 18px;
  justify-content: center;
  left: 0;
  padding: 12px 20px;
  position: fixed;
  right: 0;
  z-index: 60;
}

#update-notice button {
  background: none;
  border: none;
  border-bottom: 1px solid var(--gold-soft);
  color: var(--gold-soft);
  cursor: pointer;
  font: inherit;
  padding: 0 0 1px;
}

#update-notice button:hover {
  color: var(--on-screen);
}

body.has-update-notice {
  padding-bottom: 72px;
}

/* ===================================================================== */
/* App cleanup: dark login gate, non-collapsable Material, visible        */
/* optional details, previous-reads + example-read cards.                 */
/* ===================================================================== */

/* Login on the dark threshold: the error message reads in the lamp gold on
   --screen rather than the paper red, which would muddy on dark. The single
   inverted column itself is styled in the earlier .login-view override block. */
.login-view .auth-status.error,
.login-view .form-error {
  color: var(--gold-soft);
}

/* Material — a plain, always-visible section (no summary/collapse). */
.intake-section { margin: 0 0 28px; }
.intake-head {
  align-items: baseline;
  border-bottom: 2px solid var(--border-strong);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 18px;
  padding-bottom: 10px;
}
.intake-head h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.01em;
  margin: 0;
}
.intake-status { color: var(--muted); font-size: 0.92rem; margin: 0; }
.intake-card { border: 2px solid var(--border-strong); }

/* Logline/comps/genre stay visible; no fold-out hides useful context. */
.intent-details {
  border: 1px dashed var(--gold);
  margin: 22px 0 4px;
  padding: 16px;
}
.intent-details-head {
  border-bottom: 1px solid var(--border);
  margin: 0 0 16px;
  padding-bottom: 10px;
}
.intent-details-head h3 {
  font-size: 1.12rem;
  margin: 2px 0 0;
}
.intent-details > .field-group { margin-top: 0; }
.intent-details > .intent-hint { margin-bottom: 0; }

/* Previous reads — its own section below Material, not a collapsable. */
.draft-history { margin: 0 0 28px; }

/* Example reads sit in the projects list, marked apart from the writer's own. */
.example-card { border-style: dashed; }
.example-card .eyebrow { color: var(--gold); }

/* Gray placeholder text truncates cleanly instead of clipping mid-word. */
input { text-overflow: ellipsis; }

/* ===================================================================== */
/* The read: left TOC, Download PDF, clearer expanders, print watermark.  */
/* ===================================================================== */

/* The read is its own page: a header (back + download), full-width read column. */
.read-view {
  margin: 0 auto;
  max-width: 1120px;
  min-height: 100vh;
  padding: 22px 24px 80px;
}
.read-header {
  align-items: center;
  background: var(--bg);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 6px;
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
#download-pdf { font-size: 0.76rem; }
#back-to-material { font-size: 0.82rem; }

/* TOC lives in the page's LEFT MARGIN — it never narrows the read column. Shown
   only when the margin is wide enough to hold it (the text always fills 1120). */
.report-toc { display: none; }
@media (min-width: 1500px) {
  .report-toc {
    display: block;
    left: calc((100vw - 1120px) / 2 - 172px);
    position: fixed;
    top: 104px;
    width: 156px;
    z-index: 5;
  }
  .toc-title {
    color: var(--faint);
    font-family: var(--brand);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin: 0 0 12px;
    text-transform: uppercase;
  }
  .toc-list { list-style: none; margin: 0; padding: 0; }
  .toc-list li { margin: 0; }
  .toc-list a {
    border-left: 2px solid var(--border);
    color: var(--muted);
    display: block;
    font-size: 0.84rem;
    line-height: 1.3;
    padding: 5px 0 5px 12px;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
  }
  .toc-list a:hover { border-left-color: var(--gold); color: var(--ink); }
}

/* ---------- Stage ledger strip (the persistent phase nav) ----------
   A print-brutalist pipeline, NOT pills: a single ink rule carrying mono
   number blocks + uppercase labels + hard SQUARE verdict ticks. Sticky under
   the read header; the Verdict sits at the far right behind a heavier gap. */
.stage-ledger {
  background: var(--bg);
  border-bottom: 2px solid var(--border-strong);
  margin: 0 0 28px;
  /* As a grid child of .report, min-width:auto refuses to shrink and the whole
     page scrolls sideways on mobile; 0 keeps the full-width rail in bounds. */
  min-width: 0;
  position: sticky;
  top: 44px;
  z-index: 9;
}
/* FULL-WIDTH, NON-SCROLLING: the four phase tabs share the width as flex peers
   with the Full report tab as a distinct trailing segment. No overflow scroller,
   so no tab can ever sit off-screen. On mobile the rail wraps to two rows. */
.ledger-rail {
  display: flex;
  align-items: stretch;
  gap: 0;
}
/* Each phase tab grows to fill its share of the bar; the Full report segment
   (below) is given a heavier share so the payoff reads as the destination. */
.ledger-entry {
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  row-gap: 3px;
  align-items: center;
  padding: 12px 14px 11px;
  text-align: left;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border-right: 1px solid var(--border);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.ledger-entry.disabled { cursor: default; }
.ledger-num {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--surface);
  background: var(--faint);
  border: 1px solid var(--faint);
  padding: 3px 7px;
  line-height: 1;
  align-self: center;
}
.ledger-label {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The per-phase verdict: the colored disposition tick + the readable disposition
   word side by side, sized to read at a glance. */
.ledger-disp {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ledger-tick {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
}
.ledger-sub {
  font-family: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Disposition colour on the WORD itself (token text colours, not the -soft
   washes) so the verdict reads at a glance; neutral states stay faint. */
.ledger-sub.sub-advance { color: var(--green); }
.ledger-sub.sub-conditions { color: var(--yellow); }
.ledger-sub.sub-hold { color: var(--red); }
.ledger-sub.sub-neutral { color: var(--faint); }
.ledger-tick.waiting { background: transparent; border: 1px solid var(--faint); }
.ledger-tick.reading {
  background: var(--gold);
  animation: chair-reading 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .ledger-tick.reading { animation: none; }
}
.ledger-tick.advance { background: var(--green); }
.ledger-tick.advance-with-conditions { background: var(--yellow); }
.ledger-tick.hold { background: var(--red); }
.ledger-tick.locked {
  background: transparent;
  width: auto; height: auto;
  font-family: var(--brand);
  font-weight: 700;
  color: var(--faint);
  line-height: 1;
}
.ledger-tick.verdict-locked {
  background: transparent;
  border: 2px dashed var(--faint);
  width: 9px; height: 9px;
}
/* The Full Report tab, once compiled, is ink — not a verdict colour (it carries
   the notes, not a recombined verdict). */
.ledger-tick.report-ready { background: var(--ink); }
.ledger-entry:not(.disabled):hover { background: var(--gold-wash); }
.ledger-entry:not(.disabled) .ledger-label { color: var(--ink); }
.ledger-entry:not(.disabled) .ledger-num {
  background: var(--ink);
  border-color: var(--ink);
}
/* SELECTED TAB — unmistakable: a gold-wash ground, a heavy gold bottom ink-rule,
   a bolder label and an ink-filled number. Not just a small filled box. */
.ledger-entry.active {
  background: var(--gold-wash);
  border-bottom-color: var(--gold);
}
.ledger-entry.active .ledger-num {
  background: var(--gold);
  color: var(--surface);
  border-color: var(--gold);
}
.ledger-entry.active .ledger-label {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.085em;
}
.ledger-entry.disabled .ledger-label { color: var(--faint); }
.ledger-entry:last-child { border-right: 0; }

/* THE FULL REPORT PAYOFF — a distinct, ink-bordered trailing segment, not a
   faint far-right afterthought. A ▸ marker announces it as the destination. */
.ledger-verdict {
  flex: 1.35 1 0;
  grid-template-columns: auto 1fr;
  border-left: 3px solid var(--border-strong);
  background: var(--locked-soft);
}
.ledger-verdict .ledger-arrow {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--brand);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--faint);
}
.ledger-verdict .ledger-label { letter-spacing: 0.08em; }
/* Locked-until-done: dim. Once compiled it becomes the filled ink destination. */
.ledger-verdict.disabled { cursor: default; }
.ledger-verdict.disabled .ledger-label { color: var(--locked); }
.ledger-verdict.ready {
  background: var(--ink);
}
.ledger-verdict.ready .ledger-arrow { color: var(--gold); }
.ledger-verdict.ready .ledger-label { color: var(--surface); }
.ledger-verdict.ready .ledger-sub { color: var(--gold-wash); }
.ledger-verdict.ready:not(.active):hover { background: #000; }
.ledger-verdict.ready.active {
  background: var(--ink);
  border-bottom-color: var(--gold);
}
.ledger-verdict.ready.active .ledger-label { color: var(--surface); }
.ledger-verdict.ready.active .ledger-arrow { color: var(--gold); }

/* Inline "a room is reading…" state — replaces the old full-screen loading
   overlay so the read shell stays visible while a room reads. */
.stage-reading {
  border: 2px solid var(--border-strong);
  background: var(--surface);
  padding: 16px 18px;
  margin: 0 0 28px;
}
.stage-reading-line {
  align-items: center;
  display: flex;
  font-family: var(--serif);
  font-size: 1.02rem;
  gap: 10px;
  margin: 0;
}
.stage-reading-dot {
  background: var(--gold);
  flex: 0 0 auto;
  height: 9px;
  width: 9px;
  animation: chair-reading 1.4s ease-in-out infinite;
}
.stage-reading-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-family: var(--brand);
  font-size: 0.78rem;
  gap: 16px;
  letter-spacing: 0.06em;
  margin: 10px 0 0;
}
.stage-reading-cancel { font-size: 0.74rem; }

/* The mobile sequence caption is hidden on desktop (the strip carries the full
   label + number) and shown under the wrapped strip on narrow screens for the
   active phase's full name. */
.ledger-caption { display: none; }

/* Mobile: the full-width strip WRAPS (never scrolls) — the four phase tabs lay
   out two-per-row, and the Full report payoff takes its own full row beneath.
   No tab is ever off-screen. */
@media (max-width: 720px) {
  .stage-ledger { top: 40px; }
  .ledger-rail { flex-wrap: wrap; }
  .ledger-entry {
    flex: 1 1 50%;
    min-width: 0;
    padding: 10px 12px 9px;
    border-bottom: 3px solid transparent;
    border-top: 1px solid var(--border);
  }
  /* Two columns of two: the right tab of each row drops its divider. */
  .ledger-entry:nth-child(2n) { border-right: 0; }
  .ledger-verdict {
    flex: 1 1 100%;
    border-left: 0;
    border-top: 2px solid var(--border-strong);
  }
  .ledger-label { font-size: 0.78rem; letter-spacing: 0.04em; }
  /* Keep the per-entry status sub visible on mobile so a disposition tick — esp.
     the weakest-contrast amber — always carries its CONDITIONS/HOLD label; status
     must never ride on color alone. */
  .ledger-caption {
    display: block;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-family: var(--brand);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 22px;
    padding: 9px 4px;
    position: sticky;
    text-transform: uppercase;
    top: 86px;
    z-index: 8;
  }
}

/* Let the section title be the header — drop the eyebrow bars on the read. */
#report-body .section-heading .eyebrow { display: none; }

/* The flow-strip stepper doesn't fit now the read is its own page. */
.flow-strip { display: none; }

/* Only the copy-pass groups get the +/- toggle — nothing else on the read. */
.proofread-group > summary {
  align-items: baseline;
  cursor: pointer;
  display: flex;
  gap: 10px;
  list-style: none;
}
.proofread-group > summary::-webkit-details-marker { display: none; }
.proofread-group > summary::before {
  color: var(--gold);
  content: "+";
  flex: 0 0 auto;
  font-family: var(--brand);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}
.proofread-group[open] > summary::before { content: "\2013"; }

/* Collapsed phase cards get a chevron so it's clear they open. */
.gate-card > summary { position: relative; }
.gate-card > summary::after {
  color: var(--faint);
  content: "\25BE";
  margin-left: auto;
  transition: transform 0.15s ease;
}
.gate-card[open] > summary::after { transform: rotate(180deg); }

/* PDF: a The Read Before watermark, every section expanded, the chrome gone. */
.print-watermark { display: none; }

@media print {
  .topbar, .flow-strip, #report-toc, .read-header, .report-actions, .home-link,
  .app-header, .view-head, .app-footer,
  .mode-chip, .intake-section, .draft-history, .loading-panel, .error-panel,
  .stage-ledger, .ledger-caption, .stage-reading, .gate-advance, .read-close,
  #chrome, .update-bar, .has-update-notice { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  #app, .workbench, #report, .report-body { display: block !important; }
  /* The tabbed read flattens to ONE linear coverage document for print/PDF:
     every stage panel and every phase card expands, regardless of the active
     tab, so the Download-PDF document is the whole read in order. (read-close
     holds only interactive CTAs and stays hidden, above.) */
  #report-body[data-tabbed] > section:not(.read-close):not(.hidden),
  #report-body[data-tabbed] #gate-report .gate-card { display: block !important; }
  /* Expand every collapsed section so the whole read prints. */
  details > *:not(summary) { display: block !important; }
  details > summary::before,
  .gate-card > summary::after { content: "" !important; }
  .gate-card, .diagnosis-card, .evidence-item, .sample-card,
  .comparison-item, .proofread-row { break-inside: avoid; }
  .print-watermark {
    color: rgba(0, 0, 0, 0.06);
    display: block;
    font-family: var(--brand);
    font-size: 4.6rem;
    font-weight: 700;
    left: 50%;
    letter-spacing: 0.12em;
    position: fixed;
    text-transform: uppercase;
    top: 45%;
    transform: translate(-50%, -50%) rotate(-30deg);
    white-space: nowrap;
    z-index: 9999;
  }
}
