@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap; src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap; src: url('/fonts/space-grotesk-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Light theme only. Tokens are a shared contract with panel.css / ranking.css / onboarding.css. */
:root { --ink:#0F1B2D; --muted:#4A5A70; --muted-2:#33445A; --line:#E3E8EE; --bg:#F4F6F9; --surface:#FFFFFF; --soft:#EEF2F7;
  --blue:#1F4FD1; --blue-dark:#163B9E; --blue-soft:#EEF3FF; --green:#1E8E5A; --green-text:#17704A;
  --sev1:#F5B800; --sev2:#F06A00; --sev3:#B3001B; --r-lg:20px; --r-md:14px;
  --font-body:Inter, system-ui, sans-serif; --font-head:'Space Grotesk', Inter, sans-serif; --shadow:0 6px 24px rgba(15,27,45,0.14); }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; font: 16px/1.4 var(--font-body); background: var(--bg); color: var(--ink); }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
main { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; } /* ranking.css may override left on desktop */
button { min-height: 48px; padding: 0 16px; font: inherit; font-weight: 600; border: 2px solid var(--blue); border-radius: var(--r-md); background: var(--blue); color: #fff; cursor: pointer; }
button.secondary { background: var(--surface); color: var(--blue); }
button:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* header: floating card on phone, full-width bar on desktop */
header { position: absolute; z-index: 4; top: calc(14px + env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 8px 14px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-text h1, .tagline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text { min-width: 0; }
h1 { margin: 0; font: 700 18px/22px var(--font-head); }
.tagline { margin: 0; font-size: 13px; line-height: 17px; color: var(--muted); }
.tag-d, header nav { display: none; }
#ranking-btn { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; background: var(--soft); color: var(--ink); font-size: 14px; }

#chip { position: absolute; z-index: 4; top: calc(14px + env(safe-area-inset-top) + 76px); left: 14px; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(15,27,45,0.25); }
#chip[hidden] { display: none; }
#chip .dot { width: 8px; height: 8px; border-radius: 4px; background: #FF5A4E; }
#chip.clean .dot { background: var(--green); }

#bottombar { position: absolute; z-index: 4; left: 14px; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
#bottombar > * { pointer-events: auto; }
#legend { align-self: flex-start; width: 200px; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--r-md); background: rgba(255,255,255,.96); box-shadow: 0 4px 16px rgba(15,27,45,0.12); font-size: 12px; }
#legend .bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--sev1), var(--sev2) 50%, var(--sev3)); }
#legend .labels { display: flex; justify-content: space-between; color: var(--muted); }
#legend small { font-size: 11px; color: var(--muted); }
#locate { display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px; border: 0; border-radius: var(--r-lg); background: var(--blue); font-size: 17px; font-weight: 700; box-shadow: 0 10px 28px rgba(31,79,209,0.35); }
#locate:hover { background: var(--blue-dark); }
#hint { align-self: center; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.92); font-size: 13px; color: var(--muted-2); }

/* map controls */
.maplibregl-ctrl-top-right { top: auto; bottom: calc(180px + env(safe-area-inset-bottom)); right: 14px; margin: 0; } /* above the attribution, clear of the #street card */
.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 0; }
.maplibregl-ctrl-group { border-radius: var(--r-md); box-shadow: 0 4px 16px rgba(15,27,45,0.14); }
.maplibregl-ctrl-group button { width: 48px; height: 48px; min-height: 0; border: 0; border-radius: 0; background-color: var(--surface); }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.maplibregl-ctrl-bottom-right { bottom: calc(140px + env(safe-area-inset-bottom)); right: 6px; } /* above the CTA stack on phone */

#map.error { display: grid; place-items: center; padding: 24px; text-align: center; font-weight: 600; color: var(--sev3); }


#toast { position: fixed; left: 50%; top: calc(132px + env(safe-area-inset-top)); z-index: 20; width: max-content; max-width: calc(100% - 28px); transform: translateX(-50%); padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; text-align: center; box-shadow: var(--shadow); pointer-events: none; opacity: 0; transition: opacity .2s; }
#toast.show { opacity: 1; }

@media (max-width: 399px) { #ranking-btn { padding: 0 12px; } #ranking-btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
@media (max-width: 899px) { main:has(#panel:not([hidden])) #bottombar { display: none; } } /* panel covers the CTA area */

@media (min-width: 900px) {
  header { position: static; padding: 14px 24px; gap: 16px; border-radius: 0; border-bottom: 1px solid var(--line); box-shadow: none; z-index: 9; }
  h1 { font-size: 20px; line-height: 24px; }
  .tag-m, #chip, #hint, #ranking-btn { display: none; }
  .tag-d { display: inline; }
  header nav { display: flex; gap: 6px; }
  header nav a { display: flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 12px; color: var(--muted-2); font-size: 14px; font-weight: 600; text-decoration: none; }
  header nav a[aria-current] { background: var(--soft); color: var(--ink); }
  #bottombar { left: 16px; right: auto; bottom: 16px; width: 220px; flex-direction: column-reverse; }
  #legend { width: 220px; }
  #locate { height: 56px; font-size: 16px; }
  #toast { top: 84px; }
  .maplibregl-ctrl-top-right { top: 16px; bottom: auto; right: 16px; }
  .maplibregl-ctrl-group button { width: 44px; height: 44px; }
  .maplibregl-ctrl-bottom-right { bottom: 0; right: 0; }
}
