/* MIDAS Curator styles.
   Colors come only from the --rv-* tokens (docs/reviewer/reviewer-colors.css).
   Rules: hue describes the pipeline's evidence (blue found, amber partial,
   vermillion not found); human decisions use neutral ink and shape; every
   status pairs color with an icon and a word. CSP forbids inline styles, so
   everything visual lives here. */

:root, [data-theme="light"] {
  color-scheme: light;
  --rv-bg: #F5F6F8; --rv-surface: #FCFCFD; --rv-surface-muted: #EDEFF2; --rv-border: #D3D8DF;
  --rv-text: #1E2329; --rv-text-muted: #586170; --rv-ink: #1E2329; --rv-on-ink: #FCFCFD;
  --rv-found-fg: #0B66A8; --rv-found-bg: #D6E7F7;
  --rv-partial-fg: #8F5C00; --rv-partial-bg: #FBEFD3;
  --rv-notfound-fill: #B34700; --rv-on-notfound: #FFFFFF;
  --rv-neutral-fg: #4A5260; --rv-neutral-border: #7E8794;
  --rv-hl-current-bg: #FFE680; --rv-hl-current-text: #1E2329; --rv-hl-current-line: #1E2329;
  --rv-hl-other-line: #7E8794; --rv-hl-model-bg: #D6E7F7; --rv-hl-model-line: #0B66A8; --rv-hl-select-line: #1E2329;
  --rv-banner-bg: #FBEFD3; --rv-banner-fg: #5C3B00;
  /* Source spacing: label to value, between fields, between sections. */
  --rv-space-tight: .15em; --rv-space-field: .55em; --rv-space-section: 1.4em;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --rv-bg: #14171C; --rv-surface: #1B1F26; --rv-surface-muted: #232831; --rv-border: #343A45;
    --rv-text: #E4E7EC; --rv-text-muted: #A1A9B5; --rv-ink: #E4E7EC; --rv-on-ink: #14171C;
    --rv-found-fg: #72B6EC; --rv-found-bg: #1A3550;
    --rv-partial-fg: #E6B04E; --rv-partial-bg: #392C12;
    --rv-notfound-fill: #F0884A; --rv-on-notfound: #14171C;
    --rv-neutral-fg: #B4BBC6; --rv-neutral-border: #6B7483;
    --rv-hl-current-bg: #5A4C0C; --rv-hl-current-text: #FFF5CC; --rv-hl-current-line: #FFF5CC;
    --rv-hl-other-line: #7D8696; --rv-hl-model-bg: #1A3550; --rv-hl-model-line: #72B6EC; --rv-hl-select-line: #E4E7EC;
    --rv-banner-bg: #392C12; --rv-banner-fg: #F5DDA8;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --rv-bg: #14171C; --rv-surface: #1B1F26; --rv-surface-muted: #232831; --rv-border: #343A45;
  --rv-text: #E4E7EC; --rv-text-muted: #A1A9B5; --rv-ink: #E4E7EC; --rv-on-ink: #14171C;
  --rv-found-fg: #72B6EC; --rv-found-bg: #1A3550;
  --rv-partial-fg: #E6B04E; --rv-partial-bg: #392C12;
  --rv-notfound-fill: #F0884A; --rv-on-notfound: #14171C;
  --rv-neutral-fg: #B4BBC6; --rv-neutral-border: #6B7483;
  --rv-hl-current-bg: #5A4C0C; --rv-hl-current-text: #FFF5CC; --rv-hl-current-line: #FFF5CC;
  --rv-hl-other-line: #7D8696; --rv-hl-model-bg: #1A3550; --rv-hl-model-line: #72B6EC; --rv-hl-select-line: #E4E7EC;
  --rv-banner-bg: #392C12; --rv-banner-fg: #F5DDA8;
}

