/* Idaho Education Finance — layout.
   All color, type and radius come from styles/theme.css (ledger) tokens.
   Macrostructure: persistent chapter rail + single reading column, mirroring
   the Quarto book's docked sidebar so existing readers keep their bearings. */

*, *::before, *::after { box-sizing: border-box; }

.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-contrast);
  padding: .6rem 1rem; border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; }

body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); }

/* ── shell ─────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 288px minmax(0, 1fr); min-height: 100vh; }

/* ── rail ──────────────────────────────────────────────────────────── */
.rail {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
}
.rail-head { padding: 1.15rem 1.1rem .85rem; border-bottom: 1px solid var(--border); }
.rail-kicker {
  font-size: .625rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; line-height: 1.4;
}
.rail-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.28rem;
  line-height: 1.14; margin-top: .3rem; color: var(--accent);
}
.rail-sub { font-size: .74rem; color: var(--muted); margin-top: .28rem; }

.rail-search { padding: .7rem .85rem; border-bottom: 1px solid var(--border); }
.rail-search input {
  width: 100%; font: inherit; font-size: .82rem; padding: .42rem .6rem;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg); color: var(--text);
}
.rail-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.rail-list { flex: 1; overflow-y: auto; padding: .45rem 0 1rem; }
.rail-part {
  font-size: .625rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  padding: .95rem 1.1rem .3rem;
}
.rail-item {
  display: flex; align-items: baseline; gap: .5rem; width: 100%;
  text-align: left; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: .83rem; line-height: 1.3;
  color: var(--text); padding: .36rem 1.1rem .36rem .95rem;
  border-left: 3px solid transparent;
}
.rail-item:hover { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.rail-item[aria-current="true"] {
  border-left-color: var(--accent); font-weight: 600;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.rail-item .dot {
  flex: none; width: 5px; height: 5px; border-radius: 50%;
  background: var(--warn); margin-top: .45rem;
}
.rail-foot { padding: .7rem .85rem; border-top: 1px solid var(--border); }

.ghost {
  font: inherit; font-size: .78rem; cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: 5px;
  padding: .38rem .7rem; color: var(--text);
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── main ──────────────────────────────────────────────────────────── */
.main { min-width: 0; padding: 2.1rem 2.4rem 4rem; }
.chapter { max-width: 62rem; }
.loading { color: var(--muted); }

.crumb {
  font-size: .68rem; letter-spacing: .085em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.chapter h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.1;
  margin: .3rem 0 .5rem; color: var(--text);
}
.statute { font-size: .9rem; margin: 0 0 1.1rem; }
.statute a { color: var(--accent); font-weight: 600; }
.chapter h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.22rem;
  margin: 2.4rem 0 .3rem; color: var(--text);
  padding-bottom: .35rem; border-bottom: 1px solid var(--border);
}
.section-note { font-size: .85rem; color: var(--muted); margin: .45rem 0 .9rem; }
.prose { font-size: .95rem; line-height: 1.65; margin: 0 0 1.3rem; max-width: 46rem; }

/* ── signature element: header metrics band ────────────────────────── */
.metrics {
  display: grid; grid-template-columns: 1fr 1px 1fr; gap: 0 1.9rem;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0; padding: 1.05rem 1.3rem; margin: 0 0 1.5rem;
}
.metrics .rule { background: var(--border); }
.metric-group-title {
  font-size: .625rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: .6rem;
}
.metric-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: .21rem 0; font-size: .88rem;
}
.metric-row .k { color: var(--muted); }
.metric-row .v {
  font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.metric-row .delta { font-weight: 400; color: var(--muted); font-size: .82em; }
@media (max-width: 800px) {
  .metrics { grid-template-columns: 1fr; gap: 1.1rem; }
  .metrics .rule { height: 1px; }
}

/* ── flags ─────────────────────────────────────────────────────────── */
.flag {
  display: flex; gap: .6rem; align-items: flex-start;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border));
  background: color-mix(in srgb, var(--warn) 8%, var(--surface));
  border-left: 4px solid var(--warn);
  border-radius: 0 6px 6px 0; padding: .75rem 1rem;
  font-size: .85rem; line-height: 1.5; margin: 0 0 1.4rem;
}
.flag strong { color: var(--warn); }

