/* ═══════════════════════════════════════════════════════════════
   ORION Guard Mode — Home Command HUD
   ORION visual language (matches Command/Dashboard/Alerts):
   #04070d deep-space glass · cyan/aqua/purple · Orbitron labels +
   Rajdhani body (loaded in index.html). Tuned for ~1280x800
   landscape, degrades to desktop and stacked phone layout.
   Per-panel backdrop blur intentionally omitted (tablet GPU);
   glass opacity is raised to compensate. /assets/orion.css
   (shared ORION foundation, Phase 1) now loads BEFORE this file;
   Guard keeps its own :root tokens on purpose, and where token
   names collide Guard wins because this file loads last.
   Contract: all IDs, .gm-lamp sev-*, .gm-btn[data-action]
   (incl. the hero primary control, which shares .gm-btn),
   .gm-btn-ready r-ready/r-setup, injected .gm-ready-row /
   .gm-dot s-* / .gm-empty / .gm-attn-* markup, heroCard[data-sev],
   resultPanel[data-kind] — unchanged from guard.js expectations.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ORION design tokens — mirrors command/dashboard/alerts :root.
     Guard keeps its own variable names so every downstream rule
     (and every guard.js-injected class) resolves unchanged. */
  --bg0:    #04070d;                      /* ORION --bg   */
  --bg1:    #06101e;                      /* viewport radial inner */
  --bg2:    #0a1626;                      /* ORION --ink  */
  --panel:  rgba(10, 24, 42, 0.72);       /* ORION glass, denser: no per-panel blur on Guard */
  --panel2: rgba(8, 20, 38, 0.85);        /* ORION glass-2, denser */
  --cyan:   #22e9ff;                      /* ORION --cyan */
  --teal:   #27ffd4;                      /* ORION --aqua / --sev-ok — Guard's verified color */
  --violet: #a855f7;                      /* ORION --purple */
  --pink:   #e34bff;                      /* ORION --magenta */
  --amber:  #ffb454;                      /* ORION --sev-warn */
  --red:    #ff5ea0;                      /* ORION --sev-crit */
  --text:   #cfeefb;                      /* ORION --text */
  --muted:  rgba(150, 196, 224, 0.62);    /* ORION --dim, nudged for body copy */
  --line:   rgba(40, 210, 255, 0.34);     /* ORION --line-2 (strong) */
  --line-soft: rgba(40, 210, 255, 0.16);  /* ORION --line (panel borders) */
  --off:    rgba(150, 196, 224, 0.34);    /* ORION --dim-2 — honest slate, never green */

  --sans: 'Rajdhani', system-ui, "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --disp: 'Orbitron', 'Rajdhani', system-ui, sans-serif;
  --radius: 14px;                         /* ORION --r */
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Ambient room glow behind the device frame — ORION viewport radial */
body {
  background:
    radial-gradient(ellipse 120% 100% at 50% 50%, var(--bg1) 0%, #03060c 70%, #000 100%),
    var(--bg0);
}

/* ─────────── Device frame ─────────── */

.gm-stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 1.6vmin, 22px);
}

.gm-shell {
  position: relative;
  width: min(1600px, 100%);
  min-height: calc(100vh - 2 * clamp(6px, 1.6vmin, 22px));
  min-height: calc(100dvh - 2 * clamp(6px, 1.6vmin, 22px));
  display: flex;
  flex-direction: column;
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--bg1), var(--bg0) 70%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.9),
    0 30px 80px rgba(0, 0, 0, 0.75),
    inset 0 0 120px 18px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(34, 233, 255, 0.10);
  overflow: hidden;
  padding: clamp(12px, 1.8vmin, 24px) clamp(14px, 2vmin, 28px);
}

/* ORION atmosphere glow — same four-corner hue field as fx-glow,
   held static (Guard is the calm surface; no breathe animation). */
.gm-shell::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 46% 52% at 50% 46%, rgba(124, 58, 237, 0.14), transparent 60%),
    radial-gradient(ellipse 34% 40% at 12% 70%, rgba(34, 233, 255, 0.10), transparent 62%),
    radial-gradient(ellipse 30% 36% at 88% 24%, rgba(227, 75, 255, 0.09), transparent 60%),
    radial-gradient(ellipse 26% 30% at 82% 84%, rgba(255, 94, 160, 0.06), transparent 60%);
}

