/* The Change Ledger — clinical review workbench design tokens.
   Source of truth: ../DESIGN.md. Light theme only for this
   prototype (dark mode explicitly deferred, not partially supported). These tokens are the
   ONLY color source for new implementation — do not reach for a framework default palette. */

:root {
  --canvas: #F4F6F6;
  --surface: #FFFFFF;
  --surface-subtle: #EDF2F2;
  --ink: #172B2D;
  --ink-secondary: #506467;
  --ink-disabled: #728184;
  --line: #D9E2E2;
  --control-line: #788D90;
  --accent: #0E6168;
  --accent-hover: #084A50;
  --accent-soft: #E4F1F1;
  --focus: #6B3FA0;
  --stopped: #A6333B;
  --stopped-bg: #FBEFF0;
  --changed: #245C99;
  --changed-bg: #EDF3FB;
  --reported: #236C4B;
  --reported-bg: #EAF5EE;
  --attention: #865716;
  --attention-bg: #FCF4E4;
  --error: #A52D24;
  --error-bg: #FCEFED;
  --unknown: #506467;
  --unknown-bg: #EEF2F3;
  --citation-bg: #F3F7F7;
  --shadow-overlay: 0 8px 28px rgba(23, 43, 45, 0.14);
  --shadow-menu: 0 2px 8px rgba(23, 43, 45, 0.10);
}

* { box-sizing: border-box; }

html { scroll-padding-top: 68px; } /* sticky app bar must not hide a focused element */

html, body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

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

.page-title { font-size: 26px; line-height: 32px; font-weight: 600; margin: 0 0 16px; }

/* ---- App shell ------------------------------------------------------------------------- */

.app-bar {
  min-height: 52px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-bar .brand { font-size: 15px; white-space: nowrap; }

.app-bar .spacer { flex: 1; }
.app-user { display: flex; align-items: center; gap: 8px; }

.app-bar .who { color: var(--ink-secondary); font-size: 13px; }

.app-bar nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

.testing-banner {
  background: var(--attention-bg);
  color: var(--attention);
  font-size: 13px;
  padding: 4px 24px;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 8px 24px 0;
  color: var(--ink-secondary);
  font-size: 13px;
}
@media (max-width: 1023px) { .breadcrumb { padding-left: 16px; padding-right: 16px; } }
@media (max-width: 767px) { .breadcrumb { padding-left: 12px; padding-right: 12px; } }

.workspace {
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1023px) {
  .workspace { padding: 16px; }
  .app-bar, .testing-banner { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 767px) {
  .workspace { padding: 12px; }
  .app-bar, .testing-banner { padding-left: 12px; padding-right: 12px; }
  .app-bar { flex-wrap: wrap; }
  .app-bar nav { display: none; }
  .app-bar .brand { flex: 1 1 100%; }
  .app-bar .spacer { display: none; }
  .app-user { align-items: flex-start; flex: 1 1 100%; justify-content: flex-end; margin-left: 0; min-width: 0; }
  .app-bar .who { overflow-wrap: anywhere; }
}

/* ---- Buttons and inputs ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px; /* 20 line + 14 padding + 2 border = 36px */
  border-radius: 6px;
  font: inherit;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-hover); transform: translateY(1px); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--control-line); }
.btn-secondary:hover { background: var(--surface-subtle); }
.btn-ghost { background: transparent; color: var(--accent); border-color: transparent; }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn-destructive { background: var(--error); color: #fff; }
.btn:disabled, .btn[aria-busy="true"] { cursor: wait; opacity: .65; }
.btn[aria-busy="true"]::after { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn svg { flex: none; height: 18px; width: 18px; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--control-line);
  border-radius: 6px;
  min-height: 36px;
  padding: 7px 10px;
}
input::placeholder { color: var(--ink-secondary); }
input:hover, select:hover { border-color: var(--ink-secondary); }
input[aria-invalid="true"] { border-color: var(--error); }
input:disabled, select:disabled { background: var(--surface-subtle); color: var(--ink-disabled); cursor: not-allowed; }
input:read-only { background: var(--surface-subtle); }
@media (pointer: coarse) {
  input[type="text"], input[type="email"], input[type="password"], input[type="search"], select, .btn { min-height: 44px; }
}

.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--ink); }
.field input { width: 100%; }
.field-help, .field-error { display: block; font-size: 13px; margin-top: 4px; }
.field-help { color: var(--ink-secondary); }
.field-error { color: var(--error); }
.password-field > label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--ink); }
.password-control { display: flex; gap: 4px; }
.password-control input { flex: 1 1 12ch; min-width: 0; width: auto; }
.password-control .btn { flex: 0 0 auto; min-width: 44px; min-height: 44px; padding-inline: 10px; white-space: nowrap; }
.password-control svg { height: 18px; width: 18px; }

