/* self-hosted variable fonts (latin subset) */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/content/fonts/Nunito.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700 800; font-display: swap; src: url(/content/fonts/PlusJakartaSans.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Friendly-and-clear design: rounded cards, teal brand, Plus Jakarta Sans display + Nunito body. No framework.
   Spacing scale: --s1 .5rem, --s2 1rem, --s3 1.5rem, --s4 2.5rem. Card gap is always --gap. */
:root {
  --brand: #0f766e; --brand-2: #115e59; --brand-soft: #e6f1ef; --brand-ink: #0b4f4a;
  --ink: #16302b; --ink-2: #5b6b68; --ink-3: #7b8a87;
  --bg: #f3f7f6; --card: #ffffff; --line: #e2ecea; --line-2: #eef3f2; --well: #f3f7f6;
  --good: #1f7a4d; --good-2: #3f9d6a; --mid: #9aa9a6; --warn: #d97706; --bad: #c2410c;
  --b1: #1f7a4d; --b2: #3f9d6a; --b3: #7b8a87; --b4: #d97706; --b5: #c2410c; --b0: #9aa9a6;
  --g1: #1f7a4d; --g2: #3f9d6a; --g3: #7b8a87; --g4: #d97706; --g5: #c2410c; --g0: #9aa9a6;
  --max: 1160px; --r: 16px; --r-lg: 20px; --r-sm: 10px; --gap: 1rem;
  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2.5rem;
  --shadow: 0 1px 2px rgba(22,48,43,.04), 0 6px 20px rgba(22,48,43,.05);
  --disp: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  --body: "Nunito", "Segoe UI", Arial, sans-serif;
  --head-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root { --brand: #2dd4bf; --brand-2: #5eead4; --brand-soft: #123f3b; --brand-ink: #a7f3ea; --ink: #e6efed; --ink-2: #a9b8b5; --ink-3: #8a9996; --bg: #0f1a18; --card: #16221f; --line: #26332f; --line-2: #1f2b28; --well: #1b2825; --shadow: none; }
}
* { box-sizing: border-box; }
html { font: 16px/1.55 var(--body); color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }
h1, h2, h3, .disp { font-family: var(--disp); letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: 2.3rem; line-height: 1.1; margin: 0 0 .6rem; }
h2 { font-size: 1.5rem; margin: 0 0 .4rem; display: flex; align-items: center; gap: .6rem; }
h3 { font-size: 1.1rem; margin: var(--s3) 0 .3rem; }
p { margin: .5rem 0 .9rem; }
small { color: var(--ink-3); font-size: .85em; }
code { background: var(--well); padding: .1em .35em; border-radius: 6px; font-size: .9em; }
svg.i { flex: none; vertical-align: -.2em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; top: 0; } .skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: .5rem; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
img { max-width: 100%; }
.ico, .h-ico { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); flex: none; }
.h-ico { width: 34px; height: 34px; }

/* ---------- header ---------- */
.masthead { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.masthead .wrap { display: flex; align-items: center; gap: 1.5rem; height: var(--head-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--disp); font-weight: 800; font-size: 1.4rem; color: var(--brand); text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.brand { flex: none; } .brand img { height: 30px; width: auto; max-width: none; display: block; }
/* The search box always keeps a usable width; the two personal controls (home postcode, shortlist) are icon-only
   on desktop (the 1160px column cannot fit their labels beside a usable search box). */
.q { flex: 1 1 300px; min-width: 260px; }
.nav .home-ctl, .nav #sl-ctl { position: relative; }
@media (min-width: 861px) {   /* the content column is 1160px at most, so this applies at every desktop width */
  .nav .home-ctl span, .nav #sl-ctl span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav .home-ctl svg, .nav #sl-ctl svg { width: 20px; height: 20px; }
  .nav .home-ctl, .nav #sl-ctl { padding: .35rem; border-bottom: 0; }
  .nav .home-ctl.set::after { content: ""; position: absolute; right: 2px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
}
@media (max-width: 860px) { .brand img { height: 28px; } }
.q { display: flex; align-items: center; gap: .5rem; background: var(--bg); border-radius: 999px; padding: 4px 4px 4px 16px; flex: 1 1 240px; min-width: 200px; max-width: 560px; position: relative; color: var(--ink-3); }
.q input[type=search] { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--ink); padding: .5rem 0; outline: none; }
.q input::placeholder { color: var(--ink-3); }
.q:focus-within { box-shadow: 0 0 0 3px rgba(15,118,110,.25); }
.q select { border: 0; background: transparent; font: inherit; color: var(--ink-2); padding: .3rem; }
.q button, .btn { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.15rem; border: 0; background: var(--brand); color: #fff; font: inherit; font-weight: 700; border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.q button:hover, .btn:hover { background: var(--brand-2); color: #fff; }
.btn.ghost { background: var(--brand-soft); color: var(--brand-ink); } .btn.ghost:hover { background: var(--line); }
.q.big { max-width: 720px; padding: 6px 6px 6px 20px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); margin: var(--s3) 0 var(--s2); }
.q.big input { font-size: 1.15rem; padding: .7rem 0; } .q.big button { padding: .75rem 1.5rem; font-size: 1.05rem; }
.nav { display: flex; gap: 1.1rem; margin-left: auto; font-weight: 700; font-size: .95rem; flex: none; }
.nav a { color: var(--ink); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover, .nav a.here { color: var(--brand); border-color: var(--brand); }
@media (max-width: 860px) { .masthead .wrap { height: auto; flex-wrap: wrap; gap: .6rem .9rem; padding-top: .6rem; padding-bottom: .6rem; } .q { order: 3; flex-basis: 100%; max-width: none; } .nav { margin-left: auto; gap: .3rem .9rem; font-size: .9rem; flex-wrap: wrap; justify-content: flex-end; } }
@media (max-width: 600px) { .nav { margin-left: 0; flex-wrap: wrap; gap: .3rem .9rem; flex-basis: 100%; } }
main.wrap { padding-top: var(--s4); padding-bottom: var(--s4); min-height: 60vh; }

/* ---------- common bits ---------- */
.crumbs { font-size: .88rem; color: var(--ink-3); margin: 0 0 .6rem; font-weight: 600; } .crumbs a { color: var(--ink-2); text-decoration: none; } .crumbs a:hover { color: var(--brand); }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 78ch; line-height: 1.55; margin: var(--s2) 0; }
.note { font-size: .88rem; color: var(--ink-3); }
.warn { background: #fdecea; color: #7a1f1c; padding: .6rem .9rem; border-radius: var(--r-sm); }
.notice { background: #fff6e5; color: #6b4a00; padding: .6rem .9rem; border-radius: var(--r-sm); }
@media (prefers-color-scheme: dark) { .warn { background: #3a1f1e; color: #f3c2bf; } .notice { background: #3a2f14; color: #f5d98a; } }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: .7rem 0 0; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem; background: var(--brand-soft); color: var(--brand-ink); border-radius: 999px; font-size: .9rem; font-weight: 700; text-decoration: none; line-height: 1.3; }
a.chip:hover { background: var(--line); }
.chip.plain { background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.jump { display: flex; flex-wrap: wrap; gap: .4rem; margin: var(--s2) 0 0; position: sticky; top: var(--head-h); background: var(--bg); padding: .6rem 0; z-index: 5; }
.jump a { font-size: .88rem; font-weight: 700; padding: .32rem .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink-2); }
.jump a:hover { color: var(--brand); border-color: var(--brand); }
@media (max-width: 860px) { .jump { position: static; } }
.module { margin: var(--s4) 0 0; padding-top: var(--s3); border-top: 1px solid var(--line); scroll-margin-top: calc(var(--head-h) + 6.5rem); }
.module > h2 { margin: 0 0 var(--s2); }
.module > h2 + .sub { margin-top: calc(-1 * var(--s2) + .45rem); }
.module > .sub { margin: .45rem 0 var(--s2); color: var(--ink-2); font-size: 1rem; max-width: 90ch; }
.module > h3 { margin: var(--s3) 0 .8rem; }
.module > h3 + .sub, .module > h3 + p.sub { margin-top: -.5rem; }
.card { background: var(--card); border-radius: var(--r); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.card.pad0 { padding: 0; overflow: hidden; }
.card > :first-child { margin-top: 0; } .card > :last-child { margin-bottom: 0; }
.sources { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); } .sources ul { padding-left: 1.2rem; }
details { margin: var(--s2) 0 0; }
details > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .55rem; padding: .5rem 1rem .5rem .85rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-weight: 700; color: var(--brand); user-select: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: .45em; height: .45em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translateY(1px); transition: transform .15s; }
details[open] > summary::before { transform: rotate(45deg) translateY(-2px); }
details > summary:hover { border-color: var(--brand); }
details > :not(summary) { margin-top: .8rem; }
details + details { margin-top: .6rem; }

/* ---------- school hero ---------- */
.school-head h1 { max-width: 24ch; }
.hero-grid { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: var(--gap); margin-top: var(--s3); align-items: stretch; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.score { background: var(--brand); color: #fff; border-radius: var(--r-lg); padding: 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .75rem; }
.score.band-4 { background: var(--b4); } .score.band-5 { background: var(--b5); } .score.band-3 { background: #4b5e5a; }
.score .label { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.score .dial-row { display: flex; align-items: center; gap: 1.2rem; }
.dial { width: 118px; height: 118px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: conic-gradient(#fff 0 var(--pct), rgba(255,255,255,.25) var(--pct) 100%); }
.dial > span { width: 94px; height: 94px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--disp); font-size: 2.6rem; font-weight: 800; }
.score .dial > span { background: var(--brand); } .score.band-4 .dial > span { background: var(--b4); } .score.band-5 .dial > span { background: var(--b5); } .score.band-3 .dial > span { background: #4b5e5a; }
.score .band-label { font-family: var(--disp); font-size: 1.4rem; font-weight: 800; line-height: 1.15; }
.score .range { font-size: .92rem; opacity: .92; margin-top: .3rem; }
.band-strip { position: relative; height: 8px; border-radius: 999px; overflow: visible; display: flex; gap: 2px; margin-top: .2rem; }
.band-strip i { display: block; height: 100%; border-radius: 999px; background: rgba(255,255,255,.28); }
.band-strip i:nth-child(1) { width: 15%; opacity: .5; } .band-strip i:nth-child(2) { width: 20%; opacity: .65; } .band-strip i:nth-child(3) { width: 30%; opacity: .8; } .band-strip i:nth-child(4) { width: 20%; opacity: .9; } .band-strip i:nth-child(5) { width: 15%; opacity: 1; }
.band-strip .m { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.25); transform: translateX(-2px); }
.band-strip-l { display: flex; justify-content: space-between; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .75; }
.score .why { font-size: .95rem; opacity: .96; line-height: 1.5; }
.score .tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: auto; }
.score .tag { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; background: rgba(255,255,255,.16); border-radius: 8px; font-size: .85rem; font-weight: 700; color: #fff; text-decoration: none; }
.score .tag:hover { background: rgba(255,255,255,.28); }
.score.none { background: var(--card); color: var(--ink); box-shadow: var(--shadow); } .score.none .label { color: var(--ink-3); } .score.none .big { font-family: var(--disp); font-size: 1.5rem; font-weight: 800; } .score.none .why { color: var(--ink-2); }
.score-other { font-size: .88rem; color: var(--ink-2); margin-top: .5rem; }
.glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--gap); }
@media (max-width: 600px) { .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- stat cards ---------- */
.stat { position: relative; background: var(--card); border-radius: var(--r); padding: 1rem 1.1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.stat .l { font-size: .85rem; color: var(--ink-2); font-weight: 700; min-height: 2.55em; line-height: 1.25; padding-right: 44px; display: flex; align-items: flex-start; }
.stat .ico { position: absolute; top: .85rem; right: .85rem; width: 34px; height: 34px; border-radius: 10px; }
.stat .v { font-family: var(--disp); font-size: 1.7rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.stat .v.txt { font-size: 1.25rem; }
.stat .n { font-size: .84rem; color: var(--ink-3); line-height: 1.35; }
.stat .v.good { color: var(--good); } .stat .v.bad { color: var(--bad); } .stat .v.warn { color: var(--warn); }
.stat.big .v { font-size: 2.2rem; }
.stat .bar { display: flex; align-items: center; gap: .6rem; margin-top: .55rem; }
.bar .track { flex: 1; height: 10px; border-radius: 999px; background: var(--line-2); position: relative; }
.bar .fill { height: 100%; border-radius: 999px; background: var(--brand); }
.bar .mark { position: absolute; top: -4px; width: 3px; height: 18px; border-radius: 2px; background: var(--ink); opacity: .55; transform: translateX(-1px); }
.bar .cmp { font-size: .82rem; color: var(--ink-3); white-space: nowrap; }
.stat .official { font-size: .78rem; color: var(--ink-3); margin-top: auto; padding-top: .35rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--gap); margin: 0 0 var(--s2); }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat .v { font-size: 1.45rem; } .stat.big .v { font-size: 1.8rem; } }

/* ---------- Ofsted rows ---------- */
.of-list { padding: .4rem 1.4rem; }
.of-row { display: grid; grid-template-columns: 250px minmax(0, 1fr) 150px; gap: 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line-2); }
.of-row:last-child { border-bottom: 0; }
.of-row .name { font-weight: 700; } .of-row .name small { display: block; font-weight: 600; color: var(--ink-3); font-size: .78rem; }
.of-row .track { height: 12px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.of-row .fill { height: 100%; border-radius: 999px; }
.of-row .grade { font-weight: 800; text-align: right; }
.of-row .txt { color: var(--ink-2); font-size: .92rem; }
@media (max-width: 640px) { .of-row { grid-template-columns: 1fr 110px; } .of-row .track { display: none; } .of-row .name { grid-column: 1; grid-row: 1; } .of-row .txt { grid-column: 1; grid-row: 2; } .of-row .grade { grid-column: 2; grid-row: 1 / span 2; align-self: center; } }
.of-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .85rem; color: var(--ink-2); margin: .8rem 0 0; align-items: center; }
.of-legend span { display: inline-flex; align-items: center; gap: .4rem; } .of-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.g1, .fill.g1 { background: var(--g1); } .g2, .fill.g2 { background: var(--g2); } .g3, .fill.g3 { background: var(--g3); } .g4, .fill.g4 { background: var(--g4); } .g5, .fill.g5 { background: var(--g5); } .g0, .fill.g0 { background: var(--g0); }
.tg1 { color: var(--g1); } .tg2 { color: var(--g2); } .tg3 { color: var(--ink-2); } .tg4 { color: var(--g4); } .tg5 { color: var(--g5); } .tg0 { color: var(--ink-3); }
.grade-pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; color: #fff; font-weight: 700; font-size: .85rem; white-space: nowrap; line-height: 1.4; }
.grade-pill.g3 { background: var(--well); color: var(--ink-2); border: 1px solid var(--line); } .grade-pill.g0 { background: var(--well); color: var(--ink-3); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .grade-pill.g3, .grade-pill.g0 { background: var(--line-2); } }
.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: .9rem; }
.badge.good { background: #e3f3ea; color: var(--good); } .badge.bad { background: #fdecea; color: #9a2a1b; } .badge.mid { background: var(--well); color: var(--ink-2); }
@media (prefers-color-scheme: dark) { .badge.good { background: #143a28; color: #8fe0b3; } .badge.bad { background: #3a1f1e; color: #f3c2bf; } }

/* ---------- charts ---------- */
.trend-card { display: grid; grid-template-columns: 200px minmax(0, 1fr) 150px; gap: 1.4rem; align-items: center; }
.trend-card .t .l { font-size: .85rem; color: var(--ink-2); font-weight: 700; display: block; }
.trend-card .t .ttl { font-weight: 700; margin-top: .2rem; line-height: 1.3; }
.trend-card > svg, .trend-card .chart-scroll > svg { width: 100%; height: auto; display: block; overflow: visible; }
@media (max-width: 640px) { .trend-card { grid-template-columns: 1fr; gap: .8rem; } .trend-card .chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.2rem; } .trend-card .chart-scroll > svg { min-width: 520px; } }
.trend-card .r { display: grid; gap: .35rem; font-size: .9rem; color: var(--ink-2); justify-items: start; }
@media (max-width: 800px) { .trend-card { grid-template-columns: 1fr; } }
.div { display: grid; grid-template-columns: 1fr 1fr; height: 10px; width: 140px; position: relative; }
.div::before { content: ""; position: absolute; left: 50%; top: -3px; width: 1px; height: 16px; background: var(--line); }
.div .neg { justify-self: end; height: 100%; background: var(--bad); border-radius: 999px 0 0 999px; }
.div .pos { height: 100%; background: var(--good); border-radius: 0 999px 999px 0; }
.fx { display: flex; align-items: center; gap: .7rem; white-space: nowrap; }
table.breakdown tbody th { white-space: normal; min-width: 11rem; } table.breakdown td:last-child { font-size: .88rem; color: var(--ink-2); white-space: normal; min-width: 14rem; } table.breakdown thead th:first-child { white-space: normal; }
@media (max-width: 700px) { table.breakdown tbody th { min-width: 8rem; } }
.rng { position: relative; display: block; width: 100px; height: 8px; border-radius: 999px; background: var(--line-2); margin: .35rem 0 .15rem; }
.rng .span { position: absolute; top: 0; height: 100%; border-radius: 999px; opacity: .45; }
.rng .dot { position: absolute; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); transform: translateX(-7px); box-sizing: border-box; }
.rng-t { display: block; }

/* ---------- tables ---------- */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 var(--s2); background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
details .tscroll { margin-bottom: 0; }
table.data { border-collapse: collapse; width: 100%; font-size: .93rem; }
table.data th, table.data td { padding: .65rem .9rem; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
table.data thead th { background: var(--well); font-weight: 700; white-space: nowrap; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
table.data tbody tr:last-child td, table.data tbody tr:last-child th { border-bottom: 0; }
table.data tbody tr:hover td, table.data tbody tr:hover th { background: rgba(15,118,110,.035); }
table.data tbody th { font-weight: 700; } table.data tbody th small { display: block; font-weight: 600; color: var(--ink-3); font-size: .78rem; }
table.data td { white-space: nowrap; font-variant-numeric: tabular-nums; } table.data td:first-child, table.data th:first-child { white-space: normal; }
table.data td.cmp { color: var(--ink-3); }
table.data tr.missing { color: var(--ink-3); }
table.data td.num, table.data th.num { text-align: right; }
table.data td.wrap, table.data th.wrap { white-space: normal; }
table.compare th { width: 32%; } table.compare thead th { text-transform: none; font-size: 1rem; letter-spacing: 0; color: var(--ink); } table.compare thead th small { display: block; font-weight: 600; color: var(--ink-3); }
table.schools td small { display: block; color: var(--ink-3); } table.schools td .grade-pill + small { display: inline; margin-left: .25rem; }
table.schools td a { font-weight: 700; text-decoration: none; } table.schools td a:hover { text-decoration: underline; }
table.schools tr.hot td { background: var(--brand-soft); }
.vs.up { color: var(--good); } .vs.down { color: var(--bad); } .vs.same { color: var(--ink-3); }
.z-well-above, .z-above { color: var(--good); font-weight: 700; } .z-below, .z-well-below { color: var(--bad); font-weight: 700; } .z-in-line { color: var(--ink-2); }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.2rem; margin: 0; }
dl.details dt { color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: .45rem; } dl.details dd { margin: 0; overflow-wrap: anywhere; } dl.details dt svg { flex: none; opacity: .8; }
@media (max-width: 600px) { dl.details { grid-template-columns: 1fr; gap: .1rem; } dl.details dd { margin-bottom: .6rem; } }
ul.cols { columns: 3 220px; padding-left: 1.2rem; margin: .4rem 0; } ul.cols li { break-inside: avoid; }
ul.changes { padding-left: 0; list-style: none; margin: 0; } ul.changes li { display: flex; gap: .7rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--line-2); } ul.changes li:last-child { border-bottom: 0; } ul.changes time { color: var(--ink-3); font-size: .85em; font-weight: 700; white-space: nowrap; min-width: 9.5em; }
ul.changes .i { color: var(--brand); align-self: center; }
.pill { display: inline-block; color: #fff; font-weight: 800; padding: .1rem .55rem; border-radius: 999px; font-size: .9rem; min-width: 2.5rem; text-align: center; font-family: var(--disp); }
.band-1 { background: var(--b1); } .band-2 { background: var(--b2); } .band-3 { background: var(--b3); } .band-4 { background: var(--b4); } .band-5 { background: var(--b5); } .band-none { background: var(--b0); }
.pill.band-none { background: var(--well); color: var(--ink-3); border: 1px solid var(--line); }
.traj { font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; } .traj-improving { color: var(--good); } .traj-declining { color: var(--bad); } .traj-stable { color: var(--ink-2); }
th[data-sort] { cursor: pointer; } th[data-sort]::after { content: " ⇅"; color: var(--ink-3); } th[data-sort][data-dir=asc]::after { content: " ↑"; color: var(--brand); } th[data-sort][data-dir=desc]::after { content: " ↓"; color: var(--brand); }
tr.bad { background: #fdecea; }

/* ---------- map ---------- */
.map-wrap { margin: 0 0 var(--s2); }
.map-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-bottom: .6rem; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--ink-2); padding: .35rem .9rem; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; } .legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend i.band-none { background: var(--well); border: 1px solid var(--line); }
.map { height: 380px; background: var(--well); border-radius: var(--r); position: relative; overflow: hidden; box-shadow: var(--shadow); z-index: 0; }
.map-area { height: 460px; }
.map::before { content: "Map loads as you scroll"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-weight: 700; }
.map.leaflet-container::before { display: none; }
.leaflet-container { font: inherit; }
.leaflet-tile-pane { filter: saturate(.55) brightness(1.04) contrast(.92); }
.leaflet-container a { color: var(--brand); }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a { border-bottom-color: var(--line) !important; color: var(--ink) !important; background: var(--card) !important; font-weight: 700; }
.leaflet-control-attribution { font-size: .7rem !important; background: rgba(255,255,255,.75) !important; border-radius: 8px 0 0 0; }
.leaflet-popup-content-wrapper { border-radius: 12px !important; box-shadow: 0 8px 24px rgba(0,0,0,.18) !important; font-family: var(--body); }
.leaflet-popup-content { margin: .8rem 1rem !important; font-size: .92rem; line-height: 1.45; }
.leaflet-popup-content .pop-name { font-family: var(--disp); font-weight: 800; font-size: 1rem; display: block; margin-bottom: .2rem; text-decoration: none; }
.leaflet-popup-content .pop-sub { color: var(--ink-2); display: block; }
.leaflet-popup-content .pill { margin-top: .3rem; }
.ctl { width: 34px; height: 34px; display: flex !important; align-items: center; justify-content: center; cursor: pointer; }
.pin { border-radius: 50%; width: 28px; height: 28px; color: #fff; font-size: .76rem; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-family: var(--disp); transition: transform .12s ease; }
.pin.hot, .leaflet-marker-icon:hover .pin { transform: scale(1.3); }
.pin.band-none { background: #b7c2bf; width: 14px; height: 14px; border-width: 2px; }
.pin.me { background: var(--ink); width: 30px; height: 30px; position: relative; }
.pin.me::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--brand); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- home ---------- */
.hero { padding: 0 0 var(--s2); }
.hero h1 { font-size: 2.9rem; max-width: 18ch; }
.hero p { max-width: 62ch; font-size: 1.15rem; color: var(--ink-2); }
@media (max-width: 640px) { .hero h1 { font-size: 2.1rem; } }
.entry { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin: var(--s3) 0; }
@media (max-width: 900px) { .entry { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.entry a { display: block; background: var(--card); border-radius: var(--r); padding: 1.2rem 1.3rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border: 1px solid transparent; transition: border-color .12s, transform .12s; }
.entry a:hover { border-color: var(--brand); transform: translateY(-2px); }
.entry .ico { width: 42px; height: 42px; border-radius: 12px; margin-bottom: .8rem; }
.entry strong { display: block; font-family: var(--disp); font-size: 1.15rem; font-weight: 800; margin-bottom: .2rem; }
.entry span:not(.ico) { color: var(--ink-2); font-size: .95rem; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 800px) { .three { grid-template-columns: 1fr; } }
.three > div { background: var(--card); border-radius: var(--r); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); } .three h3 { margin-top: .8rem; display: flex; align-items: center; gap: .6rem; }
.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.2rem 0; margin: 0; }
.numbers div { display: grid; padding: 0 1.5rem; border-left: 1px solid var(--line-2); } .numbers div:first-child { border-left: 0; }
.numbers b { font-family: var(--disp); font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; } .numbers span { color: var(--ink-2); font-size: .92rem; margin-top: .2rem; }
@media (max-width: 800px) { .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1rem; } .numbers div:nth-child(3) { border-left: 0; } }
.la-list { columns: 4 180px; font-size: .95rem; }
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; }
.region-grid.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .region-grid.cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .region-grid, .region-grid.cols3, .region-grid.cols4 { grid-template-columns: 1fr; } }
.region-grid a { display: flex; justify-content: space-between; align-items: center; gap: .6rem; background: var(--card); border-radius: var(--r-sm); padding: .85rem 1rem; text-decoration: none; color: var(--ink); font-weight: 700; box-shadow: var(--shadow); border: 1px solid transparent; }
.region-grid a small { color: var(--ink-3); font-weight: 600; white-space: nowrap; text-align: right; flex: 0 0 auto; line-height: 1.3; }
.region-grid a > span:first-child { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.region-grid.wrap-small a { display: block; } .region-grid.wrap-small a small { display: block; white-space: normal; overflow: visible; margin-top: .15rem; text-align: left; max-width: none; }
.region-grid a:hover { border-color: var(--brand); color: var(--brand); }
.region-grid.stacked a { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .6rem; row-gap: .15rem; align-items: start; }
.region-grid.stacked a svg { grid-row: 1 / span 2; margin-top: .15rem; }
.region-grid.stacked a small { white-space: normal; line-height: 1.35; text-align: left; max-width: none; }
.prose { max-width: none; } .prose p, .prose li, .prose h1, .prose h2, .prose h3, .prose ul, .prose ol { max-width: 78ch; }
.prose h2 { margin-top: var(--s4); } .prose table { font-size: .9rem; } .prose .card { margin: var(--s2) 0; }
.prose table.data td, .prose table.data th { white-space: normal; } .prose .tscroll { box-shadow: var(--shadow); }
.compare-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: .8rem; align-items: end; margin: var(--s3) 0; background: var(--card); padding: 1.2rem; border-radius: var(--r); box-shadow: var(--shadow); }
.compare-form label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 700; color: var(--ink-2); position: relative; }
.compare-form input { padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 1rem; font-weight: 500; background: var(--bg); color: var(--ink); } .compare-form input::placeholder { color: var(--ink-3); font-weight: 500; } .compare-form .btn { padding: .7rem 1.4rem; }
@media (max-width: 640px) { .compare-form { grid-template-columns: 1fr; } }
.compare-form input:focus { outline: none; box-shadow: 0 0 0 3px rgba(15,118,110,.25); }
.compare-form button { border-radius: 999px; padding: .7rem 1.4rem; }
@media (max-width: 640px) { .compare-form { grid-template-columns: 1fr; } }
.vs-head { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin: var(--s2) 0; }
.vs-head .card { display: flex; gap: 1rem; align-items: center; } .vs-head .card h2 { font-size: 1.15rem; margin: 0; } .vs-head .card h2 a { text-decoration: none; }
.vs-head .dial { width: 84px; height: 84px; background: conic-gradient(var(--brand) 0 var(--pct), var(--line-2) var(--pct) 100%); } .vs-head .dial > span { width: 66px; height: 66px; background: var(--card); font-size: 1.7rem; color: var(--ink); }
@media (max-width: 640px) { .vs-head { grid-template-columns: 1fr; } }
.linkish { background: none; border: 0; color: var(--brand); padding: 0; text-decoration: underline; font: inherit; cursor: pointer; }
.suggest { position: absolute; left: 0; top: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 8px 24px rgba(0,0,0,.14); z-index: 40; width: 100%; max-width: 560px; margin-top: 4px; overflow: hidden; }
.suggest a { display: block; padding: .55rem .9rem; text-decoration: none; color: var(--ink); font-weight: 700; } .suggest a:hover, .suggest a.on { background: var(--well); } .suggest small { display: block; font-weight: 600; }
.spark { color: var(--brand); vertical-align: middle; }
.links-row { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: var(--s2) 0 0; font-weight: 700; } .links-row a { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; } .links-row a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: var(--s4); padding: var(--s4) 0; font-size: .9rem; color: var(--ink-2); background: var(--card); }
.foot-cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 900px) { .foot-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-cols { grid-template-columns: 1fr; } }
.foot strong { font-family: var(--disp); color: var(--ink); font-size: 1.05rem; }
.foot ul { list-style: none; padding: 0; margin: .5rem 0 0; } .foot li { margin: .3rem 0; } .foot a { text-decoration: none; font-weight: 600; } .foot a:hover { text-decoration: underline; }
.attrib { font-size: .78rem; color: var(--ink-3); margin-top: var(--s3); }
@media print { .masthead, .jump, .foot, .map-wrap { display: none; } .card, .stat, .tscroll { box-shadow: none; border: 1px solid #ccc; } }

/* ---------- stacked composition bar (destinations) ---------- */
.dest { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.5rem; align-items: center; }
@media (max-width: 800px) { .dest { grid-template-columns: 1fr; } }
.stat.flat { box-shadow: none; padding: 0; background: transparent; }
.stack-bar { display: flex; height: 34px; border-radius: 999px; overflow: hidden; background: var(--line-2); }
.stack-bar span { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: .82rem; font-family: var(--disp); white-space: nowrap; overflow: hidden; min-width: 0; }
.stack-legend { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: .7rem; font-size: .88rem; color: var(--ink-2); }
.stack-legend span { display: inline-flex; align-items: center; gap: .4rem; } .stack-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; } .stack-legend b { color: var(--ink); }
.c1 { background: #0f766e; } .c2 { background: #2a9d8f; } .c3 { background: #5bb3a6; } .c4 { background: #8fcfc5; } .c5 { background: #c2a15c; } .c6 { background: #a9b8b5; } .c0 { background: #c2410c; } .c7 { background: #d7dfdd; }
.stack-bar .c4, .stack-bar .c6, .stack-bar .c7 { color: var(--ink); }
table.rank th, table.rank td { padding: .6rem .6rem; }
table.rank td:first-child { padding-left: 1rem; } table.rank th:first-child { padding-left: 1rem; }
table.schools.rank td .grade-pill + small { display: none; }
table.rank td:nth-child(2) { min-width: 240px; }
table.data.schools:not(.rank) td:first-child { min-width: 200px; }
.m-only { display: none; }
@media (max-width: 640px) { table.data .opt { display: none; } table.rank td:nth-child(2) { min-width: 0; } table.data.schools td:first-child { min-width: 0; } table.data td { white-space: normal; } .m-only { display: block; font-weight: 600; color: var(--ink-3); font-size: .78rem; } }
.dist-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.2rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line-2); }
.dist-row:last-child { border-bottom: 0; } .dist-row:first-child { padding-top: 0; }
.dist-row .name { font-weight: 700; } .dist-row .name small { display: block; font-weight: 600; color: var(--ink-3); font-size: .78rem; }
.dist-row .stack-bar { height: 26px; } .dist-row .stack-legend { display: none; }
.dist-row .stack-bar span { color: #fff; } .dist-row .stack-bar .g3 { color: #fff; }
@media (max-width: 700px) { .dist-row { grid-template-columns: 1fr; gap: .4rem; } }

/* ---------- area hub: one card per phase ---------- */
.phase-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--s3); }
@media (max-width: 760px) { .phase-cards { grid-template-columns: 1fr; } }
.phase-card { display: flex; flex-direction: column; gap: .8rem; background: var(--card); border-radius: var(--r-lg); padding: 1.4rem 1.5rem; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border: 1px solid transparent; transition: border-color .12s, transform .12s; }
.phase-card:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--ink); }
.phase-card .top { display: flex; align-items: center; gap: .9rem; }
.phase-card .top .ico { width: 44px; height: 44px; border-radius: 13px; }
.phase-card .top strong { display: block; font-family: var(--disp); font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.phase-card .top span { color: var(--ink-2); font-size: .92rem; }
.phase-card .count { margin-left: auto; font-family: var(--disp); font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; color: var(--brand); line-height: 1; }
.phase-card p { margin: 0; color: var(--ink-2); }
.phase-card .top3 { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.phase-card .top3 li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line-2); font-weight: 700; }
.phase-card .go { margin-top: auto; display: inline-flex; align-items: center; gap: .4rem; color: var(--brand); font-weight: 800; }

/* ---- Phase 5: subjects, gaps, parent view, places, SEND finder ---- */
.h4 { font-size: .95rem; margin: var(--s2) 0 .6rem; display: flex; align-items: center; gap: .4rem; color: var(--ink-2); }
.badge.warn { background: #fef3e2; color: #9a4a06; }
.bar .fill.good { background: var(--good); } .bar .fill.warn { background: var(--warn); } .bar .fill.bad { background: var(--bad); }

/* subject offer */
.offer .offer-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; margin-bottom: .4rem; }
.offer .offer-head strong { display: inline-flex; align-items: center; gap: .4rem; }
.offer-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: .6rem 1rem; align-items: start; padding: .55rem 0; border-top: 1px solid var(--line-2); }
.offer-row .k { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding-top: .45rem; }
.offer-row .chips { margin: 0; } .offer-row .chip small { color: var(--ink-3); font-weight: 600; margin-left: .1rem; }
.offer > .note { margin: .6rem 0 0; }
@media (max-width: 600px) { .offer-row { grid-template-columns: 1fr; gap: .2rem; } .offer-row .k { padding-top: 0; } }

