:root {
  --bg: #111210;
  --sidebar: #161714;
  --panel: rgba(20, 20, 18, 0.93);
  --panel-solid: #1c1c1a;
  --card: #1a1a18;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #f0ede8;
  --muted: #8a877e;
  --accent: #c8a55a;
  --accent-2: #b8904a;
  --start: #5a9e6a;
  --ziel: #c45c5c;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
#app { display: flex; height: 100%; }

/* ============ SIDEBAR ============ */
#sidebar {
  width: 340px;
  flex: 0 0 340px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
  z-index: 1200;
}
#app.collapsed #sidebar { margin-left: -340px; }

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  font-size: 22px;
  filter: drop-shadow(0 0 6px rgba(200, 165, 90, 0.4));
}
.brand-title { font-weight: 800; font-size: 18px; letter-spacing: 0.2px; }
.brand-title span { color: var(--accent); }
.brand-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.side-scroll { flex: 1; overflow-y: auto; padding: 4px 16px 16px; }
.side-scroll::-webkit-scrollbar { width: 8px; }
.side-scroll::-webkit-scrollbar-thumb { background: #2e2d2a; border-radius: 8px; }

.panel { padding: 16px 0; border-bottom: 1px solid var(--border); }
.panel:last-child { border-bottom: none; }
.panel-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.panel-title .hint, .hint { color: var(--muted); cursor: help; font-size: 11px; }
.sub-label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 6px; }

/* route fields */
.route-fields { position: relative; }
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  transition: border-color 0.15s;
}
.field:focus-within { border-color: var(--accent); }
.field.invalid {
  border-color: rgba(255, 90, 95, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 90, 95, 0.28) inset;
}
.field + .field { margin-top: 0; }
.pin { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; }
.pin.start { background: var(--start); box-shadow: 0 0 0 3px rgba(90, 158, 106, 0.2); }
.pin.ziel { background: var(--ziel); box-shadow: 0 0 0 3px rgba(196, 92, 92, 0.2); }
.field-input { flex: 1; min-width: 0; }
.field-input label { display: block; font-size: 10px; color: var(--muted); }
.field-input input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  padding: 1px 0;
  outline: none;
}
.field-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  line-height: 1;
}
.field-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.swap-btn {
  display: block;
  margin: 6px 0 6px auto;
  margin-right: 56px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
}
.swap-btn:hover { border-color: var(--accent); }
.route-status {
  min-height: 17px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.route-status.ok { color: #8ec89a; }
.route-status.info { color: #c8b87a; }
.route-status.error { color: #c87a7a; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: "▾";
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
#mode-travel {
  width: 100%;
  appearance: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 13px;
  cursor: pointer;
}

/* preferences */
.pref { margin-bottom: 16px; }
.pref-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; margin-bottom: 8px;
}
.pref-head b { color: var(--accent); font-variant-numeric: tabular-nums; }
.pref-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 5px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--p, 50%), #2a2a28 var(--p, 50%));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent-2);
  cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent-2); cursor: pointer;
}

.cta {
  width: 100%;
  margin-top: 8px;
  background: var(--accent);
  color: #1a1208;
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 10px;
  padding: 13px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 165, 90, 0.22);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.cta:hover { background: #d4b06a; box-shadow: 0 6px 22px rgba(200, 165, 90, 0.35); }
.cta:active { transform: translateY(1px); }
.cta.loading { opacity: 0.7; pointer-events: none; }

/* route details */
#route-details .empty {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border: 1px dashed var(--border-strong);
  border-radius: 10px; padding: 14px;
}
.empty-ico { font-size: 22px; }
#route-details .empty b { font-size: 13px; }
#route-details .empty p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }

