:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --stage-pad: 18px;
  --topbar-gap: 14px;
  --route-sheet-max-h: min(560px, calc(100dvh - 120px));
  --bg: #eef2f7;
  --bg-grad-1: #e3ecf6;
  --bg-grad-2: #f6f8fc;
  --map-bg: #f1f5f9;
  --surface: #ffffff;
  --surface-90: rgba(255, 255, 255, 0.92);
  --surface-70: rgba(255, 255, 255, 0.78);
  --surface-soft: #f5f7fb;
  --surface-tint: #eef3ff;
  --ink: #0b1530;
  --ink-soft: #4a5874;
  --ink-muted: #8593af;
  --line: rgba(11, 21, 48, 0.08);
  --line-strong: rgba(11, 21, 48, 0.14);
  --brand-dark: #1b2f56;
  --brand-light: #7ca8d8;
  --brand-soft-bg: #f0f6fc;
  --accent-orange: #f58232;
  --accent-orange-light: #fff3ec;
  --brand: #7ca8d8;
  --brand-deep: #1b2f56;
  --brand-soft: #f0f6fc;
  --brand-tint: rgba(124, 168, 216, 0.18);
  --route-brand-glow: rgba(124, 168, 216, 0.42);
  --route: #f58232;
  --route-deep: #d96a1f;
  --route-glow: rgba(245, 130, 50, 0.28);
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 18px 44px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 32px 80px rgba(15, 23, 42, 0.22), 0 6px 16px rgba(15, 23, 42, 0.08);
  --shadow-color: 0 14px 32px rgba(29, 78, 216, 0.22);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.46, 0.64, 1);
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-hairline: rgba(11, 21, 48, 0.06);
  --glass-blur: blur(26px) saturate(170%);
  --glass-blur-sm: blur(14px) saturate(150%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow: hidden;
  touch-action: manipulation;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button,
input {
  outline: none;
}

button {
  cursor: pointer;
  border: 0;
  background: transparent;
}

button:focus-visible,
input:focus-visible {
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.22);
  outline: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: currentColor;
}

.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;
}

.app-shell,
.map-stage {
  width: 100%;
  height: 100dvh;
  height: 100svh;
  min-height: 0;
}

.map-stage {
  position: relative;
  padding: var(--stage-pad);
  padding-top: calc(var(--stage-pad) + var(--safe-top));
  padding-right: calc(var(--stage-pad) + var(--safe-right));
  padding-bottom: calc(var(--stage-pad) + var(--safe-bottom));
  padding-left: calc(var(--stage-pad) + var(--safe-left));
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(124, 154, 215, 0.18), transparent 60%),
    radial-gradient(90% 90% at 100% 100%, rgba(249, 115, 22, 0.08), transparent 60%),
    linear-gradient(160deg, var(--bg-grad-2) 0%, var(--bg-grad-1) 100%);
}

.map-frame {
  position: absolute;
  top: calc(var(--stage-pad) + var(--safe-top));
  right: calc(var(--stage-pad) + var(--safe-right));
  bottom: calc(var(--stage-pad) + var(--safe-bottom));
  left: calc(var(--stage-pad) + var(--safe-left));
  overflow: hidden;
  border: 1px solid rgba(11, 21, 48, 0.08);
  border-radius: 26px;
  background: #a8b0b8;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.map-haze {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: transparent;
  opacity: 0;
}

.map-root {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.6) 60%, rgba(241, 245, 249, 0.3)),
    var(--map-bg);
}

.map-root svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.map-status {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(241, 245, 249, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.map-status[hidden] {
  display: none !important;
}

.map-status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 320px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid rgba(11, 21, 48, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.map-status-card p {
  margin: 0;
  color: var(--ink-700, #334155);
  font-size: 0.98rem;
  line-height: 1.45;
}

.map-status-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(11, 21, 48, 0.12);
  border-top-color: var(--brand-600, #1d4ed8);
  animation: map-status-spin 0.8s linear infinite;
}

.map-status.is-error .map-status-spinner {
  display: none;
}

.map-status-retry {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--brand-600, #1d4ed8);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.map-status-retry:hover {
  filter: brightness(1.05);
}

@keyframes map-status-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Topbar ──────────────────────────────────────────────────────────── */

.topbar {
  position: absolute;
  top: calc(24px + var(--safe-top));
  left: calc(24px + var(--safe-left));
  right: calc(24px + var(--safe-right));
  z-index: 40;
  display: flex;
  align-items: flex-start;
  gap: var(--topbar-gap);
  pointer-events: none;
}

.brand-lockup,
.search-header-card,
.search-stack,
.tool-dock,
.hint-bubble,
.floating-sheet,
.floating-card,
.suggestions {
  pointer-events: auto;
}

.floating-card {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 24px 48px rgba(27, 47, 86, 0.12), 0 2px 8px rgba(27, 47, 86, 0.06);
  overflow: hidden;
}

.search-header-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  flex: 1 1 auto;
  max-width: min(760px, 100%);
  padding: 12px 16px;
  overflow: visible;
  animation: float-in 0.28s var(--ease-out);
  transition: padding 0.22s var(--ease-out), gap 0.22s var(--ease-out);
}

.search-header-card.is-collapsed {
  gap: 0;
  padding-bottom: 10px;
}

.search-header-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
}

.search-header-actions {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.search-header-actions-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(245, 247, 251, 0.92);
  border: 1px solid rgba(11, 21, 48, 0.06);
}

.search-panel-body[hidden] {
  display: none;
}

.search-panel-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass-bg);
  color: var(--ink-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  transition: transform 0.2s var(--ease-out), background 0.16s, color 0.16s;
}

.search-panel-toggle:hover {
  background: #fff;
  color: var(--brand-deep);
}

.search-header-card.is-collapsed .search-panel-toggle .icon {
  transform: rotate(180deg);
}

.travel-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 8px rgba(15, 23, 42, 0.05);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
}