/* ── charts ────────────────────────────────────────────────────────── */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart .bar { transition: opacity .12s ease; }
.chart .bar:hover { opacity: .78; }
.chart .lbl {
  fill: var(--text); font-size: 10.5px; font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}
.legend {
  display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem;
  color: var(--muted); margin: .55rem 0 0;
}
.legend span { display: inline-flex; align-items: center; gap: .38rem; }
.legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

/* ── Public School Demographics ─────────────────────────────────────── */
.demographics-kpis {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  background: var(--panel); border-radius: 0 6px 6px 0;
  margin: 0 0 1.35rem;
}
.demo-kpi { padding: .95rem 1rem; min-width: 0; }
.demo-kpi + .demo-kpi { border-left: 1px solid var(--border); }
.demo-kpi-label {
  color: var(--muted); font-size: .625rem; letter-spacing: .085em;
  text-transform: uppercase; font-weight: 700;
}
.demo-kpi-value {
  color: var(--accent); font-family: var(--font-display); font-weight: 700;
  font-size: 1.55rem; line-height: 1.15; margin: .28rem 0 .1rem;
  font-variant-numeric: tabular-nums;
}
.demo-kpi-note { color: var(--muted); font-size: .75rem; line-height: 1.35; }
@media (max-width: 1100px) {
  .demographics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-kpi:nth-child(odd) { border-left: 0; }
  .demo-kpi:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 540px) {
  .demographics-kpis { grid-template-columns: 1fr; }
  .demo-kpi + .demo-kpi { border-left: 0; border-top: 1px solid var(--border); }
}
.line-chart .line-end {
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.line-chart .axis-note {
  fill: var(--muted); font-family: var(--font-body); font-size: 10.5px;
}
.staff-small-multiples {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem; align-items: start; margin: .3rem 0 .55rem;
}
.staff-figure {
  margin: 0; padding: .75rem .75rem .35rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  min-width: 0;
}
.staff-figure h3 {
  font-family: var(--font-display); font-size: .98rem; line-height: 1.25;
  margin: 0 0 .2rem; color: var(--text);
}
.staff-small-multiples { grid-template-columns: 1fr; }
.staff-figure .chart { overflow-x: auto; }
.figure-key { color: var(--muted); font-size: .8rem; margin: .4rem 0 1rem; }
.methods {
  margin: 1.4rem 0 0; border: 1px solid var(--border);
  background: var(--panel); border-radius: 6px;
}
.methods > summary {
  cursor: pointer; list-style: none; padding: .75rem 1rem;
  color: var(--accent); font-weight: 700; font-size: .86rem;
}
.methods > summary::-webkit-details-marker { display: none; }
.methods > summary::before { content: "\25B8  "; }
.methods[open] > summary::before { content: "\25BE  "; }
.methods-body { padding: 0 1rem .9rem; }
.methods-body p { margin: .55rem 0; font-size: .84rem; line-height: 1.55; }
@media (max-width: 900px) { .staff-small-multiples { grid-template-columns: 1fr; } }

/* ── tables ────────────────────────────────────────────────────────── */
.table-tools {
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
  margin: .1rem 0 .7rem;
}
.table-tools input[type="search"] {
  font: inherit; font-size: .82rem; padding: .36rem .55rem;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface); color: var(--text); min-width: 14rem;
}
.table-tools .count { font-size: .78rem; color: var(--muted); margin-left: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .855rem; }
table.data th, table.data td { padding: .44rem .8rem; text-align: left; }
table.data thead th {
  position: sticky; top: 0; z-index: 1;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-bottom: 1px solid var(--border);
  font-size: .68rem; letter-spacing: .07em; text-transform: uppercase;
  font-weight: 700; color: var(--accent); cursor: pointer; white-space: nowrap;
}
table.data thead th[data-sorted]::after { content: " \25B4"; }
table.data thead th[data-sorted="desc"]::after { content: " \25BE"; }
table.data tbody tr + tr td { border-top: 1px solid var(--border); }
table.data tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.flagcell { color: var(--warn); font-size: .78rem; }
/* Identifier columns carry a short integer and should not claim a full slot. */
table.data td.idcell, table.data th.idcell {
  text-align: right; font-variant-numeric: tabular-nums;
  width: 1%; white-space: nowrap; padding-left: .55rem; padding-right: .55rem;
  color: var(--muted); font-size: .8rem;
}
.scroll-body { max-height: 30rem; overflow-y: auto; }

