/* AskHansard — the printed Hansard volume as a reference: ink on laid paper,
   a claret drawn from the Chamber's benches, and a slate used only for things
   the machine derived rather than the record stated. */

:root {
  --ground: #f7f5f2;
  --surface: #ffffff;
  --sunk: #f0ece6;
  --ink: #1c1a18;
  --muted: #6b655e;
  --faint: #948d84;
  --rule: #e2ddd6;
  --rule-strong: #cfc7bc;
  --accent: #8e2a2a;
  --accent-soft: #f3e4e2;
  --slate: #2e5266;
  --slate-soft: #e3ebf0;
  --warn: #8a6318;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 34rem;
  --page: 52rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #161513;
    --surface: #1f1d1a;
    --sunk: #252320;
    --ink: #ede9e3;
    --muted: #a49c92;
    --faint: #7e766c;
    --rule: #332f2b;
    --rule-strong: #474139;
    --accent: #d4676b;
    --accent-soft: #3a2422;
    --slate: #8fb6cc;
    --slate-soft: #1e2b33;
    --warn: #c79a46;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding-inline: 20px;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main, .mast, .notice, footer { max-width: var(--page); margin-inline: auto; }

a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- masthead ---------- */
.mast { padding-block: 40px 14px; }
.wordmark {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
}
.wordmark em { font-style: italic; color: var(--accent); }
.tagline { margin: 6px 0 0; color: var(--muted); max-width: var(--measure); }

.notice {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 11px 15px;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 26px;
}
.notice p { margin: 0; max-width: var(--measure); }
.notice p + p { margin-top: 5px; }
.notice strong { color: var(--ink); }

/* ---------- panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 22px;
  margin-bottom: 22px;
}
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: 1.6rem; margin: 0 0 14px; }
h2 { font-size: 1.25rem; margin: 0 0 10px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 10px 0 0; }
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--sunk);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05em 0.3em;
}

/* ---------- forms ---------- */
textarea, input[type="search"], input[type="text"] {
  font: inherit;
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 9px 11px;
  width: 100%;
}
textarea { resize: vertical; }
button {
  font: inherit;
  font-weight: 600;
  color: var(--surface);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 9px 20px;
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: progress; }

.ask-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ask-form button { align-self: flex-start; }
.search-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* flex-basis follows the main axis. In the row form above it is a width; in
   the column form below it would be a HEIGHT, which grew the search box to a
   quarter of the screen on the results page. */
.search-form input[type="search"] { flex: 1 1 16rem; min-width: 12rem; }
.search-form-full { flex-direction: column; align-items: stretch; }
.search-form-full input[type="search"] { flex: 0 0 auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input { flex: 1 1 9rem; }

.progress {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
}
.unavailable, .empty, .error, .no-citations, .withheld {
  font-size: 0.9rem;
  color: var(--muted);
}
.error { color: var(--warn); }

/* ---------- answer ---------- */
.asked { font-size: 1.35rem; color: var(--muted); font-style: italic; }
.answer { margin-block: 18px; }
.answer-body p { max-width: var(--measure); }
.refusal {
  border-left: 3px solid var(--rule-strong);
  padding-left: 14px;
  color: var(--muted);
  max-width: var(--measure);
}
.sources-heading { margin-top: 26px; border-top: 1px solid var(--rule); padding-top: 16px; }
.sources-note {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  font-weight: 400;
}
.sources { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.source { border: 1px solid var(--rule); border-left: 3px solid var(--slate); padding: 12px 15px; }
.source blockquote {
  font-family: var(--serif);
  margin: 0 0 8px;
  font-size: 1rem;
  quotes: "\201C" "\201D";
}
.source blockquote::before { content: open-quote; }
.source blockquote::after { content: close-quote; }
.source-meta { margin: 0; font-size: 0.82rem; color: var(--muted); }
.source-links { margin: 6px 0 0; font-size: 0.82rem; display: flex; gap: 14px; flex-wrap: wrap; }
.withheld { color: var(--warn); margin-top: 14px; }

/* ---------- results ---------- */
.results-heading { font-size: 1.05rem; color: var(--muted); }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.result { border-top: 1px solid var(--rule); padding-top: 14px; }
.result:first-child { border-top: 0; padding-top: 0; }
.result-meta {
  margin: 0 0 4px;
  font-size: 0.75rem;
  color: var(--faint);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.result-meta .date { font-variant-numeric: tabular-nums; }
.result-meta .ministry { color: var(--slate); }
.result-meta .kind { font-family: var(--mono); }
.result-title { margin: 0 0 6px; font-size: 1.02rem; }
.result-title a { text-decoration: none; }
.result-title a:hover { text-decoration: underline; }
.snippet { margin: 0; font-size: 0.92rem; color: var(--muted); max-width: var(--measure); }
mark { background: var(--accent-soft); color: var(--ink); padding: 0 1px; }

/* ---------- transcript ---------- */
.debate-title { margin: 4px 0 10px; }
.transcript { margin-top: 20px; display: grid; gap: 16px; }
.turn { border-left: 2px solid var(--rule); padding-left: 14px; }
.turn-target {
  border-left-color: var(--accent);
  border-left-width: 3px;
  padding: 2px 0 2px 13px;
}
.turn-speaker { margin: 0 0 4px; font-weight: 600; font-size: 0.92rem; }
.turn p { max-width: var(--measure); }
.procedural {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--faint);
  max-width: var(--measure);
}

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--rule); padding-block: 18px 40px; margin-top: 8px; }
.coverage, .colophon { font-size: 0.82rem; color: var(--muted); max-width: var(--measure); }
.colophon { color: var(--faint); }

@media (max-width: 560px) {
  .ask-form button, .search-form button { width: 100%; }
}

/* ---------- the working ----------
   The machine showing its working. Slate throughout, because everything here
   is derived rather than stated by the record -- the claret is reserved for
   Hansard's own words. */

.ask-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.trace {
  margin-top: 28px;
  border-top: 2px solid var(--rule-strong);
  padding-top: 18px;
}
.trace-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0;
}
.trace-heading { font-size: 1.05rem; color: var(--slate); font-weight: 600; }
.trace-body { margin-top: 14px; }

