/* ================================================================
   PITSTOP — design system
   Motorsport-inspired, fast feeling, high contrast.
   ---------------------------------------------------------------- */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* dark theme (default) */
  --bg: #08090b;
  --bg-elev: #101216;
  --bg-card: #14171c;
  --line: #1f242c;
  --line-strong: #2a3038;
  --ink: #f5f7fa;
  --ink-mute: #8a93a3;
  --ink-dim: #5a6373;

  --lime: oklch(0.88 0.22 130);
  --lime-soft: oklch(0.88 0.22 130 / 0.18);
  --magenta: oklch(0.7 0.25 350);
  --magenta-soft: oklch(0.7 0.25 350 / 0.18);
  --warn: oklch(0.78 0.18 60);
  --danger: oklch(0.7 0.22 25);
  --ok: var(--lime);

  --grid: rgba(255, 255, 255, 0.04);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -20px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  --bg: #f4f4f1;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --line: #e2e2dd;
  --line-strong: #c8c8c0;
  --ink: #0a0c10;
  --ink-mute: #5d6573;
  --ink-dim: #8a93a3;

  --lime: oklch(0.7 0.22 135);
  --lime-soft: oklch(0.7 0.22 135 / 0.16);
  --magenta: oklch(0.55 0.25 350);
  --magenta-soft: oklch(0.55 0.25 350 / 0.14);

  --grid: rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 12px 30px -18px rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-display);
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
[x-cloak] { display: none !important; }

/* utility ---------------------------------------------------------- */
.mono { font-family: var(--font-mono); font-feature-settings: "zero", "ss01"; }
.kbd  { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink-mute); background: var(--bg-elev); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-on  { background: var(--lime); box-shadow: 0 0 0 4px var(--lime-soft); }
.dot-off { background: var(--ink-dim); }
.dot-warn{ background: var(--warn); box-shadow: 0 0 0 4px oklch(0.78 0.18 60 / 0.18); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--ink-mute);
  background: var(--bg-elev);
}
.chip-on   { color: var(--lime); border-color: color-mix(in oklab, var(--lime) 40%, transparent); background: var(--lime-soft); }
.chip-off  { color: var(--ink-dim); border-color: var(--line-strong); background: var(--bg-elev); }
.chip-warn { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 40%, transparent); background: oklch(0.78 0.18 60 / 0.14); }
.chip-mag  { color: var(--magenta); border-color: color-mix(in oklab, var(--magenta) 40%, transparent); background: var(--magenta-soft); }
.chip-pending { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 40%, transparent); background: oklch(0.78 0.18 60 / 0.14); }

.text-muted { color: var(--ink-mute); }
.text-dim   { color: var(--ink-dim); }
.text-ok    { color: var(--lime); }
.text-warn  { color: var(--warn); }
.text-danger{ color: var(--danger); }
.text-accent{ color: var(--lime); }

/* shared chrome ---------------------------------------------------- */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
  border-radius: 6px;
  font-family: var(--font-mono); font-weight: 700;
  font-size: 14px;
  position: relative; overflow: hidden;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, var(--lime) 0 4px, transparent 4px 8px);
  opacity: 0.0;
  transition: opacity 0.3s;
}
.brand:hover .brand-mark::after { opacity: 0.5; }

/* button ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer; transition: transform 0.1s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
  user-select: none; white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--lime); color: #0a0c10;
  box-shadow: 0 0 0 0 var(--lime-soft);
}
.btn-primary:hover { box-shadow: 0 0 0 6px var(--lime-soft); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn-block { width: 100%; justify-content: center; }

/* theme toggle ----------------------------------------------------- */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 3px; background: var(--bg-elev);
}
.theme-toggle button {
  border: 0; background: transparent;
  color: var(--ink-mute);
  width: 30px; height: 30px;
  border-radius: 999px;
  display: grid; place-items: center;
  cursor: pointer; transition: background 0.2s, color 0.2s;
}
.theme-toggle button.active {
  background: var(--ink); color: var(--bg);
}

/* card ------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.card-title {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-mute);
}
.card-body { padding: 18px; }

/* form input ------------------------------------------------------- */
.input {
  width: 100%;
  padding: 11px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-display); font-size: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 4px var(--lime-soft);
}
.input::placeholder { color: var(--ink-dim); }

