:root {
  --bg: #f5f6f8; --panel: #ffffff; --panel-2: #fafbfc; --ink: #161b26; --ink-2: #485165; --ink-3: #8790a2;
  --line: #e3e6eb; --line-2: #eef0f3; --hover: #f1f3f6; --sel: #e8eefc; --sel-line: #2f5bd8;
  --accent: #2f5bd8; --accent-ink: #ffffff; --accent-soft: #eaf0fd;
  --ok: #17804a; --ok-soft: #e6f4ec; --warn: #a86b0c; --warn-soft: #fbf1df; --err: #c0352b; --err-soft: #fbeae8;
  --run: #2f5bd8; --run-soft: #eaf0fd; --mute-soft: #eff1f4;
  --dirty: #fff6d6; --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 6px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06); --shadow-lg: 0 12px 40px rgba(16,24,40,.18);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1218; --panel: #161a22; --panel-2: #1a1f28; --ink: #e7eaf0; --ink-2: #aeb5c3; --ink-3: #737c8e;
  --line: #262c37; --line-2: #1f242e; --hover: #1e2430; --sel: #1d2a47; --sel-line: #6f93ff;
  --accent: #5b82f0; --accent-soft: #1c2742; --ok: #3fb97a; --ok-soft: #13291e; --warn: #e0a84a; --warn-soft: #2d2412;
  --err: #f07068; --err-soft: #2f1716; --run: #6f93ff; --run-soft: #1c2742; --mute-soft: #1f242e; --dirty: #33300f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.45 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 12px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 18px; } h2 { font-size: 15px; } h3 { font-size: 13px; }
.muted { color: var(--ink-3); } .ink2 { color: var(--ink-2); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: 52px 1fr; height: 100vh; }
.prod-band { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--err); z-index: 50; }
.topbar { grid-column: 1 / 3; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 14px; letter-spacing: -.01em; width: 220px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: var(--panel); display: grid; place-items: center; }
.env-switch { position: relative; }
.env-btn { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; min-width: 240px; }
.env-btn:hover { border-color: var(--ink-3); }
.env-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.env-btn .name { font-weight: 600; flex: 1; text-align: left; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: 4px; font-size: 10.5px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; background: var(--mute-soft); color: var(--ink-2); white-space: nowrap; }
.badge.prod { background: var(--err); color: #fff; } .badge.mock { background: var(--mute-soft); color: var(--ink-3); }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.err { background: var(--err-soft); color: var(--err); } .badge.run { background: var(--run-soft); color: var(--run); }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; border-radius: var(--r); }
.user-chip:hover { background: var(--hover); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 12px; }
.rail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 4px; }
.rail a { width: 52px; padding: 8px 0 6px; border-radius: 8px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; font-weight: 550; }
.rail a:hover { background: var(--hover); color: var(--ink); }
.rail a.active { background: var(--accent-soft); color: var(--accent); }
.rail .grow { flex: 1; }
.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.page { flex: 1; overflow: auto; padding: 18px 22px 28px; }
.page.flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.page-head .sub { color: var(--ink-3); font-size: 12px; }
.page-head .spacer { flex: 1; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); border-color: #cfd4dc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.icon { width: 32px; padding: 0; } .btn.sm.icon { width: 26px; }
.btn-group { display: inline-flex; } .btn-group .btn { border-radius: 0; margin-left: -1px; } .btn-group .btn:first-child { border-radius: var(--r) 0 0 var(--r); margin: 0; } .btn-group .btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
.seg { display: inline-flex; background: var(--mute-soft); border-radius: 7px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 5px; cursor: pointer; font-weight: 550; color: var(--ink-2); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.input, select.input, textarea.input { height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); outline: none; width: 100%; min-width: 0; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { height: 26px; font-size: 12px; padding: 0 8px; }
.code-input { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; tab-size: 2; white-space: pre; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-2); font-weight: 550; }
label.field .hint { font-weight: 400; color: var(--ink-3); font-size: 11px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; } .col { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--panel); font-size: 12px; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- cards & tables ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.card-body { padding: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; } .kpi .v { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; } .kpi .l { color: var(--ink-3); font-size: 12px; font-weight: 550; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.t td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--hover); }
table.t tr.sel td { background: var(--sel); }
.table-wrap { overflow: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--mute-soft); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.err { background: var(--err-soft); color: var(--err); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.run { background: var(--run-soft); color: var(--run); } .pill.run::before { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); }
.empty h3 { color: var(--ink-2); margin-bottom: 6px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 4px; }
.tabs button { border: 0; background: none; padding: 10px 12px; cursor: pointer; color: var(--ink-3); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { background: var(--mute-soft); color: var(--ink-2); border-radius: 999px; padding: 0 6px; font-size: 11px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,18,24,.38); z-index: 100; display: grid; place-items: center; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; animation: rise .16s ease-out; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal-head { padding: 16px 18px 6px; display: flex; align-items: center; gap: 10px; } .modal-head h2 { flex: 1; }
.modal-body { padding: 10px 18px; overflow: auto; }
.modal-foot { padding: 12px 18px 16px; display: flex; justify-content: flex-end; gap: 8px; }
.drawer-ov { position: fixed; inset: 0; z-index: 90; background: rgba(15,18,24,.18); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--panel); box-shadow: var(--shadow-lg); z-index: 91; display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); } .drawer-head h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 18px; }
.menu { position: absolute; z-index: 120; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; min-width: 200px; max-height: 420px; overflow: auto; }
.menu .mi { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.menu .mi:hover, .menu .mi.focus { background: var(--hover); }
.menu .sep { height: 1px; background: var(--line-2); margin: 4px 0; } .menu .mh { padding: 6px 10px 2px; font-size: 11px; color: var(--ink-3); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--panel); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); max-width: 420px; animation: rise .16s; display: flex; gap: 8px; align-items: flex-start; }
.toast.err { background: var(--err); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }
.callout { padding: 10px 12px; border-radius: 8px; background: var(--mute-soft); color: var(--ink-2); font-size: 12px; display: flex; gap: 8px; }
.callout.warn { background: var(--warn-soft); color: var(--warn); } .callout.err { background: var(--err-soft); color: var(--err); } .callout.info { background: var(--accent-soft); color: var(--accent); }