.travel-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(10, 22, 51, 0.72);
  font: 600 12px/1 "Figtree", sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.travel-mode-btn .icon {
  width: 16px;
  height: 16px;
}

.travel-mode-btn.is-active {
  background: var(--brand-deep);
  color: #fff;
  box-shadow: 0 6px 16px rgba(27, 47, 86, 0.28);
}

.home-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(10, 22, 51, 0.1);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-deep);
  font: 600 12px/1 "Figtree", sans-serif;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, transform 0.16s var(--ease-out);
}

.home-back-btn:hover {
  background: var(--surface-tint);
  border-color: rgba(124, 168, 216, 0.45);
  transform: translateY(-1px);
}

.home-back-btn .icon {
  width: 16px;
  height: 16px;
}

.search-header-card.floating-card {
  border-radius: 28px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 8px rgba(15, 23, 42, 0.05);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  flex-shrink: 0;
}

.lang-switch-btn {
  min-width: 40px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(10, 22, 51, 0.72);
  font: 600 12px/1 "Figtree", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lang-switch-btn.is-active {
  background: #0a1633;
  color: #fff;
  box-shadow: 0 6px 16px rgba(10, 22, 51, 0.28);
}

.lang-switch-btn:focus-visible {
  outline: 2px solid #4f8cff;
  outline-offset: 2px;
}

.search-header-lead {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 0 1 auto;
  min-width: 0;
}

.search-header-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 2px 4px 2px 2px;
  text-decoration: none;
  color: inherit;
}

.search-header-divider {
  display: none;
}

.glass-field {
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.glass-field:focus-within {
  border-color: rgba(124, 168, 216, 0.55);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(124, 168, 216, 0.18);
}

.glass-field:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(124, 168, 216, 0.45);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-90);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 40px;
  max-width: min(200px, 36vw);
  object-fit: contain;
  object-position: left center;
}

.search-header-card .brand-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(200px, 32vw);
  object-fit: contain;
  object-position: left center;
}

/* ── Search Stack (trip planner) ─────────────────────────────────────── */

.search-stack {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
}

.trip-planner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.planner-field,
.planner-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 52px;
  padding: 10px 16px;
  border-radius: 16px;
}

.planner-start {
  text-align: left;
  color: var(--ink);
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.planner-start:hover {
  background: rgba(255, 255, 255, 0.78);
}

.planner-swap {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin: 0 -6px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass-strong);
  color: var(--brand-light);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 14px rgba(27, 47, 86, 0.1);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  z-index: 2;
  transition: transform 0.18s var(--ease-out), color 0.16s, box-shadow 0.16s;
}

.planner-swap:hover {
  color: var(--brand-deep);
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(27, 47, 86, 0.14);
}

.planner-swap .icon {
  width: 16px;
  height: 16px;
}

.planner-dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.planner-dot.start {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.planner-dot.start::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.planner-dot.end {
  background: transparent;
  border: 2px solid var(--route);
  color: var(--route);
  box-shadow: none;
}

.planner-dot.end svg {
  display: block;
}

.planner-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
  flex: 1 1 auto;
}

