/* ── 혼자간다 토큰 ──────────────────────────────────────────────────────
 * 🔥 아래 대비는 전부 실제로 계산한 값이다(WCAG 2.x 상대휘도, 2026-10-14 목업 docs/mockup/index.html 에서 옮김).
 *    새 색을 만들면 같이 잰다. 수치 순서: paper / surface / sunken (지도는 --map 따로).
 * 성격: 도로 이정표. 강조색은 표지판 녹색 하나(화면당 주 버튼 하나), 이정표 판(--plate)은 강조색이 아니라 잉크를 뒤집은 면이다.
 * --line 은 장식선 전용(구분선) — 뜻을 싣는 경계에 쓰지 않으므로 3:1 요구 밖이다.
 */
:root {
  --paper:   #F3F5F4;
  --surface: #FFFFFF;
  --sunken:  #E6EBE8;
  --map:     #E1E7E3;
  --ink:     #14201A;   /* 15.3 / 16.8 / 13.9 · map 13.4 */
  --ink-2:   #2D3A33;   /* 10.9 / 11.9 / 9.9 */
  --muted:   #56635C;   /* 5.8 / 6.3 / 5.2 · map 5.0 */
  --line:    #D3DAD6;   /* 장식선 */
  --accent:  #0A6847;   /* 6.2 / 6.8 / 5.6 · map 5.4 — 흰 글자를 6.8:1 로 받는다 */
  --on-accent: #FFFFFF;
  --plate:   #14201A;   /* 이정표 판. 판 위 글자 --on-plate 16.8:1 */
  --on-plate: #FFFFFF;
  --plate-dim: #B9C6BF; /* 판 위 보조 글자 9.5:1 */
  --warn:    #8A5300;   /* 5.8 / 6.3 / 5.2 */
  --radius: 6px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:   #0E1411;
    --surface: #161F1B;
    --sunken:  #1E2924;
    --map:     #1A2420;
    --ink:     #E4ECE8;   /* 15.5 / 14.0 / 12.5 · map 13.3 */
    --ink-2:   #C6D1CB;   /* 11.9 / 10.7 / 9.6 */
    --muted:   #97A59E;   /* 7.3 / 6.6 / 5.9 · map 6.2 */
    --line:    #2A3631;
    --accent:  #5BC79A;   /* 8.9 / 8.1 / 7.2 · map 7.7 */
    --on-accent: #06120C; /* 9.2 */
    --plate:   #E4ECE8;   /* 다크에선 판을 밝게 뒤집는다. 판 위 글자 15.5 */
    --on-plate: #0E1411;
    --plate-dim: #3A4741; /* 판 위 보조 글자 8.1 */
    --warn:    #E2AE52;   /* 9.2 / 8.4 */
  }
}
:root[data-theme="dark"] {
  --paper:#0E1411; --surface:#161F1B; --sunken:#1E2924; --map:#1A2420; --ink:#E4ECE8; --ink-2:#C6D1CB;
  --muted:#97A59E; --line:#2A3631; --accent:#5BC79A; --on-accent:#06120C; --plate:#E4ECE8; --on-plate:#0E1411;
  --plate-dim:#3A4741; --warn:#E2AE52;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--font); overflow-wrap: anywhere; }
img, svg { max-width: 100%; }
a { color: inherit; }
p a, .src a, .prose a, .inline-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.num { font-variant-numeric: tabular-nums; }
/* 글 줄 안의 링크 — 줄 높이는 그대로 두고 위아래 패딩으로 누르는 면만 44px 이상으로(인라인 패딩은 줄 간격을 밀지 않는다).
   2026-10-15 360·1280px 측정에서 18px 높이로 잡힌 것들: 출처 줄·근거 설명·안내 줄·본문 링크 */
p a, li a, dd a, td a { padding: 14px 0; }
.crumb a, .sign__where a, .cpn__i a { padding: 0; }  /* 이미 inline-flex 44px 인 것은 패딩을 겹쳐 얹지 않는다 */
.skip { position: absolute; left: -9999px; min-height: 44px; padding: 12px; }
.skip:focus { left: 16px; top: 8px; z-index: 2000; background: var(--surface); padding: 8px 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 머리 — 로고(=홈) + 내비 5칸 */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 800; font-size: 19px;
        letter-spacing: -0.03em; text-decoration: none; }
.logo svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; color: var(--ink-2); }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--ink); }

