:root {
  --bg: #050b16; --bg-2: #07101f; --surface: #0b1626; --surface-2: #0f1d31; --line: rgba(160, 190, 230, .13); --line-2: rgba(160, 190, 230, .24);
  --text: #e8f0fb; --text-2: #a9b8cc; --text-3: #6f8098;
  --brand: #9bd83a; --brand-2: #3aa8ff; --ok: #6fdc8c; --bad: #ff6b7a; --warn: #ffc25c; --info: #6cc4ff; --muted: #7d8aa0;
  --must: #ff8a5c; --opt: #8fa3bf; --remember: #ffd166; --limit: #c792ea; --tip: #6cc4ff;
  --radius: 14px; --radius-lg: 20px; --ease: cubic-bezier(.2, .7, .2, 1);
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f7fb; --bg-2: #eef3f9; --surface: #ffffff; --surface-2: #f3f6fb; --line: rgba(20, 40, 70, .12); --line-2: rgba(20, 40, 70, .22);
  --text: #0c1a2c; --text-2: #3c4d63; --text-3: #6a7a8f; --brand: #4f9a12; --brand-2: #1677d2; color-scheme: light;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --bg: #f4f7fb; --bg-2: #eef3f9; --surface: #fff; --surface-2: #f3f6fb; --line: rgba(20,40,70,.12); --line-2: rgba(20,40,70,.22); --text: #0c1a2c; --text-2: #3c4d63; --text-3: #6a7a8f; --brand: #4f9a12; --brand-2: #1677d2; color-scheme: light; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font-body); overflow-x: clip; }
body { min-height: 100vh; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--font-mono); }
::selection { background: color-mix(in srgb, var(--brand) 35%, transparent); }

