/* Wireframe layout on top of site.css tokens. Phones: tab bar at the bottom, one column. Wide screens: top nav,
   filters | list | map on school pages. */
:root { --target-min: 44px; --cta-height: 52px; --radius-sm: 8px; --radius-md: 12px; --radius-full: 999px; --line-strong: #848F9B; --star: #B45309; --tabbar-h: 64px; }
@media (prefers-color-scheme: dark) { :root { --line-strong: #6E7A88; --star: #F1A54E; } }
body { font-family: "Noto Sans", "Noto Sans KR", "Noto Sans SC", system-ui, sans-serif; }
html[lang="ko"] body { font-family: "Noto Sans", "Noto Sans KR", system-ui, sans-serif; }
html[lang="zh-Hans"] body { font-family: "Noto Sans", "Noto Sans SC", system-ui, sans-serif; }

/* header */
header.top { position: sticky; top: 0; z-index: 30; }
header.top .wrap { min-height: 56px; }
.topnav a { font-size: 14px; }
.langs { display: inline-flex; border: 1px solid var(--band-muted); border-radius: 8px; overflow: hidden; }
.langs a { margin: 0 !important; border: 0 !important; border-radius: 0 !important; min-width: 44px; min-height: 40px; display: inline-flex !important; align-items: center; justify-content: center; padding: 0 10px !important; }
main.wrap { padding-block: 16px 32px; }

/* tab bar + compare tray (phones) */
.tabbar { display: none; }
.tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 0 max(12px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.tray > * { pointer-events: auto; max-width: 560px; margin: 0 auto; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); }
@media (max-width: 860px) {
  .topnav { display: none; }
  header.top .brand .tag { display: none; }
  .tabbar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 26; background: var(--surface-0); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tabbar .ac-tabs a { padding: 0; font-size: 12px; color: var(--ink-muted); }
  .tabbar .ac-tabs a.ac-tabs__item--active { color: var(--brand); }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .tray { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}

/* shared */
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel { background: var(--surface-0); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.eyebrow { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; line-height: 18px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; font-weight: 500; }
.cards { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cards h2 { margin: 12px 0 0; font-size: 16px; }
.chipsrow { display: flex; flex-wrap: wrap; gap: 8px; }

/* home */
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-bottom: 8px; }
.hero h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; margin: 6px 0 12px; }
.hero .lead { margin: 0; }
.ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.ledger div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
.ledger b { display: block; font-size: 28px; line-height: 34px; font-variant-numeric: tabular-nums; }
.ledger span { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.schoolpick { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; }
.schoolpick h2 { margin: 0; }
#school-search { width: 100%; max-width: 320px; }
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rules h3 { margin: 0 0 4px; font-size: 15px; }
.rules p { margin: 0; font-size: 14px; color: var(--ink-muted); }

/* school results */
.rhead h1 { margin: 0 0 6px; font-size: 24px; line-height: 32px; }
.rhead p { margin: 0 0 6px; max-width: 72ch; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 12px 0; }
.toolbar .left { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filterbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--surface-0); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.results { display: grid; grid-template-columns: 260px minmax(0, 1fr) minmax(0, 400px); gap: 20px; align-items: start; }
.results .aside, .results .mapcol { position: sticky; top: 72px; }
.results .aside .ac-group { margin: 0; }
.mapcol .sel { margin-top: 12px; }
.empty { padding: 24px; text-align: center; }
.sheet-overlay { position: fixed; inset: 0; z-index: 40; }
.sheet-overlay .ac-sheet { height: 100%; }
.sheet-overlay .ac-sheet__panel { max-width: 560px; width: 100%; margin: 0 auto; }
.viewtoggle { display: none; }
@media (max-width: 1100px) {
  .results { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }
  .results .aside { display: none; }
}
@media (min-width: 1101px) { .filterbtn { display: none; } }
@media (max-width: 860px) {
  .hero, .rules { grid-template-columns: minmax(0, 1fr); }
  .results { grid-template-columns: minmax(0, 1fr); }
  .results .mapcol { position: static; }
  .viewtoggle { display: block; }
  .results[data-view="list"] .mapcol { display: none; }
  .results[data-view="map"] .listcol { display: none; }
}

/* program detail */
.dhead h1 { margin: 4px 0 8px; font-size: clamp(24px, 3vw, 30px); line-height: 1.25; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); grid-template-areas: "main act" "main side" "main ."; grid-template-rows: auto auto 1fr; gap: 16px 24px; align-items: start; margin-top: 16px; }
.dmain { grid-area: main; } .dact { grid-area: act; } .dside { grid-area: side; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.actions { display: flex; flex-direction: column; gap: 8px; }
details.more > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
@media (max-width: 860px) { .dgrid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "act" "main" "side"; grid-template-rows: auto; } }
/* keep the last lines of the page clear of the compare tray */
@media (max-width: 860px) { body.has-tray { padding-bottom: calc(var(--tabbar-h) + 84px + env(safe-area-inset-bottom, 0px)); } }
body.has-tray { padding-bottom: 84px; }

/* compare */
.scrollx { overflow-x: auto; background: var(--surface-0); border: 1px solid var(--line); border-radius: 12px; }
.scrollx .ac-cmp { min-width: var(--cmp-min, 560px); }
.ac-cmp table { min-width: 0; }
.ac-cmp__actions .ac-btn { background: transparent; color: var(--brand); border: 1px solid var(--line); box-shadow: none; }

/* home quick filters + compare toolbar */
.quick h3, .schoolpick + div + div h3, #schools h3 { margin: 12px 0 8px; font-size: 15px; }
.qchip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-0); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.qchip[aria-pressed="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface-0)); color: var(--brand); font-weight: 700; }
.qchip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cmpbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }

/* header wordmark: the domain, with the site name under it */
header.top .brand { line-height: 1.15; }
header.top .brand .dom { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
header.top .brand .tld { font-weight: 500; opacity: 0.75; }
header.top .brand small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--band-muted); }

/* sponsor banners: labelled, and unlike a program card (warm tint, dashed edge, no stars or facts) */
.sponsor { margin: 16px 0; padding: 12px 14px; border: 1px dashed #C9B37A; border-radius: 12px; background: #FFFBF0; max-width: 760px; }
.sponsor-label { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #7A5B00; margin-bottom: 8px; }
.sponsor-link { display: block; color: var(--ink); text-decoration: none; }
.sponsor-link img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 1; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.sponsor-link img.only-m { aspect-ratio: 2 / 1; max-width: 480px; }
@media (max-width: 600px) { .sponsor-link picture.has-m img { aspect-ratio: 2 / 1; } }
.sponsor-text { display: flex; flex-direction: column; gap: 2px; }
.sponsor-text b { font-size: 16px; }
.sponsor-text span { font-size: 14px; color: var(--ink-muted); }
.sponsor-text .sponsor-cta { color: var(--brand); font-weight: 700; margin-top: 4px; }
.sponsor-link:hover b, .sponsor-link:focus-visible b { text-decoration: underline; }
.sponsor-note { margin: 8px 0 0; font-size: 12px; }
.sponsor-note a { color: var(--ink-muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sponsor { background: #2A2416; border-color: #6B5A2E; } :root:not([data-theme="light"]) .sponsor-label { color: #E3C77A; } }
.listcol .sponsor { max-width: none; }
