/* QAVA Automation Studio design system (static/pages/studio.js).
 *
 * Tokens are scoped to the Studio page, so nothing here restyles other portal
 * pages. The primary colour follows the portal brand variable (--ib-red), the
 * rail uses the QAVA charcoal. Class names are the contract with studio.js and
 * the UI tests; restyle them, do not rename them.
 */
/* Tokens: on the page, and on the dialogs and lightbox, which are attached to <body>. */
#page-automation-studio, .st-modal-back, .st-lightbox {
  --st-bg: #f4f5f7; --st-surface: #fff; --st-surface-2: #f9fafb; --st-hover: #f3f4f6;
  --st-line: #e3e5ea; --st-line-2: #eef0f3;
  --st-text: #1f2129; --st-text-2: #5b5f6b; --st-text-3: #6b6f7b; /* A11Y-003: was #8a8e99 (3.3:1); now 5.0:1 on white */
  /* A11Y-001: primary = the AA-safe action red (6.0:1 with white text); brand #ea1b3d is 4.45:1 */
  --st-primary: var(--ib-action, #c4162f); --st-primary-600: var(--ib-action-hover, #a81228); --st-primary-50: var(--ib-red-bg, #fff0f3);
  --st-ink: var(--ib-charcoal, #2f2f39);
  --st-info: #2563eb; --st-info-50: #eff4ff; --st-ok: #15803d; --st-ok-50: #ecfdf3; --st-warn: #b45309; --st-warn-50: #fff8eb;
  --st-bad: #c81e1e; --st-bad-50: #fef2f2; --st-violet: #6d28d9; --st-violet-50: #f5f3ff; --st-orange: #c2410c; --st-orange-50: #fff4ed;
  --st-r: 8px; --st-r-sm: 6px; --st-r-xs: 4px;
  --st-shadow: 0 1px 2px rgba(16,24,40,.05); --st-shadow-md: 0 4px 14px rgba(16,24,40,.08); --st-shadow-lg: 0 24px 56px rgba(16,24,40,.2);
  --st-focus: 0 0 0 3px color-mix(in srgb, var(--st-primary) 28%, transparent);
  --st-rail-w: 224px; --st-top-h: 56px;
}
#page-automation-studio { padding: 0 !important; color: var(--st-text); font-size: 13px; }

/* ── shell: the Studio owns the whole viewport while it is open ─────────────── */
body.studio-fullwidth .product-topbar { display: none !important; }
body.studio-fullwidth .main-content { padding: 0 !important; margin-left: 0 !important; width: 100% !important; max-width: none !important; }
.st-shell { display: grid; grid-template-columns: var(--st-rail-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .15s ease;
  /* the rail colour runs the full page height, not just one viewport */
  background: linear-gradient(to right, var(--st-ink) 0, var(--st-ink) var(--st-rail-w), var(--st-bg) var(--st-rail-w)); }
#page-automation-studio .st-body a, #page-automation-studio .st-modal a { color: #1d4ed8; text-decoration: none; }
#page-automation-studio .st-body a:hover, #page-automation-studio .st-modal a:hover { text-decoration: underline; }
#page-automation-studio .st-timeline a { color: var(--st-text); }
.st-shell.collapsed { --st-rail-w: 64px; }

.st-rail { background: var(--st-ink); color: #d4d5dc; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; padding: 12px 0 10px; scrollbar-width: thin; }
.st-rail-top { display: flex; align-items: center; gap: 6px; padding: 2px 12px 12px 16px; }
.st-rail-brand { display: block; cursor: pointer; flex: 1; min-width: 0; }
.st-rail-brand img { display: block; height: 30px; width: auto; max-width: 100%; }
.st-rail-collapse { flex: none; width: 28px; height: 28px; border: 0; border-radius: var(--st-r-sm); background: transparent; color: #9fa1ad; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.st-rail-collapse:hover { background: rgba(255,255,255,.08); color: #fff; } .st-rail-collapse:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.st-rail-collapse svg { width: 16px; height: 16px; transition: transform .15s; }
.st-shell.collapsed .st-rail-collapse svg { transform: rotate(180deg); }
.st-rail-title { font-size: 10.5px; letter-spacing: .01em; color: #a8aab6; padding: 2px 18px 6px; font-weight: 600; }
.st-rail-group { font-size: 10px; letter-spacing: .01em; color: #a3a5b3; padding: 14px 18px 4px; font-weight: 600; }
.st-rail a { position: relative; display: flex; align-items: center; gap: 11px; margin: 1px 8px; padding: 8px 10px; border-radius: var(--st-r-sm); font-size: 13px; color: #cfd0d8; cursor: pointer; text-decoration: none; white-space: nowrap; }
.st-rail a:hover { background: rgba(255,255,255,.07); color: #fff; }
.st-rail a:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.st-rail a.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 500; }
.st-rail a.active::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ib-red, #ea1b3d); /* brand red reads better than the action red on the charcoal rail */ }
.st-rail svg { width: 17px; height: 17px; flex: none; opacity: .92; }
.st-rail .st-rail-badge { margin-left: auto; font-size: 10.5px; font-weight: 600; min-width: 18px; text-align: center; padding: 1px 6px; border-radius: 99px; background: rgba(255,255,255,.12); color: #fff; }
.st-rail .st-rail-badge.hot { background: var(--st-primary); }
.st-rail-sep { height: 1px; background: rgba(255,255,255,.07); margin: 8px 14px; }
.st-rail-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.07); }
.st-shell.collapsed .st-rail-title, .st-shell.collapsed .st-rail-group, .st-shell.collapsed .st-rail a span, .st-shell.collapsed .st-rail-brand { display: none; }
.st-shell.collapsed .st-rail-top { justify-content: center; padding: 2px 0 12px; }
.st-shell.collapsed .st-rail a { justify-content: center; padding: 9px 0; }
.st-shell.collapsed .st-rail .st-rail-badge { position: absolute; top: 2px; right: 6px; min-width: 0; padding: 0 4px; font-size: 9.5px; }
.st-shell.collapsed .st-rail-group { display: block; height: 1px; padding: 0; margin: 10px 16px; background: rgba(255,255,255,.07); font-size: 0; }

.st-main { min-width: 0; display: flex; flex-direction: column; }
/* compact Studio header: where you are, what you work on, global actions */
.st-context { display: flex; align-items: center; gap: 10px; min-height: var(--st-top-h); padding: 8px 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--st-line); position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.2) blur(8px); }
.st-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--st-text-3); flex: none; white-space: nowrap; }
.st-crumbs a { color: var(--st-text-2); cursor: pointer; text-decoration: none; } .st-crumbs a:hover { color: var(--st-text); text-decoration: underline; }
.st-crumbs b { color: var(--st-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.st-crumbs i { font-style: normal; color: #c3c6cf; }
.st-context .st-spacer { flex: 1; }
.st-ctx { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--st-line); border-radius: var(--st-r-sm); background: var(--st-surface); height: 34px; overflow: hidden; min-width: 0; flex: 0 1 auto; }
.st-ctx label { font-size: 10.5px; font-weight: 600; letter-spacing: .01em; color: var(--st-text-3); padding: 0 4px 0 10px; }
.st-ctx select { font: inherit; font-size: 13px; font-weight: 500; border: 0; background: transparent; height: 32px; padding: 0 22px 0 2px; width: auto; max-width: 260px; min-width: 0; color: var(--st-text); cursor: pointer; text-overflow: ellipsis; }
.st-ctx select:focus-visible { outline: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--st-primary) 40%, transparent); }
.st-ctx + .st-ctx { margin-left: -2px; }
#st-env-badge { display: inline-flex; align-items: center; gap: 6px; flex: none; cursor: help; }
#st-env-badge:empty { display: none; }
@media (max-width: 1500px) { .st-ctx label { display: none; } .st-ctx select { padding-left: 10px; max-width: 210px; } }
@media (max-width: 1600px) { .st-crumbs a, .st-crumbs i { display: none; } #st-project { min-width: 150px; } }
#st-env-badge .st-muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.st-runner { font-size: 12px; display: inline-flex; align-items: center; gap: 7px; color: var(--st-text-2); padding: 0 10px; height: 34px; border-radius: var(--st-r-sm); border: 1px solid var(--st-line); background: var(--st-surface); white-space: nowrap; cursor: pointer; }
.st-runner:hover { background: var(--st-hover); }
.st-iconbtn { width: 34px; height: 34px; border-radius: var(--st-r-sm); border: 1px solid var(--st-line); background: var(--st-surface); color: var(--st-text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.st-iconbtn:hover { background: var(--st-hover); color: var(--st-text); } .st-iconbtn:focus-visible { outline: none; box-shadow: var(--st-focus); }
.st-iconbtn svg { width: 16px; height: 16px; }
.st-avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--st-ink); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; flex: none; }
.st-avatar:focus-visible { outline: none; box-shadow: var(--st-focus); }
.st-menu { position: absolute; right: 16px; top: calc(var(--st-top-h) - 2px); min-width: 230px; background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-r); box-shadow: var(--st-shadow-lg); padding: 6px; z-index: 40; }
.st-menu .st-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--st-line-2); margin-bottom: 4px; }
.st-menu .st-menu-head b { display: block; font-size: 13px; } .st-menu .st-menu-head span { font-size: 12px; color: var(--st-text-2); }
.st-menu button { display: flex; width: 100%; gap: 8px; align-items: center; text-align: left; font: inherit; font-size: 13px; padding: 8px 10px; border: 0; background: none; border-radius: var(--st-r-xs); cursor: pointer; color: var(--st-text); }
.st-menu button:hover, .st-menu button:focus-visible { background: var(--st-hover); outline: none; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: #b8bbc4; display: inline-block; flex: none; }
.st-dot.on { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.16); }
.st-dot.run { background: var(--st-info); box-shadow: 0 0 0 3px rgba(37,99,235,.16); animation: st-pulse 1.4s ease-in-out infinite; }
@keyframes st-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .st-dot.run { animation: none; } .st-shell { transition: none; } }