/* number formatting */
.num-xl { font-family: var(--font-display); font-weight: 700; font-size: 44px; letter-spacing: -0.04em; line-height: 1; }
.num-lg { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: -0.03em; line-height: 1; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ APP SHELL (sidebar + main) =========================== */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: var(--bg);
}
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.sidebar .brand { padding: 4px 8px 6px; }
.side-section { display: flex; flex-direction: column; gap: 2px; }
.side-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; color: var(--ink-dim);
  text-transform: uppercase;
  padding: 0 10px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--ink-mute);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.side-link:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 6%, transparent); }
.side-link.active {
  color: var(--ink);
  background: color-mix(in oklab, var(--ink) 8%, transparent);
}
.side-link.active::before {
  content: ""; width: 3px; height: 16px; background: var(--lime); border-radius: 2px;
  margin-left: -10px; margin-right: 7px;
}
.side-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.side-link .badge {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 10px;
  background: var(--bg-card); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 999px;
  color: var(--ink-mute);
}
.side-link .badge.lime { color: var(--lime); border-color: color-mix(in oklab, var(--lime) 40%, transparent); background: var(--lime-soft); }

.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lime), var(--magenta));
  color: var(--bg); display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}
.side-user .name { font-size: 13px; font-weight: 600; }
.side-user .role { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); letter-spacing: 0.06em; text-transform: uppercase; }

main.app-main { padding: 22px 28px 60px; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em;
}
.crumbs .sep { opacity: 0.5; }
.crumbs strong { color: var(--ink); font-weight: 600; }

.search {
  position: relative;
  flex: 1; max-width: 360px;
}
.search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  outline: none;
}
.search input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.search input::placeholder { color: var(--ink-dim); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); }
.search .kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }

.topbar-actions { display: flex; gap: 8px; align-items: center; }

.title-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.title-row h1 {
  margin: 0; font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -0.03em; font-weight: 700;
}
.title-row .sub {
  margin-top: 6px;
  font-size: 14px; color: var(--ink-mute);
}
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--ink-mute); text-transform: uppercase;
}

/* KPI cards -------------------------------------------------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 22px;
}
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  position: relative; overflow: hidden;
}
.kpi.active { border-color: color-mix(in oklab, var(--lime) 40%, transparent); }
.kpi.active::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--lime);
}
.kpi .lbl { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em; }
.kpi .val {
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1;
  margin: 8px 0 6px;
}
.kpi .val small { font-family: var(--font-mono); font-weight: 500; font-size: 13px; color: var(--ink-mute); }
.kpi .delta { font-family: var(--font-mono); font-size: 11px; }
.kpi .delta.up { color: var(--lime); }
.kpi .delta.dn { color: var(--warn); }
.kpi .delta.muted { color: var(--ink-dim); }
.kpi .spark {
  position: absolute; right: 14px; bottom: 12px;
  width: 80px; height: 30px; opacity: 0.9;
}

/* status / events / map cards (overview) --------------------------- */
.grid-overview {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
}

