:root{--bg:#0c0f0d;--panel:#151a16;--line:#2a322b;--text:#f1f3ef;--muted:#9da59e;--ok:#a8d5a5;--warn:#e2bd70;--bad:#e18a83}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:Inter,"Noto Sans SC",system-ui,-apple-system,sans-serif}.hidden{display:none!important}
.wrap{max-width:1120px;margin:auto;padding:26px 20px 44px}header{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:18px}h1{font-size:34px;margin:4px 0 5px;font-weight:650}header p{margin:0;color:var(--muted);font-size:14px}.eyebrow{font-size:11px;letter-spacing:.17em;color:var(--muted)}.pill{border:1px solid var(--line);border-radius:99px;padding:9px 12px;font-size:12px;white-space:nowrap}.pill.ok{color:var(--ok);border-color:#3c553e}.pill.warn{color:var(--warn);border-color:#594d31}.pill.bad{color:var(--bad);border-color:#593633}
.mapcard{position:relative;border:1px solid var(--line);border-radius:20px;overflow:hidden;background:var(--panel)}#map{height:520px;background:#111}.maphud{position:absolute;z-index:500;left:16px;bottom:16px;background:#101411e8;border:1px solid var(--line);border-radius:12px;padding:11px 13px;display:flex;flex-direction:column;gap:7px;font-size:13px;max-width:min(520px,calc(100% - 32px))}.hudrow{display:grid;grid-template-columns:42px 1fr;gap:8px;align-items:start}.hudlabel{color:var(--muted);font-size:11px;letter-spacing:.06em}.maphud b{font-size:13px;line-height:1.45;font-weight:600;word-break:break-word}.maphud #coords{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:11px;margin-top:11px}.card{background:var(--panel);border:1px solid var(--line);border-radius:15px;padding:16px}.card>span,.arrival span{display:block;color:var(--muted);font-size:11px;margin-bottom:8px}.card>b,.arrival b{display:block;font-size:20px;font-weight:600}.card small,.arrival small{display:block;color:var(--muted);font-size:11px;margin-top:6px}.lower{display:grid;grid-template-columns:1.45fr 1fr;gap:11px;margin-top:11px}.arrival{display:flex;justify-content:space-between;align-items:center;gap:16px}.card p{color:var(--muted);font-size:12px;line-height:1.65;margin:0}button{border:0;border-radius:11px;padding:12px 15px;background:#e3e9e0;color:#152015;font-weight:650;cursor:pointer}
footer{text-align:center;color:#697169;font-size:10px;margin-top:22px}.login{position:fixed;inset:0;display:grid;place-items:center;padding:20px;background:var(--bg)}.loginbox{width:min(390px,100%);border:1px solid var(--line);border-radius:18px;padding:25px;background:var(--panel)}.loginbox h1{font-size:29px}.loginbox p{color:var(--muted);font-size:13px}.loginbox input{width:100%;margin:13px 0 10px;padding:13px;border-radius:10px;border:1px solid var(--line);background:#0e120f;color:var(--text);outline:none}.loginbox button{width:100%}#loginErr{min-height:18px;color:var(--bad);font-size:11px;margin-top:8px}
.leaflet-control-attribution{font-size:9px!important}
@media(max-width:760px){.wrap{padding:18px 12px 32px}header{align-items:flex-start}h1{font-size:27px}.mapcard,#map{height:52vh;min-height:380px}.stats{grid-template-columns:1fr 1fr}.lower{grid-template-columns:1fr}.arrival{align-items:flex-start;flex-direction:column}.arrival button{width:100%}}
.weather{margin-top:11px}.weatherHead{display:flex;justify-content:space-between;align-items:flex-start;gap:15px}.weatherHead span,.weatherGrid span{display:block;color:var(--muted);font-size:11px;margin-bottom:6px}.weatherHead b{font-size:22px}.weatherGrid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-top:15px;padding-top:14px;border-top:1px solid var(--line)}.weatherGrid b{font-size:14px;font-weight:600}.weatherAlert{max-width:440px;border:1px solid #594d31;color:var(--warn);border-radius:10px;padding:8px 10px;font-size:11px;line-height:1.5}.weather>small{display:block;color:var(--muted);font-size:10px;margin-top:13px}
@media(max-width:760px){.weatherGrid{grid-template-columns:1fr 1fr 1fr}.weatherHead{flex-direction:column}.weatherAlert{max-width:none;width:100%}}

/* V2.7.4c SOS emergency presentation */
.sos-wrap{margin:0 0 18px}
.sos-wrap.hidden{display:none!important}
.sos-global{position:sticky;top:0;z-index:1200;display:flex;align-items:center;gap:12px;padding:11px 16px;border-radius:10px 10px 0 0;background:#9f1717;color:#fff;font-weight:800;letter-spacing:.04em;box-shadow:0 6px 20px rgba(0,0,0,.28)}
.sos-global-icon{display:inline-flex;align-items:center;justify-content:center;min-width:48px;height:28px;padding:0 8px;border:1px solid rgba(255,255,255,.72);border-radius:7px;font-size:13px}
.sos-card{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 24px;border:1px solid #d84040;border-top:0;border-radius:0 0 14px 14px;background:#651414;color:#fff;box-shadow:0 10px 28px rgba(0,0,0,.22)}
.sos-card-main{display:flex;align-items:center;gap:18px}
.sos-symbol{display:flex;align-items:center;justify-content:center;flex:0 0 48px;width:48px;height:48px;border-radius:50%;background:#fff;color:#8d1717;font-size:30px;font-weight:900}
.sos-title{font-size:22px;font-weight:850;line-height:1.2}
.sos-message{margin-top:7px;font-size:15px;color:#fff;opacity:.96}
.sos-coords{margin-top:5px;font-size:13px;color:#fff;opacity:.75}
.sos-clear{flex:0 0 auto;border:1px solid rgba(255,255,255,.65);background:transparent;color:#fff;border-radius:9px;padding:10px 14px;font-weight:700;cursor:pointer}
.sos-clear:hover{background:rgba(255,255,255,.12)}
@media(max-width:700px){.sos-card{align-items:flex-start;flex-direction:column;padding:18px}.sos-symbol{width:42px;height:42px;flex-basis:42px}.sos-title{font-size:19px}.sos-clear{width:100%}}

/* V2.8.7 ride metrics */
.ride-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:11px;margin-top:11px}
@media(max-width:760px){
  .ride-metrics{grid-template-columns:1fr 1fr}
  .ride-metrics .card:last-child{grid-column:1/-1}
}

/* V2.8.8 history controls */
.historybar{margin-bottom:11px;padding:13px 15px}
.historyTop{display:flex;align-items:center;justify-content:space-between;gap:14px}
.historyTop>div:first-child>span{display:block;color:var(--muted);font-size:10px;margin-bottom:4px}
.historyTop>div:first-child>b{font-size:16px}
.historyControls{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.historyControls .mini,.historyControls input{height:34px;border:1px solid var(--line);border-radius:9px;background:#0f1410;color:var(--text);padding:0 10px;font-size:11px}
.historyControls .mini{cursor:pointer}
.historyControls .mini.active{background:#e3e9e0;color:#152015;border-color:#e3e9e0}
.historyControls input{color-scheme:dark}
.historySummary{margin-top:9px;padding-top:9px;border-top:1px solid var(--line);color:var(--muted);font-size:11px;line-height:1.55}
@media(max-width:760px){
 .historyTop{align-items:flex-start;flex-direction:column}
 .historyControls{justify-content:flex-start;width:100%}
 .historyControls input{flex:1;min-width:135px}
}

/* V2.8.10 dashboard polish */
.headerRight{display:flex;align-items:center;gap:18px}.nowBlock{border-left:1px solid var(--line);padding-left:18px;min-width:190px}.nowBlock b{display:block;font-size:14px}.nowBlock span{display:block;color:var(--muted);font-size:11px;margin-top:5px}.metric{display:flex;align-items:center;gap:14px}.metric>i{font-style:normal;color:#83d39a;font-size:23px;line-height:1;min-width:26px;text-align:center}.metric>div{min-width:0;flex:1}.metric span{display:block;color:var(--muted);font-size:11px;margin-bottom:8px}.metric b{display:block;font-size:20px;font-weight:600}.metric small{display:block;color:var(--muted);font-size:11px;margin-top:6px}.ride-metrics{grid-template-columns:repeat(5,1fr)}
@media(max-width:900px){.ride-metrics{grid-template-columns:repeat(3,1fr)}.headerRight{align-items:flex-end;flex-direction:column;gap:8px}.nowBlock{display:none}}
@media(max-width:760px){.ride-metrics{grid-template-columns:1fr 1fr}.ride-metrics .card:last-child{grid-column:auto}.metric>i{font-size:19px;min-width:20px}}


/* V2.8.11 — match approved dashboard visual */
.metric>i{display:grid;place-items:center;color:#82dc9a;min-width:34px;width:34px;height:34px}
.metric>i svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.stats .metric:nth-child(2)>i svg path:first-child{fill:currentColor;stroke:currentColor;opacity:.94}
.stats .metric:nth-child(2)>i svg path:last-child{stroke:#15351e;stroke-width:1.35}
.stats .metric:nth-child(3)>i svg path:last-child{fill:currentColor;stroke:none;opacity:.82}
.ride-metrics .metric:nth-child(-n+3)>i svg path:first-child{fill:currentColor;stroke:currentColor;opacity:.9}
.ride-metrics .metric:nth-child(-n+3)>i svg path:last-child{stroke:#17331f;stroke-width:1.4}
.arrivalMain{display:flex;align-items:center;gap:16px;min-width:0}
.arrivalCheck{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border-radius:50%;background:#94e37f;color:#102313;box-shadow:0 0 0 7px rgba(104,211,130,.06)}
.arrivalCheck svg{width:29px;height:29px;fill:none;stroke:currentColor;stroke-width:2.7;stroke-linecap:round;stroke-linejoin:round}
.arrival b{font-size:21px}
.weatherGrid>div{position:relative;padding-left:0}
#rain{white-space:nowrap}
@media(max-width:760px){
 .metric>i{width:28px;height:28px;min-width:28px}.metric>i svg{width:23px;height:23px}
 .arrivalMain{align-items:flex-start}.arrivalCheck{width:42px;height:42px;flex-basis:42px}.arrivalCheck svg{width:25px;height:25px}
}

/* V2.8.12 — weather SVG icon system */
.weatherNow{display:flex;align-items:center;gap:13px}.weatherIcon,.weatherItem>i{display:grid;place-items:center;color:#82d8c7;flex:0 0 auto}.weatherIcon{width:38px;height:38px}.weatherIcon svg{width:34px;height:34px}.weatherItem{display:flex;align-items:flex-start;gap:9px}.weatherItem>i{width:24px;height:24px;margin-top:1px}.weatherItem>i svg{width:22px;height:22px}.weatherIcon svg,.weatherItem>i svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weatherItem>div{min-width:0}.weatherItem span{margin-bottom:5px}.weatherIcon.sunny{color:#e6c85f}.weatherIcon.rainy{color:#79c9df}.weatherIcon.cloudy{color:#91cbd4}
@media(max-width:760px){.weatherItem{gap:7px}.weatherItem>i{width:20px;height:20px}.weatherItem>i svg{width:19px;height:19px}.weatherIcon{width:32px;height:32px}.weatherIcon svg{width:29px;height:29px}}


/* V2.8.13 — speed-colored route + compact map legend */
.speedLegend{background:#101411e8;border:1px solid var(--line);border-radius:10px;padding:8px 10px;color:var(--muted);font-size:9px;line-height:1.35;box-shadow:0 2px 12px rgba(0,0,0,.12)}
.speedLegend b{display:block;color:var(--text);font-size:9px;margin-bottom:5px;font-weight:650}.speedLegend span{display:flex;align-items:center;gap:5px;white-space:nowrap}.speedLegend i{display:inline-block;width:13px;height:3px;border-radius:99px}
@media(max-width:760px){.speedLegend{padding:6px 8px;font-size:8px}.speedLegend b{font-size:8px}.speedLegend i{width:11px}}

/* V2.8.14 — mobile-only responsive refinement. Desktop V2.8.13 remains unchanged. */
@media (max-width:760px){
  .wrap{padding:14px 12px 28px}
  header{flex-direction:column;align-items:stretch;gap:10px;margin-bottom:14px}
  header>div:first-child{min-width:0}
  h1{font-size:28px;line-height:1.15;margin:4px 0 6px}
  header p{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .eyebrow{font-size:9px}
  .headerRight{width:100%;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px}
  .headerRight .pill{padding:7px 10px;font-size:11px}
  .nowBlock{display:none}

  .historybar{padding:12px;margin-bottom:10px}
  .historyTop{gap:10px}
  .historyControls{display:grid;grid-template-columns:64px 64px minmax(0,1fr);gap:7px;width:100%}
  .historyControls .mini,.historyControls input{width:100%;min-width:0;height:38px;padding:0 8px;font-size:12px}
  #historyAll{grid-column:1/-1;width:max-content;min-width:92px}
  .historySummary{font-size:10px;margin-top:10px;padding-top:9px}

  .mapcard,#map{height:400px;min-height:400px}
  .mapcard{border-radius:16px}
  .maphud{left:10px;bottom:10px;max-width:calc(100% - 112px);padding:8px 10px;gap:4px;border-radius:10px}
  .hudrow{display:block}
  .hudlabel{display:none}
  .maphud b{display:block;font-size:11px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .maphud #coords{display:block;font-size:9px;margin-top:3px;white-space:nowrap}
  .speedLegend{margin:0 2px 2px 0!important;padding:6px 7px;font-size:7px;line-height:1.25}
  .speedLegend b{font-size:7px;margin-bottom:3px}.speedLegend i{width:9px;height:2px}

  .stats{gap:8px;margin-top:9px}
  .ride-metrics{gap:8px;margin-top:8px}
  .card{padding:12px;border-radius:13px}
  .metric{gap:9px;min-height:104px}
  .metric>i{width:25px;height:25px;min-width:25px}.metric>i svg{width:21px;height:21px}
  .metric span{font-size:10px;margin-bottom:5px}.metric b{font-size:18px;line-height:1.15}.metric small{font-size:9px;line-height:1.35;margin-top:5px}
  .stats .metric:nth-child(4) b{font-size:17px;word-break:normal}

  .weather{padding:13px;margin-top:9px}
  .weatherHead{gap:8px}.weatherNow{gap:9px}.weatherHead b{font-size:21px}
  .weatherGrid{grid-template-columns:1fr 1fr;column-gap:10px;row-gap:14px;margin-top:12px;padding-top:12px}
  .weatherItem{gap:7px}.weatherItem span{font-size:10px;margin-bottom:4px}.weatherGrid b{font-size:13px}
  .weather>small{font-size:9px;line-height:1.4;margin-top:11px}

  .lower{gap:8px;margin-top:9px}
  .arrival{padding:13px;gap:12px}
  .arrivalMain{align-items:center}.arrivalCheck{width:40px;height:40px;flex-basis:40px}.arrivalCheck svg{width:24px;height:24px}
  .arrival b{font-size:19px}.arrival span{font-size:10px;margin-bottom:5px}.arrival small{font-size:9px;margin-top:4px}
  .arrival button{padding:11px 12px;font-size:12px}
  footer{font-size:8px;line-height:1.5;margin-top:16px;padding:0 5px}
}

@media (max-width:390px){
  .wrap{padding-left:10px;padding-right:10px}
  .mapcard,#map{height:370px;min-height:370px}
  .historyControls{grid-template-columns:60px 60px minmax(0,1fr)}
  .stats,.ride-metrics{gap:7px}
  .card{padding:11px}
  .metric{gap:7px;min-height:100px}
  .metric b{font-size:17px}
  .weatherGrid{column-gap:6px}
}


/* V2.8.15 — mobile history controls: four controls in one row */
.datePickWrap{display:contents}.mobileDateLabel{display:none}
@media (max-width:760px){
  .historyControls{display:grid;grid-template-columns:58px 58px minmax(92px,1fr) 82px;gap:6px;align-items:center}
  .historyControls .mini{height:38px;padding:0 5px;font-size:11px;white-space:nowrap}
  #historyAll{grid-column:auto;width:100%;min-width:0}
  .datePickWrap{display:block;position:relative;width:100%;height:38px;border:1px solid var(--line);border-radius:9px;background:#0f1410;overflow:hidden}
  .mobileDateLabel{display:flex;position:absolute;inset:0;align-items:center;justify-content:center;color:var(--text);font-size:11px;pointer-events:none;white-space:nowrap}
  .datePickWrap #historyDate{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;color-scheme:dark}
}
@media (max-width:390px){
  .historyControls{grid-template-columns:52px 52px minmax(82px,1fr) 74px;gap:5px}
  .historyControls .mini,.mobileDateLabel{font-size:10px}
}

/* V2.8.17 — current-location marker parse/layer fix */
.current-location-icon{
  background:transparent!important;
  border:0!important;
  position:relative;
  overflow:visible!important;
  z-index:9999!important;
}
.current-location-icon .current-location-pulse{
  position:absolute;
  left:50%;top:50%;
  width:34px;height:34px;
  margin:-17px 0 0 -17px;
  border-radius:50%;
  background:rgba(65,210,166,.24);
  border:2px solid rgba(255,255,255,.55);
  animation:currentLocationPulse 2.2s ease-out infinite;
  box-sizing:border-box;
}
.current-location-icon .current-location-ring{
  position:absolute;
  left:50%;top:50%;
  width:22px;height:22px;
  margin:-11px 0 0 -11px;
  border-radius:50%;
  display:grid;
  place-items:center;
  box-sizing:border-box;
  background:#28c99a;
  border:4px solid #fff;
  box-shadow:0 0 0 3px rgba(16,112,85,.78),0 3px 10px rgba(0,0,0,.55);
}
.current-location-icon .current-location-dot{
  display:block;
  width:7px;height:7px;
  border-radius:50%;
  background:#fff;
}
@keyframes currentLocationPulse{
  0%{transform:scale(.65);opacity:.9}
  70%,100%{transform:scale(1.35);opacity:0}
}
@media(max-width:760px){
  .current-location-icon .current-location-pulse{width:40px;height:40px;margin:-20px 0 0 -20px}
  .current-location-icon .current-location-ring{width:26px;height:26px;margin:-13px 0 0 -13px}
  .current-location-icon .current-location-dot{width:8px;height:8px}
}
@media(prefers-reduced-motion:reduce){
  .current-location-icon .current-location-pulse{animation:none;opacity:.45}
}

/* V2.8.18 unified journey metrics */
.journey-metrics{display:grid;grid-template-columns:repeat(5,1fr);gap:11px;margin-top:11px}
.journey-metrics .metric>i svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:900px){.journey-metrics{grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.journey-metrics{grid-template-columns:1fr 1fr;gap:8px;margin-top:9px}.journey-metrics .metric{min-height:78px}.journey-metrics .metric>i{font-size:19px;min-width:20px}}
@media(max-width:390px){.journey-metrics{gap:7px}}


/* V2.8.19 — motion-state filter + journey totals */
.journey-total{margin-top:11px;padding:18px 20px;display:flex;align-items:center;gap:24px}
.journeyTotalHead{min-width:180px}.journeyTotalHead span{display:block;color:#82dc9a;font-size:10px;letter-spacing:.12em;margin-bottom:5px}.journeyTotalHead b{font-size:20px}
.journeyTotalGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;flex:1}.journeyTotalGrid>div{border-left:1px solid var(--line);padding-left:18px}.journeyTotalGrid span,.journeyTotalGrid small{display:block;color:var(--muted);font-size:10px}.journeyTotalGrid b{display:block;font-size:22px;margin:6px 0}.journeyTotalGrid small{line-height:1.35}
.arrivalCheck.state-not-started{background:#263029;color:#9aa69d;box-shadow:none}.arrivalCheck.state-riding{background:#7fdc99;color:#102313}.arrivalCheck.state-paused{background:#c7a95f;color:#211b0e}.arrivalCheck.state-arrived{background:#94e37f;color:#102313}
@media(max-width:760px){.journey-total{margin-top:9px;padding:13px;display:block}.journeyTotalHead{min-width:0;margin-bottom:12px}.journeyTotalHead b{font-size:18px}.journeyTotalGrid{grid-template-columns:1fr 1fr 1fr;gap:7px}.journeyTotalGrid>div{padding-left:9px}.journeyTotalGrid>div:first-child{border-left:0;padding-left:0}.journeyTotalGrid b{font-size:16px}.journeyTotalGrid span,.journeyTotalGrid small{font-size:8px}}
