:root {
  --bg: #0b1f17;
  --bg-2: #12301f;
  --surface: #ffffff;
  --surface-2: #f4f6f5;
  --border: #dfe5e2;
  --text: #13201a;
  --muted: #5f6f67;
  --primary: #128a4a;
  --primary-dark: #0d6b39;
  --danger: #c62828;
  --amber: #f5b700;
  --sev-1: #f5b700;
  --sev-2: #f07800;
  --sev-3: #d7263d;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(10, 30, 20, .18);
  --topbar-h: 60px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Buttons */
.btn { border: 1px solid transparent; border-radius: 10px; padding: .55rem .9rem; font-weight: 600; background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; gap: .4rem; justify-content: center; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-light { background: #fff; color: var(--text); }
.btn-ghost { background: transparent; color: #e7f3ec; }
.btn-ghost:hover, .btn-ghost.active { background: rgba(255,255,255,.12); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-outline { background: #fff; border-color: var(--border); }
.btn-sm { padding: .35rem .65rem; font-size: .85rem; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); padding: .2rem .5rem; }

/* Brand */
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; font-weight: 600; font-size: 1.15rem; letter-spacing: -.01em; white-space: nowrap; }
.brand b { color: var(--amber); }
.brand-lg { font-size: 1.6rem; color: var(--text); justify-content: center; }

/* Auth */
/* Sign-in screen. A white header bar, road photos crossfading behind (6 photos, 6 s each), a caption and
   road progress strip, and a plain footer. Slides, captions and bars share one timeline. */
.auth { --cycle: 60s; --stretches: 20; position: relative; min-height: 100%; display: grid; isolation: isolate; overflow-x: clip; background: #0a0f0c;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto auto auto;
  grid-template-areas: "top" "hero" "card" "cap" "foot"; }
.auth-top { grid-area: top; position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; color: #fff; background: rgba(12, 20, 16, .28); border-bottom: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 24px rgba(0, 0, 0, .18); }
.auth-top::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 7px; opacity: .9;
  background: linear-gradient(#000 0 2px, #fff 2px 2.5px, #b00 2.5px 4.5px, #fff 4.5px 5px, #060 5px); }
.auth-top .brand { color: #fff; font-size: 1.1rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.auth-top .brand span { display: inline; }
.auth-top .brand b { color: var(--amber); }
.auth-sos { font-size: .82rem; color: rgba(255, 255, 255, .78); white-space: nowrap; }
.auth-sos a { margin-left: .35rem; padding: 3px 9px; border-radius: 4px; background: rgba(214, 40, 40, .85); color: #fff; font-weight: 700; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .25); }
.auth-sos a:hover { background: var(--danger); }

.auth-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #0a0f0c; }
/* A light shade only where the text sits (the headline on the left, the road strip at the bottom), so the
   photos stay bright and clear everywhere else. */
.auth-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8, 12, 10, .62) 0%, rgba(8, 12, 10, .3) 42%, rgba(8, 12, 10, .06) 70%, transparent 100%),
              linear-gradient(0deg, rgba(8, 12, 10, .62) 0%, rgba(8, 12, 10, .2) 16%, transparent 30%); }
.auth-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0;
  filter: brightness(1.14) contrast(1.12) saturate(1.18);
  animation: auth-slide var(--cycle) linear infinite both; }
.auth-hero { text-shadow: 0 2px 14px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .45); }
@media (max-width: 979px) {
  /* On phones the text covers more of the photo, so the shade is a little more even. */
  .auth-bg::after { background: linear-gradient(180deg, rgba(8, 12, 10, .35) 0%, rgba(8, 12, 10, .5) 55%, rgba(8, 12, 10, .7) 100%); }
}
.auth-slide.s1 { background-image: url(/img/auth/road-1.jpg); }
.auth-slide.s2 { background-image: url(/img/auth/road-2.jpg); }
.auth-slide.s3 { background-image: url(/img/auth/road-3.jpg); }
.auth-slide.s4 { background-image: url(/img/auth/road-6.jpg); }
.auth-slide.s5 { background-image: url(/img/auth/road-4.jpg); background-position: center 30%; }
.auth-slide.s6 { background-image: url(/img/auth/road-5.jpg); background-position: center 35%; }
.auth-slide.s7 { background-image: url(/img/auth/road-7.jpg); }
.auth-slide.s8 { background-image: url(/img/auth/road-8.jpg); background-position: center 40%; }
.auth-slide.s9 { background-image: url(/img/auth/road-9.jpg); background-position: center 30%; }
.auth-slide.s10 { background-image: url(/img/auth/road-10.jpg); }
.auth .s1 { animation-delay: -1.5s; } .auth .s2 { animation-delay: 4.5s; } .auth .s3 { animation-delay: 10.5s; }
.auth .s4 { animation-delay: 16.5s; } .auth .s5 { animation-delay: 22.5s; } .auth .s6 { animation-delay: 28.5s; }
.auth .s7 { animation-delay: 34.5s; } .auth .s8 { animation-delay: 40.5s; } .auth .s9 { animation-delay: 46.5s; }
.auth .s10 { animation-delay: 52.5s; }
/* 10 photos, 6 s each: each owns 1/10 of the cycle. Fade in over 1.5 s (2.5%), hold, fade out while the next fades in. */
@keyframes auth-slide {
  0% { opacity: 0; transform: scale(1.06); }
  2.5% { opacity: 1; }
  10% { opacity: 1; }
  12.5% { opacity: 0; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}
@keyframes auth-cap { 0%, 1.8% { opacity: 0; transform: translateY(4px); } 3%, 10% { opacity: 1; transform: none; } 11%, 100% { opacity: 0; } }

.auth-hero { grid-area: hero; align-self: end; color: #fff; padding: 28px 20px 8px; max-width: 640px; }
.auth-eyebrow { margin: 0 0 .6rem; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); }
.auth-hero h1 { margin: 0; font-size: 1.45rem; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.auth-lead { margin: .9rem 0 0; max-width: 34rem; color: rgba(255, 255, 255, .8); line-height: 1.6; }

.auth-caption { grid-area: cap; position: relative; padding: 0 20px 18px; color: rgba(255, 255, 255, .85); font-size: .82rem; }
.cap { margin: 0 0 8px; opacity: 0; animation: auth-cap var(--cycle) linear infinite both; }
.cap:not(.s1) { position: absolute; left: 20px; top: 0; }
/* Progress: a road across the screen. The pin leaves the BumpsKenya logo at the left edge and drives along it over
   the whole cycle. Dragging the pin scrubs the slideshow (js/auth-road.js). Behind the pin the road is fresh dark tarmac with bright markings, ahead it's worn. The road
   has 20 stretches (--stretches, two per photo); the pin hops over a speed bump every 3 s, and every second bump
   (.at-photo) is where the photo changes. */
.auth-road { position: relative; height: 26px; margin-top: 80px; cursor: pointer; touch-action: none; user-select: none; border-radius: 3px 0 0 3px;
  border-block: 2px solid rgba(255, 255, 255, .35);
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .4) 0 16px, transparent 16px 32px) 0 50% / 100% 3px no-repeat,
    radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.3px) 0 0 / 5px 5px, #6a6862; }
/* The BumpsKenya logo sits on the road's left end; the pin's trip (the track) starts at its centre. */
.road-start { position: absolute; left: 6px; bottom: calc(100% + 6px); z-index: 1; border-radius: 14px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 4px 10px rgba(0, 0, 0, .5); }
.road-track { position: absolute; inset: 0 0 0 36px; }
.road-pin { z-index: 2; cursor: grab; }
.auth-road.dragging, .auth-road.dragging .road-pin { cursor: grabbing; }
.auth-road.dragging .road-pin svg { filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .6)); }
.road-fresh { position: absolute; inset: -2px 0; border-block: 2px solid rgba(255, 255, 255, .95); border-radius: inherit;
  background: repeating-linear-gradient(90deg, #fff 0 16px, transparent 16px 32px) 0 50% / 100% 3px no-repeat,
    radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.3px) 1px 1px / 4px 4px, #1c1e1d;
  clip-path: inset(0 100% 0 0); animation: road-lay var(--cycle) linear infinite both; }
.road-bump { position: absolute; top: -2px; bottom: -2px; left: calc(var(--n) * 100% / var(--stretches)); width: 9px; margin-left: -4.5px;
  border-radius: 3px; background: repeating-linear-gradient(0deg, #f2b705 0 5px, #111 5px 10px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 2px 3px rgba(0, 0, 0, .35); }
.road-bump.at-photo { top: -5px; bottom: -5px; width: 11px; margin-left: -5.5px; }
.road-pin { position: absolute; bottom: 50%; left: 0; width: 34px; margin-left: -17px; line-height: 0;
  animation: road-drive var(--cycle) linear infinite both; }
.road-pin svg { display: block; transform-origin: 50% 100%; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55));
  animation: road-hop calc(var(--cycle) / var(--stretches)) ease-out infinite; animation-delay: -.25s; }
@keyframes road-lay { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes road-drive { 0% { left: 0; opacity: 0; } 1.5% { opacity: 1; } 97% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes road-hop { 0% { transform: none; } 8% { transform: translateY(-12px) rotate(-7deg); } 16% { transform: translateY(0) scale(1.1, .88); }
  22%, 100% { transform: none; } }

.auth-card { grid-area: card; position: relative; z-index: 1; justify-self: center; align-self: start; width: min(420px, calc(100% - 32px)); margin: 16px 0 24px;
  background: var(--surface); border-radius: 8px; padding: 6px 24px 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.auth-card .tabs { position: relative; background: none; padding: 0; margin: 0 -24px 20px; border-radius: 0; border-bottom: 1px solid var(--border); gap: 0; }
.auth-card .tab-indicator { position: absolute; left: 0; bottom: -1px; height: 3px; width: 0; background: var(--primary); border-radius: 3px 3px 0 0;
  transition: transform .42s cubic-bezier(.2,.8,.2,1), width .42s cubic-bezier(.2,.8,.2,1); }
body.night .auth-card .tab-indicator { background: var(--night-accent); }
.auth-card .tab { flex: 1; background: none; border-radius: 0; box-shadow: none; padding: 14px 8px 12px; margin-bottom: -1px;
  border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; }
.auth-card .tab.active { background: none; box-shadow: none; color: var(--text); border-bottom-color: transparent; }
.auth-card .tab { transition: color .3s ease; }
.auth-card .btn-primary { border-radius: 6px; }
.auth-card input, .auth-card select, .auth-card textarea { border-radius: 6px; }
.auth-foot { grid-area: foot; display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap;
  padding: 12px 20px; background: #0a0f0c; color: rgba(255, 255, 255, .6); font-size: .78rem; border-top: 1px solid rgba(255, 255, 255, .08); }

@media (prefers-reduced-motion: reduce) {
  .auth-slide, .cap { animation: none; }
  .auth-slide.s1, .cap.s1 { opacity: 1; }
  .auth-road { display: none; }
}
@media (max-width: 979px) {
  .auth-lead, .auth-caption { display: none; }
  /* Phones: the four account types as a 2 x 2 grid of small tiles instead of four full-width rows. */
  #register-form .account-types { grid-template-columns: 1fr 1fr; }
  #register-form .type-card span { height: 100%; grid-template-columns: 1fr; align-content: start; row-gap: .3rem; padding: .65rem; }
  #register-form .type-card i { grid-row: auto; width: 2rem; height: 2rem; }
  #register-form .type-card small { font-size: .74rem; line-height: 1.3; }
  .auth-sos { font-size: 0; } .auth-sos a { font-size: .8rem; }
}
@media (min-width: 980px) {
  .auth { --g: max(40px, calc((100vw - 1200px) / 2)); grid-template-columns: var(--g) minmax(0, 1fr) 400px var(--g);
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas: "top top top top" ". hero card ." ". cap card ." "foot foot foot foot"; }
  .auth-top, .auth-foot { padding-inline: var(--g); }
  .auth-top { padding-block: 12px; }
  .auth-hero, .auth-caption { padding-left: 0; padding-right: 56px; }
  .auth-hero { align-self: center; padding-top: 48px; }
  .auth-hero h1 { font-size: 2.3rem; line-height: 1.15; max-width: 15em; }
  .auth-caption { align-self: end; padding-bottom: 28px; }
  .auth-road { width: 100vw; margin-left: calc(-1 * var(--g)); border-radius: 0; }
  .cap:not(.s1) { left: 0; }
  .auth-card { align-self: center; width: 100%; margin: 40px 0; }

  /* Creating an account: a wider card, account types in a 2 x 2 grid and paired fields, so the form is
     about half as tall instead of one long narrow column. Keyed on the form being visible, so every way
     of reaching it (tabs, "Back" links) gets the same layout. */
  .auth:has(#register-form:not([hidden])) { grid-template-columns: var(--g) minmax(0, 1fr) min(640px, 56vw) var(--g); }
  .auth:has(#register-form:not([hidden])) .auth-card { align-self: start; margin-top: 32px; }
  .auth:has(#register-form:not([hidden])) .auth-hero { align-self: start; padding-top: 72px; }
  .auth:has(#register-form:not([hidden])) .auth-hero h1 { font-size: 1.9rem; }
  #register-form { grid-template-columns: 1fr 1fr; column-gap: 1rem; align-items: start; }
  #register-form > * { grid-column: 1 / -1; }
  #register-form > label:not(:first-of-type) { grid-column: auto; }
  #register-form .account-types { grid-template-columns: 1fr 1fr; gap: .55rem; }
  #register-form .type-card span { height: 100%; align-items: start; padding: .7rem .75rem; }
  .auth:has(#register-form:not([hidden])) .auth-road { width: auto; }   /* the tall card would sit on it */
  #register-form .employment { grid-template-columns: 1fr 1fr; }
  #register-form .employment > :not(.choice) { grid-column: 1 / -1; }
  #register-form .employment .choice span { height: 100%; }
}
.auth-error:empty { min-height: 0; margin: 0; }
.auth-error { color: var(--danger); min-height: 1.2em; margin: .8rem 0 0; text-align: center; font-size: .9rem; }
.tabs { display: flex; background: var(--surface-2); border-radius: 10px; padding: 4px; margin-bottom: 1rem; }
.tab { flex: 1; border: 0; background: transparent; padding: .55rem; border-radius: 8px; font-weight: 600; color: var(--muted); font-size: .9rem; }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* Forms */
.form { display: grid; gap: .8rem; }
.form label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea {
  border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; color: var(--text); background: #fff; width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
.form textarea { min-height: 70px; resize: vertical; }
.form .check { display: flex; align-items: center; gap: .5rem; font-weight: 500; color: var(--text); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.form .actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .3rem; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: block; text-align: center; border: 1px solid var(--border); border-radius: 10px; padding: .5rem; cursor: pointer; color: var(--text); font-weight: 600; }
.seg input:checked + label { border-color: currentColor; background: color-mix(in srgb, currentColor 12%, #fff); }
.seg .s1 { color: #9a7200; } .seg .s2 { color: #b85a00; } .seg .s3 { color: var(--sev-3); }
.coords { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--muted); }

/* App layout */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 1rem; padding: 0 16px; background: var(--bg); color: #fff; z-index: 5; }
.search-slot { flex: 1; max-width: 520px; min-width: 0; }
.search-slot gmp-place-autocomplete { width: 100%; color-scheme: light; }
.top-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: .5rem; margin-left: .5rem; padding-left: .75rem; border-left: 1px solid rgba(255,255,255,.15); }
.user-name { font-size: .9rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-pill { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: .15rem .45rem; border-radius: 99px; background: var(--amber); color: #2a2000; font-weight: 700; }
.role-pill.driver { background: #2c5f45; color: #d9f3e4; }
.role-pill.user { background: #e3eefc; color: #1a4fa0; }
.badge { background: var(--danger); color: #fff; border-radius: 99px; font-size: .7rem; padding: 0 .4rem; min-width: 1.2rem; }

.stage { position: relative; flex: 1; min-height: 0; }
.stage > .map { position: absolute; inset: 0; background: #dfe7e2; }
.map-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--surface-2); z-index: 2; }
.map-error > div { max-width: 460px; background: #fdecec; border: 1px solid #f3b4b4; border-left: 5px solid var(--danger); border-radius: 12px; padding: 1.1rem 1.3rem; text-align: start; }
.map-error h2 { color: #a31515; margin: 0 0 .3rem; font-size: 1.15rem; }
.map-error p { margin: 0; color: #5c1a1a !important; }

.map-controls { position: absolute; right: 12px; top: 12px; display: grid; gap: 8px; z-index: 3; }
.ctrl { width: 42px; height: 42px; border-radius: 10px; border: 0; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; }
.ctrl svg { width: 22px; height: 22px; stroke: var(--text); stroke-width: 1.8; fill: var(--text); }
.ctrl svg path, .ctrl svg rect { fill: none; }
.ctrl[aria-pressed=true] { background: var(--primary); }
.ctrl[aria-pressed=true] svg { stroke: #fff; fill: #fff; }

.legend { position: absolute; left: 12px; bottom: 24px; background: rgba(255,255,255,.95); border-radius: 10px; padding: .45rem .7rem; display: flex; gap: .8rem; font-size: .8rem; box-shadow: var(--shadow); z-index: 3; }
.legend span { display: flex; align-items: center; gap: .3rem; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.dot.sev-1 { background: var(--sev-1); } .dot.sev-2 { background: var(--sev-2); } .dot.sev-3 { background: var(--sev-3); }

.fab { position: absolute; right: 16px; bottom: 28px; z-index: 3; border: 0; border-radius: 99px; padding: .85rem 1.2rem; background: var(--primary); color: #fff; font-weight: 700; box-shadow: var(--shadow); display: flex; align-items: center; gap: .5rem; }
.fab:hover { background: var(--primary-dark); }
.fab-plus { font-size: 1.3rem; line-height: 1; }

.hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 4; background: var(--bg); color: #fff; border-radius: 12px; padding: .6rem .8rem; display: flex; align-items: center; gap: .6rem; box-shadow: var(--shadow); font-size: .9rem; max-width: calc(100% - 32px); flex-wrap: wrap; justify-content: center; }
.hint-top { top: 12px; bottom: auto; }

/* Side panel */
.panel { position: absolute; left: 12px; top: 12px; bottom: 80px; width: min(380px, calc(100% - 24px)); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 4; display: flex; flex-direction: column; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 1.05rem; }
.panel-body { padding: 1rem; overflow-y: auto; flex: 1; }
.panel.wide { width: min(640px, calc(100% - 24px)); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .9rem; margin: .8rem 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: .3rem; border-radius: 99px; padding: .15rem .55rem; font-size: .78rem; font-weight: 700; color: #fff; }
.chip.sev-1 { background: var(--sev-1); color: #2a2000; } .chip.sev-2 { background: var(--sev-2); } .chip.sev-3 { background: var(--sev-3); }
.chip.neutral { background: var(--surface-2); color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.list li { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; display: flex; gap: .6rem; align-items: center; }
.list li.clickable { cursor: pointer; } .list li.clickable:hover { background: var(--surface-2); }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; font-size: .92rem; }
.list .sub { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.dist { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stat { background: var(--surface-2); border-radius: 10px; padding: .7rem; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { color: var(--muted); font-size: .78rem; }
.subtabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin: 0 -1rem 1rem; padding: 0 1rem; }
.subtab { border: 0; background: none; padding: .6rem .8rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.subtab.active { color: var(--primary); border-color: var(--primary); }
table.users { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.users th, table.users td { text-align: start; padding: .45rem .3rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.users select { padding: .2rem; border-radius: 6px; border: 1px solid var(--border); }
details.create { border: 1px dashed var(--border); border-radius: 10px; padding: .6rem .8rem; margin-bottom: 1rem; }
details.create summary { font-weight: 600; cursor: pointer; }
details.create .form { margin-top: .8rem; }
.empty { text-align: center; color: var(--muted); padding: 1.5rem 0; }
.summary-box { background: var(--surface-2); border-radius: 10px; padding: .8rem; margin: 1rem 0; display: flex; justify-content: space-between; gap: .5rem; }
.summary-box b { font-size: 1.3rem; display: block; }

/* Markers */
.bump-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); display: grid; place-items: center; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .15s; }
.bump-pin svg { transform: rotate(45deg); width: 17px; height: 17px; stroke: #fff; stroke-width: 2.6; fill: none; stroke-linecap: round; }
.bump-pin.sev-1 { background: var(--sev-1); } .bump-pin.sev-1 svg { stroke: #2a2000; }
.bump-pin.sev-2 { background: var(--sev-2); } .bump-pin.sev-3 { background: var(--sev-3); }
.bump-pin:hover { transform: rotate(-45deg) scale(1.15); }
.bump-pin.draft { background: var(--primary); animation: pulse 1.4s infinite; }
.bump-pin.report { background: #5b6bd6; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(18,138,74,.15); } }
.cluster { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 99px; background: var(--bg); color: #fff; font-weight: 700; display: grid; place-items: center; border: 3px solid var(--amber); box-shadow: 0 2px 8px rgba(0,0,0,.35); font-size: .85rem; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26,115,232,.25), 0 1px 4px rgba(0,0,0,.4); }

/* Drive mode */
.drive-hud { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: .8rem; background: var(--bg); color: #fff; border-radius: 16px; padding: .6rem .8rem; box-shadow: var(--shadow); width: min(560px, calc(100% - 24px)); }
.hud-speed { text-align: center; line-height: 1; min-width: 56px; }
.hud-speed b { font-size: 1.8rem; display: block; font-variant-numeric: tabular-nums; }
.hud-speed small { opacity: .7; font-size: .7rem; }
.hud-next { flex: 1; font-weight: 600; }
.hud-next .far { opacity: .75; font-weight: 500; }
.drive-alert { position: absolute; inset: auto 12px 100px; z-index: 6; margin: 0 auto; max-width: 560px; background: var(--danger); color: #fff; font-size: 1.4rem; font-weight: 800; text-align: center; padding: 1.1rem; border-radius: 16px; box-shadow: var(--shadow); animation: flash .6s ease-in-out 3; }
@keyframes flash { 50% { filter: brightness(1.35); } }
.app.driving .fab, .app.driving .legend { display: none; }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: .5rem; z-index: 50; max-width: min(380px, calc(100% - 32px)); }
.toast { background: var(--text); color: #fff; padding: .7rem .9rem; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; animation: slide-in .2s ease-out; }
.toast.error { background: var(--danger); border-left: 5px solid #7f0000; font-weight: 600; } .toast.success { background: var(--primary); }
@keyframes slide-in { from { transform: translateY(8px); opacity: 0; } }

/* Mobile */
@media (max-width: 760px) {
  :root { --topbar-h: auto; }
  .topbar { flex-wrap: wrap; padding: 8px 12px; gap: .5rem; }
  .search-slot { order: 3; flex-basis: 100%; max-width: none; }
  .user-name { display: none; }
  .user-chip { margin-left: .2rem; padding-left: .4rem; }
  .top-actions .btn-ghost { padding: .45rem .55rem; font-size: .85rem; }
  .brand span { display: none; }
  .panel, .panel.wide { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 70%; border-radius: 16px 16px 0 0; }
  .legend { bottom: auto; top: 12px; left: 12px; }
  .fab { bottom: 20px; }
  .toasts { left: 16px; right: 16px; max-width: none; }
}
.plain-search { width: 100%; border: 0; border-radius: 10px; padding: .6rem .8rem; }
.panel .plain-search { border: 1px solid var(--border); }
.top-actions .btn { white-space: nowrap; }
@media (max-width: 760px) {
  .topbar .brand { flex: 0 0 auto; }
  .top-actions { flex-wrap: nowrap; }
  .map-error { padding-top: 140px; align-items: start; }
}

/* Pin wrapper: map libraries position the wrapper, the inner pin keeps its rotation */
.bump-pin-wrap { width: 30px; height: 36px; display: flex; align-items: flex-start; justify-content: center; cursor: grab; }

/* Toasts sit above the floating button, centred, so they never cover it */
.toasts { right: auto; left: 50%; transform: translateX(-50%); bottom: 96px; width: max-content; max-width: min(440px, calc(100% - 32px)); }
@media (max-width: 760px) { .toasts { left: 50%; right: auto; bottom: 88px; } }

/* Legend uses the same pin shape as the map */
.legend .dot { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); width: 12px; height: 12px; }

/* Severity at a glance: pins grow and redden with severity, severe ones pulse, and each type has its own glyph */
.bump-pin-wrap { position: relative; }
.bump-pin-wrap.sev-1 { width: 24px; height: 29px; }
.bump-pin-wrap.sev-1 .bump-pin { width: 24px; height: 24px; border-width: 2px; }
.bump-pin-wrap.sev-1 .bump-pin svg { width: 14px; height: 14px; }
.bump-pin-wrap.sev-3 { width: 36px; height: 43px; }
.bump-pin-wrap.sev-3 .bump-pin { width: 36px; height: 36px; border-width: 3px; }
.bump-pin-wrap.sev-3 .bump-pin svg { width: 21px; height: 21px; stroke-width: 2.8; }
.bump-pin.sev-3:not(.draft):not(.report) { animation: severe-pulse 1.8s ease-out infinite; }
@keyframes severe-pulse {
  0% { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 0 rgba(215,38,61,.55); }
  70%, 100% { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 14px rgba(215,38,61,0); }
}
.pin-label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; display: none; white-space: nowrap; font-size: .72rem; font-weight: 700; padding: .05rem .4rem; border-radius: 99px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); pointer-events: none; }
.show-pin-labels .pin-label { display: block; }
.bump-pin-wrap.sev-1 .pin-label { color: #7a5b00; }
.bump-pin-wrap.sev-2 .pin-label { color: #a14f00; }
.bump-pin-wrap.sev-3 .pin-label { color: #a3122a; }

/* Cluster ring shows the worst bump inside it */
.cluster.sev-1 { border-color: var(--sev-1); }
.cluster.sev-2 { border-color: var(--sev-2); }
.cluster.sev-3 { border-color: var(--sev-3); box-shadow: 0 0 0 3px rgba(215,38,61,.3), 0 2px 8px rgba(0,0,0,.35); }

/* Map key: severity colours and size, then type glyphs */
.legend { flex-direction: column; gap: .35rem; max-width: calc(100% - 90px); }
.legend-row { display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.legend .dot.sev-1 { width: 10px; height: 10px; } .legend .dot.sev-3 { width: 15px; height: 15px; }
.legend-types { border-top: 1px solid var(--border); padding-top: .35rem; color: var(--muted); }
.type-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--bg); }
.type-icon svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 760px) { .legend-types { display: none; } }

/* Bump details: severity banner with advice */
.sev-banner { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: 12px; color: #fff; margin-bottom: .6rem; }
.sev-banner b { font-size: 1.1rem; }
.sev-banner small { display: block; opacity: .92; font-size: .82rem; margin-top: .1rem; }
.sev-banner.sev-1 { background: var(--sev-1); color: #2a2000; }
.sev-banner.sev-2 { background: var(--sev-2); }
.sev-banner.sev-3 { background: var(--sev-3); }
.sev-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.22); display: grid; place-items: center; }
.sev-icon svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Trip bar (open trip) and the prompt drivers see before choosing a destination */
.trip-bar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: .5rem .6rem; background: var(--bg); color: #fff; border-radius: 14px; padding: .55rem .7rem; box-shadow: var(--shadow); max-width: min(620px, calc(100% - 140px)); font-size: .9rem; }
.trip-bar-text { display: grid; line-height: 1.25; min-width: 0; }
.trip-bar-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-bar-text span { opacity: .85; font-size: .82rem; }
.trip-bar-text em { font-style: normal; color: #ff8a97; font-weight: 700; }
.trip-prompt { max-width: min(520px, calc(100% - 140px)); }
.app.driving .trip-bar { display: none; }
.panel:not([hidden]) ~ .trip-bar { display: none; }
@media (max-width: 760px) {
  .trip-bar { top: auto; bottom: 88px; max-width: calc(100% - 24px); }
}
.notice { background: #fff4e0; color: #6b4500; border-radius: 10px; padding: .6rem .75rem; font-size: .9rem; margin: 0 0 .6rem; }

/* Drive alert colour follows severity; details appear underneath when voice details are on */
.drive-alert.sev-1 { background: var(--sev-1); color: #2a2000; }
.drive-alert.sev-2 { background: var(--sev-2); }
.drive-alert small { display: block; font-size: 1rem; font-weight: 600; margin-top: .35rem; opacity: .95; }
.hud-next .dot { margin-right: .4rem; vertical-align: -1px; }

/* Badge on a pin that marks several bumps in a row */
.pin-count { position: absolute; top: -7px; right: -11px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 99px; background: var(--bg); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); pointer-events: none; }

/* One-way bumps: arrow on the pin, counter-rotated against the map's heading in drive mode */
.pin-dir { position: absolute; left: -12px; top: -6px; width: 19px; height: 19px; border-radius: 50%; background: #1a73e8; border: 2px solid #fff; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.35); transform: rotate(calc(var(--dir) - var(--map-heading, 0deg))); pointer-events: none; }
.pin-dir svg { width: 12px; height: 12px; fill: #fff; stroke: none; }
.chip.dir { background: #e3eefc; color: #1a4fa0; }
.chip.ok { background: #e3f4ea; color: #0d6b39; }

/* Photos */
.photo-strip { display: flex; flex-wrap: wrap; gap: .45rem; margin: .7rem 0 .2rem; }
.photo { position: relative; display: block; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-strip.small .photo { width: 52px; height: 52px; }
.photo-del { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1rem; line-height: 1; display: grid; place-items: center; }
.photo-add { width: 76px; height: 76px; border-radius: 8px; border: 2px dashed var(--border); display: grid; place-items: center; font-size: 1.8rem; color: var(--muted); cursor: pointer; }
.photo-add:hover { border-color: var(--primary); color: var(--primary); }

/* History, reports, import */
.list.history li { align-items: flex-start; }
.list.history .sub { line-height: 1.5; }
.report-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: flex-end; }
.report-actions select { padding: .3rem .4rem; border-radius: 8px; border: 1px solid var(--border); }
.section-title { font-size: .95rem; margin: 1rem 0 .3rem; }
.import-errors { font-size: .82rem; color: var(--danger); max-height: 160px; overflow-y: auto; padding-inline-start: 1.1rem; }
.ok-notice { background: #e3f4ea; color: #0d6b39; }

/* Account */
.label-row { display: flex; align-items: center; gap: .4rem; }
.panel-body p code { word-break: break-all; }
.link { color: var(--primary); text-decoration: none; justify-self: start; }
.link:hover { text-decoration: underline; }
.danger-zone summary { color: var(--danger); }

/* Off-route banner in drive mode */
.off-route { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: .5rem .7rem; background: #fff4e0; color: #6b4500; border-radius: 12px; padding: .55rem .75rem; box-shadow: var(--shadow); width: min(560px, calc(100% - 24px)); font-size: .9rem; }

/* Security log */
table.events tr.flagged td { background: #fff1f1; }
table.events td { vertical-align: top; }

/* ---------- Roadside help ---------- */
.btn-accept { background: #0f9d58; color: #fff; border-color: #0f9d58; }
.btn-accept:hover { background: #0b7d46; }
.btn-sos { background: #d7263d; color: #fff; border-color: #d7263d; font-weight: 800; }
.btn-lg { padding: .85rem 1.2rem; font-size: 1.05rem; }
.btn-ghost-dark { background: transparent; border-color: transparent; color: var(--primary); padding-left: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .25rem; margin: .35rem 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .2rem .6rem; }
.seg-choice { border: 1px solid var(--border); border-radius: 10px; padding: .5rem .7rem; display: grid; gap: .3rem; }
.seg-choice legend { font-size: .85rem; color: var(--muted); padding: 0 .3rem; }
.list.providers li, .list.jobs li { align-items: flex-start; }
.list.jobs li.highlight { background: #e8f5ee; border-radius: 10px; }

/* SOS button: always reachable, right side above the + button, over any open panel */
.sos { position: absolute; right: 18px; bottom: 100px; z-index: 7; /* above panels: always reachable */ width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff;
  background: #d7263d; color: #fff; font-weight: 900; font-size: 1.05rem; letter-spacing: .5px; box-shadow: 0 6px 18px rgba(215,38,61,.45); }
.sos:active { transform: scale(.95); }
.app.driving .sos { bottom: 24px; }
@media (max-width: 760px) { .sos { bottom: 90px; right: 14px; } }

/* Banner while a request is open or accepted */
.help-banner { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 6; display: grid; gap: .1rem; text-align: center;
  padding: .55rem 1rem; border-radius: 14px; box-shadow: var(--shadow); cursor: pointer; width: min(520px, calc(100% - 140px)); color: #fff; background: #b3261e; }
.help-banner.accepted { background: #0f9d58; }
.help-banner span { font-size: .85rem; opacity: .9; }
.help-wait { display: flex; gap: .8rem; align-items: flex-start; background: #fff4e0; border-radius: 12px; padding: .8rem; margin-bottom: .6rem; }
.pulse { flex: 0 0 auto; width: 16px; height: 16px; margin-top: .2rem; border-radius: 50%; background: #d7263d; animation: pulse-ring 1.4s infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(215,38,61,.6); } 100% { box-shadow: 0 0 0 16px rgba(215,38,61,0); } }
.help-coming { background: #e8f5ee; border-radius: 12px; padding: .8rem; margin-bottom: .6rem; display: grid; gap: .2rem; }
.help-coming > b { color: #0b7d46; font-size: 1.05rem; }
.sos-intro { background: #fdecee; border-radius: 12px; padding: .7rem .8rem; margin-bottom: .6rem; }
.duty { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem .8rem; border-radius: 12px; background: var(--surface-2); }
.duty.on { background: #e8f5ee; }

/* Ringing alarm: full screen, impossible to miss */
.alarm { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(10,10,10,.75); }
.alarm-card { width: min(440px, 100%); background: #fff; border-radius: 20px; padding: 1.4rem 1.2rem; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.alarm.emergency .alarm-card { border: 4px solid #d7263d; animation: alarm-flash 1s infinite; }
.alarm.service .alarm-card { border: 4px solid #0f9d58; }
@keyframes alarm-flash { 50% { box-shadow: 0 0 0 12px rgba(215,38,61,.35), 0 20px 60px rgba(0,0,0,.4); } }
.alarm-icon { width: 72px; height: 72px; margin: 0 auto .6rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; color: #fff; background: #d7263d; animation: shake .5s infinite; }
.alarm.service .alarm-icon { background: #0f9d58; }
@keyframes shake { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.alarm-card h2 { margin: 0 0 .4rem; }
.alarm-distance { font-size: 1.3rem; font-weight: 800; margin: .2rem 0; }
.alarm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1rem; }

/* Help markers on the map */
.overlay-pin { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem; background: #fff; border: 3px solid var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.overlay-pin.recovery, .overlay-pin.responder { border-color: #d7263d; }
.overlay-pin.me-help { border-color: #1a73e8; }

/* Install prompt (installable web app) */
.install-banner { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: .7rem; width: min(460px, calc(100% - 24px)); padding: .6rem .7rem; border-radius: 14px;
  background: var(--bg); color: #fff; box-shadow: var(--shadow); }
.install-banner img { border-radius: 10px; flex: 0 0 auto; }
.install-banner > span { flex: 1; line-height: 1.3; }
.install-banner .icon-btn { color: #fff; }
.install-steps { padding-inline-start: 1.2rem; line-height: 1.7; }
/* Installed app on iPhone: keep content clear of the notch / status bar */
@media (display-mode: standalone) { .topbar { padding-top: max(10px, env(safe-area-inset-top)); } }

/* Sign-up: account type cards */
.account-types { border: 0; padding: 0; margin: 0; display: grid; gap: .45rem; }
.account-types legend { font-weight: 600; margin-bottom: .35rem; }
.type-card { display: block; cursor: pointer; }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card span { display: grid; grid-template-columns: 2.25rem 1fr; column-gap: .6rem; align-items: center; padding: .6rem .75rem;
  border: 2px solid var(--border); border-radius: 12px; background: #fff; }
.type-card i { grid-row: span 2; font-style: normal; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; background: var(--surface-2); color: var(--primary-dark); }
.type-card i svg { width: 1.3rem; height: 1.3rem; }
.type-card input:checked + span i { background: var(--primary); color: #fff; }
.type-card small { color: var(--muted); font-size: .8rem; }
.type-card input:checked + span { border-color: var(--primary); background: #e8f5ee; }
.type-card input:focus-visible + span { outline: 3px solid rgba(18,138,74,.35); }
.business { border-top: 1px solid var(--border); padding-top: .4rem; display: grid; gap: .7rem; }
.role-pill.mechanic { background: #fff1d6; color: #7a5200; }
.role-pill.recovery { background: #fde2e4; color: #9b1c2c; }

/* Phones: the nav wraps onto a second line instead of running off the screen (no sideways scrolling). */
@media (max-width: 760px) {
  .top-actions { flex-wrap: wrap; justify-content: flex-start; row-gap: .15rem; margin-left: 0; width: 100%; }
  .top-actions .btn-ghost { padding: .4rem .5rem; }
  .user-chip { margin-left: auto; border-left: 0; }
}

table.users tr.deleted td { opacity: .55; }

.field-error { color: var(--danger); font-weight: 600; }

/* Announcement banner (set in the admin console) */
.announcement { display: flex; align-items: center; gap: .75rem; padding: .5rem 16px; font-size: .9rem; font-weight: 500; }
.announcement span { flex: 1; }
.announcement .icon-btn { font-size: 1.3rem; color: inherit; }
.announcement.info { background: #e3f4ea; color: #0d4f2b; }
.announcement.warning { background: #fff3cd; color: #5c4400; }
.announcement.critical { background: #fbe0e3; color: #7a1020; }
a.btn { text-decoration: none; }

/* Fuel stations */
.overlay-pin.fuel { border-color: #1a73e8; color: #1a5fc0; }
.overlay-pin.fuel.delivers { border-color: #0b8f6a; color: #0b6b50; }
.overlay-pin.fuel svg { width: 18px; height: 18px; }
.overlay-pin.fuel.draft { border-style: dashed; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0; }
.tag-sm { font-size: .72rem; font-weight: 600; background: var(--surface-2); color: #3c4a43; border-radius: 99px; padding: .1rem .5rem; }
.kv-list { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .9rem; font-size: .88rem; margin: .8rem 0; }
.kv-list dt { color: var(--muted); }
.kv-list dd { margin: 0; overflow-wrap: anywhere; }
.station-detail .sub { color: var(--muted); font-size: .88rem; margin: 0 0 .4rem; }
.station-form fieldset { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem .75rem; margin: 0; display: grid; gap: .6rem; }
.station-form legend { font-weight: 700; font-size: .85rem; padding: 0 .3rem; color: var(--text); }
.station-form .checks { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.price-chip { display: inline-flex; align-items: baseline; gap: .3rem; font-size: .78rem; background: #eef6ff; color: #1a3d6b; border-radius: 8px; padding: .15rem .5rem; }
.price-chip b { font-size: .85rem; }
.price-chip small { color: #5d7391; font-size: .7rem; }
.price-chip.stale { background: #f4f4f4; color: #6b6b6b; }
.price-chip.stale small { color: #a05a00; font-weight: 600; }
.price-form { margin-top: .6rem; }

/* Employment: 1. self-employed / 2. company (shared by sign-up, profiles and staff forms) */
.employment { border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem .8rem; margin: 0; display: grid; gap: .55rem; }
.employment legend { font-weight: 700; font-size: .9rem; padding: 0 .3rem; color: var(--text); }
.employment .choice { display: block; cursor: pointer; }
.employment .choice input { position: absolute; opacity: 0; pointer-events: none; }
.employment .choice span { display: grid; gap: .1rem; border: 2px solid var(--border); border-radius: 10px; padding: .5rem .7rem; background: #fff; color: var(--text); font-weight: 500; }
.employment .choice small { color: var(--muted); font-size: .8rem; font-weight: 400; }
.employment .choice input:checked + span { border-color: var(--primary); background: #e8f5ee; }
.employment .choice input:focus-visible + span { outline: 3px solid rgba(18,138,74,.35); }
.employment h4 { margin: .4rem 0 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: #3c4a43; }
.company-block { display: grid; gap: .6rem; }
.co-new { display: grid; gap: .6rem; }
.co-search { position: relative; }
.co-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; padding: .3rem; display: grid; gap: 2px; }
.co-results button { text-align: start; border: 0; background: none; padding: .45rem .55rem; border-radius: 8px; display: grid; gap: .1rem; color: var(--text); font-weight: 500; }
.co-results button:hover, .co-results button:focus { background: var(--surface-2); }
.co-results small { color: var(--muted); font-weight: 400; }
.co-results p { margin: .4rem .5rem; }
.co-picked { display: flex; align-items: center; justify-content: space-between; gap: .5rem; background: #e8f5ee; border-radius: 10px; padding: .5rem .7rem; font-size: .9rem; color: var(--text); }
.routes-editor { display: grid; gap: .4rem; }
.routes-editor > label { display: grid; gap: .2rem; }
.route-add { display: flex; gap: .4rem; }
.route-add input { flex: 1; }
.route-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.route-list li { display: inline-flex; align-items: center; gap: .2rem; background: #e3eefc; color: #1a3d6b; border-radius: 99px; padding: .15rem .2rem .15rem .65rem; font-size: .85rem; font-weight: 600; }
.route-list .icon-btn { font-size: 1.1rem; color: inherit; padding: 0 .35rem; }
.company-search { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); margin: .4rem 0; }
.company-search input { padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 10px; font-size: .95rem; }
@media (max-width: 520px) {
  .employment .row, .station-form .row { grid-template-columns: 1fr; }
}

/* Road notices */
/* Above the SOS button (which sits above "Map a bump"), so all three stay reachable. */
.fab-secondary { bottom: 180px; padding: .6rem 1rem; font-size: .9rem; background: #fff; color: var(--text); border: 2px solid var(--primary); }
.fab-secondary:hover { background: #e8f5ee; }
.fab-secondary .fab-plus { color: var(--primary); }
@media (max-width: 760px) { .fab-secondary { bottom: 166px; } }
.app.driving .fab-secondary { display: none; }
.mapping-bar { position: absolute; left: 50%; transform: translateX(-50%); top: 12px; z-index: 6; display: flex; align-items: center; gap: .6rem;
  background: var(--bg); color: #fff; padding: .55rem .7rem .55rem 1rem; border-radius: 99px; box-shadow: var(--shadow); max-width: calc(100% - 32px); font-size: .9rem; }
.mapping-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-pin { border-color: #f07800; color: #8a4400; }
.notice-pin svg, .notice-icon svg { width: 18px; height: 18px; }
.notice-pin.t-road_closed { border-color: #d7263d; color: #a0101f; }
.notice-pin.t-flooding { border-color: #1a73e8; color: #1a5fc0; }
.notice-pin.t-blackspot { border-color: #7a1020; color: #7a1020; }
.notice-pin.t-obstruction { border-color: #8a5a00; color: #8a5a00; }
.notice-pin.t-poor_road { border-color: #6b4e2e; color: #6b4e2e; }
.notice-pin.t-missing_sign { border-color: #5b4bb7; color: #5b4bb7; }
.notice-pin.t-broken_down_vehicle { border-color: #b85c00; color: #b85c00; }
.notice-pin.t-police_block { border-color: #1d3f8f; color: #1d3f8f; }
.notice-pin.t-animals { border-color: #3f6b2a; color: #3f6b2a; }
.notice-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #fff1e0; color: #8a4400; flex-shrink: 0; }
.notice-icon.t-road_closed, .t-road_closed .notice-icon { background: #fbe0e3; color: #a0101f; }
.notice-icon.t-flooding, .t-flooding .notice-icon { background: #e3eefc; color: #1a5fc0; }
.notice-icon.t-blackspot, .t-blackspot .notice-icon { background: #f6dde0; color: #7a1020; }
.notice-icon.t-obstruction, .t-obstruction .notice-icon { background: #f5ead5; color: #8a5a00; }
.notice-icon.t-poor_road, .t-poor_road .notice-icon { background: #efe6dc; color: #6b4e2e; }
.notice-icon.t-missing_sign, .t-missing_sign .notice-icon { background: #ebe8f7; color: #5b4bb7; }
.notice-icon.t-broken_down_vehicle, .t-broken_down_vehicle .notice-icon { background: #f7e9da; color: #b85c00; }
.notice-icon.t-police_block, .t-police_block .notice-icon { background: #e3e9f7; color: #1d3f8f; }
.notice-icon.t-animals, .t-animals .notice-icon { background: #e4eedf; color: #3f6b2a; }
.notice-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .6rem; }
.notice-head small { display: block; color: var(--muted); }
.notice-types li { align-items: center; }
.correction-box { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .4rem; }
.correction-form { margin-top: .6rem; }
.emergency-contact { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: #fdecee; border: 1px solid #f3c4ca; border-radius: 10px; padding: .55rem .7rem; margin: .6rem 0; font-size: .9rem; }
.emergency-contact small { display: block; color: #7a1020; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .7rem; }

/* ---------- Upgrades: language, offline, speed zones, route choice ---------- */
.lang-btn { font-weight: 800; letter-spacing: .04em; min-width: 2.6rem; border: 1px solid rgba(255,255,255,.35); gap: .35rem; }
.lang-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.lang-menu { position: relative; }
.lang-list { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 40; min-width: 190px; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.lang-list button { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 1rem; border: 0; background: none; color: inherit;
  font: inherit; text-align: start; padding: .55rem .7rem; border-radius: 8px; cursor: pointer; }
.lang-list button:hover, .lang-list button:focus-visible { background: var(--surface-2); outline: none; }
.lang-list button[aria-checked="true"] { background: #e3f4ea; color: #0d6b39; font-weight: 700; }
.lang-list small { color: var(--muted); font-weight: 500; }
body.night .lang-list button[aria-checked="true"] { background: #1a4a30; color: #fff; box-shadow: inset 0 0 0 1px var(--night-accent); }
.auth-top-right { display: flex; align-items: center; gap: 12px; }
.auth-top .lang-btn { color: #fff; }
.offline-badge { align-self: center; background: #8a5a00; color: #fff; font-size: .75rem; font-weight: 700; border-radius: 99px; padding: .2rem .6rem; }
.offline-badge[data-waiting]:not([data-waiting=""])::after { content: " · " attr(data-waiting) " to send"; font-weight: 500; }
.offline-ok { color: var(--primary-dark); }

/* A round speed-limit sign: red ring, number in the middle. */
.zone-sign { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 4px solid #d7263d;
  color: #111; font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums; box-shadow: 0 2px 6px rgba(0,0,0,.3); flex: 0 0 auto; }
.zone-sign.small { width: 28px; height: 28px; border-width: 3px; font-size: .75rem; }
.zone-pin.zone-off .zone-sign { opacity: .45; border-color: #9aa5a0; }
.hud-limit { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #fff; border: 5px solid #d7263d; color: #111; }
.hud-limit b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.hud-limit.over { animation: limit-flash .8s ease-in-out infinite; }
@keyframes limit-flash { 50% { background: #d7263d; color: #fff; } }

.route-options { display: grid; gap: .5rem; margin: .8rem 0; }
.route-option { display: grid; gap: .1rem; text-align: start; border: 2px solid var(--border); border-radius: 10px; padding: .6rem .75rem; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.route-option span { color: var(--muted); font-size: .82rem; }
.route-option em { font-style: normal; font-size: .75rem; font-weight: 700; color: var(--primary-dark); }
.route-option.chosen { border-color: var(--primary); background: #e8f5ee; cursor: default; }
.route-option:not(.chosen):hover { border-color: var(--primary); }
.route-option:disabled:not(.chosen) { opacity: .6; cursor: default; }

/* ---------- Ratings, reviews, payments, arrival ---------- */
.stars { color: #f5a300; letter-spacing: .05em; white-space: nowrap; }
.stars .off, .reviews .off { color: #cfd6d2; }
.stars b { color: var(--text); letter-spacing: 0; }
.stars.none { color: var(--muted); letter-spacing: 0; }
a:has(> .stars) { text-decoration: none; }
.review-summary { display: flex; gap: 1rem; align-items: center; margin: .8rem 0 1rem; }
.review-summary .big { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.review-summary .bars { display: grid; gap: .15rem; margin-top: .3rem; font-size: .75rem; }
.review-summary .bars div { display: grid; grid-template-columns: 2rem 9rem 1.5rem; align-items: center; gap: .3rem; }
.review-summary .bars i { display: block; height: 6px; border-radius: 3px; background: #f5a300; min-width: 2px; }
.review-box { border: 1px solid var(--border); border-radius: 10px; padding: .7rem; margin: .8rem 0; display: grid; gap: .5rem; }
.review-box textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: .5rem; font: inherit; resize: vertical; }
.star-input { display: flex; gap: .2rem; }
.star-input button { border: 0; background: none; font-size: 2rem; line-height: 1; color: #cfd6d2; cursor: pointer; padding: 0 .1rem; }
.star-input button.on { color: #f5a300; }
.eta { display: grid; background: #e8f5ee; border-radius: 10px; padding: .5rem .7rem; margin: .5rem 0; }
.eta b { font-size: 1.05rem; } .eta span { font-size: .8rem; color: var(--muted); }
.eta.close { background: #fff4d6; }
.bill { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; margin: .4rem 0; display: grid; gap: .5rem; }
.bill.paid { border-color: var(--primary); background: #e8f5ee; }
.bill.failed { border-color: var(--danger); }
.bill .sub { color: var(--muted); font-size: .8rem; }
.pay-form { display: grid; gap: .4rem; }
.pay-form input { border: 1px solid var(--border); border-radius: 8px; padding: .5rem; font: inherit; }
.btn-mpesa { background: #2e9e3a; color: #fff; font-weight: 700; }
.btn-mpesa:hover { background: #24802e; }
.bill-form-wrap { margin-top: .5rem; } .bill-form-wrap summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--primary-dark); }

/* ---------- Points, fleet, sharing ---------- */
.points-box { border: 1px solid var(--border); border-radius: 10px; padding: .7rem; }
.points-head { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.points-head > b { font-size: 1.8rem; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: .5rem 0 .2rem; }
.progress i { display: block; height: 100%; background: var(--primary); }
.leaders { margin: .4rem 0 0; padding-left: 1.3rem; font-size: .88rem; }
.leaders li { display: flex; justify-content: space-between; } .leaders li.me { font-weight: 700; }
.share-toggle { margin-top: .5rem; }
.fleet-totals .alert-cell { color: var(--danger); }
.warn-text { color: var(--sev-2); font-weight: 600; }
.btn-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; margin-right: .3rem; }

/* ---------- Night mode ---------- */
body.night {
  --surface: #151c20; --surface-2: #1d262b; --border: #2b373e; --text: #e6eef0; --muted: #9db0b7; --bg: #05080a;
  color-scheme: dark; color: var(--text);
}
/* Components that are white in day mode. */
body.night .btn-light, body.night .btn-outline, body.night .tab.active, body.night .fab-secondary, body.night .alarm-card,
body.night .overlay-pin, body.night .type-card span, body.night .employment .choice span, body.night .co-results,
body.night .form input:not([type=checkbox]):not([type=radio]), body.night .form select, body.night .form textarea {
  background: var(--surface-2); color: var(--text);
}
body.night .fab-secondary:hover { background: #12301f; }
body.night .toast:not(.error):not(.success) { background: #2b373e; color: #fff; }
body.night .notice, body.night .help-wait { background: #3a2f0c; color: #ffe6a6; }
body.night .co-picked, body.night .type-card input:checked + span, body.night .employment .choice input:checked + span { background: #12301f; }
body.night .map-error { background: #0f1518; }
body.night a:not(.btn) { color: #7fd3a3; }
body.night .app, body.night .stage { background: #0a0f12; }
body.night .ctrl { background: var(--surface); }
body.night .legend { background: rgba(21, 28, 32, .94); color: var(--text); }
body.night .panel input, body.night .panel select, body.night .panel textarea { background: #0f1518; color: var(--text); border-color: var(--border); }
body.night .route-option.chosen, body.night .eta, body.night .bill.paid { background: #12301f; }
body.night .eta.close { background: #3a2f0c; }
body.night .chip.neutral { background: var(--surface-2); color: var(--text); }
/* Driving at night: bigger, calmer warnings that are readable at a glance. */
body.night .drive-hud { background: #000; border: 1px solid #222; }
body.night .hud-next { font-size: 1.1rem; }
body.night .drive-alert { font-size: 1.7rem; padding: 1.3rem; }

/* ---------- Kilometres wallet ---------- */
.km-chip { border: 1px solid rgba(245, 183, 0, .6); color: var(--amber); font-weight: 700; font-variant-numeric: tabular-nums; }
.bundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .5rem; margin: .5rem 0 .8rem; }
.bundle { display: grid; gap: .1rem; justify-items: start; text-align: start; border: 2px solid var(--border); border-radius: 10px; padding: .55rem .6rem;
  background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.bundle b { font-size: 1.05rem; } .bundle .price { font-weight: 700; color: var(--primary-dark); }
.bundle.chosen, .bundle:hover { border-color: var(--primary); }
.bundle.suggested { box-shadow: 0 0 0 3px rgba(245, 183, 0, .45); }
.km-price { margin: .2rem 0 .4rem; min-height: 1.3em; }
.ok-text { color: var(--primary-dark); font-weight: 600; }
body.night .bundle .price, body.night .ok-text { color: #7fd3a3; }
.km-chip.low { border-color: #e0663a; color: #ffb59b; }
.wallet-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin: 0 -1rem .9rem; padding: 0 1rem; overflow-x: auto; scrollbar-width: none; }
.wallet-tabs::-webkit-scrollbar { display: none; }
.wallet-tabs button { flex: 0 0 auto; border: 0; background: none; padding: .55rem .7rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.wallet-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
.wallet-balance { border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: .8rem; background: var(--surface); }
.wallet-balance.compact { padding: .7rem .9rem; }
.wallet-total { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.wallet-total span { color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.wallet-total b { font-size: 1.8rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.wallet-balance.compact .wallet-total b { font-size: 1.3rem; }
.wallet-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin: .8rem 0 0; padding-top: .8rem; border-top: 1px solid var(--border); }
.reward-card .wallet-split { margin-top: .4rem; }
.wallet-split dt { color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.wallet-split dd { margin: .1rem 0 0; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.wallet-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.plain-list { margin: .3rem 0 .8rem; padding-inline-start: 1.1rem; } .plain-list li { margin: .25rem 0; }
.ledger { list-style: none; margin: 0 0 .6rem; padding: 0; }
.ledger li { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.ledger .title { font-weight: 600; } .ledger .sub { color: var(--muted); font-size: .8rem; }
.ledger b { white-space: nowrap; font-variant-numeric: tabular-nums; } .ledger b.plus { color: var(--primary-dark); } .ledger b.minus { color: var(--text); }
.reward-card { border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: .9rem; background: var(--surface); }
.reward-card header { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .2rem; }
.reward-card h3 { margin: 0; font-size: 1.02rem; }
.reward-card .rate { font-size: .8rem; font-weight: 700; color: var(--primary-dark); background: #e3f4ea; padding: .15rem .55rem; border-radius: 999px; }
.redeem-row { display: grid; grid-template-columns: 1fr 96px; gap: .7rem; align-items: center; }
.redeem-row input[type=range] { accent-color: var(--primary); width: 100%; padding: 0; border: 0; }
.redeem-result { display: grid; gap: .05rem; text-align: center; border: 1px dashed var(--border); border-radius: 10px; padding: .7rem; margin: .2rem 0 .3rem; min-height: 4.2rem; align-content: center; }
.redeem-result b { font-size: 1.5rem; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.invite-code { display: grid; gap: .1rem; text-align: center; background: var(--surface-2); border-radius: 10px; padding: .7rem; margin: .7rem 0 .5rem; }
.invite-code b { font-size: 1.6rem; letter-spacing: .22em; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.invite-link { display: flex; gap: .4rem; margin-bottom: .5rem; }
.invite-link input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: .45rem .6rem; font-size: .85rem; color: var(--muted); background: var(--surface); }
.btn-whatsapp { background: #1f8f4d; color: #fff; }
.btn-whatsapp:hover { background: #17733d; color: #fff; }
.confirm-card, .done-card { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; padding: 1rem; margin: .4rem 0 .9rem; background: var(--surface); }
.confirm-card h3, .done-card h3 { margin: 0 0 .6rem; font-size: 1rem; }
.confirm-card dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 .8rem; }
.confirm-card dt { color: var(--muted); } .confirm-card dd { margin: 0; font-weight: 600; }
.confirm-card .actions { display: flex; gap: .5rem; justify-content: flex-end; }
body.night .reward-card .rate { background: #12301f; color: #7fd3a3; }
body.night .ledger b.plus, body.night .redeem-result b { color: #7fd3a3; }

/* ---------- Safety, history, privacy ---------- */
.safety-box { border: 1px solid var(--border); border-radius: 12px; padding: .8rem .9rem; margin: .2rem 0 .8rem; }
.safety-box h3 { margin: 0 0 .25rem; font-size: .98rem; }
.btn-sos-outline { background: #fff; border: 2px solid #b3261e; color: #b3261e; font-weight: 700; }
.btn-sos-outline:hover { background: #fdecee; }
.btn-sos-outline:disabled { border-color: var(--border); color: var(--muted); }
.sos-banner { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: .8rem;
  background: #b3261e; color: #fff; padding: .6rem .7rem .6rem 1rem; border-radius: 14px; box-shadow: var(--shadow); width: min(560px, calc(100% - 32px)); }
.sos-banner > div { display: grid; flex: 1; } .sos-banner span { font-size: .82rem; opacity: .9; }
.sos-banner .btn { background: #fff; color: #b3261e; white-space: nowrap; }
.lead-text { font-size: .98rem; margin: 0 0 .8rem; }
.steps { padding-inline-start: 1.2rem; margin: .3rem 0 .6rem; } .steps li { margin: .3rem 0; }
.account-links { display: grid; gap: .4rem; margin: .2rem 0 .6rem; }
.account-links .btn { display: grid; justify-items: start; justify-content: stretch; text-align: start; gap: .05rem; padding: .6rem .8rem; }
.account-links .btn small { color: var(--muted); font-weight: 500; font-size: .8rem; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; margin: .4rem 0 .4rem; }
.stat-cards div { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; background: var(--surface); }
.stat-cards b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat-cards span { color: var(--muted); font-size: .8rem; }
.stat-cards em { display: block; font-style: normal; font-size: .75rem; color: var(--muted); margin-top: .1rem; }
.stat-cards em.up { color: var(--primary-dark); }
.period-switch { display: flex; gap: .3rem; margin: .2rem 0 .3rem; }
.period-switch button { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.period-switch button[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.trip-log { list-style: none; margin: 0; padding: 0; }
.trip-log li { padding: .65rem 0; border-bottom: 1px solid var(--border); display: grid; gap: .1rem; }
.trip-log .title { font-weight: 600; } .trip-log .sub { color: var(--muted); font-size: .82rem; }
.terms-check { font-size: .85rem; font-weight: 500; color: var(--text); align-items: flex-start; }
.terms-check input { margin-top: .2rem; }
.invited-note { background: #e3f4ea; color: #0d6b39; border-radius: 10px; padding: .55rem .75rem; font-size: .88rem; margin: 0 0 .4rem; }
.auth-foot a { color: inherit; }
.gate { position: fixed; inset: 0; z-index: 60; background: rgba(5, 12, 9, .72); display: grid; place-items: center; padding: 16px; }
.gate-card { background: var(--surface); color: var(--text); width: min(520px, 100%); border-radius: 14px; padding: 1.4rem; box-shadow: 0 20px 60px rgba(0,0,0,.35); max-height: calc(100vh - 32px); overflow: auto; }
.gate-card h2 { margin: 0 0 .5rem; font-size: 1.25rem; }
.gate-card .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: var(--muted); font-weight: 700; }
.gate-card .doc-links { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .8rem 0; }
body.night .safety-box, body.night .sos-banner .btn { background: var(--surface); }
body.night .btn-sos-outline { background: transparent; }
body.night .invited-note { background: #12301f; color: #a8e2bf; }
.fleet-actions { display: grid; gap: .3rem; }
#redeem-form { margin-top: .9rem; }
body.night .sos-intro { background: #3a1216; color: #ffd7dc; }

/* ---------- Night mode: selected, active and focused states must stand out ---------- */
body.night { --night-accent: #3ddc84; }
body.night .tabs { background: #0f1518; }
body.night .tab.active { background: #1f5c3a; color: #fff; box-shadow: inset 0 0 0 1px var(--night-accent); }
body.night .auth-card .tab.active { background: none; box-shadow: none; color: #fff; border-bottom-color: transparent; }
body.night .subtab.active { color: var(--night-accent); border-color: var(--night-accent); }
body.night .form input:focus, body.night .form select:focus, body.night .form textarea:focus,
body.night .panel input:focus, body.night .panel select:focus, body.night .panel textarea:focus { outline: 2px solid var(--night-accent); outline-offset: -1px; border-color: transparent; }
body.night .seg input:checked + label { background: color-mix(in srgb, currentColor 22%, transparent); border-width: 2px; }
body.night .type-card input:checked + span, body.night .employment .choice input:checked + span,
body.night .route-option.chosen, body.night .bundle.chosen { background: #1a4a30; border-color: var(--night-accent); box-shadow: inset 0 0 0 1px var(--night-accent); }
body.night .bundle:hover, body.night .route-option:not(.chosen):hover { border-color: var(--night-accent); }
body.night .type-card input:focus-visible + span, body.night .employment .choice input:focus-visible + span { outline: 3px solid rgba(61, 220, 132, .5); }
body.night .wallet-tabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--night-accent); }
body.night .period-switch button[aria-pressed="true"] { background: var(--night-accent); color: #04130b; border-color: var(--night-accent); }
body.night .ctrl[aria-pressed=true] { background: #1f8f4d; box-shadow: 0 0 0 2px var(--night-accent); }
body.night .btn-ghost.active, body.night .btn-ghost[aria-pressed=true] { background: rgba(61, 220, 132, .22); box-shadow: inset 0 0 0 1px var(--night-accent); }
body.night .btn:focus-visible, body.night button:focus-visible, body.night a:focus-visible { outline: 2px solid var(--night-accent); outline-offset: 2px; }
body.night input[type=checkbox], body.night input[type=radio], body.night input[type=range] { accent-color: var(--night-accent); }
body.night .toast.error { background: #c62828; border-left-color: #ff8a80; color: #fff; }
body.night .map-error > div { background: #3a1216; border-color: #7a2a2a; border-left-color: #ff6b6b; }
body.night .map-error h2 { color: #ffb3b3; }
body.night .map-error p { color: #ffd7d7 !important; }
.map-error.warn > div { background: #fff4e0; border-color: #f0d58a; border-left-color: #e0a800; }
.map-error.warn h2 { color: #6b4500; } .map-error.warn p { color: #5a3d00 !important; }
body.night .map-error.warn > div { background: #3a2f0c; border-color: #6b5a1a; border-left-color: #f5b700; }
body.night .map-error.warn h2 { color: #ffd66b; } body.night .map-error.warn p { color: #ffe6a6 !important; }

/* ---------- Sign in / Create account: the switch is a view transition ---------- */
.auth-card { view-transition-name: auth-card; }
.auth-card .tabs { view-transition-name: auth-tabs; }
.auth-forms { view-transition-name: auth-forms; }
.auth-hero { view-transition-name: auth-hero; }
.auth-error { view-transition-name: auth-error; }
::view-transition-group(auth-card), ::view-transition-group(auth-tabs), ::view-transition-group(auth-hero),
::view-transition-group(auth-error), ::view-transition-group(auth-forms) {
  animation-duration: .5s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
::view-transition-group(auth-forms) { overflow: clip; }
/* The forms keep their real size (no stretching) while the card outline morphs around them. */
::view-transition-old(auth-forms), ::view-transition-new(auth-forms) { width: 100%; height: 100%; object-fit: none; object-position: 50% 0; }
::view-transition-old(auth-forms) { animation: auth-out .18s ease-in both; }
::view-transition-new(auth-forms) { animation: auth-in .48s cubic-bezier(.2,.8,.2,1) .08s both; }
:root[data-auth-dir="back"]::view-transition-new(auth-forms) { animation-name: auth-in-back; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; }
@keyframes auth-out { to { opacity: 0; transform: translateY(-8px); filter: blur(2px); } }
@keyframes auth-in { 0% { opacity: 0; transform: translateY(18px); } 70% { opacity: 1; transform: translateY(-3px); } 100% { opacity: 1; transform: none; } }
@keyframes auth-in-back { 0% { opacity: 0; transform: translateY(-14px); } 70% { opacity: 1; transform: translateY(2px); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .auth-card .tab-indicator { transition: none; }
}

/* ---------- Saved places ---------- */
.quick-places { margin: 0 0 .9rem; }
.place-row { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: thin; }
.place-chip { flex: 0 0 auto; display: grid; text-align: start; min-width: 112px; max-width: 190px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 12px; padding: .55rem .75rem; font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.place-chip:hover { border-color: var(--primary); transform: translateY(-1px); }
.place-chip b { font-size: .92rem; } .place-chip span { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-chip.add { border-style: dashed; }
.recent-list { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: .5rem 0 .2rem; }
.recent-item { border: 0; background: var(--surface-2); color: var(--text); border-radius: 999px; padding: .3rem .7rem; font: inherit; font-size: .84rem; cursor: pointer; }
.recent-item:hover { background: #e3f4ea; }
body.night .recent-item:hover { background: #1a4a30; }
body.night .place-chip:hover { border-color: var(--night-accent); }
.share-on { background: #e3f4ea; color: #0d6b39; border-radius: 10px; padding: .5rem .7rem; }
body.night .share-on { background: #12301f; color: #a8e2bf; }

/* ---------- End of trip ---------- */
.trip-done { text-align: center; padding: .4rem 0 .2rem; }
.trip-done .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: var(--primary-dark); font-weight: 700; margin: 0; }
.trip-done h3 { margin: .15rem 0 .8rem; font-size: 1.25rem; }
.trip-done .stat-cards { text-align: start; }
.trip-done p { text-align: start; }
body.night .trip-done .eyebrow { color: var(--night-accent); }

/* ---------- Help ---------- */
.faq details { border-bottom: 1px solid var(--border); padding: .15rem 0; }
.faq summary { cursor: pointer; padding: .55rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.2rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 .7rem; color: var(--muted); font-size: .92rem; }
.seg.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.seg.kinds input { position: absolute; opacity: 0; pointer-events: none; }
.seg.kinds label { font-size: .84rem; }
.seg.kinds input:checked + label { border-color: var(--primary); background: #e3f4ea; color: #0d6b39; }
body.night .seg.kinds input:checked + label { background: #1a4a30; color: #fff; border-color: var(--night-accent); }
.seg.kinds input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; }
.feedback-list { list-style: none; margin: 0; padding: 0; }
.feedback-list li { border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem; margin-bottom: .6rem; }
.feedback-list p { margin: .3rem 0; white-space: pre-wrap; }
.fb-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.fb-reply { margin-top: .6rem; border-left: 3px solid var(--primary); background: var(--surface-2); padding: .5rem .7rem; border-radius: 0 8px 8px 0; }
.btn-col { display: grid; gap: .5rem; }
#btn-account .badge, .account-links .badge { background: #d7263d; color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .4rem; min-width: 1.2rem; text-align: center; }

/* ---------- Notifications ---------- */
.toggle-list { display: grid; gap: 0; }
.toggle-row { display: flex !important; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--border);
  font-weight: 500 !important; color: var(--text) !important; font-size: .92rem; cursor: pointer; }
.toggle-row input { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 44px; height: 26px; border-radius: 999px; background: #c9d3ce;
  position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.toggle-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.toggle-row input:checked { background: var(--primary); }
.toggle-row input:checked::after { transform: translateX(18px); }
.toggle-row input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
body.night .toggle-row input { background: #3a4a52; }
body.night .toggle-row input:checked { background: #1f8f4d; box-shadow: 0 0 0 1px var(--night-accent); }

/* ---------- First-time guide ---------- */
.onboarding { animation: ob-fade .25s ease-out; }
.onboarding.leaving { opacity: 0; transition: opacity .2s ease; }
.ob-card { animation: ob-rise .35s cubic-bezier(.2,.8,.2,1); }
.ob-card h2 { margin: .2rem 0 .6rem; }
.ob-langs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0 1rem; }
.ob-langs button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .88rem; cursor: pointer; }
.ob-langs button.on { border-color: var(--primary); background: #e3f4ea; color: #0d6b39; font-weight: 700; }
body.night .ob-langs button.on { background: #1a4a30; color: #fff; border-color: var(--night-accent); }
.ob-points { margin: .4rem 0 1rem; padding-inline-start: 1.2rem; } .ob-points li { margin: .3rem 0; }
.ob-actions { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-top: 1rem; }
.ob-dots { display: flex; justify-content: center; gap: .4rem; margin-top: 1rem; }
.ob-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: width .25s, background .25s; }
.ob-dots i.on { width: 20px; border-radius: 99px; background: var(--primary); }
@keyframes ob-fade { from { opacity: 0; } }
@keyframes ob-rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .onboarding, .ob-card { animation: none; } }

/* ---------- Right-to-left (Arabic) ---------- */
html[dir="rtl"] body { font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, Inter, system-ui, sans-serif; }
#map, .map, .auth-road, .stat-cards b, .wallet-total b, .ledger b, .invite-code b, input[type=tel], input[type=email] { direction: ltr; }
html[dir="rtl"] .stat-cards b, html[dir="rtl"] .wallet-total b { text-align: right; }
html[dir="rtl"] .faq summary::after { margin-inline-start: auto; }
html[dir="rtl"] .fb-reply { border-left: 0; border-right: 3px solid var(--primary); border-radius: 8px 0 0 8px; }
html[dir="rtl"] .toggle-row input::after { left: auto; right: 3px; }
html[dir="rtl"] .toggle-row input:checked::after { transform: translateX(-18px); }
html[dir="rtl"] .disclosures, html[dir="rtl"] .confirm-card { border-left-width: 1px; border-right-width: 4px; }
html[dir="rtl"] .map-error > div { border-left-width: 1px; border-right: 5px solid var(--danger); }

/* The place search never collapses to a sliver: hide the user's name first, then give the search its own row. */
.search-slot { min-width: 220px; }
@media (max-width: 1400px) { .user-name { display: none; } }
@media (min-width: 761px) and (max-width: 1366px) {
  :root { --topbar-h: auto; }
  .topbar { flex-wrap: wrap; padding: 8px 16px; row-gap: .4rem; }
  .search-slot { order: 3; flex-basis: 100%; max-width: none; }
}

/* =====================================================================================================
   Google Maps-style shell: the map fills the screen; search, chips, layers and controls float on it.
   ===================================================================================================== */
.app.gm { position: relative; }
.app.gm .stage { position: absolute; inset: 0; }
.app.gm .topbar { position: absolute; inset: 0 0 auto 0; height: auto; display: block; padding: 0; background: none; z-index: 8; pointer-events: none; }
.app.gm .topbar > * { pointer-events: auto; }
.gm-shadow, .search-card, .chip-btn, .avatar, .layers-btn, .locate-btn, .lang-btn, .km-chip { box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15); }

.search-card { position: absolute; top: 12px; left: 12px; width: 392px; height: 48px; display: flex; align-items: center; gap: 2px; padding: 0 4px; background: #fff; border-radius: 24px; color: #202124; z-index: 2; }
.search-card .search-slot { flex: 1; min-width: 0; max-width: none; height: 100%; display: flex; align-items: center; }
.search-card gmp-place-autocomplete { width: 100%; color-scheme: light; --gmp-mat-color-surface: #fff; }
.search-card .plain-search { width: 100%; border: 0; outline: 0; font: inherit; font-size: 15px; background: transparent; padding: 0 6px; }
.sc-btn { flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; color: #5f6368; }
.sc-btn:hover { background: #f1f3f4; }
.sc-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-dir .dir-diamond { fill: #1a73e8; stroke: none; }
.sc-dir .dir-arrow { stroke: #fff; stroke-width: 2.2; }

.gm-chips { position: absolute; top: 12px; left: 416px; right: 260px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; }
.gm-chips::-webkit-scrollbar { display: none; }
.chip-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 10px; border: 0; border-radius: 16px; background: #fff; color: #3c4043; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.chip-btn:hover { background: #f1f3f4; }
.chip-btn svg { width: 18px; height: 18px; fill: none; stroke: #5f6368; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip-btn.active { background: #e8f0fe; color: #1967d2; } .chip-btn.active svg { stroke: #1967d2; }
.gm-chips .offline-badge { align-self: center; }

.app.gm .top-actions { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 8px; margin: 0; }
.app.gm .lang-btn, .app.gm .km-chip { height: 36px; background: #fff; color: #3c4043; border: 0; border-radius: 18px; padding: 0 12px; font-weight: 600; }
.app.gm .km-chip { color: #188038; }
.app.gm .km-chip.low { color: #d93025; }
.avatar-menu { position: relative; }
.avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #188038; color: #fff; font-weight: 600; font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.avatar.big { width: 48px; height: 48px; font-size: 22px; box-shadow: none; }
.avatar .badge { position: absolute; top: -3px; right: -3px; background: #d93025; color: #fff; border-radius: 999px; font-size: .68rem; min-width: 1.15rem; padding: 0 .3rem; border: 2px solid #fff; }
.account-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: #fff; color: #202124; border-radius: 16px; padding: 8px; box-shadow: 0 4px 16px rgba(60,64,67,.28); z-index: 30; }
.ap-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 14px; border-bottom: 1px solid #e8eaed; margin-bottom: 6px; }
.ap-head b { display: block; font-size: 15px; } .ap-head .role-pill { margin-top: 2px; }
.app.gm .user-name { display: block; }
.ap-item { display: flex; width: 100%; align-items: center; gap: .5rem; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 14px; color: #202124; text-decoration: none; cursor: pointer; text-align: start; }
.ap-item:hover { background: #f1f3f4; }

.drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 320px; max-width: 86vw; background: #fff; color: #202124; z-index: 41; box-shadow: 0 0 24px rgba(0,0,0,.25); display: flex; flex-direction: column; animation: drawer-in .22s cubic-bezier(.2,.8,.2,1); }
@keyframes drawer-in { from { transform: translateX(-100%); } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 12px 20px; border-bottom: 1px solid #e8eaed; }
.brand.dark { color: #202124; } .brand.dark b { color: #188038; }
.drawer-list { overflow-y: auto; padding: 8px 0; display: grid; }
.drawer-list button, .drawer-list a { border: 0; background: none; text-align: start; padding: 12px 24px; font: inherit; font-size: 14px; color: #202124; text-decoration: none; cursor: pointer; }
.drawer-list button:hover, .drawer-list a:hover { background: #f1f3f4; }
.drawer-list hr { border: 0; border-top: 1px solid #e8eaed; margin: 6px 0; }

/* Layers and my-location, bottom corners */
.layers { position: absolute; left: 12px; bottom: 24px; z-index: 6; }
.layers-btn { width: 72px; height: 72px; border: 2px solid #fff; border-radius: 10px; background: linear-gradient(135deg, #e8f0fe, #fff); color: #3c4043; display: grid; place-items: center; align-content: center; gap: 2px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.layers-btn svg { width: 26px; height: 26px; fill: none; stroke: #1a73e8; stroke-width: 1.8; stroke-linejoin: round; }
.layers-pop { position: absolute; left: 0; bottom: calc(100% + 10px); width: 320px; max-width: calc(100vw - 24px); background: #fff; color: #202124; border-radius: 16px; padding: 14px; box-shadow: 0 4px 16px rgba(60,64,67,.28); }
.lp-title { font-weight: 600; font-size: 14px; margin: 0 0 10px; }
.layers-pop .map-controls { position: static; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.layers-pop .ctrl { width: auto; height: auto; display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 2px solid #e8eaed; background: #fff; box-shadow: none; font: inherit; font-size: 12px; color: #3c4043; cursor: pointer; }
.layers-pop .ctrl svg { width: 26px; height: 26px; }
.layers-pop .ctrl[aria-pressed=true] { border-color: #1a73e8; background: #e8f0fe; color: #1967d2; }
.layers-pop .ctrl[aria-pressed=true] svg { stroke: #1967d2; fill: #1967d2; }
.layers-pop .legend { position: static; box-shadow: none; padding: 12px 0 0; margin-top: 12px; border-top: 1px solid #e8eaed; background: none; max-width: none; }
.locate-btn { position: absolute; right: 10px; bottom: 132px; z-index: 6; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; display: grid; place-items: center; cursor: pointer; }
.locate-btn svg { width: 22px; height: 22px; fill: none; stroke: #5f6368; stroke-width: 2; stroke-linecap: round; }
.locate-btn svg .fill { fill: #1a73e8; stroke: none; }
.app.gm .sos { right: 10px; bottom: 186px; width: 56px; height: 56px; }
.app.gm .fab { bottom: 24px; right: auto; left: 50%; transform: translateX(calc(-100% - 6px)); box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15); }
.app.gm .fab-secondary { bottom: 24px; transform: translateX(6px); }
.app.gm .legend { display: flex; }

/* Panel: Google's left side panel (desktop), bottom sheet (phones) */
@media (min-width: 761px) {
  .app.gm .panel { left: 0; top: 0; bottom: 0; width: 408px; border-radius: 0; padding-top: 72px; box-shadow: 0 0 20px rgba(0,0,0,.18); z-index: 7; }
  .app.gm .panel-head { border-top: 1px solid #e8eaed; }
  body.panel-open .app.gm .gm-chips { left: 420px; }
  body.panel-open .app.gm .layers { left: 420px; }
  body.panel-open .app.gm .trip-bar { left: calc(50% + 204px); }
}

/* Directions panel */
.dir-head { background: #fff; margin: -1rem -1rem 0; padding: 12px 16px 14px; border-bottom: 1px solid #e8eaed; }
.dir-modes { display: flex; gap: 6px; margin-bottom: 10px; }
.dir-mode { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 16px; background: #e8f0fe; color: #1967d2; font-weight: 600; font-size: 13px; }
.dir-mode svg { width: 18px; height: 18px; fill: #1967d2; }
.dir-fields { display: grid; grid-template-columns: 22px 1fr 36px; align-items: center; column-gap: 8px; row-gap: 8px; }
.dir-dots { grid-row: 1 / 3; display: grid; justify-items: center; align-content: space-between; height: 64px; }
.dir-dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #5f6368; background: #fff; }
.dir-dots b { width: 2px; flex: 1; height: 26px; background: repeating-linear-gradient(#bdc1c6 0 3px, transparent 3px 7px); }
.dir-dots .to { border-color: #ea4335; background: #ea4335; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.dir-field { border: 1px solid #dadce0; border-radius: 8px; min-height: 40px; display: flex; align-items: center; padding: 0 8px; background: #fff; }
.dir-field gmp-place-autocomplete { width: 100%; }
.dir-field .static { font-size: 14px; color: #202124; }
.dir-swap { grid-row: 1 / 3; grid-column: 3; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: #5f6368; cursor: pointer; }
.dir-swap:hover { background: #f1f3f4; }
.dir-swap svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.route-card { display: grid; grid-template-columns: 28px 1fr auto; gap: 4px 12px; width: 100%; padding: 14px 16px; margin: 0 -1rem; width: calc(100% + 2rem); border: 0; border-bottom: 1px solid #e8eaed; background: #fff; text-align: start; font: inherit; color: #202124; cursor: pointer; border-left: 4px solid transparent; }
.route-card:hover { background: #f8f9fa; }
.route-card.chosen { border-left-color: #1a73e8; background: #fff; cursor: default; }
.route-card .rc-car svg { width: 24px; height: 24px; fill: #5f6368; margin-top: 2px; }
.route-card .rc-via { font-size: 14px; } .route-card .rc-meta { grid-column: 2 / 4; font-size: 13px; color: #5f6368; }
.route-card .rc-time { font-size: 18px; font-weight: 500; text-align: end; white-space: nowrap; }
.route-card .rc-time.fast { color: #188038; } .route-card .rc-time.slow { color: #d93025; }
.route-card .rc-dist { display: block; font-size: 13px; color: #5f6368; font-weight: 400; }
.route-card .rc-bumps { grid-column: 2 / 4; font-size: 13px; color: #b06000; }
.dir-actions { display: flex; gap: 10px; align-items: center; padding: 14px 0 6px; }
.btn-start { display: inline-flex; align-items: center; gap: 8px; background: #1a73e8; color: #fff; border: 0; border-radius: 20px; padding: 10px 22px; font-weight: 600; font-size: 15px; box-shadow: 0 1px 3px rgba(60,64,67,.3); cursor: pointer; }
.btn-start:hover { background: #1765cc; color: #fff; }
.btn-start svg { width: 18px; height: 18px; fill: #fff; }
.btn-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: #1a73e8; border: 1px solid #dadce0; border-radius: 20px; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn-pill:hover { background: #f1f8ff; }
.steps-list { list-style: none; margin: 0 -1rem; padding: 0; }
.steps-list li { display: grid; grid-template-columns: 48px 1fr; gap: 0 8px; padding: 12px 16px 12px 8px; border-bottom: 1px solid #f1f3f4; }
.steps-list .maneuver { width: 30px; height: 30px; color: #5f6368; justify-self: center; }
.steps-list .st-main { font-size: 14px; color: #202124; }
.steps-list .st-extra { font-size: 12px; color: #5f6368; margin-top: 2px; }
.steps-list .st-dist { font-size: 12px; color: #5f6368; margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.steps-list .st-dist::after { content: ""; flex: 1; border-top: 1px solid #e8eaed; }
.suggest-list { list-style: none; margin: 8px -1rem 0; padding: 0; }
.suggest-list button { display: grid; grid-template-columns: 40px 1fr; align-items: center; width: 100%; border: 0; background: none; text-align: start; padding: 10px 16px 10px 8px; font: inherit; color: #202124; cursor: pointer; }
.suggest-list button:hover { background: #f1f3f4; }
.suggest-list .sg-ic { width: 32px; height: 32px; border-radius: 50%; background: #f1f3f4; display: grid; place-items: center; justify-self: center; }
.suggest-list .sg-ic svg { width: 18px; height: 18px; fill: none; stroke: #5f6368; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.suggest-list b { font-weight: 500; font-size: 14px; display: block; } .suggest-list small { color: #5f6368; font-size: 12px; }
.place-card .pc-name { font-size: 22px; font-weight: 400; margin: 0 0 4px; color: #202124; }
.place-card .pc-type { color: #5f6368; font-size: 14px; }
.place-card .pc-rating { color: #5f6368; font-size: 14px; } .place-card .pc-rating b { color: #202124; font-weight: 500; } .place-card .stars { color: #fbbc04; letter-spacing: 1px; }
.place-card .pc-actions { display: flex; gap: 18px; padding: 14px 0; border-bottom: 1px solid #e8eaed; margin: 0 -1rem 8px; padding-inline: 1rem; overflow-x: auto; }
.pc-act { display: grid; justify-items: center; gap: 6px; border: 0; background: none; color: #1a73e8; font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; min-width: 56px; }
.pc-act .ic { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #dadce0; display: grid; place-items: center; }
.pc-act.primary .ic { background: #1a73e8; border-color: #1a73e8; }
.pc-act .ic svg { width: 20px; height: 20px; fill: none; stroke: #1a73e8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pc-act.primary .ic svg { stroke: #fff; } .pc-act.primary .ic svg .solid { fill: #fff; stroke: none; }
.place-card .pc-line { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 10px 0; font-size: 14px; color: #202124; align-items: start; }
.place-card .pc-line svg { width: 20px; height: 20px; fill: none; stroke: #1a73e8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; justify-self: center; }
.open-now { color: #188038; font-weight: 500; } .closed-now { color: #d93025; font-weight: 500; }

/* Route drawing on the map */
.route-tag { position: relative; background: #fff; color: #202124; border-radius: 8px; padding: 4px 8px; font-size: 13px; font-weight: 500; line-height: 1.25; box-shadow: 0 1px 3px rgba(0,0,0,.35); white-space: nowrap; cursor: pointer; transform: translateY(-8px); }
.route-tag::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #fff; }
.route-tag.chosen { background: #1a73e8; color: #fff; } .route-tag.chosen::after { border-top-color: #1a73e8; }
.route-tag small { display: block; font-weight: 400; font-size: 11px; opacity: .85; }
.route-origin { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #3c4043; box-shadow: 0 1px 3px rgba(0,0,0,.4); transform: translateY(8px); }
.route-destination svg { width: 27px; height: 38px; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.nav-puck { width: 40px; height: 40px; transition: transform .4s linear; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); transform-origin: 50% 50%; margin-bottom: -20px; }
.nav-puck svg { width: 40px; height: 40px; display: block; }

/* Trip bar after planning: a slim card, Google-style */
.app.gm .trip-bar { top: auto; bottom: 24px; background: #fff; color: #202124; border-radius: 28px; box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15); padding: 8px 8px 8px 18px; }
.app.gm .trip-bar .trip-bar-text span { color: #5f6368; opacity: 1; } .app.gm .trip-bar .trip-bar-text em { color: #d93025; }
.app.gm .trip-bar .btn-ghost-light { color: #1a73e8; background: none; }
.app.gm .trip-bar #btn-trip-end { color: #5f6368; font-size: 1.3rem; padding: 0 .6rem; }

.app.gm .trip-prompt { top: 72px; bottom: auto; }

/* =====================================================================================================
   Navigation (drive mode), Google Maps-style
   ===================================================================================================== */
.app.driving .topbar, .app.driving .layers, .app.driving .fab, .app.driving .trip-bar, .app.driving .locate-btn, .app.driving .trip-prompt { display: none !important; }
.app.driving .panel { display: none; }
.app.driving .sos { bottom: 110px; }
.nav-ui { position: absolute; inset: 0; pointer-events: none; z-index: 9; }
.nav-ui > * { pointer-events: auto; }
.nav-banner { position: absolute; top: 12px; left: 12px; width: min(440px, calc(100% - 24px)); background: #0b8043; color: #fff; border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.35); overflow: hidden; }
.nav-main { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 14px 16px; }
.nav-icon .maneuver { width: 60px; height: 60px; color: #fff; }
.nav-text b { display: block; font-size: 30px; line-height: 1.05; font-weight: 600; font-variant-numeric: tabular-nums; }
.nav-text span { display: block; font-size: 20px; line-height: 1.2; font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nav-then { display: flex; align-items: center; gap: 8px; background: #075e30; padding: 8px 16px; font-size: 16px; font-weight: 500; }
.nav-then .maneuver { width: 26px; height: 26px; color: #fff; }
.nav-ui .hud-next { position: absolute; top: calc(12px + var(--banner-h, 108px)); left: 12px; width: min(440px, calc(100% - 24px)); margin-top: 8px; background: #fff; color: #202124; border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 15px; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.nav-ui .hud-next:empty { display: none; }
.nav-speed { position: absolute; left: 12px; bottom: 110px; display: grid; gap: 8px; justify-items: center; }
.nav-speed .hud-speed { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: #202124; display: grid; place-content: center; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.nav-speed .hud-speed b { font-size: 24px; line-height: 1; }
.nav-speed .hud-speed small { font-size: 11px; color: #5f6368; opacity: 1; }
.nav-recenter { position: absolute; left: 50%; transform: translateX(-50%); bottom: 112px; display: inline-flex; align-items: center; gap: 8px; border: 0; background: #fff; color: #1a73e8; border-radius: 22px; padding: 10px 18px; font: inherit; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; }
.nav-recenter svg { width: 18px; height: 18px; fill: #1a73e8; }
.nav-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 52px 1fr 52px 52px; align-items: center; gap: 8px; background: #fff; color: #202124; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; box-shadow: 0 -2px 10px rgba(0,0,0,.2); }
@media (min-width: 761px) { .nav-bottom { left: 12px; right: auto; bottom: 12px; width: 440px; border-radius: 16px; } .nav-speed { left: 470px; bottom: 16px; } .nav-recenter { bottom: 24px; left: calc(50% + 230px); } .app.driving .sos { bottom: 24px; } }
.nav-eta { text-align: center; line-height: 1.15; }
.nav-eta b { display: block; font-size: 26px; font-weight: 600; color: #188038; font-variant-numeric: tabular-nums; }
.nav-eta span { font-size: 14px; color: #5f6368; }
.nav-round { width: 48px; height: 48px; border-radius: 50%; border: 1px solid #dadce0; background: #fff; display: grid; place-items: center; cursor: pointer; }
.nav-round svg { width: 24px; height: 24px; fill: none; stroke: #3c4043; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-x { background: #fce8e6; border-color: #fce8e6; } .nav-x svg { stroke: #d93025; stroke-width: 2.6; }
#btn-drive-mute .mute { display: none; } #btn-drive-mute[aria-pressed=true] .mute { display: inline; } #btn-drive-mute[aria-pressed=true] .snd { display: none; }
.app.driving .drive-alert { top: calc(12px + var(--banner-h, 108px) + 56px); bottom: auto; left: 12px; right: auto; width: min(440px, calc(100% - 24px)); margin: 0; font-size: 1.15rem; border-radius: 12px; text-align: start; }
.app.driving .off-route { top: calc(12px + var(--banner-h, 108px) + 8px); left: 12px; transform: none; width: min(440px, calc(100% - 24px)); background: #202124; }
.nav-banner.arrived { background: #1a73e8; }

/* Phones */
@media (max-width: 760px) {
  .search-card { left: 12px; right: 64px; width: auto; }
  .gm-chips { top: 66px; left: 0; right: 0; padding-inline: 12px; }
  .app.gm .top-actions { top: 16px; }
  .app.gm .top-actions .lang-menu, .app.gm .top-actions .km-chip { display: none; }
  .app.gm .sos { bottom: 150px; }
  .locate-btn { bottom: 96px; }
  .layers { bottom: 92px; } .layers-btn { width: 56px; height: 56px; font-size: 0; } .layers-btn span { display: none; }
  .app.gm .fab { bottom: 20px; font-size: .9rem; padding: .7rem 1rem; }
  .app.gm .trip-bar { bottom: 16px; left: 12px; right: 12px; transform: none; justify-content: space-between; }
  .nav-text b { font-size: 26px; } .nav-text span { font-size: 17px; }
  .nav-icon .maneuver { width: 48px; height: 48px; } .nav-main { grid-template-columns: 52px 1fr; }
}

/* Night */
body.night .search-card, body.night .chip-btn, body.night .account-pop, body.night .drawer, body.night .layers-pop, body.night .locate-btn,
body.night .app.gm .lang-btn, body.night .app.gm .km-chip, body.night .app.gm .trip-bar, body.night .nav-bottom, body.night .nav-ui .hud-next,
body.night .nav-speed .hud-speed, body.night .nav-recenter, body.night .nav-round, body.night .route-card, body.night .dir-head, body.night .dir-field { background: #202124; color: #e8eaed; }
body.night .chip-btn, body.night .ap-item, body.night .drawer-list button, body.night .drawer-list a, body.night .route-card, body.night .steps-list .st-main { color: #e8eaed; }
body.night .chip-btn:hover, body.night .ap-item:hover, body.night .drawer-list button:hover, body.night .route-card:hover, body.night .suggest-list button:hover { background: #303134; }
body.night .layers-pop .ctrl { background: #303134; border-color: #3c4043; color: #e8eaed; }
body.night .layers-pop .ctrl[aria-pressed=true] { border-color: #8ab4f8; background: #174ea6; color: #fff; }
body.night .route-card.chosen { border-left-color: #8ab4f8; }
body.night .nav-round { border-color: #3c4043; } body.night .nav-round svg { stroke: #e8eaed; }
body.night .layers-btn { background: linear-gradient(135deg, #303134, #202124); color: #e8eaed; border-color: #3c4043; }
.route-card .rc-time.mid { color: #e37400; }
.tb-time.fast { color: #188038; } .tb-time.mid { color: #e37400; } .tb-time.slow { color: #d93025; }
.tb-dist { color: #5f6368; font-weight: 400; }
.overlay-pin.place-pin { width: 27px; height: 38px; border: 0; border-radius: 0; background: none; box-shadow: none; transform: translateY(-2px); }
.overlay-pin.place-pin svg { width: 27px; height: 38px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.dir-static { width: 100%; text-align: start; border: 0; background: none; font: inherit; font-size: 14px; color: #202124; padding: 10px 0; cursor: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-options { padding: 10px 0 0; } .dir-options select { margin-top: 4px; width: 100%; }
.dir-status { padding: 8px 0 0; }
.dir-more { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 6px; }
.steps-list .maneuver-wrap { display: contents; }
.nav-then .btn-pill { margin-inline-start: auto; color: #1a73e8; }
.nav-banner.arrived .nav-then { background: #185abc; }
body.night .dir-static { color: #e8eaed; }
[dir=rtl] .search-card { left: auto; right: 12px; }
[dir=rtl] .app.gm .top-actions { right: auto; left: 12px; }
[dir=rtl] .gm-chips { left: 260px; right: 416px; }
[dir=rtl] .drawer { left: auto; right: 0; animation-name: drawer-in-rtl; }
@keyframes drawer-in-rtl { from { transform: translateX(100%); } }
[dir=rtl] .route-card { border-left: 0; border-right: 4px solid transparent; } [dir=rtl] .route-card.chosen { border-right-color: #1a73e8; }
body.night .brand.dark { color: #e8eaed; }
body.night .search-card gmp-place-autocomplete { color-scheme: dark; --gmp-mat-color-surface: #202124; --gmp-mat-color-on-surface: #e8eaed; }
body.night .search-card .plain-search { color: #e8eaed; }
body.night .sc-btn { color: #9aa0a6; } body.night .sc-btn:hover { background: #303134; }
/* With a trip, the add buttons move up above the trip card instead of covering it. */
body.has-trip .app.gm .fab { display: inline-flex; bottom: 88px; }
body.has-trip .app.gm .fab-secondary { display: inline-flex; }
/* Navigation keeps the screen clear: no install offer, and SOS above the map's zoom buttons. */
body:has(.app.driving) .install-banner { display: none; }
@media (min-width: 761px) { .app.driving .sos { bottom: 130px; } }

.gm-chips { flex-wrap: nowrap; }
@media (max-width: 760px) {
  .app.gm .top-actions { width: auto; left: auto; right: 12px; margin: 0; flex-wrap: nowrap; }
  /* The bottom sheet owns the lower half: floating buttons step aside while it's open. */
  body.panel-open .app.gm .layers, body.panel-open .app.gm .locate-btn, body.panel-open .app.gm .sos,
  body.panel-open .app.gm .fab, body.panel-open .app.gm .trip-bar { display: none !important; }
}
.pc-act { text-decoration: none; }
.place-card .pc-actions { gap: 10px; justify-content: space-between; }
/* Whenever the navigation screen is up, the add buttons and trip card stay out of its way. */
.app:has(#drive-hud:not([hidden])) .fab, .app:has(#drive-hud:not([hidden])) .trip-bar,
.app:has(#drive-hud:not([hidden])) .layers, .app:has(#drive-hud:not([hidden])) .locate-btn { display: none !important; }
/* Theme button: a moon in light theme (tap for dark), a sun in dark theme (tap for light). */
.theme-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; color: #3c4043; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15); }
.theme-btn:hover { background: #f1f3f4; }
.theme-btn svg, .theme-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-item svg { width: 18px; height: 18px; color: #5f6368; }
.ic-sun { display: none; } body.night .ic-sun { display: block; } body.night .ic-moon { display: none; }
body.night .theme-btn { background: #202124; color: #fdd663; } body.night .theme-btn:hover { background: #303134; }
body.night .theme-item svg { color: #fdd663; }
@media (max-width: 760px) { .app.gm .top-actions .theme-btn { display: none; } } /* on phones it's in the account menu */
body.night .app.gm .trip-bar .btn-ghost-light { background: none; border: 0; box-shadow: none; color: #8ab4f8; }
body.night .app.gm .trip-bar #btn-trip-end { color: #9aa0a6; }
/* Side menu items, buttons and links alike: readable hover and keyboard focus in both themes. */
.drawer-list button:hover, .drawer-list a:hover, .drawer-list button:focus-visible, .drawer-list a:focus-visible { background: #f1f3f4; color: #202124; outline: none; }
body.night .drawer-list button:hover, body.night .drawer-list a:hover,
body.night .drawer-list button:focus-visible, body.night .drawer-list a:focus-visible { background: #303134; color: #e8eaed; }
body.night .drawer-list a, body.night .drawer-list a:visited { color: #e8eaed; }
.drawer-list a:visited { color: #202124; }
/* Top buttons in light theme: Google-style white pills with blue icons and a faint blue edge, so they stand out
   on the map; Directions is the solid blue one, because it is how a trip starts. */
.chip-btn { border: 1px solid #d2e3fc; color: #174ea6; }
.chip-btn svg { stroke: #1a73e8; }
.chip-btn:hover { background: #e8f0fe; border-color: #aecbfa; }
.chip-btn.active { background: #d2e3fc; border-color: #1a73e8; }
.chip-btn.chip-primary { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.chip-btn.chip-primary:hover { background: #1765cc; }
.chip-btn.chip-primary svg .solid { fill: #fff; stroke: none; }
.chip-btn.chip-primary svg .arrow { stroke: #1a73e8; stroke-width: 2.2; }
body.night .chip-btn { border-color: #3c4043; color: #e8eaed; }
body.night .chip-btn svg { stroke: #8ab4f8; }
body.night .chip-btn.chip-primary { background: #8ab4f8; border-color: #8ab4f8; color: #202124; }
body.night .chip-btn.chip-primary svg .solid { fill: #202124; } body.night .chip-btn.chip-primary svg .arrow { stroke: #8ab4f8; }

/* Top buttons: a clear green edge and a firmer shadow so they never blend into the map. */
.chip-btn { border: 2px solid #188038; box-shadow: 0 1px 3px rgba(60,64,67,.35), 0 3px 8px rgba(60,64,67,.2); height: 34px; }
.chip-btn:hover { border-color: #0d652d; background: #e6f4ea; }
.chip-btn.active { border-color: #0d652d; background: #ceead6; color: #0d652d; }
.chip-btn.chip-primary { border-color: #0d652d; }
body.night .chip-btn { border-color: #81c995; }
body.night .chip-btn:hover { background: #1e3a2a; }
body.night .chip-btn.chip-primary { border-color: #81c995; }

/* Logo links (admin console sidebar) keep their colours on hover, with a soft highlight instead. */
a.brand, a.brand:visited, a.brand:hover, a.brand:focus-visible { color: #fff; text-decoration: none; }
a.brand { border-radius: 10px; transition: background .15s; }
a.brand:hover, a.brand:focus-visible { background: rgba(255,255,255,.1); }
a.brand:hover b { color: var(--amber); }

/* Google's place search boxes follow the app's theme, not the computer's dark setting. */
gmp-place-autocomplete { color-scheme: light; }
body.night gmp-place-autocomplete { color-scheme: dark; }

/* Directions fields fit the panel: Google's box sits inside our rounded field without its own border, and the
   columns may shrink so nothing is pushed past the right edge. */
.dir-fields { grid-template-columns: 22px minmax(0, 1fr) 40px; }
.dir-field { min-width: 0; overflow: hidden; padding: 0 4px 0 8px; }
.dir-field:has(gmp-place-autocomplete) { padding: 0; }
.dir-field gmp-place-autocomplete { width: 100%; min-width: 0; border: 0; border-radius: 8px; --gmp-mat-color-outline-decorative: transparent; }
.dir-field:focus-within { border-color: #1a73e8; box-shadow: 0 0 0 1px #1a73e8; }
.dir-options select { max-width: 100%; text-overflow: ellipsis; }

/* A slightly wider side panel on computers, so directions and route cards have room. */
@media (min-width: 761px) {
  .app.gm .panel { width: 440px; }
  body.panel-open .app.gm .gm-chips { left: 452px; }
  body.panel-open .app.gm .layers { left: 452px; }
  body.panel-open .app.gm .trip-bar { left: calc(50% + 220px); }
  .search-card { width: 416px; }
  .gm-chips { left: 440px; }
}
.dir-options label { display: grid; gap: 4px; }
.dir-options select { appearance: none; -webkit-appearance: none; width: 100%; height: 40px; padding: 0 36px 0 12px; border: 1px solid #dadce0; border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%235f6368' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 10px center / 18px;
  color: #202124; font: inherit; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.dir-options select:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 1px #1a73e8; }
body.night .dir-options select { background-color: #202124; color: #e8eaed; border-color: #5f6368; }

/* Place search box and its suggestions (our own, filled from Google's places database). */
.ac { position: relative; width: 100%; }
.ac-input { width: 100%; height: 38px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: #202124; padding: 0 4px; }
.ac-input::placeholder { color: #80868b; }
.ac-input::-webkit-search-cancel-button { cursor: pointer; }
.search-card .ac-input { height: 46px; font-size: 15px; }
.ac-list { position: absolute; left: -9px; right: -5px; top: calc(100% + 6px); z-index: 50; margin: 0; padding: 6px 0; list-style: none; background: #fff;
  border-radius: 12px; box-shadow: 0 4px 16px rgba(60,64,67,.3); max-height: 340px; overflow-y: auto; }
.search-card .ac-list { left: -48px; right: -44px; top: calc(100% + 4px); }
.ac-list li { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 4px; padding: 8px 12px 8px 6px; cursor: pointer; }
.ac-list li.on, .ac-list li:hover { background: #f1f3f4; }
.ac-ic { width: 28px; height: 28px; border-radius: 50%; background: #f1f3f4; display: grid; place-items: center; justify-self: center; }
.ac-list li.on .ac-ic { background: #e8f0fe; }
.ac-ic svg { width: 16px; height: 16px; fill: none; stroke: #5f6368; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ac-text { min-width: 0; line-height: 1.3; }
.ac-text b { display: block; font-weight: 500; font-size: 14px; color: #202124; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-text small { display: block; font-size: 12px; color: #5f6368; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-field, .dir-field:has(.ac) { overflow: visible; }
.dir-field:has(.ac) { padding: 0 4px 0 8px; }
.dir-go-row { padding: 12px 0 2px; }
.dir-go-row .btn-start { width: 100%; justify-content: center; }
body.night .ac-input { color: #e8eaed; } body.night .ac-input::placeholder { color: #9aa0a6; }
body.night .ac-list { background: #202124; box-shadow: 0 4px 16px rgba(0,0,0,.6); }
body.night .ac-list li.on, body.night .ac-list li:hover { background: #303134; }
body.night .ac-ic { background: #303134; } body.night .ac-ic svg { stroke: #9aa0a6; }
body.night .ac-text b { color: #e8eaed; } body.night .ac-text small { color: #9aa0a6; }

/* Reporting while driving: a Report button on the right, and a sheet of big tiles (one tap each). */
.nav-report-btn { position: absolute; right: 10px; bottom: 180px; display: grid; justify-items: center; gap: 2px; width: 64px; padding: 10px 0 8px;
  border: 2px solid #188038; border-radius: 16px; background: #fff; color: #188038; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.nav-report-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-report-btn:hover { background: #e6f4ea; }
@media (min-width: 761px) { .nav-report-btn { bottom: 200px; } }
.nav-report { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; background: #fff; color: #202124; border-radius: 20px 20px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px rgba(0,0,0,.3); animation: nr-up .2s ease-out; max-height: 75%; overflow-y: auto; }
@keyframes nr-up { from { transform: translateY(30%); opacity: 0; } }
@media (min-width: 761px) { .nav-report { left: 12px; right: auto; bottom: 12px; width: 440px; border-radius: 16px; } }
.nr-head { display: flex; align-items: center; justify-content: space-between; }
.nr-head b { font-size: 18px; }
.nr-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f1f3f4; font-size: 22px; line-height: 1; cursor: pointer; color: #3c4043; }
.nr-sub { margin: 2px 0 12px; font-size: 13px; color: #5f6368; }
.nr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nr-tile { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 92px; padding: 10px 6px; border: 2px solid #e8eaed; border-radius: 14px;
  background: #fff; color: #202124; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; }
.nr-tile:hover, .nr-tile:focus-visible { border-color: #188038; background: #e6f4ea; outline: none; }
.nr-tile.busy { border-color: #1a73e8; background: #e8f0fe; }
.nr-tile:disabled { cursor: progress; }
.nr-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fef7e0; color: #b06000; }
.nr-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nr-tile.notice .nr-ic { background: #fce8e6; color: #c5221f; }
.nr-tile.t-flooding .nr-ic { background: #e8f0fe; color: #1967d2; }
.nr-tile.t-road_works .nr-ic, .nr-tile.t-broken_down_vehicle .nr-ic { background: #feefe3; color: #c26401; }
.nr-tile.t-police_block .nr-ic { background: #e3e9f7; color: #1d3f8f; }
.nr-tile.t-animals .nr-ic { background: #e6f4ea; color: #137333; }
body.night .nav-report-btn { background: #202124; color: #81c995; border-color: #81c995; }
body.night .nav-report { background: #202124; color: #e8eaed; }
body.night .nr-tile { background: #303134; border-color: #3c4043; color: #e8eaed; }
body.night .nr-x { background: #303134; color: #e8eaed; } body.night .nr-sub { color: #9aa0a6; }
@media (max-width: 760px) { .nav-report-btn { bottom: 226px; } }

/* My-location button while it waits for a precise reading; the dot looks hollow while the position is rough. */
.locate-btn.locating svg { animation: locate-pulse 1s ease-in-out infinite; }
@keyframes locate-pulse { 50% { opacity: .35; transform: scale(.85); } }
.me-dot { box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.me-dot.rough { background: #fff; border-color: #1a73e8; }

/* Compass beam from the blue dot (which way the phone faces), like Google Maps. */
.me-dot { position: relative; overflow: visible; }
.me-beam { display: none; position: absolute; left: 50%; bottom: 50%; width: 64px; height: 46px; transform-origin: 50% 100%;
  background: radial-gradient(ellipse at 50% 100%, rgba(66,133,244,.55) 0%, rgba(66,133,244,.25) 45%, rgba(66,133,244,0) 72%);
  clip-path: polygon(50% 100%, 8% 0, 92% 0); pointer-events: none; z-index: -1; }
.me-dot.has-heading .me-beam { display: block; }

/* The blue dot as two layers: the compass beam underneath, the dot on top. */
.me-dot { width: 22px; height: 22px; background: none; border: 0; box-shadow: none; border-radius: 0; }
.me-core { position: absolute; inset: 0; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.me-dot.rough .me-core { background: #fff; border-color: #1a73e8; }
.me-beam { width: 84px; height: 62px; z-index: auto;
  background: radial-gradient(ellipse 50% 100% at 50% 100%, rgba(26,115,232,.75) 0%, rgba(26,115,232,.4) 45%, rgba(26,115,232,0) 100%);
  clip-path: polygon(50% 100%, 12% 0, 88% 0); }

/* The next bump in navigation: a large card readable at a glance (distance big, type, severity colour). */
.nav-ui .hud-next { padding: 0; background: none; box-shadow: none; }
.bump-card { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 10px 14px 10px 10px;
  background: #fff; color: #202124; border-radius: 14px; border-left: 8px solid #f9ab00; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.bump-card.sev-1 { border-left-color: #f9ab00; } .bump-card.sev-2 { border-left-color: #e37400; } .bump-card.sev-3 { border-left-color: #d93025; }
.bc-icon { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; background: #fef7e0; color: #b06000; }
.bump-card.sev-2 .bc-icon { background: #feefe3; color: #c26401; } .bump-card.sev-3 .bc-icon { background: #fce8e6; color: #c5221f; }
.bc-icon svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bc-main { min-width: 0; line-height: 1.1; }
.bc-dist { display: block; font-size: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bc-dist small { font-size: 20px; font-weight: 700; }
.bc-what { display: block; margin-top: 2px; font-size: 16px; font-weight: 600; color: #3c4043; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-side { display: grid; justify-items: end; gap: 4px; text-align: end; }
.bc-secs { font-size: 18px; font-weight: 700; color: #202124; }
.bc-then { font-size: 13px; color: #5f6368; white-space: nowrap; }
/* The last 150 m: the card fills with the severity colour so it can't be missed. */
.bump-card.near.sev-3 { background: #d93025; color: #fff; border-left-color: #a50e0e; }
.bump-card.near.sev-2 { background: #e37400; color: #fff; border-left-color: #b06000; }
.bump-card.near.sev-1 { background: #f9ab00; color: #202124; border-left-color: #b06000; }
.bump-card.near.sev-3 .bc-what, .bump-card.near.sev-3 .bc-secs, .bump-card.near.sev-3 .bc-then,
.bump-card.near.sev-2 .bc-what, .bump-card.near.sev-2 .bc-secs, .bump-card.near.sev-2 .bc-then { color: #fff; }
.bump-card.near .bc-icon { background: rgba(255,255,255,.9); }
.bump-card.clear { grid-template-columns: auto 1fr; border-left-color: #188038; padding: 10px 14px; }
.bump-card.clear b { font-size: 16px; }
.bc-ok { width: 28px; height: 28px; border-radius: 50%; background: #e6f4ea; color: #188038; display: grid; place-items: center; font-weight: 800; }
body.night .bump-card { background: #202124; color: #e8eaed; } body.night .bc-what, body.night .bc-secs { color: #e8eaed; } body.night .bc-then { color: #9aa0a6; }
@media (max-width: 760px) { .bc-dist { font-size: 36px; } .bump-card { grid-template-columns: 50px 1fr auto; } .bc-icon { width: 50px; height: 50px; } }
.nr-note { margin: -6px 0 10px; font-size: 13px; color: #5f6368; }
.nr-note.ok { color: #188038; font-weight: 600; }
.nr-note.warn { color: #b06000; font-weight: 600; }
body.night .nr-note { color: #9aa0a6; } body.night .nr-note.ok { color: #81c995; } body.night .nr-note.warn { color: #fdd663; }
/* A driver report's pin (square, so it can't be mistaken for a mapped bump's round pin) */
.report-marker.overlay-pin { background: none; border: 0; box-shadow: none; width: auto; height: auto; }
.rp-pin { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px 8px 8px 0; transform: rotate(-45deg); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.4); background: #e37400; color: #fff; }
.report-marker.selected .rp-pin { outline: 3px solid #1a73e8; }
.rp-pin svg { width: 22px; height: 22px; transform: rotate(45deg); fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Mapping sessions: the Start mapping button, and the recording bar while mapping */
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #d93025; display: inline-block; flex: 0 0 auto; }
.mapping .rec-dot, .mapping-bar .rec-dot { animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: .3; } }
.app.gm .fab.fab-map { background: #fff; color: #202124; border: 2px solid #d93025; gap: 8px; }
.app.gm .fab.fab-map:hover { background: #fce8e6; }
.mapping-bar { position: absolute; left: 50%; transform: translateX(-50%); top: 72px; z-index: 9; display: flex; align-items: center; gap: 10px;
  background: #202124; color: #fff; padding: 8px 8px 8px 16px; border-radius: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.35); white-space: nowrap; }
.mapping-bar b { font-weight: 700; }
.mapping-bar #mapping-stats { color: #bdc1c6; font-variant-numeric: tabular-nums; }
.mapping-bar .btn-pill { padding: 6px 14px; }
.app.driving .mapping-bar { top: auto; bottom: 96px; }
@media (min-width: 761px) { .app.driving .mapping-bar { bottom: 100px; left: 232px; transform: none; } }
@media (max-width: 760px) { .mapping-bar { top: 112px; } }
/* With both buttons, Start mapping sits above Map a bump */
.app.gm .fab.fab-map { bottom: 84px; }
body.has-trip .app.gm .fab.fab-map { bottom: 148px; }
.app.gm .fab.fab-map { transform: translateX(-50%); }

/* Navigation on road nobody has mapped yet: the next-bump card says so instead of "No bumps ahead". */
.bump-card.unmapped { grid-template-columns: auto 1fr; border-left-color: #f9ab00; padding: 10px 14px; background: #fef7e0; }
.bump-card.unmapped .bc-ok { background: #f9ab00; color: #fff; }
.bump-card.unmapped b { display: block; font-size: 16px; }
.bump-card.unmapped span:not(.bc-ok) { display: block; font-size: 13px; color: #5f6368; }
body.night .bump-card.unmapped { background: #3c2f00; } body.night .bump-card.unmapped span:not(.bc-ok) { color: #e8eaed; }

/* How much of the route has been mapped for bumps */
.coverage-box { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: #fef7e0; }
.coverage-box.full { background: #e6f4ea; }
.coverage-box.none { background: #fce8e6; }
.coverage-box p { margin: 6px 0 0; font-size: 13px; color: #3c4043; }
.cov-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 1px; }
.cov-bar i { display: block; } .cov-bar i.m { background: #188038; } .cov-bar i.u { background: #f9ab00; }
body.night .coverage-box { background: #3c2f00; } body.night .coverage-box.full { background: #0d3a1f; } body.night .coverage-box.none { background: #3c1414; }
body.night .coverage-box p { color: #e8eaed; }

.reveal-note { margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px; background: #e8f0fe; color: #174ea6; font-size: 14px; }
body.night .reveal-note { background: #1a2b45; color: #d2e3fc; }

/* How the trip is paid (trip panel) */
.pay-box { margin: 10px 0; padding: 12px; border-radius: 10px; background: #e8f0fe; color: #174ea6; font-size: 14px; }
.pay-box p { margin: 0 0 8px; } .pay-box p:last-child { margin: 0; }
.pay-box.paid { background: #e6f4ea; color: #0d652d; }
.pay-box.low { background: #fef7e0; color: #7a4f01; }
.pay-box.empty { background: #fce8e6; color: #a50e0e; }
.pay-box .btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
body.night .pay-box { background: #1a2b45; color: #d2e3fc; } body.night .pay-box.empty { background: #3c1414; color: #f6aea9; }
body.night .pay-box.paid { background: #0d3a1f; color: #a8dab5; } body.night .pay-box.low { background: #3c2f00; color: #fde293; }

/* The wallet ran out during a trip: top up on the spot (works in drive mode too) */
.wallet-empty { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: grid; place-items: end center; padding: 12px; }
@media (min-width: 761px) { .wallet-empty { place-items: center; } }
.we-card { width: min(460px, 100%); background: #fff; color: #202124; border-radius: 20px; padding: 20px; box-shadow: 0 8px 30px rgba(0,0,0,.35); animation: nr-up .2s ease-out; }
.we-card h2 { margin: 0 0 8px; font-size: 20px; color: #a50e0e; }
.we-card p { margin: 0 0 12px; font-size: 14px; color: #3c4043; }
.we-amounts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.we-actions { display: grid; gap: 8px; }
.we-actions .btn-start { justify-content: center; }
.we-status { margin: 10px 0 0 !important; font-weight: 600; color: #1967d2 !important; }
body.night .we-card { background: #202124; color: #e8eaed; } body.night .we-card p { color: #bdc1c6; }
.bump-card.wallet { border-left-color: #d93025; background: #fce8e6; } .bump-card.wallet .bc-ok { background: #d93025; }
body.night .bump-card.wallet { background: #3c1414; }

/* Android floating window (picture-in-picture) during navigation: only the next turn and the next bump. */
html.pip .topbar, html.pip .nav-bottom, html.pip .nav-speed, html.pip .nav-recenter, html.pip .nav-report-btn, html.pip .sos,
html.pip .nav-then, html.pip .drive-alert, html.pip .mapping-bar, html.pip .wallet-empty, html.pip .toast-wrap, html.pip #toasts,
html.pip .gmnoprint, html.pip .gm-style-cc, html.pip .install-banner { display: none !important; }
html.pip .nav-banner { top: 4px; left: 4px; width: calc(100% - 8px); border-radius: 10px; }
html.pip .nav-main { grid-template-columns: 38px 1fr; gap: 6px; padding: 6px 8px; }
html.pip .nav-icon .maneuver { width: 36px; height: 36px; }
html.pip .nav-text b { font-size: 20px; } html.pip .nav-text span { font-size: 12px; -webkit-line-clamp: 1; }
html.pip .nav-ui .hud-next { top: auto; bottom: 4px; left: 4px; width: calc(100% - 8px); margin: 0; }
html.pip .bump-card { grid-template-columns: 34px 1fr; gap: 6px; padding: 6px 8px; border-left-width: 5px; }
html.pip .bc-icon { width: 34px; height: 34px; } html.pip .bc-icon svg { width: 22px; height: 22px; }
html.pip .bc-dist { font-size: 22px; } html.pip .bc-dist small { font-size: 12px; } html.pip .bc-what { font-size: 11px; }
html.pip .bc-side { display: none; }

/* Sign up with Google (Create account only) */
.google-signup { display: grid; gap: 10px; margin: 4px 0 6px; }
#gsi-btn { display: flex; justify-content: center; min-height: 44px; }
.google-done { background: #e6f4ea; color: #0d652d; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.google-done p { margin: 0 0 4px; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted, #5f6368); font-size: 13px; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--border, #dadce0); }
input[readonly] { background: #f1f3f4; color: #3c4043; }

/* Remember me, and the eye on password fields */
.remember-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.remember-row .check { margin: 0; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 46px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: transparent; color: #5f6368; display: grid; place-items: center; cursor: pointer; }
.pw-eye:hover { background: rgba(0,0,0,.06); }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pw-eye[aria-pressed=true] { color: #1a73e8; }
body.night .pw-eye { color: #9aa0a6; }

/* Quick mapping: type chips, then one tap on how harsh it is saves (Map a bump, drive Report, voice) */
.qm { display: grid; gap: 10px; margin-bottom: 12px; }
.qm-types { display: flex; flex-wrap: wrap; gap: 6px; }
.qm-type { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 8px; border: 1.5px solid var(--border, #dadce0); border-radius: 999px;
  background: var(--surface, #fff); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.qm-type .qm-ic { display: inline-flex; width: 20px; height: 20px; } .qm-type .qm-ic svg { width: 20px; height: 20px; }
.qm-type.on { border-color: #1a73e8; background: #e8f0fe; color: #174ea6; }
.qm-ask { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--muted, #5f6368); }
.qm-sev { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qm-s { min-height: 64px; border-radius: 14px; border: 0; color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.qm-s.s1 { background: var(--sev-1); color: #3c2a00; } .qm-s.s2 { background: var(--sev-2); } .qm-s.s3 { background: var(--sev-3); }
.qm-s:hover, .qm-s:focus-visible { filter: brightness(1.07); outline: 3px solid #1a73e8; outline-offset: 2px; }
.qm-s.busy { opacity: .7; cursor: progress; }
.qm-more { justify-self: start; background: none; border: 0; padding: 4px 0; color: #1a73e8; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.qm-more:hover { text-decoration: underline; }
.toast.has-undo { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.toast-undo { margin-left: auto; background: none; border: 0; color: #8ab4f8; font: inherit; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; white-space: nowrap; }
.toast.success .toast-undo { color: #fff; text-decoration: underline; }
.toast-undo small { font-weight: 600; opacity: .8; margin-left: 2px; }
.nav-report .qm-type { background: #fff; color: #202124; border-color: #dadce0; } .nav-report .qm-type.on { background: #e8f0fe; color: #174ea6; border-color: #1a73e8; }
body.night .nav-report .qm-type { background: #303134; color: #e8eaed; border-color: #5f6368; } body.night .nav-report .qm-type.on { background: #1f3a5f; color: #d2e3fc; border-color: #8ab4f8; }

/* Voice mapping: the microphone in drive mode and in the mapping bar; red and pulsing while listening */
.nav-mic svg, .mic-pill svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mic-pill { display: inline-flex; align-items: center; padding: 4px 8px; }
.mic-pill svg { width: 18px; height: 18px; }
[data-voice-map][aria-pressed="true"] { color: #d93025; }
[data-voice-map].listening { background: #d93025 !important; color: #fff !important; animation: mic-pulse 1.6s ease-out infinite; }
@keyframes mic-pulse { 0% { box-shadow: 0 0 0 0 rgba(217,48,37,.55); } 100% { box-shadow: 0 0 0 14px rgba(217,48,37,0); } }
/* The bottom bar takes as many round buttons as are shown (the microphone only when voice mapping is available). */
.nav-bottom { grid-template-columns: 52px minmax(0, 1fr); grid-auto-flow: column; grid-auto-columns: 48px; }
.nav-eta b { font-size: clamp(20px, 6vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Road notice, place first: the draft pin, then a grid of notices where one tap saves */
.notice-draft { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 3px dashed #f07800; color: #8a4400; box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: grab; }
.notice-draft svg { width: 20px; height: 20px; }
.nq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 12px; }
.nq-tile { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 92px; padding: 10px 4px; border: 2px solid var(--border, #e8eaed); border-radius: 14px;
  background: var(--surface, #fff); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; }
.nq-tile:hover, .nq-tile:focus-visible { border-color: #188038; outline: none; }
.nq-tile.busy { border-color: #1a73e8; }
.nq-tile:disabled { cursor: progress; opacity: .85; }
.nq-details { margin: 4px 0; font-size: 13px; }

/* Editing or moving a bump: its position, with the pin draggable on the map */
.move-box { border: 1px solid var(--border, #dadce0); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; }
.move-box .coords { font-size: 12px; }
.move-box p { margin: 0; }