.map-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  min-height: 460px;
}
.map-head {
  position: absolute; top: 14px; left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 5; gap: 10px; pointer-events: none;
}
.map-head > * { pointer-events: auto; }
.map-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--ink-mute); text-transform: uppercase; }
.map-canvas {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 30%, color-mix(in oklab, var(--lime) 4%, transparent), transparent 70%),
    var(--bg-elev);
}
.map-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.map-pin {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  text-decoration: none;
  color: var(--ink);
}
.map-pin:hover { transform: translate(-50%, -100%) scale(1.05); z-index: 10; }
.map-pin .head {
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: var(--font-mono); font-size: 10px;
  white-space: nowrap;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
  color: var(--ink);
}
.map-pin.online .head { border-color: color-mix(in oklab, var(--lime) 50%, transparent); }
.map-pin.offline .head { opacity: 0.6; }
.map-pin .marker {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--lime);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--lime);
}
.map-pin.offline .marker { background: var(--ink-dim); box-shadow: 0 0 0 1px var(--ink-dim); }
.map-pin.warn .marker { background: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.map-pin .pulse {
  position: absolute; bottom: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--lime);
  opacity: 0.4;
  animation: ping 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes ping {
  0% { transform: translateY(50%) scale(0.4); opacity: 0.6; }
  100% { transform: translateY(50%) scale(2); opacity: 0; }
}

.map-legend {
  position: absolute; left: 14px; bottom: 14px;
  display: flex; gap: 10px;
  background: color-mix(in oklab, var(--bg-card) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em;
  z-index: 5;
}
.map-legend .lg { display: flex; align-items: center; gap: 6px; }

.map-caption {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.08em; text-transform: uppercase;
  background: color-mix(in oklab, var(--bg-card) 90%, transparent);
  padding: 12px 18px; border-radius: 10px;
  border: 1px dashed var(--line-strong);
  pointer-events: none;
}

/* side panel (donut + events) -------------------------------------- */
.side-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.status-card .body { padding: 18px; }
.status-flex { display: flex; align-items: center; gap: 18px; }
.donut {
  width: 110px; height: 110px;
  position: relative; flex-shrink: 0;
}
.donut svg { transform: rotate(-90deg); }
.donut-center {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  text-align: center;
}
.donut-center .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.donut-center .l { font-family: var(--font-mono); font-size: 9px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px;}

.status-list { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.status-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
}
.status-row .swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.status-row .lbl { color: var(--ink-mute); flex: 1; }
.status-row .v { font-family: var(--font-mono); font-weight: 600; }

/* event ticker ----------------------------------------------------- */
.events-card { display: flex; flex-direction: column; min-height: 0; }
.events-body {
  max-height: 340px;
  overflow-y: auto;
  padding: 4px 0;
}
.evt {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: start;
  padding: 10px 18px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.evt:last-child { border-bottom: 0; }
.evt .ic {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--bg-elev);
  color: var(--ink-mute);
  margin-top: 1px;
}
.evt.ok .ic    { background: var(--lime-soft); color: var(--lime); }
.evt.cmd .ic   { background: var(--magenta-soft); color: var(--magenta); }
.evt.warn .ic  { background: oklch(0.78 0.18 60 / 0.18); color: var(--warn); }
.evt .body { min-width: 0; }
.evt .msg { font-weight: 500; word-break: break-word; }
.evt .meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); margin-top: 2px; word-break: break-all; }
.evt .t { font-family: var(--font-mono); font-size: 10px; color: var(--ink-dim); white-space: nowrap; }

.events-empty {
  padding: 24px 18px; text-align: center;
  color: var(--ink-mute); font-size: 13px;
}

/* fleet table ------------------------------------------------------ */
.fleet-card { margin-top: 16px; }
.fleet-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 8px; }
.tabs button {
  border: 0; background: transparent;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 5px 11px; border-radius: 5px;
  cursor: pointer;
}
.tabs button.active { background: var(--ink); color: var(--bg); }
.tabs button .ct { font-family: var(--font-mono); font-size: 10px; opacity: 0.7; margin-left: 4px; }

.table-wrap { overflow-x: auto; }
table.fleet {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
table.fleet th {
  text-align: left;
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute); font-weight: 500;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
  white-space: nowrap;
}
table.fleet th.sortable {
  cursor: pointer; user-select: none;
  position: relative; padding-right: 24px;
}
table.fleet th.sortable:hover { color: var(--ink); }
table.fleet th.sortable::after {
  content: ""; position: absolute;
  right: 10px; top: 50%;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--ink-dim);
  transform: translateY(-50%);
  opacity: 0.45;
}
table.fleet th.sortable.sort-asc::after {
  border-top: 0; border-bottom: 4px solid var(--lime); opacity: 1;
}
table.fleet th.sortable.sort-desc::after {
  border-top: 4px solid var(--lime); border-bottom: 0; opacity: 1;
}
table.fleet th.sortable.sort-asc,
table.fleet th.sortable.sort-desc { color: var(--ink); }
table.fleet td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
table.fleet tr:last-child td { border-bottom: 0; }
table.fleet tbody tr { cursor: pointer; transition: background 0.12s; }
table.fleet tbody tr:hover { background: color-mix(in oklab, var(--ink) 4%, transparent); }

td.veh {
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap;
}
.vavatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px;
  font-weight: 700; color: var(--ink);
}
.veh .label { font-weight: 600; font-size: 13px; }
.veh .vin { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); margin-top: 1px;}

td.status { display: flex; align-items: center; gap: 8px; }
td.status .txt { font-size: 12px; }
.txt-on  { color: var(--lime); font-weight: 600; }
.txt-off { color: var(--ink-dim); font-weight: 600; }
.txt-warn{ color: var(--warn); font-weight: 600; }

td.last { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }

.actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink-mute);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }

/* mobile sidebar --------------------------------------------------- */
.mobile-toggle {
  display: none;
  width: 36px; height: 36px; border-radius: 8px;
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--ink); cursor: pointer;
  align-items: center; justify-content: center;
}
.scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 25;
}

@media (max-width: 1100px) {
  .grid-overview { grid-template-columns: 1fr; }
  .map-card { min-height: 380px; }
}
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0;
    width: 260px; height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; }
  .mobile-toggle { display: inline-flex; }
  main.app-main { padding: 16px 16px 40px; }
  .topbar { gap: 10px; }
  .search { order: 3; flex: 1 1 100%; max-width: 100%; }
  table.fleet th:nth-child(4),
  table.fleet td:nth-child(4),
  table.fleet th:nth-child(5),
  table.fleet td:nth-child(5),
  table.fleet th:nth-child(7),
  table.fleet td:nth-child(7) { display: none; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px 14px; }
  .kpi .val { font-size: 26px; }
  .kpi .spark { display: none; }
  .map-card { min-height: 320px; }
  .map-head { top: 10px; left: 10px; right: 10px; }
  .map-head .map-title { display: none; }
  .status-flex { flex-direction: column; align-items: flex-start; gap: 14px; }
  .donut { align-self: center; }
  table.fleet th:nth-child(6),
  table.fleet td:nth-child(6) { display: none; }
  .evt { padding: 10px 14px; }
  .title-row h1 { font-size: 26px; }
}

/* ============ AUTH (login split layout) =========================== */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}
.form-side {
  display: flex; flex-direction: column;
  padding: 28px 36px 36px;
  position: relative;
  min-width: 0;
}
.form-side .top-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: auto;
}
.form-wrap {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 380px; width: 100%;
  margin: 0 auto;
  padding: 32px 0;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}
.eyebrow .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--lime); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

h1.headline {
  font-size: clamp(34px, 4vw, 44px);
  font-weight: 700; letter-spacing: -0.035em;
  line-height: 1.0;
  margin: 0 0 12px;
  text-wrap: balance;
}
h1.headline em {
  font-style: normal;
  background: linear-gradient(100deg, var(--lime) 30%, var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede {
  font-size: 15px; color: var(--ink-mute);
  line-height: 1.5; max-width: 380px;
  margin: 0 0 32px;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-mute);
}
.input-wrap {
  position: relative;
  display: flex; align-items: center;
}
.input-wrap svg.lead {
  position: absolute; left: 12px;
  color: var(--ink-mute); pointer-events: none;
}
.input-wrap input {
  width: 100%;
  padding: 13px 14px 13px 38px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-display); font-size: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 4px var(--lime-soft);
}
.input-wrap input::placeholder { color: var(--ink-dim); }
.toggle-pw {
  position: absolute; right: 8px;
  width: 32px; height: 32px; border-radius: 6px;
  border: 0; background: transparent; cursor: pointer;
  color: var(--ink-mute);
  display: grid; place-items: center;
}
.toggle-pw:hover { color: var(--ink); }

.auth-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: oklch(0.7 0.22 25 / 0.12);
  border: 1px solid oklch(0.7 0.22 25 / 0.4);
  color: var(--danger);
  font-size: 12px;
  font-family: var(--font-mono);
  display: flex; align-items: center; gap: 8px;
}

.submit {
  margin-top: 12px;
  padding: 13px 18px;
  background: var(--lime); color: #0a0c10;
  border: 0; border-radius: 10px; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: -0.005em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: box-shadow 0.2s, transform 0.1s;
}
.submit:hover { box-shadow: 0 0 0 6px var(--lime-soft); }
.submit:active { transform: translateY(1px); }
.submit svg { transition: transform 0.2s; }
.submit:hover svg { transform: translateX(2px); }

.foot-meta {
  margin-top: auto; padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-dim); letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}
.foot-meta a:hover { color: var(--ink); }

.visual-side {
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 600px 400px at 30% 20%, var(--lime-soft), transparent 60%),
    radial-gradient(ellipse 500px 400px at 80% 70%, var(--magenta-soft), transparent 60%),
    var(--bg-elev);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 36px;
}
.visual-side::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 800px 600px at 50% 50%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 800px 600px at 50% 50%, #000 30%, transparent 80%);
}
.visual-side > * { position: relative; z-index: 1; }

