/* Pretendard 폰트는 index.html 의 preload 로 일찍 받기 시작하고 js/ui/fonts.js 가 적용한다.
   @import 로 여기 넣으면 이 파일을 받아 파싱한 "뒤에야" 폰트 CSS를 또 받으러 가는 직렬
   왕복이 생기고, 폰트 CSS 가 응답이 없을 때 화면 전체가 멈춘다. */

/* 색·글자·여백·모서리·그림자·레이어 토큰은 css/tokens.css 에 있다 (이 파일보다 먼저 읽힌다).
   예전 이름(--bg-0, --ink, --accent-2 …)도 거기서 새 토큰에 이어 두었다. */

/* 안전 영역(상태바·제스처 내비게이션 바·노치) — 한 곳에서 정의해 모든 화면이 같은 값을 쓴다.
   env() 는 브라우저와 최신 WebView 가, --safe-area-inset-* 는 Capacitor(SystemBars)가 px 로 넣어 준다.
   env() 의 두 번째 인자(폴백)는 그 이름이 "정의되지 않았을 때"만 쓰이는데 safe-area-inset-* 는 값이
   0 이어도 항상 정의돼 있어서 폴백이 안 먹는다. 그래서 둘 중 큰 값을 쓴다 (둘 다 같은 값을 보고하면
   그대로 그 값이라 겹쳐 더해지지 않는다). */
:root {
  --sat: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --sab: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --sal: max(env(safe-area-inset-left, 0px), var(--safe-area-inset-left, 0px));
  --sar: max(env(safe-area-inset-right, 0px), var(--safe-area-inset-right, 0px));
  /* 손가락으로 누르는 곳의 최소 크기 */
  --tap: 44px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    'Segoe UI', 'Malgun Gothic', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* 한글은 어절 중간에서 끊지 않는다 — 안내·힌트·빈 상태 문장이 "추가하/면", "두/세요" 처럼 끊겼다. 줄에 안 들어가는
     긴 낱말(URL·영문 복합어)만 어디서든 끊는다. 이름·주소처럼 더 강하게 끊어야 하는 곳은 아래에서 따로 anywhere 를 쓴다. */
  word-break: keep-all;
  overflow-wrap: break-word;
  /* 시트·지도에서 끝까지 밀었을 때 WebView 가 문서 단위 오버스크롤(당겨서 새로고침, 글로우)을
     일으키지 않게 한다. 스크롤은 각 영역 안에서 끝난다. */
  overscroll-behavior: none;
}

#map { height: 100vh; width: 100vw; background: var(--bg-0); }

/* 베이스맵이 테마별로 따로 있으므로 타일에 필터를 걸지 않는다. */

/* MapLibre 컨트롤을 패널과 같은 톤으로 */
.maplibregl-ctrl-group {
  background: var(--bg-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-sm) !important;
  box-shadow: var(--sh-2) !important;
  overflow: hidden;
}
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: var(--ctrl-icon); }
.maplibregl-ctrl-group button:hover { background: var(--bg-3) !important; }

.maplibregl-ctrl-attrib {
  background: var(--bg-1) !important;
  color: var(--ink-3) !important;
  border-radius: var(--r-xs) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.maplibregl-ctrl-attrib a { color: var(--ink-2) !important; }
.maplibregl-ctrl-attrib-button { filter: var(--ctrl-icon); }

/* ============================================================
   사이드 창
   ============================================================ */

.goo-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  pointer-events: none;
  filter: none;
}
.goo-wrapper.gooey { filter: url(#goo); }
.goo-wrapper .side-panel { pointer-events: auto; }

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 25vw;
  height: 100vh;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--sh-3);
  transition: width 0.35s var(--ease),
              left 0.35s var(--ease),
              right 0.35s var(--ease),
              opacity 0.28s var(--ease); /* AI 위저드가 닫힐 때 시트가 서서히 돌아온다 (html.wizard-open) */
}
.side-panel.left { left: 0; right: auto; border-right: 1px solid var(--line); }
.side-panel.right { right: 0; left: auto; border-left: 1px solid var(--line); }
.side-panel.collapsed { width: 0; }

.panel-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 72px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: background 0.18s var(--ease), height 0.22s var(--ease);
}
/* 손잡이 그립 점 */
.panel-handle::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 3px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--ink-3);
  box-shadow: 0 -8px 0 var(--ink-3), 0 8px 0 var(--ink-3);
}
.panel-handle:hover { background: var(--bg-3); height: 84px; }
.panel-handle:active { cursor: grabbing; }

.side-panel.right .panel-handle {
  left: -25px;
  border-right: none;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.side-panel.left .panel-handle {
  right: -25px;
  border-left: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* 잡고 끄는 동안: 떠다니는 알약으로 */
.side-panel.morphing {
  width: 84px;
  height: 50px;
  border: none;
  border-radius: var(--r-pill);
  right: auto;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: width 0.3s var(--ease),
              height 0.3s var(--ease),
              border-radius 0.3s var(--ease),
              background 0.3s var(--ease);
}
.side-panel.morphing .panel-handle,
.side-panel.morphing .panel-body { visibility: hidden; }
.side-panel.collapsed .panel-body { display: none; }

.drag-blob {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  z-index: 2001;
  pointer-events: none;
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
}
.drag-blob.shrink { width: 0; height: 0; opacity: 0; }

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  /* 스크롤은 그대로 되지만 막대는 안 보이게 — 좁은 사이드 컬럼에서
     막대 폭(8px)이 콘텐츠 폭을 눈에 띄게 깎아 먹었다 */
  scrollbar-width: none;
}
.panel-body::-webkit-scrollbar { width: 0; display: none; }

/* ============================================================
   화면
   ============================================================ */

.screen {
  padding: 8px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: screen-in 0.28s var(--ease) both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.screen-head { display: flex; align-items: flex-start; gap: 10px; }
.screen-head-text { min-width: 0; }
.screen-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.28;
  word-break: keep-all;
}
.screen-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}

.btn-back {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease),
              transform 0.16s var(--ease);
}
.btn-back:hover { background: var(--bg-3); color: var(--ink); transform: translateX(-2px); }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-tight { display: flex; flex-direction: column; gap: 12px; }
.empty {
  margin: 10px 0;
  padding: 18px;
  font-size: 13px;
  color: var(--ink-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  text-align: center;
}

/* 빈 화면 안내 (dom.js 의 emptyState). 점선 박스 한 줄(.empty)은 메모·오류 같은 짧은 알림용으로 남긴다. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
  padding: 26px 18px 22px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  background: color-mix(in srgb, var(--bg-2) 55%, transparent);
}
.empty-state-icon { font-size: 30px; line-height: 1; margin-bottom: 4px; }
.empty-state-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.empty-state-text { margin: 0; max-width: 30ch; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.empty-state-note { margin: 2px 0 0; max-width: 34ch; font-size: 11px; line-height: 1.5; color: var(--ink-3); }
.empty-state-action { margin-top: 12px; }
/* 컴팩트: 바로 아래에 입력 줄이 이어지는 화면(예산)에서 그 줄을 화면 밖으로 밀어내지 않는다 */
.empty-state.is-compact { gap: 2px; padding: 14px 16px 12px; }
.empty-state.is-compact .empty-state-icon { font-size: 22px; margin-bottom: 2px; }
.empty-state.is-compact .empty-state-title { font-size: 14px; }
.empty-state.is-compact .empty-state-text { font-size: 12px; line-height: 1.5; }

/* ============================================================
   상세
   ============================================================ */

.panel-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 2px 14px;
  background: var(--bg-2);
  box-shadow: var(--sh-1);
}
.kv { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; }
.kv-k { flex: none; width: 62px; font-size: 12px; color: var(--ink-3); }
.kv-v { font-size: 13px; word-break: break-word; line-height: 1.5; }

.row-links { display: flex; gap: 7px; flex-wrap: wrap; }

/* ============================================================
   버튼 / 폼
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
              transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.btn:hover { background: var(--bg-3); border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 4px 14px var(--accent-soft);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  filter: brightness(1.08);
  box-shadow: 0 8px 22px var(--accent-soft);
}

.btn-danger {
  color: var(--danger);
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 32%, transparent);
}
.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border-color: var(--danger);
}

.btn-mini { padding: 4px 9px; font-size: 11px; border-radius: var(--r-xs); color: var(--ink-2); }
.btn-mini:hover { color: var(--ink); }

.btn-ghost { background: var(--bg-2); }

.screen-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.screen-foot .btn { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}
.input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13px;
  background: var(--bg-2);
  color: var(--ink);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease),
              background 0.16s var(--ease);
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--line-strong); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select.input { appearance: none; cursor: pointer; }

.search-row { display: flex; gap: 7px; }
.search-row .input { flex: 1; min-width: 0; }
.search-results { display: flex; flex-direction: column; gap: 5px; }
.search-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--bg-2);
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease);
}
.search-item:hover { background: var(--bg-3); border-color: var(--line-strong); }
.search-name { font-size: 12px; font-weight: 600; }
.search-addr {
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-hint { font-size: 11px; color: var(--ink-3); padding: 4px 2px; }

.picked { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.picked-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--ink);
}

.form-error {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--danger);
}
.form-error:not(:empty) {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 26%, transparent);
}

/* ============================================================
   지도 마커
   ============================================================ */

