/* Shared structure of every GPS theme page. Colours, type and shapes come from CSS variables set by gps/engine.js from gps/themes.js;
   the layout switches (data-banner, data-dock, data-speed, data-report, data-search) place the pieces differently in each theme. */
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("../fonts/orbitron-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin.woff2") format("woff2"); }
:root { --s: 1; --dock-h: 0px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; font: 500 calc(15px * var(--s)) / 1.25 var(--font), system-ui, sans-serif; color: var(--fg); -webkit-tap-highlight-color: transparent; user-select: none; }
#map { position: fixed; inset: 0; }
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-top-right, .maplibregl-ctrl-top-left { display: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; }
.panel { background: var(--bg); color: var(--fg); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: 0 6px 22px rgba(0, 0, 0, .28); }
[data-glass="1"] .panel { backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }
[data-glow="1"] .panel { box-shadow: 0 0 16px color-mix(in srgb, var(--edge) 55%, transparent), inset 0 0 12px color-mix(in srgb, var(--edge) 18%, transparent); border-width: 1.5px; }
[data-thin="1"] .panel { box-shadow: none; border-width: 1px; }
[data-big="1"] .panel { border-width: 3px; box-shadow: none; }
[data-big="1"] { font-weight: 700; }
[data-paper="1"] .panel { background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .03) 0 1px, transparent 1px 3px); }
[data-angular="1"] .panel { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); box-shadow: none; }
[data-soft="1"] .panel { box-shadow: 0 10px 30px rgba(10, 80, 90, .22); }
[data-warm="1"] .panel { box-shadow: 0 6px 22px rgba(40, 18, 0, .35); }
.car { --s: 1.3; }

