/* style.css */
:root {
  color-scheme: dark;
  --bg: #07131b;
  --panel: rgba(9, 24, 33, 0.93);
  --panel-solid: #0c202b;
  --panel-soft: #102c39;
  --text: #f4fbff;
  --muted: #9bb2bf;
  --line: rgba(181, 223, 234, 0.16);
  --mint: #78e6d2;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #dfeef0;
    --panel: rgba(246, 252, 252, 0.94);
    --panel-solid: #f7fcfc;
    --panel-soft: #eaf5f5;
    --text: #09202b;
    --muted: #59707a;
    --line: rgba(16, 61, 73, 0.15);
    --shadow: 0 18px 55px rgba(13, 46, 55, 0.2);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #dfeef0;
  --panel: rgba(246, 252, 252, 0.94);
  --panel-solid: #f7fcfc;
  --panel-soft: #eaf5f5;
  --text: #09202b;
  --muted: #59707a;
  --line: rgba(16, 61, 73, 0.15);
  --shadow: 0 18px 55px rgba(13, 46, 55, 0.2);
}

* { box-sizing: border-box; }

html, body, #app, #map-shell, #map {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body { background: var(--bg); color: var(--text); }
button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }

#map {
  background:
    radial-gradient(circle at 57% 46%, rgba(86, 159, 175, 0.45), transparent 28%),
    linear-gradient(135deg, #112f37, #0d222c);
}

.leaflet-container { font: inherit; }
.leaflet-control-attribution {
  background: rgba(7, 19, 27, 0.66) !important;
  color: #b8cad2 !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: #d2f9ed !important; }

.map-vignette {
  position: absolute;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 13, 18, 0.44), transparent 19%, transparent 70%, rgba(4, 13, 18, 0.52)),
    linear-gradient(90deg, rgba(4, 13, 18, 0.2), transparent 38%);
}

.topbar, .map-tools, .explorer-panel, .status-pill, .nearby-fab,
.zoom-controls, .map-mode-message, .place-sheet, .route-dock,
.show-route-fab, #toast {
  position: absolute;
  z-index: 500;
}

.topbar {
  top: max(12px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.brand, .top-actions { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 7px;
  border: 0;
  border-radius: 14px;
  background: rgba(7, 19, 27, 0.77);
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.2);
  text-align: left;
  backdrop-filter: blur(12px);
}

.brand strong {
  display: block;
  font-size: 16px;
  line-height: 17px;
  letter-spacing: -0.04em;
}

.brand small {
  display: block;
  color: #b5c8d0;
  font-size: 9px;
  line-height: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-mark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 9px;
  background: linear-gradient(145deg, #71ead5, #3697bd);
}

.brand-mark span {
  flex: 1;
  border-radius: 3px;
  background: #092733;
}

.brand-mark span:nth-child(1) { height: 40%; }
.brand-mark span:nth-child(2) { height: 78%; }
.brand-mark span:nth-child(3) { height: 57%; }

.top-actions { display: flex; gap: 7px; }

.round-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(214, 245, 250, 0.14);
  border-radius: 50%;
  background: rgba(7, 19, 27, 0.77);
  backdrop-filter: blur(12px);
}

.round-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-tools {
  top: calc(max(12px, env(safe-area-inset-top)) + 61px);
  left: 14px;
  right: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(430px, 100%);
  height: 49px;
  padding: 0 8px 0 14px;
  border: 1px solid rgba(214, 245, 250, 0.18);
  border-radius: 15px;
  background: rgba(7, 19, 27, 0.88);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(15px);
}

.search-box svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #b8d0da;
  stroke-width: 2;
  stroke-linecap: round;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 14px;
}

.search-box input::placeholder { color: #94aab4; }

.search-box button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: #b6c7ce;
  background: transparent;
  font-size: 25px;
  line-height: 1;
}

