:root {
  --teal: #0f8b8d; --teal-soft: #e0f2f1; --ink: #17212b; --muted: #5d6b78;
  --card: #ffffff; --line: #e3e8ec; --bg: #eef2f4;
  --great: #6a3d9a; --good: #2171b5; --fair: #41b6c4; --thin: #9aa3ab;
  --radius: 18px; --shadow: 0 2px 10px rgba(20, 40, 60, .16);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
#map { position: fixed; inset: 0; }
.ui { position: fixed; left: 0; right: 0; z-index: 2; pointer-events: none; padding: 0 12px; }
.ui > * { pointer-events: auto; }
.ui.top { top: max(10px, env(safe-area-inset-top)); display: grid; gap: 8px; max-width: 520px; }
.ui.bottom { bottom: max(6px, env(safe-area-inset-bottom)); display: grid; gap: 8px; max-width: 560px; }
.ui.side { top: 150px; left: auto; right: 0; display: grid; gap: 10px; justify-items: end; padding-right: 12px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

.search { position: relative; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 48px; }
.search svg { width: 22px; height: 22px; fill: var(--ink); flex: none; }
.search input { flex: 1; border: 0; outline: 0; font-size: 16px; background: transparent; color: var(--ink); min-width: 0; }
.results { position: absolute; left: 0; right: 0; top: 52px; margin: 0; padding: 6px 0; list-style: none;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow); max-height: 50vh; overflow: auto; }
.results li { padding: 9px 16px; cursor: pointer; }
.results li small { color: var(--muted); display: block; }
.results li[aria-selected="true"], .results li:hover { background: var(--teal-soft); }

.legend { padding: 8px 14px; font-size: 14px; }
.lg-row { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.lg-title { grid-row: 1 / 3; font-weight: 600; font-size: 17px; }
.lg-title small { font-weight: 400; color: var(--muted); font-size: 13px; }
.ramp { height: 9px; border-radius: 5px;
  background: linear-gradient(90deg, #c6dbef 0%, #9ecae1 6%, #6baed6 16%, #4292c6 33%, #2171b5 66%, #08519c 100%); }
.lg-ticks { position: relative; height: 14px; font-size: 11px; color: var(--muted); }
.lg-ticks span { position: absolute; top: 0; }
.lg-ticks span:nth-child(1) { left: 0; } .lg-ticks span:nth-child(2) { left: 33%; transform: translateX(-50%); } .lg-ticks span:nth-child(3) { right: 0; }
.lg-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.fab { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 24px; height: 24px; fill: var(--ink); }
.layers { padding: 10px 14px; display: grid; gap: 8px; font-size: 14px; }
.layers input { accent-color: var(--teal); }

.days { padding: 10px 12px 8px; }
.days-head { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.pill { background: var(--teal-soft); color: var(--teal); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.hint { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; }
.day-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 8px; }
.day-chips button { border: 0; background: transparent; border-radius: 12px; padding: 5px 0; font: inherit; font-size: 13px;
  color: var(--muted); cursor: pointer; line-height: 1.25; }
.day-chips button b { display: block; font-size: 16px; color: var(--ink); }
.day-chips button[aria-selected="true"] { background: var(--teal-soft); color: var(--teal); outline: 2px solid var(--teal); }
.day-chips button[aria-selected="true"] b { color: var(--teal); }
.day-chips button:disabled { opacity: .35; cursor: default; }

.app-banner { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; font-size: 13.5px; }
.app-banner span { flex: 1; }
.btn { background: var(--teal); color: #fff; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 600;
  text-decoration: none; font-size: 14px; white-space: nowrap; cursor: pointer; }
.x { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; padding: 0 6px; }
.foot { margin: 0; text-align: center; font-size: 11.5px; color: var(--muted); background: rgba(255,255,255,.8);
  border-radius: 10px; padding: 3px 8px; justify-self: center; }
.foot a, .link { color: var(--muted); }
.link { border: 0; background: none; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }

.maplibregl-popup-content { border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 14px; min-width: 220px; }
.pop h3 { margin: 0 0 2px; font-size: 16px; }
.pop .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.pop dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; margin: 0 0 8px; }
.pop dt { color: var(--muted); } .pop dd { margin: 0; font-weight: 600; text-align: right; }
.pop .rate { display: inline-block; border-radius: 999px; padding: 1px 9px; color: #fff; font-size: 12px; font-weight: 600; }
.pop .note { color: var(--muted); font-size: 11.5px; margin: 6px 0; }
.pop a.more { display: block; text-align: center; margin-top: 6px; }
.pop .bul { font-size: 12.5px; }
.r-great { background: var(--great); } .r-good { background: var(--good); } .r-fair { background: var(--fair); } .r-thin { background: var(--thin); }
.maplibregl-ctrl-attrib { font-size: 10.5px; }
.maplibregl-ctrl-bottom-right { bottom: 190px; }
dialog { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); max-width: min(560px, 92vw); font-size: 13.5px; }
dialog h2 { margin-top: 0; font-size: 18px; }
dialog li { margin-bottom: 6px; }
.noscript { position: fixed; inset: 0; z-index: 9; background: #fff; padding: 24px; }

@media (min-width: 900px) {
  .ui.top { left: 12px; right: auto; width: 420px; }
  .ui.bottom { left: 12px; right: auto; width: 460px; }
  .ui.side { top: 12px; }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
}
.maplibregl-popup { z-index: 3; }
