/* PackTrack — guest-flow operations console.
   Enterprise-operations look (Trimble / Garmin / Cisco / Hexagon): clean, fast,
   restrained. Charcoal masthead + Great Wolf blue accent on an Apple-flavored
   token base. Light + dark schemes render together.

   RULES:
   - Never hardcode a color / spacing / radius outside this :root block — add or
     adjust a token and reference it everywhere.
   - Status TEXT (pills, badges) uses the WCAG-AA --label-* tokens; the vivid
     --color-* hues are for shapes (dots, accents, borders) only. A test in
     test/deployConfig.test.js guards the pill/badge text tokens — do not regress. */

:root {
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-hero: 44px;
  --text-large-title: 28px;
  --text-title1: 22px;
  --text-title2: 17px;
  --text-title3: 15px;
  --text-body: 13px;
  --text-caption1: 11px;
  --text-caption2: 10px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Brand — Great Wolf blue + charcoal. The GWL-blue accent is the one saturated
     hue in the system; charcoal is the masthead / chrome surface. */
  --color-brand: #2a73d9;
  --color-brand-strong: #1f5fbf;
  --color-charcoal: #1f2933;
  --color-charcoal-raise: #26333f;

  --color-accent: var(--color-brand);
  --color-green: #34c759;
  --color-amber: #ff9f0a;
  --color-red: #ff3b30;

  --bg-window: #f4f6f8;
  --bg-surface: #ffffff;
  --bg-secondary: rgba(118, 118, 128, 0.1);
  --bg-tertiary: rgba(118, 118, 128, 0.06);
  --bg-hover: rgba(31, 41, 51, 0.04);

  --tint-green: rgba(52, 199, 89, 0.16);
  --tint-amber: rgba(255, 159, 10, 0.16);
  --tint-red: rgba(255, 59, 48, 0.16);
  --tint-brand: rgba(42, 115, 217, 0.1);

  /* Darkened status TEXT tokens for small pill/badge labels. The vivid --color-*
     hues are too light for 10–11px text on a pale same-hue tint — amber and green
     fail WCAG AA 4.5:1. These pass AA and read cleanly on a wall display.
     Use --label-* for status TEXT, --color-* for shapes. */
  --label-green: #1a7f37;
  --label-amber: #8a5a00;
  --label-red: #c9271d;

  --text-primary: rgba(23, 30, 38, 0.92);
  --text-secondary: rgba(23, 30, 38, 0.6);
  --text-tertiary: rgba(23, 30, 38, 0.42);
  --separator: rgba(23, 30, 38, 0.12);
  --separator-strong: rgba(23, 30, 38, 0.18);

  /* Text tokens for content ON the charcoal masthead (fixed dark surface in both
     schemes) — kept theme-independent so the wordmark chrome reads identically. */
  --on-charcoal: rgba(255, 255, 255, 0.94);
  --on-charcoal-secondary: rgba(255, 255, 255, 0.62);
  --on-charcoal-tertiary: rgba(255, 255, 255, 0.44);
  --hairline-on-charcoal: rgba(255, 255, 255, 0.12);

  /* Control standard — segmented pickers, filter bars, any future page's
     controls. Defined once here so every page reads at the same size rather
     than each surface inventing its own. */
  --control-text: var(--text-body);      /* 13px — button labels inside a control */
  --control-group-label: var(--text-body); /* 13px — the uppercase group label */
  --control-pad-y: 6px;
  --control-pad-x: var(--space-4);
  --control-bar-pad-y: var(--space-4);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 980px;

  --shadow-card: 0 1px 2px rgba(23, 30, 38, 0.06), 0 1px 3px rgba(23, 30, 38, 0.05);
  --shadow-raise: 0 4px 14px rgba(23, 30, 38, 0.1);
  --shadow-drawer: -12px 0 32px rgba(23, 30, 38, 0.16);

  --z-drawer: 100;
  --z-modal: 120;

  --duration-fast: 150ms;
  --ease-standard: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-brand: #4b90ee;
    --color-brand-strong: #6aa4f2;
    --color-charcoal: #161c22;
    --color-charcoal-raise: #1f272f;

    --color-green: #30d158;
    --color-amber: #ff9f0b;
    --color-red: #ff453a;

    --bg-window: #14181d;
    --bg-surface: #1e252c;
    --bg-secondary: rgba(255, 255, 255, 0.08);
    --bg-tertiary: rgba(255, 255, 255, 0.05);
    --bg-hover: rgba(255, 255, 255, 0.05);

    --tint-green: rgba(48, 209, 88, 0.2);
    --tint-amber: rgba(255, 159, 11, 0.2);
    --tint-red: rgba(255, 69, 58, 0.2);
    --tint-brand: rgba(75, 144, 238, 0.16);

    /* Dark mode: the darkened light-mode label tokens would be near-invisible on a
       dark tint. Restore the vivid hues — they read as bright labels on dark. */
    --label-green: #30d158;
    --label-amber: #ff9f0b;
    --label-red: #ff453a;

    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.58);
    --text-tertiary: rgba(255, 255, 255, 0.4);
    --separator: rgba(255, 255, 255, 0.12);
    --separator-strong: rgba(255, 255, 255, 0.2);

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-raise: 0 4px 14px rgba(0, 0, 0, 0.5);
    --shadow-drawer: -12px 0 32px rgba(0, 0, 0, 0.6);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-system);
  font-size: var(--text-body);
  line-height: 1.4;
  color: var(--text-primary);
  background: var(--bg-window);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6);
}

