/* Self-hosted font, so no request goes to Google (privacy rule: no third-party calls). */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin.woff2) format('woff2');
}

/* Design tokens from the Designer's guide (design/design-guide.md). */
:root {
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --ink: #142033;
  --muted: #5A6577;
  --line: #E3E7EE;
  --line-strong: #D5DBE5;
  --primary: #1D4ED8;
  --primary-ink: #1E3A8A;
  --primary-soft: #E8EEFC;
  --hidden: #9A4508;
  --hidden-bar: #D97706;
  --hidden-soft: #FDF1E4;
  --hidden-line: #F3D9BC;
  --on-dark-muted: #C9D2E0;
  --zone: #0B5E57;
  --zone-soft: #E6F4F1;
  --zone-line: #B9E0D8;
  --header-bg: #142033;
  --ink-on-primary: #FFFFFF;
  --surface-2: #F4F6F9;

  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --radius-card: 18px;
  --radius-box: 12px;
  --radius-button: 14px;
  --radius-pill: 999px;
  --gutter: 20px;
}
@media (prefers-color-scheme: dark) {
  /* Designer ux-v2 section 3: contrast-checked dark colours */
  :root {
    --bg: #0E1624; --surface: #172133; --ink: #E8EDF5; --muted: #A3AEC2;
    --line: #26324A; --line-strong: #34425E; --primary: #6E9BFF; --ink-on-primary: #0E1624; --primary-ink: #C9D8FF;
    --primary-soft: #1D2B4A; --hidden: #FDBA74; --hidden-bar: #F59E0B; --hidden-soft: #3A2414; --hidden-line: #5C3A1E;
    --zone: #7FD4C6; --zone-soft: #12302C; --zone-line: #1F4D46; --on-dark-muted: #A3AEC2;
    --header-bg: #172133; --surface-2: #1D2940;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: var(--primary); }
button { font: inherit; color: inherit; cursor: pointer; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { max-width: 480px; margin: 0 auto; padding: 20px var(--gutter) 110px; }
main.wide { max-width: 960px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.unknown { color: var(--muted); font-weight: 400; font-size: 13px; }
.hidden-text { color: var(--hidden); }
.page-title { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.screen-title { font-size: 19px; font-weight: 800; margin: 0; }

/* Search */
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-button); padding: 0 14px; min-height: 50px; margin: 16px 0 12px; }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-weight: 600; color: var(--ink); min-width: 0; height: 48px; }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--ink-on-primary); }
.count { margin: 18px 0 10px; font-weight: 700; }
.notice { background: var(--hidden-soft); border: 1px solid var(--hidden-line); color: var(--hidden); border-radius: var(--radius-box); padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }

