:root {
  --ink: #171b19;
  --forest: #176b4a;
  --forest-dark: #0d5137;
  --leaf: #3a9b70;
  --elementary: #198754;
  --middle: #c46a19;
  --high: #356fa8;
  --paper: #f5f6f3;
  --white: #fff;
  --line: #d9ddd8;
  --line-strong: #c5cbc5;
  --muted: #6d756f;
  --soft: #eef1ed;
  --focus: #f2b742;
  --panel-shadow: 0 18px 55px rgba(29, 39, 34, .18);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow: hidden; background: #e9ede9; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 3000;
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
}
.skip-link:focus { top: 12px; }

/* Compact utility header */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(205, 211, 205, .92);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; letter-spacing: -.04em; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy b { font-size: 19px; }
.brand-copy small { color: var(--muted); font-size: 8px; font-weight: 650; letter-spacing: -.01em; }
.brand-mark { position: relative; width: 27px; height: 29px; display: inline-block; transform: rotate(-7deg); }
.brand-mark i {
  position: absolute;
  left: 1px;
  width: 24px;
  height: 9px;
  display: block;
  border: 2px solid var(--forest);
  border-radius: 50%;
}
.brand-mark i:nth-child(1) { top: 1px; }
.brand-mark i:nth-child(2) { top: 9px; }
.brand-mark i:nth-child(3) { top: 17px; }
.topbar-note { justify-self: center; margin: 0; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.install-button,
.saved-button {
  min-height: 36px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.install-button { border: 0; padding: 0 13px; background: var(--forest); color: white; }
.install-button[hidden] { display: none; }
.saved-button { border: 1px solid var(--line-strong); padding: 0 8px 0 12px; background: white; }
.saved-button span {
  min-width: 21px;
  height: 21px;
  margin-left: 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  font-size: 9px;
}

/* Map-first workspace */
.map-workspace {
  position: fixed;
  inset: 64px 0 0;
  overflow: hidden;
  background: #e8ece8;
}
.map-stage { position: absolute; inset: 0; overflow: hidden; }
.naver-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-toolbar {
  position: absolute;
  top: 16px;
  left: 462px;
  z-index: 20;
  min-width: 230px;
  max-width: min(420px, calc(100vw - 510px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 11px 10px 14px;
  border: 1px solid rgba(205, 213, 206, .95);
  border-radius: 11px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px rgba(31, 45, 38, .11);
  backdrop-filter: blur(10px);
}
.map-toolbar div { min-width: 0; display: grid; gap: 2px; }
.map-toolbar small { color: var(--muted); font: 700 8px/1.2 ui-monospace, monospace; text-transform: uppercase; }
.map-toolbar b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.map-toolbar > span { flex: 0 0 auto; padding: 5px 7px; border-radius: 6px; background: var(--soft); color: var(--forest); font-size: 8px; font-weight: 850; }
.map-empty {
  position: absolute;
  z-index: 15;
  left: calc(50% + 210px);
  top: 50%;
  width: min(310px, calc(100% - 500px));
  display: grid;
  gap: 6px;
  transform: translate(-50%, -50%);
  padding: 18px 20px;
  border: 1px solid rgba(199, 208, 200, .96);
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 15px 38px rgba(29, 43, 36, .14);
  text-align: center;
  pointer-events: none;
}
.map-empty b { font-size: 13px; }
.map-empty span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.map-empty.error { border-color: #e2bfa6; color: #8c4e23; }
.map-empty[hidden] { display: none; }
.map-legend {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  gap: 13px;
  padding: 9px 11px;
  border: 1px solid rgba(207, 214, 208, .95);
  border-radius: 9px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 6px 18px rgba(30, 42, 35, .08);
  color: var(--muted);
  font-size: 8px;
  backdrop-filter: blur(8px);
}
.map-legend span { display: flex; align-items: center; gap: 5px; }
.map-legend span[hidden] { display: none; }
.map-legend i { width: 11px; height: 11px; display: inline-block; }
.legend-home { border: 3px solid var(--forest); border-radius: 50%; background: white; }
.legend-school { border: 2px solid white; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 1px #9caaa0; }
.legend-zone { border: 2px dashed var(--middle); border-radius: 2px; background: rgba(196,106,25,.13); }

/* Search and result rail */
.explorer-panel {
  position: absolute;
  z-index: 100;
  inset: 14px auto 14px 14px;
  width: 420px;
  overflow: hidden;
  border: 1px solid rgba(206, 212, 207, .95);
  border-radius: 14px;
  background: rgba(252, 253, 251, .98);
  box-shadow: var(--panel-shadow);
}
.panel-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c7cec8 transparent;
}
.hero-intro { padding: 24px 22px 17px; border-bottom: 1px solid var(--line); }
.eyebrow {
  margin: 0 0 8px;
  color: var(--forest);
  font: 850 9px/1.2 ui-monospace, monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}
h1, h2, h3, p { word-break: keep-all; }
h1 { margin: 0; font-size: 28px; line-height: 1.18; letter-spacing: -.055em; font-weight: 820; }
h1 em { color: var(--forest); font-style: normal; }
.hero-description { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

.search-box { position: relative; z-index: 60; padding: 16px 18px 14px; border-bottom: 1px solid var(--line); background: white; }
.search-box:focus-within { z-index: 200; }
.search-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-bottom: 12px; padding: 3px; border-radius: 8px; background: var(--soft); }
.search-mode button { height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; }
.search-mode button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(29, 43, 35, .08); }
.search-box > label { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 7px; }
.search-box > label span { font-size: 10px; font-weight: 850; }
.search-box > label small { color: var(--muted); font-size: 8px; }
.autocomplete-shell { position: relative; }
.search-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: white;
  transition: border-color .18s, box-shadow .18s;
}
.search-row:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(23,107,74,.1); }
.search-icon { position: relative; width: 13px; height: 13px; border: 2px solid var(--forest); border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; right: -5px; bottom: -3px; width: 6px; height: 2px; border-radius: 9px; background: var(--forest); transform: rotate(45deg); }
.search-row input { min-width: 0; border: 0; outline: 0; padding: 10px 9px; background: transparent; color: var(--ink); font-size: 13px; }
.search-row button { height: 38px; border: 0; border-radius: 7px; padding: 0 11px; background: var(--forest); color: white; cursor: pointer; font-size: 9px; font-weight: 850; white-space: nowrap; }
.search-row button:hover { background: var(--forest-dark); }
.search-row button:disabled { opacity: .65; cursor: wait; }
.search-hints { display: flex; align-items: center; gap: 5px; padding-top: 9px; }
.search-hints > span { margin-right: 2px; color: #8a918c; font-size: 8px; }
.search-hints button { border: 0; border-radius: 6px; padding: 5px 7px; background: var(--soft); color: #5e6660; cursor: pointer; font-size: 8px; }
.search-hints button:hover { color: var(--forest); background: #e6f1ea; }
.demo-notice { margin: 0; padding: 9px 19px; border-bottom: 1px solid var(--line); background: #fafbfa; color: #7b847e; font-size: 8px; line-height: 1.45; }
.demo-notice span { margin-right: 5px; color: #c58a3c; font-size: 7px; }
.demo-notice.connected { color: var(--forest); }
.demo-notice.connected span { color: var(--leaf); }
.demo-notice.warning { color: #934b23; background: #fff8f3; }

.school-suggestions {
  position: absolute;
  z-index: 3000;
  top: calc(100% + 6px);
  left: -2px;
  right: -2px;
  max-height: min(330px, 52vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 20px 44px rgba(20, 34, 27, .22);
}
.school-suggestions[hidden] { display: none; }
.school-suggestion {
  width: 100%;
  display: grid;
  grid-template-columns: 31px minmax(0,1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.school-suggestion:hover, .school-suggestion:focus-visible, .school-suggestion.active { outline: 0; background: #eef5f0; }
.suggestion-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 7px; background: #e6f1ea; color: var(--forest); font-size: 9px; font-weight: 850; }
.suggestion-icon.address::before { content: ""; width: 8px; height: 8px; border: 2px solid var(--forest); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.suggestion-copy { min-width: 0; display: grid; gap: 3px; }
.suggestion-copy b, .suggestion-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-copy b { font-size: 10px; }
.suggestion-copy > span { color: var(--muted); font-size: 8px; }
.school-suggestion small { max-width: 80px; overflow: hidden; padding: 4px 6px; border-radius: 6px; background: var(--soft); color: var(--forest); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-status { padding: 18px 10px; color: var(--muted); font-size: 9px; text-align: center; }

/* Results */
.results { padding: 18px 18px 24px; }
.results-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.results-heading .eyebrow { margin-bottom: 5px; }
.results h2 { margin: 0; overflow: hidden; font-size: 16px; line-height: 1.28; letter-spacing: -.035em; text-overflow: ellipsis; }
.result-helper { margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.result-overview { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: white; }
.result-overview span { min-width: 48px; display: grid; place-items: center; padding: 7px 6px; border-right: 1px solid var(--line); }
.result-overview span:last-child { border: 0; }
.result-overview b { font: 850 15px/1 ui-monospace, monospace; }
.result-overview small { margin-top: 3px; color: var(--muted); font-size: 6px; white-space: nowrap; }

.boundary-notice, .dong-selector, .assignment-summary, .result-meaning, .level-guide { margin: 0 0 10px; border-radius: 9px; }
.boundary-notice { display: grid; gap: 4px; padding: 11px 12px; border: 1px solid #e6c89b; background: #fff8ea; color: #754a1c; }
.boundary-notice[hidden], .dong-selector[hidden], .assignment-summary[hidden], .result-meaning[hidden] { display: none; }
.boundary-notice b { font-size: 9px; }
.boundary-notice span { font-size: 8px; line-height: 1.55; }
.dong-selector { display: grid; gap: 8px; padding: 11px 12px; border: 1px solid #cfe0d3; background: #f3f8f4; }
.dong-selector div { display: grid; gap: 3px; }
.dong-selector b { color: var(--forest); font-size: 9px; }
.dong-selector span, .dong-selector p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.dong-selector label { display: flex; align-items: center; justify-content: space-between; font-size: 8px; font-weight: 800; }
.dong-selector select { max-width: 160px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 9px; background: white; font-size: 9px; }
.assignment-summary { padding: 11px 12px; border: 1px solid #bcd5c4; background: #edf6ef; }
.assignment-summary-head { display: flex; justify-content: space-between; gap: 9px; margin-bottom: 9px; }
.assignment-summary-head > div { display: grid; gap: 2px; }
.assignment-summary-head b { color: var(--forest); font-size: 10px; }
.assignment-summary-head span, .assignment-summary-head small { color: var(--muted); font-size: 7px; }
.assignment-groups { max-height: 160px; display: grid; gap: 8px; overflow: auto; }
.assignment-groups section { display: grid; grid-template-columns: 36px 1fr; gap: 7px; align-items: start; }
.assignment-groups strong { padding-top: 5px; color: var(--forest); font-size: 8px; }
.assignment-level.middle > strong { color: var(--middle); }
.assignment-level.high > strong { color: var(--high); }
.assignment-level > div { min-width: 0; display: grid !important; gap: 6px !important; }
.assignment-zone-name { display: flex; gap: 5px; align-items: center; font-size: 8px; font-weight: 850; }
.assignment-zone-name small { padding: 2px 5px; border-radius: 5px; background: white; color: var(--muted); font-size: 6px; }
.assignment-school-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.assignment-school-chips a, .assignment-school-chips span { padding: 5px 6px !important; border: 1px solid #d2dfd4; border-radius: 6px; background: white; font-size: 7px !important; }
.assignment-level p { margin: 0; color: var(--muted); font-size: 7px; line-height: 1.45; }

.result-meaning { position: relative; display: grid; gap: 5px; padding: 11px 12px 11px 15px; border: 1px solid #bdd4c4; border-left: 4px solid var(--elementary); background: white; }
.result-meaning.middle { border-color: #e5c598; border-left-color: var(--middle); }
.result-meaning.high { border-color: #b9ccdf; border-left-color: var(--high); }
.result-meaning.neutral { border-left-color: #7c8982; }
.meaning-kicker { width: fit-content; padding: 3px 5px; border-radius: 5px; background: #e8f3ec; color: var(--forest); font-size: 7px; font-weight: 850; }
.result-meaning.middle .meaning-kicker { background: #fff0db; color: #8b4d13; }
.result-meaning.high .meaning-kicker { background: #e9f1f8; color: #315f8c; }
.result-meaning b { display: block; font-size: 10px; }
.result-meaning p { margin: 3px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.result-meaning > small { position: absolute; top: 12px; right: 12px; color: var(--muted); font-size: 7px; }

.result-controls { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -4px 10px; padding: 7px 4px; background: rgba(252,253,251,.95); backdrop-filter: blur(8px); }
.scope-tabs { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 3px; border-radius: 8px; background: var(--soft); }
.scope-tabs button { height: 29px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 8px; font-weight: 800; }
.scope-tabs button.active { background: var(--ink); color: white; }
.assigned-toggle { flex: 0 0 auto; height: 35px; display: flex; align-items: center; gap: 5px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: white; color: var(--muted); cursor: pointer; font-size: 7px; font-weight: 800; }
.assigned-toggle i { width: 14px; height: 14px; display: grid; place-items: center; border: 1px solid #bac3bc; border-radius: 4px; color: transparent; font-size: 8px; font-style: normal; }
.assigned-toggle.active { border-color: var(--forest); color: var(--forest); }
.assigned-toggle.active i { border-color: var(--forest); background: var(--forest); color: white; }

.level-guide { display: grid; gap: 7px; padding: 10px 11px; border: 1px solid var(--line); background: #f9faf8; }
.guide-copy { display: flex; gap: 8px; align-items: center; }
.guide-symbol { flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: #e7f3eb; color: var(--elementary); font-size: 9px; font-weight: 900; }
.guide-symbol.middle { background: #fff0db; color: var(--middle); }
.guide-symbol.high { background: #e8f0f8; color: var(--high); }
.guide-symbol.all { background: #ecefed; color: #65726b; }
.guide-copy b { display: block; font-size: 8px; }
.guide-copy p { margin: 2px 0 0; color: var(--muted); font-size: 7px; line-height: 1.45; }
.high-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; }
.high-stages li { display: grid; gap: 2px; padding: 6px; border: 1px solid #cad8e5; border-radius: 6px; background: #f5f9fc; }
.high-stages span { color: var(--high); font: 800 6px/1 ui-monospace, monospace; }
.high-stages b { font-size: 7px; }
.high-stages small { color: var(--muted); font-size: 6px; }

.column-label { display: flex; align-items: center; justify-content: space-between; padding: 3px 2px 8px; }
.column-label b { font-size: 10px; }
.column-label span { color: var(--muted); font-size: 7px; }
.school-list { display: grid; gap: 6px; }
.school-group { display: grid; gap: 6px; }
.school-group + .school-group { margin-top: 5px; }
.school-group-head { display: flex; justify-content: space-between; padding: 7px 2px 2px; border-bottom: 1px solid var(--line); }
.school-group-head b { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.school-group-head span { color: var(--muted); font-size: 7px; }
.school-card {
  position: relative;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 5px 10px;
  align-items: center;
  padding: 12px 11px 11px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.school-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #b7bdb8; }
.school-card.verified::before, .school-card.confirmed::before { background: var(--elementary); }
.school-card.eligible::before { background: var(--middle); }
.school-card.applicable::before { background: var(--high); }
.school-card:hover { transform: translateY(-1px); border-color: #aebbb2; box-shadow: 0 7px 16px rgba(29,45,36,.07); }
.school-card.active { border-color: var(--forest); background: #fbfefc; box-shadow: 0 8px 20px rgba(25,87,59,.11); }
.school-letter { grid-row: 1 / span 2; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 7px; background: #e7f2eb; color: var(--forest); font-size: 9px; font-weight: 900; }
.school-title { min-width: 0; display: flex; align-items: center; gap: 5px; }
.school-title h3 { min-width: 0; margin: 0; overflow: hidden; font-size: 12px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex: 0 0 auto; padding: 3px 5px; border-radius: 5px; background: var(--soft); color: var(--muted); font-size: 6px; font-weight: 800; }
.school-meta { grid-column: 2; min-width: 0; display: flex; gap: 5px; overflow: hidden; color: var(--muted); font-size: 7px; }
.school-meta span { flex: 0 0 auto; white-space: nowrap; }
.school-meta span:last-child { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.school-meta span + span::before { content: "·"; margin-right: 5px; }
.assignment-state { grid-column: 3; grid-row: 1 / span 2; min-width: 0; display: grid; justify-items: end; gap: 4px; text-align: right; }
.assignment-state small { color: var(--muted); font-size: 6px; }
.assignment-state strong { max-width: 92px; overflow: hidden; padding: 4px 6px; border-radius: 5px; background: var(--soft); color: #606863; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.assignment-state.confirmed strong, .assignment-state.verified strong { background: #dff2e5; color: var(--forest); }
.assignment-state.shared strong { background: #f8efbf; color: #6e5c00; }
.assignment-state.eligible strong { background: #fff0db; color: #8b4d13; }
.assignment-state.applicable strong { background: #e8f0f8; color: #315f8c; }
.empty { display: grid; gap: 5px; padding: 28px 18px; border: 1px dashed var(--line-strong); border-radius: 9px; background: rgba(255,255,255,.7); color: var(--muted); font-size: 9px; text-align: center; }
.empty b { color: var(--ink); }
.empty span { font-size: 8px; }
.loading { animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .45; } }

.panel-foot { display: flex; justify-content: space-between; padding: 14px 20px 20px; color: var(--muted); font-size: 7px; }
.panel-foot a { text-decoration: underline; text-underline-offset: 2px; }

/* Floating school detail */
.school-detail {
  position: absolute;
  z-index: 90;
  right: 16px;
  top: 72px;
  width: min(350px, calc(100vw - 480px));
  max-height: calc(100% - 145px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  background: rgba(19, 36, 28, .96);
  box-shadow: 0 20px 48px rgba(17, 31, 24, .24);
  color: white;
  backdrop-filter: blur(14px);
}
.school-detail.detail-empty { display: none; }
.detail-top { display: flex; justify-content: space-between; gap: 16px; }
.detail-top p { margin: 0 0 5px; color: #9bd3b6; font-size: 8px; }
.detail-top h3 { margin: 0; font-size: 21px; letter-spacing: -.04em; }
.save { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.24); border-radius: 8px; background: transparent; color: white; cursor: pointer; }
.save.saved { border-color: #d9ee9e; background: #d9ee9e; color: var(--ink); }
.detail-summary { margin: 13px 0 18px; color: #a9b8b0; font-size: 9px; line-height: 1.6; }
.assignment-explainer { display: grid; gap: 4px; margin: 0 0 17px; padding: 10px 11px; border: 1px solid rgba(205,231,214,.19); border-radius: 8px; background: rgba(255,255,255,.05); }
.assignment-explainer small { color: #9bd3b6; font-size: 7px; font-weight: 800; }
.assignment-explainer b { color: #edf4ef; font-size: 9px; line-height: 1.45; }
.assignment-explainer span { color: #8fa298; font-size: 7px; }
.assignment-explainer.eligible small { color: #efb670; }
.assignment-explainer.applicable small { color: #9fc5e8; }
.stat-title { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.stat-title b { font-size: 9px; }
.stat-title span { color: #82958b; font-size: 7px; text-align: right; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; }
.stat { padding: 11px; border-right: 1px solid rgba(255,255,255,.12); }
.stat:last-child { border: 0; }
.stat small { display: block; margin-bottom: 6px; color: #8fa298; font-size: 7px; }
.stat strong { font-size: 14px; }
.stat em { margin-left: 2px; color: #d9ee9e; font-size: 7px; font-style: normal; }
.trend { margin-top: 18px; }
.bars { height: 70px; display: flex; gap: 7px; align-items: end; border-bottom: 1px solid rgba(255,255,255,.15); }
.bar { flex: 1; min-height: 14px; position: relative; border-radius: 3px 3px 0 0; background: #69a989; }
.bar span { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); color: #bdcac3; font-size: 7px; }
.bar-labels { display: flex; gap: 7px; margin-top: 5px; color: #758a7f; font-size: 6px; }
.bar-labels span { flex: 1; text-align: center; }
.career-unavailable { margin-top: 17px; padding: 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: rgba(255,255,255,.04); }
.career-unavailable b { color: #d9ee9e; font-size: 8px; }
.career-unavailable p { margin: 5px 0 0; color: #91a298; font-size: 7px; line-height: 1.55; }
.source-link { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 17px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.1); color: #8fa298; font-size: 7px; }
.source-link a { text-decoration: underline; text-underline-offset: 2px; }

/* Map markers */
.naver-school-marker {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 4px;
  border: 1px solid #bcc8be;
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 5px 14px rgba(27, 48, 37, .16);
  cursor: pointer;
  white-space: nowrap;
}
.naver-school-marker span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--forest); color: white; font-size: 8px; font-weight: 850; }
.naver-school-marker b { font-size: 9px; }
.naver-school-marker.middle.verified span { background: var(--middle); }
.naver-school-marker.high.verified span { background: var(--high); }
.naver-school-marker.nearby { opacity: .72; }
.naver-school-marker.selected { border-color: var(--ink); box-shadow: 0 7px 18px rgba(27,48,37,.24); }
.naver-home-marker { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border: 7px solid var(--forest); border-radius: 50%; background: white; box-shadow: 0 0 0 5px rgba(23,107,74,.14), 0 6px 16px rgba(24,65,46,.23); }
.naver-home-marker::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 8px; height: 8px; border-right: 4px solid var(--forest); border-bottom: 4px solid var(--forest); background: white; transform: rotate(45deg); }
.naver-home-marker b { position: absolute; top: 34px; padding: 3px 6px; border-radius: 5px; background: white; box-shadow: 0 3px 8px rgba(24,65,46,.12); color: var(--ink); font-size: 8px; white-space: nowrap; }

/* Mobile navigation and install sheet */
.mobile-nav { display: none; }
.install-sheet[hidden] { display: none; }
.install-sheet { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: end center; }
.sheet-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(13,28,22,.5); backdrop-filter: blur(5px); }
.sheet-panel { position: relative; width: min(460px, 100%); display: grid; gap: 15px; padding: 16px 25px 28px; border-radius: 20px 20px 0 0; background: white; box-shadow: 0 -20px 60px rgba(16,37,27,.18); }
.sheet-handle { justify-self: center; width: 42px; height: 4px; border-radius: 99px; background: #d2d8d3; }
.sheet-app-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: #e9f3ec; }
.sheet-panel h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.sheet-panel p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.sheet-primary, .sheet-secondary { width: 100%; min-height: 47px; border-radius: 9px; cursor: pointer; font-weight: 800; }
.sheet-primary { border: 0; background: var(--forest); color: white; }
.sheet-secondary { border: 1px solid var(--line); background: white; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 3000; transform: translate(-50%, 18px); opacity: 0; padding: 11px 16px; border-radius: 8px; background: var(--ink); color: white; font-size: 10px; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Privacy */
.privacy-page { min-height: 100vh; overflow: auto; padding: 92px 24px 60px; background: var(--paper); }
.privacy-card { width: min(820px, 100%); margin: 0 auto; padding: clamp(30px, 6vw, 60px); border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 24px 70px rgba(22,55,42,.1); }
.privacy-card h1 { margin: 12px 0 20px; font-size: clamp(34px, 6vw, 58px); line-height: 1.08; }
.privacy-lead { margin-bottom: 40px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.privacy-card section { padding: 24px 0; border-top: 1px solid var(--line); }
.privacy-card section h2 { margin: 0 0 10px; font-size: 20px; }
.privacy-card section p, .privacy-updated { margin: 0; color: var(--muted); line-height: 1.75; }
.privacy-updated { margin-top: 24px; font-size: 14px; }
.privacy-back { display: inline-flex; margin-top: 26px; color: var(--forest); font-weight: 800; }

@media (max-width: 1020px) {
  .topbar-note { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .explorer-panel { width: 390px; }
  .map-toolbar { left: 432px; }
  .school-detail { width: min(320px, calc(100vw - 440px)); }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .topbar { height: 58px; padding: 0 13px; }
  .brand-copy small, .install-button { display: none; }
  .saved-button { border: 0; background: var(--soft); }
  .map-workspace { position: relative; inset: auto; min-height: calc(100vh - 58px); margin-top: 58px; overflow: visible; display: flex; flex-direction: column; }
  .map-stage { position: sticky; top: 58px; z-index: 1; width: 100%; height: 43vh; min-height: 330px; }
  .map-toolbar { left: 12px; top: 12px; max-width: calc(100% - 24px); min-width: 210px; }
  .map-empty { left: 50%; width: min(300px, calc(100% - 38px)); }
  .map-legend { right: 10px; bottom: 10px; max-width: calc(100% - 20px); flex-wrap: wrap; gap: 7px 10px; }
  .explorer-panel { position: relative; inset: auto; z-index: 20; width: 100%; overflow: visible; border: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 35px rgba(29,39,34,.13); }
  .panel-scroll { height: auto; overflow: visible; }
  .hero-intro { padding: 22px 18px 15px; }
  h1 { font-size: 27px; }
  .search-box { padding: 15px 16px 13px; }
  .results { padding: 17px 16px 30px; }
  .school-detail { position: relative; right: auto; top: auto; z-index: 22; order: 3; width: calc(100% - 32px); max-height: none; margin: 0 16px 24px; }
  .school-detail.detail-empty { display: none; }
  .result-controls { position: static; }
}

@media (max-width: 430px) {
  .top-actions { gap: 4px; }
  .saved-button { padding-inline: 8px; font-size: 8px; }
  .hero-description { font-size: 9px; }
  .search-box > label small { display: none; }
  .search-hints button:last-child { display: none; }
  .results-heading { grid-template-columns: 1fr; }
  .result-overview { width: 100%; }
  .result-overview span { flex: 1; }
  .result-controls { align-items: stretch; flex-direction: column; }
  .assigned-toggle { justify-content: center; }
  .school-card { grid-template-columns: 30px minmax(0,1fr); }
  .assignment-state { grid-column: 2; grid-row: 3; display: flex; align-items: center; justify-items: start; }
  .school-meta { white-space: nowrap; }
  .school-meta span:nth-child(2) { display: none; }
  .assignment-groups section { grid-template-columns: 1fr; }
  .assignment-groups strong { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
