/* ==========================================================================
   Theme tokens.
   theme.js always resolves the active theme to an explicit data-theme on
   <html> (following the OS when the user has picked "auto"), so the dark
   palette lives in exactly one place below.
   ========================================================================== */
:root {
  --gs-accent: #00A9DF;
  --gs-accent-2: #0090C0;
  --gs-accent-bg: #EFF8FD;
  --gs-on-accent: #FFFFFF;

  --gs-surface: #FFFFFF;
  --gs-surface-2: #FAFAFA;
  --gs-surface-3: #F7F7F7;
  --gs-surface-4: #F0F0F0;
  --gs-surface-5: #EDEDED;

  --gs-border: #F0F0F0;
  --gs-border-2: #E0E0E0;
  --gs-border-3: #D1D5DB;
  --gs-border-4: #B8B8B8;

  --gs-text: #222222;
  --gs-text-2: #444444;
  --gs-text-3: #505050;
  --gs-text-4: #909090;
  --gs-text-disabled: #B8B8B8;

  --gs-ok-bg: #E8F8EE;
  --gs-ok-fg: #1A7A3B;
  --gs-warn-bg: #FFF3CD;
  --gs-warn-fg: #856404;
  --gs-danger-bg: #FEF0F0;
  --gs-danger-fg: #C0392B;

  --gs-shadow: rgba(0, 0, 0, 0.15);
  --gs-scrim: rgba(0, 0, 0, 0.45);
  --gs-map-filter: none;
  color-scheme: light;
}

/* The login screen is always dark, whatever theme the account uses — it is branding, seen
   before any account (and its theme preference) is known. Sharing the selector keeps the
   dark values defined exactly once. */
:root[data-theme="dark"],
#login-screen {
  --gs-accent: #00A9DF;
  --gs-accent-2: #33BCE8;
  --gs-accent-bg: #102C3F;
  --gs-on-accent: #FFFFFF;

  --gs-surface: #162234;
  --gs-surface-2: #1B2A3E;
  --gs-surface-3: #1F3048;
  --gs-surface-4: #243650;
  --gs-surface-5: #2A3F5C;

  --gs-border: #223349;
  --gs-border-2: #2A3E58;
  --gs-border-3: #334A69;
  --gs-border-4: #3F5878;

  --gs-text: #E4F1FB;
  --gs-text-2: #D4E8F7;
  --gs-text-3: #A9C8DE;
  --gs-text-4: #7CA2BE;
  --gs-text-disabled: #5A7B96;

  --gs-ok-bg: #12301F;
  --gs-ok-fg: #5FD68C;
  --gs-warn-bg: #33280C;
  --gs-warn-fg: #F0C14B;
  --gs-danger-bg: #3A1A1A;
  --gs-danger-fg: #FF8A80;

  --gs-shadow: rgba(0, 0, 0, 0.5);
  --gs-scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Roboto, Arial, sans-serif;
  color: var(--gs-text);
  background: var(--gs-surface);
}

/* Map darkening is its own setting, independent of the interface theme (data-map-theme vs
   data-theme). The filter is scoped to the tile pane only, so markers, routes, zones and
   tooltips keep their real colours instead of being inverted along with the basemap. */
:root[data-map-theme="dark"] {
  --gs-map-filter: invert(1) hue-rotate(180deg) brightness(0.94) contrast(0.88) saturate(0.7);
}
.leaflet-tile-pane { filter: var(--gs-map-filter); }

/* Chrome that sits on the map (labels, popups, attribution) follows the MAP theme, not the
   interface one — otherwise a dark basemap keeps glowing white label pills. Literal colours
   rather than tokens, because the interface may legitimately be light at the same time.
   Dark-only overrides, so a light map keeps Leaflet's own styling untouched. */
:root[data-map-theme="dark"] .leaflet-tooltip,
:root[data-map-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-map-theme="dark"] .leaflet-popup-tip {
  background-color: #1B2A3E;
  border-color: #1B2A3E;
  color: #E4F1FB;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
:root[data-map-theme="dark"] .leaflet-tooltip-left::before { border-left-color: #1B2A3E; }
:root[data-map-theme="dark"] .leaflet-tooltip-right::before { border-right-color: #1B2A3E; }
:root[data-map-theme="dark"] .leaflet-tooltip-top::before { border-top-color: #1B2A3E; }
:root[data-map-theme="dark"] .leaflet-tooltip-bottom::before { border-bottom-color: #1B2A3E; }
:root[data-map-theme="dark"] .leaflet-control-attribution {
  background: rgba(22, 34, 52, 0.8);
  color: #A9C8DE;
}
:root[data-map-theme="dark"] .leaflet-control-attribution a { color: #7CA2BE; }

/* The login screen covers the viewport, but the canvas behind it still comes from body —
   match it so overscroll can't flash white when the account theme is light. */
body:has(#login-screen) { background: #162234; }

#login-screen {
  /* 100vh is WRONG on phones: it means the viewport with the address bar hidden, so while the bar is
     visible the element is taller than the screen and the sign-in button sits below the fold. dvh
     tracks the bar as it collapses and expands. vh first as the fallback for browsers without dvh. */
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gs-surface);
  /* Set explicitly so descendants inherit the dark-scoped text colour rather than body's. */
  color: var(--gs-text);
  position: relative;
}
.login-lang { position: absolute; top: 16px; right: 16px; }
.gs-lang-select { padding: 4px 8px; border: 1px solid var(--gs-border-4); border-radius: 4px; font-size: 11px; background: var(--gs-surface); color: var(--gs-text-2); }
.login-card {
  width: 320px;
  padding: 32px;
  text-align: center;
}
.login-logo { width: 64px; height: 64px; }
.login-title { color: var(--gs-accent); font-size: 19px; margin: 12px 0 24px; }
#login-form { display: flex; flex-direction: column; text-align: left; }
#login-form label { font-size: 11px; color: var(--gs-text-3); margin-top: 12px; }
#login-form input {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid var(--gs-border-4);
  border-radius: 4px;
  font-size: 13px;
  color: var(--gs-text-2);
  background: var(--gs-surface-3);
}
.login-error { color: var(--gs-danger-fg); font-size: 11px; margin-top: 12px; }
.login-ok { color: var(--gs-ok-fg); font-size: 11px; margin-top: 12px; line-height: 1.5; }
.login-hint { color: var(--gs-text-3); font-size: 11px; line-height: 1.5; margin-bottom: 4px; }
/* Secondary action under the button — deliberately quiet, so it reads as a way out rather than
   competing with Login for attention. */
.login-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  color: var(--gs-text-3);
  text-decoration: none;
}
.login-link:hover { color: var(--gs-accent); text-decoration: underline; }
.btn-primary {
  margin-top: 20px;
  padding: 10px;
  background: var(--gs-accent);
  color: var(--gs-on-accent);
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
.btn-primary:hover { opacity: 0.9; }

/* Same reason as #login-screen: on a phone 100vh exceeds the visible area whenever the address bar is
   showing, which pushed the bottom of the app off-screen and made the layout jump as the bar moved. */
#main-shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
#impersonate-banner {
  height: 34px;
  background: #E67E22;
  color: var(--gs-on-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 11px;
  flex-shrink: 0;
}
.ib-actions { display: flex; gap: 8px; align-items: center; }
.ib-btn {
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  white-space: nowrap;
}
.ib-btn:hover { background: rgba(255,255,255,0.28); }
.ib-btn-primary { background: rgba(0,0,0,0.25); font-weight: bold; }
.ib-btn-primary:hover { background: rgba(0,0,0,0.35); }
#nav-bar {
  height: 30px;
  background: #1a2a3a;
  color: #cfd8e3;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px;
  font-size: 11px;
  flex-shrink: 0;
  overflow-x: auto;         /* stat chips + impersonation label can exceed a narrow width — scroll, don't clip */
  scrollbar-width: none;    /* keep the 30px bar clean (Firefox) */
}
#nav-bar::-webkit-scrollbar { display: none; }  /* keep the 30px bar clean (Chromium/Safari) */
.nav-user { display: flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.nav-user:hover { color: var(--gs-on-accent); }
.nav-caret { font-size: 9px; opacity: 0.7; }
.nav-stat { display: flex; align-items: center; gap: 4px; white-space: nowrap; opacity: 0.9; }
.nav-stat-icon { font-size: 11px; }
.nav-stat-value { font-weight: bold; }
.nav-side { margin-left: auto; }
#nav-account { margin-left: 4px; }
.tb-brand {
  color: var(--gs-accent);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  padding: 0 10px;
  letter-spacing: 0.4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.gs-conn-status {
  align-items: center;
  gap: 6px;
  background: var(--gs-warn-bg);
  color: var(--gs-warn-fg);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  margin-right: 4px;
  white-space: nowrap;
}
.gs-hist-popup { min-width: 190px; font-size: 11px; line-height: 1.5; }
.gs-hp-addr { font-weight: 600; margin-bottom: 5px; color: var(--gs-text); word-break: break-word; }
.gs-hp-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-top: 1px solid var(--gs-border); }
.gs-hp-row > span { color: var(--gs-text-3); white-space: nowrap; }
.gs-hp-row > strong { text-align: right; }
.gs-hp-row > a { color: var(--gs-accent); text-decoration: none; font-size: 10px; }
.gs-hp-row > a:hover { text-decoration: underline; }
.top-bar-logout { margin-left: 16px; color: var(--gs-text-3); text-decoration: none; font-size: 12px; }
.top-bar-logout:hover { color: var(--gs-text-2); }
#status-line { padding: 16px; color: var(--gs-text-3); font-size: 12px; }

#toolbar {
  height: 56px;
  flex-shrink: 0;
  background: var(--gs-surface-2);
  border-bottom: 1px solid var(--gs-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;    /* a scrollbar across a 56px bar reads as a defect — keep scroll, hide the bar */
}
#toolbar::-webkit-scrollbar { display: none; }
.tb-side { display: flex; align-items: center; }
.tb-sep-v { width: 1px; height: 30px; background: var(--gs-surface-5); margin: 0 4px; flex-shrink: 0; }
/* Auto width (min 64px) so longer translated labels (nl "Bestuurdersinformatie", de …) widen their
   own item instead of overflowing onto the neighbour; the label itself is still capped + ellipsized
   below as a hard stop, so no language can ever make items collide. */
.tb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: auto;
  min-width: 64px;
  padding: 0 7px;
  height: 52px;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.tb-item:hover:not(.disabled) { background: var(--gs-surface-5); }
.tb-item.active { background: #00A9DF14; }
.tb-item.active .tb-icon, .tb-item.active .tb-label { color: var(--gs-accent); }
.tb-item.disabled { opacity: 0.35; cursor: default; }
.tb-icon { font-size: 17px; color: var(--gs-text-3); line-height: 1; }
/* The theme icon is now drawn (SVG) rather than typed (☾/☀), because a text glyph's ink cannot be
   sized reliably across fonts. On DESKTOP it is held at the same visual weight the glyph had, so the
   bar looks exactly as it did; the phone rules below size it against Logout instead. */
#tb-theme .tb-icon { display: inline-flex; align-items: center; justify-content: center; }
#tb-theme .tb-icon svg { display: block; width: 17px; height: 17px; }
.tb-icon-exit {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 10px !important;
  box-sizing: border-box;
}
.tb-item:hover:not(.disabled) .tb-icon { color: var(--gs-text-2); }
.tb-label { font-size: 9px; color: var(--gs-text-3); margin-top: 4px; text-align: center; white-space: nowrap; max-width: 118px; overflow: hidden; text-overflow: ellipsis; }
/* Small count badge over a toolbar icon (e.g. Unused devices) — top-right of the icon, red so a
   nonzero count reads as "needs attention" at a glance without widening the fixed-width item. */
.gs-dlg-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  cursor: se-resize;
  background: linear-gradient(135deg, transparent 40%, rgba(0,0,0,0.18) 40%, rgba(0,0,0,0.18) 55%, transparent 55%, transparent 65%, rgba(0,0,0,0.18) 65%, rgba(0,0,0,0.18) 80%, transparent 80%);
  border-radius: 0 0 4px 0;
  z-index: 10;
}
.ed-modal { position: relative; }
/* Live fleet count under the Objects button ("1809/2225"). Its own line rather than a badge: the
   badge is a red disc sized for a one- or two-digit alert count, and a ratio would be unreadable in
   one. Accent-coloured and tabular so the digits do not jitter as the count changes. */
.tb-count {
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  margin-top: 3px;
  color: var(--gs-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
/* On a phone the labels are hidden and the items are ~30px wide — a ratio has nowhere to go. */
@media (max-width: 640px) { .tb-count { display: none; } }

/* Sized to match .tb-count above — at 9px this was legible only if you already knew a number was
   there, which defeats the point of an alert. Stays a red disc rather than becoming a plain line:
   unlike the Objects ratio, this one is a count of things that need attention. */
.tb-badge {
  position: absolute;
  top: 1px;
  right: 4px;
  background: #e74c3c;
  color: #FFFFFF;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  min-width: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--gs-surface-2);
}

#main-body { flex: 1; display: flex; min-height: 0; }
#map-area { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }

#sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--gs-surface);
  border-right: 1px solid var(--gs-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#sidebar-resize-handle {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
  user-select: none;
  position: relative;
}
#sidebar-resize-handle:hover,
#sidebar-resize-handle.dragging {
  background: rgba(0, 169, 223, 0.25);
}
#sidebar-resize-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 32px;
  background-image: radial-gradient(circle, var(--gs-border-4) 1.5px, transparent 1.5px);
  background-size: 4px 8px;
  background-repeat: repeat-y;
  pointer-events: none;
  transition: background-image 0.15s;
}
#sidebar-resize-handle:hover::after,
#sidebar-resize-handle.dragging::after {
  background-image: radial-gradient(circle, rgba(0, 169, 223, 0.9) 1.5px, transparent 1.5px);
}
body.sidebar-resizing { cursor: col-resize !important; user-select: none !important; }
body.sidebar-resizing iframe, body.sidebar-resizing #map { pointer-events: none; }
#device-list { display: flex; flex-direction: column; height: 100%; }
#history-panel { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.hi-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gs-border);
  flex-shrink: 0;
}
.hi-title { font-size: 13px; font-weight: bold; color: var(--gs-text-2); }
.hi-controls { padding: 10px 12px; border-bottom: 1px solid var(--gs-border); flex-shrink: 0; overflow-y: auto; }
.hi-controls .ed-field { margin-bottom: 8px; }
/* History's Objet picker (history.js): opens in the flow, not floating, because .hi-controls scrolls
   and would clip an absolutely-positioned list. */
.hi-obj .gs-ms-panel { position: static; margin-top: 2px; min-width: 0; max-height: 45vh; resize: none; }
.hi-obj .gs-ms-item { cursor: pointer; }
.hi-obj .gs-ms-item[hidden] { display: none; }
.hi-obj .hi-obj-sel { background: var(--gs-surface-3); font-weight: 600; color: var(--gs-accent); }
.hi-obj.hi-obj-open .gs-ms-caret { transform: rotate(180deg); }
.hi-btn-row { display: flex; gap: 6px; margin-top: 4px; }
.hi-btn-row .ed-btn { flex: 1; padding: 7px 6px; font-size: 11px; }
.hi-info-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: bold;
  color: var(--gs-text-3);
  background: var(--gs-surface-5);
  flex-shrink: 0;
}
.hi-info-list { flex: 1; overflow-y: auto; }
.hi-event { border-bottom: 1px solid var(--gs-border); }
.hi-event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.hi-event-row:hover { background: var(--gs-surface-3); }
.hi-event-icon { font-size: 14px; flex-shrink: 0; }
.hi-event-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hi-event-label { font-size: 10px; color: var(--gs-text-3); text-transform: uppercase; }
.hi-event-date { font-size: 11px; color: var(--gs-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-event-right { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; gap: 1px; }
.hi-event-dur { font-size: 11px; color: var(--gs-text-2); }
.hi-event-fuel { font-size: 10px; color: var(--gs-accent); }
.hi-event-more { color: var(--gs-text-3); cursor: pointer; padding: 0 4px; flex-shrink: 0; }
.hi-event-more:hover { color: var(--gs-accent); }
.hi-summary {
  background: var(--gs-surface-3);
  border-bottom: 2px solid var(--gs-border-2);
  padding: 8px 12px 6px;
  font-size: 11px;
}
.hi-sum-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.hi-sum-row span { color: var(--gs-text-3); }
.hi-sum-row strong { color: var(--gs-text-2); font-weight: 600; }
.hi-detail {
  padding: 4px 12px 10px 35px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  font-size: 11px;
}
.hi-detail div { display: flex; justify-content: space-between; gap: 8px; }
.hi-detail span { color: var(--gs-text-3); }
.hi-detail strong { color: var(--gs-text-2); font-weight: normal; }
.hi-detail-addr strong { text-align: right; overflow-wrap: anywhere; }

.gs-history-pin {
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 2px rgba(0,0,0,0.6);
}
.gs-history-stop-pin {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a73e8;
  border: 3px solid #FFFFFF;
  box-shadow: 0 0 3px rgba(0,0,0,0.6);
  color: var(--gs-on-accent);
  font-size: 21px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.gs-history-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 10px solid #FF0000;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.6));
}

.dl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--gs-border);
  flex-shrink: 0;
}
.dl-filter {
  border: 1px solid var(--gs-border-4);
  background: var(--gs-surface);
  color: var(--gs-text-3);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}
.dl-filter.active { background: var(--gs-accent); border-color: var(--gs-accent); color: var(--gs-on-accent); }
.dl-filter:hover:not(.active) { border-color: var(--gs-accent); color: var(--gs-accent); }

.dl-search {
  margin: 8px;
  padding: 8px;
  border: 1px solid var(--gs-border-4);
  border-radius: 4px;
  font-size: 12px;
  flex-shrink: 0;
}

.dl-group-header {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: bold;
  color: var(--gs-text-3);
  background: var(--gs-surface-5);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 1;
}
.dl-group-header:hover { background: var(--gs-surface-5); }
.dl-group-arrow { font-size: 9px; flex-shrink: 0; }
.dl-group-count { font-weight: normal; margin-left: auto; color: var(--gs-text-3); font-size: 10px; }

.dl-rows { overflow-y: auto; flex: 1; }

.dl-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gs-border-3);
  cursor: pointer;
  position: relative;
}
.dl-row:hover { background: var(--gs-surface-3); }
/* Selected device stays clearly marked (accent left bar + accent name) so you remember what you're
   working on. Uses inset box-shadow, not background, so it shows even over the per-status row colours. */
.dl-row.selected { box-shadow: inset 4px 0 0 var(--gs-accent); }
.dl-row.selected .dl-row-name { color: var(--gs-accent); font-weight: 700; }

/* A drawn disc, not the ● character: the glyph's ink was ~8px and differed per font. The colour is
   the background, so a per-account dot colour (devicelist.js dotStyle) simply overrides it. */