/* MapLibre 가 위치를 잡는 wrapper. 크기만 잡아두고 시각 효과는 안쪽 .pin 이 맡는다. */
.pin-anchor { width: 34px; height: 34px; }

.pin {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-2);
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), opacity 0.18s var(--ease);
}
.pin:hover { transform: scale(1.1); }
.pin-flight { border-color: var(--flight); }
.pin-hotel { border-color: var(--hotel); }
.pin-attraction { border-color: var(--attraction); }

/* 고른 항목의 이동 구간 — 출발/도착 핀만 또렷하고 나머지는 한 걸음 물러난다.
   .pin-selected 보다 앞에 둬서, 고른 핀이 도착 핀이기도 하면 선택 모양이 이긴다. */
.pin-dim { opacity: 0.5; }
.pin-leg-from { box-shadow: var(--sh-2), 0 0 0 4px color-mix(in srgb, var(--ink) 24%, transparent); }
.pin-leg-to { box-shadow: var(--sh-2), 0 0 0 5px var(--accent-soft); }

.pin-selected { transform: scale(1.2); box-shadow: var(--sh-2), 0 0 0 6px var(--accent-soft); }
.pin-selected:hover { transform: scale(1.26); }

/* 선택된 지점에서 퍼지는 파장. 지도에서 "여기" 를 눈으로 찾게 해준다.
   ::after 만 움직이므로 핀 자체의 위치/크기는 건드리지 않는다. */
.pin-selected::after {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1; /* 번호 배지(.pin-index) 보다 뒤에 있어야 한다 */
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pin-pulse 2.1s var(--ease) infinite;
  pointer-events: none;
}
@keyframes pin-pulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(2.1); opacity: 0; }
  100% { transform: scale(2.1); opacity: 0; }
}

.pin-icon { font-size: 14px; line-height: 1; }
.pin-index {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--bg-0);
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* 구간의 출발·도착 표지. 핀 위에 얹히는 작은 알약이라 눌림은 아래 핀이 받는다. */
.leg-end {
  pointer-events: none;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
  box-shadow: var(--sh-2);
}
.leg-end-from { background: var(--bg-2); color: var(--ink); border: 1px solid var(--line-strong); }
.leg-end-to { background: var(--accent); color: #fff; border: 1px solid var(--accent); }

/* 가까운 핀 묶음 — 개수 배지. 눌리는 크기는 핀(34px)보다 크게 잡는다. */
.pin-anchor.is-clustered { display: none; }
.cluster-anchor { width: 40px; height: 40px; cursor: pointer; }
.cluster-anchor:focus { outline: none; }
.cluster-pin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg-0);
  border: 3px solid var(--bg-0);
  box-shadow: var(--sh-2), 0 0 0 2px var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s var(--ease);
}
.cluster-anchor:hover .cluster-pin { transform: scale(1.08); }
.cluster-anchor:focus-visible .cluster-pin { box-shadow: 0 0 0 3px var(--accent), var(--sh-2); }
.cluster-count { font-size: 15px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

/* MapLibre 팝업도 같은 시스템으로 */
.maplibregl-popup-content {
  background: var(--bg-2) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-xs) !important;
  box-shadow: var(--sh-2) !important;
  font: inherit !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
}
.maplibregl-popup-tip { display: none !important; }

/* ============================================================
   접근성
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* 화면 전환마다 새 제목(h1)에 tabindex="-1" 로 포커스를 준다(views.js render()) —
   스크린리더가 새 화면에 왔다는 걸 알게 하려는 것이지, Tab 키로 여기 올 일은
   없다(tabindex="-1" 는애초에 Tab 순서에서 빠진다). 그런데 데스크톱 크롬은
   프로그램적 포커스엔 :focus-visible 링을 안 그려주는데, 안드로이드 WebView는
   그 구분을 안 해서 화면마다 제목에 테두리가 그려져 있었다. 여기서만 끈다. */
[tabindex='-1']:focus-visible {
  outline: none;
}

:root[data-motion='reduce'] *,
:root[data-motion='reduce'] *::before,
:root[data-motion='reduce'] *::after {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   오프라인 배지
   ============================================================ */

.net-badge {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--sab));
  transform: translateX(-50%);
  z-index: 2100;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--sh-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  /* screen-in 은 끝값이 transform: none 이라, 남겨 두면(both) 위의 translateX(-50%) 를 덮어 띠가 화면 가운데에서
     오른쪽으로 치우쳤다. 가운데 맞춤을 품은 전용 키프레임을 쓴다 (offline-badge-in 과 같은 방식). */
  animation: net-badge-in 0.28s var(--ease) both;
}
.net-badge[hidden] { display: none; }
@keyframes net-badge-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.net-badge.is-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line-strong));
  background: color-mix(in srgb, var(--danger) 12%, var(--bg-2));
}

/* 오프라인 모드 배지 (#net-badge) — 검색창 바로 아래, network-badge.js 가 top 을 맞춘다.
   눌리는 게 아니라 알려 주는 것이라 터치를 가로채지 않는다(지도 위에 떠 있어도 아래 지도가 그대로 움직인다). */
.offline-badge {
  position: fixed;
  left: 50%;
  top: calc(var(--sat) + 66px);
  transform: translateX(-50%);
  z-index: 1450;
  display: flex;
  align-items: center;
  gap: 10px;
  /* left: 50% 로 둔 fixed 요소의 가용 폭은 화면의 절반이라, 그대로 두면 설명 줄이 쓸데없이 줄바꿈된다 */
  width: max-content;
  max-width: min(calc(100vw - 24px - var(--sal) - var(--sar)), 400px);
  padding: 7px 16px 7px 8px;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line-strong));
  border-radius: 22px;
  background: color-mix(in srgb, var(--warn) 14%, var(--bg-2));
  box-shadow: var(--sh-2);
  color: var(--ink);
  pointer-events: none;
  animation: offline-badge-in 0.28s var(--ease) both;
}
.offline-badge[hidden] { display: none; }
.offline-badge-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 24%, transparent);
}
.offline-badge-icon svg { width: 17px; height: 17px; }
.offline-badge-text { display: flex; flex-direction: column; min-width: 0; }
.offline-badge-title { font-size: 13px; font-weight: 700; line-height: 1.25; }
.offline-badge-sub { font-size: 11px; line-height: 1.3; color: var(--ink-2); }
/* 다시 연결됐을 때 — 경고색 대신 초록 */
.offline-badge.is-restored {
  border-color: color-mix(in srgb, var(--hotel) 45%, var(--line-strong));
  background: color-mix(in srgb, var(--hotel) 14%, var(--bg-2));
}
.offline-badge.is-restored .offline-badge-icon {
  color: var(--hotel);
  background: color-mix(in srgb, var(--hotel) 24%, transparent);
}
@keyframes offline-badge-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   모바일: 아래에서 올라오는 시트
   지도가 주인공이고, 일정은 필요한 만큼만 끌어올린다.
   ============================================================ */

