/* SEND Lens — focused comparison of English schools on SEND provision. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:wght@400;600&display=swap');

:root {
  --bg:         #faf9f6;             /* warm off-white instead of cool grey */
  --bg-soft:    #f4f2ec;             /* subtle alternate for panels */
  --card:       #ffffff;
  --ink:        #1a1d2e;
  /* --ink-soft bumped from #5f667a to #525868 for better contrast on the
     warm #faf9f6 background (WCAG AA for sustained reading body text). */
  --ink-soft:   #525868;
  --ink-faint:  #7a8092;
  --line:       #e6e3da;             /* warmer line colour */
  --line-soft:  #efece5;
  --accent:     #1d3b8c;             /* slightly deeper, warmer blue */
  --accent-soft:#e3eaf7;
  --accent-soft-2:#f0f5fc;
  --la:         #d97706;             /* slightly softer orange */
  --region:     #0d8e6a;
  --national:   #6d4ec2;
  --warn-bg:    #fdf6e8;
  --warn-bd:    #d97706;
  --shadow:     0 1px 2px rgba(20,25,46,.03), 0 4px 16px rgba(20,25,46,.05);
  --shadow-hi:  0 4px 14px rgba(29,59,140,.10), 0 18px 36px rgba(29,59,140,.08);
  --radius:     10px;
  --radius-lg:  14px;
}

/* ====== ACCESSIBILITY ================================================== */
/* Skip-to-content link — visually hidden until focused. Keyboard users hit
   Tab once on page load and can jump past the topbar and tab nav directly
   into the page content. */
.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-120%);
  background: var(--accent);
  color: white;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  font-weight: 600;
  z-index: 100;
  transition: transform 0.12s ease-out;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid white;
  outline-offset: -4px;
}

/* The wrapping #main-content div is a focus target only — no visible style.
   tabindex="-1" makes it programmatically focusable when the skip link
   activates. The :focus outline is suppressed because the div itself is
   only a landing pad, not a visible region. */
#main-content:focus { outline: none; }
.legal-page {
  max-width: 900px;
  margin: 36px auto;
  padding: 0 24px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "ss01", "cv11";   /* nicer "1" and lowercase a */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { letter-spacing: 0; }
a { color: var(--accent); }
a:hover { color: var(--ink); }

/* ====== TOP BAR ======================================================== */
.topbar {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 22px 32px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 24px;
  align-items: flex-end;
}
.brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
  font-weight: 700;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark svg {
  flex: none;
  filter: drop-shadow(0 1px 1px rgba(20,25,46,.12));
}
.brand .brand-accent { color: var(--la); }
.brand p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  max-width: 720px;
}

/* Mobile nav toggle — only visible on narrow viewports. Desktop keeps the
   tab row fully visible inside the topbar grid. */
.nav-toggle {
  display: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  align-self: center;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 0;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: -1px;
}
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font: inherit;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Mobile topbar: stack the brand, expose the menu toggle, hide the tab row
   until toggled open. Threshold at 720px because the brand+strapline+full
   tab row stops fitting cleanly somewhere around there. */
@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 16px 18px 0;
  }
  .nav-toggle { display: inline-block; }
  .tabs {
    grid-column: 1 / -1;
    flex-direction: column;
    gap: 0;
    margin-top: 12px;
    border-bottom: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.18s ease-out;
  }
  .tabs.nav-open {
    max-height: 320px;
    border-top: 1px solid var(--line);
    margin-top: 16px;
  }
  .tab {
    width: 100%;
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 14px 4px;
  }
  .tab.active { border-bottom-color: var(--accent); }
  .brand h1 { font-size: 20px; }
  .brand p { font-size: 12px; }
}

/* ====== TAB PANES ====================================================== */
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.page-head {
  max-width: 1100px;
  margin: 32px auto 16px;
  padding: 0 24px;
}
.page-head h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: 0; }
.page-head p { color: var(--ink-soft); margin: 0; max-width: 760px; }

