/* SPECULUM — Field Instrument for Semiotic Audit
   Order of the Unforbidden Sciences · ORDO·SEMEION·MMXXVI
   ----------------------------------------------------- */

:root {
  /* Default palette: Ink */
  --bg: #0e0d12;
  --bg-elev: #16151b;
  --bg-sunk: #08070b;
  --ink: #ece4d2;
  --ink-dim: #b4ac99;
  --ink-faint: #6e6757;
  --rule: #2a2630;
  --rule-soft: #1d1a23;
  --accent: #c9a570;      /* brass */
  --accent-deep: #8a6f3e;
  --warn: #b04a3a;        /* oxblood */
  --warn-deep: #6d2c20;
  --signal: #6b8a7a;      /* verdigris */
  --halo: rgba(201, 165, 112, 0.08);

  --serif: "Cormorant Garamond", "EB Garamond", "Tinos", Georgia, serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;

  --t-display: clamp(48px, 6vw, 96px);
  --t-h1: clamp(36px, 4vw, 56px);
  --t-h2: 28px;
  --t-h3: 20px;
  --t-body: 17px;
  --t-mono: 12px;
  --t-mono-sm: 10.5px;

  --density: 1;
  --max-w: 1440px;
}

/* Palette: Parchment */
[data-palette="parchment"] {
  --bg: #ece4d2;
  --bg-elev: #e3dac6;
  --bg-sunk: #d6cdb6;
  --ink: #1a1814;
  --ink-dim: #4a443a;
  --ink-faint: #8a8270;
  --rule: #b8ad94;
  --rule-soft: #cec5ad;
  --accent: #5a4324;
  --accent-deep: #2f2210;
  --warn: #8b2c1f;
  --warn-deep: #5a1a12;
  --signal: #3a5447;
  --halo: rgba(90, 67, 36, 0.06);
}

/* Palette: Verdigris */
[data-palette="verdigris"] {
  --bg: #0a1014;
  --bg-elev: #111a1f;
  --bg-sunk: #060a0d;
  --ink: #d8e6dc;
  --ink-dim: #93a59a;
  --ink-faint: #5d6e64;
  --rule: #1f2c30;
  --rule-soft: #16201f;
  --accent: #7fc7a4;
  --accent-deep: #4a8068;
  --warn: #d97a4a;
  --warn-deep: #8a4524;
  --signal: #9bb5a6;
  --halo: rgba(127, 199, 164, 0.07);
}

/* Palette: Angelic Vampire — wine-black + gold leaf + blood + ivory */
[data-palette="seraphic"] {
  --bg: #150a0e;
  --bg-elev: #1f1014;
  --bg-sunk: #0c0508;
  --ink: #f4ead0;
  --ink-dim: #c9b896;
  --ink-faint: #7a6650;
  --rule: #3a1f25;
  --rule-soft: #25141a;
  --accent: #d4af37;       /* gold leaf */
  --accent-deep: #8a6a1c;
  --warn: #c2143f;          /* arterial */
  --warn-deep: #6a0a22;
  --signal: #e8c9a0;
  --halo: rgba(212, 175, 55, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--t-body);
  line-height: 1.45;
  font-feature-settings: "liga", "kern", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { min-height: 100vh; }

button {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ============ TYPOGRAPHIC PRIMITIVES ============ */

.mono { font-family: var(--mono); font-size: var(--t-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.mono-sm { font-family: var(--mono); font-size: var(--t-mono-sm); letter-spacing: 0.08em; text-transform: uppercase; }
.mono-flat { font-family: var(--mono); font-size: var(--t-mono); letter-spacing: 0.02em; text-transform: none; }
.serif-italic { font-style: italic; font-feature-settings: "liga", "kern", "onum"; }

.label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; margin: 0; line-height: 1.05; letter-spacing: -0.01em; }
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }

p { margin: 0 0 1em 0; }

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

a { color: var(--accent); text-decoration: none; border-bottom: 1px dashed currentColor; }
a:hover { color: var(--ink); }

/* ============ APP SHELL ============ */

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--halo), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 120%, var(--halo), transparent 50%);
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-sunk);
  position: sticky; top: 0; z-index: 50;
}

.brand {
  display: flex; align-items: center; gap: 14px;
}
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: var(--accent);
}
.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.18em;
  font-weight: 500;
}
.brand-name em { font-style: normal; color: var(--ink-faint); margin-right: 6px; }

.crumbs {
  display: flex; gap: 14px; align-items: center;
  font-family: var(--mono); font-size: var(--t-mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint);
}
.crumbs .sep { color: var(--rule); }
.crumbs .here { color: var(--ink); }

.topbar-meta {
  display: flex; gap: 18px; align-items: center;
  font-family: var(--mono); font-size: var(--t-mono-sm);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
}
.topbar-meta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px var(--signal);
  display: inline-block;
}

/* nav buttons */
.navbtn {
  font-family: var(--mono);
  font-size: var(--t-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 8px 14px;
  border: 1px solid var(--rule);
  background: transparent;
  transition: all .15s ease;
}
.navbtn:hover { color: var(--ink); border-color: var(--ink-dim); }
.navbtn.active { color: var(--bg); background: var(--ink); border-color: var(--ink); }

/* ============ BENCH (HOME) ============ */

.bench {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: calc(100vh - 73px);
}
.bench-left {
  padding: 72px 56px 56px;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column;
  position: relative;
}
.bench-right {
  padding: 56px;
  display: flex; flex-direction: column;
  gap: 28px;
}

.preamble {
  font-family: var(--serif);
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1.15;
  font-weight: 400;
  margin: 0 0 36px 0;
  max-width: 22ch;
  letter-spacing: -0.015em;
}
.preamble em { font-style: italic; color: var(--accent); }

.bench-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 24px;
  margin-bottom: 40px;
}
.bench-meta dt { font-family: var(--mono); font-size: var(--t-mono-sm); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.bench-meta dd { margin: 0; font-family: var(--serif); font-size: 15px; }

.bench-seal {
  margin-top: auto;
  display: flex; align-items: center; gap: 22px;
  padding-top: 36px;
  border-top: 1px solid var(--rule);
}

/* ============ ORNAMENT (corner flourishes + dividers) ============ */

.ornament {
  display: block;
  margin: 0 auto;
  color: var(--accent);
  opacity: 0.85;
}
.divider-ornament {
  display: flex; align-items: center; gap: 16px;
  margin: 28px 0;
  color: var(--rule);
}
.divider-ornament::before, .divider-ornament::after {
  content: ""; flex: 1; border-top: 1px solid currentColor;
}
.divider-ornament .glyph { color: var(--accent); opacity: 0.7; }

[data-ornament="none"] .ornament,
[data-ornament="none"] .divider-ornament,
[data-ornament="none"] .corner-flourish { display: none; }
[data-ornament="light"] .divider-ornament { opacity: 0.5; }

/* corner flourishes for big cards */
.corner-flourish {
  position: absolute; width: 28px; height: 28px; color: var(--accent);
  opacity: 0.5;
  pointer-events: none;
}
.cf-tl { top: 8px; left: 8px; }
.cf-tr { top: 8px; right: 8px; transform: scaleX(-1); }
.cf-bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.cf-br { bottom: 8px; right: 8px; transform: scale(-1, -1); }

[data-ornament="baroque"] .findings-head,
[data-ornament="baroque"] .verdict-banner,
[data-ornament="baroque"] .specimen-card,
[data-ornament="baroque"] .pull-quote {
  position: relative;
}

/* ============ ANTIPHON (under section names) ============ */
.antiphon {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--accent);
  opacity: 0.85;
  display: block;
  margin-top: 6px;
  margin-left: auto;
}
.section-rule { flex-wrap: wrap; }
.section-rule .antiphon { width: 100%; text-align: right; margin-top: 4px; }

/* ============ SPECIMEN CARD (on Findings) ============ */
.specimen-card {
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  padding: 32px 36px 28px;
  position: relative;
  margin-top: 8px;
}
.specimen-card .header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 18px;
}
.specimen-text {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0 18px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  font-style: italic;
  white-space: pre-wrap;
}
.specimen-text .lineno {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-faint); letter-spacing: 0.08em;
  text-align: right; padding-top: 4px;
  font-style: normal;
  user-select: none;
}
.specimen-text .line { padding: 0; }
.specimen-card .highlighted {
  background: var(--halo);
  border-bottom: 1px dotted var(--accent);
  padding: 0 2px;
}

/* ============ PULL QUOTE (Most Operative Phrase) ============ */
.pull-quote {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 44px 32px 48px;
  text-align: center;
  margin: 16px 0 12px;
  position: relative;
}
.pull-quote .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 22px;
}
.pull-quote blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 22ch;
  margin: 0 auto;
  position: relative;
  font-weight: 400;
}
.pull-quote blockquote::before {
  content: "\201C"; position: absolute; left: -0.5em; top: -0.4em;
  font-size: 1.4em; color: var(--accent); opacity: 0.4; line-height: 1;
}
.pull-quote blockquote::after {
  content: "\201D"; position: absolute; right: -0.4em; bottom: -0.6em;
  font-size: 1.4em; color: var(--accent); opacity: 0.4; line-height: 1;
}
.pull-quote .attribution {
  margin-top: 24px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint);
}

/* ============ SERAPHIC FLOURISHES (palette-conditional) ============ */
[data-palette="seraphic"] body, [data-palette="seraphic"] .shell {
  background-image:
    radial-gradient(ellipse 60% 40% at 50% -10%, var(--halo), transparent 70%),
    radial-gradient(ellipse 40% 30% at 100% 100%, rgba(194, 20, 63, 0.05), transparent 60%);
}
[data-palette="seraphic"] .pull-quote blockquote {
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.15);
}
[data-palette="seraphic"] .grade-big,
[data-palette="seraphic"] .verdict-banner .stamp .big {
  text-shadow: 0 0 20px currentColor;
}
[data-palette="seraphic"] .state-row .bar > span {
  background: linear-gradient(90deg, var(--warn-deep), var(--warn));
}
[data-palette="seraphic"] .preamble em {
  background: linear-gradient(180deg, var(--accent) 0%, #f7d674 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bench-seal .seal-text {
  font-family: var(--mono);
  font-size: var(--t-mono-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.5;
}

.cta-primary {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 18px 26px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  align-self: flex-start;
}
.cta-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.cta-primary .arr { font-family: var(--serif); font-size: 22px; line-height: 0; }

.cta-ghost {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: all .15s ease;
}
.cta-ghost:hover { border-color: var(--ink); }

/* Instrument card on right side */
.instrument {
  border: 1px solid var(--rule);
  background:
    linear-gradient(180deg, var(--bg-elev), var(--bg-sunk));
  padding: 0;
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex; flex-direction: column;
}
.instrument-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
}
.instrument-body {
  flex: 1;
  display: grid;
  place-items: center;
  position: relative;
  min-height: 360px;
}
.instrument-body svg { width: min(80%, 480px); height: auto; display: block; }
.instrument-foot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
}
.instrument-foot .gauge {
  padding: 14px 16px;
  border-right: 1px solid var(--rule-soft);
  display: flex; flex-direction: column; gap: 4px;
}
.instrument-foot .gauge:last-child { border-right: none; }
.gauge-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.gauge-value { font-family: var(--serif); font-size: 22px; font-variant-numeric: tabular-nums; }

/* Recent operations strip */
.recent {
  border: 1px solid var(--rule);
  background: var(--bg-elev);
}
.recent-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
}
.recent ul { list-style: none; padding: 0; margin: 0; }
.recent li {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px; align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule-soft);
  cursor: pointer;
  transition: background .12s ease;
}
.recent li:last-child { border-bottom: none; }
.recent li:hover { background: var(--bg-sunk); }
.recent .ts { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.08em; }
.recent .title { font-family: var(--serif); font-size: 16px; }
.recent .verdict {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid currentColor;
}
.verdict.v-clean { color: var(--signal); }
.verdict.v-mixed { color: var(--accent); }
.verdict.v-corrosive { color: var(--warn); }

/* ============ INTAKE ============ */

.intake {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: calc(100vh - 73px);
}
.intake-rail {
  border-right: 1px solid var(--rule);
  padding: 40px 32px;
  background: var(--bg-sunk);
  display: flex; flex-direction: column; gap: 28px;
}
.intake-main {
  padding: 48px 64px;
  display: flex; flex-direction: column;
  max-width: 980px;
}

.field { display: flex; flex-direction: column; gap: 10px; }
.field > .label { display: flex; justify-content: space-between; align-items: baseline; }

.textarea {
  width: 100%;
  min-height: 360px;
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  padding: 22px 24px;
  resize: vertical;
  outline: none;
  transition: border-color .15s ease;
}
.textarea:focus { border-color: var(--accent); }
.textarea::placeholder { color: var(--ink-faint); font-style: italic; }

.input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  padding: 10px 0;
  outline: none;
}
.input:focus { border-bottom-color: var(--accent); }

/* Segmented control */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--rule);
}
.seg button {
  padding: 10px 8px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-dim);
  border-right: 1px solid var(--rule);
  background: transparent;
  transition: all .12s ease;
}
.seg button:last-child { border-right: none; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--bg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  cursor: pointer;
}
.chip.on { border-color: var(--ink); color: var(--ink); background: var(--bg-elev); }
.chip:hover { color: var(--ink); }

.consent-block {
  border: 1px solid var(--rule);
  padding: 18px 20px;
  background: var(--bg-elev);
  display: flex; flex-direction: column; gap: 12px;
}
.consent-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
}
.consent-row .box {
  width: 18px; height: 18px;
  border: 1px solid var(--rule);
  margin-top: 2px;
  display: grid; place-items: center;
  color: var(--accent);
}
.consent-row.on .box { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.consent-row .lbl { font-family: var(--serif); font-size: 15px; line-height: 1.4; }
.consent-row .lbl small { display: block; color: var(--ink-faint); font-size: 12px; margin-top: 2px; }

/* ============ EXAMINATION (LOADING) ============ */

.examination {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 73px);
  position: relative;
  overflow: hidden;
}
.examination::before, .examination::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  border: 1px solid var(--rule); border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.examination::before { width: 90vmin; height: 90vmin; opacity: 0.25; }
.examination::after { width: 130vmin; height: 130vmin; opacity: 0.12; }

