/* ===========================================================================
   K-Toilet — operational toilet finder for foreigners in Korea.
   One neutral surface, one navy brand, three field-check status hues
   (open = green, closed = red, unchecked = grey).

   Layout:
     • Desktop (>= 761px): a quiet full-height operational rail (~420px) that
       floats over the live Naver map on the left. The rail scrolls; the
       mobile-only view switch and sheet toggle are hidden.
     • Mobile (<= 760px): a bottom sheet with an explicit Map/List segmented
       control and a sheet toggle. Peek keeps the map visible; expanded lets
       list / detail / report scroll. No drag handle is required.
   =========================================================================== */

:root {
  --bg: #e9eeec;
  --surface: #ffffff;
  --surface-2: #f5f7f6;
  --ink: #16242a;
  --ink-soft: #3c4a50;
  --muted: #6a767c;
  --faint: #97a1a5;
  --line: #e3e8e6;
  --line-strong: #d2dad7;

  --brand: #10263a;      /* dark navy — clusters, primary buttons, brand */
  --brand-ink: #0a1a29;
  --focus: #2f74b5;

  /* field-check status channel */
  --open: #12996a;
  --open-ink: #0b6b4a;
  --closed: #d64027;
  --closed-ink: #a52d18;
  --none: #8a949a;

  --warn-ink: #9a5b12;
  --danger: #c0442e;

  /* cards / bordered items cap at 8px */
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-1: 0 6px 20px rgba(20, 40, 45, 0.10);
  --shadow-2: 0 18px 46px rgba(18, 36, 41, 0.22);
  --tap: 44px;

  --rail-w: 420px;
  --sheet-peek: 132px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--focus); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
}

/* -------------------------------------------------------------------------- */
/* Map                                                                        */
/* -------------------------------------------------------------------------- */

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #d7e1dc;
}

.map-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 400;
}
.map-overlays > * { pointer-events: auto; }

.search-area {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  animation: pop 0.18s ease;
}
.search-area svg { width: 16px; height: 16px; }
.search-area:hover { border-color: var(--brand); }

.locate-me {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #d5dee3;
  border-radius: 50%;
  background: #fff;
  color: #216fae;
  box-shadow: 0 3px 10px rgba(16, 38, 58, 0.22);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.locate-me:hover { background: #f7fafc; border-color: #b9c8d1; }
.locate-me:active { transform: scale(0.96); }
.locate-me:disabled { cursor: progress; opacity: 1; }
.locate-me.has-location {
  border-color: #fff;
  background: #287fc4;
  color: #fff;
}
.locate-crosshair {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  background:
    linear-gradient(currentColor, currentColor) center top / 2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) left center / 5px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right center / 5px 2px no-repeat;
}
.locate-crosshair::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.locate-crosshair::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.locate-spinner {
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid #c9d7e1;
  border-top-color: #216fae;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.app[data-mode="detail"] .locate-me,
.app[data-mode="report"] .locate-me { display: none; }

/* Keep the "Search this area" pill clear of the desktop rail. */
@media (min-width: 761px) {
  .search-area { left: calc(50% + (var(--rail-w) + 32px) / 2); }
}

@keyframes pop {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.map-tools {
  position: absolute;
  right: 16px;
  bottom: 118px;
  display: grid;
  gap: 10px;
}

.fab {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
  box-shadow: var(--shadow-1);
}
.fab svg { width: 21px; height: 21px; }
.fab:hover { border-color: var(--brand); }
.fab-ghost { color: var(--muted); }
.fab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Legend — compact, upper-right, readable over the map. It never covers the
   left rail (desktop) or the bottom-sheet controls (mobile). */
.legend {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 208px;
  max-width: calc(100vw - 32px);
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(3px);
  box-shadow: var(--shadow-1);
  font-size: 0.76rem;
  color: var(--ink-soft);
}
.legend-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.legend-list li { display: flex; align-items: center; gap: 10px; }
.legend-pin {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 7px 7px 7px 2px;
  color: #fff;
  font-size: 0.56rem;
  font-weight: 800;
  transform: rotate(-45deg);
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(15, 28, 24, 0.28);
}
.legend-pin__label {
  transform: rotate(45deg);
  line-height: 1;
}
.legend-pin.st-open { background: var(--open); }
.legend-pin.st-closed { background: var(--closed); }
.legend-pin.st-none { background: var(--none); }
.legend-cluster {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 5px rgba(15, 28, 24, 0.22);
  font-size: 0.68rem;
  font-weight: 800;
}

/* -------------------------------------------------------------------------- */
/* Markers (preserve existing Naver marker styling)                           */
/* -------------------------------------------------------------------------- */

.wc-pin {
  position: relative;
  width: 30px;
  height: 30px;
  cursor: pointer;
  transform-origin: 50% 100%;
  transition: transform 0.12s ease;
}
.wc-pin__body {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 2px;
  transform: rotate(45deg);
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(15, 28, 24, 0.34);
}
.wc-pin__body b {
  transform: rotate(-45deg);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.wc-pin.st-open .wc-pin__body { background: var(--open-ink); }
.wc-pin.st-closed .wc-pin__body { background: var(--closed-ink); }
.wc-pin.st-none .wc-pin__body { background: var(--none); }

.wc-pin.is-selected { transform: scale(1.28); z-index: 5; }
.wc-pin.is-selected .wc-pin__body {
  border-color: #fff;
  box-shadow: 0 0 0 4px var(--brand), 0 4px 12px rgba(15, 28, 24, 0.5);
}

.place-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.97);
  color: var(--brand);
  border: 3px solid var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92), 0 5px 14px rgba(15, 28, 24, 0.28);
  cursor: pointer;
  line-height: 1;
}
.place-cluster b { font-size: 0.9rem; font-weight: 900; }
.place-cluster small { margin-top: 2px; font-size: 0.46rem; font-weight: 800; opacity: 0.78; }
.place-cluster.size-s { width: 50px; height: 50px; }
.place-cluster.size-m { width: 56px; height: 56px; }
.place-cluster.size-l { width: 64px; height: 64px; }

.user-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--focus);
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(47, 116, 181, 0.28), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* -------------------------------------------------------------------------- */
/* Panel — desktop operational rail                                           */
/* -------------------------------------------------------------------------- */

