/* Pandu "Glass": frosted panels over the map, day and night (theme.js
   decides; html[data-theme]). html.solid drops the blur on phones that
   can't afford it. */
:root {
  --sign-green: #0B6B3A;   /* JKR expressway sign */
  --sign-blue: #1D4F9C;    /* JKR direction sign */
  --marking: #F5C400;      /* yellow road marking */
  --slow: #F0A202;
  --heavy: #E2522F;
  --stop: #9B1C1C;
  --radius-pill: 22px;
  --radius-sheet: 24px;
  --radius-ctl: 14px;
  --font: -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Noto Sans", Ubuntu, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --blur: blur(22px) saturate(1.8);
  --fp-w: 360px; /* wide search panel; FP_W in app.js */
}
:root, :root[data-theme="day"] {
  color-scheme: light;
  --glass-bg: rgba(250, 250, 252, .62);
  --glass-bg-wide: rgba(250, 250, 252, .64);
  --glass-solid: rgba(250, 250, 252, .98);
  --glass-border: rgba(255, 255, 255, .6);
  --glass-shadow: 0 6px 24px rgba(0, 0, 0, .13);
  --text: #111214;
  --text-2: #5C5C61;
  /* fills carry white text (>= 4.5:1); *-text variants are for words on glass */
  --accent: #0A64D8;
  --accent-text: #0A5BC4;
  --go: #1F7F38;
  --go-text: #186A2C;
  --danger: #D70015;
  --warn-text: #7A5C00;
  --fill: rgba(118, 118, 128, .14);
  --fill-2: rgba(118, 118, 128, .08);
  --seg-on: #FFFFFF;
  --hairline: rgba(60, 60, 67, .16);
  --page: #F2F2F7;
  --scrim: rgba(0, 0, 0, .25);
}
:root[data-theme="night"] {
  color-scheme: dark;
  --glass-bg: rgba(28, 28, 32, .58);
  --glass-bg-wide: rgba(28, 28, 32, .6);
  --glass-solid: rgba(28, 28, 32, .98);
  --glass-border: rgba(255, 255, 255, .08);
  --glass-shadow: 0 6px 24px rgba(0, 0, 0, .5);
  --text: #F2F2F7;
  --text-2: #B0B0B8;
  --accent: #0A64D8;
  --accent-text: #6AAEFF;
  --go: #1F7F38;
  --go-text: #30D158;
  --danger: #D70015;
  --warn-text: #F5C400;
  --fill: rgba(118, 118, 128, .28);
  --fill-2: rgba(118, 118, 128, .16);
  --seg-on: #636366;
  --hairline: rgba(255, 255, 255, .1);
  --page: #000000;
  --scrim: rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
#map { position: fixed; inset: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* the shared glass surface */
.glass, .sheet, .triptab, .fab, .dlg, .toast, .attrib, .mpill, .fpanel, .tripbar, .maplibregl-popup-content {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow), inset 0 0 0 .5px var(--glass-border), inset 0 1px 0 rgba(255, 255, 255, .18);
  color: var(--text);
}
html.solid .glass, html.solid .sheet, html.solid .triptab, html.solid .fab, html.solid .dlg, html.solid .toast,
html.solid .attrib, html.solid .mpill, html.solid .fpanel, html.solid .tripbar, html.solid .maplibregl-popup-content {
  background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none;
}
html.theme-fade *, html.theme-fade *::before { transition: background-color 1s ease, color 1s ease, border-color 1s ease, box-shadow 1s ease !important; }