/* ---------- the alert banner at the top: stop light / stop sign / railroad crossing, and the next cross street ---------- */
#top { position: fixed; z-index: 20; top: calc(10px + var(--safe-t)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.alert, .cross { pointer-events: auto; display: flex; align-items: center; gap: 12px; }
.alert { min-width: min(430px, 94vw); padding: 10px 16px 10px 12px; background: var(--accent); color: var(--accent-fg); border-radius: var(--radius); box-shadow: 0 6px 22px rgba(0, 0, 0, .3); }
.alert[hidden], #alertWrap[hidden] { display: none; }
.alert .ico { width: 3em; height: 3em; flex: none; display: grid; place-items: center; }
.alert .ico svg { width: 100%; height: 100%; }
.alert .txt { flex: 1; min-width: 0; line-height: 1.15; }
.alert .txt b { display: block; font-size: 1.25em; font-weight: 800; font-family: var(--display); }
.alert .txt small { opacity: .85; font-size: .85em; }
.alert .dist { font: 800 1.7em var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.alert.signal { background: #1b1b1b; color: #fff; } .alert.stop { background: #c8102e; color: #fff; } .alert.rail { background: #ffd400; color: #111; }
.cross { padding: 8px 16px; background: var(--bg); color: var(--fg); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0, 0, 0, .22); min-width: min(300px, 80vw); }
.cross .lbl { font-size: .7em; letter-spacing: .12em; color: var(--dim); font-weight: 800; }
.cross b { flex: 1; font-weight: 800; font-size: 1.12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--display); }
.cross .dist { color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
#top[data-banner="pill"] .alert, #top[data-banner="pill"] .cross { border-radius: 999px; }
#top[data-banner="bar"] { top: 0; padding: 0; gap: 0; align-items: stretch; }
#top[data-banner="bar"] .alert { border-radius: 0; padding-top: calc(10px + var(--safe-t)); min-width: 0; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); }
#top[data-banner="bar"] .cross { border-radius: 0; border-width: 0 0 1px; min-width: 0; padding-top: calc(8px + var(--safe-t)); }
#top[data-banner="bar"] .alert:not([hidden]) ~ .cross { padding-top: 8px; }
#top[data-banner="guide"] .alert, #top[data-banner="guide"] .cross { background: #006b3f; color: #fff; border: 3px solid #fff; border-radius: 9px; box-shadow: 0 0 0 2px #006b3f, 0 6px 18px rgba(0, 0, 0, .35); min-width: min(520px, 94vw); font-family: "Inter", Arial, sans-serif; }
#top[data-banner="guide"] .cross .lbl, #top[data-banner="guide"] .cross .dist { color: #cfeedd; }
#top[data-banner="guide"] .alert.stop { background: #c8102e; box-shadow: 0 0 0 2px #c8102e, 0 6px 18px rgba(0, 0, 0, .35); }
#top[data-banner="guide"] .alert.rail { background: #ffd400; color: #111; border-color: #111; box-shadow: 0 0 0 2px #ffd400; }
#top[data-banner="guide"] .alert.signal { background: #1b1b1b; box-shadow: 0 0 0 2px #1b1b1b; }
#top[data-banner="card"] { align-items: flex-start; right: auto; width: min(400px, 100vw); }
#top[data-banner="card"] .alert, #top[data-banner="card"] .cross { width: 100%; border-radius: var(--radius); }

/* ---------- speed limit sign (the US white rectangle) and the current speed ---------- */
#speed { position: fixed; z-index: 15; display: flex; gap: 10px; align-items: flex-end; }
#speed .limit { width: 5em; background: #fff; color: #000; border: .22em solid #000; border-radius: .5em; text-align: center; padding: .25em 0 .35em; line-height: 1; box-shadow: 0 0 0 .2em #fff, 0 4px 12px rgba(0, 0, 0, .45); font-family: "Inter", Arial, sans-serif; }
#speed .limit small { display: block; font-weight: 800; font-size: .72em; letter-spacing: .02em; }
#speed .limit b { display: block; font-size: 2.6em; font-weight: 800; margin-top: .05em; font-variant-numeric: tabular-nums; }
#speed .limit[hidden] { display: none; }
#speed .now { min-width: 4.4em; padding: .4em .7em; text-align: center; background: var(--bg); color: var(--fg); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
#speed .now b { display: block; font: 800 1.9em var(--display); font-variant-numeric: tabular-nums; line-height: 1; }
#speed .now small { color: var(--dim); font-weight: 700; font-size: .75em; letter-spacing: .08em; }
#speed.over .now { background: var(--danger); color: #fff; border-color: var(--danger); } #speed.over .now small { color: #fff; }
#speed[data-pos="right"] { right: 12px; bottom: calc(var(--dock-h) + 104px); flex-direction: row-reverse; }
#speed[data-pos="left"] { left: 12px; bottom: calc(var(--dock-h) + 14px); }
#speed[data-pos="top"] { left: 12px; top: calc(175px + var(--safe-t)); flex-direction: column; align-items: flex-start; }
[data-glow="1"] #speed .limit { box-shadow: 0 0 0 .2em #fff, 0 0 18px rgba(255, 255, 255, .55); }
[data-thin="1"] #speed .limit { border-width: .12em; box-shadow: none; }

/* ---------- bottom card: current road, next turn, time left, start ---------- */
#dock { position: fixed; z-index: 16; display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
#dock .road { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
#dock .road img { height: 2em; width: auto; flex: none; }
#dock .road b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 800; }
#dock .road small { display: block; color: var(--dim); font-size: .75em; }
#dock .man { display: flex; align-items: center; gap: 8px; flex: 1.3; min-width: 0; }
#dock .man svg { width: 2.2em; height: 2.2em; flex: none; color: var(--accent); }
#dock .man b { display: block; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dock .man small { color: var(--dim); }
#dock .eta { text-align: right; flex: none; }
#dock .eta b { font: 800 1.35em var(--display); display: block; line-height: 1.05; }
#dock .eta small { color: var(--dim); font-size: .78em; }
#dock .go { flex: none; background: var(--accent); color: var(--accent-fg); font-weight: 800; padding: .7em 1.3em; border-radius: calc(var(--radius) * .8); }
#dock .go.on { background: var(--danger); color: #fff; }
#dock .end { flex: none; width: 2.5em; height: 2.5em; padding: 0 0 .12em; border-radius: 50%; border: 1.5px solid var(--edge); background: transparent; color: var(--danger); font-size: 1.1em; font-weight: 800; line-height: 1; display: grid; place-items: center; cursor: pointer; }   /* end the route: the x at the left of the dock */
#dock .end:active { background: var(--danger); color: #fff; }
#dock[data-dock="card"] { left: 12px; right: 12px; bottom: calc(46px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
#dock[data-dock="float"] { left: 50%; transform: translateX(-50%); bottom: calc(46px + var(--safe-b)); width: min(680px, calc(100vw - 24px)); border-radius: 999px; padding-left: 20px; }
#dock[data-dock="bar"], #dock[data-dock="sheet"] { left: 0; right: 0; bottom: 0; border-radius: 0; border-width: 1px 0 0; padding-bottom: calc(14px + var(--safe-b)); box-shadow: 0 -4px 18px rgba(0, 0, 0, .25); }
#dock[data-dock="sheet"] { border-radius: calc(var(--radius) * 1.4) calc(var(--radius) * 1.4) 0 0; flex-wrap: wrap; row-gap: 6px; }
#dock[data-dock="bar"] .eta b { font-size: 1.8em; }
[data-big="1"] #dock { font-size: 1.15em; }

/* ---------- report buttons: police / construction / debris ---------- */
#reports { position: fixed; z-index: 17; display: flex; gap: 10px; }
#reports .rb { display: flex; align-items: center; gap: 8px; background: var(--bg); color: var(--fg); border: 1px solid var(--edge); border-radius: 999px; padding: .5em 1em .5em .6em; font-weight: 800; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
#reports .rb svg { width: 2.3em; height: 2.3em; flex: none; }
#reports .rb:active { transform: scale(.96); }
#reports .main { display: none; width: 3.8em; height: 3.8em; border-radius: 50%; background: var(--danger); color: #fff; align-items: center; justify-content: center; font-weight: 900; font-size: 1.3em; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
#reports[data-report="fab"] { right: 12px; bottom: calc(var(--dock-h) + 12px); flex-direction: column-reverse; align-items: flex-end; }
#reports[data-report="fab"] .main, #reports[data-report="radial"] .main { display: flex; }
#reports[data-report="fab"] .rb { display: none; } #reports[data-report="fab"].open .rb { display: flex; }
#reports[data-report="rail"] { right: 10px; top: 50%; transform: translateY(-30%); flex-direction: column; }
#reports[data-report="rail"] .rb { padding: .55em; border-radius: var(--radius); } #reports[data-report="rail"] .rb span { display: none; }
#reports[data-report="tabs"] { left: 0; right: 0; bottom: var(--dock-h); gap: 0; }
#reports[data-report="tabs"] .rb { flex: 1; justify-content: center; border-radius: 0; box-shadow: none; padding: .55em .3em; border-width: 1px 1px 0 0; }
#reports[data-report="dock"] { right: 12px; bottom: calc(var(--dock-h) + 12px); }
#reports[data-report="dock"] .rb { border-radius: var(--radius); }
#reports[data-report="radial"] { right: 18px; bottom: calc(var(--dock-h) + 16px); width: 4em; height: 4em; display: block; }
#reports[data-report="radial"] .main { position: absolute; right: 0; bottom: 0; z-index: 2; }
#reports[data-report="radial"] .rb { position: absolute; right: 0; bottom: 0; padding: .5em; border-radius: 50%; opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s; }
#reports[data-report="radial"] .rb span { display: none; }
#reports[data-report="radial"].open .rb { opacity: 1; pointer-events: auto; }
#reports[data-report="radial"].open .rb:nth-of-type(1) { transform: translate(-5.2em, -.4em); } #reports[data-report="radial"].open .rb:nth-of-type(2) { transform: translate(-3.9em, -3.9em); } #reports[data-report="radial"].open .rb:nth-of-type(3) { transform: translate(-.4em, -5.2em); }
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(var(--dock-h) + 16px); max-width: calc(100vw - 150px); text-align: center; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: .6em 1.1em; border-radius: 999px; font-weight: 800; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ---------- side buttons (night mode, search, recentre) ---------- */
#side { position: fixed; z-index: 18; right: 12px; top: calc(150px + var(--safe-t)); display: flex; flex-direction: column; gap: 10px; }
#side button { width: 3em; height: 3em; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0, 0, 0, .28); font-size: 1.05em; color: var(--fg); }
#side button svg { width: 1.45em; height: 1.45em; }
#side .on { background: var(--accent); color: var(--accent-fg); }

/* ---------- from / to search ---------- */
#search { position: fixed; z-index: 30; display: none; padding: 12px; }
#search.open { display: block; }
#search h4 { margin: 0 0 8px; font: 800 .8em var(--display); letter-spacing: .1em; color: var(--dim); text-transform: uppercase; }
#search .f { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
#search .dot { width: .9em; height: .9em; border-radius: 50%; border: .22em solid var(--accent); flex: none; } #search .dot.to { background: var(--danger); border-color: var(--danger); border-radius: 2px; }
#search input { font-size: 16px; flex: 1; min-width: 0; background: color-mix(in srgb, var(--fg) 7%, transparent); border: 1px solid var(--edge); border-radius: calc(var(--radius) * .6); padding: .7em .8em; outline: none; user-select: text; }
#search input:focus { border-color: var(--accent); }
#search .row { display: flex; gap: 8px; margin-top: 8px; }
#search .row button { flex: 1; padding: .7em; border-radius: calc(var(--radius) * .6); font-weight: 800; border: 1px solid var(--edge); }
#search .row .primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
#search ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 34vh; overflow: auto; }
#search li { padding: .55em .6em; border-radius: calc(var(--radius) * .5); cursor: pointer; }
#search li:hover, #search li.on { background: color-mix(in srgb, var(--accent) 18%, transparent); }
#search li small { display: block; color: var(--dim); }
#search[data-search="card"] { left: 12px; top: calc(150px + var(--safe-t)); width: min(390px, calc(100vw - 24px)); }
#search[data-search="drawer"] { left: 0; top: 0; bottom: 0; width: min(370px, 100vw); border-radius: 0 var(--radius) var(--radius) 0; padding-top: calc(16px + var(--safe-t)); }
#search[data-search="pill"] { left: 12px; right: 12px; top: calc(10px + var(--safe-t)); max-width: 720px; margin: 0 auto; }

/* ---------- brand and credit ---------- */
#brand { position: fixed; z-index: 14; left: 12px; bottom: calc(12px + var(--safe-b)); font: 800 1.05em var(--display); color: var(--fg); background: var(--bg); border: 1px solid var(--edge); border-radius: calc(var(--radius) * .6); padding: .35em .8em; display: flex; align-items: center; gap: .5em; letter-spacing: .02em; }
#brand i { width: .9em; height: .9em; display: block; background: var(--accent); border-radius: 50%; }
#brand[data-mark="bar"] i { width: .25em; height: 1.1em; border-radius: 2px; } #brand[data-mark="sign"] i { width: 1.1em; height: .8em; background: #006b3f; border: .12em solid #fff; border-radius: .2em; outline: .08em solid #006b3f; }
#brand[data-mark="stamp"] { border: 2px double var(--fg); letter-spacing: .08em; text-transform: uppercase; font-size: .9em; } #brand[data-mark="stamp"] i { border-radius: 0; transform: rotate(45deg); width: .7em; height: .7em; }
#brand[data-mark="grid"] { text-transform: uppercase; letter-spacing: .14em; color: var(--accent); text-shadow: 0 0 8px var(--accent); } #brand[data-mark="grid"] i { border-radius: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 2px, transparent 2px 4px); box-shadow: 0 0 8px var(--accent); }
#brand[data-mark="slash"] i { width: .35em; height: 1.2em; transform: skewX(-20deg); border-radius: 0; } #brand[data-mark="block"] { background: #ffd400; color: #000; border: 3px solid #000; text-transform: uppercase; } #brand[data-mark="block"] i { background: #000; border-radius: 0; }
#brand[data-mark="wave"] i { border-radius: 60% 40% 60% 40%; transform: rotate(-20deg); } #brand[data-mark="sun"] i { background: radial-gradient(circle, #ffd27a 0 40%, var(--accent) 45%); box-shadow: 0 0 10px var(--accent); }
#brand[data-mark="plan"] { border-style: dashed; text-transform: uppercase; letter-spacing: .1em; font-size: .85em; } #brand[data-mark="plan"] i { background: none; border: 1px solid var(--fg); border-radius: 0; }
#credit { position: fixed; z-index: 14; right: 8px; bottom: calc(4px + var(--safe-b)); font-size: 10px; color: var(--fg); background: color-mix(in srgb, var(--bg) 80%, transparent); padding: 1px 6px; border-radius: 6px; }
#credit a { color: inherit; }
body[data-dock-bottom="1"] #brand { bottom: calc(var(--dock-h) + 12px); } body[data-dock-bottom="1"] #credit { bottom: calc(var(--dock-h) + 4px); }
.maplibregl-canvas { outline: none; }

@media (max-width: 640px) {
  .alert { min-width: 0; width: 100%; } .cross { min-width: 0; width: 100%; }
  #dock { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "road eta" "man go"; gap: 8px 12px; padding: 10px 12px; }
  #dock .road { grid-area: road; } #dock .eta { grid-area: eta; } #dock .man { grid-area: man; } #dock .go { grid-area: go; align-self: stretch; display: grid; place-items: center; min-width: 5.2em; }
  #dock[data-dock="float"] { border-radius: var(--radius); }
  #speed .limit { font-size: 13px; } #speed .now { padding: .3em .55em; } #speed .now b { font-size: 1.6em; }
}
@media (min-width: 1000px) and (min-height: 600px) { #top[data-banner="pill"] { top: calc(14px + var(--safe-t)); } }

/* ---------- Highway Midnight pieces: controls on the left, speed sign top right under the signs ---------- */
body[data-side="left"] #side { right: auto; left: 12px; top: calc(var(--top-h, 150px) + 12px); transition: top .25s; }
body[data-side="left"] #reports[data-report="rail"] { right: auto; left: 10px; top: auto; bottom: calc(var(--dock-h) + 14px); transform: none; }
#speed[data-pos="topright"] { right: 12px; top: calc(var(--top-h, 100px) + 12px); flex-direction: column; align-items: flex-end; gap: 8px; transition: top .25s; }

/* ---------- exits, ramp merges, forks and lanes that end: the cross-street sign grows into the exit sign and the lane strip ---------- */
.cross { flex-direction: column; align-items: stretch; gap: 0; }
.cross .cs { display: flex; align-items: center; gap: 12px; }
.cross .ex[hidden] { display: none; }
.cross.has-ex .cs { display: none; }
.cross.has-ex { background: #006b3f; color: #fff; border: 3px solid #fff; border-radius: 9px; box-shadow: 0 0 0 2px #006b3f, 0 6px 18px rgba(0, 0, 0, .38); padding: 9px 14px 11px; min-width: min(440px, 94vw); animation: exgrow .22s ease-out; font-family: "Inter", Arial, sans-serif; }
@keyframes exgrow { from { transform: scaleY(.6); opacity: .4; transform-origin: top; } to { transform: none; opacity: 1; } }
.cross .ex b { flex: none; white-space: normal; overflow: visible; text-overflow: clip; font-size: inherit; }
.ex .xs { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "tab refs d" "big big arrow" "small small arrow"; gap: 3px 10px; align-items: center; }
.ex .xtab { grid-area: tab; display: inline-flex; align-items: baseline; gap: 5px; background: #fff; color: #00693e; padding: 1px 9px 2px; border-radius: 5px; font-weight: 800; justify-self: start; line-height: 1.25; }
.ex .xtab small { font-size: .7em; letter-spacing: .08em; } .ex .xtab b { font-size: 1.22em; }
.ex .xtab.warn { background: #ffd400; color: #111; } .ex .xtab.warn b { font-size: .95em; letter-spacing: .04em; }
.ex .xrefs { grid-area: refs; display: flex; gap: 8px; align-items: flex-end; min-height: 34px; }
.ex .xrefs .rf { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; }
.ex .xrefs .rf i { font-style: normal; font-size: .62em; font-weight: 800; letter-spacing: .06em; background: #111; color: #fff; padding: 0 5px; border-radius: 3px; line-height: 1.35; }
.ex .xrefs img { height: 30px; width: auto; display: block; }
.ex .xd { grid-area: d; font: 800 1.5em/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex .xbig { grid-area: big; font: 800 1.35em/1.12 var(--display); }
.ex .xsmall { grid-area: small; opacity: .92; font-size: .9em; }
.ex .xa { grid-area: arrow; width: 46px; height: 46px; justify-self: end; }
.ex .xl { display: flex; align-items: center; gap: 14px; margin-top: 9px; padding-top: 9px; border-top: 1.5px solid rgba(255, 255, 255, .45); }
.ex .lanes { display: flex; gap: 3px; flex: none; }
.ex .ln { width: 27px; height: 42px; display: block; }
.ex .ln .bg { fill: rgba(255, 255, 255, .08); stroke: rgba(255, 255, 255, .38); stroke-width: 1.2; stroke-dasharray: 3 3; }
.ex .ln .ar { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ex .ln.keep .bg { fill: rgba(255, 255, 255, .28); stroke: #fff; stroke-width: 1.8; stroke-dasharray: none; }
.ex .ln.keep .ar { stroke: #fff; }
.ex .ln.end .bg, .ex .ln.ramp .bg { stroke: #ffd400; fill: rgba(255, 212, 0, .14); } .ex .ln.end .ar, .ex .ln.ramp .ar { stroke: #ffd400; }
.ex .tip { min-width: 0; line-height: 1.15; } .ex .tip b { display: block; font: 800 1.2em/1.1 var(--display); } .ex .tip small { opacity: .92; display: block; margin-top: 2px; }

#dock .man > div, #dock .road > div { min-width: 0; }

#search h4 { display: flex; justify-content: space-between; align-items: center; }
#search .x { font-size: 1.9em; line-height: .7; padding: 0 .25em .1em; color: var(--dim); }
[data-glass="1"] #speed .now, [data-glass="1"] #side button { backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }

/* ---------- reported hazards on the top banner (police / construction / debris), and the alert-sound button ---------- */
.alert.police { background: #1c4fd6; color: #fff; } .alert.construction { background: #f08c00; color: #111; } .alert.debris { background: #fab005; color: #111; }
#top[data-banner="guide"] .alert.police { background: #1c4fd6; box-shadow: 0 0 0 2px #1c4fd6, 0 6px 18px rgba(0, 0, 0, .35); }
#top[data-banner="guide"] .alert.construction { background: #f08c00; color: #111; border-color: #111; box-shadow: 0 0 0 2px #f08c00, 0 6px 18px rgba(0, 0, 0, .35); }
#top[data-banner="guide"] .alert.debris { background: #fab005; color: #111; border-color: #111; box-shadow: 0 0 0 2px #fab005, 0 6px 18px rgba(0, 0, 0, .35); }
#side .off { opacity: .6; }

/* ---------- exit services (gas / food / hotel) inside the green sign, the "still there?" prompt, the stop chip ---------- */
.cross.has-sv { min-width: min(480px, 96vw); }
.ex .sv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1.5px solid rgba(255, 255, 255, .45); }
.ex .sv .col { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ex .sv h5 { margin: 0; display: flex; align-items: center; gap: 5px; font: 800 .78em/1 var(--display); letter-spacing: .09em; text-transform: uppercase; }
.ex .sv h5 svg { width: 1.45em; height: 1.45em; flex: none; }
.ex .sv .it { display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 1px; padding: 6px 7px 0; border-radius: 8px; background: rgba(255, 255, 255, .14); color: #fff; border: 1.5px solid rgba(255, 255, 255, .55); min-width: 0; overflow: hidden; font-family: inherit; }
.ex .sv .it:active { background: rgba(255, 255, 255, .32); }
.ex .sv .it b { font-size: .86em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 800; }
.ex .sv .it small { font-size: .7em; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex .sv .rc { display: block; margin: 5px -7px 0; padding: 4px 7px 5px; background: rgba(0, 0, 0, .3); font-size: .72em; line-height: 1.15; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex .sv .rc i { font-style: normal; font-weight: 600; opacity: .8; margin-left: .4em; }
.ex .sv .rc.none { font-weight: 600; opacity: .7; }
.ex .sv .rc.sample { background: rgba(255, 212, 0, .3); }
.ex .sv .none { font-size: .74em; opacity: .75; padding: 4px 0; }
#still { position: fixed; z-index: 19; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h) + 14px); width: min(300px, calc(100vw - 150px)); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
#still[hidden], #stopchip[hidden] { display: none; }
#still .q { display: flex; align-items: center; gap: 8px; font-weight: 800; font-family: var(--display); }
#still .q .qi svg { width: 2.1em; height: 2.1em; display: block; }
#still .btns { display: flex; gap: 8px; }
#still .btns button { flex: 1; min-height: 2.9em; border-radius: calc(var(--radius) * .8); font-weight: 800; border: 1.5px solid var(--edge); font-size: .95em; }
#still .yes { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
#stopchip { position: fixed; z-index: 19; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h) + 62px); display: flex; align-items: center; gap: 4px; max-width: calc(100vw - 150px); padding: .3em .35em .3em .9em; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-weight: 800; font-size: .92em; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
#stopchip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stopchip button { width: 1.9em; height: 1.9em; border-radius: 50%; background: rgba(0, 0, 0, .22); font-size: 1.1em; line-height: 1; flex: none; }
.alert.accident { background: #e03131; color: #fff; }
#top[data-banner="guide"] .alert.accident { background: #e03131; box-shadow: 0 0 0 2px #e03131, 0 6px 18px rgba(0, 0, 0, .35); }
/* the "!" button is the first <button> in #reports, so the four report buttons are nth-of-type 2 to 5; fanned out on a quarter circle of radius 7.8em */
#reports[data-report="radial"].open .rb:nth-of-type(2) { transform: translate(-7.8em, -.2em); } #reports[data-report="radial"].open .rb:nth-of-type(3) { transform: translate(-6.8em, -4.1em); }
#reports[data-report="radial"].open .rb:nth-of-type(4) { transform: translate(-4.1em, -6.8em); } #reports[data-report="radial"].open .rb:nth-of-type(5) { transform: translate(-.2em, -7.8em); }
.ex .sv .rc.food { display: flex; gap: 1px; align-items: center; font-size: .86em; letter-spacing: .02em; padding-top: 3px; padding-bottom: 4px; }
.ex .sv .rc.food .d { opacity: .3; font-weight: 700; } .ex .sv .rc.food .d.on { opacity: 1; font-weight: 900; color: #b8f5cf; }
#side { transition: opacity .2s; } body.crowded #side { opacity: 0; pointer-events: none; }
/* wide screens (the car layout, tablets, computers): the signs are centred, so the speed sign and the left button column can start at the very top instead of under the signs */
@media (min-width: 900px) and (min-height: 480px) { #speed[data-pos="topright"], body[data-side="left"] #side { top: calc(12px + var(--safe-t)); } }
@media (min-width: 900px) and (min-height: 480px) { body[data-side="left"] #side { flex-direction: row; } }   /* the four buttons in a row along the top-left, clear of the report buttons below */

/* ---------- trip planner: stops between start and end, the "Keep me moving" switch, the sample-trip link ---------- */
#search { max-height: calc(100vh - 24px); overflow-y: auto; }
#search #stops { display: contents; }
#search .f .dot.stop { width: .7em; height: .7em; margin: 0 .1em; border: 0; border-radius: 50%; background: var(--accent); }
#search .f .rm { flex: none; width: 2em; height: 2em; border-radius: 50%; color: var(--dim); font-size: 1.15em; line-height: 1; }
#search .link { display: block; width: 100%; text-align: left; padding: .45em .2em; margin-top: 2px; color: var(--accent); font-weight: 800; font-size: .92em; }
#search .link[hidden] { display: none; }
#search .link.dim { color: var(--dim); font-weight: 700; font-size: .78em; }
#search .sw { display: flex; align-items: center; gap: .7em; margin: 8px 0 2px; padding: .55em .6em; border: 1px solid var(--edge); border-radius: calc(var(--radius) * .6); cursor: pointer; }
#search .sw input { width: 2.6em; height: 1.45em; appearance: none; -webkit-appearance: none; background: color-mix(in srgb, var(--fg) 22%, transparent); border-radius: 999px; position: relative; flex: none; transition: background .15s; outline: none; margin: 0; padding: 0; border: 0; }
#search .sw input::after { content: ""; position: absolute; top: .16em; left: .18em; width: 1.13em; height: 1.13em; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
#search .sw input:checked { background: var(--accent); } #search .sw input:checked::after { transform: translateX(1.15em); }
#search .sw b { display: block; font-weight: 800; } #search .sw small { display: block; color: var(--dim); font-size: .8em; }
/* five or six report buttons with words do not fit across a phone: icons only on narrow screens for the bar-style layouts */
@media (max-width: 640px) { #reports[data-report="tabs"] .rb span, #reports[data-report="dock"] .rb span { display: none; } }

/* ---------- the map credit behind a small "i": hold it for 2 seconds and the credit opens ---------- */
#credit { right: 8px; bottom: calc(6px + var(--safe-b)); display: flex; align-items: center; gap: 6px; padding: 0; background: none; border-radius: 0; font-size: 11px; }
body[data-dock-bottom="1"] #credit { bottom: calc(var(--dock-h) + 6px); }
#credit .txt { display: none; padding: 4px 9px; border-radius: 9px; background: color-mix(in srgb, var(--bg) 90%, transparent); color: var(--fg); border: 1px solid var(--edge); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
#credit.open .txt { display: block; }
#credit .i { position: relative; flex: none; width: 26px; height: 26px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--dim); border: 1px solid var(--edge); font: italic 700 15px Georgia, "Times New Roman", serif; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; }
#credit .i svg.ring { position: absolute; inset: -4px; width: 32px; height: 32px; transform: rotate(-90deg); pointer-events: none; }
#credit .i svg.ring circle { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-dasharray: 88; stroke-dashoffset: 88; stroke-linecap: round; }
#credit .i.holding svg.ring circle { animation: credit-hold 2s linear forwards; }
@keyframes credit-hold { to { stroke-dashoffset: 0; } }

/* ---------- weather alerts (a Plus feature): the strip under the green sign, the details sheet, the PLUS badge ---------- */
.wxbar { pointer-events: auto; display: flex; align-items: center; gap: 8px; width: min(520px, 94vw); padding: 6px 12px; border-radius: 9px; border: 2px solid #fff; font: 800 .95em "Inter", Arial, sans-serif; text-align: left; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.wxbar[hidden] { display: none; }
.wxbar .wi { flex: none; width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .28); font-weight: 900; }
.wxbar b { flex: none; } .wxbar small { flex: 1; min-width: 0; font-weight: 700; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wxbar.s4, .wxbar.s3 { background: #c8102e; color: #fff; } .wxbar.s2 { background: #f08c00; color: #111; } .wxbar.s1, .wxbar.s0 { background: #ffd400; color: #111; border-color: #111; }
#top[data-banner="bar"] .wxbar { border-radius: 0; width: auto; border-width: 0 0 1px; }
@media (max-width: 640px) { .wxbar { width: 100%; } }
#wxsheet { position: fixed; z-index: 35; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 80px); display: flex; flex-direction: column; padding: 12px; }
#wxsheet[hidden] { display: none; }
#wxsheet h4 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; font: 800 .8em var(--display); letter-spacing: .1em; color: var(--dim); text-transform: uppercase; }
#wxsheet .x { font-size: 1.9em; line-height: .7; padding: 0 .25em .1em; color: var(--dim); }
#wxsheet .body { overflow: auto; } #wxsheet .al { padding: 8px 0 10px; border-top: 1px solid var(--edge); } #wxsheet .al:first-child { border-top: 0; }
#wxsheet .al h5 { margin: 0; font-size: 1.1em; } #wxsheet .al.s4 h5, #wxsheet .al.s3 h5 { color: var(--danger); } #wxsheet .al small { display: block; color: var(--dim); margin: 2px 0 6px; } #wxsheet .al p { margin: 0; white-space: pre-wrap; font-size: .9em; user-select: text; }
.plus { font-style: normal; font-size: .65em; font-weight: 900; letter-spacing: .08em; padding: .1em .45em; border-radius: 999px; background: var(--accent); color: var(--accent-fg); vertical-align: .15em; margin-left: .3em; }
#search .sw.locked { opacity: .7; } #search .sw.locked input { pointer-events: none; }

/* ---------- the "before you go" notice (closures and highway signs on the route, shown once when a route starts) ---------- */
#wxsheet .meta { display: block; color: var(--dim); margin: 0 0 3px; } #wxsheet .note { display: block; color: var(--dim); font-size: .75em; margin-top: 10px; line-height: 1.3; }
#wxsheet .sec { padding: 4px 0 6px 12px; margin: 10px 0; border-left: 4px solid var(--dot, var(--accent)); } #wxsheet .sec h5 { margin: 0 0 2px; font-size: 1.1em; } #wxsheet .sec p { margin: 4px 0 0; font-size: .9em; }
#wxsheet .dmsbox { background: #101010; border: 3px solid #333; border-radius: 8px; padding: 10px 12px; margin: 8px 0; display: grid; gap: 10px; }
#wxsheet .dmspage { color: #ffb000; font: 700 1.15em/1.25 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; text-transform: uppercase; text-shadow: 0 0 6px rgba(255, 176, 0, .55); }
#wxsheet { border-top: 4px solid var(--sheet-accent, var(--accent)); }

/* ---------- no route planned: like Google and Apple Maps, just the map and its buttons. No empty route card, no "next cross street" placeholder, and no speed box until there is a route or a live GPS fix ---------- */
body.idle #dock, body.idle #reports { display: none; }   /* the report buttons (police, accident, construction, debris) only exist while there is a route */
body.idle:not(.moving) #speed, body.idle:not(.live) #cross, body.idle #cross.empty { display: none; }   /* the green cross-street sign stays up when the phone's position is live (driving unrouted) and names the next cross street; with nothing to say it is not shown */

/* ---------- Home and Work chips in the directions panel ---------- */
#search #saved { display: flex; gap: 8px; margin: 8px 0 2px; }
#search .chip { flex: 1; min-width: 0; display: flex; align-items: stretch; border: 1px dashed var(--edge); border-radius: calc(var(--radius) * .6); overflow: hidden; } #search .chip.set { border-style: solid; }
#search .chip .use { flex: 1; min-width: 0; text-align: left; padding: .45em .7em; } #search .chip .use b { display: block; font-weight: 800; } #search .chip .use b svg { width: 1.05em; height: 1.05em; vertical-align: -.15em; margin-right: .2em; }
#search .chip .use small { display: block; color: var(--dim); font-size: .78em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#search .chip .edit { flex: none; width: 2.3em; color: var(--dim); border-left: 1px solid var(--edge); } #search .chip .edit[hidden] { display: none; }
#search #setRow[hidden] { display: none; }

#speed .compass { min-width: 2.6em; padding: .3em .6em; text-align: center; background: var(--bg); color: var(--fg); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); font: 800 1.35em var(--display); letter-spacing: .04em; line-height: 1.1; }   /* the compass point we are driving: N, NE, E ... */
#speed .compass b { font: inherit; }

/* Place Detail Card */
.place-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.place-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: white;
}

.place-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  color: #999;
}

.place-body {
  padding: 16px;
}

.place-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.contact-item {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: #0066cc;
  flex-shrink: 0;
}

.contact-item a {
  color: #0066cc;
  text-decoration: none;
}

.place-hours {
  background: #f5f5f5;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.place-hours strong {
  display: block;
  margin-bottom: 4px;
}

.hours-text {
  color: #666;
  white-space: pre-wrap;
}

.place-reviews {
  background: #fff9f0;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.rating-badge {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fire-icon {
  font-size: 18px;
}

.review-count {
  font-size: 14px;
  color: #666;
}

.review-source {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.contributions-section {
  border-top: 1px solid #eee;
  padding-top: 16px;
}

.contributions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.contributions-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.points-info {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.action-btn {
  background: #f0f0f0;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.action-btn:hover {
  background: #e8e8e8;
}

.icon-label {
  font-size: 20px;
}

.contribution-form {
  background: #f9f9f9;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
}

.contribution-form h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group textarea {
  resize: vertical;
}

.star-rating {
  display: flex;
  gap: 8px;
}

.star-rating input {
  display: none;
}

.star {
  font-size: 24px;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.2s;
}

.star-rating input:checked ~ .star,
.star:hover {
  opacity: 1;
}

.submit-btn {
  width: 100%;
  padding: 10px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.submit-btn:hover {
  background: #0052a3;
}

@media (max-width: 600px) {
  .place-card {
    max-height: 90vh;
  }
}

/* Leaderboard */
.leaderboard-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: white;
}

.leaderboard-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.leaderboard-list {
  padding: 8px;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: #f9f9f9;
  transition: background 0.2s;
}

.leaderboard-entry:hover {
  background: #f0f0f0;
}

.leaderboard-entry.rank-1,
.leaderboard-entry.rank-2,
.leaderboard-entry.rank-3 {
  background: #fff8e1;
  border-left: 4px solid #ffd700;
}

.rank {
  font-size: 18px;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

.rank-1 .rank { color: #ffd700; }
.rank-2 .rank { color: #c0c0c0; }
.rank-3 .rank { color: #cd7f32; }

.user-info {
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.badge {
  font-size: 12px;
  color: #0066cc;
  font-weight: 600;
  margin-top: 2px;
}

.points {
  font-weight: 700;
  font-size: 16px;
  color: #0066cc;
  min-width: 80px;
  text-align: right;
}

.leaderboard-footer {
  padding: 12px;
  text-align: center;
  color: #999;
  border-top: 1px solid #eee;
  position: sticky;
  bottom: 0;
  background: white;
}

/* tap the speed limit sign to set the limit here */
#speed .limit { cursor: pointer; }
#speed .limit.unk { opacity: .6; border-style: dashed; }
#limEdit { position: fixed; inset: 0; z-index: 3000; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
#limEdit[hidden] { display: none; }
#limEdit .le-box { width: min(420px, 100%); background: #fff; color: #111; border-radius: 16px 16px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
#limEdit .le-t { font-weight: 800; font-size: 17px; } #limEdit .le-road { color: #555; font-size: 14px; margin: 2px 0 10px; }
#limEdit .le-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
#limEdit button { font: 700 20px system-ui, sans-serif; padding: 14px 0; border-radius: 10px; border: 2px solid #111; background: #fff; color: #111; }
#limEdit .le-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; } #limEdit .le-row button { font-size: 16px; padding: 12px 0; }

/* search places without routing: the top box of the Directions panel, and the chip shown under the pin */
#search .dot.lk { border-color: var(--dim); }
#lookChip { position: fixed; left: 50%; transform: translateX(-50%); top: calc(64px + env(safe-area-inset-top)); z-index: 31; display: flex; align-items: center; gap: 10px; padding: 10px 12px; max-width: min(92vw, 460px); }
#lookChip .lt { min-width: 0; flex: 1; } #lookChip b { display: block; font-size: 1.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #lookChip small { display: block; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lookChip .lgo { font: 800 .9em var(--display); padding: 9px 14px; border-radius: 10px; border: 0; background: var(--accent); color: #04121c; }
#lookChip .lx { background: transparent; border: 0; color: var(--dim); font-size: 22px; padding: 0 4px; }

/* The speed limit sign stays up on the map page whenever the phone's position is live, even standing still or stopped at the side of the road: a limit is fixed by tapping the sign,
   and a sign that vanished when you stopped made that impossible. Only the sign shows then (no speed, no compass). */
body.idle.live:not(.moving) #speed { display: flex; }
body.idle.live:not(.moving) #speed .now, body.idle.live:not(.moving) #speed .compass { display: none; }

/* the owner's "who can fix speed limits" panel (same bottom sheet as the limit editor) */
#limAdmin { position: fixed; inset: 0; z-index: 3000; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
#limAdmin[hidden] { display: none; }
#limAdmin .le-box { width: min(420px, 100%); background: #fff; color: #111; border-radius: 16px 16px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); max-height: 86vh; overflow: auto; }
#limAdmin .le-t { font-weight: 800; font-size: 17px; margin-bottom: 8px; }
#limAdmin .la-new { background: #e8f7ee; border: 2px solid #1b9e4b; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; } #limAdmin .la-new strong { display: block; font: 800 38px/1.1 ui-monospace, Menlo, monospace; letter-spacing: .12em; margin-top: 4px; }
#limAdmin .la-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #ddd; } #limAdmin .la-row i { display: block; color: #666; font-style: normal; font-size: 13px; }
#limAdmin .la-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 10px 0; } #limAdmin .la-add input, #limAdmin .la-add select { font: 16px system-ui, sans-serif; padding: 10px; border: 2px solid #111; border-radius: 10px; min-width: 0; } #limAdmin .la-add button { grid-column: 1 / -1; background: #111; color: #fff; }
#limAdmin button { font: 700 16px system-ui, sans-serif; padding: 11px 14px; border-radius: 10px; border: 2px solid #111; background: #fff; color: #111; } #limAdmin .le-row { display: grid; margin-top: 8px; }
#limEdit .le-adm { margin-top: 10px; width: 100%; font-size: 14px; padding: 10px 0; border-radius: 10px; border: 2px dashed #888; background: #fff; color: #333; }

/* SCHOOL ZONES: the yellow school limit sign sits under the white one while the zone's time window is on */
#speed .lims { display: flex; flex-direction: column; align-items: center; gap: .55em; }
#speed .school { width: 5em; background: #ffd400; color: #000; border: .22em solid #000; border-radius: .5em; text-align: center; padding: .25em 0 .3em; line-height: 1; box-shadow: 0 0 0 .2em #ffd400, 0 4px 12px rgba(0, 0, 0, .45); font-family: "Inter", Arial, sans-serif; cursor: pointer; }
#speed .school small { display: block; font-weight: 800; font-size: .6em; letter-spacing: .02em; }
#speed .school b { display: block; font-size: 2.1em; font-weight: 800; margin-top: .05em; font-variant-numeric: tabular-nums; }
#speed .school[hidden] { display: none; }
#szEdit { position: fixed; inset: 0; z-index: 3000; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
#szEdit[hidden] { display: none; }
#szEdit .le-box { width: min(440px, 100%); background: #fff; color: #111; border-radius: 16px 16px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; font-family: system-ui, sans-serif; }
#szEdit .le-t { font-weight: 800; font-size: 17px; } #szEdit .le-road { color: #555; font-size: 14px; margin: 2px 0 8px; } #szEdit .sz-now { background: #fff6bf; border: 2px solid #ffd400; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; }
#szEdit .sz-f { display: block; font-size: 13px; font-weight: 700; color: #333; margin-top: 9px; } #szEdit select, #szEdit input[type=time] { font: 16px system-ui, sans-serif; padding: 9px; border: 2px solid #111; border-radius: 10px; display: block; margin-top: 4px; min-width: 0; }
#szEdit .sz-days { display: flex; gap: 5px; margin-top: 4px; } #szEdit .sz-d { flex: 1; padding: 10px 0; font: 700 13px system-ui, sans-serif; border-radius: 9px; border: 2px solid #111; background: #fff; color: #111; } #szEdit .sz-d.on { background: #111; color: #ffd400; }
#szEdit .sz-times { margin-top: 4px; } #szEdit .sz-t { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 600; } #szEdit .sz-t input { display: inline-block; margin: 0; }
#szEdit .sz-chk { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 8px; } #szEdit .le-row { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-top: 12px; }
#szEdit button { font: 700 16px system-ui, sans-serif; padding: 12px 14px; border-radius: 10px; border: 2px solid #111; background: #fff; color: #111; } #szEdit .sz-go { background: #ffd400; } #szEdit .sz-rm { width: 100%; margin-top: 8px; border-color: #c0392b; color: #c0392b; font-size: 14px; }
#limEdit .le-sch { margin-top: 10px; width: 100%; font: 700 15px system-ui, sans-serif; padding: 11px 0; border-radius: 10px; border: 2px solid #111; background: #ffd400; color: #111; }

/* Route button on a business card */
.place-card .route-btn { display: block; width: 100%; margin: 10px 0 6px; padding: 12px 16px; border: 0; border-radius: 10px; background: #1a73e8; color: #fff; font: 600 16px/1.2 system-ui, sans-serif; cursor: pointer; }
.place-card .route-btn:active { background: #1558b0; }
#limEdit .le-undo { margin-top: 10px; width: 100%; font: 700 15px system-ui, sans-serif; padding: 11px 0; border-radius: 10px; border: 2px solid #b00020; background: #fff; color: #b00020; }
#verBox { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 74px); z-index: 2900; width: min(380px, calc(100% - 24px)); background: #fff; color: #111; border-radius: 14px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); border: 2px solid #ffd400; font-family: system-ui, sans-serif; }
#verBox[hidden] { display: none; }
#verBox .vb-t { font-weight: 800; font-size: 17px; } #verBox .vb-r { color: #555; font-size: 13px; margin: 2px 0 10px; }
#verBox .vb-b { display: flex; gap: 8px; } #verBox button { flex: 1; font: 700 16px system-ui, sans-serif; padding: 13px 0; border-radius: 10px; border: 2px solid #111; background: #ffd400; color: #111; } #verBox button[data-a="skip"] { background: #fff; }
.place-card .share-btn { display: block; width: 100%; margin: 0 0 6px; padding: 11px 16px; border: 2px solid #1a73e8; border-radius: 10px; background: #fff; color: #1a73e8; font: 600 16px/1.2 system-ui, sans-serif; cursor: pointer; }
.place-card .share-btn:active { background: #e8f0fe; }
/* an ESTIMATED limit (tier 4 Mapillary signs, tier 5 neighbourhood default): a dashed edge and a ~ so it reads as "probably", not as an official number */
#speed .limit.est { border-style: dashed; } #speed .limit.est b::before { content: "~"; font-size: .7em; opacity: .75; margin-right: 1px; }
#limEdit .le-off { margin-top: 10px; width: 100%; font: 700 15px system-ui, sans-serif; padding: 11px 0; border-radius: 10px; border: 2px solid #475467; background: #fff; color: #475467; }
#gigNotes { background: none; border: 0; color: #1a73e8; text-decoration: underline; font: 600 14px system-ui, sans-serif; padding: 6px 4px; cursor: pointer; } #gigNotes[hidden] { display: none; }

/* the bottom card: a long street name is cut with ... and never runs under the ETA */
#dock .road b { display: block; } #dock .road > div { min-width: 0; flex: 1 1 auto; overflow: hidden; }
/* the turn arrow now lives in the green street sign, beside the name; the bottom card keeps only the words */
#dock .man #manIco { display: none; }
.cross .tarr { flex: none; display: inline-flex; align-items: center; } .cross .tarr svg { width: 2.2em; height: 2.2em; color: #fff; stroke-width: 6; }
/* a street with two names: the second green sign hangs from the first on two little posts */
.cross2 { position: relative; margin-top: 12px; min-width: min(320px, 70vw); } .cross2[hidden] { display: none; }
.cross2::before, .cross2::after { content: ""; position: absolute; top: -12px; width: 4px; height: 12px; background: #fff; box-shadow: 0 0 0 1px #006b3f; } .cross2::before { left: 22%; } .cross2::after { right: 22%; }
.cross2 .lbl { opacity: .9; }
/* the exit-services sign is shorter: tighter padding, one place per column, a one-line subtitle */
.ex .xsmall { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8em; }
.ex .xskip { flex: none; font: 800 .9em/1 var(--display, system-ui); padding: 5px 9px; border-radius: 7px; border: 2px solid #fff; background: rgba(0, 0, 0, .25); color: #fff; cursor: pointer; }
.ex .sv { margin-top: 5px; padding-top: 6px; gap: 6px; } .ex .sv .col { gap: 3px; } .ex .sv h5 { font-size: .7em; } .ex .sv .it { padding: 4px 6px 0; } .ex .sv .rc { margin-top: 3px; padding: 3px 6px 4px; }
.ex .xs { gap: 1px 10px; } .ex .xbig { line-height: 1.05; }
.cross .tarr[hidden] { display: none; }
.cross.has-turn .lbl { display: none; }

/* the exit-services cards: two places per column in a smaller area (name, then distance and price on one line) */
.ex .sv .col { gap: 3px; }
.ex .sv .it { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 5px; row-gap: 0; padding: 3px 6px 3px; }
.ex .sv .it b { grid-column: 1 / -1; font-size: .78em; line-height: 1.12; }
.ex .sv .it small { font-size: .64em; white-space: nowrap; }
.ex .sv .rc { margin: 0; padding: 0; background: none; font-size: .64em; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ex .sv .rc i { margin-left: .25em; }
.ex .sv h5 { margin-bottom: 0; }
/* services sign: the arrow sits beside "Next exit" only, so the "Not on your route" line runs the full width and Skip is all the way right */
.cross.has-sv .ex .xs { grid-template-areas: "tab refs d" "big big arrow" "small small small"; }
.cross.has-sv .ex .xsmall { grid-column: 1 / -1; }
.cross.has-sv .ex .xa { width: 38px; height: 38px; align-self: start; }

/* Terms / Privacy links: the very bottom of the Directions panel, under the content */
#search .legal { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); display: flex; justify-content: center; gap: 8px; font-size: 12px; color: var(--dim); }
#search .legal a { color: var(--dim); text-decoration: underline; }

/* no "~" beside an estimated limit, and no posted-limit sign in the plain map view (no route): only the current speed stays */
#speed .limit.est b::before { content: none; }
/* (the sign shows while moving, routed or not: see body:not(.moving) below) */

/* the posted-limit sign only shows while actually moving (over 5 mph; it goes away 3 seconds after you stop) */
body:not(.moving) #speed .limit { display: none; }

/* the Terms / Privacy links never ride up with the keyboard: hidden while a field in Directions is being typed in */
body.kbd #search .legal { display: none; }

/* Android phones (Samsung etc.): no automatic text inflation; the Directions panel fits the visible screen (dvh = without the browser bars), scrolls, and the Terms / Privacy links are the last thing inside it */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
#search { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#search[data-search="drawer"] { max-height: none; height: 100vh; height: 100dvh; bottom: auto; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
#search .legal { position: static; margin: 18px 0 4px; padding-top: 10px; border-top: 1px solid var(--edge); }
@media (max-height: 820px) { #search .sw { padding: .4em .55em; margin-top: 6px; } #search .f { margin: 4px 0; } #search #saved { margin-top: 6px; } }

/* the left button column (search, day/night, report, sound, recentre) and the four report buttons: 10% smaller */
#side { gap: 9px; }
#side button { width: 2.7em; height: 2.7em; }
#side button svg { width: 1.3em; height: 1.3em; }
#reports { gap: 9px; }
#reports .rb { padding: .45em .9em .45em .54em; }
#reports .rb svg { width: 2.07em; height: 2.07em; }

/* the Android Auto car screen (?car=1): the map only; the car's own cards show the turn, the time and the search */
body.carview #search { display: none !important; }   /* the car screen is the phone app as it is; only the typing panel is left out (the car has its own keyboard and voice) */

/* ---------- the Android Auto car screen (?car=1): 800x400-ish, landscape, touch (!important: it must beat every theme layout rule) ---------- */
body.carview { --car-btn: 36px; }
body.carview #top { top: 4px !important; padding: 0 !important; left: 100px !important; right: 100px !important; transform: scale(.68); transform-origin: top center; }   /* the green sign: about 60% of its phone size */
body.carview #side { left: 8px !important; right: auto !important; top: 6px !important; gap: 4px !important; opacity: 1 !important; pointer-events: auto !important; flex-direction: column !important; }
body.carview #side button { width: var(--car-btn) !important; height: var(--car-btn) !important; font-size: 12px !important; border-radius: 10px !important; }
body.carview #side button svg { width: 19px !important; height: 19px !important; }
/* the four report buttons: icons only, a column on the right under the speed box */
body.carview #reports { left: 8px !important; right: auto !important; top: 214px !important; bottom: auto !important; flex-direction: column !important; gap: 4px !important; transform: none !important; width: auto !important; height: auto !important; }
body.carview #reports .rb { position: static !important; opacity: 1 !important; pointer-events: auto !important; transform: none !important; width: var(--car-btn); height: var(--car-btn); padding: 0 !important; justify-content: center; border-radius: 10px !important; }
body.carview #reports .rb span { display: none !important; }
body.carview #reports .rb svg { width: 22px !important; height: 22px !important; }
body.carview #reports .main { display: none !important; }
/* speed and compass top right, small */
body.carview #speed { right: 8px !important; top: 6px !important; left: auto !important; bottom: auto !important; gap: 5px !important; flex-direction: column !important; align-items: flex-end !important; font-size: 12px !important; }
body.carview #speed .now { min-width: 52px; padding: 3px 6px !important; }
body.carview #speed .now b { font-size: 24px !important; }
/* the trip card along the bottom: between the brand tag and the report column, smaller type */
body.carview #dock { transform: translateX(-50%) !important; margin: 0 !important; max-width: none !important; left: 50% !important; right: auto !important; bottom: 8px !important; top: auto !important; width: 374px !important; padding: 7px 11px !important; gap: 8px !important; font-size: 13px !important; }
body.carview #dock .road { display: none !important; }   /* the road name is already on the green sign and the map */
body.carview #dock .man b { font-size: 14px !important; }
body.carview #dock .eta b { font-size: 20px !important; }
body.carview #dock .go, body.carview #dock .eta small { font-size: 12px !important; }
body.carview #credit { display: none !important; }
body.carview #brand { left: 8px !important; bottom: 8px !important; font-size: 11px !important; padding: 3px 8px !important; border-radius: 8px !important; }

/* ---------- search suggestions: always a readable size (a long address line used to widen the page, and phones then shrank everything) ---------- */
#search { box-sizing: border-box; max-width: 100vw; overflow-x: hidden; }
#search ul { overflow-x: hidden; -webkit-overflow-scrolling: touch; }
#search li { font-size: 16px; line-height: 1.25; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
#search li b { display: block; font-weight: 700; }
#search li small { font-size: 13px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }

/* ---------- the turn is on the green sign: its small label ("TURN RIGHT") stays visible beside the arrow, and the bottom bar drops its turn line ---------- */
.cross.has-turn .lbl { display: inline; }
#dock .man[hidden] { display: none; }

/* ---------- ?carplay=1 (the iPhone app's CarPlay screen draws its own maneuver panel, trip card and buttons): only the map, the route line, the car and report pins; the map credit stays (required) ---------- */
body.carplay #top, body.carplay #dock, body.carplay #side, body.carplay #reports, body.carplay #speed, body.carplay #brand, body.carplay #search, body.carplay #toast,
body.carplay #wx, body.carplay #still, body.carplay #stopchip, body.carplay #unitCard, body.carplay #routeOpts, body.carplay .rlabel, body.carplay #lookChip, body.carplay #gigWarn, body.carplay #gigNote, body.carplay #gigSheet { display: none !important; }
