/* ka-release dashboard. One small stylesheet, no build step. */
:root {
  --bg: #F4F6F8; --surface: #FFFFFF; --ink: #14171C; --muted: #565E6B; --line: #DCE1E8; --line-soft: #EEF1F5;
  --accent: #1F4FD1; --accent-bg: #E8EEFC; --accent-line: #B9C9F3;
  --ok: #17653F; --ok-bg: #E3F4EA; --ok-line: #A7D9BB;
  --wait: #8A4B00; --wait-bg: #FFF1DC; --wait-line: #F3C98B;
  --bad: #A3221A; --bad-bg: #FDE8E6; --bad-line: #EDB3AD;
  --off: #5B6270; --off-line: #B5BDC9;
  --log-bg: #12151B; --log-ink: #D7DCE3;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1217; --surface: #171B22; --ink: #E6E9EE; --muted: #A3ABB8; --line: #2A303A; --line-soft: #222832;
    --accent: #8FB0FF; --accent-bg: #1C2742; --accent-line: #34487A;
    --ok: #7FD6A4; --ok-bg: #14301F; --ok-line: #2D5A3F;
    --wait: #F6C477; --wait-bg: #36280F; --wait-line: #6B4F1E;
    --bad: #FF9C93; --bad-bg: #3A1715; --bad-line: #6E2D28;
    --off: #A3ABB8; --off-line: #4A5260;
    --log-bg: #0A0C10; --log-ink: #D7DCE3;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/22px var(--font); }
a { color: var(--accent); }
h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 600; }
h2 { margin: 0; font-size: 19px; line-height: 26px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; line-height: 18px; } .strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 13px; } .nowrap { white-space: nowrap; } .grow { flex: 1 1 24px; }
.warn { color: var(--wait); }
.good { color: var(--ok); } .bad { color: var(--bad); }
.notes { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--line-soft); font-family: var(--mono); font-size: 13px; line-height: 19px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; }

