/* TP5 Judgment Analyser - screen styles.
   Visual language follows TP1 (navy bar, tricolour strip, white cards on light grey, blue primary).
   No external fonts: system sans for UI, Georgia for the Court's words and headings. */

:root {
  --navy: #0d2240;
  --navy-2: #173461;
  --blue: #1f4fd1;
  --blue-hover: #1942b3;
  --blue-soft: #e9effd;
  --ground: #f3f5f8;
  --card: #ffffff;
  --ink: #172033;
  --ink-2: #48546a;
  --ink-3: #66718a;
  --rule: #dde2ea;
  --rule-2: #edf0f4;
  --quote-bg: #f2f5fa;
  --ok: #1e7d4f;
  --ok-soft: #e5f4ec;
  --bad: #b4443f;
  --bad-soft: #fbecea;
  --amber: #8a5a00;
  --amber-line: #e0a21b;
  --amber-soft: #fff6df;
  --neutral: #56627a;
  --neutral-soft: #eef1f5;
  --focus: #1f4fd1;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .06);
  --f-sans: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
  --f-serif: Georgia, "Times New Roman", serif;
  --f-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--f-sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100; background: #fff; color: var(--navy);
  padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }
.muted { color: var(--ink-3); }
.pg { font-family: var(--f-mono); font-size: .76rem; color: var(--ink-3); white-space: nowrap; }