.planner-label {
  color: var(--brand-light);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.planner-destination-hit {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.planner-destination-hit:hover .planner-label,
.planner-destination-hit:focus-visible .planner-label {
  color: var(--brand-deep);
}

.planner-destination-hit:focus-visible {
  outline: 2px solid rgba(124, 168, 216, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

.planner-text strong {
  margin-top: 2px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-destination .search-input-wrap {
  margin-top: 2px;
}

.planner-destination #store-search {
  height: auto;
  min-height: 24px;
  padding: 0 36px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-deep);
}

.planner-end {
  padding-right: 10px;
  cursor: pointer;
}

.planner-end:has(#store-search:focus) {
  cursor: text;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.search-leading {
  position: absolute;
  left: 14px;
  color: var(--ink-muted);
  pointer-events: none;
}

#store-search,
#start-search,
#destination-search {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
}

#store-search::placeholder,
#start-search::placeholder,
#destination-search::placeholder {
  color: var(--ink-muted);
  font-weight: 500;
}

.search-clear {
  position: absolute;
  right: 0;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.16);
  color: var(--ink-muted);
  transition: background 0.16s, color 0.16s;
}

.search-clear:hover {
  background: rgba(148, 163, 184, 0.28);
  color: var(--brand-deep);
}

.planner-destination .search-clear .icon {
  width: 14px;
  height: 14px;
}

.modal-search {
  margin-top: 16px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.modal-search:focus-within {
  border-color: rgba(124, 168, 216, 0.55);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(124, 168, 216, 0.18);
}

.modal-search .search-leading {
  left: 14px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.modal-search input {
  min-width: 0;
  box-sizing: border-box;
}

/* ── Suggestions ─────────────────────────────────────────────────────── */

.suggestions,
.start-options,
.route-steps-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.suggestions {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  max-height: min(440px, 58vh);
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.suggestions.visible {
  display: grid;
  gap: 4px;
  animation: float-in 0.22s var(--ease-out);
}

.suggestions li button {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background 0.16s, border-color 0.16s, transform 0.16s var(--ease-out);
}

.start-options button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background 0.16s, border-color 0.16s, transform 0.16s var(--ease-out);
}

.suggestions li button .cat-chip {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.suggestions li button strong,
.start-options button strong {
  display: block;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}

.suggestion-meta {
  display: block;
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.start-option-copy {
  min-width: 0;
}

.start-options button .start-option-category {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.suggestions li button .chev,
.start-options button .chev {
  color: var(--ink-muted);
  width: 16px;
  height: 16px;
  transition: transform 0.16s var(--ease-out), color 0.16s;
}

.suggestions li button.active,
.suggestions li button:hover,
.start-options button.active,
.start-options button:hover {
  background: var(--surface-tint);
  border-color: rgba(29, 78, 216, 0.15);
}

.suggestions li button.active .chev,
.suggestions li button:hover .chev,
.start-options button.active .chev,
.start-options button:hover .chev {
  transform: translateX(3px);
  color: var(--brand);
}

/* ── Category chips ──────────────────────────────────────────────────── */

.cat-chip {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-tint);
  color: var(--brand);
  flex: 0 0 auto;
}

.cat-chip[data-category="dining"] { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.cat-chip[data-category="wellness"] { background: rgba(16, 185, 129, 0.14); color: #047857; }
.cat-chip[data-category="fashion"] { background: rgba(29, 78, 216, 0.12); color: #1e3a8a; }
.cat-chip[data-category="consulting"] { background: rgba(100, 116, 139, 0.16); color: #334155; }
.cat-chip[data-category="shops"] { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.cat-chip[data-category="food"] { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.cat-chip[data-category="cafe"] { background: rgba(217, 119, 6, 0.14); color: #92400e; }
.cat-chip[data-category="retail"] { background: rgba(29, 78, 216, 0.12); color: #1e3a8a; }
.cat-chip[data-category="health"] { background: rgba(16, 185, 129, 0.14); color: #047857; }
.cat-chip[data-category="service"] { background: rgba(100, 116, 139, 0.16); color: #334155; }
.cat-chip[data-category="beauty"] { background: rgba(236, 72, 153, 0.14); color: #be185d; }
.cat-chip[data-category="market"] { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.cat-chip[data-category="showroom"] { background: rgba(99, 102, 241, 0.14); color: #4338ca; }
.cat-chip[data-category="pharmacy"] { background: rgba(20, 184, 166, 0.16); color: #0f766e; }

.start-pin {
  display: inline-grid;
  place-items: center;
  background: var(--brand-tint);
  color: var(--brand);
  flex: 0 0 auto;
}

/* ── Tool dock ───────────────────────────────────────────────────────── */

.tool-dock {
  position: absolute;
  right: calc(30px + var(--safe-right));
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-90);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-md);
}

.tool-dock button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  transition: background 0.16s, color 0.16s, transform 0.18s var(--ease-out);
}

.tool-dock button:hover {
  background: var(--surface-tint);
  color: var(--brand);
  transform: translateY(-1px);
}

.tool-dock .icon {
  width: 20px;
  height: 20px;
}

/* ── Hint bubble ─────────────────────────────────────────────────────── */

.hint-bubble {
  position: absolute;
  left: 50%;
  top: 180px;
  z-index: 28;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-90);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-sm);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
  transform: translateX(-50%);
  transition: opacity 0.2s, transform 0.2s;
}

.hint-bubble[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
}

.map-stage:has(.search-header-card.is-collapsed) .hint-bubble {
  top: 116px;
}

.hint-bubble .icon {
  color: var(--route);
}

/* ── SVG layer behavior. Visual colors/type come from yedimavimap.svg. ── */

.map-root svg .store-polygon {
  cursor: pointer;
  transition: filter 0.18s var(--ease-out), stroke 0.18s;
  vector-effect: non-scaling-stroke;
}

.map-root svg .store-polygon.store-hover {
  filter: brightness(1.04) saturate(1.04);
}

.map-root svg .store-polygon.store-selected {
  filter: brightness(1.05) saturate(1.08);
  stroke-width: 2;
}

.map-root svg #Storelabels[data-label-source="svg"] text,
.map-root svg #Storelabels[data-label-source="svg"] tspan {
  pointer-events: none;
  user-select: none;
}

.map-root svg .store-label,
.map-root svg #Storelabels:not([data-label-source="svg"]) text,
.map-root svg #Storelabels:not([data-label-source="svg"]) tspan {
  text-anchor: middle;
  dominant-baseline: central;
}

.map-root svg .store-label-group {
  pointer-events: none;
}

.map-root svg #entries {
  opacity: 0;
  pointer-events: none;
}

#route_x5F_nodes,
#route_x5F_guides {
  opacity: 0;
}

#Storelabels,
#Storelabels *,
#entries,
#entries *,
#route_x5F_nodes,
#route_x5F_nodes *,
#route_x5F_guides,
#route_x5F_guides *,
#no_x5F_access,
#no_x5F_access *,
#logo {
  pointer-events: none;
}

/* ── Start points ────────────────────────────────────────────────────── */

.start-point-group {
  cursor: pointer;
}

.start-point-halo,
.start-point-dot,
.start-point-pill,
.start-point-text {
  vector-effect: non-scaling-stroke;
}

.start-point-halo {
  display: none;
}

.start-point-dot {
  fill: #ffffff;
  stroke: var(--brand-deep);
  stroke-width: 2.4;
  transition: fill 0.18s, stroke 0.18s;
}

.start-point-pill {
  fill: rgba(255, 255, 255, 0.98);
  stroke: rgba(11, 21, 48, 0.12);
  stroke-width: 1;
}

.start-point-text {
  fill: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.start-point-group:hover .start-point-dot,
.start-point-group.is-active .start-point-dot {
  fill: var(--brand);
  stroke: var(--brand-deep);
}

/* ── Route render ────────────────────────────────────────────────────── */

.route-glow,
.route-trace,
.route-shell,
.route-dots {
  fill: none;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.route-glow {
  stroke: var(--brand-light);
  stroke-width: 28;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.38;
  filter: blur(10px);
}

.route-trace {
  stroke: var(--brand-soft);
  stroke-width: 18;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px var(--route-brand-glow));
}

.route-shell {
  stroke: #fff;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
  filter: drop-shadow(0 2px 10px rgba(124, 168, 216, 0.35));
}

.route-dots {
  stroke: var(--brand-light);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 0 16;
  filter: drop-shadow(0 0 8px rgba(124, 168, 216, 0.65));
}

.animate-route-dots {
  animation: route-dots 1s linear infinite;
}

@keyframes route-dots {
  to {
    stroke-dashoffset: -16;
  }
}

.route-mode-drive .route-glow {
  stroke: #64748b;
  opacity: 0.28;
}

.route-mode-drive .route-trace {
  stroke: #cbd5e1;
  filter: drop-shadow(0 0 8px rgba(100, 116, 139, 0.25));
}

.route-mode-drive .route-shell {
  stroke: #fff;
  filter: drop-shadow(0 2px 8px rgba(71, 85, 105, 0.28));
}

.route-mode-drive .route-dots {
  stroke: #475569;
  stroke-width: 9;
  stroke-dasharray: 0 18;
  filter: none;
}

.map-stage.travel-mode-drive .map-root {
  filter: saturate(0.92) contrast(1.02);
}

.map-stage.travel-mode-walk .map-root {
  filter: saturate(1.02);
}

.route-marker-start,
.route-marker-end {
  vector-effect: non-scaling-stroke;
}

.route-marker-start .core {
  fill: var(--brand);
  stroke: #fff;
  stroke-width: 2;
}

.route-marker-end .pin-shadow {
  fill: rgba(11, 21, 48, 0.22);
  filter: blur(2px);
}

.route-marker-end .pin-body {
  fill: var(--route);
  stroke: #fff;
  stroke-width: 2;
}

.route-marker-end .pin-dot {
  fill: #fff;
}

.route-journey-marker {
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.route-journey-marker .journey-core {
  fill: var(--ok);
  stroke: #fff;
  stroke-width: 2.8;
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.45));
}

/* ── Floating sheets ─────────────────────────────────────────────────── */

.floating-sheet {
  position: absolute;
  z-index: 32;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-90);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-lg);
  animation: sheet-in 0.32s var(--ease-spring);
}

.floating-sheet[hidden],
.floating-card[hidden],
.modal[hidden] {
  display: none;
}

.sheet-handle {
  display: none;
  margin: -6px auto 12px;
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(11, 21, 48, 0.16);
}

#store-sheet {
  display: none !important;
}

.store-sheet {
  left: calc(30px + var(--safe-left));
  bottom: calc(30px + var(--safe-bottom));
  width: min(340px, calc(100% - 60px - var(--safe-left) - var(--safe-right)));
  padding: 16px;
}

.route-sheet {
  position: absolute;
  z-index: 32;
  left: calc(30px + var(--safe-left));
  bottom: calc(30px + var(--safe-bottom));
  top: auto;
  width: min(360px, calc(100% - 60px - var(--safe-left) - var(--safe-right)));
  max-height: var(--route-sheet-max-h);
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  animation: sheet-in 0.32s var(--ease-spring);
}

.route-sheet.floating-card {
  overflow: hidden;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.route-sheet-header {
  position: relative;
  flex: 0 0 auto;
  flex-shrink: 0;
  padding: 22px 22px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-deep) 0%, #2a4985 100%);
  overflow: hidden;
  isolation: isolate;
}

.route-sheet-header::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -18%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.route-sheet-header-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.route-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.route-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: route-pulse 1.6s ease-in-out infinite;
}

@keyframes route-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.route-close-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: background 0.16s;
}

.route-close-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.route-sheet-header h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.12);
}

.route-from-button {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.route-from-button:hover .route-from-label,
.route-from-button:focus-visible .route-from-label {
  color: rgba(255, 255, 255, 0.92);
}

.route-from-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 3px;
  border-radius: 8px;
}

.route-from-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

#route-from-label {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
}

.route-meta-pills {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.route-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.84rem;
  font-weight: 700;
}

.route-meta-pill .icon {
  width: 15px;
  height: 15px;
  opacity: 0.75;
}

.route-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0 4px;
  background: transparent;
  -webkit-overflow-scrolling: touch;
}