/* School cards */
.card-grid { display: grid; gap: 12px; }
@media (min-width: 900px) { main.wide .card-grid { grid-template-columns: 1fr 1fr; } }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; color: inherit; text-decoration: none; }
.card:hover, .card:focus-visible { border-color: var(--primary); outline: none; }
.card-top { display: flex; gap: 12px; align-items: center; }
.initials { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.card h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.money-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.money { border-radius: var(--radius-box); padding: 10px 12px; background: var(--surface-2); }
.money.true { background: var(--primary-soft); color: var(--primary-ink); }
.money strong { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.extras-line { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; color: var(--hidden); font-size: 13px; font-weight: 600; }
.extras-line .icon { width: 16px; height: 16px; margin-top: 1px; }

/* Profile */
.profile-head { background: var(--header-bg); color: #fff; margin: -20px calc(var(--gutter) * -1) 16px; padding: 14px var(--gutter) 20px; }
.head-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #fff; display: grid; place-items: center; text-decoration: none; }
.icon-btn[aria-pressed="true"] .icon { fill: currentColor; }
.profile-head .initials { background: rgba(255,255,255,.12); color: #fff; }
.profile-head h1 { font-size: 22px; font-weight: 800; margin: 10px 0 2px; overflow-wrap: anywhere; }
.profile-head .sub { color: var(--on-dark-muted); font-size: 13px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); background: rgba(255,255,255,.12); }
.pill.light { background: var(--bg); border: 1px solid var(--line); color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; margin-bottom: 12px; }
.panel.hidden-panel { border-color: var(--hidden-line); }
.panel h2 { font-size: 16px; font-weight: 800; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.big-money { font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0; }
.bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 12px 0 8px; }
.bar .fees { background: var(--primary); }
.bar .extra { background: var(--hidden-bar); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; font-weight: 600; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--primary); }
.legend span.h::before { background: var(--hidden-bar); }
.legend span.h { color: var(--hidden); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-box); padding: 12px; }
.fact strong { display: block; font-size: 16px; font-weight: 800; margin-top: 2px; }

.grade-picker { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; font-weight: 600; }
.grade-picker select, .compare-pick select { font: inherit; font-weight: 600; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; min-height: 40px; padding: 0 10px; max-width: 100%; }

.segmented { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px; margin-bottom: 8px; }
.segmented button { border: 0; background: transparent; border-radius: var(--radius-pill); min-height: 36px; padding: 0 16px; font-weight: 700; font-size: 14px; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-height: 52px; align-items: flex-start; }
.rows li:first-child { border-top: 0; }
.rows .name { font-weight: 600; overflow-wrap: anywhere; }
.rows .note { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.rows .amt { font-weight: 800; white-space: nowrap; text-align: right; }
.hidden-panel .amt { color: var(--hidden); }
.hidden-panel .amt.unknown { color: var(--muted); font-weight: 400; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--hidden-soft); color: var(--hidden); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { color: var(--muted); font-size: 14px; margin: 0; }
.source { font-size: 12px; color: var(--muted); margin: 16px 0; overflow-wrap: anywhere; }
.source a { color: var(--muted); }

.sticky-actions { position: fixed; left: 0; right: 0; bottom: 64px; background: var(--surface); border-top: 1px solid var(--line); padding: 10px var(--gutter); display: flex; gap: 10px; justify-content: center; }
.sticky-actions > * { flex: 1; max-width: 220px; }
.btn { min-height: 50px; border-radius: var(--radius-button); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 16px; }
.btn.solid { background: var(--primary); border-color: var(--primary); color: var(--ink-on-primary); }
main.has-sticky { padding-bottom: 180px; }

/* Compare */
.compare-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.compare-pick select { width: 100%; }
.compare-total { background: var(--header-bg); color: #fff; border-radius: var(--radius-card); padding: 16px; margin-bottom: 12px; }
.compare-total .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare-total strong { display: block; font-size: 22px; font-weight: 800; }
.compare-total .sub { color: var(--on-dark-muted); font-size: 13px; }
.compare-total .verdict { margin-top: 12px; font-weight: 700; }
.crow { padding: 10px 0; border-top: 1px solid var(--line); }
.crow:first-child { border-top: 0; }
.crow .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-weight: 700; }
.crow.h .two { color: var(--hidden); }

/* Bottom navigation */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; max-width: 160px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); text-decoration: none; }
.bottom-nav a[aria-current="page"] { color: var(--primary); }
.site-note { max-width: 480px; margin: 0 auto; padding: 0 var(--gutter); }
.prose h2 { font-size: 16px; margin: 18px 0 6px; }
.prose p, .prose li { color: var(--ink); }

/* Feeder zone banner */
.zone { background: var(--zone-soft); border: 1px solid var(--zone-line); color: var(--zone); border-radius: var(--radius-card); padding: 14px 16px; margin-bottom: 12px; font-size: 14px; }
.zone-title { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 15px; }
.zone p { margin: 6px 0 0; }
.zone .strong { font-weight: 700; }
.zone .btn { margin-top: 10px; min-height: 44px; border-color: var(--zone-line); color: var(--zone); background: transparent; }