.vis-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-mute); letter-spacing: 0.06em;
  align-self: flex-start;
}
.vis-tag::before {
  content: ""; width: 24px; height: 2px; background: var(--lime); border-radius: 2px;
}

.live-card {
  align-self: center;
  width: 100%; max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  transform: rotate(-1.5deg);
  transition: transform 0.4s;
  margin: 24px 0;
}
.live-card:hover { transform: rotate(0); }
.lc-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.lc-head .left { display: flex; flex-direction: column; gap: 2px; }
.lc-head .name { font-weight: 600; font-size: 13px; }
.lc-head .vin  { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); letter-spacing: 0.06em; }
.lc-status { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--lime); letter-spacing: 0.08em; text-transform: uppercase; }

.lc-map {
  position: relative; height: 180px;
  border-radius: 10px; background: var(--bg-elev);
  border: 1px solid var(--line);
  overflow: hidden; margin-bottom: 14px;
}
.lc-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.lc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lc-stat {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px;
}
.lc-stat .v { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.lc-stat .v small { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); margin-left: 2px; font-weight: 500;}
.lc-stat .l { font-family: var(--font-mono); font-size: 9px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px;}

.mini-ticker {
  width: 100%; max-width: 440px; align-self: center;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
  font-family: var(--font-mono); font-size: 11px;
  height: 110px;
  position: relative;
}
.mini-ticker-head {
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; color: var(--ink-mute); letter-spacing: 0.08em; text-transform: uppercase;
}
.mt-feed-wrap { height: 70px; overflow: hidden; }
.mt-feed { animation: mtscroll 14s linear infinite; }
@keyframes mtscroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
.mt-row {
  display: grid; grid-template-columns: 56px 1fr;
  gap: 10px; padding: 6px 14px;
  color: var(--ink-mute);
  border-bottom: 1px dashed var(--line);
}
.mt-row .vin { color: var(--lime); }
.mt-row .msg { color: var(--ink); }

/* ============ VEHICLE DETAIL ====================================== */
.veh-head {
  display: grid; grid-template-columns: 1fr auto;
  gap: 16px; align-items: center;
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.veh-head::after {
  content: ""; position: absolute;
  right: -120px; top: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lime-soft), transparent 70%);
  pointer-events: none;
}
.veh-head > * { position: relative; }
.veh-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.vavatar-lg {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700;
  font-size: 20px; flex-shrink: 0;
}
.veh-id h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.03em; font-weight: 700;
}
.veh-id .vin {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-mute);
  margin-top: 2px;
  letter-spacing: 0.04em;
  word-break: break-all;
}
.veh-id .meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 8px; font-size: 12px;
  color: var(--ink-mute);
}
.veh-id .meta b { color: var(--ink); font-weight: 600; }
.veh-actions {
  display: flex; gap: 8px;
  align-items: center; flex-wrap: wrap;
}

.tabs-row {
  display: flex; gap: 2px; padding: 3px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tabs-row a, .tabs-row button {
  border: 0; background: transparent;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-mute);
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.tabs-row a.active, .tabs-row button.active {
  background: var(--ink); color: var(--bg);
}
.tabs-row .ct {
  font-family: var(--font-mono); font-size: 10px;
  opacity: 0.75;
  padding: 1px 6px;
  background: color-mix(in oklab, currentColor 15%, transparent);
  border-radius: 999px;
}

.row-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.row-2-rev { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-bottom: 16px; }
.row-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) {
  .row-2, .row-2-rev, .row-2-eq { grid-template-columns: 1fr; }
}

.pos-card { padding: 20px; }
.pos-card .pos-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.pos-card .pos-head .live-mark {
  display: flex; align-items: center; gap: 6px;
}
.pos-card .pos-head .live-mark .lbl {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--lime);
  letter-spacing: 0.08em; text-transform: uppercase;
}

.coord-row {
  display: flex; gap: 16px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-mono); font-size: 12px;
  margin-top: 14px;
}
.coord-row .lbl {
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}
.coord-row .val {
  font-weight: 600;
  margin-top: 2px;
  word-break: break-all;
}

.mini-map {
  height: 220px;
  border-radius: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  position: relative; overflow: hidden;
}

.pos-empty {
  height: 220px;
  border-radius: 10px;
  background: var(--bg-elev);
  border: 1px dashed var(--line-strong);
  display: grid; place-items: center;
  text-align: center; padding: 16px;
  color: var(--ink-mute);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.04em;
}

