/* /runs: the list-page layout (rules/ui-design.md), styled after the landing mockup's records table
   (docs/brainstorms/mockups/site-landing.html#records). */
/* The phase colours (--s-plan ... --s-coord) live in site.css: the mow post's timeline uses them too. */
:root { --run: #1f4fd1; --good: #1f7a4a; --bad: #b42318; --idle: #8a8a94; --open: #b58a00; --paused: #c2410c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --run: #77aaff; --good: #4fc184; --bad: #f87171; --idle: #6e6e78; --open: #facc15; --paused: #fb923c; }
}
:root[data-theme="dark"] { --run: #77aaff; --good: #4fc184; --bad: #f87171; --idle: #6e6e78; --open: #facc15; --paused: #fb923c; }

.runs { padding-block: 2.5rem 4rem; }
.list-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.375rem 1rem; margin-bottom: 1.25rem; }
.list-head h1 { margin: 0; font-size: 2rem; line-height: 1.1; letter-spacing: -0.01em; }
.summary { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.summary b { color: var(--ink); }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); }
.runs-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.runs-table th, .runs-table td { text-align: left; padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.runs-table thead th { background: var(--code-bg); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.runs-table tbody tr:last-child > * { border-bottom: 0; }
.runs-table tbody tr:hover { background: var(--hover); }
.runs-table tbody th { font-weight: 400; white-space: nowrap; }
.run-name { color: var(--ink); font-weight: 600; }
/* The one-line notes wrap; every other cell keeps to one line. */
.about { min-width: 16rem; max-width: 28rem; color: var(--muted); font-size: 0.9375rem; }
.kind { color: var(--muted); white-space: nowrap; }
.runs-table small { display: block; color: var(--muted); font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Lines: added in green, deleted in red, as a diff stat reads. */
.table-wrap { position: relative; } /* holds Lines' visually-hidden words inside the scroller, not the page */
.add { color: var(--good); }
.del { color: var(--bad); }
/* Its digits, not the header, set the column: trim the right padding only, so it stays under the header. */
.runs-table td:has(> .add) { padding-right: 0.25rem; }

/* Status: a square dot plus a neutral word. */
.st { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; background: var(--c, var(--idle)); }
.st[data-s="running"] { --c: var(--run); }
.st[data-s="shipped"] { --c: var(--good); }
.st[data-s="open"] { --c: var(--open); }
.st[data-s="paused"] { --c: var(--paused); }
.st[data-s="closed"] { --c: var(--idle); }

/* Cost bar: one rect per phase; the SVG width is this run's cost / the dearest run's × 120px. */
.cost { display: block; margin-top: 4px; overflow: visible; }
.cost rect { fill: var(--c); stroke: var(--paper); stroke-width: 2px; }
[data-p="plan"] { --c: var(--s-plan); }
[data-p="build"] { --c: var(--s-build); }
[data-p="review"] { --c: var(--s-review); }
[data-p="fix"] { --c: var(--s-fix); }
[data-p="coord"] { --c: var(--s-coord); }
/* Lane graph: the mow tracker's ids view in small — one plate per wave, lanes that run together
   stacked in a column. Lane colours are the mow post's graph (.mowg in site.css). */
.wg { display: inline-flex; align-items: center; gap: 4px; }
.wg-wave { display: inline-flex; align-items: center; gap: 3px; padding: 4px; background: var(--code-bg); }
.wg-stage { display: inline-flex; flex-direction: column; gap: 3px; }
.wg i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--c); color: #161616; font: normal 700 10px/1 var(--font); }
.wg i[data-s="pending"] { --c: #3a3a3a; color: #a0a0aa; }
.wg i[data-s="done"] { --c: #3ddc84; }
.wg i[data-s="issues"] { --c: #facc15; }
.wg i[data-s="error"] { --c: #f87171; }
.wg i[data-s="running"] { --c: #60a5fa; animation: wg-pulse 1.5s ease-in-out infinite; }
@keyframes wg-pulse { 50% { background: #bfdbfe; } }
@media (prefers-reduced-motion: reduce) { .wg i[data-s="running"] { animation: none; } }

.key { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--muted); }
.key i { display: inline-block; width: 8px; height: 8px; margin-right: 0.375rem; background: var(--c); }

/* Chats: one plain row per chat in a single tbody, so undo the per-run tbody rules. */

@media (max-width: 640px) {
  /* Names break at their hyphens, and the description gives up width before the name does. */
  .runs-table tbody th { white-space: normal; }
  .about { min-width: 9rem; }
}

/* Time saved: the alarm clock with minutes on its face, in plain ink. */
.clock { display: block; width: 38px; height: 46px; color: var(--ink); font-family: var(--font); }