/* ---------------------------------------------------------------- top bar */
.tricolour { display: grid; grid-template-columns: repeat(3, 1fr); height: 4px; }
.tricolour span:nth-child(1) { background: #ff9933; }
.tricolour span:nth-child(2) { background: #ffffff; }
.tricolour span:nth-child(3) { background: #138808; }
.topbar { background: var(--navy); color: #fff; }
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; gap: 14px 28px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand-mark {
  flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { display: grid; min-width: 0; }
.brand-title { font-size: 1.3rem; font-weight: 700; letter-spacing: .005em; }
.brand-sub { font-size: .86rem; color: #c8d2e6; }
.mainnav { display: flex; gap: 4px; margin-left: auto; }
.mainnav a {
  color: #dbe3f3; text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 7px 14px; border-radius: 999px;
}
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.mainnav a[aria-current="page"] { color: var(--navy); background: #fff; }
.health-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600;
  color: #fff; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16); white-space: nowrap;
}
.health-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa6bd; flex: 0 0 auto; }
.health-pill.is-ok .dot { background: #2ecc71; box-shadow: 0 0 0 3px rgba(46, 204, 113, .25); }
.health-pill.is-bad { background: rgba(214, 69, 65, .22); border-color: rgba(255, 140, 130, .55); }
.health-pill.is-bad .dot { background: #ff6b5f; box-shadow: 0 0 0 3px rgba(255, 107, 95, .25); }

/* ---------------------------------------------------------------- page + cards */
.page { max-width: 1320px; margin: 0 auto; padding: 28px 28px 72px; display: grid; gap: 22px; }
.page > * { min-width: 0; }
.page--narrow { max-width: 960px; }
.page--report { max-width: 1260px; }        /* 26 Oct, summary: the contents rail beside the report (920px below 1100px) */
.card {
  background: var(--card); border: 1px solid #e3e7ee; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px; min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { font-size: 1.12rem; color: var(--navy); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.page-title { font-family: var(--f-serif); font-size: 1.9rem; font-weight: 600; color: var(--navy); }
.lede { color: var(--ink-2); margin-top: 6px; max-width: 70ch; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.empty { color: var(--ink-3); padding: 10px 0; }

/* ---------------------------------------------------------------- buttons, badges */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .15s, box-shadow .15s, border-color .15s;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(31, 79, 209, .28); }
.btn-primary:hover { background: var(--blue-hover); color: #fff; }
.btn-secondary { background: #fff; color: var(--navy); border-color: #c9d1de; }
.btn-secondary:hover { border-color: var(--navy); color: var(--navy); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #983631; color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); padding-inline: 8px; }
.btn-ghost:hover { color: var(--blue); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .86rem; border-radius: 8px; }
.link-btn {
  background: none; border: 0; padding: 0; color: var(--blue); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; line-height: 1.6;
  background: var(--neutral-soft); color: var(--neutral); border: 1px solid transparent;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: #f1d28a; }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.badge-navy { background: var(--navy); color: #fff; }
.tag-unverified {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 5px; font-size: .7rem; font-weight: 700;
  background: var(--amber-soft); color: var(--amber); border: 1px solid #f1d28a; vertical-align: 1px; white-space: nowrap;
}

/* progress */
.progress { height: 10px; background: #e5e9f0; border-radius: 999px; overflow: hidden; flex: 1 1 auto; }
.progress-fill { display: block; height: 100%; width: 0; background: var(--blue); border-radius: inherit; transition: width .4s ease; }
.progress--thin { height: 6px; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-pct { font-family: var(--f-mono); font-size: .9rem; color: var(--ink-2); min-width: 3.5rem; text-align: right; }

/* toast */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: min(420px, calc(100vw - 32px));
  background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  box-shadow: 0 8px 24px rgba(13, 34, 64, .3);
}
.toast.is-bad { background: var(--bad); }
.toast.is-ok { background: var(--ok); }

/* alerts */
.alert { border-radius: 10px; padding: 12px 16px; border: 1px solid var(--rule); background: #fff; }
.alert-bad { border-color: #efb9b5; background: var(--bad-soft); color: #7d2925; }
.alert-ok { border-color: #a9d8bf; background: var(--ok-soft); color: #165c3a; }
.alert-info { border-color: #c4d3f6; background: var(--blue-soft); color: #1d3b8a; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* forms */
.field { display: grid; gap: 4px; min-width: 0; }
.field label, .field .label { font-size: .78rem; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.input, .select {
  width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid #c9d1de; border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit; font-size: .93rem;
}
.input:focus-visible, .select:focus-visible { outline: 3px solid rgba(31, 79, 209, .35); outline-offset: 0; border-color: var(--blue); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.filters .field--wide { grid-column: span 2; }

/* tables */
.tblwrap { position: relative; overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: #fff; -webkit-overflow-scrolling: touch; }
.tbl { border-collapse: collapse; width: 100%; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule-2); }
.tbl thead th {
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
  font-weight: 700; background: #f7f9fb; white-space: nowrap;
}
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ================================================================ upload page */
.upload-card { display: grid; gap: 18px; }
.dropzone {
  position: relative; display: grid; place-items: center; gap: 8px; text-align: center; cursor: pointer;
  padding: 44px 20px; border: 2px dashed #b7c3d8; border-radius: 14px; background: #f8fafd;
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--blue); background: var(--blue-soft); }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.dropzone svg { width: 46px; height: 46px; color: var(--blue); }
.dz-title { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.dz-choose { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.dz-hint { color: var(--ink-3); font-size: .9rem; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-state { display: grid; gap: 10px; }
.upload-file { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 600; }
.whatyouget ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.whatyouget li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.whatyouget li svg { width: 22px; height: 22px; color: var(--ok); margin-top: 1px; }
.recent { list-style: none; margin: 0; padding: 0; display: grid; }
.recent-item { border-top: 1px solid var(--rule-2); }
.recent-item:first-child { border-top: 0; }
.recent-link {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  padding: 12px 6px; color: inherit; text-decoration: none; border-radius: 8px;
}
.recent-link:hover { background: #f7f9fc; color: inherit; }
.recent-main { display: grid; min-width: 0; flex: 1 1 280px; }
.recent-title { font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.recent-meta { font-size: .86rem; color: var(--ink-3); overflow-wrap: anywhere; }
.recent-side { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.recent-item .progress { margin: 0 6px 12px; }

/* ================================================================ job page */
.job-card { display: grid; gap: 16px; }
.job-title { font-size: 1.35rem; color: var(--navy); overflow-wrap: anywhere; }
.job-message { color: var(--ink-2); min-height: 1.5em; }
.job-facts { display: flex; gap: 6px 20px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-3); }
.job-facts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stage { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink-3); }
.stage-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #c9d1de; background: #fff; }
.stage-icon svg { width: 14px; height: 14px; }
.stage-state { font-size: .8rem; font-weight: 600; }
.stage.is-done { color: var(--ink); }
.stage.is-done .stage-icon { background: var(--ok); border-color: var(--ok); color: #fff; }
.stage.is-active { background: var(--blue-soft); color: var(--navy); font-weight: 700; }
.stage.is-active .stage-icon { border-color: var(--blue); border-right-color: transparent; animation: spin 1s linear infinite; }
.stage.is-failed .stage-icon { background: var(--bad); border-color: var(--bad); color: #fff; }
.stage.is-failed { color: var(--bad); font-weight: 700; }
.job-note { font-size: .88rem; color: var(--ink-3); }
.error-card { border-left: 4px solid var(--bad); display: grid; gap: 12px; }
.error-card h2 { color: var(--bad); font-size: 1.2rem; }
/* "Result at a glance" while the briefing is checked (18 Oct, speed round). The stamp and the table reuse the report's
   classes (.stamp, .glance, .tag-unverified, .flag-note), so they look as they will in the report. */
.early-card { display: grid; gap: 14px; }
.early-head { display: grid; gap: 10px; }
.early-h { font-family: var(--f-serif); font-size: 1.4rem; font-weight: 600; color: var(--navy); }
.early-title { font-family: var(--f-serif); font-size: 1.15rem; color: var(--ink); overflow-wrap: anywhere; flex: 1 1 260px; min-width: 0; }
.early-title .v { font-style: italic; color: var(--ink-2); }
.early-note { font-size: .9rem; color: var(--ink-2); background: #f7f9fc; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; }

/* ================================================================ report (screen) */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.toolbar-msg { flex-basis: 100%; }
.confirm {
  flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: #fff; border: 1px solid #efb9b5; border-left: 4px solid var(--bad); border-radius: 10px; padding: 12px 16px;
}
.confirm p { flex: 1 1 280px; }

.report {
  background: var(--card); border: 1px solid #e3e7ee; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px 40px 28px; display: grid; min-width: 0;
}
.report > * { min-width: 0; }
.rp-head { display: grid; gap: 14px; padding-bottom: 20px; }
.rp-head h1 { font-family: var(--f-serif); font-size: clamp(1.7rem, 4.4vw, 2.4rem); font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.rp-head h1 .v { font-style: italic; font-weight: 400; color: var(--ink-2); }
.rp-row { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.rp-meta { color: var(--ink-2); font-size: .95rem; display: grid; gap: 2px; min-width: 0; flex: 1 1 320px; }
.stamp {
  border: 2.5px solid var(--neutral); color: var(--neutral); border-radius: 7px; padding: 8px 14px; transform: rotate(-3deg);
  text-align: center; text-transform: uppercase; letter-spacing: .07em; line-height: 1.25; max-width: 260px;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px currentColor; font-family: var(--f-mono);
}
.stamp b { display: block; font-size: .98rem; }
.stamp span { display: block; font-size: .68rem; margin-top: 2px; }
.stamp--fail { border-color: var(--bad); color: var(--bad); }
.stamp--ok { border-color: var(--ok); color: var(--ok); }

.banner { border-radius: 10px; padding: 14px 18px; display: grid; gap: 8px; margin-bottom: 16px; }
.banner-amber { background: var(--amber-soft); border: 1px solid #f1d28a; border-left: 5px solid var(--amber-line); color: #4d3600; }
.banner h2 { font-family: var(--f-sans); font-size: 1rem; font-weight: 700; color: #5c4100; }
.banner ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 3px; font-size: .9rem; }
.banner a { color: #6b4b00; font-weight: 600; }
.banner .flag-list li { overflow-wrap: anywhere; }
.banner .flag-list .pg { color: #7a6431; }

.sec { padding-block: 30px 6px; display: grid; gap: 14px; scroll-margin-top: 58px; }
.sec + .sec { border-top: 1px solid var(--rule-2); }
.sec-head { display: grid; gap: 4px; }
.sec-num { font-family: var(--f-mono); font-size: .75rem; color: var(--ink-3); letter-spacing: .06em; }
.sec h2 { font-family: var(--f-serif); font-size: 1.55rem; font-weight: 600; color: var(--navy); }
.sec-note { font-size: .88rem; color: var(--ink-3); }
.empty-note { font-size: .95rem; color: var(--ink-3); font-style: italic; background: #f8f9fb; border-radius: 8px; padding: 10px 14px; }

.glance { border-collapse: collapse; width: 100%; font-size: .95rem; }
.glance th, .glance td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule-2); }
.glance th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; width: 10.5rem; padding-top: 12px; }
.glance tr { scroll-margin-top: 64px; }
.glance tr:last-child > * { border-bottom: 0; }
.glance td { overflow-wrap: anywhere; }
.glance .pg { margin-left: 6px; }
.glance tr.is-outcome td { font-weight: 700; }
.glance tr.is-outcome.res-fail td { color: var(--bad); }
.glance tr.is-outcome.res-ok td { color: var(--ok); }
.glance tr.is-unverified td { color: var(--ink-2); }
.glance tr.is-flagged > * { background: var(--amber-soft); }
.glance tr.is-flagged > th { border-left: 4px solid var(--amber-line); padding-left: 8px; }
.glance .flag-note { margin-top: 6px; font-weight: 400; }
.outcome-flag { border-left: 4px solid var(--amber-line); background: var(--amber-soft); border-radius: 0 6px 6px 0; padding: 8px 12px; scroll-margin-top: 64px; }

.cq { margin: 0; background: var(--quote-bg); border-left: 3px solid #9aa7bf; padding: 9px 14px; font-family: var(--f-serif); font-size: 1.04rem; line-height: 1.55; border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.cq .pg { margin-left: 6px; }
/* The Court's words are never cut short: no height limit, no line clamp, no hidden overflow. */
.cq, .cq p, .concl li, .concl-q, .tbl.wit td.words {
  max-height: none; overflow: visible; white-space: normal; text-overflow: clip; -webkit-line-clamp: unset; line-clamp: none;
}

/* "Show the full paragraph" (17 Oct): the paragraph(s) a quote comes from, collapsed under the quote; screen only. */
.ctx { margin-top: 6px; font-size: .92rem; }
.ctx > summary { cursor: pointer; color: var(--blue); font-weight: 600; width: fit-content; list-style-position: inside; }
.ctx > summary:hover { color: var(--blue-hover); }
.ctx > summary:focus-visible { outline: 3px solid rgba(31, 79, 209, .35); outline-offset: 2px; border-radius: 4px; }
.ctx-body { margin-top: 6px; padding: 8px 12px; border: 1px dashed #c4cddc; border-radius: 6px; font-family: var(--f-serif); line-height: 1.55; overflow-wrap: anywhere; }
.ctx-body p { margin: 0; }
.ctx-body p + p { margin-top: 8px; }
.tbl.wit .ctx { font-size: .88rem; }

/* "More from the judgment" (18 Oct 2026, recall round): the section's other checked points, collapsed under its
   up-front list (a plain heading when REPORT_COLLAPSE=0); numbering continues; the PDF prints everything. */
.more { border-top: 1px dashed var(--rule); padding-top: 10px; scroll-margin-top: 64px; }
.more > summary { cursor: pointer; color: var(--blue); font-weight: 600; width: fit-content; list-style-position: inside; }
.more > summary:hover { color: var(--blue-hover); }
.more > summary:focus-visible { outline: 3px solid rgba(31, 79, 209, .35); outline-offset: 2px; border-radius: 4px; }
.more[open] > summary { margin-bottom: 4px; }
.more-n { color: var(--ink-3); font-weight: 400; }
.more-h { font-family: var(--f-sans); font-size: .95rem; font-weight: 700; color: var(--ink-2); border-top: 1px dashed var(--rule); padding-top: 10px; scroll-margin-top: 64px; }
.more-tag { font-size: .8rem; font-weight: 400; color: #7a6431; }

.points { list-style: none; margin: 0; padding: 0; display: grid; }
.point {
  display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 4px 12px; padding: 14px 10px 14px 0;
  border-top: 1px solid var(--rule-2); scroll-margin-top: 64px; border-left: 4px solid transparent; border-radius: 4px;
}
.point:first-child { border-top: 0; }
.point-n { font-family: var(--f-serif); font-size: 1.45rem; line-height: 1.1; color: var(--blue); text-align: right; }
.points--reasons .point-n { color: var(--bad); }
.point-body { display: grid; gap: 8px; min-width: 0; }
.point-h { font-family: var(--f-sans); font-size: 1.02rem; font-weight: 700; color: var(--ink); line-height: 1.4; }
/* "Verify yourself" badge with the full reason in small text under it (only on the flagged item) */
.flag-note { display: grid; gap: 3px; justify-items: start; font-family: var(--f-sans); }
.flag-why { font-size: .8rem; line-height: 1.45; color: #6d5a2e; overflow-wrap: anywhere; }
.point.is-flagged, .concl li.is-flagged, .tbl tr.is-flagged > :first-child { border-left-color: var(--amber-line); }
.point.is-flagged { background: linear-gradient(90deg, rgba(255, 246, 223, .75), rgba(255, 246, 223, 0) 70%); padding-left: 0; }
.is-pulse { animation: pulse 1.6s ease-out 1; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 162, 27, .6); } 100% { box-shadow: 0 0 0 14px rgba(224, 162, 27, 0); } }

.verbatim { background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--navy); border-radius: 10px; padding: 14px 18px; display: grid; gap: 10px; }
.verbatim .label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
/* No list markers: the Court's own numbering ("1.", "2.") is inside its quoted words. */
.concl { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; font-family: var(--f-serif); font-size: 1.05rem; line-height: 1.55; }
.concl li { display: grid; gap: 6px; padding: 2px 0 2px 12px; border-left: 3px solid #c9d3e3; scroll-margin-top: 64px; overflow-wrap: anywhere; }
.concl li::marker { content: none; }
.concl li.is-flagged { border-left: 4px solid var(--amber-line); background: var(--amber-soft); border-radius: 0 4px 4px 0; padding: 6px 8px 6px 12px; }
/* 20 Oct, user case fixes: the conclusions' own "More from the judgment" list (inside the verbatim box) */
.verbatim .more, .verbatim .more-h { margin-top: 2px; }
.more > .concl--more, .more-h + .concl--more { margin-top: 10px; }
/* 20 Oct, user case fixes (T4): the note naming footnote reference digits inside a quote */
.fn-note { font-family: var(--f-sans); font-size: .8rem; line-height: 1.45; color: var(--ink-3); margin: 0; }

.tbl.wit td.words { font-family: var(--f-serif); font-size: .98rem; overflow-wrap: anywhere; }
.tbl.wit th[scope="row"] { font-weight: 700; width: 26%; }
.tbl.wit td.p { width: 4.5rem; white-space: nowrap; }
.tbl.wit tr { scroll-margin-top: 64px; }
.tbl.wit tr > :first-child { border-left: 4px solid transparent; }
.tbl.wit tr.is-flagged { background: var(--amber-soft); }
.tbl.wit .flag-note { margin-top: 6px; }
.tbl.wit { min-width: 560px; }

.rp-foot { border-top: 1px solid var(--rule); margin-top: 30px; padding-top: 16px; font-size: .86rem; color: var(--ink-2); display: grid; gap: 10px; }
/* 27 Oct 2026, user fixes: the footer is one plain line, the time taken */
.rp-time { margin: 0; }
/* 27 Oct 2026, user fixes: why a "Result at a glance" row is not verified, under its value */
.glance-why { display: block; margin-top: 3px; font-size: .8rem; line-height: 1.45; color: #6d5a2e; overflow-wrap: anywhere; }

/* ================================================================ report: summary + section cards + contents rail */
/* 26 Oct, summary (SPEC §4.19; plan.md section 3; the approved mockup handoff/summary_layout/design/mockup.html): "The
   judgment in brief" at the top, every section a card that opens and closes, a contents rail that stays on screen (a
   menu bar below 1100px). The cards look applies inside .rp-layout, which only the screen page has; the PDF keeps the
   plain report. The server renders every card open; report.js closes them once it runs (html.cards-ready). */
:root { --rail-w: 252px; --cite: #1f4fd1; --cite-soft: #eef3fe; }
.rp-layout { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); gap: 22px; align-items: start; }
.rp-layout > * { min-width: 0; }
.rp-layout > .report { background: transparent; border: 0; box-shadow: none; padding: 0; gap: 14px; border-radius: 0; }
.case-card, .brief, .sc, .rp-layout .rp-foot { background: var(--card); border: 1px solid #e3e7ee; border-radius: var(--radius); box-shadow: var(--shadow); }
.case-card { padding: 26px 30px 22px; }
.rp-layout .banner { margin: 0; }
.rp-layout .rp-foot { margin-top: 6px; padding: 18px 24px; }

/* the judgment in brief: the system's plain words (never in quotation marks), the topic in a left column */
.brief { padding: 18px 24px 12px; border-top: 4px solid var(--blue); display: grid; gap: 10px; }
.brief-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.brief-head h2 { font-family: var(--f-serif); font-size: 1.45rem; font-weight: 600; color: var(--navy); }
.brief-note { flex-basis: 100%; font-size: .86rem; color: var(--ink-2); }
.brief-list { list-style: none; margin: 0; padding: 0; display: grid; }
.bp { display: grid; grid-template-columns: 1.9rem 10.5rem minmax(0, 1fr); gap: 2px 14px; padding: 11px 10px 11px 0;
      border-top: 1px solid var(--rule-2); border-left: 4px solid transparent; border-radius: 4px; cursor: pointer; outline-offset: -2px; }
.bp:first-child { border-top: 0; }
.bp:hover { background: #f7f9fc; }
.bp-n { font-family: var(--f-serif); font-size: 1.3rem; line-height: 1.15; color: var(--blue); text-align: right; }
.bp-topic { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding-top: 4px; line-height: 1.35; overflow-wrap: anywhere; }
.bp--core .bp-topic { color: var(--navy); }
.bp-main { display: grid; gap: 5px; min-width: 0; }
.bp-text { font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; }
.bp-src { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; font-size: .8rem; }
.bp-src-l { color: var(--ink-3); }
.bp-src a { display: inline-flex; gap: 4px; align-items: baseline; text-decoration: none; color: var(--blue); background: var(--blue-soft);
            border: 1px solid #c4d3f6; border-radius: 999px; padding: 1px 9px; font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bp-src a b { font-weight: 700; }
.bp-src a:hover { background: #dde7fc; color: var(--blue-hover); }
.bp-sep { display: none; }                 /* the commas between page links show in print only */
.bp.is-current { border-left-color: var(--cite); background: var(--cite-soft); }
/* a topic not summarised: a grey line that opens its section; the outcome not confirmed: amber, badge first */
.bp--pointer .bp-topic { color: var(--ink-3); }
.bp--pointer .bp-text { font-size: .92rem; color: var(--ink-3); }
.bp-go { font-weight: 600; white-space: nowrap; }
.bp-badge { justify-self: start; }
.bp.is-flagged { border-left-color: var(--amber-line); background: linear-gradient(90deg, rgba(255, 246, 223, .8), rgba(255, 246, 223, 0) 75%); }
.bp.is-flagged .bp-text { color: var(--ink-2); }
.brief-failed { font-size: .95rem; color: var(--ink-2); }
/* 27 Oct, user fixes: a point marked Verify (it could not be confirmed): amber edge, badge first, the note under it */
.bp.is-verify .bp-text { color: var(--ink); }
.bp-check { font-size: .84rem; color: var(--amber); line-height: 1.45; overflow-wrap: anywhere; }
/* 28 Oct, no word limit: a summary point of any length and its note are shown whole, like the Court's words: no height
   limit, no line clamp, no hidden overflow, no ellipsis */
.bp-text, .bp-check {
  max-height: none; overflow: visible; white-space: normal; text-overflow: clip; -webkit-line-clamp: unset; line-clamp: none;
}
.brief-note-partial { font-size: .86rem; color: var(--ink-3); }

/* section cards */
.sc.sec { padding: 0; display: block; gap: 0; scroll-margin-top: 0; }
.sc.sec + .sc.sec { border-top: 1px solid #e3e7ee; }
.sc > .sc-head { margin: 0; font: inherit; color: inherit; }
.sc.is-open > .sc-head { position: sticky; top: var(--stick-top, 0px); z-index: 4; background: #fff;
                         border-bottom: 1px solid var(--rule); border-radius: var(--radius) var(--radius) 0 0; }
.sc-toggle { appearance: none; -webkit-appearance: none; background: none; border: 0; margin: 0; width: 100%; text-align: left; cursor: pointer;
             display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto 30px; align-items: center; gap: 4px 12px;
             padding: 15px 18px; min-height: 60px; border-radius: inherit; color: inherit; font: inherit; }
.sc-toggle:hover { background: #f8fafd; }
.sc-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.sc-num { font-family: var(--f-mono); font-size: .76rem; color: var(--ink-3); letter-spacing: .06em; }
.sc-title { font-family: var(--f-serif); font-size: 1.26rem; font-weight: 600; color: var(--navy); line-height: 1.3; overflow-wrap: anywhere; }
.sc-counts { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; font-family: var(--f-sans); }
.sc-n { font-size: .78rem; font-weight: 700; color: var(--ink-2); background: var(--neutral-soft); border-radius: 999px; padding: 1px 10px; white-space: nowrap; }
.sc-counts .jflag, .rail .jflag { font-size: .74rem; font-weight: 700; color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 1px 8px; border: 1px solid #f1d28a; white-space: nowrap; }
.sc-chev { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--rule); display: grid; place-items: center; background: #fff; transition: transform .15s; }
.sc-chev::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: translateY(-2px) rotate(45deg); }
.sc.is-open .sc-chev { transform: rotate(180deg); }
.sc-toggle:hover .sc-chev { border-color: var(--ink-3); }
.sc-partial { padding: 0 18px 8px calc(18px + 2.2rem + 12px); }
.sc-peek { list-style: none; margin: -4px 0 0; padding: 0 18px 15px calc(18px + 2.2rem + 12px); display: grid; gap: 3px; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.sc-peek li { position: relative; padding-left: 14px; overflow-wrap: anywhere; }
.sc-peek li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: #9aa7bf; }
.sc-peek .peek-q { font-family: var(--f-serif); color: var(--ink); }
.sc-peek .peek-q .pg { margin-left: 4px; }
.sc-peek .peek-more { color: var(--ink-3); font-size: .84rem; }
.sc-peek .peek-more::before { display: none; }
.sc.is-open > .sc-peek { display: none; }
/* a link target lands below the phone bar and its card's sticky header, also when the browser itself scrolls to it
   (a link opened in a new tab, JavaScript off); report.js measures each open card's header (--sc-head-h) */
.rp-layout .sc-body [id] { scroll-margin-top: calc(var(--stick-top, 0px) + var(--sc-head-h, 64px) + 10px); }
/* (26 Oct, integration, after the review) and a focused control with no id (Shift+Tab up a long card) */
.rp-layout .sc-body :is(a, summary, button) { scroll-margin-top: calc(var(--stick-top, 0px) + var(--sc-head-h, 64px) + 10px); }
.rp-layout .sc, .rp-layout .brief, .rp-layout .bp, .rp-layout .banner { scroll-margin-top: calc(var(--stick-top, 0px) + 10px); }
/* a closed card's body is hidden="until-found" where the browser supports it, so Ctrl+F still finds its words */
.sc-body[hidden="until-found"] { display: block !important; }
.sc-inner { padding: 14px 24px 16px; display: grid; gap: 14px; }
.sc-foot { display: flex; justify-content: center; border-top: 1px dashed var(--rule); padding-top: 10px; }
.sc--empty { box-shadow: none; border-style: dashed; background: #fbfcfd; }
.sc-headrow { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 14px 18px 6px; }
.sc--empty .sc-title { color: var(--ink-2); font-size: 1.15rem; }
.sc-empty-note, .sc--empty > .sec-note { padding: 0 18px 14px calc(18px + 2.2rem + 12px); font-size: .92rem; color: var(--ink-3); }
.sc-empty-note { font-style: italic; }
/* before report.js has set each card's state (and only if it runs within 4 s) every card shows closed */
html.js-cards:not(.cards-ready) .sc-body { display: none !important; }
html.js-cards:not(.cards-ready) .sc.is-open > .sc-peek { display: grid; }
html.js-cards:not(.cards-ready) .sc.is-open > .sc-head { position: static; border-bottom: 0; }
html.js-cards:not(.cards-ready) .sc.is-open .sc-chev { transform: none; }
/* without JavaScript (or when report.js never ran) every card stays open: no control is shown that would do nothing */
html:not(.js-cards) .sc-chev, html:not(.js-cards) .sc-foot, html:not(.js-cards) .rail-actions { display: none; }
html:not(.js-cards) .sc-toggle { cursor: default; }
html:not(.js-cards) .sc-toggle:hover { background: none; }

/* the points a summary point is based on */
.point.is-cited, .concl li.is-cited { border-left-color: var(--cite); background: var(--cite-soft); }
.tbl.wit tr.is-cited > * { background: var(--cite-soft); }
.tbl.wit tr.is-cited > :first-child { border-left-color: var(--cite); }
.is-cite-pulse { animation: citepulse 1.6s ease-out 1; }
@keyframes citepulse { 0% { box-shadow: 0 0 0 0 rgba(31, 79, 209, .45); } 100% { box-shadow: 0 0 0 14px rgba(31, 79, 209, 0); } }
.back-to { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-family: var(--f-sans); font-size: .82rem; font-weight: 700;
           color: var(--blue); text-decoration: none; background: #fff; border: 1px solid #c4d3f6; border-radius: 999px; padding: 2px 11px; margin-top: 2px; }
.back-to:hover { background: var(--blue-soft); }

/* contents rail */
.rail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; overscroll-behavior: contain; z-index: 20;
        background: var(--card); border: 1px solid #e3e7ee; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 10px 12px; scrollbar-width: thin; }
.rail-skip { position: absolute; left: 8px; top: 8px; z-index: 30; background: #fff; padding: 6px 10px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 600; }
.rail-skip:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rail-bar { display: none; }
.rail-panel { display: grid; gap: 10px; }
.rail-title { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 0 8px; }
.rail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 4px; }
.rail-actions .btn { padding-inline: 6px; }
.rail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.rail-link { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 1px 8px; align-items: start; padding: 7px 8px; min-height: 38px;
             border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .88rem; line-height: 1.35; }
.rail-link:hover { background: #f1f4f9; color: var(--navy); }
.rail-num { font-family: var(--f-mono); font-size: .7rem; color: var(--ink-3); }
.rail-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #9aa7bf; margin-top: .32em; background: #fff; }
.rail-link.is-open .rail-dot { background: var(--navy); border-color: var(--navy); }
.rail-link.is-empty { color: var(--ink-3); }
.rail-link.is-empty .rail-dot { border-style: dashed; }
.rail-ico { width: 10px; height: 10px; margin-top: .32em; border-radius: 2px; background: #c9d1de; }
.rail-ico--brief { background: var(--blue); }
.rail-ico--flag { background: var(--amber-line); }
.rail-link.is-brief { color: var(--navy); font-weight: 700; }
.rail-count { font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); padding-top: .1em; }
.rail-flag { grid-column: 2 / -1; justify-self: start; margin-top: 2px; }
.rail-link[aria-current="location"] { background: var(--navy); color: #fff; }
.rail-link[aria-current="location"] .rail-num, .rail-link[aria-current="location"] .rail-count { color: #c8d2e6; }
.rail-link[aria-current="location"] .rail-dot { border-color: #fff; }
.rail-link[aria-current="location"].is-open .rail-dot { background: #fff; }
.rail-sep { border-top: 1px solid var(--rule-2); margin: 5px 8px; }
.flag-more > summary { cursor: pointer; color: #6b4b00; font-weight: 700; width: fit-content; font-size: .9rem; }
.flag-more[open] > summary { margin-bottom: 4px; }

/* phones and tablets: the rail becomes a menu bar at the top */
@media (max-width: 1099px) {
  .page--report { max-width: 920px; }
  .rp-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  :root { --stick-top: 54px; }
  .rail { top: 0; max-height: none; overflow: visible; padding: 0; border-radius: 0 0 12px 12px; box-shadow: 0 2px 10px rgba(16, 24, 40, .1); }
  .rail-bar { display: block; }
  .rail-toggle { appearance: none; background: none; border: 0; width: 100%; min-height: 52px; padding: 0 14px; display: grid;
                 grid-template-columns: 22px minmax(0, 1fr) 30px; align-items: center; gap: 10px; font: inherit; color: var(--navy); cursor: pointer; text-align: left; }
  .rail-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
  .rail-bar-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-current { color: var(--ink-2); font-size: .9rem; }
  .rail-current:not(:empty)::before { content: "· "; }
  .rail-burger, .rail-burger::before, .rail-burger::after { display: block; width: 18px; height: 2px; background: var(--navy); border-radius: 2px; position: relative; content: ""; }
  .rail-burger::before { position: absolute; top: -6px; } .rail-burger::after { position: absolute; top: 6px; }
  .rail-toggle[aria-expanded="true"] .sc-chev { transform: rotate(180deg); }
  .rail-panel { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid #e3e7ee;
                border-radius: 12px; box-shadow: 0 12px 32px rgba(13, 34, 64, .22); padding: 12px 10px; max-height: min(72vh, 600px); overflow: auto; }
  .rail.is-menu-open .rail-panel { display: grid; }
  .rail-link { min-height: 44px; }
  /* without JavaScript the contents are a plain list at the top (no menu to open) */
  html:not(.js-cards) { --stick-top: 0px; }
  html:not(.js-cards) .rail { position: static; padding: 12px 10px; border-radius: var(--radius); }
  html:not(.js-cards) .rail-bar { display: none; }
  html:not(.js-cards) .rail-panel { display: grid; position: static; border: 0; box-shadow: none; padding: 0; max-height: none; }
}
@media (max-width: 720px) {
  .case-card { padding: 20px 16px 18px; }
  .brief { padding: 16px 14px 10px; }
  .bp { grid-template-columns: 1.5rem minmax(0, 1fr); gap: 2px 10px; }
  .bp-n { grid-row: 1 / span 2; font-size: 1.15rem; }
  .bp-topic, .bp-main { grid-column: 2; }
  .bp-topic { padding-top: 2px; }
  .sc-toggle { grid-template-columns: 1.7rem minmax(0, 1fr) 30px; padding: 13px 12px; gap: 6px 8px; }
  .sc-counts { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .sc-chev { grid-column: 3; grid-row: 1; }
  .sc-title { font-size: 1.12rem; }
  .sc-peek, .sc-partial, .sc-empty-note, .sc--empty > .sec-note { padding-left: calc(12px + 1.7rem + 8px); padding-right: 12px; }
  .sc-inner { padding: 12px 12px 14px; }
  .sc-headrow { grid-template-columns: 1.7rem minmax(0, 1fr); padding: 12px 12px 4px; }
  .sc-headrow .sc-counts { grid-column: 2; }
  .rp-layout .rp-foot { padding: 16px 14px; }
}

/* ================================================================ dashboard */
.dash-status { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink-3); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa6bd; }
.live-dot.is-live { background: #2ecc71; box-shadow: 0 0 0 3px rgba(46, 204, 113, .22); }
.dash-content { display: grid; gap: 22px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi {
  display: grid; gap: 4px; align-content: start; text-align: left; cursor: pointer; color: inherit; text-decoration: none;
  background: var(--card); border: 1px solid #e3e7ee; border-top: 4px solid var(--navy); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px 16px; font: inherit;
}
.kpi:hover { border-color: #b9c6dd; border-top-color: var(--navy); color: inherit; }
.kpi.kpi--ok { border-top-color: var(--ok); }
.kpi.kpi--bad { border-top-color: var(--bad); }
.kpi.kpi--amber { border-top-color: var(--amber-line); }
.kpi-label { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.kpi-value { font-size: 2rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi--ok .kpi-value { color: var(--ok); }
.kpi--bad .kpi-value { color: var(--bad); }
.kpi-n { font-size: .78rem; color: var(--ink-3); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dash-grid .span-2 { grid-column: 1 / -1; }
.chart-card { display: grid; gap: 10px; align-content: start; }
.chart-card .card-head { margin-bottom: 0; }
.chart-sub { font-size: .86rem; color: var(--ink-3); margin-top: -6px; }
.chart-box { position: relative; width: 100%; min-height: 160px; }
.chart-box canvas { display: block; }
.chart-empty { color: var(--ink-3); font-size: .92rem; padding: 26px 0; text-align: center; background: #f8f9fb; border-radius: 8px; }
.n-note { font-size: .78rem; color: var(--ink-3); }
.values summary { cursor: pointer; font-size: .84rem; color: var(--blue); font-weight: 600; width: fit-content; }
.values .tbl { font-size: .86rem; }
.values .tbl td, .values .tbl th { padding: 6px 10px; }
.values[open] summary { margin-bottom: 8px; }
.cell-btn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: rgba(31, 79, 209, .35); text-underline-offset: 2px;
}
.cell-btn:hover { text-decoration-color: currentColor; }
.heat { border-collapse: separate; border-spacing: 3px; font-size: .84rem; min-width: 760px; width: 100%; }
.heat th { font-size: .74rem; color: var(--ink-2); font-weight: 700; text-align: left; vertical-align: bottom; padding: 4px 6px; }
.heat thead th { min-width: 96px; }
.heat tbody th { white-space: normal; min-width: 170px; }
.heat td { padding: 0; }
.heat .hbtn {
  width: 100%; min-height: 44px; border: 1px solid var(--rule-2); border-radius: 6px; font: inherit; cursor: pointer;
  display: grid; place-items: center; line-height: 1.2; font-variant-numeric: tabular-nums;
}
.heat .hbtn small { display: block; font-size: .72rem; opacity: .9; }
.heat .hbtn.is-zero { background: #fafbfc; color: #9aa3b5; cursor: default; }
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--ink-3); }
.heat-legend .ramp { width: 140px; height: 10px; border-radius: 4px; background: linear-gradient(90deg, rgba(180, 68, 63, .08), rgba(180, 68, 63, .9)); }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.wall-card { border: 1px solid var(--rule); border-left: 4px solid var(--bad); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; align-content: start; background: #fff; }
.wall-card blockquote { margin: 0; font-family: var(--f-serif); font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.wall-card .wall-h { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.wall-card .wall-src { font-size: .84rem; color: var(--ink-3); }
.wall-card .wall-src a { font-weight: 700; }
.quality { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0; }
.quality div { background: #f8f9fb; border-radius: 10px; padding: 10px 14px; }
.quality dt { font-size: .76rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.quality dd { margin: 2px 0 0; font-size: 1.35rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.quality dd small { font-size: .8rem; font-weight: 600; color: var(--ink-3); }
.empty-state { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 48px 24px; }
.empty-state h2 { font-family: var(--f-serif); font-size: 1.5rem; color: var(--navy); }

/* drill-down drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(13, 34, 64, .35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(560px, 100vw); background: #fff;
  box-shadow: -12px 0 32px rgba(13, 34, 64, .22); display: grid; grid-template-rows: auto 1fr; outline: none;
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--rule); background: #f7f9fc; }
.drawer-head h2 { font-size: 1.1rem; color: var(--navy); }
.drawer-head p { font-size: .84rem; color: var(--ink-3); margin-top: 2px; }
.icon-btn { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--rule); background: #fff; cursor: pointer; font-size: 1.3rem; line-height: 1; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.drawer-body { overflow-y: auto; padding: 16px 20px 32px; display: grid; gap: 14px; align-content: start; }
.dd-item { border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; }
.dd-item h3 { font-size: 1rem; }
.dd-item h3 a { color: var(--navy); }
.dd-meta { font-size: .84rem; color: var(--ink-3); }
.dd-quote { margin: 0; background: var(--quote-bg); border-left: 3px solid #9aa7bf; padding: 8px 12px; border-radius: 0 6px 6px 0; display: grid; gap: 4px; }
.dd-quote .dd-h { font-size: .84rem; font-weight: 700; color: var(--ink-2); }
.dd-quote p { font-family: var(--f-serif); font-size: .98rem; overflow-wrap: anywhere; }

/* ================================================================ library */
.lib-table { min-width: 980px; }
.lib-table tbody tr { cursor: pointer; }
.lib-table tbody tr:hover { background: #f7f9fc; }
.lib-table .lib-title { min-width: 230px; }
.lib-table .lib-court { min-width: 190px; }
.lib-title a { font-weight: 700; color: var(--navy); text-decoration: none; }
.lib-title a:hover { text-decoration: underline; }
.lib-sub { display: block; font-size: .8rem; color: var(--ink-3); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: .74rem; padding: 1px 8px; border-radius: 6px; background: var(--neutral-soft); color: var(--ink-2); white-space: nowrap; }
.row-confirm { display: grid; gap: 6px; min-width: 190px; }
.row-confirm p { font-size: .82rem; font-weight: 600; color: #7d2925; }
.lib-count { font-size: .88rem; color: var(--ink-3); }

/* ================================================================ responsive */
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 12px 16px; gap: 10px 14px; }
  .brand { gap: 12px; flex: 1 1 100%; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .brand-title { font-size: 1.12rem; }
  .brand-sub { font-size: .76rem; }
  .mainnav { margin-left: 0; }
  .mainnav a { padding: 6px 11px; font-size: .9rem; }
  .health-pill { font-size: .8rem; padding: 5px 10px; margin-left: auto; }
  .page { padding: 18px 16px 56px; gap: 16px; }
  .card { padding: 18px 16px; }
  .report { padding: 22px 16px 20px; border-radius: 12px; }
  .page-title { font-size: 1.55rem; }
  .glance th { width: 6.8rem; }
  .point { grid-template-columns: 1.8rem minmax(0, 1fr); gap: 4px 8px; }
  .point-n { font-size: 1.2rem; }
  .filters .field--wide { grid-column: 1 / -1; }
  .stamp { transform: rotate(-2deg); }
  .kpi-value { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