/* school vs England comparison rows (subjects) */
.cmp-list { padding: .35rem 1.25rem; }
.cmp-row { display: grid; grid-template-columns: 230px minmax(0, 1fr) 118px; gap: 1rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line-2); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row .name { font-weight: 700; } .cmp-row .name a { text-decoration: none; } .cmp-row .name a:hover { text-decoration: underline; } .cmp-row .name small { display: block; font-weight: 600; color: var(--ink-3); font-size: .78rem; }
.cmp-row .track { position: relative; height: 12px; border-radius: 999px; background: var(--line-2); }
.cmp-row .fill { height: 100%; border-radius: 999px; background: var(--brand); } .cmp-row .fill.good { background: var(--good); } .cmp-row .fill.bad { background: var(--bad); }
.cmp-row .mark { position: absolute; top: -4px; width: 3px; height: 20px; border-radius: 2px; background: var(--ink); opacity: .55; transform: translateX(-1px); }
.cmp-row .val { text-align: right; font-family: var(--disp); font-weight: 800; font-size: 1.15rem; } .cmp-row .val small { display: block; font-family: var(--body); font-weight: 600; color: var(--ink-3); font-size: .76rem; }
.cmp-row .val.good { color: var(--good); } .cmp-row .val.bad { color: var(--bad); }
@media (max-width: 640px) { .cmp-row { grid-template-columns: 1fr 90px; } .cmp-row .track { grid-column: 1 / -1; order: 3; } }