/* ---- Base ------------------------------------------------------------ */
* { box-sizing: border-box; }
html { font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; background: var(--rv-bg); color: var(--rv-text); }
a { color: var(--rv-text); text-underline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.6rem; line-height: 1.25; font-weight: 600; margin-bottom: 8px; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: .9rem; margin: 20px 0 6px; }
small { font-size: .8rem; color: var(--rv-text-muted); }
code { font: .78rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--rv-text-muted); }
kbd { font: .7rem/1 ui-monospace, Menlo, monospace; padding: 2px 5px; margin-left: 4px; border: 1px solid var(--rv-neutral-border); border-radius: 3px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--rv-ink); outline-offset: 2px; scroll-margin: 30px; }
.muted { color: var(--rv-text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

button, input, select, textarea { font: inherit; color: var(--rv-text); }
button, .button {
  min-height: 34px; padding: 6px 12px; border: 1px solid var(--rv-neutral-border); border-radius: 6px;
  background: transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: .9rem;
}
button:hover, .button:hover { background: var(--rv-surface-muted); }
button:disabled { color: var(--rv-text-muted); cursor: default; background: transparent; opacity: .75; }
button.primary, .button.primary, .primary { background: var(--rv-ink); color: var(--rv-on-ink); border-color: var(--rv-ink); }
button.primary:hover, .button.primary:hover { background: var(--rv-ink); opacity: .9; }
button.primary kbd { border-color: currentColor; }
button.ghost { border-color: transparent; }
button.ghost:hover { border-color: var(--rv-border); }
button.small { min-height: 28px; padding: 3px 9px; font-size: .82rem; }
input:not([type=checkbox]), select, textarea {
  width: 100%; padding: 6px 9px; border: 1px solid var(--rv-neutral-border); border-radius: 6px; background: var(--rv-surface);
}
textarea { resize: vertical; }
label { display: block; font-size: .82rem; font-weight: 600; margin: 12px 0 4px; }
label.inline, .toggle-row label, .raw-toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--rv-ink); }

/* ---- App chrome ------------------------------------------------------ */
.topbar {
  min-height: 52px; display: flex; align-items: center; gap: 28px; padding: 8px 24px; flex-wrap: wrap;
  background: var(--rv-surface); border-bottom: 1px solid var(--rv-border);
}
.brand { font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand span { font-weight: 400; color: var(--rv-text-muted); border-left: 1px solid var(--rv-border); padding-left: 12px; margin-left: 10px; }
.topbar nav { display: flex; gap: 20px; flex: 1; }
.topbar nav a { font-size: .88rem; text-decoration: none; color: var(--rv-text-muted); }
.topbar nav a:hover { color: var(--rv-text); text-decoration: underline; }
.topbar > span { font-size: .82rem; color: var(--rv-text-muted); }
.topbar form button, .topbar .theme-toggle { min-height: 28px; padding: 3px 10px; font-size: .82rem; }
main { padding: 24px 28px 60px; max-width: 1600px; margin: auto; }
.banner { padding: 10px 24px; background: var(--rv-banner-bg); color: var(--rv-banner-fg); border-bottom: 1px solid var(--rv-border); }
.skip-link { position: fixed; top: -60px; left: 10px; background: var(--rv-surface); padding: 10px; z-index: 100; }
.skip-link:focus { top: 10px; }
#save-status:not(:empty) {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 20; max-width: 80vw;
  background: var(--rv-ink); color: var(--rv-on-ink); padding: 10px 18px; border-radius: 6px;
}
#save-status button { margin-left: 10px; min-height: 0; padding: 2px 8px; color: inherit; background: transparent; border: 1px solid currentColor; }
#save-status button kbd { margin-left: 6px; color: inherit; border-color: currentColor; background: transparent; }
dialog { max-width: 560px; color: var(--rv-text); background: var(--rv-surface); border: 1px solid var(--rv-border); border-radius: 10px; padding: 24px; }
dialog::backdrop { background: rgb(0 0 0 / .45); }