.examination-core {
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  text-align: center;
  width: 100%;
  max-width: 520px;
  padding: 0 24px;
}
.examination-core .sigil { width: 220px; height: 220px; }

/* ── Circular progress dial (sigil + ring + percentage) ── */
.exam-dial {
  position: relative; width: 260px; height: 260px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.exam-ring-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible;
}
/* Orbital backdrop rings */
.exam-orbit {
  position: absolute; left: 50%; top: 50%; border-radius: 50%;
  border: 1px solid var(--rule); transform: translate(-50%, -50%);
  pointer-events: none;
}
.exam-orbit--1 { width: 320px; height: 320px; opacity: 0.35; animation: examSpin 60s linear infinite; border-style: dashed; will-change: transform; }
.exam-orbit--2 { width: 400px; height: 400px; opacity: 0.18; animation: examSpinR 90s linear infinite; will-change: transform; }
@keyframes examSpin  { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes examSpinR { to { transform: translate(-50%,-50%) rotate(-360deg); } }

.exam-sigil-wrap { position: relative; display: flex; align-items: center; justify-content: center; z-index: 2; }
.exam-sigil-halo {
  position: absolute; left: 50%; top: 50%;
  width: 150px; height: 150px; margin: -75px 0 0 -75px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--halo) 0%, transparent 70%);
}

/* Percentage centred under the sigil glyph */
.exam-dial-pct {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 1px; z-index: 3;
  font-family: var(--mono);
}
.exam-dial-pct-num { font-size: 22px; color: var(--accent); letter-spacing: 0.02em; }
.exam-dial-pct-mark { font-size: 11px; color: var(--ink-faint); }

/* Stage heading block */
.exam-stage-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.exam-stage-principle {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); min-height: 14px;
}
.exam-status {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-faint);
  display: flex; align-items: center; gap: 8px;
}
.exam-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: examPulse 1.4s ease infinite; }
@keyframes examPulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }
.exam-status .blink { color: var(--accent); }
.exam-title {
  font-family: var(--serif);
  font-size: 36px;
  font-style: italic;
  max-width: 16ch;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Stage log — centered, aligned columns */
.exam-log {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  width: 100%;
  max-width: 380px;
  display: flex; flex-direction: column; gap: 4px;
  text-align: left;
}
.exam-log-row { display: flex; align-items: baseline; gap: 8px; opacity: 0.5; transition: opacity .3s ease, color .3s ease; }
.exam-log-row.done { opacity: 0.85; color: var(--ink-dim); }
.exam-log-row.active { opacity: 1; color: var(--ink); }
.exam-log-row.pending { opacity: 0.35; }
.exam-log-check { width: 12px; flex-shrink: 0; text-align: center; }
.exam-log-row.done .exam-log-check { color: var(--signal); }
.exam-log-row.active .exam-log-check { color: var(--accent); }
.exam-log-label { flex: 1; }
.exam-log-principle { color: var(--ink-faint); font-size: 9px; letter-spacing: 0.06em; white-space: nowrap; }

.exam-notice { margin-top: 8px; }

@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes spin-rev { to { transform: rotate(-360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
/* GPU-promote spinners so rotation composites instead of repainting the
   whole SVG each frame (translateZ(0) forces a compositor layer). */
.spin-slow { animation: spin-slow 30s linear infinite; transform-origin: center; will-change: transform; transform: translateZ(0); backface-visibility: hidden; }
.spin-rev { animation: spin-rev 50s linear infinite; transform-origin: center; will-change: transform; transform: translateZ(0); backface-visibility: hidden; }
.pulse { animation: pulse 2s ease-in-out infinite; }

/* ── Premium sigil treatment ──
   Soft brass glow + gentle float. The glow is a SEPARATE radial-gradient
   layer behind the sigil that animates only OPACITY (compositor-only,
   ~free) — never the `filter` property, which forces a full re-raster
   every frame and was causing constant GPU load. */
.sigil-premium {
  position: relative;
  animation: sigilFloat 9s ease-in-out infinite;
  will-change: transform;
}
.sigil-premium::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 80%; height: 80%; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,165,112,0.22) 0%, transparent 65%);
  pointer-events: none; z-index: -1;
  animation: sigilGlowOpacity 6s ease-in-out infinite;
}
@keyframes sigilGlowOpacity {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}
@keyframes sigilFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
/* Slower, eased rotation reads as more deliberate/premium than constant linear. */
.spin-premium { animation: spin-slow 48s linear infinite; transform-origin: center; will-change: transform; transform: translateZ(0); backface-visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .sigil-premium { animation: none; }
  .sigil-premium::before { animation: none; opacity: 0.6; }
  .spin-premium, .spin-slow, .spin-rev { animation: none; }
}

/* ============ FINDINGS ============ */

.findings {
  padding: 48px 56px 80px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.findings-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 40px;
}
.findings-head .doc-no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.findings-head h1 {
  font-size: clamp(36px, 4.2vw, 56px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.08;
  margin-bottom: 22px;
  letter-spacing: -0.02em;
  max-width: 28ch;
}
.findings-head .artifact {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.head-meta {
  display: flex; flex-direction: column; gap: 14px;
  text-align: right;
  min-width: 260px;
}
.head-meta .row {
  display: flex; justify-content: space-between; gap: 24px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.head-meta .row span:first-child { color: var(--ink-faint); }

/* big grade */
.grade-big {
  font-family: var(--serif);
  font-size: 86px;
  line-height: 0.9;
  font-style: italic;
  letter-spacing: -0.04em;
  color: var(--accent);
}

/* Section blocks */
.findings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px 64px;
}
.finding-section { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.finding-section.full { grid-column: 1 / -1; }

.section-rule {
  display: flex; align-items: baseline; gap: 16px;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}
.section-rule .no {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.14em;
}
.section-rule .name {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink);
}
.section-rule .gloss {
  margin-left: auto;
  font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--ink-faint);
}

.finding-section h2 {
  font-family: var(--serif);
  font-size: 30px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.finding-section p {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-dim);
  max-width: 60ch;
}
.finding-section p strong { color: var(--ink); font-weight: 500; font-style: italic; }

/* Symbol inventory cards */
.symbols { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--rule-soft); }
.symbol {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: start;
}
.symbol .glyph {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border: 1px solid var(--rule);
  color: var(--accent);
}
.symbol .body h3 { font-family: var(--serif); font-size: 22px; font-style: italic; margin-bottom: 6px; }
.symbol .body p { font-size: 14.5px; color: var(--ink-dim); margin: 0 0 4px 0; max-width: 50ch; line-height: 1.5; }
.symbol .body .tag {
  display: block;
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 10px;
}
.symbol .effect {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--warn);
  text-align: right;
  max-width: 16ch;
  line-height: 1.4;
}

/* State induction — bar plot */
.states { display: flex; flex-direction: column; gap: 14px; }
.state-row { display: grid; grid-template-columns: 140px 1fr 60px; gap: 16px; align-items: center; }
.state-row .name { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.state-row .bar {
  height: 14px; background: var(--bg-sunk); border: 1px solid var(--rule); position: relative;
}
.state-row .bar > span {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
}
.state-row .pct { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--ink-dim); }

/* Ritual mechanics list */
.mechanics { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule); }
.mech {
  padding: 18px 20px;
  border-right: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
}
.mech:nth-child(2n) { border-right: none; }
.mech .label { margin-bottom: 6px; }
.mech .title { font-family: var(--serif); font-style: italic; font-size: 18px; margin-bottom: 4px; }
.mech .desc { font-size: 14px; color: var(--ink-dim); line-height: 1.5; }

/* ============ ETHICS VERDICT ============ */

.verdict-page {
  padding: 48px 56px 80px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.verdict-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  align-items: center;
  padding: 32px 36px;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  margin-bottom: 48px;
}
.verdict-banner .sigil { width: 96px; height: 96px; }
.verdict-banner h2 {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 34px; line-height: 1.1; margin-bottom: 8px;
}
.verdict-banner p { color: var(--ink-dim); font-size: 16px; margin: 0; max-width: 56ch; }
.verdict-banner .stamp {
  text-align: center;
  border: 1px solid currentColor;
  padding: 14px 20px;
  font-family: var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--warn);
  font-size: 13px;
}
.verdict-banner .stamp .big { display: block; font-family: var(--serif); font-style: italic; font-size: 32px; letter-spacing: -0.01em; text-transform: none; color: var(--warn); margin-top: 4px; }

/* Principles grid */
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.principle {
  background: var(--bg);
  padding: 28px 30px;
  display: grid; grid-template-columns: 48px 1fr auto; gap: 20px;
  align-items: flex-start;
}
.principle .ord {
  font-family: var(--serif); font-style: italic; font-size: 30px; color: var(--ink-faint);
}
.principle h3 {
  font-family: var(--serif); font-size: 22px; font-style: italic; font-weight: 400;
  margin-bottom: 6px;
}
.principle .creed {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 12px;
}
.principle p { font-size: 14.5px; color: var(--ink-dim); margin: 0; line-height: 1.5; }
.principle .score {
  font-family: var(--serif); font-style: italic;
  font-size: 42px; line-height: 1; letter-spacing: -0.03em;
  text-align: right; min-width: 70px;
}
.principle .score small {
  display: block; font-family: var(--mono); font-style: normal;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 2px;
}
.score.s-pass { color: var(--signal); }
.score.s-mixed { color: var(--accent); }
.score.s-fail { color: var(--warn); }

/* ============ ARCHIVE ============ */

.archive {
  padding: 48px 56px 80px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.archive-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 32px;
}
.archive-head h1 { font-size: 44px; font-style: italic; font-weight: 400; }
.archive-head .count { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); letter-spacing: 0.12em; text-transform: uppercase; }

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.archive-table thead th {
  text-align: left;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint);
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
}
.archive-table tbody td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
.archive-table tbody tr { cursor: pointer; transition: background .12s; }
.archive-table tbody tr:hover { background: var(--bg-elev); }
.archive-table .glyphcell { width: 50px; }
.archive-table .glyphcell svg { width: 36px; height: 36px; color: var(--accent); }
.archive-table .ts { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; white-space: nowrap; }
.archive-table .titlecell { font-family: var(--serif); font-style: italic; font-size: 18px; }
.archive-table .medium { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.archive-table .verdict-cell { text-align: right; }
.archive-table .grade {
  font-family: var(--serif); font-style: italic; font-size: 26px;
  letter-spacing: -0.02em;
}

/* ============ FOOTER STRIP (audit chrome) ============ */

.specbar {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--rule);
  padding: 14px 32px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--bg-sunk);
}
.specbar .left, .specbar .right { display: flex; gap: 24px; }

/* ============ EMPTY / HINT ============ */

.empty-hint {
  font-family: var(--serif); font-style: italic;
  font-size: 16px; color: var(--ink-faint);
}

/* ============ ACTION ROW ============ */
.action-row {
  display: flex; gap: 12px; align-items: center; margin-top: 28px;
}

/* ============ MOBILE ============ */

@media (max-width: 880px) {
  .topbar { grid-template-columns: 1fr auto; padding: 14px 18px; }
  .crumbs { display: none; }
  .brand-name { font-size: 18px; letter-spacing: 0.14em; }
  .bench { grid-template-columns: 1fr; }
  .bench-left, .bench-right { padding: 36px 22px; border-right: none; }
  .bench-left { border-bottom: 1px solid var(--rule); }
  .intake { grid-template-columns: 1fr; }
  .intake-rail { border-right: none; border-bottom: 1px solid var(--rule); padding: 28px 22px; }
  .intake-main { padding: 28px 22px; }
  .findings, .verdict-page, .archive { padding: 28px 22px 60px; }
  .findings-head { grid-template-columns: 1fr; gap: 16px; }
  .head-meta { text-align: left; min-width: 0; }
  .findings-grid { grid-template-columns: 1fr; gap: 40px; }
  .verdict-banner { grid-template-columns: 1fr; text-align: center; gap: 18px; }
  .verdict-banner .sigil { margin: 0 auto; }
  .principles { grid-template-columns: 1fr; }
  .mechanics { grid-template-columns: 1fr; }
  .mech { border-right: none; }
  .symbol { grid-template-columns: 56px 1fr; }
  .symbol .effect { grid-column: 2; text-align: left; max-width: none; }
  .archive-table thead { display: none; }
  .archive-table tbody td { display: block; padding: 4px 0; border: none; }
  .archive-table tbody tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
  .archive-table .verdict-cell { text-align: left; }
  .state-row { grid-template-columns: 100px 1fr 50px; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-sunk); }
::-webkit-scrollbar-thumb { background: var(--rule); border: 2px solid var(--bg-sunk); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ============ SELECTION ============ */
::selection { background: var(--accent); color: var(--bg); }

/* ============ DENSITY (tweak) ============ */
[data-density="loose"] .findings, [data-density="loose"] .verdict-page, [data-density="loose"] .archive { padding-top: 72px; padding-bottom: 110px; }
[data-density="loose"] .finding-section { gap: 24px; }
[data-density="loose"] .findings-grid { gap: 80px 80px; }

/* ============ BLOOD DROP (intensity icon) ============ */
.blood-drop {
  display: inline-block;
  width: 8px; height: 12px;
  background: var(--warn);
  clip-path: polygon(50% 0, 100% 65%, 100% 85%, 65% 100%, 35% 100%, 0 85%, 0 65%);
  margin-right: 4px;
  opacity: 0.85;
}

/* ============ SIGIL OVERLAY (tweak) ============ */
.sigil-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0; transition: opacity .4s ease;
}
[data-sigil="on"] .sigil-overlay { opacity: 0.06; }
.sigil-overlay svg { width: 100%; height: 100%; }

/* ============================================================
   GATE · Initiatory Entry Sequence · Ordo Semeion · MMXXVI
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   GATE — Maxed · Symmetrical · Mobile-first
   ════════════════════════════════════════════════════════════ */