@media (max-width: 768px) {
  /* 모바일 브라우저 주소창 때문에 100vh 는 화면보다 크다 */
  #map { height: 100dvh; }

  .side-panel.sheet {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100dvh;
    border: none;
    border-top: 1px solid var(--line);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    /* transform 은 JS 스프링 물리가 매 프레임 직접 쓴다 — CSS transition 은 안 쓴다.
       transform-origin 을 바닥에 둬서 눌림/출렁임이 위쪽 가장자리에서만 보이게 한다. */
    transform-origin: bottom center;
    will-change: transform;
    /* 애니메이션 중에도 항상 이 값 하나만 쓴다 — 움직일 때/멈췄을 때 값을 다르게
       주면(예: 10px↔22px) 전환 순간이 튀어 보인다. 14px 로 고정. */
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
  }

  /* 좌우 배치는 모바일에서 의미가 없다 */
  .side-panel.sheet.left,
  .side-panel.sheet.right { left: 0; right: 0; }
  .side-panel.sheet.collapsed { width: 100%; }

  /* 손잡이: 시트 상단 전체를 잡을 수 있게. 44px 는 손가락이 안정적으로 잡는 최소 크기 */
  .side-panel.sheet .panel-handle {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: 44px;
    transform: none;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    touch-action: none;
    /* 본문(.panel-body)에 mask-image 가 걸려 있어서 본문이 별도 스택 컨텍스트가 되고, 이 손잡이
       위에 그려진다. z-index 가 auto 면 HALF/FULL 에서 손잡이 띠를 눌러도 터치가 본문으로
       가서 시트 대신 리스트가 스크롤됐다 (손잡이가 PEEK 에서만 잡혔다). 본문 위로 올린다.
       본문 내용은 padding-top 44px 아래에서 시작하므로 가리는 내용은 없다. */
    z-index: 2;
    transition: opacity 0.22s var(--ease), visibility 0.22s;
  }
  .side-panel.sheet .panel-handle::after {
    content: '';
    position: absolute;
    inset: auto;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 5px;
    margin: 0;
    border-radius: var(--r-pill);
    background: var(--line-strong);
    box-shadow: none;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  }
  .side-panel.sheet .panel-handle:hover { background: transparent; height: 44px; }

  /* 본문이 스크롤되면 헤더와 내용 가리지 않게 핸들바가 페이드 아웃으로 사라진다.
     다시 맨 위로 올리면 부드럽게 나타난다. */
  .side-panel.sheet .panel-handle.is-scrolled {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .side-panel.sheet .panel-handle.is-scrolled::after {
    opacity: 0;
    transform: translateX(-50%) translateY(-5px);
  }

  .side-panel.sheet .panel-body {
    padding-top: 44px;
    padding-bottom: calc(var(--sab) + 12px);
    overscroll-behavior: contain;
    /* 본문은 세로로만 스크롤된다. 가로 팬은 브라우저가 가져가지 않게 막고(제스처 충돌 방지),
       핀치 줌은 접근성 때문에 남긴다. */
    touch-action: pan-y pinch-zoom;
    /* 시트 박스 자체는 100dvh 지만 실제로 보이는 건 그중 일부(--sheet-visible,
       JS 가 매 프레임 갱신) 뿐이다. 이 값으로 안 잡아두면 내용이 화면 밖으로
       그냥 밀려날 뿐 스크롤이 안 걸린다. */
    max-height: var(--sheet-visible, 100%);
    /* 상단 도달 전 짧고 부드러운 페이드 아웃: 가장자리 닿기 직전 20px 구간에서만 흐려짐 */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0px, rgba(0, 0, 0, 0.4) 10px, black 20px, black 100%);
    mask-image: linear-gradient(to bottom, transparent 0px, rgba(0, 0, 0, 0.4) 10px, black 20px, black 100%);
  }
  /* 살짝 걸쳐 있을 때는 안쪽 스크롤을 막아 시트 끌기와 안 싸우게 */
  .side-panel.sheet.sheet-peek .panel-body { overflow-y: hidden; }

  /* 화면 제목 줄은 스크롤 영역이 아니라 시트의 제목 줄이다 — 터치를 전부 시트 끌기(panel.js 의
     bindDragSurface)로 넘긴다. 브라우저가 스크롤을 가져가면 끌기 도중 pointercancel 이 터져서
     시트가 몇 px 끌려갔다 되돌아오는 떨림이 생긴다. 리스트 스크롤은 이 줄 아래에서 시작하면 된다. */
  .side-panel.sheet .screen-head { touch-action: none; }

  .screen { padding: 6px 14px 24px; gap: 14px; }
  .screen-title { font-size: 18px; }

  /* 손가락 목표 크기 확보 */
  .card { padding: 14px 12px; }
  .btn { padding: 11px 14px; min-height: 44px; }
  .btn-mini { padding: 7px 11px; min-height: 34px; font-size: 12px; }
  .btn-back { width: 44px; height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .input { padding: 11px 12px; font-size: 16px; } /* 16px 미만이면 iOS 가 확대한다 */

  .screen-foot { position: static; }

  /* 목록이 길어서 버튼이 내용 위에 겹치는 화면에서만 배경을 깐다.
     sticky 는 제자리를 비우지 않고 떠 있어서 뒤가 비치는데, --bg-1 은
     반투명이라 배경색만으로는 못 가린다. 그래서 블러까지 쓴다.
     짧은 화면에까지 붙이면 아무것도 안 가리면서 상자만 보인다. */
  .screen-foot.is-floating {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 8px -14px 0;
    padding: 10px 14px calc(10px + var(--sab));
    /* --bg-1 은 반투명이라 블러가 안 먹는 WebView 에서는 줄 아래(제스처 바 자리)로 뒤 글자가 비쳤다 — 불투명한 바닥색 위에 겹친다 */
    background: linear-gradient(var(--bg-1), var(--bg-1)), var(--bg-0);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  }

  /* 내용이 시트 높이보다 짧으면(GO 화면·짧은 홈) 버튼 줄이 내용 끝에 붙어 시트 맨 아래에서 떠 버렸다 — 버튼 줄 아래로
     시트 바탕이 한 줄 더 비쳐서 따로 노는 블록처럼 보였다. 화면을 보이는 시트 높이만큼 늘리고 버튼 줄을 그 바닥으로
     밀어, 제스처 바 자리까지 버튼 줄이 채우게 한다. --sheet-visible 은 panel.js 가 넣고, 44px 은 panel-body 의 위 여백이다.
     내용이 더 길면 min-height 라 영향이 없다 (그때는 sticky 로 바닥에 붙는다). */
  .side-panel.sheet .screen:has(> .screen-foot.is-floating) {
    min-height: calc(var(--sheet-visible, 0px) - 44px);
  }
  .side-panel.sheet .screen > .screen-foot.is-floating { margin-top: auto; }

  /* 내비게이션 바(홈 버튼 줄) 자리. 시트는 화면 맨 아래까지 이어져 있어서 본문이 바 밑으로 그대로 비쳐 지나갔다 — 실기기에서
     "길찾기" 버튼 아랫부분이 바 뒤에 반쯤 가려진 채 보였다. 보이는 시트의 맨 아래 --sab 만큼을 시트 바탕색으로 덮어, 본문은
     바 윗변에서 끝난 것처럼 보이게 한다 (스크롤 영역·--sheet-visible 은 그대로라 다른 화면의 계산은 안 바뀐다).
     --sheet-visible 은 panel.js 가 끌 때마다 갱신하므로 띠도 시트를 따라 움직인다. 안전 영역이 0 인 브라우저에서는 높이가 0 이다. */
  .side-panel.sheet::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--sheet-visible, 100%) - var(--sab));
    height: var(--sab);
    background: var(--surface);
    pointer-events: none;
    z-index: 3;
  }

  /* 모바일에선 젤리 변형을 쓰지 않는다 */
  .side-panel.sheet.morphing {
    width: 100%;
    height: 100dvh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: var(--bg-1);
  }
  .drag-blob { display: none !important; }

  .net-badge { bottom: calc(12px + var(--sab)); font-size: 11px; }

  /* 지도 출처 표기(OSM·CARTO)는 라이선스상 화면에 보여야 해서 숨기지 않는다. 시트에 가리지 않게
     시트 윗변 바로 위로 올린다 — 높이는 map-view.js 가 시트가 멈출 때마다 --sheet-covered 로 넣는다.
     시트를 끝까지 올려 지도가 안 보일 때는 화면 밖으로 밀려나지 않게 위쪽에서 멈춘다. */
  .maplibregl-ctrl-bottom-right {
    bottom: min(var(--sheet-covered, 0px), calc(100% - 48px));
    right: 24px; /* 오른쪽 가장자리의 엣지 독 손잡이(폭 24px)와 겹치면 출처 버튼 대신 독이 열린다 */
    transition: bottom 0.3s var(--ease);
  }
  .maplibregl-ctrl-bottom-left { display: none; }

  /* 위저드 동안 ⓘ 는 카드와 한 몸처럼 움직인다: 카드가 걷힐 때(날아가는 중)는 카드와 같이 빨리 내려가고(0.26s),
     새 카드가 올라올 때는 카드의 올라오는 곡선(wizard-card-enter)과 맞춰 올라온다. */
  html.wizard-open .maplibregl-ctrl-bottom-right { transition: bottom 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
  html:has(.wizard-layer:is([data-state='FLYING'], [data-state='ARRIVED'])) .maplibregl-ctrl-bottom-right {
    transition: bottom 0.26s cubic-bezier(0.4, 0, 1, 1);
  }
}

/* ============================================================
   예약 내용 가져오기
   ============================================================ */

.import-box {
  min-height: 120px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
}

.import-cta { width: 100%; }

.import-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--bg-2);
  box-shadow: var(--sh-1);
}
.import-card.conf-high { border-left-color: var(--hotel); }
.import-card.conf-medium { border-left-color: var(--attraction); }
.import-card.conf-low { border-left-color: var(--ink-3); }
/* 이미 일정에 넣은 결과. 남은 카드와 구별되게 흐리게 둔다 */
.import-card.is-added { opacity: 0.6; }

