/* Grammar School Admissions: a transit-map look.
   Navy ink on white, crimson + gold accents, school-tie stripe as the signature motif. */
:root {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f2f4f7; --surface-3: #e8ecf1;
  --ink: #0d1b2a; --ink-2: #566170; --line: #dde2e8; --rail: #5b6b7e;
  --link: #0a58b8; --crimson: #c8102e; --gold: #e3a400; --navy: #0d1b2a;
  --yes: #0f7b4f; --no: #b3261e; --focus: #e3a400;
  --c-lac: #7a2ea0; --c-pp: #c25a00; --c-med: #b3261e; --c-sib: #00809d; --c-staff: #5c6f00; --c-faith: #8a4fa6;
  --c-feeder: #2f5d7c; --c-area: #0f7b4f; --c-rank: #0a58b8; --c-dist: #646d78; --c-other: #646d78; --c-apt: #c2186b;
  --radius: 4px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e13; --surface: #11171f; --surface-2: #17202b; --surface-3: #1f2a37;
    --ink: #e4e9ef; --ink-2: #98a5b4; --line: #2a3646; --rail: #7d8b9c;
    --link: #79b4ff; --crimson: #ff5c70; --gold: #f2c14e; --navy: #0d1b2a;
    --yes: #4fd197; --no: #ff8a80; --focus: #f2c14e;
    --c-lac: #c991ec; --c-pp: #ffa45c; --c-med: #ff8a80; --c-sib: #4fd0ea; --c-staff: #c3d65c; --c-faith: #d6a4ec;
    --c-feeder: #8dbbe0; --c-area: #4fd197; --c-rank: #79b4ff; --c-dist: #a3adb8; --c-other: #a3adb8; --c-apt: #ff7eb6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0e13; --surface: #11171f; --surface-2: #17202b; --surface-3: #1f2a37;
  --ink: #e4e9ef; --ink-2: #98a5b4; --line: #2a3646; --rail: #7d8b9c;
  --link: #79b4ff; --crimson: #ff5c70; --gold: #f2c14e; --navy: #0d1b2a;
  --yes: #4fd197; --no: #ff8a80; --focus: #f2c14e;
  --c-lac: #c991ec; --c-pp: #ffa45c; --c-med: #ff8a80; --c-sib: #4fd0ea; --c-staff: #c3d65c; --c-faith: #d6a4ec;
  --c-feeder: #8dbbe0; --c-area: #4fd197; --c-rank: #79b4ff; --c-dist: #a3adb8; --c-other: #a3adb8; --c-apt: #ff7eb6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 "Hanken Grotesk", system-ui, sans-serif; font-feature-settings: "tnum" 1; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: .1em 0 .25em; }
h2 { font-size: 1.35rem; margin: 0 0 .9rem; }
h3 { font-size: 1.05rem; margin: 1.1rem 0 .4rem; letter-spacing: -0.01em; }
.muted { color: var(--ink-2); } .small { font-size: .875rem; }

/* site chrome: tie stripe + wordmark */
.tie { height: 10px; background: repeating-linear-gradient(135deg, var(--navy) 0 14px, var(--gold) 14px 18px, var(--crimson) 18px 30px, var(--gold) 30px 34px); }
.masthead { border-bottom: 1px solid var(--line); background: var(--surface); }
.masthead .in { max-width: 1180px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -0.01em; font-size: 1.05rem; flex-wrap: wrap; }
.wordmark .crest { width: 22px; height: 26px; flex: none; clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%);
  background: repeating-linear-gradient(135deg, var(--navy) 0 5px, var(--gold) 5px 7px, var(--crimson) 7px 12px, var(--gold) 12px 14px); }
.wordmark small { font-weight: 500; color: var(--ink-2); font-size: .85rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 16px 72px; }
footer { color: var(--ink-2); font-size: .85rem; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }

/* cards & sections */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 18px 0; }
section.card > h2 { display: flex; align-items: center; gap: 10px; }
section.card > h2::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 4px solid var(--crimson); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dt { color: var(--ink-2); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding-top: 3px; }
dd { margin: 0; }
@media (max-width: 560px) { dl { grid-template-columns: 1fr; gap: 2px; } dt { padding-top: 10px; } }

/* badges */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 3px; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.c-lac { --c: var(--c-lac); } .c-pp { --c: var(--c-pp); } .c-med { --c: var(--c-med); } .c-sib { --c: var(--c-sib); } .c-staff { --c: var(--c-staff); }
.c-faith { --c: var(--c-faith); } .c-feeder { --c: var(--c-feeder); } .c-area { --c: var(--c-area); } .c-rank { --c: var(--c-rank); }
.c-dist { --c: var(--c-dist); } .c-other { --c: var(--c-other); } .c-apt { --c: var(--c-apt); }
.g { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--line); }
.g-boys { color: var(--c-rank); } .g-girls { color: var(--crimson); } .g-mixed { color: var(--c-area); }