/* ---- Cards, tables, rows ------------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.patient-header {
  min-height: 88px;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.patient-header h1 { font-size: 26px; line-height: 32px; font-weight: 600; margin: 0; }
.patient-header .meta { color: var(--ink-secondary); font-size: 13px; }
.source-header { padding: 12px 16px; }
.source-header h1 { font-size: 18px; line-height: 24px; font-weight: 600; margin: 0; }
.source-header .meta { color: var(--ink-secondary); font-size: 13px; }

.section-heading {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  margin: 24px 0 8px;
}
.timeline-heading { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.timeline-heading h2 { font-size: inherit; line-height: inherit; margin: 0; }

.coverage-notice { color: var(--ink-secondary); font-size: 13px; margin: 8px 0; font-variant-numeric: tabular-nums; }
.chart-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 16px 0;
  min-height: 48px;
}
.chart-date-filter { margin: 0; min-width: 200px; }
.chart-upload { align-self: center; display: grid; gap: 4px; }
#filter-status { flex-basis: 100%; }
@media (max-width: 767px) {
  .chart-date-filter, .chart-upload { width: 100%; }
  .chart-upload .btn { width: 100%; }
}

.upload-workspace { max-width: 900px; }
.upload-dropzone { border-style: dashed; margin-top: 16px; padding: 24px; text-align: center; }
.upload-dropzone.is-dragging { background: var(--accent-soft); border-color: var(--accent); }
.upload-dropzone h2 { font-size: 18px; line-height: 24px; margin: 0 0 8px; }
.upload-item { margin-bottom: 12px; padding: 16px; }
.upload-item--needs-confirmation { border-color: var(--attention); }
.upload-item--rejected { border-color: var(--error); }
.attribution-form { display: grid; gap: 8px; margin-top: 12px; max-width: 320px; }
.ingest-item { margin-bottom: 12px; padding: 16px; }
.ingest-item--failed { border-color: var(--error); }
.ingest-item--needs-confirmation, .ingest-item--held-for-review, .ingest-item--needs-human { border-color: var(--attention); }
.processing-steps { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; margin: 12px 0; padding: 0; }
.processing-step { border: 1px solid var(--control-line); border-radius: 4px; color: var(--ink-secondary); font-size: 13px; padding: 2px 6px; }
.processing-step--complete { background: var(--surface-subtle); color: var(--ink); }
.processing-step--pending { border-style: dashed; color: var(--accent); }
.processing-step--needs-confirmation, .processing-step--held-for-review, .processing-step--needs-human { background: var(--attention-bg); border-color: var(--attention); color: var(--attention); }
.processing-step--failed { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.processing-step--degraded { border-style: dashed; color: var(--ink-secondary); }
.review-task { margin-bottom: 16px; padding: 16px; }
.review-task h2 { font-size: 18px; line-height: 24px; margin: 0; }
.review-task-head, .review-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.review-actions { justify-content: flex-start; margin-top: 16px; }
.review-matrix { border-collapse: collapse; margin-top: 12px; width: 100%; }
.review-matrix th, .review-matrix td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.review-matrix th { color: var(--ink-secondary); font-size: 13px; }
.review-differs { color: var(--attention); font-weight: 600; }
@media (max-width: 767px) {
  .review-matrix, .review-matrix tbody, .review-matrix tr, .review-matrix th, .review-matrix td, .sources-matrix, .sources-matrix tbody, .sources-matrix tr, .sources-matrix th, .sources-matrix td { display: block; width: 100%; }
  .review-matrix thead, .sources-matrix thead { display: none; }
  .review-matrix tr, .sources-matrix tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .review-matrix th, .review-matrix td, .sources-matrix th, .sources-matrix td { border: 0; display: grid; gap: 8px; grid-template-columns: minmax(112px, 38%) minmax(0, 1fr); overflow-wrap: anywhere; padding: 6px; }
  .review-matrix th::before, .review-matrix td::before, .sources-matrix th::before, .sources-matrix td::before { color: var(--ink-secondary); content: attr(data-label); font-size: 13px; font-weight: 600; }
}
.sources-matrix { border-collapse: collapse; width: 100%; }
.sources-matrix th, .sources-matrix td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
.sources-matrix th { color: var(--ink-secondary); font-size: 13px; }
.source-state { margin: 16px 0; padding: 16px; }
.source-state h2 { font-size: 18px; line-height: 24px; margin: 0 0 8px; }
.source-state p { margin: 0; }
.history-filter { max-width: 280px; }
.history-list { display: grid; gap: 12px; list-style: none; margin: 16px 0; padding: 0; }
.history-event { padding: 16px; }
.access-grant { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; margin-bottom: 12px; padding: 16px; }
.access-grant--expired, .access-grant--revoked { border-color: var(--control-line); }
.access-grant--expiring { border-color: var(--attention); }
.dialog-body { min-width: min(480px, calc(100vw - 32px)); padding: 24px; position: relative; }
.dialog-body h2 { font-size: 18px; line-height: 24px; margin: 0 0 12px; }
.dialog-close { position: absolute; right: 12px; top: 8px; }
#access-dialog { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-overlay); color: var(--ink); padding: 0; }
#access-dialog::backdrop { background: rgba(23, 43, 45, 0.28); }
.side-source-sheet { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-overlay); color: var(--ink); margin: 0; max-height: calc(100vh - 84px); padding: 0; position: fixed; right: 16px; top: 68px; width: min(400px, calc(100vw - 32px)); }
.side-source-sheet::backdrop { background: rgba(23, 43, 45, 0.14); }
.side-source-sheet .dialog-body { min-width: 0; overflow-y: auto; }
.combobox { position: relative; }
.combobox label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.combobox input { width: 100%; }
.combobox-listbox { background: var(--surface); border: 1px solid var(--control-line); list-style: none; margin: 4px 0 0; max-height: 180px; overflow-y: auto; padding: 4px; position: absolute; width: 100%; z-index: 2; }
.combobox-listbox [role="option"] { cursor: pointer; padding: 6px 8px; }
.combobox-listbox [aria-selected="true"] { background: var(--accent-soft); }
.admin-tabs { display: flex; gap: 8px; margin: 16px 0; }
.admin-tabs button { background: var(--surface); border: 1px solid var(--control-line); border-radius: 4px; color: var(--ink); font: inherit; padding: 6px 12px; }
.admin-tabs button[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); font-weight: 600; }
.admin-table { border-collapse: collapse; margin-top: 16px; width: 100%; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.admin-table th { color: var(--ink-secondary); font-size: 13px; }
@media (max-width: 767px) {
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table th, .admin-table td { display: block; width: 100%; }
  .admin-table thead { display: none; }
  .admin-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .admin-table th, .admin-table td { border: 0; display: grid; gap: 8px; grid-template-columns: minmax(112px, 38%) minmax(0, 1fr); overflow-wrap: anywhere; padding: 6px; }
  .admin-table th::before, .admin-table td::before { color: var(--ink-secondary); content: attr(data-label); font-size: 13px; font-weight: 600; }
}

.table-scroll { overflow-x: auto; }
table.ledger { width: 100%; border-collapse: collapse; }
table.ledger th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.sort-header { background: none; border: 0; color: inherit; font: inherit; font-weight: inherit; padding: 0; text-align: left; }
.sort-header:hover { color: var(--accent-hover); text-decoration: underline; }
#ledger-table th { background: var(--surface); position: sticky; top: 0; z-index: 1; }
table.ledger td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}
table.ledger tbody tr { height: 64px; } /* acts as a minimum in table layout; wrapping still grows the row */
table.ledger tbody tr:last-child td { border-bottom: 0; }
table.ledger td:not(:first-child) { font-variant-numeric: tabular-nums; }
#ledger-table tbody tr:hover td { background: var(--surface-subtle); cursor: pointer; }
table.ledger tr.selected td { background: var(--accent-soft); }
table.ledger tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.scroll-hint { display: none; padding: 8px 12px; }
@media (max-width: 767px) { .scroll-hint { display: block; } }

