/*
  편한길로 화면 스타일. Figma "편한길로 시안 v2"를 따른다 (토스 느낌, 벤토 카드, 큰 숫자).
  .app[data-screen]이 지금 보이는 화면을 정한다: start / home / search / map / route / report
  .app[data-dir]는 화면이 바뀌는 방향이다: forward(앞으로) / back(뒤로) / tab(탭 전환)
  색은 아래 변수에서만 바꾼다. 휴대폰이 어두운 모드면 자동으로 다크 색을 쓴다.
  지도 위 선 색도 이 변수를 app.js가 읽어서 쓴다.
*/

:root {
  --brand: #3182F6;
  --brand-deep: #1B64DA;
  --brand-soft: #E8F3FF;
  --accent: #FFC342;
  --ink: #191F28;
  --muted: #536170;
  --action: #1758B5;
  --primary-fill: #1B62CF;
  --warning-text: #8B2C36;
  --warning-bg: #FFF0F1;
  --up-text: #A52A38;
  --down-text: #904010;
  --good: #0A7A4B;
  --line: #E5E8EB;
  --surface: #FFFFFF;
  --bg: #F2F4F6;
  --steep-up: #F04452;
  --steep-down: #FF8A3D;
  --route-short: #B0B8C1;
  --shadow: 0 6px 24px rgba(0, 0, 0, .09);
  --font: "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  /* 움직임: 빠르게 출발해 부드럽게 멈춘다 / 살짝 넘쳤다가 돌아온다 */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.45, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand-deep: #4593FC;
    --brand-soft: #1C2B44;
    --ink: #F9FAFB;
    --muted: #BEC2CD;
    --action: #8ABEFF;
    --primary-fill: #1B62CF;
    --warning-text: #FFD1D6;
    --warning-bg: #492630;
    --up-text: #FF9EA6;
    --down-text: #FFC290;
    --good: #5FD39A;
    --line: #2E2E38;
    --surface: #202027;
    --bg: #17171C;
    --steep-up: #F66570;
    --steep-down: #FFA05C;
    --route-short: #62626C;
    --shadow: 0 6px 24px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); letter-spacing: -0.02em; word-break: keep-all; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.is-up { color: var(--up-text); }
.is-down { color: var(--down-text); }

/* 휴대폰 화면 크기의 틀. 넓은 화면에서는 가운데에 휴대폰처럼 보인다 */
.app { --gutter: clamp(16px, 5vw, 24px); --tabbar-height: calc(72px + env(safe-area-inset-bottom)); position: relative; width: min(100%, 480px); height: 100%; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--bg); }
#map { position: absolute; inset: 0; z-index: 0; background: var(--bg); visibility: hidden; }
/* iOS Safari는 지도 선(translate3d)을 위 시트보다 앞에 그리기도 한다. 지도와 시트를 각자의 층으로 나눠 막는다 */
#map { isolation: isolate; }
.app[data-screen="map"] #map, .app[data-screen="route"] #map, .app.map-linger #map { visibility: visible; }

/* ---------- 화면 전환 ---------- */
.screen { position: absolute; inset: 0; z-index: 2; display: none; }
.screen.solid { background: var(--bg); }
.screen.scroll { overflow-y: auto; padding: calc(env(safe-area-inset-top) + 20px) calc(var(--gutter) + env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 24px) calc(var(--gutter) + env(safe-area-inset-left)); }
.screen.pass { pointer-events: none; }
.screen.pass > * { pointer-events: auto; }
.app[data-screen="home"] #home, #home.is-leaving,
.app[data-screen="map"] #mapview, #mapview.is-leaving,
.app[data-screen="route"] #route, #route.is-leaving { display: block; }
.app[data-screen="start"] #start, #start.is-leaving,
.app[data-screen="search"] #search, #search.is-leaving,
.app[data-screen="report"] #report, #report.is-leaving { display: flex; }
/* 나가는 화면은 잠깐 남아 사라지고, 들어오는 화면이 그 위로 온다 */
.screen.is-leaving { z-index: 1; }
.screen.is-leaving, .screen.is-leaving * { pointer-events: none !important; }