/* The working is always in the page. This is the only thing that decides
   whether a reader is looking at it. */
.working-hidden .trace-body,
.working-hidden .hit-score { display: none; }
.working-hidden .trace { margin-top: 20px; padding-top: 12px; }

.working-toggle {
  background: none;
  border: 1px solid var(--rule);
  color: var(--slate);
  font: inherit;
  font-size: 0.8rem;
  padding: 3px 11px;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
}
.working-toggle:hover { border-color: var(--slate); background: var(--slate-soft); }

.trace-step { margin-bottom: 22px; }
.trace-step-label {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.step-n {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--surface);
  background: var(--slate);
  border-radius: 2px;
  padding: 1px 6px;
  font-weight: 500;
}
.trace-why {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: var(--measure);
  margin: 6px 0;
}
.trace-note {
  font-size: 0.85rem;
  color: var(--slate);
  font-style: italic;
  margin: 4px 0;
}
.trace-filters { margin: 8px 0; font-size: 0.8rem; }

/* The step that can be re-run. The trace is otherwise a record of something
   already done; this is the one part a reader can take away and use. */
.trace-run {
  margin: 10px 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.run-search {
  border: 1px solid var(--slate);
  color: var(--slate);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 4px 11px;
  border-radius: 2px;
  white-space: nowrap;
}
.run-search:hover { background: var(--slate); color: var(--surface); }
.trace-run-note { font-size: 0.78rem; color: var(--faint); }
.query-alone { font-size: 0.74rem; color: var(--faint); text-decoration: none; }
.query-alone:hover { color: var(--accent); text-decoration: underline; }
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  background: var(--slate-soft);
  color: var(--slate);
  border-radius: 2px;
  padding: 1px 6px;
  margin-right: 5px;
}
.chip-q { background: var(--sunk); color: var(--muted); }

