:root {
  --colorsBaseWhite: #ffffff;
  --colorsBaseBlack: #000000;
  --colorsGrayLightMode25: #fdfdfd;
  --colorsGrayLightMode50: #f5f6f6;
  --colorsGrayLightMode100: #e5e7e8;
  --colorsGrayLightMode200: #cdd0d4;
  --colorsGrayLightMode300: #abafb5;
  --colorsGrayLightMode400: #808790;
  --colorsGrayLightMode500: #656b75;
  --colorsGrayLightMode600: #575b63;
  --colorsGrayLightMode700: #4a4d54;
  --colorsGrayLightMode900: #3a3c3f;
  --colorsGrayLightMode950: #202124;
  --colorsBrand50: #deebff;
  --colorsBrand100: #cee1ff;
  --colorsBrand300: #8db8fe;
  --colorsBrand500: #4c90fe;
  --colorsBrand600: #3d80ec;
  --colorsBrand700: #2e70db;
  --colorsError50: #fef2f1;
  --colorsError100: #fee3e1;
  --colorsError500: #f04437;
  --colorsWarning50: #fff9eb;
  --colorsWarning100: #feefc6;
  --colorsWarning500: #f78f08;
  --colorsSuccess50: #ecfcf2;
  --colorsSuccess100: #dbf9e6;
  --colorsSuccess600: #069454;
  --colorsBlue100: #d1e9ff;
  --colorsBlue500: #2e90fa;
  --colorsPurple100: #eae8fe;
  --colorsPurple500: #7959f8;
  --spacing052px: 2px;
  --spacing14px: 4px;
  --spacing156px: 6px;
  --spacing28px: 8px;
  --spacing312px: 12px;
  --spacing416px: 16px;
  --spacing520px: 20px;
  --spacing624px: 24px;
  --spacing832px: 32px;
  --radiusSm: 6px;
  --radiusMd: 8px;
  --radiusLg: 10px;
  --radiusXl: 12px;
  --radius2xl: 16px;
  --radius3xl: 20px;
  --radiusFull: 9999px;
  --fontFamilyFontFamilyBody: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --surface: var(--colorsBaseWhite);
  --surface-soft: rgba(255, 255, 255, 0.86);
  --panel-bg: rgba(248, 252, 244, 0.92);
  --panel-border: rgba(171, 175, 181, 0.54);
  --text: var(--colorsGrayLightMode950);
  --text-muted: var(--colorsGrayLightMode600);
  --text-soft: var(--colorsGrayLightMode500);
  --brand: var(--colorsBrand600);
  --focus: var(--colorsBrand500);
  --shadow-xs: 0 1px 2px rgba(32, 33, 36, 0.06);
  --shadow-sm: 0 7px 20px rgba(32, 33, 36, 0.09);
  --shadow-md: 0 18px 44px rgba(32, 33, 36, 0.14);
  --map-green: #bde8a6;
  --map-green-deep: #a9db8d;
  --map-ground: #edf2e8;
  --map-block: #e7e9e3;
  --map-road: #ffffff;
  --map-road-edge: #d5d8d1;
  color-scheme: light;
}

@property --finder-column-size {
  syntax: "<length>";
  inherits: false;
  initial-value: 420px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--map-ground);
  color: var(--text);
  font-family: var(--fontFamilyFontFamilyBody);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

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

.visually-hidden {
  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 {
  --rail-column-size: 64px;
  --finder-column-size: 420px;
  --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);
  display: grid;
  grid-template-columns: calc(var(--rail-column-size) + var(--safe-left)) minmax(0, var(--finder-column-size)) minmax(0, 1fr);
  height: 100vh;
  min-height: 720px;
  background: var(--map-ground);
  transition:
    --finder-column-size 260ms cubic-bezier(0.22, 1, 0.36, 1),
    grid-template-columns 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rail {
  z-index: 5;
  display: grid;
  grid-template-rows: 56px auto auto 1fr;
  align-items: start;
  justify-items: center;
  width: calc(64px + var(--safe-left, 0px));
  padding: calc(var(--spacing520px) + var(--safe-top, 0px))
    var(--spacing28px) var(--spacing624px)
    calc(var(--spacing28px) + var(--safe-left, 0px));
  background: rgba(245, 251, 239, 0.94);
  border-right: 1px solid rgba(171, 175, 181, 0.42);
  backdrop-filter: blur(18px);
}

.rail-main,
.rail-footer,
.rail-chips {
  display: grid;
  gap: var(--spacing416px);
}

.rail-main,
.rail-chips {
  width: 100%;
  justify-items: center;
}

.rail-main::before,
.rail-chips::before {
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  background: rgba(171, 175, 181, 0.48);
}

.rail-footer {
  align-self: end;
  gap: var(--spacing520px);
}

.rail-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--colorsGrayLightMode600);
  background: transparent;
  border: 0;
  border-radius: var(--radiusFull);
}

.rail-button:hover,
.rail-button:focus-visible,
.rail-button.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  outline: none;
}

.rail-button:focus-visible,
.collapse-button:focus-visible,
.search-clear:focus-visible,
.search-submit:focus-visible,
.saved-place:focus-visible,
.category-card:focus-visible,
.right-map-controls button:focus-visible,
.zoom-controls button:focus-visible,
.poi:focus-visible,
.selected-marker:focus-visible,
.location-preview-main:focus-visible,
.location-preview-close:focus-visible,
.round-icon-button:focus-visible,
.place-label-edit:focus-visible,
.place-label-save:focus-visible,
.place-action:focus-visible,
.place-info-control:focus-visible,
.location-setup-close:focus-visible,
.location-setup-search button:focus-visible,
.location-setup-save:focus-visible,
.location-setup-clear:focus-visible,
.setup-marker:focus-visible {
  outline: 3px solid rgba(76, 144, 254, 0.34);
  outline-offset: 2px;
}

.rail-menu {
  align-self: start;
}

.rail-chips {
  margin-top: var(--spacing520px);
}

.rail-chip {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: var(--radiusFull);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.rail-chip-red {
  color: #e31a53;
  background: #ffe3e7;
}

.rail-chip-orange {
  color: #db6803;
  background: #feefc6;
}

.rail-chip-green {
  color: #069454;
  background: #dbf9e6;
}

.rail-chip-violet {
  color: #6838ee;
  background: #eae8fe;
}

.finder-panel {
  z-index: 4;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  padding: var(--spacing416px) var(--spacing520px) 0;
  overflow: hidden;
  background: var(--panel-bg);
  border-right: 1px solid rgba(101, 107, 117, 0.36);
  box-shadow: 6px 0 18px rgba(32, 33, 36, 0.08);
  backdrop-filter: blur(18px);
  transition:
    width 260ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 260ms cubic-bezier(0.22, 1, 0.36, 1),
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    backdrop-filter 180ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: width, padding;
}

.finder-panel::before {
  position: absolute;
  top: 68px;
  right: 0;
  left: 0;
  z-index: 2;
  height: 30px;
  content: "";
  background: linear-gradient(180deg, var(--panel-bg) 0%, rgba(248, 252, 244, 0.86) 38%, rgba(248, 252, 244, 0) 100%);
  opacity: 1;
  transition: opacity 140ms ease;
  pointer-events: none;
}

/* Bottom-sheet grab handle (mobile only; shown via media query) */
.sheet-handle {
  display: none;
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  width: 100%;
  height: 26px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  touch-action: none;
}

.sheet-handle::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 42px;
  height: 5px;
  margin-left: -21px;
  border-radius: var(--radiusFull);
  background: rgba(120, 125, 135, 0.42);
  transition: background 160ms ease;
}

