/* 어린이집 지도 — tokens follow DESIGN.md (Toss-derived, light only) */
:root {
  --brand: #3182f6;
  --brand-strong: #2272eb;
  --brand-soft: #e8f3ff;
  --brand-text: #1b64da;
  --bg: #ffffff;
  --surface: #f2f4f6;
  --surface-strong: #e5e8eb;
  --border: #e5e8eb;
  --border-strong: #d1d6db;
  --text: #191f28;
  --text-soft: #4e5968;
  --text-faint: #6b7684;
  --text-muted: #8b95a1;
  --danger: #e42939;
  --roomy: #0a7c42;
  --roomy-bg: #e6f6ee;
  --tight: #b25e00;
  --tight-bg: #fff3e0;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 58px;
  /* TDS typography tokens (oh-my-design.kr toss, confirmed 2026-10-13): size / line-height */
  --t1: 30px; --t1-lh: 40px;
  --t2: 26px; --t2-lh: 35px;
  --t3: 22px; --t3-lh: 31px;
  --t4: 20px; --t4-lh: 29px;
  --t5: 17px; --t5-lh: 25.5px;
  --t6: 15px; --t6-lh: 22.5px;
  --t7: 13px; --t7-lh: 19.5px;
  --panel-w: 420px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand-text); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
