:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2f4bff;
  --brand-2: #6a5cff;
  --from: #2563eb;
  --to: #e11d48;
  --ok: #059669;
  --warn: #d97706;
  --plan: #7c3aed;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(17, 24, 39, .12), 0 2px 6px rgba(17, 24, 39, .06);
  --header: 56px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* ---------- 헤더 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000; height: var(--header);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: block; flex: none; overflow: hidden; }
.logo-mark svg { display: block; width: 100%; height: 100%; }
.logo small { font-weight: 600; color: var(--muted); font-size: 12px; margin-left: 2px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--ink-2); font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.nav a:hover, .nav a[aria-current] { background: #eef0ff; color: var(--brand); text-decoration: none; }

/* ---------- 지도 영역 ---------- */
.map-wrap { position: relative; height: calc(100vh - var(--header)); height: calc(100dvh - var(--header)); min-height: 520px; background: var(--bg); }
/* 지도는 화면 가장자리에서 살짝 띄워 네 모서리를 둥글게 */
#map { position: absolute; inset: 12px; background: #eef1f4; border-radius: 22px; overflow: hidden; box-shadow: 0 0 0 1px rgba(17, 24, 39, .06), 0 6px 24px rgba(17, 24, 39, .08); isolation: isolate; }
/* 간소화 지도 바탕: 가운데가 살짝 밝은 회청색 (지역 상자·한강이 도드라지게) */
body.map-simple #map { background: #dde9f3; } /* 바다 */
.leaflet-container { font-family: var(--font); }
/* 경로를 찾으면 나머지 노선·역은 회색으로 물러나 경로만 또렷하게 */
body.has-route .leaflet-net-pane { opacity: .16; filter: grayscale(1); }
body.has-route .leaflet-station-pane { opacity: .12; filter: grayscale(1); }
body.has-route .leaflet-city-pane { opacity: .6; }
.leaflet-net-pane, .leaflet-station-pane, .leaflet-city-pane { transition: opacity .5s, filter .5s; }
.route-line, .route-case { opacity: 0; }
.route-line.drawn, .route-case.drawn { opacity: 1; }

.panel {
  position: absolute; z-index: 600; top: 26px; left: 26px; bottom: 26px; width: 372px;
  display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.panel-head { padding: 18px 20px 10px; }
.panel-head h1 { margin: 0; font-size: 18px; letter-spacing: -.02em; line-height: 1.35; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { overflow-y: auto; padding: 0 20px 20px; flex: 1; }
#sheet-handle { display: none; }

.search { position: relative; display: grid; grid-template-columns: 1fr 40px; gap: 8px; margin-top: 6px; }
.fields { display: grid; gap: 6px; background: #f3f4f6; border-radius: 12px; padding: 6px; }
.field { position: relative; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 9px; padding: 0 12px; border: 1px solid transparent; }
.field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 75, 255, .12); }
.field .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.from { background: var(--from); }
.dot.to { background: var(--to); }
.field input { border: 0; outline: 0; height: 40px; width: 100%; font: inherit; font-size: 15px; background: transparent; color: var(--ink); }
.side-btns { display: grid; gap: 6px; align-content: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 16px; color: var(--ink-2); display: grid; place-items: center; }
.icon-btn:hover { background: #f3f4f6; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10; list-style: none; margin: 0; padding: 6px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); max-height: 320px; overflow: auto; }
.suggest li { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.suggest li.on, .suggest li:hover { background: #eef0ff; }
.dots { display: flex; gap: 3px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }

.years { display: flex; gap: 4px; margin: 14px 0 4px; padding: 4px; background: #f3f4f6; border-radius: 12px; }
.years button { flex: 1; border: 0; background: transparent; padding: 7px 0; font-size: 12.5px; font-weight: 700; color: var(--muted); border-radius: 9px; white-space: nowrap; }
.years button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.years-cap { font-size: 11.5px; color: var(--muted); margin: 0 2px 10px; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 2px 0 12px; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px 0; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
body:not([data-mode="commute"]) .mode-commute, body[data-mode="commute"] .mode-route { display: none; }
.cm-cap { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.hub-chips .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cm-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 10px; }
.cm-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cm-tbl th, .cm-tbl td { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.cm-tbl th { font-size: 12px; color: var(--muted); font-weight: 600; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }
.chip small { color: var(--muted); font-weight: 600; margin-left: 2px; }
.hub-line { margin-top: 8px; padding: 8px 10px; border-radius: 9px; background: #f9fafb; border-left: 4px solid var(--c); font-size: 13px; }
.hub-line .v { font-size: 15px; }

/* ---------- 결과 ---------- */
.idle { padding: 8px 0; }
.hint { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; color: var(--ink-2); }
.step { width: 22px; height: 22px; border-radius: 50%; background: #eef0ff; color: var(--brand); font-weight: 800; font-size: 12px; display: grid; place-items: center; flex: none; }
.pop { margin-top: 12px; }
.pop-t { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.chip { display: inline-block; margin: 0 6px 6px 0; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--ink-2); }
.chip:hover { border-color: var(--brand); color: var(--brand); }

.res { animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.res-top { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 8px; }
.res-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.res-min { font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.compare { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 12px; background: #ecfdf5; border-radius: 10px; font-size: 13px; color: #065f46; flex-wrap: wrap; }
.compare .arrow { opacity: .5; }
.compare .saved { font-weight: 800; }
.res-meta { margin-top: 8px; font-size: 13px; color: var(--muted); }
.res-avail { margin-top: 8px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.tag.open { background: #ecfdf5; color: var(--ok); }
.tag.construction { background: #fff7ed; color: var(--warn); }
.tag.planned { background: #f5f3ff; color: var(--plan); }
.badge { display: inline-block; background: var(--c); color: #fff; font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }

.legs { list-style: none; margin: 16px 0 0; padding: 0; position: relative; }
.leg { position: relative; display: flex; gap: 12px; padding: 0 0 16px 0; }
.leg::before { content: ''; position: absolute; left: 6px; top: 14px; bottom: -2px; width: 3px; background: var(--c, #d1d5db); border-radius: 2px; }
.leg.walk::before { background: repeating-linear-gradient(#9ca3af 0 3px, transparent 3px 7px); }
.leg.end::before { display: none; }
.lg-dot { width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--c, #9ca3af); background: #fff; flex: none; margin-top: 2px; position: relative; z-index: 1; }
.leg.end .lg-dot { border-color: var(--to); }
.leg.walk { font-size: 13px; color: var(--muted); }
.leg.walk small { margin-left: 4px; }
.lg-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lg-st { margin-top: 4px; font-size: 14.5px; }
.lg-meta { font-size: 12.5px; color: var(--muted); }
.endpoints { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.endpoints details { padding: 6px 0; }
.endpoints summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.disclaimer { font-size: 11.5px; color: var(--muted); margin: 12px 0 0; }
.empty { padding: 14px; background: #fff7ed; border-radius: 12px; font-size: 13.5px; margin-top: 10px; }
.empty p { margin: 4px 0; }

/* ---------- 역 정보 ---------- */
.st-popup .leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow); }
.st-popup .leaflet-popup-content { margin: 14px 16px; font-family: var(--font); }
.st-name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 6px; }
.st-name small { font-size: 13px; color: var(--muted); font-weight: 600; }
.approx { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--plan); background: #f5f3ff; padding: 2px 6px; border-radius: 5px; }
.st-lines, .st-notes { list-style: none; margin: 8px 0 0; padding: 0; }
.st-lines li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px; }
.ls.open { color: var(--ok); }
.ls.construction { color: var(--warn); font-weight: 700; }
.ls.planned { color: var(--plan); font-weight: 700; }
.st-notes li { font-size: 12px; color: var(--ink-2); padding: 6px 8px; background: #f9fafb; border-radius: 8px; margin-top: 4px; }
.st-actions { display: flex; gap: 6px; align-items: center; margin-top: 12px; }
.btn { border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; color: #fff; background: var(--brand); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.from { background: var(--from); }
.btn.to { background: var(--to); }
.st-actions .more { margin-left: auto; font-size: 12.5px; font-weight: 600; }

.st-tip { font-family: var(--font); font-weight: 700; font-size: 12px; border-radius: 8px; }
.st-label span {
  position: absolute; transform: translate(-50%, 7px); white-space: nowrap; font-size: 11px; font-weight: 600; color: #374151;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; pointer-events: none;
}
.st-label.hub span { font-weight: 800; font-size: 12px; color: #111827; }
body.has-route .st-label { opacity: .3; }

.end-pin .pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0, 0, 0, .25); border: 2px solid #fff; animation: drop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.end-pin .pin b { transform: rotate(45deg); color: #fff; font-size: 10.5px; }
.end-pin.from .pin { background: var(--from); }
.end-pin.to .pin { background: var(--to); }
.end-pin .pin-name { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); background: #111827; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
@keyframes drop { from { transform: rotate(-45deg) translate(10px, -10px); opacity: 0; } to { transform: rotate(-45deg); opacity: 1; } }
.xfer-pin span { display: block; background: #111827; color: #fff; font-size: 10.5px; font-weight: 800; text-align: center; border-radius: 5px; padding: 1px 0; }

.legend { position: absolute; z-index: 500; right: 16px; bottom: 26px; background: rgba(255, 255, 255, .95); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 12px; display: grid; gap: 5px; }
.legend div { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; }
.legend svg { width: 34px; height: 8px; }

.toast { position: fixed; z-index: 2000; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; transition: .25s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 광고 ---------- */
.ad-slot { margin: 16px 0 0; min-height: 280px; }
@media (min-width: 769px) { .ad-slot { min-height: 250px; } }
/* 지도 패널 안 광고: 경로 결과와 붙지 않게 간격과 구분선 */
.panel .ad-slot { margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--line); }
.panel .ad-slot.placeholder { border-top: 1.5px dashed #d1d5db; }
.ad-slot.placeholder { display: grid; place-items: center; border: 1.5px dashed #d1d5db; border-radius: 12px; color: #9ca3af; font-size: 12px; }

/* ---------- 콘텐츠 페이지 ---------- */
.content { max-width: 1040px; margin: 0 auto; padding: 48px 20px 64px; }
.content h2 { font-size: 24px; letter-spacing: -.02em; margin: 48px 0 12px; }
.content h2:first-child { margin-top: 0; }
.content h1 { font-size: 30px; letter-spacing: -.03em; margin: 0 0 8px; line-height: 1.3; }
.lead { color: var(--ink-2); font-size: 16px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--ink); display: block; }
a.card:hover { border-color: var(--brand); text-decoration: none; box-shadow: 0 6px 18px rgba(47, 75, 255, .08); }
.card .t { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.card .s { font-size: 13px; color: var(--muted); margin-top: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline > li { position: relative; padding: 0 0 22px 22px; }
.timeline > li::before { content: ''; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.timeline .yr { font-size: 18px; font-weight: 800; }
.timeline ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.timeline ul li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { background: #f9fafb; font-size: 12.5px; color: var(--muted); }
.stations-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.stations-list a { display: inline-block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13.5px; color: var(--ink-2); }
.stations-list a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--ink-2); }
.mini-map { height: 380px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin: 16px 0; }
.cta { display: inline-block; margin-top: 12px; background: var(--brand); color: #fff; font-weight: 700; padding: 11px 18px; border-radius: 12px; }
.cta:hover { text-decoration: none; filter: brightness(1.08); }
.note { font-size: 13px; color: var(--muted); }
.footer { border-top: 1px solid var(--line); background: #fff; padding: 28px 20px; font-size: 13px; color: var(--muted); }
.footer .in { max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.footer a { color: var(--muted); }

/* ---------- 모바일 ---------- */
@media (max-width: 768px) {
  .nav a { padding: 8px 8px; font-size: 13px; }
  .nav a.hide-m { display: none; }
  .logo small { display: none; }
  .panel {
    top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 64%; border-radius: 20px;
  }
  #sheet-handle { display: block; width: 100%; height: 22px; border: 0; background: transparent; position: relative; flex: none; }
  #sheet-handle::after { content: ''; position: absolute; left: 50%; top: 9px; width: 40px; height: 4px; border-radius: 4px; background: #d1d5db; transform: translateX(-50%); }
  .panel-head { padding: 0 16px 6px; }
  .panel-head h1 { font-size: 15.5px; }
  .panel-head p { display: none; }
  .panel-body { padding: 0 16px 16px; }
  .legend { top: 18px; bottom: auto; right: 62px; padding: 7px 9px; font-size: 11px; }
  #map { inset: 8px; border-radius: 18px; }
  .res-min { font-size: 32px; }
  .content h1 { font-size: 24px; }
}
@media (max-width: 420px) {
  .nav a.hide-s { display: none; }
  .nav a { padding: 8px 6px; }
}
.leaflet-tooltip.mini-tip { font-size: 11px; padding: 2px 6px; }
/* 주요 거점역 이름표 */
.st-label.major span { font-weight: 700; font-size: 12px; color: #fff; background: #2B2F3A; padding: 3px 9px; border-radius: 999px; text-shadow: none; transform: translate(9px, -50%); box-shadow: 0 2px 6px rgba(43,47,58,.25); }
/* 예상 요금 */
.fare { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 9px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); }
.fare-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.fare b { font-size: 16px; }
.fare small { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }

/* ---------- 경로 옵션 · 현실 소요시간 ---------- */
.opt-tabs { display: flex; gap: 6px; margin: 0 0 14px; }
.opt { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); text-align: left; transition: border-color .15s, background .15s; }
.opt:hover { border-color: #c7cbd3; }
.opt.on { border-color: var(--ink); background: #f9fafb; box-shadow: inset 0 0 0 1px var(--ink); }
.opt-name { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.opt.on .opt-name { color: var(--brand); }
.opt b { font-size: 16px; letter-spacing: -.02em; }
.opt small { font-size: 11.5px; color: var(--muted); }
.opt-same { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.opt-note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
/* 탑승시간: 시간 막대의 탑승 색(파랑)과 같은 계열로 강조 */
.res-ride { display: inline-block; vertical-align: 6px; margin-left: 8px; padding: 3px 10px; border-radius: 999px; background: #e6eeff; color: #1f4fd1; font-size: 15px; font-weight: 700; letter-spacing: -.01em; line-height: 1.4; }
.res-ride b { font-weight: 800; }
.tbar { display: flex; gap: 2px; height: 8px; margin-top: 10px; border-radius: 4px; overflow: hidden; }
.tb-walk { background: #cbd5e1; }
.tb-xfer { background: #8b95a7; }
.tb-wait { background: #f6b73c; }
.tb-ride { background: #3b6fe0; }
.tlegend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.tlegend .lg-ride { color: #1f4fd1; font-weight: 800; }
.tlegend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }
.lg-wait { font-size: 12px; color: #92400e; margin: 3px 0 2px; }
.lg-wait small { color: var(--muted); margin-left: 4px; }

/* ---------- 지도 모드 전환 · 간소화 모드 ---------- */
.mm-ctl { display: flex; background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(17, 24, 39, .15); padding: 3px; gap: 2px; }
.mm-btn { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; min-height: 34px; }
.mm-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.city-label span { position: absolute; transform: translate(-50%, -50%); font-size: 15px; font-weight: 800; letter-spacing: .25em; color: #d5dae2; white-space: nowrap; pointer-events: none; }
.city-label.big span { font-size: 22px; color: #cfd5de; }
body.map-simple .st-label span { font-size: 11.5px; }
@media (pointer: coarse) { .st-tip { font-size: 13px; } }

/* 좁은 폰(≤400px): 헤더 줄바꿈 방지 */
.logo, .nav a { white-space: nowrap; }
.nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
@media (max-width: 400px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .logo { font-size: 16px; gap: 7px; }
  .logo small { display: none; }
  .nav a { font-size: 12.5px; padding: 8px 5px; }
}

/* 상세 페이지 미니 지도: 메인 지도와 같은 간소화/실사 모드 */
.mini-map { background: #eef1f4; }
.mini-map.simple { background: #e8ecf0; background-image: radial-gradient(ellipse 75% 65% at 50% 45%, #f4f6f8 0%, #eaeef2 55%, #e1e6ec 100%); }
.mini-map .city-label span { font-size: 13px; }
.mini-map .city-label.big span { font-size: 18px; }
.mini-map .mm-btn { min-height: 30px; padding: 5px 9px; font-size: 12px; }
@media (max-width: 600px) { .mini-map { height: 320px; } }

/* 간소화 노선도: 지역 상자 이름 */
.region-label span { position: absolute; transform: translate(10px, 8px); font-size: 12px; font-weight: 800; letter-spacing: .04em; color: #7d8ca5; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.region-label.gg span { color: #84977a; }
.region-label.incheon span { color: #6c989e; }
.river-label span { position: absolute; transform: translate(-50%, -50%); font-size: 12px; font-weight: 700; font-style: italic; letter-spacing: .3em; color: #6f9cc4; white-space: nowrap; pointer-events: none; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }

/* 내 위치 버튼 */
.locate-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(17, 24, 39, .15); display: grid; place-items: center; cursor: pointer; }
.locate-btn:active { background: #f1f3f6; }

/* ---------- 경로 닫기 버튼: 경로가 있을 때만 지도 위에 ---------- */
.route-exit { display: none; position: absolute; z-index: 650; top: 26px; left: calc(50% + 199px); transform: translateX(-50%); border: 0; border-radius: 999px; background: #111827; color: #fff; font-size: 13.5px; font-weight: 700; padding: 9px 16px; box-shadow: 0 4px 14px rgba(17, 24, 39, .25); white-space: nowrap; }
.route-exit:hover { background: #1f2937; }
body.has-route .route-exit { display: block; animation: exit-in .25s ease both; }
@keyframes exit-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 768px) {
  .route-exit { top: 20px; left: 20px; transform: none; font-size: 13px; padding: 8px 13px; }
  body.has-route .route-exit { animation: none; }
}

/* ---------- 누를 수 있는 곳은 모두 손가락 커서 (Leaflet 기본 스타일이 컨트롤 커서를 덮어써서 지정) ---------- */
a, button, summary, select, label[for], [role="button"], [role="tab"], [data-act], .suggest li,
.leaflet-container .leaflet-control button, .leaflet-container .leaflet-control a, .leaflet-container .locate-btn,
.leaflet-container .leaflet-interactive, .leaflet-container a.leaflet-popup-close-button { cursor: pointer; }
button:disabled { cursor: default; }

/* ---------- 좌우 광고 레일 (PC 넓은 화면만) ---------- */
.ad-rail { display: none; }
.ad-rail .ad-slot { margin: 0; height: 600px; }
/* 메인 지도: 1280px 이상이면 지도 오른쪽에 300px 레일, 지도는 그만큼 좁힌다 */
@media (min-width: 1280px) {
  .ad-rail.map-rail { display: block; position: absolute; top: 12px; right: 12px; width: 300px; bottom: 12px; overflow: hidden; }
  .map-wrap:has(.map-rail) #map { right: 324px; }
  .map-wrap:has(.map-rail) .legend { right: 340px; }
  .map-wrap:has(.map-rail) .route-exit { left: calc((100% - 324px + 410px) / 2); }
}
/* 본문 페이지: 본문(1040px) 양옆 여백에 고정 레일. 1400px 이상 160px, 1760px 이상 300px */
@media (min-width: 1420px) {
  .ad-rail.rail-left, .ad-rail.rail-right { display: block; position: fixed; top: calc(var(--header) + 24px); width: 160px; z-index: 5; }
  .ad-rail.rail-left { left: calc(50% - 520px - 184px); }
  .ad-rail.rail-right { right: calc(50% - 520px - 184px); }
}
@media (min-width: 1760px) {
  .ad-rail.rail-left, .ad-rail.rail-right { width: 300px; }
  .ad-rail.rail-left { left: calc(50% - 520px - 324px); }
  .ad-rail.rail-right { right: calc(50% - 520px - 324px); }
}

/* 동네 검색 결과: 동네 이름 + 가장 가까운 역 */
.suggest li.place small { color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.suggest li.place .pl-ic { color: var(--brand); font-weight: 400; margin-right: 6px; }
.suggest li.place .pl-near { font-size: 12px; color: var(--ink-2); white-space: nowrap; margin-left: 8px; }

/* 개선 요청 */
.content.narrow { max-width: 720px; }
.fb-form { display: grid; gap: 18px; margin-top: 24px; }
.fb-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fb-form legend, .fb-field > span { font-weight: 700; font-size: 14px; margin-bottom: 8px; display: block; padding: 0; }
.fb-field small { font-weight: 400; color: var(--muted); }
.fb-types { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-types label { cursor: pointer; position: relative; }
.fb-types input { position: absolute; opacity: 0; pointer-events: none; }
.fb-types span { display: inline-block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; background: #fff; }
.fb-types input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 700; }
.fb-types input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.fb-field input, .fb-field textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; background: #fff; }
.fb-field textarea { resize: vertical; min-height: 140px; }
.fb-field input:focus, .fb-field textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fb-actions .btn { padding: 12px 28px; font-size: 15px; }
.fb-actions .btn:disabled { opacity: .6; }
.fb-status { margin-top: 18px; padding: 14px 16px; border-radius: 12px; font-size: 14px; line-height: 1.6; }
.fb-status.ok { background: #ecfdf3; color: #065f46; }
.fb-status.warn { background: #fff7ed; color: #9a3412; }
.fb-log { list-style: none; padding: 0; margin: 0; }
.fb-log li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fb-log time { color: var(--muted); font-size: 12.5px; margin-right: 10px; font-variant-numeric: tabular-nums; }
.fb-strip { max-width: 1040px; margin: 0 auto 32px; padding: 0 20px; box-sizing: border-box; }
.fb-strip a { display: block; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; font-size: 14px; color: var(--ink-2); }
.fb-strip a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.fb-link { display: block; margin: 14px 0 4px; font-size: 13px; color: var(--brand); }

/* 허브 페이지 소개 문단, 푸터 메뉴 */
.intro p { color: var(--ink-2); font-size: 15px; line-height: 1.75; margin: 10px 0 24px; }
.foot-nav { margin-bottom: 6px; }
.foot-nav a { font-weight: 600; }

/* ---------- 공유하기 버튼 (총 소요시간 오른쪽) ---------- */
.share-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 1px solid #c9d2ff; background: #f3f5ff; color: var(--brand); font: inherit; font-size: 13.5px; font-weight: 700; padding: 8px 12px; border-radius: 10px; margin-bottom: 4px; }
.share-btn:hover { background: #e8ecff; }
.share-btn:active { transform: translateY(1px); }
.res-static .res-top { margin-top: 4px; }

/* ---------- 추진 단계 배지 ---------- */
.stage { display: inline-block; font-size: 11.5px; font-weight: 800; line-height: 1; padding: 4px 7px; border-radius: 6px; white-space: nowrap; vertical-align: 1px; }
.stage.st-open { background: #e7f7ee; color: #047857; }
.stage.st-cons { background: #fff1e0; color: #c2410c; }
.stage.st-pass { background: #e6f0ff; color: #1d4ed8; }
.stage.st-plan { background: #f1f0f7; color: #6b6585; }
.stage-sep { font-size: 11px; color: var(--muted); margin: 0 3px 0 2px; }
.stage-help .stage { margin: 0 2px 0 8px; }
.stage-help .stage:first-child { margin-left: 2px; }
.card .s .stage { margin-right: 4px; }
.tl-tbl tr.yr-first td { border-top: 2px solid #d8dce3; }
.tl-tbl td:first-child { white-space: nowrap; }

/* ---------- 경로 페이지 ---------- */
.route-links { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 6px; }
.route-links li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.route-steps { padding-left: 20px; display: grid; gap: 8px; }
.route-steps li { line-height: 1.6; }

/* ---------- 간소화 노선도: 시·군·구 배경과 안내 ---------- */
.base-label span { position: absolute; transform: translate(-50%, -50%); font-size: 13px; font-weight: 800; letter-spacing: .2em; color: #b4bcc6; white-space: nowrap; pointer-events: none; }
.legend-note { display: none; margin: 4px 0 0; padding-top: 6px; border-top: 1px solid var(--line); max-width: 210px; font-size: 11px; line-height: 1.45; color: var(--muted); font-weight: 500; }
body.map-simple .legend-note { display: block; }
.sheet-map-note { display: none; margin-top: 4px; font-size: 11.5px; color: var(--muted); }

/* ---------- 푸터 ---------- */
.foot-legal a { color: var(--ink-2); }
.foot-legal b { font-weight: 800; }

/* ---------- 휴대폰(768px 이하) 바텀시트 ---------- */
@media (max-width: 768px) {
  /* 시트는 높이를 바꾸지 않고 아래로 밀어 내리기만 한다(translate). 그래야 휴대폰에서도 끊기지 않고 움직인다.
     얼마나 내릴지(--sheet-y)는 app.js 의 setSheet 가 상태(peek·mid·open)마다 계산해 넣는다 */
  .map-wrap { overflow: hidden; }
  .panel {
    max-height: 70%; touch-action: pan-y; will-change: transform; backface-visibility: hidden;
    transform: translate3d(0, var(--sheet-y, calc(100% - 290px)), 0); transition: transform .34s cubic-bezier(.2, .85, .25, 1);
  }
  .panel.no-anim, body.sheet-init .panel { transition: none; }
  /* 손잡이: 누르기 쉽게 높이를 키우고 막대도 조금 굵게. 제목 줄까지 끌어서 올리고 내릴 수 있다 */
  #sheet-handle { height: 30px; touch-action: none; cursor: grab; }
  #sheet-handle::after { top: 11px; width: 46px; height: 5px; background: #c4c9d2; }
  .panel-head { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
  body:not(.sheet-open) .panel .panel-body { overflow: hidden; }
  /* 접힘(peek): 손잡이와 제목만 → 지도를 거의 가리지 않는다 */
  body.sheet-peek .panel .panel-head h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 휴대폰: 범례가 실사 지도 버튼을 가리지 않게 안내 문구는 시트 안으로 */
  body.map-simple .legend-note { display: none; }
  body.map-simple .sheet-map-note { display: block; }
  .share-btn { padding: 7px 10px; font-size: 13px; }
}