/* ── map ───────────────────────────────────────────────────────────── */
.map-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(210px, 1fr); gap: 1.1rem; align-items: start; }
@media (max-width: 900px) { .map-grid { grid-template-columns: 1fr; } }
.map { height: 520px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.leaflet-container { background: var(--surface); font-family: var(--font-body); }
.map-side { display: flex; flex-direction: column; gap: .85rem; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: .8rem .9rem;
}
.card h3 {
  font-size: .655rem; letter-spacing: .085em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin: 0 0 .55rem;
}
.swatches { display: flex; flex-direction: column; gap: .28rem; font-size: .8rem; }
.swatches div { display: flex; align-items: center; gap: .45rem; }
.swatches i { width: 15px; height: 11px; border-radius: 2px; border: 1px solid rgba(0,0,0,.16); flex: none; }
.swatches span { font-variant-numeric: tabular-nums; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.seg button {
  flex: 1; font: inherit; font-size: .76rem; padding: .34rem .3rem;
  background: var(--surface); border: 0; cursor: pointer; color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.lea-pop { font-size: .82rem; line-height: 1.45; }
.lea-pop b { font-family: var(--font-display); font-size: .95rem; display: block; margin-bottom: .2rem; }
.lea-pop dl { display: grid; grid-template-columns: auto auto; gap: .1rem .7rem; margin: .25rem 0 0; }
.lea-pop dt { color: var(--muted); }
.lea-pop dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ── drawer ────────────────────────────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(20,18,14,.32); }
.drawer-panel {
  position: relative; width: min(38rem, 100%); background: var(--surface);
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
  box-shadow: -12px 0 32px rgba(20,18,14,.13);
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border);
}
.drawer-head h2 { font-family: var(--font-display); font-size: 1.1rem; margin: 0; }
.drawer-body { overflow-y: auto; padding: 1.1rem 1.2rem 2rem; font-size: .88rem; line-height: 1.55; }
.qc-item { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.qc-item:last-child { border-bottom: 0; }
.qc-id {
  display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .06em;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent); padding: .1rem .38rem; border-radius: 3px; margin-right: .5rem;
}
.qc-item.resolved .qc-id { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }

.footnote {
  margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border);
  font-size: .78rem; color: var(--muted); line-height: 1.55; max-width: 46rem;
}

/* ── motion ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ── print ─────────────────────────────────────────────────────────── */
@media print {
  .rail, .table-tools, .seg, .drawer, .skip { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .chapter { max-width: none; }
  .scroll-body { max-height: none; overflow: visible; }
  .map-grid { grid-template-columns: 1fr; }
  .map { height: 340px; page-break-inside: avoid; }
  table.data { font-size: .72rem; }
  .metrics, .flag, .card { page-break-inside: avoid; }
}

/* Sequential choropleth ramp, derived from the theme accent so no color
   is introduced outside theme.css. Read from JS via getComputedStyle. */
:root {
  --ramp-0: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --ramp-1: color-mix(in srgb, var(--accent) 30%, var(--surface));
  --ramp-2: color-mix(in srgb, var(--accent) 45%, var(--surface));
  --ramp-3: color-mix(in srgb, var(--accent) 60%, var(--surface));
  --ramp-4: color-mix(in srgb, var(--accent) 80%, var(--surface));
  --ramp-5: var(--accent);
  --ramp-none: color-mix(in srgb, var(--muted) 14%, var(--surface));
}

/* Chapters whose page is not yet rebuilt read as muted, not as warnings. */
.rail-item.todo { color: var(--muted); }
.rail-item.todo::after {
  content: "pending"; margin-left: auto; font-size: .58rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); opacity: .75; padding-left: .5rem;
}

