:root {
  --bg: #f3f4f8; --surface: #fff; --ink: #16171d; --sub: #5f6372; --faint: #9a9eac; --line: #e5e7ee;
  --brand: #4433e6; --brand-weak: #ecebfd; --up: #d93a3f; --down: #16794a;
  --r-lg: 20px; --r-md: 14px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121318; --surface: #1b1d24; --ink: #ecedf2; --sub: #a3a7b5; --faint: #6f7381; --line: #2a2d37; --brand: #948bff; --brand-weak: #27254a; --up: #ff7a7e; --down: #4fd18c; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Pretendard Variable", Pretendard, -apple-system, system-ui, sans-serif; font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 머리 */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -0.03em; text-decoration: none; }
.mark { width: 28px; height: 28px; }
.mark rect { fill: var(--brand); }
.mark circle { fill: #fff; }
.top-search { font-size: 14px; font-weight: 600; color: var(--sub); text-decoration: none; padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }

main { padding: 8px 16px 56px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--sub); margin: 8px 0 4px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--faint); }
h2 { font-size: 19px; letter-spacing: -0.025em; margin: 40px 0 12px; }

/* 첫 덩어리: 동네·과목 이름 + 큰 숫자 */
.hero { padding: 12px 0 4px; }
.hero h1 { margin: 0; font-size: 26px; line-height: 1.3; letter-spacing: -0.035em; font-weight: 800; }
.h-place { display: block; font-size: 15px; font-weight: 600; color: var(--sub); letter-spacing: -0.01em; margin-bottom: 2px; }
.lede { margin: 8px 0 0; color: var(--sub); font-size: 15px; }
.asof { white-space: nowrap; color: var(--faint); }

.tabs { display: inline-flex; gap: 2px; padding: 3px; margin: 22px 0 0; background: var(--line); border-radius: 12px; }
.tabs button { font: inherit; font-size: 15px; font-weight: 700; border: 0; background: transparent; color: var(--sub); padding: 8px 16px; min-height: 40px; border-radius: 9px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 18, 30, 0.12); }
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 22px 20px 18px; margin-top: 12px; }
.big { margin: 0; }
.big-label { display: block; font-size: 14px; font-weight: 600; color: var(--sub); }
.big strong { display: block; font-size: 56px; line-height: 1.05; font-weight: 800; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.big small { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-left: 2px; color: var(--sub); }
.spread { margin: 6px 0 0; color: var(--sub); font-size: 15px; }
.spread b { color: var(--ink); }

/* 학원 하나하나가 점 */
.strip { position: relative; height: 92px; margin: 22px 4px 0; }
.band { position: absolute; top: 0; bottom: 22px; background: var(--brand-weak); border-radius: 8px; }
.dots { position: absolute; left: 0; right: 0; bottom: 26px; height: 60px; }
.dots i { position: absolute; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--brand); opacity: 0.55; }
.med { position: absolute; top: -4px; bottom: 18px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 2px; }
.axis { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; border-top: 1px solid var(--line); }
.axis span { position: absolute; top: 3px; transform: translateX(-50%); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--sub); margin: 10px 0 0; }
.legend span { display: inline-block; margin-right: -8px; vertical-align: middle; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); opacity: 0.55; }
.lg-band { width: 16px; height: 10px; border-radius: 3px; background: var(--brand-weak); }
.lg-med { width: 2px; height: 12px; background: var(--ink); border-radius: 2px; }
.cmp { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; }
.cmp .up { color: var(--up); } .cmp .down { color: var(--down); }

.info { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--sub); margin: 16px 2px; }
.info svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.info b { color: var(--ink); font-weight: 600; }

