/* 세종 고입 길잡이 — 스타일 */

:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --surface-3: #e4e8f1;
  --text: #14171f;
  --text-2: #4b5364;
  --muted: #6c7486;
  --line: #dfe3ed;
  --line-strong: #c5cbd9;
  --accent: #2f5bea;
  --accent-hover: #2449c4;
  --accent-soft: #e7edff;
  --accent-ink: #1c3fb5;
  --on-accent: #ffffff;
  --ok: #0f7a57;
  --ok-soft: #dff5ec;
  --warn: #8f5200;
  --warn-soft: #fff1d6;
  --early: #a82a70;
  --early-soft: #fde7f2;
  --late: #5f38c4;
  --late-soft: #ede6ff;
  --hero-a: #e9eeff;
  --hero-b: #f5f6fa;
  /* 그래프 색 (검증된 순서: 파랑 → 주황 → 청록 → 노랑) */
  --c1: #2a78d6;
  --c2: #eb6834;
  --c3: #1baf7a;
  --c4: #eda100;
  --o1: #104281;
  --o2: #1c5cab;
  --o3: #2a78d6;
  --o4: #5598e7;
  --o5: #86b6ef;
  --c-mute: #aab2c2;
  --grid: #e6e9f1;
  --axis: #c5cbd9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 8px 24px rgba(20, 30, 60, .06);
  --shadow-lg: 0 24px 64px rgba(10, 16, 40, .28);
  --font: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --lw: 98px; /* 그래프 이름표 폭 */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1218;
    --surface: #181c25;
    --surface-2: #212634;
    --surface-3: #2a3041;
    --text: #eceff6;
    --text-2: #c2c8d6;
    --muted: #98a1b4;
    --line: #2a3142;
    --line-strong: #3b4459;
    --accent: #7d9bff;
    --accent-hover: #9bb2ff;
    --accent-soft: #1e2a52;
    --accent-ink: #bccaff;
    --on-accent: #0f1218;
    --ok: #55d1a5;
    --ok-soft: #133528;
    --warn: #f0b04f;
    --warn-soft: #3a2a0c;
    --early: #ff8ec6;
    --early-soft: #3d1a2c;
    --late: #b79cff;
    --late-soft: #2a2050;
    --hero-a: #18203a;
    --hero-b: #0f1218;
    --c1: #3987e5;
    --c2: #d95926;
    --c3: #199e70;
    --c4: #c98500;
    --o1: #9ec5f4;
    --o2: #6da7ec;
    --o3: #3987e5;
    --o4: #256abf;
    --o5: #184f95;
    --c-mute: #566078;
    --grid: #262c3b;
    --axis: #3b4459;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1218;
  --surface: #181c25;
  --surface-2: #212634;
  --surface-3: #2a3041;
  --text: #eceff6;
  --text-2: #c2c8d6;
  --muted: #98a1b4;
  --line: #2a3142;
  --line-strong: #3b4459;
  --accent: #7d9bff;
  --accent-hover: #9bb2ff;
  --accent-soft: #1e2a52;
  --accent-ink: #bccaff;
  --on-accent: #0f1218;
  --ok: #55d1a5;
  --ok-soft: #133528;
  --warn: #f0b04f;
  --warn-soft: #3a2a0c;
  --early: #ff8ec6;
  --early-soft: #3d1a2c;
  --late: #b79cff;
  --late-soft: #2a2050;
  --hero-a: #18203a;
  --hero-b: #0f1218;
  --c1: #3987e5;
  --c2: #d95926;
  --c3: #199e70;
  --c4: #c98500;
  --o1: #9ec5f4;
  --o2: #6da7ec;
  --o3: #3987e5;
  --o4: #256abf;
  --o5: #184f95;
  --c-mute: #566078;
  --grid: #262c3b;
  --axis: #3b4459;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0; padding-left: 1.2em; }
li { margin: .3em 0; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 10px; z-index: 50; text-decoration: none; font-weight: 700; }
.skip:focus { top: 12px; }

