/* ============================================================
   NEXT ROUTE — Shared in-vehicle chrome
   Everything both Driving Mode and Parked Mode stand on:
   the bezel, the screen grid, the nav rail, cards, labels, CTAs.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #000;
  font-family: var(--font-display);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---- Fit harness -------------------------------------------
   Screens are authored at true hardware size (1560x660) and
   scaled down to the viewport by js/fit.js. Design in real px. */

.stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.fit { transform-origin: top center; }

/* ---- Bezel + screen ---------------------------------------- */

.bezel {
  width: var(--screen-w);
  background: #000;
  border-radius: var(--radius-bezel);
  padding: 14px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}

.screen {
  width: 100%;
  height: var(--screen-h);
  background: var(--void);
  border-radius: var(--radius-screen);
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr var(--side-w);
  color: var(--ink);
  position: relative;
}

/* ---- Nav rail ----------------------------------------------
   Host-system furniture. Deliberately quiet — Next Route lives
   inside the truck's shell, it doesn't shout over it. */

.rail {
  background: var(--rail);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: var(--gap-xs);
}
.ico {
  width: var(--target-min);
  height: var(--target-min);
  border-radius: var(--radius-card);
  display: grid;
  place-items: center;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  font-weight: var(--weight-bold);
}
.ico span { display: block; font-size: 20px; margin-bottom: 2px; }
.ico.on { background: var(--signal); color: var(--on-signal); }
.rail .spacer { flex: 1; }
.ico.temp { font-variant-numeric: var(--numerals); }

/* ---- Typographic roles ------------------------------------- */

.label {
  font-size: var(--size-label);
  letter-spacing: var(--track-label);
  color: var(--muted);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
}
.label.is-signal { color: var(--signal); }
.label.is-warn { color: var(--warn); }
.label.is-go { color: var(--go); }

.eyebrow {
  font-size: var(--size-label);
  letter-spacing: 0.22em;
  color: var(--signal);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
}

h1 {
  font-size: var(--size-title);
  font-weight: var(--weight-heavy);
  letter-spacing: var(--track-tight);
  line-height: 1;
}

.sub {
  color: var(--muted);
  font-size: var(--size-body);
  letter-spacing: 0.02em;
}

/* Status pill. Green says the thing you hoped for is true — you
   read "trail open" from across the cab without parsing a word. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--size-label);
  letter-spacing: 0.14em;
  color: var(--go);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  margin-left: 14px;
}
.status i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--go);
  display: block;
}
.status.is-alert { color: var(--warn); }
.status.is-alert i { background: var(--warn); }
.status.is-closed { color: var(--signal); }
.status.is-closed i { background: var(--signal); }

/* ---- Cards -------------------------------------------------- */

.card {
  background: var(--surface-1);
  border-radius: var(--radius-card);
  padding: var(--gap-m) 18px;
}
.card .k { /* legacy alias for .label inside cards */
  font-size: var(--size-label);
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: var(--weight-bold);
}

.stat { background: var(--surface-1); border-radius: var(--radius-card); padding: var(--gap-m) 18px; }
.stat .v {
  font-size: var(--size-data-l);
  font-weight: var(--weight-heavy);
  letter-spacing: var(--track-tight);
  margin-top: var(--gap-xs);
  font-variant-numeric: var(--numerals);
}
.stat .v small {
  font-size: 14px;
  font-weight: var(--weight-med);
  color: var(--muted);
  margin-left: 3px;
}

/* ---- Alert --------------------------------------------------
   Amber, not orange: this is information you must act on before
   you leave the truck, but it is not a failure and it does not
   stop you. Signal stays the accent; Warn does the cautioning. */

.alert {
  background: var(--warn-ghost);
  border: 1px solid var(--warn-edge);
  border-radius: var(--radius-card);
  padding: 14px var(--gap-m);
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.alert .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warn);
  margin-top: 5px;
  flex: none;
}
.alert b {
  display: block;
  font-size: var(--size-label);
  letter-spacing: 0.16em;
  color: var(--warn);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.alert p { font-size: var(--size-sub); line-height: 1.5; color: var(--ink); }

/* ---- Buttons ------------------------------------------------
   60px floor, 76px for primary. Ink on Signal is 2.95:1 and is
   never used — primary CTAs are Void on Signal at 6.05:1. */

.btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  min-height: var(--target-min);
  padding: 0 18px;
  font-size: var(--size-body);
  font-weight: var(--weight-bold);
  letter-spacing: 0.01em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: var(--gap-s);
}
.btn.primary {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--on-signal);
  min-height: var(--target-primary);
}
.btn em { font-style: normal; font-size: 20px; }

/* ---- Side rail ---------------------------------------------- */

.side {
  background: var(--rail);
  border-left: 1px solid var(--line);
  padding: var(--gap-l) 20px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
}
.side .spacer { flex: 1; }

.foot {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: center;
  opacity: 0.7;
  text-transform: uppercase;
}

/* ---- Data primitives ---------------------------------------- */

.num { font-variant-numeric: var(--numerals); }

.track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.track .fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--muted);
  border-radius: 4px;
}
.track .fill.is-urgent { background: var(--signal); }