/* ---------- Buttons / chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; transition: .2s var(--ease); white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--brand-2); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(95deg, var(--brand-2), color-mix(in srgb, var(--brand) 85%, var(--brand-2))); color: #04101d; border: 0; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: color-mix(in srgb, var(--bad) 60%, transparent); color: var(--bad); background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.chip.target { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.chip.source { color: var(--brand-2); border-color: color-mix(in srgb, var(--brand-2) 45%, transparent); }
.chip.win { color: var(--limit); border-color: color-mix(in srgb, var(--limit) 45%, transparent); }
.chip.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.tag { display: inline-block; font: 700 10px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; margin-right: 6px; vertical-align: 1px; }
.tag.must { background: color-mix(in srgb, var(--must) 18%, transparent); color: var(--must); }
.tag.opt { background: color-mix(in srgb, var(--opt) 18%, transparent); color: var(--opt); }
.tag.remember { background: color-mix(in srgb, var(--remember) 18%, transparent); color: var(--remember); }
.tag.limit { background: color-mix(in srgb, var(--limit) 18%, transparent); color: var(--limit); }
.tag.tip { background: color-mix(in srgb, var(--tip) 18%, transparent); color: var(--tip); }
.tag.warn { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--font-body); padding: 6px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.t-ok { color: var(--ok); } .t-bad { color: var(--bad); } .t-warn { color: var(--warn); } .t-info { color: var(--info); } .t-muted { color: var(--muted); }

/* ---------- Landing ---------- */
#landing { position: fixed; inset: 0; overflow: hidden; display: grid; place-items: center; background: radial-gradient(120% 80% at 50% 110%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 60%), var(--bg); z-index: 5; }
#flow { position: absolute; inset: 0; width: 100%; height: 100%; }
.land { position: relative; text-align: center; padding: 24px 16px; max-width: 940px; }
.land .logo { width: 78px; height: 78px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 0 60px -10px rgba(155,216,58,.6), 0 0 90px -20px rgba(58,168,255,.7); }
.land .eyebrow { margin-top: 18px; font: 600 12px/1 var(--font-mono); letter-spacing: .28em; color: var(--brand); text-transform: uppercase; }
.land h1 { font: 700 clamp(38px, 6.4vw, 82px)/1.0 var(--font-display); letter-spacing: -.03em; margin: 16px 0 14px; }
.grad { background: linear-gradient(95deg, #3aa8ff 0%, #5fc6c8 45%, #9bd83a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.land p.lead { color: var(--text-2); font-size: clamp(15px, 1.6vw, 19px); max-width: 680px; margin: 0 auto; }
.land .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.land .ms { display: inline-grid; grid-template-columns: repeat(2, 8px); gap: 2px; }
.land .ms i { width: 8px; height: 8px; display: block; } .ms i:nth-child(1){background:#f25022}.ms i:nth-child(2){background:#7fba00}.ms i:nth-child(3){background:#00a4ef}.ms i:nth-child(4){background:#ffb900}
.land .stats { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-top: 38px; color: var(--text-3); font: 500 13px/1.3 var(--font-mono); }
.land .stats b { display: block; font: 700 26px/1 var(--font-display); color: var(--text); margin-bottom: 6px; }
.land .live-note { margin-top: 18px; font-size: 13px; color: var(--text-3); min-height: 20px; }
#landing .tenants { position: absolute; top: 50%; width: 100%; left: 0; display: flex; justify-content: space-between; padding: 0 6vw; pointer-events: none; font: 600 11px/1 var(--font-mono); letter-spacing: .25em; color: var(--text-3); transform: translateY(-50%); }

/* ---------- App shell ---------- */
#app { display: grid; grid-template-columns: 260px minmax(0, 1fr) 330px; grid-template-rows: 60px minmax(0, 1fr) auto; grid-template-areas: "top top top" "rail main notes" "rail console notes"; height: 100vh; }
#app.no-notes { grid-template-columns: 260px minmax(0, 1fr) 0; }
#app.no-notes .notes { display: none; }
.top { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); min-width: 0; }
.top .brand { display: flex; align-items: center; gap: 10px; font: 700 15px/1.1 var(--font-display); white-space: nowrap; }
.top .brand img { width: 30px; height: 30px; border-radius: 50%; }
.top .brand small { display: block; font: 500 9.5px/1 var(--font-mono); letter-spacing: .2em; color: var(--text-3); margin-top: 3px; }
.top .proj { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.top .spacer { flex: 1; }
.top .tenants { display: flex; gap: 6px; }
.mode { white-space: nowrap; font: 700 11px/1 var(--font-mono); letter-spacing: .14em; padding: 6px 9px; border-radius: 6px; }
.mode.demo { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.mode.live { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text-2); }
.iconbtn:hover { color: var(--text); border-color: var(--line-2); }

.rail { grid-area: rail; border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 10px; background: var(--bg-2); }
.rail .ph { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; color: var(--text-2); border: 1px solid transparent; }
.rail .ph:hover { background: var(--surface); }
.rail .ph.on { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.rail .ph .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--font-mono); position: relative; }
.rail .ph .n svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.rail .ph b { display: block; font: 600 14px/1.2 var(--font-display); }
.rail .ph small { display: block; font-size: 11.5px; color: var(--text-3); line-height: 1.3; margin-top: 2px; }
.rail .ph .cnt { font: 600 11px/1 var(--font-mono); color: var(--text-3); }
.rail .ph.done .n { color: var(--brand); }
.rail .sess { margin-top: 18px; padding: 12px 10px 4px; border-top: 1px solid var(--line); }
.rail .sess h5 { font: 600 10.5px/1 var(--font-mono); letter-spacing: .2em; color: var(--text-3); margin-bottom: 10px; text-transform: uppercase; }
.rail .sess div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); padding: 4px 0; }

main#main { grid-area: main; overflow-y: auto; padding: 26px clamp(16px, 3vw, 38px) 60px; min-width: 0; }
.ph-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ph-head .k { font: 600 11.5px/1 var(--font-mono); letter-spacing: .22em; color: var(--brand); text-transform: uppercase; }
.ph-head h2 { font: 700 clamp(26px, 3vw, 36px)/1.1 var(--font-display); letter-spacing: -.02em; margin-top: 8px; }
.ph-head p { color: var(--text-2); margin-top: 6px; max-width: 70ch; }
.ph-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: -8px 0 22px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .6s var(--ease); }

