/* Self-hosted fonts (no third-party requests). */
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --bg: #04060d;
  --bg-2: #080d1a;
  --panel: rgba(13, 20, 38, 0.62);
  --panel-2: rgba(19, 29, 54, 0.7);
  --line: rgba(130, 200, 255, 0.11);
  --line-2: rgba(130, 200, 255, 0.2);
  --text: #e7f0ff;
  --muted: #8593b0;
  --dim: #5d6a86;
  --aqua: #5ff5dc;
  --teal: #19c2ad;
  --teal-deep: #008080;
  --violet: #8b7bff;
  --claude: #ff8f66;
  --gpt: #2ee59d;
  --amber: #ffbf5a;
  --red: #ff5f7e;
  --glow-aqua: 0 0 24px rgba(95, 245, 220, 0.35);
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--font);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
a { color: var(--aqua); }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }
.dim { color: var(--muted); }
.small { font-size: 11.5px; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.gap { gap: 12px; }
.gap-sm { gap: 8px; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: radial-gradient(1200px 700px at 70% -10%, #0c1a33 0%, transparent 60%), radial-gradient(900px 600px at -10% 110%, #0d1430 0%, transparent 60%), var(--bg); }
.aurora { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.32; animation: drift 26s ease-in-out infinite alternate; }
.a1 { width: 560px; height: 560px; background: #0d9488; top: -160px; right: 8%; }
.a2 { width: 480px; height: 480px; background: #5b45ff; bottom: -200px; left: 18%; animation-duration: 32s; opacity: 0.22; }
.a3 { width: 320px; height: 320px; background: #00b3a4; top: 40%; left: -120px; animation-duration: 38s; opacity: 0.18; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }
.grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(120, 190, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 190, 255, 0.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%); }

/* ---------- layout ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(8, 13, 26, 0.85), rgba(6, 9, 18, 0.7)); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 26px; }
.brand-mark { width: 38px; height: 38px; filter: drop-shadow(0 0 10px rgba(95, 245, 220, 0.45)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font: 700 19px var(--display); letter-spacing: 0.04em; }
.brand-text span { font: 500 10.5px var(--mono); letter-spacing: 0.32em; color: var(--aqua); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--muted); cursor: pointer; text-align: left; transition: 0.2s; }
.nav-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-btn.active { color: var(--text); background: linear-gradient(90deg, rgba(95, 245, 220, 0.13), rgba(139, 123, 255, 0.05)); border-color: rgba(95, 245, 220, 0.22); box-shadow: inset 3px 0 0 var(--aqua); }
.nav-btn.active svg { color: var(--aqua); filter: drop-shadow(0 0 6px rgba(95, 245, 220, 0.6)); }
.nav-count { margin-left: auto; font: 500 11px var(--mono); font-style: normal; color: var(--aqua); background: rgba(95, 245, 220, 0.1); padding: 1px 7px; border-radius: 99px; }
.nav-count:empty, .nav-dot:not(.on) { display: none; }
.nav-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.rail-foot { margin-top: auto; padding: 0 10px; font-size: 10.5px; color: var(--dim); }

.main { min-width: 0; padding: 22px 30px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; color: var(--aqua); letter-spacing: 0.18em; text-transform: uppercase; }
.topbar h1 { margin: 2px 0 0; font: 600 28px/1.15 var(--display); letter-spacing: -0.01em; }
.top-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; cursor: pointer; backdrop-filter: blur(8px); }
.pill .led { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.pill.ok .led { background: var(--gpt); box-shadow: 0 0 10px var(--gpt); }
.pill.bad .led { background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 1.6s infinite; }
.pill small { color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
@keyframes blink { 50% { opacity: 0.35; } }

.autopilot { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 10px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; transition: 0.25s; }
.ap-track { position: relative; width: 50px; height: 28px; border-radius: 99px; background: #1a2440; border: 1px solid var(--line-2); transition: 0.25s; }
.ap-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #6b7896; transition: 0.3s cubic-bezier(0.3, 1.4, 0.6, 1); }
.ap-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.ap-text b { font: 700 12.5px var(--display); letter-spacing: 0.16em; }
.ap-text small { font: 500 10px var(--mono); color: var(--muted); letter-spacing: 0.12em; }
.autopilot[aria-pressed="true"] { border-color: rgba(95, 245, 220, 0.55); box-shadow: 0 0 0 1px rgba(95, 245, 220, 0.15), 0 0 32px rgba(95, 245, 220, 0.18); }
.autopilot[aria-pressed="true"] .ap-track { background: linear-gradient(90deg, #0f8f82, #29d3bd); border-color: transparent; }
.autopilot[aria-pressed="true"] .ap-knob { left: 25px; background: #fff; box-shadow: 0 0 12px #fff; }
.autopilot[aria-pressed="true"] .ap-text small { color: var(--aqua); }

.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- panels and controls ---------- */
.panel { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); backdrop-filter: blur(16px); padding: 18px 20px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.panel::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(135deg, rgba(95, 245, 220, 0.06), transparent 35%); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font: 600 15px var(--display); letter-spacing: 0.01em; }
.view { display: flex; flex-direction: column; gap: 18px; animation: rise 0.35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: #021412; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); cursor: pointer; font-weight: 500; transition: 0.18s; white-space: nowrap; }
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: rgba(95, 245, 220, 0.45); background: rgba(95, 245, 220, 0.07); }
.btn.primary { border-color: transparent; color: #021412; background: linear-gradient(135deg, #5ff5dc, #22c5b0); box-shadow: 0 6px 24px rgba(34, 197, 176, 0.3); font-weight: 600; }
.btn.primary svg { fill: #021412; stroke: #021412; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255, 95, 126, 0.4); color: #ffb3c2; }
.btn.tiny { padding: 5px 10px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

input[type="text"], input[type="password"], input[type="time"], textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(3, 7, 16, 0.6); outline: none; transition: 0.2s;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
textarea.code { font: 12.5px/1.6 var(--mono); }
input:focus, textarea:focus, select:focus { border-color: rgba(95, 245, 220, 0.55); box-shadow: 0 0 0 3px rgba(95, 245, 220, 0.12); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.field > span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.field > span .hint { font: italic 400 11.5px var(--font); letter-spacing: 0; text-transform: none; color: var(--dim); }
.field > span.row.between { gap: 10px; flex-wrap: wrap; }

/* ---------- model / effort picker (custom listbox) ---------- */
.picker { position: relative; }
.picker-btn {
  width: 100%; min-height: 50px; display: flex; align-items: center; gap: 11px; padding: 8px 12px 8px 13px; text-align: left; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(3, 7, 16, 0.6)); transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.picker-btn:hover { border-color: rgba(95, 245, 220, 0.38); background: linear-gradient(180deg, rgba(95, 245, 220, 0.05), rgba(3, 7, 16, 0.6)); }
.picker-btn:focus-visible, .picker.open .picker-btn { outline: none; border-color: rgba(95, 245, 220, 0.6); box-shadow: 0 0 0 3px rgba(95, 245, 220, 0.12); }
.picker-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--aqua); box-shadow: 0 0 10px rgba(95, 245, 220, 0.7); }
.picker.warn .picker-dot { background: var(--amber); box-shadow: 0 0 10px rgba(255, 191, 90, 0.6); }
.picker-val { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.picker-val b { font: 600 13.5px var(--font); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-val small { font: 11px var(--mono); color: var(--muted); letter-spacing: 0.02em; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-btn .chev { width: 16px; height: 16px; color: var(--muted); transition: transform 0.2s, color 0.2s; }
.picker.open .chev { transform: rotate(180deg); color: var(--aqua); }
.picker-pop {
  position: absolute; z-index: 40; left: 0; top: calc(100% + 6px); width: max(100%, 330px); max-width: min(560px, calc(100vw - 32px)); max-height: 420px; overflow-y: auto; padding: 6px;
  border-radius: 14px; border: 1px solid rgba(95, 245, 220, 0.28); background: rgba(7, 12, 25, 0.98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 36px rgba(95, 245, 220, 0.07); animation: pickin 0.14s ease-out;
  scrollbar-width: thin; scrollbar-color: rgba(95, 245, 220, 0.28) transparent;
}
.picker.meter .picker-val small { font: 11.5px var(--font); }
@media (max-width: 760px) { .picker-pop { width: 100%; max-height: 60vh; } .picker-opt code { display: none; } }
.picker.up .picker-pop { top: auto; bottom: calc(100% + 6px); }
@keyframes pickin { from { opacity: 0; transform: translateY(-4px); } }
.picker-group { padding: 10px 10px 4px; font: 500 10px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.picker-group:first-child { padding-top: 4px; }
.picker-opt { width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text); cursor: pointer; text-align: left; }
.picker-opt:hover, .picker-opt:focus-visible { outline: none; background: rgba(95, 245, 220, 0.07); border-color: rgba(95, 245, 220, 0.16); }
.picker-opt.on { background: rgba(95, 245, 220, 0.12); border-color: rgba(95, 245, 220, 0.3); }
.picker-opt.warn b { color: var(--amber); }
.opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opt-main b { font: 600 13px var(--font); }
.opt-main small { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.picker-opt code { flex: none; font: 10.5px var(--mono); color: var(--dim); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); background: rgba(3, 7, 16, 0.5); }
.picker-opt .tick { width: 15px; height: 15px; color: var(--aqua); stroke-width: 2.4; opacity: 0; }
.picker-opt.on .tick { opacity: 1; }
.picker-empty { padding: 12px; color: var(--muted); font-size: 12.5px; }
/* Effort meter: five bars, lit up to the level. */
.lvl { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; flex: none; }
.lvl i { width: 3px; border-radius: 2px; background: rgba(130, 200, 255, 0.18); }
.lvl i:nth-child(1) { height: 5px; } .lvl i:nth-child(2) { height: 7.5px; } .lvl i:nth-child(3) { height: 10px; } .lvl i:nth-child(4) { height: 12.5px; } .lvl i:nth-child(5) { height: 15px; }
.lvl[data-n="1"] i:nth-child(-n + 1), .lvl[data-n="2"] i:nth-child(-n + 2), .lvl[data-n="3"] i:nth-child(-n + 3), .lvl[data-n="4"] i:nth-child(-n + 4), .lvl[data-n="5"] i:nth-child(-n + 5) { background: linear-gradient(180deg, #5ff5dc, #19c2ad); box-shadow: 0 0 6px rgba(95, 245, 220, 0.35); }
.lvl[data-n="0"] i { background: rgba(130, 200, 255, 0.28); }
/* An open picker lifts its panel above the next one (panels are separate stacking contexts). */
.panel:has(.picker.open) { z-index: 20; }

/* ---------- uploaded images ---------- */
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.asset { position: relative; margin: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: rgba(3, 7, 16, 0.5); }
.asset img { display: block; width: 100%; height: 100%; object-fit: cover; }
.asset figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 6px; font-size: 10.5px; color: #e4edff; background: linear-gradient(transparent, rgba(2, 6, 14, 0.88)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; }
.asset-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(4, 8, 18, 0.8); color: var(--text); cursor: pointer; opacity: 0; transition: opacity 0.15s, border-color 0.15s, color 0.15s; }
.asset-x svg { width: 13px; height: 13px; stroke-width: 2.2; }
.asset:hover .asset-x, .asset-x:focus-visible { opacity: 1; }
.asset-x:hover, .asset-x:focus-visible { outline: none; border-color: rgba(255, 95, 126, 0.7); color: #ffb3c2; }
@media (hover: none) { .asset-x { opacity: 1; } }
.asset.loading { display: grid; place-items: center; border-style: dashed; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(95, 245, 220, 0.2); border-top-color: var(--aqua); animation: spin 0.8s linear infinite; }
.asset-add {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px; text-align: center; cursor: pointer;
  border-radius: 12px; border: 1.5px dashed rgba(95, 245, 220, 0.3); background: rgba(95, 245, 220, 0.03); color: var(--muted); font-size: 12px; transition: 0.18s;
}
.asset-add svg { width: 22px; height: 22px; color: var(--aqua); margin-bottom: 2px; }
.asset-add span { font-family: var(--font); font-size: 12px; letter-spacing: 0; text-transform: none; }
.asset-add small { font-size: 10.5px; color: var(--dim); letter-spacing: 0; text-transform: none; }
.asset-add:hover, .asset-add:focus-visible, .asset-add.drag { outline: none; border-color: rgba(95, 245, 220, 0.75); background: rgba(95, 245, 220, 0.08); color: var(--text); }
.asset-add.drag { box-shadow: 0 0 24px rgba(95, 245, 220, 0.18); }

/* ---------- featured vs body image settings ---------- */
.img-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.img-kind { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(3, 7, 16, 0.35); }
.img-kind::before { content: ""; position: absolute; left: 16px; right: 16px; top: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #8b7bff, #5ff5dc); }
.img-kind.body::before { background: linear-gradient(90deg, #2ee59d, #5ff5dc); }
.img-kind-head { display: flex; flex-direction: column; gap: 6px; }
.img-kind-head b { font: 600 14px var(--display); }
.kind-tag { padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; font: 600 9.5px var(--mono); letter-spacing: 0.14em; }
.kind-tag.hero { color: #b8afff; }
.kind-tag.body { color: var(--gpt); }

.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(3, 7, 16, 0.6); border: 1px solid var(--line); }
.seg button { padding: 6px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.seg button.on { background: rgba(95, 245, 220, 0.14); color: var(--text); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font: 500 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid currentColor; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.queued { color: #9fb0d4; }
.chip.running, .chip.working { color: var(--aqua); }
.chip.running::before { animation: blink 1s infinite; box-shadow: 0 0 8px currentColor; }
.chip.waiting { color: var(--amber); }
.chip.paused { color: #c3b6ff; }
.chip.ready { color: var(--violet); }
.chip.scheduled { color: #7fc4ff; }
.chip.live, .chip.done { color: var(--gpt); }
.chip.failed { color: var(--red); }
.chip.skipped { color: var(--dim); }

/* ---------- mission ---------- */
.mission-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
.reactor-panel { display: flex; align-items: center; gap: 28px; padding: 26px; }
.reactor { position: relative; width: 168px; height: 168px; flex: none; --c: #5d6a86; --speed: 18s; }
.ring { position: absolute; border-radius: 50%; inset: 0; }
.r1 { background: conic-gradient(from 0deg, transparent 0 55%, var(--c) 75%, transparent 76% 100%); mask: radial-gradient(circle, transparent 66%, #000 67% 70%, transparent 71%); animation: spin var(--speed) linear infinite; }
.r2 { inset: 16px; border: 1px dashed color-mix(in srgb, var(--c) 55%, transparent); animation: spin calc(var(--speed) * 1.6) linear infinite reverse; }
.r3 { inset: 30px; background: conic-gradient(from 90deg, var(--c), transparent 30%, var(--c) 50%, transparent 80%); mask: radial-gradient(circle, transparent 64%, #000 65% 68%, transparent 69%); animation: spin calc(var(--speed) * 0.7) linear infinite; opacity: 0.7; }
.core { position: absolute; inset: 46px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 45%, #0b1222), #070b16 70%); box-shadow: 0 0 40px color-mix(in srgb, var(--c) 45%, transparent), inset 0 0 22px color-mix(in srgb, var(--c) 40%, transparent); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); }
.core span { font: 600 10.5px var(--mono); letter-spacing: 0.18em; color: var(--c); text-shadow: 0 0 10px var(--c); }
.reactor.working { --c: #5ff5dc; --speed: 5s; }
.reactor.working .core { animation: breathe 2.4s ease-in-out infinite; }
.reactor.waiting { --c: #ffbf5a; --speed: 22s; }
.reactor.full, .reactor.empty { --c: #8b7bff; --speed: 14s; }
.reactor.offline { --c: #ff5f7e; --speed: 30s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { box-shadow: 0 0 70px rgba(95, 245, 220, 0.55), inset 0 0 30px rgba(95, 245, 220, 0.5); } }
.reactor-info { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.reactor-info h2 { margin: 0; font: 600 24px/1.2 var(--display); }
.reactor-info p { margin: 0 0 6px; }
.activity { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(95, 245, 220, 0.06); border: 1px solid rgba(95, 245, 220, 0.18); font-size: 12px; color: #c9fff5; margin-bottom: 6px; }
.activity .timer { margin-left: auto; color: var(--muted); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 0 0 rgba(95, 245, 220, 0.6); animation: ping 1.6s infinite; flex: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(95, 245, 220, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 245, 220, 0); } }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; }
.stat > span { font-size: 10.5px; letter-spacing: 0.14em; }
.stat b { font: 600 30px/1.1 var(--display); background: linear-gradient(180deg, #fff, #9feee2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat small { font-size: 11.5px; }
.stat.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
.stat.wide b { font: 600 22px var(--mono); }

/* pipeline */
.pipeline { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 6px 2px 4px; }
.stage { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 120px; text-align: center; }
.stage-node { position: relative; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; border: 1px solid var(--line-2); background: rgba(3, 7, 16, 0.7); color: var(--dim); transition: 0.3s; }
.stage-node svg { width: 22px; height: 22px; }
.stage b { font: 600 12.5px var(--display); color: var(--muted); }
.stage small { font: 500 11px var(--mono); color: var(--dim); }
.stage.done .stage-node { color: #021412; background: linear-gradient(135deg, #5ff5dc, #22c5b0); border-color: transparent; box-shadow: var(--glow-aqua); }
.stage.done b { color: var(--text); }
.stage.active .stage-node { color: var(--aqua); border-color: var(--aqua); box-shadow: 0 0 0 4px rgba(95, 245, 220, 0.1), var(--glow-aqua); animation: nodepulse 1.8s ease-in-out infinite; }
.stage.active b { color: var(--aqua); }
.stage.active small { color: var(--text); }
.stage.wait .stage-node { color: var(--amber); border-color: var(--amber); box-shadow: 0 0 18px rgba(255, 191, 90, 0.35); }
.stage.fail .stage-node { color: var(--red); border-color: var(--red); }
@keyframes nodepulse { 50% { box-shadow: 0 0 0 8px rgba(95, 245, 220, 0.04), 0 0 34px rgba(95, 245, 220, 0.5); } }
.beam { flex: 1; min-width: 28px; height: 2px; margin-bottom: 44px; background: var(--line-2); position: relative; overflow: hidden; border-radius: 2px; }
.beam.done { background: linear-gradient(90deg, #22c5b0, #5ff5dc); box-shadow: 0 0 10px rgba(95, 245, 220, 0.6); }
.beam.active::after { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--aqua), transparent); animation: flow 1.3s linear infinite; }
@keyframes flow { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* feed */
.feed-panel { display: flex; flex-direction: column; }
.lane-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lane-dot.claude { background: var(--claude); box-shadow: 0 0 10px var(--claude); }
.lane-dot.gpt { background: var(--gpt); box-shadow: 0 0 10px var(--gpt); }
.feed { display: flex; flex-direction: column; gap: 14px; max-height: 620px; overflow-y: auto; padding: 4px 6px 4px 2px; scroll-behavior: smooth; }
.feed::-webkit-scrollbar, .drawer-body::-webkit-scrollbar, .topic-list::-webkit-scrollbar { width: 8px; }
.feed::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb, .topic-list::-webkit-scrollbar-thumb { background: rgba(130, 200, 255, 0.14); border-radius: 8px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 14px; }
.msg { max-width: min(760px, 88%); display: flex; gap: 12px; animation: pop 0.35s cubic-bezier(0.2, 1.2, 0.4, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.msg.chatgpt { align-self: flex-end; flex-direction: row-reverse; }
.msg.app { align-self: center; max-width: 92%; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font: 700 13px var(--display); }
.msg.claude .avatar { color: #2a0f05; background: linear-gradient(135deg, #ffb08f, #ff7a4d); box-shadow: 0 0 16px rgba(255, 143, 102, 0.4); }
.msg.chatgpt .avatar { color: #02170e; background: linear-gradient(135deg, #7af5c4, #19c37d); box-shadow: 0 0 16px rgba(46, 229, 157, 0.35); }
.bubble { min-width: 0; padding: 12px 15px; border-radius: 4px 16px 16px 16px; background: rgba(255, 143, 102, 0.07); border: 1px solid rgba(255, 143, 102, 0.22); }
.msg.chatgpt .bubble { border-radius: 16px 4px 16px 16px; background: rgba(46, 229, 157, 0.06); border-color: rgba(46, 229, 157, 0.22); }
.msg.app .bubble { border-radius: 12px; background: rgba(139, 123, 255, 0.08); border-color: rgba(139, 123, 255, 0.28); font-size: 13px; }
.msg.app.error .bubble { background: rgba(255, 95, 126, 0.08); border-color: rgba(255, 95, 126, 0.35); }
.bubble-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font: 500 11px var(--mono); letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.msg.claude .bubble-head b { color: var(--claude); }
.msg.chatgpt .bubble-head b { color: var(--gpt); }
.msg.app .bubble-head b { color: #b9adff; }
.bubble-text { white-space: pre-wrap; word-wrap: break-word; color: #dce6f8; }
.bubble-text.clamp { max-height: 9.3em; overflow: hidden; mask-image: linear-gradient(#000 60%, transparent); }
.bubble .more { margin-top: 6px; border: 0; background: none; color: var(--aqua); cursor: pointer; padding: 0; font-size: 12px; }
.bubble img { display: block; width: 100%; max-width: 420px; border-radius: 10px; margin-top: 8px; border: 1px solid var(--line-2); }
.typing { display: flex; align-items: center; gap: 10px; padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--line); }
.typing-who { font: 600 12px var(--display); }
.typing-who.claude { color: var(--claude); }
.typing-who.gpt { color: var(--gpt); }
.typing-who.app { color: #b9adff; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; color: var(--muted); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 30% { transform: translateY(-5px); opacity: 1; } 0%, 60%, 100% { opacity: 0.4; } }

/* ---------- queue ---------- */
.composer textarea { margin-bottom: 12px; }
.topic-list { display: flex; flex-direction: column; gap: 8px; max-height: 64vh; overflow-y: auto; }
.topic { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(3, 7, 16, 0.45); transition: 0.2s; }
.topic:hover { border-color: var(--line-2); }
.topic .idx { font: 500 12px var(--mono); color: var(--dim); text-align: center; }
.topic .t-title { font-weight: 500; }
.topic .t-notes { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topic .t-actions { display: flex; gap: 4px; }
.topic.running { border-color: rgba(95, 245, 220, 0.4); background: rgba(95, 245, 220, 0.05); }
.mini { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.mini:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, 0.03); }
.mini svg { width: 15px; height: 15px; }

/* ---------- posts ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.post-card { padding: 0; overflow: hidden; cursor: pointer; transition: 0.25s; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-3px); border-color: rgba(95, 245, 220, 0.35); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 0 30px rgba(95, 245, 220, 0.08); }
.thumb { position: relative; aspect-ratio: 3 / 2; background: radial-gradient(circle at 30% 30%, rgba(95, 245, 220, 0.18), transparent 60%), radial-gradient(circle at 80% 80%, rgba(139, 123, 255, 0.2), transparent 55%), #0a1122; display: grid; place-items: center; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { font: 500 11px var(--mono); letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.thumb .chip { position: absolute; top: 12px; left: 12px; background: rgba(4, 6, 13, 0.75); backdrop-filter: blur(6px); }
.post-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-body h4 { margin: 0; font: 600 15px/1.35 var(--display); }
.post-meta { display: flex; justify-content: space-between; gap: 8px; font: 500 11px var(--mono); color: var(--muted); margin-top: auto; }
.progress { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #22c5b0, #5ff5dc); box-shadow: 0 0 10px var(--aqua); border-radius: 4px; transition: width 0.6s; }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(2, 4, 10, 0.6); backdrop-filter: blur(3px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(880px, 100vw); display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; background: linear-gradient(180deg, rgba(10, 16, 32, 0.97), rgba(6, 10, 20, 0.98)); border-left: 1px solid var(--line-2); box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5); animation: slidein 0.3s cubic-bezier(0.2, 1, 0.3, 1); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; gap: 16px; }
.drawer-head h2 { margin: 4px 0 0; font: 600 21px/1.3 var(--display); }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-tabs { align-self: flex-start; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; }
.drawer-body iframe { width: 100%; height: 100%; min-height: 70vh; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--muted); font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }
.kv dd { margin: 0; word-break: break-word; }
.sub-h { margin: 22px 0 10px; font: 600 13px var(--display); color: var(--aqua); letter-spacing: 0.04em; }
.notes { margin: 0; padding-left: 18px; color: #cfd9ee; }
.notes li { margin: 3px 0; }
.img-plan { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; font-size: 12.5px; }
.img-plan img { width: 100%; border-radius: 8px; }

/* ---------- settings ---------- */
.settings { display: flex; flex-direction: column; gap: 18px; padding-bottom: 70px; }
.conn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.conn { display: flex; flex-direction: column; gap: 10px; }
.conn-top { display: flex; align-items: center; gap: 12px; }
.conn-logo { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font: 700 15px var(--display); }
.conn-logo.claude { background: linear-gradient(135deg, #ffb08f, #ff7a4d); color: #2a0f05; }
.conn-logo.gpt { background: linear-gradient(135deg, #7af5c4, #19c37d); color: #02170e; }
.conn-logo.site { background: linear-gradient(135deg, #8bdcff, #5b7bff); color: #050b1d; }
.conn h4 { margin: 0; font: 600 15px var(--display); }
.conn .status { font: 500 11px var(--mono); letter-spacing: 0.08em; }
.conn .status.ok { color: var(--gpt); }
.conn .status.bad { color: var(--amber); }
.conn p { margin: 0; font-size: 12.5px; color: var(--muted); }
.code-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border-radius: 14px; border: 1px solid rgba(46, 229, 157, 0.35); background: rgba(46, 229, 157, 0.06); text-align: center; }
.code-box .code { font: 600 26px var(--mono); letter-spacing: 0.18em; color: #fff; text-shadow: 0 0 18px rgba(46, 229, 157, 0.6); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.slider-field { display: flex; flex-direction: column; gap: 8px; }
.slider-field .row { justify-content: space-between; }
.slider-field b { font: 600 20px var(--mono); color: var(--aqua); }
input[type="range"] { width: 100%; accent-color: #2ee6c8; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(3, 7, 16, 0.5); color: var(--muted); cursor: pointer; font: 500 12px var(--mono); }
.days button.on { color: #021412; background: linear-gradient(135deg, #5ff5dc, #22c5b0); border-color: transparent; }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle input { display: none; }
.toggle .sw { position: relative; width: 42px; height: 24px; border-radius: 99px; background: #1a2440; border: 1px solid var(--line-2); transition: 0.2s; flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #6b7896; transition: 0.2s; }
.toggle input:checked + .sw { background: linear-gradient(90deg, #0f8f82, #29d3bd); border-color: transparent; }
.toggle input:checked + .sw::after { left: 21px; background: #fff; }
details.adv { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; background: rgba(3, 7, 16, 0.35); }
details.adv summary { cursor: pointer; font: 600 13px var(--display); color: var(--muted); }
details.adv[open] summary { color: var(--text); margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.hint { font-size: 12px; color: var(--muted); }
.hint code { font-family: var(--mono); font-size: 11.5px; color: #c9fff5; background: rgba(95, 245, 220, 0.08); padding: 1px 5px; border-radius: 5px; }
.savebar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 22px; padding: 10px 12px 10px 20px; border-radius: 16px; border: 1px solid rgba(95, 245, 220, 0.4); background: rgba(8, 14, 28, 0.94); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(95, 245, 220, 0.12); backdrop-filter: blur(12px); animation: rise 0.25s; }
.savebar span { font-size: 13px; color: var(--aqua); }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast { max-width: 380px; padding: 12px 16px; border-radius: 13px; border: 1px solid var(--line-2); background: rgba(10, 16, 32, 0.96); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); font-size: 13px; animation: pop 0.3s; }
.toast.ok { border-color: rgba(46, 229, 157, 0.5); }
.toast.err { border-color: rgba(255, 95, 126, 0.55); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .mission-top { grid-template-columns: 1fr; }
  .conn-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 20; flex-direction: row; padding: 8px 10px; border-right: 0; border-top: 1px solid var(--line); }
  .brand, .rail-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav-btn { flex-direction: column; gap: 3px; padding: 6px 10px; font-size: 11px; }
  .nav-btn.active { box-shadow: none; }
  .nav-count, .nav-dot { position: absolute; top: 2px; right: 6px; }
  .main { padding: 16px 16px 96px; }
  .topbar h1 { font-size: 22px; }
  .reactor-panel { flex-direction: column; text-align: center; padding: 20px; }
  .reactor-info .row { justify-content: center; flex-wrap: wrap; }
  .reactor { width: 140px; height: 140px; }
  .core { inset: 38px; }
  .msg { max-width: 100%; }
  .topic { grid-template-columns: 26px minmax(0, 1fr); }
  .topic .chip, .topic .t-actions { grid-column: 2; justify-self: start; }
  .kv { grid-template-columns: 1fr; }
  .img-plan { grid-template-columns: 1fr; }
  .drawer { padding: 16px; }
}

/* ---------- utilities (no inline styles anywhere: strict CSP) ---------- */
.mb14 { margin-bottom: 14px; }
.mt4 { margin-top: 4px; }
.mt16 { margin-top: 16px; }
.pre { white-space: pre-wrap; }
.t-red { color: var(--red); }
.t-amber { color: var(--amber); }
.t-green { color: var(--gpt); }
.t-claude { color: var(--claude); }
.t-gpt { color: var(--gpt); }
.feed.full { max-height: none; }

/* ---------- sign-in ---------- */
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 30px; }
.login-card .brand { padding: 0 0 6px; }
.login-card .err { margin: 0; min-height: 1.2em; color: #ffb3c2; font-size: 13px; }
.login-card h2 { margin: 0; font: 600 20px/1.3 var(--display); }
.login-card p { margin: 0; }
.step-dots { display: flex; gap: 6px; }
.step-dots i { width: 22px; height: 4px; border-radius: 4px; background: var(--line-2); }
.step-dots i.on { background: var(--aqua); box-shadow: 0 0 10px var(--aqua); }
.qr { align-self: center; width: 210px; height: 210px; padding: 10px; border-radius: 14px; background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { font: 600 13px/1.6 var(--mono); letter-spacing: 0.08em; word-break: break-all; text-align: center; padding: 10px; border-radius: 10px; background: rgba(3, 7, 16, 0.6); border: 1px dashed var(--line-2); color: #c9fff5; }
.otp { text-align: center; font: 600 24px var(--mono) !important; letter-spacing: 0.4em; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; border-radius: 12px; background: rgba(3, 7, 16, 0.6); border: 1px solid var(--line-2); font: 600 14px var(--mono); letter-spacing: 0.06em; text-align: center; }
.linklike { border: 0; background: none; color: var(--aqua); cursor: pointer; padding: 0; font-size: 12.5px; align-self: center; }
.check { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }

/* ---------- step-up (re-confirm with 2FA) ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(2, 4, 10, 0.72); backdrop-filter: blur(5px); animation: rise 0.2s; }
.modal { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 18px; border: 1px solid rgba(95, 245, 220, 0.4); background: rgba(10, 16, 32, 0.98); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(95, 245, 220, 0.12); }
.modal h3 { margin: 0; font: 600 17px var(--display); display: flex; align-items: center; gap: 10px; }
.modal h3 svg { color: var(--aqua); width: 20px; height: 20px; }
.modal p { margin: 0; font-size: 13px; color: var(--muted); }
.modal .err { min-height: 1.2em; color: #ffb3c2; font-size: 12.5px; }

/* ---------- security panel ---------- */
.sec-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sec-tile { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(3, 7, 16, 0.45); display: flex; flex-direction: column; gap: 4px; }
.sec-tile b { font: 600 14px var(--display); }
.sec-tile span { font: 500 10.5px var(--mono); letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.sec-tile.ok b { color: var(--gpt); }
.sec-tile.warn b { color: var(--amber); }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; font: 500 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-word; }
.table tr.bad td:first-child { color: #ffb3c2; }
.table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 99px; font: 500 10px var(--mono); letter-spacing: 0.08em; background: rgba(95, 245, 220, 0.12); color: var(--aqua); }
@media (max-width: 900px) { .sec-grid { grid-template-columns: 1fr 1fr; } }
