:root {
  --ink: #1c1a17;
  --paper: #f7f4ee;
  --card: #fffdf9;
  --rule: #d9d2c5;
  --accent: #1f3a8f;        /* shell accent (per-figure theming: Batch C) */
  --accent-soft: #e6ebf7;
  --creative: #3a4a6b;      /* indigo — continuation mode */
  --creative-soft: #e4e8f1;
  --muted: #6b645a;
  --ls: #2f6f4e;            /* parliamentary speech */
  --gov: #8a5a1a;           /* government statement */
  --press: #6b4fa0;         /* press release */
  --letter: #b03a5b;        /* cleared letter */
  --essay: #2a6b8a;         /* cleared essay */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 Georgia, "Iowan Old Style", "Times New Roman", serif;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
/* .site-header is owned by components.css (the shared chrome nav). */

.mode-toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.mode-btn {
  font: inherit; font-size: 15px; background: transparent; border: none; cursor: pointer;
  padding: 8px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: flex-start;
}
.mode-btn + .mode-btn { border-left: 1px solid var(--rule); }
.mode-btn .mode-hint { font-size: 11px; opacity: 0.7; }
.mode-btn.active { background: var(--accent); color: #fff; }
#app[data-mode="continuation"] .mode-btn#mode-continuation.active { background: var(--creative); }

main.wrap { padding-top: 22px; padding-bottom: 60px; }

.creative-banner {
  background: var(--creative-soft); border: 1px solid var(--creative); color: var(--creative);
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px;
}

#ask-form { display: flex; gap: 10px; align-items: stretch; }
#question {
  flex: 1; font: inherit; padding: 12px 14px; border: 1px solid var(--rule);
  border-radius: 8px; background: var(--card); resize: vertical; min-height: 52px;
}
#ask-btn {
  font: inherit; font-size: 16px; padding: 0 22px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; cursor: pointer;
}
#app[data-mode="continuation"] #ask-btn { background: var(--creative); }
#ask-btn:disabled { opacity: 0.5; cursor: default; }

.status { color: var(--muted); font-style: italic; margin: 16px 2px; }

.answer { margin-top: 22px; }
.answer-disclaimer {
  background: var(--creative-soft); border-left: 3px solid var(--creative); color: var(--creative);
  padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; font-size: 14px; font-weight: bold;
}
.answer-body {
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  padding: 18px 20px; font-size: 18px; line-height: 1.7;
}
.answer-body.declined { color: var(--muted); font-style: italic; }
.audio-source-badge {
  font-family: var(--sans); font-size: 13px; line-height: 1.45;
  background: #efe4d3; color: #6b4a1a; border: 1px solid #e0cba8;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 14px;
}
.audio-source-badge a { color: var(--accent); font-weight: 600; white-space: nowrap; }
.cite-marker {
  cursor: pointer; color: var(--accent); font-weight: bold; font-size: 0.7em;
  vertical-align: super; padding: 0 1px; text-decoration: none;
}
.cite-marker:hover { text-decoration: underline; }

.decline-actions { margin-top: 14px; }
.continuation-cta {
  font: inherit; font-size: 15px; padding: 9px 16px; border: 1px solid var(--creative);
  background: var(--creative-soft); color: var(--creative); border-radius: 8px; cursor: pointer;
}

.citation-list { list-style: none; padding: 0; margin: 18px 0 0; }
.citation-list li {
  border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--card); cursor: pointer; font-size: 14px;
}
.citation-list li:hover { border-color: var(--accent); }
.cite-num { font-weight: bold; color: var(--accent); margin-right: 6px; }

.badge {
  display: inline-block; font-size: 11px; font-weight: bold; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 10px; color: #fff; margin-right: 6px;
}
.badge.parliamentary_speech { background: var(--ls); }
.badge.government_statement { background: var(--gov); }
.badge.press_release { background: var(--press); }
.badge.cleared_letter { background: var(--letter); }
.badge.cleared_essay { background: var(--essay); }
.cite-meta { color: var(--muted); }

