/* Waypoint phone app (4.19.0). Own screens, laid out like the approved prototype. Only shown at phone width. */
#m-app{display:none}
@media(max-width:760px){
  /* The web app stays rendered (but invisible and untouchable) behind the phone shell, so its forms,
     which are <dialog>s inside it, can still open on top. display:none made them open at 0x0 and block taps. */
  body.m-on:not(.m-embed) #app{position:fixed;left:0;top:0;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none}
  body.m-on:not(.m-embed) #app dialog,body.m-on:not(.m-embed) #app dialog *{visibility:visible;pointer-events:auto}
  body.m-on:not(.m-embed) #app dialog:not([open]){display:none}
  body.m-on:not(.m-embed) #app #toast{visibility:visible;bottom:calc(84px + env(safe-area-inset-bottom,0px));z-index:4500}
  body.m-on #m-app{display:flex;flex-direction:column;position:fixed;inset:0;z-index:20;background:var(--panel);color:var(--text);font-size:14px;line-height:1.4}
  body.m-on{overflow:hidden}
  body.m-on.m-embed #m-app{inset:0 0 auto 0;height:calc(48px + env(safe-area-inset-top,0px));z-index:3000;background:var(--panel)}
  body.m-on.m-embed #m-screen,body.m-on.m-embed #m-nav{display:none!important}
  body.m-on.m-embed #app{display:flex!important;flex-direction:column;position:fixed;inset:calc(48px + env(safe-area-inset-top,0px)) 0 0 0;z-index:2000;background:var(--bg);overflow:auto}
  body.m-on.m-embed #app .nav-rail,body.m-on.m-embed #app .topbar,body.m-on.m-embed #app .mobile-nav{display:none!important}
  body.m-on.m-embed #app .workspace{flex:1;min-height:0;overflow:auto}
  body.m-on.m-embed #app .conn-banner{display:none}
  #m-embedbar{display:flex;align-items:center;gap:10px;padding:8px 12px;padding-top:calc(8px + env(safe-area-inset-top,0px));border-bottom:1px solid var(--line);background:var(--panel)}
  #m-embedbar[hidden]{display:none}
  #m-embedbar button{display:flex;align-items:center;gap:4px;color:var(--brand);font-weight:700;background:none;border:0;font:inherit;padding:4px 6px}
  #m-embedbar svg{width:20px;height:20px}
  #m-embedbar b{font-size:16px}

  :where(#m-app *){box-sizing:border-box}
  :where(#m-app button){font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
  :where(#m-app svg){fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  #m-screen{flex:1;min-height:0;overflow:auto;position:relative;display:flex;flex-direction:column;padding-top:env(safe-area-inset-top,0px)}
  #m-screen>*{flex:none}
  #m-nav{display:grid;border-top:1px solid var(--line);background:var(--panel);padding-bottom:env(safe-area-inset-bottom,0px)}
  #m-nav button{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 0 9px;font-size:11px;color:var(--muted)}
  #m-nav button[aria-current="true"]{color:var(--brand);font-weight:700}
  #m-nav svg{width:24px;height:24px}
  .m-badge-dot{position:absolute;top:3px;left:calc(50% + 6px);min-width:16px;height:16px;border-radius:8px;background:#d6384a;color:#fff;font-size:10px;font-style:normal;font-weight:700;display:grid;place-items:center;padding:0 4px}

  .m-top{display:flex;align-items:center;gap:8px;padding:8px 14px 6px}
  .m-acct{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;text-align:left}
  .m-acct b{display:flex;align-items:center;gap:4px;font-size:17px;max-width:100%}
  .m-acct b span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .m-acct small{color:var(--muted);font-size:11.5px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .m-icon-btn{width:34px;height:34px;border-radius:50%;display:grid!important;place-items:center;color:var(--muted)!important;background:var(--elevated)!important;flex:none}
  .m-icon-btn svg{width:20px;height:20px}
  .m-icon-btn.spin svg{animation:m-sp .7s linear infinite}
  @keyframes m-sp{to{transform:rotate(360deg)}}
  .m-status{margin:0;padding:0 14px 6px;font-size:12px;color:var(--muted)}
  .m-status[hidden]{display:none}
  .m-mode{display:flex;flex:none;padding:3px;border-radius:10px;background:var(--elevated)}
  .m-mode button{padding:6px 11px;border-radius:8px;font-size:13px;font-weight:700;color:var(--muted)}
  .m-mode button[aria-selected="true"]{background:var(--panel)!important;color:var(--brand);box-shadow:0 1px 3px rgba(0,0,0,.18)}
  .m-status.bad{color:#d6384a}
  .m-seg{display:grid;grid-template-columns:1fr 1fr;margin:0 14px;border-bottom:1px solid var(--line)}
  .m-seg button{padding:10px 0;color:var(--muted);font-weight:600;border-bottom:2px solid transparent!important}
  .m-seg button[aria-selected="true"]{color:var(--brand);border-bottom-color:var(--brand)!important}
  .m-seg2{margin-top:6px}
  .m-search{display:flex;align-items:center;gap:8px;margin:10px 14px;padding:0 12px;height:42px;border-radius:12px;background:var(--elevated);color:var(--muted)}
  .m-search svg{width:18px;height:18px;flex:none}
  #m-app .m-search input{flex:1;min-width:0;border:0!important;box-shadow:none!important;background:none!important;color:var(--text);font:inherit;height:100%;outline:0!important;padding:0 4px;-webkit-appearance:none;appearance:none}
  .m-chips{display:flex;gap:6px;padding:0 14px;overflow-x:auto;scrollbar-width:none}
  .m-chips.wrap{padding:0;flex-wrap:wrap}
  .m-chip{flex:none;padding:8px 14px!important;border-radius:10px;background:var(--elevated)!important;color:var(--muted)!important;font-weight:700}
  .m-chip[aria-pressed="true"]{background:var(--brand)!important;color:#fff!important}
  .m-subcounts{display:flex;justify-content:space-between;padding:10px 18px 8px;color:var(--muted);font-size:12px}
  .m-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px}
  .m-dot.moving{background:#16a34a}.m-dot.parked,.m-dot.idle{background:#2563eb}.m-dot.offline{background:#94a3b8}
  .m-list{list-style:none;margin:0;padding:0}
  .m-veh,.m-row{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:11px 14px;border-top:1px solid var(--line)}
  .m-row{border-top:0;border-bottom:1px solid var(--line)}
  .m-grow{flex:1;min-width:0;display:flex;flex-direction:column}
  .m-grow b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}
  .m-grow small{color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .m-vi{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;color:#fff;flex:none;background:#94a3b8}
  .m-vi svg{width:55%;height:55%;stroke:#fff}
  .m-vi.moving{background:#16a34a}.m-vi.idle{background:#f59e0b}.m-vi.parked{background:#2563eb}.m-vi.offline{background:#94a3b8}
  .m-vst{display:flex;flex-direction:column;align-items:flex-end;gap:2px;color:var(--muted);font-size:12px;flex:none}
  .m-vst strong{font-size:13px;color:var(--text)}
  .m-vst strong.moving{color:#16a34a}.m-vst strong.parked{color:#2563eb}.m-vst strong.idle{color:#d97706}
  .m-pill{border:1px solid var(--line);border-radius:6px;padding:1px 7px;background:var(--elevated)}
  .m-empty{padding:30px 20px;text-align:center;color:var(--muted)}
  .m-empty b{display:block;color:var(--text);margin-bottom:4px}
  .m-muted{color:var(--muted)}
  .m-pad{padding:10px 14px}

  .m-mapslot{flex:1!important;min-height:300px;position:relative;margin-top:0}
  .m-focuschip{position:absolute;z-index:1100;top:8px;left:8px;width:fit-content;max-width:calc(100% - 80px);display:flex;align-items:center;gap:2px;padding:3px 3px 3px 12px;border-radius:999px;background:var(--panel);color:var(--text);font-size:13px;box-shadow:0 2px 10px rgba(0,0,0,.28)}
  .m-mapctl{position:absolute;z-index:1100;top:8px;right:8px;display:flex;flex-direction:column;gap:6px}
  .m-mapctl button{width:54px;padding:7px 0 5px;border-radius:12px;background:var(--panel)!important;color:var(--text)!important;box-shadow:0 2px 8px rgba(0,0,0,.28);display:flex!important;flex-direction:column;align-items:center;gap:2px;font-size:10px;font-weight:700}
  .m-mapctl button svg{width:21px;height:21px}
  .m-mapctl button.on{background:var(--brand)!important;color:#fff!important}
  .m-focuschip span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:4px}
  .m-focuschip button{flex:none;width:30px;height:30px;border-radius:50%;display:grid!important;place-items:center;background:var(--elevated)!important;color:var(--text)!important}
  .m-focuschip button svg{width:16px;height:16px}
  .m-rpslot{flex:1 1 0!important;min-height:200px;margin-top:0}
  .m-map{position:absolute;inset:0}
  .m-mk{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;transform:translate(-50%,-100%);width:max-content}
  .m-mk i{width:22px;height:22px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);border:2px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.35);background:#94a3b8}
  .m-mk i.moving{background:#16a34a}.m-mk i.parked,.m-mk i.idle{background:#2563eb}.m-mk i.idle{background:#f59e0b}
  .m-mk span{font-size:11px;font-weight:700;background:var(--panel);color:var(--text);padding:1px 6px;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.25);white-space:nowrap}
  .m-callout{margin:10px 14px;padding:10px 12px;border-radius:12px;background:var(--brand-soft);color:var(--text);font-size:13px}
  .m-callout.warn{background:rgba(245,158,11,.16)}
  .m-focus{display:flex;justify-content:space-between;align-items:center;gap:8px}
  .m-focus-btns{display:flex;gap:6px;flex:none}

  .m-hdr{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--panel);z-index:3}
  .m-hdr h2{margin:0;font-size:18px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .m-hdr-flat{position:static;border-bottom:0;padding-bottom:4px}
  .m-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line);margin:12px 14px;border:1px solid var(--line);border-radius:14px;overflow:hidden}
  .m-stats6{grid-template-columns:repeat(5,1fr)}
  .m-stats div{background:var(--panel);padding:10px 4px;text-align:center}
  .m-stats b{display:block;font-size:20px}
  .m-stats span{color:var(--muted);font-size:11px}
  .m-quick{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:0 14px 10px}
  .m-quick button{display:flex;flex-direction:column;align-items:center;gap:5px;padding:10px 2px;border-radius:12px;background:var(--elevated)!important;font-size:11.5px;font-weight:600;text-align:center}
  .m-quick svg{width:22px;height:22px;color:var(--brand)}
  .m-menu{margin:0 14px 10px;border:1px solid var(--line);border-radius:14px;overflow:hidden}
  .m-menu button{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:13px 14px;text-align:left}
  .m-menu button+button{border-top:1px solid var(--line)}
  .m-menu small{color:var(--muted)}
  .m-menu svg{flex:none;color:var(--muted)}
  .m-gap{margin-top:12px}
  .m-danger{color:#d6384a}
  .m-tabs{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--line);margin-top:4px}
  .m-manage-tabs{grid-template-columns:repeat(4,minmax(0,1fr))}.m-manage-tabs button{font-size:12px}
  .m-tabs.two{grid-template-columns:1fr 1fr}
  .m-tabs button{padding:10px 0;color:var(--muted);font-weight:600;border-bottom:2px solid transparent!important}
  .m-tabs button[aria-selected="true"]{color:var(--brand);border-bottom-color:var(--brand)!important}
  .m-av{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--brand-soft);color:var(--brand);font-weight:700;flex:none}
  .m-av svg{width:20px;height:20px}
  .m-av.big{width:54px;height:54px;font-size:20px}
  .m-row-plain{border:0;padding-top:0}
  .m-row-plain .m-av+span{display:flex;flex-direction:column}
  .m-row-plain small{color:var(--muted)}
  .m-badge{font-size:11px;padding:2px 8px;border-radius:999px;background:var(--elevated);color:var(--muted);white-space:nowrap;display:inline-block}
  .m-badge.ok{background:var(--brand-soft);color:var(--brand)}
  .m-right{display:flex;flex-direction:column;align-items:flex-end;gap:2px}
  .m-who{display:flex;gap:12px;align-items:center}
  .m-who b{font-size:17px}
  .m-btn{display:inline-flex!important;align-items:center;justify-content:center;gap:6px;padding:11px 16px;border-radius:10px;background:var(--brand)!important;color:#fff!important;font-weight:700}
  .m-btn.ghost{background:var(--elevated)!important;color:var(--text)!important}
  .m-btn.sm{padding:6px 10px;font-size:13px}
  .m-btn.wide{width:100%}
  .m-two{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .m-act{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:8px 14px 4px}
  .m-act2{grid-template-columns:repeat(3,1fr)}
  .m-service{width:100%;min-height:46px;border:1px solid var(--line-strong);border-radius:12px;background:var(--elevated);color:var(--text);font-weight:800;font-size:14px}
  .m-act4{grid-template-columns:repeat(4,1fr)}
  .m-act button{display:flex;flex-direction:column;align-items:center;gap:5px;padding:13px 4px;border-radius:12px;background:var(--elevated)!important;font-weight:600;font-size:12px}
  .m-act svg{width:22px;height:22px;color:var(--brand)}
  .m-act .danger,.m-act .danger svg{color:#d6384a}
  .m-sec{margin:16px 14px 6px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:700}
  .m-dl{margin:0 14px 10px;border:1px solid var(--line);border-radius:14px;overflow:hidden}
  .m-dl div{display:flex;justify-content:space-between;gap:12px;padding:10px 14px;border-top:1px solid var(--line)}
  .m-dl div:first-child{border-top:0}
  .m-dl dt{color:var(--muted);flex:none}
  .m-dl dd{margin:0;text-align:right;font-weight:600;min-width:0;overflow-wrap:anywhere}

  .m-tog{display:flex!important;align-items:center;justify-content:space-between;gap:12px;padding:11px 16px;width:100%;text-align:left}
  .m-tog small{color:var(--muted)}
  .m-sw{flex:none;width:44px;height:26px;border-radius:13px;background:var(--line-strong,#ccd7e5);position:relative;transition:background .15s}
  .m-sw::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .15s}
  .m-sw.on{background:var(--brand)}
  .m-sw.on::after{transform:translateX(18px)}
  .m-check{display:flex!important;align-items:center;gap:12px;width:100%;padding:11px 16px;border-bottom:1px solid var(--line);text-align:left}
  .m-check small{color:var(--muted)}
  .m-box{flex:none;width:22px;height:22px;border-radius:6px;border:2px solid var(--line-strong,#ccd7e5);display:grid;place-items:center}
  .m-box svg{width:14px;height:14px;stroke:#fff;opacity:0}
  .m-check[aria-checked="true"] .m-box{background:var(--brand);border-color:var(--brand)}
  .m-check[aria-checked="true"] .m-box svg{opacity:1}

  .m-ctl{padding:12px 14px;display:flex;flex-direction:column;gap:10px}
  .m-ctl select,.m-custom input,.m-bar select{height:42px;border-radius:10px;border:1px solid var(--line);background:var(--elevated);color:var(--text);font:inherit;padding:0 10px;width:100%}
  .m-custom{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:end}
  .m-custom label{display:flex;flex-direction:column;gap:3px}
  .m-custom small{color:var(--muted)}
  .m-custom .m-btn{grid-column:1/-1}
  .m-bar{display:flex;align-items:center;gap:10px}
  .m-bar input[type=range]{flex:1;min-width:0;accent-color:var(--brand)}
  .m-bar select{width:72px}
  .m-kv{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:0 14px 12px}
  .m-kv div{background:var(--elevated);border-radius:10px;padding:8px;text-align:center}
  .m-kv b{display:block}.m-kv span{font-size:11px;color:var(--muted)}
  .m-alarm{display:flex;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line)}
  .m-alarm i{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--elevated);color:#d6384a;font-style:normal;font-weight:800;flex:none}
  .m-alarm small{color:var(--muted)}
  .m-alarm.read{opacity:.6}
  .m-alarm-btns{display:flex;gap:8px;align-items:center;margin-top:8px}

  #m-layer .m-overlay{position:fixed;inset:0;background:rgba(8,14,28,.45);display:flex;align-items:flex-end;z-index:2500}
  .m-sheet{width:100%;max-height:84%;overflow:auto;background:var(--panel);border-radius:20px 20px 0 0;padding:6px 0 calc(18px + env(safe-area-inset-bottom,0px))}
  .m-grab{width:38px;height:4px;border-radius:2px;background:var(--line-strong,#ccd7e5);margin:6px auto 10px}
  .m-sheet h2{margin:0;padding:0 16px 8px;font-size:17px}
  .m-node{display:flex!important;align-items:center;gap:10px;width:100%;text-align:left;padding:10px 16px 10px calc(16px + var(--d,0)*20px)}
  .m-node[aria-current="true"]{background:var(--brand-soft)}
  .m-ic{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;background:var(--elevated);color:var(--muted);flex:none}
  .m-ic svg{width:18px;height:18px}
  .m-node em{font-style:normal;color:var(--muted);font-size:13px;flex:none}
  #m-toast{position:fixed;left:14px;right:14px;bottom:calc(76px + env(safe-area-inset-bottom,0px));background:var(--text);color:var(--panel);padding:11px 13px;border-radius:10px;z-index:4000;font-size:13px;opacity:0;pointer-events:none;transition:opacity .2s}
  #m-toast.show{opacity:1}
  /* The web app's own dialogs sit on top of the phone app: let them look like sheets. */
  body.m-on dialog{max-width:100vw}

  /* Choose account: full page, like the customer list in the iopgps app */
  .m-full{position:fixed;inset:0;background:var(--panel);z-index:2500;display:flex;flex-direction:column;padding-top:env(safe-area-inset-top,0px)}
  .m-fullbar{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;padding:10px 12px}
  .m-fullbar b{text-align:center;font-size:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .m-pk-list{flex:1;min-height:0;overflow:auto;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}
  .m-pk-row{display:flex;align-items:center;gap:6px;padding:2px 14px 2px calc(10px + var(--d,0)*22px);border-bottom:1px solid var(--line)}
  .m-pk-row[aria-current="true"] .m-grow b{color:var(--brand)}
  .m-pk-x{flex:none;width:28px;height:28px;border-radius:7px;display:grid;place-items:center;font-weight:800;font-size:18px;line-height:1}
  .m-pk-x.on{background:var(--brand)!important;color:#fff!important}
  .m-pk-main{flex:1;min-width:0;display:flex!important;align-items:center;gap:12px;padding:12px 0;text-align:left}
  .m-pk-main b{font-size:16px;font-weight:600}
  .m-pk-main b em{font-style:normal;color:var(--muted);font-weight:500}
  .m-pk-go{flex:none;color:var(--muted);width:22px;display:grid;place-items:center}
  .m-pk-row[aria-current="true"] .m-pk-go{color:var(--brand)}

  /* Replay events */
  .m-evs{margin:0 14px 16px;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--panel)}
  .m-ev{display:flex!important;align-items:center;gap:12px;width:100%;padding:11px 14px;text-align:left;border-bottom:1px solid var(--line)}
  .m-ev:last-child{border-bottom:0}
  .m-ev b{display:block;font-size:15px}
  .m-ev small{color:var(--muted);font-size:13px}
  .m-evi{flex:none;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-weight:800;font-size:14px;color:#fff;background:#e84c5b}
  .m-evi.parking{background:#5b6b80}.m-evi.longIdle{background:#f2a516}.m-evi.trip{background:#1267e8}

  /* Alarm settings fields */
  .m-fld{display:flex;flex-direction:column;gap:6px;padding:8px 16px;font-size:14px;color:var(--muted)}
  #m-app .m-fld input{height:44px;border:1px solid var(--line);border-radius:12px;padding:0 12px;font:inherit;font-size:16px;background:var(--panel);color:var(--text)}
  .m-hdr .m-btn.sm{margin-left:auto}

  /* 3D vehicle icons and the full vehicle card */
  .m-vi3{flex:none;display:grid;place-items:center}
  .m-vi3 img,.m-vi3 svg{width:100%;height:100%;object-fit:contain}
  .m-mk3{position:relative;width:44px;height:44px}
  .m-mk3 .veh-marker{width:44px;height:44px;display:grid;place-items:center}
  .m-mk3>span{position:absolute;left:50%;top:44px;transform:translateX(-50%);font-size:11px;font-weight:700;background:var(--panel);color:var(--text);padding:1px 6px;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.25);white-space:nowrap}
  .m-mk3 .marker-photo{width:42px;height:42px;border-radius:50%;border:3px solid;overflow:hidden;background:#fff}
  .m-mk3 .marker-photo img{width:100%;height:100%;object-fit:cover}
  .m-vsheet{max-height:86vh;overflow:auto}
  .m-vhead{display:flex;align-items:center;gap:12px;padding:6px 16px}
  .m-vhead h2{margin:0 0 4px;padding:0;font-size:20px}
  .m-vhead small{color:var(--muted)}
  .m-vglyph{flex:none;width:52px;height:52px;display:grid;place-items:center}
  .m-vglyph img{width:100%;height:100%;object-fit:contain}
  .m-vthumb{flex:none;width:52px;height:52px;border-radius:12px;object-fit:cover}
  .m-vpill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:700;background:#e8eef7;color:#475569}
  .m-vpill.moving{background:#dcfce7;color:#15803d}.m-vpill.idle{background:#fef3c7;color:#b45309}.m-vpill.parked{background:#dbeafe;color:#1d4ed8}
  .m-vsub{margin:6px 16px 10px;color:var(--muted);font-size:13px}
  .m-vstats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 16px 10px}
  .m-vstats>div{background:var(--elevated);border-radius:12px;padding:9px 6px;text-align:center}
  .m-vstats span{display:block;font-size:12px;color:var(--muted)}
  .m-vstats b{font-size:15px}
  .m-vlines{list-style:none;margin:0 16px 10px;padding:0;font-size:14px}
  .m-vlines li{display:flex;gap:10px;padding:6px 0;border-top:1px solid var(--line)}
  .m-vlines li i{font-style:normal;width:20px;text-align:center}
  .m-vlines li.warn{color:#b91c1c}

  /* Replay: big map, controls and events in a bottom sheet */
  #m-screen.m-fill{overflow:hidden}
  #m-screen.m-fill .m-ctl{padding:8px 14px;gap:8px}
  #m-screen.m-fill .m-hdr{padding:8px 14px}
  #m-rpbody{flex:none;max-height:56%;display:flex;flex-direction:column;min-height:0}
  .m-rp-sheet{background:var(--panel);border-top-left-radius:18px;border-top-right-radius:18px;box-shadow:0 -6px 20px rgba(0,0,0,.12);position:relative;z-index:2;margin-top:-14px;display:flex;flex-direction:column;min-height:0;max-height:100%}
  .m-rp-sheet.open{max-height:56vh}
  .m-rp-handle{display:grid!important;place-items:center;width:100%;min-height:30px;padding:12px 0 6px}
  .m-rp-handle i{width:52px;height:5px;border-radius:3px;background:var(--line-strong,#cbd5e1)}
  .m-rp-sum{display:flex!important;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:60px;padding:8px 10px 8px 16px;font-size:13px;color:var(--muted);border-top:1px solid var(--line);text-align:left}
  .m-rp-sum b{color:var(--text)}
  .m-rp-arrow{flex:none;width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:var(--brand);color:#fff;font-style:normal}
  .m-rp-arrow svg{width:26px;height:26px;transition:transform .18s}
  .m-rp-arrow.open svg{transform:rotate(180deg)}
  .m-rpinfo-row{display:flex;align-items:center;gap:10px}
  .m-rpinfo-row #m-rpinfo{flex:1;margin:0;min-width:0}
  .m-here{flex:none;display:inline-flex!important;align-items:center;gap:6px;min-height:44px;padding:0 14px;border-radius:22px;background:var(--elevated)!important;color:var(--brand)!important;font-weight:700;font-size:13px}
  .m-here svg{width:18px;height:18px}
  #m-rpcard{position:absolute;z-index:1150;left:10px;right:76px;top:8px;pointer-events:none}
  .m-evcard{pointer-events:auto;background:var(--panel);color:var(--text);border-radius:14px;box-shadow:0 4px 16px rgba(0,0,0,.3);padding:10px 12px 12px}
  .m-evc-top{display:flex;align-items:flex-start;gap:8px}
  .m-evc-top>span{flex:1;min-width:0}
  .m-evc-top b{display:block;font-size:15px}
  .m-evc-top small{display:block;color:var(--muted);font-size:12px}
  .m-evc-x{flex:none;width:44px;height:44px;margin:-6px -6px 0 0;display:grid!important;place-items:center;border-radius:50%}
  .m-evc-x svg{width:20px;height:20px}
  .m-evc-addr{margin:4px 0 0;font-size:14px;line-height:1.35}
  .m-evc-xy{margin:2px 0 0;font-size:11px;color:var(--muted)}
  .m-evc-act{display:flex;gap:8px;margin-top:10px}
  .m-evc-go,.m-evc-copy{flex:1;min-height:44px;display:inline-flex!important;align-items:center;justify-content:center;gap:6px;border-radius:10px;font-weight:700;font-size:14px;text-decoration:none}
  .m-evc-go{background:var(--brand)!important;color:#fff!important}
  .m-evc-copy{background:var(--elevated)!important;color:var(--text)!important}
  .m-rp-more{overflow:auto;min-height:0}
  .m-rp-more .m-evs{margin-bottom:12px}

  /* Compact vehicle bubble: sits above the bottom bar, leaves the map usable, closes with the cross or a tap on the map */
  #m-layer:has(.m-vcard){pointer-events:none}
  .m-vcard{pointer-events:auto;position:fixed;left:10px;right:10px;bottom:calc(66px + env(safe-area-inset-bottom,0px));z-index:2400;background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:0 8px 30px rgba(0,0,0,.28);padding:10px 12px 10px}
  .m-vcard .m-vhead{padding:0 34px 0 0;gap:10px}
  .m-vcard .m-vhead h2{font-size:17px;margin:0 0 2px;padding:0}
  .m-vcard .m-vglyph,.m-vcard .m-vthumb{width:40px;height:40px}
  .m-vx{position:absolute!important;top:6px;right:6px;width:32px;height:32px;border-radius:50%;background:var(--elevated)!important;color:var(--muted);font-size:15px;display:grid!important;place-items:center}
  .m-vline{margin:6px 0 0;font-size:13px;color:var(--muted)}
  .m-vline.addr{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .m-vact{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-top:8px}
  .m-vact>*{display:flex!important;flex-direction:column;align-items:center;gap:2px;padding:7px 2px;border-radius:10px;background:var(--elevated);font-size:11px;font-weight:700;color:var(--text);text-decoration:none}
  .m-vact svg{width:18px;height:18px}
  .m-vact6{grid-template-columns:repeat(6,1fr);gap:4px}
  .m-vact4{grid-template-columns:repeat(4,1fr)}
  .m-actn2{grid-template-columns:repeat(2,1fr)}
  .m-vact6>*{font-size:10px;padding:7px 0}
  .m-act4{grid-template-columns:repeat(4,1fr)}
}

  .m-subrow{display:flex;align-items:center;gap:8px;padding-right:12px}
  .m-subrow .m-check{flex:1;border-bottom:0}

/* 4.27.16: Follow button in the vehicle card */
.m-vfollow{float:right;margin:2px 0 6px 8px;padding:5px 12px;border-radius:999px;border:1px solid var(--line,#d6dbe3);background:var(--elevated);color:var(--muted);font-size:12px;font-weight:600}
.m-vfollow.on{background:var(--accent,#2563eb);border-color:transparent;color:#fff}
