/* Sentinel Tracking — dark-first operations console.
   Dark is the base theme; .st-light (set on the app root by MainLayout) overrides the tokens.
   Hexes mirror Theme/SentinelTheme.cs (MudBlazor palette) and js/sentinelMap.js (marker colours).
   Every text token is checked for 4.5:1 on the surfaces it is used on; --border-input for 3:1. */

.st-theme { min-height: 100%; --st-focus: #9db0ff; --st-danger-text: #f0a3a3; }
.st-theme.st-light { --st-focus: #1d4ed8; --st-danger-text: #b91c1c; }
/* Mud's error alert sets its text in the raw error colour, which is 4.15:1 on its own tint in dark. */
.st-theme .mud-alert-text-error, .st-theme .mud-alert-text-error .mud-alert-icon { color: var(--st-danger-text); }
.st-theme:fullscreen { background: #050712; overflow: auto; }
.st-theme.st-light:fullscreen { background: #f1f5f9; }

/* MudBlazor removes the browser focus outline and leaves almost nothing in its place. Every Mud
   control — in pages, dialogs and menus alike — gets one visible keyboard ring. */
.st-theme .mud-button-root:focus-visible,
.st-theme .mud-chip:focus-visible,
.st-theme .mud-tab:focus-visible,
.st-theme .mud-list-item:focus-visible,
.st-theme .mud-menu-item:focus-visible,
.st-theme .mud-switch-base:focus-visible,
.st-theme .mud-picker-calendar-day:focus-visible { outline: 2px solid var(--st-focus); outline-offset: 2px; }

.st-shell {
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #050712;
  --surface: #0b0f1a;
  --surface-2: #111623;
  --surface-hover: #151b2b;
  --border: #232a3a;            /* dividers and card edges (decorative) */
  --border-strong: #3a4254;
  --border-input: #646d82;      /* field boundaries: 3.5:1 on --surface-2 */
  --text: #e5e9f2;
  --text-muted: #a5aec3;
  --text-low: #8791a8;          /* 5.7:1 on --surface-2 */
  --accent: #4867ff;            /* fills; white text on it is 4.5:1 */
  --accent-hover: #5b7aff;
  --accent-weak: #18203a;
  --accent-text: #9db0ff;       /* accent-coloured text on --accent-weak: 7.7:1 */
  --focus: var(--st-focus, #9db0ff);
  --moving: #37c27d;   --moving-tint: rgba(55,194,125,.14);   --moving-text: #37c27d;
  --stopped: #d1a23c;  --stopped-tint: rgba(209,162,60,.14);  --stopped-text: #d1a23c;
  --offline: #7a8498;  --offline-tint: rgba(122,132,152,.12);
  --danger-tint: rgba(224,82,82,.12); --danger-border: rgba(224,82,82,.45); --danger-text: #f0a3a3;
  --glow: 0 0 0 1px var(--border), 0 8px 30px rgba(0,0,0,.45);
  --ease: cubic-bezier(.18,.72,.24,1);
  --ease-lg: cubic-bezier(.16,.85,.35,1);

  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  height: 100dvh;              /* the console owns the full viewport — no template chrome */
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* never let wide content push the shell past the viewport */
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.st-light .st-shell {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e4e9f0;
  --border-strong: #cbd5e1;
  --border-input: #7c8aa0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-low: #5b6b82;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-weak: #eff6ff;
  --accent-text: #1d4ed8;
  --moving: #16a34a; --moving-tint: rgba(22,163,74,.10);  --moving-text: #166534;
  --stopped: #d97706; --stopped-tint: rgba(217,119,6,.10); --stopped-text: #92400e;
  --offline: #64748b; --offline-tint: rgba(100,116,139,.10);
  --danger-tint: rgba(185,28,28,.08); --danger-border: rgba(185,28,28,.4); --danger-text: #b91c1c;
  --glow: 0 1px 2px rgba(15,23,42,.06), 0 10px 30px rgba(15,23,42,.08);
}

.st-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ── Top bar ── */
.st-top { display: flex; align-items: center; gap: 12px; padding: 8px 18px; min-width: 0;
  background: var(--surface); border-bottom: 1px solid var(--border); z-index: 500; }
.st-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; letter-spacing: .012em;
  white-space: nowrap; }
.st-brand .st-mark { width: 24px; height: 24px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, var(--accent), #2438b8); box-shadow: 0 0 14px rgba(72,103,255,.5); }
.st-brand-sub { color: var(--text-low); font-weight: 500; }
.st-live { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--text-muted);
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.st-live .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--moving); }
.st-top .spacer { flex: 1; min-width: 0; }
.st-tools { display: flex; align-items: center; gap: 2px; }
.st-user { font-size: .8rem; color: var(--text-muted); max-width: 160px; margin: 0 4px 0 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-narrow { display: none; }

/* ── Top-bar navigation ── */
.st-nav { display: flex; gap: 4px; margin-left: 10px; }
.st-nav a { padding: 7px 14px; border-radius: 9px; color: var(--text-muted); text-decoration: none;
  font-size: .84rem; font-weight: 600; white-space: nowrap; }
.st-nav a.active { background: var(--accent-weak); color: var(--accent-text); }

/* ── KPI strip ── */
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
  padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.st-kpi { position: relative; overflow: hidden; padding: 12px 15px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); }
.st-kpi::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(130% 120% at 0% 0%, var(--tint), transparent 62%); pointer-events: none; }
.st-kpi .kl { position: relative; display: flex; align-items: center; gap: 7px; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-low); font-weight: 600; }
.st-kpi .kl .d { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px var(--c); background: var(--c); flex: none; }
.st-kpi .kv { position: relative; font-size: 1.75rem; font-weight: 700; margin-top: 5px; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.st-kpi.total { --tint: var(--accent-weak); --c: var(--accent); }
.st-kpi.moving { --tint: var(--moving-tint); --c: var(--moving); }
.st-kpi.stopped { --tint: var(--stopped-tint); --c: var(--stopped); }
.st-kpi.offline { --tint: var(--offline-tint); --c: var(--offline); }

/* ── Body grid ── */
.st-body { display: grid; grid-template-columns: 328px minmax(0, 1fr); min-height: 0; position: relative; }
.st-body.collapsed { grid-template-columns: 0 minmax(0, 1fr); }

/* ── Sidebar ── */
.st-side { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface);
  border-right: 1px solid var(--border); overflow: hidden; }
.st-search { padding: 12px 13px 4px; }
.st-chips { padding: 0 9px 8px; }
.st-chips .n { font-variant-numeric: tabular-nums; margin-left: 5px; }
.st-alert { margin: 0 13px 10px; }
.st-alert .mud-button-root { margin-top: 8px; }

.st-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 14px; }
.st-row { display: flex; align-items: center; gap: 2px; margin: 2px 0; padding-right: 4px; border-radius: 10px; }
.st-row.sel { background: var(--accent-weak); box-shadow: inset 0 0 0 1px var(--accent); }
.st-row.hid .st-rowbtn { opacity: .55; }
.st-rowbtn { flex: 1; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 11px;
  padding: 9px 11px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit;
  text-align: start; cursor: pointer; }
.st-rowbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.st-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.st-dot.moving { background: var(--moving); box-shadow: 0 0 8px var(--moving); }
.st-dot.stopped { background: var(--stopped); box-shadow: 0 0 8px var(--stopped); }
.st-dot.offline { background: var(--offline); }
.st-rowmain { min-width: 0; display: block; }
.st-name { display: block; font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-meta { display: block; font-size: .76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; margin-top: 1px; }
/* Row tools stay out of the way until the row is hovered, focused or selected — and are always shown
   where there is no hover (touch), so they are never unreachable or focused while invisible. */
.st-rowact { display: flex; flex: none; opacity: 0; }
.st-row:focus-within .st-rowact, .st-row.sel .st-rowact { opacity: 1; }
@media (hover: none) { .st-rowact { opacity: 1; } }

/* ── Map ── */
.st-map { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.st-map .leaflet-container { height: 100%; width: 100%; background: var(--bg); font-family: var(--font); }
/* Leaflet puts its controls at z-index 1000, above the details panel and replay tray. Keep them under. */
.st-map .leaflet-top, .st-map .leaflet-bottom { z-index: 450; }
/* Esri's dark canvas sits lighter than the near-black shell; pull it down to match.
   Scoped to the tile pane so markers, routes and geofences keep their true colours. */
.st-map .leaflet-tile-pane { filter: brightness(.6) contrast(1.08); }
.st-light .st-map .leaflet-tile-pane { filter: none; }
.st-map .leaflet-control-attribution { background: rgba(5,7,18,.75); color: var(--text-muted); }
.st-map .leaflet-control-attribution a { color: var(--text); }
.st-light .st-map .leaflet-control-attribution { background: rgba(255,255,255,.85); }
.st-mapempty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 400; }
.st-mapempty div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 18px; color: var(--text-muted); font-size: .84rem; box-shadow: var(--glow); }

/* ── Detail drawer ── */
.st-drawer { position: absolute; top: 14px; right: 14px; bottom: 14px; width: 328px; z-index: 600;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--glow);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none; }
.st-drawer.open { transform: none; opacity: 1; pointer-events: auto; }
.st-dhead { padding: 13px 12px 13px 16px; border-bottom: 1px solid var(--border);
  background: radial-gradient(120% 100% at 100% 0%, var(--accent-weak), transparent 70%); }