/* Root */
.gate-root {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 9999;
  overflow: hidden;
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.gate-dissolve {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

/* Particles */
.gate-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.gate-particle {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: particleDrift linear infinite;
}
@keyframes particleDrift {
  0%   { opacity: 0; transform: translateY(0) scale(1); }
  20%  { opacity: 0.25; }
  80%  { opacity: 0.08; }
  100% { opacity: 0; transform: translateY(-80px) scale(0.3); }
}

/* Scanlines */
.gate-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(201,165,112,0.012) 3px,
    rgba(201,165,112,0.012) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* ── TWO-ZONE LORE LAYOUT ── */
.gate-lore-layout {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* TOP ZONE — logo + sigil — occupies top 52% */
.gate-top-zone {
  width: 100%;
  flex: 0 0 52%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 12px;
  position: relative;
}

/* BOTTOM ZONE — text — occupies bottom 48% */
.gate-bottom-zone {
  width: 100%;
  flex: 0 0 48%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 24px 0;
  max-width: 640px;
  align-self: center;
  text-align: center;
}

/* Logo */
.gate-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  border: 1px solid var(--rule);
  background: rgba(14,9,12,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  margin-bottom: 16px;
  z-index: 4;
  position: relative;
}
.gate-logo-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.gate-wordmark {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.gate-wordmark-sub {
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  color: var(--accent);
}

/* Orbital container */
.gate-orbital {
  width: min(380px, 58vw);
  height: min(380px, 58vw);
  opacity: 0;
  transition: opacity 1.2s ease 0.2s;
  pointer-events: none;
  position: relative;
  z-index: 1;
}
.gate-orbital--visible { opacity: 1; }

/* Sigil SVG */
.gate-sigil-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 40px rgba(201,165,112,0.08));
  transition: filter 0.8s ease;
}
.gate-sigil--granted {
  filter: drop-shadow(0 0 60px rgba(201,165,112,0.3));
}
.gate-sigil--glitch {
  filter: drop-shadow(0 0 20px rgba(176,74,58,0.6));
  animation: sigilGlitch 0.6s ease;
}
@keyframes sigilGlitch {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-3px, 1px); }
  40%  { transform: translate(3px, -1px); }
  60%  { transform: translate(-2px, 2px); }
  80%  { transform: translate(2px, -2px); }
  100% { transform: translate(0,0); }
}

/* Ring animations */
.gate-ring-outer      { animation: ringRotate 32s linear infinite; transform-origin: 250px 250px; }
.gate-ring-outer-dash { animation: ringRotate 48s linear infinite reverse; transform-origin: 250px 250px; }
.gate-ring-mid        { animation: ringRotate 20s linear infinite reverse; transform-origin: 250px 250px; }
.gate-ring-inner      { animation: ringRotate 14s linear infinite; transform-origin: 250px 250px; }
.gate-arc-lines       { animation: ringRotate 60s linear infinite; transform-origin: 250px 250px; }
.gate-teardrop        { animation: tearFloat 5s ease-in-out infinite; }
.gate-node            { animation: nodePulse 3s ease-in-out infinite; }
@keyframes ringRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes tearFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes nodePulse { 0%,100% { opacity: 0.5; } 50% { opacity: 0.9; } }
.gate-pulse-ring { animation: pulseRing 1.6s ease-out infinite; }
.gate-pulse-ring--1 { animation-delay: 0.5s; }
.gate-pulse-ring--2 { animation-delay: 1s; }
@keyframes pulseRing { 0% { opacity: 0.5; r: 110; } 100% { opacity: 0; r: 200; } }
.gate-granted-glow { animation: grantedGlow 2s ease-in-out infinite; }
@keyframes grantedGlow { 0%,100% { opacity: 0.06; } 50% { opacity: 0.14; } }

/* Fade utilities */
.gate-fade-in  { animation: gateFadeIn  0.7s ease forwards; }
.gate-fade-out { animation: gateFadeOut 0.4s ease forwards; }
@keyframes gateFadeIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gateFadeOut { from { opacity: 1; } to { opacity: 0; } }
.gate-void { height: 40px; }

/* ── BOOT PHASE ── */
.gate-boot-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 480px;
  align-items: center;
}
.gate-boot-line {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  font-size: 11px;
  letter-spacing: 0.12em;
}
.gate-boot-line--visible { opacity: 1; transform: translateX(0); }
.gate-cursor {
  display: inline-block;
  width: 7px; height: 13px;
  background: var(--accent);
  opacity: 0.7;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 0.7; } 50% { opacity: 0; } }

/* ── LORE PHASE ── */
.gate-lore-chapter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 580px;
}

.gate-chapter-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
}
.gate-chapter-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--rule);
  transition: all 0.4s ease;
}
.gate-chapter-dot--active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transform: scale(1.3);
}
.gate-chapter-dot--done {
  background: var(--accent-deep);
}

.gate-lore-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-height: 160px;
  align-items: center;
}

.gate-lore-line {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  line-height: 1.6;
  text-align: center;
  max-width: 520px;
}
.gate-lore-line--visible { opacity: 1; transform: translateY(0); }

.gate-lore-serif {
  font-family: var(--serif);
  font-size: clamp(15px, 2.2vw, 19px);
  color: var(--ink-dim);
  font-weight: 300;
  font-style: italic;
  line-height: 1.7;
}
.gate-lore-line--gold  { color: var(--accent) !important; }
.gate-lore-line--dim   { color: var(--ink-faint) !important; opacity: 0.7; }
.gate-lore-line.gate-mono { font-size: clamp(9px, 1.4vw, 11px) !important; letter-spacing: 0.1em; line-height: 1.8; }

.gate-skip-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s ease;
  padding: 8px 0;
  margin-top: 4px;
}
.gate-skip-btn:hover { opacity: 0.8; }

/* ── CHALLENGE SPLIT ── */
.gate-root--challenge {
  justify-content: center;
}

.gate-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

.gate-split-left {
  display: flex;
  position: relative;
  overflow: hidden;
}
.gate-split-left-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 52px 32px 32px;
  gap: 24px;
  overflow: hidden;
  position: relative;
}
.gate-challenge-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border: 1px solid var(--rule);
  background: rgba(14,9,12,0.9);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  flex-shrink: 0;
}
.gate-split-rule {
  width: 1px;
  position: absolute;
  right: 0; top: 60px; bottom: 60px;
  background: linear-gradient(to bottom, transparent, var(--rule) 20%, var(--rule) 80%, transparent);
}

.gate-split-right {
  display: flex;
  overflow: hidden;
}
.gate-split-right-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 44px;
  max-width: 520px;
}

/* Keyhole */
.keyhole-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.keyhole-svg {
  width: min(220px, 32vw);
  height: auto;
}
.keyhole-motto {
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.12em;
}
.kh-ring-outer      { animation: ringRotate 40s linear infinite; transform-origin: 160px 148px; }
.kh-ring-outer-dash { animation: ringRotate 60s linear infinite reverse; transform-origin: 160px 148px; }
.kh-ring-mid        { animation: ringRotate 24s linear infinite reverse; transform-origin: 160px 148px; }
.kh-ring-inner      { animation: ringRotate 16s linear infinite; transform-origin: 160px 148px; }
.kh-node            { animation: nodePulse 2.5s ease-in-out infinite; }
.kh-active-ring     { animation: ringRotate 4s linear infinite; transform-origin: 160px 104px; }
.kh-unlock-spin     { animation: ringRotate 1.5s linear infinite; transform-origin: 160px 104px; }
.kh-pulse-ring--0   { animation: pulseRing 1.4s ease-out 0s infinite; }
.kh-pulse-ring--1   { animation: pulseRing 1.4s ease-out 0.4s infinite; }
.kh-pulse-ring--2   { animation: pulseRing 1.4s ease-out 0.8s infinite; }
.kh-open-glow       { animation: grantedGlow 1.5s ease-in-out infinite; }

/* Lore stream */
.gate-lore-stream-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 0;
}
.gate-lore-stream-fade-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: linear-gradient(to bottom, var(--bg), transparent);
  z-index: 2;
  pointer-events: none;
}
.gate-lore-stream-fade-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 48px;
  background: linear-gradient(to top, var(--bg), transparent);
  z-index: 2;
  pointer-events: none;
}
.gate-lore-stream {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.gate-lore-stream-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 48px 8px;
  overflow-y: auto;
  height: 100%;
  scrollbar-width: none;
}
.gate-lore-stream-inner::-webkit-scrollbar { display: none; }
.gate-stream-line {
  opacity: 0.45;
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.6;
  transition: opacity 0.5s ease;
  text-align: left;
}
.gate-stream-serif {
  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.01em;
}
.gate-stream-line--latest { opacity: 1; }
.gate-stream-line--gold   { color: var(--accent); }
.gate-stream-line--dim    { opacity: 0.25; }

/* Challenge right panel */
.gate-challenge-v2 {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.gate-challenge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.gate-challenge-lore {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gate-lore-text {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  color: var(--ink-dim);
  font-weight: 300;
  line-height: 1.65;
}
.gate-lore-text--dim  { color: var(--ink-faint); font-size: 14px; }
.gate-lore-text--gold { color: var(--accent); }

/* Input block */
.gate-input-block { display: flex; flex-direction: column; gap: 8px; }
.gate-input-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.gate-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--rule);
  background: var(--bg-sunk);
  transition: border-color 0.2s ease;
}
.gate-input-wrap--active { border-color: var(--accent-deep); }
.gate-input-wrap--error  { border-color: var(--warn); animation: inputShake 0.4s ease; }
@keyframes inputShake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
.gate-input-prefix {
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  border-right: 1px solid var(--rule);
  line-height: 48px;
  flex-shrink: 0;
}
.gate-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.3em;
  color: var(--ink);
  padding: 0 16px;
  height: 48px;
}
.gate-input::placeholder { color: var(--ink-faint); letter-spacing: 0.2em; font-size: 14px; }
.gate-submit-btn {
  padding: 0 20px;
  height: 48px;
  background: var(--accent);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.gate-submit-btn:hover { background: var(--ink); }
.gate-submit-btn .gate-mono { color: var(--bg); font-size: 10px; letter-spacing: 0.12em; }

.gate-hint, .gate-error {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 20px;
}
.gate-hint .gate-mono { color: var(--ink-faint); }
.gate-error { animation: gateFadeIn 0.3s ease; }
.gate-mono--warn { color: var(--warn); }

/* Attempt pips */
.gate-challenge-attempts {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gate-attempt-pip {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1px solid var(--ink-faint);
  transition: all 0.3s ease;
}
.gate-attempt-pip--used {
  background: var(--warn);
  border-color: var(--warn);
}

.gate-footer-lore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  gap: 16px;
  flex-wrap: wrap;
}

/* Solving / Granted */
.gate-solving { display: flex; flex-direction: column; gap: 16px; }
.gate-solving-lines { display: flex; flex-direction: column; gap: 12px; }
.gate-sline {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.gate-sline--visible { opacity: 1; transform: translateX(0); }
.gate-sline--gold .gate-mono { color: var(--accent); }
.gate-sline-cursor { font-family: var(--mono); font-size: 12px; color: var(--accent); width: 12px; text-align: center; }

.gate-granted {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}
.gate-granted-mark {
  padding: 8px 16px;
  border: 1px solid var(--signal);
  display: inline-block;
}
.gate-mono--gold { color: var(--accent); }
.gate-granted-lore { display: flex; flex-direction: column; gap: 10px; }
.gate-granted-footer { padding-top: 16px; border-top: 1px solid var(--rule); }

/* Sound toggle */
.gate-sound-btn {
  position: fixed;
  bottom: 44px;
  right: 20px;
  z-index: 10;
  background: rgba(14,9,12,0.8);
  border: 1px solid var(--rule);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
}
.gate-sound-btn:hover, .gate-sound-btn.active { border-color: var(--accent-deep); color: var(--accent); }
.gate-sound-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.gate-sound-btn.active .gate-sound-dot { animation: dotPulse 1.5s ease-in-out infinite; }
@keyframes dotPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Bottom bar */
.gate-bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-top: 1px solid var(--rule);
  background: rgba(14,9,12,0.7);
  backdrop-filter: blur(8px);
  z-index: 5;
}

/* Mono utilities */
.gate-mono        { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.gate-mono--dim   { color: var(--ink-dim); }
.gate-mono--faint { color: var(--ink-faint); }
.gate-mono--gold  { color: var(--accent); }
.gate-mono--warn  { color: var(--warn); }

/* ── MOBILE ── */
@media (max-width: 700px) {
  /* Lore layout — more sigil, readable text */
  .gate-top-zone { flex: 0 0 48%; justify-content: flex-end; padding-bottom: 8px; }
  .gate-bottom-zone { flex: 0 0 52%; padding: 12px 20px 0; }
  .gate-orbital { width: min(280px, 70vw); height: min(280px, 70vw); }
  .gate-logo { padding: 6px 14px; }
  .gate-wordmark { font-size: 13px; }
  .gate-wordmark-sub { font-size: 11px; }
  .gate-lore-lines { min-height: 120px; gap: 8px; }
  .gate-lore-serif { font-size: clamp(13px, 3.5vw, 16px) !important; }
  .gate-lore-line.gate-mono { font-size: 9px !important; }

  /* Challenge — stack vertically on mobile */
  .gate-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }
  .gate-split-left { min-height: auto; }
  .gate-split-left-inner {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 16px 20px;
    gap: 16px;
    justify-content: center;
    align-items: flex-start;
  }
  .gate-challenge-logo { display: none; }
  .keyhole-svg { width: min(140px, 38vw); }
  .gate-lore-stream-wrap { max-height: 120px; min-height: 80px; }
  .gate-split-rule { display: none; }
  .gate-split-right-inner { padding: 24px 20px; }
  .gate-footer-lore { flex-direction: column; gap: 6px; align-items: flex-start; }
  .gate-bottom-bar span:nth-child(2) { display: none; }
}

@media (max-width: 400px) {
  .gate-orbital { width: min(240px, 75vw); height: min(240px, 75vw); }
  .gate-bottom-zone { padding: 10px 16px 0; }
  .gate-lore-serif { font-size: 13px !important; }
}

/* ── TOPBAR — stronger separation from bench content ── */
.topbar {
  border-bottom: 1px solid var(--rule) !important;
  background: var(--bg-sunk) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 1px 0 var(--rule), 0 8px 32px rgba(0,0,0,0.4) !important;
}

/* Brand name — stronger contrast against anything below */
.brand-name {
  color: var(--ink) !important;
  text-shadow: none;
  position: relative;
}
/* Gold dot between SPECVLVM and Auditus */
[data-palette="seraphic"] .brand-name em {
  color: var(--accent) !important;
  opacity: 1;
}

/* ── BENCH LEFT — scroll-reveal entrance animations ── */
.bench-left {
  animation: benchLeftReveal 0.9s ease forwards;
  opacity: 0;
}
@keyframes benchLeftReveal {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger each child of bench-left */
.bench-left > * {
  opacity: 0;
  animation: benchItemReveal 0.7s ease forwards;
}
.bench-left > *:nth-child(1) { animation-delay: 0.15s; }
.bench-left > *:nth-child(2) { animation-delay: 0.25s; }
.bench-left > *:nth-child(3) { animation-delay: 0.35s; }
.bench-left > *:nth-child(4) { animation-delay: 0.45s; }
.bench-left > *:nth-child(5) { animation-delay: 0.55s; }
.bench-left > *:nth-child(6) { animation-delay: 0.65s; }
.bench-left > *:nth-child(7) { animation-delay: 0.75s; }
.bench-left > *:nth-child(8) { animation-delay: 0.85s; }
@keyframes benchItemReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PREAMBLE — much stronger contrast + text shadow ── */
.preamble {
  font-size: clamp(34px, 3.2vw, 48px) !important;
  color: var(--ink) !important;
  text-shadow:
    0 0 40px rgba(0,0,0,0.8),
    0 2px 4px rgba(0,0,0,0.6) !important;
  line-height: 1.12 !important;
  position: relative;
  z-index: 2;
}

/* Seraphic: the preamble gets a subtle radial backdrop */
[data-palette="seraphic"] .preamble {
  text-shadow:
    0 0 60px rgba(12,5,8,0.9),
    0 2px 8px rgba(0,0,0,0.7),
    0 0 2px rgba(0,0,0,1) !important;
}
/* The em stays gold gradient but also gets a shadow */
[data-palette="seraphic"] .preamble em {
  filter: drop-shadow(0 0 8px rgba(212,175,55,0.3));
}

/* ── FIELD TAG — stronger legibility ── */
.bench-left .label:first-child {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--accent-deep);
  opacity: 1;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

/* ── BENCH RIGHT — entrance animation ── */
.bench-right {
  animation: benchRightReveal 1s ease 0.3s forwards;
  opacity: 0;
}
@keyframes benchRightReveal {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── INSTRUMENT CARD — ambient glow on seraphic ── */
[data-palette="seraphic"] .instrument {
  box-shadow:
    inset 0 0 40px rgba(212,175,55,0.04),
    0 0 0 1px var(--rule);
}
[data-palette="seraphic"] .instrument-body {
  background: radial-gradient(ellipse at 50% 45%,
    rgba(212,175,55,0.06) 0%,
    transparent 65%
  );
}

/* Instrument body — subtle breathing animation */
.instrument-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%,
    var(--halo) 0%, transparent 70%
  );
  animation: instrumentBreath 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes instrumentBreath {
  0%,100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.04); }
}