.import-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.import-kind { font-size: 12px; font-weight: 600; }
.import-conf {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
}
.import-conf.conf-high {
  background: color-mix(in srgb, var(--hotel) 18%, transparent);
  color: var(--hotel);
}
.import-conf.conf-medium {
  background: color-mix(in srgb, var(--attraction) 20%, transparent);
  color: var(--attraction);
}
.import-conf.conf-low { background: var(--bg-3); color: var(--ink-3); }

.import-reason { margin: 0; font-size: 12px; color: var(--ink-3); }

.import-status { margin: 0; font-size: 12px; color: var(--ink-3); }
.import-status.is-error { color: var(--danger); }
.import-status.is-ok { color: var(--hotel); }
/* 실패는 아니지만 사용자가 손을 써야 하는 경우 (검색이 잠시 막힘 등) */
.import-status.is-warn { color: var(--attraction); line-height: 1.5; }

/* 백업 화면 맨 위 — 읽지 못한 원본이 남아 있을 때만 (views.js recoveryCard) */
.recovery-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-color: color-mix(in srgb, var(--warn) 45%, var(--line-strong));
  background: color-mix(in srgb, var(--warn) 10%, var(--bg-2));
}
.recovery-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.recovery-card .field-hint { margin: 0; }

.import-card .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* 파일 선택 버튼 (input 은 감추고 label 을 버튼처럼) */
.file-cta {
  width: 100%;
  cursor: pointer;
  justify-content: center;
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-cta:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 짧은 입력 두 개를 한 줄에 (여행 정보: 출발일 / 돌아오는 날) */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ============================================================
   지도 검색
   ============================================================ */

#map-search-root {
  position: fixed;
  top: calc(14px + var(--sat));       /* 상태바 아래 */
  left: calc(62px + var(--sal));      /* 확대/축소 버튼 옆 */
  z-index: 1500;
  width: min(340px, calc(100vw - 92px - var(--sal) - var(--sar)));
}
/* 결과가 펼쳐진 동안은 일정 시트(2000) 위로 — 키보드가 올라오면 시트가 검색창 바로 밑까지 올라와
   결과 목록이 시트 뒤로 들어가 첫 항목 일부만 보였다 (실기 23b). 토스트(2200)보다는 아래다. */
#map-search-root:has(.map-search.is-open) { z-index: 2050; }

.map-search { display: flex; flex-direction: column; gap: 6px; }

.map-search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-2);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  overflow: hidden;
}

.map-search-input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.map-search-input::placeholder { color: var(--ink-3); }
.map-search-input:focus { outline: none; }
.map-search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--sh-2), 0 0 0 3px var(--accent-soft);
}

.map-search-results {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: var(--r);
  background: var(--bg-1);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  max-height: 46vh;
  overflow-y: auto;
}
.map-search.is-open .map-search-results { display: flex; }

.map-search-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--r-xs);
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.map-search-item:hover { background: var(--bg-3); }
.map-search-name { font-size: 13px; font-weight: 600; }
.map-search-addr {
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-search-hint { padding: 8px 10px; font-size: 12px; color: var(--ink-3); }

.pin-search {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  animation: pin-pulse 2.1s var(--ease) infinite;
}

@media (max-width: 768px) {
  #map-search-root {
    left: calc(12px + var(--sal));
    right: calc(12px + var(--sar));
    top: calc(12px + var(--sat));
    width: auto;
  }
}

/* ============================================================
   넓은 창
   ============================================================ */

/* 넓은 화면(예산 등) — 표가 25vw 에 안 들어간다 */
.side-panel.wide { width: min(680px, 92vw); }
@media (max-width: 768px) {
  .side-panel.sheet.wide { width: 100%; }
}

/* ============================================================
   가상 키보드(IME)가 올라왔을 때 — panel.js 가 키보드가 가린 높이를 --kb 로, 패널에 .kb-open 으로 준다.
   보이는 영역만 줄고 레이아웃 뷰포트는 그대로인 경우(크롬 기본)에만 켜진다. WebView 처럼 뷰포트 자체가
   줄면 시트가 알아서 짧아지므로 --kb 는 0 이다.
   ============================================================ */

.side-panel.sheet.kb-open .panel-body {
  /* 스크롤 영역이 키보드 위에서 끝나게 한다. 안 그러면 마지막 칸이 키보드 밑까지 스크롤돼 들어가지 못한다 */
  max-height: calc(var(--sheet-visible, 100%) - var(--kb, 0px));
  /* 제스처 바 자리는 키보드가 차지한다 — 안전 영역을 또 더하지 않는다 */
  padding-bottom: 24px;
}
.side-panel.sheet.kb-open .screen-foot.is-floating { padding-bottom: 10px; }

/* 입력칸으로 스크롤해 올릴 때 위아래로 여유를 둔다 — 칸만 키보드 가장자리에 딱 붙지 않고 라벨·앞뒤 내용이 같이 보인다 */
.input, textarea, select { scroll-margin-block: 72px; }

/* ============================================================
   시스템 바 침범 방지 (안전 영역)
   값은 맨 위 :root 의 --sat/--sab/--sal/--sar. 예전에는 .native-shell 아래에서만, 그것도
   env(safe-area-inset-top, 28px) 처럼 폴백을 줬는데, 이 폴백은 env 가 0 을 보고하면 안 쓰여서
   (위 :root 주석 참고) 결국 아무 여백도 안 줬다. 이제 브라우저(PWA)와 APK 가 같은 규칙을 쓴다.
   ============================================================ */

/* 데스크톱 사이드 패널(가로로 눕힌 폰 포함)도 상태바·노치·제스처 바를 피한다 */
.side-panel:not(.sheet) .panel-body {
  padding-top: var(--sat);
  padding-bottom: var(--sab);
}
.side-panel.right:not(.sheet) { right: var(--sar); }
.side-panel.left:not(.sheet) { left: var(--sal); }

/* 시트는 진짜 화면 끝(bottom:0)까지 채운다 — 위치를 올려버리면 그 밑으로
   지도가 비치는 빈 공간이 생긴다. 내비게이션 바를 피하는 건 안쪽 콘텐츠
   패딩(.panel-body 의 아래 --sab)만으로 충분하다. 화면(.screen)에는 따로 더하지 않는다 —
   예전에는 .native-shell 에서 둘이 겹쳐 안전 영역이 두 번 더해졌다. */
.side-panel.sheet .panel-body {
  /* 예전에는 시트가 화면 꼭대기까지 닿는다고 보고 상태바 높이만큼 위쪽을 더 밀었다.
     지금은 FULL 도 화면의 25% 아래에서 멈춰서 상태바에 닿지 않는다 — 그 여백(실기기에서
     35px)은 시트가 반쯤 올라온 상태에서 내용을 밀어내는 빈 공간일 뿐이었다. */
  padding-top: 44px;
  padding-bottom: calc(var(--sab) + 12px);
  padding-left: var(--sal);
  padding-right: var(--sar);
}

/* ============================================================
   전체 점검 후 추가
   토스트 · 알림 배지 · 새 화면 요소 · 키보드 포커스 · 터치 영역
   ============================================================ */

/* 눈에는 안 보이지만 스크린리더와 복사(선택)에는 남는다 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 알림 배지 (손상된 데이터를 건너뛰었을 때). 오프라인 배지와 겹치지 않게 한 칸 위. */
.net-badge.is-warn {
  display: flex;
  align-items: center;
  gap: 10px;
  /* left: 50% 로 둔 fixed 요소의 가용 폭은 화면의 절반이라, 폭을 내용에 맞춰 주지 않으면 글이 쓸데없이 줄바꿈된다 */
  width: max-content;
  max-width: min(92vw, 440px);
  white-space: normal;
  line-height: 1.45;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--warn) 45%, var(--line-strong));
  background: color-mix(in srgb, var(--warn) 12%, var(--bg-2));
}
.net-badge.is-warn[hidden] { display: none; }
.data-notice { bottom: calc(64px + var(--sab)); }
/* 새 버전 준비됨 (network-badge.js guardUpdateReload) — 아래쪽 띠·토스트와 겹치지 않게 검색창 아래.
   top 은 스크립트가 검색창 위치에 맞춘다(이 값은 그 전의 기본값). 온라인일 때만 뜨니 같은 자리의 오프라인 배지와 겹칠 일은 거의 없다. */
.update-notice { top: calc(var(--sat) + 66px); bottom: auto; }
.data-notice-close {
  flex: none;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  background: var(--bg-3);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* 되돌리기 토스트 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--sab));
  transform: translateX(-50%);
  z-index: 2200;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 440px);
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--bg-3);
  color: var(--ink);
  box-shadow: var(--sh-3);
  font-size: 13px;
  animation: toast-in 0.2s var(--ease) both;
}
/* screen-in 은 끝에 transform: none 이라 가운데 맞춤(translateX(-50%))이 풀려 토스트가 오른쪽으로 밀리고 잘렸다 */
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
/* 위저드 카드가 화면 아래를 차지하는 동안에는 토스트를 위로 — 아래에 두면 버튼을 가린다 */
html.wizard-open .toast {
  bottom: auto;
  top: calc(var(--sat) + 68px);
}
.toast-text { min-width: 0; overflow-wrap: anywhere; }
.toast-action {
  flex: none;
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.toast-action:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }

/* 폼 보조 */
.field-hint { font-size: 11px; line-height: 1.5; color: var(--ink-3); }
.input-static {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink-2);
  background: var(--bg-3);
}

/* 바닥에 붙은 버튼 줄(약 64px + 제스처 바)이 있는 화면에서는 토스트를 그 위로 올린다. 바닥 18px 에 두면
   "뒤로 가기를 한 번 더…" 안내가 "일정 전체 보기" 버튼을 덮어서 누를 수 없었다. */
body:has(.screen-foot.is-floating) .toast { bottom: calc(82px + var(--sab)); }

/* 시트를 접으면(PEEK) 바닥 버튼 줄만 남기고 그 위는 비운다 — 안 그러면 탭 막대의 윗변이 손잡이와 버튼 사이에
   1cm 가량 잘려서 보였다. 버튼 줄이 없는 화면은 지금처럼 내용 윗부분이 보인다. */
.side-panel.sheet.sheet-peek .screen:has(> .screen-foot.is-floating) > :not(.screen-foot) { visibility: hidden; }

/* 홈의 핵심 버튼은 시트가 접혀 있어도 늘 보인다 */
.screen-foot.is-floating {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 8px -16px 0;
  padding: 10px 16px calc(10px + var(--sab));
  background: linear-gradient(var(--bg-1), var(--bg-1)), var(--bg-0);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .screen-foot.is-floating {
    margin: 8px -14px 0;
    padding: 10px 14px calc(10px + var(--sab));
  }
}

/* 지도를 못 불러왔을 때 */
.map-failed { display: grid; place-items: center; background: var(--bg-0); }
.map-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  padding: 16px;
  text-align: center;
  color: var(--ink-2);
}
.map-fallback-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.map-fallback-sub { margin: 0; font-size: 12px; line-height: 1.55; }

/* 키보드로 지도 핀에 닿았을 때 */
.pin-anchor:focus { outline: none; }
.pin-anchor:focus-visible .pin { box-shadow: 0 0 0 3px var(--accent), var(--sh-2); }
.go-card-main:focus-visible,
.chip-btn:focus-visible,
.toast-action:focus-visible,
.data-notice-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 손가락으로 쓰는 기기(와 좁은 창)에서는 누를 곳을 44px 이상으로 (--tap).
   예전에는 일부가 34~40px 이었다. 눈에 보이는 모양은 그대로 두는 것(지도 핀·엣지 독 손잡이)은
   보이는 크기를 유지한 채 누르는 칸만 넓힌다. */
@media (pointer: coarse), (max-width: 768px) {
  .btn,
  .btn-mini,
  .chip-btn,
  .choice,
  .plan-tab,
  .toast-action,
  .data-notice-close,
  .search-item,
  .map-search-item { min-height: var(--tap); min-width: var(--tap); }
  .input,
  select.input,
  .map-search-input { min-height: var(--tap); }
  .icon-btn,
  .btn-back { width: var(--tap); height: var(--tap); }
  .hero-edit { top: 4px; right: 4px; }

  /* 체크박스는 감싼 label(.plan-main) 줄 전체가 누르는 곳이다. 상자만 크게 해서는 줄 높이가 모자란다 */
  .plan-main { min-height: var(--tap); }
  .plan-check { width: 24px; height: 24px; }

  /* 지도 핀(34px)·묶음 배지(40px): 모양은 그대로, MapLibre 가 잡는 칸만 44px */
  .pin-anchor,
  .cluster-anchor {
    width: var(--tap);
    height: var(--tap);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 가장자리 손잡이는 모양은 그대로 두고, 눈에 안 보이는 터치 영역만 넓힌다 */
  .edge-handle { position: relative; }
  .edge-handle::before {
    content: '';
    position: absolute;
    inset: -14px 0 -14px -22px;
  }
}

/* 긴 이름·주소 줄바꿈 — word-break: keep-all 이라 띄어쓰기 없는 긴 낱말(장소명, URL, 영문
   복합어)이 줄을 못 바꾸고 화면 밖으로 밀려나 잘렸다. 안 들어갈 때만 어디서든 끊는다. */
.screen-title,
.screen-sub,
.screen-head-text,
.card-title,
.card-place,
.go-title,
.go-place,
.focus-title,
.focus-place,
.hero-title,
.hero-sub,
.kv-v,
.plan-title,
.plan-place,
.search-name,
.search-addr,
.picked-chip,
.cost-title,
.import-reason {
  overflow-wrap: anywhere;
}
.screen-head-text { min-width: 0; }

/* 하단에 고정된 버튼 줄(is-floating)은 자기 안에 안전 영역(내비게이션 바) 패딩을 이미
   갖고 있다. 시트 본문(.panel-body)과 화면(.screen)도 같은 만큼 아래 패딩을 두고 있어서
   둘이 겹쳐, 버튼 아래가 실기기에서 112px 나 비었다 (버튼 위로 내용이 그만큼 가려짐).
   고정 버튼이 있는 화면에서는 본문과 화면 아래 패딩을 없애고 버튼 줄이 그 자리를 맡는다. */
.side-panel.sheet .panel-body:has(.screen-foot.is-floating),
.screen:has(.screen-foot.is-floating) {
  padding-bottom: 0;
}

/* ============================================================
   AI 여행 만들기 위저드 (js/ui/sub-views/ai-wizard.js)
   지도 위에 질문 카드 한 장씩. 움직이는 건 transform 과 opacity 뿐이다 (top/left/height/margin 은 애니메이션하지 않는다)
   — 지도가 날아가는 동안에도 60fps 를 지키려고, 합성 레이어에서만 일어나는 속성만 쓴다.
   ============================================================ */

/* 위저드가 떠 있는 동안 일정 시트·검색창·핀은 비켜 둔다. 위저드가 보여 주는 건 지도 하나다. */
html.wizard-open #side-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* 숨길 때는 서서히, 돌아올 때(이 규칙이 풀릴 때)는 .side-panel 의 opacity 전환이 맡는다 */
  transition: opacity 0.2s var(--ease), visibility 0s linear 0.2s;
}
html.wizard-open #map-search-root,
html.wizard-open .maplibregl-marker {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 일정을 정리하는 동안 장소를 찾을 때마다 지도에 떨어지는 임시 핀 (map-view.js wizardPlace) — 위 규칙의 예외 */
html.wizard-open .maplibregl-marker.wizard-pin {
  opacity: 1;
  visibility: visible;
}
.wizard-pin {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink, #fff);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(255, 255, 255, 0.85);
  /* transform 은 지도가 위치용으로 쓰므로 안쪽 요소가 아니라 이 애니메이션은 scale 속성만 건드린다 */
  animation: wizard-pin-drop 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}
@keyframes wizard-pin-drop {
  from { scale: 0; opacity: 0; }
  60%  { scale: 1.25; opacity: 1; }
  to   { scale: 1; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .wizard-pin { animation: none; }
}

.wizard-layer {
  --wiz-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wiz-dir: 1; /* 1: 앞으로 (이전 카드는 왼쪽으로 물러남), -1: 뒤로 */
  --wiz-kb: 0px; /* 키보드가 가린 높이 — JS 가 visualViewport 로 갱신 */
  position: fixed;
  inset: 0;
  z-index: 1800;
  pointer-events: none; /* 카드와 버튼만 받는다. 나머지는 지도가 그대로 받는다 */
}
/* 카드가 지도와 구분되게 아래쪽을 살짝 눌러 준다 (정적 — 애니메이션 없음) */
.wizard-layer::before {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 62%;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg-0) 78%, transparent), transparent);
}

.wizard-close {
  position: absolute;
  top: calc(var(--sat) + 10px);
  left: calc(var(--sal) + 12px);
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink);
  font-size: 16px;
  box-shadow: var(--sh-2);
  cursor: pointer;
  pointer-events: auto;
}

/* 날아가는 중 표시 */
.wizard-flight {
  position: absolute;
  top: calc(var(--sat) + 14px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 136px);
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--bg-2);
  box-shadow: var(--sh-2);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, -14px, 0);
  transition: opacity 0.22s var(--ease), transform 0.34s var(--wiz-ease);
  will-change: transform, opacity;
}
.wizard-layer[data-state='FLYING'] .wizard-flight {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}
.wizard-flight-trail {
  position: relative;
  flex: none;
  width: 46px;
  height: 18px;
  overflow: hidden;
  background: repeating-linear-gradient(90deg, var(--ink-3) 0 4px, transparent 4px 9px) center / 100% 2px no-repeat;
}
.wizard-flight-plane {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 15px;
  line-height: 18px;
  will-change: transform;
  animation: wizard-plane 1.3s linear infinite;
}
.wizard-flight-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes wizard-plane {
  from { transform: translate3d(-18px, 0, 0); }
  to   { transform: translate3d(48px, 0, 0); }
}