.st-dtop { display: flex; align-items: flex-start; gap: 8px; }
.st-dheadmain { flex: 1; min-width: 0; }
.st-dtitle { margin: 0; font-weight: 700; font-size: 1.02rem; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.st-dsub { font-size: .75rem; color: var(--text-low); margin-top: 2px; overflow-wrap: anywhere; }
.st-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; margin-top: 2px; }
.st-badge.moving { background: var(--moving-tint); color: var(--moving-text); }
.st-badge.stopped { background: var(--stopped-tint); color: var(--stopped-text); }
.st-badge.offline { background: var(--offline-tint); color: var(--text-muted); }
.st-dbody { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 15px 16px; }
.st-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.st-card { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; min-width: 0; }
.st-card .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-low); font-weight: 600; }
.st-card .v { font-size: .98rem; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.st-card .v.sm { font-size: .82rem; }
.st-copy { margin-top: 8px; }
.st-sect { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-low);
  font-weight: 600; margin: 18px 0 9px; }
.st-events { display: flex; flex-direction: column; gap: 7px; }
.st-event { display: flex; align-items: center; gap: 9px; font-size: .8rem; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.st-event .tag { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.st-event .tag.enter { background: var(--accent-weak); color: var(--accent-text); }
.st-event .tag.exit { background: var(--surface-hover); color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--border-strong); }
.st-event .t { margin-left: auto; color: var(--text-low); font-size: .75rem; white-space: nowrap; }
.st-emptyline { font-size: .8rem; color: var(--text-low); padding: 6px 0; }
.st-dfoot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; }
.st-dfoot .mud-button-root { flex: 1 1 auto; }

