:root {
  color-scheme: dark;
  --bg: #07090d;
  --ink: #f3efe6;
  --muted: #b7c0cc;
  --glass: rgba(10, 14, 20, 0.58);
  --glass-2: rgba(16, 22, 32, 0.72);
  --stroke: rgba(255, 255, 255, 0.14);
  --stroke-2: rgba(255, 255, 255, 0.08);
  --haze: #e6c27a;
  --haze-2: #f0d9a4;
  --cyan: #8ee7dc;
  --danger: #ff8b7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --radius: 18px;
  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

#map { position: absolute; inset: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.hud {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
  padding: calc(10px + env(safe-area-inset-top)) 12px 0;
}
.hud-bottom {
  bottom: 0;
  top: auto;
  padding: 0 12px calc(10px + env(safe-area-inset-bottom));
}

.glass {
  pointer-events: auto;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.bar-layers { margin-top: 8px; padding: 7px 10px; }
.bar-bottom {
  display: grid;
  grid-template-columns: minmax(140px, auto) 1fr minmax(180px, 28%);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 148px;
}
.brand strong { display: block; font-size: 13px; letter-spacing: 0.02em; }
.brand .sub { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background:
    radial-gradient(circle at 30% 30%, var(--haze-2), transparent 42%),
    radial-gradient(circle at 70% 80%, #6a7d8f, #1b242f 70%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.search { position: relative; flex: 1 1 220px; min-width: 180px; display: flex; gap: 6px; }
.search input, .field input, .field select, .icon-btn, .seg-btn, .chip {
  font: inherit;
  color: var(--ink);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--stroke);
  border-radius: 12px;
}
.search input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  outline: none;
}
.search input:focus, .field input:focus, .field select:focus {
  border-color: rgba(230, 194, 122, 0.7);
  box-shadow: 0 0 0 3px rgba(230, 194, 122, 0.18);
}

.suggest {
  position: absolute;
  left: 0;
  right: 46px;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--glass-2);
  backdrop-filter: blur(18px);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  max-height: 280px;
  overflow: auto;
  z-index: 5;
}
.suggest li {
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}
.suggest li small { display: block; color: var(--muted); font-size: 11px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: rgba(230, 194, 122, 0.16); }

.when { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field span { font-size: 10px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.field input, .field select { height: 34px; padding: 0 8px; }
.stepper { display: flex; gap: 4px; }
.icon-btn {
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 600;
}
.icon-btn:hover, .seg-btn:hover, .chip:hover { background: rgba(255,255,255,0.12); }
.icon-btn:active { transform: translateY(1px); }

.step-pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(142, 231, 220, 0.35);
  color: var(--cyan);
  white-space: nowrap;
}

.zoom { display: flex; gap: 4px; }

.presets { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 180px; }
.chip {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.chip.accent {
  background: rgba(230, 194, 122, 0.16);
  border-color: rgba(230, 194, 122, 0.45);
  color: var(--haze-2);
}

.seg { display: flex; padding: 3px; gap: 3px; background: rgba(0,0,0,0.25); border-radius: 12px; border: 1px solid var(--stroke-2); }
.seg-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
  border: 0;
  background: transparent;
}
.seg-btn[aria-pressed="true"] {
  background: rgba(230, 194, 122, 0.22);
  color: var(--haze-2);
}

.toggles { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--haze); }

.clock-local { font-family: var(--mono); font-size: 14px; letter-spacing: 0.02em; font-weight: 600; }
.clock-utc { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: var(--mono); letter-spacing: 0.03em; }
#scrub { width: 100%; accent-color: var(--haze); }
.hint { font-size: 11px; color: var(--muted); text-align: right; }

.attrib {
  pointer-events: auto;
  margin: 8px 4px 0;
  font-size: 11px;
  color: rgba(243, 239, 230, 0.72);
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}
.attrib a { color: var(--haze-2); }

.status, .toast {
  position: absolute;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  background: var(--glass-2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
}
.status { bottom: 118px; color: var(--muted); }
.toast { top: 148px; color: var(--haze-2); max-width: min(520px, 92vw); text-align: center; }

.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { display: none; }
.maplibregl-canvas:focus { outline: none; }

@media (max-width: 860px) {
  .brand { display: none; }
  .bar { padding: 6px 8px; gap: 6px; }
  .bar-layers { margin-top: 6px; }
  .bar-bottom {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px;
  }
  .hint { text-align: left; }
  .hud { padding-left: 8px; padding-right: 8px; }
  .status { bottom: 148px; }
  .toast { top: auto; bottom: 200px; }
  .when { width: 100%; }
  .search { min-width: 100%; flex-basis: 100%; }
  .search input, .icon-btn { height: 34px; }
  .presets { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .chip { flex: 0 0 auto; }
}