/* 카드 + 진행 막대. 안전 영역(제스처 바)은 여기서 한 번만 비운다 — 카드는 그 위에 뜬다.
   키보드가 올라오면 이 덩어리 전체가 transform 으로 올라간다 (레이아웃을 건드리지 않는다). */
.wizard-stack {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal));
  transform: translate3d(0, calc(-1 * var(--wiz-kb)), 0);
  transition: transform 0.26s var(--wiz-ease);
  will-change: transform;
  pointer-events: none;
}
/* 키보드가 내비게이션 바까지 덮고 있으니 그 몫의 여백은 뺀다 */
.wizard-layer.kb-open .wizard-stack { padding-bottom: 10px; }

/* 카드 두 장이 같은 칸에 겹쳐 놓이는 동안(전환) 높이가 튀지 않게 한다. 모두 아래 정렬. */
.wizard-card-host {
  display: grid;
  align-items: end;
  width: 100%;
  max-width: 460px;
  pointer-events: none;
}
/* min-width:0 — 그리드 칸의 기본 최소 너비(auto)가 안쪽 내용(달력·기간 칩 줄)의 너비를 따라가 카드가 화면 밖으로 밀려나 잘리던 것을 막는다 */
.wizard-card-host > * { grid-area: 1 / 1; min-width: 0; }
.wizard-card-host { grid-template-columns: minmax(0, 1fr); }
.wizard-body,
.wizard-cal,
.wizard-chips-scroll { min-width: 0; max-width: 100%; }

.wizard-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  /* 키보드가 올라와 보이는 높이가 줄어도 카드가 화면 위로 넘치지 않게 — 넘치면 본문이 스크롤된다 */
  max-height: calc(var(--wiz-vh, 100dvh) - var(--sat) - var(--sab) - 104px);
  padding: 8px 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  /* 블러는 쓰지 않는다: 지도(WebGL) 위에서 매 프레임 뒤를 다시 흐리면 프레임이 밀린다 */
  /* 불투명: 반투명이면 뒤 지도의 지명이 카드 위로 희미하게 비쳐 보인다 */
  background: var(--bg-2);
  color: var(--ink);
  box-shadow: var(--sh-3);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
  pointer-events: auto;
}
/* 카메라가 나는 중이거나 카드가 오가는 중에는 눌리지 않는다 (상태 머신이 IDLE 일 때만 입력을 받는다) */
.wizard-layer:not([data-state='IDLE']) .wizard-card { pointer-events: none; }

.wizard-card.is-entering { animation: wizard-card-enter 0.52s cubic-bezier(0.22, 1, 0.36, 1) both; }
.wizard-card.is-leaving,
.wizard-card.is-flying-out { animation: wizard-card-exit 0.26s cubic-bezier(0.4, 0, 1, 1) both; }
/* 카드를 갈아 끼울 때 나가는 카드와 들어오는 카드가 같은 칸에서 동시에 보여 글자가 겹쳤다.
   나가는 카드는 빨리 걷고(0.14s), 들어오는 카드는 그만큼 뒤에 올라온다 (JS 의 ENTER_DELAY_MS 와 같은 값) */
.wizard-card.is-leaving { animation-duration: 0.14s; }
.wizard-card-host:has(> .is-leaving) > .wizard-card.is-entering { animation-delay: 0.14s; }

/* 새 카드: 아래에서 올라오며 한 번 튕긴다 */
@keyframes wizard-card-enter {
  0%   { opacity: 0; transform: translate3d(0, 56px, 0) scale(0.96); }
  55%  { opacity: 1; transform: translate3d(0, -8px, 0) scale(1.012); }
  78%  { transform: translate3d(0, 3px, 0) scale(0.998); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
/* 이전 카드: 한 걸음 물러나며 사라진다 (뒤로 갈 때는 반대쪽) */
@keyframes wizard-card-exit {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to   { opacity: 0; transform: translate3d(calc(var(--wiz-dir, 1) * -24px), 0, 0) scale(0.96); }
}

.wizard-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  margin: 0 -6px;
}
.wizard-back,
.wizard-back-spacer { flex: none; width: var(--tap); height: var(--tap); }
.wizard-back {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.wizard-count {
  padding-right: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.wizard-q {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  word-break: keep-all;
  outline: none;
}
.wizard-hint {
  margin: -4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  word-break: keep-all;
}
.wizard-label {
  margin: 2px 0 -4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-3);
}
.wizard-recap { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.wizard-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  /* 안쪽 포커스 링이 잘리지 않게 2px 을 안으로 들이고 같은 만큼 밖으로 뺀다 */
  margin: -2px;
  padding: 2px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.wizard-foot { display: flex; gap: 8px; }

/* 입력 */
.wizard-input,
.wizard-textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg-3);
  color: var(--ink);
  font: inherit;
  font-size: 17px; /* 16px 미만이면 일부 브라우저가 입력 때 화면을 확대한다 */
  outline: none;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.wizard-input::placeholder,
.wizard-textarea::placeholder { color: var(--ink-3); }
.wizard-input:focus,
.wizard-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.wizard-textarea {
  min-height: 84px;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
}
/* 출발지 자동완성 */
.wizard-ac-field { position: relative; display: flex; align-items: center; }
.wizard-ac-input { padding-right: 46px; }
.wizard-ac-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.wizard-ac-clear[hidden] { display: none; }
.wizard-ac-clear:hover { color: var(--ink); }
.wizard-ac-list {
  display: flex;
  flex-direction: column;
  max-height: 216px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
}
.wizard-ac-list[hidden] { display: none; }
.wizard-ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap);
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.wizard-ac-item:last-child { border-bottom: 0; }
.wizard-ac-item:hover,
.wizard-ac-item.is-active { background: var(--accent-soft); }
.wizard-ac-icon { flex: none; display: inline-flex; color: var(--ink-2); }
.wizard-ac-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-ac-kind { flex: none; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.is-nudge { animation: wizard-nudge 0.32s var(--ease); }
@keyframes wizard-nudge {
  20% { transform: translate3d(-6px, 0, 0); }
  40% { transform: translate3d(6px, 0, 0); }
  60% { transform: translate3d(-4px, 0, 0); }
  80% { transform: translate3d(4px, 0, 0); }
}

/* 버튼 */
.wizard-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s var(--ease), opacity 0.16s var(--ease), background 0.16s var(--ease);
}
.wizard-btn:active:not(:disabled) { transform: scale(0.97); }
.wizard-btn:disabled { opacity: 0.45; cursor: default; }
.wizard-btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 6px 18px var(--accent-soft);
}
.wizard-btn-ghost { background: var(--bg-3); color: var(--ink); }
/* 못 누르는 주요 버튼: 투명도만 낮추면 연한 그러데이션 위 흰 글자가 1.9:1 로 안 읽혔다 — 글자가 읽히는 회색 버튼으로 */
.wizard-btn-primary:disabled {
  opacity: 1;
  border-color: var(--line-strong);
  background: var(--bg-3);
  color: var(--ink-2);
  box-shadow: none;
}
.wizard-paste-btn { flex: none; min-height: var(--tap); font-size: 14px; }
.wizard-btn-sm { min-height: var(--tap); font-size: 14px; }

/* 정리 중 '백그라운드에서 계속' (ai-wizard.js createTrip) */
.wizard-bg { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; margin-top: 4px; }
.wizard-bg .wizard-btn { flex: none; width: 100%; }
.wizard-bg-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-3); text-align: center; }