/* gaps: dumbbell rows */
.gap-list { padding: .35rem 1.25rem; }
.gap-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 96px 120px; gap: 1rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--line-2); }
.gap-row:last-child { border-bottom: 0; }
.gap-row .name { font-weight: 700; } .gap-row .name small { display: block; font-weight: 600; color: var(--ink-3); font-size: .78rem; }
.gap-track { position: relative; height: 22px; }
.gap-track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 3px; border-radius: 3px; background: var(--line-2); }
.gap-track .line { position: absolute; top: 8px; height: 7px; border-radius: 4px; background: var(--brand); opacity: .35; }
.gap-track .dot, .gap-legend .dot { position: absolute; top: 4px; width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--card); box-sizing: border-box; transform: translateX(-7px); box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.gap-track .dot.a, .gap-legend .dot.a { background: var(--bad); } .gap-track .dot.b, .gap-legend .dot.b { background: var(--brand); }
.gap-track .nat, .gap-legend .nat { position: absolute; top: 2px; width: 3px; height: 19px; border-radius: 2px; background: var(--ink); opacity: .35; transform: translateX(-1px); }
.gap-row .vals { display: flex; flex-direction: column; font-family: var(--disp); font-weight: 800; line-height: 1.2; text-align: right; }
.gap-row .vals .a { color: var(--bad); } .gap-row .vals .b { color: var(--brand); }
.gap-row .gap { font-weight: 800; text-align: right; } .gap-row .gap small { display: block; font-weight: 600; color: var(--ink-3); font-size: .76rem; }
.gap-row .gap.good { color: var(--good); } .gap-row .gap.bad { color: var(--bad); }
.gap-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: .8rem 0 0; font-size: .86rem; color: var(--ink-2); }
.gap-legend span { display: inline-flex; align-items: center; gap: .45rem; } .gap-legend .dot, .gap-legend .nat { position: static; transform: none; display: inline-block; } .gap-legend .nat { height: 15px; }
@media (max-width: 700px) { .gap-row { grid-template-columns: 1fr 80px 100px; } .gap-track { grid-column: 1 / -1; order: 4; } }