/* ---- List pages (runs, resources, reports, vocabulary) ------------- */
.eyebrow { font-size: .82rem; color: var(--rv-text-muted); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 12px 0 24px; }
.breadcrumb { font-size: .85rem; color: var(--rv-text-muted); }
.card { background: var(--rv-surface); border: 1px solid var(--rv-border); border-radius: 10px; padding: 20px 22px; }
.run-grid, .vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.run-card { text-decoration: none; display: block; }
.run-card:hover { border-color: var(--rv-neutral-border); }
.run-card h2 { margin: 14px 0 6px; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .78rem;
  border: 1px solid var(--rv-neutral-border); color: var(--rv-neutral-fg);
}
.stat-row { display: flex; gap: 28px; margin: 20px 0; }
.stat-row span { font-size: .85rem; color: var(--rv-text-muted); }
.stat-row strong { display: block; font-size: 1.35rem; color: var(--rv-text); }
.text-link { font-weight: 600; font-size: .88rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rv-border); border-radius: 8px; background: var(--rv-surface); }
table { border-collapse: collapse; width: 100%; text-align: left; }
th { font-size: .8rem; font-weight: 600; color: var(--rv-text-muted); background: var(--rv-surface-muted); }
td, th { padding: 12px 16px; border-bottom: 1px solid var(--rv-border); vertical-align: top; }
td small { display: block; max-width: 650px; overflow-wrap: anywhere; }
.resource-title { font-weight: 600; text-decoration: none; }
.resource-title:hover { text-decoration: underline; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric strong { font-size: 1.8rem; display: block; }
.login { max-width: 520px; margin: 60px auto; }
.login button { margin-top: 18px; }
.vocabulary-card h2 { margin-top: 14px; }
.reconciliation { margin: 0 24px 12px; }
.reconciliation summary, details.card summary { cursor: pointer; font-weight: 600; }

/* ---- Review screen --------------------------------------------------- */
main.review-main { max-width: none; padding: 0; height: calc(100vh - 53px); display: flex; flex-direction: column; }
.review-heading {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 10px 24px; background: var(--rv-surface); border-bottom: 1px solid var(--rv-border);
}
.review-title h1 { font-size: 1.1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 3px; font-size: .82rem; color: var(--rv-text-muted); }
.review-meta a { color: var(--rv-text-muted); }
.review-meta .pipeline-status { white-space: normal; cursor: help; }
.progress-wrap { display: inline-flex; align-items: center; gap: 8px; }
#progress { color: var(--rv-text); font-weight: 600; }
progress { appearance: none; width: 90px; height: 4px; border: 0; border-radius: 2px; background: var(--rv-border); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--rv-border); }
progress::-webkit-progress-value { background: var(--rv-ink); }
progress::-moz-progress-bar { background: var(--rv-ink); }
.review-actions { display: flex; gap: 8px; }

.review-layout {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 370px;
  background: var(--rv-surface);
}
.claim-panel, .decision-panel { overflow: auto; min-height: 0; }
.claim-panel { border-right: 1px solid var(--rv-border); }
.decision-panel { border-left: 1px solid var(--rv-border); padding: 18px 20px 40px; }

