/* Light by default whatever the device setting (item #1705, Al, 3 November 2026); the page has no
   theme switch. Values below are copied from creag apps/lasair/src/theme/tokens.css; keep them in step by hand. */
:root {
  color-scheme: light;
  --color-warn: #8a5300;
  --color-ok: #17692f;
  --color-bad: #a3262a;
  --color-bg: #f5f6fb;
  --color-surface: #ffffff;
  --color-border: #dde1ee;
  --color-text: #0f1324;
  --color-text-muted: #454c66;
  --color-accent: #3a3fd1;
  --color-focus: #3a3fd1;
  --radius-md: 4px;
  --radius-lg: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 16px/1.5 "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main { max-width: 960px; margin: 0 auto; padding: 24px; display: grid; gap: 16px; }

h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: 0.02em; }

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
figure { margin: 0; }
video { width: 100%; height: 100%; object-fit: cover; }
.frame:has(video[hidden]) { background: var(--color-surface) url("poster.svg") center / cover; }
/* The chart carries no text, so "coming soon" is for screen readers only. */
.soon {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
video:not([hidden]) ~ .soon { display: none; }

/* The column gap is wider than the gap inside a row, so Dev's key does not read as part of Prod's
   card at desktop width (item #1626 row 3: 12px apart at 1280px). */
nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; }
/* Each environment is one row: the guest card takes four fifths, the admin key one fifth, in the
   same box style (Al, 1 November 2026). Two links side by side, since anchors cannot nest. */
.env { display: grid; grid-template-columns: 4fr 1fr; gap: 8px; }
.card, .key {
  text-decoration: none; color: inherit;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.card { display: block; padding: 12px 16px; }
.card:hover, .key:hover { border-color: var(--color-accent); }
.card:focus-visible, .key:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.label { font-weight: 600; color: var(--color-accent); }
/* The health word (item #1642): muted, after the label. Item #1705: each state also has an icon,
   so colour is never the only signal (amber: starting and degraded; green: up; red: down). */
.health { margin-left: 12px; color: var(--color-text-muted); font-size: 14px; }
.health .icon { display: inline-block; font-weight: 700; font-size: 1.15em; line-height: 1; width: 1.2em; margin-right: 4px; text-align: center; }
.health[data-state="starting"], .health[data-state="degraded"] { color: var(--color-warn); }
.health[data-state="up"], .health[data-state="refreshing"] { color: var(--color-ok); }
.health[data-state="down"] { color: var(--color-bad); }
/* Starting: the ◐ glyph is too small to read (review N1), so it is hidden and a CSS ring of the
   same box as the other icons is drawn instead. aria-hidden on the icon; the word carries the state. */
.health[data-state="starting"] .icon { font-size: 0; position: relative; vertical-align: middle; width: 18px; height: 18px; }
.health[data-state="starting"] .icon::before { content: ""; position: absolute; inset: 2px; box-sizing: border-box; border: 2.5px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 1.2s linear infinite; }
.health[data-stale="true"] .icon::before { animation: none; }
.reload { font: inherit; color: var(--color-accent); text-decoration: underline; background: none; border: 0; padding: 12px 8px; min-height: 44px; cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .health .icon, .health .icon::before { animation: none !important; } }
.note { margin: 0; min-height: 1.5em; color: var(--color-text-muted); font-size: 14px; }
/* A small icon (Al: "admin is a smaller icon eg key"); the box is at least a 44px target. The
   glyph is 24px so it does not look lost in the one-fifth box (item #1626 row 2). */
.key {
  display: grid; place-items: center; min-width: 44px; min-height: 44px;
  font-size: 24px; line-height: 1;
}

@media (max-width: 640px) {
  main { padding: 16px; }
  nav { grid-template-columns: 1fr; }
}