@keyframes in-forward { from { opacity: 0; translate: 36px 0; } }
@keyframes in-back { from { opacity: 0; translate: -36px 0; } }
@keyframes in-tab { from { opacity: 0; scale: .985; } }
@keyframes out-forward { to { opacity: 0; translate: -24px 0; } }
@keyframes out-back { to { opacity: 0; translate: 24px 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes drop-in { from { opacity: 0; translate: 0 -18px; } }
@keyframes rise-in { from { opacity: 0; translate: 0 18px; } }
@keyframes sheet-in { from { translate: 0 100%; } }
@keyframes pop-in { from { opacity: 0; scale: .8; } }

.app[data-dir="forward"] .screen.solid:not(.is-leaving) { animation: in-forward .34s var(--ease) backwards; }
.app[data-dir="back"] .screen.solid:not(.is-leaving) { animation: in-back .34s var(--ease) backwards; }
.app[data-dir="tab"] .screen.solid:not(.is-leaving) { animation: in-tab .26s var(--ease) backwards; }
.app[data-dir="forward"] .screen.solid.is-leaving { animation: out-forward .26s ease forwards; }
.app[data-dir="back"] .screen.solid.is-leaving { animation: out-back .26s ease forwards; }
.app[data-dir="tab"] .screen.solid.is-leaving { animation: fade-out .2s ease forwards; }
/* 지도 위에 떠 있는 화면은 위 상자가 내려오고 아래 시트가 올라온다 */
.app[data-screen="map"] .map-top, .app[data-screen="route"] .route-head { animation: drop-in .38s var(--ease) backwards; }
.app[data-screen="route"] .sheet { animation: sheet-in .48s var(--ease) backwards; }
.screen.pass.is-leaving > * { animation: fade-out .2s ease forwards; }

h1, h2, p { margin: 0; }
.page-title { margin: 14px 0 16px; font-size: 26px; font-weight: 700; line-height: 1.3; }

/* 버튼 */
.btn-primary { width: 100%; min-height: 56px; border: 0; border-radius: 16px; background: var(--primary-fill); color: #fff; font-size: 17px; font-weight: 700; transition: transform .15s var(--ease), filter .15s; }
.btn-primary:disabled { opacity: .5; cursor: progress; }
.btn-primary:active, .btn-soft:active, .btn-outline:active, .btn-end:active { transform: scale(.97); filter: brightness(.94); }
.btn-soft { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--brand-soft); color: var(--action); font-size: 16px; font-weight: 700; transition: transform .15s var(--ease), filter .15s; }
.btn-soft svg { flex: none; width: 20px; height: 20px; }
.btn-outline { min-height: 50px; border: 1.5px solid var(--brand); border-radius: 16px; background: var(--surface); color: var(--action); font-size: 16px; font-weight: 700; transition: transform .15s var(--ease), filter .15s; }
.bottom-cta { padding-top: 8px; }
.icon-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 50%; background: none; transition: background-color .15s, transform .15s var(--ease); }
.icon-btn:active { background: var(--bg); transform: scale(.92); }
.icon-btn svg { width: 100%; height: 100%; }
.text-btn { justify-self: start; min-height: 44px; padding: 4px 0; border: 0; background: none; color: var(--action); font-size: 16px; font-weight: 700; transition: opacity .15s; }
.text-btn:active { opacity: .55; }
.chip { display: inline-flex; align-items: center; padding: 5px 11px; border: 0; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 700; white-space: nowrap; }
.swap svg { transition: transform .4s var(--spring); }
.swap.is-spun svg { animation: spin-half .4s var(--ease); }
@keyframes spin-half { from { rotate: -180deg; } }

/* 카드 */
.card { border-radius: 22px; background: var(--surface); }
.card-soft { padding: 16px; border-radius: 20px; background: var(--bg); }
.card-tint { padding: 14px 16px; border-radius: 20px; background: var(--brand-soft); }
[data-icon] { display: block; }
[data-icon] svg { display: block; width: 100%; height: 100%; stroke: none; }

/* 알림 */
.toast { position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 10px); z-index: 30; display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 16px; background: #1F2733; color: #fff; font-size: 14.5px; font-weight: 500; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); opacity: 0; transform: translateY(-12px) scale(.98); transition: opacity .22s ease, transform .32s var(--ease); pointer-events: none; }
.toast.is-in { opacity: 1; transform: none; pointer-events: auto; }
.toast span { flex: 1; }
.toast button { flex: none; padding: 8px 12px; border: 0; border-radius: 10px; background: #66A1FF; color: #102640; font-size: 14px; font-weight: 700; transition: transform .12s var(--ease), filter .12s; }
.toast button:active { transform: scale(.94); filter: brightness(.92); }

/* ---------- 01 시작 ---------- */
#start { flex-direction: column; overflow: auto; padding: env(safe-area-inset-top) calc(var(--gutter) + env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 20px) calc(var(--gutter) + env(safe-area-inset-left)); background: var(--surface); }
#start > :not(.glow) { flex-shrink: 0; }
#start .bottom-cta { position: relative; margin-top: auto; padding-top: 20px; }
.glow { position: absolute; border-radius: 50%; filter: blur(70px); }
.glow-blue { top: 40px; left: 10%; width: 80%; aspect-ratio: 1; background: var(--brand); opacity: .18; }
.glow-yellow { top: 210px; right: 10%; width: 30%; aspect-ratio: 1; background: var(--accent); opacity: .3; filter: blur(45px); }
.start-hero { position: relative; width: min(132px, 17vh); width: min(132px, 17dvh); aspect-ratio: 1; margin: min(28px, 3vh) auto 0; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -8px; } }
.start-copy { position: relative; padding-top: 14px; }
.start-copy h1 { font-size: 26px; font-weight: 700; line-height: 1.36; }
.start-copy p { margin-top: 6px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.start-pick { position: relative; display: grid; gap: 8px; padding-top: 18px; }
.pick-card { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 14px 8px 10px; border: 2px solid transparent; border-radius: 20px; background: var(--bg); text-align: left; transition: border-color .2s, background-color .2s, transform .2s var(--spring); }
.pick-card:active { transform: scale(.97); }
.pick-text { flex: 1; display: grid; min-width: 0; }
.pick-card strong { font-size: 16.5px; font-weight: 700; transition: color .2s; }
.pick-text > span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.pick-icon { flex: none; width: 46px; height: 46px; transition: transform .35s var(--spring); }
/* 고른 유형에는 오른쪽 동그라미에 체크가 톡 찍힌다 */
.pick-card::after { content: ""; flex: none; width: 22px; height: 22px; border: 2px solid var(--route-short); border-radius: 50%; transition: border-color .2s, background-color .2s; }
.pick-card[aria-checked="true"]::after { border-color: var(--primary-fill); background: var(--primary-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 15px no-repeat; animation: pick-pop .26s var(--spring); }
/* 유형 선택 화면에 들어오면 카드가 차례로 올라온다 */
.app[data-screen="start"] .pick-card { animation: rise-in .4s var(--ease) backwards; }
.app[data-screen="start"] .pick-card:nth-child(2) { animation-delay: 40ms; }
.app[data-screen="start"] .pick-card:nth-child(3) { animation-delay: 80ms; }
.app[data-screen="start"] .pick-card:nth-child(4) { animation-delay: 120ms; }
.app[data-screen="start"] .pick-card:nth-child(5) { animation-delay: 160ms; }
.pick-card[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.pick-card[aria-checked="true"] strong { color: var(--action); }
.pick-card[aria-checked="true"] .pick-icon { transform: scale(1.12) rotate(-4deg); }

/* ---------- 02 홈 ---------- */
.brand { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; }
.logo { width: 29px; height: 29px; }
.brand .profile-chip { margin-left: auto; min-height: 44px; padding: 4px 12px; }
.home-guide { margin: -8px 0 14px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.home-guide:empty { display: none; }
.search-pill { display: flex; align-items: center; gap: 10px; width: 100%; height: 54px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--surface); color: var(--muted); font-size: 16px; font-weight: 500; text-align: left; transition: transform .15s var(--ease); }
.search-pill:active { transform: scale(.98); }
.search-pill svg { width: 22px; height: 22px; stroke-width: 2.2; }
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.bento-side { display: grid; gap: 10px; }
.bento .card { position: relative; display: grid; align-content: start; gap: 2px; padding: 16px; overflow: hidden; border: 0; text-align: left; transition: transform .2s var(--ease); }
.bento .card:active { transform: scale(.97); }
.card-big { min-height: 210px; padding: 18px !important; background: var(--primary-fill) !important; color: #fff; }
.card-big strong { font-size: 22px; font-weight: 700; line-height: 1.3; }
.card-big span { opacity: .85; font-size: 13px; font-weight: 500; }
.card-small { min-height: 100px; }
.card-small strong { font-size: 16px; font-weight: 700; }
.card-small span { color: var(--muted); font-size: 12.5px; }
.card-icon { position: absolute; right: 4px; bottom: 2px; width: 54px; height: 54px; }
.card-big .card-icon { right: -4px; bottom: -4px; width: 112px; height: 112px; }
.numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.numbers .card { display: grid; gap: 2px; padding: 16px; }
.numbers span { color: var(--muted); font-size: 13px; }
.numbers strong { color: var(--action); font-size: 24px; font-weight: 900; }
.list-card { margin-top: 14px; padding: 14px 16px 6px; }
.list-card h2 { font-size: 15px; font-weight: 700; }
.trip-list { margin: 0; padding: 0; list-style: none; }
.trip-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 0; border: 0; background: none; text-align: left; transition: transform .15s var(--ease), opacity .15s; }
.trip-btn:active { transform: scale(.98); opacity: .7; }
.trip-tile { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--brand-soft); }
.trip-tile i { width: 46px; height: 46px; }
.trip-text { display: grid; flex: 1; min-width: 0; }
.trip-text strong { font-size: 17px; font-weight: 700; }
.trip-text span { color: var(--muted); font-size: 14px; }
.trip-btn > svg { flex: none; width: 20px; height: 20px; color: var(--route-short); }
/* 홈에 들어오면 카드가 위에서부터 차례로 올라온다 */
.app[data-screen="home"] #home > * { animation: rise-in .45s var(--ease) backwards; }
.app[data-screen="home"] #home > :nth-child(3) { animation-delay: 40ms; }
.app[data-screen="home"] #home > :nth-child(4) { animation-delay: 80ms; }
.app[data-screen="home"] #home > :nth-child(5) { animation-delay: 120ms; }
.app[data-screen="home"] #home > :nth-child(n+6) { animation-delay: 160ms; }

/* 아래 탭 */
#home { bottom: var(--tabbar-height); padding-bottom: 24px; }
.tabbar { position: absolute; right: 0; bottom: 0; left: 0; z-index: 6; display: none; justify-content: space-between; height: var(--tabbar-height); padding: 8px 44px calc(env(safe-area-inset-bottom) + 12px); border-top: 1px solid var(--line); background: var(--surface); }
.app[data-screen="home"] .tabbar, .app[data-screen="map"] .tabbar { display: flex; animation: rise-in .32s var(--ease) backwards; }
.tabbar button { display: grid; justify-items: center; gap: 3px; min-width: 56px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 700; transition: color .2s; }
.tabbar svg { width: 26px; height: 26px; transition: transform .35s var(--spring); }
.tabbar button:active svg { transform: scale(.85); }
.tabbar button[aria-current="page"] { color: var(--ink); }
.tabbar button[aria-current="page"] svg { transform: translateY(-1px) scale(1.08); }

/* ---------- 출발·도착 상자 (검색 화면과 길 비교 화면이 같이 쓴다) ---------- */
.od-box { position: relative; flex: 1; min-width: 0; display: grid; border-radius: 16px; background: var(--bg); }
/* 출발 점과 도착 점을 잇는 점선 */
.od-box::before { content: ""; position: absolute; left: 19px; top: 50%; height: 14px; margin-top: -7px; border-left: 2px dotted var(--route-short); }
.od-row { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 46px; padding: 0 6px 0 14px; border-radius: 14px; transition: box-shadow .2s; }
.od-row + .od-row { box-shadow: 0 -1px 0 var(--line); }
.od-row.is-active, .od-row.is-active + .od-row { box-shadow: none; }
.od-row.is-active { box-shadow: inset 0 0 0 2px var(--brand); background: var(--surface); }
.od-row input { flex: 1; min-width: 0; min-height: 46px; padding: 4px 0; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 500; text-overflow: ellipsis; }
.od-row input::placeholder { color: var(--muted); opacity: .8; }
.od-row.is-me input, .od-row.is-me span { color: var(--action); font-weight: 700; }
.dot { position: relative; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); }
.dot-start { border: 3.5px solid var(--brand); }
.dot-end { background: var(--steep-up); }
.clear-btn { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; animation: pop-in .18s var(--ease) backwards; transition: transform .12s var(--ease); }
.clear-btn:active { transform: scale(.82); }
.clear-btn svg { width: 20px; height: 20px; padding: 4px; border-radius: 50%; background: var(--route-short); color: var(--surface); stroke-width: 3; }
.od-compact .od-row { width: 100%; min-height: 40px; padding-right: 12px; border: 0; background: none; font-size: 15.5px; font-weight: 700; text-align: left; }
.od-compact .od-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od-compact .od-row:active { background: var(--line); }

/* ---------- 검색 ---------- */
#search { flex-direction: column; }
.search-head { flex: none; display: flex; align-items: center; gap: 2px; padding: calc(env(safe-area-inset-top) + 10px) calc(6px + env(safe-area-inset-right)) 10px calc(4px + env(safe-area-inset-left)); background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.search-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px calc(var(--gutter) + env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 24px) calc(var(--gutter) + env(safe-area-inset-left)); }
#search-status { margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; background: var(--warning-bg); color: var(--warning-text); font-size: 14.5px; font-weight: 500; animation: rise-in .25s var(--ease) backwards; }
#search-status.is-quiet { background: var(--brand-soft); color: var(--action); }
#search-status:empty { display: none; }
.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border: 0; border-radius: 16px; background: var(--surface); font-size: 15px; font-weight: 700; transition: transform .15s var(--ease); }
.quick-btn:active { transform: scale(.97); }
.quick-btn svg { flex: none; width: 20px; height: 20px; color: var(--action); }
.result-group { margin-top: 18px; }
.result-heading { margin: 0 4px 6px; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.result-list { margin: 0; padding: 4px; border-radius: 18px; background: var(--surface); list-style: none; }
.result-li { display: flex; align-items: center; }
.result-row { flex: 1; display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 56px; padding: 8px 10px; border: 0; border-radius: 14px; background: none; text-align: left; transition: background-color .15s; }
.result-row:active { background: var(--brand-soft); }
.result-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--bg); color: var(--muted); }
.result-icon svg { width: 20px; height: 20px; }
.result-text { display: grid; min-width: 0; }
.result-text strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 16px; font-weight: 500; line-height: 1.35; }
.result-text mark { background: none; color: var(--action); font-weight: 700; }
.result-text > span { color: var(--muted); font-size: 13px; }
.result-del { flex: none; width: 44px; height: 44px; padding: 13px; border: 0; background: none; color: var(--route-short); transition: transform .12s var(--ease), color .12s; }
.result-del:active { transform: scale(.8); color: var(--ink); }
/* 기록을 지우면 그 줄이 옆으로 빠진다 */
.result-list li { transition: opacity .16s ease, translate .16s ease; }
.result-list li.is-removing { opacity: 0; translate: 24px 0; pointer-events: none; }
/* 기본 목록 ↔ 검색 결과로 바뀌는 순간 */
#search-results.is-switch { animation: fade-in .16s ease; }
.result-del svg { width: 100%; height: 100%; }
.result-empty { display: grid; justify-items: center; gap: 6px; margin: 0; padding: 40px 12px; color: var(--muted); text-align: center; }
.result-empty strong { color: var(--ink); font-size: 16px; overflow-wrap: anywhere; }
.result-empty .btn-soft { margin-top: 10px; }
.result-group .trip-list { padding: 4px 14px; border-radius: 18px; background: var(--surface); }