.link-row { padding: 0 !important; }
.link-row a { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 52px; color: inherit; text-decoration: none; }
.row-end { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.on-dark { color: var(--on-dark-muted); }

.offline-bar { position: sticky; top: 0; z-index: 5; background: #142033; color: #FFFFFF; text-align: center; font-size: 13px; font-weight: 600; padding: 8px var(--gutter); padding-top: max(8px, env(safe-area-inset-top)); }

.zone-line { font-size: 12px; }
.zone-guide { font-size: 12px; font-weight: 700; }
.zone-title { font-size: 14px; font-weight: 700; }
.sub-title { font-size: 13px; font-weight: 700; margin: 14px 0 4px; }
.bullets { margin: 0; padding-left: 18px; font-size: 14px; }
.bullets li { margin: 4px 0; }
.chips.radius { margin-top: 14px; }

/* Location search (Designer clean-up v1, item 1) */
.search-box { position: relative; }
.in-field-btn { width: 44px; height: 44px; margin-right: -8px; border: 0; background: transparent; color: var(--primary); display: grid; place-items: center; border-radius: 10px; }
.in-field-btn[aria-pressed="true"] { background: var(--primary-soft); }
.suggestions { display: grid; gap: 2px; margin: -6px 0 10px; }
.suggestion { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-box); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-align: left; text-decoration: none; }
.suggestion .icon { width: 16px; height: 16px; color: var(--muted); }
.prompt h2 { font-size: 17px; }
.prompt .chips { flex-wrap: wrap; margin-top: 10px; }
.filter-sheet { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-box); }
.filter-sheet[hidden] { display: none; }
.chip .badge { margin-left: 4px; padding: 0 6px; }
.chips.radius { margin-top: 0; margin-bottom: 8px; }
.link-btn { display: block; margin: 12px 0; min-height: 44px; border: 0; background: none; color: var(--primary); font-weight: 700; padding: 0; text-align: left; }

