/* K-hisroad — 화면 스타일. 색·글꼴·간격은 모두 tokens.css에서 가져온다. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -48px; z-index: 100; background: var(--brand); color: var(--on-brand); padding: 8px 12px; border-radius: var(--radius); }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 8px); }

.wrap {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-left: max(var(--margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--margin), env(safe-area-inset-right, 0px));
}

/* ---------- 타이포그래피 (DESIGN.md 스케일) ---------- */
.display, .heading, .title, .title-sm { font-family: var(--font-serif); font-weight: 600; text-wrap: balance; margin: 0; }
.display { font-size: 48px; line-height: 58px; letter-spacing: -0.02em; }
.heading { font-size: 36px; line-height: 46px; letter-spacing: -0.015em; }
.title { font-size: 20px; line-height: 28px; }
.title-sm { font-size: 18px; line-height: 26px; }
.display em, .heading em { font-style: normal; color: var(--accent); }
.lead { font-size: 18px; line-height: 30px; color: var(--ink-muted); max-width: 34em; margin: 0; }
.eyebrow { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.muted { color: var(--ink-muted); }
.small { font-size: 14px; line-height: 20px; }
.center { text-align: center; }
.narrow { max-width: 40em; margin-inline: auto; }
@media (max-width: 767px) {
  .display { font-size: 34px; line-height: 42px; letter-spacing: -0.015em; }
  .heading { font-size: 26px; line-height: 34px; letter-spacing: -0.01em; }
  .lead { font-size: 16px; line-height: 26px; }
}

/* ---------- 버튼 · 칩 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: var(--radius); border: 1.5px solid transparent;
  font-size: 14px; font-weight: 600; letter-spacing: 0.02em; line-height: 18px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background-color .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-sm { min-height: 40px; padding: 0 14px; }
.btn-block { flex: 1 1 auto; }
.btn-brand { background: var(--brand); color: var(--on-brand); }
.btn-ink { background: var(--ink); color: var(--surface); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-gold { background: var(--gold-on-deep); color: #261900; }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--accent-bright); }
.btn-ghost:hover { background: var(--accent-tint); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--radius-full); border: 1px solid var(--hairline);
  background: var(--surface-raised); cursor: pointer; font-size: 13px; font-weight: 700;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; line-height: 16px;
  background: var(--surface-low); color: var(--ink-muted); border: 1px solid var(--hairline);
}
.chip-accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.chip-gold { background: transparent; color: var(--gold-on-deep); border-color: var(--gold-on-deep); }
.chip-btn { cursor: pointer; }
.chip-btn[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* 난이도 배지 (DESIGN.md: Chips & Difficulty Badges) */
.diff { padding: 3px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; line-height: 16px; }
.diff-easy { background: var(--brand-tint); color: var(--brand); }
.diff-normal { background: var(--gold-tint); color: var(--gold-text); }
.diff-hard { background: var(--accent-tint); color: var(--accent); }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--surface); }
.header-inner { display: flex; align-items: center; gap: var(--space-lg); min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 32px; height: 32px; }
.bm-bg { fill: var(--brand); }
.bm-path { fill: none; stroke: var(--gold-on-deep); stroke-width: 2.2; stroke-linecap: round; }
.bm-sun { fill: var(--accent-bright); }
.brand-text { font-family: var(--font-serif); font-weight: 700; font-size: 18px; line-height: 1.1; display: flex; flex-direction: column; }
.brand-text small { font-family: var(--font-sans); font-weight: 500; font-size: 11px; color: var(--ink-muted); letter-spacing: 0.04em; }
.main-nav { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { white-space: nowrap; flex-shrink: 0; text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 10px; border-radius: var(--radius); color: var(--ink-muted); }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-tint); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.header-search { position: relative; display: flex; align-items: center; }
.header-search svg { position: absolute; inset-inline-start: 12px; width: 16px; height: 16px; fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-linecap: round; }
.header-search input {
  width: 200px; height: 40px; padding-block: 0; padding-inline: 36px 12px; border-radius: var(--radius-full);
  background: var(--surface-low); border: 1.5px solid transparent;
}
.header-search input:focus { outline: none; border-color: var(--brand); }
@media (max-width: 1280px) { .header-search { display: none; } }
.brand, .header-actions { flex-shrink: 0; }
@media (max-width: 767px) {
  .main-nav { display: none; }
  .header-inner { min-height: 56px; gap: 8px; }
  .header-search { display: none; }
  .hide-sm { display: none; }
}

