/* Factory status — utilitarian: system fonts, one accent, status colours that hold in both themes. */
:root {
  --bg: #ffffff;
  --fg: #1b1f24;
  --muted: #5b6470;
  --line: #d8dde3;
  --card: #f6f8fa;
  --accent: #0b5cad;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #c62828;
  --info: #0b5cad;
  --off: #6e7781;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419;
    --fg: #e6e9ed;
    --muted: #9aa4af;
    --line: #2d343c;
    --card: #171d24;
    --accent: #6cb6ff;
    --ok: #4ac26b;
    --warn: #d4a72c;
    --bad: #ff7b72;
    --info: #6cb6ff;
    --off: #8b949e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1419;
  --fg: #e6e9ed;
  --muted: #9aa4af;
  --line: #2d343c;
  --card: #171d24;
  --accent: #6cb6ff;
  --ok: #4ac26b;
  --warn: #d4a72c;
  --bad: #ff7b72;
  --info: #6cb6ff;
  --off: #8b949e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.2rem; margin: 0; }
h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
h3.owner { color: var(--bad); }
small, .small { color: var(--muted); font-size: 0.85em; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.muted, .empty { color: var(--muted); }

.page { max-width: 72rem; margin: 0 auto; padding: 0 16px 3rem; }
.top {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0 0.25rem;
}
.top .asof { margin: 0; }
nav ul { display: flex; gap: 0.25rem 1rem; flex-wrap: nowrap; overflow-x: auto; list-style: none; margin: 0.4rem 0 0; padding: 0 0 0.4rem; }
nav a { white-space: nowrap; text-decoration: none; font-size: 0.9rem; }
nav a:hover, nav a:focus { text-decoration: underline; }
.theme {
  position: fixed; right: 16px; bottom: 16px; z-index: 2;
  font: inherit; font-size: 0.85rem;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.3rem 0.6rem; cursor: pointer;
}

section { min-height: calc(100vh - 5rem); padding: 1.5rem 0 1rem; border-bottom: 1px solid var(--line); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 1rem; margin-bottom: 0.75rem; }
.asof { color: var(--muted); font-size: 0.85rem; margin: 0; }
.stale { background: var(--bad); color: #fff; padding: 0.5rem 0.75rem; border-radius: 6px; font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem; }
.card p { margin: 0.15rem 0; }
.card.big .pct { font-size: 2.6rem; }
.card-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.pct { font-size: 1.6rem; font-weight: 700; line-height: 1.15; }
.count { color: var(--muted); font-size: 0.85rem; }
meter { width: 100%; height: 0.6rem; }
.trend { margin-right: 0.5rem; font-size: 0.85rem; white-space: nowrap; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--bad); }
.trend.flat, .trend.none { color: var(--muted); }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: top; padding: 0.4rem 0.6rem 0.4rem 0; border-bottom: 1px solid var(--line); }
thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
tbody th { font-weight: 600; white-space: nowrap; }
table.grid td { min-width: 8rem; }
.cell { display: flex; flex-direction: column; gap: 0.1rem; align-items: flex-start; }
.ver { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.85em; }
dl.stats { display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.75rem; margin: 0.3rem 0 0; }
dl.stats dt { color: var(--muted); }
dl.stats dd { margin: 0; font-weight: 600; text-align: right; }
dd.bad { color: var(--bad); }

.badge {
  display: inline-block; white-space: nowrap;
  border: 1px solid currentColor; border-radius: 999px;
  padding: 0 0.45rem; font-size: 0.75rem; font-weight: 600; line-height: 1.5;
  color: var(--off);
}
.s-live, .s-green, .s-approved { color: var(--ok); }
.s-in-progress, .s-running, .s-in-review, .s-building, .s-ready, .s-pending { color: var(--info); }
.s-planned, .s-none, .s-skipped, .s-na, .s-off { color: var(--off); }
.s-blocked-on-owner, .s-blocked, .s-changes-requested { color: var(--warn); }
.s-red, .s-rejected { color: var(--bad); }

@media (max-width: 40rem) {
  body { font-size: 14px; }
  .card.big .pct { font-size: 2.2rem; }
  section { min-height: auto; }
}