/* School cards (Designer clean-up v1, item 3) */
.card-title { flex: 1; min-width: 0; }
.card-top { align-items: flex-start; }
.distance { flex: none; font-size: 13px; font-weight: 700; color: var(--primary-ink); background: var(--primary-soft); border-radius: var(--radius-pill); padding: 2px 8px; }
.card-unknown { margin: 10px 0 0; }
.extras-line.one-line span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* School detail (Designer clean-up v1, items 4 and 5) */
.bottom-nav[hidden] { display: none; }
.sticky-actions.no-nav { bottom: 0; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
main.has-sticky { padding-bottom: 110px; }
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.extras-link { text-decoration: none; }
.extras-link span { min-width: 0; }
.contact-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.contact-buttons .btn { min-height: 48px; padding: 0 8px; }
.contact-text { margin: 10px 0 0; overflow-wrap: anywhere; }
.apply-btn { width: 100%; margin-top: 10px; }
.how-it-works { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.how-it-works summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; color: var(--primary); }
.missing-line { margin: 4px 0 8px; }
.grade-chips { margin: 4px 0 12px; }
.panel { padding: 16px; }
.panel h2 { font-size: 15px; font-weight: 700; }
.grade-picker select, .compare-pick select { min-height: 44px; }

/* ---------- Top bar and website welcome (Designer responsive-v1, steps 1-2) ---------- */
.top-bar { display: none; }
.welcome-title { font-size: 24px; font-weight: 800; line-height: 1.2; margin: 4px 0 8px; }
.welcome-line { font-size: 16px; margin: 0 0 4px; }
.feature-tiles { display: grid; gap: 10px; margin-top: 16px; }
.feature-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-box); padding: 14px; }
.feature-tile strong { font-size: 15px; font-weight: 700; }
.feature-tile p { margin: 4px 0 0; }
.feature-tile:nth-child(2) strong { color: var(--hidden); }
@media (min-width: 700px) {
  .top-bar { display: block; position: sticky; top: 0; z-index: 10; height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .top-inner { max-width: 1280px; height: 100%; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .brand { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; color: var(--ink); text-decoration: none; min-height: 44px; }
  .brand .icon { width: 28px; height: 28px; color: var(--primary); }
  .top-links { display: flex; gap: 4px; }
  .top-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
  .top-links a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
  .bottom-nav, .bottom-nav[hidden] { display: none; }
  .sticky-actions { bottom: 0; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  main { padding-bottom: 40px; }
  main.has-sticky { padding-bottom: 110px; }
  .welcome-title { font-size: 32px; }
  .feature-tiles { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Desktop two panes (Designer responsive-v1 step 3) ---------- */
@media (min-width: 700px) {
  .card { cursor: pointer; }
  .card:hover { border-color: var(--line-strong); box-shadow: 0 2px 8px rgba(20, 32, 51, .08); }
}
@media (min-width: 1100px) {
  main.two-pane { max-width: 1280px; display: grid; grid-template-columns: 400px 1fr; gap: 24px; padding-top: 0; padding-bottom: 0; height: calc(100vh - 64px); }
  .list-pane, .detail-pane { overflow-y: auto; padding: 20px 4px 40px; min-width: 0; }
  main.two-pane .list-pane .card-grid { grid-template-columns: 1fr; }
  .card.selected { border: 2px solid var(--primary); padding: 15px; }
  .pane-actions { position: sticky; top: -20px; z-index: 2; display: flex; gap: 10px; background: var(--bg); padding: 0 0 12px; margin-top: -20px; padding-top: 20px; }
  .pane-actions > * { flex: 1; max-width: 220px; }
  .detail-pane .head-bar a.icon-btn { visibility: hidden; }
  .big-money { font-size: 40px; }
}

/* ---------- Compare as a table on wider screens (Designer responsive-v1 step 4) ---------- */
.crow.chead { display: none; }
@media (min-width: 700px) {
  .compare-table { padding: 0 16px; }
  .compare-table .crow { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: 16px; align-items: baseline; padding: 12px 0; }
  .compare-table .crow .label { font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 600; }
  .compare-table .crow.chead { display: grid; position: sticky; top: 64px; background: var(--surface); z-index: 1; font-size: 15px; }
  .compare-table .crow.chead + .crow { border-top: 1px solid var(--line); }
}

/* ---------- Around me rings and cost chart (map plan B + C) ---------- */
.view-toggle { display: flex; width: 100%; margin: 4px 0 12px; }
.view-toggle button { flex: 1; padding: 0 8px; min-height: 40px; }
.viz svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto 8px; font-family: var(--font); }
.viz .ring { fill: none; stroke: var(--line-strong); stroke-dasharray: 4 4; }
.viz .ring-label, .viz .tick { fill: var(--muted); font-size: 11px; }
.viz .axis { fill: var(--muted); font-size: 12px; font-weight: 700; }
.viz .grid { stroke: var(--line); }
.viz .home { fill: var(--primary); stroke: var(--surface); stroke-width: 3; }
.viz .dot circle { fill: var(--surface); stroke: var(--primary); stroke-width: 2; }
.viz .dot text { fill: var(--ink); font-size: 10px; font-weight: 800; pointer-events: none; }
.viz .dot:hover circle, .viz .dot:focus circle, .viz .dot.selected circle { fill: var(--primary-soft); stroke-width: 3; }
.viz .bubble circle { fill: var(--primary); stroke: var(--surface); }
.viz .bubble text { fill: var(--ink-on-primary); font-size: 12px; }
.viz .sweet { fill: var(--zone-soft); }
.viz .sweet-label { fill: var(--zone); font-size: 11px; font-weight: 700; }
.school-links { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.school-links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }



/* ---------- Phone bottom sheet (Designer ux-v2 section 1) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(14, 22, 36, .35); z-index: 30; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--surface); color: var(--ink); border-radius: 22px 22px 0 0; box-shadow: 0 -4px 16px rgba(20, 32, 51, .12); padding: 6px var(--gutter) max(16px, env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
.sheet.full { height: 92vh; }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 4px auto 12px; }
.sheet-title { font-size: 16px; font-weight: 700; margin: 0; }
.sheet-title:focus { outline: none; }
.sheet-cost { margin: 12px 0 4px; }
.sheet-cost strong { display: block; font-size: 20px; font-weight: 800; }
.sheet-actions { display: flex; gap: 10px; margin-top: 12px; }
.sheet-actions .btn { flex: 1; min-height: 44px; }
.icon-btn.light { color: var(--ink); border-color: var(--line-strong); flex: none; }
.icon-btn.light[aria-pressed="true"] { color: var(--primary); }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -6px; background: var(--surface); padding: 4px 0 8px; z-index: 2; }
.sheet .profile-head { margin: 0 0 16px; border-radius: var(--radius-card); }
.sheet .profile-head .head-bar { display: none; }
.sheet .pane-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.sheet .pane-actions > * { flex: 1; }
.viz .has-selection .dot:not(.selected) { opacity: .5; }
.viz .dot.selected circle { stroke-width: 3; }

/* ---------- "Keep SchoolMap on your phone" tip (ux-v2 section 2) ---------- */
.home-tip { background: var(--primary-soft); border-radius: var(--radius-card); padding: 14px 16px; margin-bottom: 12px; }
.tip-head { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); }
.tip-head .icon { color: var(--primary); }
.home-tip p { margin: 6px 0 10px; }
.tip-steps { margin: 0 0 10px; padding-left: 20px; font-size: 14px; }
.tip-steps .icon { width: 16px; height: 16px; vertical-align: -3px; }
.tip-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tip-actions .btn { min-height: 44px; }
.sheet .profile-head h1 { display: none; } /* the sheet bar already shows the name */
.tip-actions .link-btn { margin: 0; }

/* ---------- Visual polish v1 (Designer, 28 Oct) ---------- */
/* 1. Scrollbars follow light/dark mode */
:root { color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { color-scheme: dark; } }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--bg); }
.chips { scrollbar-width: none; }
/* 3. All grades visible */
.grade-chips { flex-wrap: wrap; overflow: visible; }
@media (min-width: 1100px) {
  /* 2. The school header fits inside the desktop pane */
  .detail-pane { overflow-x: hidden; }
  .detail-pane .profile-head { margin: 0 0 16px; border-radius: 18px; border: 1px solid var(--line); position: relative; }
  /* 5. Save button sits in the header row next to the name; the bar comes after the header */
  .detail-pane .profile-head .head-bar { position: absolute; top: 14px; right: 16px; margin: 0; }
  .detail-pane .profile-head .head-bar a.icon-btn { display: none; }
  .detail-pane .profile-head h1 { padding-right: 56px; }
  .detail-pane .pane-actions { position: static; margin-top: 0; padding-top: 0; }
  /* 6. Both panes start at the same height */
  .list-pane, .detail-pane { padding-top: 20px; }
}

/* 8. Location button: spinner only; the field and a status line say what's happening */
.in-field-btn.busy .icon { display: none; }
.in-field-btn.busy::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--primary); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .in-field-btn.busy::after { animation: pulse 1.2s ease-in-out infinite; border-right-color: var(--primary); } }
.search-box input.finding { color: var(--muted); }
.loc-status { display: flex; align-items: center; gap: 6px; margin: -6px 0 10px; font-size: 13px; color: var(--muted); }
.loc-status .icon { width: 16px; height: 16px; color: var(--hidden); }
.loc-status[hidden] { display: none; }

