/* sazi leads console — hand-rolled design system, no dependencies. */

:root {
  --bg0: #05080f;
  --bg1: #0a101d;
  --panel: rgba(148, 163, 184, .055);
  --panel2: rgba(148, 163, 184, .1);
  --line: rgba(148, 163, 184, .14);
  --line2: rgba(148, 163, 184, .26);
  --fg: #e8eef7;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #5eead4;
  --accent2: #38bdf8;
  --violet: #818cf8;
  --grad: linear-gradient(120deg, #5eead4, #38bdf8 55%, #818cf8);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 18px 50px rgba(2, 6, 16, .55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.55 var(--sans);
  color: var(--fg);
  background: var(--bg0);
  -webkit-font-smoothing: antialiased;
}

/* slow aurora backdrop — two drifting glows, GPU-composited only */
body::before, body::after {
  content: "";
  position: fixed;
  inset: -30vmax;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background:
    radial-gradient(38vmax 38vmax at 18% 12%, rgba(56, 189, 248, .13), transparent 60%),
    radial-gradient(30vmax 30vmax at 82% 78%, rgba(129, 140, 248, .1), transparent 60%);
  animation: drift1 46s ease-in-out infinite alternate;
}
body::after {
  background: radial-gradient(34vmax 34vmax at 70% 20%, rgba(94, 234, 212, .07), transparent 60%);
  animation: drift2 58s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate3d(4vw, 3vh, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(-3vw, -4vh, 0) scale(1.12); } }

::selection { background: rgba(94, 234, 212, .25); }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- shared controls ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 9px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line2); color: var(--fg);
  transition: border-color .15s, background .15s, transform .1s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary {
  background: var(--grad); border: none; color: #04121a; font-weight: 650;
  box-shadow: 0 6px 22px rgba(56, 189, 248, .25);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); border-color: var(--line2); }
.btn.danger:hover { border-color: var(--err); color: var(--err); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }

input[type=text], input[type=email], input[type=password] {
  font: inherit; color: var(--fg);
  background: rgba(2, 8, 18, .5); border: 1px solid var(--line2); border-radius: 9px;
  padding: 9px 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(56, 189, 248, .14); }
input::placeholder { color: var(--dim); }

.pill {
  font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: .8px;
  padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line2); color: var(--muted);
}
.pill.running, .pill.queued, .pill.pausing { color: var(--accent2); border-color: var(--accent2); }
.pill.running, .pill.queued { animation: pulse 1.8s ease-in-out infinite; }
.pill.paused { color: var(--warn); border-color: var(--warn); }
.pill.done { color: var(--ok); border-color: var(--ok); }
.pill.failed, .pill.stopped { color: var(--err); border-color: var(--err); }
.pill.idle { color: var(--dim); }
@keyframes pulse { 50% { opacity: .5; } }

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.status-dot.running, .status-dot.queued, .status-dot.pausing { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); animation: pulse 1.8s infinite; }
.status-dot.paused { background: var(--warn); }
.status-dot.done { background: var(--ok); }
.status-dot.failed, .status-dot.stopped { background: var(--err); }

/* ---------- auth pages ---------- */