/* ── Plain buttons and links (sign-in, not-found — pages rendered without interactivity) ── */
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 14px;
  font: inherit; font-size: .9rem; font-weight: 600; border-radius: 10px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.st-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(72,103,255,.35); }
.st-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.st-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Skeleton / empty ── */
.st-skel { padding: 9px 11px; display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: center; }
.st-skel .sk { background: var(--surface-hover); border-radius: 6px; }
.st-skel .d { width: 10px; height: 10px; border-radius: 50%; }
.st-skel .l1 { height: 10px; width: 62%; } .st-skel .l2 { height: 8px; width: 42%; margin-top: 6px; }
.st-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: .84rem; line-height: 1.5; }
.st-empty .mud-button-root { margin-top: 12px; }

/* ── Leaflet marker glyphs (mirrors sentinelMap.js) ── */
.veh-divicon { background: transparent; border: none; }
.veh-sel { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent), 0 0 14px 2px rgba(72,103,255,.7); border-radius: 50%; }
/* Cluster counts: markercluster's default is dark text on translucent green, unreadable on the dark map. */
.st-map .marker-cluster { background: rgba(72,103,255,.35); }
.st-map .marker-cluster div { background: var(--accent); color: #fff; font: 700 .75rem var(--font); }

/* ── Reports / Users pages ── */
.st-shell.rpt { grid-template-rows: auto minmax(0, 1fr); }
.st-content { overflow-y: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rpt-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.rpt-vehicle { flex: 1 1 230px; max-width: 340px; min-width: 0; }
.rpt-date { flex: 0 1 170px; min-width: 140px; }
.rpt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
.rpt-tabs { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rpt-tabs .mud-tabs-panels { padding: 0 4px 8px; }
.rpt-table { background: transparent; }
.rpt-empty { padding: 26px; text-align: center; color: var(--text-muted); font-size: .86rem; line-height: 1.5;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.rpt-tabs .rpt-empty { border: 0; border-radius: 0; }
.rpt-hint { font-size: .8rem; color: var(--text-muted); }

/* ── Map floating tools + draw panel ── */
.st-maptools { position: absolute; top: 14px; left: 56px; z-index: 550; display: flex; gap: 8px; }
.st-drawpanel { position: absolute; top: 14px; left: 56px; z-index: 560; width: min(270px, calc(100% - 70px)); padding: 14px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); box-shadow: var(--glow); }
.st-drawpanel h2 { margin: 0 0 4px; font-size: .92rem; font-weight: 650; }
.st-drawpanel p { margin: 0 0 12px; font-size: .8rem; line-height: 1.45; color: var(--text-muted); }
.st-drawpanel .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ── Bottom replay tray ── */
.st-tray { position: absolute; left: 14px; right: 356px; bottom: 14px; z-index: 540; padding: 12px 15px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); box-shadow: var(--glow);
  transform: translateY(calc(100% + 26px)); opacity: 0; }
.st-tray.open { transform: none; opacity: 1; }
.st-tray-head { display: flex; align-items: center; gap: 10px; }
.st-tray-title { flex: 1; min-width: 0; margin: 0; font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.st-tray-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.st-tray-date { flex: 0 1 165px; min-width: 140px; }
.st-tray-body { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.st-scrub { flex: 1; min-width: 0; accent-color: var(--accent); height: 24px; }
.st-scrub:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.st-tray-stat { font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ── Sign-in, not-found, access denied ── */
.st-shell.st-login { display: grid; grid-template-rows: 1fr; place-items: center; padding: 24px; overflow-y: auto; }
.st-login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 8px; padding: 28px 26px 26px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--glow); }
.st-login-card h1 { font-size: 1.3rem; font-weight: 650; margin: 14px 0 6px; }
.st-login-card label { font-size: .8rem; color: var(--text-muted); margin-top: 8px; }
/* 1rem: iOS zooms the page when a focused field is under 16px */
.st-login-card input[type=text], .st-login-card input[type=password] { height: 44px; padding: 0 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border-input); color: var(--text); font: inherit; font-size: 1rem; }
.st-login-card input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.st-login-card .st-btn { margin-top: 18px; min-height: 44px; }
.st-login-error { padding: 10px 12px; border-radius: 10px; font-size: .86rem; line-height: 1.45;
  background: var(--danger-tint); border: 1px solid var(--danger-border); color: var(--danger-text); }
.st-notfound-text { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--text-muted); }
.st-denied { padding: 48px 24px; text-align: center; color: #a5aec3; font-family: "Segoe UI", system-ui, sans-serif; }
.st-denied a { color: #9db0ff; }

/* ── Hover: only where a pointer can actually hover, so nothing latches after a tap ── */
@media (hover: hover) {
  .st-nav a:hover { background: var(--surface-hover); color: var(--text); }
  .st-rowbtn:hover { background: var(--surface-hover); }
  .st-row.sel .st-rowbtn:hover { background: none; }
  .st-row:hover .st-rowact { opacity: 1; }
  .st-btn:hover { background: var(--surface-hover); }
  .st-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
}

/* ── Motion: opt-in. Each rule names the properties it animates. ── */
@media (prefers-reduced-motion: no-preference) {
  .st-live .pulse { animation: st-pulse 1.9s infinite; }
  .st-skel .sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 37%, var(--surface-2) 63%);
    background-size: 400% 100%; animation: st-sh 1.4s infinite; }
  .st-body { transition: grid-template-columns .24s var(--ease-lg), grid-template-rows .24s var(--ease-lg); }
  .st-drawer, .st-tray { transition: transform .26s var(--ease-lg), opacity .26s var(--ease-lg); }
  .st-nav a, .st-rowbtn, .st-btn { transition: background-color .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease); }
  .st-rowact { transition: opacity .14s var(--ease); }
}
/* Reduced motion keeps a short cross-fade so panels do not pop. */
@media (prefers-reduced-motion: reduce) {
  .st-drawer, .st-tray { transition: opacity .15s linear; }
}
@keyframes st-pulse { 0%{box-shadow:0 0 0 0 rgba(55,194,125,.55)} 70%{box-shadow:0 0 0 7px rgba(55,194,125,0)} 100%{box-shadow:0 0 0 0 rgba(55,194,125,0)} }
@keyframes st-sh { 0%{background-position:100% 0} 100%{background-position:0 0} }