/* parent view rows */
.pv-list { padding: .35rem 1.25rem; }
.pv-row { display: grid; grid-template-columns: 260px minmax(0, 1fr) 96px; gap: 1rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line-2); }
.pv-row:last-child { border-bottom: 0; }
.pv-row .name { font-weight: 700; font-size: .93rem; } .pv-row .name small { display: block; font-weight: 600; color: var(--ink-3); font-size: .76rem; }
.pv-bar { position: relative; display: flex; height: 14px; border-radius: 999px; overflow: visible; background: var(--line-2); }
.pv-bar i { display: block; height: 100%; }
.pv-bar i:first-child { border-radius: 999px 0 0 999px; } .pv-bar i:last-of-type { border-radius: 0 999px 999px 0; }
.pv-bar .sa, .pv-legend .sa { background: var(--brand); } .pv-bar .ag, .pv-legend .ag { background: #6fb7b1; } .pv-bar .dk, .pv-legend .dk { background: #d7dfdd; }
.pv-bar .di, .pv-legend .di { background: #f0a274; } .pv-bar .sd, .pv-legend .sd { background: var(--bad); } .pv-bar .yes, .pv-legend .yes { background: var(--warn); border-radius: 999px; }
.pv-bar .nat, .pv-legend .nat { position: absolute; top: -4px; width: 3px; height: 22px; border-radius: 2px; background: var(--ink); opacity: .55; transform: translateX(-1px); }
.pv-row .pv-val { text-align: right; font-family: var(--disp); font-weight: 800; font-size: 1.1rem; } .pv-row .pv-val small { display: block; font-family: var(--body); font-weight: 600; color: var(--ink-3); font-size: .74rem; }
.pv-row .pv-val.good { color: var(--good); } .pv-row .pv-val.bad { color: var(--bad); }
.pv-row.fact .name { color: var(--ink-2); }
.pv-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .8rem 0 0; font-size: .84rem; color: var(--ink-2); }
.pv-legend span { display: inline-flex; align-items: center; gap: .4rem; } .pv-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; } .pv-legend .nat { position: static; transform: none; display: inline-block; height: 14px; }
@media (max-width: 640px) { .pv-row { grid-template-columns: 1fr 80px; } .pv-bar { grid-column: 1 / -1; order: 3; } }

