:root {
  --bg: #0f172a; --card: #1e293b; --line: #334155; --text: #f1f5f9; --muted: #94a3b8;
  --accent: #22c55e; --accent2: #38bdf8; --danger: #ef4444; --warn: #f59e0b;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.error { color: var(--danger); min-height: 1.2em; }
button { font: inherit; color: var(--text); background: #334155; border: 0; border-radius: 12px;
  padding: 10px 14px; cursor: pointer; }
button:active { transform: scale(.97); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); color: #052e16; font-weight: 700; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.wide { width: 100%; margin-top: 8px; }
.small-btn { padding: 6px 10px; font-size: 13px; }
input { font: inherit; width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: #0b1222; color: var(--text); margin-top: 6px; }
input[type=range], input[type=checkbox] { width: auto; }
input[type=range] { width: 100%; }
label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
.code { text-transform: uppercase; letter-spacing: .2em; font-family: ui-monospace, monospace; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row > input { margin: 0; flex: 1; }

.screen { position: fixed; inset: 0; }
.card { background: var(--card); border-radius: 20px; padding: 20px; box-shadow: 0 10px 40px #0008; }
#onboarding, #setupNeeded { display: grid; place-items: center; padding: 20px; }
.onboard { width: min(420px, 100%); }
.logo { font-size: 28px; font-weight: 800; }
.or { text-align: center; color: var(--muted); margin: 14px 0 0; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors button { width: 36px; height: 36px; border-radius: 50%; padding: 0; border: 3px solid transparent; }
.colors button.sel { border-color: #fff; }

#map { position: absolute; inset: 0; background: #1a2333; }
.leaflet-control-attribution { font-size: 10px; }
.leaflet-top.leaflet-left { top: calc(70px + var(--safe-top)); }

.topbar { position: absolute; z-index: 700; top: calc(10px + var(--safe-top)); left: 10px; right: 10px;
  display: flex; gap: 8px; }
.pill { background: var(--card); border-radius: 999px; white-space: nowrap; box-shadow: 0 4px 16px #0006;
  max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; flex: 1; }
.search input { margin: 0; border-radius: 999px; background: var(--card); box-shadow: 0 4px 16px #0006; }
.results { position: absolute; top: 48px; left: 0; right: 0; background: var(--card); border-radius: 14px;
  overflow: hidden; box-shadow: 0 10px 30px #0008; }
.results div { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.results div small { display: block; color: var(--muted); }

.nav-banner { position: absolute; z-index: 710; top: calc(10px + var(--safe-top)); left: 10px; right: 10px;
  background: #15803d; border-radius: 18px; padding: 14px; display: flex; gap: 14px; align-items: center;
  box-shadow: 0 8px 24px #0008; }
.nav-arrow { font-size: 40px; width: 52px; text-align: center; }
.nav-dist { font-size: 26px; font-weight: 800; }
.nav-instr { font-size: 17px; }
body.navigating .topbar { display: none; }

.speedo { position: absolute; z-index: 500; left: 12px; bottom: calc(var(--sheet-h, 150px) + 16px);
  width: 64px; height: 64px; border-radius: 50%; background: #fff; color: #0f172a; display: grid;
  place-items: center; align-content: center; box-shadow: 0 4px 16px #0008; border: 4px solid #0f172a; }
.speedo b { font-size: 22px; line-height: 1; } .speedo small { font-size: 10px; }
.speedo.fast { background: var(--danger); color: #fff; }

.fabs { position: absolute; z-index: 500; right: 12px; bottom: calc(var(--sheet-h, 150px) + 16px);
  transition: bottom .2s;
  display: flex; flex-direction: column; gap: 10px; }
.fab { width: 52px; height: 52px; border-radius: 50%; background: var(--card); font-size: 20px; padding: 0;
  box-shadow: 0 4px 16px #0008; position: relative; }
.fab-label { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); padding: 5px 9px;
  border-radius: 999px; background: #fff; color: #0f172a; box-shadow: 0 2px 8px #0005; white-space: nowrap;
  font-size: 12px; line-height: 1.2; font-weight: 700; pointer-events: none; }
body.night .fab-label { background: var(--card); color: var(--text); }
.fab.report { background: var(--warn); width: 60px; height: 60px; font-size: 26px; }
.fab.sos { background: var(--danger); font-weight: 800; font-size: 14px; }

.sheet { position: absolute; z-index: 550; left: 0; right: 0; bottom: 0; background: var(--card);
  border-radius: 20px 20px 0 0; padding: 8px 14px calc(12px + var(--safe-bottom)); box-shadow: 0 -8px 30px #0007; }
.people { max-height: 45vh; overflow-y: auto; transition: max-height .25s; }
.people.collapsed { max-height: 130px; overflow: hidden; }
.grip { width: 42px; height: 5px; background: var(--line); border-radius: 3px; margin: 2px auto 8px; cursor: pointer; }
#memberList { list-style: none; margin: 0; padding: 0; }
#memberList li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
#memberList li:last-child { border-bottom: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  color: #fff; border: 3px solid #fff; flex-shrink: 0; box-shadow: 0 2px 8px #0008; }
.member-info { flex: 1; min-width: 0; }
.member-info b { display: block; } .member-info span { color: var(--muted); font-size: 13px; }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: #0b1222; color: var(--muted); white-space: nowrap; }
.badge.driving { background: #1d4ed8; color: #fff; }
.events { font-size: 13px; background: #0b1222; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }

.route { z-index: 560; }
.route-head { display: flex; justify-content: space-between; align-items: center; }
.eta { font-size: 24px; font-weight: 800; color: var(--accent); }
.route details { margin: 6px 0; } .route ol { max-height: 25vh; overflow: auto; padding-left: 22px; margin: 6px 0; }
.route li { padding: 3px 0; color: var(--muted); }

.modal { position: absolute; inset: 0; z-index: 900; background: #0009; display: grid; place-items: end center; }
.modal .card { width: min(480px, 100%); max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding-bottom: calc(20px + var(--safe-bottom)); }
.modal h3 { margin-top: 0; }
.report-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 8px; }
.report-grid button { font-size: 30px; padding: 14px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: #0b1222; }
.report-grid span { font-size: 13px; color: var(--muted); }
.circle-list { list-style: none; padding: 0; margin: 0 0 8px; }
.circle-list li { padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.circle-list li.sel { background: #0b1222; outline: 2px solid var(--accent); }
.invite { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.toggle { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }

.toasts { position: absolute; z-index: 1000; top: calc(70px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; width: min(420px, 92vw); pointer-events: none; }
.toast { background: #020617ee; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  animation: pop .25s ease-out; pointer-events: none; }
.toast button { pointer-events: auto; }
.toast.warn { border-color: var(--warn); } .toast.danger { border-color: var(--danger); background: #450a0aee; }
@keyframes pop { from { transform: translateY(-10px); opacity: 0; } }

/* map markers */
.member-pin { position: relative; }
.member-pin .avatar { width: 44px; height: 44px; }
.member-pin .avatar.stale { filter: grayscale(.8); opacity: .75; }
.me-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--accent2); border: 4px solid #fff;
  box-shadow: 0 0 0 8px #38bdf833, 0 2px 8px #0008; }
.me-arrow { width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-bottom: 34px solid var(--accent2); filter: drop-shadow(0 2px 4px #000a); transform-origin: 50% 60%; }
.hazard-pin { font-size: 22px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; box-shadow: 0 2px 8px #0009; border: 3px solid var(--warn); }
.hazard-pin.police { border-color: #3b82f6; } .hazard-pin.crash, .hazard-pin.closure { border-color: var(--danger); }
.place-pin { font-size: 22px; }
.leaflet-popup-content-wrapper { background: var(--card); color: var(--text); border-radius: 14px; }
.leaflet-popup-tip { background: var(--card); }
.popup-actions { display: flex; gap: 6px; margin-top: 8px; }
.popup-actions button { padding: 6px 10px; font-size: 13px; }

.gps-banner { position: absolute; z-index: 590; top: calc(66px + var(--safe-top)); left: 10px; right: 10px;
  background: #1e293bf2; border: 1px solid var(--warn); border-radius: 14px; padding: 10px 12px;
  display: flex; gap: 10px; align-items: center; justify-content: space-between; box-shadow: 0 6px 20px #0008; }
.gps-banner button { white-space: nowrap; }

/* ── driving look ── */
select { font: inherit; width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: #0b1222; color: var(--text); }
#map { background: #eef1f5; }
body.night #map { background: #1b2433; }
.leaflet-container { font-family: inherit; }
.me-puck { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #60a5fa, #1d4ed8 70%);
  border: 4px solid #fff; box-shadow: 0 0 0 10px #3b82f633, 0 4px 12px #0007; position: relative; }
.me-chev { position: absolute; inset: 2px; width: 32px; height: 32px; transition: transform .4s; }
.hazard-pin { width: 42px; height: 42px; border-radius: 50% 50% 50% 6px; transform: rotate(-45deg); background: #fff;
  display: grid; place-items: center; border: 3px solid var(--warn); box-shadow: 0 4px 10px #0006; font-size: 0; }
.hazard-pin span { transform: rotate(45deg); font-size: 20px; }
.hazard-pin.police { border-color: #3b82f6; background: #eff6ff; }
.hazard-pin.crash, .hazard-pin.closure { border-color: var(--danger); background: #fef2f2; }
.hazard-pin.traffic { border-color: #f97316; background: #fff7ed; }
.hazard-pin.camera { border-color: #8b5cf6; background: #f5f3ff; }
.member-pin .avatar { box-shadow: 0 4px 12px #0007; }
.fab { background: #fff; color: #0f172a; }
body.night .fab { background: var(--card); color: var(--text); }
.fab.sos { color: #fff; }
.nav-banner { background: linear-gradient(135deg, #16a34a, #15803d); border-radius: 22px; }
.nav-arrow { background: #ffffff22; border-radius: 16px; height: 56px; display: grid; place-items: center; }
.search input { background: #fff; color: #0f172a; }
.pill { background: #fff; color: #0f172a; }
body.night .search input, body.night .pill { background: var(--card); color: var(--text); }
.speedo { border-color: #1d4ed8; }

.kr-icon { display: inline-block; vertical-align: middle; line-height: 0; }
.kr-icon svg { width: 100%; height: 100%; }
.report-grid button { font-size: 13px; color: var(--muted); }
.myvoice { margin-top: 12px; background: #0b1222; border-radius: 12px; padding: 8px 10px; }
.myvoice summary { cursor: pointer; font-weight: 600; }
#myVoiceList { list-style: none; padding: 0; margin: 6px 0 0; max-height: 34vh; overflow: auto; }
#myVoiceList li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
#settingsModal .card { max-height: 92vh; overflow-y: auto; }

.report-grid button { padding: 10px 2px; }
.report-grid button.selected { outline: 2px solid var(--accent2); background: #12354a; color: var(--text); }
.hazard-pin.pothole { border-color: #4b5563; } .hazard-pin.flood { border-color: #0ea5e9; background: #f0f9ff; }
.hazard-pin.roadworks { border-color: #f97316; } .hazard-pin.breakdown { border-color: #64748b; }

.fab.mic { background: linear-gradient(135deg, #22e07a, #0ea5e9); color: #04121f; width: 60px; height: 60px; }
.fab.mic.live { animation: micpulse 1.4s infinite; }
.gps-banner { align-items: flex-start; }
.gps-banner > div:first-child { flex: 1; min-width: 0; }
.gps-actions { flex-direction: column; align-items: stretch; flex-shrink: 0; margin: 0; }
.gps-actions button { white-space: normal; }
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 #22e07a99; } 70% { box-shadow: 0 0 0 16px #22e07a00; } 100% { box-shadow: 0 0 0 0 #22e07a00; } }
.asst-panel { position: absolute; z-index: 800; left: 12px; right: 84px; bottom: calc(var(--sheet-h, 150px) + 16px);
  display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.bubble { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 15px; box-shadow: 0 4px 14px #0007; animation: pop .2s ease-out; }
.bubble.bot { align-self: flex-start; background: #0f172aee; color: #e2fbe9; border: 1px solid #22e07a77; border-bottom-left-radius: 4px; }
.bubble.bot::before { content: "Lanemate"; display: block; font-size: 11px; color: #22e07a; font-weight: 700; letter-spacing: .04em; }
.bubble.me { align-self: flex-end; background: #2563eb; color: #fff; border-bottom-right-radius: 4px; }
.route-choices { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.toggle.big { align-items: flex-start; background: #0b1222; border: 1px solid #22e07a55; border-radius: 12px; padding: 10px; margin-top: 4px; }
.toggle.big input { margin-top: 4px; }
.logo { background: linear-gradient(90deg, #22e07a, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }

.report-grid { gap: 6px; max-height: 52vh; overflow-y: auto; }
.report-grid button { font-size: 11px; padding: 8px 2px; line-height: 1.15; }
.hazard-pin.fire { border-color: #ef4444; background: #fff7ed; } .hazard-pin.wildlife { border-color: #ca8a04; background: #fefce8; }
.hazard-pin.tree { border-color: #16a34a; } .hazard-pin.heavy { border-color: #2563eb; } .hazard-pin.unsealed { border-color: #b45309; }

.link-btn { background: none; border: none; color: var(--accent2); padding: 10px 0 0; width: 100%; text-align: center; text-decoration: underline; cursor: pointer; font-size: 14px; }
.link-btn.danger-link { color: #f87171; margin-top: 6px; }
.account-box { margin-top: 14px; padding: 12px; border: 1px solid var(--line, #334155); border-radius: 14px; }
.hazard-pin.official { box-shadow: 0 0 0 3px #1d4ed8, 0 4px 10px #0007; }
.closed-badge { background: var(--danger); color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: 700; }
.circle-people { list-style: none; margin: 0 0 10px; padding: 0; }
.circle-people li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(148,163,184,.15); }

/* ── Settings: tabs, character and vehicle pickers ── */
.card.settings { padding-top: 14px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.settings-head h3 { margin: 0; }
.icon-btn { background: transparent; border: 1px solid var(--line); width: 36px; height: 36px; border-radius: 10px; padding: 0; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; margin: 12px 0 6px; position: sticky; top: -20px; z-index: 2; }
.tabs button { padding: 8px 4px; font-size: 12.5px; border-radius: 9px; background: transparent; border: 0; color: var(--muted); white-space: nowrap; }
.tabs button.active { background: var(--card); color: var(--text); font-weight: 700; box-shadow: 0 1px 4px #0006; }
.tab-panel h4 { margin: 18px 0 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.row.seg { gap: 6px; } .row.seg button { flex: 1; }
.char-grid { display: grid; grid-template-columns: 1fr; gap: 6px; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.char-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.char-card.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.char-emoji { font-size: 24px; width: 32px; text-align: center; }
.char-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.char-text .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-play { width: 36px; height: 36px; padding: 0; border-radius: 50%; flex: none; }
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.veh-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); background: #e9edf2; color: #1e293b; }
.veh-card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.veh-img { height: 44px; display: flex; align-items: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; padding: 0; border: 2px solid var(--line); }
.swatch.sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.about { margin-top: 16px; line-height: 1.6; }

/* ── Vehicles on the map ── */
.veh-marker { width: 56px; height: 56px; display: grid; place-items: center; transition: transform .6s ease; filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 3px 5px #0008); }
.veh-marker.me { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px #38bdf8aa) drop-shadow(0 3px 6px #0009); }
.veh-badge { position: absolute; right: 2px; bottom: 2px; min-width: 20px; height: 20px; border-radius: 10px; font-size: 10px; font-weight: 800; color: #fff; display: grid; place-items: center; border: 2px solid #fff; padding: 0 3px; }

/* Install banner */
#installBanner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 3000;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
  background: #1e293b; color: #f1f5f9; border: 1px solid #334155; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 520px; margin: 0 auto; }
#installBanner img { border-radius: 10px; flex: none; }
#installBanner .ib-text { flex: 1; display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; }
#installBanner .ib-text span { color: #94a3b8; }
#installBanner button.primary { flex: none; padding: 8px 14px; }
#installBanner .ib-close { background: none; border: 0; color: #94a3b8; font-size: 16px; padding: 6px; cursor: pointer; }

.speedo { cursor: pointer; }
.toggle-row { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; font-size: 14px; }
.toggle-row input { margin-top: 3px; width: 18px; height: 18px; flex: none; }

/* ── v1.7 driving screen ── */
.nav-banner { background: linear-gradient(160deg, #1f6feb, #1347b8); border-radius: 20px; padding: 12px 14px; gap: 14px;
  box-shadow: 0 10px 28px #0b1a4a66; color: #fff; flex-wrap: wrap; }
.nav-arrow { width: 64px; height: 64px; flex: 0 0 64px; background: #ffffff1f; border-radius: 16px; display: grid; place-items: center; font-size: 0; color: #fff; }
.nav-text { flex: 1; min-width: 0; }
.nav-dist { font-size: 34px; font-weight: 800; line-height: 1.05; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.nav-instr { font-size: 18px; font-weight: 600; line-height: 1.25; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nav-then { flex: 0 0 calc(100% + 28px); box-sizing: border-box; display: flex; align-items: center; gap: 6px; margin: 0 -14px -12px; padding: 6px 16px 8px;
  background: #0b2f86; border-radius: 0 0 20px 20px; font-size: 15px; font-weight: 700; }
.nav-then.hidden { display: none; }
.turn-dot span { display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 5px solid #1347b8; box-shadow: 0 2px 6px #0006; }

/* trip bar while driving: just ETA, time/distance left and End */
body.navigating .route { padding: 12px 14px calc(12px + var(--safe-bottom, 0px)); }
body.navigating .route > :not(.route-head) { display: none; }
body.navigating .route .eta { font-size: 26px; color: #16a34a; }
body.navigating #startNavBtn { background: var(--danger); color: #fff; }
body.navigating #cancelRouteBtn { display: none; }
body.navigating #placeBtn, body.navigating #sosBtn, body.navigating #settingsBtn { display: none; }
body.navigating .speedo { bottom: calc(var(--sheet-h, 90px) + 16px); }

.route li { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--text); border-bottom: 1px solid var(--line); }
.route li .muted { margin-left: auto; font-size: 13px; white-space: nowrap; }
.route ol { list-style: none; padding-left: 0; }
.step-ic { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: #1f6feb; color: #fff; display: grid; place-items: center; }

/* compact location bar */
.gps-banner { padding: 8px 10px; align-items: center; border-color: #f59e0b88; border-radius: 14px; }
.gps-msg { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
.gps-msg #gpsReason:empty { display: none; }
.gps-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.gps-actions button { padding: 7px 10px; font-size: 13px; white-space: nowrap; }

/* tidy round buttons: icon only, label on hover (desktop) */
.fab { width: 50px; height: 50px; display: grid; place-items: center; box-shadow: 0 3px 12px #0005; border: 1px solid #0f172a14; }
.fab-label { opacity: 0; transition: opacity .15s; }
@media (hover: hover) { .fab:hover .fab-label { opacity: 1; } }
.fab.report { width: 58px; height: 58px; color: #1f1300; }
.fab.mic { width: 58px; height: 58px; }
.fabs { gap: 12px; }

/* ── music ── */
.fab.music { color: #1db954; }
.fab.music.playing::after { content: ""; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #1db954; box-shadow: 0 0 0 2px #fff; }
.card.music { display: flex; flex-direction: column; gap: 12px; }
.music-search input { width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #0b1222; color: var(--text); font: inherit; }
.music-apps-row { display: flex; gap: 6px; margin-top: 8px; }
.music-apps-row .app-btn { flex: 1; padding: 9px 4px; font-weight: 700; color: #fff; border: none; }
.app-btn.sp { background: #1db954; color: #04121f; } .app-btn.yt { background: #ff0033; } .app-btn.am { background: linear-gradient(135deg, #fa233b, #fb5c74); }
.music-card { background: #0b1222; border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.music-card .row { gap: 8px; flex-wrap: wrap; }
.music-card p { margin: 0; }
.music-brand { display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; } .brand-dot.sp { background: #1db954; } .brand-dot.yt { background: #ff0033; } .brand-dot.am { background: #fa233b; }
.setup-steps { margin: 0; padding-left: 20px; line-height: 1.5; } .setup-steps code { background: #1e293b; padding: 2px 6px; border-radius: 6px; word-break: break-all; }
#spClientId { flex: 1; min-width: 0; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #111a2e; color: var(--text); font-family: ui-monospace, monospace; }
.np { display: flex; gap: 12px; align-items: center; }
.np img { border-radius: 10px; object-fit: cover; background: #1e293b; flex: 0 0 72px; }
.np-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.np-text b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-controls { display: flex; justify-content: center; align-items: center; gap: 22px; }
.np-btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; padding: 0; background: #1e293b; color: var(--text); border: none; }
.np-btn.big { width: 64px; height: 64px; background: #1db954; color: #04121f; }
.playlist-list { list-style: none; padding: 0; margin: 6px 0 0; max-height: 34vh; overflow: auto; }
.playlist-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px; background: none; border: none; color: var(--text); text-align: left; font: inherit; border-radius: 10px; }
.playlist-btn:hover { background: #1e293b; }
.playlist-btn img, .pl-ph { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex: 0 0 36px; display: grid; place-items: center; background: #1e293b; }
.music-error { background: #451a03; color: #fed7aa; border-radius: 10px; padding: 8px 10px; }
.mini-player { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px; background: #0b1222; border-radius: 14px; }
.mini-player.hidden { display: none; }
.mini-player img { border-radius: 8px; object-fit: cover; flex: 0 0 40px; background: #1e293b; }
.mp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.mp-text b, .mp-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0; border: none; background: #1e293b; color: var(--text); flex: 0 0 44px; }
#mpPlay { background: #1db954; color: #04121f; }
.mini-player img.hidden, .np img.hidden { display: none; }
body.navigating .route > .mini-player:not(.hidden) { display: flex; }
.route .mini-player { display: none; }
body.navigating .route .mini-player:not(.hidden) { display: flex; }
.music-card a { color: #7cb7ff; font-weight: 600; }

/* ── reports freshness + live traffic ── */
.leaflet-container:not(.z14) .hazard-pin.longterm { display: none; }
.hazard-pin.longterm, .hazard-pin.aged { opacity: .7; filter: saturate(.7); }
.traffic-delay { font-size: 14px; font-weight: 700; color: #f97316; margin-left: 6px; }
.still-there { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--safe-top, 0px) + 150px); z-index: 1200; display: flex; align-items: center; gap: 12px;
  background: #0f172a; color: #fff; padding: 10px 12px 10px 16px; border-radius: 18px; box-shadow: 0 10px 30px #0008; font-size: 17px; }
.still-there.hidden { display: none; }
.st-btn { width: 56px; height: 56px; border-radius: 50%; border: none; font-size: 26px; display: grid; place-items: center; }
.st-btn.yes { background: #16a34a; } .st-btn.no { background: #dc2626; }

/* ── professional icon set ── */
.logo { display: flex; align-items: center; gap: 8px; } .logo img { border-radius: 7px; }
.ui-ic { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.ui-ic.ok-ic { color: #22c55e; } .ui-ic.bad-ic { color: #ef4444; }
.dot-ic { width: 16px; height: 16px; border: 2px solid var(--muted); border-radius: 50%; box-sizing: border-box; }
button .ui-ic, button svg { vertical-align: -3px; }
.kr-icon svg { display: block; }
/* Map report pins: the report badge itself, with a white rim and a small pointer */
.hazard-pin, .hazard-pin.official, .hazard-pin.police { transform: none !important; width: 40px !important; height: 46px !important; background: none !important; border: none !important;
  border-radius: 0 !important; box-shadow: none !important; display: flex; flex-direction: column; align-items: center; }
.hazard-pin .pin-face { display: block; width: 34px; height: 34px; border-radius: 12px; border: 2.5px solid #fff; box-shadow: 0 3px 10px #0007; overflow: hidden; line-height: 0; }
.hazard-pin .pin-face .kr-icon { width: 34px !important; height: 34px !important; }
.hazard-pin::after { content: ""; width: 0; height: 0; border: 6px solid transparent; border-top-color: #fff; margin-top: -1px; filter: drop-shadow(0 2px 1px #0005); }
.hazard-pin.official .pin-face { border-color: #e2e8f0; }
.report-grid .kr-icon { width: 40px !important; height: 40px !important; }
.place-pin { color: #a855f7; filter: drop-shadow(0 2px 2px #0006); }
.dest-pin { width: 34px; height: 34px; border-radius: 50%; background: #0f172a; color: #fff; display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 3px 10px #0007; }
.st-btn { color: #fff; }
.char-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--av); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.hazard-pin span, .hazard-pin .kr-icon { transform: none !important; }

/* ── review fixes ── */
body.navigating .toasts { top: calc(190px + var(--safe-top)); }           /* below the turn banner */
.results { z-index: 1100; }                                                 /* search results above messages */
body:has(.modal:not(.hidden)) .leaflet-control-attribution { display: none; } /* credits never cover a panel */
.card a, .onboarding a, #appVersion ~ a, .modal a { color: #7cb7ff; }
.leaflet-control-attribution { font-size: 10px; opacity: .85; }
#onboarding a, .screen a { color: #7cb7ff; }
body:has(#searchResults:not(.hidden)) .toasts { display: none; }

/* ── traffic on your route ── */
.jam-tag { display: inline-block; padding: 3px 8px; border-radius: 10px; font: 800 12px/1.3 system-ui, sans-serif; color: #fff; white-space: nowrap;
  border: 2px solid #fff; box-shadow: 0 2px 6px #0006; transform: translateX(-50%); position: relative; left: 32px; }
.jam-tag.m1 { background: #ca8a04; } .jam-tag.m2 { background: #ea580c; } .jam-tag.m3 { background: #dc2626; } .jam-tag.m4 { background: #7f1d1d; }

/* ── other drivers ── */
.other-driver { width: 20px; height: 32px; opacity: .9; filter: drop-shadow(0 1px 1.5px #0007); transition: transform .4s; }
.veh-grid, #vehicleGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.veh-card .veh-img { display: grid; place-items: center; height: 46px; }