.dl-row-icon { flex-shrink: 0; width: 14px; height: 14px; border-radius: 50%; margin-right: 10px; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.dl-row-icon.status-moving { background-color: #2ecc71; }
.dl-row-icon.status-stopped { background-color: #FAB444; }
.dl-row-icon.status-idle { background-color: #9CC602; }
.dl-row-icon.status-offline { background-color: var(--gs-text-disabled); }

.dl-row-info { flex: 1; min-width: 0; }
.dl-row-name { font-size: 12px; color: var(--gs-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-row-sub { font-size: 10px; color: var(--gs-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dl-row-right { text-align: right; flex-shrink: 0; }
.dl-row-speed { font-size: 11px; color: var(--gs-text-2); }
.dl-row-time { font-size: 10px; color: var(--gs-text-3); }
.dl-stale-fix { color: #E67E22; cursor: help; }

/* Rows painted in an account's status colour: text follows that colour, not the theme
   (devicelist.js inkClass picks the side with more contrast). Selected keeps its bar and bold name. */
.dl-row.dl-ink-dark .dl-row-name, .dl-row.dl-ink-dark .dl-row-speed { color: #000; }
.dl-row.dl-ink-dark .dl-row-sub, .dl-row.dl-ink-dark .dl-row-time, .dl-row.dl-ink-dark .dl-menu-btn { color: #1a1a1a; }
.dl-row.dl-ink-dark .dl-stale-fix { color: #8A3B00; }
.dl-row.dl-ink-light .dl-row-name, .dl-row.dl-ink-light .dl-row-speed { color: #fff; }
.dl-row.dl-ink-light .dl-row-sub, .dl-row.dl-ink-light .dl-row-time, .dl-row.dl-ink-light .dl-menu-btn { color: #fff; }
.dl-row.dl-ink-light .dl-stale-fix { color: #FFD08A; }
.dl-row.dl-ink-dark .dl-menu-btn:hover { background: rgba(0,0,0,0.12); }
.dl-row.dl-ink-light .dl-menu-btn:hover { background: rgba(255,255,255,0.18); }

.dl-menu-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-left: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gs-text-3);
  border-radius: 50%;
}
.dl-menu-btn:hover { background: var(--gs-surface-5); color: var(--gs-text-2); }

/* Floats above the list and the map: devicelist.js placeMenu switches it to position: fixed next to
   its ⋮ button. absolute/top/right is only the fallback before that runs. */
.dl-menu {
  position: absolute;
  top: 100%;
  right: 12px;
  z-index: 2000;
  overflow-y: auto;
  background: var(--gs-surface);
  border: 1px solid var(--gs-border);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  min-width: 190px;
  padding: 4px 0;
}
.dl-menu-item {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--gs-text-2);
  cursor: pointer;
  white-space: nowrap;
}
.dl-menu-item:hover:not(.disabled) { background: var(--gs-surface-3); }
.dl-menu-item.disabled { color: var(--gs-text-disabled); cursor: default; }

#map { flex: 1; min-width: 0; min-height: 0; }

#map-toolbar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mt-btn {
  width: 32px;
  height: 32px;
  background: var(--gs-surface);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--gs-text-2);
}
/* Data-points toggle is part of the phone work — desktop already has the same switch as a labelled
   checkbox in the History panel, where there is room for words. */
#mt-points { display: none; }
.mt-btn:hover { background: var(--gs-surface-3); }
.mt-btn.active { background: var(--gs-accent); color: var(--gs-on-accent); }
.mt-btn.active:hover { background: #0090c0; }
.mt-sep { height: 1px; background: rgba(0,0,0,0.1); margin: 2px 4px; }
#mt-measure-readout {
  display: none;
  position: absolute;
  top: 10px;
  left: 52px;
  z-index: 500;
  background: var(--gs-surface);
  padding: 6px 10px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  font-size: 11px;
  color: var(--gs-text-2);
}

@media print {
  #top-bar, #toolbar, #sidebar, #sidebar-resize-handle, #map-toolbar, #mt-measure-readout, #device-panel { display: none !important; }
  #main-body, #map-area, #map { height: 100vh !important; width: 100% !important; }
}

.gs-popup-wrap .leaflet-popup-content-wrapper { border-radius: 4px; }
.gs-popup-title { font-weight: bold; color: var(--gs-accent); margin-bottom: 6px; font-size: 12px; }
.gs-popup-table { border-collapse: collapse; font-size: 11px; }
.gs-popup-table td { padding: 2px 6px 2px 0; vertical-align: top; }
.gs-popup-table td:first-child { color: var(--gs-text-3); white-space: nowrap; }
.gs-popup-table td:last-child { color: var(--gs-text-2); }
.gs-popup-detailed { display: inline-block; margin-top: 6px; color: var(--gs-accent); font-size: 11px; text-decoration: none; }
.gs-popup-detailed:hover { text-decoration: underline; }

#device-panel { flex-shrink: 0; max-height: min(320px, 45vh); overflow-y: auto; background: var(--gs-surface); border-top: 1px solid var(--gs-border); }
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gs-surface-5);
  padding: 0 12px;
  height: 34px;
  flex-shrink: 0;
}
.dp-tabs { display: flex; gap: 4px; height: 100%; }
.dp-tab {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  color: var(--gs-text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.dp-tab.active { color: var(--gs-accent); border-bottom-color: var(--gs-accent); }
.dp-close { cursor: pointer; color: var(--gs-text-3); font-size: 15px; }
.dp-close:hover { color: var(--gs-text-2); }
.st-panel-checks { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 4px; }
.st-panel-check { display: flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.dp-body { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 16px; }
.dp-col { min-width: 160px; flex: 1; }
.dp-col-wide { flex: 2; min-width: 240px; }
.dp-section-title { font-size: 10px; font-weight: bold; color: var(--gs-accent); margin: 8px 0 4px; }
.dp-section-title:first-child { margin-top: 0; }
.dp-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; padding: 3px 0; border-bottom: 1px solid var(--gs-border); }
/* Daily-statistics period selector — swipeable (‹ current ›) with dots. Touch-swipe on phone. */
.dp-period { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; user-select: none; touch-action: pan-y; }
.dp-period-label { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--gs-text); background: var(--gs-surface-2); border: 1px solid var(--gs-border-4); border-radius: 14px; padding: 5px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-period-arrow { flex: 0 0 auto; width: 28px; height: 28px; border: 1px solid var(--gs-border-4); border-radius: 50%; background: var(--gs-surface-2); color: var(--gs-text-2); font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.dp-period-arrow:hover:not(:disabled) { border-color: var(--gs-accent); color: var(--gs-accent); }
.dp-period-arrow:disabled { opacity: 0.3; cursor: default; }
.dp-period-dots { display: flex; justify-content: center; gap: 5px; margin: 0 0 8px; }
.dp-period-dots .dp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gs-border-4); cursor: pointer; transition: background .12s; }
.dp-period-dots .dp-dot.on { background: var(--gs-accent); }
.dp-kv span:first-child { color: var(--gs-text-3); }
.dp-sensors-tool { cursor: pointer; margin-left: 8px; color: var(--gs-text-3); font-weight: normal; }
.dp-sensors-tool:hover { color: var(--gs-accent); }
.dp-sensor-picker { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.dp-kv span:last-child { color: var(--gs-text-2); text-align: right; }
.dp-tacho-issues { font-size: 10px; color: #c0392b; margin-top: 4px; line-height: 1.5; }
.dp-notes { width: 100%; height: 60px; padding: 6px; border: 1px solid var(--gs-border-4); border-radius: 4px; font-size: 11px; margin-bottom: 6px; resize: vertical; }
/* Day timeline — the drives and stops of the chosen period, in order, with clock times.
   Folded away behind its own toggle so the Daily-statistics totals stay the first thing on screen. */
.dp-tl-toggle { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 7px 8px; font-size: 11px; font-weight: 600; color: var(--gs-text-2); background: var(--gs-surface-2); border: 1px solid var(--gs-border-3); border-radius: 6px; cursor: pointer; user-select: none; }
.dp-tl-toggle:hover { border-color: var(--gs-accent); color: var(--gs-accent); }
.dp-tl-toggle.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
.dp-tl-caret { color: var(--gs-text-4); font-size: 10px; }
.dp-tl-count { margin-left: auto; font-weight: normal; color: var(--gs-text-4); font-variant-numeric: tabular-nums; }
.dp-tl { border: 1px solid var(--gs-border-3); border-top: none; border-radius: 0 0 6px 6px; max-height: 320px; overflow-y: auto; }
.dp-tl-day { position: sticky; top: 0; z-index: 1; padding: 4px 8px; font-size: 10px; font-weight: bold; color: var(--gs-text-3); background: var(--gs-surface-4); border-bottom: 1px solid var(--gs-border-2); }
.dp-tl-row { display: flex; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--gs-border); cursor: pointer; }
.dp-tl-row:last-child { border-bottom: none; }
.dp-tl-row:hover { background: var(--gs-surface-3); }
.dp-tl-row:focus-visible { outline: 2px solid var(--gs-accent); outline-offset: -2px; }
/* The row currently drawn on the map. Marked so that after scrolling the list you can still tell
   which leg the map is showing. */
.dp-tl-row.sel { background: var(--gs-accent-bg); }
.dp-tl-resolving { color: var(--gs-text-disabled); font-style: italic; }

/* Panel folded away so the map has the screen. Height is the bar and nothing else — the map above
   grows into what it gives up (GsMap.invalidateSize is called on both transitions). */
#device-panel.dp-collapsed { max-height: none; height: auto; overflow: hidden; }
.dp-peek {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; height: 30px; box-sizing: border-box;
  font-size: 11px; color: var(--gs-text-2);
  background: var(--gs-surface-2); border-top: 1px solid var(--gs-border-3);
  cursor: pointer; user-select: none; touch-action: pan-y;
}
.dp-peek:hover { background: var(--gs-surface-3); }
.dp-peek:focus-visible { outline: 2px solid var(--gs-accent); outline-offset: -2px; }
.dp-peek-caret { color: var(--gs-accent); font-size: 9px; }
.dp-peek-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-peek-what { color: var(--gs-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The affordance. Pushed right so it reads as a hint, not a label on the object. */
.dp-peek-hint { margin-left: auto; color: var(--gs-text-4); font-size: 10px; white-space: nowrap; flex-shrink: 0; }
@media (max-width: 640px) {
  .dp-peek { height: 36px; font-size: 12px; padding: 8px 12px; }
}
/* The state is carried by a colour rail rather than a word, so a long day is scannable at a glance.
   Same hues the device list already uses for moving/stopped, so the two views agree. */
.dp-tl-row.move { border-left: 3px solid #2ecc71; }
.dp-tl-row.stop { border-left: 3px solid #FAB444; }
/* Start over end, so the times form one narrow column the eye can run down. */
.dp-tl-time { flex: 0 0 42px; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--gs-text); line-height: 1.35; }
.dp-tl-time span { display: block; color: var(--gs-text-4); }
.dp-tl-body { flex: 1; min-width: 0; }
.dp-tl-line { display: flex; align-items: baseline; gap: 6px; font-size: 11px; color: var(--gs-text-2); }
.dp-tl-dur { margin-left: auto; color: var(--gs-text-3); font-variant-numeric: tabular-nums; }
.dp-tl-meta { font-size: 10px; color: var(--gs-text-3); margin-top: 1px; font-variant-numeric: tabular-nums; }
.dp-tl-where { font-size: 10px; color: var(--gs-text-4); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* On a phone the panel is the whole screen, so the list can have more of it — and the addresses get
   to wrap onto a second line instead of being cut, since there is no column competing for the width. */
@media (max-width: 640px) {
  .dp-tl { max-height: 60vh; }
  .dp-tl-toggle { padding: 10px 8px; font-size: 12px; }
  .dp-tl-row { padding: 8px; }
  .dp-tl-time { flex-basis: 46px; font-size: 12px; }
  .dp-tl-line { font-size: 12px; }
  .dp-tl-meta, .dp-tl-where { font-size: 11px; }
  .dp-tl-where { white-space: normal; }
}

.dp-gauge { position: relative; height: 18px; background: var(--gs-surface-3); border-radius: 9px; overflow: hidden; margin-top: 4px; }
.dp-gauge-fill { height: 100%; background: var(--gs-accent); }
.dp-gauge span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--gs-text-2); }
.dp-fuel-gauge { width: 100%; max-width: 160px; display: block; margin: 6px auto 0; }
.dp-fuel-gauge .gauge-track { stroke: var(--gs-border-2); }
.dp-fuel-gauge .gauge-needle { stroke: var(--gs-text-2); }
.dp-fuel-gauge .gauge-center { fill: var(--gs-text-2); }
.dp-fuel-gauge .gauge-label { fill: var(--gs-text-4); font-family: sans-serif; }
.dp-fuel-gauge .gauge-pct { font-family: sans-serif; }
.st-panel-section { border: 1px solid var(--gs-border-2); border-radius: 4px; margin-bottom: 6px; overflow: hidden; }
.st-panel-section .st-panel-checks { padding: 8px 12px 6px; }
.st-panel-summary { font-weight: 600; font-size: 12px; padding: 7px 10px; cursor: pointer; background: var(--gs-surface-2); user-select: none; list-style: none; display: flex; align-items: center; gap: 6px; }
.st-panel-summary::-webkit-details-marker { display: none; }
.st-panel-summary::before { content: 'â–¶'; font-size: 9px; transition: transform 0.15s; display: inline-block; color: var(--gs-text-3); }
details[open] .st-panel-summary::before { transform: rotate(90deg); }
.st-panel-sensor-hdr { font-size: 11px; color: var(--gs-text-3); padding: 0 12px 4px; }
.dp-sparkline { width: 100%; height: 80px; }
.dp-sparkline-range { display: flex; justify-content: space-between; font-size: 10px; color: var(--gs-text-3); margin-top: 2px; }

.ed-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.ed-modal {
  width: min(480px, 94vw);
  max-height: 90vh;
  max-width: 96vw;
  min-width: 320px;
  min-height: 200px;
  background: var(--gs-surface);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2), 0 4px 14px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Resize is handled by the custom bottom-right drag handle (tableresize.js). The native `resize: both`
     grip was removed: overflow:hidden + border-radius clipped it, and it collided with the custom handle. */
}
/* Wide (tabbed) dialogs keep ONE constant size while the user moves between tabs/submenus — the
   height is fixed rather than content-driven, so switching from a tall tab to a short one no longer
   makes the box jump around (user request 2026-08-13). The body scrolls inside; a user drag-resize
   (tableresize.js) sets inline width/height, which still overrides this default. */
.ed-modal.ed-modal-wide { width: min(660px, 94vw); height: min(80vh, 720px); }
/* Reports, Drivers and Drivers information open large, so their lists are readable without dragging the
   corner first (2026-11-14). A size the account drags is still saved and wins over this. */
.ed-modal.ed-modal-wide.ed-modal-module { width: 94vw; height: 88vh; }
/* Long column titles there wrap onto a second line instead of being cut to "TODAY'S DRIVI...". */
.ed-modal-module .cp-table th { white-space: normal !important; vertical-align: bottom; text-overflow: clip !important; line-height: 1.2; }
.ed-header {
  background: var(--gs-accent);
  color: var(--gs-on-accent);
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-radius: 10px 10px 0 0;
}
.ed-title { font-size: 13px; font-weight: 600; letter-spacing: 0.1px; }
.ed-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ed-btn-header {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.18);
  cursor: pointer;
  white-space: nowrap;
}
.ed-btn-header:hover { background: rgba(255,255,255,0.3); }
.ed-close {
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  opacity: 0.8;
  padding: 3px 7px;
  border-radius: 4px;
  transition: background 0.12s, opacity 0.12s;
}
.ed-close:hover { background: rgba(255,255,255,0.22); opacity: 1; }
.ed-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--gs-border);
  background: var(--gs-surface-2);
  flex-shrink: 0;
}
.ed-tab { padding: 8px 12px; font-size: 11px; color: var(--gs-text-3); cursor: pointer; border-bottom: 2px solid transparent; }
.ed-tab:hover:not(.disabled) { color: var(--gs-text-2); }
.ed-tab.active { color: var(--gs-accent); border-bottom-color: var(--gs-accent); }
.ed-tab.disabled { opacity: 0.35; cursor: default; }
.ed-body { padding: 16px; overflow-y: auto; flex: 1; }
/* When a module (Drivers, etc.) is rendered inside a dialog the inner cp-header/cp-title is
   redundant — the modal header already shows the title. Hide it; the remaining icons sit on the
   LEFT, refresh first (2026-11-19: the user wants refresh on the left everywhere). */
.ed-body .cp-header { margin-bottom: 10px; justify-content: flex-start; }
.ed-body .cp-header > [id$="-refresh"] { order: -1; }
.ed-body .cp-title { display: none; }
.ed-section-title { font-size: 11px; font-weight: 600; color: var(--gs-accent); margin: 16px 0 8px; letter-spacing: 0.02em; }
.ed-section-title:first-child { margin-top: 0; }
.ed-field { margin-bottom: 10px; }
.ed-field label { display: block; font-size: 10px; font-weight: 500; color: var(--gs-text-2); margin-bottom: 4px; }
.ed-field input:focus, .ed-field select:focus {
  outline: none;
  border-color: var(--gs-accent);
  box-shadow: 0 0 0 3px rgba(0,169,223,0.12);
}
.ed-field input, .ed-field select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--gs-border-3);
  border-radius: 5px;
  font-size: 12px;
  color: var(--gs-text-2);
  background: var(--gs-surface-2);
  box-sizing: border-box;
  transition: border-color 0.12s, box-shadow 0.12s;
}
/* Radio added 2026-08-22. `.ed-field input` above sets width:100% for text fields, and only checkbox
   was exempted — so every radio button in the app stretched to the full field width. Browsers centre
   a radio's dot inside its box, so the dot appeared floating mid-row with its label pushed to the far
   right edge, looking like a broken layout. Affects any radio inside .ed-field, not just one dialog. */
.ed-field input[type="checkbox"],
.ed-field input[type="radio"] {
  width: 16px;
  height: 16px;
  padding: 0;
  flex: 0 0 auto;
  border: none;
}
.ed-field-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.ed-field-row label { flex-basis: 100%; }
.ed-field-row select { width: auto; flex-shrink: 0; }
.ed-field-row input { flex: 1; min-width: 80px; }
.ed-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; min-height: 22px; }
.ed-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--gs-surface-3);
  border: 1px solid var(--gs-border-3);
  font-size: 11px;
  color: var(--gs-text-2);
}
.ed-tag-x { cursor: pointer; color: var(--gs-text-3); font-weight: bold; line-height: 1; }
.ed-tag-x:hover { color: #c0392b; }
.ed-tag-hint { font-size: 11px; color: var(--gs-text-3); font-style: italic; }
.ed-suggest-wrap:empty { display: none; }
.ed-suggest-wrap {
  border: 1px solid var(--gs-border-3);
  border-radius: 5px;
  background: var(--gs-surface-2);
  margin-top: 2px;
  max-height: 140px;
  overflow-y: auto;
}
.ed-suggest-item { padding: 6px 10px; font-size: 11px; color: var(--gs-text-2); cursor: pointer; }
.ed-suggest-item:hover { background: var(--gs-surface-3); color: var(--gs-text); }
.ed-placeholder { color: var(--gs-text-3); font-size: 12px; padding: 20px 0; text-align: center; }
.ed-loading { padding: 30px; text-align: center; color: var(--gs-text-3); font-size: 12px; }
.ed-error { color: #c0392b; font-size: 11px; margin-bottom: 10px; }
.ed-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--gs-border);
  flex-shrink: 0;
}
.ed-btn {
  padding: 8px 14px;
  border: 1px solid var(--gs-border-4);
  border-radius: 4px;
  background: var(--gs-surface);
  color: var(--gs-text-2);
  font-size: 12px;
  cursor: pointer;
}
.ed-btn:hover:not(:disabled) { background: var(--gs-surface-3); }
/* Disabled state, added 2026-08-22. Only .ed-btn-danger had one, so every other .ed-btn carrying a
   `disabled` attribute — 22 of them across 9 files — rendered at full strength with a pointer cursor
   and a live hover. An operator clicks it, nothing happens, and the button looks no different from a
   working one: indistinguishable from a broken feature. Found via the bulk-apply dialog, where Apply
   is deliberately gated behind Preview + Snapshot and gave no sign it was waiting for either. */
.ed-btn:disabled,
.ed-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.ed-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
/* Sensor health pills — a param merely existing in the latest position doesn't mean it works,
   so the Sensors tab grades each one over a window of history. Colour carries the same meaning
   as everywhere else in the app (ok / warn / danger tokens), never a bespoke palette. */
/* Decimal hours shown under each duration — 8 h 30 min is 8.5, which is the figure that actually
   gets typed into payroll and planning sheets, so showing both saves doing the sum by hand. */
.tc-dec { display: block; font-size: 10.5px; color: var(--gs-text-3); font-variant-numeric: tabular-nums; }
/* Number plate shown under a driver card number — a raw 16-digit card means nothing on its own, but
   "the card that drives 2DRH339" is instantly recognisable. */
.drv-plate { display: block; font-size: 10.5px; color: var(--gs-accent-2); }
.drv-search { width: 100%; box-sizing: border-box; margin: 2px 0 4px; }
.drv-owner-tag { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 10px; background: var(--gs-surface-3, rgba(127,127,127,.16)); color: var(--gs-text-2); white-space: nowrap; }
.cp-dim { color: var(--gs-text-3, var(--gs-text-2)); }
.eu-vis-toggle { cursor: pointer; user-select: none; font-size: 14px; line-height: 1; display: inline-block; }
.eu-vis-toggle:hover { opacity: 0.7; }
/* Destructive action button. Deliberately outlined rather than filled: it sits beside the filled
   primary "Add selected", and two solid buttons of equal weight makes the destructive one too easy
   to hit by reflex. */
.ed-btn-danger {
  border-color: var(--gs-danger-fg);
  color: var(--gs-danger-fg);
  background: var(--gs-danger-bg);
}
.ed-btn-danger:hover:not(:disabled) { background: var(--gs-danger-fg); color: #fff; }
.ed-btn-danger:disabled { opacity: 0.45; cursor: default; }
.tc-totals-row td { border-top: 2px solid var(--gs-border-3); background: var(--gs-surface-3); }
.tc-totals-row .tc-dec { color: var(--gs-accent-2); }
/* Today's row stands out — the company reads today's compliance first. */
.tc-today-row td { background: rgba(0, 169, 223, 0.10); font-weight: 600; }
/* card out while the truck drove on (nocard-drive-v1, 2026-11-28) */
.tc-nocard-row td { background: rgba(220, 53, 69, 0.08); }
.tc-nocard-row td.tc-nocard-cell { color: var(--gs-danger-fg, #b00020); font-weight: 600; }
.tc-today-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 10px; font-weight: 700; background: var(--gs-accent-2, #00A9DF); color: #fff; vertical-align: middle; }
/* Line the numeric columns up under the totals (km + rest/work/drive/break), payroll-sheet style;
   Date and Beginning stay left-aligned. */
.tc-day-table th:nth-child(2), .tc-day-table td:nth-child(2),
.tc-day-table th:nth-child(n+4), .tc-day-table td:nth-child(n+4) { text-align: right; }

.sn-health { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 9px; white-space: nowrap; }
.sn-health-live   { background: var(--gs-ok-bg);     color: var(--gs-ok-fg); }
.sn-health-frozen { background: var(--gs-warn-bg);   color: var(--gs-warn-fg); }
.sn-health-zero   { background: var(--gs-danger-bg); color: var(--gs-danger-fg); }
.sn-health-absent { background: var(--gs-surface-3); color: var(--gs-text-3); }
.sn-health-text   { background: var(--gs-accent-bg); color: var(--gs-accent-2); }
.sn-health-load   { background: var(--gs-surface-3); color: var(--gs-text-3); font-style: italic; }

.ed-btn-primary { background: var(--gs-accent); border-color: var(--gs-accent); color: var(--gs-on-accent); }
.ed-btn-primary:hover { opacity: 0.9; }
.ed-attr-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.ed-attr-key { width: 40%; padding: 6px; border: 1px solid var(--gs-border-4); border-radius: 4px; font-size: 11px; }
.ed-attr-val { flex: 1; padding: 6px; border: 1px solid var(--gs-border-4); border-radius: 4px; font-size: 11px; }
.ed-attr-del { cursor: pointer; color: var(--gs-text-3); padding: 0 4px; }
.ed-attr-del:hover { color: #c0392b; }
.ed-info-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--gs-border); font-size: 12px; }
.ed-info-row span:first-child { color: var(--gs-text-3); }
.ed-field input[type="color"] { width: 60px; padding: 2px; height: 32px; cursor: pointer; }
.ed-icon-picker { display: flex; gap: 8px; }
.ed-icon-choice {
  font-size: 21px;
  padding: 4px 8px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.ed-icon-choice:hover { background: var(--gs-surface-3); }
.ed-icon-choice.selected { border-color: var(--gs-accent); background: #00A9DF14; }
.ed-preview {
  background: var(--gs-surface-3);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--gs-text-2);
  margin-bottom: 12px;
}
.ed-preview-empty { color: var(--gs-text-3); }
.ed-note {
  font-size: 10px;
  color: var(--gs-text-3);
  background: var(--gs-surface-3);
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.ed-field-row input[type="checkbox"] { width: auto; flex-shrink: 0; margin-right: 4px; }

#control-panel { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cp-loading { padding: 30px; text-align: center; color: var(--gs-text-3); font-size: 12px; }
/* Progress affordance for the tacho archive listing, added 2026-09-04. The archive is read off the
   NAS over Tailscale SMB and kerasus's 35,134 files measured 45.17s, so the plain .cp-loading text
   above is not enough on its own -- a motionless page for that long reads as broken. .td-loading
   only ever decorates a .cp-loading div, so the padding/centring/colour above still apply. */
.td-loading { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.td-spin { width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--gs-border-2); border-top-color: var(--gs-accent);
  animation: tdSpin 0.8s linear infinite; }
.td-loading-msg { color: var(--gs-text-2); font-size: 12px; }
.td-loading-sub { color: var(--gs-text-3); font-size: 11px; max-width: 340px; line-height: 1.45; }
/* tabular-nums so the seconds counter does not jitter its own width as it ticks. */
.td-loading-el { color: var(--gs-text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
@keyframes tdSpin { to { transform: rotate(360deg); } }
/* Slowed rather than stopped: a still spinner would defeat the whole point of the affordance. */
@media (prefers-reduced-motion: reduce) { .td-spin { animation-duration: 2.4s; } }
.cp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; padding-left: 10px; }
/* A refresh placed in a page header stays on the left, next to the title; whatever follows it (search box)
   still goes to the right (2026-11-19). Covers every page built this way, present and future. */
.cp-header > [id$="-refresh"] { margin-right: auto; }
/* A refresh in a dialog footer goes first, on the left, apart from Save/Cancel/Close (2026-11-19). */
.ed-footer > [id$="-refresh"] { order: -1; margin-right: auto; }
.cp-title-row { display: flex; align-items: center; gap: 6px; }
.cp-title { font-size: 15px; color: var(--gs-text-2); font-weight: bold; }
.cp-info { color: var(--gs-text-disabled); cursor: help; font-size: 13px; }
.cp-info:hover { color: var(--gs-text-3); }
.cp-search {
  padding: 7px 10px;
  border: 1px solid var(--gs-border-4);
  border-radius: 4px;
  font-size: 12px;
  width: 220px;
  flex-shrink: 0;
}
.cp-table-wrap { overflow-x: auto; border: 1px solid var(--gs-border-2); border-radius: 6px; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
/* Many-narrow-column raw-data tables (e.g. the raw attribute dump) look wrong stretched to 100% —
   width:100% with table-layout:auto forces the browser to spread a few dozen short numeric cells
   evenly across the full container, leaving huge dead gaps between values. Let this variant size to
   its own content instead; .cp-table-wrap's overflow-x:auto still scrolls it if that's wider than
   the panel. */
.cp-table-natural { width: auto; }
.cp-table-natural td, .cp-table-natural th { padding: 8px 10px; }
.cp-table th {
  position: relative;
  text-align: left;
  padding: 10px 14px;
  background: var(--gs-surface-3);
  color: var(--gs-text-2);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  overflow: hidden;
}
.cp-table td { padding: 4px 10px; border-top: 1px solid var(--gs-border); color: var(--gs-text-2); }
.cp-table tr:hover td { background: var(--gs-accent-bg); }

/* Columns must fit the panel, and every value stays on ONE line — wrapping a 16-char driver card id
   into a stack of letters is worse than not seeing it. So keep nowrap and let anything too long for
   its column end in an ellipsis instead. Which column gets how much space is decided at runtime by
   tableresize.js's fitToContainer(): it measures each column's natural content width and shares the
   panel out in proportion, so short columns (ID, ACTIVE) stay narrow and hand their space to the
   long ones (E-MAIL, IP, REG. TIME) rather than every column being squeezed equally. */
/* Data cells: strictly one line, ellipsis if it doesn't fit. */
.cp-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Headers: also one line, and never truncated — a header is the only clue to what a column holds,
   so it has to stay whole. Dropping the letter-spacing and tightening the padding buys back a lot
   of the width these uppercase labels were claiming. When even that isn't enough, tableresize.js
   steps the whole table's font down until every header and value fits on its line, rather than
   wrapping or ellipsising anything. */
.cp-table th {
  white-space: nowrap;
  letter-spacing: 0;
  padding: 8px 8px;
  overflow: hidden;
}
/* Descendants carry their own sizing; without this an inner span keeps its full width and spills
   past the ellipsised cell instead of being clipped with it. */
.cp-table td > * { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* The content-sized raw-dump variant keeps its natural column widths but may no longer exceed the
   panel — with the wrapping above it compresses rather than scrolling. */
.cp-table-natural { max-width: 100%; }

/* Rather than reintroduce a scrollbar when the space genuinely runs out, step the type and padding
   down. Reaching for the layout's own breathing room first keeps every column reachable. */
@media (max-width: 1200px) {
  .cp-table { font-size: 11px; }
  .cp-table th { padding: 8px 8px; }
  .cp-table td { padding: 4px 8px; }
}
@media (max-width: 900px) {
  .cp-table { font-size: 10px; }
  .cp-table th { padding: 6px 5px; letter-spacing: 0; }
  .cp-table td { padding: 3px 5px; }
  /* The action column is NOT narrowed here. It was, and that is what cut the icons off on a narrow
     window: four icons need 69px and this was handing them 58px. Text columns can give up space
     because text ellipsises; icons just disappear. */
}
/* Drag handle added by tableresize.js to every <th> — sits over the header's right edge. Only the
   dragged column's own width is ever changed (see tableresize.js) — no table-wide layout switch —
   so cells are deliberately NOT given overflow:hidden here: some (like row actions) hold several
   icon buttons side by side, and clipping overflow would hide the extra ones instead of just
   truncating text. Headers are always plain single-line labels, so ellipsis stays safe on those. */
.cp-col-resize-handle {
  position: absolute;
  top: 0; right: -5px; bottom: 0;
  width: 11px;
  cursor: col-resize;
  -webkit-user-select: none;
  user-select: none;
  z-index: 2;
}
/* A thin always-visible line at the actual column boundary (the handle's own hit area is centered
   on it, extending 5px either side) so the resize point is discoverable without first having to
   hover blindly along a header — especially on wide columns with mostly empty space, like the
   Driver card logbook's Time column, where the boundary can be far from the visible label text. */
.cp-col-resize-handle::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 5px;
  width: 1px;
  background: var(--gs-surface-5);
}
.cp-col-resize-handle:hover, .cp-col-resize-handle:active { background: rgba(0, 0, 0, 0.18); }
.cp-col-id { color: var(--gs-text-4); width: 1%; }
/* The column chooser sits inline in the title row, so it must not stretch like the full-width
   multi-selects inside dialog fields do. */
.cp-colchooser { display: inline-block; margin-left: 6px; vertical-align: middle; }
.cp-colchooser .gs-ms { width: 150px; }
.cp-colchooser .gs-ms-trigger { padding: 3px 8px; font-size: 11px; }
.cp-colchooser .gs-ms-panel { left: auto; right: 0; min-width: 190px; }
.cp-col-dim { color: var(--gs-text-4); }
.cp-col-center { text-align: center; }
.cp-col-actions { width: 1%; }
.cp-pagination { display: flex; align-items: center; gap: 8px; padding: 5px 12px; font-size: 11px; border-top: 1px solid var(--gs-border); }
.cp-pag-btn { background: none; border: 1px solid var(--gs-border-3); border-radius: 4px; cursor: pointer; padding: 1px 9px; font-size: 14px; line-height: 1.5; color: var(--gs-text-2); }
.cp-pag-btn:disabled { opacity: 0.35; cursor: default; }
.cp-pag-btn:not(:disabled):hover { background: var(--gs-surface-3); }
.cp-pag-info { flex: 1; color: var(--gs-text-2); text-align: center; }
.cp-pag-rows { border: 1px solid var(--gs-border-3); border-radius: 4px; padding: 2px 6px; font-size: 11px; color: var(--gs-text-2); background: var(--gs-surface); cursor: pointer; }
.cp-title-row .rp-icon-btn { font-size: 15px; padding: 0 6px; }
.cp-col-check { width: 1%; text-align: center; }
.cp-col-check input, .cp-col-check input[type="checkbox"] { width: 15px; height: 15px; }
.gs-tooltip.leaflet-tooltip {
  pointer-events: auto;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  cursor: text;
}
.cp-sortable { cursor: pointer; user-select: none; }
.cp-sortable:hover { color: var(--gs-text-2); }
.cp-sort-arrow { font-size: 8px; }
.cp-selected-count { font-size: 11px; color: var(--gs-text-3); align-self: center; }
.obj-signal.online { filter: hue-rotate(80deg) saturate(3); }
.obj-signal.offline { opacity: 0.35; filter: grayscale(1); }
/* Sized to hold the widest action row whole, measured rather than estimated:
   5 icons x 28px + 4 gaps x 4px + 2 x 10px cell padding = 176. Was 144 for four icons; the
   save-as-template icon made it five, and an under-sized column here is what crushed the icons
   last time rather than wrapping them. Re-measure this if another action is ever added. */
.cp-table th:last-child, .cp-table td:last-child { width: 176px; text-align: center; }
/* The tacho day table's last column is the "Total" DATA column, not an actions column — keep it
   right-aligned and content-sized, overriding the actions-oriented rule above. */
.tc-day-table th:last-child, .tc-day-table td:last-child { width: auto; text-align: right; }
/* Send-message template row: dropdown grows, save/delete buttons keep their size */
.msg-tpl-row { display: flex; gap: 6px; align-items: center; }
.msg-tpl-row select { flex: 1; min-width: 0; }
/* Device-list per-object "show on map" checkbox (left of the status dot) + its select-all header row. */
.dl-row .dl-vis { flex: 0 0 auto; margin: 0 4px 0 6px; cursor: pointer; }
.dl-vis-all { display: flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 11px; color: var(--gs-text-3); cursor: pointer; user-select: none; }
.dl-vis-all input { cursor: pointer; }
/* The vendor Leaflet layers.png is missing (Caddy serves index.html in its place), so the base-map
   switcher rendered as a blank white box that clashed with the dark theme. Theme it via the app's
   variables + give it an on-brand layers icon (inline SVG, no file dependency). */
.leaflet-control-layers { background: var(--gs-surface) !important; color: var(--gs-text) !important; border: 1px solid var(--gs-border-3) !important; border-radius: 6px !important; box-shadow: 0 1px 5px rgba(0,0,0,0.28) !important; }
.leaflet-control-layers-toggle { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300A9DF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E") !important; background-size: 22px 22px !important; background-position: center !important; background-repeat: no-repeat !important; }
.leaflet-control-layers-expanded { padding: 8px 12px 8px 10px !important; }
.leaflet-control-layers label { color: var(--gs-text) !important; }
.leaflet-control-layers-separator { border-top: 1px solid var(--gs-border-3) !important; }
.cp-actions { display: flex; gap: 4px; justify-content: center; }
/* Action icons are controls, not text — they must never be squeezed. Default flex-shrink let the row
   crush them from their intended 28px down to 12px (and the link icon to 7px), which is what drew a
   half-finished key. flex:0 0 auto pins each at its real size; the column above is sized to hold the
   whole set, so they stay whole instead of compressing as more icons appear on a row. */
.cp-actions > * { flex: 0 0 auto; }
/* .cp-access-link belongs here too — it sits in the same actions row but was left out of this rule,
   so it rendered at its bare glyph width (15px) beside four 28px buttons and had no hover target. */
.cp-edit, .cp-delete, .cp-loginas, .cp-del-history, .cp-access-link {
  cursor: pointer;
  color: var(--gs-text-3);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: 14px;
  transition: background 0.12s, color 0.12s;
}
.cp-loginas:hover { background: var(--gs-warn-bg); color: var(--gs-warn-fg); }
.cp-edit:hover { background: var(--gs-accent-bg); color: var(--gs-accent); }
.cp-delete:hover { background: var(--gs-danger-bg); color: var(--gs-danger-fg); }
.cp-del-history:hover { background: var(--gs-warn-bg); color: var(--gs-warn-fg); }
.cp-bottom-toolbar { display: flex; gap: 8px; align-items: center; margin-top: 10px; }

.tc-detail-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tc-detail-toolbar select, .tc-detail-toolbar input[type="date"] {
  padding: 7px 10px;
  border: 1px solid var(--gs-border-4);
  border-radius: 4px;
  font-size: 12px;
}
.tc-preset-group { display: flex; gap: 4px; }
.tc-preset-btn {
  padding: 6px 10px;
  border: 1px solid var(--gs-border-4);
  background: var(--gs-surface);
  color: var(--gs-text-2);
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}
.tc-preset-btn:hover { background: var(--gs-surface-3); }
.tc-preset-btn.active { background: var(--gs-accent); border-color: var(--gs-accent); color: var(--gs-on-accent); }
.tc-summary-bar { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--gs-surface-5); border-radius: 4px; font-size: 12px; color: var(--gs-text-2); margin-bottom: 12px; }
.tc-legend { display: flex; align-items: center; gap: 6px; }
.tc-activity-cell { font-size: 17px; text-align: center; }
.tc-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.tc-timeline { display: flex; flex-direction: column; gap: 6px; }
.tc-day-row { display: flex; align-items: center; gap: 10px; }
.tc-day-label { width: 118px; flex-shrink: 0; font-size: 11px; color: var(--gs-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-day-track { position: relative; flex: 1; height: 22px; background: var(--gs-surface-3); border-radius: 3px; overflow: hidden; }
.tc-seg { position: absolute; top: 0; bottom: 0; cursor: default; }
.tc-seg-drive { background: var(--gs-accent); }
.tc-seg-work { background: #f39c12; }
.tc-seg-avail { background: #9b59b6; }
.tc-seg-break { background: #9b59b6; }
.tc-seg-rest { background: var(--gs-surface-3); border-right: 1px solid var(--gs-border-4); }

#reports, #maintenance, #expenses, #tasks, #logbook, #dtc, #tacho, #objects-page, #drivers-page { flex: 1; overflow-y: auto; padding: 16px 24px; }
.rp-list-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rp-search input {
  padding: 7px 10px;
  border: 1px solid var(--gs-border-4);
  border-radius: 4px;
  font-size: 12px;
  width: 220px;
}
.rp-list-actions { display: flex; gap: 8px; }
.rp-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--gs-surface-4);
  color: var(--gs-text-2);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.12s, color 0.12s;
}
.rp-icon-btn:hover { background: var(--gs-accent); color: var(--gs-on-accent); }
.rp-run { cursor: pointer; color: var(--gs-text-3); }
.rp-run:hover { color: var(--gs-accent); }

.rp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 24px; align-items: start; }
.ed-field-inline { margin-bottom: 8px; }
.ed-field-inline label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--gs-text-2); cursor: pointer; }

.eu-apikey-row { display: flex; gap: 6px; }
.eu-apikey-row input { flex: 1; min-width: 0; }
.eu-apikey-row .ed-btn { flex-shrink: 0; padding: 8px 12px; }
input.mono, .mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11.5px; }
.eu-apikey-status { font-size: 10px; font-weight: bold; padding: 2px 8px; border-radius: 10px; margin-left: 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.eu-apikey-status-active { background: var(--gs-ok-bg); color: var(--gs-ok-fg); }
.eu-apikey-status-inactive { background: var(--gs-surface-5); color: var(--gs-text-3); }
.eu-apikey-status-expired { background: var(--gs-warn-bg); color: var(--gs-warn-fg); }
.eu-apikey-status-none { background: var(--gs-surface-5); color: var(--gs-text-3); }
.cp-api-count { font-size: 10.5px; color: var(--gs-text-3); margin-top: 3px; white-space: nowrap; }
.sms-rule-msg { white-space: normal; max-width: 260px; }

.rp-objects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 12px;
  max-height: 130px;
  overflow-y: auto;
  border: 1px solid var(--gs-border);
  border-radius: 4px;
  padding: 8px;
}
.rp-obj-check { font-size: 12px; color: var(--gs-text-2); display: flex; align-items: center; gap: 6px; min-width: 0; }
.rp-obj-check input { flex: 0 0 auto; }

/* Control-panel objects: multi-select + bulk-actions gear menu */
.eu-obj-toolbar { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; flex-wrap: wrap; }
.eu-obj-selall-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gs-text-2); }
.eu-obj-count { font-size: 11px; color: var(--gs-text-4); }
.eu-gear-wrap { position: relative; margin-left: auto; }
.eu-gear-btn { padding: 5px 12px; }
.eu-gear-menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 220px; background: var(--gs-surface); border: 1px solid var(--gs-border-3); border-radius: 8px; box-shadow: 0 10px 30px var(--gs-shadow); z-index: 20; padding: 4px; }
.eu-gear-menu[hidden] { display: none; }
.eu-gear-item { display: block; width: 100%; text-align: left; padding: 8px 12px; background: none; border: none; color: var(--gs-text); border-radius: 6px; cursor: pointer; font-size: 12px; }
.eu-gear-item:hover { background: var(--gs-surface-4); }
.eu-gear-danger { color: var(--gs-danger-fg); }
.eu-obj-hint { margin: 2px 0 6px; }
.eu-obj-item { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.eu-obj-sel { flex: 0 0 auto; margin: 0 1px 0 0; cursor: pointer; }
.eu-obj-off { color: var(--gs-warn-fg); font-size: 10px; }
.ed-input { width: 100%; padding: 8px 10px; background: var(--gs-surface); border: 1px solid var(--gs-border-3); border-radius: 6px; color: var(--gs-text); font: inherit; box-sizing: border-box; }
.ed-input:focus { outline: none; border-color: var(--gs-accent); }
/* Account-editor tabs */
.eu-tabnav { display: flex; gap: 2px; border-bottom: 1px solid var(--gs-border-2); margin: 0 0 14px; flex-wrap: wrap; }
.eu-tabbtn { padding: 8px 14px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--gs-text-3); cursor: pointer; font-size: 12px; }
.eu-tabbtn:hover { color: var(--gs-text); }
.eu-tabbtn.active { color: var(--gs-accent); border-bottom-color: var(--gs-accent); font-weight: 600; }
.eu-obj-tablewrap { max-height: 340px; overflow: auto; }
/* Tacho page: two-button sub-menu switching the Driver cards / Vehicles panels. */
.td-submenu { display: flex; gap: 6px; margin: 4px 0 12px; flex-wrap: wrap; }
.td-tab { background: var(--gs-surface-3); color: var(--gs-text-2); border: 1px solid var(--gs-border-2);
  border-radius: 6px; padding: 7px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 7px; }
.td-tab:hover { background: var(--gs-surface-4); }
.td-tab-n { background: var(--gs-surface-5); color: var(--gs-text-3); border-radius: 10px;
  padding: 1px 7px; font-size: 11px; font-weight: 400; }
.td-tab-archive { margin-left: auto; background: transparent; border-style: dashed; color: var(--gs-text-3); }
.td-tab-archive:hover { background: var(--gs-surface-4); color: var(--gs-text); }
.td-tab-on { background: var(--gs-accent); border-color: var(--gs-accent); color: var(--gs-on-accent); }
.td-tab-on .td-tab-n { background: rgba(255,255,255,0.22); color: var(--gs-on-accent); }
.td-tab:focus-visible { outline: 2px solid var(--gs-accent); outline-offset: 2px; }

/* Tacho page: card-lane strip, shown only when an account holds more than one company card. Kept
   visually lighter than .td-tab so the page reads as "which card" above "which kind of file". */
.td-lanes { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.td-lanes-cap { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gs-text-3); margin-right: 2px; }
.td-lane { background: transparent; color: var(--gs-text-2); border: 1px solid var(--gs-border-2);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.td-lane:hover { background: var(--gs-surface-4); color: var(--gs-text); }
.td-lane-on { background: var(--gs-surface-5); border-color: var(--gs-accent); color: var(--gs-text); }
.td-lane:focus-visible { outline: 2px solid var(--gs-accent); outline-offset: 2px; }

.ao-idrow { display: flex; gap: 6px; margin-top: 8px; }
.ao-idrow .ed-input { flex: 1; }
.ao-idresult { font-size: 11px; margin-top: 6px; }
.ao-idhit { color: var(--gs-ok-fg); }
.ao-idalready { color: var(--gs-text-2); }
.ao-idmiss { color: var(--gs-danger-fg); }
.ao-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--gs-border-2); border-radius: 6px; padding: 8px; margin-top: 8px; }
.ao-item { cursor: pointer; }
/* Assign-object picker: Select-all bar + collapsible per-group sections. The 2-column object grid now
   lives inside each group body; the list itself is a plain block so group headers span full width. */
.ao-selall-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--gs-text); cursor: pointer; user-select: none; }
.ao-count { color: var(--gs-text-2); font-weight: 400; }
.ao-group + .ao-group { margin-top: 4px; }
.ao-group-header { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 6px; font-size: 11px; font-weight: 600; color: var(--gs-text-2); background: var(--gs-surface-4); border-radius: 4px; user-select: none; }
.ao-group-header:hover { background: var(--gs-surface-5); }
.ao-group-arrow { font-size: 9px; transition: transform 0.12s; }
.ao-group.ao-collapsed .ao-group-arrow { transform: rotate(-90deg); }
.ao-group-count { margin-left: auto; color: var(--gs-text-3); font-weight: 400; }
/* Single object per row (a plain list, not a multi-column grid) — matches the app's other pickers. */
.ao-group-body { display: flex; flex-direction: column; gap: 1px; padding: 4px 2px 2px; }
.ao-group-body .ao-item { padding: 3px 6px; border-radius: 4px; }
.ao-group-body .ao-item:hover { background: var(--gs-surface-4); }
.ao-group.ao-collapsed .ao-group-body { display: none; }
/* Object-list top action bar: refresh + a grouped selection toolbar (visibility vs. delete) */
.cp-toolbar { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; flex-wrap: wrap; }
.cp-toolbar-sel { display: inline-flex; align-items: center; gap: 10px; padding: 3px 6px 3px 11px; background: var(--gs-accent-bg); border: 1px solid var(--gs-border-2); border-radius: 8px; }
.cp-toolbar-sel .cp-selected-count { font-weight: 600; color: var(--gs-accent-2); }
.cp-toolbar-group { display: inline-flex; align-items: center; gap: 2px; padding: 2px 5px; background: var(--gs-surface); border: 1px solid var(--gs-border-3); border-radius: 6px; }
.cp-toolbar-danger { border-color: var(--gs-danger-fg); }
.cp-toolbar-danger .rp-icon-btn:hover { background: var(--gs-danger-bg); }
.cp-toolbar-clear { color: var(--gs-text-4); font-size: 17px; line-height: 1; }
/* Objects-tab selection gear: sits inline in the toolbar (not pushed right) and opens to the right. */
.cp-sel-gear-wrap { margin-left: 0; }
.cp-sel-gear-menu { left: 0; right: auto; min-width: 260px; }
.cp-sel-gear-menu .eu-gear-item { white-space: nowrap; }
.cp-toolbar-clear:hover { color: var(--gs-text); }

/* ── Collapsible multi-select (GsMultiSelect) ────────────────────────────────
   Collapsed it reads like a <select>; open it holds a search box, a select-all row and the
   checkboxes. Everything is driven by the --gs-* tokens, so light and dark both follow the
   theme without a second rule set. */
.gs-ms { position: relative; min-width: 0; }
.gs-ms-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  text-align: left;
  color: var(--gs-text-3);
  background: var(--gs-surface);
  border: 1px solid var(--gs-border-4);
  border-radius: 4px;
  cursor: pointer;
}
.gs-ms-trigger:disabled { cursor: default; opacity: 0.7; }
.gs-ms-trigger:focus-visible { outline: 2px solid var(--gs-accent); outline-offset: 1px; }
.gs-ms.gs-ms-has .gs-ms-summary { color: var(--gs-text-2); }
.gs-ms-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gs-ms-caret { flex: 0 0 auto; font-size: 10px; color: var(--gs-text-3); }
.gs-ms.gs-ms-open .gs-ms-caret { transform: rotate(180deg); }

.gs-ms-panel {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  min-width: 210px;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  background: var(--gs-surface);
  border: 1px solid var(--gs-border-3);
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
/* MUST outrank the display:flex above. The close path sets the `hidden` attribute, which only works
   through the user-agent rule [hidden]{display:none} — a bare class selector setting display beats
   it on specificity, and the panel stays on screen with hidden="" set. Asserting on the .hidden
   property looks fine in that state; only the computed style tells the truth. */
.gs-ms-panel[hidden] { display: none; }
.gs-ms-panel.gs-ms-up { top: auto; bottom: calc(100% + 2px); }
.gs-ms[data-ms-compact] .gs-ms-panel { max-height: 220px; }
/* Object-data-list chooser: a roomier dropdown than the default — this list carries every section,
   field, stat AND every sensor across the account, so give it more height and width to scroll in. */
.st-dp-picker .gs-ms-panel { min-width: 360px; max-height: min(66vh, 560px); }
.st-dp-picker .gs-ms-list { flex: 1 1 auto; min-height: 0; }
@media (max-width: 480px) { .st-dp-picker .gs-ms-panel { min-width: 0; } }

.gs-ms-search { padding: 6px; border-bottom: 1px solid var(--gs-border); flex: 0 0 auto; }
.gs-ms-search input {
  width: 100%;
  padding: 4px 7px;
  font-size: 11px;
  font-family: inherit;
  color: var(--gs-text-2);
  background: var(--gs-surface-2);
  border: 1px solid var(--gs-border-3);
  border-radius: 3px;
}
.gs-ms-list { overflow-y: auto; padding: 2px 0; }

.gs-ms-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  font-size: 12px;
  color: var(--gs-text-2);
  cursor: pointer;
  min-width: 0;
}
.gs-ms-item:hover { background: var(--gs-surface-3); }
.gs-ms-item input { flex: 0 0 auto; margin: 0; }
.gs-ms-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gs-ms-all { border-bottom: 1px solid var(--gs-border); font-weight: 600; flex: 0 0 auto; }
.gs-ms-group {
  padding: 6px 9px 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gs-text-3);
  text-transform: uppercase;
}
.gs-ms-noresult { padding: 8px 9px; font-size: 11px; color: var(--gs-text-3); }

/* ---- Dropdowns: more visible + enlargeable (user request 2026-08-07) ---- */
/* Multi-select pickers (object/device/column/data-list choosers): taller by default, drag-to-enlarge
   from the corner, stronger edge + shadow so they stand off the page, and roomier rows. */
.gs-ms-panel {
  min-width: 240px;
  max-height: 62vh;
  resize: both;
  overflow: hidden;
  border-color: var(--gs-border-4);
  box-shadow: 0 14px 40px var(--gs-shadow), 0 0 0 1px var(--gs-border-3);
}
.gs-ms-list { flex: 1 1 auto; min-height: 0; }   /* fill the (now resizable) panel and scroll inside */
.gs-ms-item { padding: 6px 10px; }               /* larger click targets */
.gs-ms-trigger { border-color: var(--gs-border-4); }
.gs-ms-trigger:hover { border-color: var(--gs-accent); }

/* Gear / actions pop-up menus: stronger edge + shadow, a touch wider. */
.eu-gear-menu { min-width: 240px; border-color: var(--gs-border-4); box-shadow: 0 14px 40px var(--gs-shadow); }

/* Device-panel sensor picker: taller and drag-resizable instead of a fixed 200px cap. */
.dp-sensor-picker {
  max-height: 48vh;
  resize: vertical;
  overflow: auto;
  border: 1px solid var(--gs-border-4);
  border-radius: 6px;
  padding: 6px;
}

/* Native <select> fields: a clear custom caret + hover border so they read plainly as dropdowns. */
.ed-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'><path d='M1 1l5 5 5-5' fill='none' stroke='%239aa7b4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.ed-field select:hover { border-color: var(--gs-accent); }
.rp-modal-slot .ed-body { max-height: 75vh; }

/* â”€â”€ Bottom nav hidden on desktop; shown via mobile media query below â”€â”€â”€â”€ */
#gs-bottom-nav { display: none; }

/* â”€â”€ Mobile sidebar toggle button (hidden on desktop) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#gs-sidebar-toggle {
  display: none; /* shown only in mobile media query below */
  position: absolute;
  bottom: 72px;
  right: 12px;
  z-index: 450;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gs-accent);
  color: var(--gs-on-accent);
  font-size: 21px;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  line-height: 1;
}
#gs-sidebar-toggle:active { background: #0090c0; }
#gs-sidebar-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 399;
}
#gs-sidebar-overlay.gs-visible { display: block; }

