:root {
  color-scheme: light;
  --ink: #10263a;
  --muted: #557086;
  --aqua: #52d9e5;
  --sea: #0aa6c2;
  --leaf: #92df7f;
  --sun: #ffe37b;
  --pink: #ff9fc6;
  --glass: rgba(255, 255, 255, 0.56);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --line: rgba(255, 255, 255, 0.62);
  --shadow: 0 18px 46px rgba(14, 74, 109, 0.18);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.96), transparent 22%),
    radial-gradient(circle at 82% 12%, rgba(255, 227, 123, 0.75), transparent 22%),
    linear-gradient(135deg, #baf5ff 0%, #f7fff6 36%, #d7f6ff 68%, #fdf4ff 100%);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 18px;
}

.map-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.map-canvas {
  height: 100vh;
  width: 100vw;
  filter: saturate(1.1) contrast(1.03);
  background: #dff8d5;
}

.leaflet-container {
  overflow: hidden;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-container {
  -webkit-tap-highlight-color: transparent;
  font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  border: 0;
  max-width: none !important;
  max-height: none !important;
}

.leaflet-tile-container {
  pointer-events: none;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: visiblePainted;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control {
  float: left;
  clear: both;
}

.leaflet-right .leaflet-control {
  float: right;
  margin-right: 10px;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-popup {
  position: absolute;
  text-align: center;
  margin-bottom: 20px;
}

.leaflet-popup-content-wrapper {
  padding: 1px;
  text-align: left;
}

.leaflet-popup-content {
  margin: 13px 19px;
  line-height: 1.4;
}

.leaflet-popup-tip-container {
  width: 40px;
  height: 20px;
  position: absolute;
  left: 50%;
  margin-left: -20px;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-popup-tip {
  width: 17px;
  height: 17px;
  padding: 1px;
  margin: -10px auto 0;
  transform: rotate(45deg);
}

.map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 38%),
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.28), transparent 18%);
}

.glass-panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.control-dock {
  position: fixed;
  left: 18px;
  bottom: 84px;
  z-index: 2;
  width: min(360px, calc(100vw - 36px));
  max-height: min(620px, calc(100vh - 120px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  transform: translateY(calc(100% + 120px));
  transition: opacity 180ms ease, transform 220ms ease, visibility 180ms ease;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.control-dock::-webkit-scrollbar {
  display: none;
}

.is-panel-open .control-dock {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.is-navigating .control-dock {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 120px));
  visibility: hidden;
}

.panel-toggle-button {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  min-width: 132px;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  color: #08374a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(82, 217, 229, 0.58)),
    var(--aqua);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -8px 14px rgba(10, 166, 194, 0.12),
    0 14px 30px rgba(10, 166, 194, 0.24);
  font-weight: 900;
  transform: translateX(-50%);
}

.is-navigating .panel-toggle-button {
  display: none;
}

.instruction-banner {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 3;
  width: min(560px, calc(100vw - 36px));
  padding: 14px 18px;
  border-radius: 22px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 220ms ease;
}

.instruction-banner.is-visible {
  opacity: 1;
}

.instruction-banner h2 {
  margin: 0;
  font-size: clamp(1.15rem, 3vw, 1.65rem);
}

.arrival-message {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: min(460px, calc(100vw - 36px));
  padding: 22px;
  border-radius: 24px;
  color: var(--ink);
  font-size: clamp(1.7rem, 6vw, 3rem);
  font-weight: 900;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 240ms ease;
}

.arrival-message.is-visible {
  opacity: 1;
}

.end-route-button {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 4;
  width: min(170px, calc(100vw - 40px));
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  color: #ffffff;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.9) 0 8%, transparent 9%),
    linear-gradient(180deg, rgba(255, 160, 160, 0.92), rgba(221, 25, 40, 0.98) 58%, rgba(142, 0, 20, 0.96));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -18px 28px rgba(85, 0, 14, 0.32),
    0 20px 44px rgba(144, 7, 26, 0.34);
  font-size: 1.15rem;
  font-weight: 950;
  transform: translateX(-50%);
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--sea);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-block-start: 0;
}

h1 {
  margin-block-end: 0;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1;
}

h2 {
  margin-block-end: 8px;
  font-size: 1.05rem;
  line-height: 1.1;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

.search-card,
.location-panel,
.directions-panel,
.place-card {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 14px 30px rgba(16, 38, 58, 0.08);
  padding: 12px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.scope-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.36);
}

.scope-toggle label {
  display: block;
  margin: 0;
}

.scope-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scope-toggle span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.scope-toggle input:checked + span {
  color: #08374a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(82, 217, 229, 0.54)),
    var(--aqua);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 18px rgba(10, 166, 194, 0.16);
}

input {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  box-shadow:
    inset 0 2px 10px rgba(10, 166, 194, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  outline: none;
  padding: 13px 14px;
}

input:focus {
  border-color: rgba(10, 166, 194, 0.75);
  box-shadow:
    0 0 0 4px rgba(82, 217, 229, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.search-row button,
.location-button,
.directions-button {
  border: 1px solid rgba(255, 255, 255, 0.82);
  color: #08374a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(82, 217, 229, 0.58)),
    var(--aqua);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -8px 14px rgba(10, 166, 194, 0.12),
    0 10px 22px rgba(10, 166, 194, 0.22);
}

.search-row button {
  width: 48px;
  border-radius: 16px;
  font-size: 1.35rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: #0b5063;
  background: rgba(255, 255, 255, 0.5);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.directions-button,
.location-button {
  min-height: 42px;
  border-radius: 13px;
  font-weight: 800;
}

.directions-button,
.location-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.directions-button {
  justify-content: center;
}

.location-button span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.panel-note {
  margin: 10px 0 0;
  font-size: 0.84rem;
}

.directions-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(146, 223, 127, 0.2)),
    rgba(255, 255, 255, 0.36);
}

.directions-panel p,
.place-card p {
  margin-block-end: 0;
}

.leaflet-control-zoom {
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(14, 74, 109, 0.18) !important;
}

.leaflet-control-zoom a {
  border: 0 !important;
  color: var(--ink) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(82, 217, 229, 0.58)),
    var(--aqua) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 32px rgba(16, 38, 58, 0.18);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.leaflet-popup-content-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100svh;
    padding: 10px;
  }

  .map-canvas {
    height: 100svh;
  }

  .control-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 76px;
    width: auto;
    max-height: 48svh;
    border-radius: 20px;
  }

  .instruction-banner {
    top: 10px;
    width: calc(100vw - 20px);
    border-radius: 20px;
  }

  .end-route-button {
    bottom: 16px;
    width: 136px;
    border-radius: 22px;
  }

  .place-card {
    display: none;
  }
}

@media (max-width: 440px) {
  .search-row {
    grid-template-columns: 1fr;
  }

  .search-row button {
    width: 100%;
    min-height: 44px;
  }
}