.citation-panel {
  /* sit BELOW the sticky 75px .site-header (z-index 30) so the close button isn't buried under it */
  position: fixed; top: var(--header-h, 75px); right: 0; width: min(460px, 92vw);
  height: calc(100dvh - var(--header-h, 75px)); overflow-y: auto;
  background: var(--card); border-left: 1px solid var(--rule); box-shadow: -8px 0 30px rgba(0,0,0,0.12);
  padding: 24px 24px 60px; z-index: 20;
}
.panel-close {
  position: absolute; top: 12px; right: 16px; font-size: 28px; line-height: 1; border: none;
  background: none; cursor: pointer; color: var(--muted);
}
.panel-title { font-size: 19px; line-height: 1.3; margin: 4px 44px 4px 0; }
.panel-meta { font-family: var(--sans); font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.04em; margin: 0 0 10px; }
.panel-context {
  border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 14px; font-size: 16px; line-height: 1.7;
}
.panel-row { font-size: 14px; color: var(--muted); margin: 4px 0; }
.panel-row b { color: var(--ink); }
.cleared-basis { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 8px; }

.site-footer { color: var(--muted); font-size: 13px; border-top: 1px solid var(--rule); padding: 18px 20px 40px; }


/* ===== merged from components.css (P1: one render-blocking stylesheet) ===== */
/* Discovery-site chrome + components. Layers on styles.css (palette + base + badges +
   citation-panel). Shared by all pages. */

:root { --container: 1080px; --sans: -apple-system, "Segoe UI", Roboto, sans-serif; }