/* places pressure */
.places { margin: .9rem 0; padding: .9rem 1rem; border-radius: 12px; background: var(--well); }
.places-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; }
.places .bar { display: flex; align-items: center; gap: .6rem; margin-top: .6rem; }
.places p { margin: .7rem 0 0; }

/* SEND */
.send-card { margin-top: var(--s2); }
.send-card p:first-child strong { display: inline-flex; align-items: center; gap: .35rem; }
.need-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.need-grid .need { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: inherit; transition: transform .12s; }
.need-grid .need:hover { transform: translateY(-2px); }
.need-grid .need strong { font-family: var(--disp); font-size: 1.1rem; color: var(--brand-ink); }
.need-grid .need small { color: var(--ink-3); font-size: .8rem; } .need-grid .need .n { margin-top: .4rem; font-weight: 700; font-size: .86rem; color: var(--ink-2); }
@media (max-width: 900px) { .need-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .need-grid { grid-template-columns: 1fr; } }

/* similar-intake strip */
.sim-head { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.2rem; align-items: start; margin-bottom: 1.1rem; } .sim-head > p { margin: .4rem 0 0; }
.sim-words { font-size: 1.02rem; color: var(--ink-2); }
.sim-strip { position: relative; height: 44px; margin: 0 14px; border-bottom: 2px solid var(--line); }
.sim-strip i { position: absolute; bottom: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); opacity: .28; transform: translateX(-4px); }
.sim-strip .med { position: absolute; bottom: 0; width: 2px; height: 22px; background: var(--ink); opacity: .5; transform: translateX(-1px); }
.sim-strip .me { position: absolute; bottom: 2px; width: 30px; height: 30px; border-radius: 50%; transform: translateX(-15px); display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--disp); font-weight: 800; font-size: .86rem; box-shadow: 0 0 0 3px var(--card), 0 2px 6px rgba(0,0,0,.25); }
.sim-strip .me em { font-style: normal; }
.sim-axis { display: flex; justify-content: space-between; margin: .4rem 14px 0; font-size: .8rem; color: var(--ink-3); }
@media (max-width: 640px) { .sim-head { grid-template-columns: 1fr; gap: .4rem; } }