@media (max-width: 767px) {
  #patients-table-wrap { overflow: visible; }
  #patients-table thead { display: none; }
  #patients-table, #patients-table tbody, #patients-table tr, #patients-table td { display: block; width: 100%; }
  #patients-table tbody tr { height: auto; padding: 8px 0; }
  #patients-table td { display: grid; grid-template-columns: minmax(112px, 38%) 1fr; gap: 8px; min-height: 0; }
  #patients-table td::before { content: attr(data-label); color: var(--ink-secondary); font-size: 13px; font-weight: 600; }
  #ledger-table { min-width: 0; }
  #ledger-table thead { display: none; }
  #ledger-table, #ledger-table tbody, #ledger-table tr, #ledger-table td { display: block; width: 100%; }
  #ledger-table tbody tr { height: auto; margin: 8px 0; padding: 8px 0; }
  #ledger-table td { border: 0; display: grid; gap: 8px; grid-template-columns: minmax(112px, 38%) minmax(0, 1fr); min-height: 0; overflow-wrap: anywhere; padding: 6px 12px; }
  #ledger-table td::before { color: var(--ink-secondary); content: attr(data-label); font-size: 13px; font-weight: 600; }
  #ledger-table ~ .scroll-hint { display: none; }
}

.med-name { font-weight: 600; font-size: 15px; line-height: 22px; color: var(--ink); }