.filter-row {
  display: flex;
  gap: 7px;
  width: 100%;
  margin-top: 9px;
  padding: 1px 2px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar,
.place-list::-webkit-scrollbar,
.route-stops::-webkit-scrollbar { display: none; }

.filter {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(220, 243, 248, 0.13);
  border-radius: 999px;
  color: #cee0e5;
  background: rgba(8, 23, 31, 0.77);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(9px);
}

.filter.active {
  border-color: transparent;
  color: #05232a;
  background: var(--mint);
  box-shadow: 0 3px 15px rgba(94, 229, 205, 0.3);
}

.zoom-controls {
  top: 203px;
  right: 14px;
  overflow: hidden;
  border: 1px solid rgba(214, 245, 250, 0.15);
  border-radius: 13px;
  box-shadow: var(--shadow);
}

.zoom-controls button {
  display: block;
  width: 44px;
  height: 43px;
  border: 0;
  background: rgba(7, 19, 27, 0.9);
  font-size: 24px;
  font-weight: 300;
}

.zoom-controls button + button { border-top: 1px solid var(--line); }

.status-pill {
  top: 205px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #d7e9ee;
  background: rgba(7, 19, 27, 0.78);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(120, 230, 210, 0.15);
}

.nearby-fab {
  top: 255px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: #dffdf7;
  background: #123b42;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 800;
}

.nearby-fab svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--mint);
  stroke-width: 1.9;
}

.site-marker-wrap, .route-marker-wrap {
  border: 0;
  background: transparent;
}

.site-marker {
  display: block;
  width: 15px;
  height: 15px;
  border: 3px solid rgba(246, 255, 255, 0.96);
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.54), 0 0 0 4px color-mix(in srgb, var(--marker-color), transparent 72%);
  transition: transform 0.16s ease;
}

.site-marker:hover { transform: scale(1.35); }

.route-marker {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 3px solid white;
  border-radius: 50%;
  color: #06252e;
  background: var(--mint);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36);
  font-size: 13px;
  font-weight: 900;
}

.adding-pin { cursor: crosshair !important; }

.map-mode-message {
  top: 303px;
  left: 14px;
  max-width: 206px;
  padding: 12px;
  border: 1px solid rgba(120, 230, 210, 0.38);
  border-radius: 13px;
  background: #10353a;
  box-shadow: var(--shadow);
}

.map-mode-message strong, .map-mode-message span { display: block; }
.map-mode-message strong { color: var(--mint); font-size: 12px; }
.map-mode-message span { margin-top: 3px; color: #e2f5f5; font-size: 11px; }

.map-mode-message button {
  min-height: 33px;
  margin-top: 9px;
  padding: 0 10px;
  border: 1px solid rgba(217, 250, 247, 0.25);
  border-radius: 8px;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.explorer-panel {
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 14px;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100% - 28px));
  max-height: min(66vh, 615px);
  overflow: hidden;
  border: 1px solid rgba(211, 242, 247, 0.12);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(17px);
  transition: opacity 0.18s ease, transform 0.2s ease, max-height 0.25s ease;
}

.explorer-panel.dimmed { opacity: 0.62; }
.panel-handle { display: none; }

.panel-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 72px;
  padding: 17px 17px 8px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--mint);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.panel-head h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.panel-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  line-height: 1;
}

.circuit-card {
  position: relative;
  min-height: 91px;
  margin: 0 13px 13px;
  overflow: hidden;
  border: 1px solid rgba(122, 230, 211, 0.19);
  border-radius: 15px;
  background: linear-gradient(120deg, rgba(50, 135, 132, 0.3), rgba(36, 62, 89, 0.49)), #143743;
}

.circuit-orbit {
  position: absolute;
  border: 1px solid rgba(131, 234, 214, 0.22);
  border-radius: 50%;
}

.orbit-one { top: -100px; right: -20px; width: 174px; height: 174px; }
.orbit-two { top: -52px; right: 47px; width: 125px; height: 125px; }

.circuit-copy {
  position: relative;
  padding: 14px;
  color: #c7e5e6;
  font-size: 12px;
  line-height: 15px;
}

.circuit-copy span {
  color: #fff;
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.07em;
}

.start-route-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-height: 35px;
  padding: 0 10px;
  border: 1px solid rgba(213, 253, 242, 0.28);
  border-radius: 10px;
  color: #ecfffa;
  background: rgba(5, 30, 37, 0.42);
  font-size: 11px;
  font-weight: 800;
}

.start-route-btn span {
  color: var(--mint);
  font-size: 18px;
  vertical-align: -1px;
}

.panel-subhead {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  padding: 0 17px 10px;
  color: var(--muted);
  font-size: 11px;
}

.panel-subhead strong { color: var(--text); font-size: 12px; }