/* â”€â”€ Log manager — dropdown + modals â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.lm-dropdown {
  position: fixed;
  z-index: 2000;
  background: var(--gs-surface);
  border: 1px solid var(--gs-border-2);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16);
  min-width: 160px;
  padding: 4px 0;
  overflow: hidden;
}
.lm-dd-item {
  padding: 9px 16px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  transition: background 0.1s;
}
.lm-dd-item:hover { background: var(--gs-accent-bg); }
.lm-modal { width: min(720px, 94vw); }
.lm-body { display: flex; flex-direction: column; gap: 0; min-height: 120px; }
.lm-loading, .lm-empty, .lm-err { padding: 24px; text-align: center; color: var(--gs-text-3); font-size: 12px; }
.lm-err { color: #c0392b; }
.lm-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gs-border);
  flex-shrink: 0;
}
.lm-month-label { font-size: 12px; font-weight: 600; color: var(--gs-text); flex: 1; }
.lm-btn {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--gs-border-4);
  border-radius: 5px;
  background: var(--gs-surface-2);
  color: var(--gs-text);
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
  transition: background 0.1s, border-color 0.1s;
}
.lm-btn:hover { background: var(--gs-accent-bg); border-color: var(--gs-accent); color: #006fa6; }
.lm-btn:disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.lm-btn-dl { border-color: var(--gs-accent); color: var(--gs-accent); background: var(--gs-accent-bg); }
.lm-btn-dl:hover { background: var(--gs-accent-bg); }
.lm-scroll-area { overflow-y: auto; overflow-x: auto; max-height: 55vh; flex: 1; }
.lm-file-table, .lm-entry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.lm-file-table th, .lm-file-table td,
.lm-entry-table th, .lm-entry-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--gs-border);
  text-align: left;
  vertical-align: middle;
}
.lm-file-table th, .lm-entry-table th { background: var(--gs-surface-3); font-weight: 600; font-size: 10.5px; color: var(--gs-text-3); }
.lm-file-table tr:hover td, .lm-entry-table tr:hover td { background: var(--gs-surface-2); }
/* Same fit-the-panel rule as .cp-table above — the log viewer is the other place with wide rows
   (long file paths and raw log lines, neither of which contains a space to wrap at), so it needs
   overflow-wrap for the same reason. .lm-scroll-area keeps overflow-x as a last-resort fallback. */
.lm-file-table th, .lm-file-table td,
.lm-entry-table th, .lm-entry-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
@media (max-width: 1200px) {
  .lm-file-table, .lm-entry-table { font-size: 10.5px; }
  .lm-file-table th, .lm-file-table td,
  .lm-entry-table th, .lm-entry-table td { padding: 6px 7px; }
}
@media (max-width: 900px) {
  .lm-file-table, .lm-entry-table { font-size: 10px; }
  .lm-file-table th, .lm-file-table td,
  .lm-entry-table th, .lm-entry-table td { padding: 5px 5px; }
}
/* The generic cell rule above forces max-width:0 + overflow:hidden (ellipsis for long log paths); on
   the Actions cell that collapsed its View/Download buttons to a sliver. This more-specific selector
   (0,2,1 beats the 0,1,1 generic td rule) exempts the actions cell so its buttons keep their width. */
.lm-file-table td.lm-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; max-width: none; overflow: visible; }
.lm-mono { font-family: 'Courier New', monospace; font-size: 11px; }
.lm-ev-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.lm-ev-ok   { background: var(--gs-ok-bg); color: var(--gs-ok-fg); }
.lm-ev-out  { background: var(--gs-surface-3); color: var(--gs-text-3); }
.lm-ev-fail { background: var(--gs-danger-bg); color: var(--gs-danger-fg); }
.lm-cur-badge { display: inline-block; padding: 1px 5px; border-radius: 8px; font-size: 10px; font-weight: 600; background: var(--gs-warn-bg); color: var(--gs-warn-fg); margin-left: 4px; vertical-align: middle; }
.lm-sz { color: var(--gs-text-3); }

/* â”€â”€ Settings Objects tab — visibility + edit buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.st-obj-actions { display: flex; gap: 6px; align-items: center; }
.st-vis-btn, .st-edit-obj-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.12s, opacity 0.12s;
  opacity: 0.7;
}
.st-vis-btn:hover, .st-edit-obj-btn:hover { background: var(--gs-accent-bg); opacity: 1; }
.st-vis-btn:disabled { opacity: 0.35; cursor: default; }
.st-vis-hidden { opacity: 0.35; }
.st-vis-hidden:hover { opacity: 0.7; }

/* Settings → Objects: search + multi-select toolbar and sortable headers */
.st-obj-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 0 10px; flex-wrap: wrap; }
.st-obj-toolbar .st-obj-search { flex: 0 0 240px; padding: 5px 8px; border: 1px solid var(--gs-border-4); border-radius: 4px; font-size: 12px; }
.st-obj-toolbar .st-obj-spacer { flex: 1 1 auto; }
.st-obj-selcount { font-size: 11px; color: var(--gs-text-2); }
.st-obj-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.st-obj-sort:hover { color: var(--gs-accent); }
.st-obj-check, #st-obj-selall { cursor: pointer; }

.st-group-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 0 8px; }
.st-new-group-input { flex: 0 0 220px; padding: 5px 8px; border: 1px solid var(--gs-border-4); border-radius: 4px; font-size: 12px; }
.st-group-save-btn, .st-group-cancel-btn { font-size: 13px; }
.st-empty-note { color: var(--gs-text-3); font-size: 12px; padding: 16px 0; }
.st-group-sel { border: 1px solid var(--gs-border-3); border-radius: 4px; padding: 3px 6px; font-size: 11px; color: var(--gs-text-2); background: var(--gs-surface-2); cursor: pointer; }
.st-group-sel:disabled { opacity: 0.4; }
.st-new-group-form { background: var(--gs-surface-3); border: 1.5px solid var(--gs-border-3); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.st-new-group-row { display: flex; gap: 8px; align-items: center; }
.st-device-picker { display: flex; flex-direction: column; }
.st-device-picker-toggle { display: flex; align-items: center; gap: 7px; background: none; border: 1.5px solid var(--gs-border-3); border-radius: 6px; padding: 7px 12px; font-size: 12px; color: var(--gs-text); cursor: pointer; text-align: left; width: 100%; }
.st-device-picker-toggle:hover { border-color: var(--gs-accent); background: var(--gs-accent-bg); }
.st-device-picker-arrow { font-size: 10px; color: var(--gs-text-3); }
.st-device-picker-count { margin-left: auto; background: var(--gs-accent); color: var(--gs-on-accent); font-size: 10px; font-weight: 600; padding: 1px 8px; border-radius: 10px; }
.st-device-picker-hint { margin-left: auto; font-size: 10px; color: var(--gs-text-4); font-style: italic; }
.st-device-picker-list { border: 1.5px solid var(--gs-border-3); border-top: none; border-radius: 0 0 6px 6px; background: var(--gs-surface); max-height: 220px; overflow-y: auto; }
.st-device-check-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; font-size: 12px; color: var(--gs-text); border-bottom: 1px solid var(--gs-border-2); }
.st-device-check-row:last-child { border-bottom: none; }
.st-device-check-row:hover { background: var(--gs-surface-3); }
.st-device-check-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--gs-accent); flex-shrink: 0; cursor: pointer; }
.st-new-group-actions { display: flex; gap: 8px; }
.st-color-field { display: flex; align-items: center; gap: 8px; }
.st-color-field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gs-accent); cursor: pointer; flex-shrink: 0; }
/* Status dot colours: four small pickers with their names, then the reset button, wrapping on phones. */
.st-dot-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ed-field .st-dot-colors label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; font-weight: normal; }
.st-dot-colors input[type="color"] { width: 34px; height: 26px; padding: 2px; border: 1px solid var(--gs-border-3); border-radius: 4px; cursor: pointer; background: none; }
.st-dot-reset { font-size: 11px; padding: 4px 10px; border: 1px solid var(--gs-border-3); border-radius: 4px; background: var(--gs-surface); color: var(--gs-text-2); cursor: pointer; }
.st-dot-reset:hover:not(:disabled) { border-color: var(--gs-accent); color: var(--gs-accent); }
.st-dot-reset:disabled { opacity: 0.5; cursor: default; }
.st-theme-picker { width: 44px; height: 28px; padding: 2px; border: 1px solid var(--gs-border-3); border-radius: 4px; cursor: pointer; background: none; }
/* A custom background colour decides light or dark by itself (theme.js paintBg), so the Light/Dark
   button would do nothing visible -- hidden until the account goes back to Standard. */
:root[data-custom-bg] #tb-theme { display: none; }
/* Custom toolbar colour (theme.js paintToolbar): the toolbar's own rules keep using the theme tokens;
   inside the bar those tokens are simply re-pointed at the toolbar palette. */
:root[data-custom-toolbar] #toolbar,
:root[data-custom-toolbar] #gs-bottom-nav {
  --gs-surface: var(--gs-tb-bg);
  --gs-surface-2: var(--gs-tb-bg);
  --gs-surface-5: var(--gs-tb-hover);
  --gs-border: var(--gs-tb-border);
  --gs-border-2: var(--gs-tb-border);
  --gs-text-2: var(--gs-tb-ink);
  --gs-text-3: var(--gs-tb-ink-2);
  --gs-accent: var(--gs-tb-accent);
}
.st-color-field input[type="color"] { width: 44px; height: 28px; padding: 2px; border: 1px solid var(--gs-border-3); border-radius: 4px; cursor: pointer; background: none; }
.st-group-expand-btn { cursor: pointer; user-select: none; font-size: 10px; color: var(--gs-text-3); display: inline-block; padding: 2px 4px; }
.st-group-expand-btn:hover { color: var(--gs-text); }
.st-group-members-row > td { padding: 0 4px 8px !important; }
.st-group-members { background: var(--gs-surface-3); border-radius: 4px; padding: 8px 10px; }
.st-group-device-item { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--gs-border-2); font-size: 12px; color: var(--gs-text); }
.st-group-device-item:last-of-type { border-bottom: none; }
.st-group-remove-device { background: none; border: none; cursor: pointer; color: var(--gs-text-4); font-size: 14px; padding: 0 4px; line-height: 1; }
.st-group-remove-device:hover { color: #c0392b; }
.st-group-add-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--gs-border-2); }
.st-group-add-sel { flex: 1; border: 1px solid var(--gs-border-4); border-radius: 4px; padding: 4px 6px; font-size: 11px; color: var(--gs-text); }

