/* ============ TruckNav design tokens ============ */
:root{
  --bg:#0b1220; --surface:#121a2b; --surface-2:#1a2438; --surface-3:#222e46;
  --glass:rgba(15,22,38,.82); --line:rgba(255,255,255,.08); --line-2:rgba(255,255,255,.14);
  --text:#eef2f8; --muted:#94a3b8; --faint:#64748b;
  --accent:#3b82f6; --accent-2:#60a5fa; --accent-ink:#fff;
  --green:#22c55e; --red:#ef4444; --amber:#f59e0b;
  --r-sm:10px; --r:14px; --r-lg:20px; --r-xl:28px;
  --shadow:0 8px 24px rgba(2,6,23,.35),0 2px 6px rgba(2,6,23,.25);
  --shadow-sm:0 2px 8px rgba(2,6,23,.3);
  --safe-top:env(safe-area-inset-top,0px); --safe-bot:env(safe-area-inset-bottom,0px);
  --ease:cubic-bezier(.2,.8,.2,1);
  font-family:"Inter","Segoe UI Variable","Segoe UI",Roboto,system-ui,-apple-system,sans-serif;
  -webkit-font-smoothing:antialiased;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:var(--bg);color:var(--text);font-size:15px;line-height:1.4}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0}
button:focus-visible,select:focus-visible,input:focus-visible,[role=button]:focus-visible{outline:2px solid var(--accent-2);outline-offset:2px}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
svg .fill{fill:currentColor;stroke:none}
.hidden{display:none!important}
.muted{color:var(--muted)} .small{font-size:13px} .pad{padding:12px 18px}
.fine{color:var(--faint);font-size:12px;line-height:1.5;margin:12px 18px 0}
.fine.center{text-align:center}
#map{position:absolute;inset:0}
.maplibregl-ctrl-attrib{font-size:10px}
.maplibregl-ctrl-attrib.maplibregl-compact{background:rgba(255,255,255,.75)}
body.nav .maplibregl-ctrl-bottom-right,body.nav .maplibregl-ctrl-bottom-left{display:none}

/* ============ floating controls ============ */
.glass{background:var(--glass);backdrop-filter:blur(14px) saturate(1.4);-webkit-backdrop-filter:blur(14px) saturate(1.4)}
#topBar{position:absolute;z-index:5;top:calc(12px + var(--safe-top));left:12px;right:12px;display:flex;gap:8px;max-width:520px;
  background:var(--glass);backdrop-filter:blur(14px) saturate(1.4);-webkit-backdrop-filter:blur(14px) saturate(1.4);
  border:1px solid var(--line);border-radius:var(--r-xl);padding:5px;box-shadow:var(--shadow)}
