/* Squadron Playground: nethric.ai tokens, ComfyUI-style node canvas. */
:root {
  --ground: #0A0B14; --ground-2: #0D0E1A; --card: #10111C;
  --glass: rgba(255,255,255,.04); --glass-hover: rgba(109,90,224,.10);
  --border: rgba(183,168,255,.16); --border-hi: rgba(183,168,255,.32);
  --accent: #6D5AE0; --accent-hi: #B7A8FF; --blue: #46B8FF; --ice: #A9E8FF;
  --ember: #E8A87C; --ember-hi: #F0C09C; --ok: #7ED8A8; --crit: #EF7B7B;
  --text: #E2DFF2; --text-2: #A8A3C8; --muted: #AEAACA; --micro: #B9B4D6;
  --node: #161726; --node-2: #1C1D30; --widget: #0F1020;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
  --top-h: 52px; --strip-h: 96px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--text); font: 300 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--ice); }
a:hover { color: #fff; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-left));
  background: rgba(10,11,20,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; min-width: 0; }
.brand img { display: block; }
.brand-word { font-weight: 400; letter-spacing: .38em; font-size: 12px; }
.brand-sep { color: var(--text-2); }
.brand-prod { font-weight: 400; letter-spacing: .28em; font-size: 12px; color: var(--accent-hi); }
.demo-badge {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 11px; letter-spacing: .04em; color: var(--micro);
  border: 1px solid var(--border-hi); border-radius: 999px; padding: 4px 10px; background: rgba(109,90,224,.12);
}
.demo-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 8px var(--ember); }
@media (max-width: 420px) {
  .brand-word, .brand-sep { display: none; }
  .demo-badge { font-size: 10.5px; padding: 4px 8px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--glass);
  font-size: 11.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--glass-hover); border-color: var(--border-hi); }