.route-status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 16px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--route);
  border-radius: 0 16px 16px 0;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--route);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 18px rgba(15, 23, 42, 0.06);
}

.route-status-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-orange-light);
  color: var(--route);
  flex-shrink: 0;
}

.route-status-icon .icon {
  width: 20px;
  height: 20px;
}

.route-status-label {
  margin: 0;
  color: var(--route);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.route-status-text {
  margin: 3px 0 0;
  color: var(--brand-deep);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.route-sheet .route-progress {
  margin: 12px 18px 0;
}

.route-steps-panel {
  padding: 12px 16px 16px;
}

.route-steps-panel.is-collapsed .route-steps-timeline {
  display: none;
}

.route-steps-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--brand-deep);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 18px rgba(15, 23, 42, 0.05);
  transition: background 0.16s, border-color 0.16s;
}

.route-steps-toggle:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(124, 168, 216, 0.4);
}

.route-steps-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-soft-bg);
  color: var(--brand-light);
  transition: background 0.16s, color 0.16s;
}

.route-steps-toggle:hover .route-steps-toggle-icon {
  background: var(--brand-light);
  color: #fff;
}

.route-steps-toggle .chev {
  color: var(--brand-light);
  transition: transform 0.2s var(--ease-out);
}

.route-steps-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.route-steps-toggle .steps-toggle-count {
  background: var(--brand-tint);
  color: var(--brand-deep);
}