/* ---------- 홈: 히어로 ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--space-xl); align-items: center; padding-block: 56px 40px; }
.hero-text { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hero-text .eyebrow { margin: 0; color: var(--ink-muted); }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border-radius: var(--radius-full); background: var(--surface-low); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-muted); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-bright); }
.stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 8px 36px; margin: 8px 0 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { font-size: 12px; color: var(--ink-muted); letter-spacing: 0.02em; }
.stats dd { margin: 0; font-family: var(--font-serif); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.center-row { justify-content: center; }
.hero-figure { position: relative; margin: 0; border-radius: var(--radius-xl); overflow: hidden; aspect-ratio: 4 / 5; max-height: 560px; width: 100%; box-shadow: var(--shadow-float); }
.hero-figure .art { position: absolute; inset: 0; }
.chip-float { position: absolute; top: 16px; inset-inline-end: 16px; background: var(--glass); color: var(--ink); }
.hero-figure figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 72px 24px 24px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; color: #f9f8f5;
  background: linear-gradient(to top, rgba(3, 37, 23, 0.85), rgba(3, 37, 23, 0));
}
.hero-figure figcaption strong { font-family: var(--font-serif); font-size: 26px; line-height: 1.3; }
.hero-figure figcaption span:last-child { font-size: 14px; opacity: .9; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-block: 28px 24px; }
  .hero-figure { aspect-ratio: 16 / 10; }
  .stats { grid-template-columns: repeat(2, auto); }
}

.art { background: var(--surface-low); }
.art svg { display: block; width: 100%; height: 100%; }

/* ---------- 통합 검색 ---------- */
.finder { background: var(--surface-raised); border-radius: var(--radius-xl); padding: var(--space-lg); box-shadow: var(--shadow-ambient); border: 1px solid var(--hairline); display: flex; flex-direction: column; gap: var(--space-md); }
.finder-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.finder-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-muted); min-width: 0; }
.field select, .select-sm {
  height: 48px; padding-block: 0; padding-inline: 14px 36px; border-radius: var(--radius); border: 1.5px solid transparent;
  background: var(--surface-low) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23727973' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
  appearance: none; -webkit-appearance: none; font-size: 15px; font-weight: 500; color: var(--ink); width: 100%;
}
.field select:focus, .select-sm:focus { outline: none; border-color: var(--brand); }
.select-sm { height: 40px; width: auto; font-size: 14px; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) {
  .finder-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finder-fields .btn { grid-column: 1 / -1; }
}