/* Instrument header — status dot pulse */
.instrument-header .mono-sm:first-child::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
  animation: statusPulse 2.5s ease-in-out infinite;
}
@keyframes statusPulse {
  0%,100% { opacity: 0.4; box-shadow: none; }
  50%      { opacity: 1; box-shadow: 0 0 6px var(--accent); }
}

/* ── GAUGE VALUES — count-up animation ── */
.gauge-value {
  animation: gaugeReveal 0.8s ease 0.8s both;
}
@keyframes gaugeReveal {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RECENT EXAMINATIONS — hover state ── */
.recent ul li {
  transition: background 0.15s ease, padding-left 0.15s ease;
}
.recent ul li:hover {
  padding-left: 20px;
  background: var(--halo);
}

/* ── BENCH META — typewriter-style reveal ── */
.bench-meta {
  animation: benchItemReveal 0.7s ease 0.4s both;
}
.bench-meta dt, .bench-meta dd {
  animation: benchItemReveal 0.5s ease both;
}
.bench-meta dt:nth-child(1), .bench-meta dd:nth-child(2) { animation-delay: 0.5s; }
.bench-meta dt:nth-child(3), .bench-meta dd:nth-child(4) { animation-delay: 0.6s; }
.bench-meta dt:nth-child(5), .bench-meta dd:nth-child(6) { animation-delay: 0.7s; }
.bench-meta dt:nth-child(7), .bench-meta dd:nth-child(8) { animation-delay: 0.8s; }

/* ── BENCH SEAL — fade up last ── */
.bench-seal {
  animation: benchItemReveal 0.7s ease 1s both;
}

/* ── SAMPLE BUTTONS — shimmer on hover ── */
.bench-sample-btn {
  position: relative;
  overflow: hidden;
}
.bench-sample-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(212,175,55,0.15) 50%,
    transparent 100%
  );
  transition: left 0.4s ease;
}
.bench-sample-btn:hover::after { left: 100%; }

/* ── CTA PRIMARY — stronger on bench ── */
.bench-left .cta-primary {
  position: relative;
  overflow: hidden;
}
.bench-left .cta-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.06) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.bench-left .cta-primary:hover::before { transform: translateX(100%); }

/* ── BENCH BACKGROUND — very subtle scan lines on seraphic ── */
[data-palette="seraphic"] .bench-left {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(212,175,55,0.008) 3px,
      rgba(212,175,55,0.008) 4px
    );
}

/* ── TOPBAR BRAND — prevent bleed into bench content ── */
.shell > .topbar + * {
  /* Ensure content starts cleanly below topbar */
  isolation: isolate;
}

/* ── CORNER ORNAMENT on bench-left ── */
.bench-left::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 1px;
  height: 120px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  opacity: 0.3;
}
.bench-left::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 1px;
  width: 120px;
  background: linear-gradient(to right, var(--accent), transparent);
  opacity: 0.3;
}

/* ── HISTORY PANEL — entrance ── */
.bench-history {
  animation: benchItemReveal 0.7s ease 0.9s both;
}

/* ── INSTRUMENT FOOT — staggered gauge entrance ── */
.instrument-foot .gauge:nth-child(1) { animation: gaugeReveal 0.6s ease 0.9s both; }
.instrument-foot .gauge:nth-child(2) { animation: gaugeReveal 0.6s ease 1.0s both; }
.instrument-foot .gauge:nth-child(3) { animation: gaugeReveal 0.6s ease 1.1s both; }
.instrument-foot .gauge:nth-child(4) { animation: gaugeReveal 0.6s ease 1.2s both; }

/* ── BENCH HEADING AREA — isolation layer so nav doesn't bleed ── */
.bench-left {
  isolation: isolate;
}
.bench-left .preamble {
  position: relative;
  isolation: isolate;
}
/* Subtle bg behind the preamble text so it's never ambiguous */
[data-palette="seraphic"] .bench-left .preamble::before {
  content: '';
  position: absolute;
  inset: -12px -20px;
  background: radial-gradient(ellipse at 20% 50%,
    rgba(12,5,8,0.5) 0%,
    transparent 70%
  );
  z-index: -1;
  pointer-events: none;
}

/* Readability fix: ensure action-row text is always legible */
.action-row .cta-primary,
.action-row .cta-ghost {
  text-shadow: none;
  isolation: isolate;
}

/* ── RECENT LIST — stronger line items ── */
.recent ul {
  border: 1px solid var(--rule);
}
.recent ul li {
  border-bottom: 1px solid var(--rule-soft) !important;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}


/* Status text fade cycle */
@keyframes statusFade {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Instrument header — live clock */
.instrument-header {
  padding: 14px 20px !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ══════════════════════════════════════════════════════════════
   RUNTHROUGH FIXES — All gaps addressed
   ══════════════════════════════════════════════════════════════ */

/* ── ERROR BANNER — animated, dismissible, Order voice ── */
.error-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--warn-deep);
  padding: 12px 32px;
  cursor: pointer;
  animation: errorSlideIn 0.4s ease;
  border-bottom: 1px solid var(--warn);
}
@keyframes errorSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.error-banner-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.error-banner-text {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  flex: 1;
}
.error-banner-dismiss {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  flex-shrink: 0;
  transition: color 0.2s ease;
}
.error-banner:hover .error-banner-dismiss { color: var(--ink); }

/* ── ROUTE TRANSITIONS ── */
.bench, .intake, .examination, .findings,
.verdict-page, .archive, .lore-root {
  animation: screenReveal 0.4s ease forwards;
}
@keyframes screenReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SCORECARD BARS ── */
.scorecard-bar-wrap {
  margin-top: 8px;
}
.scorecard-bar-track {
  height: 2px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
}
.scorecard-bar-fill {
  height: 100%;
  transition: width 1s ease;
  position: relative;
}
.scorecard-bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0;
  width: 12px; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.3));
}

/* ── COMPLIANCE BADGE ── */
.compliance-badge {
  display: inline-block;
  animation: badgeReveal 0.5s ease 0.3s both;
}
@keyframes badgeReveal {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── SPECIMEN TEXT — max height with scroll ── */
.specimen-text {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.specimen-text::-webkit-scrollbar { width: 4px; }
.specimen-text::-webkit-scrollbar-track { background: transparent; }
.specimen-text::-webkit-scrollbar-thumb { background: var(--rule); }

/* ── FINDINGS — jump button ── */
.findings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.doc-no {
  font-family: var(--mono);
  font-size: var(--t-mono-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
  width: 100%;
}

/* ── INTAKE — char limit warning ── */
.textarea {
  resize: vertical;
  min-height: 260px;
}

/* ── SPECBAR footer — entrance ── */
.specbar {
  animation: specbarReveal 0.6s ease 0.5s both;
}
@keyframes specbarReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── ARCHIVE CARD DQ BARS — transition delay ── */
.archive-dq-fill {
  transition: width 1s ease 0.3s !important;
}

/* ── VERDICT SCORECARD — staggered entrance ── */
.principle {
  animation: principleReveal 0.5s ease both;
}
.principle:nth-child(1) { animation-delay: 0.1s; }
.principle:nth-child(2) { animation-delay: 0.18s; }
.principle:nth-child(3) { animation-delay: 0.26s; }
.principle:nth-child(4) { animation-delay: 0.34s; }
.principle:nth-child(5) { animation-delay: 0.42s; }
.principle:nth-child(6) { animation-delay: 0.50s; }
@keyframes principleReveal {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── FINDINGS SECTIONS — staggered entrance ── */
.finding-section {
  animation: sectionReveal 0.6s ease both;
}
.findings-grid .finding-section:nth-child(1) { animation-delay: 0.1s; }
.findings-grid .finding-section:nth-child(2) { animation-delay: 0.2s; }
.findings-grid .finding-section:nth-child(3) { animation-delay: 0.3s; }
.findings-grid .finding-section:nth-child(4) { animation-delay: 0.4s; }
.findings-grid .finding-section:nth-child(5) { animation-delay: 0.5s; }
.findings-grid .finding-section:nth-child(6) { animation-delay: 0.6s; }
.findings-grid .finding-section:nth-child(7) { animation-delay: 0.7s; }
@keyframes sectionReveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── TOPBAR nav crumbs — active state ── */
.crumbs span.here {
  color: var(--ink);
  position: relative;
}
.crumbs span.here::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
}

/* ── INTAKE RAIL — staggered entrance ── */
.intake-rail > * {
  animation: intakeItemReveal 0.5s ease both;
}
.intake-rail > *:nth-child(1) { animation-delay: 0.1s; }
.intake-rail > *:nth-child(2) { animation-delay: 0.2s; }
.intake-rail > *:nth-child(3) { animation-delay: 0.3s; }
.intake-rail > *:nth-child(4) { animation-delay: 0.4s; }
.intake-rail > *:nth-child(5) { animation-delay: 0.5s; }
@keyframes intakeItemReveal {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── INTAKE MAIN — entrance ── */
.intake-main > * {
  animation: intakeItemReveal 0.5s ease both;
}
.intake-main > *:nth-child(1) { animation-delay: 0.15s; }
.intake-main > *:nth-child(2) { animation-delay: 0.22s; }
.intake-main > *:nth-child(3) { animation-delay: 0.29s; }
.intake-main > *:nth-child(4) { animation-delay: 0.36s; }
.intake-main > *:nth-child(5) { animation-delay: 0.43s; }

/* ── SYMBOL CARDS — hover lift ── */
.symbol {
  transition: background 0.2s ease, transform 0.2s ease;
}
.symbol:hover {
  background: var(--halo);
  transform: translateX(4px);
}

/* ── PULL QUOTE — entrance ── */
.pull-quote {
  animation: pullQuoteReveal 0.7s ease 0.3s both;
}
@keyframes pullQuoteReveal {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── VERDICT — counter-praxis grid mobile ── */
@media (max-width: 640px) {
  .verdict-page > div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 28px !important;
  }
}

/* ── DQ BAR on findings header ── */
.head-meta .row span[style*="fontFamily"] {
  font-variant-numeric: tabular-nums;
  animation: dqReveal 0.8s ease 0.4s both;
}
@keyframes dqReveal {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── ARCHIVE stats stagger ── */
.archive-stat:nth-child(1) { animation: gaugeReveal 0.5s ease 0.1s both; }
.archive-stat:nth-child(2) { animation: gaugeReveal 0.5s ease 0.2s both; }
.archive-stat:nth-child(3) { animation: gaugeReveal 0.5s ease 0.3s both; }
.archive-stat:nth-child(4) { animation: gaugeReveal 0.5s ease 0.4s both; }
.archive-stat:nth-child(5) { animation: gaugeReveal 0.5s ease 0.5s both; }

/* ── ARCHIVE CARDS stagger ── */
.archive-card:nth-child(1) { animation: screenReveal 0.4s ease 0.05s both; }
.archive-card:nth-child(2) { animation: screenReveal 0.4s ease 0.10s both; }
.archive-card:nth-child(3) { animation: screenReveal 0.4s ease 0.15s both; }
.archive-card:nth-child(4) { animation: screenReveal 0.4s ease 0.20s both; }
.archive-card:nth-child(5) { animation: screenReveal 0.4s ease 0.25s both; }
.archive-card:nth-child(n+6) { animation: screenReveal 0.4s ease 0.30s both; }

/* ══════════════════════════════════════════════════════════════
   MONETIZATION — Upgrade Screen · Examiner UI · Toast
   ══════════════════════════════════════════════════════════════ */

/* ── UPGRADE OVERLAY ── */
.upgrade-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,7,11,0.92);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: overlayIn 0.3s ease;
}
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.upgrade-modal {
  width: min(720px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 44px;
  gap: 28px;
  animation: modalIn 0.35s ease;
  scrollbar-width: thin;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.upgrade-sigil {
  display: flex;
  justify-content: center;
}

.upgrade-header {
  text-align: center;
}
.upgrade-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 300;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 12px;
}
.upgrade-subtitle {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.upgrade-lore {
  max-width: 520px;
  text-align: center;
  font-size: 16px;
  color: var(--ink-dim);
  line-height: 1.7;
  font-weight: 300;
  font-style: italic;
}

/* ── PLANS GRID ── */
.upgrade-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}
@media (max-width: 560px) {
  .upgrade-plans { grid-template-columns: 1fr; }
}

.upgrade-plan {
  padding: 24px 24px 20px;
  border: 1px solid var(--rule);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: border-color 0.2s ease;
}
.upgrade-plan:hover { border-color: var(--accent-deep); }

.upgrade-plan--featured {
  border-color: var(--accent-deep);
  background: var(--bg-elev);
}

.upgrade-plan-badge {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--accent-deep);
  display: inline-block;
  align-self: flex-start;
}

.upgrade-plan-name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.upgrade-plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.upgrade-plan-amount {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
}
.upgrade-plan-period {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
}

.upgrade-plan-saving {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--signal);
  letter-spacing: 0.06em;
  min-height: 14px;
}

.upgrade-plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  margin-top: 4px;
}
.upgrade-plan-features li {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-dim);
  font-style: italic;
  padding-left: 16px;
  position: relative;
}
.upgrade-plan-features li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-style: normal;
}