.route-steps-timeline {
  position: relative;
  margin: 14px 0 0;
  padding: 0 0 0 8px;
  list-style: none;
}

.route-steps-timeline::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--ok) 0%, rgba(226, 232, 240, 0.95) 100%);
  border-radius: 999px;
}

.route-steps-timeline li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0 0 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.route-steps-timeline li:last-child {
  padding-bottom: 0;
}

.route-step-node {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-muted);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.route-step-node .icon {
  width: 14px;
  height: 14px;
}

.route-step-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}

.route-steps-timeline li.done .route-step-node {
  background: var(--ok);
  color: #fff;
}

.route-steps-timeline li.active .route-step-node {
  background: var(--brand-light);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(124, 168, 216, 0.22);
}

.route-step-card {
  flex: 1 1 auto;
  margin-top: -2px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 16px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s, transform 0.16s var(--ease-out);
}

.route-steps-timeline li:hover .route-step-card {
  border-color: rgba(124, 168, 216, 0.28);
}

.route-steps-timeline li.active .route-step-card {
  border-color: rgba(124, 168, 216, 0.45);
}

.route-step-text {
  margin: 0 0 8px;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--brand-deep);
}

.route-steps-timeline li.done .route-step-text {
  color: var(--ink-muted);
  text-decoration: line-through;
}

.route-step-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand-light);
  font-size: 0.74rem;
  font-weight: 700;
}

.route-step-meta .icon {
  width: 12px;
  height: 12px;
}

.route-sheet-footer {
  flex: 0 0 auto;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.42);
}

.route-footer-secondary {
  display: inline-grid;
  place-items: center;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--brand-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: background 0.16s;
}

.route-footer-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.88);
}

.route-footer-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 16px;
  background: var(--brand-light);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 28px rgba(124, 168, 216, 0.38);
  transition: background 0.16s, transform 0.16s var(--ease-out), box-shadow 0.16s;
}

.route-footer-primary:hover:not(:disabled) {
  background: var(--brand-deep);
  transform: translateY(-1px);
}

.route-footer-primary:disabled,
.route-footer-secondary:disabled {
  opacity: 0.5;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sheet-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sheet-eyebrow-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sheet-eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-eyebrow .icon {
  width: 14px;
  height: 14px;
}

.floating-sheet h2 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.sheet-subcopy {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 500;
}

.sheet-copy {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
  font-weight: 500;
}

.store-sheet .sheet-copy {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.sheet-actions button,
.btn-primary,
.btn-soft,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  transition: background 0.16s, color 0.16s, transform 0.16s var(--ease-out), box-shadow 0.18s;
}

.btn-primary {
  flex: 1 1 0;
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: var(--shadow-color);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(29, 78, 216, 0.32);
}

.btn-soft {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-soft:hover:not(:disabled) {
  background: var(--surface-tint);
  color: var(--brand);
}

.btn-ghost {
  flex: 1 1 0;
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  color: var(--brand);
  border-color: rgba(29, 78, 216, 0.18);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  transition: background 0.16s, color 0.16s;
  border: 1px solid var(--line);
}

.icon-button:hover {
  background: var(--surface-tint);
  color: var(--brand);
}

.store-sheet .sheet-actions button {
  flex: 1 1 0;
}

/* ── Route sheet body ────────────────────────────────────────────────── */

.route-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.route-top-row .icon-button {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.route-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.route-meta-line > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-sep {
  color: var(--ink-muted);
  opacity: 0.6;
}

.meta-from {
  color: var(--ink);
  font-weight: 700;
  max-width: 140px;
}

.meta-from > span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.meta-icon {
  width: 14px;
  height: 14px;
  color: var(--ink-muted);
}

.current-step-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff8f1, #fff1e6);
}

.current-step-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--route) 0%, var(--route-deep) 100%);
  color: #fff;
  box-shadow: 0 8px 18px var(--route-glow);
}