/* ---------- 지도 ---------- */
.map-top { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right)); display: grid; justify-items: center; gap: 8px; pointer-events: none !important; }
.map-top > * { pointer-events: auto; }
.map-bar { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 60px; padding: 6px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.map-search { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 48px; padding: 0 10px 0 6px; border: 0; border-radius: 14px; background: none; color: var(--muted); font-size: 16.5px; font-weight: 500; text-align: left; transition: background-color .15s; }
.map-search:active { background: var(--bg); }
.map-search img { flex: none; display: block; border-radius: 9px; }
.map-search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-search svg { flex: none; width: 22px; height: 22px; color: var(--ink); }
.profile-chip { flex: none; display: grid; justify-items: center; min-height: 48px; padding: 6px 12px; border: 0; border-radius: 14px; background: var(--brand-soft); color: var(--action); line-height: 1.25; transition: transform .15s var(--ease); }
.profile-chip:active { transform: scale(.95); }
.profile-chip span { font-size: 11.5px; font-weight: 500; }
.profile-chip strong { font-size: 14px; }
.map-bar-pick strong { font-size: 17px; }
.map-hint { max-width: 100%; padding: 7px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; font-weight: 700; text-align: center; animation: drop-in .4s var(--ease) .15s backwards; }
.map-hint:empty { display: none; }

/* 지도 위 둥근 버튼. app.js가 --fab-bottom으로 아래 시트·카드 바로 위에 올려 둔다 */
.map-fabs { position: absolute; right: calc(12px + env(safe-area-inset-right)); bottom: 0; z-index: 4; display: none; flex-direction: column; align-items: flex-end; gap: 10px; transform: translateY(calc(-1 * var(--fab-bottom, 104px))); transition: transform .42s var(--ease), opacity .2s; }
.app[data-screen="map"] .map-fabs, .app[data-screen="route"] .map-fabs { display: flex; animation: pop-in .3s var(--ease) .1s backwards; }
.app[data-screen="route"][data-sheet="full"]:not([data-guide]) .map-fabs { opacity: 0; pointer-events: none; }
.fab { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--muted); box-shadow: 0 4px 16px rgba(16, 38, 64, .2); transition: transform .2s var(--spring), background-color .2s, color .2s; }
.fab:active { transform: scale(.9); }
.fab svg { width: 24px; height: 24px; }
.fab.is-on { color: var(--brand-deep); }
.fab.is-follow { background: var(--primary-fill); color: #fff; }
.fab.is-finding svg { animation: breathe .9s ease-in-out infinite alternate; }
@keyframes breathe { to { opacity: .35; scale: .88; } }
.fab.is-ping { animation: fab-ping .5s var(--ease); }
@keyframes fab-ping { from { box-shadow: 0 4px 16px rgba(16, 38, 64, .2), 0 0 0 0 rgba(49, 130, 246, .55); } to { box-shadow: 0 4px 16px rgba(16, 38, 64, .2), 0 0 0 16px rgba(49, 130, 246, 0); } }
.fab-report { display: none; grid-auto-flow: column; gap: 6px; width: auto; height: 42px; padding: 0 14px 0 11px; border-radius: 21px; color: var(--ink); font-size: 14px; font-weight: 700; }
.fab-report svg { width: 20px; height: 20px; }
.app[data-screen="route"] .fab-report { display: grid; }

/* 지도를 누르면 뜨는 장소 카드 */
.place-card { position: absolute; left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right)); bottom: calc(var(--tabbar-height) + 12px); display: grid; gap: 12px; padding: 14px; border-radius: 22px; background: var(--surface); box-shadow: 0 8px 32px rgba(0, 0, 0, .18); animation: card-up .36s var(--spring) backwards; }
.place-card { touch-action: none; }
.place-card.is-settling { transition: transform .3s var(--spring); }    /* 조금만 내렸다 놓으면 튕겨 돌아온다 */
.place-card.is-closing { animation: card-down .18s ease forwards; }
.place-card.is-pop { animation: card-pop .32s var(--ease); }
@keyframes card-up { from { opacity: 0; translate: 0 40px; } }
@keyframes card-down { to { opacity: 0; translate: 0 30px; } }
@keyframes card-pop { 40% { scale: .97; } }
.place-head { display: flex; align-items: center; gap: 12px; }
.place-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--brand-soft); color: var(--action); }
.place-icon svg { width: 24px; height: 24px; }
.place-text { flex: 1; display: grid; min-width: 0; }
.place-text strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 17px; line-height: 1.35; }
.place-text span { color: var(--muted); font-size: 14px; }
.place-head .icon-btn { margin: -6px -6px 0 0; align-self: start; color: var(--muted); }
.place-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.place-actions .btn-primary { min-height: 50px; font-size: 16px; }
.place-actions .btn-primary:only-child { grid-column: 1 / -1; }