.trace-queries { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 14px; }
.trace-query { border-left: 2px solid var(--rule); padding-left: 13px; }
.query-text { margin: 0; display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.query-index {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--slate);
  font-weight: 500;
}
.query-words { font-weight: 600; font-size: 0.93rem; }
.query-compiled { margin: 3px 0; font-size: 0.78rem; color: var(--faint); }
.query-empty { margin: 3px 0; font-size: 0.8rem; color: var(--warn); }
.query-more { margin: 4px 0 0; font-size: 0.78rem; color: var(--faint); }
.query-hits { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 3px; }
.query-hits li {
  display: grid;
  grid-template-columns: 1.6rem 3.4rem 1fr;
  gap: 8px;
  font-size: 0.82rem;
  align-items: baseline;
}
.query-hits .rank, .query-hits .bm25 {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.query-hits a { color: var(--muted); text-decoration: none; }
.query-hits a:hover { color: var(--accent); text-decoration: underline; }

table.fusion { border-collapse: collapse; width: 100%; font-size: 0.82rem; min-width: 620px; }
table.fusion th, table.fusion td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.fusion thead th {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 500;
  background: var(--sunk);
}
table.fusion .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.fusion tr.dropped { color: var(--faint); }
table.fusion tr.dropped a { color: var(--faint); }
table.fusion tr.kept { background: var(--slate-soft); }
table.fusion .verdict {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
table.fusion tr.kept .verdict { color: var(--slate); font-weight: 500; }
.row-meta { display: block; font-size: 0.74rem; color: var(--faint); margin-top: 1px; }
.hit-score {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--faint);
}

/* ---------- BM25 explainer ----------
   Reference material: folded by default, quiet when open. */

.explainer {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--slate);
  background: var(--ground);
  margin: 14px 0;
  max-width: 44rem;
}
.explainer > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--slate);
  list-style-position: inside;
}
.explainer > summary:hover { background: var(--slate-soft); }
.explainer[open] > summary { border-bottom: 1px solid var(--rule); }
.explainer-body { padding: 4px 16px 14px; }
.explainer-body p {
  font-size: 0.86rem;
  color: var(--muted);
  max-width: var(--measure);
  margin: 10px 0;
}
.explainer-body h4 {
  font-family: var(--sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  margin: 18px 0 2px;
  font-weight: 600;
}
.explainer-body strong { color: var(--ink); }
.rule-of-thumb {
  border-left: 2px solid var(--slate);
  padding: 8px 0 8px 13px;
  background: var(--slate-soft);
  padding-right: 12px;
}
.rule-of-thumb strong { color: var(--slate); }
.explainer-note { font-size: 0.78rem !important; color: var(--faint) !important; }

table.idf { border-collapse: collapse; width: 100%; font-size: 0.82rem; min-width: 26rem; }
table.idf th, table.idf td {
  text-align: left;
  padding: 5px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
table.idf thead th {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  font-weight: 500;
}
table.idf .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.idf .pct { color: var(--faint); }
table.idf .bar { width: 34%; }
table.idf .bar span {
  display: block;
  height: 7px;
  background: var(--slate);
  border-radius: 1px;
  min-width: 2px;
}

/* ---------- navigation between a result and its passage ---------- */


/* The anchored turn must not land flush against the top of the viewport. */

.turn-target {
  animation: settle 1.4s ease-out;
}
/* A brief flash on arrival, then out of the way. The border and the label
   identify the speech from then on. */
@keyframes settle {
  from { background: var(--accent-soft); }
  to { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .turn-target { animation: none; }
}

.you-are-here {
  font-family: var(--mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 500;
  margin-left: 8px;
}


.split-hint { margin: 5px 0 0; font-size: 0.79rem; color: var(--faint); }

/* ---------- result item ---------- */
.result-speaker {
  margin: 0 0 5px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.debate-ministry {
  margin: 0 0 8px;
  font-size: 0.84rem;
  color: var(--slate);
}

/* Section-type codes carry an explanation. */
abbr.kind, .result-meta .ministry {
  text-decoration: none;
  border-bottom: 1px dotted var(--faint);
  cursor: help;
}
abbr.kind { font-family: var(--mono); }

/* A topic heading inside a debate. Nobody said it, so it must not look like
   speech -- it marks where the subject changes. */
.debate-heading {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  margin: 10px 0 2px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-strong);
  max-width: var(--measure);
}

/* ---------- controls that ride along ----------
   A debate can run to hundreds of turns and a result list well past a screen,
   so the controls stay put rather than sitting at a top the reader has left. */

.actionbar, .searchbar-stuck {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ground);
  border-bottom: 1px solid var(--rule-strong);
  /* Cancel the page gutter so the backdrop reaches the edges while stuck,
     then re-apply it inside. */
  margin-inline: -20px;
  padding-inline: 20px;
  /* A soft edge so scrolled content clearly passes *under* the bar. */
  box-shadow: 0 6px 12px -10px rgb(0 0 0 / 45%);
}

.actionbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
  padding-block: 11px;
  margin-bottom: 18px;
  font-size: 0.86rem;
}

/* Leaving the page: claret, left-pointing, first in the reading order. */
.action-back {
  font-weight: 600;
  white-space: nowrap;
}

/* Moving within the page: slate, grouped on the other side, so the two are
   never mistaken for each other. */
.actionbar-page {
  display: flex;
  align-items: baseline;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.actionbar-state {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.action-jump, .action-more {
  color: var(--slate);
  font-weight: 600;
  white-space: nowrap;
}
.action-jump:hover, .action-more:hover { color: var(--accent); }

@media (max-width: 560px) {
  .actionbar { gap: 8px 14px; font-size: 0.8rem; }
  .actionbar-page { width: 100%; justify-content: space-between; }
}

/* ---------- search bar ---------- */
.searchbar { margin-bottom: 20px; }
.searchbar-stuck { padding-block: 10px; }
.searchbar h1 { margin-bottom: 12px; }

.filter-drop { font-size: 0.84rem; }
.filter-drop > summary {
  cursor: pointer;
  color: var(--muted);
  padding: 4px 0;
  list-style-position: inside;
  white-space: nowrap;
}
.filter-drop > summary:hover { color: var(--accent); }
.filter-drop .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}
.filter-drop .filters { padding: 8px 0 2px; }
/* Open drawers get their own row: two of them competing for space beside the
   search box leaves neither usable. */
.filter-drop[open] { flex: 1 0 100%; }

.phrasings { flex-direction: column; align-items: stretch; gap: 6px; }
/* The same trap as the search box above, one layer deeper: this stack is a
   column, so `flex: 1 1 16rem` from .search-form input[type="search"] -- which
   outranks a plain `.phrasings input` -- sets a 16rem HEIGHT on every box. */
.phrasings input[type="search"] { flex: 0 0 auto; min-width: 0; }
.phrasings-note {
  margin: 0 0 2px;
  font-size: 0.8rem;
  color: var(--muted);
  max-width: var(--measure);
}
.phrasing-row { display: flex; gap: 8px; align-items: center; }
.phrasing-row input[type="search"] { flex: 1 1 auto; }
.phrasing-index {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  width: 1.6rem;
}
/* The first phrasing is edited in the box above; here it is shown so it can be
   numbered alongside the others and removed. */
.phrasing-fixed {
  flex: 1 1 auto;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--sunk);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 5px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phrasing-drop {
  flex: 0 0 auto;
  color: var(--faint);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
  padding: 5px 8px;
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.phrasing-drop:hover { color: var(--accent); border-color: var(--accent); }
.phrasing-add {
  align-self: flex-start;
  background: none;
  border: 1px dashed var(--rule-strong);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  padding: 4px 11px;
  border-radius: 2px;
  cursor: pointer;
}
.phrasing-add:hover { border-color: var(--slate); color: var(--slate); }


/* ---------- the passage a search matched ----------
   Slate, like everything else the machine derived rather than the record
   stated -- a chunk boundary is an artefact of indexing, not of Hansard. The
   prose keeps its normal weight: this is a margin note, not emphasis someone
   placed on the words. */

.matched-run {
  margin: 16px 0 16px -13px;
  padding: 10px 16px 2px;
  border-left: 3px solid var(--slate);
  background: var(--slate-soft);
  border-radius: 0 3px 3px 0;
}
.matched-run > p { max-width: var(--measure); }
.matched-run > p:last-child { margin-bottom: 10px; }

.matched-label {
  font-family: var(--mono);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate);
  font-weight: 500;
  margin: 0 0 8px;
  opacity: 0.85;
}

/* ---------- moving between the passages of one speech ---------- */

.split-note {
  background: var(--sunk);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 9px 13px;
  margin: 0 0 12px;
}
.split-text {
  margin: 0 !important;
  font-size: 0.8rem;
  color: var(--muted);
}

.passage-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin: 8px 0 0 !important;
}
.passage-nav-label {
  font-family: var(--mono);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-right: 3px;
}
.passage-pip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--slate);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  text-decoration: none;
}
.passage-pip:hover { border-color: var(--slate); background: var(--slate-soft); }
.passage-pip.is-current {
  color: var(--surface);
  background: var(--slate);
  border-color: var(--slate);
  font-weight: 600;
}
.passage-clear {
  font-size: 0.74rem;
  color: var(--muted);
  margin-left: 6px;
}