.sheet-handle:hover::before,
.sheet-handle:active::before {
  background: rgba(120, 125, 135, 0.7);
}

.app-shell.is-panel-collapsed {
  --finder-column-size: 0px;
}

.app-shell.is-panel-collapsed .finder-panel {
  width: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  border-right: 0;
  box-shadow: none;
  backdrop-filter: none;
  transform: none;
  pointer-events: none;
}

.app-shell.is-panel-collapsed .finder-panel::before {
  opacity: 0;
}

.app-shell.is-panel-collapsed .search-row {
  position: absolute;
  top: var(--spacing416px);
  left: var(--spacing520px);
  width: 380px;
  pointer-events: auto;
}

.app-shell.is-panel-collapsed .panel-scroll {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-14px);
  transition:
    opacity 130ms ease,
    transform 210ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 210ms;
  pointer-events: none;
}

.search-row {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: var(--spacing28px);
  align-items: center;
  flex: 0 0 auto;
}

.panel-scroll {
  position: relative;
  z-index: 1;
  min-height: 0;
  flex: 1 1 auto;
  margin: var(--spacing416px) -10px 0 0;
  padding: 0 10px var(--spacing520px) 0;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition:
    opacity 170ms ease 60ms,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.panel-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.app-shell.is-details-open .panel-scroll {
  display: none;
}

.search-box {
  position: relative;
  height: 52px;
}

.search-pin {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  display: none;
  place-items: center;
  width: 20px;
  height: 22px;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-pin svg {
  width: 16px;
  height: 22px;
  stroke: none;
}

.search-box input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 54px 0 var(--spacing520px);
  overflow: hidden;
  color: #5d6a84;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(205, 208, 212, 0.78);
  border-radius: var(--radiusFull);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.74), var(--shadow-sm);
  caret-color: var(--colorsBrand500);
  outline: none;
}

.search-box input::-webkit-search-decoration,
.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-results-button,
.search-box input::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

.search-box.has-clear input {
  padding-right: 88px;
}

.search-box input::placeholder {
  color: #5d6a84;
  font-weight: 500;
}

.search-box input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(76, 144, 254, 0.16), var(--shadow-sm);
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 48px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: #667085;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radiusFull);
  transform: translateY(-50%);
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

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

.search-clear svg {
  width: 20px;
  height: 20px;
}

.search-clear:hover {
  color: var(--brand);
  background: rgba(76, 144, 254, 0.08);
  border-color: rgba(76, 144, 254, 0.54);
}

.search-submit {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: #667085;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radiusFull);
  transform: translateY(-50%);
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.search-submit svg {
  width: 20px;
  height: 20px;
}

.search-submit:hover {
  color: var(--brand);
  background: rgba(76, 144, 254, 0.08);
  border-color: rgba(76, 144, 254, 0.54);
  box-shadow: var(--shadow-xs);
}

.collapse-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--colorsBaseWhite);
  background: var(--brand);
  border: 0;
  border-radius: var(--radiusFull);
  box-shadow: 0 9px 22px rgba(61, 128, 236, 0.32);
}

/* Sections that only appear on the mobile sheet / landscape drawer */
.only-narrow {
  display: none;
}

.collapse-button svg {
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-shell.is-panel-collapsed .collapse-button svg {
  transform: rotate(180deg);
}

.saved-places {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing28px);
  margin-top: 0;
  padding-top: var(--spacing312px);
}

.saved-place {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  column-gap: 10px;
  align-items: center;
  height: 58px;
  min-width: 0;
  padding: 0 10px 0 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(171, 175, 181, 0.56);
  border-radius: var(--radiusFull);
  box-shadow: var(--shadow-xs);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease, transform 150ms ease;
}

.saved-place:hover {
  border-color: rgba(76, 144, 254, 0.58);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.saved-place.is-empty {
  grid-template-columns: 38px minmax(0, 1fr);
  color: #3f454f;
  background: rgba(255, 255, 255, 0.86);
  border: 1.5px dashed rgba(171, 175, 181, 0.7);
  box-shadow: none;
}

.saved-place.is-empty .saved-edit {
  display: none;
}

.saved-place span:nth-child(2) {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radiusFull);
}

.saved-icon svg {
  width: 18px;
  height: 18px;
}

.saved-icon.neutral {
  color: #667085;
  background: #f0f1f3;
}

.saved-icon.brand {
  color: var(--brand);
  background: var(--colorsBrand100);
}

.saved-place.is-empty .saved-icon {
  color: #626a76;
  background: #e5e7e8;
}

.saved-edit {
  color: #5d6677;
}

.saved-edit svg {
  width: 17px;
  height: 17px;
}

.nearby-section {
  display: block;
  margin-top: var(--spacing520px);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing416px);
  margin-bottom: var(--spacing416px);
}

.section-heading h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 24px;
}

.section-heading span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  line-height: 18px;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 0 var(--spacing520px);
}

.category-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  height: 58px;
  min-width: 0;
  padding: 0 14px 0 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(205, 208, 212, 0.56);
  border-radius: var(--radiusFull);
  box-shadow: var(--shadow-xs);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.category-card:hover {
  border-color: var(--colorsBrand500);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.category-card.is-selected {
  background: var(--surface);
  border-color: var(--colorsBrand500);
}

.category-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-bg);
  border-radius: var(--radiusFull);
}

.category-icon svg {
  width: 18px;
  height: 18px;
}

.category-label {
  overflow: hidden;
  padding-left: var(--spacing28px);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Sectioned panel content (Directions / Locations / Saved) --- */
.panel-section {
  margin-top: var(--spacing520px);
}

.panel-section:first-child {
  margin-top: var(--spacing312px);
}

.section-label {
  margin: 0 0 var(--spacing416px);
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  line-height: 24px;
}

.directions-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--spacing28px);
}

