/* PCX Studio — calm, dense operator dashboard.
   Rule of the palette: colour means status (ok / error / running / never) and nothing else.
   Everything else is ink on paper. System fonts only (CSP forbids external fonts). */
:root {
  --bg: #eef0f3; --surface: #ffffff; --surface-2: #f4f5f7; --surface-3: #e9ebef;
  --border: #dadee4; --border-strong: #bfc5ce; --text: #161a22; --text-2: #3b4250; --muted: #6b7384; --faint: #9aa2b0;
  --ink: #1f2430; --ink-hover: #30374a; --on-ink: #ffffff; --link: #2f4f9e; --focus: #4f6fc4;
  --ok: #1f8a4c; --ok-soft: #e3f3e9; --ok-line: #9ed3b4;
  --err: #c43c3c; --err-soft: #fbe7e7; --err-line: #efb0b0;
  --warn: #b06f12; --warn-soft: #fcf0da; --warn-line: #eccc8a;
  --mute: #a0a7b3; --mute-soft: #eceef1; --mute-line: #d2d6dd;
  --r-card: 10px; --r-ctl: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c; --surface: #1a1f27; --surface-2: #20262f; --surface-3: #262d37;
    --border: #2c333e; --border-strong: #3d4654; --text: #e4e7ec; --text-2: #c3c9d3; --muted: #8f98a8; --faint: #6a7383;
    --ink: #e8ebf0; --ink-hover: #ffffff; --on-ink: #161a22; --link: #8fb0f5; --focus: #6f8fde;
    --ok: #4cc281; --ok-soft: #16311f; --ok-line: #2a5c3d;
    --err: #ef6e6e; --err-soft: #3b1d1d; --err-line: #6a3030;
    --warn: #e2aa4e; --warn-soft: #352b15; --warn-line: #6a5424;
    --mute: #6f7a8a; --mute-soft: #252c37; --mute-line: #3a4350;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13.5px/1.45 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 22px; line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -.015em; }
h2 { font-size: 14px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 13px; margin: 20px 0 8px; font-weight: 600; color: var(--text-2); }
h3 .muted { font-weight: 400; }
p { margin: 0 0 10px; }
code, .mono, pre { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 0 5px; border-radius: 4px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.lead { color: var(--muted); margin: -6px 0 18px; max-width: 72ch; }
.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.spacer { flex: 1; }
.plain { list-style: none; padding: 0; margin: 0; } .plain li { padding: 2px 0; }
.stack { display: flex; flex-direction: column; gap: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 22px; padding: 0 22px; height: 52px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; color: var(--text); letter-spacing: -.01em; font-size: 14px; }
.brand:hover { text-decoration: none; }
.mark { width: 18px; height: 18px; display: block; color: var(--ink); }
.nav { display: flex; gap: 2px; align-self: stretch; }
.nav a { display: inline-flex; align-items: center; color: var(--muted); padding: 0 10px; position: relative; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); }
.nav a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px 2px 0 0; }
.health { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.health .dot { width: 8px; height: 8px; }
.health.ok .dot { animation: pulse 2.4s ease-in-out infinite; }
.health.err { color: var(--err); font-weight: 600; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 60% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) { .health.ok .dot { animation: none; } }
.who { color: var(--text); font-weight: 500; }
.user-menu { display: inline-flex; align-items: center; gap: 14px; }

.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 22px 48px; flex: 1; }
.page-narrow { max-width: 400px; padding-top: 11vh; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-head .title h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: 12.5px; }
.head-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.crumbs { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { margin: 0 6px; color: var(--faint); }
.footer { text-align: center; color: var(--faint); font-size: 12px; padding: 18px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 20px; margin-bottom: 16px; }
.grid .card { margin-bottom: 0; }
.card-narrow { max-width: 440px; }
.card-err { border-color: var(--err-line); }
.card-err h2 { color: var(--err); }
.card-flush { padding: 0; overflow: hidden; }
.card-flush h2 { padding: 14px 20px 0; margin-bottom: 10px; }
.card-flush .card-foot { padding: 12px 20px; border-top: 1px solid var(--border); }
.section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.empty { text-align: center; padding: 48px 20px; }
.empty p { margin: 0 0 4px; }

/* Login */
.login { padding: 28px 28px 26px; }
.login .brand { margin-bottom: 18px; font-size: 15px; }
.login .mark { width: 22px; height: 22px; }
.login h1 { font-size: 19px; margin-bottom: 4px; }
.login .lead { margin: 0 0 18px; }

/* Flash */
.flash { padding: 10px 14px; border-radius: var(--r-ctl); margin-bottom: 16px; border: 1px solid transparent; }
.flash-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.flash-err { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }
.flash-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }

/* Forms: every control is styled; nothing is left to the browser */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; }
.form-grid .field-submit { justify-content: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.field-inline > span { color: var(--muted); }
.field-error { color: var(--err); margin: 0; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.input, .select {
  appearance: none; -webkit-appearance: none; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-ctl); padding: 7px 10px; min-height: 36px; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--faint); }
.input:hover, .select:hover { border-color: var(--muted); }
.input:focus, .select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.input.invalid { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 20%, transparent); }
.input-sm { min-height: 30px; padding: 4px 8px; width: 170px; }
textarea.input { resize: vertical; line-height: 1.45; min-height: 96px; }
.select {
  width: auto; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23808898' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select-sm { min-height: 30px; padding: 3px 28px 3px 9px; font-size: 13px; }
.field .select { width: 100%; }
.input[readonly] { background: var(--surface-2); color: var(--text-2); cursor: text; }
.copy-row { display: flex; gap: 8px; margin: 0 0 8px; }
.copy-row .input { min-width: 0; }

.btn {
  appearance: none; -webkit-appearance: none; font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: background .12s, border-color .12s, color .12s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); border-color: var(--border-strong); }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn-danger { color: var(--err); border-color: var(--err-line); background: transparent; }
.btn-danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); border-color: transparent; }
.btn-block { width: 100%; }
.btn-primary.btn-block { min-height: 40px; }

/* Toggle switch (a submit button) */
.switch { appearance: none; -webkit-appearance: none; border: 0; padding: 0; width: 36px; height: 20px; border-radius: 999px; background: var(--mute); position: relative; cursor: pointer; transition: background .15s; flex: none; vertical-align: middle; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.switch.on { background: var(--ok); }
.switch.on .knob { transform: translateX(16px); }
.switch-label { font-size: 12.5px; color: var(--muted); }

/* Status */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mute); flex: none; vertical-align: middle; }
.dot-ok { background: var(--ok); } .dot-err { background: var(--err); } .dot-warn { background: var(--warn); } .dot-mute { background: var(--mute); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--mute-soft); color: var(--muted); vertical-align: middle; line-height: 1.5; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: var(--ok); } .pill-err { background: var(--err-soft); color: var(--err); } .pill-warn { background: var(--warn-soft); color: var(--warn); }
h1 .pill { font-size: 12.5px; padding: 2px 10px 2px 8px; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; font-weight: 500; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); line-height: 1.5; vertical-align: middle; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 600; }
.badge-info { background: var(--mute-soft); color: var(--text-2); border-color: transparent; font-weight: 600; }
.reason { color: var(--err); }

/* 7-day outcome rail: ok share in green, failures in red, empty rail when nothing ran */
.rate { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.rate svg { width: 56px; height: 6px; flex: none; }
.rate .rail { fill: var(--err); }
.rate .rail-empty { fill: var(--mute-line); }
.rate .fill { fill: var(--ok); }
.rate .pct { min-width: 34px; text-align: right; }
.rate .n { color: var(--faint); font-size: 12px; }

/* Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow-x: auto; }
.card .table-wrap, .card-flush .table-wrap { border: 0; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table .col-dot { width: 30px; padding-right: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.table .cell-actions { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; }
.table th.num { text-align: right; }
.table .time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .shrink { width: 1%; white-space: nowrap; }
.job-name { font-weight: 600; color: var(--text); }
.job-desc { color: var(--muted); font-size: 12.5px; max-width: 46ch; }
.job-sched .words { white-space: nowrap; }
.when { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.when .rel { color: var(--muted); font-size: 12px; }
tr.is-off td > *:not(.reason), tr.is-disabled td > *:not(.reason) { opacity: .55; }
tr.is-off td .reason, tr.is-disabled td .reason { opacity: 1; }
tr.is-off td:hover, tr.is-disabled td:hover { opacity: 1; }
.users .email { color: var(--muted); font-size: 12.5px; }

/* Key/value */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 20px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Run meta strip */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; margin: 0; }
.meta div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.meta dt { color: var(--muted); font-size: 12.5px; } .meta dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Run output + log */
.code { margin: 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-ctl); overflow: auto; max-height: 360px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.card-err .code { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }
.log { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 6px 0; max-height: 560px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.log-line { display: flex; gap: 12px; padding: 2px 14px; }
.log-line .ts { color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }
.log-line .lvl { flex: none; width: 46px; font-weight: 600; font-size: 11.5px; padding-top: 1px; }
.log-line .msg { white-space: pre-wrap; word-break: break-word; min-width: 0; }
.log-debug .lvl { color: var(--faint); } .log-debug .msg { color: var(--muted); }
.log-info .lvl { color: var(--text-2); } .log-warn .lvl { color: var(--warn); } .log-error .lvl { color: var(--err); }
.log-error { background: var(--err-soft); } .log-warn { background: var(--warn-soft); }
.log > p { padding: 4px 14px; margin: 0; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); font-weight: 500; font-size: 12.5px; }
.live .dot { background: var(--warn); animation: pulse-warn 1.6s ease-in-out infinite; }
@keyframes pulse-warn { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live .dot { animation: none; } }