.trip-card {
  padding: 0;
  display: flex; flex-direction: column;
  /* No more `overflow: hidden` on the card itself — the map sub-area owns
     clipping. This avoids parent-stacking issues that broke touch panning. */
}
.trip-map-area {
  position: relative;
  height: 460px;
  overflow: hidden;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  /* Without `touch-action: none` on a Leaflet container, single-finger drag
     is captured by the browser for page scrolling and panning silently
     no-ops on mobile. This is the well-known Leaflet-on-mobile fix. */
  touch-action: none;
}
.trip-head {
  position: absolute; top: 14px; left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; z-index: 5; pointer-events: none;
}
.trip-head > * { pointer-events: auto; }
.trip-title {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; color: var(--ink-mute);
  text-transform: uppercase;
  background: color-mix(in oklab, var(--bg-card) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.trip-canvas {
  position: absolute; inset: 0;
  touch-action: none;
}
.trip-canvas .leaflet-container { background: var(--bg-elev); touch-action: none; }

.trip-bar {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  padding: 12px 14px;
  background: color-mix(in oklab, var(--bg-card) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 5;
  /* The bar overlay sits over the bottom strip of the map. Without this it
     swallows touch events meant for the map underneath it. */
  pointer-events: none;
}
.trip-bar > * { pointer-events: auto; }

.trip-history {
  border-top: 1px solid var(--line);
  max-height: 320px;
  overflow-y: auto;
}
.trip-history-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
  position: sticky; top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.trip-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 10px; align-items: start;
  padding: 10px 14px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}
.trip-row:hover { background: color-mix(in oklab, var(--ink) 4%, transparent); }
.trip-row:last-child { border-bottom: 0; }
.trip-row .swatch {
  width: 8px; align-self: stretch;
  border-radius: 2px;
  margin-top: 3px;
  min-height: 28px;
}
.trip-row .meta { min-width: 0; }
.trip-row .meta .when {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.trip-row .meta .name {
  font-weight: 600; font-size: 13px;
  word-break: break-word;
}
.trip-row .meta .name a { color: var(--ink); }
.trip-row .meta .name a:hover { color: var(--lime); text-decoration: underline; }
.trip-row .meta .stats {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-mute);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.trip-row .kind {
  font-family: var(--font-mono); font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-mute);
  white-space: nowrap;
  align-self: start;
}
.trip-row .kind.pbuff { color: var(--lime); border-color: color-mix(in oklab, var(--lime) 40%, transparent); background: var(--lime-soft); }
.trip-row .kind.gps   { color: var(--magenta); border-color: color-mix(in oklab, var(--magenta) 40%, transparent); background: var(--magenta-soft); }
.trip-stats-mini {
  display: flex; gap: 14px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-mute); text-transform: uppercase;
  letter-spacing: 0.08em; flex-wrap: wrap;
}
.trip-stats-mini b {
  color: var(--ink); font-weight: 600;
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: none; letter-spacing: -0.01em;
  margin-right: 4px;
}
.trip-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  text-align: center;
  padding: 24px;
}

.list-card { display: flex; flex-direction: column; min-height: 0; }
.list-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.list-empty {
  padding: 24px 18px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 13px;
}
.net-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 12px 18px;
  border-bottom: 1px dashed var(--line);
}
.net-row:last-child { border-bottom: 0; }
.net-row .icn {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--lime);
}
.net-row.bt .icn { color: var(--magenta); }
.net-row .info { min-width: 0; }
.net-row .info .name {
  font-weight: 600; font-size: 13px;
  word-break: break-word;
}
.net-row .info .sub {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-mute); margin-top: 2px;
  letter-spacing: 0.04em; word-break: break-all;
}
.net-row .info .secret {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink); margin-top: 4px;
  word-break: break-all;
}
.net-row .info .secret.muted { color: var(--ink-dim); }
.net-row .nbadge {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-mute);
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap;
}

.vfile-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
}
.vfile-pill:hover { color: var(--ink); border-color: var(--line-strong); }
.vfile-pill.active {
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
}
.vfile-pill .ct {
  font-size: 10px; opacity: 0.75;
  padding: 1px 6px;
  background: color-mix(in oklab, currentColor 15%, transparent);
  border-radius: 999px;
}

