:root {
  --ink: #172033;
  --muted: #667085;
  --paper: #f3f6fa;
  --surface: #fff;
  --line: #d8e0ea;
  --blue: #0a66c2;
  --blue-pale: #eaf3fc;
  --green: #18794e;
  --amber: #986700;
  --red: #b42318;
  --radius: 8px;
  --ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --data: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--ui); }
[hidden], .auth-gate[hidden], #app-shell[hidden] { display: none !important; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-panel { width: min(420px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.auth-panel h1 { margin: 0 0 8px; }
.auth-panel p { color: var(--muted); }
.shell { min-height: 100vh; }
.site-header { height: 60px; padding: 0 max(20px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.back { color: var(--blue); font-weight: 700; text-decoration: none; }
.account { display: flex; align-items: center; gap: 12px; color: var(--muted); min-width: 0; }
.account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { min-height: 40px; padding: 8px 13px; border: 1px solid #b9c5d4; border-radius: 6px; background: var(--surface); color: var(--ink); font: 700 13px/1 var(--ui); cursor: pointer; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: white; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #79b8f3; outline-offset: 2px; }
main { width: min(1240px, calc(100% - 40px)); margin: 36px auto 60px; }
.report-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font: 800 12px/1.2 var(--data); text-transform: uppercase; letter-spacing: .06em; }
h1 { margin: 0; max-width: 760px; font-size: clamp(32px, 5vw, 58px); line-height: 1.02; letter-spacing: -.035em; }
.lede { margin: 12px 0 0; max-width: 700px; color: var(--muted); font-size: 17px; }
.snapshot-date { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); background: var(--surface); font: 700 12px/1.3 var(--data); }
.state-panel { display: flex; gap: 10px; align-items: baseline; margin-bottom: 16px; padding: 12px 14px; border-left: 4px solid var(--blue); background: var(--blue-pale); }
.state-panel[data-state="partial"], .state-panel[data-state="stale"] { border-color: var(--amber); background: #fff8e6; }
.state-panel[data-state="error"] { border-color: var(--red); background: #fff1f0; }
.state-panel[data-state="loaded"] { border-color: var(--green); background: #edf8f2; }
.state-panel span { color: var(--muted); }
.source-rail, .matrix-panel { margin-bottom: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.section-head { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 20px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.source-card { min-height: 105px; padding: 12px; background: var(--surface); }
.source-card strong, .source-card span { display: block; }
.source-card .status { margin-top: 7px; color: var(--green); font: 800 12px/1.3 var(--data); text-transform: capitalize; }
.source-card .status.partial, .source-card .status.stale { color: var(--amber); }
.source-card .status.unavailable, .source-card .status.not_authorised, .source-card .status.api_unsupported { color: var(--red); }
.source-card .status.valid_empty { color: var(--muted); }
.source-card small { color: var(--muted); }
.filters { display: grid; grid-template-columns: 1fr 1fr minmax(220px, 1.4fr) 1fr auto; gap: 12px; align-items: end; margin-bottom: 16px; padding: 16px; background: #dee8f4; border: 1px solid #c4d2e3; border-radius: var(--radius); }
.field label { display: block; margin-bottom: 5px; font-weight: 800; font-size: 12px; }
.field select, .field input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #aebdce; border-radius: 5px; background: var(--surface); color: var(--ink); font: inherit; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px; border-bottom: 2px solid var(--ink); text-align: left; color: var(--muted); font: 800 11px/1.3 var(--data); text-transform: uppercase; letter-spacing: .035em; }
td { padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child { width: 19%; font-weight: 800; }
.tag { display: inline-block; margin: 0 4px 5px 0; padding: 3px 6px; border: 1px solid #b9cbe0; border-radius: 4px; background: #f4f8fc; font: 700 11px/1.3 var(--data); }
.evidence-list { margin: 0; padding-left: 18px; }
.evidence-list li + li { margin-top: 5px; }
.evidence-list a { color: var(--blue); overflow-wrap: anywhere; }
.muted { color: var(--muted); }
details summary { color: var(--blue); font-weight: 700; cursor: pointer; }
details p { margin: 8px 0 0; color: var(--muted); }
.empty-panel { padding: 34px 16px; text-align: center; }
.empty-panel h3 { margin: 0 0 4px; }
.empty-panel p, footer { color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.pagination span { color: var(--muted); font: 700 12px/1.3 var(--data); }
.evidence-detail { margin-top: 8px; color: var(--muted); }
.evidence-detail[aria-busy="true"] { min-height: 24px; }
footer { padding: 12px 4px; font-size: 13px; }
@media (max-width: 800px) { .filters { grid-template-columns: 1fr 1fr; } .field-query { grid-column: 1 / -1; } .report-head { align-items: start; flex-direction: column; } }
@media (max-width: 600px) {
  .site-header { padding: 0 14px; } .account span { display: none; } main { width: calc(100% - 24px); margin-top: 24px; }
  .filters { grid-template-columns: 1fr; } .field-query { grid-column: auto; } .state-panel, .section-head { align-items: start; flex-direction: column; }
  .matrix-panel { padding: 14px; } .table-wrap { overflow: visible; }
  table, thead, tbody, tr, td { display: block; width: 100%; } thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody { display: grid; gap: 12px; } tr { padding: 6px 12px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 5px; }
  td, td:first-child { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; width: 100%; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: inherit; overflow-wrap: anywhere; }
  td:last-child { border-bottom: 0; } td::before { content: attr(data-label); color: var(--muted); font: 800 10px/1.4 var(--data); text-transform: uppercase; }
  .pagination { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
