/* Status app-lag — bare Botnest semantiske tokens. Chrome er livlig (railen),
   innholdet rolig. */

html, body { height: 100%; }
.st-body { margin: 0; display: flex; min-height: 100dvh; background: var(--bn-bg); color: var(--bn-text); }

/* Rail + hovedflate */
.st-rail { flex: none; height: 100dvh; position: sticky; top: 0; align-self: flex-start; }
/* The body grows with the page, so the sticky rail has room to stay (Karl, 24 Sep: "I scrolled past the navigation rail"). */
.st-body { height: auto; }
.st-brand {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 14px;
  font: var(--bn-weight-heavy) 18px/1 var(--bn-font-ui); text-decoration: none;
  color: var(--bn-chrome-text);
}
.st-brand:hover { text-decoration: none; }
.st-rail-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.st-theme-group { width: 100%; }
.st-theme-group .bn-btn { flex: 1; }
.st-version { font-size: var(--bn-text-tiny); color: var(--bn-chrome-text-dim); padding: 4px 12px 0; }

.st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-topbar { position: sticky; top: 0; z-index: 30; }
.st-title { margin: 0; font: var(--bn-weight-bold) var(--bn-text-h3)/1.2 var(--bn-font-ui);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-topbar-right { margin-left: auto; color: var(--bn-text-3); font-size: var(--bn-text-small); }
.st-menu-btn { display: none; }
.st-content { flex: 1; padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 18px; max-width: 1400px; width: 100%; box-sizing: border-box; }

.st-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; flex: none; }
.st-ic--lg { width: 40px; height: 40px; }

/* Rutenett */
.st-grid { display: grid; gap: 16px; }
.st-grid--kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.st-grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.st-hint { color: var(--bn-text-3); font-size: var(--bn-text-small); margin-top: 6px; }