@media (max-width: 640px) {
  .veh-head { padding: 16px; }
  .vavatar-lg { width: 44px; height: 44px; font-size: 16px; }
  .trip-map-area { height: 360px; }
  .trip-history { max-height: 260px; }
  .net-row { grid-template-columns: 28px 1fr auto; padding: 10px 14px; }
  .list-head { padding: 12px 14px; }
}

/* ============ AUTH brand-hero (decorative right pane) ============= */
.brand-hero {
  flex: 1;
  display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center;
  gap: 18px;
  padding: 24px 0;
}
.brand-mark-xl {
  width: 88px; height: 88px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
  border-radius: 18px;
  font-family: var(--font-mono); font-weight: 700;
  font-size: 44px; letter-spacing: -0.04em;
  position: relative; overflow: hidden;
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 24px 60px -24px rgba(0, 0, 0, 0.55);
}
.brand-mark-xl::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, var(--lime) 0 6px, transparent 6px 12px);
  opacity: 0.18;
  pointer-events: none;
}
.brand-wordmark {
  font-size: clamp(56px, 6vw, 84px);
  font-weight: 700; letter-spacing: -0.05em;
  line-height: 0.95;
  color: var(--ink);
}
.brand-tagline {
  font-size: 17px; line-height: 1.4;
  color: var(--ink-mute);
  max-width: 360px; margin: 0;
}
.speedstack {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px;
}
.speedstack span {
  display: block; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--lime), transparent);
}
.speedstack span:nth-child(1) { width: 220px; opacity: 1; }
.speedstack span:nth-child(2) { width: 180px; opacity: 0.85; }
.speedstack span:nth-child(3) { width: 140px; opacity: 0.65; }
.speedstack span:nth-child(4) { width: 90px;  opacity: 0.45; }
.speedstack span:nth-child(5) { width: 50px;  opacity: 0.28; }

.brand-foot {
  display: flex; flex-direction: column; gap: 12px;
  align-self: stretch;
}
.checker-bar {
  height: 14px;
  background-image:
    linear-gradient(45deg, var(--ink) 25%, transparent 25%),
    linear-gradient(-45deg, var(--ink) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--ink) 75%),
    linear-gradient(-45deg, transparent 75%, var(--ink) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0px;
  border-radius: 3px;
  opacity: 0.55;
}
.brand-foot-meta {
  font-size: 10px; color: var(--ink-dim);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin: 0;
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .visual-side { display: none; }
  .form-side { padding: 20px 24px 24px; min-height: 100vh; }
  .form-wrap { padding: 24px 0; }
}
@media (max-width: 480px) {
  .form-side { padding: 16px 18px 20px; }
  h1.headline { font-size: 28px; }
  .lede { font-size: 14px; margin-bottom: 24px; }
}

/* ============ Commands panel (advanced tab → sub-tabs + per-mode forms) === */
.cmd-subtabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cmd-subtabs::-webkit-scrollbar { height: 4px; }
.cmd-subtabs button {
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 7px 14px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  min-height: 32px;
  transition: color 0.12s, background 0.12s;
}
.cmd-subtabs button:hover { color: var(--ink); }
.cmd-subtabs button.active {
  background: var(--ink);
  color: var(--bg);
}

.cmd-pane {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.cmd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.cmd-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cmd-field-full { grid-column: 1 / -1; }
.cmd-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.cmd-field input[type="file"] { padding: 8px 10px; font-family: var(--font-display); font-size: 13px; }
.cmd-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 10px 0 0;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.cmd-check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--lime);
  cursor: pointer;
}

.cmd-error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--danger, #ff5d5d);
  background: color-mix(in oklab, var(--danger, #ff5d5d) 12%, transparent);
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid color-mix(in oklab, var(--danger, #ff5d5d) 35%, transparent);
}

.cmd-progress {
  margin-top: 10px;
  height: 6px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.cmd-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--lime), color-mix(in oklab, var(--lime) 70%, var(--magenta)));
  transition: width 0.15s ease-out;
  border-radius: 999px;
}

.cmd-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cmd-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.cmd-card-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.cmd-card-path {
  font-size: 11px;
  color: var(--ink-mute);
  word-break: break-all;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.cmd-card .btn { font-size: 13px; }

@media (max-width: 640px) {
  .cmd-grid { grid-template-columns: 1fr; }
  .cmd-cards { grid-template-columns: 1fr; }
  .cmd-pane { padding: 12px; }
}