/* Faint engineering grid — ORION fx-grid spec (34px, radial-faded) */
.gm-shell::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(40, 210, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 210, 255, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 78%);
          mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 78%);
}

.gm-header, .gm-main, .gm-footline { position: relative; z-index: 1; }

/* ─────────── Header ─────────── */

.gm-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.gm-brand { display: flex; align-items: center; gap: 14px; justify-self: start; }

/* CSS-only logo: orbital ring around the status lamp */
.gm-logo {
  position: relative;
  width: 44px; height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(34, 233, 255, 0.35);
  box-shadow:
    inset 0 0 12px rgba(34, 233, 255, 0.12),
    0 0 16px rgba(34, 233, 255, 0.10);
}
.gm-logo::before {
  content: "";
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: rgba(168, 85, 247, 0.55);
  border-right-color: rgba(34, 233, 255, 0.25);
}
@media (prefers-reduced-motion: no-preference) {
  .gm-logo::before { animation: gmOrbit 9s linear infinite; }
  @keyframes gmOrbit { to { transform: rotate(360deg); } }
}

.gm-brand-text h1 {
  margin: 0;
  font-family: var(--disp);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1.1;
  background: linear-gradient(92deg, #7ff6ff, var(--cyan) 45%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--cyan); /* fallback */
  filter: drop-shadow(0 0 14px rgba(34, 233, 255, 0.35));
}

.gm-sub {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Status lamps — driven by guard.js via .gm-lamp + sev-* */
.gm-lamp {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--off);
  box-shadow: 0 0 10px 2px rgba(150, 196, 224, 0.28);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.gm-lamp.sev-ok       { background: var(--teal);  box-shadow: 0 0 14px 3px rgba(39, 255, 212, 0.55); }
.gm-lamp.sev-warning  { background: var(--amber); box-shadow: 0 0 14px 3px rgba(255, 180, 84, 0.55); }
.gm-lamp.sev-critical { background: var(--red);   box-shadow: 0 0 14px 3px rgba(255, 94, 160, 0.60); }

@media (prefers-reduced-motion: no-preference) {
  .gm-lamp { animation: lampBreathe 4.5s ease-in-out infinite; }
  @keyframes lampBreathe {
    0%, 100% { opacity: 0.78; }
    50%      { opacity: 1; }
  }
}

/* Clock — center of the header, big tabular digits */
.gm-clock { text-align: center; justify-self: center; }

.gm-time {
  font-family: var(--disp);
  font-size: clamp(30px, 4.4vmin, 44px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(34, 233, 255, 0.45);
}

.gm-date {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.gm-fresh {
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(150, 196, 224, 0.75);
}

/* Exit nav */
.gm-exit-wrap {
  position: relative;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gm-exit, .gm-exit-more {
  font-family: var(--disp);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(10, 24, 42, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.gm-exit:hover, .gm-exit-more:hover,
.gm-exit:focus-visible, .gm-exit-more:focus-visible {
  color: var(--cyan);
  border-color: var(--line);
  box-shadow: 0 0 14px rgba(34, 233, 255, 0.15);
}

.gm-exit-more { padding: 10px 12px; line-height: 1; }

.gm-exit-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(34, 233, 255, 0.08);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.gm-exit-menu a {
  padding: 13px 16px;
  font-family: var(--disp);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
}
.gm-exit-menu a:last-child { border-bottom: none; }
.gm-exit-menu a:hover, .gm-exit-menu a:focus-visible {
  background: rgba(34, 233, 255, 0.08);
  color: var(--cyan);
}

/* ─────────── Main grid ─────────── */

.gm-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  grid-template-areas:
    "left right"
    "systems systems";
  gap: clamp(10px, 1.6vmin, 16px);
  padding-top: clamp(10px, 1.6vmin, 16px);
}

.gm-col-left  { grid-area: left;  display: flex; flex-direction: column; gap: clamp(10px, 1.6vmin, 16px); min-width: 0; }
.gm-col-right { grid-area: right; display: flex; flex-direction: column; min-width: 0; }
.gm-systems   { grid-area: systems; }

/* ─────────── Panels (shared glass) ─────────── */
/* Note: backdrop-filter reserved for the exit menu and result overlay
   only — blurring every panel is too heavy for budget wall tablets. */

.gm-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(12px, 1.8vmin, 16px) clamp(14px, 2vmin, 18px);
  overflow: hidden;
}

/* ORION glass sheen + top hairline (same recipe as .panel::before/::after
   on Command/Dashboard/Alerts). Applied to cards, the hero, the system
   strip and the result overlay so every surface reads as one product. */
.gm-card::before, .gm-hero::before, .gm-systems::before, .gm-result::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(150deg, rgba(40, 210, 255, 0.06), transparent 42%),
    linear-gradient(0deg, rgba(124, 58, 237, 0.05), transparent 30%);
}
.gm-card::after, .gm-hero::after, .gm-systems::after, .gm-result::after {
  content: "";
  position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(40, 210, 255, 0.5), transparent);
  opacity: 0.55;
}
.gm-card > *, .gm-hero > *, .gm-systems > *, .gm-result > * {
  position: relative;
  z-index: 1;
}

.gm-card-head, .gm-dock-head, .gm-limits-label {
  margin: 0 0 10px;
  font-family: var(--disp);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.gm-card-head::before, .gm-dock-head::before {
  content: "";
  display: inline-block;
  width: 14px; height: 1px;
  margin-right: 8px;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

/* ─────────── Hero — house brief ─────────── */

.gm-hero {
  --sev: var(--off);
  --sev-glow: rgba(150, 196, 224, 0.30);
  --sev-border: rgba(150, 196, 224, 0.38);
  --sev-line: rgba(150, 196, 224, 0.55);
  --sev-bg: rgba(150, 196, 224, 0.10);
  --sev-soft: rgba(150, 196, 224, 0.09);
  --sev-faint: rgba(150, 196, 224, 0.35);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2.2vw, 28px);
  padding: clamp(14px, 2.2vmin, 24px) clamp(16px, 2.2vmin, 26px);
  background:
    radial-gradient(520px 260px at 12% 30%, var(--sev-soft), transparent 70%),
    var(--panel);
  border: 1px solid var(--sev-border);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(34, 233, 255, 0.06),
    0 0 34px -14px var(--sev-glow);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.gm-hero[data-sev="ok"] {
  --sev: var(--teal); --sev-glow: rgba(39, 255, 212, 0.55);
  --sev-border: rgba(39, 255, 212, 0.38); --sev-line: rgba(39, 255, 212, 0.60);
  --sev-bg: rgba(39, 255, 212, 0.10); --sev-soft: rgba(39, 255, 212, 0.09);
  --sev-faint: rgba(39, 255, 212, 0.35);
}
.gm-hero[data-sev="warning"] {
  --sev: var(--amber); --sev-glow: rgba(255, 180, 84, 0.50);
  --sev-border: rgba(255, 180, 84, 0.38); --sev-line: rgba(255, 180, 84, 0.60);
  --sev-bg: rgba(255, 180, 84, 0.10); --sev-soft: rgba(255, 180, 84, 0.09);
  --sev-faint: rgba(255, 180, 84, 0.35);
}
.gm-hero[data-sev="critical"] {
  --sev: var(--red); --sev-glow: rgba(255, 94, 160, 0.55);
  --sev-border: rgba(255, 94, 160, 0.40); --sev-line: rgba(255, 94, 160, 0.62);
  --sev-bg: rgba(255, 94, 160, 0.10); --sev-soft: rgba(255, 94, 160, 0.09);
  --sev-faint: rgba(255, 94, 160, 0.35);
}
.gm-hero[data-sev="unknown"] {
  --sev: var(--muted); --sev-glow: rgba(150, 196, 224, 0.35);
  --sev-border: rgba(150, 196, 224, 0.38); --sev-line: rgba(150, 196, 224, 0.55);
  --sev-bg: rgba(150, 196, 224, 0.10); --sev-soft: rgba(150, 196, 224, 0.09);
  --sev-faint: rgba(150, 196, 224, 0.35);
}

/* Signature element: the status aperture ring */
.gm-ring {
  position: relative;
  width: clamp(120px, 15vmin, 168px);
  height: clamp(120px, 15vmin, 168px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--sev);
  border: 2px solid var(--sev-line);
  box-shadow:
    0 0 28px -4px var(--sev-glow),
    inset 0 0 26px -8px var(--sev-glow);
  transition: color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}
.gm-ring::before {
  content: "";
  position: absolute; inset: 8px;
  border-radius: 50%;
  border: 1px dashed var(--sev-faint);
}
/* scanning sweep — only while state is unknown/verifying */
.gm-hero[data-sev="unknown"] .gm-ring::after {
  content: "";
  position: absolute; inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--cyan);
}
@media (prefers-reduced-motion: no-preference) {
  .gm-hero[data-sev="unknown"] .gm-ring::after { animation: gmOrbit 1.6s linear infinite; }
}

.gm-shield { width: 52%; height: 52%; filter: drop-shadow(0 0 10px var(--sev-glow)); }

/* legacy hero lamp — kept for guard.js compatibility, now the ring core dot */
.gm-hero-lamp {
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sev);
  box-shadow: 0 0 10px 2px var(--sev-glow);
}

.gm-hero-body { min-width: 0; }

.gm-hero-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.gm-badge {
  font-family: var(--disp);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sev);
  border: 1px solid var(--sev-line);
  background: var(--sev-bg);
  border-radius: 999px;
  padding: 5px 12px;
}

.gm-conf {
  font-family: var(--disp);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.gm-hero-title {
  margin: 0 0 6px;
  font-family: var(--disp);
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.18;
  color: var(--text);
  text-shadow: 0 0 30px var(--sev-faint);
  overflow-wrap: break-word;
}

.gm-hero-summary {
  margin: 0;
  max-width: 62ch;
  font-size: 15px;
  color: var(--muted);
}

.gm-hero-action {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--cyan);
}
.gm-hero-action::before { content: "\25B8\00a0"; color: var(--teal); }

.gm-hero-limits {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.gm-limits-label { margin-bottom: 6px; color: rgba(150, 196, 224, 0.8); }
.gm-hero-limits ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.gm-hero-limits li {
  font-size: 12.5px;
  color: rgba(150, 196, 224, 0.85);
}
.gm-hero-limits li::before { content: "\2013\00a0"; color: var(--violet); }

/* ─────────── Hero primary control ───────────
   The main security-panel action. Deliberately NOT severity-colored:
   the ring/badge report state; this is a control. Cyan accent only —
   green stays reserved for verified results. Shares .gm-btn so
   guard.js click binding, disabled state and data-ready updates
   apply unchanged. */

.gm-hero-control {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: clamp(180px, 17vw, 230px);
}

.gm-hero-control-label {
  font-family: var(--disp);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.gm-btn.gm-hero-cta {
  min-height: clamp(112px, 15vmin, 148px);
  gap: 10px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(180px 120px at 50% 0%, rgba(34, 233, 255, 0.10), transparent 72%),
    var(--panel2);
  box-shadow:
    0 0 26px -10px rgba(34, 233, 255, 0.45),
    inset 0 0 22px -14px rgba(34, 233, 255, 0.35);
}
.gm-btn.gm-hero-cta:hover, .gm-btn.gm-hero-cta:focus-visible {
  border-color: var(--cyan);
  box-shadow:
    0 0 30px -6px rgba(34, 233, 255, 0.45),
    inset 0 0 24px -12px rgba(34, 233, 255, 0.40);
}

.gm-hero-cta-ico {
  width: 38px; height: 38px;
  color: var(--cyan);
  filter: drop-shadow(0 0 10px rgba(34, 233, 255, 0.45));
}

.gm-hero-cta-title {
  font-family: var(--disp);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
}

/* readiness line inside the CTA — guard.js swaps its classes, so target
   by position, not by an extra class it would wipe */
.gm-btn.gm-hero-cta .gm-btn-ready { font-size: 10px; }

.gm-hero-cta-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

/* ─────────── Home checklist (readiness strip) ─────────── */

.gm-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 26px; }

.gm-ready-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid rgba(34, 233, 255, 0.07);
  min-width: 0;
}

.gm-ready-name {
  flex: 1;
  font-size: 14.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gm-ready-state {
  font-family: var(--disp);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Status dots + state colors — classes injected by guard.js */
.gm-dot {
  flex: 0 0 auto;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--off);
  box-shadow: 0 0 8px rgba(86, 101, 122, 0.4);
}
.gm-dot.s-ok      { background: var(--teal);   box-shadow: 0 0 10px rgba(39, 255, 212, 0.6); }
.gm-dot.s-warn    { background: var(--amber);  box-shadow: 0 0 10px rgba(255, 180, 84, 0.6); }
.gm-dot.s-crit    { background: var(--red);    box-shadow: 0 0 10px rgba(255, 94, 160, 0.65); }
.gm-dot.s-unknown { background: var(--muted);  box-shadow: 0 0 8px rgba(150, 196, 224, 0.45); }
.gm-dot.s-off     { background: transparent;   box-shadow: none; border: 1.5px solid var(--off); }

.gm-ready-state.s-ok      { color: var(--teal); }
.gm-ready-state.s-warn    { color: var(--amber); }
.gm-ready-state.s-crit    { color: var(--red); }
.gm-ready-state.s-unknown { color: var(--muted); }
.gm-ready-state.s-off     { color: var(--off); }

/* ─────────── Attention + cameras row ─────────── */

.gm-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1.6vmin, 16px);
}

.gm-empty {
  font-size: 13.5px;
  color: var(--muted);
  padding: 4px 0;
}
.gm-empty::before { content: "\25C9\00a0\00a0"; color: rgba(39, 255, 212, 0.55); }

.gm-attn-item {
  border-left: 2px solid var(--amber);
  padding: 6px 0 6px 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 180, 84, 0.07), transparent 70%);
}
.gm-attn-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}
.gm-attn-msg .gm-dot { margin-top: 5px; }
.gm-attn-when {
  margin-top: 4px;
  font-family: var(--disp);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.gm-cam-line { font-size: 14px; color: var(--text); }
.gm-cam-insight {
  margin-top: 8px;
  font-size: 13px;
  color: var(--violet);
}
.gm-cam-insight::before { content: "\25B8\00a0"; }

.gm-cam-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(34, 233, 255, 0.35);
  padding-bottom: 2px;
}
.gm-cam-link:hover, .gm-cam-link:focus-visible { text-shadow: 0 0 12px rgba(34, 233, 255, 0.5); }

