@view-transition { navigation: auto; }

/* Workbench look: light grey ground, white panels with hairline borders, one indigo accent,
   dense type. Wide screens get a fixed sidebar; phones get a top bar and bottom tabs. */
:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --sunken: #f7f8fa;
  --ink: #111827;
  --muted: #646b78;
  --line: #e4e7ec;
  --brand: #4338ca;
  --brand-ink: #4338ca;
  --on-brand: #ffffff;
  --soft: #eef2ff;
  --gold: #818cf8;
  --gold-ink: #b45309;
  --gold-soft: #fef3c7;
  --accent: #111827;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --warn: #92400e;
  --warn-soft: #fffbeb;
  --danger: #b91c1c;
  --hero: #312e81;
  --hero-ink: #eef2ff;
  --hero-muted: #c7d2fe;
  --shadow: 0 1px 2px rgb(17 24 39 / .05), 0 8px 24px rgb(17 24 39 / .08);
  --r: 12px;
  --r-sm: 8px;
  --gutter: 16px;
  --gap: 30px;
  --pad: 18px;
  --side: 224px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --fs-xs: .8125rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.1875rem;
  --fs-2xl: 1.625rem;
  --tab-h: 56px;
  --ctl: 44px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
:root[data-theme="gray"], :root[data-theme="warm"] { color-scheme: light; }
:root[data-theme="warm"] {
  --bg: #f6efe2;
  --surface: #fffdf8;
  --sunken: #f8f2e6;
  --ink: #1f1a14;
  --muted: #6b6257;
  --line: #e8dcc8;
  --soft: #efeafc;
}
:root[data-theme="dark"] {
    --bg: #0f1115;
    --surface: #171a21;
    --sunken: #12151b;
    --ink: #e6e8ec;
    --muted: #9aa1ad;
    --line: #272c37;
    --brand: #4f46e5;
    --brand-ink: #a5b4fc;
    --soft: #1e2140;
    --gold: #6366f1;
    --gold-ink: #fbbf24;
    --gold-soft: #33290f;
    --accent: #f3f4f6;
    --ok: #6ee7b7;
    --ok-soft: #10261f;
    --warn: #fcd34d;
    --warn-soft: #2e2509;
    --danger: #fca5a5;
    --hero: #1e1b4b;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .3);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f1115;
    --surface: #171a21;
    --sunken: #12151b;
    --ink: #e6e8ec;
    --muted: #9aa1ad;
    --line: #272c37;
    --brand: #4f46e5;
    --brand-ink: #a5b4fc;
    --soft: #1e2140;
    --gold: #6366f1;
    --gold-ink: #fbbf24;
    --gold-soft: #33290f;
    --accent: #f3f4f6;
    --ok: #6ee7b7;
    --ok-soft: #10261f;
    --warn: #fcd34d;
    --warn-soft: #2e2509;
    --danger: #fca5a5;
    --hero: #1e1b4b;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}
@media (min-width: 640px) { :root { --gutter: 22px; } }
@media (min-width: 981px) { :root { --gutter: 24px; --gap: 40px; --pad: 22px; --fs-md: .9375rem; --fs-lg: 1rem; --fs-xl: 1.125rem; --fs-2xl: 1.75rem; --ctl: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 68px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--fs-md)/1.65 var(--sans);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
body.bare { padding-bottom: 0; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img { display: block; max-width: 100%; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: var(--fs-2xl); line-height: 1.3; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: var(--fs-xl); line-height: 1.4; font-weight: 700; }
h3 { font-size: var(--fs-md); line-height: 1.4; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
/* 16px on phones stops iOS zooming into a focused field */
input, select, textarea { font-size: 1rem; }
textarea { display: block; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); resize: vertical; min-height: 88px; }
textarea::placeholder, input::placeholder { color: var(--muted); }
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: var(--fs-sm); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--brand); color: var(--on-brand); padding: 10px 16px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.block-gap { margin-top: var(--gap); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); }
.tag { flex: none; display: inline-flex; align-items: center; height: 24px; font-size: var(--fs-xs); line-height: 1; padding: 0 8px; border-radius: 6px; background: var(--sunken); color: var(--muted); white-space: nowrap; border: 1px solid var(--line); }
.tag-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag-gold { background: var(--soft); color: var(--brand-ink); border-color: transparent; }
.lead { margin-top: 8px; color: var(--muted); max-width: 46em; line-height: 1.7; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--ctl); padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: background-color .15s, border-color .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--brand-ink); color: var(--brand-ink); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary, .btn-gold { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover, .btn-gold:hover { background: color-mix(in srgb, var(--brand) 88%, #000); border-color: var(--brand); color: var(--on-brand); }
.btn-quiet { background: transparent; border-style: dashed; font-weight: 400; color: var(--muted); }
.btn-text { min-height: var(--ctl); padding: 0; border: 0; background: transparent; color: var(--brand-ink); font-size: var(--fs-sm); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- shell: top bar on phones, sidebar on wide screens ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; margin-right: auto; color: var(--ink); min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; }
.brand-zh { font-weight: 700; font-size: 1rem; letter-spacing: .01em; }
.top-nav { display: none; }
.city-switch { position: relative; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--muted); }
.city-switch .ic { width: 15px; height: 15px; pointer-events: none; }
.city-switch select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); padding: 0 20px 0 0; margin-right: -20px; height: 44px; cursor: pointer; flex: 1; min-width: 0; }
.city-switch select:focus-visible { outline: none; }
.city-switch:focus-within { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.city-switch option { color: #111827; background: #fff; }
.acct { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--r-sm); background: var(--brand); color: var(--on-brand); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.acct:hover { text-decoration: none; background: color-mix(in srgb, var(--brand) 88%, #000); }
.acct .ic { width: 15px; height: 15px; }
.acct.is-in { background: var(--soft); color: var(--brand-ink); }
.acct span { max-width: 7em; overflow: hidden; text-overflow: ellipsis; }

.tabbar { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: grid; justify-items: center; align-content: center; gap: 2px; height: var(--tab-h); color: var(--muted); font-size: .6875rem; line-height: 1.2; }
.tabbar a:hover { text-decoration: none; }
.tabbar .ic { width: 22px; height: 22px; }
.tabbar a[aria-current] { color: var(--brand-ink); font-weight: 600; }

/* ---------- home workbench ---------- */
.dash { display: grid; gap: 14px; padding-top: 14px; }
.dash > * { min-width: 0; }
.dash-side, .dash-main { display: grid; gap: 14px; align-content: start; min-width: 0; }
.intro { padding: 24px 20px; border-radius: var(--r); background: var(--hero); color: var(--hero-ink); }
.intro .chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / .12); font-size: var(--fs-xs); color: var(--hero-muted); }
.intro h1 { margin-top: 14px; font-size: 1.75rem; line-height: 1.3; color: #fff; }
.intro .lead { color: var(--hero-muted); margin-top: 10px; }
.starter { display: grid; gap: 14px; }
.starter-title { font-weight: 700; font-size: var(--fs-lg); }
.starter-note { font-size: var(--fs-xs); color: var(--muted); }
.starter .btn { width: 100%; }
.figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.figures li { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 16px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.figures strong { font-size: 1.625rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.panel > .section-head { margin-bottom: 12px; }
.panel .school-list { border: 0; border-radius: 0; margin-inline: calc(var(--pad) * -1); margin-bottom: calc(var(--pad) * -1); border-top: 1px solid var(--line); }

/* ---------- section head ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: var(--fs-xl); }
.section-head a { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 600; min-height: 32px; white-space: nowrap; }
.section-head a .ic { width: 14px; height: 14px; }

/* ---------- city tiles ---------- */
.c-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.c-card a { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color .15s; }
.c-card a:hover { text-decoration: none; border-color: var(--brand-ink); }
.c-card img { width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover; }
.c-text { display: grid; gap: 2px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; min-width: 0; }
.c-country { display: none; }
.c-text strong { font-size: var(--fs-md); color: var(--ink); }

/* ---------- journey ---------- */
.journey { display: grid; gap: 10px; }
.journey li { display: grid; grid-template-columns: 36px 1fr; gap: 4px 14px; padding: var(--pad); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.j-no { grid-row: 1 / 4; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--soft); color: var(--brand-ink); font-size: var(--fs-sm); font-weight: 700; }
.journey p { font-size: var(--fs-sm); color: var(--muted); }
.j-links { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 2px; }
.j-links a { display: inline-flex; align-items: center; min-height: 36px; font-weight: 600; }

.cta-card { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 14px 16px; border-radius: var(--r); background: var(--hero); color: var(--hero-ink); }
.cta-card:hover { text-decoration: none; }
.cta-card > span:first-child { display: grid; gap: 2px; font-size: var(--fs-sm); color: var(--hero-muted); }
.cta-card strong { font-size: var(--fs-lg); color: #fff; }
.cta-go { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); background: rgb(255 255 255 / .14); }

/* ---------- horizontal school row ---------- */
.hscroll { --edge: var(--gutter); display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--edge); padding: 2px var(--edge) 10px; scrollbar-width: none; max-width: 1240px; margin-inline: auto; }
.hscroll::-webkit-scrollbar { display: none; }
.s-card { flex: none; width: 168px; scroll-snap-align: start; }
.s-card a { display: grid; gap: 2px; height: 100%; align-content: start; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s; }
.s-card a:hover { text-decoration: none; border-color: var(--brand-ink); }
.s-card strong { margin-top: 10px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.s-card .fee { margin-top: 8px; font-weight: 700; color: var(--accent); }
.s-card .muted { font-size: var(--fs-xs); }

.mono { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 10px; line-height: 1; font-size: .75rem; font-weight: 700; letter-spacing: .01em; }
.mono-long { font-size: .625rem; letter-spacing: 0; }
.tone-0 { background: #eef2ff; color: #4338ca; }
.tone-1 { background: #e0f2fe; color: #0369a1; }
.tone-2 { background: #fef3c7; color: #92400e; }
.tone-3 { background: #f3e8ff; color: #7e22ce; }
.tone-4 { background: #dcfce7; color: #166534; }
:root[data-theme="dark"] .tone-0 { background: #1e2140; color: #a5b4fc; }
:root[data-theme="dark"] .tone-1 { background: #0c2a3d; color: #7dd3fc; }
:root[data-theme="dark"] .tone-2 { background: #33290f; color: #fcd34d; }
:root[data-theme="dark"] .tone-3 { background: #2a1d3d; color: #d8b4fe; }
:root[data-theme="dark"] .tone-4 { background: #10261a; color: #86efac; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .tone-0 { background: #1e2140; color: #a5b4fc; }
  :root:not([data-theme]) .tone-1 { background: #0c2a3d; color: #7dd3fc; }
  :root:not([data-theme]) .tone-2 { background: #33290f; color: #fcd34d; }
  :root:not([data-theme]) .tone-3 { background: #2a1d3d; color: #d8b4fe; }
  :root:not([data-theme]) .tone-4 { background: #10261a; color: #86efac; }
}

/* ---------- ask ---------- */
.ask-band { display: grid; gap: 16px; padding: var(--pad); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.ask-band h2 { margin-bottom: 4px; }
.ask-box { display: grid; gap: 8px; padding: 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); align-content: start; }
.ask-box:focus-within { border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--soft); }
.ask-box textarea { border: 0; background: transparent; padding: 6px 6px 0; min-height: 56px; resize: none; outline: none; }
.ask-row { display: flex; gap: 8px; align-items: center; }
.ask-row select { flex: 1; min-width: 0; height: var(--ctl); padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunken); font-size: var(--fs-sm); }
.q-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.q-chips a, .q-chips button { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border-radius: 999px; border: 0; background: var(--soft); color: var(--brand-ink); font-size: var(--fs-sm); cursor: pointer; text-align: left; }
.q-chips a:hover, .q-chips button:hover { text-decoration: none; background: color-mix(in srgb, var(--soft) 80%, var(--brand)); }
.ask-head .ask-box { margin-top: 14px; max-width: 760px; }
.ask-layout { display: grid; gap: 12px; margin-top: 16px; }
.answer-text { line-height: 1.8; }
.answer-text sup a { padding: 0 2px; font-weight: 600; }
.src-list { display: grid; gap: 8px; margin-top: 12px; }
.src-list li { display: grid; grid-template-columns: 24px 1fr; gap: 4px 8px; padding: 12px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line); font-size: var(--fs-sm); }
.src-list .n { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--brand); color: var(--on-brand); font-size: .6875rem; font-weight: 700; }
.src-list p { grid-column: 2; color: var(--muted); }
.src-list .ext { grid-column: 2; font-size: var(--fs-xs); }
.faq-group { margin-top: 16px; }
.faq-group:first-child { margin-top: 0; }
.faq-group > h3 { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-of-type { border-top: 0; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 8px 0; cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 1.125rem; font-weight: 400; color: var(--muted); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 0 14px; font-size: var(--fs-sm); white-space: pre-line; }
.faq .a .muted { display: block; margin-top: 8px; }
#human-form { display: grid; gap: 10px; margin-top: 10px; }
.my-qs { display: grid; }
.my-qs li { padding: 12px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.my-qs li:first-child { border-top: 0; padding-top: 0; }
.my-qs .q-text { font-weight: 600; }
.my-qs .q-answer { margin-top: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--soft); white-space: pre-line; }
.my-qs .q-meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; color: var(--muted); font-size: var(--fs-xs); }
.ask-about .btn { margin-top: 10px; }

/* ---------- topic and tool cards ---------- */
.t-cards { display: grid; gap: 10px; }
.t-card a, .t-card.is-soon { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); min-height: 68px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .15s; }
.t-card a:hover { text-decoration: none; border-color: var(--brand-ink); }
.t-card a > .ic { color: var(--muted); width: 16px; height: 16px; }
.t-card.is-soon { color: var(--muted); border-style: dashed; background: transparent; }
.t-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--soft); color: var(--brand-ink); }
.is-soon .t-icon { background: var(--sunken); color: var(--muted); }
.t-text { display: grid; flex: 1; min-width: 0; line-height: 1.45; }
.t-text .muted { font-size: var(--fs-sm); }
.tool-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tool-cards a { display: grid; gap: 6px; align-content: start; height: 100%; padding: var(--pad); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s; }
.tool-cards a:hover { text-decoration: none; border-color: var(--brand-ink); }
.tool-cards .t-icon { margin-bottom: 4px; }
.tool-cards .muted { font-size: var(--fs-sm); line-height: 1.55; }

.trust { display: grid; gap: 8px; padding: calc(var(--pad) + 4px); border-radius: var(--r); background: var(--hero); color: var(--hero-muted); }
.trust strong { font-size: var(--fs-xl); color: #fff; }
.trust p { font-size: var(--fs-sm); max-width: 52em; }
.trust a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; font-size: var(--fs-sm); font-weight: 600; color: #fff; }
.trust a .ic { width: 14px; height: 14px; }

.empty-card { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--r); border: 1px dashed var(--line); color: var(--muted); }
.empty-card > .ic { width: 24px; height: 24px; }
.empty-card p { display: grid; gap: 2px; font-size: var(--fs-sm); }
.empty-card strong { color: var(--ink); font-size: var(--fs-md); }

/* ---------- city page ---------- */
.city-hero { position: relative; height: 180px; margin: 12px var(--gutter) 0; border-radius: var(--r); background: var(--hero); color: #fff; overflow: hidden; }
.city-hero img { width: 100%; height: 100%; object-fit: cover; }
.city-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(17 24 39 / .88), rgb(17 24 39 / .1) 75%); }
.city-hero-text { position: absolute; inset: auto 0 14px; z-index: 1; padding-inline: 16px; font-size: var(--fs-sm); max-width: none; }
.city-hero-text h1 { margin: 0 0 2px; font-size: 1.75rem; color: #fff; }
.city-hero .crumb a { color: #fff; }
.lift { margin-top: 12px; }
.photo-credit { margin-top: 20px; font-size: var(--fs-xs); }
.entries { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 6px; }
.entries a { display: grid; justify-items: center; gap: 6px; color: var(--ink); font-size: var(--fs-xs); text-align: center; }
.entries a:hover { text-decoration: none; color: var(--brand-ink); }
.e-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--soft); color: var(--brand-ink); }
.e-icon .ic { width: 20px; height: 20px; }

/* ---------- page head ---------- */
.page-head { padding: 22px 0 4px; }
.crumb { font-size: var(--fs-sm); margin-bottom: 4px; }
.crumb a { display: inline-flex; align-items: center; min-height: 36px; margin-block: -8px; color: var(--muted); }
.crumb a::before { content: "‹"; margin-right: 6px; font-size: 1.2em; line-height: 1; }
.pills { display: flex; gap: 6px; overflow-x: auto; margin: 12px calc(var(--gutter) * -1) 0; padding: 2px var(--gutter) 4px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills a { flex: none; display: inline-flex; align-items: center; height: var(--ctl); padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); }
.pills a:hover { text-decoration: none; border-color: var(--brand-ink); }
.pills a[aria-current] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }

/* ---------- school list ---------- */
.list-layout { margin-top: 14px; }
.filter-bar { position: sticky; top: 52px; z-index: 10; margin-inline: calc(var(--gutter) * -1); padding: 8px var(--gutter); background: var(--bg); }
.bar-row { display: flex; gap: 8px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); outline: none; height: 100%; }
.search:focus-within { border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--soft); }
.filter-toggle { display: inline-flex; align-items: center; gap: 6px; height: var(--ctl); padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; }
.filter-toggle.is-active, .filter-toggle[aria-expanded="true"] { border-color: var(--brand-ink); color: var(--brand-ink); font-weight: 600; }
.filter-panel { display: grid; gap: 14px; margin-top: 8px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.q legend, .field { font-size: var(--fs-sm); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chips span { display: inline-flex; align-items: center; height: var(--ctl); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 400; transition: background-color .15s, color .15s; }
.chips input:checked + span { background: var(--soft); border-color: var(--brand-ink); color: var(--brand-ink); font-weight: 600; }
.chips input:focus-visible + span { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.field { display: grid; gap: 6px; }
.field select, .field input { width: 100%; height: var(--ctl); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background-color: var(--sunken); font-weight: 400; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646b78' stroke-width='2' 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 10px center; background-size: 16px; }
.field select:focus, .field input:focus, textarea:focus { border-color: var(--brand-ink); outline: none; box-shadow: 0 0 0 3px var(--soft); }
.field textarea { font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.list-status { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 12px 2px 8px; font-size: var(--fs-sm); color: var(--muted); }
.list-status strong { color: var(--ink); font-size: var(--fs-lg); }
.school-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.school-list:empty { display: none; }
.school-row { position: relative; border-top: 1px solid var(--line); }
.school-row:first-child, .school-row[hidden] + .school-row:not([hidden]) { border-top-color: transparent; }
.school-row > a { display: grid; grid-template-columns: 44px 1fr; gap: 2px 14px; padding: 16px 56px 16px 16px; color: var(--ink); transition: background-color .15s; }
.school-row > a:hover { text-decoration: none; background: var(--sunken); }
.school-row .mono { grid-row: 1 / 3; }
.row-main { display: grid; min-width: 0; }
.row-main .name { line-height: 1.4; font-weight: 600; }
.row-main .alt, .row-main .meta { font-size: var(--fs-sm); color: var(--muted); }
.row-main .alt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-fee { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 4px; }
.row-fee .fee { font-weight: 700; font-size: var(--fs-lg); color: var(--accent); }
.row-fee .local { font-size: var(--fs-xs); color: var(--muted); }
.fee-bar { grid-column: 2; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.fee-bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; transform-origin: left; transition: transform .45s var(--ease); }
.fav { position: absolute; top: 8px; right: 6px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; }
.fav:hover { background: var(--sunken); }
.fav .ic { width: 20px; height: 20px; transition: transform .3s var(--ease); }
.fav[aria-pressed="true"] { color: #e11d48; }
.fav[aria-pressed="true"] .ic { fill: currentColor; }
.fav:active .ic { transform: scale(.8); }
.empty { margin-top: 12px; padding: 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }
.note { margin-top: 10px; }

/* ---------- school page ---------- */
.school-head { padding-top: 14px; }
.school-card { margin-top: 6px; padding: calc(var(--pad) + 2px) var(--pad); }
.school-title { display: flex; align-items: flex-start; gap: 12px; }
.school-title > div { flex: 1; min-width: 0; }
.school-title h1 { font-size: 1.5rem; }
.school-title .alt { color: var(--muted); font-size: var(--fs-sm); }
.school-title .fav { position: static; margin: -6px -8px 0 0; }
.school-title .mono { width: 48px; height: 48px; font-size: var(--fs-xs); }
.school-title .mono-long { font-size: .625rem; }
.headline-fee { display: grid; gap: 2px; margin-top: 16px; }
.headline-fee > .num:first-child { font-size: 2rem; font-weight: 700; line-height: 1.2; color: var(--accent); width: fit-content; letter-spacing: -.01em; }
.headline-fee .per, .headline-fee .local { font-size: var(--fs-sm); color: var(--muted); }
.keyfacts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.keyfacts div, .facts div { padding: 12px 14px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); }
.keyfacts dt, .facts dt, .once dt { font-size: var(--fs-xs); color: var(--muted); }
.keyfacts dd, .facts dd { font-size: var(--fs-sm); font-weight: 600; }
.school-layout, .guide-layout, .tool-layout { display: grid; gap: 14px; margin-top: 14px; }
.col-main, .col-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.card h2 { margin-bottom: 12px; }
.card h3 { margin: 14px 0 6px; }
.card > p + p { margin-top: 8px; }
.table-scroll { overflow-x: auto; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); }
table.fees { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.fees th, .fees td { padding: 11px 0; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.fees th:first-child { text-align: left; white-space: normal; padding-right: 12px; font-weight: 400; }
.fees thead th { border-top: 0; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); padding-top: 0; }
.fees td + td { padding-left: 14px; }
.fees td.muted { font-size: var(--fs-sm); }
.once { display: grid; gap: 0; }
.once div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.once div:first-child { border-top: 0; }
.once dt { font-size: var(--fs-sm); }
.once dd { font-weight: 600; text-align: right; }
.notes, .points { display: grid; gap: 10px; margin-top: 12px; font-size: var(--fs-sm); }
.notes li, .points li { position: relative; padding-left: 14px; }
.notes li::before, .points li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.notes { color: var(--muted); }
.points { margin-top: 0; font-size: var(--fs-md); }
.status { margin-top: 10px; padding: 8px 12px; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.todo { background: var(--warn-soft); color: var(--warn); }
.source .muted, .calc .muted { margin-top: 8px; }
.total { display: grid; gap: 2px; margin-top: 12px; }
.total > .num:first-child { font-size: 1.625rem; font-weight: 700; line-height: 1.25; color: var(--accent); }
.total .local { font-size: var(--fs-sm); color: var(--muted); }
.contact { display: grid; gap: 4px; margin-top: 10px; font-size: var(--fs-sm); }
.link-list { display: grid; }
.link-list a { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--line); color: var(--ink); }
.link-list li:first-child a { border-top: 0; }
.link-list .ic { color: var(--brand-ink); }
.card.related h2 { margin-bottom: 2px; }

/* ---------- guides ---------- */
.guide-topics { display: grid; gap: 8px; }
.g-head { display: flex; align-items: center; gap: 12px; }
.g-head > div { flex: 1; min-width: 0; }
.g-head > .ic { color: var(--muted); }
.g-link { display: block; color: var(--ink); }
.g-link:hover { text-decoration: none; }
.g-topic .pills { margin-top: 10px; }
.g-topic .pills a { background: var(--sunken); }
.g-topic.is-soon { background: transparent; border-style: dashed; }
.guide-lead .summary { font-size: 1.125rem; line-height: 1.8; }
.facts { display: grid; gap: 8px; margin-top: 14px; }
.steps { display: grid; gap: 12px; counter-reset: step; }
.steps li { position: relative; padding-left: 36px; counter-increment: step; min-height: 24px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--soft); color: var(--brand-ink); font-size: var(--fs-xs); font-weight: 700; }
.stages { display: grid; }
.stages li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.stages li:first-child { border-top: 0; padding-top: 0; }
.stages .num { color: var(--brand-ink); font-weight: 600; font-size: var(--fs-sm); }
.stages p { grid-column: 1 / -1; }
.area-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.area-chips li { padding: 5px 12px; border-radius: 999px; background: var(--soft); color: var(--brand-ink); font-size: var(--fs-sm); }
.sources { display: grid; }
.sources li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.sources li:first-child { border-top: 0; padding-top: 0; }
.sources a { overflow-wrap: anywhere; }

/* ---------- tools ---------- */
.tool-form { display: grid; gap: 14px; align-content: start; }
.progress { font-size: var(--fs-sm); color: var(--muted); }
.checklist { display: grid; gap: 12px; align-content: start; }
.cl-phase header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.cl-phase h2 { margin: 0; }
.cl-date { font-size: var(--fs-sm); color: var(--brand-ink); font-weight: 600; }
.cl-phase li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.cl-phase li:first-child { border-top: 0; }
.cl-phase label { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 0; cursor: pointer; }
.cl-phase input { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border-radius: 6px; border: 1.5px solid var(--muted); background: var(--surface); cursor: pointer; transition: background-color .15s, border-color .15s; }
.cl-phase input:checked { border-color: var(--brand); background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat; }
.cl-phase input:checked + span { color: var(--muted); text-decoration: line-through; }
.cl-phase li > a { flex: none; font-size: var(--fs-sm); display: inline-flex; align-items: center; min-height: 44px; }
.budget-result .once { margin-top: 12px; }
.budget-result .total { margin-top: 0; }

/* ---------- my plan ---------- */
.plan-layout { display: grid; gap: 12px; margin-top: 12px; }
.plan-layout > * { min-width: 0; }
.plan-layout.has-plan .plan-form { order: 2; }
.plan-form { display: grid; gap: 14px; align-content: start; }
.plan-form h2 { margin: 0; }
.kids { display: grid; gap: 8px; }
.kid { display: grid; grid-template-columns: 1fr var(--ctl); gap: 8px; align-items: end; }
.kid:has(> span:empty) { grid-template-columns: 1fr; }
.kid > span:empty { display: none; }
.kid button { height: var(--ctl); border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.plan-out { display: grid; gap: 12px; align-content: start; }
.plan-sec > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.plan-sec > header h2 { margin: 0; }
.plan-sec > header .step { display: grid; place-items: center; min-width: 28px; height: 24px; padding: 0 6px; border-radius: 6px; background: var(--soft); color: var(--brand-ink); font-size: var(--fs-xs); font-weight: 700; }
.plan-hero { background: var(--hero); border-color: var(--hero); color: var(--hero-muted); }
.plan-hero .eyebrow { display: none; }
.plan-hero h2 { font-size: 1.25rem; line-height: 1.45; color: #fff; margin-bottom: 4px; }
.plan-hero p { font-size: var(--fs-sm); }
.plan-hero .btn-row .btn { background: rgb(255 255 255 / .12); border-color: transparent; color: #fff; }
.plan-hero .btn-row .btn-gold { background: #fff; color: var(--hero); }
.plan-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.plan-stats div { padding: 12px 8px; text-align: center; border-radius: var(--r-sm); background: rgb(255 255 255 / .1); font-size: var(--fs-xs); line-height: 1.4; }
.plan-stats strong { display: block; font-size: 1.25rem; font-weight: 700; color: #fff; }
.match { display: grid; }
.match li { position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 0 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.match li:first-child { border-top: 0; padding-top: 0; }
.match .mono { grid-row: 1 / 3; }
.match a.name { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink); font-weight: 600; }
.match .meta { grid-column: 2; font-size: var(--fs-xs); color: var(--muted); }
.match .fee { grid-column: 3; grid-row: 1 / 3; text-align: right; font-weight: 700; color: var(--accent); white-space: nowrap; }
.match .fee small { display: block; font-weight: 400; font-size: var(--fs-xs); color: var(--muted); }
.city-opts { display: grid; gap: 8px; }
.city-opts a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.city-opts a:hover { text-decoration: none; border-color: var(--brand-ink); }
.city-opts .muted { grid-column: 1 / -1; }
.timeline { display: grid; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold); }
.timeline li.done::before { background: var(--brand); border-color: var(--brand); }
.timeline strong { display: block; }
.timeline .when { font-size: var(--fs-xs); color: var(--brand-ink); font-weight: 600; }
.timeline p { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- community ---------- */
.post-list { display: grid; gap: 8px; }
.post-list a { display: grid; gap: 4px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s; }
.post-list a:hover { text-decoration: none; border-color: var(--brand-ink); }
.post-list strong { font-size: var(--fs-lg); line-height: 1.4; }
.post-list p { font-size: var(--fs-sm); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: var(--fs-xs); color: var(--muted); }
.ev-list { display: grid; gap: 8px; }
.ev-list:empty { display: none; }
.ev { display: grid; gap: 6px; justify-items: start; }
.ev h3 { margin: 0; font-size: var(--fs-lg); }
.ev-top { display: flex; flex-wrap: wrap; gap: 6px; }
.ev .ev-when { font-weight: 700; color: var(--brand-ink); }
.ev form { display: grid; gap: 10px; width: 100%; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.post-form { display: grid; gap: 14px; max-width: 760px; }
.post-form h2 { margin: 0; }
.organizer { display: flex; gap: 14px; align-items: flex-start; }
.organizer h2 { margin-bottom: 4px; }
.organizer p { font-size: var(--fs-sm); max-width: 52em; }
.organizer p + p { margin-top: 6px; }
.post-page { max-width: 760px; padding-top: 18px; }
.post-page h1 { margin: 4px 0 8px; font-size: 1.625rem; }
.post-body { margin-top: 18px; font-size: 1.0625rem; line-height: 1.9; }
.post-body p + p { margin-top: 1.1em; }
.post-sources { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.eyebrow { font-size: var(--fs-xs); color: var(--brand-ink); font-weight: 600; }

.prose { max-width: 760px; }
.prose h2 { margin: 22px 0 6px; }
.prose h2:first-child { margin-top: 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }

/* ---------- account ---------- */
.login-wrap { display: grid; place-items: start center; padding-top: 24px; }
.login-card { display: grid; gap: 14px; width: 100%; max-width: 420px; padding: 22px 18px; }
#login-step2 { display: grid; gap: 14px; }
.login-card .btn { width: 100%; }
.me-card { display: grid; gap: 10px; }
.me-card h2 { margin: 0; }
.me-id { display: flex; align-items: center; gap: 12px; }
.me-id .avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--brand); color: var(--on-brand); font-size: 1.125rem; font-weight: 700; }
.me-name { display: flex; gap: 8px; }
.me-name input { flex: 1; min-width: 0; height: var(--ctl); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); }

/* ---------- compare ---------- */
.cmp { position: absolute; top: 50px; right: 6px; display: grid; justify-items: center; align-content: center; gap: 2px; width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: .625rem; line-height: 1; cursor: pointer; }
.cmp:hover { background: var(--sunken); }
.cmp .ic { width: 18px; height: 18px; }
.cmp[aria-pressed="true"] { color: var(--brand-ink); background: var(--soft); font-weight: 600; }
.school-title .cmp { position: static; margin: -6px 0 0; }
.cmp-tray { position: fixed; z-index: 25; left: var(--gutter); right: var(--gutter); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 10px); display: flex; align-items: center; gap: 6px; max-width: 480px; margin-inline: auto; padding: 6px 6px 6px 14px; border-radius: var(--r); background: var(--ink); color: var(--surface); box-shadow: var(--shadow); font-size: var(--fs-sm); }
.cmp-tray span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-tray a { flex: none; display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--r-sm); background: var(--brand); color: #fff; font-weight: 600; }
.cmp-tray a:hover { text-decoration: none; }
.cmp-tray button { flex: none; height: 40px; padding: 0 10px; border: 0; background: transparent; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cmp-layout { display: grid; gap: 12px; margin-top: 12px; }
.cmp-layout > * { min-width: 0; }
.cmp-controls { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.cmp-controls .muted { grid-column: 1 / -1; }
.cmp-controls .muted:empty { display: none; }
.cmp-card { padding: 14px 10px; }
.cmp-card .table-scroll { margin-inline: -10px; padding-inline: 10px; }
.cmp-card > .muted { margin-top: 10px; }
.cmp-table { width: 100%; min-width: calc(64px + var(--n, 1) * 82px); border-collapse: collapse; table-layout: fixed; font-size: var(--fs-sm); }
.cmp-table th, .cmp-table td { padding: 9px 6px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.cmp-table thead th, .cmp-table thead td { border-top: 0; }
.cmp-table thead th { font-weight: 600; }
.cmp-table th[scope="row"], .cmp-table thead td { width: 64px; padding-left: 0; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
.cmp-table thead a { display: block; color: var(--ink); }
.cmp-table .mono { margin-bottom: 6px; }
.cmp-table .fee { display: block; color: var(--accent); font-weight: 700; }
.cmp-table .sub { display: block; font-size: var(--fs-xs); color: var(--muted); }
.cmp-remove { margin-top: 2px; min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: var(--fs-xs); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- city comparison ---------- */
.city-qs { display: grid; gap: 12px; margin-top: 12px; }
.cq .muted { margin-top: 8px; font-size: var(--fs-xs); }
.cq-rows li { display: grid; grid-template-columns: minmax(5.5em, max-content) 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.cq-rows li:first-child, .cq-bars li:first-child a { border-top: 0; padding-top: 0; }
.cq-rows .muted { margin: 0; }
.cq-city { font-weight: 600; }
.cq-bars a { display: grid; grid-template-columns: 5.5em 1fr; gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: var(--fs-sm); }
.cq-bars a:hover { text-decoration: none; }
.cq-val { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }
.cq-val strong { color: var(--accent); }
.cq-val .muted { margin: 0; }
.cq-bars .fee-bar { grid-column: 2; }

/* ---------- admin ---------- */
.admin { display: grid; gap: 12px; max-width: 1240px; margin-inline: auto; padding: 14px var(--gutter) 60px; }
.admin-nav { display: flex; gap: 4px; overflow-x: auto; padding: 4px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); scrollbar-width: none; }
.admin-nav button { flex: none; display: inline-flex; align-items: center; gap: 6px; height: var(--ctl); padding: 0 14px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--muted); font-size: var(--fs-sm); cursor: pointer; }
.admin-nav button:hover { color: var(--ink); background: var(--sunken); }
.admin-nav button[aria-current] { background: var(--soft); color: var(--brand-ink); font-weight: 600; }
.admin-nav .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e11d48; color: #fff; font-size: .625rem; font-weight: 700; }
.admin-main { display: grid; gap: 12px; align-content: start; min-width: 0; }
.admin-main h2 { margin-bottom: 8px; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 12px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); font-size: var(--fs-sm); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--soft); color: var(--brand-ink); font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-grid div { padding: 16px 10px; text-align: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: var(--fs-xs); color: var(--muted); }
.stat-grid strong { display: block; font-size: 1.625rem; font-weight: 700; color: var(--ink); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; margin-top: 8px; }
.bars span { flex: 1; min-width: 3px; background: var(--gold); border-radius: 3px 3px 0 0; position: relative; }
.bars span:hover { background: var(--brand); }
.bars span:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding: 4px 8px; border-radius: 4px; background: #111827; color: #fff; font-size: .6875rem; white-space: nowrap; z-index: 2; }
.a-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.a-table th, .a-table td { padding: 9px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.a-table th { font-size: var(--fs-xs); font-weight: 400; color: var(--muted); border-top: 0; white-space: nowrap; }
.a-table td.nowrap { white-space: nowrap; }
.a-table tr.click { cursor: pointer; }
.a-table tr.click:hover td { background: var(--sunken); }
.a-item { display: grid; gap: 8px; }
.a-item .a-q { font-weight: 600; white-space: pre-line; }
.a-form { display: grid; gap: 12px; }
.a-form .grid2 { display: grid; gap: 10px; }
.a-form .check { display: flex; align-items: center; gap: 8px; min-height: var(--ctl); font-size: var(--fs-sm); font-weight: 400; cursor: pointer; }
.a-form .check input { width: 18px; height: 18px; accent-color: var(--brand); }
.a-form textarea.code { font: .8125rem/1.6 ui-monospace, Consolas, monospace; min-height: 360px; }
.band-table input { height: 36px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); width: 100%; min-width: 64px; }
.band-table td { padding: 3px; border: 0; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: var(--r-sm); background: var(--ink); color: var(--surface); font-size: var(--fs-sm); box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.err { background: #b91c1c; }
body:not(.bare) .toast { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px); }

/* ---------- footer ---------- */
.site-footer { margin-top: 48px; padding: 20px 0 24px; border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 16px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 36px; font-size: var(--fs-sm); color: var(--muted); }
.site-footer .muted { font-size: var(--fs-xs); width: 100%; max-width: 76em; }

/* ---------- tablet ---------- */
@media (min-width: 640px) {
  .figures { grid-template-columns: repeat(4, 1fr); }
  .c-cards { grid-template-columns: repeat(2, 1fr); }
  .journey { grid-template-columns: repeat(2, 1fr); }
  .t-cards { grid-template-columns: repeat(2, 1fr); }
  .tool-cards { grid-template-columns: repeat(4, 1fr); }
  .entries { grid-template-columns: repeat(8, 1fr); }
  .city-hero { height: 220px; }
  .keyfacts { grid-template-columns: repeat(4, 1fr); }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .guide-topics { grid-template-columns: repeat(2, 1fr); }
  .ev-list { grid-template-columns: repeat(2, 1fr); }
  .post-list { grid-template-columns: repeat(2, 1fr); }
  .school-row > a { grid-template-columns: 40px 1fr auto; padding-right: 108px; align-items: center; }
  .row-fee { grid-column: 3; grid-row: 1 / 3; flex-direction: column; align-items: flex-end; margin-top: 0; text-align: right; gap: 0; }
  .fee-bar { grid-column: 2 / 4; }
  .fav { top: 50%; margin-top: -22px; right: 8px; }
  .cmp { top: 50%; margin-top: -22px; right: 54px; }
  .pills { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; }
  .cmp-card { padding: 16px; }
  .cmp-card .table-scroll { margin-inline: -16px; padding-inline: 16px; }
  .cmp-table th[scope="row"], .cmp-table thead td { width: 110px; font-size: var(--fs-sm); }
  .city-qs { grid-template-columns: repeat(2, 1fr); align-items: start; }
  .city-opts { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .a-form .grid2 { grid-template-columns: 1fr 1fr; }
  .ask-band { grid-template-columns: 1fr 1fr; gap: 24px; padding: 20px; align-items: center; }
  .login-wrap { padding-top: 56px; }
  .login-card { padding: 28px 26px; }
}

/* ---------- wide: sidebar shell ---------- */
@media (min-width: 981px) {
  body, body.bare { padding: 0 0 0 var(--side); }
  input, select, textarea { font-size: var(--fs-md); }
  .tabbar { display: none; }
  .top { position: fixed; inset: 0 auto 0 0; width: var(--side); height: auto; flex-direction: column; align-items: stretch; gap: 6px; padding: 16px 12px; border-bottom: 0; border-right: 1px solid var(--line); overflow-y: auto; }
  .brand { margin: 0 0 14px 8px; flex: none; }
  .top-nav { display: grid; gap: 2px; }
  .top-nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: var(--r-sm); color: var(--muted); font-size: var(--fs-md); }
  .top-nav a:hover { text-decoration: none; background: var(--sunken); color: var(--ink); }
  .top-nav a[aria-current] { background: var(--soft); color: var(--brand-ink); font-weight: 600; }
  .nav-label { display: block; margin: 12px 10px 2px; font-size: var(--fs-xs); color: var(--muted); }
  .nav-gap { display: block; height: 8px; }
  .nav-gap:first-child { display: none; }
  .city-switch { margin-top: auto; height: 38px; }
  .acct { height: 38px; }
  .wrap, .hscroll, .admin { max-width: 1400px; margin-inline: 0; }
  .dash { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: var(--gutter); padding-top: var(--gutter); align-items: start; }
  /* Whichever column is shorter stays in view while the other scrolls; app.js sets --stick from its height */
  .dash-side, .dash-main { display: grid; gap: var(--gutter); position: sticky; top: var(--stick, var(--gutter)); }
  .dash > * > * { order: 0; }
  .intro { padding: 30px 26px; }
  .intro h1 { font-size: 2rem; }
  .journey { grid-template-columns: repeat(4, 1fr); }
  .t-cards { grid-template-columns: repeat(3, 1fr); }
  .page-head { padding-top: 32px; }
  .city-hero { height: 240px; margin-top: 24px; }
  .filter-bar { position: static; margin: 0; padding: 0; background: transparent; }
  .filter-toggle { display: none; }
  .cmp-tray { bottom: 20px; left: calc(var(--side) + var(--gutter)); }
  body:not(.bare) .toast, .toast { bottom: 24px; left: calc(50% + var(--side) / 2); }
  .site-footer { margin-top: 48px; }
  .admin { padding-top: 24px; }
}

/* Two-column page layouts need more room than the sidebar leaves on small laptops */
@media (min-width: 1180px) {
  .list-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; }
  .filter-bar { position: sticky; top: 20px; }
  .filter-panel { margin-top: 10px; }
  .list-status { margin-top: 2px; }
  .school-layout, .guide-layout, .ask-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
  .col-side { position: sticky; top: 20px; }
  .tool-layout, .plan-layout, .cmp-layout { grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
  .tool-form, .plan-form, .cmp-controls { position: sticky; top: 20px; }
  .plan-layout.has-plan .plan-form { order: 0; }
  .cmp-controls { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (min-width: 981px) { body.bare .acct { margin-top: auto; } }

/* Glyphs set inside fixed boxes sit dead centre */
.brand-mark, .j-no, .t-icon, .e-icon, .src-list .n, .plan-sec > header .step, .me-id .avatar, .admin-nav .badge, .cta-go, .steps li::before { line-height: 1; }
.btn, .acct, .pills a, .pills button, .chips span, .q-chips a, .q-chips button { line-height: 1.2; text-align: center; }

/* ---------- exchange-rate ticker ---------- */
.ticker { overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.ticker-track { display: flex; width: max-content; animation: ticker 48s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-set { display: flex; align-items: center; flex: none; }
.ticker-set span { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 20px; white-space: nowrap; font-variant-numeric: tabular-nums; border-right: 1px solid var(--line); }
.ticker-set b { font-weight: 400; color: var(--muted); }
.ticker-note { color: var(--muted); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- open-day timeline ---------- */
.od-filter { margin-top: 14px; }
.pills button { flex: none; display: inline-flex; align-items: center; height: var(--ctl); padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); cursor: pointer; }
.pills button:hover { border-color: var(--brand-ink); }
.pills button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.od-timeline { display: grid; gap: 22px; margin-top: 18px; }
.od-month > h2 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.od-list { display: grid; }
.od-list li { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 0 0 18px; }
.od-list li::before { content: ""; position: absolute; left: 31px; top: 62px; bottom: 2px; width: 2px; background: var(--line); }
.od-list li:last-child { padding-bottom: 0; }
.od-list li:last-child::before { display: none; }
.od-date { display: grid; justify-items: center; align-content: center; gap: 2px; width: 64px; height: 60px; border-radius: 10px; background: var(--soft); color: var(--brand-ink); font-size: .6875rem; line-height: 1.2; text-align: center; }
.od-date strong { font-size: 1.375rem; line-height: 1; }
.od-body { min-width: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.od-body .name { display: inline-flex; align-items: center; min-height: 36px; font-weight: 700; font-size: var(--fs-lg); color: var(--ink); }
.od-body p { font-size: var(--fs-sm); margin-top: 2px; }
.od-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px !important; color: var(--muted); }
.od-mini li { padding-bottom: 12px; }
.od-mini .od-body { border: 0; background: transparent; padding: 4px 0 0; }
.od-mini li::before { display: none; }

@media (min-width: 981px) {
  .ticker-set span { height: 40px; padding: 0 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; }
  .ticker-track { animation: none; }
  .ticker-set[aria-hidden] { display: none; }
}

.journey li { grid-template-rows: auto 1fr auto; }
.j-links { align-self: end; }

/* ---------- home: left column cards ---------- */
/* On phones the two columns dissolve into one list, in reading order */
/* Phones: two doors first, then the ask box, open days, cities, parents talking and the top fees */
@media (max-width: 980px) {
  .dash-side, .dash-main { display: contents; }
  /* The cards are now the grid items; a wide scroller inside one must not widen the column */
  .dash-side > *, .dash-main > * { min-width: 0; }
  .dash .intro { order: 1; }
  .dash .doors { order: 2; }
  .dash .ask-card { order: 3; }
  .dash #od-panel { order: 4; }
  .dash .cities-panel { order: 5; }
  .dash .talk-panel { order: 6; }
  .dash .fees-panel { order: 7; }
  .dash .starter, .dash .figures, .dash .steps-card, .wide-only { display: none; }
  .ask-card > .muted { display: none; }
  .ask-card .q-chips li:nth-child(n+3) { display: none; }
  .fees-panel .school-row:nth-child(n+4) { display: none; }
  .cities-panel .c-cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--pad) * -1); padding: 2px var(--pad) 4px; scrollbar-width: none; }
  .cities-panel .c-card { flex: 0 0 72%; scroll-snap-align: start; }
}
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.door { display: grid; gap: 2px; align-content: start; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.door:hover { text-decoration: none; border-color: var(--brand-ink); }
.door .ic { width: 22px; height: 22px; margin-bottom: 6px; color: var(--brand-ink); }
.door strong { font-size: var(--fs-lg); }
.door span { font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; }
.door-pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.door-pri .ic { color: #fff; }
.door-pri span { color: rgb(255 255 255 / .8); }
@media (min-width: 981px) { .doors { display: none; } }
.talk-panel [data-threads-empty] { margin-top: 4px; }
.ask-card .ask-box { margin-top: 12px; background: var(--sunken); }
.steps-card .journey { gap: 0; }
.steps-card .journey li { padding: 14px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.steps-card .journey li:first-child { border-top: 0; padding-top: 2px; }
.steps-card .journey li:last-child { padding-bottom: 0; }
.steps-card .journey { grid-template-columns: 1fr; }

/* ---------- dropdown lists ---------- */
/* Browsers that allow it draw the opened list in the site's own style; others keep their native list.
   Phones are left alone: their native pickers are easier to use with a thumb. */
@supports (appearance: base-select) {
  @media (hover: hover) and (pointer: fine) {
    select, .field select, .city-switch select, .ask-row select, ::picker(select) { appearance: base-select; -webkit-appearance: base-select; }
    select { display: flex; align-items: center; cursor: pointer; }
    select::picker-icon { display: none; }
    ::picker(select) { margin: 6px 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); max-height: 340px; min-width: anchor-size(width); font-size: var(--fs-md); font-weight: 400; opacity: 0; transition: opacity .12s, display .12s allow-discrete, overlay .12s allow-discrete; }
    ::picker(select):popover-open { opacity: 1; }
    @starting-style { ::picker(select):popover-open { opacity: 0; } }
    select option { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border-radius: 8px; color: var(--ink); background: transparent; cursor: pointer; white-space: nowrap; }
    select option:hover, select option:focus-visible { background: var(--sunken); outline: none; }
    select option:checked { background: var(--soft); color: var(--brand-ink); font-weight: 600; }
    select option::checkmark { order: 1; margin-left: auto; color: var(--brand-ink); }
    select optgroup { padding: 4px 0; }
    select optgroup legend, select optgroup::before { font-size: var(--fs-xs); color: var(--muted); }
    .city-switch select { height: 100%; }
    .city-switch option { color: var(--ink); background: transparent; }
  }
}

.head-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; }
.head-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: var(--fs-sm); font-weight: 600; }
.head-links .ic { width: 16px; height: 16px; }

/* ---------- display preferences ---------- */
.i18n-wait body { visibility: hidden; }
.prefs { position: relative; }
.prefs summary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); cursor: pointer; list-style: none; }
.prefs summary::-webkit-details-marker { display: none; }
.prefs summary span { display: none; }
.prefs[open] summary { border-color: var(--brand-ink); color: var(--brand-ink); }
.prefs-panel { position: absolute; z-index: 40; right: 0; top: calc(100% + 8px); width: 228px; padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.prefs-label { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 6px; }
.prefs-label + .swatches + .prefs-label { margin-top: 14px; }
.swatches { display: flex; gap: 6px; }
.swatches button { flex: 1; display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; font-size: var(--fs-xs); line-height: 1.2; cursor: pointer; }
.swatches button[aria-pressed="true"] { border-color: var(--brand-ink); background: var(--soft); color: var(--brand-ink); font-weight: 600; }
.swatches i { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgb(128 128 128 / .35); }

/* ---------- community ---------- */
.board-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.board { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s; }
.board:hover { text-decoration: none; border-color: var(--brand-ink); }
.board img { width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover; }
.board > span { display: grid; min-width: 0; }
.board > .ic { color: var(--muted); width: 16px; height: 16px; }
.school-pick { display: grid; gap: 12px; }
.board-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.board-chips:empty { display: none; }
.board-chips a { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 12px; border-radius: 999px; background: var(--soft); color: var(--brand-ink); font-size: var(--fs-sm); }
.board-chips a:hover { text-decoration: none; }
.board-chips span { font-size: var(--fs-xs); opacity: .75; }
.thread-list { display: grid; gap: 8px; }
.thread-list:empty { display: none; }
.thread-list a { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s; }
.thread-list a:hover { text-decoration: none; border-color: var(--brand-ink); }
.thread-list strong { font-size: var(--fs-lg); line-height: 1.4; }
.thread-list p { font-size: var(--fs-sm); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thread-list.flat { gap: 0; }
.thread-list.flat a { padding: 12px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.thread-list.flat li:first-child a { border-top: 0; padding-top: 0; }
.board-layout { display: grid; gap: 14px; margin-top: 14px; }
.board-layout > * { min-width: 0; }
.thread-page { max-width: 820px; padding-top: 18px; }
.thread-page h1 { margin: 4px 0 8px; font-size: 1.5rem; }
.post-tools { display: inline-flex; gap: 12px; margin-left: auto; }
.post-tools .btn-text { min-height: 28px; font-size: var(--fs-xs); color: var(--muted); }
.reply-head { margin: 28px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.reply-list { display: grid; gap: 8px; }
.reply-list li { padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.reply-body { margin-top: 6px; font-size: var(--fs-md); }
.reply-body p + p { margin-top: .7em; }
#reply-form { margin-top: 16px; max-width: none; }
.check { display: flex; align-items: center; gap: 8px; min-height: var(--ctl); font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.post-form { margin-bottom: 12px; }
.shop-list { display: grid; gap: 10px; }
.shop-list:empty { display: none; }
.shop { display: grid; gap: 6px; align-content: start; }
.shop h3 { margin: 0; font-size: var(--fs-lg); }
.shop.is-promo { border-color: var(--gold-ink); }
.tag-promo { background: var(--gold-soft); color: var(--gold-ink); border-color: transparent; font-weight: 600; }
.shop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; font-size: var(--fs-sm); }
.checkins { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.checkins form { display: grid; gap: 10px; }
.checkins .reply-list li { background: var(--sunken); }
.cat-filter { margin-top: 6px; }
.pro-note { margin-top: 14px; }
.pro-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; }
.pro-contact .btn .ic { width: 16px; height: 16px; }
.pro-wx { font-size: var(--fs-sm); color: var(--muted); }
.pro-wx strong { color: var(--ink); user-select: all; }
.pro .post-meta { margin-top: 2px; }
.check-set { display: flex; flex-wrap: wrap; gap: 0 18px; padding: 0; border: 0; }
.check-set legend { width: 100%; padding: 0; font-size: var(--fs-sm); font-weight: 600; }

@media (min-width: 640px) {
  .board-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-list { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 981px) {
  .prefs summary { width: 100%; height: 38px; justify-content: flex-start; padding: 0 10px; }
  .prefs summary span { display: inline; }
  .prefs-panel { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; width: 100%; }
  body.bare .prefs { margin-top: auto; }
  body.bare .acct { margin-top: 0; }
  .board-grid { grid-template-columns: repeat(4, 1fr); }
  .board { grid-template-columns: 44px 1fr auto; }
  .board img { width: 44px; height: 44px; }
}
@media (min-width: 1180px) {
  .board-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
  .shop-list { grid-template-columns: repeat(3, 1fr); }
}

/* English mode: the Chinese name line would repeat the English name */
html[lang="en"] .row-main .alt, html[lang="en"] .school-title .alt, html[lang="en"] .s-card .alt { display: none; }

/* Phone top bar: keep the name on one line and let the account button shrink to its icon */
.brand-zh { white-space: nowrap; }
.brand-slogan { display: none; }
.footer-brand { width: 100%; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: var(--fs-sm); }
.footer-brand span { color: var(--muted); font-size: var(--fs-xs); }
@media (min-width: 981px) {
  .brand { flex-wrap: wrap; row-gap: 0; }
  .brand-slogan { display: block; width: 100%; padding-left: 32px; margin-top: -6px; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; white-space: nowrap; }
}
@media (max-width: 639px) {
  .acct span { display: none; }
  .acct { padding: 0; width: 36px; }
  .city-switch { padding: 0 8px; }
}

/* ---------- photos ---------- */
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 10px; max-width: 560px; }
.imgs a { display: block; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--sunken); border: 1px solid var(--line); }
.imgs img { width: 100%; height: 100%; object-fit: cover; }
.post-body + .imgs { max-width: none; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-top: 16px; }
.img-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pick-list { display: contents; }
.pick-item { position: relative; width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--sunken); }
.pick-item img { width: 100%; height: 100%; object-fit: cover; }
.pick-item button { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgb(17 24 39 / .7); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.pick-add { cursor: pointer; }
.pick-add[hidden] { display: none; }
.pick-msg { font-size: var(--fs-xs); }

/* Space for the compare tray so it never covers the end of the page */
body:has(.cmp-tray:not([hidden])) { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 72px); }
@media (min-width: 981px) { body:has(.cmp-tray:not([hidden])) { padding-bottom: 72px; } }
/* Focus ring stays inside rows whose list clips its corners */
.school-row > a:focus-visible { outline-offset: -3px; }
/* Checklist: the phase to work on now */
.cl-phase.is-now { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.cl-phase h2 .tag { margin-left: 6px; vertical-align: middle; }
/* Login: resend and change address */
.login-more { margin-top: 4px; gap: 16px; font-size: var(--fs-sm); }
.login-more .btn-text:disabled { color: var(--muted); cursor: default; text-decoration: none; }
/* Unverified fees: a quiet marker next to the figure */
.tag-todo { background: transparent; color: var(--muted); border: 1px dashed var(--line); }

/* An empty section is one quiet line with its next step */
.empty-line { padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); font-size: var(--fs-sm); }
.empty-line + .ev-list:not(:empty), .empty-line + .faq-mini { margin-top: 10px; }
.faq-mini { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.faq-mini a { display: block; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--ink); }
.faq-mini li:first-child a { border-top: 0; }
#school-talk.is-empty .section-head { display: none; }

/* School page: labelled compare and save buttons under the fee */
.school-actions { margin-top: 14px; }
.school-actions .btn[aria-pressed="true"] { background: var(--soft); color: var(--brand-ink); border-color: transparent; }
.school-actions [data-fav][aria-pressed="true"] .ic { fill: currentColor; }
.fav-hint { margin-top: 8px; font-size: var(--fs-sm); }

/* ---------- local services ---------- */
.door-wide { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; column-gap: 12px; align-items: center; }
.door-wide .ic:first-child { grid-row: span 2; margin: 0; }
.door-wide span { grid-column: 2; }
.door-wide .ic:last-child { grid-column: 3; grid-row: 1 / span 2; width: 18px; height: 18px; margin: 0; color: var(--muted); }
.loc-group { margin-top: 20px; }
.loc-group h2 { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.loc-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.loc-cats button { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 0; align-items: center; text-align: left; padding: 12px 14px; min-height: 60px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.loc-cats button:hover { border-color: var(--brand-ink); }
.loc-cats button[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--soft); }
.loc-cats .ic { grid-row: span 2; width: 20px; height: 20px; color: var(--brand-ink); }
.loc-cats strong { font-size: var(--fs-md); }
.loc-cats span { font-size: var(--fs-xs); color: var(--muted); }
#loc-empty { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.loc .shop-actions { margin-top: 2px; }
@media (min-width: 640px) { .loc-cats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1180px) { .loc-cats { grid-template-columns: repeat(5, 1fr); } }

/* ---------- review round 2 ---------- */
/* Sidebar: only the links scroll, so city, display settings and sign-in stay in view on short screens */
@media (min-width: 981px) {
  .top { overflow: visible; }
  .top-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; scrollbar-width: thin; }
  .top-nav a { color: var(--ink); }
  .top-nav a .ic { color: var(--muted); }
  .top-nav a[aria-current] .ic { color: inherit; }
  .nav-label { font-size: .75rem; letter-spacing: .08em; margin-top: 14px; }
}
@media (min-width: 981px) and (max-height: 720px) {
  .top-nav a { height: 32px; }
  .nav-label { margin-top: 8px; }
  .brand { margin-bottom: 8px; }
}
/* A mouse can scroll the school strip on city pages */
@media (hover: hover) and (min-width: 981px) {
  .hscroll { scrollbar-width: thin; padding-bottom: 12px; }
  .hscroll::-webkit-scrollbar { display: block; height: 8px; }
  .hscroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
}
/* The city choice in the ask box looks like the other dropdowns */
.ask-row select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646b78' stroke-width='2' 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 10px center; background-size: 16px; }
.cq-city { word-break: keep-all; }
.ev > p { font-size: var(--fs-sm); }
/* Local services: one icon per group, one-line tiles */
.loc-group h2 { display: flex; align-items: center; gap: 6px; }
.loc-group h2 .ic { width: 16px; height: 16px; }
.loc-cats button { display: flex; justify-content: space-between; gap: 10px; min-height: 48px; padding: 10px 14px; }
/* Pressed feedback, which touch screens need because they never hover */
.btn, .door, .pills a, .pills button, .loc-cats button, .board, .t-card a, .c-card a, .tool-cards a, .chips label { transition: transform .1s; }
.btn:active, .door:active, .pills a:active, .pills button:active, .loc-cats button:active, .board:active, .t-card a:active, .c-card a:active, .tool-cards a:active { transform: scale(.98); }
.school-row > a:active, .tabbar a:active, .thread-list a:active, .link-list a:active { background: var(--sunken); }
@media (prefers-reduced-motion: reduce) { .btn:active, .door:active, .pills a:active, .pills button:active, .loc-cats button:active, .board:active, .t-card a:active, .c-card a:active, .tool-cards a:active { transform: none; } }
/* Phones: tighter hero, key facts as rows, shorter open-day rows, even plan figures */
@media (max-width: 639px) {
  .intro { padding: 18px 16px; }
  .intro .chip { display: none; }
  .intro h1 { margin-top: 0; font-size: 1.5rem; }
  .intro .lead { font-size: var(--fs-sm); margin-top: 8px; }
  .keyfacts { grid-template-columns: 1fr; gap: 0; }
  .keyfacts div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
  .keyfacts div:first-child { border-top: 0; }
  .keyfacts dt { flex: none; }
  .keyfacts dd { text-align: right; }
  .od-mini .od-meta > span:not(.tag) { display: none; }
  .od-mini .od-body .name { min-height: 28px; }
  .plan-stats strong { font-size: 1.0625rem; white-space: nowrap; }
}

/* ================= layout system (2026-10 plan) =================
   Dashboards use a 12-column grid; directories a left rail; reading pages a 720px article with a side column;
   tools put settings beside their output. Extra width adds columns, never line length. */
:root { --grid: 12px; --col: 20px; }
html { scroll-padding-top: 110px; }
@media (min-width: 981px) {
  :root { --grid: 16px; --col: 24px; }
  .wrap, .hscroll, .admin { max-width: 1320px; margin-inline: auto; }
}

/* ---- home: dashboard ---- */
@media (min-width: 981px) {
  .dash-side, .dash-main { display: contents; }
  .dash { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--grid); align-items: stretch; }
  .dash > * > * { grid-column: 1 / -1; min-width: 0; }
  .dash .intro { order: 1; }
  .dash .figures { order: 2; grid-template-columns: repeat(4, 1fr); }
  .dash .starter { order: 3; }
  .dash .ask-card { order: 4; grid-column: span 6; }
  .dash #od-panel { order: 5; grid-column: span 6; }
  .dash .talk-panel { order: 6; }
  .dash .cities-panel { order: 7; }
  .dash .fees-panel { order: 8; }
  .dash .steps-card { order: 9; }
  .dash:has(#od-panel[hidden]) .ask-card { grid-column: 1 / -1; }
}
@media (min-width: 1180px) {
  .dash .intro { grid-column: span 8; display: grid; align-content: center; }
  .dash .figures { grid-column: span 4; grid-template-columns: 1fr 1fr; }
  .dash .figures li { align-content: center; }
  .dash .starter { grid-template-columns: auto repeat(3, minmax(0, 1fr)) auto; align-items: end; column-gap: 16px; }
  .dash .starter-title { align-self: center; max-width: 9em; }
  .dash .starter .btn { width: auto; }
  .dash .starter-note { display: none; }
  .dash .ask-card, .dash #od-panel, .dash .talk-panel { grid-column: span 4; }
  .dash:has(#od-panel[hidden]) .ask-card { grid-column: span 7; }
  .dash:has(#od-panel[hidden]) .talk-panel { grid-column: span 5; }
  .dash #od-next li:nth-child(n+3) { display: none; }
  .cities-panel .c-cards { grid-template-columns: repeat(4, 1fr); }
  .dash .fees-panel { grid-column: span 8; }
  .dash .steps-card { grid-column: span 4; }
}
@media (min-width: 1360px) { .t-cards { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 980px) { .dash #od-next li:nth-child(n+3) { display: none; } }
@media (max-width: 639px) { .dash .intro .lead { display: none; } }

/* ---- school list: one line per school on wide screens, shorter rows on phones ---- */
.row-name { display: grid; min-width: 0; }
@media (min-width: 1180px) {
  .list-layout { grid-template-columns: 264px minmax(0, 1fr); gap: var(--col); }
  .list-main .school-row > a { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1.2fr) 110px 150px; column-gap: 16px; padding: 12px 108px 12px 16px; }
  .list-main .school-row .row-main { display: contents; }
  .list-main .school-row .mono { grid-row: 1; }
  .list-main .school-row .row-name { grid-column: 2; }
  .list-main .school-row .meta { grid-column: 3; align-self: center; }
  .list-main .school-row .fee-bar { grid-column: 4; grid-row: 1; align-self: center; margin-top: 0; }
  .list-main .school-row .row-fee { grid-column: 5; grid-row: 1; }
}
@media (max-width: 639px) {
  .school-row > a { padding-block: 12px; }
  .row-fee .local { display: none; }
}

/* ---- school page: head card in two zones; on phones the calculator follows the fee table ---- */
@media (min-width: 1180px) {
  .school-card { display: grid; grid-template-columns: minmax(0, 1fr) 340px; column-gap: var(--col); }
  .school-card > * { grid-column: 1; }
  .school-card .keyfacts { grid-column: 2; grid-row: 1 / span 4; margin: 0; padding-left: var(--col); border-left: 1px solid var(--line); align-content: center; grid-template-columns: 1fr; gap: 0; }
  .school-card .keyfacts div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
  .school-card .keyfacts div:first-child { border-top: 0; }
  .school-card .keyfacts dt { flex: none; }
  .school-card .keyfacts dd { text-align: right; }
  .school-layout { gap: var(--col); }
}
@media (min-width: 640px) {
  .col-main .related .link-list { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 16px; }
  .col-main .related .link-list li:nth-child(-n+3) a { border-top: 0; }
}
@media (max-width: 1179px) {
  .school-layout .col-main, .school-layout .col-side { display: contents; }
  .school-layout .fees-block { order: 1; }
  .school-layout .calc { order: 2; }
  .school-layout #school-events { order: 3; }
  .school-layout .enquiry { order: 4; }
  .school-layout #school-talk { order: 5; }
  .school-layout .related { order: 6; }
  .school-layout .source { order: 7; }
}
@media (max-width: 639px) { .fav-hint { display: none; } }

/* ---- reading pages: article capped at 720px, contents list, side column ---- */
.toc { margin-top: 0; }
.guide-layout .toc { grid-column: 1 / -1; }
@media (max-width: 980px) { .guide-layout .toc { position: sticky; top: 52px; z-index: 10; flex-wrap: nowrap; background: var(--bg); padding-block: 6px; } }
@media (min-width: 1180px) {
  .guide-layout { grid-template-columns: minmax(0, 720px) 320px; gap: var(--col); }
  .guide-layout .toc { display: none; }
}
@media (min-width: 1360px) {
  .guide-layout { grid-template-columns: 160px minmax(0, 720px) 320px; }
  .guide-layout .toc { grid-column: 1; display: grid; gap: 0; align-content: start; position: sticky; top: 20px; margin: 0; padding: 0; overflow: visible; }
  .guide-layout .toc::before { content: "本页内容"; font-size: var(--fs-xs); color: var(--muted); padding: 0 8px 6px; }
  .guide-layout .toc a { height: auto; min-height: 32px; padding: 6px 8px; border: 0; background: none; border-radius: 6px; white-space: normal; font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
  .guide-layout .toc a:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }
}
html[lang="en"] .guide-layout .toc::before { content: "On this page"; }

/* ---- guide hub: one grid ---- */
.g-group { margin-left: 8px; vertical-align: 2px; font-weight: 400; }
.g-topic .when { margin-top: 2px; font-size: var(--fs-xs); }
@media (min-width: 1180px) { .guide-topics.one-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---- community hub: topics, events and stories in the main column; boards beside them ---- */
.comm-layout { display: grid; gap: 24px; margin-top: 16px; }
.comm-main, .comm-side { display: grid; gap: 24px; align-content: start; min-width: 0; }
.comm-sec { min-width: 0; }
@media (max-width: 1179px) {
  .comm-main, .comm-side { display: contents; }
  .comm-sec.c0 { order: 1; }
  .comm-sec.c1 { order: 2; }
  .comm-sec.c2 { order: 3; }
  .comm-sec.c3 { order: 4; }
  .comm-sec.c4 { order: 5; }
  .comm-sec.c6 { order: 6; }
  .comm-sec.c5 { order: 7; }
}
@media (max-width: 639px) {
  .comm-layout .board-grid { grid-template-columns: 1fr 1fr; }
  .comm-layout .board { grid-template-columns: 1fr; }
  .comm-layout .board img, .comm-layout .board > .ic { display: none; }
  .ev-list[data-fallback] > :nth-child(n+3) { display: none; }
}
@media (min-width: 1180px) {
  .comm-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--col); align-items: start; }
  .comm-main, .comm-side { gap: 28px; }
  .comm-side { position: sticky; top: 20px; }
  .comm-side .board-grid { grid-template-columns: 1fr; }
  .comm-side .board { grid-template-columns: 44px 1fr auto; }
}

/* ---- open days: two across on wide screens ---- */
@media (min-width: 1180px) {
  .od-timeline .od-list { grid-template-columns: 1fr 1fr; column-gap: var(--col); }
  .od-timeline .od-list li::before { display: none; }
}
@media (max-width: 980px) { #od-city { position: sticky; top: 52px; z-index: 10; background: var(--bg); padding-block: 6px; } }

/* ---- tools ---- */
.budget-layout { display: grid; gap: 14px; margin-top: 14px; }
.budget-layout > * { min-width: 0; }
@media (min-width: 640px) { #budget-form { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1180px) {
  .budget-layout { grid-template-columns: minmax(0, 720px) 340px; gap: var(--col); align-items: start; }
  .budget-layout .tool-form { position: static; }
  .budget-layout .budget-result { position: sticky; top: 20px; }
  .cmp-layout { grid-template-columns: 1fr; }
  .cmp-controls { position: static; grid-template-columns: 200px minmax(0, 360px) 1fr; align-items: end; }
  .checklist { max-width: 760px; }
  .city-qs { grid-template-columns: repeat(3, 1fr); }
}

/* ---- plan: results in a main column; fees, guides and the form beside them ---- */
.plan-main, .plan-aside { display: grid; gap: 12px; align-content: start; min-width: 0; }
.plan-jump { margin-top: 0; }
@media (max-width: 980px) { .plan-jump { position: sticky; top: 52px; z-index: 10; background: var(--bg); padding-block: 6px; flex-wrap: nowrap; } }
@media (max-width: 639px) { .plan-main .match li:nth-child(n+5) { display: none; } }
@media (min-width: 1180px) {
  .plan-jump { display: none; }
  .plan-layout.has-plan { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--grid) var(--col); }
  .plan-layout.has-plan .plan-out { display: contents; }
  .plan-layout.has-plan .plan-hero { grid-column: 1 / -1; grid-row: 1; }
  .plan-layout.has-plan .plan-main { grid-column: 1; grid-row: 2 / span 2; }
  .plan-layout.has-plan .plan-aside { grid-column: 2; grid-row: 2; }
  .plan-layout.has-plan .plan-form { grid-column: 2; grid-row: 3; position: static; order: 0; }
}

/* ---- account page ---- */
.me-layout { display: grid; gap: 24px; margin-top: 16px; }
.me-main { display: grid; gap: 24px; align-content: start; min-width: 0; }
.me-main > * { min-width: 0; }
@media (min-width: 1180px) {
  .me-layout { grid-template-columns: 340px minmax(0, 1fr); gap: var(--col); align-items: start; }
  .me-side { position: sticky; top: 20px; }
  .me-main { grid-template-columns: 1fr 1fr; column-gap: var(--grid); }
  .me-main > * { grid-column: 1 / -1; }
  .me-main > .me-plan { grid-column: 1; grid-row: 1; }
  .me-main > .me-cl { grid-column: 2; grid-row: 1; }
}

/* ---- ask: the question box lines up with the answers below it ---- */
.ask-head .ask-box { max-width: none; }
@media (min-width: 1180px) {
  .ask-head .ask-box, .ask-head .q-chips { max-width: calc(100% - 340px - var(--col)); }
  .ask-layout { gap: var(--col); }
}
@media (max-width: 639px) {
  #ask-samples { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  #ask-samples li { flex: none; }
}

/* ---- city page on phones: guides as compact tiles ---- */
@media (max-width: 639px) {
  #guide .t-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  #guide .t-card .t-text .muted, #guide .t-card a > .ic:last-child { display: none; }
}
/* ---- local services: list two across on wide screens ---- */
.loc-tips { margin-bottom: 12px; }
@media (min-width: 1180px) {
  #loc-list { grid-template-columns: repeat(2, 1fr); }
  .loc-tips { max-width: 760px; }
}
/* A photo strip inside a card must not widen a one-column list */
.ev-list, #loc-list, .shop-list { grid-template-columns: minmax(0, 1fr); }
.card.ev, .card.shop { min-width: 0; }
@media (min-width: 640px) { .ev-list, .shop-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .comm-main .ev-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .shop-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1179px) { .plan-main, .plan-aside { display: contents; } }
@media (min-width: 1180px) { .list-main .school-row .meta { font-size: var(--fs-xs); line-height: 1.5; } }

/* ---- city home: dashboard ---- */
.city-dash { display: grid; gap: var(--gap); margin-top: var(--gap); }
.city-dash > * { min-width: 0; }
.city-dash .hscroll { --edge: var(--gutter); margin-inline: calc(var(--gutter) * -1); max-width: none; }
.only-wide { display: none; }
@media (min-width: 1180px) {
  .only-narrow { display: none; }
  .only-wide { display: block; }
  .city-dash { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px var(--col); align-items: start; }
  .city-dash .cd-guide .t-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ---- local services: directory with a left rail on wide screens ---- */
.loc-layout { display: grid; gap: 16px; }
.loc-rail, .loc-main { min-width: 0; }
.loc-rail .pro-note { margin-top: 16px; }
@media (min-width: 1180px) {
  .loc-layout { grid-template-columns: 264px minmax(0, 1fr); gap: var(--col); align-items: start; margin-top: 16px; }
  .loc-rail { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin; }
  .loc-rail .pills { margin-top: 0; }
  .loc-rail .loc-cats { grid-template-columns: 1fr; gap: 4px; }
  .loc-rail .loc-cats button { min-height: 40px; padding: 8px 12px; border-color: transparent; background: transparent; }
  .loc-rail .loc-cats button:hover { background: var(--sunken); }
  .loc-rail .loc-cats button[aria-pressed="true"] { background: var(--soft); box-shadow: none; border-color: transparent; color: var(--brand-ink); }
  .loc-rail .loc-group { margin-top: 16px; }
}

/* ---- topic and story pages: text beside a side column ---- */
.read-layout { display: grid; gap: 14px; }
.read-layout > * { min-width: 0; }
.read-layout .thread-page, .read-layout .post-page { max-width: none; }
@media (min-width: 1180px) { .read-layout { grid-template-columns: minmax(0, 760px) 340px; gap: var(--col); align-items: start; } .read-layout .col-side { margin-top: 18px; } }
/* ---- budget: the total stays in view ---- */
.budget-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.budget-detail .once { margin-top: 0; }
.budget-detail .once:empty { display: none; }
@media (min-width: 1180px) { .budget-layout .budget-side { position: sticky; top: 20px; } .budget-layout .budget-result { position: static; } }
@media (max-width: 1179px) {
  .budget-side { display: contents; }
  .budget-total { order: -1; position: sticky; top: 60px; z-index: 10; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-block: 12px; box-shadow: var(--shadow); }
  .budget-total h2 { margin: 0; font-size: var(--fs-md); }
  .budget-total .total { margin: 0; text-align: right; }
}
@media (min-width: 981px) and (max-width: 1179px) { .budget-total { top: 12px; } }
/* ---- admin console on a phone: tables scroll inside their card ---- */
.admin > *, .admin main, .admin main > *, .admin .card { min-width: 0; }
.admin .table-scroll { max-width: 100%; }
@media (max-width: 639px) { .admin .a-table { min-width: 560px; } .admin .a-table input, .admin .a-table select { min-width: 0; } }
.admin-main, .admin-main > * { min-width: 0; }
@media (min-width: 1180px) { #loc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.admin .card:has(> .a-table) { overflow-x: auto; }

/* ---------- city leads ---------- */
.lead-slot { margin-top: 14px; display: grid; gap: 10px; }
.lead-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: start; }
.lead-card .avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--brand); color: var(--on-brand, #fff); font-size: 1.125rem; font-weight: 700; line-height: 1; }
.lead-card h3 { margin: 0; font-size: var(--fs-lg); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lead-card .btn-row { grid-column: 1 / -1; margin-top: 6px; align-items: center; }
.lead-ver { margin-top: 2px; font-size: var(--fs-sm); color: var(--ok); font-weight: 600; }
.lead-ver::before { content: "✓ "; }
.lead-line { margin-top: 10px; font-size: var(--fs-sm); color: var(--muted); }
.q-by { margin-top: 6px; font-size: var(--fs-xs); color: var(--muted); }
@media (min-width: 981px) {
  .lead-card { grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; }
  .lead-card .btn-row { grid-column: 3; margin-top: 0; }
}
.lead-desk { display: grid; gap: 22px; }
.desk-jump { margin-top: 0; }
.desk-sec { display: grid; gap: 10px; scroll-margin-top: 110px; }
.desk-sec > h2 { display: flex; align-items: baseline; gap: 8px; }
.desk-sec > h2 .num { color: var(--muted); font-weight: 400; font-size: var(--fs-md); }
.desk-item { display: grid; gap: 6px; max-width: 760px; }
.desk-item h3 { margin: 0; font-size: var(--fs-lg); }

/* School names: English first, Chinese with it */
.s-card .alt { font-size: var(--fs-xs); color: var(--muted); }
.school-title h1 { line-height: 1.3; }
@media (max-width: 639px) { .school-title h1 { font-size: 1.25rem; } .row-main .name { font-size: var(--fs-md); } }

/* ---- exam results published by the school ---- */
.results-block h3 { margin: 14px 0 6px; font-size: var(--fs-md); }
table.res { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.res th, .res td { padding: 10px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.res thead th { border-top: 0; padding-top: 0; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); white-space: nowrap; }
.res tbody th { width: 5.5em; font-weight: 600; }
.res td + td, .res th + th { padding-left: 12px; }
.res td:last-child { white-space: nowrap; }
.res-m { display: inline-block; margin: 0 14px 2px 0; }
.results-block .status { margin-top: 12px; }
@media (max-width: 1179px) { .school-layout .results-block { order: 2; } .school-layout .calc { order: 3; } }

/* ---- school claiming: what the school wrote is set apart from what the site checked ---- */
.claim-badge { margin: 4px 0 0; }
.school-says { background: var(--brand-soft, #f4f3ff); }
.school-says h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.school-says h2 .tag { font-weight: 400; background: var(--panel, #fff); }
.says-body p { margin: 0 0 8px; }
.claim-line { margin: 4px 2px 0; font-size: var(--fs-sm); color: var(--muted); }
.claim-desk { display: grid; gap: 14px; max-width: 760px; }
.claim-desk .link-list li { display: flex; justify-content: space-between; gap: 12px; }
.reply-list li.is-official { border-left: 3px solid var(--ok); padding-left: 10px; }
.site-note { font-size: var(--fs-sm); }

@media (max-width: 1179px) { .school-layout .school-says { order: 2; } }

/* ---- school facts: size, nationalities, admission, as the school states them ---- */
.fact-list { display: grid; gap: 0; margin: 0; }
.fact-list div { display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.fact-list div:first-child { border-top: 0; padding-top: 0; }
.fact-list dt { color: var(--muted); font-size: var(--fs-sm); }
.fact-list dd { margin: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.fact-src { font-size: var(--fs-xs); white-space: nowrap; }
.school-facts .status { margin-top: 12px; }
@media (max-width: 1179px) { .school-layout .school-facts { order: 2; } }

/* ---- school list: what the chosen order rests on ---- */
.sort-basis { margin: 0; font-size: var(--fs-xs); }
.row-main .sort-note { color: var(--brand); font-weight: 600; }

/* ---- service tax shown apart from tuition ---- */
.tax-line { margin-top: 10px; }
.tax-sum { display: grid; gap: 0; margin: 8px 0; }
.tax-sum div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.tax-sum dt { color: var(--muted); }
.tax-sum dd { margin: 0; text-align: right; }
.tax-sum div:last-child dd { font-weight: 700; }

@media (max-width: 639px) {
  .fees.has-tax th:last-child, .fees.has-tax td:last-child { display: none; }
  .fees.has-tax th, .fees.has-tax td { padding-left: 6px; padding-right: 0; font-size: var(--fs-sm); }
  .fees.has-tax thead th { white-space: normal; font-size: var(--fs-xs); }
}

/* ---- the stamp on a school page whose data the owner has confirmed ---- */
.school-title .stamp { flex: none; margin-left: auto; width: 116px; height: 116px; color: var(--brand); opacity: .9; transform: rotate(-8deg); }
.stamp svg { display: block; width: 100%; height: 100%; }
@media (max-width: 639px) { .school-title .stamp { width: 84px; height: 84px; } }
#review-panel h3 { margin: 16px 0 6px; font-size: var(--fs-md); }
#review-panel h3 a { font-weight: 400; font-size: var(--fs-sm); margin-left: 8px; }

/* ---- the same stamp on a confirmed guide and on a confirmed site-listed centre ---- */
.guide-lead .stamp { float: right; width: 104px; height: 104px; margin: 0 0 8px 14px; color: var(--brand); opacity: .9; transform: rotate(-8deg); }
.shop.loc { position: relative; }
.shop.loc > .stamp { position: absolute; top: 10px; right: 12px; width: 64px; height: 64px; color: var(--brand); opacity: .9; transform: rotate(-8deg); pointer-events: none; }
.shop.loc:has(> .stamp) > .ev-top, .shop.loc:has(> .stamp) > h3 { padding-right: 72px; }
@media (max-width: 639px) { .guide-lead .stamp { width: 80px; height: 80px; } }
#g-review h3, #s-review h3 { margin: 16px 0 6px; font-size: var(--fs-md); }

/* ---- the mark in the header: roof and tick, drawn, so it looks the same on every device ---- */
.brand-mark svg { display: block; width: 100%; height: 100%; }

/* ---- sidebar brand: the name and the line under it never run past the sidebar, in either language ---- */
@media (min-width: 981px) {
  .brand { min-width: 0; max-width: calc(var(--side) - 32px); }
  .brand-zh { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .brand-slogan { overflow: hidden; text-overflow: ellipsis; }
}

/* ---- UI pass 2026-10-08: nothing inside a grid or flex column may widen the page (English strings are longer) ---- */
.school-layout > *, .col-main > *, .col-side > *, .one-grid > *, .guide-topics > *, .loc-layout > *, .loc-main > * { min-width: 0; }
.table-scroll { max-width: calc(100% + var(--pad) * 2); }
.g-topic .pills { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.g-head h3 { overflow-wrap: anywhere; }
@media (max-width: 639px) {
  .btn-row .btn { white-space: normal; height: auto; min-height: var(--ctl); padding-block: 8px; text-align: center; }
  .fees.has-tax thead th { hyphens: auto; overflow-wrap: anywhere; }
}
.t-cards > *, .t-cards a > *, .city-dash > * { min-width: 0; }
.t-cards a { overflow-wrap: anywhere; }
@media (max-width: 639px) {
  .section-head { flex-wrap: wrap; row-gap: 6px; }
  .section-head .btn { white-space: normal; height: auto; min-height: var(--ctl); padding-block: 8px; text-align: center; max-width: 100%; }
}
.search { min-width: 0; }
.filter-toggle { flex: none; }
/* Narrow phones, and English names in the top bar: the bar shrinks its parts instead of pushing the account button off */
@media (max-width: 420px) {
  .top { gap: 6px; }
  .brand { flex: none; }
  .city-switch { min-width: 0; flex: 0 1 auto; padding: 0 6px; }
  .city-switch select { min-width: 0; width: 100%; text-overflow: ellipsis; }
  .prefs, .acct { flex: none; }
}
.loc-cats button { min-width: 0; }
.loc-cats button { flex-wrap: wrap; row-gap: 0; }
.loc-cats button strong { min-width: 0; text-align: left; }
.loc-cats button .num { flex: none; }

/* ---- articles written from the site's data ---- */
.art-body h2 { margin: 26px 0 8px; }
.art-body ul { margin: 0 0 10px; padding-left: 20px; }
.art-body li { margin: 4px 0; }
.art-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin: 6px 0 10px; }
.art-table th, .art-table td { padding: 9px 12px 9px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.art-table thead th { border-top: 0; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); white-space: nowrap; }
.art-table tbody th { font-weight: 400; min-width: 12em; }
.art-table .num { text-align: right; }
.art-table .nowrap { white-space: nowrap; }
.art-meta { margin-top: 18px; font-size: var(--fs-sm); }
.art-list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; max-width: 760px; }
.art-list a { display: block; color: var(--ink); }
.art-list a:hover { text-decoration: none; }
.art-list h2 { margin: 0 0 4px; font-size: var(--fs-lg); color: var(--brand-ink); }
.art-layout { display: grid; gap: 16px; align-items: start; }
.art-layout > * { min-width: 0; }
.art-layout .col-side { display: grid; gap: 16px; }
@media (min-width: 1180px) { .art-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
