/* The Bring-Up Dashboard's stylesheet (phase 7): docs/mockup.html's CSS, with
   the IBM Plex fonts served by the app (static/fonts/, SIL OFL) instead of
   Google Fonts, and styles for the forms, alerts and top bar the mockup only
   sketched. No inline <style> or <script> anywhere (the CSP refuses them). */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-sans-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* Layout: an ops console. A slim top bar, then one working column. Summary first, detail on drill-down. */
:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --sunk: #EBEEF3;
  --ink: #16202E;
  --muted: #5A6577;
  --line: #DCE1E8;
  --accent: #2652B8;
  --accent-soft: #E3EAF8;
  --ok: #17694A;   --ok-soft: #DDF1E7;  /* mockup #1D7F55; darker for 4.5:1 (WCAG AA) */
  --warn: #7F520C; --warn-soft: #FBEFD6;  /* mockup #9A6410 */
  --bad: #B83A33;  --bad-soft: #F8E1DF;
  --todo: #5B6575; --todo-soft: #E9ECF0;  /* mockup #7D8796 */
  --f-display: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E131A; --surface: #151C26; --sunk: #1B2430; --ink: #E5E9EF; --muted: #96A1B1; --line: #263142;
    --accent: #7FA3F4; --accent-soft: #1D2A44;
    --ok: #4FC48C; --ok-soft: #15301F; --warn: #E3B24F; --warn-soft: #33280F;
    --bad: #F0776D; --bad-soft: #3A1A18; --todo: #8892A1; --todo-soft: #222B37;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E131A; --surface: #151C26; --sunk: #1B2430; --ink: #E5E9EF; --muted: #96A1B1; --line: #263142;
  --accent: #7FA3F4; --accent-soft: #1D2A44;
  --ok: #4FC48C; --ok-soft: #15301F; --warn: #E3B24F; --warn-soft: #33280F;
  --bad: #F0776D; --bad-soft: #3A1A18; --todo: #8892A1; --todo-soft: #222B37;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: 0.005em; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.num { font-size: 13px; }
td.num { white-space: nowrap; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }

.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-family: var(--f-display); font-weight: 600; font-size: 16px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 18px; height: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.brand-mark i { background: var(--accent); border-radius: 1px; }
.brand-mark i:nth-child(3n) { opacity: .45; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--muted); flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs span.sep { opacity: .5; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; display: grid; gap: 24px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-head .aside { margin-left: auto; font-size: 12px; color: var(--muted); }
.panel-body { padding: 16px 18px; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 9px 2px 8px; border-radius: 99px; white-space: nowrap; line-height: 1.6; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-done    { color: var(--ok);   background: var(--ok-soft); }
.s-progress{ color: var(--accent); background: var(--accent-soft); }
.s-blocked { color: var(--warn); background: var(--warn-soft); }
.s-failed  { color: var(--bad);  background: var(--bad-soft); }
.s-todo    { color: var(--todo); background: var(--todo-soft); }
.s-na      { color: var(--todo); background: transparent; border: 1px dashed var(--line); }
.s-planned { color: var(--todo); background: var(--todo-soft); }

/* Health: outlined so it reads differently from status pills */
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 1px 9px 1px 7px; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap; line-height: 1.6; }
.health::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.h-ok { color: var(--ok); background: var(--ok-soft); }
.h-warn { color: var(--warn); background: var(--warn-soft); }
.h-bad { color: var(--bad); background: var(--bad-soft); }
.h-complete { color: var(--todo); background: transparent; }
.health-reasons { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13px; }
.health-reasons li { display: flex; gap: 8px; align-items: baseline; }
.health-reasons li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--muted)); transform: translateY(-1px); }
.sched { position: relative; height: 8px; border-radius: 4px; background: var(--sunk); margin: 6px 0 4px; }
.sched i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.sched b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }

.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--sunk); white-space: nowrap; }
.team { font-size: 12px; color: var(--muted); white-space: nowrap; }
.team b { color: var(--ink); font-weight: 500; }