.direction-pill {
  display: grid;
  place-items: center;
  height: 52px;
  color: var(--colorsGrayLightMode700);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(205, 208, 212, 0.7);
  border-radius: var(--radiusFull);
  box-shadow: var(--shadow-xs);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.direction-pill:hover,
.direction-pill.is-active {
  color: var(--brand);
  border-color: var(--colorsBrand500);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.direction-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: inherit;
  background: #f0f1f3;
  border-radius: var(--radiusFull);
  transition: background 150ms ease;
}

.direction-pill:hover .direction-icon,
.direction-pill.is-active .direction-icon {
  background: var(--colorsBrand100);
}

.direction-icon svg {
  width: 20px;
  height: 20px;
}

.chip-row {
  display: flex;
  gap: var(--spacing28px);
  /* Vertical negative margin + padding give the chip shadows room to render
     without being clipped by the horizontal scroll container (overflow-y).
     Horizontal stays at 0 so the first chip aligns with the section labels. */
  margin: -4px 0 -10px;
  padding: 4px 0 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.loc-chip {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  height: 52px;
  min-width: 0;
  padding: 0 18px 0 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(171, 175, 181, 0.56);
  border-radius: var(--radiusFull);
  box-shadow: var(--shadow-xs);
  scroll-snap-align: start;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.loc-chip:hover {
  border-color: rgba(76, 144, 254, 0.58);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.loc-chip-label {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.loc-chip-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radiusFull);
}

.loc-chip-icon svg {
  width: 18px;
  height: 18px;
}

.loc-chip-icon.accent-red {
  color: #f04437;
  background: #fee3e1;
}

.loc-chip-icon.accent-amber {
  color: #f78f08;
  background: #feefc6;
}

.loc-chip-icon.accent-indigo {
  color: #4c63e6;
  background: #e6e9fd;
}

.loc-chip-icon.accent-green {
  color: #069454;
  background: #dbf9e6;
}

.place-details-panel {
  min-height: 0;
  flex: 1 1 auto;
  margin-top: var(--spacing416px);
  padding: 0 0 var(--spacing624px);
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-14px);
  transition:
    opacity 180ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 260ms;
  pointer-events: none;
  will-change: opacity, transform;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.place-details-panel[hidden] {
  display: none;
}

.place-details-panel.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition:
    opacity 180ms ease 40ms,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
  pointer-events: auto;
}

.place-details-panel::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* ===== Directions panel ===== */
.directions-panel {
  min-height: 0;
  flex: 1 1 auto;
  margin-top: var(--spacing28px);
  /* Flush content; bottom gutter kept for scroll comfort */
  padding: 0 0 var(--spacing624px);
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-14px);
  transition:
    opacity 180ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 260ms;
  pointer-events: none;
  scrollbar-width: none;
}

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

.directions-panel::-webkit-scrollbar {
  display: none;
}

.directions-panel.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition:
    opacity 180ms ease 40ms,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
  pointer-events: auto;
}

/* When directions is open it takes over the whole panel */
.app-shell.is-directions-open .panel-scroll,
.app-shell.is-directions-open .search-row {
  display: none;
}

.dir-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px 40px;
  gap: var(--spacing28px);
  align-items: center;
  margin-bottom: var(--spacing520px);
}

.dir-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  color: var(--text);
}

.dir-modes {
  display: flex;
  gap: 8px;
  margin-bottom: var(--spacing416px);
}

.dir-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  height: 52px;
  padding: 0 10px 0 6px;
  border: 1px solid transparent;
  border-radius: var(--radiusFull);
  background: #ffffff;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.dir-mode-eta {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1;
  color: #2a313a;
  white-space: nowrap;
  transition: color 160ms ease;
}

.dir-mode-eta:empty {
  display: none;
}

.dir-mode-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e6eaee;
  color: #656b75;
  transition: background 160ms ease, color 160ms ease;
}

.dir-mode-ico svg {
  width: 18px;
  height: 18px;
}

.dir-mode:hover {
  border-color: rgba(76, 144, 254, 0.58);
}

.dir-mode.is-active {
  background: #3d80ec;
  border-color: #3d80ec;
  box-shadow: 0 2px 8px rgba(61, 128, 236, 0.28);
}

.dir-mode.is-active .dir-mode-ico {
  background: #ffffff;
  color: #3d80ec;
}

.dir-mode.is-active .dir-mode-eta {
  color: #ffffff;
}

.dir-mode:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(61, 128, 236, 0.28);
}

.dir-route {
  position: relative;
  margin-bottom: var(--spacing520px);
}

.dir-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 60px 6px 6px;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.02);
}

.dir-field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 50px;
  padding: 0 16px;
  border: 1px solid #eaedf1;
  border-radius: var(--radiusFull);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 32, 51, 0.05);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.dir-field:focus-within {
  border-color: #3d80ec;
  box-shadow: 0 0 0 3px rgba(61, 128, 236, 0.16);
}

.dir-field-ico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

.dir-field-ico svg {
  width: 20px;
  height: 20px;
}

.dir-field-ico.from {
  color: #3d80ec;
}

.dir-field-ico.to {
  color: #17b26a;
}

.dir-input {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #1d232b;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  outline: none;
}

.dir-field-clear {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-right: -6px;
  color: #98a2b3;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}

.dir-field-clear[hidden] {
  display: none;
}

.dir-field-clear svg {
  width: 16px;
  height: 16px;
}

.dir-field-clear:hover {
  color: #475467;
  background: rgba(0, 0, 0, 0.05);
}

.dir-input::placeholder {
  color: #9aa2ac;
  font-weight: 500;
}

.dir-swap {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #e3ecfb;
  color: #3d80ec;
  cursor: pointer;
  transition: background 140ms ease, transform 160ms ease;
}

.dir-swap svg {
  width: 19px;
  height: 19px;
}

.dir-swap:hover {
  background: #d4e2fa;
}

.dir-swap:active {
  transform: translateY(-50%) rotate(180deg);
}

.dir-shortcuts {
  display: flex;
  flex-direction: column;
}

.dir-shortcut,
.dir-nearby-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
}

.dir-shortcut:hover,
.dir-nearby-item:hover {
  background: rgba(20, 32, 51, 0.045);
}

.dir-shortcut-ico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f1f3;
  color: #667085;
}

.dir-shortcut-ico svg {
  width: 20px;
  height: 20px;
}

.dir-shortcut-text,
.dir-nearby-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dir-shortcut-text strong,
.dir-nearby-text strong {
  font-size: 14px;
  font-weight: 550;
  color: var(--text);
}

.dir-shortcut-text span,
.dir-nearby-text span {
  overflow: hidden;
  font-size: 13px;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dir-nearby {
  margin-top: var(--spacing416px);
}

.dir-nearby-title {
  margin: 0 0 var(--spacing28px);
  font-size: 16px;
  font-weight: 550;
  color: var(--text);
}

.dir-nearby-list {
  display: flex;
  flex-direction: column;
}

.dir-nearby-ico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-bg);
}

.dir-nearby-ico svg {
  width: 20px;
  height: 20px;
}

.dir-suggest[hidden] {
  display: none;
}

/* Leave-now / Options toolbar (shown once a destination is set) */
.dir-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dir-toolbar[hidden] {
  display: none;
}

.dir-when {
  position: relative;
}

.dir-when-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid rgba(205, 208, 212, 0.7);
  border-radius: var(--radiusFull);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease;
}

.dir-when-btn:hover {
  border-color: rgba(76, 144, 254, 0.58);
}

.dir-when-clock {
  width: 16px;
  height: 16px;
  color: #667085;
}

.dir-when-caret {
  width: 15px;
  height: 15px;
  color: #667085;
  transform: rotate(180deg);
  transition: transform 160ms ease;
}

.dir-when-btn[aria-expanded="true"] .dir-when-caret {
  transform: rotate(0deg);
}

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

.dir-when-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 6;
  min-width: 160px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid rgba(205, 208, 212, 0.7);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  transform-origin: top left;
  animation: dir-dropdown-in 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dir-when-menu[hidden] {
  display: none;
}

.dir-when-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.dir-when-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.dir-when-item.is-selected {
  color: #3d80ec;
  font-weight: 650;
}