/* ====== SEARCH ========================================================= */
.search-wrap {
  max-width: 900px;
  margin: 28px auto 8px;
  padding: 0 24px;
  position: relative;
}
#search {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}
#search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#results {
  position: absolute;
  left: 24px; right: 24px; top: 56px;
  max-height: 360px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  z-index: 10;
  box-shadow: var(--shadow);
}
#results li { padding: 8px 14px; cursor: pointer; }
#results li:hover, #results li.hi { background: var(--accent-soft); }
#results .name  { font-weight: 600; }
#results .meta  { color: var(--ink-soft); font-size: 12px; }
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* ====== EMPTY STATE ==================================================== */
.empty {
  max-width: 720px;
  margin: 56px auto;
  text-align: center;
  color: var(--ink-soft);
  padding: 0 24px;
}
.empty h2 {
  font-weight: 600;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: 0;
  margin-bottom: 14px;
}
.empty .empty-lead {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 580px;
  margin: 0 auto 18px;
}
.empty .empty-sub {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 580px;
  margin: 0 auto;
}
.empty .empty-sub strong { color: var(--ink); }
.empty .thinking-ahead-banner {
  margin-top: 32px;
  padding: 18px 22px;
  background: var(--accent-soft-2);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  text-align: left;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
}
.empty .thinking-ahead-banner strong { color: var(--accent); }
@media (max-width: 600px) {
  .empty { margin: 32px auto; }
  .empty h2 { font-size: 22px; }
  .empty .empty-lead { font-size: 15px; }
}

/* About-page version */
.thinking-ahead {
  margin: 0 0 24px;
  padding: 18px 22px;
  background: var(--accent-soft-2);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}
.thinking-ahead h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.thinking-ahead p {
  margin: 0 0 8px;
  line-height: 1.65;
}
.thinking-ahead p:last-child { margin-bottom: 0; }

/* ====== MAIN REPORT ==================================================== */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px 48px;
}

.school-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line-soft);
  margin: 12px 0 18px;
}
@media (max-width: 600px) {
  .school-head {
    flex-direction: column;
    padding: 16px 18px;
  }
  .school-head .peer-counts { text-align: left; white-space: normal; }
}
.school-head h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: 0; font-weight: 600; }
.school-head .meta { color: var(--ink-soft); font-size: 13px; }
.school-head .meta.sub { font-size: 12px; margin-top: 4px; }

.peer-counts {
  text-align: right;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.7;
  white-space: nowrap;
}

/* Ofsted badge — compact pill in school header */
.ofsted-badge-wrap { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ofsted-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: white;
  text-decoration: none;
  color: var(--ink);
}
.ofsted-badge:hover { box-shadow: var(--shadow); }
.ofsted-badge .ofsted-prefix {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.ofsted-badge .grade-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
}
.ofsted-badge.grade-outstanding { background: #d1fae5; border-color: #6ee7b7; color: #047857; }
.ofsted-badge.grade-good        { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.ofsted-badge.grade-ri          { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.ofsted-badge.grade-inadequate  { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.ofsted-badge.grade-unknown     { background: #f1f3f7; border-color: var(--line); color: var(--ink-soft); }
.ofsted-badge .ofsted-date { color: var(--ink-soft); font-size: 11px; }

/* Ofsted detail card */
#ofsted-detail .ofsted-row {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 14px;
}
#ofsted-detail .ofsted-row:last-child { border-bottom: 0; }
#ofsted-detail .ofsted-row .label { color: var(--ink); }
#ofsted-detail .ofsted-row .value { font-weight: 600; }
#ofsted-detail .ofsted-row .value.grade-outstanding { color: #047857; }
#ofsted-detail .ofsted-row .value.grade-good        { color: #047857; }
#ofsted-detail .ofsted-row .value.grade-ri          { color: #b45309; }
#ofsted-detail .ofsted-row .value.grade-inadequate  { color: #991b1b; }
#ofsted-detail .ofsted-section-title {
  margin-top: 14px; margin-bottom: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft);
}
#ofsted-detail .ofsted-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 10px; font-size: 13px; color: var(--ink-soft);
}
#ofsted-detail .ofsted-meta a { color: var(--accent); }
#ofsted-detail .ofsted-stale {
  font-size: 12px; color: var(--ink-soft); font-style: italic; margin-top: 4px;
}
#ofsted-detail .ofsted-caveat {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-soft);
  font-style: italic;
}

/* "SEN" annotation marker on the most SEN-relevant rows */
#ofsted-detail .sen-mark {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  vertical-align: middle;
}