/* ── 상단 내비게이션 ── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { font-weight: 800; white-space: nowrap; text-decoration: none; color: var(--text); font-size: 17px; display: flex; align-items: center; gap: 8px; }
.brand svg { flex: none; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; position: relative; scroll-behavior: smooth; mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 20px), transparent 100%); padding: 0 8px; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  white-space: nowrap; text-decoration: none; color: var(--muted);
  padding: 7px 12px; border-radius: 999px; font-size: 14.5px; font-weight: 600; transition: background .15s, color .15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.icon-btn {
  flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; color: var(--text-2);
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--text); }
.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .moon { display: block; }
}

/* ── 히어로 ── */
.hero { background: linear-gradient(180deg, var(--hero-a), var(--hero-b)); padding: 44px 0 30px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-ink); background: var(--accent-soft); font-weight: 700; font-size: 13.5px; padding: 5px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(30px, 5.4vw, 48px); font-weight: 800; margin: 14px 0 12px; letter-spacing: -.03em; line-height: 1.18; }
.hero .lead { color: var(--text-2); max-width: 44em; font-size: 17px; margin-bottom: 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dday-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 10px; }
.dday-head h2 { font-size: 17px; font-weight: 800; }
.dday-head a { font-size: 14px; font-weight: 600; text-decoration: none; }
.dday-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 10px; }
.dday {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.dday.next { border-color: var(--accent); }
.dday.next::before { content: "다음"; position: absolute; top: 12px; right: 12px; font-size: 11.5px; font-weight: 800; background: var(--accent); color: var(--on-accent); padding: 2px 8px; border-radius: 999px; }
.dday .n { font-size: 28px; font-weight: 800; color: var(--accent); letter-spacing: -.02em; line-height: 1.2; }
.dday .l { font-weight: 700; font-size: 15px; line-height: 1.35; margin: 4px 0 2px; }
.dday .d { color: var(--muted); font-size: 13.5px; }
.notice {
  margin-top: 18px; padding: 12px 14px; border-radius: 12px; display: flex; gap: 10px; align-items: flex-start;
  background: var(--warn-soft); color: var(--warn); font-size: 14px; border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
}
.notice svg { flex: none; margin-top: 3px; }
.notice b { font-weight: 800; }

/* ── 섹션 공통 ── */
section { padding: 48px 0; }
section + section { border-top: 1px solid var(--line); }
.sec-head { margin-bottom: 22px; }
.sec-kicker { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: .04em; }
.sec-head h2 { font-size: clamp(23px, 3.8vw, 30px); font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.sec-head p { color: var(--text-2); margin: 8px 0 0; max-width: 46em; }
h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
h4 { font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.stack { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.stack > *, .grid-2 > *, .grid-3 > *, .two > *, .type-grid > *, .school-grid > *, .tiles > * { min-width: 0; }
.mt { margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }
.src { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.src a { color: var(--muted); }

.tag {
  display: inline-block; font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; line-height: 1.6;
}
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.early { background: var(--early-soft); color: var(--early); }
.tag.late { background: var(--late-soft); color: var(--late); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.btn {
  display: inline-grid; place-items: center; text-align: center; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 12px;
  padding: 9px 16px; font-weight: 700; font-size: 14.5px; color: var(--text); min-height: 44px; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--text-2); min-height: 40px; transition: background .15s;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ── 일정 ── */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tl {
  display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; align-items: start; margin: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px;
}
.tl.key { box-shadow: inset 4px 0 0 var(--accent); }
.tl.now { border-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 45%, var(--surface)); }
.tl.past { opacity: .55; }
.tl .when { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.tl .when small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.tl .what b { font-weight: 700; }
.tl .what .n { color: var(--text-2); font-size: 14px; display: block; margin-top: 3px; }
.tl .st { text-align: right; }
@media (max-width: 640px) {
  .tl { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .tl .when { grid-column: 1; }
  .tl .when small { display: inline; margin-left: 6px; }
  .tl .st { grid-column: 2; grid-row: 1; }
  .tl .what { grid-column: 1 / -1; }
}
.show-past { margin-bottom: 10px; }

/* ── 학교 유형 ── */
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr)); gap: 14px; }
.type-card { display: flex; flex-direction: column; gap: 8px; }
.type-card h3 { margin: 0; }
.type-card .who { font-weight: 600; }
.type-card .how { color: var(--text-2); font-size: 14.5px; margin: 0; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; margin-bottom: 14px; }
.flow .box { border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); }
.flow .box b { display: block; font-size: 16px; }
.flow .box span { font-size: 14px; color: var(--text-2); }
.flow .arrow { display: grid; place-items: center; color: var(--muted); font-size: 22px; }
@media (max-width: 640px) { .flow { grid-template-columns: 1fr; } .flow .arrow { transform: rotate(90deg); height: 20px; } }

/* ── 표 ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-size: 13px; color: var(--text-2); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover td, tbody tr:hover th { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
th.sortable { padding: 0; }
th.sortable button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 10px 12px; width: 100%; box-sizing: border-box; font: inherit; color: inherit; }
th.sortable.num button { justify-content: flex-end; }
th.sortable button::after { content: "↕"; opacity: .35; font-size: 11px; }
th.sortable[aria-sort="ascending"] button::after { content: "↑"; opacity: 1; color: var(--accent); }
th.sortable[aria-sort="descending"] button::after { content: "↓"; opacity: 1; color: var(--accent); }
th.sortable button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.link-btn { all: unset; cursor: pointer; color: var(--accent); font-weight: 700; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── 단계 ── */
.steps { display: grid; gap: 12px; counter-reset: step; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.step b { display: block; }
.step span { color: var(--text-2); font-size: 14.5px; }

/* ── 폼 ── */
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field label, .field .lab { font-size: 14px; font-weight: 700; }
.field .hint { font-size: 12.5px; color: var(--muted); }
select, input[type="number"], input[type="search"] {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); min-height: 46px;
}
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 420px) { .row-3 { grid-template-columns: 1fr; } }
.result { background: var(--surface-2); border-radius: 14px; padding: 16px; }
.result .big { font-size: 32px; font-weight: 800; color: var(--accent); letter-spacing: -.02em; line-height: 1.2; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 15px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }

/* ── 그래프 공통 ── */
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.viz-head h3 { margin: 0; }
.viz-sub { color: var(--text-2); font-size: 14px; margin: 2px 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--text-2); margin: 0 0 10px; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .ln { width: 2px; height: 14px; flex: none; border-radius: 1px; }
.c1 { background: var(--c1); } .c2 { background: var(--c2); } .c3 { background: var(--c3); } .c4 { background: var(--c4); }
.o1 { background: var(--o1); } .o2 { background: var(--o2); } .o3 { background: var(--o3); } .o4 { background: var(--o4); } .o5 { background: var(--o5); }
.cm { background: var(--c-mute); }

/* 가로 막대그래프 */
.bars { position: relative; padding: 4px 0 0; }
.bars .gridlines { position: absolute; top: 0; bottom: 0; left: var(--lw); right: 54px; pointer-events: none; }
.bars .gridlines i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.bars .gridlines i:first-child { background: var(--axis); }
.bars .reflines { z-index: 2; }
.bars .reflines .ref { width: 2px; margin-left: -1px; border-radius: 1px; }
.bars .reflines .ref:first-child { background: var(--text); }
.bars .reflines .ref.ref-b { background: var(--muted); }
.br {
  position: relative; display: grid; grid-template-columns: var(--lw) 1fr; align-items: center; min-height: 30px;
  border-radius: 8px; cursor: pointer;
}
.br:hover, .br:focus-visible { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.br-l { font-size: 13.5px; font-weight: 600; padding: 0 8px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-in { display: flex; align-items: center; gap: 2px; margin-right: 54px; height: 14px; }
.br-in .seg { height: 14px; flex: none; min-width: 2px; }
.br-in .seg:last-of-type { border-radius: 0 4px 4px 0; }
.br-v { flex: none; margin-left: 6px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.axis { position: relative; height: 20px; margin: 4px 54px 0 var(--lw); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.axis span { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.axis span:first-child { transform: none; }
.viz-empty { color: var(--muted); font-size: 14.5px; padding: 18px 0; }
.viz-table { margin-top: 4px; }
.viz-table table { font-size: 14px; }

/* 구간 막대 (전체를 나눈 비율) */
.segbar { display: flex; gap: 2px; height: 28px; margin: 6px 0 8px; }
.segbar .part { border-radius: 4px; min-width: 3px; display: flex; align-items: center; padding: 0 8px; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: visible; color: #fff; cursor: default; }
.segbar .part.dark-ink { color: #0b0b0b; }
.segbar .part.nolabel { padding: 0; font-size: 0; }
.segbar.thin { height: 8px; margin: 6px 0 4px; }
.segbar.thin .part { padding: 0; border-radius: 0; min-width: 0; }
.segbar.thin .part:first-child { border-radius: 999px 0 0 999px; }
.segbar.thin .part:last-child { border-radius: 0 999px 999px 0; }
.segbar.thin .part:only-child { border-radius: 999px; }

/* 수치 타일 */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tile .k { font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.tile .v { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; margin-top: 2px; }
.tile .v small { font-size: 16px; font-weight: 700; margin-left: 2px; }
.tile .s { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 툴팁 */
#tip {
  position: fixed; z-index: 100; pointer-events: none; max-width: 260px;
  background: var(--text); color: var(--bg); border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); opacity: 0; transition: opacity .1s; left: 0; top: 0;
}
#tip.on { opacity: 1; }
#tip b { display: block; font-size: 13.5px; margin-bottom: 2px; }
#tip .r { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
#tip .r i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* ── 학교 찾기 ── */
.tools { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tools .field { margin: 0; }
@media (max-width: 720px) { .tools { grid-template-columns: 1fr; } }
.school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.school {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, transform .15s;
}
.school:hover { border-color: var(--line-strong); }
.school.picked { border-color: var(--accent); }
.school header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.school h3 { margin: 0; font-size: 18.5px; }
.school .meta { color: var(--text-2); font-size: 13.5px; }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 9px 12px; }
.stat .k { font-size: 12.5px; color: var(--text-2); }
.stat .v { font-weight: 800; font-size: 15.5px; }
.stat .x { font-size: 12.5px; color: var(--muted); }
.school .btn-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: auto; }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); grid-column: 1 / -1; }
.count { color: var(--muted); font-size: 14px; margin-bottom: 10px; }

/* 비교함 */
.cmp-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 140%); z-index: 40; transition: transform .25s;
  background: var(--text); color: var(--bg); border-radius: 16px; padding: 10px 12px 10px 16px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px; width: min(560px, calc(100vw - 24px));
}
.cmp-bar.on { transform: translate(-50%, 0); }
.cmp-bar .names { flex: 1; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-bar .names small { opacity: .7; font-weight: 500; margin-right: 6px; }
.cmp-bar button { border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 800; font-size: 14px; min-height: 40px; }
.cmp-bar .go { background: var(--accent); color: var(--on-accent); }
.cmp-bar .go:disabled { opacity: .5; cursor: default; }
.cmp-bar .clear { background: transparent; color: inherit; opacity: .8; padding: 8px; }

/* ── 대화상자 ── */
dialog {
  border: 0; border-radius: 20px; padding: 0; width: min(760px, calc(100vw - 20px));
  max-height: calc(100dvh - 24px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.wide { width: min(960px, calc(100vw - 20px)); }
dialog::backdrop { background: rgba(8, 12, 24, .6); backdrop-filter: blur(2px); }
.dlg-head {
  position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
}
.dlg-head h3 { font-size: 21px; margin: 8px 0 0; }
.dlg-body { padding: 18px 22px 24px; display: grid; gap: 20px; }
.dlg-body section { padding: 0; border: 0; }
.close { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 12px; width: 44px; height: 44px; font-size: 17px; flex: none; }
.close:hover { background: var(--surface-2); }
.empty-note { color: var(--muted); font-size: 14.5px; margin: 0; }
.note { color: var(--text-2); font-size: 13.5px; margin: 8px 0 0; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 18px; }
.list { font-size: 14.5px; }
.cmp-table th[scope="col"] { min-width: 150px; }
.cmp-table td { min-width: 150px; }

/* ── FAQ · 체크리스트 ── */
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; }
details.faq + details.faq { margin-top: 8px; }
details.faq summary { cursor: pointer; font-weight: 700; padding: 15px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); flex: none; transition: transform .2s; margin-right: 4px; }
details.faq[open] summary::after { transform: rotate(-135deg); }
details.faq .a { padding: 0 0 16px; }
.checklist { list-style: none; padding: 0; display: grid; gap: 8px; }
.checklist li { margin: 0; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.checklist label:has(input:checked) { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.checklist input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.progress-text { font-size: 14px; font-weight: 700; color: var(--text-2); }

.sources { display: grid; gap: 6px; padding-left: 1.4em; font-size: 14.5px; }
footer { padding: 30px 0 110px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 35; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); color: var(--text);
  display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s, bottom .25s;
}
.to-top.on { opacity: 1; pointer-events: auto; }
body.has-cmp .to-top { bottom: 86px; }

@media (max-width: 560px) {
  :root { --lw: 86px; }
  .br-l { font-size: 13px; }
  section { padding: 38px 0; }
  .card { padding: 16px; }
  .dlg-head { padding: 14px 16px 12px; }
  .dlg-body { padding: 16px 16px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .topbar, .cmp-bar, .to-top, .filters, .tools, .btn-row, .hero-cta { display: none !important; }
  body { background: #fff; }
  .card, .school, .tile { box-shadow: none; }
}

/* 전체 비교표: 학교 이름 열 고정 */
#cmpTable td, #cmpTable th { white-space: nowrap; }
#cmpTable tbody th { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--line); }
#cmpTable thead th:first-child { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--line); }