/* ---------- index ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: end; margin-bottom: 8px; }
.hero p { color: var(--ink-2); font-size: 1.08rem; max-width: 62ch; margin: 0; }
.hero .legend { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; gap: 12px; } .hero .legend { justify-content: flex-start; } }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input[type=search], .filters select { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); min-width: 0; max-width: 100%; }
.filters input[type=search] { flex: 1 1 260px; border-width: 2px; border-color: var(--ink); }
.filters label.check { display: flex; gap: 6px; align-items: center; font-size: .95rem; }
.filters button.reset { font: inherit; font-weight: 600; border: 0; background: none; color: var(--link); cursor: pointer; padding: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; align-items: center; }
.chip { font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--c); background: transparent; color: var(--c); }
.chip::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.chip[aria-pressed="true"] { background: var(--c); color: var(--surface); }
.chip[aria-pressed="true"]::before { background: var(--surface); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); white-space: nowrap; background: var(--surface-2); border-bottom: 2px solid var(--ink); }
th[data-sort] { cursor: pointer; user-select: none; } th[data-sort]:hover { color: var(--ink); }
th[aria-sort="ascending"]::after { content: " ↑"; color: var(--crimson); } th[aria-sort="descending"]::after { content: " ↓"; color: var(--crimson); }
td.num, th.num { text-align: right; }
td.num:first-child { font-weight: 800; color: var(--ink-2); }
tbody tr:hover { background: var(--surface-2); }
td.name a { font-weight: 700; color: var(--ink); text-decoration: none; }
td.name a::after { content: "→"; display: inline-block; margin-left: 6px; color: var(--ink-2); font-weight: 600; transition: transform .15s; }
td.name a:hover { color: var(--link); }
td.name a:hover::after { color: var(--link); transform: translateX(3px); }
tr.pending td { color: var(--ink-2); }
td.pri { white-space: nowrap; } td.pri .arrow { color: var(--ink-2); margin: 0 1px; }
td.empty { text-align: center; padding: 36px; color: var(--ink-2); }

/* ---------- school header ---------- */
.crumbs { margin: 0; font-size: .9rem; font-weight: 600; }
.crumbs a { text-decoration: none; } .crumbs a::before { content: "← "; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-2); margin: 0 0 14px; align-items: center; font-weight: 500; }
.facts b { color: var(--ink); }
.lede { font-size: 1.15rem; max-width: 72ch; border-left: 4px solid var(--gold); padding-left: 14px; margin: 14px 0; }