/* 제목은 자기 본문에 붙인다: 위 40 > 아래 8 */
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.02em; }
h1 { font-size: clamp(24px, 4.4vw, 32px); margin: 24px 0 8px; letter-spacing: -0.03em; }
h1.quiet { font-size: 15px; font-weight: 400; color: var(--muted); margin: 24px 0 8px; letter-spacing: 0; }
h2 { font-size: 20px; margin: 40px 0 8px; }
h3 { font-size: 17px; margin: 24px 0 8px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

/* 이정표 판 — 이 사이트에서 하나만 기억에 남길 것. 한국 도로 이정표처럼 판 안쪽에 가는 테두리. */
.sign { background: var(--plate); color: var(--on-plate); border-radius: 10px; padding: 8px; }
.sign__in { border: 2px solid var(--on-plate); border-radius: 6px; padding: 12px 16px 8px; }
.sign__head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin: 0 0 4px; }
.sign__title { font-size: clamp(22px, 4.4vw, 34px); font-weight: 800; letter-spacing: -0.04em; margin: 0; }
.sign__where { color: var(--plate-dim); font-size: 14px; margin: 0; }
.sign__where a { color: inherit; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; min-height: 44px; align-items: center; }
.sign ol { list-style: none; margin: 0; padding: 0; }
.sign li + li { border-top: 1px solid var(--plate-dim); }
.sign li a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 28px; align-items: center; gap: 12px; min-height: 56px;
             text-decoration: none; padding: 4px 0; }
.sign li a:hover .dest { text-decoration: underline; text-underline-offset: 4px; }
.dest { font-size: clamp(18px, 3.2vw, 24px); font-weight: 700; letter-spacing: -0.03em; min-width: 0; }
.dest small { display: block; font-size: 13px; font-weight: 400; color: var(--plate-dim); letter-spacing: 0;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev { font-size: 14px; white-space: nowrap; }
.dist { font-size: 20px; font-weight: 700; white-space: nowrap; }
.arrow { width: 28px; height: 28px; }
.sign .empty { color: var(--plate-dim); margin: 8px 0; }

.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
       border-radius: var(--radius); text-decoration: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--ghost { background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; padding: 0 8px; }
.btn--plain { background: var(--sunken); color: var(--ink); min-height: 44px; padding: 0 14px; }

/* 칩 — 필터 1칸. 고른 칩은 잉크 반전(강조색이 아니다) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.chips a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px;
           background: var(--sunken); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.chips a[aria-current="true"] { background: var(--ink); color: var(--paper); font-weight: 700; }  /* 15.3 · 다크 15.5 */
.chips--small a { min-height: 44px; padding: 0 12px; font-size: 14px; }
.filter-label { font-size: 14px; color: var(--muted); margin: 0 0 4px; }

/* 목록 — 줄 전체가 링크(처음부터 만든 경우: 앵커를 grid 로 깐다) */
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 10px; }
.rows li + li { border-top: 1px solid var(--line); }
.rows a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 16px; min-height: 64px;
          text-decoration: none; align-items: center; }
.rows a:hover .rows__name { text-decoration: underline; text-underline-offset: 4px; }
.rows__name { font-weight: 700; }
.rows__meta { color: var(--muted); font-size: 14px; grid-column: 1; }
.rows__ev { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--ink); }
.empty-box { background: var(--surface); border-radius: 10px; padding: 16px; color: var(--ink-2); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card { background: var(--surface); border-radius: 10px; padding: 16px; }
.card h3 { margin: 0 0 4px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

/* 쪽 넘김 — 목록 아래 가운데 */
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 16px 0 0; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
.pager span { color: var(--muted); font-size: 14px; }

/* 유형 안내 */
.guidebox { background: var(--surface); border-radius: 10px; padding: 16px; margin: 0 0 8px; }
.guidebox p { margin: 0 0 8px; }
.howto { margin: 0; padding-left: 20px; }
.howto li + li { margin-top: 8px; }

/* 지도 + 보이는 곳 목록 */
.mapgrid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.map { position: relative; background: var(--map); border-radius: 10px; overflow: hidden; min-height: 520px; z-index: 0; }
.map__canvas { position: absolute; inset: 0; }
.map__tools { position: absolute; right: 12px; top: 12px; z-index: 500; }
.map__note { position: absolute; left: 12px; bottom: 28px; z-index: 500; background: var(--surface); border-radius: 6px;
             padding: 6px 10px; font-size: 13px; color: var(--ink-2); }
.map__note:empty { display: none; }
/* 점 = circleMarker. 색만으로 뜻을 싣지 않는다 — 모양(채움/테두리/점선)과 팝업·목록의 글자 '근거 n'이 같이 말한다.
   점 색은 --ink(지도 위 13.4 · 다크 13.3)·--muted(5.0 · 6.2) — 비텍스트 3:1 이상, 새 색 없음 */
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.legend svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.vis h2 { font-size: 16px; margin: 0 0 8px; }
.vis .rows a { min-height: 56px; padding: 10px 14px; }
.leaflet-container { font: inherit; background: var(--map); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.leaflet-popup-content b { display: block; }
.leaflet-popup-content span { font-size: 14px; color: var(--muted); }
.leaflet-popup-content a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink);
                           text-decoration: underline; text-underline-offset: 3px; }
.leaflet-container a.leaflet-popup-close-button { width: 44px; height: 44px; font-size: 24px; line-height: 44px; color: var(--ink-2); }
.leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 44px !important; }
.leaflet-control-attribution { font-size: 11px; }
.leaflet-control-attribution a { color: var(--ink-2); }

