/* ==========================================================================
   Mysuru Dasara Traffic
   Night palette from the Dasara 2026 site, tuned for a data-dense live map.
   Signature: "illumination roads" — roads drawn as strings of glowing bulbs.
   ========================================================================== */

:root {
  /* Dasara 2026 night palette */
  --k-950:#080310; --k-900:#0B0511; --k-850:#100716; --k-800:#12081A;
  --k-750:#170B20; --k-700:#1E1029;
  --g:#E9BC63; --g-lt:#F8DFA6; --g-hi:#FFF0C9; --g-dp:#A9772E;
  --rose:#B3316B; --rose-lt:#E58BB4; --wine:#3A0D1E;
  --cr:#F7F0E4; --cr-hi:#FFF6E4; --cr-dim:rgba(247,240,228,.62);
  --mint:#9BE3C9; --coral:#FF8A8A;
  --hair:rgba(233,188,99,.16);
  --foil:linear-gradient(135deg,#fbe6ae 0%,#e8b44a 26%,#a9761f 48%,#e8b44a 68%,#ffeec4 100%);

  /* Semantic tokens */
  --bg: var(--k-950);
  --surface: rgba(16,7,22,.82);
  --surface-2: rgba(30,16,41,.72);
  --surface-3: rgba(233,188,99,.07);
  --line: var(--hair);
  --line-strong: rgba(233,188,99,.34);
  --text: var(--cr);
  --text-dim: var(--cr-dim);
  --text-faint: rgba(247,240,228,.4);
  --accent: var(--g);
  --accent-ink: #1a0d05;
  --focus: var(--g-lt);

  /* Road states (bulb colours) */
  --st-open: #E9BC63;
  --st-congested: #FF9A3D;
  --st-one_way: #FFF0C9;
  --st-closed: #EC4A7F;
  --st-div: var(--mint);
  --glow: 1;

  --sev-info: var(--mint);
  --sev-warn: var(--st-congested);
  --sev-critical: var(--st-closed);

  /* Type */
  --f-display: "Marcellus", "Times New Roman", serif;
  --f-ui: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-kn: "Anek Kannada", "Noto Sans Kannada", "Jost", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Shape & motion */
  --r-s:10px; --r-m:16px; --r-l:24px; --r-xl:32px;
  --sh-l: 0 24px 70px rgba(0,0,0,.55);
  --ease: cubic-bezier(.22,.85,.3,1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --topbar-h: 60px;
  --panel-w: 408px;
  --peek-h: 142px;

  color-scheme: dark;
}

:root[data-theme="day"] {
  --bg: #fdf6e6;
  --surface: rgba(253,246,230,.9);
  --surface-2: rgba(247,236,214,.9);
  --surface-3: rgba(107,15,34,.05);
  --line: rgba(107,15,34,.14);
  --line-strong: rgba(184,134,43,.55);
  --text: #20160c;
  --text-dim: #5b4a33;
  --text-faint: rgba(32,22,12,.45);
  --accent: #8c1428;
  --accent-ink: #fff6e4;
  --focus: #8c1428;

  /* Google-Maps-style traffic colours on the street map */
  --st-open: #1E9E4A;
  --st-congested: #F29900;
  --st-one_way: #1A73E8;
  --st-closed: #D93025;
  --st-div: #8E24AA;
  --glow: .35;

  --sev-info: #0e7a58;
  --sev-warn: #E06A00;
  --sev-critical: #C2185B;
  --sh-l: 0 18px 50px rgba(10,23,64,.22);
  color-scheme: light;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
svg:not(.leaflet-zoom-animated) { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.kn, :lang(kn) { font-family: var(--f-kn); }
.mono { font-family: var(--f-mono); font-feature-settings: "tnum"; letter-spacing: -.02em; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 2000;
  padding: 10px 14px; border-radius: var(--r-s);
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
}
.skip:focus { top: calc(12px + var(--safe-t)); }

.glass {
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--line);
  box-shadow: var(--sh-l);
}

.eyebrow {
  font: 600 11px/1 var(--f-ui);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
}

/* ------------------------------------------------------------------ map */
#map {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(233,188,99,.06), transparent 60%),
    linear-gradient(rgba(233,188,99,.035) 1px, transparent 1px) 0 0/48px 48px,
    linear-gradient(90deg, rgba(233,188,99,.035) 1px, transparent 1px) 0 0/48px 48px,
    var(--k-900);
  z-index: 0;
}
:root[data-theme="day"] #map {
  background:
    linear-gradient(rgba(10,23,64,.05) 1px, transparent 1px) 0 0/48px 48px,
    linear-gradient(90deg, rgba(10,23,64,.05) 1px, transparent 1px) 0 0/48px 48px,
    #f3ead6;
}
/* tint dark tiles slightly warm so the gold reads as "illumination" */
:root[data-theme="night"] .leaflet-tile-pane { filter: sepia(.25) hue-rotate(-12deg) brightness(.92) saturate(.9); }
.leaflet-container { font-family: var(--f-ui); }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 80%, transparent) !important;
  color: var(--text-faint) !important; font-size: 10px;
  border-radius: 8px 0 0 0;
}
.leaflet-control-attribution a { color: var(--text-dim) !important; }
.leaflet-control-zoom { display: none; }

/* ── Illumination roads ── */
.road-wire { stroke: var(--text); stroke-opacity: .12; }
:root[data-theme="day"] .road-wire { stroke-opacity: .18; }
.road-hit { stroke: transparent; cursor: pointer; }

.bulbs-path {
  stroke-linecap: round;
  filter: drop-shadow(0 0 calc(3px * var(--glow)) currentColor) drop-shadow(0 0 calc(7px * var(--glow)) currentColor);
  pointer-events: none;
  transition: opacity .3s;
}
.bulbs-path.st-open      { color: var(--st-open);      stroke: var(--st-open); }
.bulbs-path.st-congested { color: var(--st-congested); stroke: var(--st-congested); animation: bulb-flow 2.6s linear infinite; }
.bulbs-path.st-one_way   { color: var(--st-one_way);   stroke: var(--st-one_way); animation: bulb-flow .7s linear infinite; }
.bulbs-path.st-closed    { color: var(--st-closed);    stroke: var(--st-closed); animation: bulb-dim 2.4s ease-in-out infinite; }
.bulbs-path.is-dim { opacity: .28; }
.bulbs-path.is-hot { animation-duration: .45s; stroke-width: 8px; }
.bulbs-path.st-closed.is-hot { animation-duration: 1s; }

/* dasharray is "0 14" → one period is 14px; decreasing the offset moves bulbs along the path direction */
@keyframes bulb-flow { from { stroke-dashoffset: 28; } to { stroke-dashoffset: 0; } }
@keyframes bulb-dim  { 0%, 100% { opacity: 1; } 50% { opacity: .38; } }

.div-path { stroke: var(--st-div); stroke-linecap: round; opacity: .65; pointer-events: none; }
.div-path.is-hot { opacity: 1; filter: drop-shadow(0 0 4px var(--st-div)); animation: bulb-flow 1.2s linear infinite; }

/* one-way chevrons (also convey direction when motion is reduced) */
.chev { width: 18px; height: 18px; display: grid; place-items: center; pointer-events: none; }
.chev svg { width: 16px; height: 16px; stroke: var(--st-one_way); stroke-width: 2.6; filter: drop-shadow(0 0 2px rgba(0,0,0,.9)); }
:root[data-theme="day"] .chev svg { filter: drop-shadow(0 0 2px #fff); }

/* Parking pins */
.pk-pin { width: auto !important; height: auto !important; }
.pk {
  --c: var(--mint);
  display: flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 3px; border-radius: 999px;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) calc(35% * var(--glow)), transparent), 0 6px 16px rgba(0,0,0,.35);
  transform: translate(-50%, -50%);
  white-space: nowrap; cursor: pointer;
  font: 600 12px/1 var(--f-mono); color: var(--text);
}
.pk b {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c); color: #0b0511; font: 700 12px/1 var(--f-ui);
}
.pk.lvl-mid { --c: var(--st-congested); }
.pk.lvl-low { --c: var(--st-closed); }
.pk.is-hot { outline: 2px solid var(--c); outline-offset: 3px; }

/* Event + landmark pins */
.ev-pin { width: auto !important; height: auto !important; }
.ev {
  display: grid; place-items: center; width: 26px; height: 26px;
  transform: translate(-50%, -50%) translate(0, -18px) rotate(45deg);
  border-radius: 7px; border: 1px solid var(--line-strong);
  background: var(--surface); box-shadow: 0 0 16px rgba(233,188,99,calc(.35 * var(--glow)));
}
.ev span { transform: rotate(-45deg); font-size: 12px; }
.is-far .ev { transform: translate(-50%, -50%) rotate(45deg) scale(.8); }
.is-far .pk { padding: 2px; gap: 0; }
.is-far .pk .n { display: none; }
.is-far .pk b { width: 18px; height: 18px; font-size: 10px; }
.ev.is-live { border-color: var(--st-closed); animation: ev-pulse 1.8s ease-out infinite; }
@keyframes ev-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st-closed) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