/* Claims pane */
.claim-toolbar { position: sticky; top: 0; z-index: 2; display: grid; gap: 8px; padding: 12px; background: var(--rv-surface); border-bottom: 1px solid var(--rv-border); }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.claim-toolbar select, .claim-toolbar input { font-size: .88rem; padding: 5px 8px; }
#filters-toggle { min-height: 0; white-space: nowrap; }
#filters-toggle[aria-expanded=true] { background: var(--rv-surface-muted); border-color: var(--rv-ink); }
.filters-count { font-weight: 600; }
.filter-panel { display: grid; gap: 8px; padding: 8px 10px; border: 1px solid var(--rv-border); border-radius: 6px; background: var(--rv-bg); }
.toggle-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: var(--rv-text-muted); }
.claim-group + .claim-group { margin-top: 10px; }
.claim-group[open] { padding-bottom: 4px; }
.claim-group + .claim-group > summary { border-top: 1px solid var(--rv-border); }
.claim-group > summary {
  cursor: pointer; padding: 12px 12px 4px; margin-top: 0; display: grid; grid-template-columns: auto auto 1fr; column-gap: 8px; align-items: baseline;
  font-size: .86rem; font-weight: 600; list-style-position: inside;
}
.group-count { color: var(--rv-text-muted); font-weight: 400; }
.group-count.group-done { color: var(--rv-found-fg); }
.progress-cell progress { width: 70px; vertical-align: middle; }
.progress-cell .submitted { color: var(--rv-found-fg); font-weight: 600; }
/* Resource list: number columns never wrap; the status column wraps instead of crowding them. */
th.num, td.num { white-space: nowrap; }
.status-cell .badge { max-width: 34ch; white-space: normal; }
.progress-line { display: inline-flex; align-items: center; gap: 8px; }
.group-label { font-size: .9rem; }
.group-path { grid-column: 1 / -1; font-weight: 400; font-size: .74rem; color: var(--rv-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 14px; }
.claim {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; gap: 8px; align-items: center; text-align: left;
  min-height: 0; padding: 4px 12px 4px 11px; margin: 0; border: 0; border-left: 3px solid transparent; border-radius: 0;
  background: transparent; font-size: .9rem;
}
.claim:hover { background: var(--rv-surface-muted); }
/* Selected row: the same blue rule as found evidence in the detail pane. Focus keeps its own ink outline, drawn inside so the panel edge never clips it. */
.claim.decided { background: var(--rv-surface-muted); }
.claim[aria-current=true], .claim.decided[aria-current=true] { border-left-color: var(--rv-found-fg); background: var(--rv-found-bg); }
.claim:focus-visible { outline-offset: -2px; }
.claim-value { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.claim-field { display: block; font-size: .74rem; color: var(--rv-text-muted); }
.claim-state { color: var(--rv-text-muted); text-align: center; }
.claim-state::before { content: "\25CB"; }
.claim.decided .claim-state::before { content: "\2713"; color: var(--rv-text); }
.claim--dropped { outline: 1px dashed var(--rv-neutral-border); outline-offset: -4px; }
#dropped-group { border-top: 1px solid var(--rv-border); margin-top: 10px; padding-bottom: 12px; }
#accept-drops { margin: 4px 12px 8px; }

/* Status chips: icon + word, loudness tracks risk */
.chip {
  display: inline-flex; align-items: center; gap: .35em; padding: 1px 7px; border-radius: 4px; white-space: nowrap;
  font-size: .76rem; line-height: 1.5; border: 1px solid transparent;
}
.chip--found { background: var(--rv-found-bg); color: var(--rv-found-fg); }
.chip--partial { background: var(--rv-partial-bg); color: var(--rv-partial-fg); }
.chip--notfound { background: var(--rv-notfound-fill); color: var(--rv-on-notfound); }
.chip--neutral { background: transparent; color: var(--rv-neutral-fg); border-color: var(--rv-neutral-border); }
.chip--dashed { border-style: dashed; }
/* "Found" is the common case, so it stays quiet: color only on the icon.
   That leaves color and boxes for the claims that need attention. */
.chip--found.chip--quiet { background: transparent; color: var(--rv-text-muted); padding-left: 0; padding-right: 0; }
.chip--found.chip--quiet .chip-icon { color: var(--rv-found-fg); }
/* Claim rows: model-written statuses keep their box (heavier than quiet Found) but take less width. */
.claim .chip--compact { font-size: .7rem; padding: 0 5px; gap: .25em; }

/* Triage summary at the top of the claim list */
.triage { display: grid; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--rv-border); }
.triage-lead { margin: 0; font-size: .9rem; }
.triage-lead-button { min-height: 0; padding: 4px 10px; border-color: var(--rv-ink); font-size: .9rem; }
.triage-lead-button strong { font-size: 1.05rem; }
.triage-chips { display: grid; gap: 6px; }
.triage-row { display: flex; flex-wrap: wrap; gap: 6px; }
/* Reassuring statuses sit on their own row under a hairline, apart from the ones needing attention. */
.triage-row + .triage-row { padding-top: 6px; border-top: 1px dotted var(--rv-border); }
button.triage-item.chip { min-height: 0; cursor: pointer; font-size: .78rem; padding: 2px 8px; }
button.triage-item.chip--quiet { padding: 2px 8px; border: 1px solid var(--rv-border); }
button.triage-item:hover { filter: brightness(1.08); }
button.triage-item[aria-pressed=true] { box-shadow: 0 0 0 2px var(--rv-surface), 0 0 0 4px var(--rv-ink); }

/* Decision callout in the detail pane */
.decision-banner { display: grid; gap: 2px; margin-top: 14px; padding: 9px 12px; border-radius: 6px;
  border: 1px solid var(--rv-border); border-left: 4px solid var(--rv-ink); background: var(--rv-surface-muted); font-size: .86rem; }
.decision-banner strong { font-size: .95rem; }
.decision-banner span { color: var(--rv-text-muted); }
.decision-banner .decision-banner-detail { color: var(--rv-text); }
.decision-banner--conflict { border-left-style: double; border-left-width: 6px; }

/* Source pane */
.source-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.panel-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 24px; flex-shrink: 0;
  border-bottom: 1px solid var(--rv-border); font-size: .85rem;
}
.panel-name { font-weight: 600; }
.highlight-nav { display: flex; align-items: center; gap: 8px; color: var(--rv-text-muted); white-space: nowrap; }
.raw-toggle { margin-left: 10px; font-size: .82rem; }
.notice { margin: 14px 24px 0; padding: 9px 12px; max-width: 72ch; border: 1px solid var(--rv-neutral-border); border-radius: 6px; font-size: .88rem; flex-shrink: 0; }
#source {
  flex: 1; overflow: auto; padding: 16px 24px 48px; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
  background: var(--rv-bg);
  font: 16px/1.6 Charter, "Iowan Old Style", "Source Serif 4", Georgia, serif;
}
/* One card per captured page, at a readable line length. */
.source-page {
  max-width: 76ch; margin: 0 0 18px; background: var(--rv-surface);
  border: 1px solid var(--rv-border); border-radius: 8px; overflow: hidden;
}
.source-body { padding: 14px 22px 20px; }
/* Newline classes come from presentation.display_marks(); the characters are never removed. */
#source .sb, #source .xb { white-space: normal; }        /* wraps and extra blank lines collapse */
#source.raw .sb, #source.raw .xb { white-space: pre-wrap; } /* "Raw line breaks" restores them */
#source .hb::after { content: ""; display: block; height: .5em; }
#source.raw .hb::after { display: none; }
#source .delim { font: .78rem/1.5 system-ui, sans-serif; color: var(--rv-text-muted); }
/* Metadata values: one per row, with field spacing. */
#source .mb { white-space: pre-wrap; }
#source .mb::after { content: ""; display: block; height: var(--rv-space-field); }
/* Section labels are drawn over the scraper's divider lines; the divider text stays
   in the DOM at zero size, so offsets and selections are unchanged. */