.place-list {
  min-height: 0;
  padding: 0 11px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.place-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 11px;
  min-height: 101px;
  margin-bottom: 8px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 15px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.place-card:hover, .place-card:focus-visible {
  border-color: rgba(125, 230, 212, 0.38);
  background: rgba(125, 230, 212, 0.09);
}

.card-photo {
  position: relative;
  min-height: 87px;
  overflow: hidden;
  border-radius: 10px;
  background-position: center;
  background-size: cover;
  background-color: #1d4551;
}

.card-photo span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(224, 255, 249, 0.72);
  font-size: 26px;
  font-weight: 900;
}

.card-photo-image {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-loading {
  background: linear-gradient(120deg, rgba(123, 230, 209, 0.1), rgba(115, 157, 255, 0.24)), #143640;
}

.card-copy { min-width: 0; }

.card-category {
  color: var(--category-color);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.card-copy h3 {
  margin: 3px 0 4px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 16px;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  color: #9cb2ba;
  font-size: 9px;
}

.card-foot button {
  width: 29px;
  height: 29px;
  margin: -4px -2px -4px 6px;
  border: 1px solid rgba(127, 235, 215, 0.35);
  border-radius: 9px;
  color: var(--mint);
  background: rgba(87, 213, 193, 0.09);
  font-size: 21px;
  line-height: 20px;
}

.empty-state { padding: 28px 17px; text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { font-size: 14px; }
.empty-state span { margin-top: 5px; color: var(--muted); font-size: 12px; }

.explorer-panel.collapsed { max-height: 72px; }
.explorer-panel.collapsed .circuit-card,
.explorer-panel.collapsed .panel-subhead,
.explorer-panel.collapsed .place-list { display: none; }

.place-sheet {
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  width: min(440px, calc(100% - 28px));
  overflow: hidden;
  border: 1px solid rgba(210, 244, 246, 0.16);
  border-radius: 22px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 40px));
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1), opacity 0.2s ease;
}

.place-sheet.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.sheet-grabber { display: none; }

.sheet-close {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  width: 37px;
  height: 37px;
  border: 1px solid rgba(241, 255, 255, 0.29);
  border-radius: 50%;
  color: white;
  background: rgba(4, 15, 20, 0.52);
  font-size: 25px;
  line-height: 1;
}