/* ── Masthead ─────────────────────────────────────────────────
   A self-contained charcoal panel — the operations-console app bar. Carries the
   PackTrack wordmark, the fleet totals strip, and the status legend. Its own light
   text tokens (--on-charcoal-*) keep the wordmark chrome legible in both schemes. */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  background: var(--color-charcoal);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.masthead-titles {
  margin-right: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.masthead h1 {
  margin: 0;
  font-size: var(--text-large-title);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--on-charcoal);
}

/* PackTrack wordmark logo — the SVG lockup replaces the text H1. */
.masthead h1.wordmark {
  line-height: 0;
}
.masthead h1.wordmark img {
  display: block;
  height: 34px;
  width: auto;
}

.subtitle {
  margin: 0;
  color: var(--on-charcoal-secondary);
  font-size: var(--text-caption1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.masthead-meta {
  text-align: right;
}

.totals {
  display: flex;
  gap: var(--space-5);
  justify-content: flex-end;
  flex-wrap: wrap;
}

.totals .total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 44px;
}

.totals .total strong {
  font-size: var(--text-title1);
  line-height: 1;
  font-weight: 650;
  color: var(--on-charcoal);
  font-variant-numeric: tabular-nums;
}

.totals .total span {
  margin-top: 2px;
  font-size: var(--text-caption2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--on-charcoal-tertiary);
}

.updated {
  margin: var(--space-2) 0 0;
  font-size: var(--text-caption1);
  color: var(--on-charcoal-tertiary);
  font-variant-numeric: tabular-nums;
}

/* ── Legend ───────────────────────────────────────────────────
   Sits on the charcoal masthead as a full-width row beneath the titles + totals. */

.legend {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  list-style: none;
  margin: 0;
  padding: var(--space-3) 0 0;
  border-top: 1px solid var(--hairline-on-charcoal);
  flex-basis: 100%;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-caption1);
  color: var(--on-charcoal-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
}

.swatch.online {
  background: var(--color-green);
}

.swatch.stale {
  background: var(--color-amber);
}

.swatch.offline {
  background: var(--color-red);
}

/* ── Status pills (node cards, §05) ───────────────────────────
   Status TEXT uses the AA --label-* tokens (guarded by deployConfig.test.js). */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-caption1);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill.online {
  color: var(--label-green);
  background: var(--tint-green);
}

.pill.stale {
  color: var(--label-amber);
  background: var(--tint-amber);
}

.pill.offline {
  color: var(--label-red);
  background: var(--tint-red);
}

/* planned = a provisioned-for-sale node that has never reported. Calm brand-blue
   (never the offline red) — it's a roadmap card, not an alarm. */
.pill.planned {
  color: var(--color-brand);
  background: var(--tint-brand);
}

.card.planned {
  opacity: 0.82;
}

.card.planned .card-planned-note {
  margin-top: var(--space-2);
  font-size: var(--text-caption1);
  color: var(--text-tertiary);
}

/* ── Error banner ─────────────────────────────────────────────── */

.error-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-red);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  background: var(--tint-red);
  color: var(--text-primary);
  font-weight: 600;
}

/* A leading dot reinforces "data-source problem" at a glance. */
.error-banner::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-red);
}

.error-banner.auth {
  border-color: var(--color-amber);
  background: var(--tint-amber);
}

.error-banner.auth::before {
  background: var(--color-amber);
}

.error-banner-text {
  font-variant-numeric: tabular-nums;
}

.error-banner[hidden] {
  display: none;
}