#source .section-label, .section-label--static {
  position: sticky; top: 0; z-index: 2; display: block; margin: var(--rv-space-section) -22px var(--rv-space-field);
  padding: 6px 22px; background: var(--rv-surface); border-bottom: 1px solid var(--rv-border);
  font-size: 0; line-height: 0; color: transparent;
}
#source .section-label::before, .section-label--static {
  font: 600 .72rem/1.4 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--rv-text-muted);
}
#source .section-label::before { content: attr(data-label); }
.section-label--static { font-size: .72rem; line-height: 1.4; margin-top: 0; user-select: none; }
.source-body > .source-run:first-child .section-label, .source-body > mark:first-child .section-label,
.source-body > .section-label--static { margin-top: -14px; }
#source.raw .section-label { position: static; display: inline; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--rv-text-muted); }
#source.raw .section-label::before, #source.raw .section-label--static { display: none; }
/* ISO durations keep their raw text, followed by a readable form that is not part of the source. */
#source .duration { font: .86rem/1.5 ui-monospace, Menlo, monospace; color: var(--rv-text-muted); }
#source .duration[data-readable]::after { content: "  " attr(data-readable); font: 600 .9rem/1.5 system-ui, sans-serif; color: var(--rv-text); user-select: none; }
#source.raw .duration { font: inherit; color: inherit; }
#source.raw .duration::after { content: none; }
/* Collapsed copies: still in the DOM (offsets, match counts), shown as a one-line note. */
#source .dup:not(.expanded) { font-size: 0; }
#source .dup[data-note]:not(.expanded)::before {
  content: "\25B8  " attr(data-note) " \00B7  Show"; cursor: pointer;
  font: .8rem/1.5 system-ui, sans-serif; color: var(--rv-text-muted);
}
#source .dup.expanded { background: var(--rv-surface-muted); }
#source .dup[data-note].expanded::before { content: "\25BE  " attr(data-note) " \00B7  Hide\A"; white-space: pre; cursor: pointer; font: .8rem/1.5 system-ui, sans-serif; color: var(--rv-text-muted); }
#source .dup[data-cut]::after { content: "  \27E8" attr(data-cut) "\27E9"; font: italic .78rem/1.5 system-ui, sans-serif; color: var(--rv-partial-fg); user-select: none; }
#source .dup:not(.expanded)[data-cut]::after { content: none; }
#source .dup:focus-visible { outline: 2px solid var(--rv-ink); outline-offset: 2px; }
#source.raw .dup { font-size: inherit; background: none; }
#source.raw .dup::before, #source.raw .dup::after { content: none !important; }
/* Display-only guess at the page's lost headings ("Intended audience"). */
#source .src-heading { display: inline-block; margin-top: .9em; font: 600 .98rem/1.4 system-ui, sans-serif; }
#source.raw .src-heading { display: inline; margin: 0; font: inherit; }
#source.raw .delim { font: inherit; }
.segment-label {
  display: block; white-space: normal; margin: 0; padding: 8px 22px;
  background: var(--rv-surface-muted); border-bottom: 1px solid var(--rv-border);
  font: .78rem/1.5 system-ui, sans-serif; color: var(--rv-text); user-select: none;
}
.segment-label strong { font-weight: 600; margin-right: 8px; }
.segment-url { font-family: ui-monospace, Menlo, monospace; color: var(--rv-text-muted); overflow-wrap: anywhere; }