.place-visual {
  position: relative;
  height: 176px;
  overflow: hidden;
  background: radial-gradient(circle at 72% 20%, rgba(126, 234, 213, 0.54), transparent 26%), linear-gradient(135deg, #1c5363, #162447);
}

.place-photo-image {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual-fallback {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 23px;
  background: linear-gradient(0deg, rgba(4, 18, 26, 0.72), transparent 72%);
}

.visual-fallback span {
  color: var(--mint);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.visual-fallback strong {
  max-width: 80%;
  margin-top: 4px;
  font-size: 22px;
  letter-spacing: -0.045em;
}

.photo-credit {
  position: absolute;
  z-index: 3;
  right: 11px;
  bottom: 8px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 9px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.sheet-content { padding: 18px; }

.sheet-content h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.place-location {
  margin: 7px 0 12px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 700;
}

.place-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 17px;
}

.primary-action, .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 11px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
}

.primary-action {
  flex: 1;
  border: 0;
  color: #06232b;
  background: var(--mint);
}

.primary-action:disabled {
  color: #9bb6b7;
  background: #254650;
}

.secondary-action {
  flex: 1.16;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-soft);
}

.route-dock {
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(350px, calc(100% - 28px));
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(120, 230, 210, 0.26);
  border-radius: 18px;
  background: rgba(8, 30, 36, 0.95);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.route-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.route-topline .eyebrow { margin-bottom: 2px; }
.route-topline strong { color: white; font-size: 14px; }

.route-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.route-actions button {
  min-height: 34px;
  border: 0;
  color: #b9cdd2;
  background: transparent;
  font-size: 11px;
}

.route-actions button:last-child { font-size: 20px; }

.route-stops {
  max-height: 130px;
  margin: 11px 0;
  overflow: auto;
}

.route-stop {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 37px;
  cursor: pointer;
}

.stop-number {
  display: grid;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #08262d;
  background: var(--mint);
  font-size: 10px;
  font-weight: 900;
}

.stop-name {
  flex: 1;
  overflow: hidden;
  color: #e9f6f6;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-stop button {
  width: 34px;
  height: 34px;
  border: 0;
  color: #a1b9bf;
  background: transparent;
  font-size: 20px;
}

.route-bottom { display: flex; gap: 8px; }

.add-route-stop, .navigate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.add-route-stop {
  flex: 1;
  border: 1px solid rgba(188, 234, 228, 0.19);
  color: #dcf7f4;
  background: transparent;
}

.navigate-btn {
  flex: 1.1;
  border: 0;
  color: #08252b;
  background: var(--mint);
}

.navigate-btn.disabled {
  pointer-events: auto;
  opacity: 0.43;
}

.show-route-fab {
  right: 14px;
  bottom: max(18px, env(safe-area-inset-bottom));
  min-height: 45px;
  padding: 0 14px;
  border: 1px solid rgba(125, 231, 212, 0.35);
  border-radius: 999px;
  color: #e8ffff;
  background: #113b42;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 800;
}

.show-route-fab span {
  margin-right: 4px;
  color: var(--mint);
}

#toast {
  bottom: 24px;
  left: 50%;
  max-width: calc(100% - 38px);
  padding: 11px 15px;
  border: 1px solid rgba(197, 246, 238, 0.2);
  border-radius: 999px;
  color: #efffff;
  background: rgba(5, 26, 32, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transform: translate(-50%, 25px);
  transition: 0.2s ease;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 840px) {
  .map-tools { top: 94px; left: 28px; }
  .topbar { top: 22px; left: 28px; right: 28px; }
  .status-pill, .nearby-fab { left: 28px; }
  .status-pill { top: 217px; }
  .nearby-fab { top: 267px; }
  .zoom-controls { top: 105px; right: 28px; }
  .explorer-panel { bottom: 28px; left: 28px; }
  .route-dock, .show-route-fab { right: 28px; bottom: 28px; }
  .place-sheet.open { bottom: 28px; }
}

@media (max-width: 650px) {
  .topbar {
    top: max(8px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
  }

  .brand { padding-right: 8px; }
  .brand small { font-size: 8px; }

  .map-tools {
    top: calc(max(8px, env(safe-area-inset-top)) + 57px);
    left: 10px;
    right: 10px;
  }

  .search-box { height: 47px; }
  .status-pill { top: 198px; left: 10px; }
  .nearby-fab { top: 247px; left: 10px; }
  .zoom-controls { top: 198px; right: 10px; }
  .map-mode-message { top: 297px; left: 10px; }

  .explorer-panel {
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 47vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }

  .panel-handle {
    display: block;
    flex: 0 0 auto;
    width: 40px;
    height: 4px;
    margin: 8px auto -5px;
    border-radius: 9px;
    background: rgba(215, 245, 246, 0.29);
  }

  .panel-head {
    min-height: 64px;
    padding: 13px 16px 7px;
  }

  .panel-head h1 { font-size: 20px; }
  .circuit-card { display: none; }
  .place-list { padding-bottom: max(12px, env(safe-area-inset-bottom)); }

  .place-card {
    grid-template-columns: 68px minmax(0, 1fr);
    min-height: 86px;
  }

  .card-photo { min-height: 72px; }

  .place-sheet {
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 86vh;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
    transform: translateY(105%);
  }

  .place-sheet.open { transform: translateY(0); }

  .sheet-grabber {
    position: absolute;
    z-index: 5;
    top: 8px;
    left: 50%;
    display: block;
    width: 39px;
    height: 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.6);
    transform: translateX(-50%);
  }

  .place-visual { height: 205px; }

  .sheet-content {
    padding: 18px 16px max(20px, env(safe-area-inset-bottom));
  }

  .sheet-content h2 { font-size: 25px; }

  .route-dock {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
  }

  .show-route-fab {
    right: 10px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  #toast { bottom: max(14px, env(safe-area-inset-bottom)); }

  .explorer-panel:has(+ .place-sheet.open) {
    transform: translateY(100%);
  }
}

@media (max-width: 370px) {
  .brand strong { font-size: 14px; }

  .brand small {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .round-btn { width: 40px; height: 40px; }
  .top-actions { gap: 5px; }
  .filter { padding: 0 11px; }
  .sheet-actions { flex-direction: column; }
}

.leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) saturate(0.45) brightness(0.72) contrast(1.15);
}