.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.nav { flex: 1 1 220px; max-width: 100%; padding: 24px 16px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.brand { display: flex; flex-direction: column; padding: 0 12px 20px; } .brand-name { font-size: 18px; font-weight: 600; }
.nav-foot { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-top: 1px solid var(--line); }
.nav .nav-foot .button-primary { color: var(--surface); justify-content: center; min-height: 40px; margin: 4px 0; }
/* Beside the page, the sidebar stays in view, so signing in and out is always at hand */
@media (min-width: 900px) {
  .nav { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; margin-right: 6px; } .dot-ok { background: #1E8A55; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 700px) { .main { padding: 20px 16px 40px; } }

.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.scroll { overflow-x: auto; }
.row, .row-link { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.row-link { color: var(--ink); text-decoration: none; min-height: 44px; } .row-link:hover { background: var(--line-soft); }
.button { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.badge-plain { background: var(--line-soft); color: var(--muted); }
.badge-created, .badge-running, .badge-publishing { background: var(--accent-bg); color: var(--accent); }
.badge-awaiting-approval { background: var(--wait-bg); color: var(--wait); }
.badge-succeeded { background: var(--ok-bg); color: var(--ok); }
.badge-failed { background: var(--bad-bg); color: var(--bad); }
.badge-canceled { background: var(--line-soft); color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.tile-warn { background: var(--wait-bg); border-color: var(--wait-line); }
.tile-kicker { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.tile-big { font-size: 18px; font-weight: 600; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }

.board { min-width: 1000px; display: flex; flex-direction: column; }
.board-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 170px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.board-product, .board-run { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.board-cells { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.cell { display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; line-height: 16px; }
.cell-label { font-weight: 600; } .cell-note { color: var(--muted); }
.cell-done { background: var(--ok-bg); border-color: var(--ok-line); } .cell-done .cell-label { color: var(--ok); }
.cell-partial, .cell-running { background: var(--accent-bg); border-color: var(--accent-line); } .cell-partial .cell-label, .cell-running .cell-label { color: var(--accent); }
.cell-waiting { background: var(--wait-bg); border-color: var(--wait-line); } .cell-waiting .cell-label { color: var(--wait); }
.cell-failed { background: var(--bad-bg); border-color: var(--bad-line); } .cell-failed .cell-label { color: var(--bad); }
.cell-absent { background: transparent; border-style: dashed; border-color: var(--off-line); } .cell-absent .cell-label { color: var(--off); }

.flow { min-width: 1150px; display: flex; align-items: center; gap: 8px; }
.flow-col { flex: none; width: 168px; display: flex; flex-direction: column; gap: 8px; }
.flow-lanes { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.lane { display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 10px; background: var(--line-soft); }
.lane-name { flex: none; width: 70px; font-size: 13px; font-weight: 600; }
.lane .step { flex: 1 1 0; min-width: 0; }
.chev { color: var(--off-line); font-size: 22px; line-height: 1; } .chev.small { font-size: 16px; }
.step { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 54px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
a.step:hover { outline: 2px solid var(--accent-line); }
.step-label { font-size: 13px; font-weight: 600; } .step-note { font-size: 12px; line-height: 16px; color: var(--muted); }
.step-done { background: var(--ok-bg); border-color: var(--ok-line); } .step-done .step-label { color: var(--ok); }
/* Running stands out at a glance: a solid border, a pulsing ring and a blinking dot; queued is plain until its turn. */
.step-running { background: var(--accent-bg); border-color: var(--accent); animation: step-pulse 1.6s ease-in-out infinite; }
.step-running .step-label { color: var(--accent); }
.step-running .step-label::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; animation: step-dot 1.6s ease-in-out infinite; }
@keyframes step-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-line); } 50% { box-shadow: 0 0 0 4px var(--accent-line); } }
@keyframes step-dot { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .step-running, .step-running .step-label::before { animation: none; } }
.step-queued { background: var(--surface); border-color: var(--line); } .step-queued .step-label { color: var(--muted); }
.lane:has(.step-running) .lane-name { color: var(--accent); }
.step-waiting { background: var(--wait-bg); border-color: var(--wait-line); } .step-waiting .step-label { color: var(--wait); }
.step-failed { background: var(--bad-bg); border-color: var(--bad-line); } .step-failed .step-label { color: var(--bad); }
.step-canceled { background: var(--line-soft); }
.step-absent { background: transparent; border-style: dashed; border-color: var(--off-line); } .step-absent .step-label { color: var(--off); }
.step-na { background: transparent; border-color: transparent; } .step-na .step-label { color: var(--muted); font-weight: 400; }

.grid-progress { min-width: 900px; display: grid; grid-template-columns: 90px repeat(6, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.grid-progress > span { display: flex; align-items: center; }
.shared { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .shared .step { min-width: 180px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; }
.tab-on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); font-weight: 600; }
/* column-reverse keeps the newest lines in view without any script */
.log { display: flex; flex-direction: column-reverse; max-height: 520px; overflow: auto; padding: 14px 16px; border-radius: 10px; background: var(--log-bg); color: var(--log-ink); font: 12.5px/19px var(--mono); }
.log-lines > div { white-space: pre; }

.h3 { margin: 4px 0 4px; font-size: 15px; font-weight: 600; }
.machines { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.machine { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); }
/* A stripe, not a fill: the bars' tracks are the fill colours */
.machine-busy { border-color: var(--accent-line); box-shadow: inset 4px 0 0 var(--accent); }
.machine-outside { border-color: var(--wait-line); box-shadow: inset 4px 0 0 var(--wait); }
.machine-problem { border-color: var(--wait-line); }
.install { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.install:first-of-type { border-top: 0; }
.findings { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.machine-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px; }
.machine-name { display: flex; align-items: flex-start; gap: 8px; } .machine-name > span { display: flex; flex-direction: column; }
.machine-name .icon { margin-top: 1px; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.eta { color: var(--accent); font-weight: 600; }
.working { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.last-line { display: block; padding: 6px 8px; border-radius: 6px; background: var(--log-bg); color: var(--log-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event { padding: 6px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.kv { display: inline-block; margin-right: 14px; }
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; overflow-wrap: anywhere; }

/* Icons: one sprite in base.html, drawn in the text colour */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex: none; width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 20px; height: 20px; }
.state-ok, .state-passed { color: var(--ok); } .state-here, .state-running { color: var(--accent); }
.state-wait, .state-warnings { color: var(--wait); } .state-bad, .state-failed { color: var(--bad); } .state-off { color: var(--off); }
.note { display: flex; align-items: flex-start; gap: 6px; } .note .icon { margin-top: 1px; }

/* Chips: a state in an icon and words; the words stay in ink */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px 1px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12.5px; line-height: 20px; text-decoration: none; white-space: nowrap; }
a.chip:hover { border-color: var(--accent-line); }
.chip-ok { background: var(--ok-bg); border-color: var(--ok-line); } .chip-ok .icon { color: var(--ok); }
.chip-here { background: var(--accent-bg); border-color: var(--accent-line); } .chip-here .icon { color: var(--accent); }
.chip-wait { background: var(--wait-bg); border-color: var(--wait-line); } .chip-wait .icon { color: var(--wait); }
.chip-bad { background: var(--bad-bg); border-color: var(--bad-line); } .chip-bad .icon { color: var(--bad); }
.chip-off { color: var(--muted); } .chip-off .icon { color: var(--off); }

/* Bars: the fill on a lighter track of its own colour */
.gauges { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; gap: 6px 10px; align-items: center; font-size: 12.5px; line-height: 18px; }
.gauge-label { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.gauge-value { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--accent-bg); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.bar-low { background: var(--wait-bg); } .bar-low > span { background: var(--wait); }
.spark { display: flex; flex-direction: column; gap: 2px; }
.spark svg { display: block; width: 100%; height: 32px; }
.spark-area { fill: var(--accent-bg); stroke: none; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* The In progress tile's jobs, and the Signing devices tile */
.segments { display: flex; gap: 2px; height: 10px; margin-top: 6px; }
.segment { min-width: 4px; border-radius: 4px; }
.segment-done { background: var(--ok); } .segment-running { background: var(--accent); }
.segment-failed { background: var(--bad); } .segment-todo { background: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.device { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.device:first-of-type { border-top: 0; padding-top: 4px; }
.device-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--line-soft); color: var(--muted); flex: none; }
.device-ok .device-icon { background: var(--ok-bg); color: var(--ok); }
.device-here .device-icon { background: var(--accent-bg); color: var(--accent); }
.device-wait .device-icon { background: var(--wait-bg); color: var(--wait); }
.device-bad .device-icon { background: var(--bad-bg); color: var(--bad); }
.device-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }

/* Controls (signed in) */
.inline { display: inline-flex; margin: 0; }
.button:hover { border-color: var(--accent-line); }
.button:focus-visible, .link-button:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button-primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.button-primary:hover { border-color: var(--ink); }
.button-danger { color: var(--bad); border-color: var(--bad-line); }
.button-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.button-small { min-height: 36px; padding: 0 12px; font-size: 13px; display: inline-flex; align-items: center; text-decoration: none; align-self: flex-start; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.ink { color: var(--ink); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.machine-actions { padding-top: 8px; border-top: 1px solid var(--line-soft); }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field input[type="text"], .field select { min-height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; max-width: 100%; }
.field textarea { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; width: 100%; }
.links { margin-top: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
/* A long list to tick from (the store's products): it scrolls in its own box. */
.picklist { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; margin-top: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.picklist .check { min-height: 30px; }
details.field > summary { cursor: pointer; padding: 6px 0; }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 10px; border: 1px solid; }
.flash p { margin: 0; } .flash > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.flash .icon { margin-top: 3px; flex: none; }
.flash-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.flash-bad { background: var(--bad-bg); border-color: var(--bad-line); }

/* Phone widths: after the rules they change */
@media (max-width: 700px) {
  .card { padding: 16px; }
  .row, .row-link { grid-template-columns: auto minmax(0, 1fr) auto; }
}

/* the sign-in screen */
.signin-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; box-sizing: border-box; }
.signin-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px 30px 26px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 34px rgba(0,0,0,.07); box-sizing: border-box; }
.signin-card h1 { font-size: 22px; line-height: 28px; margin: 0; }
.signin-card p { margin: 0; }
.signin-card .muted { margin-top: 2px; }
.signin-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent); color: var(--surface);
  font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.signin-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; width: 100%; font-weight: 600; }