/* Chart titles, axis titles and in-chart legends, matching the published charts. */
.chart .chart-title {
  fill: var(--accent); font-family: var(--font-display); font-weight: 700;
  font-size: 17px;
}
.chart .chart-legend {
  fill: var(--accent); font-family: var(--font-body); font-weight: 600; font-size: 12px;
}
.chart .chart-axis-title {
  fill: var(--accent); font-family: var(--font-body); font-weight: 600; font-size: 12px;
}
.chart .axis .pole {
  font-weight: 700; font-size: 11.5px; fill: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.chart .axis .pole-zero { font-weight: 700; font-size: 10.5px; fill: var(--text); }

/* Metric radio group on the map, matching the published map's radio layers. */
.radios { display: flex; flex-direction: column; gap: .3rem; }
.radio {
  display: flex; align-items: center; gap: .45rem;
  font-size: .82rem; cursor: pointer; color: var(--text);
}
.radio input { accent-color: var(--accent); margin: 0; }

/* An intentional published figure, distinct from a warning. */
.flag.flag-note {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border-left-color: var(--accent);
}
.flag.flag-note strong { color: var(--accent); }
.qc-item.intent .qc-id {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent);
}
.qc-item.review .qc-id {
  background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn);
}

/* ── tab sets, mirroring Quarto's .panel-tabset ─────────────────────────── */
.tabset { margin: .2rem 0 0; }
.tablist {
  display: flex; gap: .2rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 1.1rem;
}
.tab {
  font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
  background: none; border: 1px solid transparent; border-bottom: 0;
  border-radius: 5px 5px 0 0; padding: .45rem .95rem;
  color: var(--muted); margin-bottom: -1px;
}
.tab:hover { color: var(--accent); }
.tab[aria-selected="true"] {
  color: var(--accent); background: var(--surface);
  border-color: var(--border); border-bottom-color: var(--surface);
}
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tabpanel[hidden] { display: none; }

/* ── definitions accordion, from the 10-Year tab ────────────────────────── */
.definitions {
  background: var(--panel, var(--surface)); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 0 5px 5px 0;
  padding: .6rem .9rem; margin: 0 0 1.1rem;
}
.definitions summary {
  font-weight: 700; color: var(--accent); cursor: pointer;
  font-size: .85rem; list-style: none;
}
.definitions summary::-webkit-details-marker { display: none; }
.definitions summary::before { content: "\25B8 "; }
.definitions[open] summary::before { content: "\25BE "; }
.definitions-body {
  margin-top: .6rem; font-size: .86rem; line-height: 1.6; color: var(--text);
}
.definitions-body p { margin: 0 0 .5rem; }
.definitions-body p:last-child { margin-bottom: 0; }

/* ── instruction box above each map ─────────────────────────────────────── */
.instruction-box {
  background: var(--panel, var(--surface)); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 0 5px 5px 0;
  padding: .7rem 1rem; margin: 0 0 1rem;
}
.instruction-title {
  font-size: .655rem; letter-spacing: .085em; text-transform: uppercase;
  font-weight: 700; color: var(--accent); margin-bottom: .4rem;
}
.instruction-list { margin: 0; padding-left: 1.1rem; font-size: .85rem; line-height: 1.55; }
.instruction-list li { margin: .12rem 0; }
.card-note { font-size: .8rem; line-height: 1.5; color: var(--muted); margin: 0; }
.county-tip { font-size: .78rem; }

