/* ===== Tokens ===== */
:root {
  --bg: #fff; --ink: #101828; --muted: #667085; --line: #e4e7ec; --soft: #f5f7fb;
  --navy: #1d2d5c; --coral: #ff7a59; --teal: #0e9384;
  --radius: 12px;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }
section.wrap { padding-block: 26px; }
h1, h2 { font-family: var(--serif); font-weight: 400; color: var(--navy); margin: 0 0 6px; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.05; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
.sub { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--coral); font-weight: 600; margin: 0 0 10px; }
code { background: var(--soft); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 20; background: #ffffffee; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-family: var(--serif); font-size: 1.3rem; color: var(--navy); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--coral); }
.agent { font-size: 13px; color: var(--muted); padding-left: 18px; border-left: 1px solid var(--line); }
.burger { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 10px; cursor: pointer; }
.burger span { display: block; height: 2px; background: var(--navy); margin: 5px 0; transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero / banner ===== */
.hero { padding-block: 36px 8px; }
.lede { font-size: 17px; max-width: 60ch; color: #344054; }
.banner { background: #fff4ed; border: 1px solid #ffd6c2; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-top: 14px; max-width: 70ch; }

/* ===== Tiles ===== */
.status { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile { padding: 16px; border-right: 1px solid var(--line); }
.tile:last-child { border-right: 0; }
.tile .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tile .v { font-size: 24px; font-weight: 700; color: var(--navy); }
.tile .n { font-size: 12px; color: var(--muted); }

/* ===== Filters / chips ===== */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 13px; border: 1px solid #d0d5dd; background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.chip small { color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip[aria-pressed="true"] small { color: #cbd5ff; }
.select { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #344054; }
.select select { font: inherit; padding: 7px 10px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; }

/* ===== Chart ===== */
.chart-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 8px; margin-bottom: 16px; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-box .grid { stroke: #eceff4; }
.chart-box .axis { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart-box .med { fill: none; stroke: var(--coral); stroke-width: 2.5; stroke-linejoin: round; }
.chart-box .empty { fill: var(--muted); font-size: 13px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 0 0; margin: 0; font-size: 12px; color: #344054; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend i.line { width: 16px; height: 3px; border-radius: 2px; background: var(--coral); }

/* ===== Table ===== */
.table-scroll { overflow: auto; max-height: 60vh; border: 1px solid var(--line); border-radius: var(--radius); }
table.tx { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.tx th, .tx td { padding: 9px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid #f0f2f6; }
.tx th:first-child, .tx td:first-child { text-align: left; }
.tx td.l, .tx th.l { text-align: left; }
.tx thead th { position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; }
.tx thead th[aria-sort="ascending"]::after { content: " ▲"; color: var(--navy); }
.tx thead th[aria-sort="descending"]::after { content: " ▼"; color: var(--navy); }
.tx tbody tr:hover { background: var(--soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.tag { font-size: 11px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }

/* ===== Buyer bars ===== */
.bars { display: grid; gap: 12px; max-width: 720px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 80px; gap: 12px; align-items: center; font-size: 14px; }
.bar-track { height: 12px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .35s; }
.bar-row .pct { text-align: right; color: var(--muted); font-size: 13px; }

/* ===== Schools ===== */
.schools { list-style: none; padding: 0; margin: 14px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.schools li { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.schools li:last-child { border-bottom: 0; }
.schools .nm { font-weight: 600; }
.schools .lv { color: var(--muted); font-size: 13px; }
.schools .ds { margin-left: auto; font-weight: 600; color: var(--navy); }
.schools .near { font-size: 11px; background: #e7f6f3; color: #0b6b60; border-radius: 999px; padding: 2px 9px; }

.site-footer { border-top: 1px solid var(--line); margin-top: 30px; padding: 24px 0 40px; background: var(--soft); }
.fine { font-size: 12px; color: var(--muted); max-width: 70ch; }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .burger { display: block; }
  .nav { position: absolute; top: 60px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: flex-start; gap: 0; border-bottom: 1px solid var(--line); max-height: 0; overflow: hidden; transition: max-height .25s; }
  .nav.open { max-height: 320px; }
  .nav a, .agent { padding: 14px 16px; width: 100%; border: 0; border-top: 1px solid var(--line); }
  .tile { border-right: 0; border-bottom: 1px solid var(--line); }
  .bar-row { grid-template-columns: 90px 1fr 64px; }
  .schools li { flex-wrap: wrap; }
}