/* ─────────── Quick actions dock ─────────── */

.gm-dock-head { margin-bottom: 12px; text-align: left; }

.gm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.4vmin, 12px);
  align-content: start;
  flex: 1;
}

.gm-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: clamp(86px, 12vmin, 108px);
  padding: clamp(10px, 1.6vmin, 14px) 10px;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(120px 80px at 50% 0%, rgba(34, 233, 255, 0.05), transparent 70%),
    var(--panel2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.gm-btn:hover, .gm-btn:focus-visible {
  border-color: var(--line);
  box-shadow: 0 0 20px rgba(34, 233, 255, 0.12), inset 0 0 20px rgba(34, 233, 255, 0.04);
}
.gm-btn:active { transform: scale(0.97); }
.gm-btn:disabled { opacity: 0.45; cursor: wait; }

.gm-btn-ico {
  width: 30px; height: 30px;
  color: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(34, 233, 255, 0.35));
}
/* vary accent hue across the dock so it reads like the reference */
.gm-btn[data-action="goodnight"]  .gm-btn-ico,
.gm-btn[data-action="movie_mode"] .gm-btn-ico {
  color: var(--violet);
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.40));
}
.gm-btn[data-action="morning_report"] .gm-btn-ico {
  color: var(--teal);
  filter: drop-shadow(0 0 8px rgba(39, 255, 212, 0.40));
}