.dir-options-btn {
  padding: 6px 12px;
  color: #3d80ec;
  background: transparent;
  border: 0;
  border-radius: var(--radiusFull);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.dir-options-btn:hover {
  background: rgba(61, 128, 236, 0.08);
}

.dir-options-btn[aria-expanded="true"] {
  background: rgba(61, 128, 236, 0.14);
  font-weight: 600;
}

/* Collapsible options: grid-rows 0fr->1fr animates height so the route
   list below slides down on open and back up on close. */
.dir-options-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-bottom: 0;
  transition:
    grid-template-rows 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease,
    margin-bottom 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dir-options-panel.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-bottom: 12px;
}

.dir-options-clip {
  min-height: 0;
  overflow: hidden;
}

/* keep the collapsed panel out of the tab order once it has slid away */
.dir-options-panel:not(.is-open) .dir-options-clip {
  visibility: hidden;
  transition: visibility 0s linear 280ms;
}

.dir-options-card {
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid rgba(205, 208, 212, 0.6);
  border-radius: 14px;
}

.dir-options-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dir-options-head strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.dir-options-cols {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dir-options-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dir-options-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}

.dir-opt-choices {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.dir-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

/* native input kept for state + a11y, but visually hidden */
.dir-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

/* custom control */
.dir-box {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1.5px solid #c2c7cf;
  background: #ffffff;
  transition: border-color 140ms ease, background 140ms ease;
}

.dir-check input[type="checkbox"] ~ .dir-box {
  border-radius: 5px;
}

.dir-check input[type="radio"] ~ .dir-box {
  border-radius: 50%;
}

.dir-check:hover .dir-box {
  border-color: #3d80ec;
}

.dir-check input:focus-visible ~ .dir-box {
  box-shadow: 0 0 0 3px rgba(61, 128, 236, 0.28);
}

/* checkbox tick */
.dir-check input[type="checkbox"] ~ .dir-box::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 4.5px;
  height: 8.5px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dir-check input[type="checkbox"]:checked ~ .dir-box {
  background: #3d80ec;
  border-color: #3d80ec;
}

.dir-check input[type="checkbox"]:checked ~ .dir-box::after {
  transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

/* radio dot */
.dir-check input[type="radio"] ~ .dir-box::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  transform: scale(0);
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dir-check input[type="radio"]:checked ~ .dir-box {
  background: #3d80ec;
  border-color: #3d80ec;
}

.dir-check input[type="radio"]:checked ~ .dir-box::after {
  transform: scale(1);
}

/* Route results (shown once a destination is set) */
.dir-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dir-results[hidden] {
  display: none;
}

.dir-route-card {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid rgba(205, 208, 212, 0.55);
  border-radius: 16px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.dir-route-card:hover {
  border-color: rgba(61, 128, 236, 0.5);
}

.dir-route-card.is-selected {
  background: #3d80ec;
  border-color: #3d80ec;
}

.dir-route-time {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.dir-route-card.is-selected .dir-route-time {
  color: #ffffff;
}

.dir-route-meta {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
}

.dir-route-card.is-selected .dir-route-meta {
  color: rgba(255, 255, 255, 0.88);
}

.dir-route-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.dir-route-steps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3d80ec;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.dir-route-card.is-selected .dir-route-steps {
  color: #ffffff;
}

.dir-route-steps svg {
  width: 16px;
  height: 16px;
  transform: rotate(180deg);
  transition: transform 160ms ease;
}

.dir-route-steps[aria-expanded="true"] svg {
  transform: rotate(0deg);
}

.dir-route-print {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #98a2b3;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.dir-route-card.is-selected .dir-route-print {
  color: rgba(255, 255, 255, 0.85);
}

.dir-route-print svg {
  width: 17px;
  height: 17px;
}

.dir-route-steplist {
  margin: 10px 0 0;
  padding: 10px 0 0;
  list-style: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.dir-route-card.is-selected .dir-route-steplist {
  border-top-color: rgba(255, 255, 255, 0.24);
}

.dir-route-steplist li {
  padding: 4px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
}

.dir-route-card.is-selected .dir-route-steplist li {
  color: rgba(255, 255, 255, 0.9);
}

.dir-route-steplist[hidden] {
  display: none;
}

/* Route line drawn on the map */
.map-route {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

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

.map-route-casing {
  fill: none;
  stroke: #ffffff;
  stroke-width: 13;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-route-line {
  fill: none;
  stroke: #3d80ec;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-route-start {
  fill: #ffffff;
  stroke: #3d80ec;
  stroke-width: 4;
}

.map-route-end path {
  fill: #e5484d;
  stroke: #ffffff;
  stroke-width: 2;
}

.map-route-end circle {
  fill: #ffffff;
  stroke: none;
}

.place-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: var(--spacing416px);
  align-items: start;
  margin-bottom: var(--spacing520px);
}

/* On desktop the details are closed by the collapse button, so the in-header
   close (X) is only shown on the mobile sheet / landscape drawer. */
#closePlaceDetails {
  display: none;
}

.place-heading > .round-icon-button {
  margin-top: var(--spacing312px);
}

.place-title-stack {
  min-width: 0;
}

.place-title-row {
  display: flex;
  gap: var(--spacing28px);
  align-items: center;
  min-width: 0;
  padding-top: var(--spacing312px);
}

.place-title-row[hidden] {
  display: none;
}

.place-heading h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-label-edit {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  color: #667085;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(205, 208, 212, 0.7);
  border-radius: var(--radiusFull);
  box-shadow: var(--shadow-xs);
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.place-label-edit svg {
  width: 15px;
  height: 15px;
}

.place-label-edit:hover {
  color: var(--brand);
  background: rgba(76, 144, 254, 0.08);
  border-color: rgba(76, 144, 254, 0.54);
  box-shadow: var(--shadow-sm);
}

.place-label-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 4;
  padding: 7px 10px;
  color: var(--colorsBaseWhite);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
  background: #1f2937;
  border-radius: var(--radiusLg);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.place-label-tooltip::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 8px;
  height: 8px;
  content: "";
  background: #1f2937;
  transform: translate(-50%, -4px) rotate(45deg);
}

.place-label-edit.is-tooltip-visible .place-label-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.place-label-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: var(--spacing28px);
  align-items: center;
  padding-top: var(--spacing312px);
}

.place-label-form[hidden] {
  display: none;
}

.place-label-input-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

.place-label-input-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(76, 144, 254, 0.62);
  border-radius: var(--radiusLg);
  box-shadow: 0 0 0 4px rgba(76, 144, 254, 0.12), var(--shadow-xs);
  caret-color: var(--brand);
  outline: none;
}

.place-label-save {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: var(--colorsBaseWhite);
  background: var(--brand);
  border: 0;
  border-radius: var(--radiusFull);
  box-shadow: var(--shadow-xs);
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.place-label-save svg {
  width: 16px;
  height: 16px;
}

.place-label-save:hover {
  background: var(--colorsBrand700);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.place-heading p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
}

.round-icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #4d5a70;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(205, 208, 212, 0.64);
  border-radius: var(--radiusFull);
  box-shadow: var(--shadow-xs);
}

.round-icon-button:hover {
  color: var(--brand);
  border-color: rgba(76, 144, 254, 0.54);
}

.place-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.place-action {
  display: grid;
  gap: var(--spacing28px);
  justify-items: center;
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
}

.place-action span {
  display: grid;
  width: 100%;
  height: 56px;
  place-items: center;
  color: #4d5a70;
  background: var(--surface);
  border: 1px solid rgba(205, 208, 212, 0.66);
  border-radius: var(--radiusXl);
  box-shadow: var(--shadow-xs);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.place-action strong {
  max-width: 100%;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-align: center;
}

.place-action:hover span {
  border-color: rgba(76, 144, 254, 0.58);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.place-action.is-primary span {
  color: var(--colorsBaseWhite);
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: var(--shadow-xs);
}

.place-info-list {
  display: grid;
  gap: var(--spacing312px);
  margin-top: var(--spacing416px);
}

.place-info-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  gap: var(--spacing312px);
  align-items: start;
  min-height: 70px;
  padding: var(--spacing416px);
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(205, 208, 212, 0.62);
  border-radius: var(--radius2xl);
  box-shadow: var(--shadow-xs);
}

.place-info-card-soft {
  grid-template-columns: 32px minmax(0, 1fr);
  background: rgba(255, 255, 255, 0.72);
}

.place-info-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #667085;
  background: rgba(240, 241, 243, 0.96);
  border: 1px solid rgba(205, 208, 212, 0.58);
  border-radius: var(--radiusFull);
}

.place-info-icon svg,
.place-info-control svg {
  width: 18px;
  height: 18px;
}

.place-info-card h3 {
  margin: 0 0 4px;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.place-info-card p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.place-info-control {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #5d6a84;
  background: transparent;
  border: 0;
  border-radius: var(--radiusFull);
}

.place-info-control:hover {
  color: var(--brand);
  background: var(--colorsBrand50);
}

.map-viewport {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--map-ground);
  isolation: isolate;
}

.map-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: none;
  transform: scale(var(--map-scale, 1));
  transform-origin: 56% 46%;
  transition: transform 180ms ease;
}

.park {
  fill: var(--map-green);
}

.water {
  fill: #7ed2ec;
}

.blocks path {
  fill: var(--map-block);
  opacity: 0.78;
}

.minor-roads path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 1px rgba(128, 135, 144, 0.56));
}