/* ── Executive Summary: hero, intro, notice, definitions, feature grid ───── */
.hero-banner {
  display: flex; align-items: center; gap: 2rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--brand-navy-2) 100%);
  color: #ffffff; padding: 2.2rem 2.4rem; border-radius: 8px;
  margin: 0 0 1.8rem; box-shadow: 0 4px 10px rgba(0,0,0,.15);
}
.hero-logo { height: 92px; width: auto; flex: none; }
.hero-text { flex: 1; min-width: 0; }
.hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.18;
  letter-spacing: .01em; margin-bottom: .5rem;
}
.hero-subtitle { font-size: 1.02rem; line-height: 1.6; opacity: .95; max-width: 56rem; }
@media (max-width: 720px) {
  .hero-banner { flex-direction: column; align-items: flex-start; gap: 1.1rem; }
  .hero-logo { height: 68px; }
}

.intro-box {
  background: var(--panel); border-left: 5px solid var(--accent);
  border-radius: 0 6px 6px 0; padding: 1.1rem 1.3rem; margin: 0 0 1.4rem;
  font-size: .97rem; line-height: 1.65;
}
.intro-box p { margin: 0 0 .8rem; }
.intro-box p:last-child { margin-bottom: 0; }

.notice {
  background: var(--panel); border-left: 5px solid var(--chart-2);
  border-radius: 0 6px 6px 0; padding: .9rem 1.2rem; margin: 0 0 1.6rem;
  font-size: .93rem; line-height: 1.62;
}

dl.terms { margin: .3rem 0 0; }
dl.terms dt {
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  color: var(--accent); margin-top: 1rem;
}
dl.terms dd {
  margin: .25rem 0 0; padding-left: 1.1rem;
  border-left: 2px solid var(--border);
  font-size: .93rem; line-height: 1.62; max-width: 46rem;
}

.grid-container {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 1.3rem; margin-top: 1.4rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--brand-card-edge); border-left: 6px solid var(--chart-4);
  border-radius: 0 8px 8px 0; padding: 1.05rem 1.15rem;
  transition: transform .14s ease, box-shadow .14s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 15px rgba(0,0,0,.09); }
.feature-icon { display: block; color: var(--accent); margin-bottom: .55rem; }
.feature-icon svg { width: 24px; height: 24px; display: block; }
.feature-title {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 1.02rem; color: var(--text); margin-bottom: .35rem;
}
.feature-desc { font-size: .89rem; line-height: 1.55; color: var(--muted); }

ul.contact { margin: .3rem 0 1.1rem; padding-left: 1.15rem; font-size: .95rem; line-height: 1.75; }

/* ── Statewide Overview + K12 Primer ──────────────────────────────────────
   His pages wrap most sections in a bordered panel and use two-column grids
   with a colored left rule. Colors come from brand.css only.             */
.panel {
  border: 1px solid var(--brand-card-edge);
  background: var(--panel);
  border-radius: 8px;
  padding: 1.25rem 1.4rem;
  margin: 0 0 1.5rem;
}
.panel > p:first-child { margin-top: 0; }
.panel > p:last-child { margin-bottom: 0; }

.const-quote {
  border-left: 3px solid var(--chart-1);
  background: var(--page);
  margin: .9rem 0;
  padding: .75rem 1rem;
  font-family: var(--font-serif, inherit);
}
.const-quote p { margin: 0; }