/* 장소 상세 — 할 일: 간다/안 간다. 큰 숫자는 '혼자 근거' 하나(손을 쓰는 숫자 — 이걸 보고 정한다). 강조색은 길찾기 하나. */
.crumb { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.title { font-size: clamp(26px, 5vw, 36px); margin: 4px 0 4px; letter-spacing: -0.04em; }
.meta { margin: 0; color: var(--ink-2); }
.status { display: inline-block; margin-top: 8px; font-size: 14px; color: var(--muted); }
.status--off { color: var(--warn); font-weight: 700; }
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 24px; margin-top: 24px; align-items: start; }
.sign--ease .sign__in { padding: 16px; }
.ease { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0; }
.ease__n { font-size: 72px; line-height: 1; font-weight: 800; letter-spacing: -0.04em; }
.ease__w { font-size: 22px; font-weight: 700; }
.ease__note { margin: 8px 0 12px; color: var(--plate-dim); font-size: 14px; }
.ease__note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.evl { list-style: none; margin: 0; padding: 0; }
.evl li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--plate-dim); }
.evl svg { width: 22px; height: 22px; margin-top: 2px; }
.evl b { display: block; }
.evl span { color: var(--plate-dim); font-size: 14px; }
.evl .na b, .evl .no b { font-weight: 400; color: var(--plate-dim); }
.side .btn--primary { width: 100%; }
.facts { margin: 16px 0 0; background: var(--surface); border-radius: 10px; padding: 4px 16px; }
.facts div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px 0; }
.facts div + div { border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; }
.minimap { margin-top: 16px; border-radius: 10px; overflow: hidden; background: var(--map); aspect-ratio: 4 / 3; position: relative; z-index: 0; }
.src { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* 코스 */
.stops { list-style: none; margin: 0; padding: 0; counter-reset: stop; background: var(--surface); border-radius: 10px; }
.stops li { padding: 12px 16px; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; }
.stops li + li { border-top: 1px solid var(--line); }
.stops .no { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid;
             place-items: center; font-weight: 700; font-size: 14px; }
.stops p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.stop-link { white-space: nowrap; }
.coursemap { border-radius: 10px; overflow: hidden; background: var(--map); height: 380px; position: relative; z-index: 0; margin: 0 0 16px; }

/* 글 */
.prose { max-width: 720px; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 4px; }
.prose h2 { margin-top: 32px; }
.byline { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

/* 더보기 격자 — 제목 있는 두 묶음 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.grid a { display: flex; align-items: center; min-height: 56px; padding: 8px 14px; background: var(--surface); border-radius: 10px;
          text-decoration: none; font-weight: 700; }
.grid a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* 표 — 출처·방침 */
.table-wrap { overflow-x: auto; }
table.plain { border-collapse: collapse; width: 100%; background: var(--surface); border-radius: 10px; font-size: 15px; }
table.plain th, table.plain td { text-align: left; padding: 10px 12px; vertical-align: top; }
table.plain tr + tr td, table.plain tr + tr th { border-top: 1px solid var(--line); }
table.plain th { color: var(--muted); font-weight: 400; font-size: 14px; }

/* 쿠팡 칸 — 기본 꺼짐 */
.cpn { margin: 32px 0 0; background: var(--surface); border-radius: 10px; padding: 16px; }
.cpn__h { margin: 0; font-weight: 700; }
.cpn__d { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.cpn__l { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cpn__i a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.cpn__n { margin: 0; font-size: 14px; color: var(--muted); }

/* 푸터 — 소개·방침·약관은 여기에만 */
.foot { margin-top: 56px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
.foot .wrap { padding-top: 16px; padding-bottom: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 4px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.foot p { margin: 8px 8px 0; }

/* 모바일 — 상단 내비는 숨고 하단 탭바 5칸 */
.tabbar { display: none; }
@media (max-width: 720px) {
  .nav { display: none; }
  body { padding-bottom: 72px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0;
            background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 1000; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px;
              font-size: 12px; color: var(--muted); text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 3px 0 var(--ink); }
  /* 현재 탭은 잉크 + 위 띠. 강조색은 화면마다 주 버튼 하나에 남겨 둔다 */
  .tabbar svg { width: 22px; height: 22px; }
  .cols { grid-template-columns: 1fr; gap: 12px; }
  .actions .btn--primary { width: 100%; }
  .sign li a { grid-template-columns: minmax(0, 1fr) auto auto 20px; gap: 8px; }   /* 근거 칸을 접지 않는다 — 이 판의 요점이다 */
  .sign__in { padding: 12px 12px 4px; }
  .dist { font-size: 17px; }
  .arrow { width: 20px; height: 20px; }
  .mapgrid { grid-template-columns: 1fr; }
  .map { min-height: 62vh; }
  .chips--scroll { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px; }  /* 칩 줄만 가로로 민다(페이지는 0) */
  .chips--scroll li { flex: none; }
  .detail { grid-template-columns: 1fr; }
  .ease__n { font-size: 60px; }
  .facts div { grid-template-columns: 96px minmax(0, 1fr); }
}
