/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef0f3; --border: #dde1e6;
  --text: #1e232e; --text-2: #5b6472; --text-3: #8a93a1;
  --brand: #2b3140; --brand-fg: #ffffff; --accent: #c5d92d; --accent-fg: #1e232e;
  /* #6f8300 on --surface (#ffffff): 4.27:1 — same ~69° hue as --accent, darkened for the ~1.6:1
     --accent itself gives here (see the sparkline contrast fix in the task-7 report). Dark theme
     keeps --accent (already high-contrast against its own dark --surface). */
  --chart-line: #6f8300;
  --danger: #b42318; --danger-bg: #fee4e2;
  --radius: 8px; --radius-sm: 6px; --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 240px;
  --st-passed-bg: #d7f5df;      --st-passed-fg: #137333;
  --st-failed-bg: #fde2e1;      --st-failed-fg: #b42318;
  --st-running-bg: #fff3c4;     --st-running-fg: #8a6300;
  --st-queued-bg: #f1edd8;      --st-queued-fg: #7a6a2a;
  --st-cancelled-bg: #e8eaee;   --st-cancelled-fg: #4b5563;
  --st-error-bg: #f5dcdc;       --st-error-fg: #8a2020;
  --st-skipped-bg: #e8eaee;     --st-skipped-fg: #4b5563;
  --st-interrupted-bg: #e8eaee; --st-interrupted-fg: #4b5563;
  --st-timedOut-bg: #ffe8cc;    --st-timedOut-fg: #9a4b00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171d; --surface: #1c2027; --surface-2: #242932; --border: #2e3440;
    --text: #e6e9ee; --text-2: #9aa3b2; --text-3: #6f7a8a;
    --brand: #e6e9ee; --brand-fg: #14171d; --accent: #c5d92d; --accent-fg: #14171d;
    --chart-line: var(--accent);
    --danger: #f97066; --danger-bg: #3a1a18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --st-passed-bg: #143d25;      --st-passed-fg: #7ddc9a;
    --st-failed-bg: #4a1d1a;      --st-failed-fg: #f9a8a1;
    --st-running-bg: #453a0f;     --st-running-fg: #f5d868;
    --st-queued-bg: #3a3521;      --st-queued-fg: #d9c98a;
    --st-cancelled-bg: #2a2f38;   --st-cancelled-fg: #b0b8c4;
    --st-error-bg: #451d1d;       --st-error-fg: #f2a3a3;
    --st-skipped-bg: #2a2f38;     --st-skipped-fg: #b0b8c4;
    --st-interrupted-bg: #2a2f38; --st-interrupted-fg: #b0b8c4;
    --st-timedOut-bg: #4a2f10;    --st-timedOut-fg: #f7c07a;
  }
  /* Task-7 visual QA fix: the CFlow wordmark (public/img/cflow-logo.png) is drawn in a dark
     navy that reads fine on the light card/sidebar it was designed for, but disappears against
     this theme's own dark --surface — both on the login card and the sidebar's full-width brand
     lockup (the narrow-viewport icon-only mark is unaffected: its lime badge supplies its own
     contrast regardless of theme). A light backdrop behind the mark, dark-theme only, keeps the
     asset unchanged. */
  .login-logo, .brand-full {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.05rem; } h3 { font-size: 0.95rem; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
.muted { color: var(--text-2); } .small { font-size: 0.85rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
body.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.content { min-width: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--border); }
.brand { display: flex; flex-direction: column; gap: 4px; text-decoration: none; padding: 0 8px; }
.brand-full { display: block; height: auto; max-width: 100%; }
.brand-icon { display: none; }
.brand-sub { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 13px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-2); font-weight: 500; border-left: 3px solid transparent; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); border-left-color: var(--accent); }
.now-running { margin: 0 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.now-running-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 600; }
.now-running-link { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.now-running-meta { font-size: 0.85rem; color: var(--text-2); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.sidebar-settings { margin: 0; }
.sidebar-user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; }
.sidebar-user { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  /* Deviation from the brief: body.shell keeps `min-height: 100vh` from the base rule, and CSS
     Grid's default row-stretch (align-content: normal -> stretch) distributes that leftover
     vertical space across BOTH auto rows once the layout collapses to a single column here —
     inflating the topbar row itself, not just the content row below it, to a fraction of the
     viewport height. align-content: start keeps rows sized to their own content instead. */
  body.shell { grid-template-columns: 1fr; align-content: start; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { flex-direction: row; align-items: center; margin-right: 8px; }
  .brand-full, .brand-sub { display: none; } .brand-icon { display: block; }
  .nav { flex-direction: row; gap: 4px; }
  .nav-item { border-left: 0; border-bottom: 3px solid transparent; padding: 6px 10px; }
  .nav-item.active { border-bottom-color: var(--accent); }
  .nav-item svg { display: none; }
  .now-running { display: none; }
  .sidebar-foot { margin-top: 0; margin-left: auto; flex-direction: row; align-items: center; gap: 8px; }
  /* Fix round 1 / Important 3: the generic .nav-item svg { display: none; } above (meant for the
     main nav, which keeps its text labels at this width) also matched .sidebar-settings, and
     combined with hiding its <span> label too, left an empty ~20px anchor with no visible content
     and no accessible name. This link has no label at this width (unlike the main nav items), so
     its icon has to stay — it's the only content — and the anchor gets an explicit accessible
     name via aria-label/title in the template instead of relying on the (now hidden) <span> text. */
  .sidebar-settings svg { display: block; }
  .sidebar-settings span { display: none; }
  .sidebar-user-row { padding: 0; }
  .container { padding: 16px; }
}

/* ---------- login ---------- */
body.bare { display: grid; place-items: center; min-height: 100vh; }
.bare-main { width: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-logo { max-width: 100%; height: auto; }
.login-sub { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin-bottom: 8px; }
.login-card form { width: 100%; }
.form-error { width: 100%; margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger); font-size: 0.9rem; }
.form-ok { color: var(--st-passed-fg); }

/* ---------- page header ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-action { display: flex; gap: 8px; align-items: center; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .card + .stats, .stats + .card { margin-top: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-body { padding: 18px; }
.card-error { border-color: var(--danger); }
.card-error .card-header { color: var(--danger); border-bottom-color: var(--danger-bg); }
.card-error pre { margin: 0; padding: 14px 18px; white-space: pre-wrap; font-family: var(--mono); font-size: 0.85rem; color: var(--text); }

/* ---------- stats & ring ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-value { font-size: 1.7rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-2); font-size: 0.85rem; margin-top: 2px; }
.stat-passed .stat-value { color: var(--st-passed-fg); }
.stat-failed .stat-value { color: var(--st-failed-fg); }
/* A3: a Failed tile reading "0" looks alarming in the failed tile's red-ish colour before any
   scenario has actually failed -- a neutral zero reads calmer while staying just as truthful. */
.stat-failed .stat-value.is-zero { color: var(--text-2); }
.stat-link .stat-value.is-zero { color: var(--text-2); }
.stat-skipped .stat-value { color: var(--st-skipped-fg); }
.stat-flaky { grid-column: span 2; }
.stat-flaky .stat-value { font-size: 1rem; line-height: 1.3; }
.ring { position: relative; width: 72px; height: 72px; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.ring-value { fill: none; stroke: var(--st-passed-fg); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
/* Fix round 1 (task-7): the label is a <span data-ring="label"> element PLUS a bare "%" text
   node (views/partials/ring.eta) — with `display: grid`, that's two grid items, and with no
   explicit columns they land on two separate implicit rows ("100" then "%" below it). Flex
   lays both out on one line by default; do not touch the data-ring="label" hook sse.js writes
   to. */
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.stat-with-ring { display: flex; align-items: center; gap: 14px; }

/* ---------- status pills ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; text-transform: capitalize; line-height: 1.5; white-space: nowrap; background: var(--st-cancelled-bg); color: var(--st-cancelled-fg); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.status-passed { background: var(--st-passed-bg); color: var(--st-passed-fg); }
.status-failed { background: var(--st-failed-bg); color: var(--st-failed-fg); }
.status-running { background: var(--st-running-bg); color: var(--st-running-fg); }
.status-queued { background: var(--st-queued-bg); color: var(--st-queued-fg); }
.status-cancelled { background: var(--st-cancelled-bg); color: var(--st-cancelled-fg); }
.status-error { background: var(--st-error-bg); color: var(--st-error-fg); }
.status-skipped { background: var(--st-skipped-bg); color: var(--st-skipped-fg); }
.status-interrupted { background: var(--st-interrupted-bg); color: var(--st-interrupted-fg); }
.status-timedOut { background: var(--st-timedOut-bg); color: var(--st-timedOut-fg); }
.status-running::before, .status-queued::before { animation: pulse 1.4s ease-in-out infinite; }
/* .static: a status pill reusing a live-status palette (e.g. the Orgs page's jwt/cli-session
   auth-type pill borrowing .status-queued's colors) for a value that never actually changes —
   the pulse exists to signal "in progress," which is meaningless here. Two classes beats the
   single-class .status-queued::before selector above regardless of source order, so this
   always wins without needing !important. */
.status.static::before { animation: none; }
/* Fix round 1 (task-7): .status's own text-transform: capitalize turns a raw value like
   "cli-session" into "Cli-Session" — fine for a single-word status, wrong for the Orgs
   page's auth-type pill (task 6), which should read the value as written. */
.status.static { text-transform: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .status::before { animation: none !important; } .ring-value { transition: none; } }

/* ---------- generic pills (suite names, tags) ---------- */
.pill { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 500; line-height: 1.6; white-space: nowrap; background: var(--surface-2); color: var(--text-2); text-decoration: none; border: 1px solid var(--border); }
.pill + .pill { margin-left: 4px; }
.pill-suite { color: var(--text); font-weight: 600; }
a.pill-suite:hover { border-color: var(--accent); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 0.92rem; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.is-active { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.two-line { display: flex; flex-direction: column; gap: 2px; }
.two-line .sub { color: var(--text-3); font-size: 0.78rem; font-family: var(--mono); }
.id { font-family: var(--mono); font-size: 0.85rem; }
.bar { position: relative; height: 6px; width: 96px; background: var(--surface-2); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
/* Task-7 visual QA fix: the bar and its "N / N" count are two separate inline elements with
   nothing tying them together, so a narrower column (e.g. the Runs table at the 800px sidebar-
   as-strip breakpoint) could wrap the count onto its own line under the bar. */
.progress-cell { white-space: nowrap; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--st-passed-fg); border-radius: 3px; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 2px; border-radius: 2px; vertical-align: middle; text-decoration: none; background: var(--st-cancelled-fg); }
.dot.status-passed { background: var(--st-passed-fg); } .dot.status-failed { background: var(--st-failed-fg); }
.dot.status-timedOut { background: var(--st-timedOut-fg); } .dot.status-running { background: var(--st-running-fg); }
.dot::before { display: none; }
.dot:hover { outline: 1px solid var(--text-3); }

/* ---------- forms & buttons ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 200px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 0.88rem; font-weight: 500; color: var(--text-2); }
.input, select.input { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 0.92rem; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.input::placeholder { color: var(--text-3); }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--text); cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: var(--brand-fg); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
.actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }

/* ---------- details as disclosure ---------- */
details.card > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '+'; color: var(--text-3); font-weight: 400; }
details.card[open] > summary { border-bottom: 1px solid var(--border); }
details.card[open] > summary::after { content: '−'; }

/* ---------- empty state ---------- */
.empty { padding: 32px 18px; text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { color: var(--text-3); }
.empty p { margin: 0; }

/* ---------- log ---------- */
.log pre, pre.log { margin: 0; background: #0f1218; color: #d7dbe2; padding: 12px 14px; border-radius: var(--radius-sm); max-height: 360px; overflow: auto; font-family: var(--mono); font-size: 0.8rem; line-height: 1.5; }

/* ---------- runs page ---------- */
.feature-list { max-height: 380px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.feature-group { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.feature-group:last-child { border-bottom: 0; }
.feature-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.scenario { display: flex; padding: 3px 0 3px 4px; font-size: 0.9rem; }
.actions-start { justify-content: flex-start; }
.field > span:first-child { display: block; }

/* ---------- run page ---------- */
.run-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.run-title .id { font-size: 1.1rem; }
.run-meta { margin: -10px 0 16px; }
.stats-row { display: flex; gap: 12px; align-items: stretch; margin: 16px 0; }
.stats-row .stats { flex: 1; }
.ring-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.error-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 0.8rem; color: var(--st-failed-fg); }
.error-cell .toasts { overflow: hidden; text-overflow: ellipsis; color: var(--text-3); }
/* Wide scenario tables (eight columns on the scenario page) scroll inside their card instead of
   spilling past its border on narrow windows. */
.table-scroll { overflow-x: auto; }
.table td.sub { color: var(--text-3); }
@media (max-width: 900px) { .stats-row { flex-direction: column; } }

/* ---------- history page ---------- */
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.field-inline { min-width: 140px; }
.chart .sparkline { width: 100%; height: auto; overflow: visible; display: block; }
.spark-line { fill: none; stroke: var(--chart-line); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--chart-line); stroke: var(--surface); stroke-width: 2; }
.spark-text { fill: var(--text-2); font-size: 12px; font-family: var(--font); }
.sparkline-labels { display: flex; justify-content: space-between; margin-top: 6px; }

/* ---------- orgs page ---------- */
.org-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.org-meta { padding-top: 10px; padding-bottom: 10px; }
.verify-result { padding: 10px 18px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.verify-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* line.detail is raw CLI output (an sf error message, a username mismatch, ...) — long enough
   (and sometimes with no natural break points, e.g. a token) to overflow the card instead of
   wrapping onto the next line without this. min-width: 0 lets this flex child actually shrink
   below its content's intrinsic width so overflow-wrap has room to take effect. */
.verify-detail { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.persona-add td { background: var(--bg); }
.persona-add .row > .input { flex: 1 1 160px; }

/* ---------- Tests section ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -8px 0 18px; }
.tab { padding: 8px 12px; font-size: 0.9rem; font-weight: 500; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.stats-inline { grid-template-columns: minmax(180px, 260px); }
.stat-link { text-decoration: none; color: inherit; }
.stat-link:hover { border-color: var(--accent); }
.pill.warn { background: var(--st-failed-bg); color: var(--st-failed-fg); border-color: transparent; }
.is-missing td { color: var(--text-3); }
.add-scenarios > summary { display: inline-flex; list-style: none; cursor: pointer; }
.add-scenarios > summary::-webkit-details-marker { display: none; }
.add-scenarios[open] > summary { margin-bottom: 14px; }
/* Suite page header: "Run on" select + Run + Delete on one baseline. Not a .row — that class
   lets the field grow (flex: 1 1 200px) and wraps the Run button onto its own line. */
form.run-suite { display: flex; align-items: flex-end; gap: 8px; flex-wrap: nowrap; }   /* form.inline (display: inline) would otherwise win */
.run-suite .field-inline { margin: 0; min-width: 180px; }
.page-header .actions { align-items: flex-end; }
.bulk-bar { position: sticky; bottom: 0; display: flex; gap: 14px; align-items: center; padding: 10px 14px; margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.catalogue td:first-child { width: 28px; }
.howto { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 0.92rem; }
.howto code { font-family: var(--mono); font-size: 0.85em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.step-pattern { font-family: var(--mono); font-size: 0.88rem; }
[hidden] { display: none !important; }

/* ---------- Schedules ---------- */
.days { display: flex; gap: 10px; flex-wrap: wrap; }
/* B7: Settings' radio groups (Notifications card) are not a day-of-week picker — same layout,
   own class, so a future change to .days doesn't silently reach into an unrelated page. */
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.state-error { color: var(--st-failed-fg); }
.edit-details { display: inline-block; }
.edit-details > summary { list-style: none; cursor: pointer; }
.edit-details > summary::-webkit-details-marker { display: none; }
.edit-details[open] { display: block; margin-top: 10px; }
.schedule-form { padding: 0; }

/* ---------- Tests → Builder (preview) ---------- */
.builder { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .builder { grid-template-columns: 1fr; } }
.builder-form { display: flex; flex-direction: column; gap: 14px; }
textarea.input { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.builder .actions { display: flex; gap: 10px; }
.draft { margin: 0; min-height: 180px; padding: 14px; background: #0f1218; color: #d7dbe2; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 0.85rem; line-height: 1.7; white-space: pre-wrap; }
.draft .kw { color: #9cdcfe; }
.draft .tags { color: var(--text-3); }
.draft .line-ok, .legend .line-ok { color: var(--st-passed-fg); }
.draft .line-miss, .legend .line-miss { color: var(--st-failed-fg); }
.legend { margin: 10px 0 0; }

/* ---------- busy buttons (public/busy.js) ---------- */
.btn[aria-busy="true"] { display: inline-flex; align-items: center; gap: 6px; cursor: progress; opacity: 1; }
.btn[aria-busy="true"]::before { content: ''; width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: btn-spin .7s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::before { animation: none; border-right-color: currentColor; opacity: .5; } }