.upgrade-plan-cta {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  font-size: 10px;
}
.upgrade-plan-cta:disabled { opacity: 0.5; cursor: wait; }

.upgrade-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  text-align: center;
}

.upgrade-dismiss {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-decoration: underline;
  cursor: pointer;
  text-transform: uppercase;
  transition: color 0.2s ease;
}
.upgrade-dismiss:hover { color: var(--ink-dim); }

/* ── EXAMINER STATUS BAR on Bench ── */
.examiner-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--rule-soft);
  margin-bottom: 20px;
  cursor: default;
}
.examiner-status-bar--free {
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.examiner-status-bar--free:hover {
  border-color: var(--accent-deep);
  background: var(--halo);
}
.examiner-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal);
  flex-shrink: 0;
  animation: statusPulse 2s ease-in-out infinite;
}
.examiner-status-dot--free {
  background: var(--ink-faint);
  animation: none;
}

/* ── EXAMINER GRANTED TOAST ── */
.examiner-granted-toast {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--signal);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 700;
  cursor: pointer;
  animation: toastIn 0.4s ease, toastOut 0.4s ease 5s forwards;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  max-width: min(480px, 90vw);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(8px); pointer-events: none; }
}

.examiner-granted-mark {
  font-size: 24px;
  color: var(--signal);
  flex-shrink: 0;
}
.examiner-granted-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--signal);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.examiner-granted-sub {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink-dim);
  font-style: italic;
  line-height: 1.4;
}

/* ── PAYPAL PAYMENT UI ── */
.upgrade-method-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--rule);
  overflow: hidden;
  margin-bottom: 4px;
}
.upgrade-method-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid var(--rule);
}
.upgrade-method-btn:last-child { border-right: none; }
.upgrade-method-btn.active {
  background: var(--halo);
  color: var(--ink);
}
.upgrade-method-btn:hover:not(.active) {
  background: var(--halo);
  color: var(--ink-dim);
}

/* PayPal branded button */
.upgrade-paypal-btn {
  width: 100%;
  padding: 13px 20px;
  background: #FFC439;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: Arial, sans-serif;
  transition: background 0.2s ease, transform 0.1s ease;
  margin-top: 8px;
}
.upgrade-paypal-btn:hover { background: #FFB300; }
.upgrade-paypal-btn:active { transform: scale(0.98); }
.upgrade-paypal-btn:disabled { opacity: 0.5; cursor: wait; }

.upgrade-paypal-btn--outline {
  background: transparent;
  border: 2px solid #FFC439;
}
.upgrade-paypal-btn--outline:hover { background: rgba(255,196,57,0.08); }

.paypal-logo {
  color: #003087;
  font-style: italic;
}
.paypal-logo-pal {
  color: #009cde;
  font-style: italic;
}

/* Disabled state text for PayPal loading */
.upgrade-paypal-btn:disabled .paypal-logo,
.upgrade-paypal-btn:disabled .paypal-logo-pal {
  display: none;
}

/* ── TOPBAR AUTH BUTTON ── */
.topbar-auth-btn {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-auth-btn:hover {
  border-color: var(--accent-deep);
  color: var(--accent);
  background: var(--halo);
}
.topbar-auth-btn.examiner {
  border-color: var(--signal);
  color: var(--signal);
}
.topbar-auth-btn.examiner:hover {
  background: rgba(107,138,122,0.08);
}

/* ══════════════════════════════════════════════════════════════
   PREMIUM FEATURES — Notes · Share · Shared Viewer
   ══════════════════════════════════════════════════════════════ */

/* ── EXAMINATION NOTES ── */
.findings-notes-section,
.findings-share-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-soft);
}
.findings-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.findings-notes-textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  color: var(--ink-dim);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  line-height: 1.65;
  padding: 12px 16px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
}
.findings-notes-textarea:focus { border-color: var(--accent-deep); color: var(--ink); }
.findings-notes-textarea::placeholder { color: var(--ink-faint); }

/* ── SHARE LINK ── */
.findings-share-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.findings-share-url {
  flex: 1;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 10px 14px;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  word-break: break-all;
  min-width: 0;
}
.findings-share-copy {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.findings-share-copy.copied { background: var(--signal); }
.findings-share-revoke {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 10px 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.findings-share-revoke:hover { border-color: var(--warn); color: var(--warn); }

/* ── ARCHIVE DELETE BUTTON ── */
.archive-card-delete {
  position: absolute;
  top: 16px;
  right: 52px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
  padding: 4px 8px;
}
.archive-card:hover .archive-card-delete { opacity: 1; }
.archive-card-delete:hover { color: var(--warn); }

/* ── SHARED EXAMINATION VIEWER ── */
.shared-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 800;
  display: flex;
  flex-direction: column;
  animation: screenReveal 0.4s ease;
  overflow: hidden;
}

.shared-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-elev);
  flex-shrink: 0;
}

.shared-close-btn {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.shared-close-btn:hover { border-color: var(--accent-deep); color: var(--accent); }

.shared-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 80px;
  display: flex;
  justify-content: center;
}

.shared-content {
  width: 100%;
  max-width: 760px;
  padding-top: 48px;
}

.shared-title-block {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.shared-title {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 300;
  font-style: italic;
  color: var(--ink);
  line-height: 1.15;
}

.shared-grade-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px;
  border: 1px solid;
  flex-shrink: 0;
  min-width: 90px;
  text-align: center;
}

/* Mobile shared viewer */
@media (max-width: 640px) {
  .shared-header { padding: 12px 16px; }
  .shared-title-block { flex-direction: column; gap: 16px; }
  .shared-grade-block { align-self: flex-start; }
  .findings-share-url-row { flex-direction: column; }
}

/* ══════════════════════════════════════════════════════════════
   FULL UI POLISH — Sample row · History · Stats · New features
   ══════════════════════════════════════════════════════════════ */

/* ── SAMPLE ROW — fix spacing ── */
.bench-sample-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 16px !important;
  flex-wrap: wrap !important;
  padding: 14px 0 !important;
  border-top: 1px solid var(--rule-soft) !important;
  border-bottom: 1px solid var(--rule-soft) !important;
}
.bench-sample-label {
  font-family: var(--mono) !important;
  font-size: 9px !important;
  letter-spacing: 0.14em !important;
  color: var(--ink-faint) !important;
  text-transform: uppercase !important;
  flex-shrink: 0 !important;
  padding-right: 4px !important;
}
.bench-sample-btn {
  font-family: var(--mono) !important;
  font-size: 9px !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--ink-dim) !important;
  background: transparent !important;
  border: 1px solid var(--rule) !important;
  padding: 5px 12px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}
.bench-sample-btn:hover {
  border-color: var(--accent-deep) !important;
  color: var(--accent) !important;
  background: var(--halo) !important;
}

/* ── BENCH STATS ROW — examiner stats ── */
.bench-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 24px;
  margin-bottom: 24px;
}
.bench-stat {
  background: var(--bg-elev);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bench-stat-val {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
}
.bench-stat-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
  line-height: 1.4;
}
.bench-stat-val.gold  { color: var(--accent); }
.bench-stat-val.green { color: var(--signal); }
.bench-stat-val.red   { color: var(--warn); }

/* ── EXAMINER BADGE in topbar ── */
.topbar-examiner-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal);
  padding: 4px 10px;
  border: 1px solid var(--signal);
  background: rgba(107,138,122,0.06);
  opacity: 0.9;
}
.topbar-examiner-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--signal);
  animation: statusPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── KEYBOARD SHORTCUTS HINT ── */
.bench-shortcuts {
  margin-top: 20px;
  padding: 10px 14px;
  border: 1px solid var(--rule-soft);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.bench-shortcut {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bench-shortcut-key {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding: 2px 6px;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
}
.bench-shortcut-label {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ── DRIFT TREND in archive stats ── */
.drift-trend-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
  margin-top: 4px;
}
.drift-trend-col {
  flex: 1;
  background: var(--accent);
  opacity: 0.5;
  border-radius: 1px;
  min-height: 2px;
  transition: opacity 0.2s ease;
}
.drift-trend-col:hover { opacity: 1; }

/* ── QUICK RE-EXAMINE button in findings ── */
.quick-reexamine-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-reexamine-btn:hover {
  border-color: var(--accent-deep);
  color: var(--accent);
  background: var(--halo);
}

/* ── EXAMINATION STREAK ── */
.bench-streak {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.bench-streak-dots {
  display: flex;
  gap: 4px;
}
.bench-streak-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rule);
  transition: background 0.3s ease;
}
.bench-streak-dot.active { background: var(--accent); }
.bench-streak-dot.recent { background: var(--signal); }

/* ── CODEX POPOVER — clean positioning ── */
.codex-nav-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.codex-popover {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  padding: 18px 20px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.codex-nav-wrap:hover .codex-popover {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}
.codex-popover::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  background: var(--bg-elev);
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
  transform: translateX(-50%) rotate(45deg);
}
.codex-popover-title {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.codex-popover-desc {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--ink-dim);
  line-height: 1.65;
  font-style: italic;
  font-weight: 300;
  margin-bottom: 12px;
}
.codex-popover-link {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s ease;
}
.codex-popover-link:hover { opacity: 0.7; }

/* ── SPECIMEN COUNTER BADGE ── */
.specimen-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.specimen-counter strong {
  font-weight: 400;
  color: var(--accent);
}

/* ── SESSION HISTORY — polish ── */
.bench-history {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--rule-soft);
  animation: benchItemReveal 0.7s ease 0.9s both;
}
.bench-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.bench-history-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.bench-history-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--rule-soft);
}
.bench-history-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-soft);
  cursor: pointer;
  transition: background 0.15s ease;
}
.bench-history-item:last-child { border-bottom: none; }
.bench-history-item:hover { background: var(--halo); }
.bench-history-title {
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bench-history-ts {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  flex-shrink: 0;
}
.bench-history-grade {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--accent);
  flex-shrink: 0;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  min-width: 34px;
  text-align: center;
}
.bench-history-empty {
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  color: var(--ink-faint);
  padding: 18px 16px;
  text-align: center;
}

/* Mobile fixes */
@media (max-width: 640px) {
  .bench-stats-row { grid-template-columns: 1fr 1fr; }
  .bench-shortcuts { display: none; }
  .codex-popover { width: min(280px, 80vw); left: 0; transform: none; }
  .codex-popover::before { left: 24px; transform: translateX(0) rotate(45deg); }
  .codex-nav-wrap:hover .codex-popover { transform: none; }
}

/* ══════════════════════════════════════════════════════════════
   SHARE CARD — Full modal + card layout
   ══════════════════════════════════════════════════════════════ */