@media (max-width: 640px) {
  /* â”€â”€ Reports/dialogs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .rp-grid { grid-template-columns: 1fr; }
  .rp-objects { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .ed-modal, .ed-modal-wide, .rp-modal-slot .ed-modal-wide { width: 96vw; max-height: 90vh; }
  /* Disable JS resize handle on mobile — touch resize is not useful */
  .gs-dlg-resize-handle { display: none; }

  /* â”€â”€ Map toolbar — hide labels/measure/fullscreen on mobile â”€â”€ */
  #mt-labels, #mt-measure, #mt-fullscreen { display: none; }

  /* â”€â”€ Toolbar — compact icon-only mode on mobile â”€â”€ */
  /* The toolbar must FIT the screen, not scroll off it. A phone is 360-430px wide and the bar can
     carry a dozen icons, so fixed-width items always overflowed — the right-hand ones (theme, logout)
     simply sat off-screen with nothing to indicate it. Now the two sides share the width and the items
     inside each divide what they get, so every icon is reachable at any phone width.
     overflow-x stays as a last-resort safety net for an implausible number of items. */
  #toolbar { height: 52px; padding: 0 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0; }
  #toolbar .tb-left { flex: 1 1 auto; min-width: 0; }
  #toolbar .tb-right { flex: 0 0 auto; }
  .tb-side { min-width: 0; }
  /* flex-shrink is re-enabled (the desktop rule pins it to 0) and min-width drops to a thumb-sized
     floor, so N icons divide the available width evenly instead of pushing each other off the edge. */
  .tb-item { width: auto; min-width: 0; flex: 1 1 0; height: 48px; padding: 0 2px; }
  .tb-label { display: none; }
  .tb-icon { font-size: 19px; }
  .tb-badge { top: 1px; right: 2px; }
  .tb-desktop-only { display: none !important; }
  /* Branding is not a control. On a phone it was eating ~90px in the middle of the one row the
     operator actually needs, so it steps aside there — the page title and the login screen still
     carry it. */
  .tb-brand { display: none; }
  .tb-sep-v { margin: 0 1px; }
  /* Theme toggle sized against Logout so the last two controls read as a matched pair, with room
     between them — Logout is the one irreversible thing on the bar and should not be a thumb-width
     from a toggle you press casually. */
  #tb-theme { margin-right: 12px; }
  #tb-theme .tb-icon { width: 22px; height: 22px; }
  #tb-theme .tb-icon svg { width: 22px; height: 22px; }
  .tb-icon-exit { font-size: 11px !important; }

  /* Map tools 25% down from 32px/14px: the toolbar floats over the map and on a phone it was taking
     more of it than a set of secondary controls should. */
  #map-toolbar { gap: 3px; }
  .mt-btn { width: 24px; height: 24px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.3); font-size: 11px; }
  /* Data points: on a phone the History panel's labelled checkbox is off-screen while you are looking
     at the map, so the same switch is given a button here. */
  #mt-points { display: flex; }
  /* Theme and Logout sat shoulder to shoulder at the right edge, and Logout is the one control here
     you never want hit by accident. Push the theme toggle left so there is a deliberate gap between
     "change how it looks" and "end the session". */
  #tb-theme { margin-right: 10px; }

  /* â”€â”€ Sidebar — fixed slide-over from the left â”€â”€â”€ */
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 82vw;
    max-width: 300px;
    height: 100%;
    z-index: 1000;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    box-shadow: none;
    border-right: 1px solid var(--gs-border-2);
  }
  #sidebar.gs-mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.25);
  }
  #sidebar-resize-handle { display: none; }
  #gs-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0,0,0,0.35);
  }
  #gs-sidebar-toggle { display: none !important; }

  /* â”€â”€ Main body: leave room for bottom nav â”€â”€â”€â”€â”€â”€â”€ */
  #main-body { padding-bottom: 0; }

  /* â”€â”€ Bottom navigation bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  /* Retired 2026-08-21: this bar carried Home / Objects / Reports, which are the same three buttons
     already sitting in the toolbar above it — the icons appeared twice on every phone screen. Hidden
     here rather than deleted in app.js because wireMobileBottomNav() also owns the sidebar open/close
     API that the rest of app.js calls (lines 298/300/375); the element is still built and still tracks
     its active tab, it is simply never drawn. Restore by putting `display: flex` back. */
  #gs-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--gs-surface);
    border-top: 1px solid var(--gs-border-2);
    z-index: 300;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  }
  .gsbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .gsbn-item:active { background: var(--gs-surface-4); }
  .gsbn-icon { font-size: 24px; color: var(--gs-text-3); line-height: 1; }
  .gsbn-label { display: none; }   /* icons-only bottom nav on phone — the labels are redundant */
  .gsbn-item.active .gsbn-icon { color: var(--gs-accent); }

  /* â”€â”€ Popovers / Places panel — clamp to viewport â”€ */
  .gs-popover {
    left: 6px !important;
    right: 6px !important;
    width: auto !important;
    min-width: unset !important;
    max-width: calc(100vw - 12px) !important;
    max-height: 75vh;
    overflow-y: auto;
  }
  .pl-panel {
    left: 6px !important;
    right: 6px !important;
    width: auto !important;
    max-height: 70vh;
  }

  /* â”€â”€ Login page â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .login-card { width: 100%; padding: 24px 20px; }

  /* â”€â”€ Places draw toolbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .pl-draw-toolbar { font-size: 10px; padding: 6px 10px; gap: 6px; }
  .pl-draw-hint { display: none; } /* hint text too long for mobile */

  /* â”€â”€ Device panel — Graph and Messages tabs desktop-only â”€â”€ */
  .dp-tab-desktop { display: none; }
}

.gs-popover {
  position: fixed;
  z-index: 2000;
  background: var(--gs-surface);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  padding: 12px;
  min-width: 220px;
}
.gs-popover-title { font-size: 11px; font-weight: bold; color: var(--gs-accent); margin-bottom: 8px; }
.gs-popover-field { margin-bottom: 8px; }
.gs-popover-field label { display: block; font-size: 10px; color: var(--gs-text-3); margin-bottom: 2px; }
.gs-popover-field input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--gs-border-4);
  border-radius: 4px;
  font-size: 12px;
}
.gs-popover-status { font-size: 10px; color: var(--gs-text-3); margin-top: 6px; }
.gs-popover-note { font-size: 10px; color: #b45309; margin-bottom: 8px; }

/* â”€â”€ Places panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.pl-panel {
  position: fixed;
  z-index: 2000;
  background: var(--gs-surface);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
  width: 260px;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pl-tabs {
  display: flex;
  border-bottom: 1px solid var(--gs-border-2);
}
.pl-tab {
  flex: 1;
  padding: 9px 6px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: var(--gs-text-4);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.pl-tab:hover { color: var(--gs-accent); }
.pl-tab.pl-active { color: var(--gs-accent); border-bottom-color: var(--gs-accent); }
.pl-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.pl-empty { padding: 14px 12px; font-size: 11px; color: var(--gs-text-4); text-align: center; }
.pl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--gs-border);
}
.pl-item:last-child { border-bottom: none; }
.pl-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pl-icon { width: 16px; height: 16px; flex-shrink: 0; object-fit: contain; }
.pl-group {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gs-text-3);
  background: var(--gs-surface-2);
  border-bottom: 1px solid var(--gs-border);
}
.pl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.pl-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  color: var(--gs-text-3);
  border-radius: 3px;
  line-height: 1;
}
.pl-icon-btn:hover { background: var(--gs-surface-3); color: var(--gs-accent); }
.pl-icon-btn.pl-danger:hover { background: var(--gs-danger-bg); color: var(--gs-danger-fg); }
.pl-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--gs-border-2);
}
.pl-add-btn { width: 100%; }

/* form */
.pl-form-header {
  background: var(--gs-accent);
  color: var(--gs-on-accent);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pl-form-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.pl-field { display: flex; flex-direction: column; gap: 4px; }
.pl-field label { font-size: 10px; color: var(--gs-text-4); font-weight: 600; }
.pl-field input[type="text"] {
  padding: 6px 8px;
  border: 1px solid var(--gs-border-4);
  border-radius: 4px;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}
.pl-field-check { flex-direction: row; align-items: center; justify-content: space-between; }
.pl-field-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.pl-color-row { display: flex; align-items: center; gap: 8px; }
.pl-color-row input[type="color"] { width: 48px; height: 28px; border: 1px solid var(--gs-border-4); border-radius: 4px; cursor: pointer; padding: 1px; }
.pl-color-hex { font-size: 11px; font-family: monospace; color: var(--gs-text-3); }
.pl-form-err { min-height: 18px; font-size: 10px; color: #e53935; padding: 0 14px; }
.pl-form-footer { padding: 8px 14px 12px; display: flex; gap: 8px; border-top: 1px solid var(--gs-border-2); }

/* draw toolbar — floats above the map */
.pl-draw-toolbar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  background: rgba(30,30,30,0.88);
  color: var(--gs-on-accent);
  border-radius: 6px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  pointer-events: all;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4);
}
.pl-draw-type {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--gs-on-accent);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
  transition: background .15s;
}
.pl-draw-type:hover { background: rgba(255,255,255,0.22); }
.pl-draw-type.pl-dt-active { background: var(--gs-accent); border-color: var(--gs-accent); }
.pl-draw-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.2); }
.pl-draw-hint { color: rgba(255,255,255,0.82); font-size: 11px; }
.pl-draw-cancel {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--gs-on-accent);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
}
.pl-draw-cancel:hover { background: rgba(255,0,0,0.25); }


#gs-toast-host {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}
.gs-toast {
  background: var(--gs-surface);
  border-left: 3px solid var(--gs-accent);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  padding: 10px 14px;
  font-size: 11px;
  color: var(--gs-text-2);
  opacity: 1;
  transition: opacity 0.4s;
}
.gs-toast-out { opacity: 0; }

.gs-marker { background: transparent; border: none; }
.gs-marker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
.gs-marker-arrow {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 16px solid #FF0000;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.6));
}
.gs-marker-emoji { font-size: 21px; line-height: 1; text-align: center; }

/* Object backup/import dialog */
.bk-exp-options { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; width: 100%; }
.bk-exp-option {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--gs-text);
  background: var(--gs-surface-3); border: 1.5px solid var(--gs-border-3);
  border-radius: 7px; width: 100%; box-sizing: border-box;
  transition: border-color 0.14s, background 0.14s;
}
.bk-exp-option:hover:not(.bk-exp-disabled) { border-color: var(--gs-accent); background: var(--gs-accent-bg); }
.bk-exp-option input[type="radio"] {
  width: 17px; height: 17px; flex-shrink: 0;
  accent-color: var(--gs-accent); cursor: pointer;
}
.bk-exp-option-text { display: flex; flex-direction: column; gap: 2px; }
.bk-exp-hint { font-size: 10px; color: var(--gs-text-3); font-style: normal; font-weight: 400; }
.bk-exp-disabled { opacity: 0.48; cursor: default; pointer-events: none; }
.bk-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.bk-sum-item { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 20px; }
.bk-new   { background: var(--gs-ok-bg); color: var(--gs-ok-fg); }
.bk-exists{ background: var(--gs-warn-bg); color: var(--gs-warn-fg); }
.bk-skip  { background: var(--gs-danger-bg); color: var(--gs-danger-fg); }
.bk-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px; letter-spacing: 0.02em; text-transform: uppercase; }
.bk-badge-new    { background: var(--gs-ok-bg); color: var(--gs-ok-fg); }
.bk-badge-exists { background: var(--gs-warn-bg); color: var(--gs-warn-fg); }
.bk-badge-skip   { background: var(--gs-danger-bg); color: var(--gs-danger-fg); }

/* Light punch on the already-saturated categorized traffic tiles so green/red read clearly */
.gs-traffic-tiles { filter: saturate(1.4) contrast(1.15); }

/* Tachograph detail: activity data-source badge (live tacho vs GPS estimate) */
.tc-src { display:inline-block; padding:2px 9px; border-radius:11px; font-size:11px; font-weight:600; }
.tc-src-tacho { background: var(--gs-ok-bg); color: var(--gs-ok-fg); }
.tc-src-gps   { background: var(--gs-warn-bg); color: var(--gs-warn-fg); }

/* Generic table tools (GsTableTools): click-to-sort headers + per-table search box on every .cp-table */
.cp-table th.gs-sortable { cursor: pointer; user-select: none; }
.cp-table th.gs-sortable:hover { filter: brightness(1.18); }
.gs-sort-arrow { color: #00A9DF; font-size: 10px; }
.gs-tbl-tools { margin: 0 0 8px; }
.gs-tbl-search { width: 260px; max-width: 100%; padding: 6px 11px; border-radius: 6px; border: 1px solid var(--gs-border-4); background: var(--gs-surface); color: var(--gs-text); font-size: 12px; }
.gs-tbl-search:focus { outline: none; border-color: #00A9DF; box-shadow: 0 0 0 2px #00A9DF33; }

/* ---- Tacho-download decoded-view modal (tachodl.js) ---- */
/* The new-card naming control (input + "Name it" button, 2026-08-28) must never be clipped by the
   generic single-line-cell rules above (.cp-table td / .cp-table td > *, line ~1111/1125) -- those
   assume one plain value per cell and ellipsis anything too long, which silently hid this button
   past the column's right edge instead of showing it. This is the one cell that holds an editable
   input and an action button together; wrapping the button to its own line if the column is ever
   too narrow is far better than an unreachable control. Both selectors carry 3 classes' worth of
   specificity, so they win over the 2-class base rules regardless of where they sit in this file. */
.cp-table td.td-card-claim-cell { white-space: normal; overflow: visible; text-overflow: clip; }
.cp-table td .td-card-claim {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  overflow: visible; white-space: normal; max-width: none;
}
.td-view { margin-right: 6px; }
.td-modal-overlay {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.td-modal-box {
  background: var(--gs-surface); color: var(--gs-text);
  border: 1px solid var(--gs-border-2); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  display: flex; flex-direction: column;
  width: 780px; max-width: 95vw; height: 78vh; max-height: 90vh;
  /* user-resizable: drag the bottom-right corner */
  resize: both; overflow: hidden; min-width: 360px; min-height: 260px;
}
.td-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--gs-border-2); flex: 0 0 auto;
}
.td-modal-title { font-weight: 600; font-size: 13px; word-break: break-all; }
.td-modal-close {
  background: none; border: none; font-size: 23px; line-height: 1;
  color: var(--gs-text-3); cursor: pointer; padding: 0 4px;
}
.td-modal-close:hover { color: var(--gs-text); }
.td-modal-body { padding: 16px; overflow: auto; flex: 1 1 auto; }

/* Driver + Totals info cards, shown side by side (stack on narrow) */
.td-info-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.td-info-card {
  flex: 1 1 260px; min-width: 240px;
  background: var(--gs-surface-2); border: 1px solid var(--gs-border-2); border-radius: 8px;
  padding: 10px 14px;
}
.td-info-cap {
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--gs-text-4); font-weight: 600; margin-bottom: 6px;
}
.td-info { width: 100%; border-collapse: collapse; font-size: 12px; }
.td-info th {
  text-align: left; font-weight: 500; color: var(--gs-text-3);
  padding: 3px 14px 3px 0; white-space: nowrap; vertical-align: top; width: 1%;
}
.td-info td { padding: 3px 0; color: var(--gs-text); }
.td-info-totals td { text-align: right; font-variant-numeric: tabular-nums; }
.td-info code, .cp-table code { background: var(--gs-surface-4); padding: 1px 5px; border-radius: 4px; font-size: 11px; }

.td-daytable td, .td-daytable th { font-variant-numeric: tabular-nums; }
.td-dec { color: var(--gs-text-4); font-size: 10px; }
/* Working-time columns (Drive+Work+Avail total and its decimal) — subtly highlighted */
.td-wtcol { background: var(--gs-accent-bg); }
.cp-table td.td-wtcol { color: var(--gs-text); font-weight: 500; }
.td-total-row td {
  font-weight: 600; color: var(--gs-text);
  border-top: 2px solid var(--gs-border-3); background: var(--gs-surface-2);
}
.td-total-row td:first-child { text-transform: uppercase; letter-spacing: .03em; font-size: 11px; }
.td-blocks { display: flex; flex-wrap: wrap; gap: 6px; }
.td-block { background: var(--gs-surface-4); border: 1px solid var(--gs-border-2); border-radius: 12px; padding: 2px 10px; font-size: 11px; color: var(--gs-text-2); }

/* Schedule card */
.td-sched { background: var(--gs-surface-2); border: 1px solid var(--gs-border-2); border-radius: 8px; padding: 12px 14px; margin-bottom: 4px; }
.td-sched-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.td-sched-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gs-text-2); white-space: nowrap; }
.td-sched-field input { width: 62px; padding: 5px 8px; border: 1px solid var(--gs-border-3); border-radius: 6px; background: var(--gs-surface); color: var(--gs-text); font-size: 12px; text-align: right; }
.td-sched-field input[type="radio"] { width: auto; padding: 0; margin: 0; }
.td-sched-hint { font-size: 10px; color: var(--gs-text-4); margin-top: 8px; }
.td-sched-msg { font-size: 11px; color: var(--gs-accent); }
.td-sched-msg.td-err { color: var(--gs-danger-fg, #c0392b); }
.td-sched-divider { border-top: 1px solid var(--gs-border-2); margin: 14px 0 12px; }
.td-agent-row { align-items: center; }
.td-agent-hint { margin-top: 0; flex: 1 1 320px; }

/* Download-status table — columns fully visible (no ellipsis); long vehicle names wrap */
.td-status td, .td-status th { white-space: nowrap; overflow: visible; text-overflow: clip; vertical-align: middle; }
.td-status .td-vehcell { white-space: normal; min-width: 150px; font-weight: 500; color: var(--gs-text); }
.td-status .td-actioncell { white-space: nowrap; }
.td-status .td-force { padding: 3px 10px; font-size: 11px; margin-right: 4px; }
.td-queued { display: inline-block; font-size: 10px; color: var(--gs-accent); background: var(--gs-accent-bg); border: 1px solid var(--gs-accent); border-radius: 10px; padding: 2px 9px; margin-right: 4px; }
.td-muted { color: var(--gs-text-4); }
.td-due { color: #c0392b; font-weight: 600; }

/* Status header with the Select-vehicles button */
/* Keep the "Select vehicles" button NEXT TO its title. It used to be justify-content:space-between,
   which on a full-width page threw the button ~1400px to the right edge — far away from the very
   text that tells you to click it, so it read as missing. */
.td-status-head { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin-top: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.td-manage { padding: 5px 12px; font-size: 11px; white-space: nowrap; }

/* "Downloaded files" explorer: a wide, flat, Explorer-style window for moving files to a PC. */
.tx-box { width: min(1100px, 96vw); max-width: none; }
.tx-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--gs-border-2); }
.tx-all { font-size: 12px; color: var(--gs-text-2); display: flex; align-items: center; gap: 5px; }
.tx-count { font-size: 12px; color: var(--gs-text-3); }
.tx-msg:empty { display: none; }
.tx-msg { padding: 7px 14px; font-size: 12px; color: var(--gs-text-2); background: var(--gs-surface-3); border-bottom: 1px solid var(--gs-border-2); }
.tx-body { max-height: 62vh; overflow: auto; }
.tx-table td, .tx-table th { font-size: 12.5px; white-space: nowrap; }
.tx-table td:nth-child(2) { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* Bulk-select bar: checkbox column + queue-many-at-once actions */
.td-selcell { width: 30px; text-align: center; }
.td-bulk-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.td-bulk-count { font-size: 11px; color: var(--gs-text-3); min-width: 90px; }
.td-bulk-btn { padding: 4px 12px; font-size: 11px; }
.td-bulk-btn:disabled { opacity: 0.5; }

/* Object picker (single-column row list + search + select-all) */
.td-pick-box { max-width: 520px; height: 72vh; }
.td-pick-tools { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--gs-border-2); flex: 0 0 auto; }
.td-pick-search { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--gs-border-3); border-radius: 6px; background: var(--gs-surface); color: var(--gs-text); font-size: 12px; }
.td-pick-all { font-size: 12px; color: var(--gs-text-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.td-pick-list { padding: 0 !important; }
.td-pick-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--gs-border); cursor: pointer; font-size: 12px; color: var(--gs-text); }
.td-pick-row:hover { background: var(--gs-accent-bg); }
.td-pick-row input { flex: 0 0 auto; }
.td-pick-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--gs-border-2); flex: 0 0 auto; }
.td-pick-count { font-size: 11px; color: var(--gs-text-3); }

/* Received-files list grouped per driver/vehicle (thousands of files collapse to one row per
   person/truck) + a search box to filter by name/plate/date. */