.gm-btn-title {
  font-family: var(--disp);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}

.gm-btn-ready {
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  min-height: 1em;
}
.gm-btn-ready.r-ready { color: var(--teal); }
.gm-btn-ready.r-setup { color: var(--amber); }

/* ─────────── System strip ─────────── */

.gm-systems {
  position: relative;
  background: var(--panel2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(8px, 1.4vmin, 12px) clamp(14px, 2vmin, 18px);
  overflow: hidden;
}

.gm-detail-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 22px;
}
.gm-detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  border-left: 1px solid var(--line-soft);
  padding-left: 14px;
  min-width: 0;
}
.gm-detail-grid > div:first-child { border-left: none; padding-left: 0; }
.gm-detail-grid dt {
  font-family: var(--disp);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.gm-detail-grid dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────── Footline ─────────── */

.gm-footline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: clamp(6px, 1.2vmin, 12px);
  font-family: var(--disp);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(150, 196, 224, 0.55);
}
.gm-footline span {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--violet), transparent);
  opacity: 0.6;
}

/* ─────────── Result overlay ─────────── */

.gm-result {
  position: fixed;
  left: 50%;
  bottom: clamp(18px, 4vh, 44px);
  transform: translateX(-50%);
  z-index: 60;
  width: min(560px, calc(100vw - 32px));
  --rk: var(--muted);
  --rk-glow: rgba(150, 196, 224, 0.30);
  --rk-line: rgba(150, 196, 224, 0.50);
  --rk-bg: rgba(150, 196, 224, 0.10);
  background: var(--panel2);
  border: 1px solid var(--rk-line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.7),
    0 0 34px -8px var(--rk-glow);
  backdrop-filter: blur(14px);
}
@media (prefers-reduced-motion: no-preference) {
  .gm-result { animation: gmResultIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
  @keyframes gmResultIn {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
}

.gm-result[data-kind="verified"] {
  --rk: var(--teal); --rk-glow: rgba(39, 255, 212, 0.5);
  --rk-line: rgba(39, 255, 212, 0.55); --rk-bg: rgba(39, 255, 212, 0.10);
}
.gm-result[data-kind="cannot"] {
  --rk: var(--amber); --rk-glow: rgba(255, 180, 84, 0.45);
  --rk-line: rgba(255, 180, 84, 0.55); --rk-bg: rgba(255, 180, 84, 0.10);
}
.gm-result[data-kind="setup"] {
  --rk: var(--violet); --rk-glow: rgba(168, 85, 247, 0.45);
  --rk-line: rgba(168, 85, 247, 0.55); --rk-bg: rgba(168, 85, 247, 0.10);
}
.gm-result[data-kind="failed"] {
  --rk: var(--red); --rk-glow: rgba(255, 94, 160, 0.5);
  --rk-line: rgba(255, 94, 160, 0.55); --rk-bg: rgba(255, 94, 160, 0.10);
}

.gm-result-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gm-result-badge {
  font-family: var(--disp);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rk);
  border: 1px solid var(--rk-line);
  background: var(--rk-bg);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.gm-result-title {
  flex: 1;
  font-family: var(--disp);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-result-close {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.gm-result-close:hover, .gm-result-close:focus-visible {
  color: var(--cyan);
  border-color: var(--line);
}

.gm-result-summary { margin: 10px 0 0; font-size: 14px; color: var(--text); }

.gm-result-evidence {
  margin: 10px 0 0;
  padding: 0 0 0 2px;
  list-style: none;
}
.gm-result-evidence li {
  font-size: 13px;
  color: var(--muted);
  padding: 3px 0;
}
.gm-result-evidence li::before { content: "\25B8\00a0"; color: var(--rk); }

.gm-result-next {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--rk);
}

/* ─────────── Focus / accessibility ─────────── */

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ─────────── Responsive ─────────── */

@media (max-width: 1080px) {
  .gm-main {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "right"
      "systems";
  }
  .gm-actions { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 780px) {
  .gm-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand exit"
      "clock clock";
    row-gap: 12px;
  }
  .gm-brand     { grid-area: brand; }
  .gm-exit-wrap { grid-area: exit; }
  .gm-clock     { grid-area: clock; }

  .gm-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .gm-hero-top, .gm-hero-limits ul { justify-content: center; }
  .gm-hero-summary { margin-inline: auto; }
  .gm-hero-control { width: min(280px, 100%); }

  .gm-strip { grid-template-columns: 1fr; }
  .gm-duo { grid-template-columns: 1fr; }
  .gm-actions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .gm-brand-text h1 { font-size: 20px; letter-spacing: 0.12em; }
  .gm-exit { display: none; } /* keep the menu button; saves width */
}

/* Short laptop screens (1366x768, 1280x800, 1440x900): compress chrome,
   not type. The wall tablet keeps the roomier defaults above. */
@media (max-height: 840px) and (min-width: 1081px) {
  .gm-header { padding-bottom: 10px; }
  .gm-ring { width: clamp(104px, 13vmin, 140px); height: clamp(104px, 13vmin, 140px); }
  .gm-hero-title { font-size: clamp(19px, 2.3vw, 26px); }
  .gm-btn.gm-hero-cta { min-height: clamp(100px, 14vmin, 128px); }
  .gm-hero-cta-note { display: none; } /* readiness label still explains state */
  .gm-footline { padding-top: 4px; }
}