/* ---------- First impression, round 1 (Designer + Marketing) ---------- */
.brand-row { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 800; color: var(--ink); margin: 0 0 14px; }
.brand-row .icon { color: var(--primary); width: 22px; height: 22px; }
@media (min-width: 700px) { .brand-row { display: none; } } /* the top bar shows the name there */
.free-line { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--zone); }
.trust-line { display: flex; align-items: flex-start; gap: 6px; margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.trust-line .icon { width: 16px; height: 16px; color: var(--zone); margin-top: 1px; }
.site-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-footer p { margin: 0 0 8px; }
.site-footer a { color: var(--muted); }

/* ---------- First impression, round 2 ---------- */
.popular { flex-wrap: wrap; align-items: center; margin: -2px 0 12px; }
.popular .label { margin-right: 2px; }
.example-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; color: var(--ink); text-decoration: none; margin: 4px 0 12px; }
.example-card .big-money { margin: 2px 0 6px; }
.example-card .extras-line { margin-bottom: 6px; }
.example-more { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; color: var(--primary); font-weight: 700; font-size: 14px; }
.example-more .icon { width: 16px; height: 16px; }
@media (min-width: 700px) { .example-card:hover { border-color: var(--line-strong); box-shadow: 0 2px 8px rgba(20, 32, 51, .08); } }
@media (min-width: 1100px) {
  .hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
  .hero .example-slot { padding-top: 40px; }
}
.share-row { margin: 0 0 12px; }
.share-row .btn { width: 100%; min-height: 48px; }

/* ---------- First impression, round 3 ---------- */
.feature-tile .icon { display: block; width: 22px; height: 22px; color: var(--primary); margin-bottom: 8px; }
.feature-tile.hidden { background: var(--hidden-soft); border-color: var(--hidden-line); }
.feature-tile.hidden .icon, .feature-tile.hidden strong { color: var(--hidden); }
.coverage-note { margin: -6px 0 14px; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 32px; }

/* ---------- Visual polish v2 ---------- */
.viz .dot text.long { font-size: 8px; letter-spacing: -0.2px; }
@media (min-width: 1100px) {
  .detail-pane .pane-actions { justify-content: flex-start; }
  .detail-pane .pane-actions > * { flex: 0 0 auto; max-width: none; padding: 0 20px; }
}

/* ---------- Home button (Nicholas 28 Oct: refresh kept opening one school; add a clear way home) ---------- */
.icon-btn.home-btn { width: auto; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 10px; font-size: 15px; font-weight: 700; }
a.brand-row { text-decoration: none; width: fit-content; min-height: 44px; margin-bottom: 4px; }