/* ---------- 섹션 공통 ---------- */
.section { padding-block: 72px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-lg); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.section-head > div:first-child { max-width: 40em; display: flex; flex-direction: column; gap: 8px; }
.section-head p { margin: 0; }
.section-tools { display: flex; align-items: center; gap: 12px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.result-count { margin: 0 0 12px; }
@media (max-width: 767px) { .section { padding-block: 48px; } }

/* ---------- 코스 카드 ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gutter); }
.course-card { position: relative; display: flex; flex-direction: column; background: var(--surface-raised); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-ambient); border: 1px solid var(--hairline); }
.course-media { position: relative; aspect-ratio: 16 / 10; }
.course-media .art { position: absolute; inset: 0; }
.course-media .chip { position: absolute; inset-inline-start: 12px; top: 12px; background: var(--glass); color: var(--ink); }
.save-btn { position: absolute; inset-inline-end: 10px; top: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--glass); display: grid; place-items: center; cursor: pointer; }
.save-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.save-btn[aria-pressed="true"] svg { fill: var(--accent-bright); stroke: var(--accent-bright); }
.course-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 0; flex: 1; }
.course-road { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); }
.course-title { font-family: var(--font-serif); font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; }
.course-en { font-size: 12px; letter-spacing: 0.04em; color: var(--ink-muted); }
.course-desc { font-size: 14px; line-height: 21px; color: var(--ink-muted); margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 14px 18px 0; padding: 12px; border-radius: var(--radius-md); background: var(--surface-low); text-align: center; }
.course-meta b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.course-meta span { font-size: 11px; color: var(--ink-muted); letter-spacing: 0.04em; }
.course-actions { display: flex; gap: 8px; padding: 14px 18px 18px; }
.course-actions .btn { flex: 1; min-height: 44px; }
.course-link { text-decoration: none; }
.course-link::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.course-card .save-btn, .course-actions { position: relative; z-index: 1; }
.course-media .save-btn { position: absolute; }
.empty { text-align: center; padding: 48px 16px; border: 1.5px dashed var(--outline); border-radius: var(--radius-xl); }
.empty p { margin: 0 0 12px; }

/* ---------- 지도 소개 띠 ---------- */
.band-map { background: var(--surface-low); }
.band-map-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-xl); align-items: center; }
.band-map-inner > div:first-child { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { position: relative; padding-inline-start: 28px; }
.checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.5 2.5L13 6.5' fill='none' stroke='%231b3b2b' stroke-width='2'/%3E%3C/svg%3E") center / 18px no-repeat; }
.phone-mock { position: relative; justify-self: center; width: min(280px, 100%); aspect-ratio: 9 / 16; border-radius: 36px; overflow: hidden; border: 8px solid var(--ink); box-shadow: var(--shadow-float); }
.phone-mock .art { position: absolute; inset: 0; }
.phone-stats { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 12px; border-radius: var(--radius-lg); background: var(--glass); backdrop-filter: blur(12px); font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.phone-stats b { font-size: 20px; }
@media (max-width: 767px) { .band-map-inner { grid-template-columns: 1fr; } .phone-mock { width: 220px; } }

/* ---------- 외국인 안내 ---------- */
.section.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.center-pill { display: inline-block; padding: 6px 14px; border-radius: var(--radius-full); background: var(--accent-tint); }
.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); margin-top: var(--space-lg); text-align: start; width: 100%; }
.tile { background: var(--surface-low); border-radius: var(--radius-lg); padding: var(--space-lg); display: flex; flex-direction: column; gap: 10px; }
.tile p { margin: 0; font-size: 14px; line-height: 21px; color: var(--ink-muted); }
.tile-icon { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--surface-raised); display: grid; place-items: center; }
.tile-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--brand); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hotline { display: flex; align-items: center; gap: 16px; text-align: start; width: 100%; margin-top: var(--space-md); padding: 16px 20px; border-radius: var(--radius-lg); border: 1px solid var(--hairline); background: var(--surface-raised); }
.hotline p { margin: 0; }
.hotline-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
@media (max-width: 900px) { .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tile-grid { grid-template-columns: 1fr; } }

