/* WAVERS Radar: plain, unbranded engine UI (identity comes later). */
:root {
  color-scheme: light;
  --fg: #111;
  --bg: #f2f2f2;
  --panel: #fff;
  --line: #bbb;
  --alert: #c8102e; /* white text on this red: 5.9:1 */
  --focus: #1a5fb4;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

.page { position: relative; z-index: 1; max-width: 32rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: 0.25rem 0 0.5rem; }
h2 { font-size: 1.125rem; margin: 0 0 0.5rem; }
.lede { margin: 0 0 1rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  margin: 0 0 1rem;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.btn {
  display: block; width: 100%; min-height: 48px; margin: 0.75rem 0 0; padding: 0.75rem 1rem;
  font: inherit; font-weight: 700; color: #fff; background: #222;
  border: 2px solid #222; border-radius: 6px; cursor: pointer;
}
.btn-wave { font-size: 1.25rem; color: var(--alert); background: #fff; border-color: #fff; }

.btn:focus-visible, input:focus-visible, a:focus-visible, .state:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.check { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.5rem 0; }
.check input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; }

.state { margin: 0.5rem 0 0; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.detail { margin: 0.25rem 0 0; }

.message {
  margin: 0.75rem 0 0; padding: 0.5rem 0.75rem;
  color: #5f1a14; background: #fdecea; border-left: 4px solid #b3261e;
}
.message:empty { display: none; }
.notes { margin: 0; padding-left: 1.25rem; }

/* Scope + small pulsing ring. The pulse is a scale change (no luminance flash)
   at 1 Hz, i.e. <= 2 Hz (G-FLASH); keep in sync with PULSE_PERIOD_MS in lib/flash.js. */
.scope { position: relative; width: 72px; height: 72px; margin: 0 auto; }
.ring { position: absolute; inset: 0; border: 4px solid currentColor; border-radius: 50%; opacity: 0.4; }
body.is-alert .ring { opacity: 1; animation: ring-pulse 1000ms ease-in-out infinite; }
@keyframes ring-pulse {
  0% { transform: scale(0.8); }
  50% { transform: scale(1); }
  100% { transform: scale(0.8); }
}

/* Full-screen alert: STEADY red. No animation, no transition. Toggled only through
   the flash limiter (lib/flash.js), which caps colour changes at 2 Hz. */
.alert-layer { position: fixed; inset: 0; z-index: 0; background: var(--alert); }
body.is-alert .status { color: #fff; background: transparent; border-color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
