:root {
  color-scheme: dark;
  --bg:          #0a0f1e;
  --bg-panel:    rgba(255, 255, 255, 0.03);
  --panel-bg:    rgb(10, 15, 30);
  --bg-panel-alt:rgba(255, 255, 255, 0.04);
  --sidebar:     rgba(255, 255, 255, 0.03);
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --panel:       rgba(255, 255, 255, 0.03);
  --panel-soft:  rgba(255, 255, 255, 0.02);
  --ink:         #e2e8f0;
  --ink-strong:  #f1f5f9;
  --muted:       #475569;
  --muted-deep:  #334155;
  --line:        rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.10);
  --accent:      #0f766e;
  --accent-glow: rgba(15, 118, 110, 0.4);
  --accent-soft: rgba(15, 118, 110, 0.15);
  --ok:          #34d399;
  --ok-soft:     rgba(52, 211, 153, 0.12);
  --danger:      #f87171;
  --danger-soft: rgba(248, 113, 113, 0.10);
  --warn:        #fbbf24;
  --warn-soft:   rgba(251, 191, 36, 0.12);
  --shadow:      0 16px 45px rgba(0, 0, 0, 0.4);
  --radius:      8px;
  --radius-sm:   6px;
  --radius-pill: 999px;

  /* Two states the four-class chip vocabulary had no room for. `needs-you` is the only
     colour in this file that asks the reader to do something, so nothing decorative may
     use it; `in-flight` is deliberately cool and quiet, because work in progress is the
     normal case and must not read as a warning. */
  --needs-you:      #c4b5fd;
  --needs-you-soft: rgba(196, 181, 253, 0.14);
  --in-flight:      #7dd3fc;
  --in-flight-soft: rgba(125, 211, 252, 0.12);

  /* Spacing scale. Before this, every gap and padding in the file was a raw literal, so
     no two panels agreed on their rhythm. */
  --space-1:  4px;
  --space-2:  6px;
  --space-3:  8px;
  --space-4: 10px;
  --space-5: 14px;
  --space-6: 18px;
  --space-7: 24px;
  --space-8: 32px;

  /* Type scale, fixed rem-free px steps at a 1.15 ratio. Product UI is read at a
     consistent size; fluid headings that shrink inside a panel look worse, not better. */
  --text-xs:  10px;
  --text-sm:  11px;
  --text-md:  13px;
  --text-base:14px;
  --text-lg:  16px;
  --text-xl:  19px;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Chart tokens. One hue, light -> dark, for ORDERED categories only; nominal
     categories all wear --chart-1, because colouring bars darker-where-bigger
     would double-encode the length they already show. Validated against --bg:
     monotone lightness, adjacent lightness gaps >= 0.06, hue spread 4 degrees,
     and the dark end at 5.1:1. */
  --chart-1:     #5eead4;
  --chart-2:     #2dd4bf;
  --chart-3:     #14b8a6;
  --chart-4:     #0d9488;
  --chart-wash:  rgba(94, 234, 212, 0.10);
  --chart-track: rgba(255, 255, 255, 0.06);
  --chart-grid:  var(--line);
  /* The only token legal for chart, axis and qualifier text: 7.45:1 on --bg.
     --muted (2.5:1) and --muted-deep (1.8:1) are decorative and must not carry
     text a reader has to actually read. */
  --chart-label: #94a3b8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  align-items: center;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  border: 1px solid #0f766e;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(15, 118, 110, 0.3);
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 650;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
}

button:hover {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  box-shadow: 0 0 16px rgba(15, 118, 110, 0.5);
}

/* Links that act as buttons — the surface links on the run detail — need the box the
   `button` element rule provides, since none of it applies to an anchor. */
a.button-secondary {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: inline-flex;
  font-size: var(--text-md);
  font-weight: 650;
  gap: var(--space-2);
  justify-content: center;
  min-height: 34px;
  padding: 0 var(--space-5);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: none;
  color: #cbd5e1;
}

.button-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.button-compact {
  font-size: 11px;
  min-height: 28px;
  padding: 0 9px;
}

.button-danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.28);
  box-shadow: none;
  color: #fecaca;
}

.button-danger:hover {
  background: rgba(248, 113, 113, 0.22);
  box-shadow: none;
}

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  color: var(--ink);
  min-height: 34px;
  padding: 6px 9px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent-glow);
  outline-offset: 2px;
}

/* Buttons and links use :focus-visible so a mouse click does not leave a ring behind, while
   keyboard navigation still shows exactly where it is. The ring is brighter than the old one
   because it is now the primary way to walk the run list. */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--chart-1);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Two infinite keyframes live in this file. Neither carries information a still frame
   cannot, so both stop when the reader has asked for less motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-deep);
}