/* 시세표 */
.board { background: var(--surface); border-radius: var(--r-lg); padding: 18px 0 8px; margin-top: 8px; }
.board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 0 20px; }
.board h2 { margin: 0; font-size: 18px; }
.cnt { color: var(--brand); }
.controls { display: flex; gap: 8px; }
.controls select { font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--bg); border: 0; border-radius: 10px; padding: 8px 30px 8px 12px; min-height: 40px; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%); background-position: right 14px center, right 9px center; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.board-note { font-size: 13px; color: var(--sub); margin: 8px 20px 6px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { border-top: 1px solid var(--line); }
.row[hidden] { display: none; }
.row summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; cursor: pointer; min-height: 64px; }
.row summary::-webkit-details-marker { display: none; }
.row summary:hover { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.nm { min-width: 0; }
.nm b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.nm small { display: block; font-size: 13px; color: var(--sub); }
.pr { flex-shrink: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pr small { font-size: 13px; font-weight: 600; color: var(--sub); margin-left: 1px; }
.pr.none { font-size: 14px; font-weight: 600; color: var(--sub); }
.row details[open] summary { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.detail { padding: 4px 20px 16px; }
.addr { margin: 0 0 8px; font-size: 13px; color: var(--sub); }
.fees { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.fees th { text-align: left; font-weight: 500; padding: 7px 0; border-bottom: 1px solid var(--line); }
.fees td { text-align: right; padding: 7px 0 7px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 700; }
.map { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--brand); padding: 4px 0; }
.empty { color: var(--sub); padding: 16px 20px; margin: 0; }
.nofee { border-top: 1px solid var(--line); padding: 0 20px; }
.nofee summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--sub); padding: 14px 0; }
.nofee ul { margin: 0 0 14px; padding: 0; list-style: none; columns: 2; column-gap: 24px; font-size: 14px; }
.nofee li { padding: 3px 0; break-inside: avoid; }
.nofee small { color: var(--faint); margin-left: 6px; }

/* 과목·지역 시세표 (행 전체가 링크) */
.sheet { background: var(--surface); border-radius: var(--r-lg); margin-top: 20px; overflow: hidden; }
.sheet-row { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); text-decoration: none; font-variant-numeric: tabular-nums; }
.sheet-row:first-child { border-top: 0; }
.sheet-h { font-size: 12px; font-weight: 600; color: var(--sub); padding: 12px 20px 10px; }
.sheet-row > span:not(:first-child) { text-align: right; }
a.sheet-row:hover { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.sj { font-weight: 700; letter-spacing: -0.02em; }
.sj small { display: block; font-size: 12px; font-weight: 500; color: var(--sub); }
.v { font-weight: 700; font-size: 16px; }
.sheet:has(.sheet-row > span:nth-child(4):last-child) .sheet-row { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
.hint { color: var(--faint); font-size: 12px; margin: 8px 4px 0; }

/* 운영사 서비스 안내 */
.owner { margin: 20px 2px 0; padding: 14px 16px; border-radius: var(--r-md); border: 1px dashed var(--line); font-size: 14px; color: var(--sub); }
.owner p { margin: 0; } .owner b { color: var(--ink); } .owner a { color: var(--brand); font-weight: 700; }
.owner small { display: block; margin-top: 4px; font-size: 12px; color: var(--faint); }
footer a { color: var(--sub); }

/* 다른 과목 타일 · 칩 */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tiles a, .tile { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; text-decoration: none; display: flex; flex-direction: column; }
.tiles a:hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.tiles span { font-size: 14px; font-weight: 600; color: var(--sub); }
.tiles b { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tiles small { font-size: 12px; color: var(--faint); }
.tiles.big b { font-size: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; background: var(--surface); border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 500; }
.chips a:hover { box-shadow: inset 0 0 0 1.5px var(--brand); color: var(--brand); }
.chips.big a { font-size: 16px; font-weight: 700; padding: 8px 18px; min-height: 44px; }

/* 홈 */
.home-hero { padding: 36px 0 8px; }
.home-hero h1 { font-size: 34px; line-height: 1.25; letter-spacing: -0.045em; font-weight: 800; margin: 0; }
.home-hero .lede { font-size: 16px; margin-top: 12px; }
.search { position: relative; margin: 24px 0 12px; }
.search svg { position: absolute; left: 18px; top: 18px; width: 22px; height: 22px; fill: none; stroke: var(--sub); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; font: inherit; font-size: 17px; font-weight: 500; padding: 16px 18px 16px 50px; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 18, 30, 0.06), 0 0 0 1px var(--line); -webkit-appearance: none; }
.search input:focus { outline: none; box-shadow: 0 0 0 2px var(--brand); }
.hits { display: grid; margin-top: 6px; background: var(--surface); border-radius: var(--r-md); overflow: hidden; }
.hits:empty { display: none; }
.hits a { padding: 14px 18px; text-decoration: none; font-weight: 600; border-top: 1px solid var(--line); }
.hits a:first-child { border-top: 0; }
.hits a:hover, .hits a:focus { background: var(--brand-weak); }
.pop a { font-size: 13px; min-height: 34px; padding: 4px 12px; }

.prose { background: var(--surface); border-radius: var(--r-lg); padding: 8px 22px 20px; margin-top: 12px; }
.prose h1 { font-size: 24px; letter-spacing: -0.03em; }
.prose h2 { font-size: 17px; margin: 24px 0 6px; }
.prose p { color: var(--sub); }

.faqs { margin-top: 40px; }
.faq { background: var(--surface); border-radius: var(--r-md); margin-top: 6px; padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 0 0 16px; color: var(--sub); font-size: 15px; }
.ad { margin: 32px 0; min-height: 100px; }
footer { color: var(--faint); font-size: 12px; padding: 8px 0 48px; }
footer p { margin: 6px 0; }
.f-links a { color: var(--sub); margin-right: 14px; font-size: 13px; }

@media (max-width: 480px) {
  .hero h1 { font-size: 24px; }
  .big strong { font-size: 48px; }
  .panel { padding: 20px 16px 16px; }
  .board-head, .row summary, .detail, .nofee { padding-left: 16px; padding-right: 16px; }
  .board-note { margin-left: 16px; margin-right: 16px; }
  .sheet-row { padding: 13px 14px; gap: 4px; } .v { font-size: 15px; }
  .nofee ul { columns: 1; }
  .home-hero h1 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