.major-roads path {
  fill: none;
  stroke: var(--map-road);
  stroke-width: 20;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 1px rgba(128, 135, 144, 0.9));
}

.road-labels text {
  fill: #7d817d;
  font-size: 13px;
  font-weight: 800;
  opacity: 0.66;
}

.local-labels text {
  fill: #58616f;
  font-size: 9px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2px;
}

.right-map-controls,
.zoom-controls {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: var(--spacing28px);
}

.right-map-controls {
  top: calc(var(--spacing416px) + var(--safe-top, 0px));
  right: calc(var(--spacing416px) + var(--safe-right, 0px));
}

.zoom-controls {
  right: calc(var(--spacing416px) + var(--safe-right, 0px));
  bottom: calc(var(--spacing520px) + var(--safe-bottom, 0px));
}

.right-map-controls button,
.zoom-controls button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--colorsGrayLightMode700);
  background: rgba(255, 255, 255, 0.92);
  border: 0;
  border-radius: var(--radiusFull);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.right-map-controls button:hover,
.zoom-controls button:hover {
  color: var(--brand);
}

.right-map-controls button:nth-child(3) {
  color: var(--colorsGrayLightMode950);
}

.poi {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: 2;
  display: grid;
  justify-items: center;
  width: 120px;
  padding: 0;
  color: var(--pin);
  background: transparent;
  border: 0;
  transform: translate(-50%, -50%);
}

.poi svg {
  display: grid;
  width: var(--pin-size);
  height: var(--pin-size);
  padding: var(--pin-pad);
  color: var(--colorsBaseWhite);
  background: var(--pin);
  border: 3px solid var(--colorsBaseWhite);
  border-radius: var(--radiusFull);
  box-shadow: 0 4px 12px rgba(32, 33, 36, 0.26);
}

.poi::after {
  display: block;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  content: "";
  background: var(--pin);
  border: 2px solid var(--colorsBaseWhite);
  border-radius: var(--radiusFull);
}

.poi span {
  max-width: 118px;
  margin-top: 2px;
  overflow: hidden;
  color: #2d3440;
  font-size: 10px;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.poi-large {
  --pin-size: 58px;
  --pin-pad: 13px;
}

.poi-small {
  --pin-size: 22px;
  --pin-pad: 3px;
}

.poi-business {
  --pin: #f2a900;
}

.poi-attraction {
  --pin: #f7b500;
}

.poi-shop {
  --pin: #ef9f0a;
}

.poi-transport {
  --pin: #7f8794;
}

.selected-marker {
  position: absolute;
  top: var(--y, 50%);
  left: var(--x, 50%);
  z-index: 4;
  display: grid;
  justify-items: center;
  width: 132px;
  padding: 0;
  color: var(--brand);
  background: transparent;
  border: 0;
  transform: translate(-50%, -88%);
}

.selected-marker[hidden] {
  display: none;
}

.selected-marker-pin {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--colorsBaseWhite);
  background: var(--brand);
  border: 3px solid var(--colorsBaseWhite);
  border-radius: var(--radiusFull);
  box-shadow: 0 8px 22px rgba(46, 112, 219, 0.3);
}

.selected-marker-pin svg {
  width: 22px;
  height: 22px;
}

.selected-marker::after {
  display: block;
  width: 9px;
  height: 9px;
  margin-top: -4px;
  content: "";
  background: var(--brand);
  border: 2px solid var(--colorsBaseWhite);
  border-radius: var(--radiusFull);
  box-shadow: 0 4px 10px rgba(46, 112, 219, 0.2);
}

.selected-marker-label {
  max-width: 130px;
  margin-top: 3px;
  overflow: hidden;
  color: #253044;
  font-size: 10px;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.location-preview-card {
  position: absolute;
  right: max(84px, 50% - 280px);
  bottom: var(--spacing520px);
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 41px;
  width: min(560px, calc(100% - 128px));
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(205, 208, 212, 0.72);
  border-radius: var(--radius3xl);
  box-shadow: 0 16px 42px rgba(32, 33, 36, 0.18);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.96);
  transform-origin: 50% 100%;
  transition:
    opacity 170ms ease,
    transform 270ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  will-change: opacity, transform;
}

.location-preview-card[hidden] {
  display: none;
}

.location-preview-card.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.location-preview-main {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr) 88px;
  gap: var(--spacing312px);
  align-items: center;
  min-width: 0;
  min-height: 92px;
  padding: var(--spacing28px) var(--spacing312px);
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
}

.preview-art {
  position: relative;
  display: block;
  width: 100%;
  height: 72px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(32, 33, 36, 0.08) 0 13%, transparent 13% 100%),
    linear-gradient(72deg, transparent 0 34%, rgba(76, 144, 254, 0.95) 34% 42%, transparent 42% 100%),
    linear-gradient(144deg, transparent 0 58%, rgba(6, 148, 84, 0.78) 58% 66%, transparent 66% 100%),
    linear-gradient(160deg, #162033, #283a54 48%, #6f8798);
  border-radius: var(--radiusMd);
}

.preview-art::before {
  position: absolute;
  inset: 9px;
  content: "";
  background:
    linear-gradient(90deg, transparent 0 44%, rgba(255, 255, 255, 0.88) 44% 49%, transparent 49% 100%),
    linear-gradient(18deg, transparent 0 52%, rgba(255, 255, 255, 0.76) 52% 57%, transparent 57% 100%);
  border-radius: var(--radiusSm);
  opacity: 0.86;
}

