:root {
  color-scheme: dark;
  --bg: #08080a;
  --bg-2: #0c0c0f;
  --panel: #0f0f12;
  --panel-2: #141418;
  --panel-3: #1a1a1f;
  --border: rgba(255, 255, 255, .07);
  --border-2: rgba(255, 255, 255, .11);
  --border-3: rgba(255, 255, 255, .18);
  --text: #ededf0;
  --text-2: #a1a1aa;
  --text-3: #6b6b75;
  --accent: #8d8dff;
  --accent-2: #6c6cf0;
  --accent-soft: rgba(141, 141, 255, .12);
  --green: #3dd68c;
  --green-soft: rgba(61, 214, 140, .1);
  --red: #ff6369;
  --red-soft: rgba(255, 99, 105, .1);
  --amber: #ffb224;
  --planner: #a78bfa;
  --researcher: #4cc3ff;
  --builder: #ffb224;
  --critic: #ff7a90;
  --radius: 14px;
  --font: "Geist", "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); display: flex; flex-direction: column; min-height: 100vh; -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.muted, .empty { color: var(--text-3); }
.empty { font-size: 13px; }
::selection { background: rgba(141, 141, 255, .35); }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent; }

.bg-grid { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(124, 124, 255, .16), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 48px 48px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 520px); }

/* ---------------- top bar ---------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: rgba(8, 8, 10, .7); backdrop-filter: blur(12px); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { height: 38px; width: auto; display: block; }
.brand > .crumb-sep { width: 1px; height: 20px; background: var(--border-3); }
.crumbs { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.crumb-org { color: var(--text-2); }
.crumb-sep { color: var(--text-3); }
.crumb-app { color: var(--text); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 7px; margin-left: 8px; padding: 3px 10px 3px 9px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text-2); font-size: 12px; font-weight: 500; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.status.running { color: var(--accent); border-color: rgba(141, 141, 255, .3); background: var(--accent-soft); }
.status.running i { background: var(--accent); box-shadow: 0 0 0 3px rgba(141, 141, 255, .2); animation: pulse 1.4s infinite; }
.status.done { color: var(--green); border-color: rgba(61, 214, 140, .3); background: var(--green-soft); }
.status.done i { background: var(--green); }
.status.failed { color: var(--red); border-color: rgba(255, 99, 105, .3); background: var(--red-soft); }
.status.failed i { background: var(--red); }
.stats { display: flex; margin: 0; animation: statsIn .5s var(--ease); }
@keyframes statsIn { from { opacity: 0; transform: translateY(-4px); } }
.stats > div { padding: 0 18px; border-left: 1px solid var(--border); }
.stats > div:first-child { border-left: 0; }
.stats dt { font-size: 11px; color: var(--text-3); font-weight: 500; }
.stats dd { margin: 1px 0 0; font: 500 15px var(--mono); font-variant-numeric: tabular-nums; color: var(--text); transition: color .4s; }
.stats dd.bump { color: var(--accent); }

/* ---------------- composer ---------------- */
.composer { padding: 18px 24px 4px; max-width: 1180px; width: 100%; margin: 0 auto; }
.command { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 7px 7px 16px; border-radius: 14px; background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05)) border-box; border: 1px solid transparent; box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -24px rgba(0, 0, 0, .9); transition: box-shadow .3s var(--ease); }
.command:focus-within { box-shadow: 0 0 0 4px rgba(141, 141, 255, .14), 0 20px 50px -24px rgba(0, 0, 0, .9); background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(180deg, rgba(141, 141, 255, .7), rgba(141, 141, 255, .2)) border-box; }
.cmd-icon { width: 18px; height: 18px; color: var(--accent); }
#goal { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 17px var(--font); padding: 11px 0; letter-spacing: -.01em; }
#goal::placeholder { color: var(--text-3); }
.run { display: inline-flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 10px; background: #f4f4f6; color: #0b0b0e; font-weight: 600; font-size: 14px; text-decoration: none; transition: background .2s, transform .2s var(--ease); white-space: nowrap; }
.run:hover { background: #fff; }
.run:active { transform: scale(.98); }
.run:disabled { opacity: .45; cursor: progress; }
.run kbd { font: 500 11px var(--mono); padding: 2px 6px; border-radius: 5px; background: rgba(0, 0, 0, .08); border: 1px solid rgba(0, 0, 0, .1); }
.run.small { padding: 8px 14px; font-size: 13px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.presets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.presets-label { color: var(--text-3); font-size: 12px; margin-right: 4px; }
.preset { padding: 5px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text-2); font-size: 12.5px; transition: border-color .2s, color .2s, background .2s; }
.preset:hover { border-color: var(--border-3); color: var(--text); background: var(--panel-2); }
.replay { display: flex; gap: 6px; }
.replay select, .ghost { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--bg-2); color: var(--text-2); font: 12.5px var(--font); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; max-width: 280px; }
.ghost:hover, .replay select:hover { border-color: var(--border-3); color: var(--text); }
.goal-error { min-height: 18px; margin: 6px 0 0; color: var(--red); font-size: 12.5px; }

/* ---------------- board ---------------- */
.board { flex: 1; min-height: 0; display: grid; grid-template-columns: 296px minmax(0, 1fr) 360px; gap: 14px; padding: 4px 24px 22px; height: calc(100vh - 200px); }
.panel { min-height: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 16px 10px; }
.panel-head h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -.005em; }
.panel-head .muted { font-size: 11.5px; }
.col-left { overflow-y: auto; }
@media (max-width: 1320px) { .board { grid-template-columns: 260px minmax(0, 1fr) 320px; } .stats > div { padding: 0 12px; } }
@media (max-width: 1100px) { .board { grid-template-columns: 1fr; height: auto; } .stage { min-height: 720px; } .feed { max-height: 520px; } }