.panel {
  position: absolute;
  z-index: 500;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: var(--rail-w);
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

/* Mobile-only controls: hidden on the desktop rail. */
.mobile-view-switch,
.sheet-toggle { display: none; }

.panel-head {
  display: grid;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: 0 0 auto;
}

.brand {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 11px;
  align-items: center;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}
.brand-copy { min-width: 0; }
.brand h1 { margin: 0; font-size: 1.14rem; line-height: 1.1; }
.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang {
  align-self: start;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 3px 6px;
}

.near-me {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(16, 38, 58, 0.28);
}
.near-me svg { width: 19px; height: 19px; }
.near-me:hover { background: var(--brand-ink); }
.near-me.is-busy { opacity: 0.75; cursor: progress; }
.near-me.is-busy svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Search box + grouped suggestion listbox */
.search-box {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
}
.search-box > svg { width: 17px; height: 17px; color: var(--muted); }
.search-box input { border: 0; background: transparent; outline: 0; min-width: 0; }
.search-box input::placeholder { color: var(--faint); }
.search-clear {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: #dfe5e3; color: var(--ink-soft);
  cursor: pointer;
}
.search-clear svg { width: 14px; height: 14px; }

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.sugg-note {
  padding: 10px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.sugg-group {
  padding: 8px 10px 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sugg-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: var(--tap);
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.sugg-item svg { width: 17px; height: 17px; color: var(--muted); }
.sugg-item:hover { background: var(--surface-2); }
.sugg-text { min-width: 0; display: grid; gap: 1px; }
.sugg-name {
  font-size: 0.88rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sugg-sub {
  color: var(--muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Four quick-filter chips — single horizontal scroll row, no "More" control. */
.triage {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 2px 16px;
}
.triage::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip svg { width: 15px; height: 15px; }
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

/* -------------------------------------------------------------------------- */
/* Scroll region                                                              */
/* -------------------------------------------------------------------------- */

.panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* -------------------------------------------------------------------------- */
/* Status pill + facts (shared)                                               */
/* -------------------------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 730;
  border: 1px solid transparent;
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: currentColor; }
.pill.st-open { color: var(--open-ink); background: rgba(18, 153, 106, 0.12); border-color: rgba(18, 153, 106, 0.3); }
.pill.st-closed { color: var(--closed-ink); background: rgba(214, 64, 39, 0.11); border-color: rgba(214, 64, 39, 0.28); }
.pill.st-none { color: var(--muted); background: var(--surface-2); border-color: var(--line-strong); }

.fact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 650;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.fact svg { width: 13px; height: 13px; }
.fact.ok { color: var(--open-ink); border-color: rgba(18, 153, 106, 0.28); }
.fact.warn { color: var(--warn-ink); border-color: rgba(154, 91, 18, 0.28); }

/* -------------------------------------------------------------------------- */
/* Bilingual name + single address block (shared list / detail)               */
/* -------------------------------------------------------------------------- */

.addr {
  display: grid;
  gap: 1px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}
.addr-en { overflow-wrap: anywhere; }
.addr-ko { color: var(--faint); overflow-wrap: anywhere; }

/* -------------------------------------------------------------------------- */
/* Results list                                                               */
/* -------------------------------------------------------------------------- */

.list-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 8px;
}
.list-meta strong { font-size: 0.92rem; }
.list-meta span { color: var(--muted); font-size: 0.74rem; }

.results { display: grid; gap: 8px; padding: 0 16px 20px; }

/* Compact, scannable row: English guide name primary, Korean secondary,
   one bilingual address block. */
.result {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--none);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.result.st-open { border-left-color: var(--open); }
.result.st-closed { border-left-color: var(--closed); }
.result:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.result.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(16, 38, 58, 0.12);
}
.result-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.result-name {
  font-size: 0.92rem;
  font-weight: 730;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.result-name-ko {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.result-dist { flex: 0 0 auto; color: var(--brand); font-weight: 750; font-size: 0.82rem; }
.result-status { display: flex; }
.result-type { color: var(--muted); font-size: 0.75rem; }
.result-facts { display: flex; flex-wrap: wrap; gap: 5px; }

/* -------------------------------------------------------------------------- */
/* First-party promo ("AD · OTHER SERVICE") — clearly a separate unit         */
/* -------------------------------------------------------------------------- */

.ad-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
}
.ad-card:hover { border-color: var(--brand); }
.ad-flag {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 6px;
  background: #e6ebe9;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ad-card__title { font-size: 0.9rem; font-weight: 730; overflow-wrap: anywhere; }
.ad-card__body { color: var(--muted); font-size: 0.8rem; line-height: 1.4; overflow-wrap: anywhere; }

/* -------------------------------------------------------------------------- */
/* States: loading / empty / error                                            */
/* -------------------------------------------------------------------------- */

.skeleton { padding: 8px 16px 0; display: grid; gap: 8px; }
.sk-row {
  height: 74px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f0 25%, #f6f9f8 37%, #eef2f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.state {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin: 22px 16px;
  padding: 26px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  text-align: center;
}
.state svg { width: 30px; height: 30px; color: var(--muted); }
.state.is-error svg { color: var(--danger); }
.state strong { font-size: 0.96rem; }
.state p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.4; max-width: 30ch; }
.state .btn { margin-top: 4px; }

/* -------------------------------------------------------------------------- */
/* Detail view                                                                */
/* -------------------------------------------------------------------------- */

.detail { display: grid; gap: 14px; padding: 0 16px 26px; }

/* Sticky action bar (back + walk / naver / update) */
.detail-sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 10px;
  padding: 12px 0 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: start;
  min-height: var(--tap);
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}
.detail-back svg { width: 17px; height: 17px; }

/* One primary navigation action only (navy = walking / destination). */
.detail-actions { display: grid; gap: 6px; justify-items: stretch; }
.btn-walk { width: 100%; }
.detail-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-self: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}
.detail-hint svg { width: 12px; height: 12px; }

.detail-head { display: grid; gap: 6px; }
.detail-name {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.22;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.detail-name-ko { color: var(--ink-soft); font-size: 0.9rem; font-weight: 650; overflow-wrap: anywhere; }
.detail-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 0.78rem; font-weight: 650;
}
.detail-eyebrow-live { color: var(--open-ink); text-transform: uppercase; letter-spacing: 0.04em; }

/* Latest field check card */
.check-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--none);
  border-radius: 8px;
  background: var(--surface-2);
}
.check-card.st-open { border-left-color: var(--open); }
.check-card.st-closed { border-left-color: var(--closed); }
.check-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.check-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 1.02rem; font-weight: 800;
}
.check-card.st-open .check-status { color: var(--open-ink); }
.check-card.st-closed .check-status { color: var(--closed-ink); }
.check-card.st-none .check-status { color: var(--muted); }
.check-status .pill-dot { width: 11px; height: 11px; background: currentColor; }
.check-time { color: var(--muted); font-size: 0.82rem; font-weight: 650; }
.check-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.check-note {
  display: flex; gap: 7px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.check-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: var(--muted); }