.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,7,11,0.88);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.share-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.share-modal {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-sunk);
  flex-shrink: 0;
}
.share-modal-title {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.share-modal-close {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.share-modal-close:hover {
  border-color: var(--warn);
  color: var(--warn);
}

/* ── THE CARD ── */
.share-card {
  margin: 20px;
  border: 1px solid var(--rule);
  background: var(--bg-sunk);
  display: flex;
  flex-direction: column;
}

.share-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  flex-wrap: wrap;
  gap: 8px;
}
.share-card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.share-card-logo {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.share-card-logo em {
  color: var(--accent);
  font-style: normal;
}
.share-card-meta {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.share-card-body {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-card-specimen {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  font-weight: 300;
  color: var(--ink);
  line-height: 1.2;
}

.share-card-grade-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--rule-soft);
}
.share-card-grade {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
}
.share-card-verdict {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink-dim);
  font-style: italic;
  line-height: 1.5;
}
.share-card-drift {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.share-card-drift-num {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.share-card-drift-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.share-card-principles {
  display: grid;
  grid-template-columns: repeat(6,1fr);
  gap: 4px;
}
.share-card-principle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 1px solid var(--rule-soft);
  background: var(--bg);
}
.share-card-p-num {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.share-card-p-score {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.share-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.share-card-url {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: lowercase;
}
.share-card-notice {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── SHARE ACTIONS ── */
.share-modal-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--rule);
  background: var(--bg-sunk);
  flex-shrink: 0;
}
.share-copy-btn {
  flex: 1;
  padding: 12px 20px;
  background: var(--accent);
  border: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  cursor: pointer;
  transition: all 0.2s ease;
}
.share-copy-btn:hover { background: var(--ink); }
.share-copy-btn.copied { background: var(--signal); }
.share-dismiss-btn {
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.15s ease;
}
.share-dismiss-btn:hover { border-color: var(--ink-dim); color: var(--ink); }

/* Mobile */
@media (max-width: 640px) {
  .share-card-grade-row {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .share-card-drift { grid-column: 1; grid-row: 2; align-items: flex-start; }
  .share-card-principles { grid-template-columns: repeat(3,1fr); }
  .share-modal-actions { flex-direction: column; }
  .share-copy-btn, .share-dismiss-btn { text-align: center; }
}

/* ═══════════════════════════════════════════════════════════════════
   ARCHIVE — case-file cards, stats, controls   (render fix)
   ═══════════════════════════════════════════════════════════════════ */
.archive-head { flex-wrap: wrap; gap: 28px; }
.archive-stats { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-end; }
.archive-stat { display: flex; flex-direction: column; gap: 4px; min-width: 60px; }
.archive-stat-val { font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1; color: var(--ink); }
.archive-stat-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }

.archive-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }
.archive-filters, .archive-sort { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.archive-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.archive-card { position: relative; border: 1px solid var(--rule); background: var(--bg-elev); padding: 22px 22px 20px; cursor: pointer; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.archive-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: 0; transition: opacity .2s ease; }
.archive-card:hover { border-color: var(--accent-deep); transform: translateY(-3px); box-shadow: 0 12px 36px rgba(0,0,0,0.4); }
.archive-card:hover::before { opacity: 0.7; }

.archive-card-head { display: flex; align-items: center; gap: 12px; }
.archive-card-sigil { flex-shrink: 0; opacity: 0.85; }
.archive-card-id { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.archive-card-id .mono-sm { font-size: 9.5px; letter-spacing: 0.08em; }
.archive-card-grade { font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 1; margin-left: auto; }
.archive-card-title { font-family: var(--serif); font-size: 21px; font-style: italic; color: var(--ink); line-height: 1.25; }
.archive-card-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.archive-card-verdict { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-dim); }
.archive-card-drift { display: flex; align-items: center; gap: 10px; }
.archive-dq-track { flex: 1; height: 2px; background: var(--rule); position: relative; overflow: hidden; }
.archive-card-arrow { font-family: var(--mono); color: var(--accent); align-self: flex-end; transition: transform .2s ease; }
.archive-card:hover .archive-card-arrow { transform: translateX(4px); }

.archive-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 80px 20px; text-align: center; }
.archive-empty .empty-hint { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-faint); max-width: 42ch; }

@media (max-width: 640px) {
  .archive-cards { grid-template-columns: 1fr; }
  .archive-stats { gap: 18px; }
  .archive-stat-val { font-size: 24px; }
}

/* ═══════════════════════════════════════════════════════════════════
   CODEX / LORE — full design system   (render fix + interactive)
   ═══════════════════════════════════════════════════════════════════ */
.lore-root { --lore-max: 1080px; color: var(--ink); position: relative; }
.lore-mono { font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; font-size: 10px; }
.lore-mono--dim   { color: var(--ink-dim); }
.lore-mono--faint { color: var(--ink-faint); }
.lore-mono--gold  { color: var(--accent); }

/* scroll progress + chapter nav */
.lore-progress { position: fixed; top: 0; left: 0; height: 2px; z-index: 60; background: linear-gradient(to right, var(--accent-deep), var(--accent)); width: 0%; transition: width .1s linear; }
.lore-chapnav { position: fixed; top: 50%; right: 22px; transform: translateY(-50%); z-index: 55; display: flex; flex-direction: column; gap: 14px; }
.lore-chapnav-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink-faint); background: transparent; cursor: pointer; padding: 0; position: relative; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.lore-chapnav-dot:hover { border-color: var(--accent); transform: scale(1.25); }
.lore-chapnav-dot--active { background: var(--accent); border-color: var(--accent); }
.lore-chapnav-dot::after { content: attr(data-label); position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s ease; background: var(--bg-sunk); padding: 3px 8px; border: 1px solid var(--rule); }
.lore-chapnav-dot:hover::after { opacity: 1; }
@media (max-width: 900px) { .lore-chapnav { display: none; } }

/* HERO */
.lore-hero { position: relative; min-height: 92vh; display: flex; align-items: center; justify-content: center; overflow: hidden; text-align: center; padding: 60px 24px; }
.lore-hero-bg { position: absolute; inset: 0; pointer-events: none; }
.lore-hero-particle { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: var(--accent); opacity: 0.12; animation: loreFloat linear infinite; }
@keyframes loreFloat { 0% { transform: translateY(0) scale(1); opacity: 0; } 10% { opacity: 0.18; } 90% { opacity: 0.18; } 100% { transform: translateY(-60px) scale(1.4); opacity: 0; } }
.lore-hero-content { position: relative; z-index: 1; max-width: 760px; opacity: 0; transform: translateY(20px); transition: opacity 1s ease, transform 1s ease; }
.lore-hero--visible .lore-hero-content { opacity: 1; transform: translateY(0); }
.lore-hero-eyebrow { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 36px; }
.lore-hero-rule { width: 60px; height: 1px; background: var(--rule); }
.lore-hero-sigil { display: flex; justify-content: center; margin-bottom: 28px; }
.lore-hero-title { display: flex; flex-direction: column; gap: 6px; margin-bottom: 28px; }
.lore-hero-title-main { font-family: var(--serif); font-size: clamp(52px, 8vw, 104px); font-weight: 400; line-height: 0.95; color: var(--ink); }
.lore-hero-title-sub  { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 3vw, 36px); color: var(--accent); }
.lore-hero-desc { font-family: var(--serif); font-size: 19px; line-height: 1.6; color: var(--ink-dim); max-width: 52ch; margin: 0 auto 32px; }
.lore-hero-footer { margin-bottom: 56px; }
.lore-hero-footer .lore-mono { font-size: 13px; font-style: italic; letter-spacing: 0.04em; text-transform: none; font-family: var(--serif); color: var(--ink-faint); }
.lore-hero-scroll-hint { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lore-scroll-arrow { font-size: 18px; color: var(--accent); animation: loreBounce 2s ease infinite; }
@keyframes loreBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* STATS ROW */
.lore-stats-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; max-width: var(--lore-max); margin: 0 auto; padding: 56px 32px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.lore-stat { text-align: center; opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.lore-stat--visible { opacity: 1; transform: translateY(0); }
.lore-stat-value { font-family: var(--serif); font-size: 40px; font-weight: 400; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.lore-stat-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); line-height: 1.4; }
@media (max-width: 820px) { .lore-stats-row { grid-template-columns: repeat(3, 1fr); gap: 28px 16px; } }
@media (max-width: 420px) { .lore-stats-row { grid-template-columns: repeat(2, 1fr); } }

/* BODY + SECTIONS */
.lore-body { max-width: var(--lore-max); margin: 0 auto; padding: 0 32px; }
.lore-section { padding: 96px 0; border-bottom: 1px solid var(--rule-soft); opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.lore-section--visible { opacity: 1; transform: translateY(0); }
.lore-section-head { margin-bottom: 48px; }
.lore-section-head--right { text-align: right; }
.lore-section-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.lore-section-head--right .lore-section-meta { flex-direction: row-reverse; }
.lore-section-num { font-family: var(--mono); font-size: 13px; letter-spacing: 0.2em; color: var(--accent); }
.lore-section-rule { flex: 1; height: 1px; background: var(--rule); }
.lore-section-title { font-family: var(--serif); font-size: clamp(32px, 4vw, 52px); font-weight: 400; font-style: italic; line-height: 1.05; color: var(--ink); margin-bottom: 14px; }
.lore-section-subtitle { font-family: var(--serif); font-size: 18px; color: var(--ink-dim); line-height: 1.5; max-width: 60ch; }
.lore-section-head--right .lore-section-subtitle { margin-left: auto; }

.lore-para { font-family: var(--serif); font-size: 17.5px; line-height: 1.75; color: var(--ink-dim); margin-bottom: 22px; opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.lore-para--visible { opacity: 1; transform: translateY(0); }
.lore-para em { color: var(--ink); font-style: italic; }

/* two-column */
.lore-two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: start; margin-bottom: 40px; }
.lore-two-col--reversed { grid-template-columns: 1fr 1.5fr; }
.lore-col-sigil { display: flex; flex-direction: column; align-items: center; gap: 24px; position: sticky; top: 100px; }
.lore-col-annotation { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.lore-annotation-line { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-faint); }
.lore-annotation-line--active { color: var(--accent); }
.lore-annotation-arrow { font-size: 11px; color: var(--rule); text-align: center; }
@media (max-width: 820px) {
  .lore-two-col, .lore-two-col--reversed { grid-template-columns: 1fr; gap: 36px; }
  .lore-col-sigil { position: static; order: -1; }
}

/* sigil wrap */
.lore-sigil-wrap { opacity: 0; transform: scale(0.9) rotate(-8deg); transition: opacity 1s ease, transform 1.2s cubic-bezier(.22,1,.36,1); }
.lore-sigil-wrap--visible { opacity: 1; transform: scale(1) rotate(0); }
.lore-sigil-svg { width: 100%; height: 100%; }
.lore-sigil-wrap--visible .lore-sigil-svg { animation: loreSpin 90s linear infinite; }
@keyframes loreSpin { to { transform: rotate(360deg); } }
.lore-node { transition: opacity .3s ease; }
.lore-sigil-wrap:hover .lore-node { opacity: 1; }

/* pull quote */
.lore-pullquote { position: relative; margin: 64px auto; max-width: 70ch; text-align: center; padding: 0 40px; opacity: 0; transform: translateY(20px); transition: opacity .9s ease, transform .9s ease; }
.lore-pullquote--visible { opacity: 1; transform: translateY(0); }
.lore-pullquote-mark { font-family: var(--serif); font-size: 90px; color: var(--accent); opacity: 0.3; line-height: 0.5; height: 40px; }
.lore-pullquote-text { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.6vw, 30px); line-height: 1.45; color: var(--ink); margin-bottom: 16px; }
.lore-pullquote-attr { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); font-style: normal; }

/* subsection */
.lore-subsection { margin-top: 56px; }
.lore-subsection-title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 28px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }

/* timeline */
.lore-timeline { position: relative; }
.lore-timeline-spine { position: absolute; left: 124px; top: 8px; bottom: 8px; width: 1px; background: var(--rule); }
.lore-timeline-event { position: relative; display: grid; grid-template-columns: 108px 1fr; gap: 32px; padding: 18px 0; opacity: 0; transform: translateX(-16px); transition: opacity .7s ease, transform .7s ease; }
.lore-timeline-event--visible { opacity: 1; transform: translateX(0); }
.lore-timeline-year { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--accent); text-align: right; padding-top: 3px; }
.lore-timeline-dot { position: absolute; left: 120px; top: 22px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); }
.lore-timeline-content { padding-left: 8px; }
.lore-timeline-label { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink); margin-bottom: 6px; }
.lore-timeline-desc { font-family: var(--serif); font-size: 15px; line-height: 1.6; color: var(--ink-dim); }
@media (max-width: 640px) {
  .lore-timeline-spine, .lore-timeline-dot { display: none; }
  .lore-timeline-event { grid-template-columns: 1fr; gap: 6px; }
  .lore-timeline-year { text-align: left; }
}

/* principles grid */
.lore-principles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 36px; }
.lore-principle { position: relative; display: flex; gap: 18px; padding: 24px; border: 1px solid var(--rule); background: var(--bg-elev); opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease, border-color .25s ease, background .25s ease; cursor: default; overflow: hidden; }
.lore-principle--visible { opacity: 1; transform: translateY(0); }
.lore-principle:hover { border-color: var(--accent-deep); background: var(--bg-sunk); }
.lore-principle-num { font-family: var(--serif); font-style: italic; font-size: 30px; color: var(--accent); line-height: 1; flex-shrink: 0; width: 44px; }
.lore-principle-name { font-family: var(--serif); font-size: 20px; font-style: italic; color: var(--ink); margin-bottom: 8px; }
.lore-principle-desc { font-family: var(--serif); font-size: 14.5px; line-height: 1.6; color: var(--ink-dim); }
.lore-principle-line { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); transition: width .4s ease; }
.lore-principle:hover .lore-principle-line { width: 100%; }
@media (max-width: 640px) { .lore-principles-grid { grid-template-columns: 1fr; } }

/* circuit */
.lore-circuit { position: relative; display: flex; justify-content: center; align-items: center; min-height: 320px; margin-top: 24px; }
.lore-circuit-sigil { position: relative; z-index: 1; }
.lore-circuit-labels { position: absolute; inset: 0; }
.lore-circuit-label { position: absolute; }
.lore-circuit-label--top    { top: 0; left: 50%; transform: translateX(-50%); }
.lore-circuit-label--bottom { bottom: 0; left: 50%; transform: translateX(-50%); }
.lore-circuit-label--tr { top: 22%; right: 8%; }
.lore-circuit-label--br { bottom: 22%; right: 8%; }
.lore-circuit-label--bl { bottom: 22%; left: 8%; }
.lore-circuit-label--tl { top: 22%; left: 8%; }