/* ---------- 스탬프 여권 ---------- */
.passport-band { background: var(--surface); }
.passport-inner { background: var(--surface-deep); color: var(--on-deep); border-radius: var(--radius-xl); padding: 56px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-xl); align-items: center; }
.passport-inner > div:first-child { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.heading.on-deep { color: var(--on-deep); }
.heading.on-deep em { color: var(--gold-on-deep); }
.on-deep-muted { color: var(--on-deep-muted); margin: 0; }
.checks-deep li::before { background-color: rgba(237, 192, 102, 0.18); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.5 2.5L13 6.5' fill='none' stroke='%23edc066' stroke-width='2'/%3E%3C/svg%3E"); }
.passport-card { background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-xl); padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-float); }
.passport-card .eyebrow { margin: 0; }
.stamp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 6px; }
.stamp { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; text-align: center; padding: 8px; border: 1.5px dashed var(--outline); color: var(--ink-muted); font-family: var(--font-serif); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; line-height: 14px; overflow-wrap: anywhere; word-break: keep-all; min-width: 0; }
.stamp.got { border: 3px double var(--accent-bright); color: var(--accent); background: var(--accent-tint); transform: rotate(-2deg); }
.stamp.got:nth-child(even) { transform: rotate(1.5deg); }
.progress { height: 8px; border-radius: var(--radius-full); background: var(--surface-low); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); border-radius: inherit; transition: width .4s ease; }
.passport-card .small { margin: 0; }
@media (max-width: 900px) { .passport-inner { grid-template-columns: minmax(0, 1fr); padding: 32px 20px; } }

/* ---------- 이야기 ---------- */
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.story { background: var(--surface-low); border-radius: var(--radius-xl); overflow: hidden; }
.story .art { aspect-ratio: 16 / 10; }
.story-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.story-body p { margin: 0; }
@media (max-width: 900px) { .story-grid { grid-template-columns: 1fr; } }

/* ---------- CTA · 푸터 ---------- */
.cta { background: var(--surface-low); }
.cta .wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cta p { margin: 0; }
.site-footer { border-top: 1px solid var(--hairline); padding-block: 40px calc(24px + env(safe-area-inset-bottom, 0px)); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-lg); }
.footer-grid > div { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-grid a { text-decoration: none; color: var(--ink-muted); }
.footer-grid a:hover { color: var(--brand); }
.footer-grid span { color: var(--ink-muted); }
.footer-h { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 4px; }
.footer-bottom { margin-top: 24px; }
@media (max-width: 767px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ---------- 모바일 탭바 (앱 하단 내비) ---------- */
.tabbar { display: none; }
@media (max-width: 767px) {
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--hairline);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; font-size: 11px; font-weight: 600; color: var(--ink-muted); }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .tabbar .tab-main svg { width: 48px; height: 48px; padding: 12px; margin-top: -20px; border-radius: 50%; background: var(--brand); stroke: var(--on-brand); box-shadow: var(--shadow-float); }
}

/* ---------- 온라인 길걷기 ---------- */
.view-virtual { display: none; }
body[data-view="virtual"] .view-home { display: none; }
body[data-view="virtual"] .view-virtual { display: flex; flex-direction: column; gap: 16px; }
.view-virtual .eyebrow, .view-virtual .heading { margin: 0; }
.v-how { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.v-how li { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-lg); background: var(--surface-low); font-size: 14px; }
.v-how b { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-family: var(--font-serif); }
.v-route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gutter); }
.v-route { display: grid; grid-template-columns: 1fr; border-radius: var(--radius-xl); overflow: hidden; background: var(--surface-raised); border: 1px solid var(--hairline); box-shadow: var(--shadow-ambient); }
.v-route .art { aspect-ratio: 16 / 9; }
.v-route-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.v-route-body p { margin: 0; }
.v-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.v-head-actions { display: flex; gap: 8px; }
.v-progress { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius-xl); background: var(--surface-deep); color: var(--on-deep); }
.v-progress .progress { background: rgba(255, 255, 255, 0.15); height: 10px; }
.v-progress .progress span { background: var(--gold-on-deep); }
.v-progress .muted { color: var(--on-deep-muted); margin: 0; }
.v-km { margin: 0; font-variant-numeric: tabular-nums; }
.v-km b { font-family: var(--font-serif); font-size: 32px; }
.v-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gutter); align-items: start; }
.v-map { min-height: 420px; border-radius: var(--radius-xl); overflow: hidden; background: var(--surface-low); }
.v-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.v-side p, .v-side h4 { margin: 0; }
.v-form { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface-raised); border: 1px solid var(--hairline); }
.v-form input { height: 48px; padding-inline: 14px; border-radius: var(--radius); border: 1.5px solid transparent; background: var(--surface-low); font-size: 16px; color: var(--ink); width: 100%; }
.v-form input:focus { outline: none; border-color: var(--brand); }
.v-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.v-log li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-low); }
.v-log b { font-variant-numeric: tabular-nums; }
.postcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.postcard { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px; border-radius: var(--radius-lg); border: 1.5px dashed var(--outline); }
.postcard p { margin: 4px 0 0; }
.postcard.open { border-style: solid; border-color: var(--hairline); background: var(--surface-raised); box-shadow: var(--shadow-ambient); }
.pc-km { font-size: 12px; font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; min-width: 4.5em; }
.pc-seal { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-serif); font-size: 12px; font-weight: 700; border: 1.5px dashed var(--outline); }
.postcard.open .pc-seal { border: 3px double var(--accent-bright); color: var(--accent); background: var(--accent-tint); transform: rotate(-3deg); }
.v-me { background: var(--accent-bright); box-shadow: 0 0 0 6px rgba(193, 92, 61, 0.25); }
@media (max-width: 900px) { .v-grid { grid-template-columns: 1fr; } .v-map { min-height: 320px; } .v-how { grid-template-columns: 1fr; } }