/* ── Narrow viewports: one menu instead of a row of tools; list stacked above the map ── */
@media (max-width: 760px) {
  .st-wide { display: none; }
  .st-narrow { display: block; }
  .st-top { padding: 6px 10px; gap: 8px; }
  .st-brand-sub { display: none; }
  .st-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 8px 10px; }
  .st-kpi { padding: 8px 9px; border-radius: 10px; }
  .st-kpi .kl { font-size: .75rem; letter-spacing: 0; gap: 5px; text-transform: none; }
  .st-kpi .kl .d { width: 6px; height: 6px; }
  .st-kpi .kv { font-size: 1.25rem; }
  .st-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(150px, 38%) minmax(0, 1fr); }
  .st-body.collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: 0 minmax(0, 1fr); }
  .st-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .st-drawer { top: 8px; right: 8px; bottom: 8px; width: min(328px, calc(100% - 16px)); }
  .st-tray { left: 8px; right: 8px; bottom: 8px; }
  /* No room for both overlays: while the replay tray is open it takes the place of the details panel. */
  .st-map:has(.st-tray.open) .st-drawer { display: none; }
  .st-content { padding: 12px 10px 20px; }
  .rpt-vehicle { max-width: none; }
  .rpt-date { flex: 1 1 170px; min-width: 170px; }   /* wide enough for a full date; wraps instead of clipping it */
}