/* Phones and narrow panes */
@media (max-width: 760px) {
  .topbar { height: auto; padding: 8px 14px; gap: 10px 14px; flex-wrap: wrap; }
  .topbar .spacer { display: none; }
  .nav { order: 3; width: 100%; gap: 0; border-top: 1px solid var(--border); margin: 0 -14px -8px; padding: 0 6px; }
  .nav a { padding: 10px 8px; }
  .nav a.active::after { bottom: 0; left: 8px; right: 8px; }
  .user-menu { margin-left: auto; }
  .health { order: 4; width: 100%; padding: 8px 0 2px; border-top: 1px solid var(--border); margin-top: 8px; }
  .page { padding: 18px 14px 36px; }
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .page-narrow { padding-top: 6vh; }
  .card { padding: 16px; }
  .card-flush h2 { padding: 14px 16px 0; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Tables become stacked cards */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px 12px; border-bottom: 1px solid var(--border); position: relative; }
  .table tbody tr:hover td { background: transparent; }
  .table td, .table td:first-child, .table td:last-child { border: 0; padding: 2px 0; text-align: left; }
  .table td.num { text-align: left; }
  .table:not(.runs) td[data-label]:not([data-label=""])::before { content: attr(data-label); color: var(--muted); font-size: 12px; display: inline-block; min-width: 72px; }
  .table .col-dot { position: absolute; right: 16px; top: 15px; width: auto; }
  .table .actions { text-align: left; padding-top: 10px; display: flex; gap: 10px; align-items: center; }
  .table .actions .inline { margin: 0; }
  .table .cell-actions { justify-content: flex-start; }
  .table td.job-cell { padding-right: 24px; padding-bottom: 6px; }
  .job-desc { max-width: none; }
  .when { display: inline-flex; flex-direction: row; gap: 8px; align-items: baseline; vertical-align: baseline; }
  .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 8px; }
  .input-sm { width: 100%; }
  .form-row .input-sm { flex: 1; width: auto; }
  .page-head .select { max-width: 60vw; }
  /* Run lists: two compact lines per run instead of six labelled ones.
     Line 1: #id, status, trigger, by.  Line 2: started, duration. */
  .table.runs tr { padding: 9px 16px; display: grid; grid-template-columns: max-content max-content 1fr max-content; gap: 3px 10px; align-items: center; }
  .table.runs td { display: block; width: auto; padding: 0; }
  .table.runs td[data-label="Trigger"] { color: var(--muted); }
  .table.runs td[data-label="By"] { grid-row: 1; grid-column: 4; color: var(--muted); font-size: 12.5px; text-align: right; }
  .table.runs td[data-label="By"]:not(:empty)::before { content: "by "; }
  .table.runs td[data-label="Started"] { grid-row: 2; grid-column: 1 / 4; color: var(--muted); font-size: 12.5px; }
  .table.runs td[data-label="Started"]::before { content: "Started "; }
  .table.runs td[data-label="Duration"] { grid-row: 2; grid-column: 4; color: var(--muted); font-size: 12.5px; text-align: right; }
  .table.runs td[data-label="Duration"]::before { content: "took "; }
  /* Log lines stack: time + level above, message below at full width */
  .log { font-size: 12px; }
  .log-line { flex-wrap: wrap; gap: 0 10px; padding: 5px 12px; }
  .log-line .lvl { width: auto; }
  .log-line .msg { flex-basis: 100%; }
  .card-flush { padding: 0; }
}