/* Row selection is a real button (keyboard-reachable, aria-pressed); the whole row stays clickable. */
button.row-select {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}
button.row-select:focus-visible { border-radius: 4px; }

/* ---- Chart layout: ledger column + evidence inspector ------------------------------------- */

.chart-columns { display: flex; gap: 16px; align-items: flex-start; margin-top: 16px; }
.chart-main { flex: 1; min-width: 0; }
.inspector {
  width: 352px;
  flex-shrink: 0;
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}
.inspector:focus-visible { outline-offset: -2px; }
@media (max-width: 1279px) {
  .chart-columns { flex-direction: column; }
  .chart-main, .inspector { width: 100%; }
  .inspector { display: none; }
}
.evidence-sheet {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-overlay);
  color: var(--ink);
  max-height: min(80vh, 720px);
  padding: 0;
  width: min(480px, calc(100vw - 32px));
}
.evidence-sheet::backdrop { background: rgba(23, 43, 45, 0.28); }
.sheet-body { overflow-y: auto; max-height: inherit; padding-top: 48px; position: relative; }
.sheet-close { position: absolute; right: 12px; top: 8px; }
@media (max-width: 1023px) {
  .evidence-sheet { bottom: 12px; left: 12px; margin: 0; max-width: none; position: fixed; right: 12px; width: auto; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .evidence-sheet { margin: 0; position: fixed; right: 16px; top: 68px; }
}
.dose { font-variant-numeric: tabular-nums; color: var(--ink); }

/* Long unbroken tokens (OCR run-ons, hyphen-less brand strings) wrap instead of widening the page. */
.med-name, .row-title, .dose, .rationale-quote, .evidence-meta, .meta, .auth-note, .patient-header h1, .empty-state { overflow-wrap: anywhere; }

/* ---- Verdict badges (state carries meaning by word + icon, not color alone) ----------------- */

.verdict-label, .tag, .count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.verdict-label--stopped { background: var(--stopped-bg); color: var(--stopped); }
.verdict-label--changed { background: var(--changed-bg); color: var(--changed); }
.verdict-label--reported { background: var(--reported-bg); color: var(--reported); }
.verdict-label--unknown { background: var(--unknown-bg); color: var(--unknown); }
.tag { background: var(--surface-subtle); color: var(--ink-secondary); font-weight: 500; }
.tag--attention { background: var(--attention-bg); color: var(--attention); }
.tag--error { background: var(--error-bg); color: var(--error); }
.count-badge { background: var(--unknown-bg); color: var(--unknown); min-width: 2em; justify-content: center; }

/* ---- Evidence / rationale panel --------------------------------------------------------- */

.evidence-panel {
  padding: 16px 24px;
}
#unresolved-list > * + *, #document-pages > * + * { border-top: 1px solid var(--line); }
#document-pages { overflow: hidden; }
.rationale-quote {
  font-family: "Source Serif 4", Georgia, serif;
  font-style: normal;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--citation-bg);
  margin: 8px 0;
  border-radius: 4px;
}
.evidence-meta { color: var(--ink-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.meta { color: var(--ink-secondary); font-size: 13px; }
.row-title { color: var(--ink); font-size: 15px; font-weight: 600; line-height: 22px; }
.auth-note { color: var(--ink-secondary); font-size: 13px; }
.source-reference { margin-top: 4px; }

.status-message {
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 12px;
}
.status-message--attention {
  background: var(--attention-bg);
  color: var(--attention);
}
.error-state, .error-banner {
  background: var(--error-bg);
  color: var(--error);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}

.empty-state {
  color: var(--ink-secondary);
  padding: 32px 12px;
  text-align: center;
  max-width: 60ch;
  margin: 0 auto;
}
.empty-state h2, .error-state h2 { color: var(--ink); font-size: 18px; line-height: 24px; margin: 0 0 4px; }
.empty-state p, .error-state p { margin: 0 0 12px; }
.skeleton { background: var(--surface-subtle); border-radius: 4px; min-height: 20px; }
.skeleton--row { min-height: 64px; margin: 1px 0; }
.skeleton--header { min-height: 88px; }
.skeleton--timeline { min-height: 260px; margin: 16px 0; }
.skeleton--page { min-height: 320px; margin-top: 16px; }
.loading-skeleton { display: grid; gap: 4px; }
.loading-skeleton--chart { gap: 8px; }
.stack-8 > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.workspace--wide { max-width: 1280px; }
.workspace--reading > * { max-width: 72ch; }
.source-page { white-space: pre-wrap; margin-top: 4px; max-width: 72ch; overflow-wrap: anywhere; }
.source-metadata { display: grid; gap: 4px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 0; }
.source-metadata div { display: grid; gap: 2px; }
.source-metadata dt { color: var(--ink-secondary); font-size: 13px; }
.source-metadata dd { margin: 0; overflow-wrap: anywhere; }
.source-page-nav { align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 12px; margin: -16px -24px 12px; padding: 8px 24px; position: sticky; top: 52px; z-index: 1; }
.source-page-heading { color: var(--ink); font: inherit; font-weight: 600; margin: 0 auto 0 0; }
.inspector-close { margin-bottom: 12px; }
.source-copy-citation { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
@media (max-width: 767px) { .source-metadata { grid-template-columns: 1fr; } }
.conflict-heading { align-items: center; display: flex; gap: 8px; }
.assertion-pair { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.assertion { border-top: 1px solid var(--line); padding-top: 8px; }
.tl-conflict-bracket { fill: none; stroke: var(--attention); stroke-dasharray: 3 3; stroke-width: 2; }
.tl-conflict-mark { fill: var(--surface); stroke: var(--attention); stroke-width: 2; }
.tl-conflict { cursor: pointer; outline: none; }
.tl-conflict:focus-visible .tl-conflict-mark { stroke: var(--focus); }
@media (max-width: 767px) { .assertion-pair { grid-template-columns: 1fr; } }
.citation-mark { background: var(--citation-bg); color: inherit; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

[hidden] { display: none !important; }

/* ---- Timeline: reports per organisation, one row per change ------------------------------ */

.timeline-card { padding: 16px 24px 12px; }
.timeline-host { position: relative; }
.timeline-host > svg { display: block; width: 100%; height: auto; overflow: visible; }
.tl-label { font-size: 13px; fill: var(--ink-secondary); }
.tl-med { font-size: 14px; font-weight: 600; fill: var(--ink); }
.tl-axis { font-size: 13px; fill: var(--ink-secondary); font-variant-numeric: tabular-nums; }
.tl-plan-tick { stroke: var(--unknown); stroke-width: 1; stroke-dasharray: 3 3; }
.tl-plan-axis { fill: var(--unknown); }
.tl-grid, .tl-row { stroke: var(--line); stroke-width: 1; }
.tl-latest-report { stroke: var(--control-line); stroke-width: 1; }
.tl-latest-label { fill: var(--ink-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.tl-span { stroke: var(--control-line); stroke-width: 2; stroke-linecap: round; }
.tl-plan { stroke: var(--unknown); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 4; }
.tl-mark { cursor: pointer; outline: none; }
.tl-mark--static { cursor: default; }
.tl-mark--static .tl-ring, .tl-mark--static.selected .tl-ring { stroke: transparent; }
.tl-ring { fill: none; stroke: transparent; stroke-width: 2; transition: stroke 120ms cubic-bezier(0.2, 0, 0, 1); }
.tl-mark:hover .tl-ring { stroke: var(--control-line); }
.tl-mark.selected .tl-ring { stroke: var(--accent); }
.tl-mark:focus-visible .tl-ring { stroke: var(--focus); }
.tl-report-mark:focus-visible .tl-report { stroke: var(--focus); }
.tl-plan-mark:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.verdict-glyph { flex: none; overflow: visible; }
.date-cell { white-space: nowrap; }
.tl-tip {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -100%);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow-menu);
  z-index: 2;
}
.tl-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-secondary);
}
.tl-legend li { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend svg { overflow: visible; }

.verdict-filter { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.verdict-filter button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--control-line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 120ms cubic-bezier(0.2, 0, 0, 1), border-color 120ms cubic-bezier(0.2, 0, 0, 1);
}
.verdict-filter button:hover { background: var(--surface-subtle); }
.verdict-filter button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.verdict-filter button svg { overflow: visible; }
.verdict-filter .count { color: var(--ink-secondary); }
@media (pointer: coarse) { .verdict-filter button { min-height: 44px; } }

.coverage-strip { display: block; margin-bottom: 2px; }

/* ---- Wordmark ---------------------------------------------------------------------------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark:hover { color: var(--accent-hover); }
.wordmark-mark {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  position: relative;
}
/* three ledger lines, the middle one shorter: a list with something missing */
.wordmark-mark::before, .wordmark-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}
.wordmark-mark::before { top: 6px; right: 6px; box-shadow: 0 8px 0 #fff; }
.wordmark-mark::after { top: 10px; right: 10px; }

/* ---- Entry surfaces: landing, login, signup ------------------------------------------------ */

.entry-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 24px;
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 10fr);
  gap: 64px;
  align-items: center;
  min-height: calc(100vh - 29px);
}
.entry-title {
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 32px 0 16px;
  max-width: 24ch;
  text-wrap: balance;
}
.entry-lede {
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-secondary);
  max-width: 56ch;
  margin: 0 0 24px;
}
.entry-lede strong { color: var(--ink); font-weight: 600; }
.entry-rules {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: grid;
  gap: 12px;
}
.entry-rules li { display: flex; gap: 12px; align-items: flex-start; }
.entry-rules li > div { color: var(--ink-secondary); }
.entry-rules li strong { color: var(--ink); font-weight: 600; }
.entry-rules svg { flex: none; width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }
.entry-rules i, .verdict-label i, .verdict-glyph { display: inline-block; flex: none; height: 18px; width: 18px; }
.entry-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.entry-actions .btn { text-decoration: none; }
.entry-preview { display: grid; gap: 16px; }
.entry-preview .verdict-label svg { width: 18px; height: 18px; }
#landing-timeline { min-height: 332px; }
#landing-timeline .tl-mark { cursor: default; }
.preview-evidence { margin-left: 32px; }
.preview-evidence--unknown { box-shadow: none; margin-left: 64px; padding: 12px 16px; }
.preview-evidence--unknown p { margin: 8px 0; }
.preview-caption { font-size: 13px; color: var(--ink-secondary); margin: 0; }
.landing-footer { color: var(--ink-secondary); font-size: 13px; margin: 0 auto; max-width: 1072px; padding: 0 24px 32px; width: 100%; }
@media (max-width: 1023px) {
  .entry-shell { grid-template-columns: 1fr; gap: 40px; padding: 40px 16px; min-height: 0; }
  .entry-title { font-size: 28px; line-height: 34px; }
  .preview-evidence, .preview-evidence--unknown { margin-left: 0; }
}
@media (max-width: 767px) { .entry-shell { padding: 32px 12px; } }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.auth-brand {
  background: var(--accent-soft);
  border-right: 1px solid var(--line);
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}
.auth-lede {
  font-size: 18px;
  line-height: 26px;
  font-weight: 500;
  color: var(--ink);
  max-width: 30ch;
  margin: 0 0 24px;
  text-wrap: balance;
}
.auth-rules { margin: 0; }
.auth-rules li > div { color: var(--ink); }
.auth-rules-details { display: none; }
.auth-disclaimer { margin: 0; }
.auth-main { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; padding: 32px; }
.auth-card .page-title { margin-bottom: 4px; }
.auth-help { color: var(--ink-secondary); margin: 0 0 20px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card > .btn { width: 100%; justify-content: center; margin-top: 4px; }
.auth-foot { margin: 16px 0 0; font-size: 13px; color: var(--ink-secondary); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 767px) {
  .auth-shell { grid-template-columns: 1fr; min-height: 0; }
  .auth-brand { padding: 24px 16px; border-right: 0; border-bottom: 1px solid var(--line); gap: 24px; }
  .auth-brand > div { display: none; }
  .auth-rules-details { display: block; }
  .auth-rules-details summary { color: var(--ink); cursor: pointer; font-weight: 500; }
  .auth-rules-details .auth-rules { margin-top: 12px; }
  .auth-disclaimer { white-space: nowrap; }
  .auth-main { padding: 24px 12px; }
  .auth-card { padding: 24px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
}