/* compiler diagram */
.lore-compiler-diagram { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.lore-compiler-node { width: 100%; max-width: 220px; text-align: center; padding: 18px; border: 1px solid var(--rule); background: var(--bg-elev); }
.lore-compiler-node--core { border-color: var(--accent-deep); background: var(--bg-sunk); box-shadow: 0 0 24px var(--halo); }
.lore-compiler-arrow { color: var(--accent); font-size: 16px; }

/* warning block */
.lore-warning-block { margin-top: 40px; padding: 28px; border: 1px solid var(--warn-deep); background: rgba(176,74,58,0.05); }
.lore-warning-text { font-family: var(--serif); font-size: 15.5px; line-height: 1.65; color: var(--ink-dim); }

/* motto block */
.lore-motto-block { text-align: center; margin: 64px 0; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.lore-motto-rule { width: 80px; height: 1px; background: var(--accent); opacity: 0.5; }
.lore-motto-text { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 3vw, 34px); color: var(--ink); }
.lore-motto-attr { font-style: normal; }

/* instruments */
.lore-instruments-list { display: flex; flex-direction: column; gap: 2px; margin-top: 36px; }
.lore-instrument { display: grid; grid-template-columns: 60px 1fr auto; gap: 24px; align-items: center; padding: 24px; border: 1px solid var(--rule); background: var(--bg-elev); opacity: 0; transform: translateX(-16px); transition: opacity .6s ease, transform .6s ease, border-color .25s ease; }
.lore-instrument--visible { opacity: 1; transform: translateX(0); }
.lore-instrument:hover { border-color: var(--accent-deep); }
.lore-instrument-num { font-family: var(--mono); font-size: 18px; color: var(--accent); }
.lore-instrument-name { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.lore-instrument-desc { font-family: var(--serif); font-size: 14.5px; line-height: 1.55; color: var(--ink-dim); }
.lore-instrument-status { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; padding: 5px 10px; border: 1px solid currentColor; white-space: nowrap; }
.lore-status--active  { color: var(--signal); }
.lore-status--sealed  { color: var(--warn); }
.lore-status--planned { color: var(--ink-faint); }
@media (max-width: 640px) { .lore-instrument { grid-template-columns: 1fr; gap: 10px; } }

/* outcomes */
.lore-outcomes-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.lore-outcome { display: grid; grid-template-columns: 50px 1fr; gap: 20px; padding: 22px 24px; border: 1px solid var(--rule); background: var(--bg-elev); opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease, border-color .25s ease; }
.lore-outcome--visible { opacity: 1; transform: translateY(0); }
.lore-outcome:hover { border-color: var(--accent-deep); }
.lore-outcome-num { font-family: var(--serif); font-size: 24px; }
.lore-outcome-title { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink); margin-bottom: 8px; }
.lore-outcome-desc { font-family: var(--serif); font-size: 14.5px; line-height: 1.6; color: var(--ink-dim); }
.lore-outcome-bar { grid-column: 1 / -1; height: 2px; background: var(--rule); margin-top: 4px; position: relative; overflow: hidden; }
.lore-outcome-fill { height: 100%; background: var(--accent); }

/* type specimens */
.lore-type-specimens { display: flex; flex-direction: column; gap: 28px; margin-top: 36px; }
.lore-type-item { padding: 28px; border: 1px solid var(--rule); background: var(--bg-elev); }
.lore-type-sample { color: var(--ink); margin-bottom: 16px; }
.lore-type-sample--serif { font-family: var(--serif); font-style: italic; font-size: 26px; }
.lore-type-sample--display { font-family: var(--serif); font-size: 34px; letter-spacing: 0.04em; }
.lore-type-sample--mono { font-family: var(--mono); font-size: 16px; letter-spacing: 0.1em; color: var(--accent); }
.lore-type-meta { display: flex; flex-direction: column; gap: 4px; }

/* sigil decode */
.lore-sigil-decode { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; margin-top: 24px; }
.lore-sigil-decode-visual { display: flex; justify-content: center; position: sticky; top: 100px; }
.lore-sigil-decode-text { display: flex; flex-direction: column; gap: 4px; }
.lore-decode-item { padding: 16px 0; border-bottom: 1px solid var(--rule-soft); opacity: 0; transform: translateX(16px); transition: opacity .6s ease, transform .6s ease; }
.lore-decode-item--visible { opacity: 1; transform: translateX(0); }
.lore-decode-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.lore-decode-desc { font-family: var(--serif); font-size: 15px; line-height: 1.55; color: var(--ink-dim); }
@media (max-width: 820px) { .lore-sigil-decode { grid-template-columns: 1fr; gap: 28px; } .lore-sigil-decode-visual { position: static; } }

/* not grid */
.lore-not-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px; }
.lore-not-card { padding: 26px; border: 1px solid var(--rule); background: var(--bg-elev); opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease, border-color .25s ease; }
.lore-not-card--visible { opacity: 1; transform: translateY(0); }
.lore-not-card:hover { border-color: var(--warn-deep); }
.lore-not-label { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); margin-bottom: 10px; }
.lore-not-desc { font-family: var(--serif); font-size: 14.5px; line-height: 1.6; color: var(--ink-dim); }
@media (max-width: 640px) { .lore-not-grid { grid-template-columns: 1fr; } }

/* closing */
.lore-closing { text-align: center; padding: 96px 24px 120px; display: flex; flex-direction: column; align-items: center; gap: 24px; max-width: var(--lore-max); margin: 0 auto; }
.lore-closing-rule { width: 100px; height: 1px; background: var(--rule); }
.lore-closing-text { display: flex; flex-direction: column; gap: 6px; }
.lore-closing-motto { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.6vw, 28px); color: var(--ink); }
.lore-closing-notice { margin-top: 8px; }
.lore-cta { margin-top: 24px; background: transparent; border: 1px solid var(--accent); color: var(--accent); padding: 16px 32px; cursor: pointer; transition: background .2s ease, color .2s ease; }
.lore-cta:hover { background: var(--accent); color: var(--bg); }
.lore-cta .lore-mono { font-size: 11px; }

/* ── Codex: layout wrappers + sigil ring animation (polish) ── */
.lore-section-body { width: 100%; }
.lore-col-text { min-width: 0; }
.lore-principle-body, .lore-instrument-body, .lore-outcome-body { min-width: 0; }
.lore-closing-sigil { display: flex; justify-content: center; }
.lore-compiler-node--input  { color: var(--ink-dim); }
.lore-compiler-node--output { color: var(--ink-dim); }
.lore-ring-1, .lore-ring-2, .lore-ring-3, .lore-ring-4 { transform-origin: center; transform-box: fill-box; }
.lore-sigil-wrap--visible .lore-ring-2 { animation: loreSpinR 60s linear infinite; }
.lore-sigil-wrap--visible .lore-ring-4 { animation: loreSpin 45s linear infinite; }
@keyframes loreSpinR { to { transform: rotate(-360deg); } }

/* ═══════════════════════════════════════════════════════════════════
   CODEX — interactive Charter explorer, outcome panels, appendices
   ═══════════════════════════════════════════════════════════════════ */

/* Charter Explorer */
.charter-explorer { margin-top: 28px; opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.charter-explorer--visible { opacity: 1; transform: translateY(0); }
.charter-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 2px; }
.charter-tab {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; background: var(--bg-elev); border: 1px solid var(--rule);
  cursor: pointer; transition: all .2s ease; text-align: center;
}
.charter-tab:hover { border-color: var(--accent-deep); background: var(--bg-sunk); }
.charter-tab--active { border-color: var(--accent); background: var(--bg-sunk); box-shadow: inset 0 -2px 0 var(--accent); }
.charter-tab-glyph { font-size: 20px; color: var(--accent); line-height: 1; }
.charter-tab-num { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; }
.charter-tab-name { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); line-height: 1.3; }
.charter-tab--active .charter-tab-name { color: var(--ink-dim); }

.charter-panel { border: 1px solid var(--accent-deep); background: var(--bg-elev); padding: 32px; animation: charterFade .4s ease; }
@keyframes charterFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.charter-panel-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.charter-panel-glyph { font-size: 44px; color: var(--accent); line-height: 1; flex-shrink: 0; }
.charter-panel-num { margin-bottom: 6px; }
.charter-panel-title { font-family: var(--serif); font-style: italic; font-size: 30px; color: var(--ink); line-height: 1.05; margin-bottom: 8px; }
.charter-panel-short { font-family: var(--serif); font-size: 16px; color: var(--ink-dim); font-style: italic; }
.charter-panel-body { font-family: var(--serif); font-size: 16.5px; line-height: 1.7; color: var(--ink-dim); margin-bottom: 24px; }
.charter-panel-rows { display: flex; flex-direction: column; gap: 14px; }
.charter-row { display: grid; grid-template-columns: 160px 1fr; gap: 18px; padding: 14px 0; border-top: 1px solid var(--rule-soft); }
.charter-row-label { padding-top: 2px; }
.charter-row-text { font-family: var(--serif); font-size: 15px; line-height: 1.6; color: var(--ink-dim); }
@media (max-width: 720px) {
  .charter-tabs { grid-template-columns: repeat(3, 1fr); }
  .charter-row { grid-template-columns: 1fr; gap: 6px; }
  .charter-panel { padding: 22px; }
}

/* Outcome panels (accordion) */
.outcomes-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 28px; }
.outcome-panel { border: 1px solid var(--rule); background: var(--bg-elev); transition: border-color .2s ease; }
.outcome-panel--open { border-color: var(--accent-deep); }
.outcome-panel-head {
  width: 100%; display: grid; grid-template-columns: 40px 1fr auto 28px; gap: 18px; align-items: center;
  padding: 20px 24px; background: transparent; border: none; cursor: pointer; text-align: left;
}
.outcome-panel-numeral { font-size: 18px; }
.outcome-panel-title { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink); line-height: 1.3; }
.outcome-panel-prob { display: flex; align-items: center; gap: 10px; }
.outcome-panel-prob-val { font-family: var(--mono); font-size: 12px; color: var(--accent); min-width: 34px; text-align: right; }
.outcome-panel-prob-bar { width: 80px; height: 2px; background: var(--rule); position: relative; overflow: hidden; }
.outcome-panel-prob-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); }
.outcome-panel-chevron { font-family: var(--mono); font-size: 20px; color: var(--accent); text-align: center; }
.outcome-panel-bodywrap { overflow: hidden; transition: max-height .4s ease; }
.outcome-panel-body { padding: 0 24px 26px 82px; }
.outcome-panel-summary { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink); line-height: 1.6; margin-bottom: 14px; }
.outcome-panel-detail { font-family: var(--serif); font-size: 15px; color: var(--ink-dim); line-height: 1.7; margin-bottom: 20px; }
.outcome-panel-signals { border-top: 1px solid var(--rule-soft); padding-top: 16px; }
.outcome-signal { display: flex; gap: 10px; align-items: baseline; font-family: var(--serif); font-size: 14.5px; color: var(--ink-dim); line-height: 1.5; margin-bottom: 8px; }
.outcome-signal-mark { color: var(--accent); flex-shrink: 0; }
@media (max-width: 720px) {
  .outcome-panel-head { grid-template-columns: 30px 1fr 28px; gap: 12px; }
  .outcome-panel-prob { display: none; }
  .outcome-panel-body { padding: 0 22px 24px 22px; }
}

/* Appendices */
.appendix-list { display: flex; flex-direction: column; gap: 8px; margin-top: 36px; }
.appendix-entry { border: 1px solid var(--rule); background: var(--bg-elev); opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease, border-color .2s ease; }
.appendix-entry--visible { opacity: 1; transform: translateY(0); }
.appendix-entry:hover { border-color: var(--accent-deep); }
.appendix-head { width: 100%; display: grid; grid-template-columns: 80px 1fr 28px; gap: 18px; align-items: center; padding: 20px 24px; background: transparent; border: none; cursor: pointer; text-align: left; }
.appendix-code { letter-spacing: 0.12em; }
.appendix-title { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); }
.appendix-chevron { font-family: var(--mono); font-size: 20px; color: var(--accent); text-align: center; }
.appendix-bodywrap { overflow: hidden; transition: max-height .45s ease; }
.appendix-body { padding: 4px 24px 28px 24px; }
.appendix-para { font-family: var(--serif); font-size: 15.5px; line-height: 1.7; color: var(--ink-dim); margin-bottom: 14px; }
.appendix-para strong { color: var(--ink); font-weight: 600; }
.appendix-quote { font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.65; color: var(--ink); margin: 0 0 16px; padding: 16px 22px; border-left: 2px solid var(--accent); background: var(--bg-sunk); }
.appendix-scale { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.appendix-scale-row { display: grid; grid-template-columns: 110px 130px 1fr; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.appendix-scale-band { font-size: 11px; letter-spacing: 0.06em; }
.appendix-scale-name { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink); }
.appendix-scale-note { font-family: var(--serif); font-size: 14px; color: var(--ink-dim); line-height: 1.5; }
.appendix-margin { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.appendix-margin-line { font-family: var(--serif); font-style: italic; font-size: 15.5px; line-height: 1.6; color: var(--ink-dim); padding-left: 18px; border-left: 1px solid var(--rule); }
@media (max-width: 720px) {
  .appendix-head { grid-template-columns: 60px 1fr 24px; gap: 12px; }
  .appendix-scale-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ═══════════════════════════════════════════════════════════════════
   EXAMINATION — expanded findings + verdict detail
   ═══════════════════════════════════════════════════════════════════ */

/* Mechanics counter-move */
.mech-counter { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule-soft); font-family: var(--serif); font-size: 13.5px; line-height: 1.5; color: var(--ink-dim); }
.mech-counter-label { display: inline-block; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal); margin-right: 8px; }

/* Rhetorical devices */
.devices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.device { border: 1px solid var(--rule); background: var(--bg-elev); padding: 18px 20px; }
.device-name { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.device-instance { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink); line-height: 1.4; margin: 0 0 12px; padding-left: 14px; border-left: 2px solid var(--accent-deep); }
.device-function { font-family: var(--serif); font-size: 14px; line-height: 1.55; color: var(--ink-dim); }

/* Strategic omissions */
.omissions { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.omission { display: flex; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
.omission-mark { font-family: var(--mono); font-size: 22px; color: var(--warn); flex-shrink: 0; line-height: 1; }
.omission-item { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink); margin-bottom: 4px; }
.omission-sig { font-family: var(--serif); font-size: 14.5px; line-height: 1.55; color: var(--ink-dim); }

/* Verdict — severity badge */
.severity-badge { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 8px; border: 1px solid currentColor; }

/* Verdict — per-principle evidence */
.principle-evidence { margin: 10px 0; font-family: var(--serif); font-size: 14px; line-height: 1.55; color: var(--ink-dim); font-style: italic; padding: 10px 14px; background: var(--bg-sunk); border-left: 2px solid var(--accent-deep); }
.principle-evidence-label { display: block; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); font-style: normal; margin-bottom: 5px; }

/* Verdict — key tension */
.verdict-tension { margin-top: 48px; padding: 28px 32px; border: 1px solid var(--accent-deep); background: var(--bg-elev); }

/* Verdict — redeployment worked example */
.redeploy-example { margin-top: 16px; padding: 14px 18px; background: var(--bg-sunk); border-left: 2px solid var(--signal); }
.redeploy-example-label { display: block; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal); margin-bottom: 6px; }
.redeploy-example p { font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.6; color: var(--ink); margin: 0; }