/* 5단계: 도착·출발 · 예약한 항공권 (ai-wizard.js stepNote) */
.wizard-ticket-toggle { flex: none; width: 100%; min-height: var(--tap); font-size: 14px; }
.wizard-ticket-zone[hidden] { display: none; }
.wizard-ticket-zone .wizard-textarea { min-height: 72px; font-size: 13px; }
.wizard-ticket-actions { display: flex; gap: 8px; }
.wizard-ticket-status { margin: 0; min-height: 1.2em; font-size: 12px; color: var(--ink-2); }
.wizard-ticket-status:empty { display: none; }
.wizard-tickets { display: flex; flex-direction: column; gap: 6px; }
.wizard-tickets:empty { display: none; }
.wizard-ticket {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg-3);
}
.wizard-ticket-text { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.wizard-ticket-remove {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.wizard-ticket-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.wizard-ticket-note > span { flex: 1 1 160px; }
.wizard-ticket-fixed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

/* 칩 / 선택지 */
.wizard-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wizard-chips-scroll {
  flex-wrap: nowrap;
  /* 카드 가장자리까지 번지게 음수 여백을 주면 .wizard-body 가 가로로 넘쳐 스크롤 막대가 생긴다 */
  margin: 0;
  padding: 2px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.wizard-chips-scroll::-webkit-scrollbar { display: none; }
.wizard-chip {
  flex: none;
  min-height: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--bg-3);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.wizard-chip:active { transform: scale(0.95); }
.wizard-chip.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.wizard-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wizard-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 84px;
  padding: 12px 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: 18px;
  background: var(--bg-3);
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s var(--wiz-ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.wizard-choice:active { transform: scale(0.96); }
.wizard-choice.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.025);
}
.wizard-choice-icon { font-size: 26px; line-height: 1; }
.wizard-choice-label { font-size: 14px; font-weight: 700; line-height: 1.3; word-break: keep-all; }

/* 달력 */
.wizard-cal-head { display: flex; align-items: center; justify-content: space-between; }
.wizard-cal-label { font-size: 16px; font-weight: 800; }
.wizard-cal-nav {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.wizard-cal-nav:disabled { opacity: 0.25; cursor: default; }
.wizard-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
}
.wizard-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; }
.wizard-cal-blank { min-height: var(--tap); }
.wizard-cal-day {
  position: relative;
  isolation: isolate; /* 동그라미(::before)를 글자 뒤로 보낸다 */
  min-width: 0;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.wizard-cal-day:disabled { opacity: 0.28; cursor: default; }
.wizard-cal-day.is-today { color: var(--accent); font-weight: 800; }
.wizard-cal-day.is-in-range { background: var(--accent-soft); }
.wizard-cal-day.is-band-start { background: linear-gradient(to right, transparent 50%, var(--accent-soft) 50%); }
.wizard-cal-day.is-band-end { background: linear-gradient(to left, transparent 50%, var(--accent-soft) 50%); }
.wizard-cal-day.is-start,
.wizard-cal-day.is-end { color: var(--accent-ink); font-weight: 800; }
.wizard-cal-day.is-start::before,
.wizard-cal-day.is-end::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 42px;
  height: 42px;
  margin: auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.wizard-cal-summary {
  margin: 0;
  min-height: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

/* 진행 막대 — 카드 아래. 8칸(질문 7 + 마지막 카드), 칸마다 안쪽 채움이 왼쪽에서 오른쪽으로 scaleX 로 자란다 */
.wizard-progress {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 460px;
  padding: 0 18px;
  pointer-events: none;
}
.wizard-progress-seg {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 20%, transparent);
  overflow: hidden;
}
.wizard-progress-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--wiz-ease);
  will-change: transform;
}
.wizard-progress-seg.is-on .wizard-progress-fill { transform: scaleX(1); }

/* 마지막 카드: 복사 · 붙여넣기 */
.wizard-btn-copy {
  flex: none;
  width: 100%;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}