.current-step-icon .icon {
  width: 22px;
  height: 22px;
}

.step-index {
  margin: 0;
  color: var(--route-deep);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.current-step-body .step-copy {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.32;
}

.steps-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
  transition: background 0.16s, border-color 0.16s;
}

.steps-toggle:hover {
  background: var(--surface-tint);
  border-color: rgba(29, 78, 216, 0.18);
}

.steps-toggle .icon {
  color: var(--ink-muted);
  width: 16px;
  height: 16px;
}

.steps-toggle .chev {
  transition: transform 0.2s var(--ease-out);
}

.steps-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.steps-toggle-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
}

.route-progress {
  position: relative;
  height: 3px;
  margin: 10px 2px 2px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.route-progress span {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, var(--route) 0%, var(--route-deep) 100%);
  border-radius: 999px;
  transition: width 0.32s var(--ease-out);
}

.route-steps-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  margin: 8px 0 0;
  padding: 2px;
  border-radius: 14px;
  scrollbar-width: thin;
}

.route-steps-list[hidden] {
  display: none;
}

.route-steps-list li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, transform 0.16s var(--ease-out);
}

.route-steps-list li:hover {
  background: var(--surface-tint);
  border-color: rgba(29, 78, 216, 0.16);
}

.route-steps-list li.active {
  background: linear-gradient(135deg, #fff8f1, #fff1e6);
  border-color: rgba(249, 115, 22, 0.32);
}

.route-steps-list li.done {
  opacity: 0.55;
}

.route-steps-list li.done .step-turn-icon {
  background: var(--ok);
  color: #fff;
}

.step-turn-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.route-steps-list li.active .step-turn-icon {
  background: linear-gradient(135deg, var(--route) 0%, var(--route-deep) 100%);
  color: #fff;
}

.step-text {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.step-distance {
  color: var(--ink-muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.route-actions-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
  margin-top: 12px;
}

.route-actions-row button {
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.route-actions-row .btn-primary {
  flex: none;
}

.btn-ghost.compact,
.btn-soft.compact {
  flex: none;
  width: 44px;
  padding: 0;
}

/* ── Modals ──────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 21, 48, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: float-in 0.22s var(--ease-out);
}

.modal-card {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: min(560px, calc(100% - 32px));
  max-height: min(74dvh, 640px);
  padding: 22px;
  border-radius: 28px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transform: translateX(-50%);
  animation: sheet-in 0.32s var(--ease-spring);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#start-picker .modal-card,
#destination-picker .modal-card {
  top: 50%;
  bottom: auto;
  width: min(600px, calc(100% - 40px));
  max-height: min(82dvh, 680px);
  transform: translate(-50%, -50%);
  animation: modal-center-in 0.34s var(--ease-spring);
}

@keyframes modal-center-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 18px)) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.modal-head h2 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.start-category-block {
  margin-top: 18px;
  padding: 14px 14px 12px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.start-category-label {
  margin: 0 0 10px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.start-category-slider {
  display: block;
  align-items: center;
}

/* The flanking arrow buttons felt clunky; the row scrolls horizontally with
   soft fade edges instead. */
.start-category-nav {
  display: none;
}

.start-category-slider.can-scroll-prev .start-category-track::before,
.start-category-slider.can-scroll-next .start-category-track::after {
  opacity: 1;
}

.start-category-track {
  position: relative;
  min-width: 0;
}

.start-category-track::before,
.start-category-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.start-category-track::before {
  left: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.85) 30%, rgba(255, 255, 255, 0));
}

.start-category-track::after {
  right: 0;
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.85) 30%, rgba(255, 255, 255, 0));
}

.start-category-filters {
  display: flex;
  gap: 10px;
  padding: 4px 2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.start-category-filters::-webkit-scrollbar {
  display: none;
}

.start-category-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  font-family: "Figtree", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--glass-hairline);
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s var(--ease-out);
}

.start-category-chip:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(124, 168, 216, 0.4);
}

.start-category-chip.is-active {
  background: var(--brand-deep);
  color: #fff;
  box-shadow: 0 6px 16px rgba(27, 47, 86, 0.28);
}

.start-options {
  display: grid;
  gap: 6px;
  max-height: min(42dvh, 340px);
  margin-top: 12px;
  padding: 4px;
  overflow-y: auto;
}

.start-options button {
  padding: 10px 14px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.9rem;
}

/* ── Store detail ────────────────────────────────────────────────────── */

.store-detail-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.2fr);
  width: min(960px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
}

.store-detail-card:has(.store-detail-media[hidden]),
.modal.no-media .store-detail-card {
  grid-template-columns: 1fr;
}

.store-detail-media {
  position: relative;
  min-height: 360px;
  background:
    linear-gradient(135deg, rgba(29, 78, 216, 0.18), rgba(249, 115, 22, 0.16)),
    #e2e8ec;
}