/* Run steps: a calm pipeline list. Each row is a button that opens that step's log lines. */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); }
.steps[hidden], .log[hidden] { display: none; }
.step + .step { border-top: 1px solid var(--border); }
.step-head {
  appearance: none; -webkit-appearance: none; font: inherit; color: var(--text); background: transparent; border: 0; margin: 0; width: 100%; text-align: left;
  display: grid; grid-template-columns: 20px minmax(0, max-content) minmax(0, 1fr) max-content 16px; align-items: center; gap: 0 12px;
  padding: 9px 14px; min-height: 40px;
}
div.step-head { grid-template-columns: 20px minmax(0, max-content) minmax(0, 1fr) max-content; cursor: default; }
button.step-head { cursor: pointer; transition: background .12s; }
button.step-head:hover { background: var(--surface-2); }
button.step-head:focus-visible { outline-offset: -2px; }
.step-ico { display: inline-flex; width: 16px; height: 16px; color: var(--mute); }
.step-ok .step-ico { color: var(--ok); }
.step-error .step-ico { color: var(--err); }
.step-running .step-ico { color: var(--warn); }
.step-skipped .step-ico, .step-notreached .step-ico, .step-general .step-ico { color: var(--mute); }
.step-name { font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.step-error .step-name { color: var(--err); }
.step-skipped .step-name, .step-notreached .step-name { color: var(--muted); font-weight: 500; }
.step-detail { color: var(--muted); font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.step-dur { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
/* Plain-English line tucked under the step name: quiet, one line, full text in the title attribute */
.step-desc { grid-column: 2 / -1; grid-row: 2; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.step-notreached .step-desc, .step-skipped .step-desc { color: var(--faint); }
/* Job page plan: the same list a run shows, before anything has run. A numbered ring sits where the tick will be. */
.plan { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); }
.plan-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; align-items: start; padding: 10px 14px; }
.plan-item + .plan-item { border-top: 1px solid var(--border); }
.plan-num { grid-row: 1 / span 2; box-sizing: border-box; width: 16px; height: 16px; margin: 2px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1.5px solid var(--border-strong); color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.plan-name { font-weight: 550; overflow-wrap: anywhere; }
.plan-desc { grid-column: 2; color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.step-chev { display: inline-flex; color: var(--faint); }
.chev { transition: transform .15s; }
.step-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
.step-body { padding: 4px 14px 14px 46px; }
.step-body[hidden] { display: none; }
.step-body .code.step-error { margin-bottom: 8px; max-height: 220px; background: var(--err-soft); border-color: var(--err-line); color: var(--err); }
.log-inline { max-height: 320px; }
/* Steps / All logs: a two-segment switch, the pressed segment is the view you are looking at */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); }
.seg .btn { border: 0; border-radius: 0; min-height: 28px; padding: 0 11px; font-size: 12.5px; background: transparent; color: var(--muted); }
.seg .btn + .btn { border-left: 1px solid var(--border-strong); }
.seg .btn:hover { background: var(--surface-2); color: var(--text); }
.seg .btn[aria-pressed="true"] { background: var(--surface-3); color: var(--text); font-weight: 600; }
.seg .btn:focus-visible { outline-offset: -2px; }
.steps-summary { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } .chev { transition: none; } }

/* System page */
.sys-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.syslog { padding: 8px 0; max-height: 520px; }
.sys-where { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin: -4px 0 8px; }
.sys-where code { color: var(--text-2); background: none; border: 0; padding: 0; overflow-wrap: anywhere; }
.sys-line { padding: 1px 14px; white-space: pre-wrap; word-break: break-word; }
.sys-err { color: var(--err); background: var(--err-soft); }
.sys-warn { color: var(--warn); background: var(--warn-soft); }

@media (max-width: 760px) {
  .step-head, div.step-head { grid-template-columns: 20px minmax(0, 1fr) max-content 16px; gap: 4px 10px; padding: 10px 12px; }
  div.step-head { grid-template-columns: 20px minmax(0, 1fr) max-content; }
  .step-detail { grid-column: 2 / 3; grid-row: 2; }
  .step-desc { grid-row: 3; margin-top: 0; }
  .step-dur { grid-column: 3; grid-row: 1; }
  .step-chev { grid-column: 4; grid-row: 1; }
  .step-body { padding: 2px 12px 12px; }
  .log-inline { max-height: 60vh; }
}