.wizard-btn-copy.is-copied {
  border-color: var(--hotel);
  background: color-mix(in srgb, var(--hotel) 18%, transparent);
  color: var(--hotel);
}
.wizard-copy-icon { position: relative; display: grid; place-items: center; width: 24px; height: 24px; }
.wizard-copy-icon > span { grid-area: 1 / 1; transition: transform 0.3s var(--wiz-ease), opacity 0.2s var(--ease); }
.wizard-copy-check { opacity: 0; font-size: 20px; font-weight: 900; transform: scale(0.2) rotate(-30deg); }
.wizard-btn-copy.is-copied .wizard-copy-clip { opacity: 0; transform: scale(0.2); }
.wizard-btn-copy.is-copied .wizard-copy-check { opacity: 1; transform: scale(1) rotate(0); animation: wizard-check-pop 0.45s var(--wiz-ease) both; }
@keyframes wizard-check-pop {
  0%   { transform: scale(0.2) rotate(-30deg); }
  60%  { transform: scale(1.35) rotate(0); }
  100% { transform: scale(1) rotate(0); }
}
.wizard-peek summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.wizard-prompt-box { font-size: 12px; }
.wizard-paste-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-3) 55%, transparent);
}
.wizard-badges { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.wizard-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  animation: wizard-badge-in 0.3s var(--wiz-ease) both;
}
.wizard-badge.is-ok { background: color-mix(in srgb, var(--hotel) 18%, transparent); color: var(--hotel); }
.wizard-badge.is-warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.wizard-badge.is-muted { color: var(--ink-3); }
@keyframes wizard-badge-in {
  from { opacity: 0; transform: translate3d(0, 6px, 0) scale(0.92); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.wizard-copy-buffer {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* 분석 중 · 완료 */
.wizard-card.is-status { align-items: center; padding: 30px 18px 34px; text-align: center; }
.wizard-status-art { position: relative; display: grid; place-items: center; width: 112px; height: 112px; }
.wizard-status-icon { position: relative; font-size: 44px; line-height: 1; }
.wizard-analyzing-pulse::before,
.wizard-analyzing-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0.4);
  will-change: transform, opacity;
  animation: wizard-pulse 1.6s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.wizard-analyzing-pulse::after { animation-delay: 0.8s; }
.wizard-analyzing-pulse .wizard-status-icon {
  will-change: transform;
  animation: wizard-beat 1.1s ease-in-out infinite;
}
@keyframes wizard-pulse {
  0%   { opacity: 0.9; transform: scale(0.4); }
  100% { opacity: 0;   transform: scale(1.35); }
}
@keyframes wizard-beat {
  0%, 100% { transform: scale(1); }
  25%      { transform: scale(1.18); }
  50%      { transform: scale(0.96); }
  70%      { transform: scale(1.1); }
}
.wizard-card.is-done .wizard-status-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--hotel);
  color: #fff;
  font-size: 40px;
  font-weight: 800;
  animation: wizard-pop 0.5s var(--wiz-ease) both;
}
@keyframes wizard-pop {
  0%   { opacity: 0; transform: scale(0.3); }
  60%  { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

/* 여행이 만들어진 뒤 일정 화면의 카드: 위에서부터 차례로(--stagger-index × 55ms) 내려앉는다 */
.timeline-card-stagger {
  will-change: transform, opacity;
  animation: timeline-card-land 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--stagger-index, 0) * 55ms);
}
@keyframes timeline-card-land {
  0%   { opacity: 0; transform: translate3d(0, -22px, 0) scale(0.97); }
  60%  { opacity: 1; transform: translate3d(0, 3px, 0) scale(1.005); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* 모션 줄이기: 한 번 도는 연출은 전역 규칙이 바로 끝 상태로 보낸다. 끝없이 도는 것은 아예 멈춘다. */
@media (prefers-reduced-motion: reduce) {
  .wizard-flight-plane,
  .wizard-analyzing-pulse::before,
  .wizard-analyzing-pulse::after,
  .wizard-analyzing-pulse .wizard-status-icon { animation: none !important; }
}
:root[data-motion='reduce'] .wizard-flight-plane,
:root[data-motion='reduce'] .wizard-analyzing-pulse::before,
:root[data-motion='reduce'] .wizard-analyzing-pulse::after,
:root[data-motion='reduce'] .wizard-analyzing-pulse .wizard-status-icon { animation: none !important; }

/* ============================================================
   내 위치 (map-view.js myLocation)
   버튼은 MapLibre 오른쪽 아래 컨트롤 자리 — 모바일에서는 출처 표기와 함께 시트 윗변 위로 올라간다.
   ============================================================ */

.me-ctl {
  position: relative;
  display: flex;
  justify-content: flex-end;
  background: none;
  box-shadow: none;
}
.me-btn {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-1);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: var(--sh-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.me-btn svg { width: 22px; height: 22px; }
.me-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.me-btn[data-state='on'],
.me-btn[data-state='busy'] { color: var(--accent); }
.me-btn[data-state='follow'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.me-btn[data-state='on'] .me-btn-dot,
.me-btn[data-state='follow'] .me-btn-dot { fill: currentColor; }
.me-btn[data-state='busy'] svg { animation: me-busy 1.1s ease-in-out infinite; }
@keyframes me-busy {
  50% { opacity: 0.35; }
}

/* 권한이 없거나 아직 못 잡았을 때 버튼 왼쪽에 잠깐 뜨는 말풍선 */
.me-hint {
  position: absolute;
  right: calc(var(--tap) + 8px);
  bottom: 0;
  width: max-content;
  max-width: min(260px, 64vw);
  margin: 0;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-1);
  box-shadow: var(--sh-2);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
}
.me-hint[hidden] { display: none; }

/* 오른쪽 아래 컨트롤(내 위치 버튼·출처 표기)은 핀 위에 둔다. 핀은 z-index 0~4(내 위치 점 5)인데 MapLibre 컨트롤은
   기본 2 라서, 도착 핀 같은 것이 버튼 자리에 오면 버튼이 핀 밑에 가려졌다. */
.maplibregl-ctrl-bottom-right { z-index: 6; }

/* AI 위저드가 지도를 쓰는 동안에는 숨긴다. 시트를 끝까지 올려도(지도 25%) 버튼은 시트 윗변 위에 남겨 둔다 —
   화면이 낮아 검색창 옆으로 밀려 올라갈 만큼 좁을 때만 숨긴다. */
html.wizard-open .me-ctl { display: none; }
@media (max-height: 600px) {
  #map.sheet-full .me-ctl { display: none; }
}

/* 넓은 화면: 오른쪽 일정 창이 열려 있으면 오른쪽 아래 컨트롤(내 위치·출처)이 그 밑에 깔린다 — 창 왼쪽으로 옮긴다 */
@media (min-width: 769px) {
  body:has(.side-panel.right:not(.collapsed)) .maplibregl-ctrl-bottom-right { right: 25vw; }
  body:has(.side-panel.right.wide:not(.collapsed)) .maplibregl-ctrl-bottom-right { right: min(680px, 92vw); }
}

/* 지도 위의 나: 정확도 원 + 흰 테두리 점. 일정 핀을 누르는 데 방해되지 않게 손가락은 통과시킨다. */
.me-marker { width: 0; height: 0; pointer-events: none; }
.me-ring,
.me-dot {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.me-ring {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.me-dot {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
.me-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: me-pulse 2.2s ease-out infinite;
}
@keyframes me-pulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  80%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .me-dot::after,
  .me-btn[data-state='busy'] svg { animation: none; }
}
:root[data-motion='reduce'] .me-dot::after,
:root[data-motion='reduce'] .me-btn[data-state='busy'] svg { animation: none; }

/* 일정 카드·GO 카드의 '📍 내 위치에서 1.2km' 한 줄 */
.go-near,
.card-near { font-size: 12px; font-weight: 600; color: var(--accent); }
.card-near { margin-top: 3px; }
.go-near[hidden],
.card-near[hidden],
.kv[hidden] { display: none; }

/* ============================================================
   첫 화면 (index.html #boot)
   안드로이드 시작 화면과 같은 바탕·그림·크기라 앱이 뜰 때 튀지 않는다. 앱이 처음 그려지면 views.js 가 걷는다.
   ============================================================ */

.boot {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  background: #0e0f13; /* android res values/splash.xml 의 splash_background 와 같은 색 */
  transition: opacity 0.28s ease;
  /* 스크립트가 끝내 못 돌아도 화면을 영영 가리지 않게, 6초 뒤에는 스스로 사라진다 */
  animation: boot-gone 0.3s ease 6s forwards;
}
.boot svg { width: 288px; height: 288px; }
.boot.is-done { opacity: 0; pointer-events: none; }
@keyframes boot-gone {
  to { opacity: 0; visibility: hidden; }
}

/* ============================================================
   일정 위치 찾기 띠 (views.js locateBadge)
   "찾고 있어요 3/18 · 멈추기" → "끝났어요 · 확인". 검색창 바로 아래라 시트를 어느 칸에 두어도 보인다.
   ============================================================ */

.locate-badge {
  top: calc(var(--sat) + 66px);
  bottom: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  /* left: 50% 로 둔 fixed 요소의 가용 폭은 화면의 절반이라, 폭을 내용에 맞춰 주지 않으면 글이 쓸데없이 줄바꿈된다 */
  width: max-content;
  max-width: min(92vw, 440px);
  white-space: normal;
  line-height: 1.45;
  font-size: 13px;
  color: var(--ink);
  /* 시트를 끝까지 올리면 시트 윗변(손잡이)과 겹친다 — 뒤가 비쳐 글이 흐려지지 않게 흐리게 가린다 */
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.locate-badge-mark { flex: none; }
.locate-badge-mark:empty { display: none; }
.locate-badge.is-busy .locate-badge-mark {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
  animation: locate-spin 0.8s linear infinite;
}
@keyframes locate-spin {
  to { transform: rotate(360deg); }
}
.locate-badge-count {
  flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.locate-badge-count:empty,
.locate-badge .data-notice-close[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .locate-badge.is-busy .locate-badge-mark { animation-duration: 2.4s; }
}
:root[data-motion='reduce'] .locate-badge.is-busy .locate-badge-mark { animation-duration: 2.4s; }

/* ============================================================
   일정 재생 (js/ui/sub-views/trip-tour.js)
   여행 머리의 ▶ → 지도 카메라가 1번부터 마지막 일정까지 차례로 날아간다. 화면 아래의 재생 카드가 지금 어디인지 알려 준다.
   ============================================================ */

/* 모바일은 재생이 보여 주는 게 지도 하나라 일정 시트를 비켜 둔다 (위저드와 같은 방식). 넓은 화면은 오른쪽 창이 그대로 있다.
   출처 ⓘ 는 시트 대신 재생 카드 윗변을 따라 올라온다 (map-view.js 가 --sheet-covered 를 카드 높이로 바꾼다). */
@media (max-width: 768px) {
  html.tour-open .goo-wrapper { pointer-events: none; }
  html.tour-open #side-panel {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s var(--ease), visibility 0s linear 0.16s;
  }
  html.tour-open .maplibregl-ctrl-bottom-right { transition: bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
}
/* 재생 중에는 핀을 눌러 상세로 넘어가거나 내 위치를 따라가지 않게 한다 — 지도는 보기만 한다 */
html.tour-open .maplibregl-marker { pointer-events: none; }
/* 정거장 화면에서는 출발지·목적지 핀만 남기고 나머지는 감춘다 (map-view.js syncPins). 전체 보기에서는 모두 보인다. */
.pin-anchor.pin-tour-hide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease), visibility 0s linear 0.2s;
}
html.tour-open .me-ctl { display: none; }
/* 재생 카드가 화면 아래를 차지하는 동안에는 토스트를 위로 (위저드와 같다) */
html.tour-open .toast { bottom: auto; top: calc(var(--sat) + 12px); }

.tour-layer {
  position: fixed;
  inset: auto 0 0 0;
  z-index: calc(var(--z-sheet) - 2);
  padding: 0 calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal));
  pointer-events: none; /* 카드만 받는다. 나머지는 지도가 그대로 받는다 (끌어서 둘러보기) */
}
@media (min-width: 769px) {
  /* 넓은 화면: 오른쪽 일정 창을 피해 지도 왼쪽 아래에 둔다 */
  .tour-layer { right: auto; width: min(480px, 70vw); }
  .tour-card { margin: 0; }
}

.tour-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
  padding: 2px 12px 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text-1);
  box-shadow: var(--elev-3);
  pointer-events: auto;
  animation: tour-card-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes tour-card-in {
  from { opacity: 0; transform: translate3d(0, 28px, 0); }
  to   { opacity: 1; transform: none; }
}

.tour-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
}
.tour-day {
  flex: none;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-subtle);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tour-when {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.tour-count {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.tour-count:empty { display: none; }
.tour-close { margin-right: -4px; color: var(--text-2); }

.tour-body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.tour-tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-subtle);
  color: var(--accent-text);
}
.tour-tile[data-cat='flight'] { background: var(--cat-flight-subtle); color: var(--cat-flight); }
.tour-tile[data-cat='stay'] { background: var(--cat-stay-subtle); color: var(--cat-stay); }
.tour-tile[data-cat='place'] { background: var(--cat-place-subtle); color: var(--cat-place); }
.tour-tile[data-cat='transit'] { background: var(--cat-transit-subtle); color: var(--cat-transit); }
.tour-text { flex: 1; min-width: 0; }
.tour-title {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tour-place {
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-2);
}
.tour-place[hidden] { display: none; }

/* 영상 진행 막대 — 정거장 수만큼 나뉘어 차오른다 */
.tour-bar {
  position: relative;
  height: 4px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-1) 14%, transparent);
  overflow: hidden;
}
.tour-bar-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.tour-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.tour-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast) var(--ease-standard), transform 0.12s var(--ease-standard);
}
.tour-btn:active:not(:disabled) { background: var(--sunken); transform: scale(0.94); }
.tour-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.tour-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tour-btn-main {
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: var(--accent-ink, #fff);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 38%, transparent);
}
.tour-btn-main:active:not(:disabled) { background: color-mix(in srgb, var(--accent) 86%, #000); }
@media (hover: hover) {
  .tour-btn:hover:not(:disabled):not(.tour-btn-main) { background: var(--sunken); }
}
@media (prefers-reduced-motion: reduce) {
  .tour-card { animation: none; }
  .tour-bar-fill { transition: none; }
}
:root[data-motion='reduce'] .tour-card { animation: none; }
:root[data-motion='reduce'] .tour-bar-fill { transition: none; }