.btn-primary { background: rgba(109,90,224,.32); border-color: rgba(183,168,255,.5); color: #fff; }
.btn-primary svg { fill: currentColor; stroke: none; }
.btn-primary:hover { background: rgba(109,90,224,.48); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: rgba(16,17,28,.85); color: var(--text);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--border-hi); background: #1a1b2c; }
.icon-btn[aria-pressed="true"] { border-color: rgba(183,168,255,.55); background: rgba(109,90,224,.3); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn .i-play { display: none; fill: currentColor; stroke: none; }
.icon-btn.is-paused .i-play { display: block; }
.icon-btn.is-paused .i-pause { display: none; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: rgba(16,17,28,.85); }
.seg button { border: 0; background: transparent; height: 38px; min-width: 38px; padding: 0 9px; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: rgba(109,90,224,.38); color: #fff; }

/* ---------- stage ---------- */
.stage {
  position: relative; height: calc(100svh - var(--top-h)); min-height: 560px; overflow: hidden; overflow: clip;
  background: radial-gradient(120% 70% at 0% 0%, rgba(109,90,224,.20), transparent 55%), var(--ground);
}
.stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .32;
  background: url("../aurora-portrait.webp") center top / cover no-repeat;
}
@media (min-aspect-ratio: 1/1) { .stage::before { background-image: url("../aurora.webp"); opacity: .22; } }

.gview {
  position: absolute; inset: 0; overflow: hidden; overflow: clip; touch-action: none; cursor: grab; outline: none;
  background-color: rgba(10,11,20,.55);
  background-image: radial-gradient(circle, rgba(183,168,255,.16) 1px, transparent 1.3px);
  background-size: 24px 24px;
}
.gview:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-hi); }
.gview.grabbing { cursor: grabbing; }
.gworld { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.groups, .nodes { position: absolute; left: 0; top: 0; }
.wires { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }

/* groups (ComfyUI style) */
.ggroup { position: absolute; border-radius: 10px; border: 1px solid; --gc: 183,168,255; border-color: rgba(var(--gc),.32); background: rgba(var(--gc),.055); }
.gg-title { position: absolute; left: 12px; top: 4px; font-size: 13px; font-weight: 500; color: rgba(var(--gc),.95); letter-spacing: .02em; white-space: nowrap; }
.gc-feat { --gc: 169,232,255; }
.gc-main { --gc: 183,168,255; }
.gc-order { --gc: 160,140,240; }
.gc-sub { --gc: 70,184,255; }
.gc-test { --gc: 126,216,168; }
.gc-land { --gc: 232,168,124; }
.ggroup.enter { animation: fadein .5s ease backwards; }

/* nodes */
.gnode {
  position: absolute; display: flex; flex-direction: column; gap: 4px; padding: 0 0 8px;
  background: var(--node); border: 1px solid rgba(183,168,255,.14); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,.45); font-size: 11px; line-height: 1.3; color: var(--text);
  --hc: 92,84,140;
  transition: box-shadow .35s, border-color .35s;
}
/* pending nodes stay readable (~75%), they just are not lit yet */
.gnode[data-state="idle"] { filter: saturate(.7) brightness(.86); }
.gnode[data-state="idle"] .gn-head { background: rgba(var(--hc), .78); }
@keyframes fadein { from { opacity: 0; } }
.gn-head {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 7px 7px 0 0;
  background: rgb(var(--hc)); color: #fff; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden;
}
.gn-head svg { width: 14px; height: 14px; flex: none; opacity: .9; }
.gn-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); flex: none; }
.gn-title { flex: none; }
.gn-badge { margin-left: auto; font-size: 10.5px; font-weight: 400; opacity: .82; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.t-feature { --hc: 54,92,120; }
.t-main { --hc: 109,90,224; }
.t-order { --hc: 82,70,150; }
.t-sub { --hc: 40,110,170; }
.t-sub.r-scout { --hc: 44,96,150; }
.t-sub.r-scribe { --hc: 84,82,150; }
.t-test { --hc: 42,120,90; }
.t-merge { --hc: 160,98,58; }
.t-output { --hc: 150,90,56; }

.gn-ports { display: flex; justify-content: space-between; height: 18px; align-items: center; color: var(--text-2); font-size: 10.5px; }
.port { display: inline-flex; align-items: center; gap: 6px; }
.port.in { margin-left: -5px; }
.port.out { margin-right: -5px; }
.pdot { width: 10px; height: 10px; border-radius: 50%; background: var(--pc, var(--accent-hi)); border: 2px solid var(--node); box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.t-feature .port.out .pdot, .t-main .port.in:first-child .pdot { --pc: var(--ice); }
.t-main .port.out .pdot, .t-order .pdot { --pc: var(--accent-hi); }
.t-sub .pdot { --pc: var(--blue); }
.t-test .port.in .pdot { --pc: var(--blue); }
.t-test .port.out .pdot, .t-merge .port.in .pdot { --pc: var(--ok); }
.t-merge .port.out .pdot, .t-output .pdot { --pc: var(--ember); }

.gw {
  display: flex; align-items: center; gap: 6px; margin: 0 8px; height: 21px; padding: 0 10px; border-radius: 999px;
  background: var(--widget); border: 1px solid rgba(255,255,255,.05); color: var(--text-2); white-space: nowrap; overflow: hidden;
}
.gw .k { flex: none; }
.gw .v { margin-left: auto; color: var(--text); overflow: hidden; text-overflow: ellipsis; min-width: 0; text-align: right; }
.gw-text { flex-direction: column; align-items: stretch; height: auto; min-height: 21px; padding: 3px 10px 4px; border-radius: 6px; gap: 0; white-space: normal; }
.gw-text .k { font-size: 9px; letter-spacing: .12em; color: var(--accent-hi); }
.gw-text .v { margin: 0; text-align: left; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; height: 2.6em; line-height: 1.3; white-space: normal; }
.t-feature .gw-text .v { font-size: 12px; color: #fff; }
.t-feature .gw-text .k { color: var(--ice); }
.gw-log { border-radius: 6px; font-family: var(--mono); font-size: 10px; color: var(--ice); background: #0b0c17; }
.gw-log .v { margin: 0; text-align: left; color: inherit; }
.gw-toggle .tg { width: 24px; height: 12px; border-radius: 999px; background: #2a2b3e; position: relative; flex: none; }
.gw-toggle .tg::after { content: ""; position: absolute; left: 2px; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: #6c6a88; }
.gw-bar { position: relative; padding: 0; justify-content: center; }
.gw-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(126,216,168,.35); transition: width .25s ease, background .25s; }
.gw-bar .lab { position: relative; color: var(--text); font-family: var(--mono); font-size: 10.5px; }
.gw-bar[data-state="red"] { background: rgba(239,123,123,.16); }
.gw-bar[data-state="fail"] .fill { background: rgba(239,123,123,.5); }
.gw-bar[data-state="fail"] { background: rgba(239,123,123,.12); }
.gw-bar[data-state="running"] .fill { background: rgba(70,184,255,.4); }
.gw-bar[data-state="green"] .fill { background: rgba(126,216,168,.55); }
.gw-assert {
  margin: 0 8px; flex: 1; min-height: 0; padding: 5px 8px; border-radius: 6px; background: transparent; border: 1px dashed transparent;
  font: 9.5px/1.35 var(--mono); color: #ffc9c9; white-space: pre-wrap; overflow: hidden; height: auto;
}
.gw-assert:not(:empty) { background: rgba(239,123,123,.10); border-color: rgba(239,123,123,.4); }

/* node states */
.gnode[data-state="active"] { border-color: rgba(183,168,255,.6); box-shadow: 0 0 0 1px rgba(183,168,255,.35), 0 0 26px rgba(109,90,224,.45), 0 10px 28px rgba(0,0,0,.45); }
.gnode[data-state="active"] .gn-dot { background: #fff; opacity: calc(.35 + .65 * var(--pulse)); }
.t-sub[data-state="active"], .t-test[data-state="active"] { border-color: rgba(70,184,255,.65); box-shadow: 0 0 0 1px rgba(70,184,255,.35), 0 0 24px rgba(70,184,255,.35), 0 10px 28px rgba(0,0,0,.45); }
.gnode[data-state="ready"] { border-color: rgba(183,168,255,.32); }
.gnode[data-state="done"], .gnode[data-state="pass"] { border-color: rgba(126,216,168,.55); box-shadow: 0 0 0 1px rgba(126,216,168,.2), 0 0 18px rgba(126,216,168,.18), 0 10px 28px rgba(0,0,0,.45); }
.gnode[data-state="done"] .gn-dot, .gnode[data-state="pass"] .gn-dot { background: var(--ok); }
.gnode[data-state="pass"] { --hc: 46,140,100; }
.gnode[data-state="red"] .gn-dot { background: var(--crit); }
.gnode[data-state="fail"] { --hc: 170,64,70; border-color: rgba(239,123,123,.8);
  box-shadow: 0 0 0 calc(1px + 2.5px * var(--pulse)) rgba(239,123,123,calc(.35 + .3 * var(--pulse))), 0 0 calc(12px + 28px * var(--pulse)) rgba(239,123,123,calc(.25 + .35 * var(--pulse))), 0 10px 28px rgba(0,0,0,.45); }
.gnode[data-state="fail"] .gn-dot { background: #fff; }
.gnode[data-state="warn"] { border-color: rgba(239,123,123,.5); }
.gnode[data-state="esc"] { border-color: rgba(232,168,124,.85); box-shadow: 0 0 0 1px rgba(232,168,124,.45), 0 0 30px rgba(232,168,124,.45), 0 10px 28px rgba(0,0,0,.45); }
.t-main[data-state="esc"] { --hc: 176,108,64;
  box-shadow: 0 0 0 calc(1px + 2.5px * var(--pulse)) rgba(232,168,124,calc(.4 + .25 * var(--pulse))), 0 0 calc(16px + 28px * var(--pulse)) rgba(232,168,124,calc(.3 + .3 * var(--pulse))), 0 10px 28px rgba(0,0,0,.45); }
.t-main[data-state="watching"] { border-color: rgba(183,168,255,.4); }
@keyframes blink { 50% { opacity: .35; } }

/* wires */
:root { --pulse: .5; }
.wire { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke: var(--wc); opacity: .3; transition: opacity .35s, stroke .35s; --wc: var(--accent-hi); }
.k-feat { --wc: var(--ice); }
.k-order { --wc: var(--accent-hi); }
.k-tree, .k-diff { --wc: var(--blue); }
.k-pass { --wc: var(--ok); }
.k-out { --wc: var(--ember); }
.k-fail { --wc: var(--crit); }
.k-esc { --wc: var(--ember); }
.wire[data-state="ready"] { opacity: .72; }
.wire[data-state="done"] { opacity: .85; }
.wire[data-state="flow"], .wire[data-state="rev"] { opacity: 1; stroke-dasharray: 10 9; filter: drop-shadow(0 0 4px var(--wc)); stroke-width: 3; }
.k-fail[data-state="flow"], .k-esc[data-state="flow"], .k-esc[data-state="rev"] { stroke-dasharray: 6 7; stroke-width: 3.2; }
.wire[data-state="bad"] { --wc: var(--crit); opacity: .9; }
.wire[data-state="off"] { opacity: 0; }
.wire[data-state="spent"] { opacity: .3; stroke-dasharray: 4 8; }

/* ---------- build overlays ---------- */
.hero { position: absolute; left: 16px; top: 14px; right: 64px; pointer-events: none; z-index: 5; }
.hero h1 { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.h1-word { font-weight: 300; font-size: 26px; letter-spacing: .34em; color: #fff; line-height: 1.1; }
.h1-tag { font-weight: 300; font-size: 15px; color: var(--accent-hi); letter-spacing: .01em; }

.composer {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(13,14,26,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-hi); border-radius: 14px 14px 0 0;
  display: flex; flex-direction: column; gap: 9px;
}
.comp-label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-hi); font-weight: 500; }
.comp-row { display: flex; gap: 8px; }
.comp-row input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-hi);
  background: #0b0c17; color: #fff; font: 400 16px var(--sans);
}
.comp-row input::placeholder { color: #8984ab; }
.comp-row input:focus { outline: none; border-color: var(--accent-hi); box-shadow: 0 0 0 3px rgba(109,90,224,.3); }
.comp-row input.autotype { border-color: var(--accent-hi); }
.btn-ghost { background: var(--glass); }
.comp-hint { margin: 0; font-size: 12px; color: var(--text-2); }
.feat-chips { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.feat-chips:empty { display: none; }
.fchip-b { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 240px; height: 32px; padding: 0 4px 0 6px; border-radius: 999px; background: rgba(54,92,120,.35); border: 1px solid rgba(169,232,255,.35); font-size: 12.5px; }
.fc-num { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(169,232,255,.2); font-size: 11px; }
.fc-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 4px; }
.fc-x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.fc-x:hover { background: rgba(255,255,255,.08); color: #fff; }
.fc-x svg { width: 14px; height: 14px; }
.presets { display: flex; align-items: center; gap: 8px; min-width: 0; }
.presets-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); flex: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar, .feat-chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--glass); font-size: 13px; cursor: pointer; color: var(--text); white-space: nowrap; }
.chip:hover { border-color: var(--border-hi); background: var(--glass-hover); }
.btn-run { width: 100%; height: 48px; }

/* ---------- run overlays ---------- */
.strip {
  position: absolute; left: 0; right: 0; top: 0; z-index: 6; height: var(--strip-h);
  display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 6px 12px;
  background: rgba(13,14,26,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.counters { display: grid; grid-template-columns: .8fr 1.1fr 1.1fr .7fr; gap: 6px; margin: 0; }
.counters div { min-width: 0; }
.counters dt { font-size: 9.5px; letter-spacing: .1em; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.counters dd { margin: 0; font: 500 15px/1.2 var(--mono); color: #fff; font-variant-numeric: tabular-nums; }
.controls { display: flex; gap: 5px; align-items: center; justify-content: space-between; }
.controls .icon-btn { width: 34px; height: 38px; }
.controls .seg button { min-width: 32px; padding: 0 7px; }
@media (max-width: 370px) { .controls .seg button { min-width: 28px; padding: 0 5px; font-size: 12px; } .controls .icon-btn { width: 31px; } }
@media (min-width: 900px) { .controls .icon-btn { width: 40px; } .controls .seg button { min-width: 38px; padding: 0 10px; } }

.gtools { position: absolute; right: 12px; top: 12px; z-index: 7; display: flex; flex-direction: column; gap: 6px; }
.mode-run .gtools { top: calc(var(--strip-h) + 10px); }
.mode-build .strip, .mode-build .summary { display: none; }
.mode-run .hero, .mode-run .composer { display: none; }
.view-lanes .gtools { display: none; }
.view-lanes .gview { visibility: hidden; }

/* ---------- lanes view ---------- */
.lane-view {
  position: absolute; left: 0; right: 0; bottom: 0; top: var(--strip-h); z-index: 5; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 16px 120px; background: rgba(10,11,20,.94);
}
.main-panel { border: 1px solid var(--border-hi); border-radius: 8px; padding: 12px; background: rgba(109,90,224,.08); margin-bottom: 16px; }
.mp-head { display: flex; align-items: center; gap: 10px; }
.mp-title h2 { margin: 0; font-size: 15px; font-weight: 500; }
.mp-title p { margin: 0; font-size: 12px; color: var(--text-2); }
.mp-head .pill { margin-left: auto; }
.mp-now { font: 12px/1.45 var(--mono); color: var(--ice); margin: 10px 0 4px; min-height: 1.45em; }
.sec-label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-hi); font-weight: 500; margin: 12px 0 8px; }
.sec-sub { letter-spacing: .04em; text-transform: none; color: var(--text-2); font-weight: 300; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; color: var(--text-2); }
.pill[data-state="active"], .pill[data-state="working"], .pill[data-state="testing"] { color: #fff; border-color: rgba(70,184,255,.6); background: rgba(70,184,255,.14); }
.pill[data-state="failing"] { color: #ffd0d0; border-color: rgba(239,123,123,.6); background: rgba(239,123,123,.14); }
.pill[data-state="esc"], .pill[data-state="escalated"] { color: var(--ember-hi); border-color: rgba(232,168,124,.6); background: rgba(232,168,124,.14); }
.pill[data-state="passed"], .pill[data-state="done"] { color: var(--ok); border-color: rgba(126,216,168,.5); background: rgba(126,216,168,.1); }
.cards, .lanes { display: grid; gap: 10px; grid-template-columns: 1fr; }
.card, .lane { border: 1px solid var(--border); border-radius: 8px; background: var(--card); padding: 10px 12px; min-width: 0; }
.card-head { display: flex; align-items: baseline; gap: 8px; }
.card-num { font: 11px var(--mono); color: var(--accent-hi); }
.card-head h4 { margin: 0; font-size: 14px; font-weight: 500; }
.card-agent { margin-left: auto; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.card-dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; }
.card-dl dt { font-size: 9.5px; letter-spacing: .12em; color: var(--accent-hi); padding-top: 3px; }
.card-dl dd { margin: 0; min-height: 1.4em; }
.card-from { margin: 6px 0 0; font-size: 11px; color: var(--text-2); }
.card[data-state="passed"] { border-color: rgba(126,216,168,.4); }
.card[data-state="failing"] { border-color: rgba(239,123,123,.5); }
.typing::after { content: "▍"; color: var(--accent-hi); animation: blink .8s steps(1) infinite; }
.lane-head { display: flex; align-items: center; gap: 10px; }
.lane-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(70,184,255,.14); color: var(--blue); flex: none; }
.lane-ico svg { width: 16px; height: 16px; }
.lane-title { min-width: 0; }
.lane-title h4 { margin: 0; font-size: 14px; font-weight: 500; }
.lane-title p { margin: 0; font-size: 11.5px; color: var(--text-2); }
.lane-head .pill { margin-left: auto; }
.lane-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag { font: 11px var(--mono); padding: 2px 8px; border-radius: 4px; background: #0b0c17; border: 1px solid var(--border); color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-branch { color: var(--blue); border-color: rgba(70,184,255,.35); }
.lane-log { list-style: none; margin: 0; padding: 8px 10px; border-radius: 6px; background: #0b0c17; font: 11px/1.55 var(--mono); color: var(--micro); min-height: calc(4 * 1.55em + 16px); }
.lane-log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-log li::before { content: "$ "; color: var(--accent-hi); }
.lane-log li:last-child { color: var(--ice); }
.lane-files { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 0; }
.lane-files:empty { display: none; }
.fchip { font: 10.5px var(--mono); padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); animation: fadein .4s both; }
.lane-assert { margin: 8px 0 0; padding: 8px 10px; border-radius: 6px; background: rgba(239,123,123,.1); border: 1px dashed rgba(239,123,123,.45); font: 11px/1.45 var(--mono); color: #ffcfcf; white-space: pre-wrap; }
.lane-callout { margin: 8px 0 0; padding: 8px 10px; border-radius: 6px; font-size: 12.5px; border: 1px solid rgba(232,168,124,.5); background: rgba(232,168,124,.1); color: var(--ember-hi); }
.lane-callout[data-kind="hint"] { border-color: rgba(183,168,255,.5); background: rgba(109,90,224,.14); color: var(--text); }
.testbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.segs { display: flex; gap: 3px; flex: 1; }
.segs i { flex: 1; height: 8px; border-radius: 2px; background: #23243a; transition: background .25s; }
.segs i.ok { background: var(--ok); }
.segs i.bad { background: var(--crit); }
.segs i.run { background: rgba(70,184,255,.45); }
.tlabel { font: 11px var(--mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.lane-stamp { display: inline-block; margin-top: 8px; font-size: 11px; letter-spacing: .08em; color: var(--ok); border: 1px solid rgba(126,216,168,.45); padding: 2px 8px; border-radius: 4px; }
.lane[data-state="failing"] { border-color: rgba(239,123,123,.55); }
.lane[data-state="escalated"] { border-color: rgba(232,168,124,.7); }
.lane[data-state="passed"] { border-color: rgba(126,216,168,.45); }

/* ---------- summary sheet ---------- */
.summary {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; max-height: 62%; overflow-y: auto;
  background: rgba(13,14,26,.95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(126,216,168,.45); border-radius: 14px 14px 0 0; padding: 0 16px calc(14px + env(safe-area-inset-bottom));
  outline: none;
}
.sum-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 46px; border: 0; background: transparent; cursor: pointer; padding: 6px 0; }
.sum-toggle svg { width: 18px; height: 18px; transform: rotate(180deg); transition: transform .3s; color: var(--text-2); }
.summary.collapsed .sum-toggle svg { transform: none; }
.summary.collapsed .sum-body { display: none; }
.stamp-mini { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ok); border: 1.5px solid rgba(126,216,168,.6); padding: 4px 10px; border-radius: 4px; transform: rotate(-1.5deg); font-weight: 500; }
.sum-body h2 { margin: 2px 0 8px; font-size: 17px; font-weight: 400; display: flex; align-items: center; gap: 10px; }
.sum-all { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ok); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 10px; }
.stats div { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; min-width: 0; }
.stats dt { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.stats dd { margin: 0; font: 500 16px var(--mono); color: #fff; }
.split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: #23243a; }
.split-main { background: var(--accent); }
.split-local { background: var(--blue); }
.split-note { font-size: 12px; color: var(--text-2); margin: 6px 0 10px; }
.sum-actions { display: flex; gap: 8px; }
.sum-actions .btn { flex: 1; }
.sum-cta { font-size: 13px; margin: 12px 0 0; color: var(--text); text-align: center; }

/* ---------- below the fold ---------- */
.how { max-width: 880px; margin: 0 auto; padding: 36px 16px 8px; }
.eyebrow { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--accent-hi); font-weight: 500; margin: 0 0 12px; }
.how ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.how li { counter-increment: s; position: relative; padding: 12px 14px 12px 46px; border: 1px solid var(--border); border-radius: 8px; background: var(--glass); color: var(--text-2); font-size: 14px; }
.how li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 14px; top: 12px; font: 12px var(--mono); color: var(--accent-hi); }
.how b { color: var(--text); font-weight: 500; }
.foot { text-align: center; padding: 32px 16px 44px; border-top: 1px solid var(--border); margin-top: 32px; }
.foot-cta { margin: 0; font-size: 18px; font-weight: 300; color: #fff; }
.foot-dm { margin: 4px 0 10px; font-size: 15px; }
.foot-meta { margin: 0 0 12px; font-size: 13px; color: var(--text-2); letter-spacing: .02em; }
.foot-note { margin: 0 auto; max-width: 560px; font-size: 12px; color: var(--footer, #9E9ABD); }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  :root { --strip-h: 60px; }
  .hero { left: 28px; top: 24px; right: auto; width: 380px; }
  .h1-word { font-size: 34px; }
  .h1-tag { font-size: 17px; }
  .composer { left: 28px; right: auto; bottom: auto; top: 118px; width: 380px; max-height: calc(100% - 140px); overflow-y: auto; border-radius: 12px; border: 1px solid var(--border-hi); padding: 18px; }
  .feat-chips { flex-wrap: wrap; overflow: visible; }
  .chips { flex-wrap: wrap; overflow: visible; }
  .presets { align-items: flex-start; }
  .presets-label { padding-top: 10px; }
  .strip { flex-direction: row; align-items: center; justify-content: space-between; padding: 0 16px; }
  .counters { display: flex; gap: 26px; }
  .controls { justify-content: flex-end; gap: 8px; }
  .lane-view { padding: 20px 28px 120px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .lanes { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .summary { left: auto; right: 16px; bottom: 16px; width: 420px; border-radius: 12px; border: 1px solid rgba(126,216,168,.45); max-height: calc(100% - var(--strip-h) - 32px); }
  .how ol { grid-template-columns: 1fr 1fr; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body.rm *, body.rm *::before, body.rm *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
body.rm .wire[data-state="flow"], body.rm .wire[data-state="rev"] { stroke-dasharray: 10 6; }

/* capture mode: every motion is driven by the app clock in JS, so CSS motion is off */
body.capture *:not(.keepalive), body.capture *::before, body.capture *::after { animation: none !important; transition: none !important; }
/* keeps the compositor producing frames for screenshots of an occluded window */
.keepalive { position: fixed; left: 0; top: 0; width: 1px; height: 1px; pointer-events: none; animation: keepalive 1s linear infinite; }
@keyframes keepalive { from { background-color: rgba(10,11,20,.02); } to { background-color: rgba(10,11,21,.03); } }
html:has(body.capture) { overflow: hidden; scrollbar-width: none; }
body.capture { overflow: hidden; }

/* comfortable tap targets for the footer and summary CTAs */
.foot-dm a, .foot-meta a, .sum-cta a { display: inline-block; padding: 5px 2px; margin: -5px 0; }