.two-col {
  display: grid;
  grid-template-columns: 1fr minmax(210px, 300px);
  gap: 1.6rem;
  align-items: center;
}
.two-col.two-col-top { align-items: start; }
.two-col-top > div > p:first-child { margin-top: 0; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin: 1.1rem 0; }
@media (max-width: 700px) { .split { grid-template-columns: 1fr; } }
.split-col { padding-left: 1rem; border-left: 4px solid var(--divider); }
.split-navy { border-left-color: var(--chart-1); }
.split-gold { border-left-color: var(--chart-4); }
.split-title { font-weight: 650; margin-bottom: .1rem; }
.split-sub { font-size: .82rem; color: var(--muted); font-style: italic; margin-bottom: .5rem; }
.split-list { margin: .4rem 0 0; padding-left: 1.2rem; }
.split-list li { margin: .25rem 0; }

.callout {
  border: 1px solid var(--brand-card-edge);
  border-left: 4px solid var(--chart-1);
  border-radius: 6px;
  background: var(--page);
  padding: .9rem 1rem;
  margin: 1.1rem 0;
}
.callout-title { font-weight: 650; margin-bottom: .6rem; }

/* PDF report + full-table disclosure */
.pdf-embed, .full-table {
  border: 1px solid var(--brand-card-edge);
  border-radius: 6px;
  background: var(--panel);
  margin: 1.1rem 0;
}
.pdf-embed > summary, .full-table > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .8rem 1rem;
  font-weight: 650;
  color: var(--chart-1);
}
.pdf-embed > summary::-webkit-details-marker,
.full-table > summary::-webkit-details-marker { display: none; }
.pdf-embed > summary svg, .full-table > summary svg { width: 18px; height: 18px; flex: none; }
.pdf-embed > summary span, .full-table > summary span { border-bottom: 1px dashed currentColor; }
.pdf-embed > summary:hover span, .full-table > summary:hover span { border-bottom-style: solid; }
.pdf-body, .full-table-body { padding: 0 1rem 1rem; }
.pdf-body iframe { width: 100%; height: 760px; border: 0; border-radius: 4px; background: var(--page); }

/* FY25/FY26 snapshot: sections, indented items, subtotals, grand total */
table.snapshot td, table.snapshot th { white-space: nowrap; }
/* a wide snapshot table may let its label column wrap (SDFF uses, R76) */
table.snapshot.wrap-labels td.snap-label,
table.data.snapshot.wrap-labels.frz-table td.snap-label { white-space: normal; min-width: 14rem; }
table.snapshot .snap-label { white-space: normal; }
tr.snap-section td { font-weight: 700; background: var(--page); }
tr.snap-item .snap-label { padding-left: 2rem; }
tr.snap-subtotal td { font-weight: 700; border-top: 1px solid var(--divider); background: var(--page); }
tr.snap-total td { font-weight: 700; border-top: 2px solid var(--chart-1); background: var(--page); }
tr.snap-blank td { padding: .28rem 0; border: 0; background: transparent; }

table.chapters .chap-num { white-space: nowrap; width: 12%; }
table.chapters .chap-head { width: 22%; }
table.compact-table { font-size: .9rem; }
table.compact-table thead th { white-space: normal; vertical-align: bottom; line-height: 1.35; }

/* ── Negative figures ───────────────────────────────────────────────────────
   Accounting presentation: parentheses instead of a leading minus, in the style
   guide's #882255 (--danger in brand.css, the same value the PESF withdrawal
   traces use). The parentheses come from the number formatters in app.js; this
   rule only supplies the color, so a negative reads the same in a table cell,
   a metric tile, a chart label and the QC drawer. No new color is introduced. */
.neg { color: var(--danger); }
td.neg, th.neg { font-variant-numeric: tabular-nums; }
text.neg, tspan.neg { fill: var(--danger); }

/* Table figures (LSO, 2026-10-06): headers centered, figures right aligned in a
   block as wide as the column's longest figure, the block centered in the cell. */
table.data td .fig { display: inline-block; text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums; }