/* ---------- 지도 화면 ---------- */
.view-map { display: none; }
body[data-view="map"] .view-home,
body[data-view="map"] .site-footer { display: none; }
body[data-view="map"] .view-map { display: block; position: fixed; left: 0; right: 0; top: calc(68px + env(safe-area-inset-top, 0px)); bottom: 0; z-index: 10; }
.map { position: absolute; inset: 0; background: var(--surface-low); }
@media (max-width: 767px) {
  body[data-view="map"] .site-header { display: none; }
  body[data-view="map"] .view-map { top: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}
.map-top {
  position: absolute; z-index: 500; left: 0; right: 0;
  top: calc(12px + env(safe-area-inset-top, 0px));
  padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px));
  display: flex; align-items: flex-start; gap: 8px; pointer-events: none;
}
.map-top > * { pointer-events: auto; }
@media (min-width: 768px) { .map-top { top: 12px; } }
.map-fab {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: var(--radius-lg); border: 0;
  display: grid; place-items: center; cursor: pointer; text-decoration: none;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--ink); box-shadow: var(--shadow-float);
}
.map-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-fab[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.map-status { flex: 1; min-width: 0; align-self: center; text-align: center; font-size: 13px; font-weight: 600; }
.map-status:not(:empty) { padding: 10px 14px; border-radius: var(--radius-full); background: var(--glass); backdrop-filter: blur(12px); box-shadow: var(--shadow-ambient); }
.map-status.warn { color: var(--accent); }
.status-action { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

.map-panel {
  position: absolute; z-index: 500; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(560px, calc(100% - 24px));
  padding: 16px; border-radius: var(--radius-xl);
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-float); display: flex; flex-direction: column; gap: 12px;
}
@media (max-width: 767px) { .map-panel { bottom: 12px; } }
.track-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.track-stats > div { display: flex; flex-direction: column; align-items: center; }
.track-stats > div + div { border-inline-start: 1px solid var(--hairline); }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-muted); }
.track-stats b { font-size: 24px; line-height: 30px; font-variant-numeric: tabular-nums; }
.track-stats small { font-size: 11px; color: var(--ink-muted); }
.track-controls { display: flex; gap: 8px; }
.track-controls .btn { min-height: 48px; }
.map-note { margin: 0; text-align: center; font-size: 12px; }
.stamp-near { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-deep); color: var(--on-deep); font-size: 14px; font-weight: 600; }