.store-detail-media[hidden] {
  display: none;
}

.store-detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-detail-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 21, 48, 0) 72%, rgba(11, 21, 48, 0.08));
  pointer-events: none;
}

.store-detail-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  min-width: 0;
}

.store-detail-copy h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.store-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-deep);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s, border-color 0.16s, transform 0.16s var(--ease-out);
}

.store-detail-link:hover {
  background: var(--surface-tint);
  border-color: rgba(124, 168, 216, 0.45);
  transform: translateY(-1px);
}

.store-detail-link .icon {
  width: 16px;
  height: 16px;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .route-sheet {
    width: min(360px, calc(100% - 60px));
  }
}

@media (max-width: 920px) {
  :root {
    --stage-pad: 12px;
    --route-sheet-max-h: none;
  }

  .topbar {
    top: calc(14px + var(--safe-top));
    left: calc(14px + var(--safe-left));
    right: calc(14px + var(--safe-right));
    gap: 10px;
  }

  .search-header-card {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 10px;
    border-radius: 22px;
  }

  .search-header-toolbar {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .search-header-lead {
    gap: 8px;
    flex: 0 1 auto;
    min-width: 0;
  }

  .search-header-actions {
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
  }

  .search-header-actions-cluster {
    gap: 6px;
    padding: 3px;
  }

  .lang-switch-btn {
    min-width: 34px;
    padding: 0 8px;
  }

  .travel-mode-btn span,
  .home-back-btn span {
    display: none;
  }

  .travel-mode-btn,
  .home-back-btn {
    padding: 0 9px;
  }

  .search-header-logo {
    justify-content: flex-start;
    flex-shrink: 1;
    min-width: 0;
  }

  .search-header-card .brand-logo {
    height: clamp(30px, 8vw, 38px);
    max-width: min(120px, 30vw);
  }

  .trip-planner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
  }

  .planner-field {
    min-height: 48px;
    padding: 8px 12px;
  }

  .planner-swap {
    align-self: center;
    margin: 0;
    transform: rotate(90deg);
  }

  .planner-swap:hover {
    transform: rotate(90deg) scale(1.08);
  }

  .planner-label {
    font-size: 0.58rem;
  }

  .planner-text strong {
    font-size: 0.84rem;
  }

  .planner-destination #store-search,
  #start-search {
    font-size: 1rem;
  }

  .tool-dock {
    right: calc(14px + var(--safe-right));
    top: auto;
    bottom: calc(14px + var(--safe-bottom));
    transform: none;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 6px;
  }

  .map-stage:has(#route-sheet:not([hidden])) .tool-dock {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .tool-dock button {
    width: 42px;
    height: 42px;
  }

  .hint-bubble {
    top: auto;
    bottom: calc(88px + var(--safe-bottom));
    max-width: calc(100% - 120px);
    text-align: center;
    line-height: 1.35;
  }

  .map-stage:has(#route-sheet:not([hidden])) .hint-bubble {
    opacity: 0;
    pointer-events: none;
  }

  .store-sheet,
  .route-sheet {
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
    width: auto;
    bottom: calc(12px + var(--safe-bottom));
  }

  .route-sheet {
    max-height: none;
    height: auto;
    border-radius: 22px 22px 18px 18px;
  }

  .route-sheet-header {
    padding: 14px 14px 12px;
  }

  .route-sheet-header-top {
    margin-bottom: 8px;
  }

  .route-sheet-header h2 {
    margin-bottom: 8px;
    font-size: 1.2rem;
  }

  .route-meta-pills {
    gap: 8px;
  }

  .route-meta-pill {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .route-sheet-body {
    flex: 0 0 auto;
    overflow: visible;
  }

  .route-status-banner {
    margin: 10px 12px 0;
    padding: 12px 14px;
  }

  .route-status-text {
    font-size: 0.88rem;
    line-height: 1.4;
  }

  .route-sheet .route-progress {
    margin: 8px 12px 0;
  }

  .route-steps-panel {
    display: none;
  }

  .route-sheet-footer {
    padding: 10px 12px calc(10px + var(--safe-bottom));
  }

  .sheet-handle {
    display: block;
  }

  .modal-card {
    bottom: calc(12px + var(--safe-bottom));
    width: min(560px, calc(100% - 24px - var(--safe-left) - var(--safe-right)));
  }

  #start-picker .modal-card,
  #destination-picker .modal-card {
    width: min(600px, calc(100% - 28px - var(--safe-left) - var(--safe-right)));
    max-height: min(82dvh, calc(100dvh - 28px - var(--safe-top) - var(--safe-bottom)));
  }
}