/* ---------- JSON / code ---------- */
pre.json { margin: 0; padding: 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; font: 12px/1.55 var(--mono); overflow: auto; white-space: pre-wrap; word-break: break-word; }
.j-key { color: #8a3ab9; } .j-str { color: #0f7b52; } .j-num { color: #b25e09; } .j-bool { color: #2f5bd8; } .j-null { color: var(--ink-3); }
:root[data-theme="dark"] .j-key { color: #c792ea; } :root[data-theme="dark"] .j-str { color: #8bd49c; } :root[data-theme="dark"] .j-num { color: #f2a65a; }
.log-view { font: 12px/1.6 var(--mono); background: #0f1218; color: #d6dbe4; padding: 12px 14px; border-radius: 8px; white-space: pre-wrap; max-height: 420px; overflow: auto; }

/* ---------- data grid ---------- */
.dg { position: relative; display: flex; flex-direction: column; min-height: 0; flex: 1; background: var(--panel); outline: none; }
.dg-scroll { flex: 1; overflow: auto; position: relative; }
.dg-head { position: sticky; top: 0; z-index: 3; background: var(--panel-2); }
.dg-hrow, .dg-frow, .dg-row { display: flex; }
.dg-hcell, .dg-fcell, .dg-cell { flex: none; border-right: 1px solid var(--line-2); overflow: hidden; }
.dg-hcell { height: 32px; padding: 0 8px; display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; color: var(--ink-2); border-bottom: 1px solid var(--line); position: relative; cursor: pointer; user-select: none; }
.dg-hcell .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-hcell.key .lbl::after { content: " ⚿"; color: var(--accent); }
.dg-hcell.ro { color: var(--ink-3); font-style: italic; }
.dg-hcell .rs { position: absolute; right: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 2; }
.dg-hcell:hover { background: var(--hover); }
.dg-fcell { height: 30px; padding: 3px 4px; border-bottom: 1px solid var(--line); background: var(--panel); }
.dg-fcell input { width: 100%; height: 23px; border: 1px solid transparent; border-radius: 4px; background: var(--panel-2); padding: 0 6px; font-size: 11.5px; outline: none; }
.dg-fcell input:focus { border-color: var(--accent); background: var(--panel); }
.dg-body { position: relative; }
.dg-row { position: absolute; left: 0; height: 28px; }
.dg-row:hover .dg-cell { background-color: var(--hover); }
.dg-cell { height: 28px; padding: 0 8px; line-height: 28px; white-space: nowrap; text-overflow: ellipsis; border-bottom: 1px solid var(--line-2); font-size: 12.5px; cursor: cell; }
.dg-cell.num { text-align: right; font-variant-numeric: tabular-nums; }
.dg-cell.null { color: var(--ink-3); font-style: italic; }
.dg-cell.dirty { background: var(--dirty) !important; }
.dg-cell.insel { background: var(--sel) !important; }
.dg-cell.cur { box-shadow: inset 0 0 0 2px var(--sel-line); }
.dg-cell.rownum { color: var(--ink-3); text-align: right; font-size: 11px; background: var(--panel-2); cursor: default; position: sticky; left: 0; z-index: 2; }
.dg-cell.chk, .dg-hcell.chk, .dg-fcell.chk { position: sticky; left: 46px; z-index: 2; background: var(--panel-2); display: flex; align-items: center; justify-content: center; padding: 0; cursor: default; }
.dg-hcell.rownum, .dg-fcell.rownum { position: sticky; left: 0; z-index: 4; background: var(--panel-2); }
.dg-hcell.chk, .dg-fcell.chk { z-index: 4; }
.dg-cell.status { padding: 0 6px; cursor: default; }
.dg-row.selrow .dg-cell { background-color: color-mix(in srgb, var(--sel) 60%, transparent); }
.dg-editor { position: absolute; z-index: 5; border: 2px solid var(--sel-line); background: var(--panel); padding: 0 6px; font-size: 12.5px; outline: none; box-shadow: var(--shadow); }
.dg-foot { display: flex; align-items: center; gap: 14px; padding: 6px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); background: var(--panel-2); }
.dg-foot b { color: var(--ink); font-weight: 600; }
.dg-empty { position: absolute; inset: 60px 0 0; display: grid; place-items: center; color: var(--ink-3); pointer-events: none; text-align: center; }
.status-ico { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; }

/* ---------- workbench ---------- */
.wb { display: grid; grid-template-rows: auto auto 1fr auto; grid-template-columns: minmax(0, 1fr); height: 100%; min-height: 0; min-width: 0; }
.wb-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wb-source { background: var(--panel); border-bottom: 1px solid var(--line); }
.wb-source .tabs { padding: 0 12px; }
.wb-source-body { padding: 10px 16px 12px; display: flex; gap: 12px; align-items: stretch; }
.wb-grid { min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.wb-actions { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
.wb-actions .stat b { font-weight: 650; }
.collapse-btn { margin-left: auto; }
.binds { display: flex; flex-wrap: wrap; gap: 8px; }
.bind { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; height: 30px; }
.bind span { padding: 0 8px; font: 11.5px var(--mono); color: var(--accent); background: var(--accent-soft); height: 100%; display: flex; align-items: center; }
.bind input { border: 0; outline: none; padding: 0 8px; width: 160px; background: var(--panel); height: 100%; }
.progress { height: 6px; background: var(--mute-soft); border-radius: 999px; overflow: hidden; display: flex; }
.progress > div { height: 100%; transition: width .3s; } .progress .p-ok { background: var(--ok); } .progress .p-err { background: var(--err); }

/* ---------- console ---------- */
.console { display: grid; grid-template-columns: 260px 1fr; height: 100%; min-height: 0; }
.side { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 10px 12px; border-bottom: 1px solid var(--line-2); display: flex; gap: 6px; align-items: center; }
.side-list { flex: 1; overflow: auto; padding: 6px; }
.side-group { padding: 10px 8px 4px; font-size: 11px; color: var(--ink-3); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.side-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.side-item:hover { background: var(--hover); } .side-item.on { background: var(--accent-soft); color: var(--accent); }
.side-item .m { font: 600 10px var(--mono); width: 40px; flex: none; }
.m-GET { color: var(--ok); } .m-POST { color: #b25e09; } .m-PATCH { color: #8a3ab9; } .m-DELETE { color: var(--err); } .m-PUT { color: var(--accent); }
.req-pane { display: grid; grid-template-rows: auto 1fr; min-height: 0; min-width: 0; overflow: hidden; }
.split > section, .pane-body { min-width: 0; }
table.t.raw th { text-transform: none; letter-spacing: 0; font-family: var(--mono); font-size: 11.5px; }
.req-line { display: flex; gap: 8px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.req-line select { width: 110px; font-weight: 650; }
.split { display: grid; grid-template-rows: minmax(160px, 42%) 1fr; min-height: 0; }
.split > section { display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.split > section + section { border-top: 1px solid var(--line); }
.pane-body { flex: 1; overflow: auto; padding: 12px 16px; min-height: 0; }
.kv { width: 100%; border-collapse: collapse; } .kv td { padding: 3px 4px; } .kv input { width: 100%; }
.resp-meta { display: flex; gap: 14px; align-items: center; margin-left: auto; padding-right: 12px; font-size: 12px; }

/* ---------- ESS ---------- */
.ess-run { display: grid; grid-template-columns: 300px 1fr 360px; height: 100%; min-height: 0; }
.ess-form { padding: 18px 22px; overflow: auto; }
.job-title { font-size: 16px; font-weight: 650; margin-bottom: 4px; }
.def-line { font: 11.5px var(--mono); color: var(--ink-3); word-break: break-all; }
.pipeline { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 0; }
.stage { min-width: 170px; max-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); position: relative; display: flex; flex-direction: column; gap: 6px; }
.stage .n { font-size: 10.5px; color: var(--ink-3); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.stage .t { font-weight: 600; font-size: 12.5px; line-height: 1.3; }
.stage.SUCCEEDED { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.stage.ERROR, .stage.TIMEOUT { border-color: color-mix(in srgb, var(--err) 55%, var(--line)); }
.stage.RUNNING, .stage.SUBMITTED, .stage.READY, .stage.WAIT { border-color: var(--run); box-shadow: 0 0 0 3px var(--run-soft); }
.arrow { flex: none; width: 28px; display: grid; place-items: center; color: var(--ink-3); }
.chain-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.step-edit { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; background: var(--panel-2); }
.step-edit .hdr { display: flex; align-items: center; gap: 8px; }
.step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--panel); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.auth-card { width: 380px; padding: 28px; }
.auth-card .brand { width: auto; margin-bottom: 18px; }

@media (max-width: 1100px) { .ess-run { grid-template-columns: 260px 1fr; } .ess-run > .recent { display: none; } .kpis { grid-template-columns: repeat(2, 1fr); } }

/* guided tour */
.tour-shade { position: fixed; inset: 0; z-index: 400; background: transparent; }
.tour-ring { position: fixed; z-index: 401; border-radius: 10px; box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(15, 23, 42, .5); pointer-events: none; transition: all .25s ease; }
.tour-card { position: fixed; z-index: 402; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px 16px; transition: top .25s ease, left .25s ease; }