/* Scottish roll by stage */
.stage-card { margin: var(--s2) 0; }
.stage-card .t { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; margin-bottom: .8rem; } .stage-card .t .l { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); } .stage-card .ttl { font-weight: 800; }
.stage-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .5rem; align-items: end; height: 150px; }
.stage-bars .sb { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.stage-bars b { display: block; width: 100%; max-width: 46px; background: var(--brand); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; margin-top: auto; }
.stage-bars b i { position: absolute; top: -1.3rem; left: 0; right: 0; text-align: center; font-style: normal; font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.stage-bars span { font-size: .8rem; font-weight: 700; color: var(--ink-3); margin-top: .35rem; }

/* home postcode, shortlist */
.nav .home-ctl, .nav #sl-ctl { display: inline-flex; align-items: center; gap: .3rem; }
.nav .home-ctl span:empty::before { content: "Home"; }
.school-head { position: relative; }
.school-head .btn.save { position: absolute; right: 0; top: .2rem; padding: .45rem .9rem; font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem; }
.school-head .btn.save.on { background: var(--brand); color: #fff; }
@media (max-width: 640px) { .school-head .btn.save { position: static; margin: .4rem 0 0; } }
.chip.home { background: #fef3e2; color: #9a4a06; }
table.data td.fh { white-space: nowrap; font-weight: 700; } table.data td.fh small, table.data td.fh0 small { display: block; font-weight: 600; color: var(--ink-3); font-size: .76rem; }
button.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.vs-head.n3, .vs-head.n4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
table.compare.n3 th, table.compare.n4 th { width: auto; } table.compare.n3 thead th:first-child, table.compare.n4 thead th:first-child { width: 22%; }
@media print { .masthead, .foot, .jump, .links-row, .btn, .map-wrap, .crumbs { display: none !important; } body { background: #fff; } .card, .stat { box-shadow: none; border: 1px solid #ddd; } }

/* search filters */
.filters { margin: 0 0 var(--s2); } .filters > summary { cursor: pointer; font-weight: 800; display: inline-flex; align-items: center; gap: .4rem; list-style: none; padding: .5rem .9rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.filters > summary::-webkit-details-marker { display: none; } .filters .badge { padding: .1rem .5rem; font-size: .75rem; }
.filter-rows { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: .6rem 1.2rem; margin-top: .7rem; }
.filter-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: .5rem 1rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--line-2); } .filter-row:first-child { border-top: 0; }
.filter-row .k { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); } .filter-row .chips { margin: 0; } .filter-row .note { grid-column: 2; }
.filter-row .btns { display: flex; gap: .6rem; flex-wrap: wrap; } .filter-row .btn { display: inline-flex; align-items: center; }
.filter-row .chip { cursor: pointer; } .filter-row .chip input { position: absolute; opacity: 0; width: 0; height: 0; } .filter-row .chip:has(input:checked) { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (max-width: 600px) { .filter-row { grid-template-columns: 1fr; gap: .25rem; } .filter-row .note { grid-column: 1; } }

/* questions parents ask */
.faq { display: grid; gap: .6rem; }
.faq-item { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 0; }
.faq-item > summary { cursor: pointer; padding: .9rem 1.2rem; font-weight: 800; list-style: none; display: flex; align-items: center; gap: .6rem; background: transparent; border: 0; border-radius: var(--r); color: var(--ink); width: 100%; box-sizing: border-box; }
.faq-item > summary:hover { color: var(--brand); }
.faq-item > summary::before { content: "+"; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; flex: none; transform: none; font-size: 1rem; line-height: 1; }
.faq-item[open] > summary::before { content: "–"; transform: none; } .faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > p { margin: 0; padding: 0 1.2rem 1rem 3rem; color: var(--ink-2); }
.faq { margin-top: 0; }
.faq-item > p { margin: 0; padding: 0 1.2rem 1rem 3rem; color: var(--ink-2); }

/* stats pages */
.chart-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .5rem; font-size: .82rem; color: var(--ink-2); } .chart-legend span { display: inline-flex; align-items: center; gap: .35rem; } .chart-legend i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
table.compare-stats th small { display: block; font-weight: 600; color: var(--ink-3); font-size: .76rem; } table.compare-stats td small { display: block; font-weight: 600; color: var(--ink-3); font-size: .74rem; }
table.compare-stats strong.good { color: var(--good); } table.compare-stats strong.bad { color: var(--bad); }
td.good { color: var(--good); font-weight: 700; } td.bad { color: var(--bad); font-weight: 700; } td.warn { color: var(--warn); font-weight: 700; }
ul.plain { padding-left: 1.2rem; } ul.plain li { margin: .35rem 0; }
.stat .l a { color: inherit; text-decoration: none; } .stat .l a:hover { text-decoration: underline; }

/* ---------- getting a place: catchment and "will I get in" ---------- */
.card-inset { margin: .9rem 0; padding: .9rem 1rem; border-radius: 12px; background: var(--well); }
.catch-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; color: var(--brand-ink); } .catch-head svg { color: var(--brand); }
.card-inset p { margin: .4rem 0; }
.catch-check .badge, .getin-out .badge { margin-right: .3rem; }
.getin-form { max-width: 420px; margin: .6rem 0 .3rem; background: var(--card); border: 1px solid var(--line); }
.getin-form input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; padding: .45rem 0; outline: none; }
.getin-out { margin: .5rem 0; line-height: 1.5; }
.leaflet-tooltip { font: 600 .82rem/1.3 var(--body); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .stats.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Rankings: "Other rankings" as grouped cards instead of one wall of chips */
.rank-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.rank-groups .card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.rank-groups ul.plain { list-style: none; margin: 0; padding: 0; }
.rank-groups ul.plain li { padding: .3rem 0; border-top: 1px solid var(--line); line-height: 1.35; }
.rank-groups ul.plain li:first-child { border-top: 0; }
.rank-groups ul.plain li a { font-weight: 600; text-decoration: none; }
.rank-groups ul.plain li a:hover { text-decoration: underline; }
.rank-groups ul.plain li small { display: block; color: var(--ink-3); font-size: .8rem; }
.rank-groups .chips { margin-top: .4rem; }
.rank-groups .card.wide { grid-column: 1 / -1; }

/* contact strip under the school lede: the things a parent needs to ring, visit or look the school up */
.contact-row { display: flex; flex-wrap: wrap; gap: .35rem 1.4rem; align-items: center; margin: -.2rem 0 var(--s2); font-size: .95rem; color: var(--ink-2); }
.contact-row > span { display: inline-flex; align-items: center; gap: .4rem; } .contact-row svg { color: var(--brand); flex: none; }
.contact-row a { font-weight: 700; text-decoration: none; } .contact-row a:hover { text-decoration: underline; }
.contact-row small { color: var(--ink-3); font-size: .85em; }
.contact-row .more { font-size: .88rem; color: var(--ink-3); font-weight: 600; margin-left: auto; }
@media (max-width: 640px) { .contact-row { gap: .3rem .9rem; } .contact-row .more { margin-left: 0; } }

/* =====================================================================================
   Phone layer (2026-09-19). Everything below only applies under 860px / on touch screens.
   ===================================================================================== */
@media (max-width: 860px) {
  /* Masthead: not sticky (it was eating a quarter of the screen), brand row + one-line scrolling nav + search. */
  .masthead { position: static; }
  .masthead .wrap { display: grid; grid-template-columns: 1fr; gap: .45rem; padding-top: .55rem; padding-bottom: .6rem; height: auto; }
  .brand { font-size: 1.25rem; }
  .nav { order: 2; margin: 0 -1.25rem; padding: 0 1.25rem; display: flex; flex-wrap: nowrap; gap: .25rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; font-size: .9rem; justify-content: flex-start; flex-basis: auto; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 999px; border-bottom-width: 1px; }
  .nav a.here { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand-ink); }
  .nav .home-ctl, .nav #sl-ctl { padding: .4rem .7rem; }
  .q { order: 3; padding: 3px 3px 3px 14px; }
  .q button { padding: .5rem 1rem; }
  main.wrap { padding-top: var(--s3); }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.3rem; }
  .lede { font-size: 1.04rem; }
  .crumbs { white-space: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -1.25rem .6rem; padding: 0 1.25rem; }
  .crumbs::-webkit-scrollbar { display: none; }

  /* Section jump nav: one sticky row that scrolls sideways, active section highlighted by site.js. */
  .jump { position: sticky; top: 0; z-index: 20; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: var(--s2) -1.25rem 0; padding: .5rem 1.25rem; gap: .35rem; border-bottom: 1px solid var(--line); scroll-padding: 0 1.25rem; }
  .jump::-webkit-scrollbar { display: none; }
  .jump a { flex: none; padding: .42rem .85rem; }
  .jump a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
  .module { scroll-margin-top: 3.6rem; margin-top: var(--s3); padding-top: var(--s2); }
  .school-head h1 { max-width: none; }
  .hero-grid { gap: .8rem; }
  .score { padding: 1.2rem 1.25rem; }
  .dial { width: 100px; height: 100px; } .dial > span { width: 80px; height: 80px; font-size: 2.2rem; }
  .score .band-label { font-size: 1.2rem; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: .7rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: .7rem; }
  .stat { padding: .85rem .9rem; }
  .stat .l { min-height: 0; padding-right: 38px; font-size: .8rem; }
  .stat .ico { width: 30px; height: 30px; top: .7rem; right: .7rem; }
  .stat .v { font-size: 1.5rem; } .stat.big .v { font-size: 1.8rem; }
  .stat .n { font-size: .78rem; }
  .stat .official { display: none; }
  .card { padding: .95rem 1rem; }

  /* Tables: the first column stays put while the rest scrolls, and the wrapper shows a fade where there is more. */
  .tscroll { position: relative; }
  .tscroll.more::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 28px; background: linear-gradient(to right, rgba(255,255,255,0), var(--card)); pointer-events: none; border-radius: 0 var(--r) var(--r) 0; }
  table.data th:first-child, table.data td:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; box-shadow: 1px 0 0 var(--line-2); }
  table.data thead th:first-child { background: var(--well); z-index: 2; }
  table.data tbody tr:hover td:first-child, table.data tbody tr:hover th:first-child { background: var(--card); }
  table.data th, table.data td { padding: .55rem .65rem; font-size: .9rem; }
  table.rank td:first-child, table.rank th:first-child { position: static; box-shadow: none; }
  table.rank td:nth-child(2), table.rank th:nth-child(2) { position: sticky; left: 0; background: var(--card); z-index: 1; }
  table.rank thead th:nth-child(2) { background: var(--well); }
  /* Cap the sticky name column so the next two or three columns fit on the screen beside it. */
  table.data:not(.rank) td:first-child, table.rank td:nth-child(2) { min-width: 38vw; max-width: 48vw; }
  table.rank td:first-child, table.rank th:first-child { white-space: nowrap; padding-right: .3rem; }
  table.data td small { white-space: normal; }
  table.compare th:first-child { max-width: 34vw; }
  table.schools td small { font-size: .74rem; }
  table.compare th:first-child { width: 34%; }
  .grade-pill { font-size: .78rem; padding: .12rem .5rem; }

  /* Lists of link cards go single column and let their small print wrap. */
  .region-grid, .region-grid.cols3, .region-grid.cols4 { grid-template-columns: 1fr; gap: .5rem; }
  .region-grid a { display: grid; grid-template-columns: auto 1fr; column-gap: .6rem; row-gap: .1rem; align-items: start; padding: .75rem .9rem; }
  .region-grid a > span:first-child { grid-column: 1 / -1; }
  .region-grid a small { grid-column: 1 / -1; white-space: normal; text-align: left; line-height: 1.35; }
  .region-grid.cols3 a > span:first-child + small { grid-column: 1 / -1; }
  .entry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .entry a { padding: .9rem .95rem; } .entry .ico { width: 36px; height: 36px; margin-bottom: .5rem; } .entry strong { font-size: 1.02rem; } .entry span:not(.ico) { font-size: .86rem; }
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .9rem 0; }
  .numbers b { font-size: 1.5rem; }
  .three > div { padding: 1rem 1.1rem; }
  .phase-card { padding: 1.1rem 1.15rem; } .phase-card .count { font-size: 1.9rem; }
  .map { height: 300px; } .map-area { height: 340px; }
  .rank-groups { grid-template-columns: 1fr; }
  .foot-cols { gap: 1.4rem; }
  .attrib { font-size: .74rem; }
  .contact-row { font-size: .92rem; }
  .cmp-row .name, .gap-row .name, .pv-row .name, .of-row .name { font-size: .92rem; }
  .faq-item > summary { padding: .8rem 1rem; } .faq-item > p { padding: 0 1rem .9rem 2.6rem; }
  details > summary { padding: .5rem .9rem .5rem .75rem; }
  .chips { gap: .35rem; } .chip { font-size: .84rem; padding: .28rem .7rem; }
  .compare-form { padding: .9rem; }
  .vs-head .card { flex-direction: row; }
  .dest { gap: .8rem; }
}
@media (max-width: 360px) {
  .stat .v { font-size: 1.35rem; }
  .entry { grid-template-columns: 1fr; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Fingers, not pointers: bigger tap targets and no hover-only affordances. */
@media (pointer: coarse) {
  .jump a, .chip, details > summary, .filters > summary, .seg button, .foot a, .links-row a { min-height: 40px; display: inline-flex; align-items: center; }
  .foot li { margin: .15rem 0; }
  th[data-sort] { padding-top: .8rem; padding-bottom: .8rem; }
  .region-grid a { min-height: 48px; }
  table.data tbody tr:hover td, table.data tbody tr:hover th { background: inherit; }
}

/* Big search form on phones: the age-group dropdown was squeezing the text box to three letters. It becomes a card:
   text box and button on the first row, the age group as a full-width row beneath. */
@media (max-width: 600px) {
  .q.big { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; border-radius: 18px; padding: 8px 8px 8px 16px; gap: .4rem .5rem; }
  .q.big > svg { grid-column: 1; grid-row: 1; }
  .q.big input[type=search] { grid-column: 2; grid-row: 1; font-size: 1.05rem; padding: .6rem 0; }
  .q.big button { grid-column: 3; grid-row: 1; padding: .65rem 1.1rem; font-size: 1rem; }
  .q.big select { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0 -8px -8px -16px; width: calc(100% + 24px); padding: .7rem 16px; border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; background: var(--well); color: var(--ink); font-weight: 700; -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6b68' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 16px; }
  .q.big select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
}