/* ---------- top bar: wordmark or Back, and the menu ---------- */
.top { position: fixed; top: calc(10px + var(--safe-top)); left: 14px; right: 14px; z-index: 5; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.top > * { pointer-events: auto; }
.top .grow { flex: 1; pointer-events: none; }
.brand { font-size: 32px; font-weight: 750; letter-spacing: -.045em; font-family: ui-rounded, "SF Pro Rounded", var(--font); text-shadow: 0 0 10px var(--page), 0 0 4px var(--page); }

/* ---------- navigation sign: Malaysian (JKR) signboard; board colours are fixed, not theme tokens ---------- */
@font-face { font-family: "Overpass"; src: url("vendor/overpass/Overpass.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
.sign { position: fixed; top: calc(8px + var(--safe-top)); left: 10px; right: 10px; z-index: 6; max-width: 560px; --b: var(--sign-blue); --arrow-hole: var(--sign-blue); }
.sign.green { --b: var(--sign-green); --arrow-hole: var(--sign-green); }
.ms { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; background: var(--b); color: #fff; border: 2.5px solid #fff; outline: 3px solid var(--b); border-radius: 7px; padding: 8px 12px 8px 8px; margin: 3px; font-family: "Overpass", var(--font); box-shadow: 0 8px 22px rgba(0, 0, 0, .3); }
.ml { display: grid; justify-items: center; gap: 2px; min-width: 58px; }
.sign-arrow { width: 40px; height: 40px; color: #fff; }
.sign-arrow svg { width: 100%; height: 100%; display: block; }
.ml b { font-size: 19px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.mr { display: grid; gap: 5px; min-width: 0; justify-items: start; }
.sign-road { font-size: 21px; font-weight: 800; line-height: 1.1; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.shields { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hex { display: inline-block; background: #111; padding: 2px; clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 9px 100%, 0 50%); font-style: normal; }
.hex > i { display: block; background: #F7C600; color: #111; font-style: normal; font-weight: 800; font-size: 12.5px; line-height: 1; padding: 4px 11px 3px; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); white-space: nowrap; }
.exitno { font-size: 11px; font-weight: 800; letter-spacing: .04em; border: 1.5px solid #fff; border-radius: 3px; padding: 1px 5px 0; }
/* lanes stay inside the board, under a thin line across both columns: the lanes to use in white, the rest dimmed */
.lanes { grid-column: 1 / -1; display: flex; justify-content: center; padding: 6px 0 0; border-top: 1.5px solid rgba(255, 255, 255, .5); }
.lane { flex: 0 1 56px; height: 40px; display: grid; place-items: center; color: rgba(255, 255, 255, .6); }
.lane + .lane { border-left: 1.5px dashed rgba(255, 255, 255, .5); }
.lane svg { width: 28px; height: 28px; }
.lane.on { color: #fff; }
.lane.off svg { opacity: .55; }
.ms-next { margin: 4px 0 0 3px; display: inline-flex; gap: 6px; align-items: center; background: rgba(20, 22, 26, .88); color: #fff; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 6px; font-family: "Overpass", var(--font); }
.ms-next svg { width: 14px; height: 14px; }

/* ---------- floating round buttons ---------- */
.fabs { position: fixed; right: 14px; bottom: calc(var(--sheet-h, 160px) + 12px); z-index: 4; display: flex; flex-direction: column; gap: 12px; transition: bottom .25s ease; }
.fab { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; color: var(--text); padding: 0; }
.fab.report { color: var(--warn-text); }
.fab[hidden] { display: none; }
#locateBtn.on { color: #3478F6; }
#locateBtn .head-icon, #locateBtn.head svg:first-child { display: none; }
#locateBtn.head .head-icon { display: block; }
#compassBtn svg { transition: transform .1s linear; }
html:not(.wide) body.searching :is(.fabs, .top, .attrib, .mpill) { display: none; }

/* ---------- the dock ---------- */
.sheet { position: fixed; left: 10px; right: 10px; bottom: calc(6px + var(--safe-bottom) + var(--kb, 0px)); z-index: 5; border-radius: 34px;
  padding: 4px 18px 18px; max-height: calc(100dvh - var(--kb, 0px) - 120px); overflow: auto; overscroll-behavior: contain; }
/* five heights, like the iOS sheet; drag the top of the dock between them. app.js sets
   max-height for the content (fitSheet). */
.sheet { transition: max-height .25s ease; }
.sheet.small { overflow: hidden; }
.sheet.dragging { transition: none; overflow: hidden; }
.sheet[hidden] { display: none; }
.grab { display: block; width: 100%; min-height: 44px; margin: -6px 0 -12px; border: 0; padding: 0; background: none; touch-action: none; }
.grab::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--fill); margin: 0 auto; }
/* phones (html.wide is off) */
/* peek, about 84 px: the search field, or the trip row while driving */
html:not(.wide) .sheet.peek { overflow: hidden; padding-bottom: 8px; }
html:not(.wide) .sheet.peek .grab { margin-bottom: -18px; }
html:not(.wide) .sheet.peek:not(.driving):not(.dragging) #sheetBody { visibility: hidden; }
html:not(.wide) .sheet.peek:not(.dragging) .dmore { visibility: hidden; }
html:not(.wide) .sheet.driving .grab { margin-bottom: -24px; display: flex; align-items: flex-start; padding-top: 5px; } /* bar above the progress strip */
.searchrow { display: flex; align-items: center; gap: 10px; }
.field { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 52px; border-radius: 999px; background: var(--fill); color: var(--text-2); min-width: 0; }
.field input { flex: 1; border: 0; outline: 0; font-size: 18px; font-weight: 500; background: transparent; color: var(--text); min-width: 0; padding: 12px 0; }
.field input::placeholder { color: var(--text-2); }
.field input::-webkit-search-cancel-button { display: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.from { background: transparent; border: 2.5px solid var(--go-text); }
.iconbtn { border: 0; background: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); }
.results { list-style: none; margin: 8px -18px 0; padding: 0; max-height: 40dvh; overflow: auto; }
.results li, .list li { display: flex; gap: 12px; align-items: center; padding: 9px 18px; cursor: pointer; min-height: 52px; }
.results li[aria-selected="true"], .results li:hover, .list li:hover { background: var(--fill-2); }
.results .ic, .list .ic { width: 34px; height: 34px; border-radius: 50%; background: var(--fill); color: var(--text-2); display: grid; place-items: center; flex: none; font-size: 15px; }
.results .ic.road { color: var(--accent-text); }
.results .nm, .list .nm { font-size: 16px; font-weight: 600; line-height: 1.25; }
.results .sub, .list .sub { font-size: 13px; color: var(--text-2); }
:is(.sheet, .fpanel) h3 { margin: 2px 0 2px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
:is(.sheet, .fpanel) .muted { color: var(--text-2); font-size: 14px; line-height: 1.4; }
:is(.sheet, .fpanel) .muted.small { font-size: 12.5px; margin-top: 6px; }
:is(.sheet, .fpanel) .details { margin: 8px 0 4px; display: grid; gap: 3px; }
:is(.sheet, .fpanel) .details .row { margin-top: 4px; gap: 6px; }
:is(.sheet, .fpanel) .details a { text-decoration: none; display: inline-flex; align-items: center; }
.hours.open { color: var(--go-text); font-weight: 600; }
.hours.closed { color: var(--heavy); font-weight: 600; }
:is(.sheet, .fpanel) .label { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 14px 0 2px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.space { justify-content: space-between; }
.btn { border: 0; border-radius: var(--radius-ctl); padding: 13px 18px; font-size: 16px; font-weight: 600; background: var(--accent); color: #fff; min-height: 44px; }
.btn.go { background: var(--go); }
.btn.ghost { background: var(--fill); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.wide { width: 100%; margin-top: 14px; }
.btn:disabled { opacity: .5; }
/* the black (white at night) primary button: Start, Directions */
.pill { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; border: 0; border-radius: 999px; background: var(--text); color: var(--page); font-size: 18px; font-weight: 600; }
.pill.danger { background: var(--danger); color: #fff; }
.pill:disabled { opacity: .4; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.chip { border: 0; background: var(--fill); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--text); min-height: 44px; }
.chip[aria-pressed="true"], .chip.on { background: #0A64D8; color: #fff; }
.chip.on { display: inline-flex; align-items: center; }
.chip:disabled { opacity: .45; }
.textbtn { border: 0; background: none; color: var(--accent-text); font-size: 15px; font-weight: 600; padding: 10px 4px; min-height: 44px; }

/* explore: Home/Work with minutes from here, recents behind "Saved places" */
.saved { display: flex; align-items: center; margin-top: 8px; }
.saved .cell { flex: 1; display: flex; gap: 12px; align-items: center; border: 0; background: none; padding: 8px 10px; text-align: left; color: var(--text); min-width: 0; min-height: 56px; }
.saved .cell + .cell { border-left: .5px solid var(--hairline); }
.saved .tic { font-size: 20px; width: 28px; text-align: center; flex: none; }
.saved b { display: block; font-size: 17px; font-weight: 600; }
.saved small { display: block; font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list { list-style: none; margin: 0 -18px; padding: 0; }

/* route choice */
.rhead { display: flex; align-items: baseline; gap: 8px; }
.rhead h3 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frombtn { border: 0; background: none; color: var(--text); font-size: 14px; font-weight: 500; max-width: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 44px; padding: 0; }
.frombtn::after { content: " ⌄"; }
.eta-big { display: flex; align-items: baseline; gap: 12px; margin-top: 4px; }
.eta-big b { font-size: 40px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.eta-big span { font-size: 16px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmeta { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: flex; background: var(--fill); border-radius: 999px; padding: 3px; margin-top: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 10px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--text); min-height: 44px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button[aria-pressed="true"] { background: var(--seg-on); box-shadow: 0 2px 6px rgba(0,0,0,.12); font-weight: 600; }
.seg button:disabled { opacity: .4; }
.rlist { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.rrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: var(--fill); color: var(--text); border-radius: 14px; padding: 9px 14px; min-height: 56px; box-shadow: inset 0 0 0 2px transparent; }
.rrow[aria-pressed="true"] { background: var(--seg-on); box-shadow: inset 0 0 0 2px var(--accent), 0 2px 6px rgba(0,0,0,.08); }
.rtx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rtx b { font-size: 15px; font-weight: 600; }
.rtx small { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rtx .rmeta { font-size: 12px; }
.rtime { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rrow[aria-pressed="true"] .rtime { color: var(--accent-text); }
.ractions { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.ractions .fab { width: 54px; height: 54px; flex: none; background: var(--fill); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.delay { color: var(--heavy); font-weight: 600; }
.delay.ok { color: var(--go-text); }
.toll { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: rgba(245,196,0,.18); color: var(--warn-text); }
.toll.free { background: color-mix(in srgb, var(--go) 14%, transparent); color: var(--go-text); }

/* driving */
.progress { position: relative; height: 6px; border-radius: 3px; background: var(--fill); margin-top: 2px; }
.progress span { position: absolute; top: 0; bottom: 0; }
.progress .done { left: 0; background: #3478F6; border-radius: 3px; }
.progress span:not(.done) { border-radius: 3px; }
/* a speed camera or trap on the route: indigo dot over the strip */
.progress .cam { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #FFB300; border: 2px solid #fff; box-sizing: border-box; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.drive { display: flex; align-items: center; margin-top: 6px; min-height: 44px; }
.drive .arr b { display: block; white-space: nowrap; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.drive .arr small { font-size: 13px; color: var(--text-2); }
.drive .left { margin-left: auto; padding-left: 16px; border-left: .5px solid var(--hairline); text-align: right; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; } /* one row, so peek stays 84 px */
.drive .left small { display: block; font-size: 13px; font-weight: 400; color: var(--text-2); }
.dchev { width: 44px; height: 44px; flex: none; margin-left: 12px; border: 0; padding: 0; border-radius: 50%; background: var(--fill); color: var(--text); display: grid; place-items: center; }
.ddest { margin-top: 12px; padding-top: 12px; border-top: .5px solid var(--hairline); }
.ddest b { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; }
.ddest small { display: block; font-size: 14px; color: var(--text-2); line-height: 1.35; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the dock swiped away while driving: arrival clock and minutes left at the bottom centre */
.triptab { position: fixed; left: 50%; bottom: calc(6px + var(--safe-bottom)); transform: translateX(-50%); z-index: 5; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px 0 16px; border: 0; border-radius: 999px; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; touch-action: none; }
.triptab[hidden] { display: none; }
.triptab b { font-size: 16px; font-weight: 700; }
.triptab span { color: var(--text-2); font-weight: 600; }

/* ---------- map pill while driving: speed over the limit roundel, Re-centre, Report, Voice ---------- */
.mpill { position: fixed; right: calc(10px + var(--safe-right)); top: 52%; transform: translateY(-50%); z-index: 4; width: 48px; border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; }
.mpill[hidden], .mp-seg[hidden] { display: none; }
.mpill { scroll-margin-top: var(--safe-top); } /* read by placePill() as the top inset */
.mpill.over { z-index: 6; } /* pushed against the sign and still reaching the dock: draw over it */
.mp-seg { min-height: 48px; height: 48px; width: 48px; border: 0; padding: 0; background: none; color: var(--text); display: grid; place-items: center; }
.mp-seg + .mp-seg { border-top: 1px solid var(--hairline); }
.mp-speed { height: auto; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 6px; font-variant-numeric: tabular-nums; }
.mp-speed b { font-size: 19px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.mp-speed small { font-size: 9.5px; font-weight: 600; color: var(--text-2); }
.mp-speed .lim { order: -1; margin-bottom: 4px; width: 34px; height: 34px; box-sizing: border-box; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #111; border: 3.5px solid var(--danger); font-size: 13px; font-weight: 800; }
.mp-speed.over { background: var(--danger); color: #fff; }
/* speed camera or trap ahead: an amber strip under the sign (warning-sign colours), red when faster than the
   camera's limit; it pulses over the last 200 m */
.cam-banner { display: flex; align-items: center; gap: 8px; margin: 6px 3px 0; padding: 7px 10px; border-radius: 10px; background: #FFB300; color: #1F1A00; box-shadow: 0 6px 16px rgba(0,0,0,.25); font-variant-numeric: tabular-nums; }
.cam-banner svg { width: 22px; height: 22px; flex: none; }
.cam-banner b { font-size: 15px; font-weight: 700; }
.cam-banner span { font-size: 15px; font-weight: 600; opacity: .9; margin-left: auto; }
.cam-banner .lim { width: 28px; height: 28px; box-sizing: border-box; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #111; border: 3px solid var(--danger); font-size: 11.5px; font-weight: 800; font-style: normal; flex: none; }
.cam-banner.over { background: var(--danger); color: #fff; }
.cam-banner.near { animation: cam-pulse 1.1s ease-in-out infinite; }
@keyframes cam-pulse { 50% { transform: scale(1.03); box-shadow: 0 0 0 6px rgba(255, 179, 0, .35), 0 6px 16px rgba(0,0,0,.25); } }
.cam-banner.over.near { animation-name: cam-pulse-red; }
@keyframes cam-pulse-red { 50% { transform: scale(1.03); box-shadow: 0 0 0 6px rgba(213, 43, 30, .35), 0 6px 16px rgba(0,0,0,.25); } }
@media (prefers-reduced-motion: reduce) { .cam-banner.near { animation: none; } }
.mp-speed.over small { color: rgba(255, 255, 255, .85); }
.mp-rc { position: relative; color: var(--accent-text); }
.mp-rc .rcring { position: absolute; left: 9px; top: 9px; width: 30px; height: 30px; }
.mp-rc .rcarrow { width: 14px; height: 14px; }
.mp-report { color: var(--warn-text); }

/* ---------- dialogs ---------- */
.dlg { border: 0; border-radius: var(--radius-sheet); padding: 20px; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
.dlg::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dlg h2 { margin: 0 0 14px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.rgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rtile { border: 0; border-radius: 18px; padding: 14px 6px 12px; background: var(--fill-2); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.rtile:hover { background: var(--fill); }
.rtile .ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.menu-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: .5px solid var(--hairline); font-size: 16px; }
.menu-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--go); }
.menu-row .seg { flex: none; }
.privacy { margin-top: 16px; padding: 14px 16px; background: color-mix(in srgb, var(--go) 10%, transparent); border-radius: 16px; }
.privacy h3 { margin: 0 0 6px; font-size: 16px; color: var(--go-text); }
.privacy p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; }
.stats { margin-top: 12px; font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* ---------- toast & popups ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sheet-h, 120px) + 16px); z-index: 7; padding: 11px 16px; border-radius: 999px;
  font-size: 15px; font-weight: 500; max-width: calc(100vw - 100px); display: flex; gap: 12px; align-items: center; }
.toast button { background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 700; }
.maplibregl-popup-content { border-radius: 16px; padding: 12px 14px; font-family: var(--font); }
.maplibregl-popup-tip { display: none; }
.pop h4 { margin: 0 0 2px; font-size: 16px; }
.pop .muted { font-size: 13px; color: var(--text-2); }
.pop .row { margin-top: 10px; }
.pop .btn { padding: 8px 12px; font-size: 14px; }
.marker-report { width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.3); border: 2px solid #fff; cursor: pointer; }
.marker-report > span { transform: rotate(45deg); display: grid; place-items: center; }
.me { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent), 0 2px 6px rgba(0,0,0,.3); }
.me.nav { width: 0; height: 0; border-radius: 0; background: none; border: 0; box-shadow: none; }
.me.nav::after { content: ""; display: block; width: 34px; height: 34px; margin: -17px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 3 34 35 20 27 6 35Z' fill='%233478F6' stroke='white' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E"); filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.attrib { position: fixed; left: 8px; bottom: calc(var(--sheet-h, 120px) + 4px); z-index: 3; font-size: 11px; color: var(--text-2); padding: 2px 8px; border-radius: 8px; box-shadow: none; }

/* ---------- wide screens (html.wide: >= 600 px, or landscape under 500 px tall) ---------- */
/* search row top-right; it grows into the floating panel (12 px from the edges, 24 px corners) */
.fpanel { position: fixed; top: calc(12px + var(--safe-top)); right: calc(12px + var(--safe-right)); z-index: 5; display: flex; flex-direction: column;
  max-width: calc(100vw - 24px); padding: 5px; border-radius: 999px; }
.fpanel[hidden] { display: none; }
.fphead { display: flex; align-items: center; gap: 2px; }
.fphead .grow { flex: 1; display: none; }
.fpanel #searchbox { flex: none; }
.fpanel .field { width: clamp(110px, calc(100vw - 580px), 220px); min-height: 44px; padding: 0 14px; gap: 8px; }
/* narrow wide screens (small tablets): Home and Work only, so the field stays readable */
@media (max-width: 759px) {
  .fpanel .field { width: clamp(140px, calc(100vw - 400px), 220px); }
  .wcats .vsep, .wcats [data-cat]:not([data-cat="home"]):not([data-cat="work"]) { display: none; }
}
.fpanel .field input { font-size: 15px; padding: 8px 0; }
.fpanel .field .mag { width: 18px; height: 18px; }
.wcats { display: flex; align-items: center; gap: 2px; margin-left: 4px; }
.tb { width: 44px; height: 44px; flex: none; border: 0; padding: 0; border-radius: 50%; background: none; display: grid; place-items: center; color: var(--text); }
.tb:hover { background: var(--fill-2); }
.tb i { width: 32px; height: 32px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-style: normal; }
.tb i svg { width: 18px; height: 18px; }
.tb i b { font-size: 11.5px; font-weight: 800; }
.vsep { width: 1px; height: 24px; background: var(--hairline); margin: 0 4px; flex: none; }
.fpanel.open { bottom: calc(12px + var(--sheet-h, 0px)); width: min(var(--fp-w), calc(100vw - 24px)); border-radius: var(--radius-sheet); padding: 10px 14px 14px; gap: 8px; overflow: hidden;
  background: var(--glass-bg-wide); }
html.solid .fpanel.open { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
.fpanel.open .wcats { display: none; }
.fpanel.open #searchbox { flex: 1; }
.fpanel.open #searchbox .field { width: auto; }
.fpanel.open #searchbox[hidden] + .grow { display: block; }
.fpanel .fpchips { margin: 0; }
.fpanel #results { margin: 0 -14px; max-height: none; flex: 1 1 auto; min-height: 0; overflow: auto; }
.fpanel #sheetBody { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0 -14px; padding: 0 14px; }
.fpanel:not(.open) #sheetBody, .fpanel:not(.open) #results { display: none; }
.fpanel #results li { padding: 9px 14px; border-top: .5px solid var(--hairline); }
.fpanel #results li > div { flex: 1; min-width: 0; }
.fpanel #results .nm, .fpanel #results .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpanel #results li.hot { background: var(--fill-2); }
.fpanel #results em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.fpanel #results em small { display: block; font-weight: 400; font-size: 11.5px; }
.fpanel .empty { padding: 12px 0; }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; flex: none; }
/* numbered map pins for the results; hovering a row raises its pin */
.npin { cursor: pointer; }
.npin > span { display: grid; place-items: center; width: 26px; height: 26px; box-sizing: border-box; border-radius: 50%; background: var(--accent); color: #fff; border: 2px solid #fff;
  font: 800 12px/1 var(--font); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .12s ease; }
.npin.hot { z-index: 2; }
.npin.hot > span { transform: scale(1.3); background: #E5484D; }
/* trip bar while driving: progress strip on its top edge, arrival | time · distance | destination | End trip */
.tripbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; height: calc(62px + var(--safe-bottom)); display: flex; align-items: center; gap: 18px;
  padding: 0 calc(14px + var(--safe-right)) var(--safe-bottom) calc(22px + var(--safe-left)); border-radius: 0; }
.tripbar[hidden] { display: none; }
.tripbar .progress { position: absolute; left: 0; right: 0; top: 0; height: 4px; margin: 0; border-radius: 0; }
.tripbar .arr b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tripbar .arr small { font-size: 12px; color: var(--text-2); margin-left: 4px; }
.tripbar .trem { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tripbar .trem small { font-size: 12px; font-weight: 400; color: var(--text-2); margin-left: 4px; }
.tripbar .vsep { height: 30px; margin: 0; }
.tripbar .tdest { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; color: var(--text-2); }
.tripbar .tdest b { color: var(--text); font-size: 15px; font-weight: 600; }
.tripbar .btn { padding: 10px 20px; font-size: 15px; border-radius: 999px; white-space: nowrap; flex: none; }
.tripbar .dchev { margin: 0; }
html.wide .sign { right: auto; left: calc(12px + var(--safe-left)); top: calc(12px + var(--safe-top)); width: 340px; }
html.wide .top { left: calc(24px + var(--safe-left)); right: auto; }
html.wide .attrib { left: calc(8px + var(--safe-left)); }
html.wide .mpill { right: calc(12px + var(--safe-right)); }
html.wide body.fpopen .mpill { right: calc(var(--fp-w) + 34px + var(--safe-right)); }
html.wide body.fpopen .fabs { right: calc(var(--fp-w) + 36px + var(--safe-right)); }
@media (max-height: 499px) {
  html.wide .tripbar { height: calc(52px + var(--safe-bottom)); gap: 14px; }
  html.wide .tripbar .arr b { font-size: 22px; }
  html.wide .sign { width: 300px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
