/* Shared AdvanceChance identity. Loaded after functional styles. */
:root {
  color-scheme: light;
  --bg: #f7f8fc; --card: #fff; --ink: #111e36; --text: #27354b;
  --muted: #56647a; --line: #dfe4ee; --accent: #2448e5; --accent-soft: #edf1ff;
  --nav-current: #1938bc; --nav-line: #c8d3ff;
  --nav-school: #2448e5; --nav-competition: #2448e5; --nav-saved: #2448e5; --nav-about: #56647a;
  --on-accent: #fff; --nav-active-text: #fff;
  --brand-night: #111e36; --brand-highlight: #9db5ff;
  --score: #1938bc; --score-note: #c6d3ff; --score-text: #fff;
  --ok: #216644; --ok-soft: #edf6ef; --radius: 14px;
  --surface-shadow: 0 8px 28px #111e360b;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Kaku Gothic ProN", "Microsoft YaHei", "Noto Sans", sans-serif;
}
body { font-family: var(--font); font-size: 1rem; line-height: 1.65; background: var(--bg); }
button, input, select, textarea { font-family: inherit; }
::selection { background: #2448e5; color: #fff; }
.site-header { background: var(--brand-night); border-bottom: 0; color: #fff; }
.header-inner { min-height: 88px; gap: 16px; padding-block: 16px; }
.brand { gap: 11px; font-family: var(--font); font-size: clamp(24px, 2.1vw, 29px); font-weight: 800; letter-spacing: -.055em; color: #fff; line-height: 1; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; }
.brand > span { padding-block: 4px; }
.nav { gap: 3px; }
.nav > a { color: #cbd5e8; font-size: 14px; font-weight: 600; padding: 9px 10px; min-height: 44px; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; }
.nav > a:hover { color: #fff; background: #ffffff0a; border-bottom-color: #667da9; }
.nav > a[aria-current="page"] { color: #fff; font-weight: 750; background: transparent; border-bottom-color: var(--brand-highlight); }
.site-header .lang-sw > summary, .header-tools .login-btn, .header-inner > .me-btn {
  background: #ffffff09; border: 1px solid #ffffff2e; color: #fff; border-radius: 9px; box-shadow: none; min-height: 44px; font-size: 14px;
}
.site-header .lang-sw > summary svg { color: #fff; }
.header-tools .login-btn:hover, .header-inner > .me-btn:hover, .site-header .lang-sw > summary:hover { color: #fff; background: #ffffff16; border-color: #ffffff70; }
.site-header :focus-visible { outline-color: #c6d3ff; }
.site-header .lang-sw ul { background: #fff; border-color: var(--line); box-shadow: 0 14px 40px #111e3625; }
.site-header .lang-sw li a { color: var(--ink); }
.site-header .lang-sw li a:hover, .site-header .lang-sw li a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.hero-intro h1, .hero h1, .page h1 {
  font-family: var(--font); color: var(--ink); font-size: clamp(30px, 4vw, 46px); line-height: 1.16; font-weight: 750; letter-spacing: -.045em; text-wrap: balance;
}
:lang(zh) .hero-intro h1, :lang(zh) .page h1, :lang(ja) .hero-intro h1, :lang(ja) .page h1, :lang(ko) .hero-intro h1, :lang(ko) .page h1 { letter-spacing: -.025em; line-height: 1.3; }
.hero-intro::before { content: ""; display: block; width: 40px; height: 6px; background: var(--accent); margin-block-end: 20px; }
.school-finder-layout { padding-block-start: 40px; gap: 28px 24px; }
.hero-intro { padding-block-end: 4px; }
.hero-intro > .muted { max-width: 65ch; line-height: 1.65 !important; margin-block-start: 12px !important; }
.page { padding-block-start: 36px; }
.page h1 { margin-block-end: 18px; }
.page .lead { font-size: 1.0625rem; line-height: 1.7; }
.section-h, .program h2, .notice h2, .rep-panel h2 { font-weight: 750; letter-spacing: -.025em; }
.pick-h, .finder label, .filters label, .family-h, .degree-h { font-size: .875rem; letter-spacing: .01em; text-transform: none; color: var(--ink); font-weight: 650; }
.finder select, .finder input[type="search"], .pfilter, .search input, .mc-tools input[type="search"], .filters select { background-color: #fff; border-color: var(--line); border-radius: 10px; box-shadow: none; font-size: 1rem; }
.finder select:focus, .finder input[type="search"]:focus { border-color: var(--accent); }
.chip, .seg-b { font-weight: 550; }
.chip[aria-pressed="true"], .me-pg-c .chip[aria-pressed="true"], .sort-chips .chip[aria-pressed="true"], .seg-b[aria-selected="true"], .seg-b[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: none; }
.chip.chip-change { background: transparent; border: 1px solid var(--line); color: var(--accent); }
.chip span, .chip[aria-pressed="true"] span { color: inherit; }
.btn, .me-card-b, .rep-panel .rep-find-button { background: var(--accent); color: #fff; font-weight: 650; box-shadow: none; border-radius: 10px; }
.btn:hover, .rep-panel .rep-find-button:hover { background: var(--nav-current); }
.hero-intro .me-card-b { background: #fff; border-color: var(--line); color: var(--ink); }
.hero-intro .me-card.is-set, .hero-intro .me-card.is-off { background: transparent; }
.grid { gap: 16px; }
:is(.directory-page,#school-results) .card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: none; }
.card:hover, :is(.directory-page,#school-results) .card:hover { border-color: #a9b8eb; box-shadow: var(--surface-shadow); }
.card h3 { font-size: 1.125rem; line-height: 1.45; font-weight: 700; letter-spacing: -.02em; }
.city, .tags span, .badge, .field dt, .count, .pl-city { font-size: .875rem; }
.tags { gap: 5px 9px; }
.tags span { border: 0; background: var(--bg); border-radius: 5px; padding: 3px 7px; }
.badge.ok { color: var(--muted); background: var(--bg); font-weight: 550; }
.badge.open { color: var(--ok); background: var(--ok-soft); }
.plist { border-radius: 14px; border-color: var(--line); }
.plist a { padding: 18px 20px; }
.plist a:hover { background: #f0f4ff; }
.pl-school { color: var(--ink); font-weight: 700; }
.pl-prog { line-height: 1.6; }
#prog-results .results-h { gap: 16px; align-items: center; }
#prog-results .results-h .count { flex: 1; min-width: 0; }
#prog-results #reset { flex: 0 0 auto; min-width: 44px; white-space: nowrap; }
.home-shortcuts { background-image: none; background-color: var(--score); border-radius: 12px; }
.home-shortcuts a::before { border-radius: 1px; transform: none; width: 6px; height: 12px; }
.home-shortcuts a > span { display: none; }
.program h3, .family-h, .degree-h { color: var(--ink); }
.family-h { font-size: 1rem; font-weight: 750; }
.rep-panel input, .rep-panel select, .rep-listbar :is(button,select), .rep-list-menu > summary { background-color: #fff; border-color: var(--line); }
.rep-searchrow > button, .rep-custom form > button { background: var(--accent); color: #fff; border-color: var(--accent); }
.rep-match .rep-badge { color: var(--nav-current); background: var(--accent-soft); }
.rep-note { border-inline-start-color: var(--brand-highlight); }
.site-footer { background: #fff; border-top: 1px solid var(--line); padding-block: 30px; color: var(--muted); }
.footer-inner { max-width: 1160px; }
@media (max-width: 1240px) {
  .header-inner { row-gap: 14px; padding-block: 16px 12px; }
  .nav { justify-content: flex-start; gap: 8px; }
  .nav > a { flex: 0 1 auto; padding-inline: 12px; }
}
@media (max-width: 600px) {
  .header-inner { gap: 12px; padding-block: 14px 10px; }
  .brand { font-size: 25px; gap: 9px; letter-spacing: -.06em; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .nav { flex-wrap: wrap; justify-content: space-between; gap: 0 4px; }
  .nav > a { flex: 1 1 auto; min-width: 0; font-size: 14px; padding-inline: 6px; line-height: 1.4; }
  .header-inner > .me-btn { max-width: 100px; font-size: 14px; padding-inline: 10px; }
  .school-finder-layout { padding-block-start: 28px; gap: 22px; }
  .hero-intro::before { width: 32px; height: 5px; margin-block-end: 15px; }
  .hero-intro h1, .hero h1, .page h1 { font-size: clamp(29px, 7.6vw, 36px); }
  .page { padding-block-start: 28px; }
  .grid { gap: 12px; }
  .card h3 { font-size: 1.0625rem; }
  .plist a { padding: 16px; }
}
@media (max-width: 360px) {
  .header-inner { column-gap: 8px; }
  .brand { font-size: 20px; gap: 7px; }
  .brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  .header-inner > .me-btn { max-width: none; padding-inline: 8px; font-size: 13px; white-space: nowrap; overflow-wrap: normal; }
  .header-inner > .me-btn .me-i { display: none; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* ---------- Clearer, crisper look (Dec 2026): white page, darker text, outlined cards ---------- */
:root { --bg: #ffffff; --text: #1d2940; --muted: #45536b; --line: #d6dce8; }
.tags span { background: #eef2ff; color: #1c357f; font-weight: 550; }
.badge.ok { background: #fff; color: var(--ink); border: 1px solid #c9d1e1; font-weight: 650; }
:is(.directory-page,#school-results) .card { border-color: #d3d9e6; }
.grid-h { color: var(--ink); font-size: 14px; letter-spacing: .03em; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-top: 22px; }

/* source line under a page title: plain facts instead of a sales pitch */
.src-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: -6px 0 18px; padding-inline-start: 12px; border-inline-start: 3px solid var(--accent); font-size: 14px; line-height: 1.5; color: var(--muted); }
.src-line b { color: var(--ink); font-weight: 750; }

/* search always visible above the filters */
.fsearch { margin: 0 0 12px; }
.fsearch #comp-q { max-width: none; min-height: 50px; padding: 12px 14px 12px 44px; font-size: 16px; border: 1.5px solid #b9c4dc; border-radius: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23111e36' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='M13 13l5 5'/%3E%3C/svg%3E") no-repeat 14px center; color: var(--ink); }
.fsearch #comp-q:focus { border-color: var(--accent); outline: 2px solid #c8d3ff; outline-offset: 0; }

/* filter panel: numbered steps, folds to a one-line summary */
#comp-filter.fpanel, .schedule-page .ag-filter.fpanel { gap: 0; margin: 0 0 20px; padding: 0; background: #f2f5ff; border: 1.5px solid #cdd8fb; border-radius: 16px; overflow: hidden; }
.fp-sum { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 12px 16px; background: none; border: 0; font: inherit; text-align: start; cursor: pointer; color: var(--ink); }
.fp-t { font-weight: 800; font-size: 16px; flex: 0 0 auto; }
.fp-chosen { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 650; color: var(--accent); }
.fp-ed { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; }
.fp-ed::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.fpanel:not(.is-closed) .fp-ed { background: transparent; color: var(--ink); font-size: 0; padding: 7px 6px; }
.fpanel:not(.is-closed) .fp-ed::after { transform: rotate(-135deg) translate(-2px, -1px); width: 9px; height: 9px; }
.fp-body { display: flex; flex-direction: column; gap: 18px; padding: 16px; border-top: 1.5px solid #cdd8fb; }
.fpanel.is-closed .fp-body { display: none; }
.fp-step { display: flex; flex-direction: column; gap: 10px; }
.fp-step .pick-h { display: flex; align-items: center; font-size: 15px; font-weight: 750; color: var(--ink); margin: 0; }
.fp-step .pick-h i { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; margin-inline-end: 9px; border-radius: 50%; background: var(--ink); color: #fff; font-style: normal; font-size: 12px; font-weight: 800; }
.fpanel .pick-chips .chip { padding: 7px 12px; font-size: 14.5px; }
.fpanel .chip { background: #fff; border: 1.5px solid #c7d0e4; color: var(--ink); font-weight: 600; }
.fpanel .chip em { font-style: normal; color: var(--muted); font-weight: 500; }
.fpanel .chip[aria-pressed="true"] em { color: #dbe3ff; }
.fpanel .dis-row { background: #fff; border: 1.5px dashed #b6c4f3; }
.fpanel .dis-row .chip { border-color: #d3daf0; }
.fp-select { width: 100%; min-height: 50px; padding: 0 44px 0 14px; border: 1.5px solid #b9c4dc; border-radius: 12px; font: inherit; font-size: 16px; font-weight: 650; color: var(--ink); text-align: start; cursor: pointer; -webkit-appearance: none; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none' stroke='%23111e36' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 1.5L7 7l5.5-5.5'/%3E%3C/svg%3E") no-repeat right 16px center; }
.fp-select:focus { border-color: var(--accent); outline: 2px solid #c8d3ff; }
.fp-add { font-size: 15px; color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%232448e5' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M8 2v12M2 8h12'/%3E%3C/svg%3E"); background-position: right 16px center; }
.fpanel .sortbar { margin: 0; flex-wrap: nowrap; align-items: stretch; }
.fpanel .sort-chips { display: flex; flex-wrap: nowrap; gap: 0; padding: 3px; border: 1.5px solid #b9c4dc; border-radius: 12px; background: #fff; }
.fpanel .sort-chips .chip { flex: 1 1 0; min-width: 0; min-height: 42px; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; line-height: 1.25; text-align: center; }
.fpanel .sort-chips .chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.fp-done { width: 100%; min-height: 52px; border: 0; font-size: 16px; font-weight: 750; cursor: pointer; }
.fpanel #comp-count:empty { display: none; }

/* competition cards: compact, one fact per line */
.directory-page .comp > a { padding: 16px 16px 10px; }
.comp .card-top { flex-wrap: nowrap; }
.comp .card-top .city { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; font-size: 13.5px; color: var(--muted); }
.comp .card-top .badge { flex: 0 0 auto; white-space: nowrap; }
.comp h3 { margin: 6px 0 4px; }
.comp .comp-age { margin: 0; font-size: 14px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.comp .comp-age b { font-weight: 700; color: var(--ink); margin-inline-end: 6px; }
.comp .cat-tags { margin-top: 10px; }
.comp .card-foot { padding: 10px 16px 12px; border-top: 1px solid #e6eaf2; margin-top: 2px; }
.comp .card-foot .dl { font-size: 14px; }
#comp-list > .grid-h:first-child { margin-top: 0; }
.fpanel .pick-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.schedule-page .src-line { margin-top: -6px; }
.schedule-page .comp-age { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.schedule-page .ag-sub, .schedule-page .cal-s { color: var(--muted); }
/* age: always visible, open or folded */
.fp-quick { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 0 16px 14px; }
.fp-quick .pick-h { flex: 0 0 auto; font-size: 15px; font-weight: 750; color: var(--ink); margin: 0; }
.fp-quick .fp-select { flex: 1 1 auto; min-width: 0; min-height: 46px; }
.fpanel:not(.is-closed) .fp-quick { padding-bottom: 16px; }
/* age group = main heading; instrument type under it = lighter sub-heading */
.grid-h.age-subgroup { border-bottom: 0; margin-top: 8px; padding: 0; font-size: 13px; color: var(--accent); }
.grid-h.age-group-heading:not(.age-subgroup) + .grid-h.age-subgroup { margin-top: -2px; }
/* steps numbered automatically; a step that is not shown (Type before an instrument is chosen) is skipped */
.fp-body { counter-reset: fp; }
.fp-step { counter-increment: fp; }
.fp-step:has(> .dis-row[hidden]) { display: none; }
.fp-step > .pick-h::before { content: counter(fp); display: inline-grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; margin-inline-end: 9px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; }
.fpanel .dis-row { background: none; border: 0; padding: 0; border-radius: 0; }
.fpanel .dis-row .dis-l { display: none; }
.fpanel .dis-row .chip { border-color: #c7d0e4; }
/* folded instrument row: chosen chip + a quiet "Change" link on the same line */
.fpanel .pick-chips.is-folded { align-items: center; }
.fpanel .pick-chips > .chip-change { background: none; border: 0; padding: 6px 4px; color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.pick-chips > .chip.chip-change, .instr-chips > .chip.chip-change { background: none; border: 0; padding: 6px 4px; color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; box-shadow: none; }
/* no counts next to choice chips: they made the rows look busy (totals stay in the summary / result line) */
.chip em { display: none; }
.alt-search[hidden] { display: none; }
