/* ==========================================================================
   국가숲길 인터랙티브 지도
   ========================================================================== */
:root {
  --ink: #1d2420;
  --ink-2: #3d4842;
  --muted: #6c7770;
  --line: #e3e8e4;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --brand: #2f6b45;
  --brand-ink: #1f4d31;
  --brand-soft: #e7f0e9;
  --shadow-sm: 0 1px 2px rgba(20, 35, 25, .06), 0 1px 3px rgba(20, 35, 25, .08);
  --shadow-md: 0 6px 18px rgba(20, 35, 25, .10), 0 2px 6px rgba(20, 35, 25, .06);
  --shadow-lg: 0 18px 40px rgba(20, 35, 25, .18), 0 4px 12px rgba(20, 35, 25, .10);
  --radius: 14px;
  --header-h: 64px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}

*, *::before, *::after { 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.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- header */
.app-header {
  position: sticky; top: 0; z-index: 50;
  padding-left: max(clamp(16px, 3vw, 32px), calc((100vw - 1680px) / 2 + 32px)) !important;
  padding-right: max(clamp(16px, 3vw, 32px), calc((100vw - 1680px) / 2 + 32px)) !important;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { flex: none; display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: #f6f8f6; border-color: #d3dad5; }
.btn:focus-visible { outline: 3px solid rgba(47, 107, 69, .35); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }

/* trail switcher */
.trail-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px; min-width: 0; flex: 0 1 auto; }
.trail-nav.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.trail-nav.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
.trail-nav.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.trail-nav::-webkit-scrollbar { display: none; }
.trail-nav a {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none;
  transition: background .15s, color .15s;
}
.trail-nav a:hover { background: #eef2ef; }
.trail-nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.trail-nav .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.trail-select {
  display: none; height: 38px; padding: 0 36px 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c7770' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 18px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  -webkit-appearance: none; appearance: none; max-width: 52vw;
}

/* ---------------------------------------------------------------- layout */
.trail-wrap { margin: 0 auto; }
.page { max-width: 1680px; margin: 0 auto; padding: clamp(12px, 2vw, 24px) clamp(12px, 3vw, 32px) 48px; }

.trail-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  margin: 4px 0 14px;
}
.trail-head h1 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.trail-head h1 small { font-size: .62em; font-weight: 700; color: var(--muted); margin-left: 8px; letter-spacing: -.01em; }
.trail-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.chip svg { width: 15px; height: 15px; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.hint svg { width: 16px; height: 16px; flex: none; }

/* ---------------------------------------------------------------- map stage */
.map-shell { position: relative; margin: 0 auto; }
.map-stage {
  position: relative; width: 100%;
  border-radius: var(--radius); overflow: hidden;
  background: #eef0ec; box-shadow: var(--shadow-md);
  touch-action: pan-x pan-y;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.map-stage.is-zoomed { touch-action: none; cursor: grab; }
.map-stage.is-dragging { cursor: grabbing; }
.map-canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; }
/* 움직이는 동안만 GPU 레이어 → 멈추면 확대된 크기로 선명하게 다시 그림 */
.map-canvas.is-moving { will-change: transform; }
.map-canvas.animate { transition: transform .28s cubic-bezier(.2, .7, .2, 1); }
.map-canvas > img, .map-canvas > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-canvas > img { pointer-events: none; -webkit-user-drag: none; }
.map-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(110deg, #eef0ec 30%, #f7f8f6 50%, #eef0ec 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite; z-index: 5; transition: opacity .35s;
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.map-loading.done { opacity: 0; pointer-events: none; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* routes (visual) */
.routes .sec, .routes .extra { transition: opacity .22s ease; }
.routes .sec path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.routes .sec .casing { stroke: #fff; opacity: 0; transition: opacity .2s, stroke-width .2s; }
.routes .sec .line { transition: stroke-width .2s; }
.routes .extra { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.has-active .routes .sec:not(.is-active), .has-active .routes .extra { opacity: .3; }
.routes .sec.is-active .casing { opacity: 1; }
.routes .sec.is-active { filter: drop-shadow(0 0 2.2px rgba(0, 0, 0, .35)); }
.labels-img { transition: opacity .22s; }
.has-active .labels-img { opacity: .9; }

/* hit areas */
.hits path { fill: none; stroke: transparent; stroke-linecap: round; stroke-linejoin: round; cursor: pointer; pointer-events: stroke; }
.hits rect, .hits circle { fill: transparent; cursor: pointer; pointer-events: all; }
.hits .legend-row { transition: fill .15s; rx: 4px; }
.hits .legend-row.is-active { fill: rgba(47, 107, 69, .08); stroke: rgba(47, 107, 69, .35); stroke-width: .6; }
.hits :focus { outline: none; }

/* zoom controls */
.map-tools {
  position: absolute; right: 12px; bottom: 12px; z-index: 6;
  display: flex; flex-direction: column; border-radius: 12px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-md);
}
.map-tools button {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: transparent; cursor: pointer; color: var(--ink-2);
}
.map-tools button + button { border-top: 1px solid var(--line); }
.map-tools button:hover { background: #f3f6f4; color: var(--ink); }
.map-tools button:disabled { color: #c3cac5; cursor: default; background: transparent; }
.map-tools svg { width: 20px; height: 20px; }
.map-toast {
  position: absolute; left: 50%; top: 14px; transform: translate(-50%, -8px); z-index: 7;
  padding: 8px 14px; border-radius: 999px; background: rgba(29, 36, 32, .86); color: #fff;
  font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  white-space: nowrap;
}
.map-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 전체 화면 */
.map-stage.is-full {
  position: fixed; inset: 0; z-index: 70;
  width: 100vw; height: 100vh !important; height: 100dvh !important; max-width: none;
  aspect-ratio: auto !important; border-radius: 0; box-shadow: none; background: #e9ebe7;
}
html.map-full-open, html.map-full-open body { overflow: hidden; }
.full-exit {
  display: none; position: absolute; left: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 7;
  align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; box-shadow: var(--shadow-md);
}
.full-exit svg { width: 18px; height: 18px; }
.map-stage.is-full .full-exit { display: inline-flex; }
.map-stage.is-full .map-tools { bottom: calc(12px + env(safe-area-inset-bottom)); }

/* ---------------------------------------------------------------- popup (노선 설명창) */
.popup {
  position: fixed; left: 0; top: 0; z-index: 80;
  width: 232px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  pointer-events: none;
  opacity: 0; transform: translateY(4px) scale(.98);
  transition: opacity .16s ease, transform .16s ease;
}
.popup.show { opacity: 1; transform: none; }
.popup.pinned { pointer-events: auto; }
.popup-photo { position: relative; aspect-ratio: 16 / 10.5; background: #e9ece8; overflow: hidden; }
.popup-photo img { width: 100%; height: 100%; object-fit: cover; }
.popup-photo .badge {
  position: absolute; left: 10px; top: 10px;
  min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.popup-photo .count {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 700;
}
.popup-photo.placeholder { display: grid; place-items: center; background: #e4e6e5; }
.popup-photo.placeholder .ph {
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: #8a918d;
  font-size: 13px; font-weight: 600; letter-spacing: -.01em;
}
.popup-photo.placeholder .ph svg { width: 30px; height: 30px; }
.popup-body { padding: 12px 15px 14px; }
.popup-title { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.3; letter-spacing: -.02em; }
.popup-km { margin: 1px 0 6px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.popup-info { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.popup-info .center + .center { margin-top: 2px; }
.popup-info .res { margin-top: 2px; }
.popup-sub { font-size: 12px; color: var(--muted); margin: 0 0 2px; font-weight: 600; }
.popup-close {
  position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; display: none; place-items: center; cursor: pointer;
  background: rgba(0, 0, 0, .5); color: #fff;
}
.popup-close svg { width: 16px; height: 16px; }
.popup.pinned .popup-close { display: grid; }
.popup-cta { display: none; margin-top: 12px; width: 100%; }
.popup.pinned .popup-cta { display: flex; }
.popup-gallery { display: none; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: thin; }
.popup.pinned .popup-gallery { display: flex; }
.popup-gallery button {
  flex: none; width: 46px; height: 46px; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: #eee;
}
.popup-gallery button[aria-pressed="true"] { border-color: var(--popup-color, var(--brand)); }
.popup-gallery img { width: 100%; height: 100%; object-fit: cover; }

/* 통합형 미리보기 팝업 */
.popup.preview { width: 340px; }
.popup.preview .popup-photo { aspect-ratio: 3508 / 2361; background: #f3f3f1; }
.popup.preview .popup-photo img { object-fit: contain; }
.popup.preview .popup-title { display: flex; align-items: center; gap: 8px; }
.popup.preview .num {
  width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800;
  display: inline-grid; place-items: center; flex: none;
}
.popup.preview .popup-km { font-size: 14px; color: var(--ink-2); font-weight: 700; margin-bottom: 2px; }
.popup.preview .go { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.popup.preview .go svg { width: 14px; height: 14px; }
.popup.preview.pinned .go { display: none; }

/* 모바일: 하단 시트 */
.popup.sheet {
  left: 12px !important; right: 12px; top: auto !important; bottom: calc(12px + env(safe-area-inset-bottom));
  width: auto; max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: 116px 1fr;
  transform: translateY(24px);
}
.popup.sheet.show { transform: none; }
.popup.sheet .popup-photo { aspect-ratio: auto; height: 100%; min-height: 128px; }
.popup.sheet .popup-photo .count { display: none; }
.popup.sheet .popup-body { padding: 12px 40px 12px 14px; }
.popup.sheet .popup-title { font-size: 15.5px; }
.popup.sheet .popup-km { font-size: 15px; margin-bottom: 4px; }
.popup.sheet .popup-info { font-size: 13px; }
.popup.sheet .popup-close { background: #f0f2f0; color: var(--ink-2); }
.popup.sheet .popup-gallery { display: none !important; }
.popup.sheet.preview { grid-template-columns: 1fr; }
.popup.sheet.preview .popup-photo { min-height: 0; aspect-ratio: 3508 / 2361; max-height: 42vh; }
.popup.sheet.preview .popup-close { background: rgba(0, 0, 0, .5); color: #fff; }
.popup.sheet.preview .popup-body { padding-right: 15px; }

/* ---------------------------------------------------------------- section list */
.section-block { margin-top: clamp(20px, 3vw, 32px); }
.section-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-block-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.section-block-head p { margin: 0; font-size: 13px; color: var(--muted); }
.group-title { margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; }
.group-title::before { content: ""; width: 14px; height: 4px; border-radius: 2px; background: var(--c); }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.sec-card {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start;
  width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.sec-card:hover, .sec-card.is-active { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), var(--shadow-sm); }
.sec-card:focus-visible { outline: 3px solid rgba(47, 107, 69, .35); outline-offset: 2px; }
.sec-card .num {
  grid-row: span 2; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 999px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c); color: #fff; font-size: 13px; font-weight: 800;
}
.sec-card .name { font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: -.02em; }
.sec-card .meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; }
.sec-card .meta b { color: var(--ink); font-weight: 700; }
.sec-card .thumb { display: none; }

/* ---------------------------------------------------------------- overview page */
.overview {
  display: grid; gap: clamp(16px, 2.4vw, 32px);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: start;
}
.overview .map-col { position: sticky; top: calc(var(--header-h) + 16px); }
.overview .map-shell { max-width: calc(100vh - var(--header-h) - 40px); }
.overview .map-stage { aspect-ratio: 1 / 1; }
.side-intro h1 { margin: 0 0 6px; font-size: clamp(24px, 2.4vw, 32px); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.side-intro p { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: center; }
.stat b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.trail-list { display: grid; gap: 10px; }
.trail-card {
  display: grid; grid-template-columns: 112px 1fr auto; gap: 14px; align-items: center;
  padding: 10px; padding-right: 14px; border-radius: 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.trail-card:hover, .trail-card.is-active { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), var(--shadow-md); }
.trail-card:focus-visible { outline: 3px solid rgba(47, 107, 69, .35); outline-offset: 2px; }
.trail-card .thumb { width: 112px; aspect-ratio: 3508 / 2361; border-radius: 9px; overflow: hidden; background: #eef0ec; }
.trail-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.trail-card .t { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.trail-card .num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; flex: none;
}
.trail-card .m { margin-top: 3px; font-size: 13px; color: var(--muted); font-weight: 600; }
.trail-card .arrow { color: #a5aea8; transition: transform .15s, color .15s; }
.trail-card:hover .arrow { color: var(--c); transform: translateX(3px); }
.trail-card .arrow svg { width: 20px; height: 20px; }

.hits .label-box { rx: 6px; }
.overlays img { position: absolute; transition: opacity .22s ease, filter .22s ease; pointer-events: none; }
.has-active .overlays img:not(.is-active) { opacity: .2; }
.overlays img.is-active { filter: drop-shadow(0 0 3px rgba(255, 255, 255, 1)) drop-shadow(0 0 6px var(--c)); }
.hits .label-box.is-active { stroke: var(--c); stroke-width: 1.6; fill: rgba(255, 255, 255, .0); }

.footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1560px) {
  .app-header.has-nav .brand-sub { display: none; }
}
@media (max-width: 1100px) {
  .overview { grid-template-columns: 1fr; }
  .overview .map-col { position: static; }
  .overview .map-shell { max-width: min(100%, 760px); }
  .trail-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}
@media (max-width: 860px) {
  .trail-nav { display: none; }
  .trail-select { display: block; }
}
@media (max-width: 640px) {
  :root { --header-h: 56px; --radius: 12px; }
  .brand-sub { display: none; }
  .brand-title { font-size: 16px; }
  .btn-label { display: none; }
  .btn { padding: 0 10px; }
  .page { padding-left: 12px; padding-right: 12px; }
  .trail-head { margin-bottom: 10px; }
  .hint.desktop { display: none; }
  .map-tools { right: 8px; bottom: 8px; }
  .map-tools button { width: 36px; height: 36px; }
  .trail-list { grid-template-columns: 1fr; }
  .trail-card { grid-template-columns: 96px 1fr auto; gap: 12px; }
  .trail-card .thumb { width: 96px; }
  .stats { gap: 6px; }
  .stat b { font-size: 18px; }
  .sec-grid { grid-template-columns: 1fr; }
}
@media (hover: none) {
  .hint.desktop { display: none; }
}
@media (hover: hover) {
  .hint.touch { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* 번호 원: 숫자를 원 정중앙에 */
.trail-card .num, .popup.preview .num, .sec-card .num, .popup-photo .badge {
  line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0; text-align: center;
}

/* 통합형 지도 제목 - 원본(AI) 위치·크기 기준, 지도 폭(cqw) 비례 → 확대/축소와 함께 변함 */
.overview .map-canvas { container-type: inline-size; }
.ov-title {
  position: absolute; left: 3.9%; top: 4.2%;
  display: flex; flex-direction: column; align-items: flex-start;
  pointer-events: none; user-select: none;
}
.ov-km {
  display: inline-flex; align-items: baseline; gap: .06em;
  padding: .16em .42em .14em; border-radius: 999px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 .3cqw 1.2cqw rgba(30, 60, 85, .16);
  color: #2f5f80; font-size: 4.6cqw; font-weight: 800; line-height: 1; letter-spacing: -.03em;
}
.ov-km small { font-size: .62em; font-weight: 700; color: #5a84a1; letter-spacing: -.01em; }
.ov-sub {
  margin-top: 1.5cqw;
  color: #fff; font-size: 4.2cqw; font-weight: 700; line-height: 1.15; letter-spacing: -.03em;
  text-shadow: 0 .15cqw .8cqw rgba(25, 55, 80, .3);
}
.ov-name {
  margin-top: 1cqw; margin-left: -.2cqw;
  color: #1c1715; font-size: 8.4cqw; font-weight: 800; line-height: 1.08; letter-spacing: -.05em;
}

/* 통합형: 지도를 크게(화면 높이 기준), 목록은 좁게 → 둘을 붙여서 가운데 정렬 */
.overview {
  grid-template-columns: minmax(0, calc(100vh - var(--header-h) - 36px)) 440px;
  justify-content: center;
}
.overview .map-shell { max-width: none; }
.trail-list { gap: 10px; }
.trail-card { grid-template-columns: 150px 1fr auto; gap: 16px; padding: 10px; padding-right: 16px; }
.trail-card .thumb { width: 150px; border-radius: 10px; }
.trail-card .t { font-size: 17px; }
.trail-card .m { margin-top: 4px; font-size: 13.5px; }
@media (max-width: 1100px) {
  .overview { grid-template-columns: 1fr; }
  .overview .map-shell { max-width: min(100%, 760px); }
}
@media (max-width: 640px) {
  .trail-card { grid-template-columns: 116px 1fr auto; gap: 12px; padding-right: 12px; }
  .trail-card .thumb { width: 116px; }
  .trail-card .t { font-size: 16px; }
}

/* 개별형 지도 제목 (지도 안, 원본 위치·크기 기준) */
.map-canvas { container-type: inline-size; }
.map-title {
  position: absolute; display: flex; align-items: center; gap: .9cqw;
  pointer-events: none; user-select: none; white-space: nowrap;
}
.mt-name { font-size: var(--fs); font-weight: 800; line-height: 1.2; letter-spacing: -.045em; color: #1c1715; }
.mt-km {
  display: inline-flex; align-items: baseline; gap: .05em;
  padding: .22em .6em .2em; border-radius: 999px;
  background: rgba(255, 255, 255, .94); box-shadow: 0 .2cqw .9cqw rgba(20, 35, 25, .12);
  font-size: var(--ks); font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--c);
}
.mt-km small { font-size: .72em; font-weight: 700; opacity: .85; }
/* 제목은 한 곳에만: 데스크톱은 지도 안, 모바일은 지도 위 */
.trail-title { display: none; }
@media (max-width: 640px) {
  .trail-title { display: block; }
  .map-title { display: none; }
}

/* ---------------------------------------------------------------- 배경 (깨끗한 밝은 톤, 지도 바다색과 어울리는 차가운 흰색) */
body {
  background-color: #f5f8fb;
  background-image: linear-gradient(180deg, #eef4f9 0%, #f6f9fb 38%, #fafbfc 100%);
  background-attachment: fixed;
}
/* 지도와 목록 사이 간격 */
.overview { column-gap: clamp(28px, 3.4vw, 56px); }
.app-header {
  background: rgba(255, 255, 255, .8);
  border-bottom-color: #e3e9ef;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset;
}
.stat, .trail-card, .sec-card { border-color: #e3e9ef; box-shadow: 0 1px 2px rgba(25, 45, 70, .04), 0 4px 14px rgba(25, 45, 70, .04); }
.chip { background: rgba(255, 255, 255, .85); }
.footer { border-top-color: rgba(30, 60, 40, .1); }
@media (max-width: 640px) { body { background-attachment: scroll; } }