.searchbar{flex:1;display:flex;align-items:center;gap:12px;padding:10px 14px;border-radius:var(--r-xl);color:var(--muted);font-size:16px;text-align:left}
.searchbar svg{color:var(--accent-2)}
.searchbar:hover{background:rgba(255,255,255,.04)}
.bar-icon{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:var(--surface-3);color:var(--text)}
.bar-icon:hover{background:#2b3956}
#vehicleChip{position:absolute;z-index:5;top:calc(76px + var(--safe-top));left:12px;display:flex;gap:8px;align-items:center;max-width:calc(100% - 24px);
  background:var(--glass);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border:1px solid var(--line);
  border-radius:999px;padding:7px 14px 7px 10px;font-size:13px;box-shadow:var(--shadow-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
#vehicleChip svg{width:18px;height:18px;color:var(--accent-2)}
#vehicleChip b{font-weight:600}
#vehicleChip .sep{color:var(--faint)}
#offlineBar{position:absolute;z-index:30;top:calc(8px + var(--safe-top));left:50%;transform:translateX(-50%);display:flex;gap:8px;align-items:center;
  background:#3b2a0a;border:1px solid #6b4a10;color:#fde68a;padding:8px 14px;border-radius:999px;font-size:13px;box-shadow:var(--shadow);max-width:calc(100% - 24px)}
body:not(.nav) #offlineBar{top:calc(120px + var(--safe-top))}

.fab{position:absolute;z-index:5;width:54px;height:54px;border-radius:18px;display:grid;place-items:center;
  background:var(--glass);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border:1px solid var(--line);color:var(--text);box-shadow:var(--shadow);transition:transform .15s var(--ease)}
.fab:active{transform:scale(.94)}
.fab.br{bottom:calc(28px + var(--safe-bot));right:12px;color:var(--accent-2)}
.fab.bl{bottom:calc(28px + var(--safe-bot));left:12px}
.fab.report{background:var(--amber);border-color:transparent;color:#1f1300}
body.nav .fab.bl{bottom:calc(96px + var(--safe-bot))}
body.routing .fab,body.nav #btnLocate{display:none}
body.nav .browse-only,body.routing .browse-only,body.nav #vehicleChip,body.routing #vehicleChip,body.nav #topBar,body.routing #topBar{display:none}

#btnResume{position:absolute;z-index:6;left:50%;transform:translateX(-50%);bottom:calc(96px + var(--safe-bot));display:flex;gap:8px;align-items:center;
  background:var(--accent);color:#fff;font-weight:700;letter-spacing:.4px;padding:13px 20px;border-radius:999px;box-shadow:var(--shadow)}
#btnResume svg{width:18px;height:18px}

/* ============ navigation ============ */
#navTop{position:absolute;z-index:6;top:calc(10px + var(--safe-top));left:10px;right:10px;padding:14px 16px;border-radius:var(--r-lg);
  background:linear-gradient(135deg,#2563eb,#1d4ed8);display:flex;align-items:center;gap:14px;box-shadow:var(--shadow)}
#navIcon{width:58px;height:58px;border-radius:16px;background:rgba(255,255,255,.14);display:grid;place-items:center;flex:none}
#navIcon svg{width:42px;height:42px;stroke-width:2.4}
.nav-main{flex:1;min-width:0}
#navDist{font-size:30px;font-weight:800;line-height:1.05;letter-spacing:-.5px}
#navStreet{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.92;margin-top:2px}
#navThen{background:rgba(0,0,0,.2);border-radius:12px;padding:6px 8px;display:flex;flex-direction:column;align-items:center;font-size:10px;font-weight:600;min-width:50px;text-transform:uppercase;letter-spacing:.3px}
#navThen:empty{display:none}
#navThen svg{width:24px;height:24px;margin-top:2px}
#navWait{position:absolute;z-index:6;top:calc(110px + var(--safe-top));left:50%;transform:translateX(-50%);display:flex;gap:10px;align-items:center;
  background:var(--glass);backdrop-filter:blur(14px);border:1px solid var(--line);padding:10px 16px;border-radius:999px;box-shadow:var(--shadow);font-size:14px;white-space:nowrap}

#navSide{position:absolute;z-index:5;right:10px;top:calc(112px + var(--safe-top));width:78px;background:var(--glass);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden}
#navSideToggle{width:100%;padding:5px;display:grid;place-items:center;color:var(--muted)}
#navSideToggle svg{transition:transform .2s var(--ease)}
#navSide.collapsed #navList{display:none}
#navSide.collapsed #navSideToggle svg{transform:rotate(180deg)}
#navList{list-style:none;margin:0;padding:0;max-height:52vh;overflow:hidden}
#navList li{display:flex;flex-direction:column;align-items:center;gap:2px;padding:9px 4px;border-top:1px solid var(--line);font-size:12px;font-weight:700;text-align:center}
#navList li svg{width:26px;height:26px}
#navList li small{font-weight:500;color:var(--muted);font-size:10px;max-width:70px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

#speedo{position:absolute;z-index:5;right:12px;bottom:calc(96px + var(--safe-bot));display:flex;flex-direction:column;align-items:center;gap:6px}
#vmax{display:flex;flex-direction:column;align-items:center;background:var(--surface-2);border:1px solid var(--line-2);border-radius:10px;padding:3px 9px;line-height:1.1;box-shadow:var(--shadow-sm)}
#vmax small{font-size:8px;letter-spacing:1px;color:var(--muted);font-weight:700}
#vmax b{font-size:14px}
#speedCircle{width:68px;height:68px;border-radius:50%;background:var(--glass);backdrop-filter:blur(14px);border:3px solid var(--line-2);display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:var(--shadow);transition:background .2s,border-color .2s}
#speedCircle b{font-size:24px;line-height:1;font-variant-numeric:tabular-nums}
#speedCircle small{font-size:10px;color:var(--muted)}
#speedo.over #speedCircle{border-color:var(--red);background:#7f1d1d}

#navBottom{position:absolute;z-index:6;left:10px;right:10px;bottom:calc(10px + var(--safe-bot));padding:10px 16px;border-radius:var(--r-lg);
  background:var(--glass);backdrop-filter:blur(14px) saturate(1.4);-webkit-backdrop-filter:blur(14px) saturate(1.4);border:1px solid var(--line);
  display:grid;grid-template-columns:1fr auto 1fr;align-items:center;cursor:pointer;box-shadow:var(--shadow)}
.nb-item{display:flex;flex-direction:column;gap:1px}
.nb-item:last-child{text-align:right;align-items:flex-end}
.nb-item small{font-size:10px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);font-weight:600}
.nb-item b{font-size:17px;font-variant-numeric:tabular-nums}
.nb-item.mid{align-items:center}
.nb-item.mid b{font-size:24px;color:var(--green)}

.dot{width:9px;height:9px;border-radius:50%;background:var(--accent-2);display:inline-block;flex:none}
.dot.green{background:var(--green)} .dot.warn{background:var(--amber)}
.dot.flag{background:#fff;box-shadow:0 0 0 2px #111 inset}

/* ============ bottom sheets ============ */
.sheet{position:absolute;z-index:8;left:0;right:0;bottom:0;background:var(--surface);border-top:1px solid var(--line);border-radius:var(--r-xl) var(--r-xl) 0 0;
  box-shadow:0 -10px 40px rgba(2,6,23,.5);padding:6px 0 calc(16px + var(--safe-bot));max-height:78vh;overflow:auto;animation:up .28s var(--ease)}
@keyframes up{from{transform:translateY(30px);opacity:0}}
.sheet-grip{width:38px;height:4px;border-radius:2px;background:var(--line-2);margin:6px auto 12px}
@media(min-width:760px){
  .sheet{left:16px;right:auto;width:420px;bottom:16px;border-radius:var(--r-xl);border:1px solid var(--line)}
  .panel:not(.dim){left:16px!important;right:auto!important;top:16px!important;bottom:16px!important;width:420px;border-radius:var(--r-xl);border:1px solid var(--line);box-shadow:var(--shadow)}
  #navTop{right:auto;width:440px}
  #navBottom{right:auto;width:440px}
}
.rp-head{display:flex;gap:10px;padding:0 16px 12px;align-items:flex-start}
.fromto{flex:1;background:var(--surface-2);border-radius:var(--r);padding:11px 14px;font-size:14px;min-width:0}
.ft-row{display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden}
.ft-row b{overflow:hidden;text-overflow:ellipsis;font-weight:600}
.ft-line{border-left:2px dotted var(--faint);height:10px;margin-left:3.5px}
.icon-btn{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:var(--text);flex:none}
.icon-btn:hover{background:rgba(255,255,255,.06)}
.icon-btn.round{background:var(--surface-2)}
#rpTabs{display:flex;gap:8px;padding:0 16px;overflow-x:auto;scrollbar-width:none}
.rtab{flex:1;min-width:104px;padding:11px 8px;text-align:center;border-radius:var(--r);cursor:pointer;background:var(--surface-2);border:1.5px solid transparent;transition:border-color .15s,background .15s}
.rtab:hover{border-color:var(--line-2)}
.rtab b{display:block;font-size:18px;font-weight:800;letter-spacing:-.3px}
.rtab small{display:block;color:var(--muted);font-size:13px}
.rtab .tags{display:flex;gap:4px;justify-content:center;flex-wrap:wrap;margin-top:6px;min-height:18px}
.rtab .tag{font-size:10px;padding:2px 7px;border-radius:999px;background:rgba(255,255,255,.08);color:var(--muted);font-weight:600}
.rtab.sel{background:rgba(59,130,246,.16);border-color:var(--accent)}
.rtab.sel b{color:var(--accent-2)}
.notice{margin:12px 16px 0;padding:10px 12px;border-radius:var(--r-sm);font-size:13px}
.notice.warn{background:rgba(245,158,11,.12);color:#fcd34d;border:1px solid rgba(245,158,11,.3)}
#rpVehicle{margin:12px 16px 0;background:var(--surface-2);border-radius:var(--r);padding:11px 14px;display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;font-size:13px;cursor:pointer}
#rpVehicle:hover{background:var(--surface-3)}
#rpVehicle .vt{width:100%;display:flex;justify-content:space-between;color:var(--muted)}
#rpVehicle .vt b{color:var(--text);font-weight:600}
#rpVehicle .vt span:last-child{color:var(--accent-2);font-weight:600}
.spec{display:inline-flex;align-items:center;gap:6px;font-weight:600}
.spec i{font-style:normal;width:22px;height:22px;border-radius:50%;border:2.5px solid var(--red);background:#fff;color:#111;display:grid;place-items:center;font-size:10px;font-weight:800}
.weight-row{display:flex;align-items:center;gap:12px;margin:10px 16px 0;background:var(--surface-2);border-radius:var(--r);padding:9px 14px}
.weight-row input{flex:1;accent-color:var(--accent)}
.weight-row b{min-width:52px;text-align:right;font-variant-numeric:tabular-nums}
.btn{padding:14px;border-radius:var(--r);font-weight:700;font-size:16px;display:flex;align-items:center;justify-content:center;gap:10px;transition:filter .15s,transform .1s}
.btn:hover{filter:brightness(1.08)} .btn:active{transform:scale(.98)}
.btn.blue{background:var(--accent);color:#fff} .btn.red{background:var(--red);color:#fff}
.btn.wide{width:calc(100% - 32px);margin:14px 16px 0;border-radius:999px;padding:16px;box-shadow:0 8px 20px rgba(59,130,246,.35)}
.btn:disabled{opacity:.4;box-shadow:none;cursor:default}
.row2{display:flex;gap:10px;padding:14px 16px 0}.row2 .btn{flex:1}
.nm-buttons{display:flex;gap:10px;padding:0 16px}
.tile{flex:1;background:var(--surface-2);border-radius:var(--r);padding:14px 6px;display:flex;flex-direction:column;align-items:center;gap:8px;font-size:12px;font-weight:600;text-align:center}
.tile:hover{background:var(--surface-3)}
.tile svg{width:26px;height:26px;color:var(--accent-2)}

/* ============ full panels ============ */
.panel{position:absolute;z-index:9;inset:0;background:var(--surface);display:flex;flex-direction:column;animation:fade .22s var(--ease);overflow:hidden}
@keyframes fade{from{opacity:0;transform:translateY(10px)}}
.panel.dim{background:rgba(11,18,32,.96);backdrop-filter:blur(10px)}
.panel-head{display:flex;align-items:center;gap:6px;padding:calc(10px + var(--safe-top)) 10px 10px}
.panel-head h2{font-size:20px;font-weight:800;margin:0;letter-spacing:-.3px}
.panel-head.center{justify-content:center;position:relative;padding-top:calc(22px + var(--safe-top))}
.panel-head.center .icon-btn{position:absolute;right:14px}
.panel-body{flex:1;overflow:auto;padding:4px 16px 28px}
.panel-body h3{font-size:12px;color:var(--faint);font-weight:700;letter-spacing:.8px;text-transform:uppercase;margin:22px 6px 8px}
.group{background:var(--surface-2);border-radius:var(--r-lg);overflow:hidden}
.group>.card{background:transparent;border-radius:0;margin:0;border-top:1px solid var(--line)}
.group>.card:first-child{border-top:0}
.card{width:100%;display:flex;align-items:center;gap:14px;background:var(--surface-2);border-radius:var(--r-lg);padding:14px 16px;margin-bottom:10px;text-align:left;cursor:pointer;transition:background .15s}
.card:hover{background:var(--surface-3)}
.card>svg:first-child{color:var(--accent-2)}
.card>div{flex:1;min-width:0}
.card b{display:block;font-weight:600}
.card small{display:block;color:var(--muted);font-size:12.5px;margin-top:2px}
.card .chev{color:var(--faint);width:18px;height:18px}
.card.col{flex-direction:column;align-items:stretch;cursor:default}
.card.col:hover{background:transparent}
.card-row{display:flex;gap:14px;align-items:center}
.card-row svg{color:var(--accent-2)}
.card select,.veh-type select{background:var(--surface-3);border:1px solid var(--line-2);border-radius:var(--r-sm);padding:8px 10px;max-width:150px;outline:none}
.card.install{background:linear-gradient(135deg,#2563eb,#1d4ed8);margin-top:8px}
.card.install>svg:first-child{color:#fff}
.card.install small{color:#dbeafe}
.toggles{display:flex;flex-direction:column;padding-left:36px;margin-top:6px}
.tg{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;cursor:pointer}
.toggles .tg+.tg{border-top:1px solid var(--line)}
.tg input{position:absolute;opacity:0;pointer-events:none}
.tg i{width:44px;height:26px;border-radius:13px;background:#334155;position:relative;transition:background .2s;flex:none}
.tg i::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#cbd5e1;transition:left .2s var(--ease),background .2s;box-shadow:0 1px 3px rgba(0,0,0,.4)}
.tg input:checked+i{background:var(--accent)}
.tg input:checked+i::after{left:21px;background:#fff}
.tg input:focus-visible+i{outline:2px solid var(--accent-2);outline-offset:2px}

/* ============ search ============ */
.search-head{display:flex;align-items:center;gap:6px;padding:calc(10px + var(--safe-top)) 10px 10px}
.search-input{flex:1;display:flex;align-items:center;gap:10px;background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:0 16px}
.search-input:focus-within{border-color:var(--accent)}
.search-input svg{color:var(--muted);width:20px;height:20px}
.search-input input{flex:1;background:transparent;border:0;padding:13px 0;font-size:16px;outline:none;min-width:0}
.list{list-style:none;margin:0;padding:0 8px;overflow:auto;flex:1}
.list li{display:flex;gap:14px;align-items:center;padding:12px 10px;border-radius:var(--r);cursor:pointer}
.list li:hover{background:var(--surface-2)}
.list li .ic{width:38px;height:38px;border-radius:12px;background:var(--surface-2);display:grid;place-items:center;flex:none}
.list li .ic svg{color:var(--muted);width:20px;height:20px}
.list li b{display:block;font-weight:600}
.list li small{color:var(--muted);font-size:13px}

/* ============ vehicle ============ */
#vehTabs{display:flex;gap:8px;padding:4px 16px 0}
.vtab{flex:1;padding:10px 4px;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:12px;font-weight:600;color:var(--muted);border-radius:var(--r);background:var(--surface-2);border:1.5px solid transparent;position:relative}
.vtab.sel{color:var(--text);border-color:var(--accent);background:rgba(59,130,246,.14)}
.vtab .chk{position:absolute;top:6px;right:8px;width:16px;height:16px;border-radius:50%;background:#334155;display:grid;place-items:center}
.vtab.sel .chk{background:var(--green)}
.vtab .chk svg{width:10px;height:10px;stroke-width:3.5}
.veh-type{display:flex;align-items:center;gap:14px;background:linear-gradient(135deg,#2563eb,#1d4ed8);margin:14px 0;border-radius:var(--r-lg);padding:14px 16px;cursor:pointer}
.veh-type svg{width:32px;height:32px}
.veh-type div{flex:1}
.veh-type small{display:block;font-size:12px;opacity:.85}
.veh-type select{width:100%;max-width:none;background:transparent;border:0;font-weight:700;font-size:16px;padding:2px 0}
.veh-type select option,.card select option,.veh-row select option{background:var(--surface)}
.veh-row{display:flex;align-items:center;gap:14px;padding:12px 16px;border-top:1px solid var(--line)}
.veh-row:first-child{border-top:0}
.veh-row .lbl{flex:1;font-weight:500}
.veh-row .lbl small{display:block;color:var(--muted);font-size:12px;font-weight:400}
.veh-row.name div{flex:1}
.veh-row input,.veh-row select{background:var(--surface-3);border:1px solid transparent;border-radius:var(--r-sm);text-align:right;font-weight:700;width:84px;padding:7px 9px;outline:none;font-variant-numeric:tabular-nums}
.veh-row input:focus{border-color:var(--accent)}
.veh-row.name input{text-align:left;width:100%;font-weight:600;background:transparent;padding:4px 0;font-size:16px}
.veh-row select{width:auto;max-width:150px;text-align:left}
.veh-row .unit{color:var(--muted);font-size:13px;min-width:34px;white-space:nowrap}
.rsign{width:32px;height:32px;border-radius:50%;border:3px solid var(--red);background:#fff;color:#111;display:grid;place-items:center;font-size:10px;font-weight:900;flex:none}

/* ============ report ============ */
.report-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:22px 14px;padding:20px;max-width:440px;margin:auto;width:100%;align-content:center;flex:1}
.rep{display:flex;flex-direction:column;align-items:center;gap:10px;font-size:13px;font-weight:600;text-align:center}
.rep span.ic{width:100%;aspect-ratio:1;border-radius:28%;display:grid;place-items:center;font-size:44px;box-shadow:var(--shadow);transition:transform .15s var(--ease)}
.rep:active span.ic{transform:scale(.94)}

/* ============ modal ============ */
.modal-wrap{position:absolute;inset:0;z-index:40;background:rgba(2,6,23,.7);backdrop-filter:blur(6px);display:grid;place-items:center;padding:16px;animation:fade .2s var(--ease)}
.modal{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);padding:22px 0 20px;max-width:440px;width:100%;max-height:calc(100% - 32px);overflow:auto;box-shadow:var(--shadow)}
.modal-logo{width:56px;height:56px;border-radius:16px;display:block;margin:0 auto 10px}
.modal h2{text-align:center;margin:0 20px 14px;font-size:20px;font-weight:800}
.checklist{list-style:none;margin:0;padding:0 20px;display:flex;flex-direction:column;gap:12px}
.checklist li{background:var(--surface-2);border-radius:var(--r);padding:12px 14px;font-size:13.5px;color:var(--muted);line-height:1.5}
.checklist li b{display:block;color:var(--text);font-size:14px;margin-bottom:2px}

/* ============ ctx, toast, loading ============ */
#ctxMenu{position:absolute;z-index:12;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden;display:flex;flex-direction:column;min-width:170px}
#ctxMenu button{padding:13px 16px;text-align:left;font-weight:600}
#ctxMenu button+button{border-top:1px solid var(--line)}
#ctxMenu button:hover{background:var(--surface-3)}
#toast{position:absolute;z-index:50;left:50%;transform:translateX(-50%);bottom:calc(110px + var(--safe-bot));background:#f8fafc;color:#0f172a;padding:12px 18px;border-radius:var(--r);
  max-width:calc(100% - 32px);width:max-content;font-size:14px;font-weight:500;box-shadow:var(--shadow);text-align:center;animation:up .2s var(--ease)}
#loading{position:absolute;inset:0;z-index:15;display:grid;place-items:center;background:rgba(2,6,23,.2);pointer-events:none}
.spinner{width:44px;height:44px;border-radius:50%;border:4px solid rgba(255,255,255,.2);border-top-color:var(--accent-2);animation:spin .8s linear infinite}
.spinner.sm{width:18px;height:18px;border-width:3px}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ============ map markers ============ */
.me-marker{width:44px;height:44px;display:grid;place-items:center}
.me-marker .halo{position:absolute;width:38px;height:38px;border-radius:50%;background:#fff;box-shadow:0 0 0 8px rgba(59,130,246,.22),0 2px 6px rgba(0,0,0,.35)}
.me-marker svg{width:24px;height:24px;position:relative}
.flag-marker{width:34px;height:34px;border-radius:50%;background:#fff;box-shadow:var(--shadow);display:grid;place-items:center;border:2px solid #111}
.flag-marker svg{width:20px;height:20px;stroke:none}
.start-marker{width:18px;height:18px;border-radius:50%;background:var(--green);border:3px solid #fff;box-shadow:var(--shadow)}
.route-label{background:var(--accent);color:#fff;font-weight:700;font-size:13px;padding:5px 10px;border-radius:999px;box-shadow:var(--shadow);white-space:nowrap;cursor:pointer}
.route-label.alt{background:#fff;color:#334155;font-weight:600}
.rep-marker{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-size:18px;border:2px solid #fff;box-shadow:var(--shadow);cursor:pointer}
.maplibregl-popup-content{background:var(--surface-2);color:var(--text);border-radius:var(--r);padding:14px 16px;font-size:13px;box-shadow:var(--shadow);border:1px solid var(--line)}
.maplibregl-popup-tip{border-top-color:var(--surface-2)!important;border-bottom-color:var(--surface-2)!important}
.maplibregl-popup-close-button{color:var(--muted);font-size:20px;padding:2px 8px}
.pop{line-height:1.55}
.pop b{font-size:14px}
.pop .bad{color:#fca5a5;font-weight:700}
.pop .ok{color:#86efac;font-weight:700}
.pop .fine{margin:8px 0 0}
.pop button{margin-top:8px;color:#fca5a5;font-weight:600}

/* ===== Pro license ===== */
.btn.ghost{background:var(--surface-2);color:var(--text);box-shadow:none;border:1px solid var(--line-2);text-decoration:none}
.btn.ghost.danger{color:var(--red)}
.card.col label{display:block;cursor:default}
.lic-input{margin-top:10px;width:100%;background:var(--surface-3);border:1px solid var(--line-2);border-radius:var(--r-sm);padding:12px;font:600 15px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.02em;outline:none;color:var(--text)}
.lic-input:focus{border-color:var(--accent)}
.lic-status{margin:4px 16px 14px;padding:14px 16px;border-radius:var(--r-lg);background:var(--surface-2);border:1px solid var(--line);display:flex;gap:12px;align-items:center}
.lic-status::before{content:"";flex:none;width:10px;height:10px;border-radius:50%;background:var(--faint)}
.lic-status.ok::before{background:var(--green)} .lic-status.bad::before{background:var(--red)} .lic-status.warn::before{background:var(--amber)}
.lic-status b{display:block} .lic-status small{color:var(--muted);font-size:12.5px}

/* ===== Voice guidance ===== */
#btnVoice{display:none;left:12px;bottom:calc(160px + var(--safe-bot));color:var(--accent-2)}
body.nav #btnVoice{display:grid}
#btnVoice .mute{display:none}
#btnVoice.off{color:var(--muted)}
#btnVoice.off .on{display:none} #btnVoice.off .mute{display:block}
