:root {
  --bg: #1a2332;
  --bg-2: #223047;
  --fg: #e8edf4;
  --fg-dim: #9aa7ba;
  --focus: #f5c542;
  --focus-width: 3px;
  --radius: 10px;
  --radius-lg: 18px;
  --panel-alpha: 0.92;
  --tap: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-scale: 1;
  --card-bg: #2a3a55;
  --card-fg: #101a28;
  --accent: #5b8def;
  --danger: #e05a5a;
  --ok: #4ec27a;
  --space: calc(12px * var(--text-scale));
}
html, body {
  margin: 0; padding: 0;
  /* The page itself never scrolls sideways; rails scroll inside their
     own contained boxes. (Tablet side-scroll fix, Nov 17.) */
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: calc(15px * var(--text-scale));
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
* { box-sizing: border-box; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
button:focus { outline: none; }
[data-focusable] {
  outline: none;
  position: relative;
}
[data-focusable].is-focused::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: var(--focus-width) solid var(--focus);
  border-radius: calc(var(--radius) + 2px);
  pointer-events: none;
  z-index: 10;
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
html.reduce-motion * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
body.high-contrast {
  --bg: #000; --bg-2: #111; --fg: #fff; --fg-dim: #ccc; --card-bg: #0a1a2a; --card-fg: #000;
  --focus: #ffff00;
}
[hidden] { display: none !important; }
