:root {
  --bg: #f6f7f9; --card: #fff; --fg: #16191f; --muted: #5f6b7a; --border: #d1d5db;
  --ok: #1d8102; --run: #0972d3; --fail: #d91515; --pend: #b35c00; --chip: #eef1f4;
  --tile: 172px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419; --card: #192028; --fg: #e6e9ed; --muted: #95a1ad; --border: #2f3a45;
    --ok: #4cc35a; --run: #539fe5; --fail: #ff6b6b; --pend: #f2a33a; --chip: #232c36;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 13px/1.4 system-ui, sans-serif; background: var(--bg); color: var(--fg); }
header { display: flex; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 1; }
h1 { font-size: 16px; margin: 0; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 4px; }
#summary { display: flex; gap: 8px; flex: 1; }
.toggle { color: var(--muted); }
main { padding: 12px 20px; }
.cards { display: flex; flex-direction: column; gap: 10px; }
footer { padding: 8px 20px 20px; color: var(--muted); }
button { font: inherit; cursor: pointer; }

.pipeline { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.stale { opacity: .55; }
.phead { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.phead a { color: var(--fg); font-weight: 600; font-size: 14px; text-decoration: none; }
.phead a:hover { text-decoration: underline; }
.sub { color: var(--muted); }
.right { margin-left: auto; color: var(--muted); }
.error { color: var(--fail); }
.mute { border: 1px solid var(--border); background: none; color: var(--muted); border-radius: 4px; padding: 0 6px; font-size: 11px; }
.mute:hover { color: var(--fg); }

/* Fixed-width tiles, left-aligned like the Pipelines UI; wide pipelines scroll sideways. */
.stages { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.stage { width: var(--tile); flex: none; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; border-top-width: 3px; }
.stage.build { width: 150px; }
.stage.ok { border-top-color: var(--ok); }
.stage.run { border-top-color: var(--run); }
.stage.fail { border-top-color: var(--fail); }
.stage.idle { border-top-color: var(--border); }
.sname { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.stitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.prod { font-size: 10px; padding: 0 4px; border-radius: 3px; background: var(--chip); color: var(--muted); font-weight: 400; }
.targets { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.target { display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; color: var(--muted); }
.target .tname { overflow: hidden; text-overflow: ellipsis; }
.okline { font-size: 12px; }
.pend-mark { color: var(--pend); font-size: 10px; }
.wf { margin-top: 4px; font-size: 12px; color: var(--run); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf.waiting { color: var(--pend); }

/* Quiet pipelines: one line each. */
.quiet { background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
.qrow { display: flex; gap: 12px; align-items: center; padding: 5px 12px; cursor: pointer; border-top: 1px solid var(--border); }
.qrow:first-child { border-top: none; }
.qrow:hover { background: var(--chip); }
.qname { width: 300px; flex: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qstages { display: flex; gap: 10px; color: var(--muted); font-size: 12px; overflow: hidden; white-space: nowrap; }
.qstage { display: inline-flex; gap: 4px; align-items: center; }
.muted-list { margin-top: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.muted-list .chip { border: none; color: var(--muted); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--border); }
.dot.SUCCEEDED { background: var(--ok); }
.dot.FAILED, .dot.CANCELLED, .dot.ROLLED_BACK, .dot.STOPPED { background: var(--fail); }
.dot.IN_PROGRESS { background: var(--run); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .dot.IN_PROGRESS { animation: none; } }

.chip { padding: 1px 7px; border-radius: 10px; background: var(--chip); font-size: 12px; white-space: nowrap; font-weight: 400; }
.chip.run { color: var(--run); }
.chip.pend { color: var(--pend); }
.chip.fail { color: var(--fail); }
.chip.ok { color: var(--ok); }
.banner { margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--fail); border-radius: 6px; color: var(--fail); background: var(--card); }
.deployed { font-size: 11px; color: var(--muted); }
.pin { font-size: 12px; }
.pipeline.pinned { border-left: 3px solid var(--run); }
.wf.timed { overflow: visible; white-space: normal; }
.wfline { display: flex; gap: 6px; }
.wfname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wfleft { margin-left: auto; flex: none; font-variant-numeric: tabular-nums; }
.bar { height: 3px; border-radius: 2px; background: var(--chip); margin-top: 2px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--run); }
.blocker { margin-top: 3px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blocker.hot { color: var(--pend); font-weight: 600; }
.inflight { margin-bottom: 10px; }
.ftitle { font-weight: 600; font-size: 14px; }
.author { display: flex; gap: 12px; padding: 5px 0; border-top: 1px solid var(--border); }
.author:first-of-type { border-top: none; }
.aname { width: 110px; flex: none; font-weight: 600; color: var(--fg); text-decoration: none; }
.aname:hover, .frow a:hover { text-decoration: underline; }
.arows { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.frow { display: flex; gap: 8px; align-items: center; white-space: nowrap; min-width: 0; }
.frow a { color: var(--run); text-decoration: none; flex: none; }
.ftext { overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 520px; }
.where { color: var(--muted); flex: none; }
/* Tiles in a row stretch to equal height; steps pin to the bottom so bake bars line up. */
.stage { display: flex; flex-direction: column; }
.steps { margin-top: auto; padding-top: 6px; }
/* Gates between stage tiles: plain spacing, or a marked blocker on the promotion path. */
.stages { gap: 0; }
.gate { width: 6px; flex: none; }
.gate.blocked {
  width: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); position: relative; cursor: help;
}
.gate.blocked::before {
  content: ""; position: absolute; top: 8px; bottom: 8px; left: 50%; border-left: 2px dashed var(--border);
}
.gate-icon, .gate-text { position: relative; background: var(--card); padding: 1px 0; font-size: 11px; line-height: 1.2; }
.gate-icon { font-size: 13px; }
.gate.hot { color: var(--pend); font-weight: 600; }
.gate.hot::before { border-left-color: var(--pend); }