/* Highlights: told apart by underline style as well as color */
mark.source-run { background: transparent; color: inherit; text-decoration: none; text-underline-offset: 3px; }
/* Other claims' evidence is off by default (short values like a title match everywhere). */
#source.show-all mark.source-run { text-decoration: underline 1.5px dotted var(--rv-hl-other-line); }
mark.active-evidence { background: var(--rv-hl-current-bg); color: var(--rv-hl-current-text); text-decoration: underline 2px solid var(--rv-hl-current-line); }
mark.approximate.active-evidence { text-decoration-style: dashed; }
/* Word-window (approximate) spans can cover whole paragraphs; only show them for the selected claim. */
#source.show-all mark.source-run.approximate:not(.has-exact):not(.active-evidence) { text-decoration: none; }
.current-highlight { outline: 2px solid var(--rv-ink); outline-offset: 2px; border-radius: 2px; }
.selection-tools { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 24px; border-top: 1px solid var(--rv-border); flex-shrink: 0; }

/* Detail pane */
.detail-head { display: flex; flex-direction: column; gap: 1px; }
.detail-field { margin: 0; font-size: .86rem; font-weight: 600; }
.detail-path { overflow-wrap: anywhere; }
.claim-full-value { margin: 6px 0 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
h2.claim-full-value { font-size: 1.35rem; line-height: 1.3; }
p.claim-full-value.long { font-size: .95rem; line-height: 1.6; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
blockquote.evidence { margin: 10px 0 14px; padding: 2px 0 2px 12px; border-left: 3px solid var(--rv-neutral-border); overflow-wrap: anywhere; }
blockquote.evidence--found { border-left-color: var(--rv-found-fg); }
blockquote.evidence--partial { border-left-color: var(--rv-partial-fg); }
blockquote.evidence--notfound { border-left-color: var(--rv-notfound-fill); }
.evidence p { margin: 0 0 4px; }
.evidence-text { font-size: .95rem; }
.evidence-reasoning { font-size: .9rem; }
.evidence-meta { font-size: .8rem; color: var(--rv-text-muted); }
.evidence p.evidence-section { margin-bottom: 2px; }
/* The app's own source check reads as a fact; the model's self-rating stays quieter. */
.evidence-check { font-size: .84rem; font-weight: 600; }
.evidence-check-label { font-weight: 400; color: var(--rv-text-muted); }
.evidence-check--found { color: var(--rv-found-fg); }
.evidence-check--partial { color: var(--rv-partial-fg); }
.evidence-check--notfound { color: var(--rv-notfound-fill); }
.evidence-check--neutral { color: var(--rv-neutral-fg); }
.evidence-confidence { font-style: italic; }
.decision-buttons { display: flex; gap: 6px; margin-top: 16px; }
.decision-buttons button { flex: 1; justify-content: center; padding: 7px 6px; }
.decision-buttons button[aria-pressed=true] { background: var(--rv-surface-muted); border-color: var(--rv-ink); box-shadow: inset 0 0 0 1px var(--rv-ink); }
.decision-form { margin-top: 12px; padding: 4px 12px 12px; border: 1px solid var(--rv-border); border-radius: 8px; background: var(--rv-bg); }
#save-decision { margin-top: 14px; width: 100%; justify-content: center; }
#claim-more { margin-top: 18px; }
details.detail-more { border-top: 1px solid var(--rv-border); padding: 4px 0; }
details.detail-more summary { cursor: pointer; font-size: .86rem; font-weight: 600; padding: 6px 0; }
details.detail-more p { font-size: .86rem; margin: 4px 0 8px; }
.secondary-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; }
#history:not(:empty) { margin-top: 12px; }
.history-event { border-top: 1px solid var(--rv-border); padding: 8px 0; font-size: .8rem; }
.history-event p { margin: 2px 0 0; }
.status-label { padding: 8px 10px; border: 1px solid var(--rv-neutral-border); border-radius: 6px; font-size: .86rem; }
span.phrase-supported { text-decoration: underline 1.5px dotted; text-underline-offset: 3px; cursor: pointer; }
span.phrase-supported:hover { text-decoration-style: solid; }
span.phrase-unsupported { text-decoration: underline 2px dashed var(--rv-notfound-fill); text-underline-offset: 3px; }
button.phrase-supported { display: flex; width: 100%; text-align: left; margin: 4px 0; min-height: 0; }
.phrase-hint { font-size: .8rem; color: var(--rv-text-muted); margin: 0 0 8px; }
.phrase-unsupported-note { font-size: .86rem; margin: 8px 0; padding-left: 10px; border-left: 3px solid var(--rv-notfound-fill); }
/* Fallback: never show a field group whose claims are all filtered out. */
#claim-list > .claim-group:not(#dropped-group):not(:has(> .claim:not([hidden]))) { display: none; }

/* ---- Small screens --------------------------------------------------- */
@media (max-width: 1150px) {
  .review-layout { grid-template-columns: 250px minmax(0, 1fr) 310px; }
  main { padding: 20px 16px; }
}
@media (max-width: 850px) {
  main.review-main { height: auto; }
  .review-heading { grid-template-columns: 1fr; }
  .review-layout { display: block; }
  .claim-panel, .decision-panel { max-height: 520px; border: 0; border-bottom: 1px solid var(--rv-border); }
  .source-panel { height: 650px; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .page-heading { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media (forced-colors: active) {
  .chip { border-color: CanvasText; }
  mark.active-evidence { background: Mark; color: MarkText; }
}

/* ---- Curator notes (PLAN §16.1) --------------------------------------- */
.note-count:not(:empty) { margin-left: 2px; padding: 0 6px; border-radius: 9px; border: 1px solid var(--rv-neutral-border); font-size: .74rem; }
#notes-toggle[aria-expanded=true] { background: var(--rv-surface-muted); border-color: var(--rv-ink); }
.notes-panel { max-height: 40vh; overflow: auto; padding: 12px 24px 16px; border-bottom: 1px solid var(--rv-border); background: var(--rv-surface); flex-shrink: 0; }
.notes-panel > p { margin-bottom: 8px; font-size: .85rem; }
.notes { max-width: 80ch; }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note { padding: 8px 12px; border: 1px solid var(--rv-border); border-left: 3px solid var(--rv-neutral-border); border-radius: 6px; background: var(--rv-bg); }
.note--previous { border-left-style: dashed; }
.note-meta { margin: 0 0 2px; font-size: .78rem; color: var(--rv-text-muted); }
.note-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-actions { display: flex; gap: 6px; margin-top: 6px; }
.note textarea { width: 100%; }
.notes .note-save { margin-top: 8px; }
.notes-card + .notes-card { margin-top: 16px; }
.notes-card h3 { margin-top: 18px; }

/* ---- Human assertions (PLAN §16.2) ------------------------------------ */
.add-value { margin: 2px 12px 6px; color: var(--rv-text-muted); }
.add-value:hover { color: var(--rv-text); }
#add-empty-field { margin-top: 10px; }
.claim--human { border-left-style: dotted; }
#human-group { border-top: 1px solid var(--rv-border); margin-top: 10px; }
fieldset.basis { margin: 14px 0 0; padding: 8px 12px 10px; border: 1px solid var(--rv-border); border-radius: 6px; display: grid; gap: 6px; }
fieldset.basis legend { font-size: .82rem; font-weight: 600; padding: 0 4px; }
fieldset.basis input[type=radio] { width: 16px; height: 16px; padding: 0; margin: 0; flex: none; accent-color: var(--rv-ink); }
fieldset.basis label.inline { justify-content: flex-start; }
.field-hint { margin: 4px 0 0; font-size: .8rem; color: var(--rv-text-muted); overflow-wrap: anywhere; }
.dialog-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ---- No-op push (PLAN §16.3) ------------------------------------------ */
.push-state:not(:empty) { align-self: center; font-size: .8rem; color: var(--rv-text-muted); white-space: nowrap; }