/* Leaflet 마커 · 위치 점 */
.pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--brand); border: 3px solid var(--surface-raised); box-shadow: var(--shadow-float); display: grid; place-items: center; }
.pin span { transform: rotate(45deg); color: var(--on-brand); font-family: var(--font-serif); font-size: 13px; font-weight: 700; }
.pin.got { background: var(--accent-bright); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--locate); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26, 111, 209, 0.2); }
.leaflet-container { font-family: var(--font-sans); background: var(--surface-low); }
.leaflet-popup-content-wrapper { border-radius: var(--radius-lg); background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-float); }
.leaflet-popup-tip { background: var(--surface-raised); }
.leaflet-popup-content { margin: 14px 16px; font-size: 14px; line-height: 1.5; }
.popup-title { font-family: var(--font-serif); font-size: 17px; font-weight: 600; margin: 0 0 2px; }
.popup-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.g-popup { font-family: var(--font-sans); color: #1e2322; font-size: 14px; line-height: 1.5; max-width: 260px; }
.g-popup .muted { color: #424843; }
.popup-actions .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.leaflet-control-attribution { font-size: 10px; }
.leaflet-top.leaflet-left { top: 72px; }
@media (max-width: 767px) { .leaflet-control-zoom { display: none; } }
:root[data-theme="dark"] .leaflet-tile-pane { filter: brightness(.75) contrast(1.1) saturate(.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: brightness(.75) contrast(1.1) saturate(.7); } }

/* ---------- 시트 (모바일 바텀시트 / 데스크톱 모달) ---------- */
.sheet {
  border: 0; padding: 0; color: var(--ink); background: var(--surface-raised);
  width: min(560px, 100%); max-height: 88dvh; border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
}
.sheet::backdrop { background: rgba(30, 35, 34, 0.45); }
.sheet-inner { padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.sheet-inner p { margin: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet .art { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; }
.sheet-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-list { margin: 0; padding-inline-start: 18px; color: var(--ink-muted); font-size: 14px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-actions .btn { flex: 1 1 140px; }
@media (max-width: 767px) {
  .sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
}
.track-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.track-list li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-md); background: var(--surface-low); }
.track-list .t-info { flex: 1; min-width: 0; font-size: 14px; }
.track-list .t-info b { display: block; font-size: 15px; }
.track-list .t-actions { display: flex; gap: 6px; }
.track-list .t-actions .btn { min-height: 36px; padding: 0 10px; font-size: 13px; }

/* ---------- 언어 선택 ---------- */
.lang-btn { width: auto; padding: 0 10px; gap: 4px; display: inline-flex; align-items: center; font-size: 12px; letter-spacing: 0.04em; }
.lang-search { height: 44px; padding-inline: 14px; border-radius: var(--radius); border: 1.5px solid transparent; background: var(--surface-low); width: 100%; }
.lang-search:focus { outline: none; border-color: var(--brand); }
.lang-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; max-height: 55dvh; overflow-y: auto; }
.lang-item { width: 100%; min-height: 52px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 8px 12px; border-radius: var(--radius-md); border: 1px solid var(--hairline); background: var(--surface-raised); cursor: pointer; text-align: start; }
.lang-item:hover { background: var(--surface-low); }
.lang-item[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.lang-native { font-size: 15px; font-weight: 600; }
.lang-en { font-size: 12px; opacity: .75; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* 작은 휴대폰(380px 이하): 머리글을 줄인다 */
@media (max-width: 380px) {
  .brand-text small, #lang-code { display: none; }
  .lang-btn { width: 40px; padding: 0; justify-content: center; }
  .header-actions { gap: 6px; }
  .stamp-grid { gap: 8px; }
}
.passport-card, .passport-inner > div:first-child { min-width: 0; }

/* 오른쪽→왼쪽 언어 (아랍어·페르시아어·히브리어) */
[dir="rtl"] .flip-rtl svg { transform: scaleX(-1); }
[dir="rtl"] .field select, [dir="rtl"] .select-sm { background-position: left 14px center; }
[dir="rtl"] .stats dd, [dir="rtl"] .track-stats b, [dir="rtl"] .course-meta b { direction: ltr; unicode-bidi: isolate; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; z-index: 1000; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: var(--radius-full);
  background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-float);
}
@media (max-width: 767px) { .toast { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