/* Landing */
.stats { display: flex; gap: 32px; flex-wrap: wrap; }
.stat .v { font-family: var(--f-display); font-size: 30px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .k { margin-top: 4px; }
.page-head { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--sunk); }
.group-row td { background: var(--sunk); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 500; padding: 6px 14px; }
.cluster-name { font-weight: 600; }
.sub { font-size: 12px; color: var(--muted); }

.bar { position: relative; height: 6px; background: var(--todo-soft); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--ok); border-radius: 3px; }
.bar > i.p { background: var(--accent); }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar { flex: 1; }

/* Timeline */
.timeline { padding: 14px 18px 18px; overflow: auto; max-height: 560px; }
.tl { position: relative; min-width: 960px; }
.tl-axis { position: sticky; top: 0; z-index: 1; background: var(--surface); display: grid; grid-template-columns: 260px repeat(8, 1fr); font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); padding-block: 2px 6px; margin-bottom: 6px; }
.tl-row { display: grid; grid-template-columns: 260px 1fr; align-items: center; height: 22px; cursor: pointer; }
.tl-row:hover { background: var(--sunk); }
.tl-row .nm { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.tl-track { position: relative; height: 100%; }
.tl-bar { position: absolute; top: 6px; height: 10px; border-radius: 3px; min-width: 4px; }
.tbd { font-size: 10px; font-weight: 600; letter-spacing: .05em; color: var(--warn); background: var(--warn-soft); padding: 0 5px; border-radius: 3px; margin-right: 6px; vertical-align: 1px; }
.source { font-size: 12px; color: var(--muted); }
.tl-bar.done { background: var(--ok); opacity: .55; }
.tl-bar.progress { background: var(--accent); }
.tl-bar.planned { background: transparent; border: 1.5px dashed var(--todo); }
.tl-today { position: absolute; top: -4px; bottom: 0; width: 0; border-left: 1.5px solid var(--bad); }
.tl-today span { position: absolute; top: -16px; left: -16px; font-size: 10px; color: var(--bad); }

/* Bring-up dashboard */
.hero { display: grid; gap: 14px; }
.hero-top { display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.fact { padding: 12px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.fact .v { font-family: var(--f-mono); font-size: 16px; font-weight: 500; margin-top: 2px; font-variant-numeric: tabular-nums; }
.fact .d { font-size: 12px; color: var(--muted); }

.cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 24px; }

.phase-row td:first-child { width: 40px; color: var(--muted); font-family: var(--f-mono); font-size: 12px; }
.gate { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; margin-left: 6px; white-space: nowrap; }

.attn { list-style: none; margin: 0; padding: 0; }
.attn li { display: grid; grid-template-columns: 4px 1fr; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.attn li:last-child { border-bottom: 0; }
.attn li:hover { background: var(--sunk); }
.attn .stripe { border-radius: 2px; }
.attn .t { font-weight: 500; }
.attn .m { font-size: 12px; color: var(--muted); }

.handoff { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.handoff .arrow { color: var(--muted); }
.gate-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.gate-list li { display: flex; gap: 8px; align-items: center; }
.tick { width: 16px; height: 16px; border-radius: 3px; display: inline-grid; place-items: center; font-size: 11px; flex: none; }
.tick.y { background: var(--ok-soft); color: var(--ok); }
.tick.n { background: var(--todo-soft); color: var(--todo); }

.drift { color: var(--bad); font-weight: 500; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 13px; display: grid; gap: 2px; }
.activity li:last-child { border-bottom: 0; }
.who { font-size: 12px; color: var(--muted); }
.agent { font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 0 6px; border-radius: 3px; margin-left: 4px; }

/* Phase view */
.step-group td { background: var(--sunk); font-weight: 500; font-size: 13px; padding: 7px 14px; }
.step-title { font-weight: 500; }
.ev { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ev.req { color: var(--warn); }

/* Step view */
.step-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .step-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.bench { width: 100%; border: 1px solid var(--line); border-radius: var(--r); }
.bench th, .bench td { padding: 9px 12px; }
.bench .min { font-family: var(--f-mono); font-weight: 500; }
input.measured { font: inherit; font-family: var(--f-mono); width: 110px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); }
.cmp-ok { color: var(--ok); font-weight: 500; font-size: 12px; }
.cmp-bad { color: var(--bad); font-weight: 500; font-size: 12px; }
textarea { font: inherit; font-family: var(--f-mono); font-size: 12px; width: 100%; min-height: 200px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sunk); color: var(--ink); resize: vertical; line-height: 1.45; }
.files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.files li { display: flex; gap: 10px; align-items: center; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px; }
.files li .sz { margin-left: auto; color: var(--muted); font-size: 12px; }
.drop { margin-top: 10px; border: 1.5px dashed var(--line); border-radius: var(--r); padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { font: inherit; font-weight: 500; font-size: 13px; padding: 7px 14px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn.primary { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.hint { font-size: 12px; color: var(--muted); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.history li:last-child { border-bottom: 0; }
.history .when { font-family: var(--f-mono); font-size: 12px; color: var(--muted); min-width: 92px; }
.placeholder-note { font-size: 12px; color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 8px 16px; border-radius: 6px; font-size: 13px; }
@media (prefers-reduced-motion: no-preference) { .toast { transition: opacity .2s; } }

/* ---------- Added for the app (not in the mockup) ---------- */
body { margin: 0; }
.who-am-i { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.who-am-i form { margin: 0; }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.row-link { color: var(--ink); }
.row-link:hover { text-decoration: underline; }
.attn a { display: contents; color: inherit; }
.filters a { font-size: 13px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.filters a[aria-current="page"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.tl-row a.nm { color: var(--ink); }
.alert { margin: 0; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--bad); background: var(--bad-soft); color: var(--ink); font-size: 13px; }
.form-grid { display: grid; gap: 10px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea, input.text, select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); min-width: 0; }
.field textarea { min-height: 70px; font-family: var(--f-mono); font-size: 12px; }
.field input[type="file"] { padding: 4px; }
.stack-sm { display: grid; gap: 12px; }
.ev-item { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ev-item:last-child { border-bottom: 0; }
.ev-item pre { flex-basis: 100%; margin: 4px 0 0; padding: 8px 10px; background: var(--sunk); border-radius: 4px; font-family: var(--f-mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; }
.ev-item form { margin: 0 0 0 auto; }
.details-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.override-note { margin-top: 10px; font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main > * { min-width: 0; }
.hero h1 { overflow-wrap: anywhere; }
.tl-body { position: relative; }
.tl-today-track { position: absolute; inset: 0 0 0 260px; pointer-events: none; z-index: 2; }
.health-reasons li.c-ok { --c: var(--ok); }
.health-reasons li.c-warn { --c: var(--warn); }
.health-reasons li.c-bad { --c: var(--bad); }
.attn li { display: block; padding: 0; }
.attn li > a { display: grid; grid-template-columns: 4px 1fr; gap: 12px; padding: 12px 18px; color: inherit; }
.attn li > a:hover { text-decoration: none; background: var(--sunk); }
.attn .attn-text { display: grid; }
.stripe-bad { background: var(--bad); }
.stripe-warn { background: var(--warn); }
/* Grid items default to min-width: auto, so a wide table would widen the page
   instead of scrolling inside its panel; one column below 900 px stays the
   window's width. */
.stack > *, .cols > *, .step-grid > * { min-width: 0; }
@media (max-width: 900px) { .cols, .step-grid { grid-template-columns: minmax(0, 1fr); } }
.table-wrap { position: relative; }  /* keeps .visually-hidden cells inside the scrolling table */

/* Phase 13: manage pages */
.token-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.token-line code { padding: 6px 10px; background: var(--sunk); border: 1px solid var(--line); border-radius: 4px; overflow-wrap: anywhere; min-width: 0; }
.example h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.example pre { margin: 0; padding: 8px 10px; background: var(--sunk); border-radius: 4px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.token-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.token-actions form { margin: 0; }
.scopes { border: 0; margin: 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.scopes legend { padding: 0; margin-bottom: 4px; }
.item-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.item-row form { margin: 0; }
.people-filter { margin-left: auto; }

/* Phase 13: navigation and admin pages */
.mainnav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.mainnav a { color: var(--ink); }
.admin-page { display: grid; gap: 16px; min-width: 0; }
.admin-page form:not(.inline) { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; max-width: 100%; }
.admin-page form.inline { display: inline-block; margin: 0 6px 6px 0; }
.admin-page fieldset { min-width: 0; max-width: 100%; }
.admin-page label input:not([type=checkbox]), .admin-page label select { max-width: 100%; }
.admin-page code { overflow-wrap: anywhere; }
/* On wide screens the top bar stays one line: the breadcrumb's last item is
   cut short rather than pushing the person's name onto a second line. */
@media (min-width: 901px) {
  .crumbs { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; white-space: nowrap; }
  .crumbs > :last-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}

/* ENG-95786: the template editor. A rail of phases, the chosen phase's steps
   as compact rows, and the chosen step's panel. */
.editor-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; justify-content: space-between; }
.editor-title h1 { margin: 0; }
.editor-title p { margin: 4px 0 0; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.editor button { font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.editor button.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 500; }
.editor .muted, .editor .hint { color: var(--muted); font-size: 13px; }
.editor .hint { margin: 0; flex-basis: 100%; }
.editor .label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.editor .alert { background: var(--bad-soft); color: var(--bad); padding: 8px 12px; border-radius: 5px; margin: 0; }
.editor .mono { font-family: var(--f-mono); font-size: 12.5px; }
.editor summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.editor details[open] > summary { margin-bottom: 8px; }
.editor-settings { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-start; }
.editor-settings details[open] { flex-basis: 100%; }
.editor form.stack { display: grid; gap: 8px; align-items: start; }
.editor form.stack label { display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.editor form.stack label.check { display: flex; gap: 6px; align-items: center; color: var(--ink); }
.editor form.stack input:not([type=checkbox]), .editor form.stack select, .editor form.stack textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; }
.editor form.stack textarea { min-height: 56px; resize: vertical; }
.editor form.stack fieldset { border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px 10px; }
.editor form.stack fieldset legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.editor .row2, .editor .row3 { display: grid; gap: 8px 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor .row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.editor-grid { display: grid; gap: 16px; grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
.editor-grid.with-panel { grid-template-columns: 250px minmax(0, 1fr) minmax(0, 400px); }
.editor-rail, .editor-main, .editor-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 6px); min-width: 0; }
.editor-rail { position: sticky; top: 8px; padding: 4px; }
.editor-rail ol { list-style: none; margin: 0; padding: 0; }
.editor-rail a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 7px 8px; border-radius: 4px; color: var(--ink); text-decoration: none; }
.editor-rail a:hover { background: var(--sunk); }
.editor-rail a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.editor-rail .n { font-family: var(--f-mono); font-size: 12px; color: var(--muted); text-align: right; }
.editor-rail .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-rail .count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.editor .gate { font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--warn); background: var(--warn-soft); border-radius: 3px; padding: 2px 4px; }
.editor .rail-add { padding: 8px; border-top: 1px solid var(--line); }

.editor .phase-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.editor .phase-head h2 { margin: 0; }
.editor .phase-head p { margin: 0; }
.editor .step-rows { list-style: none; margin: 0; padding: 0; }
.editor .step-rows > li { display: grid; grid-template-columns: 14px 26px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.editor .step-rows > li[aria-current] { background: var(--accent-soft); }
.editor .step-rows > li.empty { display: block; color: var(--muted); }
.editor .step-rows > li.dragging { opacity: .4; }
.editor .step-rows > li.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.editor .step-rows > li.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.editor .step-rows .grip { color: var(--muted); cursor: grab; user-select: none; }
.editor .step-rows .pos { font-family: var(--f-mono); font-size: 12px; color: var(--muted); text-align: right; }
.editor .step-rows .step-link { min-width: 0; color: var(--ink); text-decoration: none; }
.editor .step-rows .step-link:hover .step-title { text-decoration: underline; }
.editor .step-rows .step-title, .editor .step-rows .step-key { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor .step-rows .step-key { color: var(--muted); font-size: 12px; }
.editor .step-rows .chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.editor .chip-req { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.editor .chip-prov { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.editor .step-rows .tally { font-size: 12px; color: var(--muted); white-space: nowrap; }
.editor .row-menu { position: relative; }
.editor .row-menu summary { list-style: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; }
.editor .row-menu summary::-webkit-details-marker { display: none; }
.editor .row-menu .menu { position: absolute; right: 0; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 6px 20px rgb(0 0 0 / .14); padding: 4px; display: grid; min-width: 160px; }
.editor .row-menu .menu form { margin: 0; }
.editor .row-menu .menu button { width: 100%; text-align: left; border: 0; background: none; }
.editor .row-menu .menu button:hover { background: var(--sunk); }
.editor .add-step { padding: 10px 14px; }

.editor-panel { position: sticky; top: 8px; }
.editor .panel-head { display: flex; gap: 8px; align-items: start; padding: 12px 14px 0; }
.editor .panel-head h3 { margin: 0; flex: 1; min-width: 0; }
.editor .panel-head h3 code { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.editor .panel-head .close { color: var(--muted); font-size: 20px; text-decoration: none; line-height: 1; }
.editor .tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); }
.editor .tabs a { padding: 6px 10px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 13px; }
.editor .tabs a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.editor .panel-body { padding: 14px; display: grid; gap: 12px; min-width: 0; }
.editor .deps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.editor .deps li { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.editor .minimum { border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
.editor .minimum p { margin: 0 0 6px; }
.editor .facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13px; }
.editor .facts dt { color: var(--muted); }
.editor .facts dd { margin: 0; }
.editor .placeholder-help { border: 1px solid var(--line); border-radius: 4px; background: var(--sunk); padding: 8px 10px; display: grid; gap: 6px; font-size: 13px; }
.editor .placeholder-help table { border-collapse: collapse; }
.editor .placeholder-help td { padding: 2px 8px 2px 0; vertical-align: top; }
.editor .placeholder-help .ins { font-family: var(--f-mono); font-size: 12px; padding: 1px 6px; }
.editor .preview { font-size: 13px; color: var(--muted); }
.editor .empty { padding: 20px 14px; color: var(--muted); }

@media (max-width: 1100px) {
  .editor-grid.with-panel { grid-template-columns: 220px minmax(0, 1fr); }
  .editor-grid.with-panel .editor-panel { grid-column: 1 / -1; position: static; }
}
@media (max-width: 760px) {
  .editor-grid, .editor-grid.with-panel { grid-template-columns: minmax(0, 1fr); }
  .editor-rail { position: static; }
  .editor-rail ol { display: flex; overflow-x: auto; gap: 4px; }
  .editor-rail a { grid-template-columns: auto auto auto; white-space: nowrap; }
  .editor .step-rows > li { grid-template-columns: 14px 22px minmax(0, 1fr) auto; }
  .editor .step-rows .chips { grid-column: 3 / -1; grid-row: 2; justify-content: flex-start; }
  .editor .row2, .editor .row3 { grid-template-columns: minmax(0, 1fr); }
}

/* ENG-95835: an admin's target version form in the Firmware and drivers panel. */
.target-form { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin: 0; }
.target-form input { width: 9em; font: inherit; font-family: var(--f-mono); font-size: 12.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }
.target-form .btn { padding: 4px 10px; }

/* The login page (auth/login.html) */
.signin { max-width: 420px; margin: 48px auto; }
.signin h1 { margin-top: 0; }
.signin .btn { display: inline-block; text-decoration: none; margin-top: 8px; }
.signin-note { color: var(--muted); }