/* Hero strip: "Ofsted's SEN read" one-line synthesis */
.ofsted-sen-strip {
  margin: 14px 0 2px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 3px solid #6b7280;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.5;
}
.ofsted-sen-strip .strip-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-right: 8px;
}
.ofsted-sen-strip .strip-grade {
  display: inline-block;
  font-weight: 600;
  margin-right: 10px;
}
.ofsted-sen-strip .strip-grade.grade-outstanding { color: #047857; }
.ofsted-sen-strip .strip-grade.grade-good        { color: #047857; }
.ofsted-sen-strip .strip-grade.grade-ri          { color: #b45309; }
.ofsted-sen-strip .strip-grade.grade-inadequate  { color: #991b1b; }
.ofsted-sen-strip .strip-date {
  color: var(--ink-soft); font-size: 12px;
}

/* Suspensions + permanent exclusions strip — same skeleton as the Ofsted
   SEN strip. It renders only for notably elevated pooled removals or repeated
   permanent exclusions; the left border carries the RAG signal. */
.exclusions-strip {
  margin: 14px 0 2px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 3px solid #6b7280;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.5;
}
.exclusions-strip .strip-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-right: 8px;
}
.exclusions-strip .strip-figure {
  font-weight: 700;
  margin-right: 10px;
}
.exclusions-strip .strip-figure.rate-low      { color: #047857; }
.exclusions-strip .strip-figure.rate-elevated { color: #b45309; }
.exclusions-strip .strip-figure.rate-high     { color: #991b1b; }
.exclusions-strip .strip-context {
  color: var(--ink-soft);
}
.exclusions-strip .strip-perm {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 3px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 600;
  font-size: 12.5px;
}
.exclusions-strip .strip-date {
  color: var(--ink-soft); font-size: 12px;
}

/* Workforce strip — same skeleton as Ofsted SEN / exclusions strips.
   Fires only when staffing density is notably high (thin) or notably low
   (well-staffed) versus same-LA same-FSM-band peers. Suppressed otherwise. */
.workforce-strip {
  margin: 14px 0 2px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 3px solid #6b7280;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.5;
}
.workforce-strip .strip-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-right: 8px;
}
.workforce-strip .strip-figure {
  font-weight: 700;
  margin-right: 10px;
}
.workforce-strip .strip-figure.staff-thin     { color: #b45309; }
.workforce-strip .strip-figure.staff-very-thin{ color: #991b1b; }
.workforce-strip .strip-figure.staff-strong   { color: #047857; }
.workforce-strip .strip-context {
  color: var(--ink-soft);
}

/* Absence strip — same skeleton as exclusions / workforce strips.
   Fires only when persistent absence is above peer P75 (noticeably high).
   Suppressed for typical schools — detail card still renders. */

/* ── Specialist provision banner ──────────────────────────────────────────
   Shown when the school has a SEN unit or resourced provision unit.
   Amber-tinted, persistent — always shown when the flag is set because it
   fundamentally changes how all other data on the page should be read. */
.provision-banner {
  display: none;
  gap: 10px;
}
.provision-banner:not([hidden]) {
  display: flex;
  align-items: flex-start;
  margin: 14px 0 8px;
  padding: 10px 14px;
  background: #fffbeb;
  border-left: 3px solid #d97706;
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #78350f;
}
.provision-icon {
  flex-shrink: 0;
  font-size: 1rem;
  margin-top: 1px;
  color: #d97706;
}
.provision-text strong {
  font-weight: 600;
}

.absence-strip {
  margin: 14px 0 2px;
  padding: 10px 14px;
  background: #f8fafc;
  border-left: 3px solid var(--border);
  border-radius: 0 4px 4px 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0;
  font-size: 13.5px;
  line-height: 1.5;
}
.absence-strip .strip-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-right: 8px;
}
.absence-strip .strip-figure {
  font-weight: 700;
  margin-right: 10px;
}
.absence-strip .strip-figure.rate-elevated { color: #b45309; }
.absence-strip .strip-figure.rate-high     { color: #991b1b; }
.absence-strip .strip-context {
  color: var(--ink-soft);
}
.absence-strip .strip-perm {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  color: #92400e;
  font-weight: 600;
  font-size: 12.5px;
}
.absence-strip .strip-date {
  color: var(--ink-soft); font-size: 12px;
}

/* Neurodevelopmental cluster strip — fires when cluster ID or progression is below peers */
.cluster-strip {
  margin: 14px 0 2px;
  padding: 10px 14px;
  background: #f8fafc;
  border-left: 3px solid var(--border);
  border-radius: 0 4px 4px 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0;
  font-size: 13.5px;
  line-height: 1.5;
}
.cluster-strip .strip-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-right: 8px;
}
.cluster-strip .strip-figure {
  font-weight: 700;
  margin-right: 10px;
}
.cluster-strip .strip-figure.rate-elevated { color: #b45309; }
.cluster-strip .strip-figure.rate-high     { color: #991b1b; }
.cluster-strip .strip-context { color: var(--ink-soft); }
.cluster-strip .strip-date    { color: var(--ink-soft); font-size: 12px; }


/* Shared strip RAG left-border colours — applied as a class on the strip element */
.strip-rag-red     { border-left-color: #ef4444; }
.strip-rag-amber   { border-left-color: #f59e0b; }
.strip-rag-green   { border-left-color: #10b981; }
.strip-rag-neutral { border-left-color: var(--border); }

/* Cluster strip separator dot between eyebrow and flag items */
.cluster-strip .strip-sep { margin: 0 4px; color: var(--ink-soft); }

/* Workforce / Absence / Cluster / Exclusions detail cards */
#workforce-detail .wf-row,
#absence-detail .wf-row,
#cluster-detail .wf-row,
#exclusions-detail .wf-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  font-size: 14px;
}
#workforce-detail .wf-row:last-child,
#absence-detail .wf-row:last-child,
#cluster-detail .wf-row:last-child,
#exclusions-detail .wf-row:last-child { border-bottom: 0; }
#workforce-detail .wf-row .label,
#absence-detail .wf-row .label,
#cluster-detail .wf-row .label,
#exclusions-detail .wf-row .label { color: var(--ink); }
#workforce-detail .wf-row .value,
#absence-detail .wf-row .value,
#cluster-detail .wf-row .value,
#exclusions-detail .wf-row .value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
#workforce-detail .wf-row .vs-peers,
#absence-detail .wf-row .vs-peers,
#cluster-detail .wf-row .vs-peers,
#exclusions-detail .wf-row .vs-peers {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: right;
  min-width: 130px;
}
#workforce-detail .wf-row .vs-peers.good,
#absence-detail .wf-row .vs-peers.good,
#cluster-detail .wf-row .vs-peers.good,
#exclusions-detail .wf-row .vs-peers.good { color: #047857; }
#workforce-detail .wf-row .vs-peers.bad,
#absence-detail .wf-row .vs-peers.bad,
#cluster-detail .wf-row .vs-peers.bad,
#exclusions-detail .wf-row .vs-peers.bad  { color: #b45309; }
#workforce-detail .wf-row .vs-peers.very-bad,
#absence-detail .wf-row .vs-peers.very-bad,
#cluster-detail .wf-row .vs-peers.very-bad,
#exclusions-detail .wf-row .vs-peers.very-bad { color: #991b1b; }
#workforce-detail .wf-caveat,
#absence-detail .wf-caveat,
#cluster-detail .wf-caveat,
#exclusions-detail .wf-caveat {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-soft);
  font-style: italic;
}

/* Parent View detail card */
#parentview-detail .pv-headline {
  font-size: 18px; font-weight: 600; margin-bottom: 4px;
}
#parentview-detail .pv-headline.good { color: #047857; }
#parentview-detail .pv-headline.mid  { color: #b45309; }
#parentview-detail .pv-headline.bad  { color: #991b1b; }
#parentview-detail .pv-meta {
  font-size: 13px; color: var(--ink-soft); margin-bottom: 10px;
}
#parentview-detail .pv-row {
  display: grid; grid-template-columns: 1fr auto;
  padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
#parentview-detail .pv-row:last-child { border-bottom: 0; }
#parentview-detail .pv-row .label { color: var(--ink); }
#parentview-detail .pv-row .value { font-weight: 600; font-variant-numeric: tabular-nums; }
#parentview-detail .pv-caveat {
  margin-top: 12px; font-size: 12px; color: var(--ink-soft); font-style: italic;
}
.pv-trend-mini {
  display: flex; gap: 4px; align-items: end; height: 24px; margin-top: 6px;
}
.pv-trend-mini .bar {
  flex: 1; min-width: 10px; background: var(--accent-soft); border-radius: 2px 2px 0 0;
}
.pv-trend-mini .bar.cur { background: var(--accent); }
.pv-trend-mini .label-row { font-size: 10px; color: var(--ink-soft); }
.parentview-hero-line {
  margin-top: 8px; padding: 8px 12px; background: var(--accent-soft);
  border-radius: 6px; font-size: 13px;
}
.parentview-hero-line strong { color: var(--accent); }
.parentview-hero-line .meta { color: var(--ink-soft); font-size: 11px; }

/* ====== SEARCH refinements ============================================ */
#search {
  border-radius: var(--radius);
  font-size: 17px;
  padding: 14px 16px;
}
.search-wrap { margin-top: 36px; }

/* ====== HERO ========================================================== */
.hero-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hi);
  padding: 28px 32px;
  margin: 0 0 18px;
}
@media (max-width: 600px) {
  .hero-card { padding: 22px 18px; }
}

/* Always-on signal-not-verdict reminder. Visually low-key but present
   on every school page directly under the headline figure. */
.hero-disclaimer {
  margin: 10px 0 6px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-left: 3px solid var(--ink-soft);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.hero-disclaimer strong { color: var(--ink); }
.hero-disclaimer a { color: var(--accent); }
.hero-eyebrow-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.rag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.rag-pill::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.rag-pill.rag-green {
  color: #047857;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
}
.rag-pill.rag-amber {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
}
.rag-pill.rag-red {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}
.rag-pill.rag-grey {
  color: var(--ink-soft);
  background: #f1f3f7;
  border: 1px solid var(--line);
}
.hero-card h3 {
  margin: 6px 0 20px;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
}
.hero-figure {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.hero-figure .figure {
  font-size: 52px;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0;
  font-feature-settings: "tnum";  /* tabular numerals */
}
.hero-figure .figure-caption {
  font-size: 13px;
  color: var(--ink-soft);
}
@media (max-width: 600px) {
  .hero-figure .figure { font-size: 40px; }
  .hero-figure .figure-caption { font-size: 12px; }
}
.hero-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  background: rgba(30, 64, 175, 0.03);
  border-radius: 8px;
}

/* New layout: two-panel headlines */
.hero-headlines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 4px;
}
@media (max-width: 720px) {
  .hero-headlines { grid-template-columns: 1fr; }
}
.headline-panel {
  padding: 14px 16px;
  border-radius: 8px;
  background: #ffffff;
  border-left: 3px solid var(--line);
  border-top: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}
.headline-panel.panel-id { border-left-color: var(--la); }
.headline-panel.panel-prog { border-left-color: var(--accent); }
.headline-panel .panel-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.headline-panel .panel-figure {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: 0;
}
.headline-panel .panel-figure .panel-figure-suffix {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: 4px;
}
.headline-panel .panel-verdict {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.headline-panel .panel-verdict.v-good  { color: #047857; }
.headline-panel .panel-verdict.v-flat  { color: var(--ink); }
.headline-panel .panel-verdict.v-amber { color: #b45309; }
.headline-panel .panel-verdict.v-bad   { color: #991b1b; }
.headline-panel .panel-meta {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* Section heading inside hero */
.hero-section {
  margin-top: 18px;
}
.hero-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

/* Bulleted detail/caveat lists */
.hero-bullets {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}
.hero-bullets li {
  margin-bottom: 6px;
  color: var(--ink);
}
.hero-bullets li strong { font-weight: 600; }
.hero-bullets li .pill-inline {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}
.hero-bullets li .pill-inline.pill-bad  { background: #fee2e2; color: #991b1b; }
.hero-bullets li .pill-inline.pill-good { background: #d1fae5; color: #047857; }
.hero-bullets li .pill-inline.pill-amber{ background: #fef3c7; color: #92400e; }
.hero-bullets li .pill-inline.pill-flat { background: #f1f3f7; color: var(--ink-soft); }
.hero-bullets li small {
  color: var(--ink-soft);
  font-size: 12px;
}
.hero-caveats-list li {
  color: var(--ink-soft);
  font-size: 13px;
}

/* Interpretation block — "what this could mean" */
.hero-interpretation {
  display: grid;
  gap: 14px;
}
.hero-interpretation .interp {
  padding: 12px 14px;
  border-radius: 8px;
  background: #ffffff;
  border-left: 3px solid var(--line);
  border-top: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  line-height: 1.55;
}
.hero-interpretation .interp.interp-id   { border-left-color: var(--la); }
.hero-interpretation .interp.interp-prog { border-left-color: var(--accent); }
.hero-interpretation .interp.interp-pattern { border-left-color: #7c3aed; background: #f5f3ff; }
.hero-interpretation .interp-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.hero-interpretation .interp-lead {
  font-size: 14px;
  margin-bottom: 6px;
}
.hero-interpretation .interp-lead strong { color: var(--ink); }
.hero-interpretation ul.interp-options {
  margin: 6px 0 0;
  padding-left: 18px;
}
.hero-interpretation ul.interp-options li {
  font-size: 13.5px;
  margin-bottom: 4px;
}
.hero-interpretation ul.interp-options li strong { font-weight: 600; }
.hero-comparison .cmp {
  font-size: 13px;
}
.hero-comparison .cmp-label {
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.hero-comparison .cmp-value { font-weight: 600; font-size: 15px; }
.hero-comparison .cmp-rank  { color: var(--ink-soft); font-size: 11px; margin-top: 2px; }
.hero-comparison .delta { font-size: 12px; margin-left: 4px; font-weight: 500; }
.hero-comparison .delta.good { color: #047857; }
.hero-comparison .delta.bad  { color: #b91c1c; }
.hero-comparison .delta.flat { color: var(--ink-soft); }
.hero-comparison .cmp-ratio {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.hero-comparison .cmp-ratio strong { color: var(--ink); font-weight: 600; }
.hero-narrative {
  margin: 0;
  line-height: 1.55;
  color: var(--ink);
}
.hero-narrative strong { color: var(--accent); }

.hero-card.muted { border-left-color: var(--ink-soft); }
.hero-card.muted .hero-eyebrow,
.hero-card.muted .hero-figure .figure { color: var(--ink-soft); }

/* ====== DETAIL TOGGLE ================================================= */
.detail-toggle {
  margin: 8px 0;
}
.detail-toggle > summary {
  cursor: pointer;
  padding: 14px 20px;
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-weight: 500;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-toggle > summary::before {
  content: "▸";
  display: inline-block;
  color: var(--accent);
  transition: transform 0.15s;
}
.detail-toggle[open] > summary::before { transform: rotate(90deg); }
.detail-toggle > summary::-webkit-details-marker { display: none; }
.detail-toggle[open] > summary { margin-bottom: 16px; }

/* ====== GENERIC CARD =================================================== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20,25,46,.035), 0 8px 22px rgba(20,25,46,.06);
  padding: 22px 24px;
  margin-bottom: 16px;
  border: 1px solid var(--line-soft);
}
.card.no-padding { padding: 0; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .hint { color: var(--ink-soft); font-size: 12px; margin: 0 0 12px; }
.card .footnote { font-style: italic; margin-top: 12px; }

.chart-wrap { position: relative; height: 380px; width: 100%; }
@media (max-width: 700px) { .chart-wrap { height: 460px; } }

/* ====== HEADLINE TABLE ================================================ */
table.headline { width: 100%; border-collapse: collapse; }
table.headline th, table.headline td {
  padding: 10px 8px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
table.headline th:first-child, table.headline td:first-child { text-align: left; }
table.headline th {
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
table.headline tbody tr td:nth-child(2) { color: var(--accent); font-weight: 600; }
table.headline .delta {
  display: inline-block; margin-left: 4px; font-size: 11px; color: var(--ink-soft);
}
table.headline .delta.hi  { color: #b45309; }
table.headline .delta.low { color: #047857; }
table.headline .rank      { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

/* ====== FILTER BAR ==================================================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-bar select {
  font: inherit;
  padding: 6px 10px;
  margin-left: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  min-width: 280px;
}
.filter-bar .hint { margin: 0; }

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.seg {
  border: 1px solid var(--line); background: white; padding: 6px 10px;
  cursor: pointer; font: inherit;
}
.seg + .seg { margin-left: -1px; }
.seg:first-of-type { border-radius: 6px 0 0 6px; }
.seg:last-of-type  { border-radius: 0 6px 6px 0; }
.seg.active {
  background: var(--ink); color: white; border-color: var(--ink);
  position: relative; z-index: 1;
}

.trend-controls { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.trend-controls select { font: inherit; padding: 4px 6px; }
.trend-controls .cb { margin-right: 12px; }

/* ====== BANNERS ======================================================= */
.banner {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-bd);
  padding: 12px 16px;
  margin: 0 0 16px;
  border-radius: 6px;
  font-size: 14px;
}
.banner h4 { margin: 0 0 4px; font-size: 14px; }
.banner ul { margin: 6px 0 0 20px; padding: 0; }

/* ====== LA TAB ======================================================== */
/* LA-tab callout: framing the postcode-lottery context above the table.
   Visually meaningful but doesn't compete with the table — orange-bordered
   to match the warn/banner family elsewhere on the site. */
.la-callout {
  max-width: 1100px;
  margin: 0 auto 16px;
  padding: 16px 22px;
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-bd);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
}
.la-callout h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
}
.la-callout p { margin: 0 0 8px; color: var(--ink); }
.la-callout p:last-child { margin-bottom: 0; }

/* Interpretation-block pointer to the wider-system page. Sits at the end of
   the "what this could mean" section when something concerning rendered.
   Visually low-key but consistently coloured to read as a cross-reference. */
.interp-pointer {
  margin: 6px 0 0;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
}
.interp-pointer a { color: var(--accent); font-weight: 600; }

.la-controls {
  max-width: 1100px;
  margin: 0 auto 16px;
  padding: 0 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.la-controls input[type=search] {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 240px;
  font: inherit;
}
.la-controls .cb { font-size: 13px; color: var(--ink-soft); }
.la-controls .hint { margin: 0; color: var(--ink-soft); font-size: 13px; }
#tab-las .card {
  max-width: 1100px;
  margin: 0 auto 16px;
}

.la-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.la-table th, .la-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.la-table th.num, .la-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.la-table th {
  background: #f9fafc;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  cursor: pointer;
  user-select: none;
}
.la-table th.sortable::after { content: " ⇅"; opacity: 0.4; font-size: 10px; }
.la-table th.sortable.asc::after  { content: " ▲"; opacity: 1; }
.la-table th.sortable.desc::after { content: " ▼"; opacity: 1; }
.la-table tbody tr:hover { background: #fafbff; }
.la-table .la-name { font-weight: 600; }
.la-table .low-conf { color: var(--ink-soft); font-style: italic; }
.la-table .badge {
  display: inline-block;
  padding: 1px 6px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  color: #92400e;
  border-radius: 10px;
  font-size: 10px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}
.delta-hi  { color: #b45309; }
.delta-low { color: #047857; }

/* ====== ABOUT — sub-nav + sub-pages ==================================== */
/* About is now four sub-pages (Overview / Methodology / For parents / Wider system)
   inside one top-level tab, with a horizontal sub-nav. Stays inside the tab
   nav metaphor so the top tab row doesn't have to grow. */
.about-subnav {
  max-width: 760px;
  margin: 0 auto 20px;
  padding: 0 24px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE 11 */
}
.about-subnav::-webkit-scrollbar { display: none; } /* Chrome/Safari */
.about-subtab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}
.about-subtab:hover { color: var(--ink); }
.about-subtab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}
.about-subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.about-section { display: none; }
.about-section.active { display: block; }
@media (max-width: 720px) {
  .about-subnav { padding: 0 16px; }
  .about-subtab { padding: 10px 10px; font-size: 13px; }
}
@media (max-width: 520px) {
  .about-subnav {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 0;
  }
}

/* ====== ABOUT BODY ===================================================== */
.about-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
.about-body .lede {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.about-body .callout-strong {
  margin: 18px 0;
  padding: 14px 18px;
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-bd);
  border-radius: 6px;
  font-size: 14.5px;
  line-height: 1.6;
}
.about-body h3 { font-size: 17px; margin-top: 32px; margin-bottom: 8px; }
.about-body p { line-height: 1.65; }
.about-body ul.ul-prose, .about-body ol.ol-prose {
  padding-left: 22px;
  line-height: 1.65;
}
.about-body ul.ul-prose li, .about-body ol.ol-prose li {
  margin-bottom: 8px;
}
.about-body h4 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-top: 28px;
  margin-bottom: 8px;
}
.about-body .muted-note {
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}

/* FAQ accordion using native <details> */
.faq {
  margin: 12px 0 24px;
  border-top: 1px solid var(--line);
}
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.faq summary {
  cursor: pointer;
  padding: 14px 0 14px 28px;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  list-style: none;
  position: relative;
  line-height: 1.5;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 400;
  color: var(--accent);
  width: 20px;
  text-align: center;
  transition: transform 0.15s ease;
}
.faq details[open] summary::before {
  content: "−";
  transform: translateY(-50%) rotate(0);
}
.faq details[open] summary {
  color: var(--accent);
}
.faq details p, .faq details ul {
  padding-left: 28px;
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
}
.faq details ul.ul-prose {
  padding-left: 48px;
}

/* ====== FOOTER ======================================================== */
footer.src {
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 12px;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink-soft);
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 32px;
}
.site-footer a {
  color: var(--accent);
}
.site-footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}
.site-footer-brand strong {
  color: var(--ink);
  font-size: 18px;
}
.site-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.site-footer h2 {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}
.site-footer p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
}
.site-footer-contact {
  margin-top: 18px !important;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.site-footer-small {
  margin-top: 8px !important;
  font-size: 11.5px !important;
}
@media (max-width: 860px) {
  .site-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .site-footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ====== OVERVIEW / AT-A-GLANCE VIEW =================================== */

/* View toggle bar ---------------------------------------------------- */
.view-toggle-bar {
  display: flex;
  gap: 4px;
  padding: 10px 0 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.view-toggle-btn {
  padding: 7px 20px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  font-family: inherit;
}
.view-toggle-btn:hover {
  background: var(--accent-soft);
  color: var(--ink);
}
.view-toggle-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.view-toggle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Overview container ------------------------------------------------- */
#overview-view {
  padding-bottom: 8px;
}

/* Overview context banners (provision / trust) — appear above the KPI grid */
.overview-context-banners {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.overview-provision-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  border-radius: 7px;
  padding: 10px 13px;
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.45;
}
.overview-provision-notice strong { color: #78350f; }

.overview-trust-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--accent-soft-2);
  border: 1px solid #c7d7f0;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  padding: 10px 13px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.overview-trust-banner .otb-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 2px;
}
.overview-trust-banner .otb-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.overview-trust-banner .otb-meta { color: var(--ink-soft); }
.overview-trust-banner .otb-note { color: var(--ink-faint); font-size: 11.5px; margin-top: 3px; }

/* Row groups */
.overview-row {
  margin-bottom: 18px;
}

.overview-row-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 7px;
  padding-left: 2px;
}
.overview-row-subhead {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint, #aaa);
}

.overview-row-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

/* KPI box ------------------------------------------------------------ */
.kpi-box {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 13px 13px 11px;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: transform 0.12s, box-shadow 0.12s;
  font-family: inherit;
  min-height: 0;
}
.kpi-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}
.kpi-box:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* RAG states */
.kpi-rag-green   { border-left-color: #10b981; background: #f0fdf4; }
.kpi-rag-neutral { border-left-color: #94a3b8; background: #f8fafc; } /* above avg but not top quartile */
.kpi-rag-amber   { border-left-color: #f59e0b; background: #fffbeb; }
.kpi-rag-red     { border-left-color: #ef4444; background: #fef2f2; }
.kpi-rag-grey    { border-left-color: #cbd5e1; background: #fff; }

.kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1px;
  line-height: 1.3;
}

.kpi-sublabel {
  font-size: 10px;
  color: var(--ink-faint);
  line-height: 1.3;
  margin-bottom: 7px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.kpi-value.kpi-nodata {
  color: var(--ink-faint);
  font-size: 22px;
}
.kpi-value.kpi-text-value {
  font-size: 17px;
  font-weight: 700;
  align-items: flex-start;
}
.kpi-unit {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-soft);
}

.kpi-peer {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.35;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.07);
  padding-right: 16px;  /* room for arrow */
}
.kpi-box.kpi-rag-grey .kpi-peer {
  color: var(--ink-faint);
  font-style: italic;
}

.kpi-arrow {
  position: absolute;
  bottom: 10px;
  right: 11px;
  font-size: 13px;
  color: var(--ink-faint);
  opacity: 0.4;
  transition: opacity 0.1s, transform 0.1s;
  pointer-events: none;
}
.kpi-box:hover .kpi-arrow {
  opacity: 0.9;
  transform: translateX(2px);
}

/* Narrative sections ------------------------------------------------- */
.overview-narratives {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 6px 0 14px;
}

.overview-narrative {
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 14px 15px 12px;
}

.overview-narrative h5 {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 7px;
  line-height: 1.4;
}

.overview-narrative p {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 8px;
}
.overview-narrative p:last-of-type {
  margin-bottom: 0;
}

.overview-narrative .see-detail {
  display: inline-block;
  font-size: 11.5px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-top: 6px;
}
.overview-narrative .see-detail:hover {
  text-decoration: underline;
}

.overview-disclaimer {
  font-size: 11px;
  color: var(--ink-faint);
  margin: 2px 0 16px;
  line-height: 1.5;
}

/* ====== SNAPSHOT CARD ================================================= */

.card-snapshot h3 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.snapshot-stat {
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 10px 14px;
}
.snapshot-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.snapshot-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-top: 3px;
}
.snapshot-stat-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.snapshot-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin: 14px 0 6px;
}

.snapshot-needs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 2px;
}
.snapshot-needs-table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-align: left;
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--line);
}
.snapshot-needs-table td {
  padding: 5px 8px 5px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
.snapshot-needs-table td:first-child {
  color: var(--ink);
}
.snapshot-needs-table tr:last-child td {
  border-bottom: none;
}

.snapshot-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.snapshot-fact-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.snapshot-fact-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.snapshot-stale {
  font-size: 11px;
  color: var(--warn-bd);
}

/* ====== SIGNALS SUMMARY CARD ========================================= */

.card-signals {
  border-left: 4px solid var(--accent);
}
.card-signals-alert {
  border-left-color: #c0392b;
  background: #fef9f9;
}
.card-signals-amber {
  border-left-color: var(--warn-bd);
  background: var(--warn-bg);
}
.card-signals-neutral {
  border-left-color: var(--line);
  background: var(--bg-soft);
}

.signals-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.signals-body p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.signals-body p:last-child {
  margin-bottom: 0;
  font-size: 12px;
  color: var(--ink-faint);
  font-style: italic;
}

/* ====== 9-METRIC EXPLAINER TABLE ====================================== */

.metric-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  margin: 0 0 24px;
}
.metric-explainer {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}
.metric-explainer th {
  background: var(--bg-soft);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.metric-explainer td {
  padding: 8px 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
.metric-explainer td:first-child {
  color: var(--ink);
  white-space: nowrap;
}
.metric-group-head td {
  background: var(--bg-soft);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding: 6px 10px;
  border-top: 2px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ====== DETAIL SECTION HEADERS ======================================= */

.detail-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 28px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
}
.detail-section-head > span:first-child {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.detail-section-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: 0;
  text-transform: none;
}

/* ====== RESPONSIVE ==================================================== */

@media (max-width: 680px) {
  .snapshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .overview-row-boxes {
    grid-template-columns: repeat(2, 1fr);
  }
}
