:root {
  --bg: #0f0f12; --panel: #18181d; --ink: #f5f5f4; --muted: #a8a29e; --line: #2a2a31;
  --accent: #ffd400; --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --learn: #93c5fd;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 460px; padding-top: 72px; }
.banner { margin: 0; padding: 6px 16px; background: #3b2f00; color: var(--accent); font-size: 14px; text-align: center; }
header.top { border-bottom: 1px solid var(--line); margin-bottom: 20px; }
header.top .wrap:first-child { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-weight: 900; font-size: 20px; letter-spacing: -0.03em; }
.tabs, .periods { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.tabs { padding-bottom: 10px; }
.tabs a, .periods a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.tabs a[aria-current], .periods a[aria-current] { color: var(--ink); border-bottom: 2px solid var(--accent); }
.periods { margin-bottom: 20px; font-size: 15px; }
.linkish { background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; padding: 0; }
.btn { background: var(--accent); color: #111; border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 700; cursor: pointer; }
h1 { font-size: 28px; margin: 0 0 16px; }
h2 { font-size: 20px; margin: 36px 0 12px; }
h2 .small { font-weight: 400; margin-left: 8px; }
h3 { font-size: 16px; margin: 24px 0 8px; color: var(--muted); font-weight: 600; }
.small, .note { font-size: 13px; color: var(--muted); }
.bad { color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .label { color: var(--muted); font-size: 14px; }
.tile .value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-weight: 600; font-size: 13px; }
td, tfoot th { font-variant-numeric: tabular-nums; }
.cards td:not(:last-child), .num { white-space: nowrap; }
tfoot th, tfoot td { font-weight: 700; border-bottom: 0; }
td a, td { overflow-wrap: anywhere; }
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rules li { line-height: 1.4; }
.pill { display: inline-block; min-width: 92px; text-align: center; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; margin-right: 8px; color: #111; }
.pill.ok { background: var(--ok); } .pill.warn { background: var(--warn); } .pill.stop { background: var(--bad); } .pill.learn { background: var(--learn); }
form { margin: 0; }

@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile .value { font-size: 22px; }
}
/* The 11-column table needs about 1000px; below that, cards (review: tablets scrolled sideways). */
@media (max-width: 1040px) {
  /* Phone: each table row becomes a card with labelled values, so nothing scrolls sideways. */
  .cards thead { display: none; }
  .cards, .cards tbody, .cards tfoot, .cards tr { display: block; }
  .cards tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  .cards th[scope=row] { display: block; border: 0; padding: 4px 0; font-size: 16px; }
  .cards td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; white-space: normal; }
  .cards td::before { content: attr(data-label); color: var(--muted); }
  .cards td[colspan] { display: block; }
  .cards td[colspan]::before { content: none; }
  .plain td.small { display: none; }
}

/* Proces: the stages as a flow; a chip is an app sitting in that stage. */
.flow { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.stage { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.stage.busy { border-color: #4a4a55; }
.stage.on { border-color: var(--accent); }
.stage:not(:last-child)::after { content: "→"; position: absolute; right: -10px; top: 12px; width: 10px; text-align: center; color: var(--muted); font-size: 13px; }
.stage-name { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1.25; display: flex; gap: 6px; align-items: baseline; overflow-wrap: anywhere; }
.step { color: var(--muted); font-weight: 400; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; background: #26262e; color: var(--ink); text-decoration: none; border-radius: 10px; padding: 3px 10px; font-size: 13px; max-width: 100%; overflow-wrap: anywhere; }
.chip.on { background: var(--accent); color: #111; font-weight: 700; }
@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; gap: 14px; }
  .stage { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .stage:not(:last-child)::after { content: "↓"; right: auto; left: 18px; top: auto; bottom: -15px; }
}