/* ---------- the line (flowchart) ---------- */
.flow-intro { margin: -6px 0 10px; }
.line { list-style: none; margin: 0; padding: 0; max-width: 1000px; }
.line > li { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; position: relative; }
.line > li.stop:not(.has-branch) .main { grid-column: 2 / span 2; }
.rail { position: relative; }
.rail::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 8px; transform: translateX(-50%); background: var(--rail); }
.line > li:first-child .rail::before { top: 30px; border-radius: 4px 4px 0 0; }
.line > li.end .rail::before { bottom: auto; height: 26px; }
.marker { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 5px solid var(--rail); display: grid; place-items: center; z-index: 1; }
.stop .main { padding: 12px 0 18px; }
.kicker { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.stop .title { font-weight: 700; font-size: 1.06rem; line-height: 1.3; margin: 2px 0 4px; }
.desc { font-size: .9rem; color: var(--ink-2); margin-top: 4px; }
.desc b { color: var(--ink); font-weight: 600; }
.when { font-weight: 700; font-size: .92rem; color: var(--crimson); }

.zlabel { grid-column: 2 / span 2; padding: 20px 0 6px; font-weight: 800; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.zlabel span { display: inline-grid; place-items: center; width: 24px; height: 24px; background: var(--crimson); color: #fff; border-radius: 3px; font-size: .78rem; letter-spacing: 0; }
.zlabel::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.seg { min-height: 30px; }
.seglabel { grid-column: 2 / span 2; align-self: center; font-size: .82rem; font-weight: 700; padding: 2px 0 8px; }
.seg.no .seglabel { color: var(--no); }
.seg.no .seglabel:not(:empty)::before { content: "↓ "; }
.seg.yes .seglabel { color: var(--ink-2); font-weight: 500; }
.seglabel .go { color: var(--yes); font-weight: 700; margin-right: 4px; }
.seglabel .go::before { content: "↓ "; }
.seglabel .exc { font-size: .8rem; margin-top: 2px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.step { border: 1px solid var(--line); border-top: 4px solid var(--ink); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.step.optional { border-top-style: dashed; border-top-color: var(--ink-2); }
.step .who { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.step .what { font-weight: 700; margin: 2px 0; line-height: 1.3; }
.subjects { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; align-items: center; }
.subj { font-size: .8rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); }
.subj.paper { border-radius: 3px; background: transparent; border: 1px solid var(--line); font-weight: 500; }
.stop.test .marker { width: 30px; height: 30px; top: 11px; }
.stop.minor .marker { width: 16px; height: 16px; border-width: 4px; top: 18px; }
.stop.decision .marker { border-radius: 4px; transform: translateX(-50%) rotate(45deg); }
.stop.apt .marker { border-color: var(--c-apt); }
.stop.apt .step { border-top-color: var(--c-apt); }
.pool { margin-top: 6px; }
.quota { display: inline-block; font-size: .78rem; font-weight: 800; color: var(--surface); background: var(--ink); padding: 2px 8px; border-radius: 3px; margin: 4px 0 2px; }

/* branches leaving the line */
.branch { padding: 10px 0 14px; position: relative; }
.branch::before { content: ""; position: absolute; left: -22px; width: 22px; top: 33px; border-top: 3px solid var(--bc, var(--line)); }
.bcard { border: 1px solid var(--line); border-left: 5px solid var(--bc, var(--line)); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
.blabel { display: inline-block; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--bc); margin-bottom: 2px; }
.branch.in { --bc: var(--yes); }
.branch.exit { --bc: var(--ink-2); }
.branch.exit .bcard { border-style: dashed; border-left-style: solid; background: transparent; }
.branch .title { font-weight: 700; line-height: 1.3; }

/* criteria stations */
.stop.crit .marker { width: 34px; height: 34px; top: 10px; border-color: var(--rail); background: var(--c); color: #fff; font-weight: 800; font-size: .78rem; }
.stop.crit .kicker { color: var(--c); }
.stop.crit .branch { --bc: var(--c); }
.stop.crit .and { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 3px 0; }
b.or { color: var(--c, var(--link)); text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; margin: 0 3px; }
.acad { margin-top: 8px; font-size: .88rem; }
.acad span { display: inline-block; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c); margin-right: 4px; }
.alloc { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: .88rem; }
.alloc b { font-size: 1.1rem; }
.subcrit { margin: 6px 0 0; padding-left: 20px; font-size: .88rem; }
.stop.end .marker { width: 30px; height: 30px; top: 11px; border-radius: 3px; background: var(--rail); }
.tiebreak { margin: 22px 0 0; max-width: 1000px; font-size: .93rem; padding: 12px 16px; background: var(--surface-2); border-left: 4px solid var(--gold); border-radius: var(--radius); }

@media (max-width: 720px) {
  .line > li { grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; }
  .line > li.stop:not(.has-branch) .main, .zlabel, .seglabel { grid-column: 2; }
  .branch { grid-column: 2; padding-top: 0; }
  .branch::before { display: none; }
  .rail::before { width: 6px; }
  .marker { width: 20px; height: 20px; border-width: 4px; }
  .stop.crit .marker { width: 28px; height: 28px; font-size: .7rem; }
  .stop.test .marker, .stop.end .marker { width: 24px; height: 24px; }
  .card { padding: 16px; }
}

/* timeline, tables */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 4px solid var(--rail); margin-left: 7px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -11px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 4px solid var(--rail); }
.timeline time { display: block; font-weight: 800; font-size: .92rem; color: var(--crimson); }
.timeline span { font-size: .93rem; }
.alloc-table { font-size: .9rem; } .alloc-table td, .alloc-table th { padding: 7px 9px; }
.area { border-top: 1px solid var(--line); padding-top: 4px; } .area:first-child { border-top: 0; }
details summary { cursor: pointer; color: var(--link); font-weight: 600; }
.ptype { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--gold); border: 1px solid currentColor; border-radius: 3px; padding: 1px 7px; }
:root:not([data-theme="dark"]) .ptype { color: #8a6400; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ptype { color: var(--gold); } }

/* ---------- simplified school page ---------- */
.school-head .lede { font-size: 1.05rem; }
.keybar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 18px 0 8px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
.keybar > div { padding: 12px 16px; border-right: 1px solid var(--line); }
.keybar > div:last-child { border-right: 0; }
.keybar dt { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: 0; }
.keybar dd { margin: 2px 0 0; font-size: 1.02rem; line-height: 1.3; }
.keybar dd b { font-size: 1.15rem; font-weight: 800; }
.keybar dd small { display: block; color: var(--ink-2); font-size: .8rem; }
@media (max-width: 560px) { .keybar { grid-template-columns: 1fr 1fr; } .keybar > div { border-bottom: 1px solid var(--line); } }

section.flow { margin: 28px 0 10px; padding: 26px 26px 18px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--gold); }
section.flow > h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 4px; }
@media (max-width: 720px) { section.flow { padding: 18px 14px 12px; box-shadow: 4px 4px 0 var(--gold); } }

/* pass mark station stands out */
.stop.passmark .main { background: color-mix(in srgb, var(--gold) 14%, transparent); border-left: 4px solid var(--gold); padding: 10px 14px; margin: 6px 0 12px; border-radius: var(--radius); }
.stop.passmark .kicker { color: var(--ink); }
.stop.passmark .marker { border-color: var(--gold); }

/* "Details" disclosures inside stations */
details.more { margin-top: 6px; }
details.more > summary { cursor: pointer; font-size: .8rem; font-weight: 700; color: var(--link); list-style: none; display: inline-flex; align-items: center; gap: 4px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 3px; font-size: .7rem; line-height: 1; }
details.more[open] > summary::before { content: "−"; }
details.more .more-body { margin-top: 4px; }
.step .desc { margin-top: 0; }

/* folded sections below the chart */
.folds { margin-top: 22px; }
details.fold { padding: 0; margin: 10px 0; }
details.fold > summary { cursor: pointer; list-style: none; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
details.fold > summary h2::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 3.5px solid var(--crimson); }
details.fold > summary::after { content: "+"; font-size: 1.4rem; font-weight: 600; color: var(--ink-2); line-height: 1; }
details.fold[open] > summary::after { content: "−"; }
details.fold > summary:hover h2 { color: var(--link); }
details.fold .fold-body { padding: 0 20px 20px; }
.disclaimer { margin-top: 18px; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; align-items: center; }
.ppill { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.ppill .pn { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--c); color: #fff; font-size: .72rem; font-weight: 800; }
.parrow { color: var(--ink-2); font-weight: 700; }

a.ppill { color: var(--ink); text-decoration: none; }
a.ppill:hover { background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.stop.crit { scroll-margin-top: 16px; }
.stop.crit:target .main, .stop.crit:target .bcard { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--c) 28%, var(--surface)); } 100% { background: transparent; } }
.seglabel .segnext { color: var(--ink-2); font-weight: 600; }

a.pmini { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin: 0 1px; border-radius: 999px; background: var(--c); color: #fff; font-size: .72rem; font-weight: 800; text-decoration: none; vertical-align: 1px; line-height: 1; }
a.pmini:hover { outline: 2px solid color-mix(in srgb, var(--c) 40%, transparent); }

/* ---- readability: markers and pills grow to fit their label ---- */
.marker { width: auto; min-width: 24px; padding: 0 4px; border-radius: 999px; }
.stop.crit .marker { width: auto; min-width: 34px; height: 34px; padding: 0 7px; font-size: .74rem; white-space: nowrap; }
.stop.decision .marker { width: 24px; padding: 0; border-radius: 4px; }
.ppill .pn, a.pmini { width: auto; white-space: nowrap; }
.ppill { white-space: normal; text-align: left; }
.plabel { color: var(--ink-2); text-transform: none; letter-spacing: 0; }
@media (max-width: 720px) { .stop.crit .marker { min-width: 28px; height: 28px; padding: 0 5px; } }

/* ---- softer contrast ---- */
.keybar, section.flow { border: 1px solid var(--line); }
section.flow { box-shadow: 0 1px 2px rgba(13,27,42,.05), 0 8px 24px rgba(13,27,42,.06); border-top: 4px solid var(--gold); }
.quota { background: var(--surface-3); color: var(--ink); }
.step { border-top: 3px solid var(--rail); }
thead th { border-bottom: 1px solid var(--line); }
.filters input[type=search] { border: 1px solid var(--line); }
.filters input[type=search]:focus { border-color: var(--link); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 20%, transparent); }
.stop.crit .marker, .ppill .pn, a.pmini { background: color-mix(in srgb, var(--c) 82%, var(--surface)); }
.stop.end .marker { background: var(--surface); }
.zlabel span { background: color-mix(in srgb, var(--crimson) 85%, var(--surface)); }

/* ---- custom select boxes ---- */
.filters select { -webkit-appearance: none; appearance: none; padding: 9px 34px 9px 12px; background-color: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.filters select:hover { border-color: var(--ink-2); }
.filters select:focus { border-color: var(--link); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 20%, transparent); }
.stop.minor .marker { width: 16px; min-width: 0; padding: 0; }

/* ---------- near me + map ---------- */
.near { border-top: 4px solid var(--gold); }
.pc-form label { display: block; margin-bottom: 8px; font-size: 1.05rem; }
.pc-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pc-row input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); flex: 1 1 220px; min-width: 0; text-transform: uppercase; }
.pc-row input::placeholder { text-transform: none; }
.pc-row input:focus { border-color: var(--link); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 20%, transparent); }
.btn-primary { font: inherit; font-weight: 700; padding: 10px 16px; border: 0; border-radius: var(--radius); background: var(--link); color: #fff; cursor: pointer; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.pc-row select { -webkit-appearance: none; appearance: none; font: inherit; padding: 10px 34px 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background-color: var(--surface); color: var(--ink);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.pc-row select:disabled { opacity: .5; }
.pc-form p { margin: 8px 0 0; } .pc-form .err { color: var(--no); margin: 4px 0 0; } .pc-form .err:empty { display: none; }
.linkbtn { font: inherit; border: 0; background: none; color: var(--link); cursor: pointer; padding: 0; text-decoration: underline; }
th.dist, td.dist { display: none; } body.has-home th.dist, body.has-home td.dist { display: table-cell; }
td.dist { white-space: nowrap; font-weight: 700; }
.gchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.gchip { font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.gchip.in { color: var(--yes); border-color: color-mix(in srgb, var(--yes) 45%, transparent); background: color-mix(in srgb, var(--yes) 8%, transparent); }
.gchip.warn { color: #9a5b00; border-color: color-mix(in srgb, #c98a00 50%, transparent); background: color-mix(in srgb, #c98a00 9%, transparent); }
.gchip.out { color: var(--ink-2); }
.gchip.maybe { color: var(--ink-2); border-style: dashed; }
.gchip.neutral { color: var(--link); border-color: color-mix(in srgb, var(--link) 35%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gchip.warn { color: #f2c14e; } }
.listbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; }
.viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viewtoggle button { font: inherit; font-weight: 600; font-size: .9rem; padding: 6px 14px; border: 0; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.viewtoggle button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
#map { height: min(70vh, 620px); padding: 0; overflow: hidden; margin-top: 0; }
#map .gchips { margin-top: 6px; }
.maplegend { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.maplegend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 2px; }

.nearme { margin: 8px 0 0; }
.nm-res { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.nm-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.nm-form label { font-weight: 600; font-size: .95rem; }
.nm-form input { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); width: 150px; text-transform: uppercase; }
.nm-form .btn-primary { padding: 7px 14px; }
.nm-form .err { color: var(--no); }

/* special-circumstances group */
.stop.special-group .marker { color: #fff; border-color: var(--rail); font-size: .7rem; min-width: 34px; }
.stop.special-group .main { padding-bottom: 8px; }
.sg-line { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.sg-line .title { font-size: 1rem; }
.sg-toggle { font: inherit; font-size: .85rem; font-weight: 700; color: var(--link); background: transparent; border: 1px solid color-mix(in srgb, var(--link) 40%, transparent); border-radius: 999px; padding: 2px 12px; cursor: pointer; }
.sg-toggle:hover { background: color-mix(in srgb, var(--link) 8%, transparent); }
.sg-list { display: grid; gap: 10px; margin-top: 10px; }
.sg-item { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); scroll-margin-top: 16px; }
.sg-item:target { animation: flash 1.6s ease-out; }
.sg-head { display: flex; gap: 8px; align-items: center; }
.sg-head .pn { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--c) 82%, var(--surface)); color: #fff; font-size: .72rem; font-weight: 800; }
.sg-head .kicker { color: var(--c); }
.sg-out { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.sg-out .blabel { color: var(--yes); }

.mpin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); padding: 0; cursor: pointer; }
.mpin:focus-visible { outline: 3px solid var(--focus); }
.mhome { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--crimson); color: #fff; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.45); cursor: pointer; }
.maplibregl-popup-content { font: 14px/1.4 "Hanken Grotesk", system-ui, sans-serif; color: #1b2633; }
.maplibregl-popup-content a { color: #0a58b8; }
.sg-list[hidden] { display: none; }
.paperlist { margin: 8px 0 0; padding-left: 18px; font-size: .9rem; color: var(--ink-2); } .paperlist li { margin: 3px 0; } .paperlist b { color: var(--ink); }
.stop.special-group .kicker { color: var(--c); }
.stop.special-group .main { padding-top: 10px; padding-bottom: 4px; }

/* each special-circumstance priority: a normal station that starts collapsed */
.line > li.stop.special:not(.expanded) { }
li.special:not(.expanded) .branch, li.special:not(.expanded) .sg-full { display: none; }
li.special.expanded .sg-short { display: none; }
.line > li.stop.special.has-branch:not(.expanded) .main { grid-column: 2 / span 2; padding-bottom: 6px; }
li.special:not(.expanded) .title { font-size: 1rem; }
.sg-short { display: inline-flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.sg-hide { margin-top: 10px; }
li.special .kicker { color: var(--c); }
.listbar { scroll-margin-top: 16px; }

/* Plain-HTML fallback (replaced by school.js) */
.prerender{padding:8px 0 24px;max-width:760px}
.prerender h1{margin:.4em 0 .2em}
.prerender dl{display:grid;grid-template-columns:max-content 1fr;gap:4px 16px;margin:16px 0}
.prerender dt{color:var(--ink2,#5d6875);font-weight:600}
.prerender dd{margin:0}
.prerender ol,.prerender ul{padding-left:1.3em}
.prerender li{margin:.35em 0}

/* Top navigation */
.masthead .in { flex-wrap: wrap; }
.topnav { margin-left: auto; display: flex; gap: 4px; }
.topnav a { padding: 6px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem; }
.topnav a:hover { color: var(--ink); background: var(--surface-2); }
.topnav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
@media (max-width: 640px) { .topnav { margin-left: 0; width: 100%; } .masthead .wordmark small { display: none; } }

/* Deadlines */
.month { font-size: 1.05rem; margin: 18px 0 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.month:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.evlist { list-style: none; margin: 0; padding: 0; }
.ev { display: grid; grid-template-columns: 15em 1fr; gap: 12px; padding: 7px 0 7px 12px; border-left: 3px solid var(--line); margin: 2px 0; }
.ev time { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ev-deadline { border-left-color: var(--crimson); }
.ev-test { border-left-color: var(--rail); }
.ev-result { border-left-color: var(--c-area); }
.ev-offer { border-left-color: var(--gold); }
@media (max-width: 640px) { .ev { grid-template-columns: 1fr; gap: 2px; } }
#dl-list { padding: 16px 18px; }
#dl-form .filters { margin-top: 10px; align-items: center; }
#dl-form label.small { display: inline-flex; gap: 6px; align-items: center; }

/* Shared tests + checked line */
.testlist { list-style: none; padding: 0; margin: 0; }
.testlist li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.testlist li:last-child { border-bottom: 0; }
.sharedtest { margin: 0 0 12px; }
.school-head .checked { margin: 4px 0 0; }
.keybar small { display: block; font-weight: 400; }

/* Info pages + footer links */
.prose { max-width: 720px; padding: 8px 0 24px; }
.prose h2 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
.prose p { line-height: 1.6; }
.footnav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.footnav a { color: inherit; }

/* Dark mode: light fills need dark text for contrast */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary,
  :root:not([data-theme="light"]) .stop.crit .marker,
  :root:not([data-theme="light"]) .ppill .pn,
  :root:not([data-theme="light"]) a.pmini,
  :root:not([data-theme="light"]) .sg-head .pn { color: #0b1118; }
}
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .stop.crit .marker, :root[data-theme="dark"] .ppill .pn,
:root[data-theme="dark"] a.pmini, :root[data-theme="dark"] .sg-head .pn { color: #0b1118; }

/* Use my location */
.locate { font: inherit; font-size: .9rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--link); cursor: pointer; white-space: nowrap; }
.locate:hover { background: var(--surface-2); }
.locate:disabled { opacity: .6; cursor: wait; }
@media (max-width: 640px) { .locate span { display: none; } }

/* Your-address markers on area stations */
.you:empty { display: none; }
.you { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; vertical-align: 1px; white-space: nowrap; }
.you.yes { background: color-mix(in srgb, var(--yes) 14%, transparent); color: var(--yes); }
.you.no { background: color-mix(in srgb, var(--no) 12%, transparent); color: var(--no); }
.you.maybe { background: var(--surface-2); color: var(--ink-2); }
@media (max-width: 640px) { .you { white-space: normal; } }

/* School page priority-area map */
.areamap-wrap { margin: 0 0 16px; }
.areamap { height: 340px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.maplegend .dot.sch { background: #1f4e79; }
.maplegend .dot.hm { background: var(--crimson); }

/* Smooth in-page jumps (not for people who prefer reduced motion) */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
[id] { scroll-margin-top: 16px; }
.maplegend .ring { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink-2); margin: 0 2px 0 8px; vertical-align: -1px; }
.area.flash { animation: flash 1.8s ease-out; border-radius: 6px; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--gold) 22%, transparent); } 100% { background: transparent; } }
.hovertip .maplibregl-popup-content { padding: 6px 10px; font-size: .85rem; pointer-events: none; }
.hovertip { pointer-events: none; }

/* Small fixed maps in the flowchart */
.minimap { position: relative; width: 100%; max-width: 360px; height: 150px; margin: 10px 0 2px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.minimap.linked { cursor: pointer; }
.minimap.linked:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.minimap .maplibregl-ctrl-attrib { font-size: 9px; }
#map { position: relative; }
.maptip { position: absolute; top: 10px; right: 10px; z-index: 3; max-width: min(320px, 60%); padding: 7px 11px; border-radius: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.25); font-size: .85rem; line-height: 1.35; pointer-events: none; }
.maptip[hidden] { display: none; }
.maptip .tiplines { margin-top: 3px; color: var(--ink-2); }
.maptip .sw { display: inline-block; width: 14px; height: 0; border-top: 3px solid; margin-right: 6px; vertical-align: 3px; }
.maptip .sw.dash { border-top-style: dashed; }
.zoomarea { display: block; margin-top: 6px; padding: 0; }

/* Enlarged map dialog */
.minimap .mm-hint { position: absolute; z-index: 2; top: 6px; right: 6px; padding: 2px 7px; border-radius: 4px; background: var(--surface); color: var(--ink-2); font-size: .72rem; font-weight: 700; pointer-events: none; opacity: .9; }
.bigmap-dlg { width: min(960px, 94vw); max-width: none; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.bigmap-dlg::backdrop { background: rgba(0,0,0,.55); }
.bigmap-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bigmap-close { font: inherit; font-size: 1.6rem; line-height: 1; background: none; border: 0; color: var(--ink-2); cursor: pointer; padding: 0 4px; }
.bigmap { height: min(70vh, 640px); }
.bigmap-note { margin: 8px 14px 12px; }

/* Share */
.headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.headrow .crumbs { margin: 0; }
.sharewrap { position: relative; }
.sharebtn { font: inherit; font-size: .9rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.sharebtn:hover { background: var(--surface-2); }
.sharemenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.sharemenu[hidden] { display: none; }
.sharemenu label { display: flex; gap: 6px; align-items: center; padding: 4px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; color: var(--ink-2); }
.sharemenu button, .sharemenu a { font: inherit; text-align: left; padding: 7px 8px; border: 0; border-radius: 5px; background: none; color: var(--ink); text-decoration: none; cursor: pointer; }
.sharemenu button:hover, .sharemenu a:hover { background: var(--surface-2); }
.seclink { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 6px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--ink-2); cursor: pointer; opacity: 0; vertical-align: middle; transition: opacity .15s; }
summary:hover .seclink, .stop:hover .seclink, .seclink:focus-visible { opacity: 1; }
.seclink:hover { background: var(--surface-2); color: var(--link); }
@media (hover: none) { .seclink { opacity: .55; } }
.kicker .seclink { width: 20px; height: 20px; margin-left: 4px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 50; padding: 9px 16px; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; overflow-wrap: anywhere; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Shortlist */
.star { display: inline-grid; place-items: center; width: 28px; height: 28px; margin: -4px 4px -4px -4px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; vertical-align: middle; }
.star:hover { background: var(--surface-2); color: var(--gold); }
.star.on { color: var(--gold); }
.headtools { display: flex; gap: 8px; align-items: center; }
.headtools .star { width: auto; height: auto; margin: 0; padding: 7px 12px; gap: 6px; display: inline-flex; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; }
.headtools .star.on svg { color: var(--gold); }
.listtools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.slbtn { font: inherit; font-size: .88rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.slbtn.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.slbtn.on svg { color: var(--gold); }
.slbtn:disabled { opacity: .55; cursor: default; }
.slbtn[hidden] { display: none; }
.sl-shared { padding: 12px 16px; margin-bottom: 10px; border-left: 4px solid var(--gold); }
.maplibregl-popup-content .star { margin: 0 4px 0 0; width: 22px; height: 22px; vertical-align: -5px; }
.maplibregl-popup-content { padding-right: 26px; }
.sltip { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(380px, calc(100vw - 32px)); padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.sltip p { margin: 6px 0; }
.sltip ul { margin: 6px 0 12px; padding-left: 1.2em; }
.sltip li { margin: 4px 0; }
.topnav .navsl { display: inline-flex; align-items: center; gap: 5px; }
.topnav .navsl svg { color: var(--gold); }
@media (max-width: 640px) { .topnav { flex-wrap: wrap; } }
.topnav .navsl svg { display: none; }
.topnav .navsl.has svg { display: inline; }
.slbtn svg { color: var(--gold); }
.sltable td.past { color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-2) 50%, transparent); }
.sltable td.name .small { margin-top: 2px; font-weight: 400; }
.sl-empty { padding: 18px 20px; }
.slbtn.navsl { text-decoration: none; }
.slbtn.navsl[hidden] { display: none; }
.slbtn.navsl svg { display: inline; color: var(--gold); }
.mpin.mstar { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 0; background: none !important; box-shadow: none; display: grid; place-items: center; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); z-index: 2; }

/* Keep the layout steady between pages: always reserve the scrollbar's space */
html { scrollbar-gutter: stable; }
/* Shortlist: rows unstarred this visit stay, faded, until reload */
.sltable tr.removed td { opacity: .45; }
.sltable tr.removed td.name { opacity: 1; }
.sltable tr.removed td.name a, .sltable tr.removed td.name .small { opacity: .45; }
#sl-undo { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 50; display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; }
#sl-undo.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#sl-undo .linkbtn { color: var(--gold); font-weight: 800; }
.listtools { position: relative; }
.sharebox { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(440px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.sharebox[hidden] { display: none; }
.sharebox p { margin: 0 0 8px; }
.sharebox-row { display: flex; gap: 8px; }
.sharebox-row input { flex: 1; min-width: 0; font: inherit; font-size: .85rem; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink); }
.keybar .of { font-weight: 400; color: var(--ink-2); font-size: .9em; }
.keybar .selparts { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: 12px; row-gap: 1px; margin-top: 5px; font-size: .78rem; color: var(--ink-2); font-weight: 500; }
.keybar .selparts span:nth-child(even) { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); font-weight: 700; }

/* Trend charts */
.trends { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 6px; }
.trend { margin: 0; flex: 1 1 260px; max-width: 360px; }
.trend figcaption { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin-bottom: 4px; }
.trend svg { width: 100%; height: auto; display: block; overflow: visible; }
.trend .grid { stroke: var(--line); stroke-width: 1; }
.trend .ln { fill: none; stroke: var(--link); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .dot { fill: var(--link); stroke: var(--surface); stroke-width: 2; }
.trend .hit { fill: transparent; cursor: default; }
.trend .pt:hover .dot { r: 6; }
.trend text { font: 600 11px "Hanken Grotesk", system-ui, sans-serif; fill: var(--ink); }
.trend text.muted, .trend text.yr { fill: var(--ink-2); font-weight: 500; }

/* Print: light, everything open, no interactive bits */
@media print {
  :root { --bg: #fff !important; --surface: #fff !important; --surface-2: #f3f4f6 !important; --ink: #000 !important; --ink-2: #444 !important; --line: #ccc !important; color-scheme: light; }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  .tie, .topnav, .sharewrap, .headtools, .nearme, .minimap, .areamap-wrap, .seclink, .sg-toggle, .more > summary, .crumbs, footer .footnav, #toast, #sl-undo, .sltip, .locate, .viewtoggle, button { display: none !important; }
  .card, .fold, .keybar, .flow { box-shadow: none !important; border-color: #ccc !important; }
  .keybar, .bcard, .timeline li { break-inside: avoid; }
  details > summary::marker, details > summary::-webkit-details-marker { display: none; }
  .fold > summary h2 { margin: 0; }
  a { color: #000; text-decoration: underline; }
  .school-head .lede { border-color: #999; }
  .wrap { max-width: none; padding: 0; }
  @page { margin: 14mm; }
}

/* Glossary */
.gl { text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); text-underline-offset: 3px; cursor: help; border-radius: 3px; }
.gl:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.gltip { position: absolute; z-index: 70; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.3); font-size: .85rem; line-height: 1.45; }
.gltip[hidden] { display: none; }
dl.glossary dt { font-weight: 800; margin-top: 16px; }
dl.glossary dd { margin: 4px 0 0; color: var(--ink-2); }
@media print { .gl { text-decoration: none; } .gltip { display: none !important; } }
.icsurl { font: inherit; font-size: .78rem; width: min(100%, 380px); padding: 3px 6px; margin-top: 3px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); color: var(--ink-2); }
.sublist { list-style: none; padding: 0; margin: 8px 0 0; }
.sublist li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sublist li:last-child { border-bottom: 0; }
.od-filter { font: inherit; width: min(100%, 360px); padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); margin: 6px 0 12px; }
#od-table tr[hidden] { display: none; }
.keybar .cd { color: var(--ink-2); }
.keybar .cd.soon { color: var(--crimson); font-weight: 700; }