.check-foot {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  color: var(--muted); font-size: 0.75rem;
  padding-top: 2px;
}
.check-foot .verified { display: inline-flex; align-items: center; gap: 5px; color: var(--open-ink); font-weight: 700; }
.check-foot .verified svg { width: 13px; height: 13px; }
.check-agree {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ink-soft); font-size: 0.8rem; font-weight: 650;
  padding-top: 8px; border-top: 1px solid var(--line);
}
.check-agree svg { width: 15px; height: 15px; color: var(--muted); }

/* Empty (no checks yet) */
.check-empty {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
}
.check-empty > svg { width: 26px; height: 26px; color: var(--muted); }
.check-empty strong { font-size: 0.98rem; }
.check-empty p { margin: 3px 0 0; color: var(--muted); font-size: 0.84rem; line-height: 1.4; }
.check-empty .btn { width: 100%; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn.is-busy svg { animation: spin 0.9s linear infinite; }

/* Report / contribute action — green channel, distinct from navy navigation. */
.btn-report {
  width: 100%;
  background: var(--open-ink);
  border: 1.5px solid var(--open-ink);
  color: #fff;
}
.btn-report:hover { background: #084f38; border-color: #084f38; }
.btn-report svg { color: currentColor; }
.check-update { margin-top: 2px; background: #fff; color: var(--open-ink); }
.check-update:hover { background: rgba(18, 153, 106, 0.08); border-color: var(--open); }
.btn-contribute { background: var(--open-ink); border-color: var(--open-ink); color: #fff; }
.btn-contribute:hover { background: #084f38; border-color: #084f38; }

/* Detail sections */
.detail-section { display: grid; gap: 8px; }
.detail-section h3 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Historical Naver observation snapshot */
.snapshot {
  display: grid;
  gap: 6px;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbf7ee;
}
.snapshot-head {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--warn-ink); font-size: 0.74rem; font-weight: 750;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.snapshot-head svg { width: 14px; height: 14px; }
.snapshot-body { margin: 0; font-size: 0.88rem; font-weight: 650; overflow-wrap: anywhere; }
.snapshot-warn { margin: 0; color: var(--muted); font-size: 0.76rem; line-height: 1.4; }

/* Report history */
.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist-row {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.hist-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hist-time { color: var(--muted); font-size: 0.76rem; }
.hist-facts { display: flex; flex-wrap: wrap; gap: 5px; }
.hist-note { color: var(--ink-soft); font-size: 0.82rem; line-height: 1.4; overflow-wrap: anywhere; }

/* -------------------------------------------------------------------------- */
/* Report form                                                                */
/* -------------------------------------------------------------------------- */

.report-form { gap: 16px; }
.report-lead { margin: 4px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }

.rf-group { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
.rf-group legend {
  padding: 0;
  font-size: 0.9rem;
  font-weight: 730;
}
.req { color: var(--danger); }
.rf-opt-tag {
  color: var(--muted); font-weight: 600; font-size: 0.76rem;
}

.rf-options { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
.rf-opt { position: relative; cursor: pointer; }
.rf-opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.rf-opt span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 62px;
  padding: 8px 6px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: center;
  line-height: 1.2;
}
.rf-opt span svg { width: 18px; height: 18px; }
.rf-opt.tone-positive span { color: var(--open-ink); border-color: rgba(18, 153, 106, 0.34); background: rgba(18, 153, 106, 0.04); }
.rf-opt.tone-negative span { color: var(--closed-ink); border-color: rgba(214, 64, 39, 0.3); background: rgba(214, 64, 39, 0.035); }
.rf-opt.tone-caution span { color: var(--warn-ink); border-color: rgba(154, 91, 18, 0.3); background: rgba(154, 91, 18, 0.04); }
.rf-opt.tone-neutral span { color: var(--muted); background: var(--surface-2); }
.rf-opt.tone-positive input:hover + span { border-color: var(--open); }
.rf-opt.tone-negative input:hover + span { border-color: var(--closed); }
.rf-opt.tone-caution input:hover + span { border-color: var(--warn-ink); }
.rf-opt.tone-neutral input:hover + span { border-color: var(--muted); }
.rf-opt.tone-positive input:checked + span { border-color: var(--open-ink); background: var(--open-ink); color: #fff; }
.rf-opt.tone-negative input:checked + span { border-color: var(--closed-ink); background: var(--closed-ink); color: #fff; }
.rf-opt.tone-caution input:checked + span { border-color: var(--warn-ink); background: var(--warn-ink); color: #fff; }
.rf-opt.tone-neutral input:checked + span { border-color: var(--muted); background: var(--muted); color: #fff; }
.rf-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.rf-pw { display: grid; gap: 6px; margin-top: 2px; }
.rf-pw label { font-size: 0.8rem; color: var(--ink-soft); font-weight: 650; }
.rf-pw input,
.report-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  outline: 0;
  resize: vertical;
}
.rf-pw input:focus,
.report-form textarea:focus { border-color: var(--brand); background: #fff; }

.rf-note-label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 730; }
.rf-count { justify-self: end; color: var(--faint); font-size: 0.74rem; }

.rf-error { margin: 0; color: var(--danger); font-size: 0.8rem; font-weight: 650; }

.geo {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.4;
  border: 1px solid var(--line);
}
.geo svg { width: 16px; height: 16px; flex: 0 0 auto; }
.geo.ok { background: rgba(18, 153, 106, 0.08); border-color: rgba(18, 153, 106, 0.28); color: var(--open-ink); }
.geo.off { background: var(--surface-2); color: var(--muted); }
.geo.pending { background: var(--surface-2); color: var(--muted); }
.geo.pending svg { animation: spin 1s linear infinite; }

.rf-actions { display: grid; gap: 9px; }
.rf-actions .btn { width: 100%; }

/* -------------------------------------------------------------------------- */
/* Report success                                                             */
/* -------------------------------------------------------------------------- */

.report-success { gap: 16px; }
.success-hero {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 22px 16px;
  border: 1px solid rgba(18, 153, 106, 0.28);
  border-radius: 8px;
  background: rgba(18, 153, 106, 0.08);
  text-align: center;
}
.success-hero > svg { width: 34px; height: 34px; color: var(--open-ink); }
.success-hero h2 { margin: 2px 0 0; font-size: 1.1rem; }
.success-hero p { margin: 0; color: var(--ink-soft); font-size: 0.86rem; line-height: 1.45; max-width: 32ch; }
.success-time { color: var(--muted); font-size: 0.78rem; }
.success-place { color: var(--ink); font-weight: 730; font-size: 0.9rem; }
.report-success > .btn { width: 100%; }

/* -------------------------------------------------------------------------- */
/* Toast                                                                      */
/* -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 950;
  max-width: min(92vw, 420px);
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(16, 30, 42, 0.96);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 650;
  text-align: center;
  box-shadow: var(--shadow-2);
  animation: pop 0.18s ease;
}

/* -------------------------------------------------------------------------- */
/* Mobile — bottom sheet (matches JS isMobile() max-width: 760px)             */
/* -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
    overflow: hidden;
    transition: height 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  }

  /* Peek keeps the map visible; only the view switch + toggle show. */
  .panel[data-sheet="peek"] { height: var(--sheet-peek); }
  .panel[data-sheet="expanded"] { height: 88dvh; }

  /* Explicit Map / List segmented control (always reachable at sheet top). */
  .mobile-view-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    flex: 0 0 auto;
    margin: 10px 16px 4px;
    padding: 4px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-2);
  }
  .view-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
  }
  .view-mode svg { width: 17px; height: 17px; }
  .view-mode[aria-pressed="true"] {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-1);
  }

  /* Sheet toggle: switches expanded / collapsed (no drag handle needed). */
  .sheet-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
    margin: 0 16px 6px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--brand);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
  }
  .sheet-toggle svg { width: 18px; height: 18px; transition: transform 0.2s ease; }
  .sheet-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .sheet-toggle__label { line-height: 1; }

  .map-tools { bottom: calc(var(--sheet-peek) + 16px); }
  .legend { top: 12px; right: 12px; width: 190px; }
  .search-area { top: 14px; left: 50%; }

  .near-me { min-height: 52px; }
  .chip { min-height: var(--tap); }
  .btn { min-height: 48px; }

  .detail { padding-bottom: 32px; }

  /* Three-column option grid stays tappable on narrow phones. */
  .rf-opt span { min-height: 64px; }
}

@media (max-width: 390px) {
  .triage .chip span { font-size: 0.8rem; }
  .rf-options { gap: 6px; }
  .rf-opt span { font-size: 0.72rem; padding: 8px 4px; }
  .detail-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .search-area, .toast, .sk-row,
  .near-me.is-busy svg, .btn.is-busy svg, .geo.pending svg,
  .sheet-toggle svg, .wc-pin {
    animation: none !important;
    transition: none !important;
  }
}

/* ========================================================================== */
/* 2026 rebuild: answer first, explore only after a map gesture               */
/* ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-dock {
  position: absolute;
  top: 16px;
  left: 16px;
  width: var(--rail-w);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(8px);
}

.search-dock .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.search-dock .search-box {
  min-height: 42px;
  background: #fff;
}

.locate {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
}
.locate svg { width: 20px; height: 20px; }
.locate:hover,
.locate.is-active { color: #fff; border-color: var(--brand); background: var(--brand); }

.search-dock .triage {
  grid-column: 1 / -1;
  margin: 0 -12px -1px;
  padding: 1px 12px;
}

.search-area {
  top: 132px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 38, 58, 0.28);
}
.search-area:hover { background: var(--brand-ink); }

.panel {
  top: 142px;
  bottom: auto;
  height: 326px;
  border-radius: 8px;
  transition: height 0.24s cubic-bezier(0.32, 0.72, 0, 1);
}
.panel[data-mode="list"][data-experience="explore"] { height: 354px; }
.panel[data-mode="detail"],
.panel[data-mode="report"] { bottom: 16px; height: auto; }

.sheet-handle {
  display: none;
  flex: 0 0 auto;
  width: 34px;
  height: 4px;
  margin: 10px auto 2px;
  border-radius: 999px;
  background: var(--line-strong);
}

.list-meta {
  padding: 14px 16px 8px;
}
.list-meta strong { font-size: 0.82rem; color: var(--ink-soft); }

.answer-card {
  display: grid;
  gap: 11px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--none);
  border-radius: 8px;
  background: var(--surface);
}
.answer-card.st-open { border-left-color: var(--open); }
.answer-card.st-closed { border-left-color: var(--closed); }
.answer-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--open-ink);
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
}
.answer-kicker span { display: inline-flex; align-items: center; gap: 6px; }
.answer-kicker svg { width: 14px; height: 14px; }
.answer-kicker strong { color: var(--brand); font-size: 0.92rem; }
.answer-kicker strong { text-transform: none; }
.answer-title { min-width: 0; }
.answer-title h2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.answer-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.answer-signal {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}
.answer-signal.st-open { color: var(--open-ink); }
.answer-signal.st-closed { color: var(--closed-ink); }
.answer-signal .pill-dot { background: currentColor; }
.answer-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.answer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
}
.answer-actions .btn { min-height: 48px; }
.btn-icon { padding: 0; }
.backup-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.backup-link svg { width: 15px; height: 15px; }

.panel[data-experience="explore"] .results {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0 16px 18px;
}
.panel[data-experience="explore"] .results::-webkit-scrollbar { display: none; }
.panel[data-experience="explore"] .result {
  flex: 0 0 330px;
  min-height: 218px;
  scroll-snap-align: start;
  align-content: start;
}
.panel[data-experience="explore"] .result-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 760px) {
  .search-dock {
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    width: auto;
    grid-template-columns: 38px minmax(0, 1fr) 42px;
    gap: 8px;
    padding: 10px;
  }
  .search-dock .brand-mark { width: 38px; height: 38px; }
  .search-dock .search-box { min-height: 42px; }
  .locate { width: 42px; height: 42px; }
  .search-dock .triage { margin: 0 -10px -1px; padding: 1px 10px; }
  .search-dock .chip { min-height: 38px; padding: 0 11px; }

  .search-area { top: max(128px, calc(env(safe-area-inset-top) + 118px)); }

  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(334px, 42dvh);
    max-width: none;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }
  .panel[data-mode="list"][data-experience="explore"] { height: min(294px, 37dvh); }
  .panel[data-mode="detail"],
  .panel[data-mode="report"] { bottom: 0; height: 84dvh; }
  .sheet-handle { display: block; }
  .list-meta { padding: 9px 16px 7px; }
  .results { padding: 0 14px 16px; }
  .answer-card { gap: 9px; padding: 13px 14px; }
  .answer-title h2 { font-size: 1.04rem; }
  .backup-link { min-height: 28px; }

  .panel[data-experience="explore"] .results { padding: 0 14px 16px; }
  .panel[data-experience="explore"] .result {
    flex-basis: min(84vw, 336px);
    min-height: 205px;
  }

  .detail { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .search-dock { grid-template-columns: 36px minmax(0, 1fr) 40px; }
  .search-dock .brand-mark { width: 36px; height: 36px; }
  .locate { width: 40px; height: 40px; }
  .search-box input { font-size: 0.86rem; }
  .panel { height: min(340px, 45dvh); }
}

/* ========================================================================== */
/* Nearest-two flow                                                           */
/* ========================================================================== */

.route-header {
  position: absolute;
  top: 16px;
  left: 16px;
  width: var(--rail-w);
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(8px);
}

.home-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}
.home-header .brand-mark { width: 44px; height: 44px; }
.home-header__copy,
.route-place__copy { min-width: 0; display: grid; gap: 2px; }
.home-header__copy strong { font-size: 1rem; }
.home-header__copy small,
.route-place__copy small { color: var(--muted); font-size: 0.72rem; }

.landing-ad-header {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.landing-ad-link {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}
.landing-ad-link > img {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}
.landing-ad-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.landing-ad-copy small {
  overflow: hidden;
  color: var(--faint);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.landing-ad-copy strong {
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.landing-ad-link > svg { width: 15px; height: 15px; color: var(--muted); }
.landing-ad-link:hover .landing-ad-copy strong,
.landing-ad-link:focus-visible .landing-ad-copy strong { color: var(--focus); }

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, 26px);
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
}
.language-switch button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  cursor: pointer;
}
.language-switch button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}

.route-place {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}
.route-rank,
.nearest-rank {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 850;
}
.route-rank { width: 38px; height: 38px; font-size: 1rem; }
.route-place__copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}
.route-walk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.route-walk:hover { background: var(--brand-ink); }
.route-walk svg { width: 17px; height: 17px; }