.auth-wrap {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
  position: relative; z-index: 1;
}
.auth-card {
  width: min(400px, 100%);
  background: rgba(10, 16, 29, .72);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line2); border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 34px 32px 28px;
}
.auth-card .brand { margin-bottom: 26px; text-align: center; }
.auth-card h1 { font-size: 19px; font-weight: 600; margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; text-align: center; }
.auth-card label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 5px; letter-spacing: .3px; }
.auth-card input { width: 100%; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 22px; }
.auth-card .alt { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth-error {
  background: rgba(248, 113, 113, .09); border: 1px solid rgba(248, 113, 113, .35);
  color: #fca5a5; border-radius: 9px; padding: 9px 12px; font-size: 13px; margin-bottom: 6px;
}
.auth-status {
  background: rgba(94, 234, 212, .08); border: 1px solid rgba(94, 234, 212, .3);
  color: #99f6e4; border-radius: 9px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
.remember { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.remember input { accent-color: var(--accent2); }

.brand {
  font-size: 24px; font-weight: 750; letter-spacing: -.5px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .tick { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.brand-sub {
  display: block; font: 10px var(--mono); letter-spacing: 3px; text-transform: uppercase;
  color: var(--dim); margin-top: 3px; -webkit-text-fill-color: var(--dim);
}

/* ---------- app shell ---------- */

#app { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px; height: 58px; flex: none;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 10, 19, .65); backdrop-filter: blur(14px);
}
.topbar .spacer { flex: 1; }
.userchip {
  display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px;
  padding: 5px 10px; border-radius: 99px; border: 1px solid transparent;
}
.userchip:hover { border-color: var(--line2); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #04121a; font-size: 11px; font-weight: 700; flex: none;
}

.shell { flex: 1; display: flex; min-height: 0; }

/* campaigns rail */
.rail {
  width: 292px; flex: none; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: rgba(7, 11, 20, .5);
}
.rail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; color: var(--dim);
  font: 10.5px var(--mono); letter-spacing: 2px; text-transform: uppercase;
}
.rail-list { flex: 1; overflow-y: auto; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.camp {
  position: relative; display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 10px 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.camp:hover { background: var(--panel); }
.camp.sel { background: var(--panel2); border-color: var(--line2); }
.camp.sel::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 3px; background: var(--grad);
}
.camp .status-dot { margin-top: 6px; }
.camp .nm { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp .meta { color: var(--dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp .del {
  position: absolute; right: 8px; top: 8px; opacity: 0;
  background: none; border: none; color: var(--dim); cursor: pointer; font-size: 14px;
  padding: 3px; border-radius: 6px; line-height: 1;
}
.camp:hover .del { opacity: 1; }
.camp .del:hover { color: var(--err); }

/* work area */
.work { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.work-inner { flex: 1; overflow-y: auto; padding: 22px 26px 40px; }

.runhead { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.runhead .title { min-width: 0; }
.runhead h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.runhead .dom { color: var(--muted); font-size: 13px; }
.runhead h2 .grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.runhead .ctl { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.runhead .when { color: var(--dim); font-size: 11.5px; }

.tabs { display: flex; gap: 2px; margin: 16px 0 20px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 8px 14px 10px; font-size: 13.5px; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--fg); }
.tab.on { color: var(--fg); border-color: var(--accent); }

/* overview */
.stagebar { display: flex; align-items: center; gap: 0; margin: 6px 0 20px; overflow-x: auto; padding-bottom: 4px; }
.stagebar .node { display: flex; align-items: center; flex: none; }
.stagebar .node .dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line2); color: var(--dim); font: 11px var(--mono);
  background: var(--bg1); transition: all .3s; flex: none;
}
.stagebar .node.done .dot { border-color: var(--ok); color: var(--ok); }
.stagebar .node.now .dot {
  border-color: var(--accent2); color: #04121a; background: var(--accent2);
  box-shadow: 0 0 0 0 rgba(56, 189, 248, .5); animation: ring 1.8s infinite;
}
@keyframes ring {
  70% { box-shadow: 0 0 0 9px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}
.stagebar .node .lbl {
  margin: 0 12px 0 8px; font-size: 12px; color: var(--muted); white-space: nowrap;
}
.stagebar .node.done .lbl { color: var(--fg); }
.stagebar .node.now .lbl { color: var(--accent2); font-weight: 600; }
.stagebar .link { width: 34px; height: 1.5px; background: var(--line2); flex: none; margin: 0 2px; }
.stagebar .link.done { background: var(--ok); }

.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 20px; }
.count { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.count b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.count span { font: 10px var(--mono); text-transform: uppercase; letter-spacing: 1.2px; color: var(--dim); }
.count.bump b { animation: bump .7s ease; }
@keyframes bump { 30% { color: var(--accent); transform: translateY(-2px); } }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; margin-bottom: 18px;
}
.panel > h3 {
  margin: 0 0 12px; font: 10.5px var(--mono); letter-spacing: 2px; text-transform: uppercase;
  color: var(--dim); display: flex; align-items: center; gap: 8px;
}
.panel > h3 .live { color: var(--accent2); animation: pulse 1.8s infinite; }

.guidance {
  border: 1px dashed rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .05);
  border-radius: var(--r-sm); padding: 10px 14px; font-size: 12.5px; color: #fde68a;
  white-space: pre-wrap; margin-bottom: 18px;
}
.guidance b { font: 10px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; display: block; margin-bottom: 3px; color: var(--warn); }

.feed { display: flex; flex-direction: column; font: 12px/1.8 var(--mono); max-height: 340px; overflow-y: auto; }
.ev { display: flex; gap: 12px; padding: 1px 2px; animation: fadein .4s ease; }
.ev .t { color: var(--dim); flex: none; }
.ev .k { width: 74px; flex: none; text-align: right; }
.ev .d { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.reading .k { color: var(--accent2); }
.ev.page .k, .ev.company .k, .ev.draft .k { color: var(--ok); }
.ev.stage_start .k { color: var(--accent2); }
.ev.stage_done .k { color: var(--ok); }
.ev.steer .k, .ev.paused .k { color: var(--warn); }
.ev.failed .k, .ev.stopped .k { color: var(--err); }
.ev.launched .k, .ev.resumed .k, .ev.done .k { color: var(--ok); }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } }

/* insights */
.md { font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.md h1, .md h2 { color: var(--fg); font-size: 14px; letter-spacing: .3px; margin: 14px 0 6px; }
.md p { margin: 6px 0; }
.md ul { margin: 6px 0; padding-left: 20px; }
.md li { margin: 3px 0; }
.md strong { color: var(--fg); }
.md a { color: var(--accent2); }
.clamp { max-height: 150px; overflow: hidden; position: relative; transition: max-height .4s ease; }
.clamp.open { max-height: 4000px; }
.clamp-fade { position: absolute; inset: auto 0 0 0; height: 56px; background: linear-gradient(transparent, var(--bg1)); }
.link-more { background: none; border: none; color: var(--accent2); cursor: pointer; padding: 6px 0 0; font-size: 12.5px; }

.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.seg {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .2s, transform .15s;
}
.seg:hover { border-color: var(--line2); transform: translateY(-2px); }
.seg .top { display: flex; align-items: center; gap: 12px; }
.seg h4 { margin: 0; font-size: 15px; font-weight: 650; flex: 1; min-width: 0; }
.fitring { --v: 0; width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--accent2) calc(var(--v) * 1%), var(--line) 0);
  display: grid; place-items: center; position: relative;
}
.fitring::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--bg1); }
.fitring b { position: relative; font-size: 11px; font-weight: 700; color: var(--fg); }
.seg .why { color: var(--muted); font-size: 12.5px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font: 10.5px var(--mono); padding: 3px 8px; border-radius: 6px;
  background: rgba(2, 8, 18, .5); border: 1px solid var(--line); color: var(--muted);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip.dm { color: var(--accent); border-color: rgba(94, 234, 212, .3); }
.chip.dq { color: #fda4af; border-color: rgba(248, 113, 113, .3); }
.seg .foot { display: flex; align-items: center; margin-top: auto; padding-top: 4px; }
.seg .foot .n { color: var(--dim); font-size: 12px; }
.seg .foot .go { margin-left: auto; background: none; border: none; color: var(--accent2); cursor: pointer; font-size: 12.5px; }
.seg .foot .go:hover { text-decoration: underline; }

.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); margin-bottom: 14px; flex-wrap: wrap; }
.crumb button { background: none; border: none; color: var(--accent2); cursor: pointer; font-size: 12.5px; padding: 0; }
.crumb .sep { opacity: .5; }
.crumb .here { color: var(--fg); }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.toolbar input { flex: 1; max-width: 340px; }
.toolbar .n { color: var(--dim); font-size: 12px; }

.colist { display: flex; flex-direction: column; gap: 8px; }
.co {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.co:hover { border-color: var(--accent2); background: var(--panel2); }
.co .fit {
  font: 11px var(--mono); width: 44px; height: 26px; border-radius: 7px; flex: none;
  display: grid; place-items: center; border: 1px solid;
}
.fit.hi { color: var(--ok); border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .08); }
.fit.mid { color: var(--accent2); border-color: rgba(56, 189, 248, .4); background: rgba(56, 189, 248, .08); }
.fit.lo { color: var(--dim); border-color: var(--line2); }
.co .main { flex: 1; min-width: 0; }
.co .nm { font-weight: 600; font-size: 13.5px; }
.co .sub { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co .sub .loc { color: var(--muted); }
.co .nums { color: var(--dim); font: 11px var(--mono); flex: none; text-align: right; line-height: 1.7; }
.co .chev { color: var(--dim); flex: none; }

.evcard {
  border-left: 3px solid var(--accent2); background: rgba(56, 189, 248, .05);
  border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 18px;
}
.evcard .q { font-size: 14px; font-style: italic; color: var(--fg); }
.evcard .src { font-size: 11.5px; color: var(--dim); margin-top: 8px; }

.prow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); }
.prow:hover { background: var(--panel); }
.prow .who .n { font-weight: 600; font-size: 13.5px; }
.prow .who .t { color: var(--muted); font-size: 12px; }
.prow .mail { font: 12px var(--mono); color: var(--muted); }
.pill.verified { color: var(--ok); border-color: rgba(52, 211, 153, .4); }
.pill.pattern { color: var(--warn); border-color: rgba(251, 191, 36, .4); }
.pill.none { color: var(--dim); }

.draft { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; background: var(--panel); }
.draft summary {
  list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: baseline;
  padding: 11px 14px;
}
.draft summary::-webkit-details-marker { display: none; }
.draft summary .co-nm { font-weight: 650; flex: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft summary .sub { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft summary .who { color: var(--dim); font-size: 12px; flex: none; }
.draft pre {
  margin: 0; padding: 4px 16px 14px; white-space: pre-wrap; font: 12.5px/1.7 var(--mono);
  color: var(--fg); border-top: 1px dashed var(--line); padding-top: 12px;
}

/* pursue bar */
.pursue {
  position: sticky; bottom: 0; z-index: 5; margin-top: 18px;
  display: flex; gap: 10px; align-items: center;
  background: rgba(7, 11, 20, .92); backdrop-filter: blur(12px);
  border: 1px solid var(--line2); border-radius: var(--r); padding: 10px 12px;
}
.pursue .tag { font: 10.5px var(--mono); color: var(--accent); letter-spacing: 1px; text-transform: uppercase; flex: none; }
.pursue input { flex: 1; }
.pursue .tpl { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pursue .tpl button {
  background: var(--panel); border: 1px solid var(--line2); color: var(--muted);
  border-radius: 99px; padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.pursue .tpl button:hover { color: var(--fg); border-color: var(--accent2); }

/* empty state */
.hero { display: grid; place-items: center; text-align: center; padding: 8vh 20px 40px; }
.hero h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 750; letter-spacing: -.5px; margin: 0 0 12px; max-width: 620px; }
.hero h2 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 480px; margin: 0 auto 28px; font-size: 15px; }
.hero .btn { font-size: 15px; padding: 12px 26px; border-radius: 11px; }

/* ---------- steering drawer ---------- */
.drawer {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: min(400px, calc(100vw - 40px)); height: min(560px, calc(100vh - 40px));
  display: flex; flex-direction: column;
  background: rgba(10, 16, 29, .92); backdrop-filter: blur(18px);
  border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow);
  animation: rise .25s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.drawer-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); flex: none;
}
.drawer-head b { font-size: 13px; }
.drawer-head .x { margin-left: auto; background: none; border: none; color: var(--dim); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 6px; }
.drawer-head .x:hover { color: var(--fg); }
.dlog { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dmsg { max-width: 88%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; font-size: 13px; }
.dmsg.agent { background: var(--panel2); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.dmsg.user { background: rgba(56, 189, 248, .16); border: 1px solid rgba(56, 189, 248, .3); border-bottom-right-radius: 4px; align-self: flex-end; }
.dsend { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); flex: none; }
.dsend input { flex: 1; }
.dhint { padding: 0 14px 8px; font-size: 11px; color: var(--dim); flex: none; }

.chatbtn { position: relative; }
.chatbtn .badge {
  position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px;
  border-radius: 99px; background: var(--accent2); color: #04121a;
  font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px;
}

/* ---------- modal & toast ---------- */
.modal-veil {
  position: fixed; inset: 0; z-index: 80; background: rgba(3, 6, 12, .7);
  backdrop-filter: blur(4px); display: grid; place-items: center; animation: fadein .2s;
}
.modal {
  width: min(420px, calc(100vw - 40px)); border-radius: 14px;
  background: var(--bg1); border: 1px solid var(--line2); box-shadow: var(--shadow);
  padding: 24px;
}
.modal h3 { margin: 0 0 8px; font-size: 16px; }
.modal p { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; }
.btn.confirm-danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .5); color: var(--err); }
.btn.confirm-danger:hover { background: rgba(248, 113, 113, .2); }