.dest-pin { width: auto !important; height: auto !important; }
.dest {
  transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center;
}
.dest span {
  padding: 5px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font: 600 12px/1 var(--f-ui); white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.dest i { width: 2px; height: 12px; background: var(--accent); }

.me-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: #6fb8ff; border: 3px solid #fff;
  box-shadow: 0 0 0 8px rgba(111,184,255,.25);
  transform: translate(-50%, -50%);
}

.leaflet-tooltip.road-tip {
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: var(--sh-l); font: 500 12px/1.3 var(--f-ui); padding: 6px 9px;
}
.leaflet-tooltip.road-tip::before { display: none; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: fixed; z-index: 900;
  top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r));
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 6px 0 10px; border-radius: var(--r-l);
}
.brand-emblem { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 0 10px rgba(233,188,99,.35)); }
.brand-text { min-width: 0; flex: 1; }
.brand-title {
  font: 400 20px/1.1 var(--f-display); letter-spacing: .02em;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-title span {
  background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="day"] .brand-title span { background: none; color: var(--accent); }
.live {
  display: flex; align-items: center; gap: 7px; margin-top: 4px; padding-left: 1px;
  font: 400 11.5px/1 var(--f-mono); color: var(--text-dim); white-space: nowrap;
}
#updated { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--mint); flex: none;
  box-shadow: 0 0 0 0 rgba(155,227,201,.7); animation: live 2s ease-out infinite;
}
.is-stale .live-dot { background: var(--st-congested); animation: none; }
.is-offline .live-dot { background: var(--st-closed); animation: none; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(155,227,201,.7); } 100% { box-shadow: 0 0 0 8px rgba(155,227,201,0); } }
.badge-sample {
  flex: none; margin-left: 2px;
  font: 600 9px/1 var(--f-ui); font-style: normal; letter-spacing: .12em; text-transform: uppercase;
  color: var(--rose-lt); border: 1px solid color-mix(in srgb, var(--rose-lt) 45%, transparent);
  padding: 3px 6px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis;
}
:root[data-theme="day"] .badge-sample { color: var(--st-closed); }

.topbar-actions { display: flex; align-items: center; gap: 2px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding: 0 10px; border: 0; border-radius: 14px;
  background: transparent; cursor: pointer; color: var(--text);
  transition: background .2s;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn svg { width: 21px; height: 21px; }
.install-btn { border: 1px solid var(--line-strong); color: var(--accent); }
.install-label { font: 600 13px/1 var(--f-ui); }
.lang-glyph { font: 600 18px/1 var(--f-kn); }
:root[lang="kn"] .lang-glyph { font: 600 14px/1 var(--f-ui); }
:root[data-theme="night"] .i-moon, :root[data-theme="day"] .i-sun { display: none; }
.bell-count {
  position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--st-closed); color: #fff;
  font: 700 10px/17px var(--f-mono); text-align: center;
}

/* ------------------------------------------------------------------ offline banner */
.offline-banner {
  position: fixed; z-index: 880; left: 50%; transform: translateX(-50%);
  top: calc(var(--topbar-h) + 18px + var(--safe-t));
  padding: 8px 14px; border-radius: 999px;
  background: var(--wine); color: var(--cr); border: 1px solid var(--rose);
  font: 500 12.5px/1.2 var(--f-ui); white-space: nowrap; box-shadow: var(--sh-l);
}

/* ------------------------------------------------------------------ map controls */
.map-controls {
  position: fixed; z-index: 700; right: calc(10px + var(--safe-r));
  top: calc(var(--topbar-h) + 22px + var(--safe-t));
  display: flex; flex-direction: column; gap: 8px;
}
.fab {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center;
  cursor: pointer; color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.fab:hover { color: var(--accent); }
.fab[aria-expanded="true"] { color: var(--accent); border-color: var(--line-strong); }

.legend {
  position: fixed; z-index: 710; right: calc(64px + var(--safe-r));
  top: calc(var(--topbar-h) + 22px + var(--safe-t));
  padding: 14px 16px; border-radius: var(--r-m); min-width: 230px;
}
.legend ul { margin-top: 10px; display: grid; gap: 9px; }
.legend li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.bulbs {
  --c: var(--st-open);
  width: 44px; height: 8px; flex: none;
  background: radial-gradient(circle, var(--c) 0 3px, transparent 3.5px) 0 50%/11px 8px repeat-x;
  filter: drop-shadow(0 0 3px var(--c));
}
.bulbs.st-congested { --c: var(--st-congested); }
.bulbs.st-one_way   { --c: var(--st-one_way); animation: legend-flow .7s linear infinite; }
.bulbs.st-closed    { --c: var(--st-closed); animation: bulb-dim 2.4s ease-in-out infinite; }
.bulbs.st-congested { animation: legend-flow 2.6s linear infinite; }
@keyframes legend-flow { to { background-position: 11px 50%; } }
.dash-div { width: 44px; height: 0; border-top: 3px dashed var(--st-div); flex: none; }
.lg-parking {
  width: 22px; height: 22px; margin: 0 11px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mint); color: #0b0511; font: 700 12px/1 var(--f-ui); font-style: normal; flex: none;
}

/* ------------------------------------------------------------------ alerts popover */
.alerts-panel {
  position: fixed; z-index: 950;
  top: calc(var(--topbar-h) + 18px + var(--safe-t));
  right: calc(10px + var(--safe-r)); left: calc(10px + var(--safe-l));
  max-height: min(70vh, 560px); display: flex; flex-direction: column;
  border-radius: var(--r-l); overflow: hidden;
}
.alerts-panel header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line);
}
.alerts-panel h2 { font: 400 18px/1 var(--f-display); }
.alerts-list { overflow: auto; padding: 6px; }
.alerts-list:empty::after { content: attr(data-empty); display: block; padding: 24px; text-align: center; color: var(--text-dim); }

.alert-item {
  --c: var(--sev-info);
  display: grid; grid-template-columns: 4px 1fr; gap: 12px;
  padding: 12px; border-radius: var(--r-s); cursor: pointer;
}
.alert-item:hover, .alert-item:focus-visible { background: var(--surface-3); }
.alert-item::before { content: ""; border-radius: 4px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.alert-item.sev-warn { --c: var(--sev-warn); }
.alert-item.sev-critical { --c: var(--sev-critical); }
.alert-item h3 { font: 600 14px/1.3 var(--f-ui); }
.alert-item p { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.alert-item time { display: block; margin-top: 6px; font: 400 11px/1 var(--f-mono); color: var(--text-faint); }

/* ------------------------------------------------------------------ toasts */
.toasts {
  position: fixed; z-index: 960; left: 50%; transform: translateX(-50%);
  top: calc(var(--topbar-h) + 18px + var(--safe-t));
  width: min(420px, calc(100vw - 20px)); display: grid; gap: 8px; pointer-events: none;
}
.toast {
  --c: var(--sev-info);
  pointer-events: auto; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: start;
  padding: 12px 8px 12px 16px; border-radius: var(--r-m);
  border-left: 3px solid var(--c);
  animation: toast-in .45s var(--ease) both;
}
.toast.sev-warn { --c: var(--sev-warn); }
.toast.sev-critical { --c: var(--sev-critical); }
.toast.is-leaving { animation: toast-out .3s ease-in both; }
.toast h3 { font: 600 14px/1.3 var(--f-ui); }
.toast p { grid-column: 1; font-size: 13px; color: var(--text-dim); }
.toast .icon-btn { grid-row: 1 / span 2; grid-column: 2; min-width: 40px; height: 40px; }
.offline-banner:not([hidden]) ~ .toasts { top: calc(var(--topbar-h) + 64px + var(--safe-t)); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ------------------------------------------------------------------ bottom sheet */
.sheet {
  position: fixed; z-index: 800; left: 0; right: 0; bottom: 0;
  /* full snap stops below the mode chips so they stay reachable */
  height: calc(100dvh - var(--topbar-h) - 72px - var(--safe-t));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-bottom: 0;
  display: flex; flex-direction: column;
  transform: translate3d(0, var(--sheet-y, calc(100% - var(--peek-h) - var(--safe-b))), 0);
  transition: transform .5s var(--ease);
  will-change: transform;
  touch-action: none;
}
.sheet.is-dragging { transition: none; }
.sheet::before {
  /* gold hairline across the top edge */
  content: ""; position: absolute; left: 18%; right: 18%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--g), transparent); opacity: .7;
}
.sheet-grip { padding: 0 14px; flex: none; cursor: grab; }
.grip {
  display: block; width: 100%; height: 22px; border: 0; background: none; cursor: grab; padding: 0;
}
.grip span { display: block; width: 42px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--text-faint); }