.preview-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.preview-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-copy span {
  overflow: hidden;
  color: #475467;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-copy small {
  overflow: hidden;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-quick-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing28px);
}

.preview-quick-actions span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--colorsBaseWhite);
  background: var(--brand);
  border-radius: var(--radiusFull);
  transition: box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.preview-quick-actions span:nth-child(2) {
  color: var(--brand);
  background: #dff6fb;
}

.preview-quick-actions span:hover {
  box-shadow: 0 8px 18px rgba(76, 144, 254, 0.26);
  transform: translateY(-1px);
}

.preview-quick-actions span:nth-child(2):hover {
  background: #d1f0ff;
}

.location-preview-close {
  display: grid;
  width: 36px;
  height: 36px;
  margin: 5px 5px 0 0;
  place-items: center;
  color: #5d6677;
  background: transparent;
  border: 0;
  border-radius: var(--radiusFull);
}

.location-preview-close:hover {
  color: var(--text);
  background: rgba(240, 241, 243, 0.86);
}

.location-setup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: var(--spacing624px);
  background: rgba(32, 33, 36, 0.38);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition:
    opacity 180ms ease,
    backdrop-filter 180ms ease;
  pointer-events: none;
}

.location-setup-backdrop[hidden] {
  display: none;
}

.location-setup-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.location-setup-modal {
  display: grid;
  width: min(780px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  padding: var(--spacing520px);
  overflow: hidden auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(205, 208, 212, 0.74);
  border-radius: var(--radius3xl);
  box-shadow: 0 24px 70px rgba(32, 33, 36, 0.26);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition:
    opacity 180ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.location-setup-backdrop.is-visible .location-setup-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.location-setup-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: var(--spacing416px);
  align-items: center;
  margin-bottom: var(--spacing520px);
}

.location-setup-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.location-setup-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #697386;
  background: transparent;
  border: 0;
  border-radius: var(--radiusFull);
}

.location-setup-close:hover {
  color: var(--text);
  background: var(--colorsGrayLightMode50);
}

.location-setup-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  height: 48px;
  margin-bottom: var(--spacing520px);
  padding-right: var(--spacing28px);
  background: var(--surface);
  border: 1px solid rgba(205, 208, 212, 0.78);
  border-radius: var(--radiusFull);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), var(--shadow-xs);
}

.location-setup-search:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(76, 144, 254, 0.16), var(--shadow-xs);
}

.location-setup-search input {
  min-width: 0;
  height: 100%;
  padding: 0 var(--spacing28px) 0 var(--spacing416px);
  color: #5d6a84;
  font-size: 14px;
  font-weight: 520;
  background: transparent;
  border: 0;
  outline: none;
}

.location-setup-search input::placeholder {
  color: #6b7280;
  font-weight: 500;
}

.location-setup-search button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #667085;
  background: transparent;
  border: 0;
  border-radius: var(--radiusFull);
}

.location-setup-search button:hover {
  color: var(--brand);
  background: var(--colorsBrand50);
}

.location-setup-map {
  position: relative;
  height: min(370px, 36vh);
  min-height: 260px;
  overflow: hidden;
  background: #edf4e7;
  border-radius: var(--radius2xl);
  box-shadow: inset 0 0 0 1px rgba(171, 175, 181, 0.36);
  cursor: crosshair;
  touch-action: none;
}

.setup-map-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(249, 231, 186, 0.54) 0 18%, transparent 18% 100%),
    linear-gradient(180deg, transparent 0 62%, rgba(182, 229, 154, 0.72) 62% 100%),
    #edf4e7;
}

.setup-road {
  position: absolute;
  display: block;
  height: 18px;
  background: #ffffff;
  border: 1px solid rgba(180, 186, 194, 0.42);
  border-radius: var(--radiusFull);
  box-shadow: 0 1px 2px rgba(101, 107, 117, 0.24);
}

.setup-road-one {
  top: 42%;
  left: -8%;
  width: 118%;
  transform: rotate(1deg);
}

.setup-road-two {
  top: 5%;
  left: 54%;
  width: 18px;
  height: 115%;
  transform: rotate(31deg);
}

.setup-road-three {
  top: 66%;
  left: -4%;
  width: 72%;
  transform: rotate(-18deg);
}

.setup-road-four {
  top: 22%;
  left: 8%;
  width: 52%;
  transform: rotate(15deg);
}

.setup-water {
  position: absolute;
  right: -12%;
  bottom: -14%;
  width: 42%;
  height: 34%;
  background: #7ed2ec;
  border-radius: 58% 42% 38% 62%;
  transform: rotate(-16deg);
  opacity: 0.9;
}

.setup-park {
  position: absolute;
  display: block;
  background: rgba(169, 219, 141, 0.78);
  border-radius: 18% 82% 28% 72%;
}

.setup-park-one {
  top: -16%;
  left: 4%;
  width: 30%;
  height: 38%;
}

.setup-park-two {
  right: 7%;
  bottom: 7%;
  width: 24%;
  height: 25%;
}