/* The marked region is an anchor target of its own, with a way back up. */
.matched-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.matched-back {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--slate);
  font-weight: 600;
  white-space: nowrap;
}

/* An anchor with no box of its own, so #passage resolves without displacing
   anything in the speech. */
.anchor {
  display: block;
  height: 0;
}

/* Jump targets settle around the middle of the viewport rather than against
   the top, so there is visible context above whatever you landed on. Near the
   end of a document the browser simply scrolls as far as it can. */
#focus, #passage {
  scroll-margin-top: 40vh;
}


.matched-who { font-weight: 600; color: var(--ink); text-transform: none;
  letter-spacing: 0; font-family: var(--sans); font-size: 0.82rem; }
.matched-which { color: var(--slate); margin-right: auto; }

/* ---------- matching by meaning ----------
   A different colour from the lexical chips, because it is a different kind of
   evidence: nothing here matched a word. */

.chip-semantic {
  background: var(--slate-soft);
  color: var(--slate);
  border: 1px solid transparent;
}
.semantic-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  flex: 1 1 100%;
}
.semantic-toggle input { accent-color: var(--slate); }

/* ---------- a question that arrived by link ----------
   It is shown rather than answered: three model calls should follow someone's
   decision, not a page load. */

.pending-ask {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--surface);
}
.pending-note {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: var(--measure);
}