.where-to {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; border-radius: var(--r-m); cursor: pointer; text-align: left;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  color: var(--text);
  transition: border-color .2s, background .2s;
}
.where-to:hover { border-color: var(--accent); }
.where-to svg { color: var(--accent); }
.where-to > span:first-of-type { font: 500 16px/1 var(--f-ui); }
.where-hint { margin-left: auto; font-size: 12.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.tabs {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 8px; border-bottom: 1px solid var(--line);
}
.tabs button {
  min-height: 46px; border: 0; background: none; cursor: pointer;
  font: 500 14px/1 var(--f-ui); color: var(--text-dim); padding: 0 4px;
  transition: color .2s;
}
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button:hover { color: var(--text); }
.tab-ink {
  position: absolute; bottom: -1px; left: 0; height: 2px; width: 25%;
  background: linear-gradient(90deg, transparent, var(--accent) 25%, var(--accent) 75%, transparent);
  box-shadow: 0 0 10px var(--accent);
  transform: translateX(calc(var(--tab-i, 0) * 100%)); transition: transform .4s var(--ease);
}

.sheet-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 14px calc(24px + var(--safe-b));
  touch-action: pan-y;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.view { animation: view-in .35s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------------ content blocks */
.sect { margin-bottom: 22px; }
.sect-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sect-head h2 { font: 400 18px/1.2 var(--f-display); letter-spacing: .01em; }
.sect-head .meta { font: 400 11.5px/1 var(--f-mono); color: var(--text-faint); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 22px; }
.stat {
  --c: var(--st-open);
  position: relative; padding: 12px 10px 10px; border-radius: var(--r-m);
  background: var(--surface-3); border: 1px solid var(--line); overflow: hidden;
  text-align: left; cursor: pointer;
}
.stat:hover { border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.stat[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.stat.st-congested { --c: var(--st-congested); }
.stat.st-one_way { --c: var(--st-one_way); }
.stat.st-closed { --c: var(--st-closed); }
.stat strong { display: block; font: 600 26px/1 var(--f-mono); color: var(--c); text-shadow: 0 0 16px color-mix(in srgb, var(--c) calc(60% * var(--glow)), transparent); }
.stat span { display: block; margin-top: 6px; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat::after {
  content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 2px;
  background: radial-gradient(circle, var(--c) 0 1.5px, transparent 2px) 0 0/8px 2px repeat-x; opacity: .8;
}

.card {
  display: block; width: 100%; text-align: left;
  padding: 14px; border-radius: var(--r-m); margin-bottom: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); transition: border-color .2s, transform .2s;
}
button.card, .card.is-tappable { cursor: pointer; }
button.card:hover, .card.is-tappable:hover { border-color: var(--line-strong); }
.card.is-active { border-color: var(--accent); }
.card-row { display: flex; align-items: center; gap: 10px; }
.card h3 { font: 600 15px/1.3 var(--f-ui); }
.card .kn { font-size: 13px; color: var(--text-dim); font-weight: 400; }
.card p { font-size: 13.5px; color: var(--text-dim); margin-top: 4px; }
.card .grow { flex: 1; min-width: 0; }

.road-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; }
.road-glyph {
  --c: var(--st-open);
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c);
}
.road-glyph svg { width: 18px; height: 18px; }
.road-glyph.st-congested { --c: var(--st-congested); }
.road-glyph.st-one_way { --c: var(--st-one_way); }
.road-glyph.st-closed { --c: var(--st-closed); }
.road-item .speed { font: 600 13px/1 var(--f-mono); color: var(--text-dim); text-align: right; }
.road-item .speed small { display: block; font: 400 10px/1.4 var(--f-ui); color: var(--text-faint); }

.tag {
  --c: var(--text-dim);
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px; font: 500 11.5px/1.3 var(--f-ui);
  color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  white-space: nowrap;
}
.tag.st-open { --c: var(--st-open); }
.tag.st-congested { --c: var(--st-congested); }
.tag.st-one_way { --c: var(--st-one_way); }
.tag.st-closed { --c: var(--st-closed); }
.tag.is-live { --c: var(--st-closed); }
.tag.is-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.tag.is-mint { --c: var(--st-div); }
.tag.is-gold { --c: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
button.tag { cursor: pointer; background: none; min-height: 30px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text);
  font: 500 14px/1 var(--f-ui); display: inline-flex; align-items: center; gap: 8px;
  transition: all .2s;
}
.chip:hover { border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.chip .kn { font-size: 12px; opacity: .75; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  font: 600 14px/1 var(--f-ui); text-decoration: none;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
}
.btn svg { width: 18px; height: 18px; }
.btn-gold { background: var(--foil); border: 0; color: #1a0d05; box-shadow: 0 6px 20px rgba(233,188,99,.25); }
:root[data-theme="day"] .btn-gold { background: var(--accent); color: var(--accent-ink); }
.btn-block { width: 100%; }

/* Parking card */
.pk-card .avail { display: flex; align-items: baseline; gap: 4px; }
.pk-card .avail strong { font: 600 24px/1 var(--f-mono); color: var(--c, var(--mint)); }
.pk-card .avail small { font: 400 12px/1 var(--f-mono); color: var(--text-faint); }
.pk-card .avail-col { flex-direction: column; align-items: flex-end; gap: 4px; }
.pk-card .avail-col strong { font-size: 20px; }
.meter { height: 6px; margin-top: 12px; border-radius: 3px; background: var(--surface-3); overflow: hidden; position: relative; }
.meter i {
  position: absolute; inset: 0 auto 0 0; border-radius: 3px;
  background: var(--c, var(--mint)); box-shadow: 0 0 10px var(--c, var(--mint));
  transition: width .8s var(--ease);
}
.lvl-ok  { --c: var(--mint); }
:root[data-theme="day"] .lvl-ok { --c: #0e7a58; }
.lvl-mid { --c: var(--st-congested); }
.lvl-low { --c: var(--st-closed); }
.pk-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.pk-type { padding: 7px 8px; border-radius: 10px; background: var(--surface-3); font: 400 11px/1.3 var(--f-ui); color: var(--text-faint); }
.pk-type b { display: block; font: 600 13px/1.2 var(--f-mono); color: var(--text); }
.pk-type.is-sel { outline: 1px solid var(--line-strong); }
.pk-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pk-foot .grow { font-size: 12.5px; color: var(--text-dim); }

/* Timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px;
  background: radial-gradient(circle, var(--g) 0 1.2px, transparent 1.6px) 0 0/2px 9px repeat-y; opacity: .6;
}
.tl-item { position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 18px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--g);
}
.tl-item.is-live::before { background: var(--st-closed); border-color: var(--st-closed); box-shadow: 0 0 12px var(--st-closed); }
.tl-item.is-done { opacity: .55; }
.tl-time { font: 600 13px/1 var(--f-mono); color: var(--accent); }
.tl-item.is-done .tl-time { color: var(--text-faint); }

/* Diversion */
.dv-route { display: flex; align-items: center; gap: 8px; font: 600 15px/1.3 var(--f-ui); flex-wrap: wrap; }
.dv-route svg { width: 16px; height: 16px; color: var(--st-div); }
.dv-via { margin-top: 6px; font-size: 13.5px; color: var(--text); }
.dv-via b { color: var(--st-div); font-weight: 500; }

/* Plan view */
.plan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.plan-head h2 { font: 400 22px/1.1 var(--f-display); flex: 1; }
.plan-step { margin-bottom: 18px; }
.plan-step > .eyebrow { display: block; margin-bottom: 10px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line); }
.seg button { min-height: 42px; border: 0; border-radius: 10px; background: none; cursor: pointer; font: 500 14px/1 var(--f-ui); color: var(--text-dim); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.rank {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 600 12px/1 var(--f-mono); border: 1px solid var(--line-strong); color: var(--accent);
}
.card.is-best { border-color: var(--line-strong); background: linear-gradient(160deg, rgba(233,188,99,.12), transparent 60%), var(--surface-2); }
.card.is-best .rank { background: var(--accent); color: var(--accent-ink); border: 0; }
.advice {
  padding: 12px 14px; border-radius: var(--r-m); margin-bottom: 8px; font-size: 13.5px;
  background: color-mix(in srgb, var(--st-div) 8%, transparent); border: 1px solid color-mix(in srgb, var(--st-div) 30%, transparent);
}
.advice.is-warn { background: color-mix(in srgb, var(--st-congested) 8%, transparent); border-color: color-mix(in srgb, var(--st-congested) 30%, transparent); }

.empty { padding: 24px 12px; text-align: center; color: var(--text-dim); font-size: 14px; }
.empty img { width: 120px; height: auto; display: block; margin: 0 auto 10px; opacity: .9; }
.skeleton { height: 76px; border-radius: var(--r-m); margin-bottom: 8px; background: linear-gradient(90deg, var(--surface-3), rgba(233,188,99,.12), var(--surface-3)) 0 0/200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.foot-note { margin-top: 18px; font-size: 12px; color: var(--text-faint); text-align: center; }
.foot-note a { color: var(--text-dim); }

/* ==========================================================================
   Desktop ≥ 960px — left panel + map
   ========================================================================== */
@media (min-width: 960px) {
  :root { --topbar-h: 64px; }
  .topbar {
    left: 12px; right: auto; width: var(--panel-w); top: 12px;
    border-radius: var(--r-l) var(--r-l) 0 0; border-bottom-color: transparent; box-shadow: none;
  }
  .sheet {
    left: 12px; right: auto; bottom: 12px; top: calc(12px + var(--topbar-h));
    width: var(--panel-w); height: auto;
    border-radius: 0 0 var(--r-l) var(--r-l); border-top: 0; border-bottom: 1px solid var(--line);
    transform: none !important; transition: none; touch-action: auto;
  }
  .sheet::before { display: none; }
  .topbar + .offline-banner { left: calc(24px + var(--panel-w) + (100vw - var(--panel-w) - 24px) / 2); }
  .grip { display: none; }
  .sheet-grip { cursor: default; padding-top: 4px; }
  .map-controls, .legend { top: 12px; }
  .map-controls { right: auto; left: calc(24px + var(--panel-w)); }
  .legend { right: auto; left: calc(80px + var(--panel-w)); }
  .alerts-panel { left: auto; width: 400px; top: 12px; right: 12px; }
  .toasts { left: auto; right: 12px; transform: none; top: 12px; width: 380px; }
  .alerts-panel:not([hidden]) ~ .toasts { top: auto; bottom: 12px; }
  .offline-banner { top: 12px; }
  .leaflet-control-attribution { border-radius: 8px 0 0 0; }
}

@media (min-width: 1400px) { :root { --panel-w: 440px; } }

/* very small phones */
@media (max-width: 380px) {
  .brand-title { font-size: 17px; }
  .where-hint { display: none; }
  .stat strong { font-size: 22px; }
  .icon-btn { min-width: 42px; padding: 0 8px; }
  .install-label { display: none; }
}

/* ==========================================================================
   Reduced motion — keep direction via chevrons, drop the animation
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* ==========================================================================
   Day theme = Google-Maps-style roads: solid traffic lines on a white casing.
   Night theme keeps the "illumination roads" bulbs.
   ========================================================================== */
:root[data-theme="day"] .road-wire { stroke: #fff; stroke-opacity: 1; stroke-width: 10px; stroke-linecap: round; }
:root[data-theme="day"] .bulbs-path {
  stroke-dasharray: none; animation: none; filter: none; stroke-width: 6px; stroke-linecap: round;
}
:root[data-theme="day"] .bulbs-path.st-closed { stroke-dasharray: 10 7; stroke-linecap: butt; }
:root[data-theme="day"] .bulbs-path.is-hot { stroke-width: 8px; filter: drop-shadow(0 0 4px rgba(0,0,0,.35)); }
:root[data-theme="day"] .bulbs-path.is-dim { opacity: .3; }
:root[data-theme="day"] .chev svg { stroke: #fff; stroke-width: 3; filter: none; }
:root[data-theme="day"] .div-path { stroke-dasharray: 8 7; }
:root[data-theme="day"] .bulbs {
  height: 6px; border-radius: 3px; background: var(--c); filter: none; animation: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.12);
}
:root[data-theme="day"] .bulbs.st-closed { background: repeating-linear-gradient(90deg, var(--c) 0 8px, #fff 8px 13px); }
:root[data-theme="day"] .leaflet-tooltip.road-tip { background: #fff; color: #202124; border-color: rgba(0,0,0,.12); }

/* satellite: keep bulbs readable */
#map[data-basemap="satellite"] .road-wire { stroke: #000; stroke-opacity: .45; stroke-width: 9px; }

/* other modes: traffic fades back so help points / places lead */
#map[data-mode="emergency"] .leaflet-roads-pane,
#map[data-mode="explore"] .leaflet-roads-pane,
#map[data-mode="emergency"] .leaflet-chev-pane,
#map[data-mode="explore"] .leaflet-chev-pane { opacity: .35; }
body:not([data-mode="traffic"]) .where-to,
body:not([data-mode="traffic"]) .tabs { display: none; }
body:not([data-mode="traffic"]) .sheet-grip { padding-bottom: 4px; }

/* Google-style route lines */
.route-casing { stroke: #1558B0; stroke-linecap: round; stroke-linejoin: round; }
.route-car { stroke: #4C8DF6; stroke-linecap: round; stroke-linejoin: round; }
.route-walk { stroke: #1A73E8; stroke-linecap: round; }
:root[data-theme="night"] .route-car { stroke: #7FB1FF; }
:root[data-theme="night"] .route-walk { stroke: #9CC3FF; filter: drop-shadow(0 0 3px #4C8DF6); }
.route-card { padding: 6px 14px; }
.route-row { display: flex; align-items: center; gap: 10px; min-height: 42px; font-size: 14px; }
.route-row svg { color: #4C8DF6; }
.route-row b { margin-left: auto; font-size: 13px; }

/* ------------------------------------------------------------------ mode chips */
.modes {
  position: fixed; z-index: 760;
  top: calc(var(--topbar-h) + 18px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r));
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 4px 4px 12px; margin: -4px -4px 0; /* room for the chip shadows inside the scroller */
}
.modes::-webkit-scrollbar { display: none; }
.modes button {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 14px 0 11px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  font: 500 14px/1 var(--f-ui);
}
.modes button svg { width: 18px; height: 18px; }
.modes button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.modes .mode-sos svg { color: var(--st-closed); }
.modes .mode-sos[aria-pressed="true"] { background: #C62828; border-color: #C62828; color: #fff; }
.modes .mode-sos[aria-pressed="true"] svg { color: #fff; }
@media (max-width: 959px) {
  .map-controls, .legend { top: calc(var(--topbar-h) + 70px + var(--safe-t)); }
  .toasts, .alerts-panel, .offline-banner { top: calc(var(--topbar-h) + 66px + var(--safe-t)); }
}
@media (min-width: 960px) {
  .modes { top: 12px; left: calc(24px + var(--panel-w) + 58px); right: auto; }
  .legend { top: 64px; }
}

/* ------------------------------------------------------------------ map type picker */
.layer-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.layer-opts button {
  display: grid; justify-items: center; gap: 6px; padding: 6px; border-radius: 12px; cursor: pointer;
  background: none; border: 2px solid transparent; font: 500 12px/1.2 var(--f-ui); color: var(--text-dim);
}
.layer-opts button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); }
.lo { width: 60px; height: 44px; border-radius: 8px; display: block; }
.lo-streets { background: linear-gradient(135deg, transparent 45%, #f7c24a 45% 52%, transparent 52%), linear-gradient(45deg, transparent 40%, #fff 40% 47%, transparent 47%), #e8ecdf; }
.lo-night { background: linear-gradient(135deg, transparent 45%, #555 45% 52%, transparent 52%), #2b2b2b; }
.lo-sat { background: radial-gradient(circle at 30% 40%, #5b7a3a, transparent 50%), radial-gradient(circle at 70% 70%, #7a6a45, transparent 45%), #3d5a2e; }

/* ------------------------------------------------------------------ help points + places */
.poi-pin { width: auto !important; height: auto !important; }
.poi {
  --pc: #7AA5E8;
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50% 50% 50% 4px;
  transform: translate(-50%, -100%) rotate(-45deg);
  background: var(--pc); border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.35); cursor: pointer;
}
.poi svg { width: 17px; height: 17px; transform: rotate(45deg); stroke: #fff; stroke-width: 2.2; }
.poi.is-hot { width: 40px; height: 40px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--pc) 35%, transparent), 0 6px 18px rgba(0,0,0,.4); }
.em-medical, .em-hospital { --pc: #D93025; }
.em-police { --pc: #1A5DC8; }
.em-lost { --pc: #E37400; }
.em-help { --pc: #0B8043; }
.pl-heritage { --pc: #B8862B; }
.pl-temple { --pc: #C2185B; }
.pl-museum { --pc: #5E35B1; }
.pl-nature { --pc: #188038; }
.pl-market { --pc: #E37400; }
.pl-festival { --pc: #8C1428; }
.poi-ic {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: color-mix(in srgb, var(--pc) 16%, transparent); position: relative;
}
.poi-ic::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--pc); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); display: inline-block; flex: none; }
.lg-poi { width: 22px; height: 22px; margin: 0 11px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--pc); border: 2px solid #fff; flex: none; }
.dist { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { flex: none; }

/* SOS strip */
.sos { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.sos a { text-decoration: none; border-radius: var(--r-m); min-height: 64px; }
.sos-main {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: linear-gradient(135deg, #E53935, #B71C1C); color: #fff;
  box-shadow: 0 8px 24px rgba(183,28,28,.35);
}
.sos-main svg { width: 26px; height: 26px; }
.sos-main b { display: block; font: 700 24px/1 var(--f-mono); }
.sos-main small { display: block; font-size: 11px; line-height: 1.25; opacity: .9; margin-top: 3px; }
.sos-alt {
  display: grid; align-content: center; justify-items: center; gap: 4px; padding: 8px;
  background: var(--surface-2); border: 1px solid color-mix(in srgb, #E53935 45%, transparent); color: var(--text);
}
.sos-alt b { font: 700 20px/1 var(--f-mono); color: #EF5350; }
.sos-alt small { font-size: 11.5px; color: var(--text-dim); }
.helplines { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.helpline {
  display: grid; gap: 3px; padding: 12px; border-radius: var(--r-m); text-decoration: none; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); min-height: 44px;
}
.helpline:hover { border-color: var(--line-strong); }
.helpline b { font-size: 16px; color: var(--accent); }
.helpline span { font: 600 13.5px/1.2 var(--f-ui); }
.helpline small { font-size: 11.5px; color: var(--text-dim); line-height: 1.3; }

/* ==========================================================================
   APPLE LIQUID GLASS PASS
   Glass recipe from Ride Ready (white 58 %, blur 34 px, saturate 1.9, bright
   top rim, hairline ring, soft wide shadow); layout language from Apple Maps /
   iOS: a floating inset sheet, capsule search field, segmented controls,
   grouped map buttons, inset-grouped cards and Messages-style chat.
   Day = light glass (default); night = dark glass with the illumination roads.
   ========================================================================== */
:root {
  --f-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Jost", system-ui, "Segoe UI", Roboto, sans-serif;
  --f-mono: -apple-system, BlinkMacSystemFont, "SF Pro Text", "JetBrains Mono", system-ui, sans-serif;
  --r-s: 12px; --r-m: 18px; --r-l: 26px; --r-xl: 32px;

  /* night: dark liquid glass */
  --bg: #0b0b0f;
  --glass-bg: rgba(28, 28, 32, .56);
  --glass-border: rgba(255, 255, 255, .14);
  --glass-rim: rgba(255, 255, 255, .16);
  --glass-shadow: 0 1px 0 var(--glass-rim) inset, 0 0 0 .5px rgba(0, 0, 0, .5), 0 24px 64px rgba(0, 0, 0, .5);
  --glass-blur: blur(34px) saturate(1.9);
  --surface: var(--glass-bg);
  --surface-2: rgba(255, 255, 255, .07);
  --surface-3: rgba(118, 118, 128, .24);
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --text: #F5F5F7;
  --text-dim: rgba(235, 235, 245, .64);
  --text-faint: rgba(235, 235, 245, .38);
  --accent: #0A84FF;
  --accent-ink: #fff;
  --accent-soft: rgba(10, 132, 255, .18);
  --focus: #0A84FF;
  --ok: #30D158;
  --sheen: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0) 40%);
}
:root[data-theme="day"] {
  --bg: #F2F2F7;
  --glass-bg: rgba(255, 255, 255, .58);
  --glass-border: rgba(255, 255, 255, .78);
  --glass-rim: rgba(255, 255, 255, 1);
  --glass-shadow: 0 1px 0 var(--glass-rim) inset, 0 0 0 1px rgba(1, 33, 105, .06), 0 28px 70px rgba(1, 33, 105, .12);
  --surface: var(--glass-bg);
  --surface-2: rgba(255, 255, 255, .78);
  --surface-3: rgba(118, 118, 128, .12);
  --line: rgba(60, 60, 67, .12);
  --line-strong: rgba(60, 60, 67, .22);
  --text: #1C1C1E;
  --text-dim: rgba(60, 60, 67, .72);
  --text-faint: rgba(60, 60, 67, .45);
  --accent: #007AFF;
  --accent-ink: #fff;
  --accent-soft: rgba(0, 122, 255, .12);
  --focus: #007AFF;
  --ok: #34C759;
  --sheen: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 45%);
}
body { font-family: var(--f-ui); letter-spacing: -.01em; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* the glass itself */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
/* specular light: brighter at the top-left edge, fading down (iOS 26 feel) */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(130% 70% at 12% 0%, rgba(255,255,255,.22), transparent 55%), var(--sheen);
  opacity: .9;
}
:root[data-theme="night"] .glass::after { opacity: .45; }

/* --------------------------------------------------------- top bar: a floating capsule */
.topbar { border-radius: 30px; padding: 0 8px 0 10px; }
.brand-emblem { width: 38px; height: 38px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.18)); }
.brand-title { font-size: 19px; }
.live { font-family: var(--f-ui); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 500; }
.live-dot { background: var(--ok); }
.badge-sample { font-family: var(--f-ui); letter-spacing: .06em; border: 0; background: rgba(255, 59, 48, .14); color: #FF3B30; padding: 3px 7px; }
:root[data-theme="night"] .badge-sample { color: #FF6961; }
.icon-btn { border-radius: 999px; }
.icon-btn:hover { background: var(--surface-3); }
.install-btn { border: 0; background: var(--accent-soft); color: var(--accent); }
.bell-count { background: #FF3B30; font-family: var(--f-ui); }

/* --------------------------------------------------------- mode chips (Apple Maps categories) */
.modes button {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: 0 1px 0 var(--glass-rim) inset, 0 6px 18px rgba(1, 33, 105, .10);
  font-weight: 600; font-size: 14px; min-height: 40px;
}
.modes button svg { width: 18px; height: 18px; color: var(--accent); }
.modes button[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 8px 22px rgba(0, 122, 255, .35); }
.modes button[aria-pressed="true"] svg { color: #fff; }
.modes .mode-sos svg { color: #FF3B30; }
.modes .mode-sos[aria-pressed="true"] { background: #FF3B30; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 8px 22px rgba(255, 59, 48, .35); }

/* --------------------------------------------------------- map buttons: one grouped glass stack */
.map-controls {
  gap: 0; border-radius: 16px; overflow: hidden;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}
.map-controls .fab {
  width: 46px; height: 46px; border-radius: 0; border: 0; background: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--accent);
}
.map-controls .fab::after { display: none; }
.map-controls .fab + .fab { border-top: .5px solid var(--line-strong); }
.map-controls .fab:hover { background: var(--surface-3); color: var(--accent); }
.map-controls .fab svg { width: 21px; height: 21px; }
.legend, .alerts-panel { border-radius: 24px; }
.layer-opts button[aria-pressed="true"] { border-color: var(--accent); }
.lo { border-radius: 10px; }

/* --------------------------------------------------------- the sheet: floating, inset, big corners */
@media (max-width: 959px) {
  .sheet {
    left: 8px; right: 8px; bottom: calc(8px + var(--safe-b));
    border-radius: 32px; border-bottom: 1px solid var(--glass-border);
    height: calc(100dvh - var(--topbar-h) - 88px - var(--safe-t) - var(--safe-b));
    transform: translate3d(0, var(--sheet-y, calc(100% - var(--peek-h))), 0);
  }
  .guide-fab { bottom: calc(var(--peek-h) + 20px + var(--safe-b)); }
}
.sheet::before { display: none; }
.grip span { width: 36px; height: 5px; background: rgba(127, 127, 127, .45); border-radius: 3px; margin-top: 7px; }

/* capsule search field (Apple Maps "Search Maps") */
.where-to {
  min-height: 46px; border-radius: 999px; border: 0; background: var(--surface-3);
  padding: 0 16px 0 14px; gap: 8px;
}
.where-to:hover { background: color-mix(in srgb, var(--surface-3) 70%, var(--accent-soft)); }
.where-to svg { color: var(--text-faint); width: 20px; height: 20px; }
.where-to > span:first-of-type { font-size: 17px; font-weight: 500; color: var(--text-dim); }
.where-hint { font-size: 13px; }

/* tabs → iOS segmented control */
.tabs {
  margin-top: 10px; border: 0; padding: 3px; gap: 2px; border-radius: 12px;
  background: var(--surface-3); margin-bottom: 2px;
}
.tabs button { min-height: 36px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text); transition: background .25s, box-shadow .25s; }
.tabs button[aria-selected="false"] { color: var(--text-dim); }
.tabs button[aria-selected="true"] { background: var(--surface-2); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
:root[data-theme="night"] .tabs button[aria-selected="true"] { background: rgba(99, 99, 102, .72); }
.tab-ink { display: none; }
.seg { border: 0; border-radius: 12px; background: var(--surface-3); padding: 3px; }
.seg button { border-radius: 9px; min-height: 38px; font-weight: 600; font-size: 14px; color: var(--text-dim); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
:root[data-theme="night"] .seg button[aria-pressed="true"] { background: rgba(99, 99, 102, .72); }
.sheet-body { padding: 16px 14px calc(28px + var(--safe-b)); }

/* --------------------------------------------------------- type */
.sect-head h2, .plan-head h2, .alerts-panel h2 { font-family: var(--f-ui); font-weight: 700; letter-spacing: -.022em; }
.sect-head h2 { font-size: 20px; }
.plan-head h2 { font-size: 26px; }
.alerts-panel h2 { font-size: 18px; }
.sect-head .meta { font-family: var(--f-ui); font-size: 13px; }
.eyebrow { font-family: var(--f-ui); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.card h3 { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }

/* --------------------------------------------------------- cards: inset grouped */
.card {
  border: 0; border-radius: 20px; background: var(--surface-2); padding: 14px 16px;
  box-shadow: 0 0 0 .5px var(--line), 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(1, 33, 105, .05);
  transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s;
}
:root[data-theme="night"] .card { box-shadow: 0 0 0 .5px var(--line), 0 1px 0 rgba(255,255,255,.06) inset; }
button.card:active, .card.is-tappable:active { transform: scale(.985); }
.card.is-active { box-shadow: 0 0 0 2px var(--accent), 0 8px 24px rgba(0, 122, 255, .18); }
.card.is-best { background: var(--surface-2); box-shadow: 0 0 0 1.5px var(--accent), 0 10px 30px rgba(0, 122, 255, .14); }
.card.is-best .rank { background: var(--accent); color: #fff; }
.rank { border: 0; background: var(--surface-3); color: var(--text); font-family: var(--f-ui); }
.stats { gap: 8px; }
.stat { border: 0; border-radius: 20px; background: var(--surface-2); box-shadow: 0 0 0 .5px var(--line), 0 6px 18px rgba(1, 33, 105, .05); }
.stat::after { display: none; }
.stat strong { font-family: var(--f-ui); font-weight: 700; font-size: 28px; text-shadow: none; letter-spacing: -.03em; }
.stat[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--c); }
.road-glyph, .poi-ic { border-radius: 50%; }
.road-glyph { background: var(--c); color: #fff; }
.road-glyph.st-one_way { color: #fff; }
:root[data-theme="night"] .road-glyph.st-one_way { color: #1c1c1e; }
.road-item .speed { font-family: var(--f-ui); font-variant-numeric: tabular-nums; font-weight: 600; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); }
.meter i { box-shadow: none; }
.pk-card .avail strong { font-family: var(--f-ui); font-weight: 700; letter-spacing: -.03em; }
.pk-type { border-radius: 12px; background: var(--surface-3); }
.pk-type b { font-family: var(--f-ui); font-variant-numeric: tabular-nums; }
.pk-type.is-sel { outline: 0; box-shadow: 0 0 0 1.5px var(--accent); }
.tl-time { font-family: var(--f-ui); font-variant-numeric: tabular-nums; color: var(--accent); }
.timeline::before { background: var(--line-strong); width: 2px; opacity: 1; }
.tl-item::before { border-color: var(--accent); background: var(--bg); }
.advice { border-radius: 16px; border: 0; background: rgba(52, 199, 89, .12); }
.advice.is-warn { background: rgba(255, 149, 0, .13); }
.dv-via b { color: var(--st-div); }

/* chips, tags, buttons: capsules */
.chip { border: 0; background: var(--surface-3); font-weight: 600; }
.chip:hover { background: color-mix(in srgb, var(--surface-3) 60%, var(--accent-soft)); }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; }
.tag { border: 0; background: color-mix(in srgb, var(--c) 14%, transparent); font-weight: 600; }
.tag.is-live { background: rgba(255, 59, 48, .14); color: #FF3B30; }
.btn { border-radius: 999px; border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 600; min-height: 42px; padding: 0 18px; transition: transform .2s, filter .2s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.97); }
.btn-gold, :root[data-theme="day"] .btn-gold {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(180deg, #2F8CFF, #0066E0);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 12px 30px rgba(0, 102, 224, .30);
}
.btn-gold::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .8s cubic-bezier(.16,1,.3,1);
}
.btn-gold:hover::after { transform: translateX(120%); }
.btn-ammu img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: #fff; }

/* emergency */
.sos-main { border-radius: 22px; background: linear-gradient(180deg, #FF453A, #D70015); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 14px 34px rgba(215, 0, 21, .30); }
.sos-main b, .sos-alt b { font-family: var(--f-ui); letter-spacing: -.02em; }
.sos-alt { border: 0; border-radius: 22px; background: var(--surface-2); box-shadow: 0 0 0 .5px var(--line), 0 6px 18px rgba(1,33,105,.05); }
.sos-alt b { color: #FF3B30; }
.helpline { border: 0; border-radius: 20px; background: var(--surface-2); box-shadow: 0 0 0 .5px var(--line), 0 6px 18px rgba(1,33,105,.05); }
.helpline b { font-family: var(--f-ui); color: var(--accent); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------- map pins: Apple Maps round glyphs */
.poi {
  width: 30px; height: 30px; border-radius: 50%; transform: translate(-50%, -50%);
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.28);
}
.poi svg { transform: none; width: 16px; height: 16px; }
.poi.is-hot { width: 42px; height: 42px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--pc) 28%, transparent), 0 6px 18px rgba(0,0,0,.35); }
.lg-poi { border-radius: 50%; transform: none; }
.pk {
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); font-family: var(--f-ui); font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 0 var(--glass-rim) inset, 0 4px 14px rgba(0,0,0,.18);
}
.leaflet-tooltip.road-tip { border-radius: 14px; background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); color: var(--text); box-shadow: var(--glass-shadow); font-family: var(--f-ui); }
.dest span { background: var(--accent); color: #fff; font-family: var(--f-ui); }
.dest i { background: var(--accent); }

/* toasts & banner */
.toast { border-radius: 22px; border-left: 0; box-shadow: var(--glass-shadow); }
.toast h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 8px; vertical-align: 1px; }
.offline-banner { font-family: var(--f-ui); background: rgba(255, 59, 48, .92); border: 0; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.alert-item { border-radius: 16px; }

/* ==========================================================================
   Ammu & Gajju — floating button + Messages-style panel
   ========================================================================== */
.guide-fab {
  position: fixed; z-index: 790; right: calc(12px + var(--safe-r)); bottom: calc(24px + var(--safe-b));
  display: flex; align-items: center; gap: 8px; padding: 4px 16px 4px 4px; min-height: 56px; border-radius: 999px; cursor: pointer;
  background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow);
  font: 600 14px/1 var(--f-ui); transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.guide-fab:hover { transform: translateY(-2px); }
.guide-fab:active { transform: scale(.96); }
.guide-fab img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: 50% 14%; background: linear-gradient(180deg, #FFE7B8, #F4C66B); box-shadow: 0 0 0 2px #fff, 0 3px 10px rgba(0,0,0,.2); }
body.guide-open .guide-fab { opacity: 0; pointer-events: none; }
@media (max-width: 420px) { .guide-fab { padding-right: 4px; } .guide-fab-label { display: none; } }

.guide-panel {
  position: fixed; z-index: 1000; display: flex; flex-direction: column; overflow: hidden;
  left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); height: min(80dvh, 680px);
  border-radius: 32px; animation: gp-in .45s cubic-bezier(.16,1,.3,1) both;
}
@keyframes gp-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@media (min-width: 960px) {
  .guide-panel { left: auto; right: 16px; bottom: 16px; width: 400px; height: min(78vh, 680px); }
  .guide-fab { right: 16px; bottom: 16px; }
}
.gp-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 10px 12px; border-bottom: .5px solid var(--line); }
.gp-switch { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 16px; background: var(--surface-3); min-width: 0; }
.gp-switch button {
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 4px 8px 4px 5px; border: 0; border-radius: 13px;
  background: none; cursor: pointer; color: var(--text-dim); text-align: left; min-width: 0;
}
.gp-switch button img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; flex: none; background: #fff; }
.gp-switch button span { display: grid; min-width: 0; }
.gp-switch b { font-size: 15px; font-weight: 700; color: var(--text); }
.gp-switch small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-switch button[aria-pressed="true"] { background: var(--surface-2); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
:root[data-theme="night"] .gp-switch button[aria-pressed="true"] { background: rgba(99, 99, 102, .72); }
.gp-close { flex: none; background: var(--surface-3); width: 36px; min-width: 36px; height: 36px; padding: 0; }
.gp-close svg { width: 18px; height: 18px; }

.gp-log { flex: 1; overflow-y: auto; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.gp-msg { max-width: 88%; font-size: 15px; line-height: 1.42; }
.gp-msg.me {
  align-self: flex-end; padding: 9px 14px; border-radius: 20px 20px 6px 20px;
  background: linear-gradient(180deg, #2F8CFF, #0A7AFF); color: #fff;
}
.gp-msg.bot { align-self: flex-start; }
.gp-msg .who { display: flex; align-items: center; gap: 6px; margin: 0 0 4px 4px; font-size: 12px; font-weight: 600; color: var(--text-dim); }
.gp-msg .who img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: #fff; }
.gp-msg .txt { padding: 10px 14px; border-radius: 20px 20px 20px 6px; background: var(--surface-2); box-shadow: 0 0 0 .5px var(--line); color: var(--text); }
.gp-msg.gd-ammu .txt { background: color-mix(in srgb, #FF2D55 9%, var(--surface-2)); }
.gp-msg .txt b { font-weight: 650; }
.gp-msg.typing { padding: 12px 14px; border-radius: 20px; background: var(--surface-2); display: flex; gap: 4px; }
.gp-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); animation: gp-dot 1.2s infinite ease-in-out; }
.gp-msg.typing i:nth-child(2) { animation-delay: .15s; } .gp-msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gp-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }
.gd-link, .gd-tel { color: var(--accent); font-weight: 600; text-decoration: none; }
.gd-tel { white-space: nowrap; }
.gd-act {
  display: inline-flex; align-items: center; min-height: 34px; margin: 8px 6px 0 0; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; font: 600 13px/1 var(--f-ui); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 6px 16px rgba(0, 122, 255, .25);
}
.gd-act + .gd-act { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.gd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gd-chips button, .gp-chips button {
  min-height: 34px; padding: 0 13px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); font: 600 13px/1 var(--f-ui);
}
.gp-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 12px 8px; flex: none; }
.gp-chips::-webkit-scrollbar { display: none; }
.gp-chips button { flex: none; }
.gp-form { display: flex; align-items: center; gap: 8px; padding: 8px 10px 12px 12px; border-top: .5px solid var(--line); }
.gp-form input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; outline: 0;
  background: var(--surface-3); color: var(--text); font: 400 16px var(--f-ui);
}
.gp-form input::placeholder { color: var(--text-faint); }
.gp-form input:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.gp-send { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--accent); color: #fff; }
.gp-send svg { width: 20px; height: 20px; stroke-width: 2.4; }
.toast { position: relative; }
/* search row: capsule field + the guides' avatar (Apple Maps puts the profile here) */
.search-row { display: flex; align-items: center; gap: 8px; }
.search-row .where-to { flex: 1; min-width: 0; }
.guide-avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%; padding: 0; border: 0; cursor: pointer; position: relative;
  background: linear-gradient(180deg, #FFE7B8, #F4C66B); box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(0,0,0,.18);
}
.guide-avatar img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: 50% 14%; display: block; }
.guide-avatar::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px #fff; }
@media (max-width: 959px) { .guide-fab { display: none; } }
body:not([data-mode="traffic"]) .search-row { justify-content: flex-end; margin-top: -6px; }
body:not([data-mode="traffic"]) .guide-avatar { width: 40px; height: 40px; }
body:not([data-mode="traffic"]) .guide-avatar img { width: 40px; height: 40px; }
@media (max-width: 959px) { .where-hint { display: none; } }
/* the chat reads on a denser glass */
.guide-panel { background: rgba(28, 28, 32, .80); }
:root[data-theme="day"] .guide-panel { background: rgba(255, 255, 255, .82); }

/* ==========================================================================
   DASARA EMBLEM PALETTE — crimson #D21231→#8C0F22, gold #F6D488→#B8862B,
   cream #FFFBF2 / #F4E3BD, deep maroon #6D0B1A. Day: crimson accent on warm
   cream glass. Night: gold accent on maroon-black glass.
   Traffic colours (green / orange / blue / red) stay: they are data.
   ========================================================================== */
:root {
  --em-crimson: #D21231; --em-maroon: #8C0F22; --em-deep: #6D0B1A;
  --em-gold: #F6D488; --em-gold-dp: #B8862B; --em-cream: #FFFBF2;
  /* night */
  --bg: #0E0710;
  --glass-bg: rgba(26, 11, 22, .60);
  --glass-border: rgba(246, 212, 136, .16);
  --glass-rim: rgba(255, 240, 201, .14);
  --surface-2: rgba(255, 240, 220, .07);
  --accent: #F0C66E;
  --accent-ink: #2B1405;
  --accent-soft: rgba(240, 198, 110, .16);
  --accent-grad: linear-gradient(180deg, #F6D488, #C9973A);
  --accent-glow: rgba(233, 188, 99, .32);
  --focus: #F0C66E;
}
:root[data-theme="day"] {
  --bg: #F7F0E4;
  --glass-bg: rgba(255, 251, 242, .62);
  --glass-border: rgba(255, 255, 255, .82);
  --glass-rim: rgba(255, 255, 255, 1);
  --glass-shadow: 0 1px 0 var(--glass-rim) inset, 0 0 0 1px rgba(109, 11, 26, .06), 0 28px 70px rgba(109, 11, 26, .12);
  --surface-2: rgba(255, 251, 242, .88);
  --surface-3: rgba(140, 15, 34, .07);
  --line: rgba(109, 11, 26, .10);
  --line-strong: rgba(109, 11, 26, .20);
  --text: #25140E;
  --text-dim: rgba(60, 30, 25, .70);
  --text-faint: rgba(60, 30, 25, .45);
  --accent: #B01028;
  --accent-ink: #FFFBF2;
  --accent-soft: rgba(176, 16, 40, .10);
  --accent-grad: linear-gradient(180deg, #D21231, #8C0F22);
  --accent-glow: rgba(176, 16, 40, .30);
  --focus: #B01028;
}

/* everything that used Apple blue now uses the emblem */
.modes button[aria-pressed="true"], .chip[aria-pressed="true"], .gd-act, .gp-send, .card.is-best .rank, .dest span {
  background: var(--accent-grad); color: var(--accent-ink);
}
.modes button[aria-pressed="true"] { box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 8px 22px var(--accent-glow); }
.modes button[aria-pressed="true"] svg { color: var(--accent-ink); }
.modes button svg { color: var(--accent); }
.modes .mode-sos svg { color: #FF3B30; }
.modes .mode-sos[aria-pressed="true"] { background: #FF3B30; color: #fff; }
.modes .mode-sos[aria-pressed="true"] svg { color: #fff; }
.modes .mode-dasara img { width: 22px; height: 22px; margin-left: -3px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.btn-gold, :root[data-theme="day"] .btn-gold {
  background: var(--accent-grad); color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 12px 30px var(--accent-glow);
}
.gd-act { box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 6px 16px var(--accent-glow); }
.gd-act + .gd-act { background: var(--accent-soft); color: var(--accent); }
.gp-msg.me { background: var(--accent-grad); color: var(--accent-ink); }
.card.is-active { box-shadow: 0 0 0 2px var(--accent), 0 8px 24px var(--accent-glow); }
.card.is-best { box-shadow: 0 0 0 1.5px var(--em-gold-dp), 0 10px 30px rgba(184, 134, 43, .18); }
.brand-title span { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--accent); }
:root[data-theme="night"] .brand-title span { background: linear-gradient(135deg,#fbe6ae 0%,#e8b44a 40%,#fff0c9 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.route-car { stroke: #1A73E8; } .route-walk { stroke: #1A73E8; }
.guide-avatar, .guide-fab img { background: linear-gradient(180deg, var(--em-gold), var(--em-gold-dp)); }

/* search row stays in Dasara mode; tabs belong to Traffic only */
body[data-mode="dasara"] .where-to { display: flex; }
body[data-mode="dasara"] .search-row { justify-content: normal; margin-top: 0; }
body[data-mode="dasara"] .guide-avatar, body[data-mode="dasara"] .guide-avatar img { width: 46px; height: 46px; }

/* ------------------------------------------------------------------ Dasara view */
.fest-hero { display: flex; align-items: center; gap: 14px; margin: 2px 2px 16px; }
.fest-hero img { width: 54px; height: 54px; flex: none; filter: drop-shadow(0 4px 10px rgba(109, 11, 26, .25)); }
.fest-hero h2 { font: 400 24px/1.1 var(--f-display); letter-spacing: .01em; color: var(--text); }
.fest-hero p { margin-top: 4px; font-size: 13.5px; color: var(--text-dim); }
.fest-hero p b { color: var(--accent); }
.venue-ic {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--em-crimson), var(--em-maroon)); box-shadow: 0 0 0 2px var(--em-gold), 0 3px 8px rgba(109, 11, 26, .25);
}
.venue-ic svg { width: 19px; height: 19px; stroke: var(--em-gold); stroke-width: 1.8; }
.route-strip { background: linear-gradient(145deg, rgba(210, 18, 49, .10), transparent 60%), var(--surface-2); }
.route-legs { display: grid; gap: 6px; margin-top: 12px; }
.leg { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; }
.leg i { height: 6px; border-radius: 3px; background: var(--c, var(--st-open)); }
.leg.st-open { --c: var(--st-open); } .leg.st-congested { --c: var(--st-congested); } .leg.st-one_way { --c: var(--st-one_way); }
.leg.st-closed i { background: repeating-linear-gradient(90deg, var(--st-closed) 0 6px, transparent 6px 10px); }
.leg b { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg small { font-size: 12px; font-weight: 600; color: var(--c, var(--st-closed)); }
.leg.st-closed small { color: var(--st-closed); }
.venue-facts { display: grid; gap: 7px; margin: 12px 0 0; font-size: 13.5px; }
.venue-facts > div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: baseline; }
.venue-facts dt { display: flex; align-items: center; gap: 7px; color: var(--text-dim); font-weight: 500; }
.venue-facts dd { margin: 0; color: var(--text); }
.venue-facts dd b { font-variant-numeric: tabular-nums; }
.venue-facts a { color: var(--accent); font-weight: 600; text-decoration: none; }
.dot-st { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--st-open)); flex: none; }
.dot-st.st-open { --c: var(--st-open); } .dot-st.st-congested { --c: var(--st-congested); } .dot-st.st-one_way { --c: var(--st-one_way); } .dot-st.st-closed { --c: var(--st-closed); }
.dot-p { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: #1E9E4A; color: #fff; font: 700 10px/1 var(--f-ui); font-style: normal; flex: none; }
.dot-aid { width: 12px; height: 12px; border-radius: 50%; background: #D93025; box-shadow: 0 0 0 2px #fff inset; flex: none; }

/* ------------------------------------------------------------------ venue pins (with Apple-Maps-style labels) */
.venue-pin { width: auto !important; height: auto !important; }
.venue { display: flex; flex-direction: column; align-items: center; gap: 3px; transform: translate(-50%, -18px); cursor: pointer; }
.venue i {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--em-crimson), var(--em-maroon));
  box-shadow: 0 0 0 2.5px var(--em-gold), 0 4px 12px rgba(109, 11, 26, .4);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.venue i svg { width: 19px; height: 19px; stroke: var(--em-gold); stroke-width: 1.9; }
.venue b {
  max-width: 120px; text-align: center; font: 700 11.5px/1.15 var(--f-ui); color: var(--em-deep); letter-spacing: -.01em;
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 5px #fff;
}
:root[data-theme="night"] .venue b { color: var(--em-gold); text-shadow: 0 0 3px #000, 0 0 6px #000; }
.venue.is-live i { animation: venue-pulse 2s ease-out infinite; }
@keyframes venue-pulse { 0% { box-shadow: 0 0 0 2.5px var(--em-gold), 0 0 0 0 rgba(246, 212, 136, .7); } 100% { box-shadow: 0 0 0 2.5px var(--em-gold), 0 0 0 16px rgba(246, 212, 136, 0); } }
.venue.is-hot i { transform: scale(1.22); }
.is-far .venue b { display: none; }

/* ------------------------------------------------------------------ the colour key: one line, always visible */
.keyline {
  position: fixed; z-index: 780; display: flex; align-items: center; gap: 14px;
  left: 8px; right: 8px; bottom: calc(var(--peek-h) + 18px + var(--safe-b));
  padding: 8px 14px; border-radius: 999px; overflow-x: auto; scrollbar-width: none; white-space: nowrap;
  font: 600 12px/1 var(--f-ui); color: var(--text);
}
.keyline::-webkit-scrollbar { display: none; }
.keyline > span { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.kl-line { width: 20px; height: 5px; border-radius: 3px; background: var(--c); flex: none; box-shadow: 0 0 0 1.5px #fff; }
.kl-line.st-open { --c: var(--st-open); } .kl-line.st-congested { --c: var(--st-congested); } .kl-line.st-one_way { --c: var(--st-one_way); }
.kl-line.st-closed { background: repeating-linear-gradient(90deg, var(--st-closed) 0 5px, #fff 5px 8px); }
.kl-line.kl-div { background: repeating-linear-gradient(90deg, var(--st-div) 0 4px, transparent 4px 7px); box-shadow: none; height: 3px; }
:root[data-theme="night"] .kl-line { box-shadow: none; background: radial-gradient(circle, var(--c) 0 2px, transparent 2.5px) 0 50%/6px 5px repeat-x; filter: drop-shadow(0 0 2px var(--c)); height: 5px; }
:root[data-theme="night"] .kl-line.st-closed { --c: var(--st-closed); }
:root[data-theme="night"] .kl-line.kl-div { --c: var(--st-div); }
.kl-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 700 9px/1 var(--f-ui); font-style: normal; }
.kl-p { background: #1E9E4A; color: #fff; }
.kl-aid { background: #D93025; box-shadow: 0 0 0 2px #fff; width: 11px; height: 11px; }
.kl-venue { background: linear-gradient(180deg, var(--em-crimson), var(--em-maroon)); box-shadow: 0 0 0 2px var(--em-gold); width: 12px; height: 12px; }
@media (min-width: 960px) {
  .keyline { left: calc(24px + var(--panel-w)); right: auto; bottom: 16px; max-width: calc(100vw - var(--panel-w) - 260px); }
}
.venue b { width: max-content; max-width: 150px; }
.is-far .venue.is-live b { display: block; }
@media (max-width: 959px) {
  /* keep the map credit legible: just above the colour key instead of behind the sheet's glass */
  .leaflet-bottom.leaflet-right { bottom: calc(var(--peek-h) + 58px + var(--safe-b)); }
  .leaflet-control-attribution { font-size: 9px; }
}

/* ------------------------------------------------------------------ Gajju & Ammu banter bubbles */
.gt { position: fixed; z-index: 850; display: flex; align-items: flex-start; gap: 4px; max-width: min(300px, calc(100vw - 24px)); pointer-events: none; }
.gt.is-in { pointer-events: auto; }
.gt-bubble {
  position: relative; display: grid; gap: 3px; text-align: left; cursor: pointer;
  padding: 10px 14px 11px; border-radius: 20px 20px 6px 20px; border: 1px solid var(--glass-border);
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow); color: var(--text); font: 500 14px/1.35 var(--f-ui);
  opacity: 0; transform: translateY(10px) scale(.94); transform-origin: 100% 100%;
  transition: opacity .25s, transform .45s cubic-bezier(.34, 1.56, .64, 1);
}
:root[data-theme="day"] .gt-bubble { background: rgba(255, 251, 242, .9); }
.gt.is-in .gt-bubble { opacity: 1; transform: none; }
.gt-bubble::after { /* tail pointing down at the avatar */
  content: ""; position: absolute; right: var(--tail, 16px); bottom: -7px; width: 14px; height: 14px;
  background: inherit; border-right: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border);
  transform: rotate(45deg); border-bottom-right-radius: 4px;
}
.gt-who { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--em-gold-dp); }
.gt[data-who="ammu"] .gt-who { color: #C2185B; }
.gt.has-ask .gt-text::after { content: " ›"; color: var(--accent); font-weight: 700; }
.gt-card { position: relative; }
.gt-bubble { padding-right: 34px; }
/* close: a clear button on the bubble's corner, with a full 44px tap area */
.gt-x {
  position: absolute; top: -9px; right: -9px; width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; padding: 0;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--glass-border);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  opacity: 0; transform: scale(.8); transition: opacity .25s, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.gt-x::before { content: ""; position: absolute; inset: -8px; }
.gt-x svg { width: 15px; height: 15px; stroke-width: 2.4; }
.gt-x:hover { background: var(--accent); color: var(--accent-ink); }
.gt.is-in .gt-x { opacity: 1; transform: none; }
.gt-bounce { animation: gt-bounce .55s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes gt-bounce { 0% { transform: scale(1); } 35% { transform: scale(1.14) rotate(-4deg); } 100% { transform: scale(1); } }
body.guide-open .gt { display: none; }
@media (prefers-reduced-motion: reduce) { .gt-bubble { transition: opacity .2s; transform: none; } .gt-bounce { animation: none; } }