.st-body { padding: 22px 28px 64px; max-width: 1680px; width: 100%; box-sizing: border-box; margin: 0 auto; }
.st-h1 { font-size: 19px; font-weight: 600; color: var(--st-text); margin: 0 0 4px; letter-spacing: -.01em; line-height: 1.3; }
.st-sub { font-size: 13px; color: var(--st-text-2); margin: 0 0 4px; max-width: 880px; line-height: 1.5; }
.st-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.st-head > div:first-child { flex: 1; min-width: 280px; }
.st-head > .st-btn, .st-head > .st-row { margin-top: 2px; }
.st-section-title { font-size: 12px; font-weight: 600; letter-spacing: .01em; color: var(--st-text-3); margin: 22px 0 10px; }

/* ── surfaces ────────────────────────────────────────────────────────────── */
.st-card { background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-r); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--st-shadow); overflow-x: auto; }
.st-card h3 { font-size: 14px; margin: 0 0 12px; color: var(--st-text); font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-card h3 .st-muted { font-weight: 400; }
.st-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.st-card-head h3 { margin: 0; }
.st-grid { display: grid; gap: 16px; }
.st-g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .st-g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.st-g4 { grid-template-columns: repeat(4, minmax(0,1fr)); } .st-g5 { grid-template-columns: repeat(5, minmax(0,1fr)); } .st-g6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.st-g21 { grid-template-columns: minmax(0,2fr) minmax(0,1fr); } .st-g12 { grid-template-columns: minmax(0,1fr) minmax(0,2fr); }
.st-split { display: grid; grid-template-columns: 248px minmax(0,1fr); gap: 16px; align-items: start; }
.st-grid > .st-card, .st-split > .st-card { margin-bottom: 0; }
.st-grid + .st-card, .st-grid + .st-grid, .st-split + .st-card, .st-grid + details.st-card { margin-top: 16px; }
.st-stack > * + * { margin-top: 16px; }
/* minmax(0,1fr), never bare 1fr: a bare 1fr track grows to its widest child
   (a long URL, a wide table) and pushes the page into horizontal scroll. */
@media (max-width: 1280px) { .st-g5, .st-g6 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 1100px) { .st-g3,.st-g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .st-split, .st-g21, .st-g12 { grid-template-columns: minmax(0,1fr); }
  .st-ctx label { display: none; } #st-env-badge .st-muted { display: none; } }
@media (max-width: 900px) { .st-crumbs a, .st-crumbs i { display: none; } .st-runner span:not(.st-dot) { display: none; } }
@media (max-width: 760px) {
  .st-shell, .st-shell.collapsed { grid-template-columns: minmax(0,1fr); background: var(--st-bg); }
  /* room for the portal's own menu button, which sits fixed at the top left on phones */
  .st-rail { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 6px 6px 6px 62px; align-items: center; }
  .st-rail a { margin: 0 2px; } .st-rail a.active::before { left: 8px; right: 8px; top: auto; bottom: -2px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .st-rail-top, .st-rail-title, .st-rail-group, .st-rail-sep { display: none; } .st-rail-foot { margin: 0; padding: 0; border: 0; display: flex; }
  .st-g2,.st-g3,.st-g4,.st-g5,.st-g6 { grid-template-columns: minmax(0,1fr); }
  .st-context { flex-wrap: wrap; padding: 8px 12px; position: static; } .st-crumbs { flex-basis: 100%; }
  .st-ctx select { max-width: 150px; }
  .st-body { padding: 14px 12px 60px; } .st-head > div:first-child { min-width: 0; flex-basis: 100%; }
  .st-banner { flex-wrap: wrap; } .st-card { padding: 12px; } }
.st-table td.st-mono, .st-table .st-mono { overflow-wrap: anywhere; }
.st-table td.st-mono:first-child { white-space: nowrap; overflow-wrap: normal; }

/* KPI tiles: label, value, context line; clickable ones lead somewhere real */
.st-kpi { position: relative; background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-r); padding: 14px 16px 13px; box-shadow: var(--st-shadow); min-width: 0; }
.st-kpi[onclick] { cursor: pointer; } .st-kpi[onclick]:hover { border-color: #c9ccd4; box-shadow: var(--st-shadow-md); }
.st-kpi[onclick]:focus-visible { outline: none; box-shadow: var(--st-focus); }
.st-kpi .st-kpi-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--st-text-2); }
.st-kpi .st-kpi-label svg { width: 15px; height: 15px; color: var(--st-text-3); }
.st-kpi b { display: block; font-size: 25px; font-weight: 600; color: var(--st-text); margin: 6px 0 2px; letter-spacing: -.02em; line-height: 1.15; }
.st-kpi span { font-size: 12px; color: var(--st-text-2); }
.st-kpi .st-kpi-foot { display: block; font-size: 12px; color: var(--st-text-2); line-height: 1.4; }
.st-kpi.tone-bad b { color: var(--st-bad); } .st-kpi.tone-ok b { color: var(--st-ok); } .st-kpi.tone-warn b { color: var(--st-warn); }

/* ── controls ────────────────────────────────────────────────────────────── */
.st-btn { font: inherit; font-size: 13px; font-weight: 500; height: 34px; padding: 0 13px; border-radius: var(--st-r-sm); border: 1px solid #d5d8df; background: var(--st-surface); color: var(--st-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; box-shadow: 0 1px 1px rgba(16,24,40,.04); transition: background .12s, border-color .12s, box-shadow .12s; }
.st-btn:hover { background: var(--st-hover); border-color: #c4c8d0; }
.st-btn:active { transform: translateY(.5px); }
.st-btn:focus-visible { outline: none; box-shadow: var(--st-focus); }
.st-btn:disabled, .st-btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.st-btn.primary { background: var(--st-primary); border-color: var(--st-primary); color: #fff; } .st-btn.primary:hover { background: var(--st-primary-600); border-color: var(--st-primary-600); }
.st-btn.dark { background: var(--st-ink); border-color: var(--st-ink); color: #fff; } .st-btn.dark:hover { background: #1f1f27; }
.st-btn.ghost { border-color: transparent; background: transparent; box-shadow: none; } .st-btn.ghost:hover { background: var(--st-hover); }
.st-btn.sm { height: 28px; padding: 0 9px; font-size: 12px; gap: 5px; } .st-btn.danger { color: var(--st-bad); } .st-btn.danger:hover { background: var(--st-bad-50); }
.st-btn svg { width: 15px; height: 15px; flex: none; }
select.st-btn { padding-right: 26px; }
.st-rec { width: 8px; height: 8px; background: #fff; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.st-input, .st-body input[type=text], .st-body input[type=password], .st-body input[type=number], .st-body input[type=url], .st-body input[type=search], .st-body select, .st-body textarea,
.st-modal input[type=text], .st-modal input[type=password], .st-modal input[type=number], .st-modal input[type=url], .st-modal select, .st-modal textarea {
  font: inherit; font-size: 13px; height: 34px; padding: 0 10px; border: 1px solid #d5d8df; border-radius: var(--st-r-sm); background: #fff; width: 100%; box-sizing: border-box; color: var(--st-text); transition: border-color .12s, box-shadow .12s; }
.st-body select[multiple], .st-modal select[multiple] { height: auto; padding: 4px; }
.st-body textarea, .st-modal textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.st-body input:hover, .st-body select:hover, .st-body textarea:hover, .st-modal input:hover, .st-modal select:hover, .st-modal textarea:hover { border-color: #bfc3cc; }
.st-body input:focus, .st-body select:focus, .st-body textarea:focus, .st-modal input:focus, .st-modal select:focus, .st-modal textarea:focus { outline: none; border-color: color-mix(in srgb, var(--st-primary) 55%, #d5d8df); box-shadow: var(--st-focus); }
.st-body input:disabled, .st-body select:disabled, .st-body textarea:disabled, .st-body input[readonly], .st-modal input:disabled { background: var(--st-surface-2); color: var(--st-text-2); }
.st-body input[type=checkbox], .st-body input[type=radio], .st-modal input[type=checkbox], .st-modal input[type=radio] { accent-color: var(--st-primary); width: 15px; height: 15px; }
.st-field { margin-bottom: 12px; } .st-field > label { display: block; font-size: 12px; font-weight: 500; color: var(--st-text-2); margin-bottom: 5px; }
.st-help { font-size: 12px; color: var(--st-text-2); margin-top: 4px; line-height: 1.45; }
.st-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* A checkbox and its sentence stay on one line; the sentence wraps beside the box. */
label.st-row { flex-wrap: nowrap; align-items: flex-start; min-height: 24px; padding: 3px 0; }
/* A11Y-012: checkbox targets were 15x15 with no clear space (WCAG 2.5.8 Target Size).
   The label's own padding above gives each row 24px of vertical clearance from its
   neighbour; the box itself grows slightly too. */
label.st-row > input[type=checkbox], label.st-row > input[type=radio] { flex: none; margin-top: 1px; width: 16px; height: 16px; }
.st-search { position: relative; } .st-search svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--st-text-3); pointer-events: none; }
.st-body .st-search input { padding-left: 32px; }

/* ── tables ──────────────────────────────────────────────────────────────── */
.st-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.st-table th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .03em; color: var(--st-text-2); padding: 9px 10px; border-bottom: 1px solid var(--st-line); background: var(--st-surface-2); position: sticky; top: 0; white-space: nowrap; }
.st-table th:first-child { border-top-left-radius: var(--st-r-xs); } .st-table th:last-child { border-top-right-radius: var(--st-r-xs); }
.st-table td { padding: 10px; border-bottom: 1px solid var(--st-line-2); vertical-align: top; }
.st-table tr:last-child td { border-bottom: 0; }
.st-table tr.click { cursor: pointer; } .st-table tr.click:hover td { background: #f8f9fb; }
.st-table tr.click:focus-visible td { background: #f8f9fb; box-shadow: inset 0 0 0 9999px transparent; outline: none; }
.st-table tr.st-row-bad td:first-child { box-shadow: inset 3px 0 0 var(--st-bad); }
.st-table tr.st-row-warn td:first-child { box-shadow: inset 3px 0 0 var(--st-warn); }
.st-table tr.st-row-ok td:first-child { box-shadow: inset 3px 0 0 #8fd3a7; }
.st-table tr.st-row-muted td { color: var(--st-text-2); }
.st-scroll { overflow-x: auto; }
.st-num { font-variant-numeric: tabular-nums; }

/* ── status chips: colour + dot, so state is not colour-only ─────────────── */
.st-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 99px; background: #eef0f3; color: #4b4f5c; white-space: nowrap; vertical-align: middle; }
.st-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.st-chip.plain::before, .st-chip.fixture::before { display: none; }
.st-chip.PASSED, .st-chip.APPROVED, .st-chip.STABLE, .st-chip.IMPLEMENTED_TESTED, .st-chip.REACHABLE, .st-chip.ONLINE, .st-chip.ACTIVE, .st-chip.ok, .st-chip.FINISHED, .st-chip.ACCEPTED { background: var(--st-ok-50); color: #146c35; }
.st-chip.FAILED, .st-chip.FRAGILE, .st-chip.BROKEN, .st-chip.UNREACHABLE, .st-chip.ERROR, .st-chip.REJECTED, .st-chip.bad, .st-chip.REVOKED { background: var(--st-bad-50); color: #a91b1b; }
.st-chip.NOT_VERIFIED, .st-chip.STARTING, .st-chip.NEEDS_REVIEW, .st-chip.WATCH, .st-chip.AWAITING_LIVE_VALIDATION, .st-chip.IN_REVIEW, .st-chip.warn, .st-chip.PROPOSED, .st-chip.PAUSED, .st-chip.WAITING_FOR_EXTENSION { background: var(--st-warn-50); color: #92400e; }
.st-chip.BLOCKED, .st-chip.SEPARATE_RUNTIME { background: var(--st-orange-50); color: #9a3412; }
.st-chip.RUNNING, .st-chip.RECORDING, .st-chip.BUSY, .st-chip.info { background: var(--st-info-50); color: #1d4ed8; } .st-chip.QUEUED { background: var(--st-violet-50); color: #5b21b6; }
.st-chip.NOT_RUN, .st-chip.SKIPPED, .st-chip.CANCELLED, .st-chip.RETIRED, .st-chip.DRAFT, .st-chip.NOT_CHECKED, .st-chip.OFFLINE, .st-chip.DEACTIVATED, .st-chip.DONE, .st-chip.NOT_SUPPORTED, .st-chip.DISCARDED, .st-chip.HUMAN_AUTHORED { background: #f0f1f4; color: #565a66; }
.st-chip.fixture { background: #fff6ed; color: #9a3412; border: 1px dashed #f8b07a; padding: 3px 7px; }
/* Phase 3: coverage, generated test cases, healing verification */
.st-chip.COVERED, .st-chip.VERIFIED { background: var(--st-ok-50); color: #146c35; }
.st-chip.PARTIAL, .st-chip.NOT_YET_VERIFIED { background: var(--st-warn-50); color: #92400e; }
.st-chip.PLANNED, .st-chip.SAVED { background: var(--st-info-50); color: #1d4ed8; }
.st-chip.NOT_COVERED, .st-chip.FAILED_AFTER_CHANGE { background: var(--st-bad-50); color: #a91b1b; }
/* business process flow (Test Discovery) */
.st-pf { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; }
.st-pf-term { padding: 6px 18px; border-radius: 99px; background: var(--st-surface-2); border: 1px solid var(--st-line); font-size: 12.5px; font-weight: 600; }
.st-pf-node { width: min(640px, 100%); border: 1px solid var(--st-line); border-radius: var(--st-r-sm); background: var(--st-surface); padding: 10px 12px; font-size: 13px; }
.st-pf-node.decision { border-left: 4px solid #d97706; }
.st-pf-node.validation { border-left: 4px solid #16a34a; }
.st-pf-node.gap { border-left: 4px dashed #d97706; }
.st-pf-node.activity { border-left: 4px solid #2563eb; }
.st-pf-label { font-weight: 600; margin: 6px 0 4px; }
.st-pf-arrow { color: var(--st-text-2); font-size: 14px; line-height: 1; }
.st-pf-branch { margin-top: 6px; padding: 6px 9px; border-radius: 6px; font-size: 12.5px; background: var(--st-warn-50); color: #7c3a0a; }
.st-pf-branch.exception { background: var(--st-bad-50); color: #8b1a1a; }
.st-chip.tier-PROD { background: var(--st-bad-50); color: #a91b1b; } .st-chip.tier-UAT { background: var(--st-violet-50); color: #5b21b6; }
.st-chip.tier-TEST { background: var(--st-info-50); color: #1d4ed8; } .st-chip.tier-DEV, .st-chip.tier-SANDBOX { background: #eef6f6; color: #0f6a63; }

/* ── states ──────────────────────────────────────────────────────────────── */
.st-empty { padding: 34px 24px; text-align: center; color: var(--st-text-2); font-size: 13px; border: 1px dashed #d6d9e0; border-radius: var(--st-r); background: var(--st-surface); line-height: 1.5; }
.st-empty b { display: block; color: var(--st-text); font-size: 14px; margin-bottom: 4px; }
.st-empty .st-empty-ic { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 50%; background: var(--st-bg); color: var(--st-text-3); display: flex; align-items: center; justify-content: center; }
.st-empty .st-empty-ic svg { width: 20px; height: 20px; }
.st-empty .st-btn { margin-top: 12px; }
.st-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.st-skel { display: grid; gap: 16px; }
.st-skel i { display: block; border-radius: var(--st-r); background: linear-gradient(90deg, #eceef1 0%, #f6f7f9 50%, #eceef1 100%); background-size: 200% 100%; animation: st-shimmer 1.2s linear infinite; }
.st-skel .h { height: 26px; width: 34%; } .st-skel .t { height: 14px; width: 58%; } .st-skel .k { height: 92px; } .st-skel .b { height: 240px; }
.st-skel .row4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
@keyframes st-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .st-skel i { animation: none; } }

/* status messages: a toast in the corner, so feedback never moves the page */
.st-msg { position: fixed; right: 20px; bottom: 20px; z-index: 950; max-width: min(460px, calc(100vw - 40px)); font-size: 13px; line-height: 1.45; padding: 11px 38px 11px 14px; border-radius: var(--st-r); box-shadow: var(--st-shadow-lg); display: none; border: 1px solid transparent; }
.st-msg.show { display: block; } .st-msg.ok { background: #f0fbf4; color: #11592c; border-color: #b9e6c9; } .st-msg.bad { background: #fff4f4; color: #8f1717; border-color: #f4c0c0; } .st-msg.info { background: #f3f6ff; color: #1e3a8a; border-color: #c9d6fb; }
.st-msg-x { position: absolute; right: 8px; top: 8px; width: 24px; height: 24px; border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; font-size: 16px; border-radius: 4px; }
.st-msg-x:hover { opacity: 1; background: rgba(0,0,0,.05); }
/* inline notices inside a page (static, part of the content) */
.st-card .st-msg, .st-modal .st-msg, .st-body > div > .st-msg, .st-notice { position: static; box-shadow: none; max-width: none; padding: 10px 12px; margin-bottom: 12px; }
.st-banner { border-radius: var(--st-r); padding: 16px 18px; margin-bottom: 16px; display: flex; gap: 14px; align-items: center; border: 1px solid; box-shadow: var(--st-shadow); background: var(--st-surface); }
.st-banner.PASSED { background: linear-gradient(0deg, #f3fcf6, #f3fcf6); border-color: #bfe8cd; } .st-banner.FAILED { background: #fff6f6; border-color: #f5c6c6; }
.st-banner.NOT_VERIFIED { background: #fffaf0; border-color: #f6dda4; } .st-banner.BLOCKED { background: #fff7f1; border-color: #f8cfae; }
.st-banner.RUNNING, .st-banner.QUEUED { background: #f4f7ff; border-color: #c9d6fb; } .st-banner.CANCELLED { background: #f8f9fa; border-color: #e1e3e8; }
.st-banner h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-banner p { margin: 2px 0 0; font-size: 13px; color: var(--st-text-2); line-height: 1.45; }
.st-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--st-line); margin-bottom: 16px; flex-wrap: wrap; }
.st-tabs button { font: inherit; font-size: 13px; padding: 9px 14px 10px; border: 0; background: none; cursor: pointer; color: var(--st-text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; border-radius: var(--st-r-xs) var(--st-r-xs) 0 0; }
.st-tabs button:hover { color: var(--st-text); background: var(--st-hover); }
.st-tabs button:focus-visible { outline: none; box-shadow: var(--st-focus); }
.st-tabs button.active { color: var(--st-text); border-bottom-color: var(--st-primary); font-weight: 600; }
.st-tabs button .st-count { font-size: 11px; font-weight: 600; background: #eceef2; color: var(--st-text-2); padding: 1px 6px; border-radius: 99px; }
.st-tabs button.active .st-count { background: var(--st-primary-50); color: var(--st-primary-600); }
/* segmented filter (status filters, period pickers) */
.st-seg { display: inline-flex; border: 1px solid var(--st-line); border-radius: var(--st-r-sm); background: var(--st-surface); padding: 2px; gap: 2px; flex-wrap: wrap; }
.st-seg button { font: inherit; font-size: 12.5px; border: 0; background: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; color: var(--st-text-2); display: inline-flex; gap: 6px; align-items: center; }
.st-seg button:hover { background: var(--st-hover); color: var(--st-text); } .st-seg button:focus-visible { outline: none; box-shadow: var(--st-focus); }
.st-seg button.active { background: var(--st-ink); color: #fff; }
.st-seg button .st-count { font-size: 11px; opacity: .8; }
.st-caps { display: flex; flex-wrap: wrap; gap: 6px 14px; min-width: 260px; }
.st-caps span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--st-text-2); white-space: nowrap; }
.st-folders a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 9px; margin: 1px -4px; border-radius: var(--st-r-sm); font-size: 13px; color: var(--st-text) !important; text-decoration: none !important; }
.st-folders a:hover { background: var(--st-hover); } .st-folders a.on { background: var(--st-primary-50); font-weight: 600; }
.st-folders a em { font-style: normal; font-size: 11.5px; color: var(--st-text-2); background: var(--st-bg); padding: 1px 7px; border-radius: 99px; }
.st-mono { font-family: Consolas, 'SFMono-Regular', ui-monospace, monospace; font-size: 12px; }
.st-muted { color: var(--st-text-2); font-size: 12px; }
.st-kv { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 6px 14px; font-size: 13px; margin: 0; }
.st-kv dt { color: var(--st-text-2); } .st-kv dd { margin: 0; overflow-wrap: anywhere; }
.st-stat-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.st-stat-strip > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--st-surface); border: 1px solid var(--st-line); }
.st-stat-strip b { font-weight: 600; }
.st-thumb { width: 120px; height: 75px; object-fit: cover; object-position: top; border: 1px solid var(--st-line); border-radius: var(--st-r-xs); cursor: zoom-in; background: #f4f5f7; display: block; }
.st-gallery { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.st-gallery figure { margin: 0; flex: none; width: 168px; } .st-gallery img { width: 168px; height: 105px; object-fit: cover; object-position: top; border-radius: var(--st-r-xs); border: 1px solid var(--st-line); cursor: zoom-in; background: #f4f5f7; display: block; }
.st-gallery figcaption { font-size: 11.5px; color: var(--st-text-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-lightbox { position: fixed; inset: 0; background: rgba(15,16,22,.86); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.st-lightbox img { max-width: 100%; max-height: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.5); border-radius: 4px; }
.st-modal-back { position: fixed; inset: 0; background: rgba(17,18,24,.48); z-index: 900; display: flex; align-items: flex-start; justify-content: center; padding: 56px 16px; overflow-y: auto; }
.st-modal { position: relative; background: var(--st-surface); border-radius: 12px; width: min(680px, 100%); padding: 22px 24px 20px; box-shadow: var(--st-shadow-lg); color: var(--st-text); font-size: 13px; }
.st-modal h3 { margin: 0 32px 6px 0; font-size: 17px; font-weight: 600; }
.st-modal h3 + .st-sub { margin-bottom: 14px; }
.st-modal > .st-row:last-child, .st-modal .st-modal-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--st-line-2); justify-content: flex-end; }
.st-modal-x { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border: 0; border-radius: var(--st-r-sm); background: none; color: var(--st-text-3); cursor: pointer; font-size: 18px; line-height: 1; }
.st-modal-x:hover { background: var(--st-hover); color: var(--st-text); } .st-modal-x:focus-visible { outline: none; box-shadow: var(--st-focus); }
.st-pair { font-family: Consolas, monospace; font-size: 28px; letter-spacing: .16em; background: var(--st-surface-2); border: 1px dashed #c3c7d0; border-radius: var(--st-r); padding: 12px 20px; display: inline-block; color: var(--st-text); }
.st-steps-live { max-height: 380px; overflow-y: auto; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.st-steps-live li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 8px 4px; border-bottom: 1px solid var(--st-line-2); }
.st-steps-live li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--st-bg); color: var(--st-text-2); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.st-steps-live li.st-muted::before { display: none; }
.st-bar { height: 8px; background: #eceef2; border-radius: 99px; overflow: hidden; } .st-bar > i { display: block; height: 100%; background: var(--st-ok); border-radius: 99px; }
.st-bar.thin { height: 6px; }
.st-rec-card { border-left: 3px solid var(--st-primary); }
.st-quote { border-left: 3px solid #d9dce3; padding: 3px 9px; color: #4a4e59; font-size: 12px; margin: 4px 0; background: var(--st-surface-2); border-radius: 0 4px 4px 0; line-height: 1.45; }
.st-sev-high { border-left: 3px solid var(--st-bad) !important; } .st-sev-medium { border-left: 3px solid #e3a008 !important; } .st-sev-low { border-left: 3px solid #a8adb8 !important; }
.st-rec-item { padding: 10px 12px; margin-bottom: 8px; background: var(--st-surface); border: 1px solid var(--st-line-2); border-radius: var(--st-r-sm); font-size: 13px; line-height: 1.45; }
.st-rec-item[onclick] { cursor: pointer; } .st-rec-item[onclick]:hover { background: #fafbfc; border-color: var(--st-line); }
.st-rec-item b { font-weight: 600; }
.st-timeline { list-style: none; margin: 0; padding: 0; }
.st-timeline li { position: relative; padding: 0 0 12px 20px; font-size: 13px; line-height: 1.45; }
.st-timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #aeb3bd; }
.st-timeline li::after { content: ""; position: absolute; left: 7px; top: 15px; bottom: 0; width: 1px; background: var(--st-line); }
.st-timeline li:last-child::after { display: none; }
.st-timeline li.ok::before { background: #22a55a; } .st-timeline li.bad::before { background: var(--st-bad); } .st-timeline li.info::before { background: var(--st-info); }
.st-steps-flow { display: flex; gap: 0; margin: 4px 0 16px; counter-reset: f; flex-wrap: wrap; }
.st-steps-flow > div { flex: 1; min-width: 150px; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; position: relative; }
.st-steps-flow > div::before { counter-increment: f; content: counter(f); flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #c9ccd4; color: var(--st-text-2); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; background: #fff; }
.st-steps-flow > div.done::before { content: "✓"; background: var(--st-ok); border-color: var(--st-ok); color: #fff; }
.st-steps-flow > div.now::before { background: var(--st-primary); border-color: var(--st-primary); color: #fff; }
.st-steps-flow > div b { display: block; font-size: 13px; } .st-steps-flow > div span { font-size: 12px; color: var(--st-text-2); }
.st-steps-flow > div + div::after { content: ""; position: absolute; left: -10px; top: 21px; width: 18px; height: 1.5px; background: #d4d7de; }
.st-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--st-text-2); }
.st-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ── Flow Builder ─────────────────────────────────────────────────────────── */
.fb2 { display: grid; grid-template-columns: 236px minmax(0,1fr) 330px; gap: 0; border: 1px solid var(--st-line); border-radius: var(--st-r); background: var(--st-surface); min-height: 660px; box-shadow: var(--st-shadow); overflow: hidden; }
@media (max-width: 1600px) { .fb2 { grid-template-columns: 210px minmax(0,1fr) 300px; } }
.fb2-canvas { container-type: inline-size; }
@container (max-width: 540px) { .fb2-canvas .fb2-branches { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 1250px) { .fb2 { grid-template-columns: 200px minmax(0,1fr); } .fb2-inspector { grid-column: 1 / -1; border-left: 0 !important; border-top: 1px solid var(--st-line); max-height: none !important; } }
@media (max-width: 760px) { .fb2 { grid-template-columns: minmax(0,1fr); } .fb2-canvas .fb2-branches { grid-template-columns: minmax(0,1fr); } .fb2-diamond { width: auto; max-width: 220px; } .fb2-palette { max-height: 280px !important; } }
.fb2-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--st-line); background: var(--st-surface); grid-column: 1 / -1; }
.fb2-toolbar .st-tabs { margin: 0; border: 0; }
.fb2-toolbar .st-tabs button { padding: 7px 12px; border-radius: var(--st-r-sm); border: 0; margin: 0; }
.fb2-toolbar .st-tabs button.active { background: var(--st-bg); border: 0; }
.fb2-toolbar .fb2-sep { width: 1px; height: 22px; background: var(--st-line); }
.fb2-stats { font-size: 12px; color: var(--st-text-2); display: inline-flex; gap: 12px; }
.fb2-stats b { color: var(--st-text); font-weight: 600; }
#fb-dirty { font-size: 12px; padding: 4px 9px; border-radius: 99px; background: var(--st-ok-50); color: #146c35; font-weight: 500; }
#fb-dirty.dirty { background: var(--st-warn-50); color: #92400e; }
.fb2-palette { border-right: 1px solid var(--st-line); padding: 10px 10px 16px; overflow-y: auto; max-height: calc(100vh - 230px); min-height: 600px; background: var(--st-surface-2); }
.fb2-palette .st-search { margin: 2px 0 6px; } .fb2-palette input[type=search] { height: 32px; background: #fff; }
.fb2-palette details { margin-top: 4px; } .fb2-palette summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; color: var(--st-text-3); padding: 8px 4px 6px; border-radius: 4px; }
.fb2-palette summary::-webkit-details-marker { display: none; }
.fb2-palette summary::after { content: "▾"; font-size: 10px; transition: transform .12s; } .fb2-palette details:not([open]) summary::after { transform: rotate(-90deg); }
.fb2-palette summary:hover { color: var(--st-text-2); } .fb2-palette summary:focus-visible { outline: none; box-shadow: var(--st-focus); }
.fb2-palette h4 { font-size: 10.5px; letter-spacing: .1em; color: var(--st-text-3); margin: 12px 4px 6px; }
.fb2-pi { display: flex; align-items: center; gap: 9px; padding: 6px 8px; margin-bottom: 4px; font-size: 12.5px; border: 1px solid var(--st-line); border-radius: var(--st-r-sm); background: #fff; cursor: grab; user-select: none; transition: border-color .1s, box-shadow .1s, transform .1s; }
.fb2-pi:hover { border-color: #c4c8d0; box-shadow: var(--st-shadow-md); }
.fb2-pi:active { cursor: grabbing; transform: scale(.98); }
.fb2-pi:focus-visible { outline: none; box-shadow: var(--st-focus); }
.fb2-pi i { width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; color: #fff; flex: none; }
.fb2-pi.hide { display: none; }
.fb2-pi { flex-wrap: wrap; } .fb2-pi .fb2-pi-note { flex-basis: 100%; margin: -2px 0 0 29px; font-size: 10.5px; font-weight: 600; color: #92400e; }
.fb2-canvas { padding: 20px 24px 48px; overflow: auto; max-height: calc(100vh - 230px); min-height: 600px; background-color: #fafbfc; background-image: radial-gradient(#dfe2e7 1px, transparent 1px); background-size: 18px 18px; }
/* ── React Flow canvas (Stage 1, @xyflow/react, see static/vendor/flow-canvas/) ──
   Overrides the .fb2-canvas padding/background above: the graph is full-bleed. ── */
.fb2-canvas { padding: 0; }
.qfc-wrap { width: 100%; height: 78vh; }
.qfc-wrap .react-flow__attribution { display: none; }
.qfc-wrap .react-flow__minimap { border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.qfc-wrap .react-flow__controls { box-shadow: var(--shadow-sm); border-radius: var(--radius-md); overflow: hidden; }
.qfc-wrap .react-flow__controls-button { border: 0; border-bottom: 1px solid var(--border-soft); }
.qfc-wrap .react-flow__edge-path { stroke: #c9c9d6; stroke-width: 1.6; }
.qfc-wrap .react-flow__edge-text { font-size: 10px; fill: var(--ib-text-2); }
.qfc-wrap .react-flow__edge-textbg { fill: #fff; }

.qfc-node { font-size: 12.5px; }
.qfc-step { width: 240px; background: #fff; border: 1px solid #dcdce6; border-radius: 8px; padding: 9px 11px; display: flex; gap: 9px; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.04); cursor: pointer; }
.qfc-step:hover { border-color: #b9b9c8; }
.qfc-step.sel { border-color: var(--ib-action); box-shadow: 0 0 0 3px rgba(196,22,47,.14); }
.qfc-step.dis { opacity: .5; } .qfc-step.err { border-color: var(--amber); }
.qfc-ic { width: 26px; height: 26px; border-radius: 6px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; }
.qfc-body { flex: 1; min-width: 0; }
.qfc-label { font-size: 12.5px; color: var(--ib-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.qfc-container { width: 220px; cursor: pointer; }
.qfc-container-head { border: 2px solid; border-radius: 7px; padding: 7px 12px; color: #fff; font-size: 12px; font-weight: 600; text-align: center; }
.qfc-container.sel .qfc-container-head { box-shadow: 0 0 0 3px rgba(196,22,47,.25); }

.qfc-decision { cursor: pointer; }
.qfc-diamond { width: 200px; }
.qfc-diamond-inner { background: var(--amber); color: #fff; text-align: center; padding: 10px 14px; border-radius: 6px; clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%); }
.qfc-diamond-inner b { display: block; font-size: 12px; } .qfc-diamond-inner small { display: block; font-weight: 400; font-size: 10.5px; margin-top: 2px; }
.qfc-decision.sel .qfc-diamond-inner { outline: 3px solid rgba(196,22,47,.5); }

.qfc-join { width: 1px; height: 1px; }
.qfc-terminal { width: 68px; text-align: center; font-size: 11px; font-weight: 600; color: #fff; border-radius: 999px; padding: 5px 0; }
.qfc-start { background: #16a34a; } .qfc-end { background: var(--ib-action); }
.fb2-empty { max-width: 380px; margin: 26px auto; text-align: center; padding: 22px; border: 2px dashed #d3d7de; border-radius: var(--st-r); background: rgba(255,255,255,.8); color: var(--st-text-2); font-size: 13px; line-height: 1.5; }
.fb2-empty b { display: block; color: var(--st-text); font-size: 14px; margin-bottom: 4px; }
.fb2-start, .fb2-end { width: 74px; text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .01em; color: #fff; border-radius: 99px; padding: 5px 0; margin: 0 auto; box-shadow: var(--st-shadow); }
.fb2-start { background: #16a34a; } .fb2-end { background: var(--st-ink); }
.fb2-drop { height: 16px; margin: 0 auto; width: 70%; border-radius: var(--st-r-sm); transition: height .1s, background .1s; position: relative; }
.fb2-drop::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #c8ccd4; transform: translateX(-50%); }
.fb2-drop.over { height: 38px; background: color-mix(in srgb, var(--st-primary) 7%, transparent); border: 2px dashed var(--st-primary); }
.fb2-drop.over::before { display: none; }
.fb2-drop.over::after { content: "Drop here"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; color: var(--st-primary); }
.fb2-canvas.dragging .fb2-drop:not(.over) { background: rgba(37,99,235,.04); }
.fb2-node { position: relative; max-width: 560px; margin: 0 auto; background: #fff; border: 1px solid #d9dce3; border-radius: var(--st-r); padding: 10px 12px; display: flex; gap: 11px; align-items: center; cursor: pointer; box-shadow: var(--st-shadow); transition: border-color .1s, box-shadow .1s; }
.fb2-node:hover { border-color: #b8bdc7; box-shadow: var(--st-shadow-md); }
.fb2-node.sel { border-color: var(--st-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-primary) 16%, transparent); }
.fb2-node[draggable=true] { cursor: grab; } .fb2-node:focus-visible { outline: none; box-shadow: var(--st-focus); }
.fb2-node.dis { opacity: .55; background: var(--st-surface-2); } .fb2-node.err { border-color: #e3a008; box-shadow: 0 0 0 3px rgba(227,160,8,.12); }
.fb2-node .fb2-ic { width: 30px; height: 30px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600; }
.fb2-node .fb2-t { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; line-height: 1.35; } .fb2-node .fb2-t small { display: block; font-weight: 400; color: var(--st-text-2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.fb2-node.err .fb2-t small { color: #92400e; }
.fb2-node .fb2-n { font-size: 11px; color: var(--st-text-3); min-width: 18px; font-variant-numeric: tabular-nums; }
.fb2-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--st-warn-50); color: #92400e; margin-left: 2px; font-weight: 600; white-space: nowrap; }
.fb2-badge.commit { background: var(--st-bad-50); color: #a91b1b; } .fb2-badge.check { background: var(--st-ok-50); color: #146c35; } .fb2-badge.var { background: var(--st-violet-50); color: #5b21b6; }
.fb2-group { max-width: 640px; margin: 0 auto; border: 1.5px solid #c8cff9; border-radius: 10px; background: rgba(244,246,255,.75); box-shadow: var(--st-shadow); }
.fb2-group > .fb2-gh { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #4f46e5; color: #fff; border-radius: 8px 8px 0 0; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.fb2-group > .fb2-gh::before { content: "▭"; opacity: .8; }
.fb2-group.loop > .fb2-gh::before { content: "↻"; } .fb2-group.try > .fb2-gh::before { content: "⚑"; }
.fb2-group.sel { box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-primary) 22%, transparent); }
.fb2-group > .fb2-gb { padding: 8px 12px 12px; }
.fb2-group.loop { border-color: #a6e5cb; background: rgba(240,252,247,.75); } .fb2-group.loop > .fb2-gh { background: #047857; }
.fb2-group.try { border-color: #f3d78f; background: rgba(255,251,240,.75); } .fb2-group.try > .fb2-gh { background: #a16207; }
.fb2-group.comp { border-color: #e3d1fb; background: rgba(250,246,255,.75); }
.fb2-if { max-width: 780px; margin: 0 auto; }
.fb2-diamond { width: 236px; margin: 0 auto; background: #f59e0b; color: #fff; text-align: center; padding: 9px 12px; font-size: 12.5px; font-weight: 600; border-radius: 6px; clip-path: polygon(7% 0, 93% 0, 100% 50%, 93% 100%, 7% 100%, 0 50%); cursor: pointer; line-height: 1.3; }
.fb2-diamond.sel { background: #d97706; outline: 3px solid color-mix(in srgb, var(--st-primary) 45%, transparent); }
.fb2-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.fb2-branch { border: 1px dashed #cfd3db; border-radius: var(--st-r); padding: 6px 8px 8px; background: rgba(255,255,255,.75); }
.fb2-branch > b { display: block; font-size: 10.5px; letter-spacing: .1em; color: var(--st-text-3); text-align: center; margin: 2px 0 2px; }
.fb2-branch:first-child > b { color: #15803d; } .fb2-branch:last-child > b { color: #b45309; }
.fb2-comment { max-width: 560px; margin: 0 auto; background: #fffbeb; border: 1px solid #f5dfa0; border-radius: var(--st-r-sm); padding: 9px 12px; font-size: 12.5px; color: #78350f; cursor: pointer; line-height: 1.45; }
.fb2-comment.todo { border-style: dashed; border-color: var(--st-primary); background: #fff4f6; color: #9f1239; }
.fb2-comment.sel { box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-primary) 18%, transparent); }
.fb2-inspector { border-left: 1px solid var(--st-line); padding: 16px; overflow-y: auto; max-height: calc(100vh - 230px); background: var(--st-surface); }
.fb2-inspector h4 { margin: 0 0 12px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.fb2-inspector h5 { margin: 16px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .01em; color: var(--st-text-3); }
.fb2-inspector fieldset { min-width: 0; }
.fb2-inspector .fb2-insp-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--st-line-2); }
.fb2-summary { list-style: none; margin: 0; padding: 0; } .fb2-summary li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--st-line-2); }
.fb2-summary li span:last-child { color: var(--st-text); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.fb2-summary li span:first-child { color: var(--st-text-2); }
.fb2-cand { display: flex; gap: 4px; margin-bottom: 6px; } .fb2-cand select { width: 112px !important; flex: none; }
.fb2-json { width: 100%; min-height: 540px !important; font-family: Consolas, ui-monospace, monospace !important; font-size: 12px !important; line-height: 1.5; }
/* ── Execution Centre step timeline (Stage 1) ────────────────────── */
.st-timeline { display: flex; flex-direction: column; }
.st-timeline-item { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: var(--space-3); }
.st-timeline-rail { position: relative; display: flex; justify-content: center; }
.st-timeline-rail::before { content: ''; position: absolute; top: 18px; bottom: -4px; width: 2px; background: var(--border); }
.st-timeline-item:last-child .st-timeline-rail::before { display: none; }
.st-timeline-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; background: var(--border); flex: none; z-index: 1; }
.st-timeline-item.PASSED .st-timeline-dot { background: var(--green); }
.st-timeline-item.FAILED .st-timeline-dot { background: var(--danger); }
.st-timeline-item.NOT_VERIFIED .st-timeline-dot, .st-timeline-item.BLOCKED .st-timeline-dot { background: var(--amber); }
.st-timeline-item.RUNNING .st-timeline-dot { background: #1e40af; box-shadow: 0 0 0 3px rgba(30,64,175,.18); }
.st-timeline-body { padding-bottom: var(--space-4); border-bottom: 1px solid var(--border-soft); margin-bottom: var(--space-2); min-width: 0; }
.st-timeline-head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--text-sm); }
.st-timeline-n { color: var(--ib-text-2); font-size: var(--text-xs); }
.st-timeline-desc { font-weight: 500; color: var(--ib-charcoal); }
.st-timeline-spacer { flex: 1; }
.st-timeline-detail { font-size: var(--text-sm); color: var(--ib-text); margin-top: 4px; }
.st-timeline-body .st-thumb { margin-top: 8px; }

.st-guide-step { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--st-line-2); }
.st-guide-step img { width: 100%; border: 1px solid var(--st-line); border-radius: var(--st-r-sm); }
@media (max-width: 760px) { .st-guide-step { grid-template-columns: 1fr; } }
.st-chart { width: 100%; height: auto; display: block; overflow: visible; }
.st-chart text { font-family: inherit; }
@media print { .st-rail, .st-context, .st-msg { display: none !important; } .st-shell { display: block; } }
/* Environments: a deactivated environment stays visible but reads as switched off */
.st-card.st-env-off { opacity: .72; border-style: dashed; }
.st-conn { margin-top: 4px; font-size: 12.5px; color: var(--st-text-2); }
.st-conn b { color: var(--st-text); font-weight: 600; }
.st-dot.bad { background: var(--st-bad, #dc2626); box-shadow: 0 0 0 3px rgba(220,38,38,.16); }
.st-msg.warn { background: #fffaeb; color: #7a3d06; border-color: #f6d58a; }
.st-steps-live li .st-rec-ctl { display: inline-flex; gap: 2px; margin-left: 6px; flex: none; }
.st-rec-ctl .st-btn.sm { padding: 2px 7px; min-height: 0; }

/* Navigation (docs/architecture/navigation/08): the record view's one labelled
   back control, and the row marked after returning to a list. */
.st-backrow { margin-bottom: 10px; }
.st-table tr.st-row-return td { background: #fff4f6; transition: background .6s ease; }
.st-table tr.st-row-return td:first-child { box-shadow: inset 3px 0 0 var(--st-primary, #ea1b3d); }
/* The context bar hides breadcrumb links below 1600px to save room; for an open
   record the link to its own list stays (from 1200px up), since that is the
   structural way back. */
@media (min-width: 1200px) and (max-width: 1600px) {
  .st-crumbs.st-crumbs-rec li:nth-last-child(2) a, .st-crumbs.st-crumbs-rec li:nth-last-child(2) i { display: inline; }
}

/* Unified automation (2026-11): windows, API steps, wait-until */
.fb2-badge.win { background: #e0f2fe; color: #075985; } .fb2-badge.added { background: #fef3c7; color: #92400e; }
.st-api { margin-top: 8px; border: 1px solid var(--st-line, #e5e7eb); border-radius: 8px; padding: 8px 10px; background: var(--st-surface-2, #fafafa); }
.st-api > summary { cursor: pointer; font-size: 12px; overflow-wrap: anywhere; }
.st-api-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 8px; }
.st-api-grid b { font-size: 12px; } .st-api-grid pre { margin: 4px 0 0; max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; background: #fff; border: 1px solid var(--st-line, #e5e7eb); border-radius: 6px; padding: 8px; }
.st-api-leaves { max-height: 300px; overflow: auto; border: 1px solid var(--st-line, #e5e7eb); border-radius: 8px; }
.st-api-leaf { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(80px, 1fr) auto; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--st-line, #e5e7eb); font-size: 12px; }
.st-api-leaf:last-child { border-bottom: 0; } .st-api-leaf span { overflow-wrap: anywhere; } .st-api-leaf .st-btn { margin-left: 4px; }
.st-env-conns { border-top: 1px solid var(--st-line, #e5e7eb); margin-top: 12px; }

/* Picking one of several matching elements: the page picture is the control, each choice is one line. */
.st-pick-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.st-pick-shot { max-height: 300px; overflow: auto; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; background: #f8fafc; }
.st-pick-stage { position: relative; line-height: 0; }
.st-pick-stage img { display: block; width: 100%; height: auto; cursor: default; }
.st-pick-dot { position: absolute; padding: 0; border: 2px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; }
.st-pick-dot:hover, .st-pick-dot:focus-visible { border-color: #ea1b3d; background: rgba(234, 27, 61, .10); outline: none; }
.st-pick-dot.sel { border-color: #2563eb; background: rgba(37, 99, 235, .14); box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); }
.st-pick-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.st-pick-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; cursor: pointer; }
.st-pick-row:hover { background: #f8fafc; }
.st-pick-row.sel { border-color: #2563eb; background: #eff6ff; }
.st-pick-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #ea1b3d; color: #fff; font: 700 12px/22px sans-serif; text-align: center; }
.st-pick-where { flex: 1; min-width: 0; font-size: 13px; }
.st-pick-foot { display: flex; justify-content: space-between; margin-top: 10px; }