/* ---------------- agents ---------------- */
.team { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 14px; }
.agent { --c: var(--text-3); position: relative; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); transition: border-color .3s, background .3s; isolation: isolate; }
.agent-row { display: flex; align-items: center; gap: 11px; }
.agent-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.agent-icon svg { width: 17px; height: 17px; }
.agent-id { flex: 1; min-width: 0; }
.agent-name { font-weight: 600; font-size: 13.5px; }
.agent-role { color: var(--text-3); font-size: 12px; }
.agent-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.agent-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); opacity: .6; }
.agent-now { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border); color: var(--text-2); font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent-now:empty { display: none; }
.agent-now.swap { animation: swapIn .35s var(--ease); }
.agent-think { display: none; align-items: center; gap: 7px; margin-top: 8px; font: 11.5px var(--mono); color: var(--c); }
.agent.thinking .agent-think { display: flex; animation: fade .3s var(--ease); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.agent.working { background: color-mix(in srgb, var(--c) 6%, var(--bg-2)); border-color: transparent; }
.agent.working::before { content: ""; position: absolute; inset: -1px; border-radius: 13px; padding: 1px; z-index: -1; background: conic-gradient(from var(--spin, 0deg), transparent 0 60%, var(--c) 80%, transparent 100%), linear-gradient(color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 30%, transparent)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 2.2s linear infinite; }
.agent.working .agent-state { color: var(--c); }
.agent.working .agent-state i { background: var(--c); opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); animation: pulse 1.2s infinite; }
.agent.waiting .agent-state { color: var(--text-2); }
.agent.waiting .agent-state i { background: var(--c); opacity: .5; }
.agent.done .agent-state { color: var(--green); }
.agent.done .agent-state i { background: var(--green); opacity: 1; }
.agent.alert { animation: shake .45s; border-color: rgba(255, 99, 105, .5); }
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.plan { list-style: none; margin: 0; padding: 0 12px 16px; display: flex; flex-direction: column; counter-reset: s; position: relative; }
.plan li { counter-increment: s; position: relative; padding: 7px 8px 7px 34px; color: var(--text-2); font-size: 12.5px; line-height: 1.45; animation: rise .4s var(--ease) both; }
.plan li::before { content: counter(s); position: absolute; left: 4px; top: 6px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font: 500 10.5px var(--mono); color: var(--text-3); border: 1px solid var(--border-2); background: var(--bg-2); }
.plan li:not(:last-child)::after { content: ""; position: absolute; left: 13.5px; top: 27px; bottom: -6px; width: 1px; background: var(--border-2); }
.plan li.done { color: var(--text); }
.plan li.done::before { content: ""; border-color: rgba(61, 214, 140, .4); background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233dd68c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.plan li.plan-empty { padding-left: 4px; color: var(--text-3); }
.plan li.plan-empty::before, .plan li.plan-empty::after { display: none; }

/* ---------------- stage ---------------- */
.stage { overflow: hidden; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 0 6px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs { display: flex; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 14px 12px 13px; color: var(--text-3); font-weight: 500; font-size: 13px; transition: color .2s; }
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--text); }
.count { font: 500 10.5px var(--mono); padding: 1px 6px; border-radius: 6px; background: var(--panel-3); color: var(--text-2); border: 1px solid var(--border); }
.count:empty { display: none; }
.count.bad { color: var(--red); background: var(--red-soft); border-color: rgba(255, 99, 105, .25); }
.count.good { color: var(--green); background: var(--green-soft); border-color: rgba(61, 214, 140, .25); }
.stage-tools { display: flex; align-items: center; gap: 10px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.track { width: 28px; height: 16px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--border-2); position: relative; transition: background .2s; }
.thumb { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); transition: transform .2s var(--ease), background .2s; }
.toggle input:checked + .track { background: var(--accent-2); border-color: transparent; }
.toggle input:checked + .track .thumb { transform: translateX(12px); background: #fff; }
.seg { display: flex; padding: 2px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--bg-2); }
.seg button { width: 30px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--text-3); }
.seg button.active { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.icon-link svg { width: 13px; height: 13px; }
.views { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; display: none; overflow-y: auto; overflow-x: hidden; padding: 14px; }
.view.active { display: block; animation: fade .25s var(--ease); }

/* banner */
.banner { display: flex; align-items: center; gap: 14px; margin: 12px 14px 0; padding: 12px 12px 12px 14px; border-radius: 12px; background: linear-gradient(90deg, rgba(61, 214, 140, .12), rgba(61, 214, 140, .03)); border: 1px solid rgba(61, 214, 140, .25); animation: drop .5s var(--ease); }
.banner.bad { background: linear-gradient(90deg, rgba(255, 99, 105, .12), rgba(255, 99, 105, .03)); border-color: rgba(255, 99, 105, .3); }
.banner-mark { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #04150c; }
.banner.bad .banner-mark { background: var(--red); color: #1a0405; }
.banner-mark svg { width: 15px; height: 15px; stroke-width: 2.6; }
.banner-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.banner-text strong { font-size: 14.5px; font-weight: 600; }
.banner-text span { color: var(--text-2); font-size: 12.5px; }
.banner.bad .run { display: none; }
.banner-close { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--text-3); }
.banner-close:hover { background: var(--panel-3); color: var(--text); }

/* preview */
.view[data-view="preview"].active { display: flex; }
.browser { flex: 1; display: flex; flex-direction: column; min-height: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-2); background: var(--bg-2); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); }
.browser-bar { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.lights { display: flex; gap: 6px; }
.lights i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a42; }
.address { flex: 1; max-width: 560px; margin: 0 auto; height: 26px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border-radius: 7px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-2); font: 12px var(--mono); overflow: hidden; white-space: nowrap; }
.address svg { width: 12px; height: 12px; color: var(--green); }
#url-bar { overflow: hidden; text-overflow: ellipsis; }
.reload { width: 80px; text-align: right; font-size: 11.5px; color: var(--accent); }
.viewport { flex: 1; position: relative; min-height: 0; overflow: hidden; background: #fff; }
.viewport iframe { position: absolute; top: 0; left: 0; border: 0; background: #fff; transform-origin: 0 0; transition: opacity .3s; }
.viewport.mobile { background: radial-gradient(circle at 50% 30%, #17171c, #0b0b0e); }
.viewport.mobile iframe { border-radius: 40px; box-shadow: 0 0 0 9px #1c1c22, 0 0 0 10px #2c2c35, 0 40px 80px -30px rgba(0, 0, 0, .9); }
.viewport.placeholder-on { background: var(--bg-2); }
.placeholder { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 40px; }
/* idle: a wireframe of the page that is about to be built */
.wire { width: 460px; max-width: 100%; margin: 0 auto; padding: 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--panel); text-align: left; }
.wire i { display: block; border-radius: 4px; background: var(--panel-3); }
.wire span { display: flex; gap: 8px; }
.wire-nav { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.wire-nav .w-logo { width: 46px; height: 10px; }
.wire-nav span i { width: 30px; height: 6px; }
.wire-nav .w-btn { width: 44px; height: 14px; border-radius: 999px; background: rgba(141, 141, 255, .35); }
.wire-hero { display: flex; flex-direction: column; gap: 8px; padding: 22px 0 18px; }
.wire-hero .w-eyebrow { width: 70px; height: 6px; background: rgba(141, 141, 255, .35); }
.wire-hero .w-h1 { width: 78%; height: 14px; }
.wire-hero .w-h1.short { width: 52%; }
.wire-hero .w-p { width: 64%; height: 7px; margin-top: 4px; }
.wire-hero .w-cta { width: 70px; height: 18px; border-radius: 999px; margin-top: 6px; background: rgba(141, 141, 255, .45); }
.wire-hero .w-cta.ghost { background: transparent; border: 1px solid var(--border-3); }
.wire-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wire-cards i { height: 46px; border-radius: 7px; }
.building .wire i { background-image: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .07) 45%, transparent 70%); background-size: 260% 100%; animation: shimmer 1.6s linear infinite; }
.building .wire { border-color: rgba(141, 141, 255, .35); box-shadow: 0 0 0 4px rgba(141, 141, 255, .06); }
.placeholder h3 { margin: 26px 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.placeholder p { margin: 0 auto; max-width: 440px; color: var(--text-3); line-height: 1.6; }
.building .building 
/* live split: code being typed + website rendering from it */
.view[data-view="preview"].active { gap: 12px; }
.live-code { display: none; flex-direction: column; width: 40%; min-width: 0; border-radius: 12px; border: 1px solid var(--border-2); background: #0a0a0d; overflow: hidden; }
.streaming .live-code { display: flex; animation: fade .3s var(--ease); }
.live-code-head { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); font: 12px var(--mono); color: var(--text-2); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--builder); box-shadow: 0 0 0 3px rgba(255, 178, 36, .2); animation: pulse 1s infinite; }
.live-count { margin-left: auto; color: var(--text-3); font-variant-numeric: tabular-nums; }
.live-code pre { flex: 1; margin: 0; padding: 12px 14px; overflow: hidden; font: 11.5px/1.6 var(--mono); color: #c8c8d4; white-space: pre-wrap; word-break: break-word; }
.live-code pre::after { content: "▍"; color: var(--builder); animation: pulse .8s infinite; }
.live-frame { pointer-events: none; }
.streaming .live-code { width: 34%; }

/* code */
.code-shell { height: 100%; display: flex; flex-direction: column; border-radius: 12px; border: 1px solid var(--border-2); background: #0a0a0d; overflow: hidden; }
.files { display: flex; gap: 2px; padding: 6px 6px 0; background: var(--panel-2); border-bottom: 1px solid var(--border); min-height: 37px; }
.files .empty { padding: 6px 8px; }
.file { padding: 6px 12px 8px; border-radius: 8px 8px 0 0; font: 12px var(--mono); color: var(--text-3); border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.file:hover { color: var(--text-2); }
.file.active { color: var(--text); background: #0a0a0d; border-color: var(--border); }
.file.flash { animation: flash 1.2s; }
.code-meta { display: flex; justify-content: space-between; padding: 8px 16px; font: 11.5px var(--mono); color: var(--text-3); border-bottom: 1px solid var(--border); }
.code { flex: 1; margin: 0; padding: 14px 16px; overflow: auto; font: 12.5px/1.65 var(--mono); color: #c8c8d4; white-space: pre-wrap; word-break: break-word; tab-size: 2; }
.code .t { color: #ff8fa3; } .code .a { color: #ffc56b; } .code .s { color: #8be3b0; } .code .c { color: #5c5c68; font-style: italic; }

/* research */
.research { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.research > * { min-width: 0; }
.research-label { margin: 18px 0 10px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.research-label .muted { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.research-main .assets { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.research-side { position: sticky; top: 0; }
@media (max-width: 1440px) { .research { grid-template-columns: 1fr; } }
.queries { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.query { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--border-2); animation: rise .3s var(--ease) both; }
.query svg { width: 13px; height: 13px; color: var(--researcher); }
.brief { max-width: 760px; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }
.brief h3 { margin: 22px 0 6px; color: var(--text); font-size: 13.5px; font-weight: 600; }
.brief h3:first-child { margin-top: 0; }
.brief ul { margin: 6px 0 12px; padding-left: 18px; }
.brief li { margin: 3px 0; }
.brief li::marker { color: var(--text-3); }
.brief p { margin: 6px 0 12px; }
.brief strong { color: var(--text); font-weight: 600; }
.brief .src { font: 11px var(--mono); color: var(--researcher); }
.brief a { color: var(--researcher); }
.research-side h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.research-side h3 + * { margin-bottom: 22px; }
.sources { list-style: none; margin: 0; padding: 0 4px 0 0; display: flex; flex-direction: column; gap: 4px; max-height: 62vh; overflow-y: auto; }
.sources a { display: block; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text-2); text-decoration: none; font-size: 12.5px; line-height: 1.4; animation: rise .3s var(--ease) both; transition: border-color .2s; }
.sources a:hover { border-color: var(--border-3); color: var(--text); }
.sources .domain { display: block; font: 11px var(--mono); color: var(--researcher); margin-bottom: 2px; }
.sources .title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.asset { position: relative; margin: 0; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-2); animation: pop .4s var(--ease) both; }
.asset img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.asset figcaption { padding: 5px 8px; font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset .kind { position: absolute; top: 6px; left: 6px; padding: 2px 7px; border-radius: 6px; font: 500 10px var(--mono); color: #fff; background: rgba(8, 8, 10, .7); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .15); }
.asset.pending { aspect-ratio: 3 / 2; display: grid; place-content: center; gap: 6px; text-align: center; font-size: 11px; color: var(--text-3); background: linear-gradient(110deg, var(--bg-2) 30%, var(--panel-3) 50%, var(--bg-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }

/* quality */
.quality { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 22px; }
@media (max-width: 1440px) { .quality { grid-template-columns: 1fr; } }
.quality h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.score { font: 500 11px var(--mono); padding: 1px 7px; border-radius: 6px; }
.score.good { color: var(--green); background: var(--green-soft); }
.score.bad { color: var(--red); background: var(--red-soft); }
.checklist { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.checklist li { position: relative; padding: 8px 12px 8px 34px; font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--border); animation: rise .3s var(--ease) both; }
.checklist li:first-child { border-top: 0; }
.checklist li::before { content: ""; position: absolute; left: 12px; top: 11px; width: 12px; height: 12px; background: center / contain no-repeat; }
.checklist li.pass::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233dd68c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.checklist li.fail { background: var(--red-soft); color: var(--text); }
.checklist li.fail::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6369' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
.checklist li .d { display: block; margin-top: 2px; color: var(--text-3); font-size: 11.5px; }
.checklist li.empty { padding-left: 12px; }
.shots { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.shot { margin: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-2); background: var(--bg-2); animation: pop .4s var(--ease) both; }
.shot a { display: block; max-height: 440px; overflow: hidden; }
.shot img { width: 100%; display: block; }
.shot figcaption { padding: 7px 10px; font: 11px var(--mono); color: var(--text-3); border-top: 1px solid var(--border); }

/* ---------------- feed ---------------- */
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.live.on { color: var(--red); }
.live.on i { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 99, 105, .2); animation: pulse 1.2s infinite; }
.feed { list-style: none; flex: 1; min-height: 0; margin: 0; padding: 2px 14px 16px; overflow-y: auto; position: relative; }
.feed-empty { margin-top: 40%; text-align: center; color: var(--text-3); font-size: 13px; padding: 0 20px; }
.ev { --c: var(--text-3); position: relative; padding: 0 0 14px 22px; animation: rise .45s var(--ease) both; }
.ev::before { content: ""; position: absolute; left: 3px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--panel); z-index: 1; }
.ev::after { content: ""; position: absolute; left: 6px; top: 12px; bottom: -2px; width: 1px; background: var(--border-2); }
.ev:last-child::after { display: none; }
.ev-head { display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.ev-agent { color: var(--c); font-weight: 600; }
.ev-kind { color: var(--text-3); }
.ev-time { margin-left: auto; font: 11px var(--mono); color: var(--text-3); font-variant-numeric: tabular-nums; }
.ev-body { margin-top: 3px; color: var(--text-2); font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.ev-body.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.ev-body.clamp.expanded { display: block; -webkit-line-clamp: unset; }
.ev-more { margin-top: 4px; font-size: 11.5px; font-weight: 500; color: var(--accent); cursor: pointer; background: none; border: 0; padding: 0; }
.ev-more:hover { text-decoration: underline; }
.col-right { position: relative; }
.feed-jump { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #0b0b0e; background: #f4f4f6; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .8); animation: drop .3s var(--ease); }
.ev.tool .ev-body { font: 12px var(--mono); color: var(--text-3); }
.ev.handoff .ev-body { margin-top: 6px; padding: 8px 10px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--border); font-size: 12.5px; }
.ev.typing .ev-body { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; }
.ev.typing { animation: fade .25s var(--ease) both; }
.ev.good { --c: var(--green); }
.ev.good .ev-body { color: var(--green); }
.ev.bad { --c: var(--red); }
.ev.bad .ev-body { color: #ffb3b6; }
.ev .sub { display: block; margin-top: 4px; color: var(--text-3); font-size: 12px; }
.ev-thumbs { display: flex; gap: 4px; margin-top: 7px; }
.ev-thumbs img { width: 54px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-2); }

/* ---------------- motion ---------------- */
@keyframes pulse { 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }
@keyframes spin { to { --spin: 360deg; } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@keyframes flash { from { color: var(--builder); } }
@keyframes ripple { 0% { transform: scale(.85); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes swapIn { from { opacity: 0; transform: translateY(3px); } }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------- small screens ---------------- */
@media (max-width: 900px) {
  .topbar, .composer, .board { padding-left: 14px; padding-right: 14px; }
  .stats { flex-wrap: wrap; row-gap: 8px; }
  .stats > div { padding: 0 12px 0 0; border-left: 0; }
  .replay { width: 100%; }
  .replay select { flex: 1; max-width: none; }
  .run span { display: none; }
  .streaming .live-code { display: none; }
}

/* ---------------- short projector screens (1366x768, 1280x720) ---------------- */
@media (max-height: 820px) and (min-width: 1101px) {
  .topbar { padding: 8px 20px; }
  .stats dd { font-size: 14px; }
  .composer { padding: 10px 20px 0; }
  .command { padding: 5px 5px 5px 14px; }
  #goal { font-size: 15.5px; padding: 8px 0; }
  .run { padding: 8px 10px 8px 14px; }
  .composer-row { margin-top: 8px; }
  .goal-error { min-height: 14px; margin-top: 2px; }
  .board { padding: 2px 20px 14px; gap: 12px; height: calc(100vh - 158px); }
  .panel-head { padding: 12px 14px 8px; }
  .agent { padding: 10px; }
  .agent-now { margin-top: 7px; padding-top: 7px; }
  .tab { padding: 11px 11px 10px; }
  .view { padding: 10px; }
}