/* Sjekklister med tilstand: grønn = ok, gul = mangler, rød = feil. Bare der det er sant. */
.st-checklist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-checklist li { display: flex; align-items: center; gap: 10px; }
.st-checklist li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--bn-track); }
.st-checklist li.is-ok::before { background: var(--bn-success-fill); box-shadow: 0 0 6px rgba(76,203,151,0.45); }
.st-checklist li.is-warn::before { background: var(--bn-warning-fill, #E0AC47); }
.st-checklist li.is-bad::before { background: var(--bn-danger-fill); }
.st-phases { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Innlogging: .bn-auth er hele siden (to kolonner), brand-kolonnen har himmelscenen. */
.st-body--auth { margin: 0; background: var(--bn-bg); color: var(--bn-text); }
.st-brand--auth { padding: 0; font-size: 20px; }
.st-auth-title { margin: 0 0 4px; font: var(--bn-weight-bold) var(--bn-text-h3)/1.2 var(--bn-font-ui); }
.st-auth-hint { color: var(--bn-text-3); font-size: var(--bn-text-small); margin: 0; }
.st-auth-alt { margin-top: 16px; }
.st-totp-setup { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.st-qr svg { width: 196px; height: 196px; background: #fff; border-radius: var(--bn-radius-sm); padding: 6px; box-sizing: content-box; }
.st-secret { font-size: 13px; letter-spacing: 0.06em; word-break: break-all; text-align: center; padding: 8px 10px; background: var(--bn-surface-2); border-radius: var(--bn-radius-xs); }
.bn-auth-body { flex-direction: column; gap: 0; }

/* Under 840px: railen blir en skuff */
@media (max-width: 840px) {
  .st-rail { position: fixed; height: 100%; }
  .st-rail:not(.is-open) { transform: translateX(-102%); }
  .st-rail.bn-drawer { position: fixed; }
  .st-menu-btn { display: inline-flex; }
  .st-content { padding: 14px; }
}

/* ---- Fase 1: tabeller, kort, logger, grafer ---- */
.st-h2 { margin: 0; font: var(--bn-weight-bold) var(--bn-text-h4)/1.3 var(--bn-font-ui); }
.st-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.st-card--danger { border-color: var(--bn-danger-border); }
.st-kpi { text-decoration: none; color: inherit; display: block; }
.st-kpi:hover { text-decoration: none; }
.st-kpi-of { font: var(--bn-weight-medium) 15px/1 var(--bn-font-ui); color: var(--bn-text-3); margin-left: 3px; }
.st-kpi-sm { font-size: 20px; }
.st-text-danger { color: var(--bn-danger-text); }
.st-mt { margin-top: 12px; }
.st-grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.st-grid--services { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.st-svc { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.st-svc:hover { text-decoration: none; }
.st-svc--infra { opacity: 0.8; }
.st-svc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-svc-name { font-weight: var(--bn-weight-bold); }
.st-svc-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--bn-text-small); }
.st-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.st-alerts li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.st-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 6px 0 0; }
.st-kv dt { color: var(--bn-text-3); font-size: var(--bn-text-small); }
.st-kv dd { margin: 0; overflow-wrap: anywhere; }
.st-row--dim td { color: var(--bn-text-2); }
.st-trunc { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-details { margin-top: 10px; }
.st-details summary { cursor: pointer; color: var(--bn-link); font-size: var(--bn-text-small); }
.st-pre { font: 12px/1.45 var(--bn-font-mono, ui-monospace, Menlo, Consolas, monospace); background: var(--bn-surface-2);
  border-radius: var(--bn-radius-xs); padding: 10px 12px; overflow: auto; max-height: 360px; margin: 8px 0 0; white-space: pre-wrap; }
.st-spark { display: block; width: 100%; height: auto; max-width: 420px; }
.st-spark .bn-ch-line { stroke-width: 2; }
.bn-chart svg { width: 100%; }

/* Logger */
.st-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.st-filters .bn-field { min-width: 150px; }
.st-filter-q { flex: 1 1 320px; }
.bn-select { appearance: auto; }
.st-log { font: 12.5px/1.5 var(--bn-font-mono, ui-monospace, Menlo, Consolas, monospace); display: flex; flex-direction: column; gap: 1px; }
.st-log-line { display: grid; grid-template-columns: 82px 96px 1fr; gap: 10px; padding: 2px 6px; border-radius: 3px; border-left: 3px solid transparent; }
.st-log .st-log-line:not(:has(.st-log-src)) { grid-template-columns: 82px 1fr; }
.st-log-ts { color: var(--bn-text-3); white-space: nowrap; }
.st-log-src { color: var(--bn-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-log-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.st-log--error { border-left-color: var(--bn-danger-fill); background: var(--bn-danger-subtle); }
.st-log--warn { border-left-color: var(--bn-warning-fill); }
.st-log--noise { color: var(--bn-text-3); }

/* ---- Fase 2: AI ---- */
.st-inline-check { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }
.st-narrow { max-width: 130px; }
.st-form { display: flex; flex-direction: column; gap: 12px; }
.st-token { display: block; font-size: 14px; user-select: all; margin: 6px 0; }

/* ---- Fase 4: Tilgang ---- */
.st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.st-inline-form { display: flex; gap: 6px; align-items: center; }
.bn-input--sm { height: var(--bn-control-h-sm, 28px); font-size: 12.5px; min-width: 260px; }

/* ---- App-identitet på AI-sidene ---- */
.st-app-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 18px; }
.st-app-name { font: var(--bn-weight-heavy) 34px/1.1 var(--bn-font-ui); letter-spacing: -0.01em; margin: 2px 0 8px; }
.st-app-hero-kpis { display: flex; flex-wrap: wrap; gap: 28px; }
.bn-chip--accent a, a .bn-chip--accent { text-decoration: none; }

/* ---- Language ---- */
.st-lang { margin-left: 10px; }
.st-lang .bn-select { min-width: 120px; }
.st-lang--auth { margin-top: 18px; }
.bn-input--sm { height: var(--bn-control-h-sm, 28px); font-size: 12.5px; padding: 0 8px; }
.st-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-i18n td { vertical-align: top; }
.st-i18n-src { font-size: 13px; }
.st-i18n-val { width: 100%; min-width: 260px; }
.st-i18n--missing .st-i18n-src { color: var(--bn-danger-text); }

/* ---- Phase B: proposals and approvals ----
   Built for a phone first: this is the screen Karl answers on, often one-handed,
   so the tap targets are full width and stack, and nothing needs a sideways
   scroll to decide with. */
.st-card--warning { border-color: var(--bn-warning-border); }
.st-proposal { border-top: 1px solid var(--bn-border); padding: 14px 0 4px; }
.st-proposal:first-of-type { border-top: 0; }
.st-proposal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-proposal-title { font-weight: var(--bn-weight-bold); }
.st-proposal-summary { margin: 8px 0 0; overflow-wrap: anywhere; }
.st-proposal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.st-proposal-actions form { margin: 0; }
.st-btn-wide { min-width: 120px; justify-content: center; }
.st-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

@media (max-width: 560px) {
  /* One decision per thumb: full-width buttons, no hunting for a small target. */
  .st-proposal-actions { flex-direction: column; align-items: stretch; }
  .st-proposal-actions form,
  .st-proposal-actions .bn-btn { width: 100%; }
  .st-btn-wide { width: 100%; }
  .st-trunc { max-width: 100%; white-space: normal; }
}

@media (max-width: 560px) {
  /* A proposal title is a whole sentence. In the top bar it has to lose its tail
     rather than wrap to three lines and push its own beginning off the screen. */
  .st-title { font-size: var(--bn-text-h4); }
  .st-lang { margin-left: 8px; }
  .st-lang .bn-select { min-width: 92px; }
  .st-topbar-right { font-size: 11px; }
}

/* ---- Phase D: colonies, tiles, bots ----
   The colours are the same names the Nest will use for a bot's skin, so Status
   and the planet cannot disagree about what "moss" means. */
.st-colony { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.st-colony:hover { text-decoration: none; }
.st-colony-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-colony-name { font-weight: var(--bn-weight-bold); font-size: var(--bn-text-h4); }
.st-theme--terra { border-left: 3px solid #4a7c59; }
.st-theme--luna  { border-left: 3px solid #8a8f98; }
.st-theme--mars  { border-left: 3px solid #a4553a; }

.st-bot { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.st-bot:hover { text-decoration: none; }
.st-bot-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-bot-mark { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 auto;
  background: var(--st-bot-colour, #8a8f98); border: 2px solid var(--bn-surface-2); }
.st-bot-mark--lg { width: 26px; height: 26px; }
.st-bot-mark--drone  { border-radius: 4px; }
.st-bot-mark--rover  { border-radius: 4px 4px 9px 9px; }
.st-bot-mark--bird   { border-radius: 50% 50% 50% 8px; }
.st-bot--dawn  { --st-bot-colour: #e8a0a8; }
.st-bot--moss  { --st-bot-colour: #6f9367; }
.st-bot--rust  { --st-bot-colour: #b4643f; }
.st-bot--slate { --st-bot-colour: #6d7885; }
.st-bot--plum  { --st-bot-colour: #8a6b9e; }
.st-bot--sand  { --st-bot-colour: #d0b183; }
.st-bot--ice   { --st-bot-colour: #7fb3c8; }

/* A path is for pasting into a terminal, so make that one click. */
.st-copy { cursor: pointer; border-bottom: 1px dashed var(--bn-border); }
.st-copy:hover { color: var(--bn-link); }
.st-copy.is-copied::after { content: " ¹3"; color: var(--bn-success-text); }

/* The way out to the planet. Set apart from the pages below it, because it
   leaves Status rather than moving around inside it. */
.st-to-nest { margin-bottom: 6px; }
.st-to-nest::after {
  content: "97";              /* a small north-east arrow: this goes elsewhere */
  margin-left: auto;
  opacity: 0.5;
  font-size: 12px;
}

/* ── the task spine ─────────────────────────────────────────────────────────── */
.st-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.st-step--done { opacity: 0.7; }
.st-step--done > b { text-decoration: line-through; }
.st-step--skipped, .st-step--failed { opacity: 0.6; }
.st-step--doing > b { color: var(--bn-action); }
.st-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--bn-text-small); }
.st-timeline li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--bn-border-subtle); }
.st-timeline li:first-child { border-top: 0; }

/* The brake bar: on every page while the estate is not running, because a stop
   Karl cannot see is a stop he will forget he made (t-10). */
.st-brakebar {
  display: block;
  padding: 10px 16px;
  background: var(--bn-danger-fill, #E05A5A);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  position: sticky;
  top: 0;
  z-index: 31;
}
.st-brakebar:hover { filter: brightness(1.08); }

/* A stop within reach of every page, not only once something is already wrong. */
.st-brakelink {
  position: fixed; right: 14px; bottom: 14px; z-index: 32;
  padding: 8px 14px; border-radius: 999px;
  background: var(--bn-surface-2); border: 1px solid var(--bn-border);
  color: var(--bn-text-2); font-size: var(--bn-text-small); text-decoration: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.st-brakelink:hover { background: var(--bn-danger-fill, #E05A5A); color: #fff; border-color: transparent; }

/* The work of the day (t-13): one person's runs, each with its own words. Tokens only. */
.st-day-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-day-pick { display: flex; align-items: center; gap: 6px; margin: 0; }
.st-day-totals-row { display: flex; flex-wrap: wrap; gap: 6px; }
.st-day-totals { margin-left: auto; color: var(--bn-text-3); font-size: var(--bn-text-small); }
.st-day-person { border-top: 1px solid var(--bn-border-subtle); padding: 14px 0 6px; }
.st-day-person:first-of-type, .st-day-summary + .st-day-person { border-top: 0; }
.st-day-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-day-name { font-weight: var(--bn-weight-bold); }
.st-day-role { margin-top: 0; }
.st-bot-person { font-weight: var(--bn-weight-bold); }
.st-day-log { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.st-day-log > li { padding-left: 12px; border-left: 2px solid var(--st-bot-colour, var(--bn-border)); }
.st-day-log > li.st-day-silent { border-left-style: dashed; border-left-color: var(--bn-border); }
.st-day-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center;
  color: var(--bn-text-3); font-size: var(--bn-text-small); }
.st-day-text { margin: 4px 0 0; font-family: var(--bn-font-reading); font-size: var(--bn-text-reading);
  line-height: var(--bn-leading-reading); white-space: pre-line; overflow-wrap: anywhere; color: var(--bn-text); }
.st-day-summary { margin: 12px 0 4px; padding: 10px 14px; border-radius: var(--bn-radius-md);
  background: var(--bn-surface-2); border-left: 3px solid var(--bn-action); }
.st-day-summary .st-hint { margin-top: 0; }
@media (max-width: 560px) {
  .st-day-totals { margin-left: 0; flex-basis: 100%; }
  .st-day-log > li { padding-left: 10px; }
  .st-day-pick { flex-basis: 100%; }
  .st-day-pick .bn-input { flex: 1 1 auto; min-height: 44px; }
  .st-day-nav .bn-btn { min-height: 44px; }
}

/* t-76: the design system panel on Services. One row per app; on a phone the detail drops under.
   Kept above the t-22 mark: everything below it is copied into the Desk's process.css. */
.st-ds { margin: 16px 0; }
.st-ds-title { display: flex; align-items: center; gap: 8px; margin: 0; }
.st-ds-alert { margin: 8px 0; }
.st-ds-rows { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.st-ds-row { display: grid; grid-template-columns: minmax(120px, 180px) auto minmax(0, 1fr); align-items: center; gap: 6px 14px;
  min-height: 44px; padding: 6px 0; border-top: 1px solid var(--bn-border-subtle); }
.st-ds-row:first-child { border-top: 0; }
.st-ds-row .bn-chip { justify-self: start; }
.st-ds-detail { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .st-ds-row { grid-template-columns: minmax(0, 1fr) auto; }
  .st-ds-detail { grid-column: 1 / -1; }
}

/* ---- t-22: processes. The swimlane chart is drawn from the process file; tokens only. ---- */
.st-proc-list { display: flex; flex-direction: column; gap: 10px; }
.st-proc-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; border: 1px solid var(--bn-border-subtle); border-radius: var(--bn-radius-md); background: var(--bn-surface); color: var(--bn-text); text-decoration: none; }
.st-proc-item:hover { border-color: var(--bn-border-strong); }
.st-proc-item-name { font-weight: 700; }
.st-proc-item-meta { color: var(--bn-text-3); font-size: var(--bn-text-small); }
.st-proc-item-go { margin-left: auto; color: var(--bn-link); }
.st-proc-runs { display: flex; flex-wrap: wrap; gap: 6px; }
.st-proc-run { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--bn-border); border-radius: var(--bn-radius-pill); color: var(--bn-text); text-decoration: none; font-size: var(--bn-text-small); }
.st-proc-run[aria-current="true"] { border-color: var(--bn-action); background: var(--bn-action-subtle); }
.st-proc-dot { width: 8px; height: 8px; border-radius: var(--bn-radius-pill); background: var(--bn-text-3); }
.st-proc-dot--done { background: var(--bn-success-text); }
.st-proc-dot--running, .st-proc-dot--planned { background: var(--bn-info-text); }
.st-proc-dot--blocked { background: var(--bn-warning-text); }
.st-proc-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.st-proc-body--panel { grid-template-columns: minmax(0, 1fr) 360px; }
.st-proc-frame { overflow-x: auto; border: 1px solid var(--bn-border-subtle); border-radius: var(--bn-radius-md); background: var(--bn-surface); -webkit-overflow-scrolling: touch; }
.st-proc-svg { display: block; font-family: var(--bn-font-ui); }
.st-proc-svg text { fill: var(--bn-text); }
.st-proc-pool { fill: none; stroke: var(--bn-border); stroke-width: 1.4; }
.st-proc-you { fill: var(--bn-warning-subtle); opacity: 0.45; }
.st-proc-machine { fill: var(--bn-surface-2); opacity: 0.7; }
.st-pn--machine rect { fill: var(--bn-surface); stroke: var(--bn-text-3); }
.st-pn .st-pn-sub rect { fill: var(--bn-surface); stroke: var(--bn-text-3); stroke-width: 1.2; }
.st-pn-sub path { fill: none; stroke: var(--bn-text); stroke-width: 1.4; stroke-linecap: round; }
.st-proc-lane-line { stroke: var(--bn-border-subtle); stroke-width: 1; }
.st-proc-svg .st-proc-lane-name { font-size: 15px; font-weight: 700; }
.st-proc-svg .st-proc-lane-name--you { fill: var(--bn-warning-text); }
.st-proc-svg .st-proc-lane-role, .st-proc-svg .st-proc-label { fill: var(--bn-text-3); font-size: 12px; }
.st-proc-svg .st-proc-label--back, .st-proc-svg .st-proc-note { fill: var(--bn-warning-text); font-size: 12px; }
.st-pf { fill: none; stroke: var(--bn-link); stroke-width: 1.6; }
.st-pf--back { stroke: var(--bn-warning-text); }
.st-pm { fill: var(--bn-link); }
.st-pm--back { fill: var(--bn-warning-text); }
.st-pm-msg { fill: none; stroke: var(--bn-text-3); stroke-width: 1.4; }
.st-pmsg { fill: none; stroke: var(--bn-text-3); stroke-width: 1.3; stroke-dasharray: 6 4; }
.st-pmsg-dot { fill: var(--bn-surface); stroke: var(--bn-text-3); stroke-width: 1.2; }
.st-ps circle { fill: var(--bn-surface); stroke: var(--bn-success-text); stroke-width: 2; }
.st-ps .st-ps-in { fill: none; stroke-width: 1.2; }
.st-ps path { fill: none; stroke: var(--bn-success-text); stroke-width: 1.4; stroke-linecap: round; }
.st-ps--unwired circle, .st-ps--unwired path { stroke: var(--bn-warning-text); }
.st-ps--unwired > circle:first-child { stroke-dasharray: 4 3; }
.st-proc-svg .st-ps-label { fill: var(--bn-success-text); font-size: 12px; font-weight: 700; }
.st-proc-svg .st-ps-label--unwired { fill: var(--bn-warning-text); }
.st-pn rect { fill: var(--bn-surface-2); stroke: var(--bn-border-strong); stroke-width: 1.4; }
.st-proc-svg .st-pn-text { font-size: 13px; }
.st-pn--ceo rect { fill: var(--bn-warning-subtle); stroke: var(--bn-warning-border); stroke-width: 2; }
.st-pg { fill: var(--bn-surface-2); stroke: var(--bn-link); stroke-width: 1.6; }
.st-pg-mark { stroke: var(--bn-link); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.st-pe { fill: var(--bn-surface); stroke: var(--bn-text); stroke-width: 4; }
.st-pn--done rect { stroke: var(--bn-success-text); stroke-width: 2.4; }
.st-pn--rework rect { stroke: var(--bn-warning-text); stroke-width: 2.4; }
.st-pn--doing rect { stroke: var(--bn-info-text); stroke-width: 2.4; }
.st-pn--failed rect { stroke: var(--bn-danger-text); stroke-width: 2.4; }
.st-pn--todo, .st-pn--skipped, .st-pn--idle { opacity: 0.5; }
.st-pn--selected rect { stroke: var(--bn-action); stroke-width: 3.2; }
a.st-pn { cursor: pointer; }
a.st-pn:hover rect { fill: var(--bn-surface-3); }
a.st-pn:focus { outline: none; }
a.st-pn:focus-visible rect { stroke: var(--bn-focus-ring); stroke-width: 3.2; }
.st-proc-panel { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; }
.st-proc-panel-head { display: flex; align-items: center; gap: 10px; }
.st-proc-panel-head .bn-card-title { margin: 0; }
.st-proc-panel-close { margin-left: auto; }
.st-proc-words { margin: 0; font-family: var(--bn-font-reading); font-style: italic; line-height: 1.5; }
.st-proc-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: var(--bn-text-small); }
.st-proc-kv dt { color: var(--bn-text-3); }
.st-proc-kv dd { margin: 0; }
.st-proc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-proc-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-size: var(--bn-text-small); }
@media (max-width: 900px) {
  .st-proc-body--panel { grid-template-columns: minmax(0, 1fr); }
  .st-proc-panel { position: static; }
  .st-proc-run { min-height: 44px; }
}
/* The chart as a canvas (process-canvas.js): pan, pinch, zoom, full screen. Without
   JavaScript the frame scrolls at full size; the design system's max-width on svg would
   otherwise shrink the chart into a tall empty box. */
.st-proc-svg { max-width: none; }
.st-proc-frame.is-canvas { height: 62vh; min-height: 320px; max-height: 760px; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.st-proc-frame.is-canvas:active { cursor: grabbing; }
.st-proc-frame.is-canvas .st-proc-svg { width: 100%; height: 100%; }
.st-proc-frame.is-canvas.is-full { position: fixed; inset: 0; z-index: 80; height: auto; min-height: 0; max-height: none; border: 0; border-radius: 0; }
.st-proc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.st-proc-tools.is-full { position: fixed; top: 10px; left: 10px; right: 10px; z-index: 81; padding: 6px; border: 1px solid var(--bn-border); border-radius: var(--bn-radius-md); background: var(--bn-surface); box-shadow: var(--bn-shadow-2); }
.st-proc-zoom { min-width: 3.5em; text-align: center; font-size: var(--bn-text-small); color: var(--bn-text-3); }
html.st-proc-noscroll, html.st-proc-noscroll body { overflow: hidden; }
@media (max-width: 900px) {
  .st-proc-tools .bn-btn { min-height: 44px; min-width: 44px; }
}
.st-proc-frame.is-canvas { position: relative; }
.st-proc-pin { position: absolute; top: 0; left: 0; bottom: 0; width: 104px; pointer-events: none; opacity: 0; transition: opacity var(--bn-dur-1, 120ms) var(--bn-ease, ease); background: linear-gradient(90deg, var(--bn-surface) 78%, transparent); }
.st-proc-pin.is-on { opacity: 1; }
.st-proc-pin-lane { position: absolute; top: 0; left: 10px; display: flex; flex-direction: column; margin-top: -14px; line-height: 1.2; }
.st-proc-pin-lane b { font-size: 13px; }
.st-proc-pin-lane span { font-size: 11px; color: var(--bn-text-3); }
.st-proc-pin-lane--you b { color: var(--bn-warning-text); }
.st-proc-legend { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--bn-text-small); color: var(--bn-text-2); }
.st-proc-legend li { display: inline-flex; align-items: center; gap: 6px; }
.st-proc-legend svg { width: 26px; height: 26px; flex: 0 0 auto; overflow: visible; }
.st-proc-legend b { color: var(--bn-warning-text); }

/* ---- the colony's org chart (24 Sep 2026): who reports to whom, grouped by process ---- */
.st-org { display: flex; flex-direction: column; align-items: center; gap: 0; }
.st-org-over { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.st-org-over-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px;
  background: var(--bn-surface-2); border: 1px solid var(--bn-border); color: var(--bn-text); font-size: 14px; font-weight: 700; text-decoration: none; }
.st-org-over-pill span { color: var(--bn-text-3); font-weight: 400; }
.st-org-over-arrow { color: var(--bn-text-3); }
.st-org-stem { width: 2px; height: 22px; background: var(--bn-border-strong); }
.st-org-head { width: min(360px, 100%); }
.st-org-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: inherit;
  background: var(--bn-surface); border: 1px solid var(--bn-border); }
.st-org-card:hover { border-color: var(--bn-border-strong); background: var(--bn-surface-2); text-decoration: none; }
.st-org-card--lead { border: 2px solid var(--bn-border-strong); }
.st-org-card--off .st-org-who b, .st-org-card--off .st-org-does { color: var(--bn-text-2); }
.st-org-top { display: flex; align-items: center; gap: 10px; }
.st-org-who { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.2; }
.st-org-who b { font-size: 16px; }
.st-org-who span { font-size: 13px; color: var(--bn-text-3); }
.st-org-does { font-size: 13px; color: var(--bn-text-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.st-org-meta { font-size: 12px; color: var(--bn-text-3); }
.st-org-groups { list-style: none; margin: 0; padding: 22px 0 0; width: 100%; display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; position: relative; border-top: 2px solid var(--bn-border-strong); }
.st-org-group--wide { grid-column: span 2; }
.st-org-group--wide > .st-org-members { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-org-group { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px;
  background: var(--bn-surface-2); border: 1px solid var(--bn-border-subtle); }
.st-org-group::before { content: ""; position: absolute; top: -24px; left: 50%; width: 2px; height: 22px; background: var(--bn-border-strong); }
.st-org-group-name { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--bn-text-3); }
.st-org-group-name a { color: inherit; }
.st-org-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; position: relative; }
.st-org-members > li { position: relative; }
.st-org-members--sub { margin: 8px 0 0 18px; padding-left: 12px; border-left: 2px solid var(--bn-border); }
.st-org-also { font-size: 13px; color: var(--bn-text-3); }
/* t-33: machines and helpers stand beside the staff, not under the head */
.st-org-side { width: 100%; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--bn-border-strong); }
.st-org-group--side::before { display: none; }
.st-org-card--machine { border-style: dashed; background: var(--bn-surface-2); }

/* t-33: the Software Factory's page: the line as stations, the changes, the numbers */
.st-fx-stations { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.st-fx-station { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px;
  background: var(--bn-surface); border: 1px solid var(--bn-border); min-width: 0; }
.st-fx-station--karl { border-color: var(--bn-warning-border, var(--bn-border-strong)); background: var(--bn-surface-2); }
.st-fx-station b { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.st-fx-station span { font-size: 12px; color: var(--bn-text-3); }
.st-fx-station .bn-chip { align-self: flex-start; }
.st-fx-score .bn-kpi-value { font-size: 22px; }
.st-fx-none { color: var(--bn-text-3); font-weight: 400; }

@media (max-width: 700px) {
  .st-org-groups { border-top: 0; padding-top: 0; }
  .st-org-group::before { display: none; }
  .st-org-group--wide { grid-column: auto; }
  .st-org-group--wide > .st-org-members { grid-template-columns: minmax(0, 1fr); }
}

/* ---- t-29: a run's log, in the order it happened ---- */
.st-runlog td { vertical-align: top; }
.st-runlog-words { font-family: var(--bn-font-reading); font-size: 14px; line-height: 1.45; color: var(--bn-text-2); max-width: 60ch; }
.st-runlog--failed td { color: var(--bn-danger-text); }

/* ---- 24 Sep: the workers' faces, where their coloured mark used to be ---- */
.st-bot-face { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--bn-surface-2); border: 2px solid var(--bn-border); }
.st-bot-face--xl { width: 72px; height: 72px; }
.st-face-img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---- t-30: what a run did, on the chart, as n8n marks an execution ---- */
.st-pf--run { stroke: var(--bn-success-text); stroke-width: 2.6; }
.st-pf--back.st-pf--run { stroke: var(--bn-warning-text); stroke-width: 2.6; }
.st-pm--run { fill: var(--bn-success-text); }
.st-pbadge-bg { fill: var(--bn-surface); stroke-width: 2; }
.st-pbadge path { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.st-pbadge--done .st-pbadge-bg { stroke: var(--bn-success-text); } .st-pbadge--done path { stroke: var(--bn-success-text); }
.st-pbadge--rework .st-pbadge-bg { stroke: var(--bn-warning-text); fill: var(--bn-warning-subtle); }
.st-proc-svg .st-pbadge-n { fill: var(--bn-warning-text); font-size: 10px; font-weight: 800; }
.st-pbadge--failed .st-pbadge-bg { stroke: var(--bn-danger-text); } .st-pbadge--failed path { stroke: var(--bn-danger-text); }
.st-pbadge--doing .st-pbadge-bg { stroke: var(--bn-info-text); } .st-pbadge--doing circle:not(.st-pbadge-bg) { fill: var(--bn-info-text); }
/* the executions, beside the chart */
.st-exec--list { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.st-exec-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.st-exec-list { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 2px; padding: 12px; }
.st-exec-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-left: 3px solid var(--bn-border); border-radius: 0 var(--bn-radius-sm) var(--bn-radius-sm) 0; color: var(--bn-text); text-decoration: none; }
.st-exec-item:hover { background: var(--bn-surface-2); text-decoration: none; }
.st-exec-item.is-current { background: var(--bn-selected, var(--bn-surface-2)); }
.st-exec-item--success { border-left-color: var(--bn-success-text); }
.st-exec-item--danger { border-left-color: var(--bn-danger-text); }
.st-exec-item--info { border-left-color: var(--bn-info-text); }
.st-exec-item--warning { border-left-color: var(--bn-warning-text); }
.st-exec-when { font-weight: 700; font-size: 14px; }
.st-exec-state { font-size: 13px; }
.st-exec-state--success { color: var(--bn-success-text); } .st-exec-state--danger { color: var(--bn-danger-text); }
.st-exec-state--info { color: var(--bn-info-text); } .st-exec-state--warning { color: var(--bn-warning-text); }
.st-exec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.st-exec-head .bn-card-title { margin: 0; }
@media (max-width: 900px) { .st-exec--list { grid-template-columns: minmax(0, 1fr); } .st-exec-list { position: static; max-height: 320px; } }