@media (max-width: 640px) {
  :root {
    --stage-pad: 8px;
  }

  .topbar {
    top: calc(8px + var(--safe-top));
    left: calc(8px + var(--safe-left));
    right: calc(8px + var(--safe-right));
  }

  .search-header-card {
    padding: 8px 10px;
    gap: 8px;
    border-radius: 18px;
  }

  .search-header-card .brand-logo {
    height: clamp(28px, 8vw, 34px);
    max-width: min(110px, 28vw);
  }

  .search-header-actions {
    gap: 5px;
  }

  .search-header-actions-cluster {
    gap: 5px;
    padding: 2px;
  }

  .lang-switch-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
  }

  .travel-mode-btn {
    min-height: 30px;
    padding: 0 8px;
  }

  .home-back-btn {
    min-height: 30px;
    padding: 0 8px;
  }

  .search-panel-toggle {
    width: 30px;
    height: 30px;
  }

  .trip-planner {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .planner-swap {
    justify-self: center;
    margin: -2px 0;
  }

  .planner-field {
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 14px;
  }

  .planner-destination #store-search,
  #start-search {
    font-size: 16px;
  }

  .planner-dot {
    width: 20px;
    height: 20px;
  }

  .tool-dock {
    right: calc(8px + var(--safe-right));
    bottom: calc(8px + var(--safe-bottom));
    border-radius: 16px;
  }

  .map-stage:has(#route-sheet:not([hidden])) .tool-dock {
    top: 42%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .tool-dock button {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .hint-bubble {
    display: none;
  }

  .store-sheet,
  .route-sheet {
    left: calc(8px + var(--safe-left));
    right: calc(8px + var(--safe-right));
    bottom: calc(8px + var(--safe-bottom));
    border-radius: 20px 20px 16px 16px;
  }

  .route-sheet-header {
    padding: 12px 12px 10px;
  }

  .route-sheet-header h2 {
    font-size: 1.05rem;
    margin-bottom: 6px;
  }

  .route-badge {
    padding: 4px 10px;
    font-size: 0.62rem;
  }

  .route-close-btn {
    width: 30px;
    height: 30px;
  }

  .route-meta-pill {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .route-status-banner {
    margin: 8px 10px 0;
    padding: 10px 12px;
    gap: 10px;
  }

  .route-status-icon {
    width: 38px;
    height: 38px;
  }

  .route-status-label {
    font-size: 0.58rem;
  }

  .route-status-text {
    font-size: 0.84rem;
  }

  .route-sheet-footer {
    padding: 8px 10px calc(8px + var(--safe-bottom));
    gap: 8px;
  }

  .route-footer-primary,
  .route-footer-secondary {
    min-height: 44px;
    border-radius: 14px;
  }

  .floating-sheet h2 {
    font-size: 1.15rem;
  }

  .sheet-actions {
    flex-direction: column;
  }

  .sheet-actions button {
    width: 100%;
  }

  .suggestions {
    max-height: min(320px, 42dvh);
  }

  .modal-card {
    left: calc(8px + var(--safe-left));
    right: calc(8px + var(--safe-right));
    bottom: calc(8px + var(--safe-bottom));
    width: auto;
    max-height: calc(100dvh - 16px - var(--safe-top) - var(--safe-bottom));
    padding: 16px;
    border-radius: 22px 22px 16px 16px;
    transform: none;
    animation: sheet-in 0.32s var(--ease-spring);
  }

  #start-picker .modal-card,
  #destination-picker .modal-card {
    top: auto;
    left: calc(8px + var(--safe-left));
    right: calc(8px + var(--safe-right));
    bottom: calc(8px + var(--safe-bottom));
    width: auto;
    max-height: calc(100dvh - 16px - var(--safe-top) - var(--safe-bottom));
    transform: none;
    animation: sheet-in 0.32s var(--ease-spring);
  }

  .start-category-chip {
    min-height: 40px;
    padding: 9px 14px;
    font-size: 0.84rem;
  }

  .start-options {
    max-height: min(36dvh, 280px);
  }

  #store-detail-modal .store-detail-card {
    position: fixed;
    top: calc(8px + var(--safe-top));
    right: calc(8px + var(--safe-right));
    bottom: calc(8px + var(--safe-bottom));
    left: calc(8px + var(--safe-left));
    width: auto;
    max-height: none;
    grid-template-columns: 1fr;
    border-radius: 22px;
    overflow-y: auto;
    transform: none;
    animation: sheet-in 0.32s var(--ease-spring);
  }

  #store-detail-modal .modal-backdrop {
    background: rgba(11, 21, 48, 0.55);
  }

  .store-detail-media {
    min-height: 180px;
    max-height: 34dvh;
  }

  .store-detail-copy {
    padding: 16px;
  }

  .store-detail-copy h2 {
    font-size: 1.22rem;
  }
}

@media (max-width: 640px) and (orientation: landscape) {
  :root {
    --route-sheet-max-h: none;
  }

  .search-header-card {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .search-header-logo {
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  .search-stack {
    flex: 1 1 220px;
    min-width: 0;
  }

  .trip-planner {
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  }

  .route-sheet {
    max-height: none;
  }

  .modal-card,
  #start-picker .modal-card,
  #destination-picker .modal-card {
    max-height: calc(100dvh - 12px - var(--safe-top) - var(--safe-bottom));
  }
}

@media (max-height: 520px) {
  .search-header-card .brand-logo {
    height: clamp(32px, 8vw, 40px);
  }

  .planner-field {
    min-height: 40px;
  }

  .route-sheet-header {
    padding: 14px 14px 12px;
  }

  .route-sheet-header h2 {
    font-size: 1.05rem;
    margin-bottom: 8px;
  }

  .route-steps-panel {
    display: none;
  }

  .route-sheet-body {
    max-height: none;
    overflow: visible;
  }
}
