/* ══════════════════════════════════════════════════════════════════════════
   Pipelines view (apps/repos/pipelines.js)

   HOUSE RULES OBSERVED — see the header of repos.css:
     • radii 3–8px on chips, plaques, bars and cards; 10px only on a button.
     • the ONLY round things here are status dots.
     • one dark surface on the page, and it is the bill. Everything below it is
       the same white-card language the rest of the Command Center uses, so the
       hero reads as "the answer" rather than as a second theme.
   ══════════════════════════════════════════════════════════════════════════ */

.ci-view{ --ci-run:#649954; --ci-wait:#e0a83c; --ci-ink:#161616; }

/* ── the bill ─────────────────────────────────────────────────────────────
   Four columns that collapse to two then one. `min-width:0` on every child
   because the sparkline is a flex row of 30 items and without it the column
   refuses to shrink and pushes the stats off the card. */
.ci-hero{
  position:relative; display:grid; gap:20px 28px; align-items:center;
  grid-template-columns:minmax(190px,auto) minmax(180px,1fr) auto;
  background:linear-gradient(128deg,#16281d 0%,#1f3a2a 58%,#254733 100%);
  border-radius:8px; padding:22px 24px 20px; margin:2px 0 16px; color:#eef5ee;
  box-shadow:0 1px 2px rgba(0,0,0,.18), 0 12px 28px -22px rgba(22,40,29,.9);
}
.ci-hero > *{ min-width:0; }
.ci-hero-eyebrow{ font-size:10.5px; font-weight:800; letter-spacing:.9px; text-transform:uppercase; color:#8fb99a; }
.ci-hero-fig{ font-size:46px; font-weight:800; line-height:1; letter-spacing:-1.5px; margin:6px 0 4px; color:#fff;
  font-variant-numeric:tabular-nums; }
.ci-hero-fig span{ font-size:16px; font-weight:700; letter-spacing:0; color:#9dc4a8; margin-left:4px; }
.ci-hero-sub{ font-size:12.5px; color:#a9cbb3; }

.ci-spark{ display:flex; align-items:flex-end; gap:2px; height:52px; }
.ci-spark i{ flex:1 1 0; min-width:2px; background:#5d8a68; border-radius:2px 2px 0 0; transition:background .12s; }
.ci-spark i:hover{ background:#a8d894; }
.ci-spark-axis{ display:flex; justify-content:space-between; gap:10px; margin-top:7px;
  font-size:11px; color:#8fb99a; font-variant-numeric:tabular-nums; }

.ci-hero-stats{ display:flex; gap:10px; }
.ci-stat{ background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.09);
  border-radius:6px; padding:9px 13px; min-width:74px; }
.ci-stat b{ display:block; font-size:19px; font-weight:800; color:#fff; line-height:1.15; font-variant-numeric:tabular-nums; }
.ci-stat b b{ display:inline; font-size:13px; font-weight:700; color:#8fb99a; }
.ci-stat span{ display:block; font-size:10.5px; color:#9dc4a8; margin-top:2px; }
.ci-stat.is-good b{ color:#b6e8a4; }
.ci-stat.is-bad b{ color:#ff9c93; }
.ci-stat.is-warn b{ color:#f2c96a; }

.ci-hero-src{ position:absolute; top:14px; right:18px; display:flex; align-items:center; gap:9px;
  font-size:11px; font-weight:700; }
.ci-hero-src a{ color:#9dc4a8; text-decoration:none; }
.ci-hero-src a:hover{ color:#fff; }
/* How old the snapshot is — see the note in hero(). Quiet when fresh, amber and
   unmissable once it is older than the refresh cadence. */
.ci-age{ font-size:10px; font-weight:700; letter-spacing:.2px; color:#7ea98b;
  background:rgba(255,255,255,.07); border-radius:4px; padding:3px 7px; }
.ci-age.is-stale{ color:#3d2c05; background:#e0a83c; }

@media(max-width:1000px){
  .ci-hero{ grid-template-columns:minmax(170px,auto) 1fr; }
  .ci-hero-stats{ grid-column:1/-1; }
}
@media(max-width:620px){
  .ci-hero{ grid-template-columns:1fr; padding:18px; }
  .ci-hero-fig{ font-size:38px; }
  .ci-hero-src{ position:static; display:block; margin-top:10px; }
}

/* ── the queue band ───────────────────────────────────────────────────────
   The one chart on the page. Two segments, drawn to scale, labels INSIDE the
   segment so there is no legend to cross-reference. Below ~9% a segment cannot
   hold its own label, so the text is clipped rather than wrapped — the width
   itself is still the message. */
.ci-queue{ background:var(--surf); border:1px solid var(--border); border-radius:8px;
  padding:16px 18px 14px; margin-bottom:18px; }
.ci-queue header{ display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; margin-bottom:11px; }
.ci-queue h3{ margin:0; font-size:13px; font-weight:800; text-transform:uppercase; letter-spacing:.4px; color:var(--ink2); }
.ci-queue-verdict{ margin-left:auto; font-size:13px; font-weight:800; color:#b07a12; }

.ci-split{ display:flex; height:38px; border-radius:5px; overflow:hidden; }
.ci-split span{ display:flex; align-items:center; gap:6px; padding:0 12px; white-space:nowrap; overflow:hidden;
  font-size:12px; font-weight:600; color:#fff; }
.ci-split em{ font-style:normal; font-weight:800; font-size:14px; font-variant-numeric:tabular-nums; }
.ci-split .run{ background:var(--ci-run); }
.ci-split .wait{ background:var(--ci-wait); color:#3d2c05; }

.ci-queue-foot{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-top:13px; }
.ci-facts{ display:flex; gap:22px; }
.ci-fact b{ display:block; font-size:16px; font-weight:800; color:var(--ink); line-height:1.2; font-variant-numeric:tabular-nums; }
.ci-fact span{ display:block; font-size:11px; color:var(--ink3); margin-top:1px; }
.ci-lever{ margin-left:auto; display:inline-flex; align-items:center; gap:6px;
  background:#f3f8f1; border:1px solid #cfe3c8; border-radius:8px; padding:8px 12px;
  font-size:12px; font-weight:600; color:#3d5c34; text-decoration:none; }
.ci-lever b{ font-weight:800; color:#2f6fb0; }
.ci-lever:hover{ background:#e9f3e5; border-color:#b7d4ad; }
@media(max-width:620px){ .ci-lever{ margin-left:0; } .ci-facts{ gap:16px; } }

/* ── two columns ──────────────────────────────────────────────────────────
   ⚠️ THE BREAKPOINT IS THE VIEWPORT BUT THE CONSTRAINT IS THE COLUMN.
   This view renders inside the Repo Library shell, behind a ~250px rail, so the
   space it actually gets is roughly `viewport - 274`. Collapsing at 940px —
   which is what "looks fine in a 940px window" suggested — left the pipeline
   list about 440px wide on a 1024px screen, and MEASURED 39 of 39 pipeline
   names ellipsed down to nothing.
   Two columns need ~900px of content (590 list + 288 aside + gap), so the
   viewport number is ~1180. Verified across twelve widths with a 250px rail in
   place; see the sweep in the session scratchpad. */
.ci-cols{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,288px); gap:22px; align-items:start; }
@media(max-width:1180px){ .ci-cols{ grid-template-columns:1fr; } }
.ci-hint{ float:right; font-size:10.5px; font-weight:600; text-transform:none; letter-spacing:0; color:var(--ink3); }

/* ── filter chips ─────────────────────────────────────────────────────── */
.ci-chips{ display:flex; flex-wrap:wrap; gap:6px; margin:0 0 10px; align-items:center; }
.ci-chip-gap{ flex:0 0 12px; }
.ci-chip{ display:inline-flex; align-items:center; gap:6px; background:var(--surf);
  border:1px solid var(--border); border-radius:6px; padding:5px 9px; cursor:pointer;
  font:600 12px/1 var(--f); color:var(--ink2); }
.ci-chip i{ font-style:normal; font-size:10.5px; font-weight:800; color:var(--ink3);
  background:var(--border-s); border-radius:3px; padding:2px 5px; font-variant-numeric:tabular-nums; }
.ci-chip:hover{ border-color:var(--ink4); }
.ci-chip.is-on{ background:var(--_k,#649954); border-color:var(--_k,#649954); color:#fff; }
.ci-chip.is-on i{ background:rgba(255,255,255,.22); color:#fff; }

/* ── one pipeline, one row ────────────────────────────────────────────────
   Grid, not flex: the bar column has to be the same width on every row or the
   bars are not comparable, which is the only reason to draw them. */
.ci-rows{ display:flex; flex-direction:column; }
/* ⚠️ EVERY COLUMN IS A minmax, INCLUDING THE FIXED-LOOKING ONES. With literal
   widths (58px 1fr 148px 52px 92px) the track total is 398px + gaps and a grid
   CANNOT go below the sum of its tracks — so at a 384px container the row was
   408px wide and spilled out of it, `1fr` having already collapsed to zero.
   Floors instead of fixed widths let the whole row compress together, which is
   also the only reason the bars stay comparable down the column. */
.ci-row{ display:grid; align-items:center; gap:12px;
  grid-template-columns:56px minmax(88px,1fr) minmax(58px,148px) minmax(38px,52px) minmax(62px,92px);
  padding:9px 10px; border-radius:6px; text-decoration:none; color:inherit;
  border-bottom:1px solid var(--border-s); }
.ci-row:last-child{ border-bottom:0; }
.ci-row:hover{ background:var(--border-s); }
.ci-row-k{ font-size:9.5px; font-weight:800; letter-spacing:.4px; text-transform:uppercase;
  color:#fff; background:var(--_k,#8d8d8d); border-radius:4px; padding:3px 0; text-align:center; }
.ci-row-name{ display:block; min-width:0; }
.ci-row-name b{ display:block; font-size:13px; font-weight:700; color:var(--ink);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ci-row-name i{ display:block; font-style:normal; font-size:11px; color:var(--ink3);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ci-row-bar{ display:flex; height:10px; background:var(--border-s); border-radius:3px; overflow:hidden; }
.ci-row-bar i{ display:block; height:100%; }
.ci-row-bar .run{ background:var(--ci-run); }
.ci-row-bar .wait{ background:var(--ci-wait); }
.ci-row-n{ font-size:13px; font-weight:700; color:var(--ink2); text-align:right; font-variant-numeric:tabular-nums; }
.ci-row-n i{ display:block; font-style:normal; font-size:10px; font-weight:600; color:var(--ink4); }
.ci-row-health{ display:flex; align-items:center; justify-content:flex-end; gap:7px; font-size:11px; }
.ci-row-health b{ font-weight:700; }
.ci-row-health .ok{ color:#4b7d3f; }
.ci-row-health .bad{ color:#c62828; }
.ci-row-health .idle{ color:var(--ink4); }
.ci-row-health .sdot{ width:8px; height:8px; border-radius:50%; flex:0 0 auto; }
/* 860, not 760: same rail arithmetic as .ci-cols above. Below this the bar and
   the health text go and the name gets the room, because a name you can read
   beats a bar you cannot compare. */
@media(max-width:860px){
  .ci-row{ grid-template-columns:52px minmax(0,1fr) minmax(38px,46px); }
  .ci-row-bar, .ci-row-health{ display:none; }
}

/* ── the side column ──────────────────────────────────────────────────── */
.ci-gaps{ display:flex; flex-direction:column; gap:8px; }
.ci-gap{ display:flex; gap:11px; align-items:flex-start; text-decoration:none;
  background:var(--surf); border:1px solid var(--border); border-left:3px solid var(--_g,#d97706);
  border-radius:6px; padding:10px 12px; }
a.ci-gap:hover{ border-color:var(--_g,#d97706); }
.ci-gap b{ font-size:19px; font-weight:800; color:var(--_g,#d97706); line-height:1.05;
  font-variant-numeric:tabular-nums; }
.ci-gap span{ font-size:11.5px; color:var(--ink3); line-height:1.45; }
.ci-gap i{ display:block; font-style:normal; font-size:12.5px; font-weight:700; color:var(--ink); }

.ci-projs{ display:flex; flex-direction:column; }
.ci-proj{ display:flex; align-items:baseline; gap:10px; padding:8px 2px; text-decoration:none;
  border-bottom:1px solid var(--border-s); }
.ci-proj:last-child{ border-bottom:0; }
.ci-proj-n{ font-size:12.5px; font-weight:700; color:var(--ink); }
.ci-proj-v{ margin-left:auto; font-size:11px; color:var(--ink3); font-variant-numeric:tabular-nums; }
.ci-proj.is-none .ci-proj-n{ color:var(--ink3); }
.ci-proj.is-none .ci-proj-v{ color:#c62828; }
.ci-proj:hover .ci-proj-n{ color:var(--c-blue); }

.ci-foot{ margin:18px 2px 0; font-size:11px; color:var(--ink4); }
.ci-foot.is-stale{ color:#a9781a; background:#fbeecb; border-radius:6px; padding:9px 12px;
  font-size:12px; font-weight:600; }
.ci-foot.is-stale b{ font-weight:800; }