.td-group-search { width: 100%; max-width: 420px; padding: 7px 10px; border: 1px solid var(--gs-border-3); border-radius: 6px; background: var(--gs-surface); color: var(--gs-text); font-size: 12px; }
.td-group-list { border: 1px solid var(--gs-border-2); border-radius: 6px; overflow: hidden; }
.td-group + .td-group { border-top: 1px solid var(--gs-border); }
.td-group-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; background: none; border: none; text-align: left; cursor: pointer; font: inherit; color: var(--gs-text); }
.td-group-head:hover { background: var(--gs-accent-bg); }
.td-group-caret { color: var(--gs-text-4); font-size: 10px; transition: transform 0.15s; flex: 0 0 auto; }
.td-group-open .td-group-caret { transform: rotate(90deg); }
.td-group-label { font-weight: 500; }
.td-group-meta { color: var(--gs-text-3); font-size: 11px; margin-left: auto; white-space: nowrap; }
.td-group-body { border-top: 1px solid var(--gs-border-2); }
.td-group-body .cp-table-wrap { border: none; border-radius: 0; }
.td-group-status { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.td-status-active { background: #4caf50; }
.td-status-dormant { background: var(--gs-border-3); }
.td-group-sort { padding: 7px 10px; border: 1px solid var(--gs-border-3); border-radius: 6px; background: var(--gs-surface); color: var(--gs-text); font-size: 12px; }

/* Per-year sub-groups inside a large driver/vehicle's file list */
.td-year-group + .td-year-group { border-top: 1px solid var(--gs-border); }
.td-year-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 12px; background: var(--gs-surface-4); border: none; text-align: left; cursor: pointer; font: inherit; font-weight: 500; color: var(--gs-text-2); font-size: 11px; }
.td-year-head:hover { background: var(--gs-accent-bg); }
.td-year-open > .td-year-head .td-group-caret { transform: rotate(90deg); }
.td-year-count { color: var(--gs-text-4); font-weight: 400; }
.td-year-body .cp-table-wrap { border: none; border-radius: 0; }

/* ---- Local downloads (operator console) ---------------------------------- */
/* Deliberately tile-first and search-first: the operator asked for "not endless scrolling tables",
   so the only lists that ever appear are (a) 15 card tiles and (b) one card's objects, grouped by
   account and collapsed until asked for. */
.ld-modal { width: min(1080px, 96vw); height: min(86vh, 780px); }
/* Tacho menu (tachotools.js, 2026-10-01): Fleet Control's download monitor framed in an overlay. The
   monitor is a wide table, so the box takes nearly the whole window. */
.tt-monitor-modal { width: 96vw; height: 92vh; max-width: 96vw; max-height: 92vh; }
.tt-monitor-modal .ed-header { gap: 8px; }
.tt-monitor-frame { flex: 1; width: 100%; border: 0; background: #0f1720; }
.ld-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ld-tile { display: flex; flex-direction: column; gap: 5px; text-align: left; cursor: pointer;
  padding: 11px 13px; border-radius: 8px; border: 1px solid var(--ed-border, #2b3b52);
  background: var(--ed-field, #16202e); color: inherit; font: inherit; }
.ld-tile:hover { border-color: var(--accent, #3d9be9); }
.ld-tile-top { display: flex; align-items: center; gap: 7px; }
.ld-tile-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-tile-sub, .ld-tile-nums { font-size: 12px; opacity: .75; }
.ld-tile-nums b { opacity: 1; font-size: 13px; }
.ld-tile-accs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.ld-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ld-dot.ld-on { background: #35c46a; } .ld-dot.ld-off { background: #8a94a2; }
/* Card health dot (last successful CARD_OPEN), separate from the old ld-on/ld-off pair above --
   that pair is untouched and still used by the unplaced/staging tile, which has no health data yet. */
.ld-dot.ld-health-on { background: #35c46a; }
.ld-dot.ld-health-warn { background: #e0a030; }
.ld-dot.ld-health-off { background: #e0453f; }
.ld-dot.ld-health-ready { background: #3b8de0; }
.ld-dot.ld-health-idle { background: #8a94a2; }
.ld-tile-status { display: block; font-size: 11px; line-height: 1.3; margin: 2px 0 3px; opacity: .9; }
.ld-tile-status.ld-st-red { color: #e0453f; } .ld-tile-status.ld-st-amber { color: #e0a030; }
.ld-alert { margin: 0 0 10px; padding: 8px 12px; border: 1px solid #e0453f; border-left-width: 4px; border-radius: 6px; background: rgba(224, 69, 63, .08); font-size: 12px; }
.ld-alert-row { margin-top: 4px; }
.ld-alert-in { width: 230px; padding: 3px 6px; font-size: 12px; }
.ld-alert-field[hidden] { display: none; }

.ld-cardhead { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.ld-name { max-width: 240px; }
.ld-idhint { font-size: 12px; opacity: .6; }

.ld-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 780px) { .ld-cols { grid-template-columns: 1fr; } }
.ld-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ld-colhead { display: flex; align-items: center; justify-content: space-between; }
/* Bounded height is the point: a card with 63 objects must not push the page into a long scroll. */
.ld-scroll { max-height: 340px; overflow-y: auto; border: 1px solid var(--ed-border, #2b3b52);
  border-radius: 6px; padding: 4px; }
.ld-row { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 5px;
  cursor: pointer; width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; }
.ld-row:hover { background: rgba(255,255,255,.05); }
.ld-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ld-row-sub { font-size: 11px; opacity: .6; white-space: nowrap; }
.ld-group-head { display: flex; align-items: center; gap: 7px; width: 100%; padding: 6px 7px;
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer; border-radius: 5px; }
.ld-group-head:hover { background: rgba(255,255,255,.05); }
.ld-group-name { flex: 1; text-align: left; font-weight: 600; font-size: 13px; }
.ld-caret { width: 12px; opacity: .7; }
.ld-group-body { padding-left: 14px; }
.ld-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .6;
  padding: 7px 7px 3px; display: flex; align-items: center; justify-content: space-between; }
.ld-mini { background: none; border: 0; color: var(--accent, #3d9be9); cursor: pointer; font-size: 11px; }
.ld-hint { padding: 12px 8px; font-size: 12px; opacity: .6; }
.ld-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ld-selcount { font-size: 12px; opacity: .75; margin-right: auto; }
.ld-move { max-width: 170px; }
.ld-tray { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.ld-tray-cap { font-size: 12px; opacity: .75; }
.ld-tray-note { font-size: 12px; opacity: .8; margin-left: 2px; }
.ld-dest-partial { font-size: 12px; color: #f0a848; margin-left: 6px; white-space: nowrap; }
.ld-dest-fix { margin-left: 6px; font-size: 12px; padding: 3px 9px; }
.ld-tray-note b { font-weight: 600; }
.ld-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 6px;
  border-radius: 4px; background: rgba(61,155,233,.16); }
.ld-chip-x { background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; font-size: 14px; line-height: 1; }
.ld-note { padding: 8px 11px; border-radius: 6px; margin-bottom: 10px; font-size: 13px;
  background: rgba(53,196,106,.15); border: 1px solid rgba(53,196,106,.4); }
.ld-note-bad { background: rgba(233,76,61,.15); border-color: rgba(233,76,61,.45); }

/* Tacho "Received files": two folders instead of an endless list of expandable file groups.
   The browsing itself happens in the Downloaded files window, which has search, multi-select and
   copy-to-folder -- so the page only needs to name the folders and their counts. */
.td-filemaps { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.td-fmap { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--ed-border, #2b3b52);
  background: var(--ed-field, #16202e); color: inherit; font: inherit; }
.td-fmap:hover { border-color: var(--accent, #3d9be9); }
.td-fmap-on { border-color: var(--accent, #3d9be9); background: rgba(61,155,233,.14); }
.td-fmap-ico { font-size: 16px; line-height: 1; }
.td-fmap-name { font-weight: 600; font-size: 13px; }
.tx-maps { margin: 0 0 8px; padding: 0 2px; }

/* Download status: a folding section with its own bounded scroll, so the page stays one screen
   however many vehicles an account runs. The heading itself is the fold control. */
.td-fold { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0;
  color: inherit; font: inherit; cursor: pointer; padding: 0; }
.td-fold:hover .ed-section-title { color: var(--accent, #3d9be9); }
.td-status-search { max-width: 300px; margin: 8px 0 6px; display: block; }
.td-status-wrap { max-height: 420px; overflow-y: auto; }
/* The header has to stay put while the body scrolls under it, or a long list loses its column names. */
.td-status-wrap thead th { position: sticky; top: 0; z-index: 2; background: var(--panel, #16202e); }

/* "Add a card" tile + its explainer. A card is a physical chip that registers itself when read, so
   this teaches the operator how one appears rather than pretending the UI can create one. */
.ld-tile-add { align-items: center; justify-content: center; border-style: dashed; text-align: center; }
.ld-tile-plus { font-size: 24px; line-height: 1; opacity: .7; }
.ld-help { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center;
  justify-content: center; background: rgba(0,0,0,.55); border-radius: 10px; }
.ld-help-in { max-width: 460px; padding: 20px 22px; border-radius: 10px;
  background: var(--panel, #16202e); border: 1px solid var(--ed-border, #2b3b52); }
.ld-help-title { font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.ld-help-steps { margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.65; }
.ld-help-note { font-size: 12px; opacity: .7; margin-bottom: 14px; }
.ld-modal .ed-body { position: relative; }

/* Cards ALMAG holds vs cards a customer holds. The page is about the operator's OWN cards; the
   customer-held ones sit behind one line so a mis-marked card is still correctable. */
.ld-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--ed-border, #2b3b52); }
.ld-linkbtn { background: none; border: 0; color: var(--accent, #3d9be9); cursor: pointer;
  font: inherit; font-size: 12px; padding: 0; }
.ld-linkbtn:hover { text-decoration: underline; }
.ld-where { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; opacity: .85; cursor: pointer; }

/* Reader claiming inside the Add-a-card panel: the step that used to require Fleet Control. */
.ld-rd { max-height: 220px; overflow-y: auto; border: 1px solid var(--ed-border, #2b3b52);
  border-radius: 6px; padding: 4px; margin: 4px 0 12px; }
.ld-rd-row { gap: 6px; }
.ld-rd-acct { max-width: 150px; font-size: 12px; padding: 3px 6px; }
.ld-help-in { max-width: 560px; max-height: 82vh; overflow-y: auto; }

/* Freshly-read cards that have not been placed with a customer yet. Given prominence because an
   unplaced card is the one thing on this screen that needs the operator to act. */
.ld-fresh { margin-bottom: 16px; padding: 12px; border-radius: 8px;
  border: 1px solid rgba(61,155,233,.45); background: rgba(61,155,233,.08); }
.ld-fresh-cap { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ld-tile-new { border-color: var(--accent, #3d9be9); }
.ld-tile-new .ld-tile-sub { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }

/* Which account receives the downloads — shown only when the staged objects are co-owned. */
.ld-acct-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; opacity: .9; }
.ld-acct-pick select { max-width: 150px; font-size: 12px; padding: 3px 6px; }

/* Disabled actions must LOOK disabled — the whole point is that they read as inert until a row is
   ticked, so the row cannot be mistaken for an unsaved-changes bar. */
.ld-actions .ed-btn[disabled], .ld-actions select[disabled] { opacity: .45; cursor: not-allowed; }

/* Handing a card back to its customer: an ordinary operation, so it gets a plain explanation rather
   than a warning. Nothing has to be undone — the chip carries the identity. */
.ld-handback { margin: -4px 0 12px; padding: 9px 12px; border-radius: 6px; font-size: 12px;
  line-height: 1.55; background: rgba(255,255,255,.05); border: 1px solid var(--ed-border, #2b3b52); }

/* Mirror grants: which accounts may READ a card's downloads, independent of who owns the vehicles. */
.ld-mirror { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px;
  padding: 9px 12px; border-radius: 6px; background: rgba(255,255,255,.04);
  border: 1px solid var(--ed-border, #2b3b52); }
.ld-mirror-cap { font-size: 12px; opacity: .8; }
.ld-mirror-list { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.ld-mirror-in { max-width: 150px; font-size: 12px; padding: 3px 6px; }
.ld-chip-on { background: rgba(53,196,106,.18); }

/* "Selected for download" activity row -- same three tones as the card health dot, so a color once
   learned there reads the same way here. Each chip is now the 90-day vehicle-unit deadline (green/
   amber/red), plus a fourth neutral tone for "never downloaded" -- kept distinct from red on purpose,
   since 91 days overdue and no download ever recorded are not the same fault. Chips are buttons: click
   one to expand the vehicles behind that count, same fold pattern as "Devices on this card" above it. */
.ld-activity-window { opacity: .65; font-weight: normal; }
.ld-activity-summary { font-size: 12px; }
.ld-muted { font-size: 12px; opacity: .6; font-style: italic; }
.ld-activity-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; flex-basis: 100%; }
.ld-activity-body { flex-basis: 100%; }
.ld-chip-ok, .ld-chip-warn, .ld-chip-bad, .ld-chip-never { display: inline-block; padding: 2px 7px; border-radius: 10px;
  font-size: 11px; margin-right: 4px; }
.ld-chip-ok { background: rgba(53,196,106,.18); color: #4fd17a; }
.ld-chip-warn { background: rgba(224,160,48,.18); color: #e0a030; }
.ld-chip-bad { background: rgba(224,69,63,.18); color: #ff6b6b; }
.ld-chip-never { background: rgba(255,255,255,.08); color: rgba(255,255,255,.55); }
.ld-chip-toggle { display: inline-flex; align-items: center; gap: 4px; border: 0; cursor: pointer;
  font: inherit; margin-right: 0; }
.ld-chip-toggle .ld-caret { width: auto; opacity: .8; }
.ld-chip-toggle[disabled] { opacity: .5; cursor: not-allowed; }
.ld-row-activity { cursor: default; flex-wrap: wrap; }
.ld-row-activity:hover { background: none; }

/* Second filter row in the Downloaded files window: which company card produced each file. */
.tx-cards { margin: 0 0 8px; padding: 0 2px; align-items: center; }
.tx-cards-cap { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .6; margin-right: 2px; }

/* The vehicle window now carries the full status table, so it needs the room a picker did not. */
.td-pick-box { width: min(1180px, 96vw); }
.td-pick-list { max-height: 60vh; overflow: auto; }
.td-pick-table th { position: sticky; top: 0; z-index: 2; background: var(--panel, #16202e); }
.td-pick-table td { white-space: nowrap; }
.td-pick-table .td-vehcell { white-space: normal; min-width: 180px; }

/* An owner is not a mirror grant: it reads the files by right and cannot be revoked from this screen,
   so it gets no remove button. Showing one would have promised something the × does not do. */
.ld-chip-own { background: rgba(255,255,255,.07); }
.ld-own-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; opacity: .6; }

/* Five-yearly card renewal. Offered only when an unplaced card is sitting there to move onto. */
.ld-renew { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px;
  padding: 9px 12px; border-radius: 6px; background: rgba(240,180,60,.10);
  border: 1px solid rgba(240,180,60,.35); font-size: 12px; }
.ld-renew-cap { font-weight: 600; }
.ld-renew-txt { opacity: .8; }
.ld-renew-sel { max-width: 190px; font-size: 12px; padding: 3px 6px; }

/* Inline "saved" for controls that write on change. These screens have no Save button by design —
   the confirmation has to appear where the operator is already looking. */
.ld-saved { font-size: 11px; color: #35c46a; font-weight: 600; }
/* Card expiry (2026-10-01): amber = within 90 days (printed date or estimate), red = within 30 days or
   expired (printed date only -- an estimate never goes red). */
.ld-tile-exp { font-size: 12px; opacity: .75; }
.ld-tile-exp.ld-exp-warn, .ld-exp-now.ld-exp-warn { color: #e0a030; opacity: 1; font-weight: 600; }
.ld-tile-exp.ld-exp-bad, .ld-exp-now.ld-exp-bad { color: #e0453f; opacity: 1; font-weight: 600; }
.ld-expiry { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; opacity: .85; }
.ld-expiry input[type=date] { width: auto; padding: 2px 6px; font-size: 12px; }
.ld-exp-now { font-size: 12px; }

/* Row toggles in the Control panel write on click — there is no Save button — so the row itself has to
   confirm. Green fade on success, red on failure. Without this a silent success and a change that never
   happened looked exactly the same. */
@keyframes cpRowSaved  { from { background: rgba(53,196,106,.35); } to { background: transparent; } }
@keyframes cpRowFailed { from { background: rgba(233,76,61,.35); }  to { background: transparent; } }
.cp-row-saved  > td { animation: cpRowSaved 1.6s ease-out; }
.cp-row-failed > td { animation: cpRowFailed 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .cp-row-saved > td, .cp-row-failed > td { animation: none; }
  .cp-row-saved  > td { background: rgba(53,196,106,.18); }
  .cp-row-failed > td { background: rgba(233,76,61,.18); }
}

/* Login log: a deactivated attempt is not a failed one. The password was right and the account was
   turned away, so it gets its own amber badge rather than the red "wrong password" colour. */
.lm-ev-blocked { background: rgba(240,180,60,.20); color: #f0b43c; border: 1px solid rgba(240,180,60,.45); }

/* The kind folders sit UNDER the card row and belong to the selected card, so they are indented and
   quieter — the card is the primary choice, the folder is what you do inside it. */
.tx-maps-sub { margin-left: 14px; padding-left: 10px; border-left: 2px solid var(--ed-border, #2b3b52); }

/* Destination row: where a card's files are written. Sits above the read-access row because it is the
   stronger statement — one decides where files land, the other only who may look at them. */
.ld-dest { background: rgba(61,155,233,.07); border-color: rgba(61,155,233,.3); }

/* Account type-ahead. The operator thinks "mk", the API needs "mklog" — the suggestion bridges the two
   so a reasonable guess never dead-ends in "no account named mk". */
.ld-suggest-wrap { position: relative; display: inline-block; }
.ld-suggest { position: absolute; top: 100%; left: 0; z-index: 40; min-width: 210px; max-height: 220px;
  overflow-y: auto; margin-top: 3px; border-radius: 6px; padding: 3px;
  background: var(--panel, #16202e); border: 1px solid var(--ed-border, #2b3b52);
  box-shadow: 0 8px 22px rgba(0,0,0,.45); }
.ld-suggest-row { display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  width: 100%; padding: 5px 8px; border: 0; border-radius: 4px; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; }
.ld-suggest-row:hover { background: rgba(255,255,255,.07); }

/* Grouped file explorer: one foldable block per driver card / per vehicle. The header is a table row
   so it lines up with the columns; it is clickable anywhere except its checkbox, which selects the
   whole folder including files folded out of sight. */
.tx-table tr.tx-grp { cursor: pointer; background: rgba(255,255,255,.045); }
.tx-table tr.tx-grp:hover { background: rgba(255,255,255,.075); }
.tx-table tr.tx-grp td { padding-top: 7px; padding-bottom: 7px; }
.tx-grp-arrow { display: inline-block; width: 12px; opacity: .7; }
.tx-table tr.tx-grp b { font-weight: 600; letter-spacing: .2px; }

/* A panel value that is older than the trust window still shows, but carries its age so it is never
   read as current -- a parked vehicle's last stored voltage was taken while the alternator charged. */
.dp-stale { opacity: .65; font-size: 12px; font-weight: 400; }

/* ─────────────────────────────────────────────────────────────────────────────
   PHONE: the device panel.  Added 2026-08-21.

   Scope is deliberately the CLIENT path only — map, device list, device panel.
   The tacho, drivers and reports screens are office tools and are left alone.

   The desktop three-column layout (Data | Daily statistics | Tachograph) is NOT
   restructured: everything here lives inside a max-width query, so it applies to
   phones only and the signed-off desktop arrangement is untouched.

   What was wrong on a phone:
     * 45vh of a short screen left the panel a few lines tall
     * 11px key/value text is below comfortable reading size held at arm's length
     * three 160px columns wrap into a ragged two-then-one on a 375px screen
     * 28px arrows and 34px tabs are under the ~44px a fingertip reliably hits
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Give the data real estate. dvh so the address bar collapsing doesn't clip it. */
  #device-panel { max-height: 62vh; max-height: 62dvh; }

  /* One column reading top-to-bottom, rather than columns fighting for width. */
  .dp-body { flex-direction: column; flex-wrap: nowrap; gap: 10px; padding: 10px 12px; }
  .dp-col, .dp-col-wide { min-width: 0; width: 100%; flex: none; }

  /* Readable at arm's length, and rows tall enough to scan. */
  .dp-kv { font-size: 13px; padding: 7px 0; gap: 12px; }
  .dp-section-title { font-size: 12px; margin: 12px 0 6px; }

  /* Touch targets: 44px is the size a fingertip hits reliably. */
  .dp-header { height: 44px; padding: 0 10px; }
  .dp-tab { padding: 0 14px; font-size: 13px; min-height: 44px; }
  .dp-close { font-size: 22px; padding: 6px; }
  .dp-period-arrow { width: 40px; height: 40px; font-size: 19px; }
  .dp-period-label { font-size: 13px; padding: 8px 12px; }
  .dp-period-dots .dp-dot { width: 9px; height: 9px; }
}

/* ── Elements that were rendering with browser defaults ──────────────────────────────────────
   Found 2026-08-22 by diffing every class used in js/*.js against every class defined here: 19
   visible elements carried only a JS hook class and no styling rule at all, so they fell back to
   the browser's defaults — plain blue underlined links on a dark panel, icon buttons that didn't
   match the identical-looking ones beside them, labels whose checkbox sat detached from its text.
   Each rule below matches an EXISTING sibling rather than introducing a new look. */

/* Control-panel action icons: these sit in the same cell as .cp-edit/.cp-delete and must be
   indistinguishable from them. */
.cp-message, .cp-save-template {
  cursor: pointer; color: var(--gs-text-3);
  width: 28px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px;
}
.cp-message:hover, .cp-save-template:hover { background: var(--gs-accent-bg); color: var(--gs-accent); }

/* An owner name inside the Objects table. As a bare <a href="#"> it rendered as the browser's
   default underlined blue, which on this dark theme reads as broken. */
.obj-owner-link { color: var(--gs-accent); text-decoration: none; }
.obj-owner-link:hover { text-decoration: underline; }

/* "Hidden from sub-users" marker — a badge, not body text. */
.obj-hidden-tag {
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: var(--gs-surface-4); color: var(--gs-text-3); white-space: nowrap;
}

/* Section heading inside the Places/zone form, matching .ed-section-title's weight and colour. */
.pl-form-title { display: block; font-size: 12px; font-weight: 600; color: var(--gs-accent); margin-bottom: 6px; }

/* Checkbox rows that were missing the flex layout every other checkbox row in the app has,
   so the box floated away from its label. Same declarations as .ed-field-inline label. */
.hi-checkbox-label, .ed-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--gs-text-2); cursor: pointer;
}
.ed-check-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }

/* Secondary/dimmed text — counts and hints that should recede, not compete. */
.cell-dim, .td-card-msg { font-size: 11px; color: var(--gs-text-4); }

/* Identifier columns: IMEIs and card IDs line up only in a monospaced face. */
.ob-imei, .tx-cardid { font-family: ui-monospace, Consolas, 'Courier New', monospace; font-size: 11px; }

/* Sort direction arrow in sortable table headers. */
.st-sort-arrow { margin-left: 4px; font-size: 9px; color: var(--gs-text-4); }

/* Plain block containers that only ever needed to exist as layout boxes. */
.drv-tabpanel { display: block; }
.ld-group { margin-bottom: 10px; }

/* Small inline button in the Edit-user object table. */
.eu-edit-obj-btn {
  cursor: pointer; background: none; border: 0; padding: 0 4px;
  color: var(--gs-text-3); font-size: 12px;
}
.eu-edit-obj-btn:hover { color: var(--gs-accent); }

/* ---- Visible column (visibility.js cellHtml) + paste-capable date field (gsdate.js) ---- */
.gs-vis { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.gs-vis input[type=checkbox] { margin: 0; cursor: pointer; }
.gs-vis input[type=checkbox]:disabled { opacity: 0.35; cursor: not-allowed; }
.gs-vis-text { font-size: 12px; }
.gs-vis-ok { color: var(--gs-text-2); }
.gs-vis-hidden { color: var(--gs-warn-fg); }
.gs-vis-expired { color: var(--gs-danger-fg); font-weight: 600; }
.gs-vis-date { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.gs-vis-date:hover { opacity: 0.75; }
.gs-datefield { display: inline-flex; align-items: center; gap: 6px; width: 100%; position: relative; }
.gs-datefield-text { flex: 1; min-width: 120px; }
.gs-datefield-pick { flex: 0 0 auto; padding: 6px 8px; cursor: pointer; background: var(--gs-surface); border: 1px solid var(--gs-border-3); border-radius: 6px; color: var(--gs-text); font: inherit; line-height: 1; }
.gs-datefield-pick:hover { border-color: var(--gs-accent); }
.gs-datefield-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gs-datefield-bad { border-color: var(--gs-danger-fg) !important; }

/* ---- searchable account picker (accountpicker.js) + column sort targets ---- */
.gs-acct { position: relative; }
.gs-acct-input { width: 100%; box-sizing: border-box; }
.gs-acct-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 10060; max-height: 240px; overflow-y: auto; }
.gs-acct-item { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.gs-acct-main { color: var(--gs-text); }
.gs-acct-sub { color: var(--gs-text-3); font-size: 11px; }
.gs-acct-none { padding: 6px 10px; font-size: 11px; color: var(--gs-text-3); font-style: italic; }
.cp-vis-sort, .eu-obj-sort, .st-obj-sort { cursor: pointer; user-select: none; }
.cp-vis-bydate, .eu-vis-bydate, .st-vis-bydate { margin-left: 8px; font-size: 11px; font-weight: normal; color: var(--gs-text-3); }
.cp-vis-bydate:hover, .eu-vis-bydate:hover, .st-vis-bydate:hover { color: var(--gs-accent); }
.eu-sort-arrow { font-size: 10px; }

/* ---- "Copied N IMEIs" confirmation toast (imeicopy.js) ---- */
.gs-copy-toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  z-index: 100000; max-width: 90vw;
  background: var(--gs-text); color: var(--gs-surface);
  padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 18px rgba(0,0,0,0.28);
  opacity: 1; transition: opacity 0.4s ease;
}
.gs-copy-toast-out { opacity: 0; }
/* Card downloads report (downloadreport.js, 2026-10-01) */
.dr-modal { width: min(1180px, 96vw); height: min(88vh, 820px); }
.dr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px 4px; }
.dr-bar label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.dr-bar input[type=date] { width: auto; }
.dr-window { padding: 2px 14px 8px; font-size: 12px; opacity: .8; }
.dr-window.dr-bad, .dr-bad { color: #e0453f; opacity: 1; }
.dr-body { overflow: auto; padding: 0 14px 14px; }
.dr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dr-table th { text-align: left; font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--gs-border, #2a3340); position: sticky; top: 0; background: var(--gs-surface); }
.dr-table td { padding: 7px 8px; border-bottom: 1px solid var(--gs-border, #2a3340); }
.dr-table .n { text-align: right; }
.dr-table .ld-dot { display: inline-block; }
.dr-group td { font-weight: 600; font-size: 12px; opacity: .7; padding-top: 14px; }
.dr-row { cursor: pointer; }
.dr-row:hover, .dr-row.dr-open { background: var(--gs-accent-bg, rgba(61,155,233,.12)); }
.dr-flag { font-weight: 700; }
.dr-files td { padding: 6px 8px 12px 28px; }
.dr-kind { font-weight: 600; font-size: 12px; margin: 6px 0 3px; }
.dr-filelist { max-height: 260px; overflow: auto; }
.dr-file { display: flex; gap: 12px; font-size: 12px; font-family: Consolas, monospace; padding: 1px 0; }
.dr-ftime { width: 80px; flex: none; opacity: .75; }
.dr-fname { flex: 1; word-break: break-all; }
.dr-fsize { width: 70px; flex: none; text-align: right; opacity: .75; }
/* Removing a card from our hub (Local downloads, 2026-10-01) */
.ld-remove { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; padding: 8px 10px; border: 1px dashed var(--gs-border, #3a4452); border-radius: 6px; }
.ld-remove-cap { font-size: 12px; font-weight: 600; opacity: .8; margin-right: 4px; }
.ld-remove-opt { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; opacity: .85; }
.ld-danger { color: #e0453f; }
.ld-removed { display: flex; flex-direction: column; gap: 8px; }
.ld-removed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 10px; border: 1px solid var(--gs-border, #2a3340); border-radius: 6px; }
.ld-removed-name { font-weight: 600; min-width: 120px; }
.ld-removed-warn { flex-basis: 100%; color: #e0a030; font-weight: 600; font-size: 12px; }
.ld-removed-row .ed-btn { margin-left: auto; }
/* Card actions + the page's own confirm box (Local downloads, 2026-10-01) */
.ld-confirm-overlay { z-index: 1100; }
.ld-confirm { width: min(520px, 94vw); min-height: 0; }
.ld-confirm .ed-body p { margin: 0 0 10px; font-size: 13px; line-height: 1.45; }
.ld-confirm-btns { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; }
.ld-danger-solid { background: #c0392b; color: #fff; border-color: #c0392b; }
.ld-files-status { flex-basis: 100%; font-style: normal; }
/* Unused devices: exact count on the badge never wraps; selection column and armed remove button. */
.tb-badge { white-space: nowrap; }
.cp-col-check { width: 28px; text-align: center; }
.cp-col-check input { cursor: pointer; }
tr.ud-row-sel td { background: rgba(231, 76, 60, .10); }
.ed-btn.ud-armed { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.ud-assign { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.ud-assign .gs-acct { flex: 1 1 240px; max-width: 380px; }
.ld-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; padding: 8px 10px; border: 1px solid var(--gs-border, #3a4452); border-radius: 6px; }
.ld-period .ld-pdays { width: 58px; padding: 3px 6px; text-align: right; }
.ld-period select.ed-input { width: auto; padding: 4px 6px; font-size: 12px; }
.ld-period-break { flex-basis: 100%; height: 0; }
.ld-period-hint { flex-basis: 100%; font-size: 11px; }
.ld-period-list { flex-basis: 100%; font-size: 12px; }
.ld-period-list summary { cursor: pointer; opacity: .85; }
.ld-ptable { width: 100%; border-collapse: collapse; margin-top: 6px; }
.ld-ptable th, .ld-ptable td { text-align: left; padding: 3px 8px; border-bottom: 1px solid var(--gs-border, #3a4452); white-space: nowrap; }
.ld-ptable th { font-weight: 600; opacity: .75; }
.ld-queued { cursor: help; }

/* Objects an account sees only through a group link (groupaccess.js) — Control Panel count, account editor, preview. */
.cp-via-group { font-size: 10.5px; color: var(--gs-text-3); white-space: nowrap; cursor: help; }
.eu-grouplinks { margin-top: 6px; }
.eu-grouplink-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--gs-border-2); }
.eu-grouplink-main { flex: 1; min-width: 0; }
.eu-grouplink-name { font-weight: 600; }
.eu-grouplink-devs { font-size: 12px; color: var(--gs-text-3); margin-top: 2px; }
.eu-grouplink-devs .eu-grouplink-only { color: var(--gs-text); font-weight: 600; }

/* Work shifts table (driver detail, 2026-10-12): rest rows italic on a light band, red when reduced or
   too short, a dashed line where a new week begins. */
.tc-sh-title { margin: 16px 0 6px; font-weight: 600; font-size: 14px; }
.tc-shift-table td, .tc-shift-table th { white-space: nowrap; }
.tc-shift-table th:nth-child(n+6), .tc-shift-table td:nth-child(n+6), .tc-shift-table th:nth-child(3), .tc-shift-table td:nth-child(3) { text-align: right; }
.tc-shift-table tr.tc-sh-rest td { font-style: italic; background: rgba(0, 169, 223, 0.06); color: var(--gs-text-2, #555); }
.tc-shift-table tr.tc-sh-rest td:first-child { text-align: right; padding-right: 12px; }
.tc-shift-table tr.tc-sh-rest td:nth-child(2) { text-align: right; }
.tc-shift-table tr.tc-sh-red td { color: var(--gs-danger-fg); }
.tc-shift-table tr.tc-sh-weekbreak td { border-top: 2px dashed var(--gs-border-4, #999); }
.tc-sh-inf { color: var(--gs-danger-fg); font-weight: 600; cursor: help; }
.tc-sh-ddd { color: var(--gs-ok-fg); font-weight: 600; }

/* Driver detail, kilometres per day (2026-10-12): a figure containing a speed-based estimate, and an
   estimate above the plausible daily maximum ("estimate — check", not counted in the total). */
.tc-km-est { font-style: italic; cursor: help; }
.tc-km-check { color: var(--gs-danger-fg); font-weight: 600; cursor: help; white-space: nowrap; }

/* Settings > My account > TachoDesk (tachodesk-account.js, 2026-10-18) */
.tdk-wrap { margin-top: 18px; }
.tdk-sub { margin-top: 14px; }
.tdk-note { color: var(--gs-muted, #667); font-size: 12.5px; margin: 4px 0 8px; line-height: 1.4; }
.tdk-msg { color: inherit; font-weight: 600; }
.tdk-error { color: var(--gs-danger-fg); font-size: 12.5px; margin: 6px 0; }
.tdk-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.tdk-row a.ed-btn { text-decoration: none; display: inline-flex; align-items: center; }
.tdk-folder.tdk-open { outline: 2px solid var(--gs-accent, #2a6ebb); }
.tdk-chip { font-size: 11px; padding: 1px 6px; border-radius: 8px; margin-left: 6px; }
.tdk-on { background: #dff3e4; color: #1d6b33; }
.tdk-off { background: #eee; color: #666; }
.tdk-detail { border: 1px solid var(--gs-border, #ddd); border-radius: 6px; padding: 10px; margin-top: 6px; }
.tdk-list { max-height: 240px; overflow: auto; border: 1px solid var(--gs-border, #ddd); border-radius: 4px; padding: 6px; }
.tdk-veh { display: block; padding: 2px 0; font-size: 13px; }
.tdk-imei { color: var(--gs-muted, #889); font-size: 11.5px; margin-left: 6px; }
.tdk-confirm { padding: 5px 8px; min-width: 180px; }

/* Tacho page: TachoDesk downloads, ALMAG / Local tabs, card vehicles (tachodl.js, 2026-10-18) */
.td-desk-dl { margin: 8px 0 12px; }
.td-desk-dl a.ed-btn { text-decoration: none; display: inline-flex; align-items: center; }
.td-lane-tag { font-size: 10px; padding: 0 5px; border-radius: 7px; background: #e8eef7; color: #2a5a9a; margin-left: 4px; }
.td-lane-on .td-lane-tag { background: rgba(255,255,255,.3); color: inherit; }
.td-desk-veh { display: block; padding: 3px 0; font-size: 13px; }
.td-desk-confirm { min-width: 220px; }

/* ---- Reports, GPS-Server layout (2026-10-26) ----
   Report properties: two columns of label | control rows, "Report" / "Schedule" / "Time period"
   section titles, date + hour + minute pickers, Generate / Save / Cancel centred — as GPS-Server's
   dialog. The list has GPS-Server's Reports / Generated tabs, tick boxes and columns. */
.ed-modal.rp-props { width: min(920px, 96vw); max-height: 92vh; }
.rp-props .ed-body { padding: 12px 18px 6px; overflow-y: auto; }
.rp-psec { color: var(--gs-accent); font-weight: 600; font-size: 12.5px; padding: 6px 0 5px; margin: 6px 0 8px; border-bottom: 1px solid var(--gs-border); }
.rp-pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start; }
@media (max-width: 760px) { .rp-pgrid { grid-template-columns: 1fr; } }
.rp-prow { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; align-items: center; gap: 8px; min-height: 30px; margin-bottom: 3px; }
.rp-prow > label { font-size: 12px; color: var(--gs-text-2); margin: 0; }
.rp-prow > div { min-width: 0; }
.rp-prow input[type="text"], .rp-prow input[type="number"], .rp-prow select, .rp-prow .gs-ms-trigger { width: 100%; box-sizing: border-box; }
.rp-prow-cb > div { display: flex; align-items: center; }
.rp-prow-cb input[type="checkbox"] { width: 15px; height: 15px; margin: 0; }
.rp-off { opacity: 0.5; pointer-events: none; }
.rp-dt { display: flex; gap: 4px; }
.rp-dt input[type="date"] { flex: 1 1 auto; min-width: 0; }
.rp-dt select { flex: 0 0 62px; width: 62px !important; }
.rp-status { min-height: 16px; font-size: 11.5px; color: var(--gs-text-3); padding: 6px 0 0; }
.rp-status.rp-status-err { color: #c0392b; }
.rp-props-foot { justify-content: center; }

.rp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--gs-border-4); margin-bottom: 10px; }
.rp-tab { padding: 7px 16px; font-size: 12.5px; color: var(--gs-text-2); cursor: pointer; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; margin-bottom: -1px; }
.rp-tab:hover { color: var(--gs-accent); }
.rp-tab.rp-tab-on { color: var(--gs-accent); font-weight: 600; background: var(--gs-surface); border-color: var(--gs-border-4); }
.rp-list .rp-cbcol { width: 26px; text-align: center; }
.rp-global-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 11px; line-height: 16px; color: var(--gs-accent); border: 1px solid var(--gs-accent); vertical-align: 1px; }
.rp-list-foot { font-size: 11px; color: var(--gs-text-3); padding: 6px 2px; text-align: right; }
.rp-list-note { font-size: 11px; color: var(--gs-text-3); padding: 2px; }
.rp-gen-open { cursor: pointer; color: var(--gs-text-3); }
.rp-gen-open:hover { color: var(--gs-accent); }
/* Same field look as .ed-field (the dialog rows are a grid of their own, not .ed-field). */
.rp-prow input[type="text"], .rp-prow input[type="number"], .rp-prow input[type="date"], .rp-prow select {
  padding: 6px 9px; border: 1px solid var(--gs-border-3); border-radius: 5px; font-size: 12px;
  color: var(--gs-text-2); background: var(--gs-surface-2); box-sizing: border-box; transition: border-color 0.12s, box-shadow 0.12s;
}
.rp-prow input:focus, .rp-prow select:focus { outline: none; border-color: var(--gs-accent); box-shadow: 0 0 0 3px rgba(0,169,223,0.12); }
.rp-prow select:hover { border-color: var(--gs-accent); }
.rp-dt select { padding: 6px 4px; }
/* Report generation loading screen: over the dialog, or over the page for ▶ in the list. */
.rp-busy { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 20, 32, 0.55); border-radius: inherit; backdrop-filter: blur(1px); }
.rp-busy.rp-busy-page { position: fixed; z-index: 4000; border-radius: 0; }
.rp-busy-box { min-width: 260px; max-width: 80%; padding: 22px 26px 18px; border-radius: 10px; text-align: center;
  background: var(--gs-surface); color: var(--gs-text-2); box-shadow: 0 12px 40px rgba(0,0,0,0.35); }
.rp-spinner { width: 38px; height: 38px; margin: 0 auto 12px; border-radius: 50%;
  border: 4px solid var(--gs-border-3); border-top-color: var(--gs-accent); animation: rp-spin 0.9s linear infinite; }
@keyframes rp-spin { to { transform: rotate(360deg); } }
.rp-busy-text { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.rp-busy-time { font-size: 11px; color: var(--gs-text-3); margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .rp-spinner { animation-duration: 3s; } }

.gs-exp-quick { display: flex; gap: 6px; margin-top: 6px; }

/* Administrator's whole fleet: the browser lays out only the rows on screen. */
.dl-rows.dl-fleet .dl-row { content-visibility: auto; contain-intrinsic-size: auto 52px; }

/* ── Assistant (agentchat.js, 2026-11-12), route /assistant, administrators only ─────────────────
   Full height under the toolbar; the typing bar stays at the bottom, also with a phone keyboard open.
   Nothing scrolls sideways: tables become stacked rows on a narrow screen. */
#assistant-page { flex: 1; min-height: 0; display: flex; background: var(--gs-surface-3); }
.ac-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; max-width: 900px; margin: 0 auto; width: 100%; }
.ac-log { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
/* conversation history (2026-11-22): two small buttons on top; History shows earlier conversations, read only */
.ac-head { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 8px 12px 0; }
.ac-hbtn { border: 1px solid var(--gs-border-3); background: var(--gs-surface); color: var(--gs-text); border-radius: 16px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.ac-hbtn:hover, .ac-hbtn:active { background: var(--gs-accent-bg); }
.ac-hbtn.ac-on { border-color: var(--gs-accent); color: var(--gs-accent); }
.ac-time { font-size: 11px; color: var(--gs-text-4); align-self: center; }
.ac-conv { background: var(--gs-surface); border: 1px solid var(--gs-border-2); border-radius: 10px; flex: none; }
.ac-conv > summary { cursor: pointer; padding: 10px 12px; list-style: none; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ac-conv > summary::-webkit-details-marker { display: none; }
.ac-conv > summary b { font-weight: 600; }
.ac-conv > summary span { color: var(--gs-text-4); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 160px; }
.ac-conv-in { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 10px; }
.ac-old .ac-chip { pointer-events: none; opacity: 0.6; }
.ac-log > * { flex-shrink: 0; }
.ac-send.ac-stop { background: var(--gs-danger-fg, #C0392B); }
.ac-msg { max-width: 100%; }
.ac-me { align-self: flex-end; background: var(--gs-accent); color: var(--gs-on-accent); padding: 8px 12px; border-radius: 14px 14px 2px 14px; max-width: 85%; word-wrap: break-word; }
.ac-bot { align-self: stretch; display: flex; flex-direction: column; gap: 8px; }
.ac-card { background: var(--gs-surface); border: 1px solid var(--gs-border-2); border-radius: 10px; padding: 10px 12px; color: var(--gs-text); font-size: 14px; overflow: hidden; }
.ac-err { color: var(--gs-danger-fg); background: var(--gs-danger-bg); }
.ac-title { font-weight: 600; margin-bottom: 6px; color: var(--gs-text); }
.ac-line { margin: 2px 0; line-height: 1.45; }
.ac-dim { color: var(--gs-text-4); }
.ac-ex { border: 0; background: none; color: var(--gs-accent); padding: 0; font: inherit; cursor: pointer; text-align: left; }
.ac-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.ac-kv dt { color: var(--gs-text-4); }
.ac-kv dd { margin: 0; word-break: break-word; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ac-table th { text-align: left; color: var(--gs-text-4); font-weight: 500; border-bottom: 1px solid var(--gs-border-2); padding: 4px 6px; }
.ac-table td { border-bottom: 1px solid var(--gs-border); padding: 4px 6px; vertical-align: top; word-break: break-word; }
.ac-note { color: var(--gs-text-4); font-size: 12px; margin-top: 6px; }
.ac-map { position: relative; height: 240px; border-radius: 8px; overflow: hidden; }
.ac-map-in { position: absolute; inset: 0; }
.ac-map-full { position: absolute; z-index: 500; top: 8px; right: 8px; border: 1px solid var(--gs-border-3); background: var(--gs-surface); color: var(--gs-text); border-radius: 6px; width: 34px; height: 34px; cursor: pointer; font-size: 16px; }
.ac-map.ac-map-big { position: fixed; inset: 0; height: auto; z-index: 2000; border-radius: 0; }
.ac-chart { display: block; max-width: 100%; }
.ac-chart .ac-grid { stroke: var(--gs-border-2); stroke-width: 1; }
.ac-chart .ac-ax { fill: var(--gs-text-4); font-size: 11px; }
.ac-chart .ac-line-path { fill: none; stroke: var(--gs-accent); stroke-width: 2; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-chip { border: 1px solid var(--gs-accent); color: var(--gs-accent); background: var(--gs-surface); border-radius: 16px; padding: 6px 12px; font-size: 13px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-chip:active, .ac-chip:hover { background: var(--gs-accent-bg); }
.ac-bar { display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--gs-surface); border-top: 1px solid var(--gs-border-2); }
.ac-input { flex: 1; min-width: 0; font-size: 16px; padding: 10px 12px; border: 1px solid var(--gs-border-3); border-radius: 20px; background: var(--gs-surface); color: var(--gs-text); }
.ac-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--gs-accent); color: var(--gs-on-accent); font-size: 18px; cursor: pointer; flex: none; }
.ac-send:disabled { opacity: 0.5; }
.ac-dots i { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--gs-text-4); animation: ac-blink 1s infinite; }
.ac-dots i:nth-child(2) { animation-delay: 0.2s; }
.ac-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes ac-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ac-dots i { animation: none; } }
@media (max-width: 640px) {
  .ac-log { padding: 8px; }
  .ac-card { padding: 8px 10px; }
  .ac-kv { grid-template-columns: 1fr; gap: 0; }
  .ac-kv dt { margin-top: 6px; font-size: 12px; }
  /* tables as stacked rows: each cell on its own line, with its column name */
  .ac-table thead { display: none; }
  .ac-table, .ac-table tbody, .ac-table tr, .ac-table td { display: block; width: 100%; }
  .ac-table tr { border-bottom: 1px solid var(--gs-border-2); padding: 6px 0; }
  .ac-table td { border: 0; padding: 1px 0; display: flex; gap: 8px; }
  .ac-table td::before { content: attr(data-l); color: var(--gs-text-4); flex: 0 0 34%; }
  .ac-table td:first-child { font-weight: 600; }
  .ac-table td:first-child::before { display: none; }
  .ac-table td:empty { display: none; }
  .ac-map { height: 200px; }
}

/* Infringements table under the Work shifts table, and the driver-detail print-out (2026-11-20). */
.tc-inf-table td, .tc-inf-table th { white-space: nowrap; vertical-align: top; }
.tc-inf-table td.tc-inf-text, .tc-inf-table td.tc-inf-rule { white-space: normal; min-width: 220px; }
.tc-inf-table td.tc-inf-rule { min-width: 280px; color: var(--gs-text-2, #555); }
.tc-inf-table td.tc-inf-num, .tc-inf-table th:nth-child(6), .tc-inf-table th:nth-child(7) { text-align: right; font-variant-numeric: tabular-nums; }
.tc-sev { font-weight: 600; white-space: nowrap; }
.tc-sev-mi { color: #b7791f; }
.tc-sev-si { color: #c2410c; }
.tc-sev-vsi { color: #c0392b; }
.tc-sev-msi { color: #7f1d1d; }
.tc-inf-note { margin-top: 6px; font-size: 11px; color: var(--gs-text-3, #777); }
#tc-print-root { display: none; }
.tc-rules-title { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.tc-rules-sub { font-size: 11px; color: #555; margin-bottom: 8px; }
.tc-rules-table td, .tc-rules-table th { vertical-align: top; white-space: normal; text-align: left; }
.tc-rules-table td.tc-rules-name { font-weight: 600; width: 22%; }
.tc-rules-table td.tc-rules-art { white-space: nowrap; width: 15%; }
.tc-rules-table tr.tc-rules-sec td { font-weight: 700; background: #e8f1fb; }
@media print {
  body.tc-printing > *:not(#tc-print-root) { display: none !important; }
  body.tc-printing { background: #fff !important; height: auto !important; overflow: visible !important; }
  body.tc-printing #tc-print-root { display: block; color: #000; font-size: 11px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #tc-print-root .tc-print-title { font-size: 16px; font-weight: 600; }
  #tc-print-root .tc-print-sub { font-size: 11px; color: #555; margin-bottom: 8px; }
  #tc-print-root .cp-table-wrap { overflow: visible; margin-top: 6px; }
  #tc-print-root .cp-table { font-size: 9.5px; }
  #tc-print-root .cp-table td, #tc-print-root .cp-table th { white-space: normal; min-width: 0; }
  #tc-print-root tr, #tc-print-root .tc-day-row { break-inside: avoid; }
  #tc-print-root .tc-sh-title { break-after: avoid; }
  #tc-print-root .tc-rules { break-before: page; }
  #tc-print-root { page: tc-detail; }
  @page tc-detail { size: A4 landscape; margin: 10mm; }
}

/* ==========================================================================
   ALMAG UI step 1 (2026-11-20) -- visual only. Colours stay in the --gs-* tokens.
   1. Four colour variables the Live dashboard (ld-*) and Tacho download (td-*) parts use were never
      defined, so their dark fall-backs showed in the light theme too (dark tiles, dark text). They now
      point at the theme tokens.
   2. Readable contrast (WCAG 4.5 : 1 for text): darker accent and muted text in the light theme; a
      lighter accent with dark ink on accent buttons in the dark theme; darker "View as" banner;
      the hard-coded hover red follows the theme's danger colour.
   3. Tablet (641-1040 px): the toolbar no longer runs off the screen -- icons only (each keeps its name
      as a tooltip) and the brand steps aside, as on a phone, so Theme and Log out stay reachable.
   4. Show / hide password button (pweye.js).
   ========================================================================== */
:root {
  --gs-accent: #006A96;          /* was #00A9DF: 2.71 : 1 as text and under white button text; now 6.0 */
  --gs-accent-2: #00587D;        /* hover of accent buttons, white text 7.8 */
  --gs-text-4: #666666;          /* muted text, was #909090 (3.19, down to 2.73); now 4.9 or more on every panel */
  --panel: var(--gs-surface);
  --ed-field: var(--gs-surface-2);
  --ed-border: var(--gs-border-3);
  --accent: var(--gs-accent);
}
:root[data-theme="dark"],
#login-screen {
  --gs-accent: #33BCE8;          /* was #00A9DF: 3.94 on the lightest panel; now 4.8 or more */
  --gs-accent-2: #5CCAEE;
  --gs-on-accent: #06243A;       /* ink on accent buttons: white on light blue was 2.71; now 7.2 */
  --gs-text-4: #9DBAD0;          /* muted text, was #7CA2BE (3.96 on the lightest panel); now 5.3 or more */
}
/* These use the on-accent ink on a background that is NOT the accent -- they keep white. */
#impersonate-banner { background: #B5540B; color: #FFFFFF; }   /* orange banner, white text 5.0 (was 2.85) */
.nav-user:hover { color: #FFFFFF; }
.gs-history-stop-pin, .pl-draw-toolbar, .pl-draw-type, .pl-draw-cancel { color: #FFFFFF; }
.tc-today-badge { color: var(--gs-on-accent); }
/* hard-coded accent / hover colours follow the tokens */
.mt-btn.active:hover, #gs-sidebar-toggle:active { background: var(--gs-accent-2); }
.gs-sort-arrow { color: var(--gs-accent); }
.gs-tbl-search:focus { border-color: var(--gs-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gs-accent) 20%, transparent); }
/* hard-coded red (#c0392b: 2.94 on dark panels) follows the theme's danger colour */
.dp-tacho-issues, .ed-tag-x:hover, .ed-error, .ed-attr-del:hover, .lm-err, .st-group-remove-device:hover,
.td-due, .rp-status.rp-status-err, .tc-sev-vsi { color: var(--gs-danger-fg); }

/* Tablet toolbar */
@media (min-width: 641px) and (max-width: 1040px) {
  .tb-brand { display: none; }
  .tb-label { display: none; }
  .tb-item { min-width: 44px; padding: 0 6px; }
  .tb-icon { font-size: 19px; }
  #tb-theme .tb-icon, #tb-theme .tb-icon svg { width: 22px; height: 22px; }
  #tb-theme { margin-right: 8px; }
}

/* Show / hide password (pweye.js) */
.pw-wrap { position: relative; display: block; }
.pw-wrap-inline { display: inline-block; vertical-align: middle; }
.pw-wrap > input { width: 100%; padding-right: 36px !important; }
.pw-eye { position: absolute; top: 0; right: 0; bottom: 0; width: 34px; display: flex; align-items: center; justify-content: center;
          padding: 0; background: none; border: none; color: var(--gs-text-3); cursor: pointer; }
.pw-eye:hover { color: var(--gs-text); }
.pw-eye:focus-visible { outline: 2px solid var(--gs-accent); outline-offset: -2px; border-radius: 4px; }
.pw-wrap > input[hidden] + .pw-eye, .pw-wrap > input:disabled + .pw-eye { display: none; }

/* ==========================================================================
   ALMAG UI step 2 (2026-11-20) -- one standard dialog frame (gsdialog.js). Visual only.
   Standard size for every dialog: large enough to read everything without resizing first;
   full screen on a phone. One-question prompts stay compact. A size or place the user sets wins.
   ========================================================================== */
@media (min-width: 641px) {
  .ed-modal.gsdf-std { width: min(1400px, 96vw) !important; height: min(1000px, 92vh) !important;
                       max-width: 98vw !important; max-height: 96vh !important; }
  .ed-modal.gsdf-compact { width: min(520px, 94vw) !important; height: auto !important; max-height: 90vh !important; }
  .ed-modal.gsdf.gsdf-user { width: var(--gsdf-w) !important; height: var(--gsdf-h) !important; }
  .ed-overlay.gsdf-placed { display: block !important; }
  .ed-overlay.gsdf-placed > .ed-modal.gsdf { position: absolute !important; margin: 0 !important;
                                             left: var(--gsdf-x) !important; top: var(--gsdf-y) !important; }
}
@media (max-width: 640px) {
  .ed-overlay:has(> .ed-modal.gsdf-std) { padding: 0; align-items: stretch; justify-content: stretch; }
  .ed-modal.gsdf-std { width: 100vw !important; height: 100vh !important; height: 100dvh !important;
                       max-width: none !important; max-height: none !important; min-width: 0 !important; border-radius: 0 !important; }
  .ed-modal.gsdf-std > .ed-header { border-radius: 0; }
  .ed-modal.gsdf-compact { width: 94vw !important; max-height: 90vh !important; }
}
/* same frame inside: title bar, scrolling body, button bar at the bottom */
.ed-modal.gsdf { display: flex; flex-direction: column; overflow: hidden; }
.ed-modal.gsdf > .ed-header { cursor: move; }
.ed-modal.gsdf > .ed-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.ed-modal.gsdf-compact > .ed-body { flex: 0 1 auto; }
.ed-modal.gsdf > .ed-footer { flex: 0 0 auto; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.ed-modal.gsdf > .ed-footer.rp-props-foot { justify-content: flex-end; }
.ed-modal.gsdf > .ed-footer > [id$="-refresh"] { order: -1; margin-right: auto; }
@media (max-width: 640px) { .ed-modal.gsdf > .ed-header { cursor: default; } }
/* Inside a dialog the last column keeps the width the list was fitted to. The page-wide 176 px (room for five
   row icons on the Control Panel) made one-icon columns in dialogs push the list 99 px past the edge. */
.ed-modal.gsdf .cp-table td:last-child { width: auto; }
/* the "Discard changes?" question sits above every dialog */
.ed-overlay.gsdf-ask { z-index: 20000; }
.gsdf-ask-text { margin: 0; line-height: 1.5; color: var(--gs-text); }
/* the Tacho file explorer opens at the same standard size */
@media (min-width: 641px) { .td-modal-box.tx-box { width: min(1400px, 96vw); max-height: 92vh; } }

/* ==========================================================================
   ALMAG UI step 3 (2026-11-20) -- the Tacho popups in the same dialog frame (gsdialog.js). Visual only.
   Tacho download page: .td-modal-overlay > .td-modal-box (file explorer, file view, company-card vehicles,
   delete folder). Tacho admin page: .ta-pop-bg > .ta-pop (folder accounts / move / transfer / delete,
   add vehicle to card, delete card). Same title bar, x, button bar, sizes and closing as every other dialog.
   ========================================================================== */
.td-modal-overlay.gsdf-ov, .ta-pop-bg.gsdf-ov { align-items: center; justify-content: center; padding: 16px; overflow: hidden; }
.td-modal-box.gsdf, .ta-pop.gsdf {
  position: relative; display: flex; flex-direction: column; overflow: hidden; resize: none; gap: 0; padding: 0;
  background: var(--gs-surface); color: var(--gs-text); border: none; border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2), 0 4px 14px rgba(0,0,0,0.1); min-width: 320px; min-height: 200px;
}
@media (min-width: 641px) {
  .td-modal-box.gsdf-std, .ta-pop.gsdf-std { width: min(1400px, 96vw) !important; height: min(1000px, 92vh) !important;
                                             max-width: 98vw !important; max-height: 96vh !important; }
  .td-modal-box.gsdf-compact, .ta-pop.gsdf-compact { width: min(520px, 94vw) !important; height: auto !important; max-width: 94vw !important; max-height: 90vh !important; }
  .td-modal-box.gsdf.gsdf-user, .ta-pop.gsdf.gsdf-user { width: var(--gsdf-w) !important; height: var(--gsdf-h) !important; }
  .td-modal-overlay.gsdf-placed, .ta-pop-bg.gsdf-placed { display: block !important; padding: 0 !important; }
  .td-modal-overlay.gsdf-placed > .gsdf, .ta-pop-bg.gsdf-placed > .gsdf { position: absolute !important; margin: 0 !important;
                                                                          left: var(--gsdf-x) !important; top: var(--gsdf-y) !important; }
}
@media (max-width: 640px) {
  .td-modal-overlay.gsdf-ov:has(> .gsdf-std), .ta-pop-bg.gsdf-ov:has(> .gsdf-std) { padding: 0; align-items: stretch; justify-content: stretch; }
  /* the backdrop's own size = what is visible (100vw also counts a page scrollbar) */
  .td-modal-box.gsdf-std, .ta-pop.gsdf-std, .ed-modal.gsdf-std { width: 100% !important; height: 100% !important;
                                             max-width: none !important; max-height: none !important; min-width: 0 !important; border-radius: 0 !important; }
  .td-modal-box.gsdf-compact, .ta-pop.gsdf-compact { width: 94vw !important; max-height: 90vh !important; }
}
/* title bar: as .ed-header */
.gsdf-td > .gsdf-head, .gsdf-ta > .gsdf-head {
  background: var(--gs-accent); color: var(--gs-on-accent); padding: 13px 18px; margin: 0; border: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; border-radius: 10px 10px 0 0;
  cursor: move;
}
.gsdf-td > .gsdf-head .td-modal-title, .gsdf-ta > .gsdf-head > b { font-size: 13px; font-weight: 600; color: inherit; }
/* the x: as .ed-close */
.gsdf-td .gsdf-xbtn, .gsdf-ta .gsdf-xbtn {
  background: none; border: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; opacity: 0.8;
  padding: 3px 7px; border-radius: 4px; min-width: 0; height: auto; box-shadow: none;
}
.gsdf-td .gsdf-xbtn:hover, .gsdf-ta .gsdf-xbtn:hover { background: rgba(255,255,255,0.22); opacity: 1; color: inherit; }
/* other buttons in the title bar (the file view's PDF button) stay readable on the accent */
.gsdf-td > .gsdf-head .ed-btn { background: rgba(255,255,255,0.18); color: inherit; border-color: transparent; }
/* body: scrolls inside the frame */
.gsdf-td > .td-modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.gsdf-td.tx-box > .tx-body { max-height: none; }
.gsdf-ta > :not(.gsdf-head):not(.gsdf-foot):not(.gs-dlg-resize-handle) { margin-left: 16px; margin-right: 16px; max-width: calc(100% - 32px); box-sizing: border-box; }
.gsdf-ta > .gsdf-head + * { margin-top: 12px; }
.gsdf-ta > .ta-popscroll { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
.gsdf-ta.gsdf-compact > :not(.gsdf-head):not(.gsdf-foot) { margin-bottom: 8px; }
/* button bar: as .ed-footer, main button on the right */
.gsdf-td > .gsdf-foot, .gsdf-ta > .gsdf-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; flex: 0 0 auto;
  padding: 12px 16px; margin: auto 0 0 0; border-top: 1px solid var(--gs-border);
}
.gsdf-td > .gsdf-foot > .td-pick-count { margin-right: auto; }
.gsdf-ta > .gsdf-foot > span[style*="flex:1"] { display: none; }
@media (max-width: 640px) { .gsdf-td > .gsdf-head, .gsdf-ta > .gsdf-head { cursor: default; border-radius: 0; } }

/* ==========================================================================
   ALMAG UI step 4 (2026-11-20) -- phone bottom tab bar (gsphone.js). Visual only.
   Phone (640 px and narrower): Map, Vehicles, History, Reports, More -- icon + word, 60 px, always visible.
   The toolbar row gives its room to the map; its buttons stay in the page and the tabs press them.
   Tablet and desktop: unchanged (the bar is not shown).
   ========================================================================== */
#gsx-tabs { display: none; }
@media (max-width: 640px) {
  #toolbar { height: 0 !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: visible !important; }
  #toolbar .tb-item, #toolbar .tb-sep-v, #toolbar .tb-brand { display: none !important; }
  /* "Reconnecting…" still shows, as a small badge at the top */
  #toolbar .gs-conn-status { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 1200; }
  #gsx-tabs {
    display: flex; flex: 0 0 auto; height: 60px; box-sizing: content-box; padding-bottom: env(safe-area-inset-bottom);
    background: var(--gs-surface); border-top: 1px solid var(--gs-border-2); position: relative; z-index: 400;
  }
  .gsx-tab {
    flex: 1 1 0; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 6px 2px; background: none; border: 0; color: var(--gs-text-3); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .gsx-tab:active { background: var(--gs-surface-4); }
  .gsx-tab.active { color: var(--gs-accent); }
  .gsx-tab:focus-visible { outline: 2px solid var(--gs-accent); outline-offset: -3px; border-radius: 6px; }
  .gsx-tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.2; }
  .gsx-tab.active .gsx-tab-label { font-weight: 600; }
  /* the object list slides over the map down to the tab bar, so the tabs stay usable */
  #sidebar { height: calc(100% - 60px - env(safe-area-inset-bottom)) !important; }
  #gs-sidebar-overlay { bottom: calc(60px + env(safe-area-inset-bottom)) !important; }
}
/* More: a sheet from the bottom with every other toolbar item, Theme and Log out */
.gsx-sheet-bg { position: fixed; inset: 0; background: var(--gs-scrim); z-index: 1500; }
.gsx-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1501; max-height: 75vh; max-height: 75dvh; overflow: auto;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); background: var(--gs-surface); border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 30px var(--gs-shadow);
}
.gsx-sheet-item {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 0 20px; background: none; border: 0;
  color: var(--gs-text); font-size: 15px; text-align: left; cursor: pointer;
}
.gsx-sheet-item:active { background: var(--gs-surface-4); }
.gsx-sheet-item.disabled { opacity: 0.4; }
.gsx-sheet-icon { width: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1; }
.gsx-sheet-icon svg { width: 22px; height: 22px; }
.gsx-sheet-sep { height: 1px; margin: 6px 0; background: var(--gs-border-2); }
.gsx-sheet-out { color: var(--gs-danger-fg); }

/* ==========================================================================
   ALMAG UI step 5 (2026-11-20) -- messages in the ALMAG window instead of the browser's alert box
   (gsdialog.js). Visual only.
   ========================================================================== */
.ed-overlay.gsdf-msg { z-index: 20001; }
.gsdf-msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.gsdf-msg .ed-modal { min-height: 0; }
.gsdf-msg .ed-footer { justify-content: flex-end; }
.gsdf-msg .ed-footer .ed-btn { min-width: 88px; }

/* ==========================================================================
   ALMAG UI step 6 (2026-11-20) -- buttons and icons (gsicons.js). Visual only.
   One button look in four kinds: main (.ed-btn-primary), normal (.ed-btn), danger (.ed-btn-danger) and quiet
   (title-bar and row icons). 36 px high on desktop and tablet, 44 px on a phone (thumb size). One line-icon set
   in the text colour instead of emoji and symbol characters; one x.
   ========================================================================== */
.ed-btn {
  min-height: 36px; padding: 0 14px; border-radius: 6px; font-size: 13px; font-weight: 500; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; vertical-align: middle; box-sizing: border-box;
}
.ed-btn-danger { font-weight: 600; }
/* inside lists and small tool rows the buttons stay compact */
.cp-table .ed-btn, .ta-poplist .ed-btn, .td-bulk-btn, .ed-btn.ed-btn-sm, .tc-preset-btn.ed-btn { min-height: 28px; padding: 0 10px; font-size: 12px; }
@media (max-width: 640px) {
  .ed-btn { min-height: 44px; }
  .cp-table .ed-btn, .ta-poplist .ed-btn { min-height: 36px; }
  /* row icons and the map buttons: thumb-sized on a phone */
  .cp-actions > *, .dl-menu-btn { min-width: 36px; min-height: 36px; }
  .mt-btn { width: 36px !important; height: 36px !important; font-size: 15px !important; }
}
/* the icon: drawn by the line set, in the element's own text colour */
.gsi::before {
  content: ''; display: inline-block; vertical-align: -0.2em; flex: 0 0 auto; width: 1.15em; height: 1.15em; background: currentColor;
  -webkit-mask: var(--gsi) center / contain no-repeat; mask: var(--gsi) center / contain no-repeat;
}
.gsi-inl { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.gsi-only { justify-content: center; }
.gsi-only::before { width: 1.25em; height: 1.25em; }
/* the toolbar and More-sheet icons fill their old emoji box */
.tb-icon > .gsi::before, .gsx-sheet-icon > .gsi::before { width: 20px; height: 20px; }
@media (max-width: 1040px) { .tb-icon > .gsi::before { width: 22px; height: 22px; } }
.mt-btn.gsi::before { width: 16px; height: 16px; }
.ed-close.gsi::before, .gsdf-xbtn.gsi::before, .td-modal-close.gsi::before { width: 14px; height: 14px; }
.ed-close.gsi, .gsdf-xbtn.gsi { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px; }
@media (max-width: 640px) { .ed-close.gsi, .gsdf-xbtn.gsi { min-width: 40px; min-height: 40px; } }

/* the icons (generated by build-icons.js) */
.gsi-home { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11 12 4l9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E"); }
.gsi-vehicle { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h11v9H3zM14 10h4l3 3v3h-7z'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3C/svg%3E"); }
.gsi-chat { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3C/svg%3E"); }
.gsi-settings { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1'/%3E%3C/svg%3E"); }
.gsi-clock { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.gsi-chart { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); }
.gsi-trend { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17l6-6 4 4 8-8'/%3E%3Cpath d='M15 7h6v6'/%3E%3C/svg%3E"); }
.gsi-clipboard { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4h6v3H9z'/%3E%3Cpath d='M8 5H5v16h14V5h-3'/%3E%3Cpath d='M8 11h8M8 15h6'/%3E%3C/svg%3E"); }
.gsi-users { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6'/%3E%3Cpath d='M16 4a3 3 0 0 1 0 6M18 14c2 .7 3 2.7 3 6'/%3E%3C/svg%3E"); }
.gsi-wrench { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0 5 5L21 13l-8 8-3-3 8-8'/%3E%3Cpath d='M14.7 6.3 11 10 4 17l3 3 7-7'/%3E%3C/svg%3E"); }
.gsi-pin { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6-5.5-6-11a6 6 0 0 1 12 0c0 5.5-6 11-6 11z'/%3E%3Ccircle cx='12' cy='10' r='2'/%3E%3C/svg%3E"); }
.gsi-crosshair { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Cpath d='M12 2v4M12 18v4M2 12h4M18 12h4'/%3E%3C/svg%3E"); }
.gsi-book { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h6a2 2 0 0 1 2 2v14a2 2 0 0 0-2-2H4z'/%3E%3Cpath d='M20 4h-6a2 2 0 0 0-2 2v14a2 2 0 0 1 2-2h6z'/%3E%3C/svg%3E"); }
.gsi-search { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-5-5'/%3E%3C/svg%3E"); }
.gsi-logout { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4h4v16h-4'/%3E%3Cpath d='M10 8l-4 4 4 4M6 12h10'/%3E%3C/svg%3E"); }
.gsi-close { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.gsi-add { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.gsi-minus { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E"); }
.gsi-routes { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 15c3-6 5-6 7-2s4 4 7-2 4-3 4-3'/%3E%3C/svg%3E"); }
.gsi-zones { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l9 7-3.5 10h-11L3 10z'/%3E%3C/svg%3E"); }
.gsi-contrast { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M12 3a9 9 0 0 1 0 18z' fill='black'/%3E%3C/svg%3E"); }
.gsi-ruler { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17 17 3l4 4L7 21z'/%3E%3Cpath d='M7 13l2 2M10 10l2 2M13 7l2 2'/%3E%3C/svg%3E"); }
.gsi-fullscreen { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E"); }
.gsi-save { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h11l3 3v13H5z'/%3E%3Cpath d='M8 4v5h7V4M8 20v-6h8v6'/%3E%3C/svg%3E"); }
.gsi-download { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5'/%3E%3Cpath d='M4 19h16'/%3E%3C/svg%3E"); }
.gsi-upload { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V4M7 9l5-5 5 5'/%3E%3Cpath d='M4 19h16'/%3E%3C/svg%3E"); }
.gsi-refresh { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 1 0-2.3 5.7'/%3E%3Cpath d='M20 4v7h-7'/%3E%3C/svg%3E"); }
.gsi-edit { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='M14 6l4 4'/%3E%3C/svg%3E"); }
.gsi-delete { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4h6v3'/%3E%3Cpath d='M6 7l1 13h10l1-13'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E"); }
.gsi-play { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4l13 8-13 8z'/%3E%3C/svg%3E"); }
.gsi-more-v { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='5' r='1.5'/%3E%3Ccircle cx='12' cy='12' r='1.5'/%3E%3Ccircle cx='12' cy='19' r='1.5'/%3E%3C/svg%3E"); }
.gsi-key { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='M11 12l9-9M17 6l3 3M15 8l2 2'/%3E%3C/svg%3E"); }
.gsi-link { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1'/%3E%3Cpath d='M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E"); }
.gsi-mail { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5h18v14H3z'/%3E%3Cpath d='M3 6l9 7 9-7'/%3E%3C/svg%3E"); }
.gsi-send { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12 20 4l-6 16-3-7z'/%3E%3Cpath d='M11 13l9-9'/%3E%3C/svg%3E"); }
.gsi-eye { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.gsi-hide { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 5.1A10.8 10.8 0 0 1 12 5c6.5 0 10 7 10 7a17.6 17.6 0 0 1-3.2 4.1M6.6 6.6C3.8 8.4 2 12 2 12s3.5 7 10 7c1.9 0 3.6-.6 5-1.5'/%3E%3C/svg%3E"); }
.gsi-calendar { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16v14H4zM4 10h16M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.gsi-check { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12l5 5L20 6'/%3E%3C/svg%3E"); }
.gsi-thermo { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14V5a2 2 0 0 1 4 0v9a4 4 0 1 1-4 0z'/%3E%3C/svg%3E"); }
.gsi-folder { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h6l2 2h10v11H3z'/%3E%3C/svg%3E"); }
.gsi-server { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16v7H4zM4 13h16v7H4z'/%3E%3Cpath d='M8 7.5h.01M8 16.5h.01'/%3E%3C/svg%3E"); }
.gsi-phone { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h10v18H7z'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); }
.gsi-antenna { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 13v8M8 21h8'/%3E%3Ccircle cx='12' cy='11' r='2'/%3E%3Cpath d='M7.8 6.8a6 6 0 0 0 0 8.4M16.2 6.8a6 6 0 0 1 0 8.4M5 4a10 10 0 0 0 0 14M19 4a10 10 0 0 1 0 14'/%3E%3C/svg%3E"); }
.gsi-file { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l4 4v14H6z'/%3E%3Cpath d='M14 3v4h4M9 12h6M9 16h6'/%3E%3C/svg%3E"); }
.gsi-warning { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20z'/%3E%3Cpath d='M12 9v5M12 17h.01'/%3E%3C/svg%3E"); }
.gsi-print { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 8V3h10v5'/%3E%3Cpath d='M5 8h14v8h-2M7 16H5V8'/%3E%3Cpath d='M7 13h10v8H7z'/%3E%3C/svg%3E"); }
.gsi-pause { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5v14M16 5v14'/%3E%3C/svg%3E"); }
.gsi-undo { --gsi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h11a5 5 0 0 1 0 10h-3'/%3E%3C/svg%3E"); }

/* ==========================================================================
   ALMAG UI step 7 (2026-11-20) -- questions in the ALMAG window instead of the browser's confirm / prompt box
   (gsdialog.js GsAsk). Visual only.
   ========================================================================== */
.ed-overlay.gsdf-q { z-index: 20002; }
.gsdf-q-input { width: 100%; box-sizing: border-box; margin-top: 12px; min-height: 36px; }
.gsdf-q .ed-footer { justify-content: flex-end; gap: 8px; }
/* OK on a question that deletes / removes: deep red, white text 6.5 : 1 in both themes */
.gsdf-q .gsdf-q-danger { background: #B3261E; border-color: #B3261E; color: #fff; }
@media (max-width: 640px) { .gsdf-q-input { min-height: 44px; font-size: 16px; } }

/* ALMAG UI step 7 part B1 (2026-11-20): admin pages ask in the ALMAG window (no style change) */

/* ALMAG UI step 7 part B2 (2026-11-20): Objects, SMS admin, Tacho admin ask in the ALMAG window (no style change) */

/* ALMAG UI step 7 part B3 (2026-11-20): Apply template asks in the ALMAG window (no style change) */

/* ==========================================================================
   ALMAG UI step 8 (2026-11-20) -- phone layouts (gscards.js). Visual only. Phone (640 px and narrower) only.
   - the object list fills the screen width, with readable text and thumb-sized rows;
   - list tables with 4+ columns become cards (one per row, column names in front of the values);
   - short questions, messages and compact dialogs slide up from the bottom.
   ========================================================================== */
@media (max-width: 640px) {
  /* object list */
  #sidebar { width: 100vw !important; max-width: none !important; }
  .dl-row { min-height: 56px; padding-top: 6px; padding-bottom: 6px; }
  .dl-row-name { font-size: 15px; font-weight: 600; color: var(--gs-text); }
  .dl-row-sub { font-size: 13px; }
  .dl-row-speed { font-size: 13px; }
  .dl-row-time { font-size: 12px; }
  .dl-row-icon { width: 16px; height: 16px; }
  .dl-menu-btn { width: 40px !important; height: 40px !important; }

  /* lists as cards */
  table.cp-table.gsx-cards { display: block; width: 100% !important; table-layout: auto !important; font-size: 14px !important; border: 0; }
  table.cp-table.gsx-cards thead { display: none; }
  table.cp-table.gsx-cards tbody { display: block; }
  table.cp-table.gsx-cards tr {
    display: block; position: relative; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--gs-border-2);
    border-radius: 10px; background: var(--gs-surface); height: auto !important;
  }
  table.cp-table.gsx-cards td {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: auto !important;
    min-width: 0 !important; max-width: none !important; height: auto !important; padding: 6px 0 !important; border: 0 !important;
    white-space: normal !important; overflow: visible !important; text-overflow: clip !important; text-align: right !important;
    font-size: 14px !important; overflow-wrap: anywhere;
  }
  table.cp-table.gsx-cards td + td { border-top: 1px solid var(--gs-border) !important; }
  table.cp-table.gsx-cards td::before {
    content: attr(data-gsx-label); flex: 0 0 38%; text-align: left; font-size: 12px; font-weight: 600; color: var(--gs-text-3);
  }
  table.cp-table.gsx-cards td[data-gsx-label=""]::before { content: none; }
  table.cp-table.gsx-cards td[data-gsx-label=""] { justify-content: flex-end; }
  /* the title line: the name of the vehicle / report / account */
  table.cp-table.gsx-cards td.gsx-title { justify-content: flex-start; text-align: left !important; font-size: 15px !important; font-weight: 700; padding-right: 40px !important; }
  table.cp-table.gsx-cards td.gsx-title::before { content: none; }
  /* the tick box sits in the card's top right corner */
  table.cp-table.gsx-cards td.gsx-check { position: absolute; top: 6px; right: 8px; padding: 6px !important; border: 0 !important; }
  table.cp-table.gsx-cards td.gsx-check::before { content: none; }
  table.cp-table.gsx-cards td.gsx-check + td { border-top: 0 !important; }
  table.cp-table.gsx-cards td.gsx-check input { width: 20px; height: 20px; }
  table.cp-table.gsx-cards tr.gsx-wide td { justify-content: center; text-align: center !important; }
  table.cp-table.gsx-cards tr.gsx-wide td::before { content: none; }
  /* the row's own buttons: a row of thumb-sized buttons at the bottom of the card */
  table.cp-table.gsx-cards td .cp-actions { justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
  .cp-table-wrap:has(> table.gsx-cards) { overflow-x: visible !important; border: 0; background: none; }

  /* short questions, messages and compact dialogs: a sheet from the bottom */
  .ed-overlay:has(> .ed-modal.gsdf-compact), .td-modal-overlay.gsdf-ov:has(> .gsdf-compact), .ta-pop-bg.gsdf-ov:has(> .gsdf-compact) {
    align-items: flex-end !important; justify-content: stretch !important; padding: 0 !important;
  }
  .ed-modal.gsdf-compact, .td-modal-box.gsdf-compact, .ta-pop.gsdf-compact {
    width: 100% !important; max-width: none !important; border-radius: 14px 14px 0 0 !important;
    padding-bottom: env(safe-area-inset-bottom); margin: 0 !important;
  }
  .ed-modal.gsdf-compact > .ed-header { border-radius: 14px 14px 0 0; }
}

/* ==========================================================================
   ALMAG UI step 9 (2026-11-20) -- menu structure on tablet and desktop (gsnav.js). Visual only.
   Dashboard · History · Reports ▾ · More ▾ … account menu (name ▾) on the right. Desktop: icon and word side by
   side; tablet: icon over word. Phone: unchanged (bottom tab bar).
   ========================================================================== */
#toolbar.gsx-has-bar { justify-content: flex-start; gap: 0; overflow: visible; }
#toolbar.gsx-has-bar > .tb-right { margin-left: 0; }
.gsx-bar { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; height: 100%; }
.gsx-bar > .tb-brand { margin-right: 6px; }
.gsx-account { margin-left: auto; }
.gsx-group { position: relative; flex: 0 0 auto; }
/* top-level entries: the moved toolbar buttons and the menu buttons look the same */
.gsx-bar > .tb-item, .gsx-top {
  display: inline-flex; flex-direction: row; align-items: center; gap: 8px; height: 40px; min-width: 0; width: auto;
  padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--gs-text-2); font: inherit; font-size: 13px;
  cursor: pointer; flex: 0 0 auto;
}
.gsx-bar > .tb-item .tb-label { display: block !important; margin: 0; font-size: 13px; max-width: none; color: inherit; }
.gsx-bar > .tb-item .tb-icon { color: inherit; }
.gsx-bar > .tb-item:hover, .gsx-top:hover, .gsx-top[aria-expanded="true"] { background: var(--gs-surface-5); color: var(--gs-text); }
.gsx-top-icon { display: inline-flex; }
.gsx-top-icon svg { width: 20px; height: 20px; }
.gsx-caret { font-size: 10px; opacity: 0.7; }
.gsx-account .gsx-top-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the menus */
.gsx-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 1200; min-width: 250px; padding: 6px;
  background: var(--gs-surface); border: 1px solid var(--gs-border-2); border-radius: 10px; box-shadow: 0 12px 32px var(--gs-shadow);
}
.gsx-account .gsx-menu { left: auto; right: 0; }
.gsx-menu .tb-item, .gsx-entry {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; height: 40px;
  min-width: 0; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--gs-text); font: inherit;
  font-size: 13px; text-align: left; cursor: pointer; position: relative;
}
.gsx-menu .tb-item .tb-label { display: block !important; margin: 0; font-size: 13px; max-width: none; color: inherit; }
.gsx-menu .tb-item .tb-icon, .gsx-entry-icon { width: 22px; flex: 0 0 22px; display: inline-flex; justify-content: center; color: var(--gs-text-3); }
.gsx-menu .tb-item:hover, .gsx-entry:hover { background: var(--gs-surface-4); }
.gsx-menu .tb-item.active { background: var(--gs-accent-bg); }
.gsx-menu #tb-theme { border-top: 1px solid var(--gs-border); border-radius: 0; margin-top: 4px; }
.gsx-menu #tb-logout, .gsx-menu #tb-logout .tb-icon { color: var(--gs-danger-fg); }
.gsx-menu .tb-badge { position: static; margin-left: auto; }
/* a bar with many buttons (the admin pages) keeps their compact look: icon over a small word */
.gsx-bar.gsx-many > .tb-item { flex-direction: column; justify-content: center; gap: 3px; height: 52px; padding: 0 7px; }
.gsx-bar.gsx-many > .tb-item .tb-label { font-size: 11px; }
/* tablet: icon over word, still one row that never runs off the screen */
@media (min-width: 641px) and (max-width: 1040px) {
  .gsx-bar > .tb-item, .gsx-top { flex-direction: column; justify-content: center; gap: 3px; height: 52px; padding: 0 10px; }
  .gsx-bar > .tb-item .tb-label, .gsx-top-label { display: block !important; font-size: 11px; }
  .gsx-caret { display: none; }
  .gsx-account .gsx-top-label { max-width: 110px; }
  .gsx-bar.gsx-many > .tb-item .tb-label { display: none !important; }
  .gsx-bar.gsx-many > .tb-item { padding: 0 8px; }
}
@media (max-width: 640px) { .gsx-bar { display: none !important; } }

/* ==========================================================================
   ALMAG UI step 10 (2026-11-20) -- text sizes (generated by build-sizes.js from app.css). Visual only.
   Five sizes, in rem so a phone's own text-size setting works: 20 / 16 / 14 (15 on a phone) / 13 / 12 px.
   Nothing below 12 px. Each rule keeps its own selector and screen-size condition; only the size changes.
   ========================================================================== */
.gs-lang-select { font-size: 0.75rem; }
.login-title { font-size: 1.25rem; }
#login-form label { font-size: 0.75rem; }
#login-form input { font-size: 0.8125rem; }
.login-error { font-size: 0.75rem; }
.login-ok { font-size: 0.75rem; }
.login-hint { font-size: 0.75rem; }
.login-link { font-size: 0.75rem; }
.btn-primary { font-size: 0.8125rem; }
#impersonate-banner { font-size: 0.75rem; }
#nav-bar { font-size: 0.75rem; }
.nav-caret { font-size: 0.75rem; }
.nav-stat-icon { font-size: 0.75rem; }
.tb-brand { font-size: 0.75rem; }
.gs-conn-status { font-size: 0.75rem; }
.gs-hist-popup { font-size: 0.75rem; }
.gs-hp-row > a { font-size: 0.75rem; }
.top-bar-logout { font-size: 0.75rem; }
#status-line { font-size: 0.75rem; }
.tb-icon { font-size: 1rem; }
.tb-icon-exit { font-size: 0.75rem !important; }
.tb-label { font-size: 0.75rem; }
.tb-count { font-size: 0.75rem; }
.tb-badge { font-size: 0.75rem; }
.hi-title { font-size: 0.8125rem; }
.hi-btn-row .ed-btn { font-size: 0.75rem; }
.hi-info-header { font-size: 0.75rem; }
.hi-event-icon { font-size: 0.875rem; }
.hi-event-label { font-size: 0.75rem; }
.hi-event-date { font-size: 0.75rem; }
.hi-event-dur { font-size: 0.75rem; }
.hi-event-fuel { font-size: 0.75rem; }
.hi-summary { font-size: 0.75rem; }
.hi-detail { font-size: 0.75rem; }
.gs-history-stop-pin { font-size: 1.25rem; }
.dl-filter { font-size: 0.75rem; }
.dl-search { font-size: 0.75rem; }
.dl-group-header { font-size: 0.75rem; }
.dl-group-arrow { font-size: 0.75rem; }
.dl-group-count { font-size: 0.75rem; }
.dl-row-name { font-size: 0.75rem; }
.dl-row-sub { font-size: 0.75rem; }
.dl-row-speed { font-size: 0.75rem; }
.dl-row-time { font-size: 0.75rem; }
.dl-menu-item { font-size: 0.75rem; }
.mt-btn { font-size: 0.875rem; }
#mt-measure-readout { font-size: 0.75rem; }
.gs-popup-title { font-size: 0.75rem; }
.gs-popup-table { font-size: 0.75rem; }
.gs-popup-detailed { font-size: 0.75rem; }
.dp-tab { font-size: 0.75rem; }
.dp-close { font-size: 1rem; }
.st-panel-check { font-size: 0.75rem; }
.dp-section-title { font-size: 0.75rem; }
.dp-kv { font-size: 0.75rem; }
.dp-period-label { font-size: 0.75rem; }
.dp-period-arrow { font-size: 1rem; }
.dp-tacho-issues { font-size: 0.75rem; }
.dp-notes { font-size: 0.75rem; }
.dp-tl-toggle { font-size: 0.75rem; }
.dp-tl-caret { font-size: 0.75rem; }
.dp-tl-day { font-size: 0.75rem; }
.dp-peek { font-size: 0.75rem; }
.dp-peek-caret { font-size: 0.75rem; }
.dp-peek-hint { font-size: 0.75rem; }
.dp-tl-time { font-size: 0.75rem; }
.dp-tl-line { font-size: 0.75rem; }
.dp-tl-meta { font-size: 0.75rem; }
.dp-tl-where { font-size: 0.75rem; }
.dp-gauge span { font-size: 0.75rem; }
.st-panel-summary { font-size: 0.75rem; }
.st-panel-summary::before { font-size: 0.75rem; }
.st-panel-sensor-hdr { font-size: 0.75rem; }
.dp-sparkline-range { font-size: 0.75rem; }
.ed-title { font-size: 0.8125rem; }
.ed-btn-header { font-size: 0.75rem; }
.ed-close { font-size: 1rem; }
.ed-tab { font-size: 0.75rem; }
.ed-section-title { font-size: 0.75rem; }
.ed-field label { font-size: 0.75rem; }
.ed-field input, .ed-field select { font-size: 0.75rem; }
.ed-tag { font-size: 0.75rem; }
.ed-tag-hint { font-size: 0.75rem; }
.ed-suggest-item { font-size: 0.75rem; }
.ed-placeholder { font-size: 0.75rem; }
.ed-loading { font-size: 0.75rem; }
.ed-error { font-size: 0.75rem; }
.ed-btn { font-size: 0.75rem; }
.tc-dec { font-size: 0.75rem; }
.drv-plate { font-size: 0.75rem; }
.drv-owner-tag { font-size: 0.75rem; }
.eu-vis-toggle { font-size: 0.875rem; }
.tc-today-badge { font-size: 0.75rem; }
.sn-health { font-size: 0.75rem; }
.ed-attr-key { font-size: 0.75rem; }
.ed-attr-val { font-size: 0.75rem; }
.ed-info-row { font-size: 0.75rem; }
.ed-icon-choice { font-size: 1.25rem; }
.ed-preview { font-size: 0.75rem; }
.ed-note { font-size: 0.75rem; }
.cp-loading { font-size: 0.75rem; }
.td-loading-msg { font-size: 0.75rem; }
.td-loading-sub { font-size: 0.75rem; }
.td-loading-el { font-size: 0.75rem; }
.cp-title { font-size: 1rem; }
.cp-info { font-size: 0.8125rem; }
.cp-search { font-size: 0.75rem; }
.cp-table { font-size: 0.75rem; }
.cp-table th { font-size: 0.75rem; }
.cp-colchooser .gs-ms-trigger { font-size: 0.75rem; }
.cp-pagination { font-size: 0.75rem; }
.cp-pag-btn { font-size: 0.875rem; }
.cp-pag-rows { font-size: 0.75rem; }
.cp-title-row .rp-icon-btn { font-size: 1rem; }
.cp-sort-arrow { font-size: 0.75rem; }
.cp-selected-count { font-size: 0.75rem; }
.dl-vis-all { font-size: 0.75rem; }
.cp-edit, .cp-delete, .cp-loginas, .cp-del-history, .cp-access-link { font-size: 0.875rem; }
.tc-detail-toolbar select, .tc-detail-toolbar input[type="date"] { font-size: 0.75rem; }
.tc-preset-btn { font-size: 0.75rem; }
.tc-summary-bar { font-size: 0.75rem; }
.tc-activity-cell { font-size: 1rem; }
.tc-day-label { font-size: 0.75rem; }
.rp-search input { font-size: 0.75rem; }
.rp-icon-btn { font-size: 0.875rem; }
.ed-field-inline label { font-size: 0.75rem; }
input.mono, .mono { font-size: 0.75rem; }
.eu-apikey-status { font-size: 0.75rem; }
.cp-api-count { font-size: 0.75rem; }
.rp-obj-check { font-size: 0.75rem; }
.eu-obj-selall-lbl { font-size: 0.75rem; }
.eu-obj-count { font-size: 0.75rem; }
.eu-gear-item { font-size: 0.75rem; }
.eu-obj-off { font-size: 0.75rem; }
.eu-tabbtn { font-size: 0.75rem; }
.td-tab { font-size: 0.75rem; }
.td-tab-n { font-size: 0.75rem; }
.td-lanes-cap { font-size: 0.75rem; }
.td-lane { font-size: 0.75rem; }
.ao-idresult { font-size: 0.75rem; }
.ao-selall-row { font-size: 0.75rem; }
.ao-group-header { font-size: 0.75rem; }
.ao-group-arrow { font-size: 0.75rem; }
.cp-toolbar-clear { font-size: 1rem; }
.gs-ms-trigger { font-size: 0.75rem; }
.gs-ms-caret { font-size: 0.75rem; }
.gs-ms-search input { font-size: 0.75rem; }
.gs-ms-item { font-size: 0.75rem; }
.gs-ms-group { font-size: 0.75rem; }
.gs-ms-noresult { font-size: 0.75rem; }
#gs-sidebar-toggle { font-size: 1.25rem; }
.lm-dd-item { font-size: 0.75rem; }
.lm-loading, .lm-empty, .lm-err { font-size: 0.75rem; }
.lm-month-label { font-size: 0.75rem; }
.lm-btn { font-size: 0.75rem; }
.lm-file-table, .lm-entry-table { font-size: 0.75rem; }
.lm-file-table th, .lm-entry-table th { font-size: 0.75rem; }
.lm-mono { font-size: 0.75rem; }
.lm-ev-badge { font-size: 0.75rem; }
.lm-cur-badge { font-size: 0.75rem; }
.st-vis-btn, .st-edit-obj-btn { font-size: 1rem; }
.st-obj-toolbar .st-obj-search { font-size: 0.75rem; }
.st-obj-selcount { font-size: 0.75rem; }
.st-new-group-input { font-size: 0.75rem; }
.st-group-save-btn, .st-group-cancel-btn { font-size: 0.8125rem; }
.st-empty-note { font-size: 0.75rem; }
.st-group-sel { font-size: 0.75rem; }
.st-device-picker-toggle { font-size: 0.75rem; }
.st-device-picker-arrow { font-size: 0.75rem; }
.st-device-picker-count { font-size: 0.75rem; }
.st-device-picker-hint { font-size: 0.75rem; }
.st-device-check-row { font-size: 0.75rem; }
.ed-field .st-dot-colors label { font-size: 0.75rem; }
.st-dot-reset { font-size: 0.75rem; }
.st-group-expand-btn { font-size: 0.75rem; }
.st-group-device-item { font-size: 0.75rem; }
.st-group-remove-device { font-size: 0.875rem; }
.st-group-add-sel { font-size: 0.75rem; }
.gs-popover-title { font-size: 0.75rem; }
.gs-popover-field label { font-size: 0.75rem; }
.gs-popover-field input { font-size: 0.75rem; }
.gs-popover-status { font-size: 0.75rem; }
.gs-popover-note { font-size: 0.75rem; }
.pl-tab { font-size: 0.75rem; }
.pl-empty { font-size: 0.75rem; }
.pl-item { font-size: 0.75rem; }
.pl-group { font-size: 0.75rem; }
.pl-icon-btn { font-size: 0.8125rem; }
.pl-form-header { font-size: 0.75rem; }
.pl-field label { font-size: 0.75rem; }
.pl-field input[type="text"] { font-size: 0.75rem; }
.pl-color-hex { font-size: 0.75rem; }
.pl-form-err { font-size: 0.75rem; }
.pl-draw-toolbar { font-size: 0.75rem; }
.pl-draw-type { font-size: 0.75rem; }
.pl-draw-hint { font-size: 0.75rem; }
.pl-draw-cancel { font-size: 0.75rem; }
.gs-toast { font-size: 0.75rem; }
.gs-marker-emoji { font-size: 1.25rem; }
.bk-exp-option { font-size: 0.75rem; }
.bk-exp-hint { font-size: 0.75rem; }
.bk-sum-item { font-size: 0.75rem; }
.bk-badge { font-size: 0.75rem; }
.tc-src { font-size: 0.75rem; }
.gs-sort-arrow { font-size: 0.75rem; }
.gs-tbl-search { font-size: 0.75rem; }
.td-modal-title { font-size: 0.8125rem; }
.td-info-cap { font-size: 0.75rem; }
.td-info { font-size: 0.75rem; }
.td-info code, .cp-table code { font-size: 0.75rem; }
.td-dec { font-size: 0.75rem; }
.td-total-row td:first-child { font-size: 0.75rem; }
.td-block { font-size: 0.75rem; }
.td-sched-field { font-size: 0.75rem; }
.td-sched-field input { font-size: 0.75rem; }
.td-sched-hint { font-size: 0.75rem; }
.td-sched-msg { font-size: 0.75rem; }
.td-status .td-force { font-size: 0.75rem; }
.td-queued { font-size: 0.75rem; }
.td-manage { font-size: 0.75rem; }
.tx-all { font-size: 0.75rem; }
.tx-count { font-size: 0.75rem; }
.tx-msg { font-size: 0.75rem; }
.tx-table td, .tx-table th { font-size: 0.8125rem; }
.tx-table td:nth-child(2) { font-size: 0.75rem; }
.td-bulk-count { font-size: 0.75rem; }
.td-bulk-btn { font-size: 0.75rem; }
.td-pick-search { font-size: 0.75rem; }
.td-pick-all { font-size: 0.75rem; }
.td-pick-row { font-size: 0.75rem; }
.td-pick-count { font-size: 0.75rem; }
.td-group-search { font-size: 0.75rem; }
.td-group-caret { font-size: 0.75rem; }
.td-group-meta { font-size: 0.75rem; }
.td-group-sort { font-size: 0.75rem; }
.td-year-head { font-size: 0.75rem; }
.ld-tile-name { font-size: 0.875rem; }
.ld-tile-sub, .ld-tile-nums { font-size: 0.75rem; }
.ld-tile-nums b { font-size: 0.8125rem; }
.ld-tile-status { font-size: 0.75rem; }
.ld-alert { font-size: 0.75rem; }
.ld-alert-in { font-size: 0.75rem; }
.ld-idhint { font-size: 0.75rem; }
.ld-row-name { font-size: 0.8125rem; }
.ld-row-sub { font-size: 0.75rem; }
.ld-group-name { font-size: 0.8125rem; }
.ld-sec { font-size: 0.75rem; }
.ld-mini { font-size: 0.75rem; }
.ld-hint { font-size: 0.75rem; }
.ld-selcount { font-size: 0.75rem; }
.ld-tray-cap { font-size: 0.75rem; }
.ld-tray-note { font-size: 0.75rem; }
.ld-dest-partial { font-size: 0.75rem; }
.ld-dest-fix { font-size: 0.75rem; }
.ld-chip { font-size: 0.75rem; }
.ld-chip-x { font-size: 0.875rem; }
.ld-note { font-size: 0.8125rem; }
.td-fmap-ico { font-size: 1rem; }
.td-fmap-name { font-size: 0.8125rem; }
.ld-help-title { font-size: 1rem; }
.ld-help-steps { font-size: 0.8125rem; }
.ld-help-note { font-size: 0.75rem; }
.ld-linkbtn { font-size: 0.75rem; }
.ld-where { font-size: 0.75rem; }
.ld-rd-acct { font-size: 0.75rem; }
.ld-fresh-cap { font-size: 0.75rem; }
.ld-tile-new .ld-tile-sub { font-size: 0.75rem; }
.ld-acct-pick { font-size: 0.75rem; }
.ld-acct-pick select { font-size: 0.75rem; }
.ld-handback { font-size: 0.75rem; }
.ld-mirror-cap { font-size: 0.75rem; }
.ld-mirror-in { font-size: 0.75rem; }
.ld-activity-summary { font-size: 0.75rem; }
.ld-muted { font-size: 0.75rem; }
.ld-chip-ok, .ld-chip-warn, .ld-chip-bad, .ld-chip-never { font-size: 0.75rem; }
.tx-cards-cap { font-size: 0.75rem; }
.ld-own-tag { font-size: 0.75rem; }
.ld-renew { font-size: 0.75rem; }
.ld-renew-sel { font-size: 0.75rem; }
.ld-saved { font-size: 0.75rem; }
.ld-tile-exp { font-size: 0.75rem; }
.ld-expiry { font-size: 0.75rem; }
.ld-expiry input[type=date] { font-size: 0.75rem; }
.ld-exp-now { font-size: 0.75rem; }
.dp-stale { font-size: 0.75rem; }
.obj-hidden-tag { font-size: 0.75rem; }
.pl-form-title { font-size: 0.75rem; }
.hi-checkbox-label, .ed-check { font-size: 0.75rem; }
.cell-dim, .td-card-msg { font-size: 0.75rem; }
.ob-imei, .tx-cardid { font-size: 0.75rem; }
.st-sort-arrow { font-size: 0.75rem; }
.eu-edit-obj-btn { font-size: 0.75rem; }
.gs-vis-text { font-size: 0.75rem; }
.gs-acct-sub { font-size: 0.75rem; }
.gs-acct-none { font-size: 0.75rem; }
.cp-vis-bydate, .eu-vis-bydate, .st-vis-bydate { font-size: 0.75rem; }
.eu-sort-arrow { font-size: 0.75rem; }
.gs-copy-toast { font-size: 0.8125rem; }
.dr-bar label { font-size: 0.8125rem; }
.dr-window { font-size: 0.75rem; }
.dr-table { font-size: 0.8125rem; }
.dr-group td { font-size: 0.75rem; }
.dr-kind { font-size: 0.75rem; }
.dr-file { font-size: 0.75rem; }
.ld-remove-cap { font-size: 0.75rem; }
.ld-remove-opt { font-size: 0.75rem; }
.ld-removed-warn { font-size: 0.75rem; }
.ld-confirm .ed-body p { font-size: 0.8125rem; }
.ld-period select.ed-input { font-size: 0.75rem; }
.ld-period-hint { font-size: 0.75rem; }
.ld-period-list { font-size: 0.75rem; }
.cp-via-group { font-size: 0.75rem; }
.eu-grouplink-devs { font-size: 0.75rem; }
.tc-sh-title { font-size: 0.875rem; }
.tdk-note { font-size: 0.8125rem; }
.tdk-error { font-size: 0.8125rem; }
.tdk-chip { font-size: 0.75rem; }
.tdk-veh { font-size: 0.8125rem; }
.tdk-imei { font-size: 0.75rem; }
.td-lane-tag { font-size: 0.75rem; }
.td-desk-veh { font-size: 0.8125rem; }
.rp-psec { font-size: 0.8125rem; }
.rp-prow > label { font-size: 0.75rem; }
.rp-status { font-size: 0.75rem; }
.rp-tab { font-size: 0.8125rem; }
.rp-global-badge { font-size: 0.75rem; }
.rp-list-foot { font-size: 0.75rem; }
.rp-list-note { font-size: 0.75rem; }
.rp-prow input[type="text"], .rp-prow input[type="number"], .rp-prow input[type="date"], .rp-prow select { font-size: 0.75rem; }
.rp-busy-text { font-size: 0.8125rem; }
.rp-busy-time { font-size: 0.75rem; }
.ac-card { font-size: 0.875rem; }
.ac-table { font-size: 0.8125rem; }
.ac-note { font-size: 0.75rem; }
.ac-map-full { font-size: 1rem; }
.ac-chart .ac-ax { font-size: 0.75rem; }
.ac-chip { font-size: 0.8125rem; }
.ac-input { font-size: 1rem; }
.ac-send { font-size: 1.25rem; }
.tc-inf-note { font-size: 0.75rem; }
.tc-rules-title { font-size: 1rem; }
.tc-rules-sub { font-size: 0.75rem; }
.gsdf-td > .gsdf-head .td-modal-title, .gsdf-ta > .gsdf-head > b { font-size: 0.8125rem; }
.gsdf-td .gsdf-xbtn, .gsdf-ta .gsdf-xbtn { font-size: 1rem; }
.gsx-sheet-item { font-size: 1rem; }
.gsx-sheet-icon { font-size: 1.25rem; }
.ed-btn { font-size: 0.8125rem; }
.cp-table .ed-btn, .ta-poplist .ed-btn, .td-bulk-btn, .ed-btn.ed-btn-sm, .tc-preset-btn.ed-btn { font-size: 0.75rem; }
.gsx-bar > .tb-item, .gsx-top { font-size: 0.8125rem; }
.gsx-bar > .tb-item .tb-label { font-size: 0.8125rem; }
.gsx-caret { font-size: 0.75rem; }
.gsx-menu .tb-item, .gsx-entry { font-size: 0.8125rem; }
.gsx-menu .tb-item .tb-label { font-size: 0.8125rem; }
.gsx-bar.gsx-many > .tb-item .tb-label { font-size: 0.75rem; }
@media (max-width: 640px) {
.dp-peek { font-size: 0.75rem; }
.dp-tl-toggle { font-size: 0.75rem; }
.dp-tl-time { font-size: 0.75rem; }
.dp-tl-line { font-size: 0.75rem; }
.dp-tl-meta, .dp-tl-where { font-size: 0.75rem; }
.tb-icon { font-size: 1.25rem; }
.tb-icon-exit { font-size: 0.75rem !important; }
.mt-btn { font-size: 0.75rem; }
.pl-draw-toolbar { font-size: 0.75rem; }
.dp-kv { font-size: 0.8125rem; }
.dp-section-title { font-size: 0.75rem; }
.dp-tab { font-size: 0.8125rem; }
.dp-close { font-size: 1.25rem; }
.dp-period-arrow { font-size: 1.25rem; }
.dp-period-label { font-size: 0.8125rem; }
.ac-kv dt { font-size: 0.75rem; }
.gsx-tab-label { font-size: 0.75rem; }
.mt-btn { font-size: 1rem !important; }
.gsdf-q-input { font-size: 1rem; }
.dl-row-name { font-size: 1rem; }
.dl-row-sub { font-size: 0.8125rem; }
.dl-row-speed { font-size: 0.8125rem; }
.dl-row-time { font-size: 0.75rem; }
table.cp-table.gsx-cards { font-size: 0.875rem !important; }
table.cp-table.gsx-cards td { font-size: 0.875rem !important; }
table.cp-table.gsx-cards td::before { font-size: 0.75rem; }
table.cp-table.gsx-cards td.gsx-title { font-size: 1rem !important; }
}
@media (max-width: 1200px) {
.cp-table { font-size: 0.75rem; }
.lm-file-table, .lm-entry-table { font-size: 0.75rem; }
}
@media (max-width: 900px) {
.cp-table { font-size: 0.75rem; }
.lm-file-table, .lm-entry-table { font-size: 0.75rem; }
}
@media (min-width: 641px) and (max-width: 1040px) {
.tb-icon { font-size: 1.25rem; }
.gsx-bar > .tb-item .tb-label, .gsx-top-label { font-size: 0.75rem; }
}
[style*="font-size:11px"], [style*="font-size: 11px"], [style*="font-size:10px"], [style*="font-size: 10px"] { font-size: 0.75rem !important; }
@media (max-width: 640px) {
  .ed-body, .gs-popover, .pl-panel { font-size: 0.9375rem; }
  .ed-body input:not([type="checkbox"]):not([type="radio"]), .ed-body select, .ed-body textarea, .gs-popover input, #sidebar input[type="text"], #sidebar input[type="search"] { font-size: 1rem !important; }
}
@media (min-width: 1041px) and (max-width: 1180px) {
  .gsx-bar.gsx-many > .tb-item { padding: 0 4px; }
  .gsx-account .gsx-top-label { max-width: 120px; }
}

/* ==========================================================================
   ALMAG UI step 11 (2026-11-20) -- text on the map follows the MAP style, not the interface theme. Visual only.
   Light map (street map, light map setting): light boxes, dark text with a light outline.
   Dark map (dark map setting, or the satellite photo): dark boxes, light text with a dark outline.
   Covers vehicle names and labels, hover tooltips, and every popup on the map (vehicle, history point, stop).
   The colour names used inside those boxes (--gs-text, --gs-accent ...) are set here per map style, so text
   that used the interface colours now follows the map. gsmaptext.js marks a map showing satellite tiles.
   ========================================================================== */
/* light map */
:root:not([data-map-theme="dark"]) .leaflet-container:not(.gsx-map-sat) .leaflet-tooltip,
:root:not([data-map-theme="dark"]) .leaflet-container:not(.gsx-map-sat) .leaflet-popup-content-wrapper,
:root:not([data-map-theme="dark"]) .leaflet-container:not(.gsx-map-sat) .leaflet-popup-tip {
  --gs-text: #16202C; --gs-text-2: #26323F; --gs-text-3: #4A5868; --gs-accent: #00628F;
  --gs-border: rgba(22, 32, 44, 0.14); --gs-surface: #FFFFFF;
  background-color: #FFFFFF; border-color: #FFFFFF; color: #16202C;
  text-shadow: 0 0 1px #FFFFFF, 0 0 2px #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
:root:not([data-map-theme="dark"]) .leaflet-container:not(.gsx-map-sat) a.leaflet-popup-close-button { color: #4A5868; }
/* dark map: the dark map setting, or the satellite photo whatever the setting */
:root[data-map-theme="dark"] .leaflet-container .leaflet-tooltip,
:root[data-map-theme="dark"] .leaflet-container .leaflet-popup-content-wrapper,
:root[data-map-theme="dark"] .leaflet-container .leaflet-popup-tip,
.leaflet-container.gsx-map-sat .leaflet-tooltip,
.leaflet-container.gsx-map-sat .leaflet-popup-content-wrapper,
.leaflet-container.gsx-map-sat .leaflet-popup-tip {
  --gs-text: #EAF3FA; --gs-text-2: #D4E3EF; --gs-text-3: #A9BFD1; --gs-accent: #5CC8F5;
  --gs-border: rgba(234, 243, 250, 0.16); --gs-surface: #1B2A3E;
  background-color: #1B2A3E; border-color: #1B2A3E; color: #EAF3FA;
  text-shadow: 0 0 1px #000000, 0 0 2px #000000;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
:root[data-map-theme="dark"] .leaflet-container a.leaflet-popup-close-button,
.leaflet-container.gsx-map-sat a.leaflet-popup-close-button { color: #A9BFD1; }
.leaflet-container.gsx-map-sat .leaflet-tooltip-left::before { border-left-color: #1B2A3E; }
.leaflet-container.gsx-map-sat .leaflet-tooltip-right::before { border-right-color: #1B2A3E; }
.leaflet-container.gsx-map-sat .leaflet-tooltip-top::before { border-top-color: #1B2A3E; }
.leaflet-container.gsx-map-sat .leaflet-tooltip-bottom::before { border-bottom-color: #1B2A3E; }
.leaflet-container.gsx-map-sat .leaflet-control-attribution { background: rgba(22, 34, 52, 0.8); color: #A9C8DE; }
.leaflet-container.gsx-map-sat .leaflet-control-attribution a { color: #7CA2BE; }
/* the satellite photo is never colour-inverted by the dark map setting (that filter is for the street map) */
.leaflet-container.gsx-map-sat .leaflet-tile-pane { filter: none; }
/* 2026-11-20 View-as fix: no CSS change (app.js only) */

/* ==========================================================================
   ALMAG UI step 15 (2026-11-20) -- object panel on a phone: a short Info list. Visual only.
   Shows the real odometer, engine, battery and fuel level; "Show all (N)" opens the rest.
   Tablet and desktop: unchanged (the button is not shown there).
   ========================================================================== */
.dp-info-more { display: none; }
@media (max-width: 640px) {
  .dp-info-col:not(.dp-showall) .dp-kv:not(.dp-keep) { display: none; }
  /* the map's button column runs past the shortened map; the open panel sits above it so its tabs stay
     visible and tappable (the light / dark map button used to cover the "Data" tab) */
  #device-panel { position: relative; z-index: 1001; }
  .dp-info-more {
    display: block; width: 100%; min-height: 44px; margin-top: 6px; padding: 0 12px;
    border: 1px solid var(--gs-border-3); border-radius: 6px; background: var(--gs-surface);
    color: var(--gs-accent); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
  }
}

/* ==========================================================================
   ALMAG UI step 16 (2026-11-20) -- object panel on a phone: "Position data" folded. Visual only.
   Phone: only its title and "Show position data (N)"; the button opens and closes it.
   Tablet and desktop: unchanged (the button is not shown there; step 15 hides .dp-info-more).
   ========================================================================== */
@media (max-width: 640px) {
  .dp-raw-col:not(.dp-open) .dp-kv { display: none; }
}
/* step 17: no CSS change (devicepanel.js only) */

/* ==========================================================================
   ALMAG UI step 18 (2026-11-20) -- object panel: the header (tabs and ×) stays at the top while the
   panel's content scrolls under it, on every screen size. Visual only.
   ========================================================================== */
#device-panel .dp-header { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--gs-border); }
/* step 19: no CSS change (devicepanel.js only) */

/* ==========================================================================
   ALMAG UI step 20 (2026-11-20) -- the invoice logo is the website's logo. Visual only.
   Login: the full logo (light text on the dark card). Desktop top bar: the dot mark before "ALMAG TECH".
   Report documents use img/logo.svg (navy text). Icons: the dot mark on white.
   ========================================================================== */
.login-logo.gsx-logo-full { display: block; width: 260px; max-width: 100%; height: auto; margin: 0 auto 28px; }
.login-title.gsx-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
@media (min-width: 1041px) {
  .gsx-bar > .tb-brand, #toolbar .tb-brand { display: inline-flex; align-items: center; gap: 8px; }
  .tb-brand::before {
    content: ''; flex: 0 0 auto; width: 22px; height: 24px;
    background: url("/img/mark.svg") center / contain no-repeat;
  }
}

/* ==========================================================================
   ALMAG UI step 21 (2026-11-21) -- desktop: the Reports entries sit in the top bar, not folded. Visual only.
   The Reports menu's own entries (same elements, same clicks) are shown in the bar and its "Reports ▾"
   button is hidden. Tablet and phone keep the folded menu / bottom tab bar.
   ========================================================================== */
@media (min-width: 1041px) {
  #gsx-g-reports { display: contents; }
  #gsx-g-reports > .gsx-top { display: none; }
  #gsx-g-reports > .gsx-menu, #gsx-g-reports > .gsx-menu[hidden] { display: contents !important; }
  #gsx-g-reports > .gsx-menu > .tb-item {
    display: inline-flex; flex-direction: row; align-items: center; gap: 8px; height: 40px; width: auto; min-width: 0;
    padding: 0 12px; border-radius: 8px; color: var(--gs-text-2); flex: 0 0 auto; white-space: nowrap;
  }
  #gsx-g-reports > .gsx-menu > .tb-item .tb-icon { width: auto; flex: 0 0 auto; color: inherit; }
  #gsx-g-reports > .gsx-menu > .tb-item:hover { background: var(--gs-surface-5); color: var(--gs-text); }
  #gsx-g-reports > .gsx-menu > .tb-item.active { background: var(--gs-accent-bg); }
  #gsx-g-reports > .gsx-menu > .tb-item.active .tb-icon, #gsx-g-reports > .gsx-menu > .tb-item.active .tb-label { color: var(--gs-accent); }
}

/* ==========================================================================
   ALMAG UI step 22 (2026-11-21) -- PC: every entry in the top bar, nothing folded. Visual only.
   The More menu's entries (same elements, same clicks) sit in the bar like the Reports ones (step 21), its
   "More" button is hidden. All bar entries show the icon with its word under it, so all 12 fit on one row.
   The account menu stays as it is. Tablet and phone unchanged.
   ========================================================================== */
@media (min-width: 1041px) {
  #gsx-g-more { display: contents; }
  #gsx-g-more > .gsx-top { display: none; }
  #gsx-g-more > .gsx-menu, #gsx-g-more > .gsx-menu[hidden] { display: contents !important; }
  #gsx-g-more > .gsx-menu > .tb-item {
    display: inline-flex; align-items: center; width: auto; min-width: 0; border-radius: 8px;
    color: var(--gs-text-2); flex: 0 0 auto; white-space: nowrap;
  }
  #gsx-g-more > .gsx-menu > .tb-item .tb-icon { width: auto; flex: 0 0 auto; color: inherit; }
  #gsx-g-more > .gsx-menu > .tb-item:hover { background: var(--gs-surface-5); color: var(--gs-text); }
  #gsx-g-more > .gsx-menu > .tb-item.active { background: var(--gs-accent-bg); }
  #gsx-g-more > .gsx-menu > .tb-item.active .tb-icon, #gsx-g-more > .gsx-menu > .tb-item.active .tb-label { color: var(--gs-accent); }
  /* word under the icon */
  #toolbar .gsx-bar > .tb-item, #gsx-g-reports > .gsx-menu > .tb-item, #gsx-g-more > .gsx-menu > .tb-item {
    flex-direction: column; justify-content: center; gap: 3px; height: 52px; padding: 0 7px;
  }
  #toolbar .gsx-bar > .tb-item .tb-label, #gsx-g-reports > .gsx-menu > .tb-item .tb-label, #gsx-g-more > .gsx-menu > .tb-item .tb-label { font-size: 0.75rem; }
}
@media (min-width: 1041px) and (max-width: 1365px) {
  #toolbar .gsx-bar > .tb-item, #gsx-g-reports > .gsx-menu > .tb-item, #gsx-g-more > .gsx-menu > .tb-item { padding: 0 4px; }
  #toolbar .gsx-account .gsx-top-label { max-width: 110px; }
}
/* a narrower PC screen or a long language: a long word is shortened with "..." (full name in the tooltip);
   the account menu always stays on screen */
@media (min-width: 1041px) {
  #toolbar .gsx-bar > .tb-item, #gsx-g-reports > .gsx-menu > .tb-item, #gsx-g-more > .gsx-menu > .tb-item { flex: 0 1 auto; min-width: 34px; }
  #toolbar .gsx-bar > .tb-item .tb-label, #gsx-g-reports > .gsx-menu > .tb-item .tb-label, #gsx-g-more > .gsx-menu > .tb-item .tb-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #toolbar .gsx-bar > .tb-brand, #gsx-g-account { flex-shrink: 0; }
}

/* ALMAG step 23 (2026-11-21): no CSS change -- Group controls removed for the administrator in editdevice.js, objects.js, bulkapply.js. */

/* ALMAG step 23b (2026-11-21): no CSS change -- Group link check button hidden in the control panel. */

/* ALMAG step 24 (2026-11-21): no CSS change -- admin Settings > Objects has no group controls. */

/* ALMAG step 25 (2026-11-21): no CSS change -- groups are no longer linked to other accounts. */
/* step 26: no CSS */
/* step 27: no CSS */
/* step 28: no CSS */

/* ==========================================================================
   ALMAG UI step 29 (2026-11-24) -- History list: times "start – end" on every row, a stop's address and a
   trip's km / top speed under them, a stop's engine-idle time on the right. All screen sizes (owner asked
   for app and PC). The address may take two lines; the full address is also in the tooltip.
   ========================================================================== */
.hi-event-date { white-space: normal; }
.hi-event-addr { font-size: 0.75rem; color: var(--gs-text-3); margin-top: 1px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2; overflow-wrap: anywhere; }
.hi-event-idle { font-size: 0.75rem; color: var(--gs-text-3); white-space: nowrap; }
/* step 30: no CSS */
/* step 31: no CSS */
/* step 32: no CSS */
/* step 33: no CSS */
/* step 34: no CSS */