.panel {
  top: 96px;
}
.panel[data-mode="list"][data-experience="start"] { height: 220px; }
.panel[data-mode="list"][data-experience="nearest"] { height: 350px; }
.panel[data-mode="list"][data-experience="explore"] { height: 354px; }

.start-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 14px 16px 18px;
  text-align: center;
}
.panel[data-experience="start"] .list-meta { display: none; }
.start-card__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(16, 38, 58, 0.08);
  color: var(--brand);
}
.start-card__icon svg { width: 21px; height: 21px; }
.start-card__copy h2 { margin: 0; font-size: 1.05rem; }
.start-card__copy p {
  max-width: 34ch;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
.find-nearest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 38, 58, 0.22);
}
.find-nearest svg { width: 19px; height: 19px; }
.find-nearest:disabled { opacity: 0.72; cursor: progress; }
.find-nearest:disabled svg { animation: spin 0.9s linear infinite; }

.panel[data-experience="nearest"] .results {
  display: grid;
  gap: 8px;
  padding: 0 12px 16px;
}
.nearest-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-left: 4px solid var(--none);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.nearest-option.st-open { border-left-color: var(--open); }
.nearest-option.st-closed { border-left-color: var(--closed); }
.nearest-option.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(16, 38, 58, 0.1);
}
.nearest-option.st-open.is-selected { border-left-color: var(--open); }
.nearest-option.st-closed.is-selected { border-left-color: var(--closed); }
.nearest-option.st-none.is-selected { border-left-color: var(--none); }
.nearest-select {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 8px 9px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.nearest-rank { width: 34px; height: 34px; font-size: 0.76rem; }
.nearest-copy { min-width: 0; display: grid; gap: 3px; }
.nearest-top { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.nearest-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}
.nearest-top b { flex: 0 0 auto; color: var(--brand); font-size: 0.78rem; }
.nearest-ko {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 650;
}
.nearest-signal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  justify-self: start;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 760;
}
.nearest-signal.st-open { color: var(--open-ink); border-color: rgba(18, 153, 106, 0.32); background: rgba(18, 153, 106, 0.11); }
.nearest-signal.st-closed { color: var(--closed-ink); border-color: rgba(214, 64, 39, 0.3); background: rgba(214, 64, 39, 0.1); }
.nearest-detail {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 72px;
  padding: 0 5px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--brand);
  font-size: 0.66rem;
  font-weight: 800;
  cursor: pointer;
}
.nearest-detail svg { width: 17px; height: 17px; }
.nearest-detail:hover,
.nearest-detail:focus-visible { background: rgba(16, 38, 58, 0.1); }