/* ── Throughput mount (later task renders the guest-throughput mini-dashboard
      into #throughput) ─────────────────────────────────────────
   Empty shell now: a styled panel with a placeholder via :empty. When later code
   fills it with children, :empty stops applying and the placeholder disappears. */

.throughput {
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  min-height: 104px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.throughput:empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  box-shadow: none;
}

.throughput:empty::before {
  content: "Guest throughput — awaiting data";
  color: var(--text-tertiary);
  font-size: var(--text-caption1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Guest-throughput mini-dashboard (T8) — rendered into #throughput ──────────
   Hero "guests today" + week/month totals + weekly/monthly averages, an inline-SVG
   trendline sparkline with an up/down/flat trend badge, and a look-back day
   scrubber. Enterprise styling, GWL-blue accents, tabular numerals. Tokens only. */

.tp-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.tp-title {
  margin: 0;
  font-size: var(--text-title3);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.tp-stale {
  padding: 1px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--tint-amber);
  color: var(--label-amber);
  font-size: var(--text-caption2);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tp-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4) var(--space-8);
  margin-bottom: var(--space-4);
}

.tp-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.tp-hero-value {
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-brand);
  font-variant-numeric: tabular-nums;
}

.tp-hero-label {
  font-size: var(--text-caption1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.tp-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-1);
  font-size: var(--text-caption1);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
}

.tp-trend.up {
  color: var(--label-green);
}

.tp-trend.down {
  color: var(--label-red);
}

.tp-arrow {
  font-size: var(--text-caption2);
}

.tp-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.tp-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 72px;
}