b { font-weight: 700; font-variant-numeric: tabular-nums; }
.ic { flex: none; }
.muted { color: var(--text-faint); }
.danger { color: var(--danger); }
:focus-visible { outline: none; box-shadow: 0 0 0 1px #8ac0ff, 0 0 0 3px #b8d9ff; } /* TDS focus ring */
/* Line breaks: whole words only (keep-all), balanced headings, no lonely last word in paragraphs,
   and number + unit phrases never split ("대기 32명"). */
h1, h2, .h-title, .concl-title, .concl-num, .card-title, .sec-title { text-wrap: balance; }
p, li, .row-sub, .row-ratio { text-wrap: pretty; }
.nw { white-space: nowrap; }

/* ---------- type ---------- */
.h-title { font-size: var(--t2); line-height: var(--t2-lh); font-weight: 700; margin: 8px 0 8px; }
.h-title.sm { font-size: var(--t3); line-height: var(--t3-lh); }
.h-sub { font-size: var(--t6); line-height: var(--t6-lh); color: var(--text-soft); margin: 0 0 24px; }
.sec { margin-top: 32px; }
.sec-title { font-size: var(--t4); line-height: var(--t4-lh); font-weight: 700; margin: 0 0 4px; }
.hint { font-size: 13px; color: var(--text-faint); margin: 6px 0 0; }
.src { font-size: 13px; color: var(--text-faint); margin: 32px 0 0; }
.fact { font-size: 15px; color: var(--text-soft); margin: 12px 0 0; }
.warn { margin: 12px 0 0; padding: 12px 16px; border-radius: 12px; background: #fff0f0; color: var(--danger); font-size: 15px; font-weight: 600; }
.warn a { color: var(--danger); text-decoration: underline; }

/* ---------- buttons ---------- */
.btn-primary {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; border-radius: 16px;
  background: var(--brand); color: #fff; font-size: 17px; font-weight: 600;
}
.btn-primary, .btn-weak, .chip, .seg button { transition: transform 0.1s ease; }
.btn-primary:active, .btn-weak:active, .chip:active { transform: scale(0.96); } /* TDS pressed */
@media (prefers-reduced-motion: reduce) { .btn-primary:active, .btn-weak:active, .chip:active { transform: none; } }
.btn-primary:disabled { background: #b0d0fb; }
.btn-weak {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 16px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand-text); font-size: 15px; font-weight: 600;
}
.btn-weak.wide { display: flex; width: 100%; margin-top: 12px; }
.link { color: var(--brand-text); font-size: 15px; font-weight: 600; padding: 8px 0; }
.link.center { display: block; width: 100%; text-align: center; margin-top: 8px; }
.danger-link { color: var(--danger); margin-top: 24px; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 0; font-size: 15px; }
.links span { color: var(--border-strong); }
.links.small { font-size: 15px; color: var(--text-faint); }
.top-back { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -12px; color: var(--text); }

/* ---------- chips, seg, fields ---------- */
.chips { display: flex; gap: 8px; margin: 24px 0 8px; }
.chips.wrap { flex-wrap: wrap; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; margin-left: -24px; margin-right: -24px; padding: 0 24px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; flex: none;
  background: var(--surface); color: var(--text-soft); font-size: 15px; font-weight: 600; white-space: nowrap;
}
.chip.lg { height: 44px; padding: 0 16px; font-size: 15px; }
.chip.is-on { background: var(--brand-soft); color: var(--brand-text); }
.seg { display: flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 14px; margin-top: 8px; }
.seg button { flex: 1; height: 44px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--text-soft); }
.seg button.is-on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 0.08); }
.seg button:disabled { color: var(--text-muted); }
.seg-4 button { font-size: 15px; }
.field { display: block; margin-top: 16px; }
.field-label { display: block; font-size: 15px; font-weight: 600; color: var(--text-soft); margin: 24px 0 8px; }
.field .field-label { margin-top: 0; }
.field input, .field select, .search input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border-strong);
  font: inherit; font-size: 17px; color: var(--text); background: #fff; -webkit-appearance: none; appearance: none;
}
.field select { background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%238b95a1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>') no-repeat right 12px center; padding-right: 40px; }
.field input:focus, .field select:focus, .search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(49 130 246 / 0.25); }
.birth { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.answer { font-size: 17px; margin: 24px 0 0; min-height: 26px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 24px; font-size: 15px; color: var(--text-soft); }
.check input { width: 22px; height: 22px; accent-color: var(--brand); margin: 1px 0 0; flex: none; }
.search { display: flex; gap: 8px; }
.search .btn-weak { height: 52px; flex: none; }
.results-list { list-style: none; margin: 4px 0 0; padding: 0; }
.results-list button { display: flex; flex-direction: column; width: 100%; padding: 12px 0; text-align: left; border-bottom: 1px solid var(--border); }
.results-list span { font-size: 13px; color: var(--text-faint); }
.results-list .muted { padding: 12px 0; font-size: 15px; }
.place-set { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 16px; border-radius: 12px; background: var(--surface); }
.place-set .ic { color: var(--text-soft); }
.place-set span { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- grade ----------
   One accent only. Blue = 노려볼 만한 곳 (자리당 대기 15명 이하: 여유·해볼 만·치열), gray = 매우 치열·자리 없음.
   Same split as the result list, so color and headline never disagree. The label says the rest. */
.grade { display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; flex: none; }
.g-roomy, .g-ok, .g-tight { background: var(--brand-soft); color: var(--brand-text); }
.g-hard, .g-none, .g-na { background: var(--surface); color: var(--text-faint); }
.t-roomy, .t-ok, .t-tight, .t-hard { color: inherit; }

/* ---------- rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 16px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-name { font-size: var(--t5); line-height: var(--t5-lh); font-weight: 700; }
.row-sub { font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-faint); }
.row-ratio { font-size: var(--t6); line-height: var(--t6-lh); color: var(--text-soft); }
.row-ratio b { font-size: var(--t5); }
@media (hover: hover) { .row:hover { background: var(--surface); margin: 0 -24px; padding-left: 24px; padding-right: 24px; } }
.list-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: 15px; font-weight: 600; color: var(--text-soft); border-bottom: 1px solid var(--border); }
.list-tools .link { font-size: 15px; }
.empty { padding: 40px 0; text-align: center; color: var(--text-soft); }
.empty p { margin: 0 0 16px; }
.fold { margin-top: 16px; border-top: 1px solid var(--border); }
.fold summary { list-style: none; cursor: pointer; padding: 16px 0; font-size: 15px; font-weight: 600; color: var(--text-soft); display: flex; justify-content: space-between; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: '펼치기'; font-size: 15px; color: var(--brand-text); flex: none; margin-left: 12px; }
.fold[open] summary::after { content: '접기'; }
.fold-note { font-size: 15px; color: var(--text-soft); margin: 0 0 16px; }

/* ---------- cards ---------- */
.card { display: block; background: var(--surface); border-radius: 16px; padding: 24px; margin-top: 16px; color: var(--text); }
.card-title { font-size: var(--t4); line-height: var(--t4-lh); font-weight: 700; margin: 0 0 8px; }
.card.info { display: flex; flex-direction: column; gap: 4px; margin-top: 32px; }
.card.info b { font-size: 17px; }
.card.info span { font-size: 15px; color: var(--text-soft); }
.pf ul { list-style: none; margin: 0; padding: 0; }
.pf-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; min-height: 48px; border-top: 1px solid rgb(0 0 0 / 0.05); }
.pf-row:first-child { border-top: 0; }
.pf-role { font-size: 15px; font-weight: 700; }
.r-challenge, .r-fit, .r-stable { color: var(--text-soft); }
.pf-name { font-size: var(--t5); font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pf-name small { font-size: 13px; font-weight: 600; color: var(--text-faint); margin-left: 6px; }
.pf-meta { font-size: var(--t7); line-height: 1.35; color: var(--text-soft); white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.pf-row.is-empty .pf-name { color: var(--text-muted); font-weight: 500; }
.pf-note, .pf-warn { font-size: 13px; color: var(--text-soft); margin: 8px 0 0; }
.pf-warn { color: var(--text); font-weight: 600; margin: 0 0 8px; }
.concl { padding: 24px 24px; }
.concl-label { font-size: 13px; font-weight: 600; color: var(--text-faint); margin: 0; }
.concl-title { font-size: var(--t4); line-height: var(--t4-lh); font-weight: 700; margin: 0; }
.concl-num { font-size: var(--t1); line-height: var(--t1-lh); font-weight: 700; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.concl-sub { font-size: 15px; color: var(--text-soft); margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.concl-rule { font-size: 15px; color: var(--text); margin: 12px 0 0; padding-top: 12px; border-top: 1px solid rgb(0 0 0 / 0.06); }
.concl-rule + .concl-rule { border-top: 0; padding-top: 0; margin-top: 6px; }
.tags { font-size: 15px; color: var(--text-soft); margin: 0; }
.dist { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dist li { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.dist .ic { color: var(--text-faint); }
.cta-row { margin-top: 24px; }
.detail-bar { display: flex; justify-content: space-between; align-items: center; height: 44px; margin-bottom: 4px; }
.fav { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; margin-right: -8px; color: var(--text-muted); }
.fav.is-on { color: var(--danger); }
.fav.is-on svg { fill: currentColor; }
.ages { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.ages th, .ages td { padding: 8px 4px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ages th:first-child { text-align: left; }
.ages thead th { color: var(--text-faint); font-weight: 600; font-size: 13px; }
.ages tr.is-mine th, .ages tr.is-mine td { background: var(--brand-soft); }
.plan-block { margin-top: 32px; }
.plan-role { font-size: 20px; margin: 0; display: flex; align-items: baseline; gap: 8px; }
.plan-role span { font-size: 15px; font-weight: 500; color: var(--text-soft); }
.plan-note { font-size: 15px; color: var(--text-soft); margin: 8px 0 0; }
.plan-note.strong { color: var(--text); font-weight: 600; }
.plan-gap { margin-top: 32px; }
.plan-block .plan-note { margin: 4px 0 0; font-size: 14px; }

/* ---------- my ---------- */
.my-item { border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.my-item .row { border-bottom: 0; }
.rank { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text-soft); }
.rank label { display: flex; align-items: center; gap: 8px; }
.rank input { width: 84px; height: 40px; border-radius: 10px; border: 1px solid var(--border-strong); padding: 0 8px; font: inherit; font-size: 17px; text-align: right; }
.rank .link { margin-left: auto; color: var(--text-faint); }
.add-row { display: flex; align-items: center; gap: 8px; min-height: 56px; margin-top: 8px; padding: 0 16px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-text); font-weight: 600; flex-direction: row-reverse; justify-content: space-between; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 72px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.timeline span { color: var(--text-soft); }
.set-list { list-style: none; margin: 0 0 8px; padding: 0; }
.set-row { display: flex; align-items: center; gap: 8px; min-height: 64px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 600; }
.set-row > span:first-child { flex: none; width: 96px; }
.set-val { flex: 1; text-align: right; color: var(--text-soft); font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-row .ic { color: var(--text-muted); }

/* ---------- onboarding ---------- */
.onb { min-height: calc(100dvh - 40px); display: flex; flex-direction: column; padding-bottom: 120px; }
.onb .top-back { margin-top: 4px; }
.stepper { display: flex; gap: 4px; margin: 8px 0 24px; }
.stepper span { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-strong); }
.stepper span.is-on { background: var(--brand); }
.onb-hero { justify-content: center; }
.hero-img { width: min(100%, 360px); height: auto; margin: 0 auto 8px; display: block; }
.empty img { width: 180px; height: auto; display: block; margin: 0 auto 8px; }
.hero-mark { width: 72px; height: 72px; border-radius: 22px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.hero-points { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hero-points li { background: var(--surface); border-radius: 14px; padding: 16px 16px; font-size: 15px; color: var(--text-soft); }
.hero-points b { color: var(--text); }
.score-box { margin-top: 24px; padding: 16px 24px; border-radius: 16px; background: var(--surface); }
.score-box .field-label { margin: 0; }
.score-num { font-size: 30px; display: block; margin: 2px 0 4px; }
.score-box p { margin: 0; font-size: 15px; color: var(--text-soft); }
.bottom-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 16px 24px calc(var(--safe-b) + 16px);
  background: linear-gradient(to top, #fff 75%, rgb(255 255 255 / 0)); max-width: 640px; margin: 0 auto;
}

/* ---------- skeleton & toast ---------- */
.sk { background: var(--surface); border-radius: 10px; animation: pulse 1.2s ease-in-out infinite; }
.sk-title { height: 34px; width: 60%; margin: 16px 0 24px; }
.sk-card { height: 180px; border-radius: 16px; margin-bottom: 24px; }
.sk-row { height: 60px; margin-bottom: 12px; }
@keyframes pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: 0.2s; z-index: 60; background: rgb(25 31 40 / 0.92); color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 15px; max-width: calc(100% - 48px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- map ---------- */
.pin {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 30px; padding: 0 8px;
  border-radius: 999px; background: #fff; border: 2px solid var(--text-muted); font-size: 15px; color: var(--text-soft);
  position: relative; transform: translateY(-6px); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}
.pin::after { content: ''; position: absolute; bottom: -6px; left: 50%; width: 8px; height: 8px; margin-left: -4px; background: inherit; border-right: 2px solid; border-bottom: 2px solid; border-color: inherit; transform: rotate(45deg); }
.pin.p-roomy, .pin.p-ok, .pin.p-tight { border-color: var(--brand); color: var(--brand-text); }
.pin.p-hard, .pin.p-none { border-color: #b0b8c1; color: var(--text-faint); }
.pin.is-selected { background: var(--brand); border-color: var(--brand); color: #fff; z-index: 5; }
.cluster { display: flex; flex-direction: column; align-items: center; padding: 6px 8px; border-radius: 14px; background: rgb(25 31 40 / 0.85); color: #fff; font-size: 13px; line-height: 1.3; }
.cluster b { font-size: 13px; }
.base-pin { width: 36px; height: 36px; border-radius: 50%; background: var(--text); color: #fff; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.2); }

/* ---------- app layout: mobile ---------- */
body.is-app { min-height: 100dvh; }
.app { position: relative; }
.map { display: none; }
.panel-head { display: none; }
.view { padding: 12px 24px calc(var(--tab-h) + var(--safe-b) + 32px); max-width: 640px; margin: 0 auto; }
.who-line { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600; color: var(--text-soft); height: 40px; }
.who-line .head-ic { color: var(--text-muted); display: flex; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: rgb(255 255 255 / 0.97); border-top: 1px solid var(--border);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.tabbar a.is-on { color: var(--text); }
body[data-route='start'] .tabbar, body[data-route='detail'] .tabbar, body[data-route='plan'] .tabbar { display: none; }
body[data-route='detail'] .view, body[data-route='start'] .view { padding-bottom: 120px; }
.mapcard { display: none; }

/* mobile map screen */
body[data-route='map'] .map { display: block; position: fixed; inset: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 1; }
body[data-route='map'] .view { position: fixed; top: 0; left: 0; right: 0; z-index: 5; padding: 8px 24px 0; pointer-events: none; }
body[data-route='map'] .map-tools > * { pointer-events: auto; }
.map-tools .chips { margin: 0; }
.map-tools .chip { background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.12); }
.map-tools .chip.is-on { background: var(--brand-soft); }
.legend { display: inline-block; margin: 8px 0 0; padding: 4px 8px; border-radius: 8px; background: rgb(255 255 255 / 0.92); font-size: 13px; font-weight: 600; color: var(--text-soft); }
.locate { position: fixed; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); width: 48px; height: 48px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 0.15); display: flex; align-items: center; justify-content: center; color: var(--text); z-index: 6; }
body[data-route='map'] .mapcard:not([hidden]) {
  display: block; position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 7;
  background: #fff; border-radius: 16px; padding: 0 16px; box-shadow: 0 4px 16px rgb(0 0 0 / 0.15);
}
.mapcard .row { border-bottom: 0; }

/* ---------- app layout: wide (panel left, map right) ---------- */
@media (min-width: 900px) {
  body.is-app { height: 100dvh; overflow: hidden; }
  body.is-app .app { display: grid; grid-template-columns: var(--panel-w) 1fr; height: 100dvh; }
  .map { display: block !important; position: relative !important; inset: auto !important; height: 100dvh; background: var(--surface); grid-column: 2; grid-row: 1; }
  .panel { display: flex; flex-direction: column; height: 100dvh; border-right: 1px solid var(--border); min-width: 0; grid-column: 1; grid-row: 1; }
  .panel-head:not(:empty) { display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 16px 0 24px; border-bottom: 1px solid var(--border); flex: none; }
  .who { flex: 1; font-size: 15px; font-weight: 600; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .seg-tabs { display: flex; gap: 2px; background: var(--surface); padding: 4px; border-radius: 10px; }
  .seg-tabs a { padding: 6px 12px; border-radius: 8px; font-size: 15px; font-weight: 600; color: var(--text-soft); }
  .seg-tabs a.is-on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
  .head-ic { display: flex; color: var(--text-muted); padding: 6px; }
  .view { flex: 1; overflow-y: auto; max-width: none; margin: 0; padding: 12px 24px 40px; position: relative !important; pointer-events: auto !important; }
  .who-line { display: none; }
  .tabbar, .mapcard { display: none !important; }
  .bottom-cta { position: sticky; bottom: -40px; margin: 24px -24px -40px; padding-bottom: 24px; }
  .onb { min-height: 0; padding-bottom: 0; }
  .onb-hero { justify-content: flex-start; padding-top: 24px; }
  .toast { bottom: 24px; right: auto; left: calc(var(--panel-w) / 2); transform: translate(-50%, 20px); }
  .toast.is-on { transform: translate(-50%, 0); }
  body[data-route='start'] .app { grid-template-columns: min(480px, 100%) 1fr; }
  .locate, .legend { display: none; }
}
@media (min-width: 1400px) { :root { --panel-w: 480px; } }

/* ---------- server-rendered pages ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 12px; background: rgb(255 255 255 / 0.96); border-bottom: 1px solid var(--border); }
.brand { font-weight: 800; color: var(--text); font-size: 17px; }
.page { max-width: 640px; margin: 0 auto; padding: 16px 24px calc(var(--safe-b) + 100px); }
.page-title { font-size: 26px; line-height: 1.35; margin: 8px 0 6px; }
.page-sub { color: var(--text-soft); margin: 0; font-size: 15px; }
.page .chips { flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; font-size: 13px; color: var(--text-faint); margin-bottom: 12px; }
.crumbs a { color: var(--text-faint); }
.fac-name { font-size: 26px; line-height: 1.35; margin: 0 0 4px; }
.fac-tags { font-size: 15px; color: var(--text-soft); margin: 0; }
.page .btn-primary { margin-top: 24px; }
.sticky { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 16px); width: calc(100% - 48px); max-width: 600px; z-index: 5; }
.boot { padding-top: 64px; }
.page-sub + .rows, .page .chips + .rows { margin-top: 12px; }

/* one-tap choices (onboarding) */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.choices.list { grid-template-columns: 1fr; }
.choice { min-height: 60px; padding: 0 16px; border-radius: 14px; background: var(--surface); font-size: var(--t5); font-weight: 700; color: var(--text); text-align: left; }
.choice.is-on { background: var(--brand-soft); color: var(--brand-text); box-shadow: inset 0 0 0 2px var(--brand); }
.choice:active { transform: scale(0.98); }
.row-choice { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 16px 16px; min-height: 76px; }
.row-choice span { font-size: var(--t6); font-weight: 500; color: var(--text-soft); }
.row-choice.is-on span { color: var(--brand-text); }
/* optional question on results: one line, two small answers */
.ask { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ask b { flex: 1; font-size: var(--t6); line-height: var(--t6-lh); }
.ask-btns { display: flex; gap: 8px; flex: none; }
.ask-btns .btn-weak { height: 36px; padding: 0 12px; border-radius: 10px; font-size: var(--t7); }
.ask-btns .btn-weak.gray { background: var(--surface); color: var(--text-soft); }

/* verdict card: grade + one number; reasons behind ⓘ */
.concl-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.concl-top .grade { height: 28px; padding: 0 10px; font-size: 14px; }
.info-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -4px -8px -4px 0; color: var(--text-muted); border-radius: 999px; }
.info-btn[aria-expanded='true'] { color: var(--brand-text); }
.why { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgb(0 0 0 / 0.06); }
.why p { margin: 0; font-size: var(--t6); line-height: var(--t6-lh); color: var(--text-soft); }
.why p + p { margin-top: 8px; }
.checks { margin: 0 0 16px; padding-left: 20px; font-size: var(--t6); line-height: var(--t6-lh); color: var(--text-soft); }
.checks li + li { margin-top: 8px; }
.checks.tick { list-style: none; padding: 0; }
.checks.tick label { display: flex; gap: 12px; align-items: flex-start; }
.checks.tick input { width: 20px; height: 20px; accent-color: var(--brand); margin: 2px 0 0; flex: none; }
.fold .rows .row:first-child { padding-top: 8px; }
.fold .field { margin-top: 0; }
.fold .field input[type='month'] { font-size: var(--t5); }

/* ---------- fewer lines: separate by space, not rules ---------- */
.row { border-bottom: 0; min-height: 0; padding: 12px 0; }
.rows li + li .row { margin-top: 4px; }
.list-tools { border-bottom: 0; margin-top: 8px; }
.ask { border: 0; padding: 8px 0; margin-top: 24px; }
.fold { border-top: 0; margin-top: 8px; }
.fold summary { padding: 12px 0; color: var(--text); }
.fold summary::after { content: ''; width: 20px; height: 20px; margin-left: 12px; background: no-repeat center / 20px url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%238b95a1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>'); transition: transform 0.15s; }
.fold[open] summary::after { content: ''; transform: rotate(180deg); }
.my-item { border-bottom: 0; padding-bottom: 8px; }
.set-row { border-bottom: 0; }
.timeline li { border-bottom: 0; padding: 8px 0; }
.results-list button { border-bottom: 0; }
/* strategy card */
.pf-head { display: flex; justify-content: space-between; align-items: baseline; }
.pf-head .card-title { margin: 0; }
.pf-more { font-size: var(--t6); font-weight: 600; }
.pf-state { margin: 4px 0 0; font-size: var(--t7); color: var(--text-soft); }
.pf ul { margin-top: 12px; }
.pf-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; min-height: 44px; border-top: 0; color: var(--text); }
.pf-meta { font-size: var(--t6); color: var(--text-soft); text-align: right; }
.pf-name small { font-size: var(--t7); color: var(--brand-text); font-weight: 600; margin-left: 8px; }

/* screens with a fixed bottom button keep their last item visible */
.screen.has-cta { padding-bottom: 120px; }
@media (min-width: 900px) { .screen.has-cta { padding-bottom: 0; } }
.plan-block { margin-top: 24px; }
.plan-role { font-size: var(--t6); font-weight: 700; color: var(--text-soft); margin: 0; }
.plan-role small { margin-left: 8px; font-size: var(--t7); color: var(--brand-text); }
.small-link { display: inline-block; margin-top: 24px; font-size: var(--t6); }

.map-info { position: fixed; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 72px); width: 48px; height: 48px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 0.15); display: flex; align-items: center; justify-content: center; color: var(--text-soft); z-index: 6; }
.map-info[aria-expanded='true'] { color: var(--brand-text); }
.map-tools .legend { position: fixed; right: 72px; bottom: calc(var(--tab-h) + var(--safe-b) + 76px); max-width: 220px; margin: 0; padding: 8px 12px; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 0.15); font-size: var(--t7); line-height: var(--t7-lh); }
@media (min-width: 900px) { .map-info { display: none; } }
.legend[hidden], .why[hidden] { display: none !important; }
body.has-card .locate, body.has-card .map-info, body.has-card .map-tools .legend { display: none !important; }

/* filter sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgb(25 31 40 / 0.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap[hidden] { display: none; }
.sheet-card { width: 100%; max-width: 480px; background: #fff; border-radius: 24px 24px 0 0; padding: 24px 24px calc(var(--safe-b) + 16px); max-height: 90dvh; overflow-y: auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head .card-title { margin: 0; }
.sheet-card .field-label { margin: 24px 0 8px; }
.sheet-card .seg + .seg { margin-top: 8px; }
.sheet-card .chips { margin: 0; }
.sheet-cta { margin-top: 32px; }
@media (min-width: 900px) { .sheet-wrap { align-items: center; } .sheet-card { border-radius: 24px; } }
/* two chips fit on any screen; on the map they float on white */
.map-tools .chips { flex-wrap: nowrap; }

/* ---------- 내 대기 ---------- */
.wait-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.wait-card { background: var(--surface); border-radius: 16px; padding: 16px 16px 16px 20px; }
.wait-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wait-name { font-size: var(--t5); font-weight: 700; color: var(--text); }
.icon-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); border-radius: 999px; margin-right: -4px; }
.wait-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; border-radius: 12px; background: #fff; text-align: left; }
.stat span { font-size: var(--t7); color: var(--text-faint); }
.stat b { font-size: var(--t4); line-height: var(--t4-lh); }
.stat em { font-style: normal; color: var(--brand-text); font-size: var(--t6); }
.add-line { display: flex; align-items: center; gap: 8px; min-height: 56px; margin-top: 8px; color: var(--brand-text); font-weight: 600; font-size: var(--t6); }
.folds { margin-top: 24px; }
/* ---------- 설정 ---------- */
.set-group { font-size: var(--t7); font-weight: 600; color: var(--text-faint); margin: 24px 0 4px; }
.set-list { margin: 0; }
.set-row { min-height: 56px; gap: 12px; cursor: pointer; }
.set-label { flex: none; font-weight: 500; }
.set-val { flex: 1; text-align: right; }
.gray-link { color: var(--text-faint); margin-top: 32px; font-size: var(--t6); font-weight: 500; }
.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--surface-strong); position: relative; flex: none; margin: 0; cursor: pointer; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); transition: transform 0.15s; }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(20px); }
/* one-field sheet */
.input-wrap { display: flex; align-items: center; gap: 8px; margin-top: 16px; border-bottom: 2px solid var(--brand); }
.input-wrap input { flex: 1; min-width: 0; height: 52px; border: 0; outline: none; font: inherit; font-size: var(--t3); font-weight: 600; color: var(--text); background: none; }
.input-wrap span { font-size: var(--t4); font-weight: 600; color: var(--text-soft); }
.wait-card .grade.g-hard, .wait-card .grade.g-none, .wait-card .grade.g-na,
.card .grade.g-hard, .card .grade.g-none, .card .grade.g-na { background: #fff; color: var(--text-soft); }

/* detail: small location map (phone) */
.mini-map { display: block; width: 100%; height: 168px; margin-top: 16px; border-radius: 16px; overflow: hidden; background: var(--surface); padding: 0; cursor: pointer; }
.mini-map .pin { font-size: var(--t7); }
.mini-map + .dist { margin-top: 12px; }
@media (min-width: 900px) { .mini-map { display: none; } }
.btn-weak.gray { background: var(--surface); color: var(--text-soft); }
.cta-row .btn-weak.wide { height: 56px; border-radius: 16px; margin-top: 0; }

.link.inline { padding: 0; font-size: inherit; }
.stat b small { font-size: var(--t6); color: var(--text-faint); font-weight: 600; }
.concl-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; }
.concl-stats div { display: flex; flex-direction: column; }
.concl-stats span { font-size: var(--t7); color: var(--text-faint); }
.concl-stats b { font-size: var(--t1); line-height: var(--t1-lh); }

/* ⓘ panel: formula, grade scale, short notes */
.calc { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-variant-numeric: tabular-nums; }
.calc-k { font-size: var(--t7); color: var(--text-faint); }
.calc b { font-size: var(--t5); }
.calc-op { color: var(--text-muted); }
.calc-r { color: var(--text); }
.scale { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 12px 0 0; padding: 0; }
.scale li { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 10px; background: #fff; font-size: var(--t7); color: var(--text-faint); }
.scale li b { font-size: var(--t7); color: var(--text-soft); }
.scale li.is-on { background: var(--brand-soft); color: var(--brand-text); }
.scale li.is-on b { color: var(--brand-text); }
.notes { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.notes li { font-size: var(--t7); line-height: var(--t7-lh); color: var(--text-soft); padding-left: 12px; position: relative; }
.notes li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); }

/* ---------- phone home: map with a results sheet ---------- */
.grip { display: none; }
.map-tools { display: none; }
@media (max-width: 899px) {
  body[data-route='results'] .map { display: block; position: fixed; inset: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 1; }
  body[data-route='results'] .view {
    position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 5; max-width: none;
    height: var(--sheet-h); overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 24px;
    background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -2px 16px rgb(0 0 0 / 0.1); transition: height 0.22s ease;
  }
  body[data-route='results'] .view.dragging { transition: none; }
  body[data-sheet='peek'] { --sheet-h: 156px; }
  body[data-sheet='half'] { --sheet-h: 58dvh; }
  body[data-sheet='full'] { --sheet-h: calc(100dvh - var(--tab-h) - var(--safe-b) - 72px); }
  body[data-route='results'] .grip { display: flex; position: sticky; top: 0; z-index: 2; height: 24px; margin: 0 -24px; align-items: center; justify-content: center; background: #fff; touch-action: none; cursor: grab; }
  .grip span { width: 40px; height: 4px; border-radius: 2px; background: #d1d6db; }
  body[data-route='results'] .who-line { height: 32px; }
  body[data-route='results'] .map-tools { display: flex; align-items: flex-start; gap: 8px; position: fixed; top: 0; left: 0; right: 0; z-index: 4; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0; pointer-events: none; }
  .map-tools > * { pointer-events: auto; }
  .map-tools .chips { margin: 0; flex: 1; }
  .map-tools .chip { background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.12); }
  .map-tools .chip.is-on { background: var(--brand-soft); }
  .map-btns { display: flex; gap: 8px; }
  .map-btn { width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.15); display: flex; align-items: center; justify-content: center; color: var(--text-soft); }
  .map-btn[aria-expanded='true'] { color: var(--brand-text); }
  .map-tools .legend { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 56px); right: 16px; margin: 0; max-width: 220px; padding: 8px 12px; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 0.15); font-size: var(--t7); line-height: var(--t7-lh); display: block; }
}
@media (min-width: 900px) { .view { height: auto; border-radius: 0; box-shadow: none; } }

/* reviews */
.reviews { margin-top: 32px; }
.rv-head { display: flex; justify-content: space-between; align-items: baseline; }
.rv-head .link { font-size: var(--t6); }
.rv-top { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rv-top span { padding: 6px 10px; border-radius: 10px; background: var(--surface); font-size: var(--t7); color: var(--text-soft); }
.rv-top b { color: var(--brand-text); margin-left: 4px; }
.rv-list { list-style: none; margin: 8px 0 0; padding: 0; }
.rv { padding: 12px 0; }
.rv-meta { display: flex; justify-content: space-between; align-items: center; font-size: var(--t7); color: var(--text-faint); }
.rv-meta .link { font-size: var(--t7); color: var(--text-faint); padding: 0; font-weight: 500; }
.rv-tags { margin: 4px 0 0; font-size: var(--t7); color: var(--brand-text); }
.rv-body { margin: 4px 0 0; font-size: var(--t6); line-height: var(--t6-lh); }
.rv-empty { margin: 8px 0 0; font-size: var(--t6); }
#rvBody { width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-strong); font: inherit; font-size: var(--t5); resize: none; }
#rvBody:focus { outline: none; border-color: var(--brand); }
.rv-err { margin: 8px 0 0; font-size: var(--t7); color: var(--danger); }
.rv-err[hidden] { display: none; }

/* before onboarding: plain dots, no numbers */
.pin.p-dot { width: 10px; height: 10px; min-width: 0; padding: 0; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); cursor: default; }
.pin.p-dot::after { display: none; }
/* policy page */
.doc h1 { font-size: var(--t2); margin: 16px 0 4px; }
.doc h2 { font-size: var(--t4); margin: 32px 0 8px; }
.doc p, .doc li { font-size: var(--t5); line-height: var(--t5-lh); color: var(--text-soft); }
.doc ul { padding-left: 20px; margin: 0; }
.doc a { color: var(--brand-text); }

/* kakao login (Kakao button guide: #FEE500, black 85%) */
.btn-kakao { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; margin-top: 16px; border-radius: 16px; background: #fee500; color: rgb(0 0 0 / 0.85); font-size: var(--t5); font-weight: 600; }
.btn-kakao:active { transform: scale(0.96); }
.empty .btn-kakao { max-width: 320px; margin: 24px auto 0; }
.set-foot { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 24px 0 0; color: var(--text-faint); }
.set-foot .link { font-weight: 500; }
.set-foot .link { margin-top: 0; }
.set-row > span:first-child { width: auto; min-width: 96px; white-space: nowrap; }

/* wide: filters float over the map like on phones */
@media (min-width: 900px) {
  .map-tools { display: flex; align-items: flex-start; gap: 8px; position: fixed; top: 16px; left: calc(var(--panel-w) + 16px); right: 16px; z-index: 4; pointer-events: none; }
  body[data-route='start'] .map-tools { left: calc(min(480px, 100%) + 16px); }
  .map-tools > * { pointer-events: auto; }
  .map-tools .chips { margin: 0; flex: 1; }
  .map-tools .chip { background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.12); }
  .map-tools .chip.is-on { background: var(--brand-soft); }
  .map-btns { display: flex; gap: 8px; }
  .map-btn { width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.15); display: flex; align-items: center; justify-content: center; color: var(--text-soft); }
  .map-btn[aria-expanded='true'] { color: var(--brand-text); }
  .map-tools .legend:not([hidden]) { display: block; position: absolute; top: 56px; right: 0; margin: 0; max-width: 240px; padding: 8px 12px; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 0.15); font-size: var(--t7); line-height: var(--t7-lh); }
}

/* wide: service mark in the panel head */
.brand-mark { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: var(--t5); font-weight: 700; color: var(--text); }
.brand-mark img { border-radius: 8px; }
@media (min-width: 900px) {
  .who-line { display: flex; height: 32px; }
  .who-line .head-ic { display: none; }
}

/* category filter chips over the map */
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip.drop { gap: 2px; padding-right: 10px; }
.chip .caret { color: currentColor; opacity: 0.7; }
.pop { position: fixed; z-index: 30; min-width: 260px; max-width: calc(100vw - 24px); padding: 12px; border-radius: 16px; background: #fff; box-shadow: 0 4px 20px rgb(0 0 0 / 0.16); }
.pop .seg:first-child { margin-top: 0; }
.pop .chips { margin: 0; gap: 8px; }
.pin b { font-size: 13px; font-weight: 700; white-space: nowrap; }

/* walking route lines */
.dist li > div { display: flex; flex-direction: column; gap: 2px; }
.dist small { font-size: var(--t7); color: var(--text-faint); }
.dist small.warn-text { color: var(--text-soft); font-weight: 600; }

.ages-sec .sec-title { margin-bottom: 8px; }
.sheet-sub { margin: 4px 0 0; font-size: 15px; color: var(--text-soft); }