/* ---- Header / nav ---- */
.site-header { background: var(--card); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 30; }
.header-inner { max-width: var(--container); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; }
.brand-link { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand { font-size: 19px; font-weight: bold; color: var(--ink); letter-spacing: -0.01em; }
.brand-tag { font-size: 11px; color: var(--muted); font-style: italic; }
.site-nav { margin-left: auto; }
.nav-list { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav-link { display: flex; flex-direction: column; padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-family: var(--sans); }
.nav-link:hover { background: var(--accent-soft); color: var(--accent); }
.nav-link.is-active { background: var(--accent); color: #fff; }
.nav-label { font-size: 14px; font-weight: 600; }
.nav-hint { font-size: 10px; opacity: 0.75; }
.nav-drawer { display: none; margin-left: auto; }
.nav-drawer-toggle { cursor: pointer; font-family: var(--sans); font-weight: 600; color: var(--accent); list-style: none; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 8px; }
@media (max-width: 760px) {
  .site-nav { display: none; }
  .nav-drawer { display: block; }
  .nav-drawer .nav-list { flex-direction: column; position: absolute; right: 20px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 8px; box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
}

/* ---- Page scaffold ---- */
.page { max-width: var(--container); margin: 0 auto; padding: 28px 20px 64px; }
.page-hero { margin-bottom: 28px; }
.page-hero .kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; color: var(--accent); font-family: var(--sans); font-weight: 700; }
.page-hero h1 { font-size: 30px; margin: 6px 0 10px; }
.page-hero .summary { color: var(--muted); font-size: 17px; max-width: 70ch; }
.page-hero .intro { color: var(--muted); font-size: 15px; max-width: 70ch; margin-top: 8px; }

/* ---- Cards grid ---- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; cursor: pointer; transition: border-color 0.15s; }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card .card-meta { color: var(--muted); font-size: 13px; font-family: var(--sans); }
.card .pills { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.pill { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 1px 8px; font-family: var(--sans); }

/* ---- Works / sources ---- */
.work-group { margin-bottom: 28px; }
.work-group h2 { font-size: 20px; margin: 0 0 4px; }
.work-group .blurb { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.work-card a { color: var(--accent); text-decoration: none; }
.work-card a:hover { text-decoration: underline; }

/* ---- Timeline ---- */
.year-bars { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.year-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; font-family: var(--sans); }
.year-bar-fill { width: 38px; background: var(--accent-soft); border-radius: 4px 4px 0 0; display: block; transition: background 0.15s; }
.year-bar:hover .year-bar-fill, .year-bar.is-active .year-bar-fill { background: var(--accent); }
.year-bar-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.year-bar-n { font-size: 11px; color: var(--muted); }

/* ---- Topics ---- */
.topic-detail { margin-top: 22px; border-top: 1px solid var(--rule); padding-top: 18px; }
.topic-detail h2 { font-size: 22px; margin: 0 0 12px; }

/* ---- Rebuttals (hard questions) ---- */
.rebuttal-claim { border: 1px solid var(--rule); border-radius: 14px; padding: 22px 24px; margin-bottom: 22px; background: var(--card); }
.claim-banner { text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; font-weight: 700; color: var(--accent); font-family: var(--sans); margin: 0 0 8px; }
.claim-text { font-size: 20px; font-style: italic; color: var(--ink); margin: 0 0 12px; border-left: 3px solid var(--rule); padding-left: 14px; }
.claim-context { color: var(--muted); font-size: 15px; }
.claim-context p { margin: 0 0 8px; }
.claim-evidence-label { font-family: var(--sans); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink); margin: 16px 0 8px; }
.passage-block { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); cursor: pointer; }
.passage-block:hover { border-color: var(--accent); }
.passage-block:focus { outline: 2px solid var(--accent); }
.passage-intro { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.passage-quote { margin: 0; font-size: 16px; line-height: 1.6; }
.passage-quote mark { background: var(--accent-soft); }
.passage-meta { margin-top: 8px; font-family: var(--sans); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }
.passage-cta { color: var(--accent); font-weight: 600; }

/* ---- Citation panel context ---- */
.panel-context .ctx { color: var(--muted); }
.panel-context .ctx-focus { background: var(--accent-soft); padding: 1px 2px; }
.panel-archive { margin-top: 14px; font-family: var(--sans); font-size: 14px; }
.panel-archive a { color: var(--accent); }

.related-row { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; }
.related-row a { font-family: var(--sans); font-size: 14px; color: var(--accent); text-decoration: none; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 14px; }
.related-row a:hover { border-color: var(--accent); }
.status { color: var(--muted); font-style: italic; }

/* ============================================================
   All-browser AI Ask page (localmind playbook §A) — gear,
   two-tier opt-in, loader, answer + citation cards, discover.
   ============================================================ */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.landing-hero { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.landing-hero .page-hero { margin: 0; flex: 1 1 460px; }
.hero-stats-row { display: flex; gap: 22px; }
.hero-stat { display: flex; flex-direction: column; }
.hero-stat-n { font-size: 24px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.hero-stat-l { font-family: var(--sans); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.ask form { display: flex; gap: 10px; align-items: stretch; }
.ask textarea { flex: 1; box-sizing: border-box; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); color: var(--ink); resize: vertical; }
.ask textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#submit-btn { font: inherit; font-weight: 600; padding: 0 22px; border: none; border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer; }
#submit-btn:disabled { opacity: 0.55; cursor: default; }

.site-loader-anchor { min-height: 0; }
.site-loader { margin: 8px 0 0; }
.site-loader--inline { margin: 10px 0 0; }
.site-loader-track { height: 4px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; }
.site-loader-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.site-loader-fill.indeterminate { width: 35% !important; animation: indeterm 1.1s ease-in-out infinite; }
@keyframes indeterm { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.site-loader-label { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-top: 4px; }

.ask-tools { position: relative; margin-top: 12px; }
.ai-gear { display: inline-flex; align-items: center; gap: 7px; background: none; border: 1px solid var(--rule); border-radius: 99px; padding: 5px 12px 5px 9px; font-family: var(--sans); font-size: 13px; color: var(--muted); cursor: pointer; }
.ai-gear svg { width: 16px; height: 16px; }
.ai-gear.is-on { border-color: var(--accent); color: var(--accent); }
/* Opens ABOVE the pill (it sits low on the page; below would overflow) and stays compact. */
.ai-settings { position: absolute; z-index: 30; bottom: calc(100% + 8px); left: 0; width: min(400px, 92vw); background: var(--card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 -6px 30px rgba(0,0,0,0.16); padding: 14px 16px; }
.ai-settings h3 { margin: 0 0 5px; font-size: 15px; }
.ai-settings p { font-family: var(--sans); font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 0 0 10px; }
.ai-tiers { display: grid; gap: 8px; }
.ai-tier { border: 1px solid var(--rule); border-radius: 10px; padding: 9px 11px; }
.ai-tier.is-active { border-color: var(--accent); background: var(--accent-soft); }
.ai-tier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 3px; font-size: 14px; color: var(--ink); }
.ai-tier-head span { font-family: var(--sans); font-size: 11px; color: var(--muted); font-weight: 400; }
.ai-tier-desc { font-family: var(--sans); font-size: 12px; color: var(--muted); margin: 1px 0 7px; }
.ai-tier-cap { font-family: var(--sans); font-size: 12px; color: var(--letter); margin: 8px 0 0; }
.ai-enable { font: inherit; font-family: var(--sans); font-size: 13px; font-weight: 600; padding: 6px 14px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
.ai-tier.is-active .ai-enable { background: none; color: var(--accent); }
.ai-enable:disabled { opacity: 0.5; cursor: default; background: none; color: var(--muted); border-color: var(--rule); }
.ai-cancel { margin-top: 12px; background: none; border: none; font-family: var(--sans); font-size: 13px; color: var(--muted); cursor: pointer; text-decoration: underline; }

.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.examples-label { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-right: 2px; }
.example { font-family: var(--sans); font-size: 13px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 99px; background: var(--card); color: var(--muted); cursor: pointer; text-align: left; }
.example:hover { border-color: var(--accent); color: var(--accent); }

/* Landing CTAs (browse-first hero) */
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn { display: inline-block; font-family: var(--sans); font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--accent); color: var(--accent); background: var(--card); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-soft); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.hero-note { font-family: var(--sans); font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }

/* The `hidden` attribute must win over display-classes (e.g. .loading sets display:flex,
   which would otherwise override the UA [hidden]{display:none} and leave the loading
   banner permanently visible on load). Global reset so every hidden element stays hidden. */
[hidden] { display: none !important; }
.loading { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.answer-section { margin-top: 22px; }
.answer-banner { font-family: var(--sans); font-size: 14px; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.answer-banner.decline { background: #f3ece1; color: #6b5836; border: 1px solid #e3d6c0; }
.answer-banner.fallback { background: var(--accent-soft); color: var(--accent); }
.answer-banner .link-btn { background: none; border: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.answer-body.prose { font-size: 19px; line-height: 1.75; color: var(--ink); }
.cite-ref { color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: none; font-size: 0.85em; vertical-align: super; }
.cite-ref:hover { text-decoration: underline; }
.citations-heading { font-size: 14px; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 20px 0 10px; }
.citations-list { display: grid; gap: 10px; }
.citation { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: border-color 0.15s; }
.citation:hover { border-color: var(--accent); }
.citation-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 5px; }
.citation-title { font-size: 15px; color: var(--ink); }
.citation-num { color: var(--accent); font-weight: 700; }
.citation-meta { font-family: var(--sans); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.citation-snippet { font-size: 14.5px; line-height: 1.5; color: var(--muted); }

.discover-panel { margin-top: 34px; }
.discover-title { font-size: 16px; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 12px; }
.discover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.discover-card { display: block; text-decoration: none; }
.discover-card.is-coming { opacity: 0.55; cursor: default; }
.discover-card.is-coming .discover-card-kicker { color: var(--muted); }
.discover-card-kicker { font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin: 0 0 4px; font-weight: 700; }
.discover-card-title { font-size: 18px; color: var(--ink); margin: 0 0 5px; }
.discover-card-desc { font-family: var(--sans); font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0; }

/* =========================================================================
   Provenance-tier renderer (constitution Principle I — anchor-or-abstain).
   Tier ① grounded and Tier ② extrapolation are HARD-separated so a Tier-②
   inference can never be read as a quotation (SC-008).
   ========================================================================= */
.qline { font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.qline strong { color: var(--ink); }

.ask-modes { margin: 10px 0 4px; }
.grounded-toggle { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.grounded-toggle input { accent-color: var(--accent); }

.tier { border-radius: 12px; padding: 16px 18px; margin: 12px 0; border: 1px solid var(--rule); }
.tier-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}

/* Tier ① — grounded, his cited words. Calm green. Quotes/citations allowed here. */
.tier1 { background: #eef7f0; border-color: #cfe6d6; }
.tier1 .tier-tag { background: #2f9e57; color: #fff; }
.tier-body { font-size: 16px; line-height: 1.7; color: var(--ink); }
.tier1 .tier-body.prose { font-size: 18px; }
.tier-cites-heading { font-size: 13px; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 16px 0 8px; }
.tier-cites { display: grid; gap: 10px; }

/* Tier ② — extrapolation. Amber + DASHED border → visibly not the grounded tier.
   The disclaimer + the label make it impossible to mistake for a quotation. */
.tier2 { background: #fdf6e7; border-color: #e6cf90; border-style: dashed; }
.tier2 .tier-tag { background: #c8891a; color: #fff; }
.tier2-disclaimer { font-family: var(--sans); font-size: 12.5px; color: #8a6314; margin: -2px 0 10px; font-style: italic; }
.tier2-disclaimer strong { color: #6f4e0a; font-style: normal; }
/* Never render Tier-② body as a blockquote / quotation. Plain prose only. */
.tier2-body { font-style: normal; }
.tier2-body::before, .tier2-body::after { content: none !important; }
.anchors-note { font-family: var(--sans); font-size: 12px; color: var(--muted); margin: 10px 0 6px; }

/* Abstain / no-basis — neutral, quiet. */
.tier-abstain { background: #f3ece1; border-color: #e3d6c0; }
.tier-abstain .tier-tag { background: #8b7d63; color: #fff; }
.tier-abstain .tier-body { color: #6b5836; font-family: var(--sans); font-size: 14.5px; }

/* Router hint card (no-model path). */
.tier-note { background: var(--accent-soft); border-color: transparent; }
.tier-note .tier-body { font-family: var(--sans); font-size: 13.5px; color: var(--accent); }

/* =========================================================================
   Voice badge (L1), header "How it works" button, help modal + splash (H2)
   ========================================================================= */
.voice-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 10px; letter-spacing: 0.02em;
  font-weight: 700; text-transform: none; vertical-align: middle; }
.discover-card.is-coming .voice-badge { background: var(--rule); color: var(--muted); }

/* "How it works" nav item is a <button> — match the nav-link look exactly. */
.nav-link-btn { background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }

/* Modal + splash overlay */
body.potw-modal-open { overflow: hidden; }
.potw-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(28, 26, 23, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.potw-modal { position: relative; background: var(--card); color: var(--ink); border: 1px solid var(--rule);
  border-radius: 16px; max-width: 540px; width: 100%; max-height: 88vh; overflow-y: auto;
  padding: 30px 30px 26px; box-shadow: 0 24px 60px rgba(28, 26, 23, 0.28); }
.potw-modal-close { position: absolute; top: 12px; right: 14px; background: none; border: 0;
  font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.potw-modal-close:hover { background: var(--accent-soft); color: var(--ink); }
.potw-modal-title { font-size: 24px; margin: 0 0 12px; }
.help-kicker { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
.help-lede { font-size: 15.5px; line-height: 1.55; color: var(--ink); margin: 0 0 16px; }
.help-tiers { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.help-tiers li { font-family: var(--sans); font-size: 13.5px; line-height: 1.5; color: var(--ink);
  padding-left: 22px; position: relative; }
.help-dot { position: absolute; left: 0; top: 5px; width: 11px; height: 11px; border-radius: 3px; }
.help-dot-grounded { background: #2f9e57; }
.help-dot-infer { background: #c8891a; }
.help-note { font-family: var(--sans); font-size: 13px; line-height: 1.5; color: var(--muted);
  background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 0 0 4px; }
.potw-modal-actions { display: flex; gap: 10px; margin-top: 18px; }
@media (max-width: 480px) { .potw-modal { padding: 24px 20px 20px; } .potw-modal-title { font-size: 21px; } }

/* Voice switcher on the Ask page (M1) */
.voice-switcher { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-family: var(--sans); }
.voice-switcher label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.voice-switcher select { font-family: var(--sans); font-size: 14px; color: var(--ink); background: var(--card);
  border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.voice-switcher select:hover { border-color: var(--accent); }

/* One-time model-download note (H1) */
.ask-note { font-family: var(--sans); font-size: 13px; line-height: 1.5; color: var(--muted);
  background: var(--accent-soft); border-radius: 10px; padding: 10px 13px; margin: 12px 0 0; max-width: 680px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); font-weight: 600;
  cursor: pointer; text-decoration: underline; }

/* One-time two-tier legend above the first answer (M2) */
.tier-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 14px;
  padding: 10px 13px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.tier-legend-key { display: inline-flex; align-items: center; gap: 7px; position: relative; padding-left: 18px; }
.tier-legend-key .help-dot { position: absolute; left: 0; top: 50%; transform: translateY(-50%); }
.tier-legend-more { margin-left: auto; }

/* =========================================================================
   Across the voices — cross-figure discovery (Batch F)
   ========================================================================= */
.compare-status { font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin: 16px 2px; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px; margin-top: 20px; align-items: start; }
.compare-card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px;
  padding: 16px 18px; }
.compare-card.is-pending { opacity: 0.6; }
.compare-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin-bottom: 10px; }
.compare-card-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.compare-card-dates { font-family: var(--sans); font-size: 11px; color: var(--muted); white-space: nowrap; }
.compare-pending { color: var(--muted); font-size: 20px; letter-spacing: 2px; margin: 4px 0; }
.compare-none { font-family: var(--sans); font-size: 13px; color: var(--muted); font-style: italic; margin: 4px 0; }
.compare-passage { margin: 0 0 12px; }
.compare-passage:last-child { margin-bottom: 0; }
.compare-passage blockquote { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink); }
.compare-passage blockquote::before { content: "\201C"; }
.compare-passage blockquote::after { content: "\201D"; }
.compare-passage figcaption { font-family: var(--sans); font-size: 11.5px; color: var(--muted);
  margin-top: 6px; }
.compare-score { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* ---- History (local explorations) ---- */
.history-empty { font-family: var(--sans); font-size: 15px; color: var(--muted); line-height: 1.6;
  margin-top: 20px; }
.history-list { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column;
  gap: 10px; }
.history-item { display: flex; align-items: flex-start; gap: 12px; background: var(--card);
  border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; }
.history-item-main { flex: 1; min-width: 0; }
.history-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-family: var(--sans); font-size: 11.5px; color: var(--muted); }
.history-badge { font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 10.5px;
  color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; }
.history-badge-compare { color: var(--creative); background: var(--creative-soft); }
.history-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-time { white-space: nowrap; }
.history-query { display: block; font-size: 16px; font-weight: 600; color: var(--ink);
  text-decoration: none; line-height: 1.4; }
.history-query:hover { color: var(--accent); text-decoration: underline; }
.history-summary { font-family: var(--sans); font-size: 13px; color: var(--muted); line-height: 1.5;
  margin: 5px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; }
.history-del { flex: none; font-family: var(--sans); font-size: 12px; color: var(--muted);
  background: none; border: 1px solid var(--rule); border-radius: 8px; padding: 4px 10px;
  cursor: pointer; }
.history-del:hover { color: var(--letter); border-color: var(--letter); }

/* =========================================================================
   On-site reader (#3) — the works library
   ========================================================================= */
.reader { display: grid; grid-template-columns: 260px 1fr; gap: 24px; margin-top: 8px; align-items: start; }
.reader-toc { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 4px; }
.reader-toc-item { display: block; text-decoration: none; padding: 9px 12px; border-radius: 9px;
  border: 1px solid transparent; color: var(--ink); }
.reader-toc-item:hover { background: var(--accent-soft); }
.reader-toc-item.is-active { background: var(--card); border-color: var(--rule); }
.reader-toc-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.reader-toc-date { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); margin-top: 2px; }
.reader-pane { min-width: 0; background: var(--card); border: 1px solid var(--rule); border-radius: 12px;
  padding: 26px 30px 40px; }
.reader-work-title { font-size: 26px; line-height: 1.2; margin: 0 0 4px; }
.reader-work-date { font-family: var(--sans); font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.04em; margin: 0 0 14px; }
.reader-source { font-family: var(--sans); font-size: 13.5px; margin: 0 0 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--rule); }
.reader-source a { color: var(--accent); }
.reader-text { font-size: 18px; line-height: 1.75; }
.reader-para { margin: 0 0 15px; scroll-margin-top: 90px; }
.reader-focus { background: var(--accent-soft); border-radius: 6px; box-shadow: 0 0 0 8px var(--accent-soft); }
@media (max-width: 720px) {
  .reader { grid-template-columns: 1fr; }
  .reader-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .reader-toc-item { flex: 0 0 auto; }
  .reader-toc-date { display: none; }
}

/* Reader link on the Ask page + tighter stacking of the two citation links */
.read-works-link { font-family: var(--sans); font-size: 13px; color: var(--accent); text-decoration: none;
  margin-left: 4px; white-space: nowrap; }
.read-works-link:hover { text-decoration: underline; }
.panel-archive-ext { margin-top: 6px; }

/* =========================================================================
   Sources — the bibliotheca
   ========================================================================= */
.biblio-figure { margin: 0 0 26px; }
.biblio-figure-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px;
  border-bottom: 2px solid var(--rule); padding-bottom: 6px; margin-bottom: 10px; }
.biblio-figure-head h2 { font-size: 21px; margin: 0; }
.biblio-figure-head h2 a { color: var(--ink); text-decoration: none; }
.biblio-figure-head h2 a:hover { color: var(--accent); }
.biblio-figure-meta { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.biblio-works { list-style: none; margin: 0; padding: 0; }
.biblio-work { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 16px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--rule); }
.biblio-work-title { font-size: 15.5px; }
.biblio-work-meta { font-family: var(--sans); font-size: 12px; color: var(--muted); white-space: nowrap; }
.biblio-work-links { font-family: var(--sans); font-size: 12.5px; white-space: nowrap; }
.biblio-work-links a { color: var(--accent); text-decoration: none; }
.biblio-work-links a:hover { text-decoration: underline; }
@media (max-width: 620px) {
  .biblio-work { grid-template-columns: 1fr; gap: 2px; }
  .biblio-work-meta, .biblio-work-links { justify-self: start; }
}