.nearest-ad-slot {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.nearest-ad-slot:hover,
.nearest-ad-slot:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(16, 38, 58, 0.08);
}
.nearest-ad-slot > img {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}
.nearest-ad-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.nearest-ad-copy small {
  color: var(--faint);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.nearest-ad-copy strong {
  font-size: 0.8rem;
  line-height: 1.3;
}
.nearest-ad-slot > svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.nearest-ad-slot--compact {
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  gap: 9px;
  min-height: 56px;
  padding: 7px 10px;
}
.nearest-ad-slot--compact > img {
  width: 40px;
  height: 40px;
}
.nearest-ad-slot--compact .nearest-ad-copy { gap: 2px; }
.nearest-ad-slot--compact .nearest-ad-copy strong { font-size: 0.74rem; }
.nearest-ad-slot--compact > svg { width: 15px; height: 15px; }
.start-card > .nearest-ad-slot { width: 100%; margin-top: 2px; text-align: left; }

.rank-pin {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 3px;
  transform: rotate(45deg);
  background: var(--none);
  color: #fff;
  box-shadow: 0 4px 10px rgba(15, 28, 24, 0.36);
  transition: transform 0.15s ease;
}
.rank-pin span { transform: rotate(-45deg); font-size: 0.76rem; font-weight: 900; }
.rank-pin.st-open { background: var(--open-ink); }
.rank-pin.st-closed { background: var(--closed-ink); }
.rank-pin.is-selected {
  transform: rotate(45deg) scale(1.24);
  border-color: #fff;
  box-shadow: 0 0 0 4px var(--brand), 0 5px 14px rgba(15, 28, 24, 0.42);
}

.search-area { top: 100px; }

@media (max-width: 760px) {
  .route-header {
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    width: auto;
    min-height: 68px;
    padding: 9px 10px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
  }
  .home-header { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .home-header .brand-mark { width: 42px; height: 42px; }
  .route-place { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; }
  .route-rank { width: 36px; height: 36px; }
  .route-walk { min-height: 46px; padding: 0 10px; }
  .language-switch { grid-template-columns: repeat(3, 23px); }
  .language-switch button { width: 23px; height: 26px; font-size: 0.62rem; }

  .search-area { top: max(88px, calc(env(safe-area-inset-top) + 78px)); }

  .locate-me {
    right: 14px;
    bottom: calc(min(294px, 37dvh) + 14px);
  }
  .app[data-experience="start"] .locate-me {
    bottom: calc(min(214px, 28dvh) + 14px);
  }
  .app[data-experience="nearest"] .locate-me {
    bottom: calc(min(350px, calc(100dvh - 110px)) + 14px);
  }

  .panel { top: auto; }

  .panel[data-mode="list"][data-experience="start"] { height: min(214px, 28dvh); }
  .panel[data-mode="list"][data-experience="nearest"] { height: min(350px, calc(100dvh - 110px)); }
  .panel[data-mode="list"][data-experience="explore"] { height: min(294px, 37dvh); }

  .start-card { gap: 6px; padding: 6px 14px 7px; }
  .start-card__icon { width: 36px; height: 36px; }
  .find-nearest { min-height: 50px; }
}

@media (max-width: 380px) {
  .route-walk span { display: none; }
  .route-walk { width: 48px; padding: 0; }
  .language-switch { grid-template-columns: repeat(3, 22px); }
  .language-switch button { width: 22px; }
  .panel[data-mode="list"][data-experience="nearest"] { height: min(340px, calc(100dvh - 110px)); }
  .app[data-experience="nearest"] .locate-me {
    bottom: calc(min(340px, calc(100dvh - 110px)) + 14px);
  }
  .nearest-option { grid-template-columns: minmax(0, 1fr) 64px; }
  .nearest-detail { width: 64px; }
}