#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(10, 16, 29, .95); border: 1px solid var(--line2); border-radius: 99px;
  padding: 9px 18px; font-size: 13px; box-shadow: var(--shadow); animation: rise .25s ease;
}
.toast.err { border-color: rgba(248, 113, 113, .5); color: #fca5a5; }

/* ---------- immersive stage ---------- */
.stage {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column;
  background:
    radial-gradient(60vmax 46vmax at 50% -10%, rgba(56, 189, 248, .14), transparent 60%),
    radial-gradient(50vmax 40vmax at 50% 115%, rgba(129, 140, 248, .12), transparent 60%),
    rgba(4, 7, 13, .97);
  animation: stagein .45s ease;
}
@keyframes stagein { from { opacity: 0; } }
.stage-head {
  display: flex; align-items: center; padding: 20px 28px; flex: none;
}
.stage-head .hint { margin-left: auto; color: var(--dim); font-size: 12px; }
.stage-head .esc { background: none; border: 1px solid var(--line2); color: var(--muted); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-size: 12px; }
.stage-head .esc:hover { color: var(--fg); border-color: var(--accent2); }

.stage-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0 24px 8vh; gap: 5vh; }

.stage-trail {
  width: min(680px, 92vw); display: flex; flex-direction: column; gap: 10px;
  max-height: 34vh; overflow: hidden; justify-content: flex-end; mask-image: linear-gradient(transparent, #000 26%);
  -webkit-mask-image: linear-gradient(transparent, #000 26%);
}
.stale {
  color: var(--dim); font-size: 13.5px; text-align: center; line-height: 1.6;
  animation: fadein .5s ease;
}
.stale.you { color: var(--muted); font-style: italic; opacity: .8; }

.stage-live { width: min(760px, 94vw); text-align: center; min-height: 96px; }
.stage-live .words {
  font-size: clamp(20px, 3.1vw, 31px); font-weight: 600; line-height: 1.42; letter-spacing: -.2px;
}
.stage-live .words .w { display: inline-block; opacity: 0; transform: translateY(8px); filter: blur(3px); transition: all .45s cubic-bezier(.2, .7, .3, 1); }
.stage-live .words.play .w { opacity: 1; transform: none; filter: none; }
.stage-live .who {
  font: 10.5px var(--mono); letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px; display: block;
}
.thinking { display: inline-flex; gap: 6px; padding: 12px; }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent2); animation: blink 1.2s infinite; }
.thinking i:nth-child(2) { animation-delay: .18s; }
.thinking i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 70%, 100% { opacity: .25; } 35% { opacity: 1; } }