.tp-tile-value {
  font-size: var(--text-title1);
  font-weight: 650;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.tp-tile-label {
  font-size: var(--text-caption2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.tp-chart {
  margin-bottom: var(--space-3);
}

.tp-spark {
  display: block;
  width: 100%;
  height: 72px;
  overflow: visible;
}

.tp-spark-area {
  fill: var(--tint-brand);
  stroke: none;
}

.tp-spark-line {
  fill: none;
  stroke: var(--color-brand);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.tp-spark-marker {
  stroke: var(--color-brand-strong);
  stroke-width: 2;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.tp-spark-empty {
  margin: 0;
  padding: var(--space-4) 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--text-caption1);
}

.tp-lookback {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.tp-lookback-label {
  font-size: var(--text-caption2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.tp-range {
  width: 100%;
  accent-color: var(--color-brand);
}

.tp-lookback-readout {
  grid-column: 1 / -1;
}

.tp-lookback-day {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--separator);
}

.tp-lookback-when {
  font-size: var(--text-caption1);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.tp-lookback-count {
  font-size: var(--text-body);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.tp-lookback-count strong {
  font-size: var(--text-title3);
  font-weight: 650;
}

.tp-lookback-empty {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--text-caption1);
}

.tp-unavailable {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 64px;
}

.tp-unavailable-title {
  margin: 0;
  font-size: var(--text-title3);
  font-weight: 650;
  color: var(--label-amber);
}

.tp-unavailable-sub {
  margin: 0;
  font-size: var(--text-caption1);
  color: var(--text-secondary);
}

/* ── Fleet grid + site groups ─────────────────────────────────── */

.fleet {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.site-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.site-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--separator);
}

.site-group-header h2 {
  margin: 0;
  padding-left: var(--space-3);
  border-left: 3px solid var(--color-brand);
  font-size: var(--text-title2);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.site-group-header .site-summary {
  font-size: var(--text-caption1);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* ── Attraction subgroups (Lodge ▸ Attraction, second level) ───
   A quiet subheader beneath the lodge <h2>: smaller, indented, GWL-blue so the
   Lodge ▸ Attraction hierarchy reads at a glance without competing with the lodge. */

.attractions {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.attraction-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.attraction-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  padding-left: var(--space-3);
}

.attraction-header h3 {
  margin: 0;
  font-size: var(--text-title3); /* smaller than the lodge <h2> (title2) */
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--color-brand);
}

.attraction-header .attraction-summary {
  font-size: var(--text-caption2);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

/* ── Node card ────────────────────────────────────────────────── */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  padding-left: var(--space-5);
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

/* At-a-glance status accent along the card's leading edge. Keyed off the status
   pill via :has() so the markup (app.js renderNodeCard) is unchanged. */
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--separator-strong);
}
.card:has(.pill.online)::before {
  background: var(--color-green);
}
.card:has(.pill.stale)::before {
  background: var(--color-amber);
}
.card:has(.pill.offline)::before {
  background: var(--color-red);
}
.card:has(.pill.planned)::before {
  background: var(--color-brand);
}

.card:hover {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-raise);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.card-id {
  font-weight: 650;
  font-size: var(--text-title3);
  letter-spacing: -0.01em;
}

.card-label {
  color: var(--text-secondary);
  font-size: var(--text-caption1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-counts {
  display: flex;
  gap: var(--space-5);
  margin: var(--space-2) 0 var(--space-1);
}

.card-counts .count strong {
  display: block;
  font-size: var(--text-large-title);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.card-counts .count span {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-caption2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.card-counts .count.zero strong {
  color: var(--text-tertiary);
}

.card-lastseen {
  font-size: var(--text-caption1);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.card-health {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--separator);
  font-size: var(--text-caption1);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.card-meta {
  font-size: var(--text-caption1);
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

/* Reader / ToF health badges. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 1px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-caption2);
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge.ok {
  color: var(--label-green);
  background: var(--tint-green);
}

.badge.bad {
  color: var(--label-red);
  background: var(--tint-red);
}

/* ── Optional chip row (device kind + boot forensics + rail + lost crossings) ──
   sensor_profile / reset_reason / boot_count / vbus_mv / buffer_dropped each arrive
   on NEWER heartbeats only and are each independently optional; the whole .card-boot
   row is omitted when a node carries NONE of them. Reuses the badge/pill token
   vocabulary so it reads as part of the same system (no hardcoded colours). */
.card-boot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-caption1);
}

/* A NORMAL last-reset cause (poweron/sw/deepsleep/unknown) — a plain muted label,
   not an alarm. The reason token is lowercase machine text → keep it as-is. */
.reset-reason {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* The FAULT badge — an abnormal last reset (panic / watchdog / brownout). Red, like
   a failed health badge; text-transform:none keeps the `int_wdt`-style token legible. */
.badge.fault {
  color: var(--label-red);
  background: var(--tint-red);
  text-transform: none;
  letter-spacing: 0;
}

/* The crash-loop hint — a running unit that has soft-rebooted more than once. Amber
   attention, mirroring the degraded-health warning (a hint, not a fleet alarm). */
.crash-loop {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 1px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-caption2);
  font-weight: 650;
  color: var(--label-amber);
  background: var(--tint-amber);
}

/* The VBUS rail label — the USB 5V rail in volts. A healthy rail reads ~5.0 V; a plain
   muted label like the normal reset-reason (no alarm). */
.vbus-rail {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Low-rail warning — the USB rail sagging into the brownout-risk zone (< 4.7 V under
   load). Amber attention, mirroring the crash-loop hint / degraded-health warning
   (a hint, not a fleet alarm). */
.vbus-low {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 1px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-caption2);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--label-amber);
  background: var(--tint-amber);
}

/* Dropped-crossing warning — ride crossings PERMANENTLY LOST when a long outage
   overran the on-device event log. Amber attention, mirroring the low-rail warning /
   crash-loop hint. There is no healthy variant on purpose: 0 dropped renders nothing
   at all, so this pill only ever appears when something was actually lost. */
.buffer-dropped {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 1px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-caption2);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--label-amber);
  background: var(--tint-amber);
}

/* ── OTA status row (phase + outcome + attempted version + detail) ─────────────
   Every part is optional and the whole row is omitted when a node reports no update
   channel at all. Deliberately MUTED end to end, with no warning variant: an OTA
   outcome is a maintenance fact about a unit still running fine on its old image,
   never a fleet alarm competing with a brownout or a lost crossing. Same token
   vocabulary as .card-health / .card-boot (no hardcoded colours). */
.card-ota {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-caption1);
  color: var(--text-secondary);
}

/* The outcome token and the attempted version are lowercase machine strings; the
   version aligns as a numeral. The free-text reason is DIMMER — it is diagnostic
   detail, subordinate to the state/result it explains. */
.ota-version {
  font-variant-numeric: tabular-nums;
}

.ota-reason {
  color: var(--text-tertiary);
}

/* The device-KIND label — what this unit IS (rfid_tof / tof_gate / camera_ai / …).
   An IDENTITY fact, not a health reading, so it clones the muted `.vbus-rail` /
   `.reset-reason` treatment and has NO amber warning variant at all — no value of a
   profile is ever an alarm. `font-variant-numeric` is deliberately omitted: unlike its
   muted siblings the value is a lowercase machine token with no digits to align. */
.sensor-profile {
  color: var(--text-secondary);
}

/* Degraded-health affordance — a subtle warning, NOT a fleet alarm (§05). */
.card.missing-health {
  border-color: var(--color-amber);
}

.health-warning {
  margin: 0;
  font-size: var(--text-caption1);
  font-weight: 600;
  color: var(--label-amber);
}

/* ── Empty state ──────────────────────────────────────────────── */

.empty-state {
  padding: var(--space-8);
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed var(--separator);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.empty-state .empty-title {
  margin: 0;
  font-size: var(--text-title2);
  font-weight: 650;
  color: var(--text-primary);
}

.empty-state .empty-sub {
  margin: var(--space-2) 0 0;
  font-size: var(--text-caption1);
}

/* ── Node detail drawer (later task renders node detail into #node-detail) ──────
   Hidden by default. When shown it slides in as a right-edge drawer over the
   console. Empty shell now: a placeholder via :empty. */

.node-detail {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 92vw;
  height: 100%;
  padding: var(--space-6);
  overflow-y: auto;
  background: var(--bg-surface);
  border-left: 1px solid var(--separator);
  box-shadow: var(--shadow-drawer);
  z-index: var(--z-drawer);
}

.node-detail[hidden] {
  display: none;
}

.node-detail:empty::before {
  content: "Select a node to see detail";
  color: var(--text-tertiary);
  font-size: var(--text-caption1);
}

/* Drawer content: header (id + status pill + close), label + Lodge ▸ Attraction
   path, a labeled key/value list, and the "Latest command" slot. Numbers tabular. */

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.detail-heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.detail-id {
  font-size: var(--text-title1);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.detail-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--separator);
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: var(--text-title2);
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.detail-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.detail-label {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-caption1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-path {
  margin: var(--space-1) 0 var(--space-4);
  color: var(--color-brand);
  font-size: var(--text-body);
  font-weight: 600;
}

.detail-list {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--separator);
}

.detail-row dt {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: var(--text-caption1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-row dd {
  margin: 0;
  text-align: right;
  font-size: var(--text-body);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.detail-command-section {
  margin-top: var(--space-5);
}

.detail-subhead {
  margin: 0 0 var(--space-2);
  font-size: var(--text-caption1);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.command-empty {
  margin: 0;
  padding: var(--space-3) 0;
  color: var(--text-tertiary);
  font-size: var(--text-caption1);
}

/* ── Force-reboot operator action (the drawer's one write control) ───────── */

.detail-reboot-section {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--separator);
}

/* Cautious SECONDARY action — deliberate but non-destructive (an amber hairline +
   tint, never a destructive-red filled primary). */
.reboot-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-amber);
  border-radius: var(--radius-md);
  background: var(--tint-amber);
  color: var(--label-amber);
  font-size: var(--text-body);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}

.reboot-button:hover {
  background: var(--bg-hover);
}

.reboot-confirm {
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.reboot-confirm-msg {
  margin: 0 0 var(--space-3);
  font-size: var(--text-caption1);
  color: var(--text-primary);
}

.reboot-confirm-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

.reboot-cancel,
.reboot-go {
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-caption1);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}

.reboot-cancel {
  border: 1px solid var(--separator-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.reboot-cancel:hover {
  background: var(--bg-hover);
}

.reboot-go {
  border: 1px solid var(--color-amber);
  background: var(--tint-amber);
  color: var(--label-amber);
}

.reboot-go:hover {
  background: var(--bg-hover);
}

.reboot-status {
  margin: var(--space-2) 0 0;
  min-height: var(--space-4);
  font-size: var(--text-caption1);
  color: var(--text-secondary);
}

/* ── Admin control panel (§T10 — non-destructive command tier, admin-gated) ─── */

.detail-admin-section {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--separator);
}

.admin-hint {
  margin: 0 0 var(--space-3);
  font-size: var(--text-caption1);
  color: var(--text-tertiary);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* Neutral, calm SECONDARY control — a brand hairline + tint, never a destructive
   red (the panel offers only non-destructive commands). */
.admin-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-brand);
  border-radius: var(--radius-md);
  background: var(--tint-brand);
  color: var(--color-brand-strong);
  font-size: var(--text-body);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}

.admin-button:hover {
  background: var(--bg-hover);
}

.admin-set {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.admin-set-label {
  font-family: var(--font-mono);
  font-size: var(--text-caption1);
  color: var(--text-secondary);
}

.admin-set-key {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-caption1);
}

.admin-set-value {
  flex: 1 1 var(--space-8);
  min-width: var(--space-8);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-caption1);
}

.admin-status {
  margin: var(--space-2) 0 0;
  min-height: var(--space-4);
  font-size: var(--text-caption1);
  color: var(--text-secondary);
}

/* ── Guest-throughput calendar overlay (T11) ─────────────────────────────────
   Opens from the throughput hero (the hero doubles as the affordance). A
   centered modal card over the console — same surface/border/close idiom as the
   node-detail drawer. Display-only: no write controls live here. */

.tp-hero[role="button"] {
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-standard);
}

.tp-hero[role="button"]:hover {
  background: var(--bg-hover);
}

.tp-hero[role="button"]:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.throughput-calendar {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raise);
  z-index: var(--z-modal);
}

.throughput-calendar[hidden] {
  display: none;
}

.cal-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cal-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: var(--text-title2);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* Month prev/next — the .detail-close pill idiom, kept distinct for disabling. */
.cal-nav {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--separator);
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: var(--text-title2);
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.cal-nav:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.cal-nav:disabled {
  opacity: 0.4;
  cursor: default;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-1);
  margin-top: var(--space-4);
}

.cal-weekday {
  padding: var(--space-1) 0;
  text-align: center;
  font-size: var(--text-caption2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.cal-cell {
  min-height: 52px;
}

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-1);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.cal-day:hover {
  background: var(--bg-hover);
}

.cal-day:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 1px;
}

/* Subtle today highlight — brand tint + brand border (shape, not status text). */
.cal-day.today {
  border-color: var(--color-brand);
  background: var(--tint-brand);
}

.cal-day.selected {
  border-color: var(--color-brand-strong);
  background: var(--tint-brand);
}

.cal-daynum {
  font-size: var(--text-caption2);
  color: var(--text-secondary);
}

.cal-count {
  font-size: var(--text-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* A no-data day (outside the API's coverage window) reads muted — its em-dash
   must never be mistaken for a real zero. */
.cal-day.no-data .cal-count {
  color: var(--text-tertiary);
  font-weight: 400;
}

.cal-detail-panel {
  margin-top: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

.cal-hint,
.cal-detail-empty {
  margin: 0;
  font-size: var(--text-caption1);
  color: var(--text-tertiary);
}

.cal-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.cal-detail-when {
  font-size: var(--text-caption1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.cal-detail-count {
  font-size: var(--text-body);
  color: var(--text-primary);
}

.cal-detail-count strong {
  font-size: var(--text-title1);
  font-weight: 700;
  color: var(--color-brand);
  font-variant-numeric: tabular-nums;
}

.cal-detail-note {
  margin: var(--space-1) 0 0;
  font-size: var(--text-caption1);
  color: var(--text-tertiary);
}

/* ── Narrow-width reflow ──────────────────────────────────────── */

@media (max-width: 640px) {
  .page {
    padding: var(--space-4);
  }

  .masthead {
    flex-direction: column;
    align-items: flex-start;
  }

  .masthead-meta,
  .totals {
    text-align: left;
    justify-content: flex-start;
  }

  .totals .total {
    align-items: flex-start;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .node-detail {
    width: 100%;
    max-width: 100%;
  }

  .cal-cell {
    min-height: 44px;
  }
}

/* ── Virtual Frontier ───────────────────────────────────────────────────────
   Great Wolf VR play analytics (public/virtual-frontier.html). Shares every
   token with the fleet view and adds no new colours. Status TEXT uses
   --label-* (WCAG AA); the vivid --color-* hues are for shapes only. */

/* order:99 pins the nav to the far right of the masthead on BOTH pages.
   .masthead-titles carries margin-right:auto, so without this the nav lands
   far-right on the Virtual Frontier page (nothing follows it) but mid-right on
   the Fleet page (masthead-meta follows it) — the nav appeared to jump when
   switching pages. */
.masthead-nav {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  /* order 1 keeps the nav on the FIRST masthead row, after .masthead-meta
     (order 0) but before .legend, which carries flex-basis:100% and therefore
     always claims a row of its own. With a higher order the nav fell below the
     legend onto a third row. .masthead-titles has margin-right:auto, so the nav
     lands flush right on both attraction pages regardless of what sits between. */
  order: 1;
  margin-left: var(--space-4);
}

/* Always the last masthead row. */
.legend { order: 2; }
.nav-link {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-title3);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--on-charcoal-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.nav-link:hover { color: var(--on-charcoal); }
.nav-link.is-current {
  background: var(--color-brand);
  color: #fff;
  font-weight: 700;
  border-color: var(--color-brand-strong);
}

.vf-controls {
  display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap;
  background: var(--bg-surface); border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: var(--control-bar-pad-y) var(--space-5);
  margin-bottom: var(--space-5);
}
.vf-ctrl { display: flex; align-items: center; gap: var(--space-3); }
.vf-ctrl-label {
  font-size: var(--control-group-label); color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.vf-seg { display: flex; background: var(--bg-tertiary); border-radius: var(--radius-md); padding: 3px; }
.vf-seg button {
  padding: var(--control-pad-y) var(--control-pad-x); border: 0; background: transparent;
  cursor: pointer; border-radius: var(--radius-sm); font: inherit;
  font-size: var(--control-text); font-weight: 500;
  color: var(--text-secondary); white-space: nowrap;
}
.vf-seg button:hover { color: var(--text-primary); }
.vf-seg button[aria-pressed="true"] {
  background: var(--bg-surface); color: var(--text-primary); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}
.vf-asof { margin-left: auto; font-size: var(--control-text); color: var(--text-tertiary); }

.vf-section { margin-top: var(--space-8); }
.vf-section h2 { font-size: var(--text-title3); font-weight: 600; margin: 0 0 var(--space-3); }
.vf-sub { font-size: var(--text-caption1); color: var(--text-tertiary); font-weight: 400; }

.vf-lodges {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-4); margin-top: var(--space-6);
}
.vf-card {
  background: var(--bg-surface); border: 1px solid var(--separator);
  border-radius: var(--radius-lg); padding: var(--space-4);
}
.vf-card.is-flagged { border-color: var(--color-red); }
.vf-card-name { font-size: var(--text-title2); font-weight: 600; }
.vf-card-place { font-size: var(--text-caption1); color: var(--text-tertiary); }
.vf-card-total {
  display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap;
  margin: var(--space-1) 0 var(--space-3);
}
.vf-card-num { font-size: var(--text-large-title); font-weight: 600; font-variant-numeric: tabular-nums; }
.vf-card-unit, .vf-card-prev { font-size: var(--text-caption1); color: var(--text-tertiary); }

.vf-titles {
  display: grid; gap: var(--space-1);
  border-top: 1px solid var(--separator); padding-top: var(--space-3);
}
.vf-title-row {
  display: grid; grid-template-columns: 20px 1fr 62px 44px;
  gap: var(--space-2); align-items: center;
}
.vf-title-rank { font-size: var(--text-caption1); color: var(--text-tertiary); }
.vf-title-name { font-size: var(--text-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf-title-count { text-align: right; font-size: var(--text-body); font-variant-numeric: tabular-nums; }
.vf-bar-track { background: var(--bg-tertiary); border-radius: 100px; }
.vf-bar { height: 5px; border-radius: 100px; background: var(--color-brand); min-width: 2px; }

/* A dark title is ABSENT from the feed, not zero. No bar, no number: it reads
   "dark", because absence must never look like a measurement. */
.vf-title-row.is-dark .vf-title-name { color: var(--text-tertiary); }
.vf-title-dark { text-align: right; font-size: var(--text-caption1); color: var(--label-red); font-weight: 600; }

.vf-pill {
  display: inline-block; padding: 1px var(--space-2); border-radius: 100px;
  font-size: var(--text-caption2); font-weight: 600;
}
.vf-pill.is-up { background: var(--tint-green); color: var(--label-green); }
.vf-pill.is-down { background: var(--tint-red); color: var(--label-red); }
.vf-pill.is-flat, .vf-pill.is-none { background: var(--bg-secondary); color: var(--text-secondary); }

.vf-table-wrap { overflow-x: auto; }
.vf-table { border-collapse: collapse; width: 100%; min-width: 600px; }
.vf-table th, .vf-table td { text-align: left; padding: var(--space-3) var(--space-4); font-size: var(--text-body); }
.vf-table th {
  font-size: var(--text-caption1); color: var(--text-secondary); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--separator-strong);
}
.vf-table td { border-bottom: 1px solid var(--separator); font-variant-numeric: tabular-nums; }
.vf-table tr:last-child td { border-bottom: 0; }
.vf-num { text-align: right; }

.vf-alert {
  display: flex; gap: var(--space-3); padding: var(--space-4);
  border-bottom: 1px solid var(--separator); align-items: flex-start;
}
.vf-alert:last-child { border-bottom: 0; }
.vf-alert-dot { width: 8px; height: 8px; border-radius: 100px; margin-top: 6px; flex: 0 0 8px; background: var(--color-red); }
.vf-alert-head { font-weight: 600; margin-bottom: 2px; }
.vf-alert-detail { font-size: var(--text-caption1); color: var(--text-secondary); }

.vf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }
.vf-tile {
  background: var(--bg-surface); border: 1px solid var(--separator);
  border-radius: var(--radius-lg); padding: var(--space-4);
}
.vf-tile-k { font-size: var(--text-caption1); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.vf-tile-v { font-size: var(--text-title1); font-weight: 600; margin: var(--space-1) 0; font-variant-numeric: tabular-nums; line-height: 1.2; }
.vf-tile-m { font-size: var(--text-caption1); color: var(--text-tertiary); }

.vf-footnotes {
  margin-top: var(--space-8); padding-top: var(--space-4);
  border-top: 1px solid var(--separator);
  font-size: var(--text-caption1); color: var(--text-tertiary);
}
.vf-footnotes p { margin: 0 0 var(--space-2); }

.vf-card, .vf-table, .vf-alert, .vf-tile { border-color: var(--separator); }

/* ── Howlers Peak overall totals (moved out of the masthead) ─────────────────
   app.js still emits <div class="total"><strong>n</strong><span>label</span></div>
   into #fleet-totals; only the position and presentation changed. Scoped to
   #fleet-summary so the masthead .totals rules (which use the on-charcoal text
   tokens) are untouched for any other consumer.

   column-reverse puts the label above the number, matching the Virtual Frontier
   tiles, without app.js having to reorder its markup. */
#fleet-summary .totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  justify-content: stretch;
}

#fleet-summary .total {
  flex-direction: column-reverse;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
}

#fleet-summary .total strong {
  font-size: var(--text-title1);
  font-weight: 600;
  color: var(--text-primary);
}

#fleet-summary .total span {
  margin-top: 0;
  font-size: var(--text-caption1);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

#fleet-summary .updated {
  margin-top: var(--space-3);
  font-size: var(--text-caption1);
  color: var(--text-tertiary);
}

/* Updated stamp under the Virtual Frontier totals, matching #fleet-summary. */
#vf-totals .updated {
  margin-top: var(--space-3);
  font-size: var(--text-caption1);
  color: var(--text-tertiary);
}

/* Data-freshness line. States plainly that figures are overnight-reported and
   which complete day they cover, so nothing reads as up-to-the-minute. */
.vf-freshness-line {
  margin: calc(var(--space-4) * -1) 0 var(--space-5);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: var(--control-text);
  color: var(--text-secondary);
}
.vf-freshness-line strong { color: var(--text-primary); font-weight: 600; }

/* Loading skeleton. Holds the page's shape while a wide window resolves — the
   vendor takes seconds for a 30-day range, and an empty page reads as broken.
   Motion is disabled for anyone who has asked for reduced motion. */
.vf-skeleton { pointer-events: none; }
.vf-sk-line {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  animation: vf-pulse 1.4s ease-in-out infinite;
}
.vf-sk-title { height: 18px; width: 45%; margin-bottom: var(--space-3); }
.vf-sk-num { height: 30px; width: 30%; margin-bottom: var(--space-4); }
.vf-sk-row { height: 12px; width: 100%; margin-bottom: var(--space-2); }
.vf-sk-row:nth-child(2) { width: 92%; }
.vf-sk-row:nth-child(3) { width: 84%; }
.vf-sk-row:nth-child(4) { width: 76%; }
.vf-sk-row:nth-child(5) { width: 68%; }

@keyframes vf-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .vf-sk-line { animation: none; }
}

/* PackTrack mark loading indicator. Replaces a bare "Loading…" line while a cold
   serverless instance resolves its several vendor calls (a second or two): the
   animated brand mark reads as "working" where a line of text reads as "stuck".
   The text stays beneath/beside the mark as the accessible label. Motion is
   disabled for anyone who has asked for reduced motion — the static mark + label
   remain. Block form (centred) fills an empty main area; the --inline modifier is
   a compact row for a controls-bar status label. */
.pt-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-8);
}
/* No design token exists for a logo mark's size — a raw px like the skeleton line
   heights above. 4:3 mark, so height follows width. */
.pt-loader-mark {
  width: 48px;
  height: auto;
  animation: pt-pulse 1.4s ease-in-out infinite;
}
.pt-loader-text {
  font-size: var(--control-text);
  color: var(--text-tertiary);
}

/* Compact inline variant — small mark beside the text, no block padding. Used for
   the Virtual Frontier controls-bar "Loading…" label (keeps its .vf-asof position). */
.pt-loader--inline {
  flex-direction: row;
  gap: var(--space-2);
  padding: 0;
}
.pt-loader--inline .pt-loader-mark { width: 18px; }

@keyframes pt-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.94); }
}

@media (prefers-reduced-motion: reduce) {
  .pt-loader-mark { animation: none; }
}