.setup-label {
  position: absolute;
  color: rgba(74, 77, 84, 0.6);
  font-size: 12px;
  font-weight: 800;
  line-height: 14px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.setup-label-one {
  top: 45%;
  left: 53%;
}

.setup-label-two {
  top: 24%;
  left: 16%;
}

.setup-label-three {
  right: 13%;
  bottom: 25%;
}

.setup-marker {
  position: absolute;
  top: var(--marker-y, 54%);
  left: var(--marker-x, 50%);
  z-index: 2;
  display: grid;
  width: 60px;
  height: 72px;
  place-items: start center;
  padding: 0;
  color: var(--colorsBaseWhite);
  background: transparent;
  border: 0;
  transform: translate(-50%, -90%);
  cursor: grab;
  touch-action: none;
}

.setup-marker:active {
  cursor: grabbing;
}

.setup-marker svg {
  width: 58px;
  height: 58px;
  padding: 12px;
  background: var(--brand);
  border: 4px solid rgba(255, 255, 255, 0.94);
  border-radius: var(--radiusFull);
  box-shadow: 0 10px 24px rgba(46, 112, 219, 0.34);
}

.setup-marker::after {
  width: 10px;
  height: 10px;
  margin-top: -6px;
  content: "";
  background: var(--brand);
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: var(--radiusFull);
}

.location-setup-save {
  height: 48px;
  margin-top: var(--spacing520px);
  color: var(--colorsBaseWhite);
  background: var(--brand);
  border: 0;
  border-radius: var(--radiusFull);
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
}

.location-setup-save:hover {
  background: var(--colorsBrand700);
}

.location-setup-save:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.location-setup-save:disabled:hover {
  background: var(--brand);
}

.location-setup-clear {
  justify-self: center;
  min-width: 160px;
  height: 40px;
  margin-top: var(--spacing416px);
  color: #575b63;
  background: transparent;
  border: 0;
  border-radius: var(--radiusFull);
  font-size: 13px;
  font-weight: 700;
}

.location-setup-clear:hover {
  color: var(--text);
  background: var(--colorsGrayLightMode50);
}

.map-status {
  position: absolute;
  right: 70px;
  bottom: 25px;
  z-index: 3;
  max-width: 230px;
  padding: 9px 12px;
  color: var(--colorsGrayLightMode700);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(171, 175, 181, 0.4);
  border-radius: var(--radiusFull);
  box-shadow: var(--shadow-xs);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.map-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    --rail-column-size: 60px;
    --finder-column-size: 390px;
  }

  .finder-panel {
    padding-inline: var(--spacing416px);
  }

  .app-shell.is-panel-collapsed .search-row {
    left: var(--spacing416px);
    width: 358px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

}

/* ===== Shared overrides for the mobile sheet AND phone-landscape drawer ===== */
@media (max-width: 820px), (orientation: landscape) and (max-height: 540px) {
  /* The rail is replaced by the sheet/drawer on small screens */
  .rail {
    display: none;
  }

  /* Show the sheet/drawer sections; hide the desktop classic blocks */
  .only-narrow {
    display: block;
  }

  .only-wide {
    display: none;
  }

  /* No blue collapse button — the grab handle drives collapse */
  .collapse-button {
    display: none;
  }

  /* When details are open, the close (X) sits next to the search bar */
  .app-shell.is-details-open .search-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .app-shell.is-details-open #closePlaceDetails {
    display: grid;
  }

  /* Hide the in-field clear X so there aren't two X's next to each other */
  .app-shell.is-details-open .search-clear {
    display: none;
  }

  .app-shell.is-details-open .search-box.has-clear input {
    padding-right: var(--spacing520px);
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Marker pin inside the search field; drop the magnifier (pin-only look) */
  .search-pin {
    display: grid;
  }

  .search-submit {
    display: none;
  }

  .search-clear {
    right: 8px;
  }

  .search-box input {
    padding-left: 44px;
    padding-right: var(--spacing520px);
  }

  .search-box.has-clear input {
    padding-right: 48px;
  }

  /* Uppercase section labels for the sheet/drawer */
  .section-label {
    margin: 0 0 var(--spacing312px);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 16px;
    text-transform: uppercase;
  }

  /* Grouped, frosted map-control capsule */
  .right-map-controls {
    gap: 4px;
    padding: 5px;
    background: rgba(245, 251, 239, 0.94);
    border: 1px solid rgba(171, 175, 181, 0.42);
    border-radius: var(--radiusFull);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
  }

  .right-map-controls button {
    width: 40px;
    height: 40px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .right-map-controls button:hover,
  .right-map-controls button:focus-visible {
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    outline: none;
  }

  .right-map-controls button:nth-child(3) {
    color: var(--colorsGrayLightMode700);
  }
}

@media (max-width: 820px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    position: relative;
    display: block;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .map-viewport,
  .map-stage {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  /* --- Left rail becomes a compact floating pill over the map --- */
  .rail {
    position: absolute;
    top: calc(var(--spacing416px) + var(--safe-top, 0px));
    bottom: auto;
    left: calc(var(--spacing416px) + var(--safe-left, 0px));
    width: auto;
    height: auto;
    grid-template-rows: none;
    gap: 0;
    padding: 6px;
    background: rgba(245, 251, 239, 0.96);
    border: 1px solid rgba(171, 175, 181, 0.42);
    border-radius: var(--radiusFull);
    box-shadow: var(--shadow-md);
    transition:
      opacity 200ms ease,
      transform 200ms ease;
  }

  .rail-menu,
  .rail-chips,
  .rail-footer {
    display: none;
  }

  .rail-main {
    gap: var(--spacing28px);
  }

  .rail-main::before {
    display: none;
  }

  /* Hide the rail while the sheet is expanded to keep the map clean */
  .app-shell:not(.is-panel-collapsed) .rail {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
  }

  /* --- Main sidebar becomes a draggable bottom sheet --- */
  .sheet-handle {
    display: block;
  }

  .search-row {
    margin-top: var(--spacing28px);
  }

  .finder-panel {
    --sheet-peek: 150px;
    position: absolute;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: min(86vh, 760px);
    padding: var(--spacing312px) var(--spacing416px)
      calc(var(--spacing520px) + var(--safe-bottom, 0px));
    background: var(--panel-bg);
    border: 1px solid rgba(171, 175, 181, 0.5);
    border-bottom: 0;
    border-radius: var(--radius3xl) var(--radius3xl) 0 0;
    box-shadow: 0 -12px 34px rgba(32, 33, 36, 0.18);
    transform: translateY(0);
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }

  .finder-panel::before {
    display: none;
  }

  /* Peek state: slide the sheet down, leaving handle + search visible */
  .app-shell.is-panel-collapsed .finder-panel {
    width: 100%;
    padding: var(--spacing312px) var(--spacing416px)
      calc(var(--spacing520px) + var(--safe-bottom, 0px));
    background: var(--panel-bg);
    border: 1px solid rgba(171, 175, 181, 0.5);
    border-bottom: 0;
    box-shadow: 0 -12px 34px rgba(32, 33, 36, 0.18);
    backdrop-filter: blur(18px);
    pointer-events: auto;
    transform: translateY(calc(100% - var(--sheet-peek)));
  }

  /* Keep the search row inside the sheet even when peeked */
  .app-shell.is-panel-collapsed .search-row {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    pointer-events: auto;
  }

  .app-shell.is-panel-collapsed .panel-scroll {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .zoom-controls {
    display: none;
  }

  .right-map-controls {
    top: calc(var(--spacing416px) + var(--safe-top, 0px));
    right: calc(var(--spacing416px) + var(--safe-right, 0px));
  }

  .location-preview-card {
    right: calc(var(--spacing416px) + var(--safe-right, 0px));
    left: calc(var(--spacing416px) + var(--safe-left, 0px));
    bottom: calc(var(--sheet-peek, 128px) + var(--spacing416px) + var(--safe-bottom, 0px));
    width: auto;
  }

  .location-setup-backdrop {
    padding: var(--spacing416px);
  }

  .location-setup-modal {
    width: min(620px, calc(100vw - 32px));
    padding: var(--spacing416px);
  }

  .location-setup-map {
    height: 310px;
  }
}

@media (max-width: 520px) {
  .finder-panel {
    padding-inline: var(--spacing312px);
  }

  .app-shell.is-panel-collapsed .finder-panel {
    padding-inline: var(--spacing312px);
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-box {
    height: 48px;
  }

  .category-card,
  .saved-place {
    height: 54px;
  }

  .place-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .place-action span {
    width: 100%;
    height: 52px;
  }

  .place-info-card {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    padding: var(--spacing312px);
  }

  .location-preview-card {
    right: var(--spacing312px);
    bottom: var(--spacing312px);
    left: 62px;
    grid-template-columns: minmax(0, 1fr) 37px;
  }

  .location-preview-main {
    grid-template-columns: 74px minmax(0, 1fr);
    min-height: 82px;
    gap: var(--spacing28px);
  }

  .preview-art {
    height: 62px;
  }

  .preview-quick-actions {
    display: none;
  }

  .location-preview-close {
    width: 32px;
    height: 32px;
  }

  .location-setup-backdrop {
    align-items: end;
    padding: var(--spacing28px);
  }

  .location-setup-modal {
    width: 100%;
    max-height: calc(100vh - 16px);
    padding: var(--spacing416px);
    border-radius: var(--radius2xl);
  }

  .location-setup-header h2 {
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
  }

  .location-setup-search {
    height: 46px;
  }

  .location-setup-search input {
    font-size: 14px;
  }

  .location-setup-map {
    height: 235px;
    min-height: 220px;
  }

  .setup-marker {
    width: 52px;
    height: 64px;
  }

  .setup-marker svg {
    width: 50px;
    height: 50px;
    padding: 10px;
  }

  .location-setup-save {
    height: 46px;
  }
}

/* ===== Phone landscape: full-screen map + collapsible left drawer ===== */
@media (orientation: landscape) and (max-height: 540px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    position: relative;
    display: block;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .map-viewport,
  .map-stage {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .collapse-button {
    display: none;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Left drawer panel, flush to the screen edge */
  .finder-panel {
    --drawer-tab: 26px;
    position: absolute;
    top: calc(var(--spacing312px) + var(--safe-top, 0px));
    bottom: calc(var(--spacing312px) + var(--safe-bottom, 0px));
    left: 0;
    right: auto;
    width: min(360px, 84vw);
    height: auto;
    max-height: none;
    padding: var(--spacing416px) calc(var(--drawer-tab) + 4px) var(--spacing416px)
      calc(var(--spacing416px) + var(--safe-left, 0px));
    background: var(--panel-bg);
    border: 1px solid rgba(171, 175, 181, 0.5);
    border-left: 0;
    border-radius: 0 var(--radius3xl) var(--radius3xl) 0;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    transform: translateX(0);
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }

  .finder-panel::before {
    display: none;
  }

  /* Minimized: slide the drawer left, leaving the grab-tab at the edge */
  .app-shell.is-panel-collapsed .finder-panel {
    width: min(360px, 84vw);
    padding: var(--spacing416px) calc(var(--drawer-tab) + 4px) var(--spacing416px)
      calc(var(--spacing416px) + var(--safe-left, 0px));
    overflow: hidden;
    background: var(--panel-bg);
    border: 1px solid rgba(171, 175, 181, 0.5);
    border-left: 0;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    pointer-events: auto;
    transform: translateX(calc(-100% + var(--drawer-tab)));
  }

  /* Vertical grab handle on the drawer's right edge (also the pull-tab) */
  .sheet-handle {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: var(--drawer-tab, 26px);
    height: auto;
  }

  .sheet-handle::before {
    top: 50%;
    left: 50%;
    width: 5px;
    height: 42px;
    margin: -21px 0 0 -2.5px;
  }

  .app-shell.is-panel-collapsed .panel-scroll {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .app-shell.is-panel-collapsed .search-row {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
  }

  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .zoom-controls {
    display: none;
  }

  .right-map-controls {
    top: calc(var(--spacing312px) + var(--safe-top, 0px));
    right: calc(var(--spacing312px) + var(--safe-right, 0px));
  }

  .location-preview-card {
    left: calc(var(--spacing312px) + var(--safe-left, 0px));
    right: auto;
    bottom: calc(var(--spacing312px) + var(--safe-bottom, 0px));
    width: min(340px, 80vw);
  }
}

/* ---------------------------------------------------------------------------
   What's New — desktop centered card, phone bottom sheet
--------------------------------------------------------------------------- */
.whatsnew-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--spacing624px);
  background: rgba(32, 33, 36, 0.42);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition:
    opacity 200ms ease,
    backdrop-filter 200ms ease;
  pointer-events: none;
}

.whatsnew-backdrop[hidden] {
  display: none;
}

.whatsnew-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.whatsnew-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(468px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  padding: var(--spacing832px) var(--spacing832px) var(--spacing624px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(205, 208, 212, 0.7);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(32, 33, 36, 0.3);
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition:
    opacity 200ms ease,
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.whatsnew-backdrop.is-visible .whatsnew-sheet {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.whatsnew-grabber {
  display: none;
}

.whatsnew-close {
  position: absolute;
  top: var(--spacing416px);
  right: var(--spacing416px);
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #697386;
  background: transparent;
  border: 0;
  border-radius: var(--radiusFull);
  cursor: pointer;
}

.whatsnew-close:hover {
  color: var(--text);
  background: var(--colorsGrayLightMode50);
}

.whatsnew-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.whatsnew-scroll {
  min-height: 0;
  overflow-y: auto;
}

.whatsnew-head {
  margin-bottom: var(--spacing832px);
}

.whatsnew-title {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: -0.02em;
}

.whatsnew-subtitle {
  margin: var(--spacing28px) 0 0;
  max-width: 34ch;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 450;
  line-height: 22px;
}

.whatsnew-features {
  display: grid;
  gap: var(--spacing624px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.whatsnew-feature {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: var(--spacing416px);
  align-items: start;
}

.whatsnew-feature-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
}

.whatsnew-feature-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.whatsnew-feature-icon.accent-red {
  color: #f04437;
  background: #fee3e1;
}

.whatsnew-feature-icon.accent-amber {
  color: #f78f08;
  background: #feefc6;
}

.whatsnew-feature-icon.accent-indigo {
  color: #4c63e6;
  background: #e6e9fd;
}

.whatsnew-feature-icon.accent-green {
  color: #069454;
  background: #dbf9e6;
}

.whatsnew-feature-copy h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 22px;
}

.whatsnew-feature-copy p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 450;
  line-height: 20px;
}

.whatsnew-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--spacing624px);
}

.whatsnew-continue {
  min-width: 132px;
  height: 44px;
  padding: 0 var(--spacing624px);
  color: var(--colorsBaseWhite);
  font-size: 15px;
  font-weight: 600;
  background: var(--brand);
  border: 0;
  border-radius: var(--radiusFull);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    background 140ms ease,
    transform 140ms ease;
}

.whatsnew-continue:hover {
  background: var(--colorsBrand700);
}

.whatsnew-continue:active {
  transform: scale(0.98);
}

.whatsnew-continue:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(76, 144, 254, 0.28), var(--shadow-sm);
}

/* Phone: dock the card to the bottom as a sheet */
@media (max-width: 820px) {
  .whatsnew-backdrop {
    place-items: end center;
    padding: 0;
    background: rgba(32, 33, 36, 0.44);
  }

  .whatsnew-sheet {
    width: 100%;
    max-height: min(88dvh, 720px);
    padding: var(--spacing520px) var(--spacing624px)
      calc(var(--spacing624px) + var(--safe-bottom, 0px));
    border: 0;
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -18px 60px rgba(32, 33, 36, 0.28);
    transform: translateY(100%);
  }

  .whatsnew-backdrop.is-visible .whatsnew-sheet {
    transform: translateY(0);
  }

  .whatsnew-grabber {
    display: block;
    width: 40px;
    height: 5px;
    margin: 0 auto var(--spacing416px);
    padding: 0;
    background: var(--colorsGrayLightMode200);
    border: 0;
    border-radius: var(--radiusFull);
    cursor: grab;
  }

  .whatsnew-close {
    top: var(--spacing312px);
    right: var(--spacing312px);
  }

  .whatsnew-head {
    margin-bottom: var(--spacing624px);
    padding-right: 36px;
  }

  .whatsnew-title {
    font-size: 24px;
    line-height: 30px;
  }

  .whatsnew-features {
    gap: var(--spacing520px);
  }

  .whatsnew-footer {
    padding-top: var(--spacing624px);
  }

  .whatsnew-continue {
    width: 100%;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