.stage-input { width: min(640px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.stage-input input {
  width: 100%; text-align: center; font-size: 17px; padding: 14px 18px;
  background: rgba(10, 16, 29, .6); border-radius: 14px;
}
.stage-input .tip { color: var(--dim); font-size: 12px; }
.upl {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--dim); font-size: 12.5px; text-decoration: underline dotted;
}
.upl:hover { color: var(--accent2); }
.upl:disabled { opacity: .5; cursor: default; }

/* launch view */
.launch { width: min(860px, 94vw); display: flex; flex-direction: column; align-items: center; gap: 26px; animation: rise .5s ease; }
.launch .eyebrow { font: 10.5px var(--mono); letter-spacing: 4px; text-transform: uppercase; color: var(--accent); animation: pulse 1.8s infinite; }
.launch h1 { margin: 0; font-size: clamp(26px, 4vw, 42px); font-weight: 750; letter-spacing: -.5px; text-align: center; }
.launch h1 small { display: block; font-size: .42em; font-weight: 400; color: var(--muted); letter-spacing: .5px; margin-top: 8px; }
.launch .constellation { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.launch .counters { display: flex; gap: clamp(18px, 4vw, 44px); flex-wrap: wrap; justify-content: center; }
.launch .counters .c { text-align: center; min-width: 86px; }
.launch .counters b { font-size: 30px; font-weight: 750; letter-spacing: -1px; display: block; font-variant-numeric: tabular-nums; }
.launch .counters b.bump { animation: bump .7s ease; }
.launch .counters span { font: 10px var(--mono); text-transform: uppercase; letter-spacing: 1.6px; color: var(--dim); }
.launch .last-ev { font: 11.5px var(--mono); color: var(--dim); min-height: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launch .acts { display: flex; gap: 12px; }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .18); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .3); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 960px) {
  .rail { width: 232px; }
  .work-inner { padding: 16px 14px 32px; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; max-height: 34vh; border-right: none; border-bottom: 1px solid var(--line); }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
  body::before, body::after { animation: none; }
}