/* ---------- Step cards ---------- */
.steps { display: grid; gap: 12px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: border-color .3s; }
.step.st-running { border-color: color-mix(in srgb, var(--info) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 12%, transparent); }
.step.st-ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.step.st-fail { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.step.na { opacity: .5; }
.step .hd { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px 18px; cursor: pointer; }
.step .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-2); font: 700 12px/1 var(--font-mono); color: var(--text-3); }
.step.st-ok .ico { background: var(--ok); border-color: var(--ok); color: #05210f; }
.step.st-fail .ico { background: var(--bad); border-color: var(--bad); color: #2a0509; }
.step.st-running .ico { border-color: var(--info); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.step.st-warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.step.st-warn .ico { background: var(--warn); border-color: var(--warn); color: #2a1a00; }
.step .msg.warnm { color: var(--warn); }
.step.st-skip .ico, .step.st-manual .ico { background: var(--surface-2); color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }
.step .ttl { font: 600 15.5px/1.3 var(--font-display); }
.step .ttl .id { font: 600 11.5px/1 var(--font-mono); color: var(--text-3); margin-right: 8px; letter-spacing: .05em; }
.step .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.step .msg { font-size: 13px; margin-top: 6px; color: var(--text-2); }
.step .msg.ok { color: var(--ok); } .step .msg.fail { color: var(--bad); }
.step .run { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.step .bd { padding: 0 18px 18px 60px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.step .why { color: var(--text-2); font-size: 14px; }
.step .nlist { display: grid; gap: 6px; }
.step .nlist div { font-size: 13.5px; color: var(--text-2); }
.code { position: relative; border: 1px solid var(--line); border-radius: 10px; background: #030812; }
:root[data-theme="light"] .code { background: #0c1424; }
.code pre { padding: 14px 16px; overflow: auto; max-height: 360px; font-size: 12.5px; line-height: 1.55; color: #cfe3ff; white-space: pre; }
.code .cp { position: absolute; top: 8px; right: 8px; }
.code .kw { color: #9bd83a; } .code .vr { color: #ffd166; } .code .st { color: #7fd1ff; } .code .cm { color: #61748e; font-style: italic; }
.inline-input { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-input input, .inline-input select { min-width: 220px; }
.gate { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); color: var(--text); }
.callout { font-size: 13.5px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--brand-2) 8%, transparent); border: 1px solid color-mix(in srgb, var(--brand-2) 30%, transparent); color: var(--text-2); }
.callout b { color: var(--text); }
.callout.warn { background: color-mix(in srgb, var(--warn) 9%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.callout.bad { background: color-mix(in srgb, var(--bad) 9%, transparent); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.callout.ok { background: color-mix(in srgb, var(--ok) 8%, transparent); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 420px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font: 600 11px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.mono { font-size: 12px; }
.tbl .flag { color: var(--bad); font-weight: 600; }
.cell { display: inline-block; font: 600 11px/1 var(--font-mono); padding: 5px 7px; border-radius: 6px; background: var(--surface-2); }
.cell.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.cell.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.cell.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.cell.info { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.cell.muted { color: var(--muted); }

/* ---------- Forms ---------- */
.intake { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.fs { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 20px; margin-bottom: 16px; }
.fs > h3 { font: 600 17px/1.2 var(--font-display); display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.fs > h3 .n { font: 600 11px/1 var(--font-mono); color: var(--brand); letter-spacing: .15em; }
.fs > p.sub { color: var(--text-3); font-size: 13px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.f { display: grid; gap: 6px; min-width: 0; }
.f label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.f label .req { color: var(--must); font: 700 10px/1 var(--font-mono); letter-spacing: .08em; }
.f label .optl { color: var(--text-3); font: 600 10px/1 var(--font-mono); letter-spacing: .08em; }
input[type=text], input[type=password], input[type=datetime-local], input[type=number], select, textarea { width: 100%; min-width: 0; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; outline: none; transition: border-color .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent); }
input.invalid { border-color: var(--bad); }
textarea { font: 12.5px/1.5 var(--font-mono); resize: vertical; min-height: 120px; }
.f .hint { font-size: 12px; color: var(--text-3); }
.f .err { font-size: 12px; color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; color: var(--text-2); }
.check input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.wl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.wl label { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; cursor: pointer; display: grid; gap: 6px; transition: .2s; background: var(--bg-2); }
.wl label.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--bg-2)); }
.wl label b { font: 600 15px/1.2 var(--font-display); display: flex; justify-content: space-between; align-items: center; }
.wl label code { font-size: 11px; color: var(--brand); }
.wl label span { font-size: 12.5px; color: var(--text-3); }
.wl input { display: none; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; color: var(--text-3); font-size: 13.5px; transition: .2s; }
.drop.over { border-color: var(--brand); color: var(--text); }
.ready { position: sticky; top: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 20px; }
.ready h3 { font: 600 17px/1.2 var(--font-display); }
.ready .score { font: 700 46px/1 var(--font-display); margin: 12px 0 2px; }
.ready ul { list-style: none; display: grid; gap: 8px; margin-top: 14px; font-size: 13px; }
.ready li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; color: var(--text-2); }
.ready li i { font-style: normal; font-weight: 700; }

/* ---------- Notes drawer ---------- */
.notes { grid-area: notes; border-left: 1px solid var(--line); overflow-y: auto; background: var(--bg-2); padding: 18px 16px 30px; }
.notes h4 { font: 600 11px/1 var(--font-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--text-3); margin: 4px 0 12px; display: flex; justify-content: space-between; align-items: center; }
.notes .filt { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.notes .filt button { font: 600 10px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line); background: none; border-radius: 6px; padding: 5px 7px; cursor: pointer; color: var(--text-3); }
.notes .filt button.on { color: var(--text); border-color: var(--line-2); background: var(--surface); }
.note { font-size: 13px; color: var(--text-2); padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; }
.note .src { display: block; margin-top: 6px; font: 500 10.5px/1.3 var(--font-mono); color: var(--text-3); }

/* ---------- Console ---------- */
.console { grid-area: console; border-top: 1px solid var(--line); background: #030812; display: flex; flex-direction: column; height: 210px; min-height: 0; transition: height .3s var(--ease); }
.console.min { height: 38px; }
:root[data-theme="light"] .console { background: #0b1322; }
.console .bar { display: flex; align-items: center; gap: 4px; padding: 0 8px; height: 38px; border-bottom: 1px solid rgba(160,190,230,.12); flex: none; overflow-x: auto; }
.console .bar .t { font: 600 10.5px/1 var(--font-mono); letter-spacing: .18em; color: #6f8098; padding: 0 8px; white-space: nowrap; }
.console .tab { font: 600 11.5px/1 var(--font-mono); padding: 7px 10px; border-radius: 7px; border: 0; background: none; color: #8ea0b8; cursor: pointer; white-space: nowrap; }
.console .tab.on { background: rgba(160,190,230,.12); color: #e8f0fb; }
.console .tab i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: #4a5a70; vertical-align: 1px; }
.console .tab i.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.console .tab i.busy { background: var(--info); box-shadow: 0 0 8px var(--info); }
.console .log { flex: 1; overflow: auto; padding: 10px 14px; font: 12px/1.55 var(--font-mono); color: #b9cbe3; white-space: pre-wrap; word-break: break-word; }
.console .log .p { color: #9bd83a; } .console .log .e { color: #ff8b98; } .console .log .w { color: #ffd166; } .console .log .o { color: #6cc4ff; } .console .log .d { color: #61748e; }

/* ---------- Batches ---------- */
.batch { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 18px; margin-bottom: 16px; }
.batch .bh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.batch h3 { font: 700 20px/1.1 var(--font-display); }
.batch .sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; font-family: var(--font-mono); }
.lifecycle { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 16px 0; }
.lifecycle div { position: relative; padding-top: 12px; font: 600 10.5px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.lifecycle div::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--surface-2); }
.lifecycle div.done::before { background: var(--brand); }
.lifecycle div.cur::before { background: linear-gradient(90deg, var(--brand), var(--brand-2)); animation: pulse 1.6s ease-in-out infinite; }
.lifecycle div.cur { color: var(--text); }
.lifecycle div.bad::before { background: var(--bad); }
@keyframes pulse { 50% { opacity: .45; } }
.batch .acts { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.batch .kv { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.batch .kv b { color: var(--text); font-weight: 600; }
.errs { display: grid; gap: 8px; margin: 10px 0; }
.err-card { border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 7%, transparent); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.err-card b { color: var(--bad); }
.err-card .fix { color: var(--text-2); margin-top: 4px; }

/* ---------- Guide ---------- */
.guide-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.guide-bar input { max-width: 380px; }
.gcols { columns: 2 380px; column-gap: 14px; }
.gcols .note { break-inside: avoid; }
.gsec { margin: 30px 0 12px; font: 700 22px/1.2 var(--font-display); }
.srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.srcs a { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); font-size: 13.5px; color: var(--text); display: block; }
.srcs a small { display: block; color: var(--text-3); font: 500 11px/1.3 var(--font-mono); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(2, 6, 14, .72); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal .box { width: min(560px, 100%); max-height: 90vh; overflow: auto; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface); padding: 26px; box-shadow: 0 40px 120px -30px #000; }
.modal h3 { font: 700 22px/1.2 var(--font-display); }
.modal p { color: var(--text-2); margin-top: 8px; font-size: 14px; }
.modal .code-big { font: 700 clamp(30px, 7vw, 44px)/1 var(--font-mono); letter-spacing: .14em; text-align: center; padding: 22px 10px; margin: 18px 0; border-radius: 14px; background: var(--bg-2); border: 1px dashed var(--line-2); color: var(--brand); user-select: all; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 8px; max-width: calc(100vw - 36px); }
.toast div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; font-size: 13.5px; box-shadow: 0 20px 50px -20px #000; animation: tin .3s var(--ease); max-width: 420px; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

.muted { color: var(--text-3); }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 14px; } .mt2 { margin-top: 24px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 14px 16px; }
.kpi b { display: block; font: 700 26px/1 var(--font-display); }
.kpi span { font-size: 12px; color: var(--text-3); }
.mobile-only { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { #app { grid-template-columns: 230px minmax(0, 1fr) 0; } #app .notes { display: none; } #app.show-notes .notes { display: block; position: fixed; top: 60px; right: 0; bottom: 0; width: min(360px, 92vw); z-index: 30; box-shadow: -30px 0 80px -30px #000; } }
@media (max-width: 1100px) { .intake { grid-template-columns: 1fr; } .ready { position: static; } .wl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px auto minmax(0, 1fr) auto; grid-template-areas: "top" "rail" "main" "console"; }
  .top { gap: 8px; padding: 0 12px; } .top .proj, .top .tenants, .top .hide-m { display: none; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; padding: 8px; gap: 6px; scrollbar-width: none; }
  .rail .ph { grid-template-columns: 28px auto; padding: 6px 10px 6px 6px; flex: none; }
  .rail .ph small, .rail .ph .cnt, .rail .sess { display: none; }
  .rail .ph .n { width: 28px; height: 28px; font-size: 10.5px; }
  .rail .ph b { font-size: 13px; white-space: nowrap; }
  main#main { padding: 18px 16px 40px; }
  .grid2, .grid3, .kpis { grid-template-columns: minmax(0, 1fr); }
  .wl { grid-template-columns: minmax(0, 1fr); }
  .step .hd { grid-template-columns: 26px minmax(0, 1fr); }
  .step .run { grid-column: 1 / -1; justify-content: flex-start; }
  .step .bd { padding: 0 14px 16px; }
  .console { height: 170px; }
  .lifecycle { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
  .mobile-only { display: inline-flex; }
  #landing .tenants { display: none; }
}