/* ---------- 03 길 비교 ---------- */
.route-head { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right)); z-index: 3; display: grid; gap: 8px; padding: 8px 4px 8px 2px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); transition: opacity .25s ease, translate .35s var(--ease); }
.route-od { display: flex; align-items: center; }
/* 이동 유형 탭: 흰 손잡이가 고른 쪽으로 미끄러진다 */
.seg { position: relative; display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); margin: 0 6px 0 8px; padding: 3px; border-radius: 13px; background: var(--bg); }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 2)); border-radius: 10px; background: var(--surface); box-shadow: 0 1px 5px rgba(0, 0, 0, .14); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .36s var(--ease); }
.seg button { position: relative; min-width: 0; min-height: 36px; padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; transition: color .2s, transform .12s var(--ease); }
.seg button:active { transform: scale(.95); }
.seg button[aria-selected="true"] { color: var(--action); }

.sheet { position: absolute; top: 170px; right: 0; bottom: 0; left: 0; z-index: 3; display: flex; flex-direction: column; border-radius: 24px 24px 0 0; background: var(--surface); box-shadow: 0 -6px 28px rgba(0, 0, 0, .12); transform: translateY(var(--peek-y, 55%)); transition: transform .46s var(--ease); will-change: transform; touch-action: none; }
.sheet[data-state="full"] { transform: none; }
.sheet.is-dragging { transition: none; }
.sheet-grab { flex: none; display: grid; place-items: center; width: 100%; height: 22px; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; }
.sheet-grab i { width: 40px; height: 5px; border-radius: 3px; background: var(--line); transition: background-color .2s, width .2s var(--ease); }
.sheet.is-dragging .sheet-grab i, .sheet-grab:active i { width: 52px; background: var(--route-short); }
.sheet:not([data-phase="result"]) .sheet-grab { visibility: hidden; }
.sheet-scroll { flex: 1; min-height: 0; overflow: hidden; }
.sheet[data-state="full"] .sheet-scroll { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.sheet-main { padding: 2px 0 calc(env(safe-area-inset-bottom) + 14px); }
.sheet-detail { display: grid; gap: 14px; padding: 4px calc(var(--gutter) + env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 28px) calc(var(--gutter) + env(safe-area-inset-left)); }
.sheet:not([data-phase="result"]) .sheet-detail { display: none; }

/* 길 카드: 옆으로 넘기면 가운데에 온 길이 선택된다. 카드마다 같은 자리에 같은 항목을 둬서 바로 견줄 수 있다 */
.route-cards { position: relative; display: flex; gap: 10px; overflow-x: auto; padding: 4px calc(var(--gutter) + env(safe-area-inset-right)) 8px calc(var(--gutter) + env(safe-area-inset-left)); scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; }
.route-cards::-webkit-scrollbar { display: none; }
.sheet[data-state="full"] .route-cards { touch-action: pan-x pan-y; }
.route-card { flex: 0 0 calc(100% - 40px); display: grid; gap: 8px; min-width: 0; padding: 14px; border: 2px solid var(--line); border-radius: 20px; background: var(--surface); text-align: left; scroll-snap-align: center; transform: scale(.97); opacity: .82; transition: transform .3s var(--ease), opacity .3s, border-color .3s, background-color .3s; animation: rise-in .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 80ms); }
.route-cards.is-single .route-card { flex-basis: 100%; }
.route-card[aria-selected="true"] { border-color: var(--brand); background: var(--brand-soft); transform: none; opacity: 1; }
.route-card:active { transform: scale(.95); transition-duration: .09s; }
.route-card[aria-selected="true"]:active { transform: scale(.98); }
.route-card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.badge { flex: none; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.badge-brand { background: var(--primary-fill); color: #fff; }
.badge-plain { background: var(--bg); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge-warn { background: var(--warning-bg); color: var(--warning-text); }
.route-name { overflow: hidden; color: var(--muted); font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.route-time { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.route-time strong { font-size: clamp(24px, 7.4vw, 30px); font-weight: 900; line-height: 1.2; }
.route-time span { color: var(--muted); font-size: 14px; }
.route-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fact { display: grid; gap: 1px; padding: 7px 8px; border-radius: 12px; background: var(--bg); transition: background-color .3s; }
.route-card[aria-selected="true"] .fact { background: var(--surface); }
.fact span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.fact strong { font-size: 15px; font-weight: 700; white-space: nowrap; }
.fact.is-bad strong { color: var(--up-text); }
.fact.is-good strong { color: var(--good); }
.spark { display: block; width: 100%; height: 34px; stroke: none; }
/* 길 카드의 높낮이 그림: 카드가 가운데로 오면 왼쪽에서 오른쪽으로 펼쳐진다 */
.route-card.is-in .spark { animation: reveal-x .8s var(--ease) .12s backwards; }
@keyframes reveal-x { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.spark-none { display: grid; place-items: center; border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 12.5px; }
.route-diff { font-size: 14px; font-weight: 500; line-height: 1.4; }
.route-dots { display: flex; align-items: center; justify-content: center; gap: 6px; height: 12px; }
.route-dots:empty { display: none; }
.route-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: width .32s var(--ease), background-color .3s; }
.route-dots i.is-on { width: 20px; background: var(--brand); }
.route-actions { display: flex; gap: 8px; padding: 8px calc(var(--gutter) + env(safe-area-inset-right)) 0 calc(var(--gutter) + env(safe-area-inset-left)); }
.route-actions .btn-primary { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; }
.route-actions .btn-primary svg { width: 20px; height: 20px; fill: currentColor; }
.route-actions .btn-soft { min-width: 84px; min-height: 52px; }

/* 찾는 중·못 찾음 */
.route-loading { display: grid; gap: 12px; padding: 4px calc(var(--gutter) + env(safe-area-inset-right)) 4px calc(var(--gutter) + env(safe-area-inset-left)); }
.skeleton-card { display: grid; gap: 12px; padding: 16px; border: 2px solid var(--line); border-radius: 20px; }
.skeleton-card i { height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--bg) 25%, var(--line) 37%, var(--bg) 63%) 0 0 / 400% 100%; animation: shimmer 1.3s linear infinite; }
.skeleton-card i:nth-child(1) { width: 36%; }
.skeleton-card i:nth-child(2) { width: 56%; height: 30px; }
.skeleton-card i:nth-child(3) { height: 48px; border-radius: 12px; }
.skeleton-card i:nth-child(4) { width: 72%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
#route-loading-text { color: var(--muted); font-size: 14.5px; font-weight: 500; text-align: center; }
/* 멈춘 게 아니라 찾는 중임을 알리는 점 세 개 */
#route-loading-text::after { content: "..."; display: inline-block; width: 1em; text-align: left; clip-path: inset(0 100% 0 0); animation: dots 1.2s steps(4, jump-none) infinite; }
@keyframes dots { to { clip-path: inset(0 0 0 0); } }
.route-error { animation: rise-in .28s var(--ease) backwards; }
.route-error { display: grid; gap: 12px; padding: 8px calc(var(--gutter) + env(safe-area-inset-right)) 4px calc(var(--gutter) + env(safe-area-inset-left)); }
#route-status { font-size: 16px; font-weight: 500; }
.route-error-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 자세히 */
/* 자세히 보기의 각 묶음은 화면에 들어오는 순간 올라온다 (app.js가 is-in을 붙인다) */
.sheet-detail > .is-in { animation: rise-in .34s var(--ease) backwards; }
/* 숫자가 올라오는 동안에는 자릿수 폭을 고정해 글자가 흔들리지 않게 한다 */
.is-counting { font-variant-numeric: tabular-nums; }
/* 비교표: 숫자가 다 올라온 뒤 가장 좋은 값에 점이 찍힌다 */
#compare.is-in .is-best::before { animation: pop-in .3s var(--spring) .6s backwards; }
.route-heading { margin-bottom: 8px; font-size: 16px; font-weight: 700; }
.compare { width: 100%; border-spacing: 0; table-layout: fixed; font-size: 14.5px; }
.compare th[scope="row"] { width: 7em; padding: 10px 4px 10px 0; color: var(--muted); font-weight: 500; text-align: left; }
.compare td, .compare thead th { padding: 10px 4px; font-weight: 700; text-align: center; transition: background-color .3s; }
.compare tbody tr > * { border-top: 1px solid var(--line); }
.compare .is-on { background: var(--brand-soft); }
.compare thead .is-on { border-radius: 14px 14px 0 0; }
.compare tbody tr:last-child .is-on { border-radius: 0 0 14px 14px; }
.compare thead button { width: 100%; min-height: 40px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 700; }
.compare thead .is-on button { color: var(--action); }
.compare thead button:active { opacity: .55; }
.compare .is-best { color: var(--good); }
.compare .is-best::before, .compare-key i { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--good); vertical-align: middle; }
.compare-key { margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; font-size: 14px; }
.card-head strong { flex: 1; }
.key { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; }
.key::before { content: ""; width: 12px; height: 4px; border-radius: 2px; background: currentColor; }
.key-up { color: var(--up-text); }
.key-down { color: var(--down-text); }
.key-up::before { background: var(--steep-up); }
.key-down::before { background: var(--steep-down); }
#elevation-chart svg { display: block; width: 100%; height: 110px; overflow: visible; stroke: none; }
.chart-axis { fill: var(--muted); font: 400 11px var(--font); }
.chart-line { stroke-dasharray: 1; }
/* 높낮이 그래프: 선이 출발에서 도착 쪽으로 그려지고, 아래 채움과 가파른 구간이 뒤따라 나타난다 */
#elevation.is-in .chart-line { animation: chart-draw .8s var(--ease) .1s backwards; }
#elevation.is-in .chart-area { animation: fade-in .5s ease .4s backwards; }
#elevation.is-in .chart-steep { animation: fade-in .3s ease .7s backwards; }
#elevation.is-in .chart-other { animation: fade-in .4s ease backwards; }
@keyframes chart-draw { from { stroke-dashoffset: 1; } }
.chart-key { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.chart-key i { width: 16px; border-top: 2px dotted var(--route-short); }
.legs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.leg { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface); }
.leg span { color: var(--muted); font-size: 14px; font-weight: 500; }
.leg strong { font-size: 17px; font-weight: 900; }
.leg em { font-size: 14px; font-style: normal; font-weight: 700; }
#round-trip .text-btn { margin-top: 8px; font-size: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 16px; background: var(--bg); text-align: center; }
.stat span { color: var(--muted); font-size: 14px; line-height: 1.3; }
.stat strong { font-size: 18px; font-weight: 900; }
#entrances strong { display: block; margin-bottom: 6px; font-size: 14px; }
#entrances ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#entrances li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
#entrances li span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.warnings { margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--bg); color: var(--muted); font-size: 13.5px; list-style: none; }
.note { color: var(--muted); font-size: 12px; }

/* ---------- 안내 중 ---------- */
.app[data-guide] .route-head { opacity: 0; translate: 0 -24px; pointer-events: none; }
.app[data-guide] .sheet { transform: translateY(105%); }
.guide-top { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right)); z-index: 3; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 22px; background: var(--primary-fill); color: #fff; box-shadow: 0 10px 30px rgba(16, 38, 64, .3); animation: drop-in .42s var(--ease) backwards; transition: background-color .35s; }
.guide-top.is-up { background: #C22F3C; }
.guide-top.is-down { background: #A84E12; }
.guide-top.is-warn { background: #39424F; }
.guide-top.is-done { background: #0A7A4B; }
.guide-icon { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; background: rgba(255, 255, 255, .2); }
.guide-icon svg { width: 28px; height: 28px; stroke-width: 2.4; }
.guide-text { display: grid; min-width: 0; }
.guide-text strong { font-size: 20px; line-height: 1.3; }
.guide-text span { opacity: .9; font-size: 14.5px; }
.guide-text.is-swap { animation: guide-swap .24s var(--ease); }
.guide-icon.is-swap { animation: pop-in .32s var(--spring); }
@keyframes guide-swap { from { opacity: 0; translate: 0 8px; } }
.guide-bar { position: absolute; right: 0; bottom: 0; left: 0; z-index: 3; overflow: hidden; border-radius: 24px 24px 0 0; background: var(--surface); box-shadow: 0 -6px 28px rgba(0, 0, 0, .12); animation: sheet-in .45s var(--ease) backwards; }
.guide-progress { height: 5px; background: var(--line); }
.guide-progress i { display: block; height: 100%; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease); }
.guide-row { display: flex; align-items: center; gap: 12px; padding: 14px calc(var(--gutter) + env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 16px) calc(var(--gutter) + env(safe-area-inset-left)); }
.guide-info { flex: 1; display: grid; min-width: 0; }
.guide-info strong { font-size: 26px; font-weight: 900; line-height: 1.25; }
.guide-info span { color: var(--muted); font-size: 14px; }
.btn-end { flex: none; min-height: 50px; padding: 0 18px; border: 0; border-radius: 16px; background: var(--warning-bg); color: var(--warning-text); font-size: 16px; font-weight: 700; transition: transform .15s var(--ease), filter .15s; }

/* ---------- 지도 위 표시 ---------- */
.pin span { display: block; width: 22px; height: 22px; border: 4px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.pin-start span { border: 6px solid var(--brand); background: #fff; box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0, 0, 0, .25); animation: pop-in .4s var(--spring) backwards; }
.pin-end { color: var(--ink); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.pin-pick { color: var(--primary-fill); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.pin-end svg, .pin-pick svg { display: block; width: 32px; height: 40px; stroke: none; transform-origin: 50% 100%; animation: pin-drop .5s var(--spring) backwards; }
@keyframes pin-drop { from { opacity: 0; translate: 0 -26px; scale: .7; } }
.pin-entrance span { width: 16px; height: 16px; border-width: 3px; background: var(--ink); }
.leaflet-container { font-family: var(--font); }
/* 고른 길이 출발지에서 도착지 쪽으로 그려진다 */
.route-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: route-draw .8s var(--ease) forwards; }
@keyframes route-draw { to { stroke-dashoffset: 0; } }
.steep-in { animation: fade-in .4s ease .5s backwards; }
/* 다른 길로 바꿔 고를 때는 기다리지 않게 빠르게 그린다 */
.route-draw.is-quick { animation-duration: .42s; }
.steep-in.is-quick { animation-duration: .2s; animation-delay: .22s; }
/* 길마다 붙는 이름표 (추천 · 12분) */
.route-label-wrap { overflow: visible; }
.route-label { position: absolute; top: 0; left: 0; padding: 4px 10px; border: 1.5px solid var(--route-short); border-radius: 999px; background: var(--surface); color: var(--muted); font: 700 12.5px/1.4 var(--font); white-space: nowrap; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); transform: translate(-50%, calc(-100% - 10px)); cursor: pointer; animation: pop-in .35s var(--spring) .3s backwards; }
.route-label::after { content: ""; position: absolute; bottom: -6px; left: 50%; width: 9px; height: 9px; margin-left: -5px; border: inherit; border-top: 0; border-left: 0; border-radius: 0 0 2px; background: inherit; transform: rotate(45deg); }
.route-label.is-on { border-color: #fff; background: var(--primary-fill); color: #fff; }
.route-label.is-still, .route-label.is-quick { animation: none; }
.route-label.is-on.is-quick { animation: label-switch .22s var(--spring); }
@keyframes label-switch { from { scale: .88; } }
.route-label:active { scale: .94; }
/* 다른 이름표와 겹치면 선 아래쪽에 단다 */
.route-label.is-below { transform: translate(-50%, 10px); }
.route-label.is-below::after { top: -6px; bottom: auto; transform: rotate(225deg); }

/* ---------- 04 제보 ---------- */
#report { flex-direction: column; background: var(--surface); }
.report-map-wrap { position: relative; z-index: 0; flex: 0 0 44%; min-height: 200px; background: var(--bg); isolation: isolate; }
#report-map { position: absolute; inset: 0; }
/* 가운데에 박힌 핀. 지도를 움직이는 동안 들렸다가 멈추면 내려앉는다 */
.center-pin { position: absolute; top: 50%; left: 50%; z-index: 1000; width: 36px; height: 45px; margin: -45px 0 0 -18px; color: var(--steep-up); pointer-events: none; }
.center-pin svg { display: block; width: 100%; height: 100%; fill: currentColor; stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); transition: transform .28s var(--spring); }
.center-pin svg circle { fill: #fff; stroke: none; }
.center-pin i { position: absolute; bottom: -3px; left: 50%; width: 12px; height: 5px; margin-left: -6px; border-radius: 50%; background: rgba(0, 0, 0, .35); transition: transform .28s var(--ease), opacity .28s; }
.center-pin.is-moving svg { transform: translateY(-12px); }
.center-pin.is-moving i { transform: scale(.55); opacity: .5; }
/* 핀이 내려앉으면 끝에서 고리가 한 번 퍼진다 */
.center-pin i::after { content: ""; position: absolute; inset: -5px -8px; border: 2px solid var(--steep-up); border-radius: 50%; opacity: 0; }
.center-pin:not(.is-moving) i::after { animation: pin-ripple .5s var(--ease) .12s; }
@keyframes pin-ripple { from { opacity: .8; scale: .3; } to { opacity: 0; scale: 1.9; } }
.report-chip.is-tick { animation: chip-tick .22s var(--ease); }
@keyframes chip-tick { from { opacity: .3; translate: 0 3px; } }
.report-locate.is-ping { animation: fab-ping .5s var(--ease); }
.fab-back { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: calc(12px + env(safe-area-inset-left)); z-index: 1000; color: var(--ink); }
.fab-back svg { margin-left: -2px; }
.report-chip { position: absolute; top: calc(env(safe-area-inset-top) + 16px); left: calc(70px + env(safe-area-inset-left)); z-index: 1000; display: block; max-width: calc(100% - 82px); padding: 8px 14px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; box-shadow: var(--shadow); }
.trail-key { position: absolute; bottom: 30px; left: calc(12px + env(safe-area-inset-left)); z-index: 1000; gap: 8px; padding: 6px 12px; color: var(--muted); box-shadow: var(--shadow); }
.trail-key i { width: 22px; border-top: 4px dotted var(--brand-deep); }
.report-locate { position: absolute; right: calc(12px + env(safe-area-inset-right)); bottom: 30px; z-index: 1000; color: var(--brand-deep); }
.report-sheet { position: relative; z-index: 1; flex: 1; display: grid; align-content: start; gap: 14px; min-height: 0; margin-top: -18px; padding: 18px calc(var(--gutter) + env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 20px) calc(var(--gutter) + env(safe-area-inset-left)); overflow-y: auto; border-radius: 24px 24px 0 0; background: var(--surface); box-shadow: 0 -4px 20px rgba(0, 0, 0, .08); }
.report-title { display: flex; align-items: center; gap: 12px; }
.report-title div { flex: 1; }
.report-title h1 { font-size: 22px; font-weight: 700; }
.report-title p { margin-top: 2px; color: var(--muted); font-size: 14.5px; }
.report-title i { flex: none; width: 60px; height: 60px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.tiles.is-nudge { animation: nudge .4s ease; }
@keyframes nudge { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }
.tiles label, .chips-row label { position: relative; }
.tiles input, .chips-row input { position: absolute; opacity: 0; }
.tiles span { display: grid; place-items: center; min-height: 52px; padding: 6px; border: 2px solid transparent; border-radius: 16px; background: var(--bg); font-size: 15px; font-weight: 500; text-align: center; transition: border-color .2s, background-color .2s, color .2s, transform .2s var(--spring); }
.tiles label:active span, .chips-row label:active span { transform: scale(.96); }
.tiles input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--action); font-weight: 700; animation: pick-pop .24s var(--ease); }
@keyframes pick-pop { 45% { scale: 1.04; } }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; animation: rise-in .3s var(--ease) backwards; }
.chips-row span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 700; transition: border-color .2s, background-color .2s, color .2s, transform .2s var(--spring); }
.chips-row label.is-key span { border-color: var(--brand); color: var(--action); }
.chips-row input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--surface); animation: pick-pop .24s var(--ease); }
.tiles input:focus-visible + span, .chips-row input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.memo textarea { display: block; width: 100%; min-height: 72px; padding: 16px; border: 0; border-radius: 16px; outline: 0; background: var(--bg); font-size: 16px; resize: none; }
.memo textarea { transition: box-shadow .18s ease; }
.memo textarea:focus { box-shadow: inset 0 0 0 2px var(--brand); }
#report-status { color: var(--warning-text); font-weight: 700; animation: rise-in .24s var(--ease) backwards; }
/* 보내는 동안 버튼 안에서 도는 고리 */
#report-form .btn-primary:disabled { opacity: .8; }
#report-form .btn-primary:disabled::after { content: ""; display: inline-block; width: 16px; height: 16px; margin-left: 10px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; vertical-align: -3px; animation: spin .7s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
#report-status:empty { display: none; }
/* 제보를 보낸 뒤: 동그라미와 체크가 그려진다 */
.report-done { position: absolute; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 24px; background: var(--surface); text-align: center; animation: fade-in .25s ease backwards; }
.report-done svg { width: 88px; height: 88px; margin-bottom: 10px; color: var(--good); stroke-width: 3.5; }
.report-done circle { stroke-dasharray: 176; stroke-dashoffset: 176; animation: stroke-in .55s var(--ease) .1s forwards; }
.report-done path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: stroke-in .35s var(--ease) .5s forwards; }
@keyframes stroke-in { to { stroke-dashoffset: 0; } }
.report-done strong { font-size: 20px; animation: rise-in .3s var(--ease) .45s backwards; }
.report-done span { color: var(--muted); font-size: 15px; animation: rise-in .3s var(--ease) .55s backwards; }

.credits { margin-top: 20px; color: var(--muted); font-size: 10px; line-height: 1.4; text-align: center; }

@media (max-height: 700px) {
  .start-hero { display: none; }
  .start-copy { padding-top: 20px; }
  .start-pick { padding-top: 14px; }
  .pick-card { min-height: 58px; }
  .pick-icon { width: 40px; height: 40px; }
  .route-card .spark { display: none; }
  .report-map-wrap { flex-basis: 38%; }
  .report-title i { display: none; }
}

@media (max-width: 360px) {
  .seg button { font-size: 13px; }
  .fact { padding: 6px; }
  .fact span { font-size: 11px; }
  .compare { font-size: 13.5px; }
}

@media (orientation: landscape) and (pointer: coarse) {
  .app { width: min(100%, 700px); }
}

/* 움직임을 줄이도록 설정한 사람에게는 전환을 보여 주지 않는다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