.route-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.route-card + .route-card { margin-top: 8px; }
.route-card:hover:not(.selected) { border-color: var(--border-strong); background: #132030; }
.route-card.selected { border-color: var(--accent); box-shadow: -2px 0 0 var(--accent) inset; }
.rc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rc-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .4px; }
.rc-badge.cool { background: rgba(200,165,90,.15); color: var(--accent); }
.rc-badge.fast { background: rgba(255,255,255,.08); color: var(--muted); }
.rc-comfort { font-size: 12px; font-weight: 700; }
.rc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.stat { background: rgba(255,255,255,.03); border-radius: 8px; padding: 8px 10px; transition: background 0.15s; }
.stat:hover { background: rgba(255,255,255,.07); }
.stat .v { font-size: 16px; font-weight: 700; }
.stat .k { font-size: 10px; color: var(--muted); }
.heatbar { height: 6px; border-radius: 6px; margin-top: 10px; background: linear-gradient(90deg,#2ecc71,#f1c40f,#e67e22,#e74c3c); position: relative; }
.heatbar i { position: absolute; top: -3px; width: 3px; height: 12px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }

.side-foot {
  display: flex; border-top: 1px solid var(--border);
}
.foot-btn {
  flex: 1; background: transparent; border: none; color: var(--muted);
  font-size: 10.5px; padding: 10px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.foot-btn span { font-size: 16px; }
.foot-btn:hover, .foot-btn.active { color: var(--accent); background: rgba(200,165,90,.07); }

/* ============ MAP AREA ============ */
#map-wrap { position: relative; flex: 1; min-width: 0; }
#map  { position: absolute; inset: 0; background: #0e0e0c; }
#map3d { position: absolute; inset: 0; background: #0e0e0c; }

/* collapse handle when sidebar hidden */
#app.collapsed #collapse { transform: rotate(180deg); }

.icon-btn {
  background: var(--panel-solid); border: 1px solid var(--border);
  color: var(--muted); width: 28px; height: 28px; border-radius: 8px;
  cursor: pointer; font-size: 14px; line-height: 1;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* top mode tabs — centered in the area left of the weather pill (right: 242px = 16 margin + 210 pill + 16 gap) */
#modes {
  position: absolute; top: 14px; left: 0; right: 242px; margin: 0 auto; width: fit-content;
  max-width: calc(100% - 242px); /* never extend under the weather pill */
  z-index: 1000; display: flex; gap: 2px;
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 12px; padding: 5px;
  box-shadow: var(--shadow);
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
#modes::-webkit-scrollbar { display: none; }
.mode-btn {
  display: flex; align-items: center; gap: 7px;
  border: none; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 9px 14px;
  border-radius: 9px; cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
}
.mode-btn span { font-size: 14px; }
.mode-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.mode-btn.active { color: #1a1208; background: var(--accent); }

/* weather pill — narrow card so it never overlaps mode buttons */
#weather-pill {
  position: absolute; top: 16px; right: 16px; z-index: 1000;
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: 12px; box-shadow: var(--shadow);
  max-width: 210px;
}
#weather-pill .src { color: var(--muted); font-size: 10.5px; display: block; margin-top: 2px; }

/* hover readout */
#hover-readout {
  position: absolute; z-index: 1100; pointer-events: none;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 6px 9px; font-size: 11.5px;
  box-shadow: var(--shadow); transform: translate(12px, 12px);
  white-space: nowrap;
}
#hover-readout b { font-size: 13px; color: var(--text); }
#hover-readout span { display: block; color: var(--muted); }

/* legend */
#legend {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 1000; width: min(560px, calc(100% - 120px));
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 18px 14px; box-shadow: var(--shadow);
}
#legend-title { text-align: center; font-size: 13px; font-weight: 700; margin-bottom: 9px; }
.gradient {
  height: 12px; border-radius: 7px;
  background: linear-gradient(to right,
    rgb(8,48,107), rgb(33,113,181), rgb(44,166,164),
    rgb(173,221,142), rgb(255,233,138), rgb(245,127,23), rgb(183,28,28));
}
.labels { display: flex; justify-content: space-between; margin-top: 7px; }
.labels div { display: flex; flex-direction: column; font-size: 11px; }
.labels .mid { align-items: center; }
.labels .end { align-items: flex-end; }
.labels b { font-size: 11.5px; }
.labels span { color: var(--muted); font-size: 10.5px; }
.disclaimer { margin: 9px 0 0; text-align: center; font-size: 10px; color: var(--muted); }
.disclaimer b { color: #cdd9e3; }

/* floating panels */
.float-panel {
  position: absolute; left: 16px; bottom: 70px; z-index: 1100;
  width: 250px; background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 14px; box-shadow: var(--shadow);
}
.float-panel h4 { margin: 0 0 10px; font-size: 13px; }
.float-panel .row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin: 10px 0 4px; color: var(--muted); }
.float-panel .row b { color: var(--accent); }
.float-panel .toggle { cursor: pointer; }
.float-panel .toggle input { accent-color: var(--accent); margin-right: 6px; }
.float-panel p { font-size: 11.5px; line-height: 1.5; color: var(--text); margin: 0 0 8px; }
.float-panel p.muted { color: var(--muted); font-size: 10.5px; }
.mini-btn { width: 100%; margin-top: 8px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px; cursor: pointer; font-size: 12px; }
.mini-btn:hover { border-color: var(--accent); }
.seg { display: flex; gap: 4px; margin: 4px 0 2px; }
.seg button {
  flex: 1; padding: 7px 4px; font-size: 11.5px; cursor: pointer;
  background: var(--card); color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; transition: all .15s;
}
.seg button:hover { color: var(--text); border-color: var(--accent); }
.seg button.active { background: var(--accent); color: #1a1208; border-color: var(--accent); font-weight: 600; }

/* route-loading progress bar — thin accent line at top of map */
#map-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 2000;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 40%, var(--accent-2) 50%, var(--accent) 60%, transparent 100%);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.2s;
  animation: progress-scan 1.4s linear infinite;
}
#app.routing #map-wrap::before { opacity: 1; }
@keyframes progress-scan {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* leaflet dark tweaks */
.leaflet-control-zoom a, .leaflet-bar a {
  background: var(--panel-solid) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover { background: #262623 !important; }
.leaflet-control-attribution {
  background: rgba(10,10,8,.75) !important;
  color: var(--muted) !important;
}
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-tooltip {
  background: var(--panel-solid); color: var(--text);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  font-size: 12px;
}
.leaflet-tooltip-top:before { border-top-color: var(--panel-solid); }

/* map markers */
.map-pin {
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 4px 9px; font-size: 11px; font-weight: 700;
  white-space: nowrap; box-shadow: var(--shadow); text-align: center;
}
.map-pin small { display: block; font-weight: 500; color: var(--muted); font-size: 9.5px; }
.map-pin.start { border-bottom: 2px solid var(--start); }
.map-pin.ziel { border-bottom: 2px solid var(--ziel); }

#locate-btn { font-size: 16px; }

/* ---- address autocomplete dropdown ---- */
.ac-dropdown {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.6);
  z-index: 1500;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.ac-dropdown:empty { display: none; }
.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.focused { background: rgba(200,165,90,.12); }
.ac-item-icon { font-size: 14px; flex-shrink: 0; opacity: 0.8; }
.ac-item-text { flex: 1; min-width: 0; }
.ac-item-main { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  padding: 2px 6px; border-radius: 10px; flex-shrink: 0;
}
.ac-item-badge.preset { background: rgba(200,165,90,.18); color: var(--accent); }
.ac-item-badge.geo { background: rgba(255,255,255,.07); color: var(--muted); }

.layer-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

#shademap-controls {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ---- heat warning banner ---- */
.heat-banner {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 1300;
  padding: 9px 16px;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}
.heat-banner.warn    { background: rgba(200,120,30,0.92); color: #fff; }
.heat-banner.extreme { background: rgba(180,30,30,0.95); color: #fff; }

/* push mode tabs (and weather pill) below the banner when it is visible */
#map-wrap:has(.heat-banner:not([hidden])) #modes { top: 50px; }
#map-wrap:has(.heat-banner:not([hidden])) #weather-pill { top: 50px; }

/* ---- routing engine badge ---- */
.routing-badge {
  background: rgba(90,180,120,0.12);
  border: 1px solid rgba(90,180,120,0.3);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 10.5px;
  color: #8ec89a;
  margin-bottom: 8px;
}
.routing-badge-fallback {
  background: rgba(200,165,90,0.08);
  border-color: rgba(200,165,90,0.2);
  color: var(--muted);
}

/* ---- tradeoff bar in route details ---- */
.tradeoff-bar {
  background: rgba(200,165,90,0.1);
  border: 1px solid rgba(200,165,90,0.22);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.tradeoff-bar b { color: var(--accent); }

/* ---- "why cooler" line in route cards ---- */
.rc-why {
  font-size: 10.5px;
  color: var(--muted);
  margin: -2px 0 7px;
  line-height: 1.4;
}

/* ---- scenario box ---- */
.scenario-box {
  background: rgba(90,160,90,0.07);
  border: 1px solid rgba(90,160,90,0.2);
  border-radius: 8px;
  padding: 10px;
  margin-top: 4px;
}
.scenario-plant-active { cursor: crosshair !important; }

/* ---- cool-place POI markers ---- */
.cool-poi-marker {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  cursor: pointer;
}
.cool-poi-water   { border-color: #3ab4f2; }
.cool-poi-shade   { border-color: #4caf50; }
.cool-poi-building { border-color: var(--accent); }

/* Mobile FAB: hidden on desktop */
#mobile-open-btn { display: none; }

/* Sidebar overlay (mobile tap-to-close) */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0,0,0,0.4);
}
#app.sidebar-open #sidebar-overlay { display: block; }

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 760px) {
  /* Sidebar slides up from the bottom as a drawer */
  #sidebar {
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: 70vh;
    flex: unset;
    border-right: none;
    border-top: 1px solid var(--border-strong);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,.65);
    z-index: 1200;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    transform: translateY(0);
  }
  #app.collapsed #sidebar {
    transform: translateY(calc(100% - 56px));
    margin-left: 0;
  }

  /* Drag handle at top of drawer */
  .side-head::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
  }
  .side-head {
    position: relative;
    padding-top: 20px;
    cursor: pointer;
    user-select: none;
  }

  /* Collapse button becomes a chevron indicator */
  #collapse {
    transform: rotate(90deg);
    transition: transform 0.3s ease;
  }
  #app.collapsed #collapse {
    transform: rotate(-90deg);
  }

  /* Compact scrollable content inside drawer */
  .side-scroll {
    max-height: calc(70vh - 120px);
    padding: 4px 14px 100px;
  }

  /* Bigger touch targets for inputs and buttons */
  .field-input input { font-size: 16px; padding: 3px 0; }
  .field { padding: 10px 10px; }
  .field-btn { width: 32px; height: 32px; font-size: 18px; }
  .cta { padding: 16px; font-size: 15px; }
  #mode-travel { padding: 13px 12px; font-size: 15px; }

  /* Map covers full screen */
  #map-wrap { height: 100%; width: 100%; }

  /* Mode tabs: compact, scrollable row at top */
  #modes {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    width: auto;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  #modes::-webkit-scrollbar { display: none; }
  .mode-btn {
    font-size: 11px;
    padding: 7px 10px;
    gap: 4px;
  }
  .mode-btn span { font-size: 13px; }

  /* keep tabs below heat banner on mobile too */
  #map-wrap:has(.heat-banner:not([hidden])) #modes { top: 46px; }

  /* Weather pill: compact top-right */
  #weather-pill {
    top: 10px;
    right: 10px;
    max-width: 140px;
    font-size: 11px;
    padding: 6px 9px;
    display: none; /* hidden on mobile — accessed via sidebar instead */
  }

  /* Legend: full width at bottom, compact */
  #legend {
    bottom: 66px; /* above the drawer handle area */
    left: 10px;
    right: 10px;
    width: auto;
    transform: none;
    padding: 10px 14px 12px;
  }
  #legend-title { font-size: 11.5px; }
  .labels div { font-size: 10px; }
  .labels b { font-size: 10.5px; }
  .disclaimer { font-size: 9px; }

  /* Float panels: full width at bottom */
  .float-panel {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 66px;
  }

  /* Show mobile FAB */
  #mobile-open-btn { display: flex; }

  /* Autocomplete dropdown: larger touch targets */
  .ac-item { padding: 12px 14px; font-size: 13px; }
  .ac-dropdown { max-height: 240px; }

  /* Hover readout hidden on touch */
  #hover-readout { display: none !important; }

  /* Leaflet zoom controls: move to avoid sidebar */
  .leaflet-top.leaflet-right {
    top: 56px;
  }

  /* Mobile FAB: open drawer button */
  #mobile-open-btn {
    align-items: center;
    gap: 8px;
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    background: var(--accent);
    color: #1a1208;
    font-weight: 700;
    font-size: 14px;
    border: none;
    border-radius: 24px;
    padding: 12px 22px;
    box-shadow: 0 4px 20px rgba(200,165,90,0.45);
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
  }
  #app.collapsed #mobile-open-btn { opacity: 1; pointer-events: auto; }
  #app:not(.collapsed) #mobile-open-btn { opacity: 0; pointer-events: none; }
}

/* Very small screens (iPhone SE etc.) */
@media (max-width: 380px) {
  .mode-btn { font-size: 10px; padding: 6px 8px; }
  .mode-btn span { display: none; }
  #legend { display: none; }
}

/* Tablet: sidebar narrower */
@media (min-width: 761px) and (max-width: 1024px) {
  #sidebar { width: 300px; flex: 0 0 300px; }
  #app.collapsed #sidebar { margin-left: -300px; }
}