/* ── Student Performance ───────────────────────────────────────────── */
.perf-info td { vertical-align: top; font-size: .84rem; line-height: 1.5; white-space: normal; }
.perf-info td:first-child { min-width: 11rem; }
.perf-info td:nth-child(2) { min-width: 20rem; }
.perf-trends {
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0; background: var(--panel, var(--surface));
  padding: .8rem 1.1rem; margin: 1rem 0 1.4rem; max-width: 60rem;
}
.perf-trends h3 {
  font-size: .655rem; letter-spacing: .085em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 .45rem;
}
.perf-trends ul { margin: 0; padding-left: 1.1rem; font-size: .88rem; line-height: 1.6; }
.perf-trends li { margin: .25rem 0; }
.perf-info th, .perf-info td { text-align: left !important; }
.perf-info td:nth-child(3) { min-width: 12rem; }
.perf-info td:nth-child(4) { min-width: 12rem; }
.demo-kpi-note { white-space: normal; }
.perf-dt td:first-child, .perf-dt th:first-child { white-space: nowrap; }
.perf-dt td:nth-child(2) { white-space: nowrap; }
.perf-dt td:nth-child(3) { white-space: nowrap; }

/* ── frozen row headers (LSO, 2026-10-08) ─────────────────────────────
   The leading label column(s) stick to the left edge when a table scrolls
   sideways, matching the header row that sticks to the top. */
table.frz-table :where(td.frz, th.frz) { position: sticky; left: 0; }
table.frz-table :where(td.frz) { z-index: 2; background: var(--surface); }
table.frz-table thead th.frz { z-index: 3; }
table.frz-table.frz-scrolled .frz-last { box-shadow: inset -1px 0 0 var(--border), 4px 0 6px -4px rgba(0,0,0,.18); }

/* ── LEA type filter buttons (R56) ─────────────────────────────────── */
.type-filter { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; margin: .2rem 0 .55rem; }
.type-filter-label { font-size: .78rem; color: var(--muted); margin-right: .1rem; }
.type-chip {
  font: 600 .8rem/1 var(--font-body, inherit); padding: .42rem .8rem; border-radius: 999px;
  border: 1px solid var(--border-strong, var(--border)); background: var(--surface); color: var(--muted);
  cursor: pointer;
}
.type-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast, #fff); }
.type-chip:hover { border-color: var(--accent); }
.type-chip[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }

/* ── header text wraps so tables need less sideways scrolling (R56) ── */
table.data thead th { white-space: normal; vertical-align: bottom; line-height: 1.3; }
table.data thead th.num, table.data thead th.idcell { min-width: 5.5rem; }
table.data thead th.idcell { min-width: 0; }
/* LEA names stay on one line on wider screens now that headers wrap. */
@media (min-width: 801px) { table.frz-table td.frz-last:not(.idcell) { white-space: nowrap; } }
.nowrap { white-space: nowrap; }
/* Primer support unit table sits above the text (R57). */
.su-table { max-width: 30rem; margin: 0 0 1.2rem; }
.su-table .footnote { margin-top: .6rem; padding-top: .5rem; }

/* Under construction notice (R62) */
.under-construction {
  border: 1px solid var(--border); border-left: 6px solid var(--accent);
  background: var(--panel); border-radius: 0 6px 6px 0;
  padding: 1.6rem 1.5rem; margin: .5rem 0 1.5rem;
}
.under-construction .uc-title {
  font-family: var(--font-display); font-weight: 700; color: var(--accent);
  font-size: 2.1rem; line-height: 1.1; margin-bottom: .6rem;
}
.under-construction .uc-text { font-size: 1.2rem; line-height: 1.5; margin: 0; }

/* visually hidden, still read by screen readers (table captions, R70) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
ul.prose { margin: 0 0 1rem; padding-left: 1.4rem; }
ul.prose li { margin: .15rem 0; }

/* Use notice (AI and machine learning restriction) */
.use-notice{max-width:72ch;margin:2.5rem 0 0;padding-top:1rem;border-top:1px solid var(--border);font-size:.8rem;line-height:1.5;color:var(--muted)}
.use-notice strong{color:inherit}