/* ---------- the AI notice ----------
   Claret, like the disclaimer in the masthead, because it is a caution about
   the record rather than something the machine derived. Placed under the prose
   and above the sources: read after the answer, before the evidence. */

.ai-notice {
  margin: 18px 0 0;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--ground);
  font-size: 0.85rem;
  color: var(--muted);
  max-width: var(--measure);
}
.ai-notice strong { color: var(--ink); }
.ai-notice-brief { margin-top: 14px; }

/* ---------- an answer that was kept ----------
   Slate: derived from a previous run rather than stated by the record. */

.from-cache {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--slate);
  background: var(--slate-soft);
  border-radius: 2px;
  padding: 5px 10px;
  display: inline-block;
}

/* ---------- the example hint ----------
   Quiet: it explains a shortcut, and should not compete with the button it
   sits beside. */

.example-hint {
  font-size: 0.82rem;
  color: var(--faint);
}

/* ---------- the retention page ---------- */

.lede-note {
  font-size: 1.02rem;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  max-width: var(--measure);
}
.panel h2 { font-size: 1.1rem; margin-top: 26px; }
table.retention { border-collapse: collapse; width: 100%; font-size: 0.86rem; min-width: 30rem; }
table.retention th, table.retention td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.retention thead th {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 500;
  background: var(--sunk);
}
table.retention tbody tr:last-child td { border-bottom: 0; }
.quiet { font-size: 0.85rem; color: var(--muted); }

/* ---------- the daily ceiling ----------
   Warn, not error: nothing is broken, a stated limit has been reached. */

.exhausted {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--warn);
  background: var(--surface);
  padding: 11px 15px;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: var(--measure);
  margin: 0 0 16px;
}
.exhausted strong { color: var(--warn); }