/* Verdict — precedent + confidence footer */
.verdict-footer-meta { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.verdict-confidence-val { font-family: var(--serif); font-size: 30px; font-style: italic; line-height: 1; }
@media (max-width: 720px) {
  .verdict-footer-meta { grid-template-columns: 1fr; gap: 28px; }
}

/* ── Verdict: Receiver Briefing (derived, zero-token) ── */
.receiver-briefing { margin: 28px 0 8px; padding: 22px 26px; border: 1px solid var(--rule); background: var(--bg-elev); }
.receiver-briefing-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.receiver-exposure { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 10px; border: 1px solid currentColor; }
.receiver-briefing-text { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.6; color: var(--ink); margin: 0 0 18px; max-width: 72ch; }
.receiver-metrics { display: flex; gap: 36px; flex-wrap: wrap; border-top: 1px solid var(--rule-soft); padding-top: 16px; }
.receiver-metric { display: flex; flex-direction: column; gap: 4px; }
.receiver-metric-val { font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--ink); }
.receiver-metric-label { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
@media (max-width: 640px) { .receiver-metrics { gap: 22px; } .receiver-metric-val { font-size: 20px; } }

/* ── Findings: Instrument Readout (derived, zero-token) ── */
.readout {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
  margin-bottom: 40px;
}
.readout-cell { background: var(--bg-elev); padding: 18px 20px; display: flex; flex-direction: column; gap: 5px; }
.readout-val { font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--ink); }
.readout-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.readout-sub { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-dim); }

/* ── Findings: affective induction summary line ── */
.states-readout {
  display: flex; flex-wrap: wrap; gap: 24px; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* ── Account screen — tabs, stats, history, data controls ── */
.account-tabs { display: flex; gap: 4px; width: 100%; border-bottom: 1px solid var(--rule); }
.account-tab { flex: 1; background: transparent; border: none; padding: 10px 4px; cursor: pointer;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.account-tab:hover { color: var(--ink-dim); }
.account-tab--active { color: var(--accent); border-bottom-color: var(--accent); }

.account-msg { width: 100%; padding: 10px 14px; border: 1px solid var(--rule); background: var(--bg-sunk);
  font-family: var(--serif); font-size: 13.5px; font-style: italic; color: var(--ink-dim); }

.account-credit-card { width: 100%; padding: 16px 20px; border: 1px solid var(--rule);
  background: rgba(107,138,122,0.05); display: flex; flex-direction: column; gap: 8px; }

.account-stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.account-stat { background: var(--bg-elev); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.account-stat-val { font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--ink); }
.account-stat-label { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }

.account-history { width: 100%; display: flex; flex-direction: column; gap: 1px; background: var(--rule); border: 1px solid var(--rule); max-height: 280px; overflow-y: auto; }
.account-purchase { background: var(--bg-elev); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-purchase-pack { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink); }
.account-purchase-meta { font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }
.account-purchase-amt { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.account-empty { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-faint); padding: 24px; text-align: center; width: 100%; }

.account-data { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.account-data-note { font-family: var(--serif); font-size: 14px; line-height: 1.6; color: var(--ink-dim); margin: 0; }
.account-data-btn { width: 100%; text-align: center; border: 1px solid var(--rule); padding: 12px; }
.account-data-btn--danger { color: var(--warn); border-color: var(--warn-deep); }
.account-data-btn--danger:hover { background: rgba(176,74,58,0.08); }
.account-delete-confirm { border: 1px solid var(--warn-deep); background: rgba(176,74,58,0.05); padding: 16px; }
.account-delete-confirm p { font-family: var(--serif); font-size: 13.5px; line-height: 1.55; color: var(--ink-dim); margin: 0; }
.account-delete-confirm strong { color: var(--warn); }

/* ── Archive search ── */
.archive-search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--rule);
  background: var(--bg-elev); padding: 10px 14px; margin-bottom: 16px; }
.archive-search:focus-within { border-color: var(--accent-deep); }
.archive-search-icon { font-family: var(--mono); font-size: 16px; color: var(--ink-faint); }
.archive-search-input { flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--serif); font-size: 16px; color: var(--ink); }
.archive-search-input::placeholder { color: var(--ink-faint); font-style: italic; }
.archive-search-clear { background: none; border: none; color: var(--ink-faint); cursor: pointer;
  font-family: var(--mono); font-size: 12px; padding: 2px 6px; }
.archive-search-clear:hover { color: var(--warn); }

/* ── Archive compare mode ── */
.cmp-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--accent-deep);
  background: var(--bg-elev); margin-bottom: 18px; }
.cmp-bar-text { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-dim); }
.archive-card--selectable { position: relative; }
.archive-card--selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.archive-card-checkbox { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px;
  border: 1px solid var(--accent); border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-family: var(--mono); font-size: 11px; color: var(--bg);
  background: var(--accent); z-index: 2; }
.archive-card--selectable .archive-card-checkbox:empty { background: transparent; color: transparent; }

/* ── The Ledger — compare viewer ── */
.cmp-row { display: grid; grid-template-columns: 1fr 1.4fr 1fr; align-items: center;
  gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.cmp-block { border: 1px solid var(--rule); background: var(--bg-elev); padding: 8px 20px; }
.cmp-cell { font-family: var(--serif); font-size: 22px; text-align: center; color: var(--ink); }
.cmp-key { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); text-align: center; }
.cmp-row--titles { border: none; align-items: stretch; margin-bottom: 20px; }
.cmp-title-cell { text-align: center; padding: 18px; border: 1px solid var(--rule); background: var(--bg-elev); }
.cmp-title-cell h3 { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink); margin: 8px 0 6px; line-height: 1.2; }
.cmp-title-cell .cmp-sub { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.cmp-grade { font-family: var(--serif); font-size: 40px; line-height: 1; }
.cmp-vs { display: flex; align-items: center; justify-content: center; font-family: var(--serif);
  font-style: italic; font-size: 20px; color: var(--ink-faint); }
.cmp-synopsis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.cmp-synopsis { padding: 18px; border: 1px solid var(--rule); background: var(--bg-elev); }
.cmp-synopsis p { font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.6; color: var(--ink-dim); margin: 0; }
@media (max-width: 680px) {
  .cmp-synopsis-grid { grid-template-columns: 1fr; }
  .cmp-cell { font-size: 17px; }
  .cmp-grade { font-size: 30px; }
}

/* ── Re-examine (Intake banner + Findings delta) ── */
.reexam-banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px;
  border: 1px solid var(--accent-deep); background: var(--bg-elev); margin-bottom: 20px; }
.reexam-banner-mark { font-family: var(--mono); font-size: 22px; color: var(--accent); line-height: 1; }
.reexam-banner-title { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.reexam-banner-sub { font-family: var(--serif); font-size: 14px; font-style: italic; color: var(--ink-dim); line-height: 1.55; }

.reexam-delta { display: flex; gap: 14px; align-items: center; padding: 16px 20px;
  border: 1px solid var(--rule); background: var(--bg-elev); margin-bottom: 24px; }
.reexam-delta-mark { font-family: var(--mono); font-size: 26px; line-height: 1; }
.reexam-delta-title { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.reexam-delta-nums { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 24px; color: var(--ink); }
.reexam-delta-arrow { color: var(--ink-faint); }
.reexam-delta-chip { font-family: var(--mono); font-size: 11px; padding: 3px 8px; border: 1px solid currentColor; }
.reexam-delta-grade { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-faint); margin-left: 6px; }

/* ── Batch examination ── */
.batch-toggle-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.batch-toggle-hint { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-dim); }
.batch-progress { margin: 8px 0 8px; }
.batch-progress-track { height: 3px; background: var(--rule); overflow: hidden; }
.batch-progress-fill { height: 100%; background: var(--accent); transition: width .4s ease; }
.batch-progress-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 8px; }

/* ── Batch fields (separate specimen inputs) ── */
.batch-fields { display: flex; flex-direction: column; gap: 14px; }
.batch-field { border: 1px solid var(--rule); background: var(--bg-elev); padding: 12px 14px; }
.batch-field-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.batch-field-num { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.batch-field-meta { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.batch-field-remove { margin-left: auto; background: none; border: none; color: var(--ink-faint); cursor: pointer; font-family: var(--mono); font-size: 12px; padding: 2px 6px; }
.batch-field-remove:hover { color: var(--warn); }
.batch-textarea { min-height: 110px; }
.batch-add-btn { align-self: flex-start; background: transparent; border: 1px dashed var(--rule); color: var(--ink-dim); padding: 10px 16px; cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; transition: border-color .2s, color .2s; }
.batch-add-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Collections (folders) ── */
.archive-collections { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.archive-card-collection { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-top: 6px; }
.archive-card-move { position: absolute; top: 16px; right: 86px; font-family: var(--mono); font-size: 12px; color: var(--ink-faint); background: none; border: none; cursor: pointer; opacity: 0; transition: opacity .15s ease, color .15s ease; padding: 4px 8px; }
.archive-card:hover .archive-card-move { opacity: 1; }
.archive-card-move:hover { color: var(--accent); }

/* ── Examination halo: CSS breathing (replaces 12fps JS re-render) ── */
.exam-sigil-halo--breathe { animation: examHaloBreathe 5s ease-in-out infinite; will-change: transform, opacity; }
@keyframes examHaloBreathe {
  0%, 100% { transform: scale(1);    opacity: 0.18; }
  50%      { transform: scale(1.06); opacity: 0.36; }
}
@media (prefers-reduced-motion: reduce) {
  .exam-sigil-halo--breathe { animation: none; opacity: 0.25; }
}

/* ── Archive: prominent Compare (Ledger) button ── */
.archive-compare-btn {
  margin-left: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 8px 16px; cursor: pointer;
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  transition: background .2s ease, color .2s ease;
}
.archive-compare-btn:hover { background: var(--accent); color: var(--bg); }
.archive-compare-btn.on { background: var(--accent); color: var(--bg); }

/* ── Section label explanations (hover/tap tooltips) ── */
.name--explain { position: relative; cursor: help; display: inline-flex; align-items: center; gap: 6px; }
.name-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border-radius: 50%;
  border: 1px solid var(--ink-faint); color: var(--ink-faint);
  font-family: var(--mono); font-size: 8px; line-height: 1;
  transition: border-color .2s ease, color .2s ease;
}
.name--explain:hover .name-info,
.name--explain:focus .name-info { border-color: var(--accent); color: var(--accent); }
.name-tooltip {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 60;
  width: max-content; max-width: 300px;
  padding: 10px 13px;
  background: var(--bg-sunk); border: 1px solid var(--accent-deep);
  color: var(--ink-dim);
  font-family: var(--serif); font-size: 13.5px; font-style: italic;
  line-height: 1.5; letter-spacing: 0; text-transform: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  pointer-events: none;
}
.name--explain:hover .name-tooltip,
.name--explain:focus .name-tooltip { opacity: 1; visibility: visible; transform: translateY(0); }
@media (max-width: 600px) { .name-tooltip { max-width: 78vw; } }

/* ── Legal screen (Terms / Refund) ── */
.legal-root { max-width: 760px; margin: 0 auto; padding: 56px 32px 96px; animation: screenReveal 0.4s ease; }
.legal-head { border-bottom: 1px solid var(--rule); padding-bottom: 24px; margin-bottom: 32px; }
.legal-title { font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); font-style: italic; font-weight: 400; color: var(--ink); margin-bottom: 18px; }
.legal-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.legal-tab { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 8px 14px; background: transparent; border: 1px solid var(--rule); color: var(--ink-faint); cursor: pointer; transition: all .2s ease; }
.legal-tab:hover { border-color: var(--accent-deep); color: var(--ink-dim); }
.legal-tab.on { border-color: var(--accent); color: var(--accent); }
.legal-meta { font-size: 10px; }
.legal-lead { font-family: var(--serif); font-size: 18px; font-style: italic; line-height: 1.6; color: var(--ink-dim); margin-bottom: 32px; }
.legal-section { margin-bottom: 28px; }
.legal-section-title { font-family: var(--serif); font-size: 20px; color: var(--ink); margin-bottom: 10px; font-weight: 500; }
.legal-section-num { color: var(--accent); font-style: italic; margin-right: 6px; }
.legal-section-body p { font-family: var(--serif); font-size: 15.5px; line-height: 1.7; color: var(--ink-dim); margin-bottom: 12px; }
.legal-section-body em { color: var(--ink); font-style: italic; }
.legal-list { margin: 0 0 12px 22px; }
.legal-list li { font-family: var(--serif); font-size: 15.5px; line-height: 1.6; color: var(--ink-dim); margin-bottom: 6px; }
.legal-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-deep); }
.legal-link:hover { border-bottom-color: var(--accent); }
.legal-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); }

/* footer links */
.specbar-link { color: var(--ink-faint); text-decoration: none; transition: color .2s ease; }
.specbar-link:hover { color: var(--accent); }

/* ── Tier / Designation labels ── */
.upgrade-plan-tier { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.upgrade-plan-blurb { font-family: var(--serif); font-size: 12.5px; font-style: italic; line-height: 1.5; color: var(--ink-faint); margin: 8px 0 4px; }
.account-tier-badge { display: inline-block; align-self: flex-start; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-deep); padding: 4px 10px; margin-bottom: 4px; }
