/* ═══════════════════════════════════════════════════════════
   studio-build · cascade — Google AI Studio design language
   dark #121317 · surfaces #212226/#18191d · accent blue #2E96FF
   Google Sans Flex (display) · Inter (body) · Google Sans Code (mono)
   blue = cascade / pre-baked / fast · amber = greenfield / generated
   green = verified / done / pass
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #121317;
  --bg-deep: #0e0f12;
  --surface: #1a1b1f;
  --surface-2: #212226;
  --surface-3: #26272c;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.15);
  --text: #e8eaed;
  --white: #ffffff;
  --text-2: #9aa0a6;
  --text-3: #6b7076;
  --blue: #2e96ff;
  --blue-bright: #6bb6ff;
  --blue-soft: rgba(46,150,255,0.14);
  --blue-border: rgba(46,150,255,0.42);
  --amber: #f9ab00;
  --amber-bright: #ffc739;
  --amber-soft: rgba(249,171,0,0.14);
  --green: #5bd18b;
  --green-soft: rgba(91,209,139,0.15);
  --red: #f28b82;
  --disp: "Google Sans Flex", "Google Sans", -apple-system, sans-serif;
  --sans: "Inter", -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Google Sans Code", "Roboto Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.006em;
}
button { font-family: inherit; cursor: pointer; }
code { font-family: var(--mono); font-size: 0.85em; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; color: #d7dae0; }

/* ── Desktop-only notice ──────────────────────────────── */
.narrow-notice {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  align-items: center; justify-content: center; text-align: center;
  padding: 32px; flex-direction: column;
}
.nn-mark { font-family: var(--mono); font-size: 14px; letter-spacing: 0.3em; color: var(--text-2); text-transform: uppercase; margin-bottom: 20px; }
.nn-mark span { color: var(--blue); }
.nn-title { font-family: var(--disp); font-size: 26px; font-weight: 500; margin-bottom: 12px; color: var(--white); }
.narrow-notice p { max-width: 380px; color: var(--text-2); font-size: 15px; }

/* ── Gate ─────────────────────────────────────────────── */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1100px 560px at 72% -10%, rgba(46,150,255,0.14), transparent 62%),
    radial-gradient(820px 480px at 8% 112%, rgba(46,150,255,0.06), transparent 60%),
    var(--bg);
  padding: 24px;
}
.gate[hidden] { display: none; }
.gate-card { width: 100%; max-width: 400px; text-align: center; }
.gate-mark {
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.32em;
  color: var(--text-2); text-transform: uppercase; margin-bottom: 22px;
}
.gate-mark span { color: var(--blue); }
.gate-title { font-family: var(--disp); font-size: 32px; font-weight: 500; letter-spacing: -0.02em; color: var(--white); }
.gate-sub { color: var(--text-2); font-size: 14.5px; margin: 8px 0 28px; }
#gate-form { display: flex; gap: 8px; }
#gate-input {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: 15px;
  padding: 13px 15px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface-2); color: var(--white); outline: none;
}
#gate-input::placeholder { color: var(--text-3); }
#gate-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
#gate-form button {
  padding: 13px 22px; border: none; border-radius: 12px;
  background: var(--white); color: var(--bg-deep); font-size: 15px; font-weight: 600;
}
#gate-form button:hover { background: #e6e7ea; }
.gate-err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px; }
.gate-card.shake { animation: shake 0.4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }

/* ── Top bar ──────────────────────────────────────────── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 22px; height: 56px;
  background: rgba(18,19,23,0.86); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.wordmark { font-family: var(--mono); font-size: 13px; letter-spacing: 0.01em; white-space: nowrap; }
.wm-a { color: var(--text-2); }
.wm-sep { color: var(--text-3); margin: 0 6px; }
.wm-b { color: var(--blue); font-weight: 500; }
.tabs { display: flex; gap: 4px; }
.tab {
  border: none; background: none; padding: 8px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: color 0.15s, background 0.15s;
}
.tab:hover { color: var(--white); background: rgba(255,255,255,0.06); }
.tab[aria-selected="true"] { background: var(--white); color: var(--bg-deep); }

/* ── Research view ────────────────────────────────────── */
.view[hidden] { display: none; }
.view-research { flex: 1; }
.paper { max-width: 840px; margin: 0 auto; padding: 68px 28px 96px; }

.kicker {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--blue); margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--disp); font-weight: 600; font-size: clamp(46px, 7vw, 68px);
  line-height: 1.04; letter-spacing: -0.035em; margin-bottom: 26px; color: var(--white);
}
.hero-lede { font-size: 18px; line-height: 1.66; max-width: 680px; color: var(--text); }
.hero-lede em { font-style: normal; color: var(--white); font-weight: 500; }
.hero-lede strong { color: var(--white); font-weight: 600; }
.tealtag { color: var(--blue-bright); font-weight: 600; white-space: nowrap; }

.verdict {
  margin-top: 36px; border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(46,150,255,0.06), transparent 80%), var(--surface);
  padding: 24px 28px; border-radius: 18px; border-left: 3px solid var(--blue);
}
.verdict-label {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--blue); margin-bottom: 10px;
}
.verdict p { font-size: 15.5px; color: var(--text); }
.verdict strong { color: var(--white); }

.sec { margin-top: 78px; }
.sec-num {
  font-family: var(--mono); font-size: 12px; color: var(--text-3);
  letter-spacing: 0.1em; margin-bottom: 10px;
}
.sec h2 {
  font-family: var(--disp); font-weight: 600; font-size: clamp(27px, 4vw, 34px);
  letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 18px; color: var(--white);
}
.sec h3 {
  font-family: var(--disp); font-weight: 500; font-size: 18px; color: var(--white);
  margin: 26px 0 10px; letter-spacing: -0.01em;
}
.sec p { margin-bottom: 14px; max-width: 700px; }
.sec p strong { color: var(--white); font-weight: 600; }
.sec em { font-style: normal; color: #c4c7cc; }
.aside {
  font-size: 14.5px; color: var(--text-2);
  border-top: 1px solid var(--border); padding-top: 16px; margin-top: 20px;
}
.aside strong { color: var(--text); }

/* latency anatomy */
.anatomy { margin: 28px 0 8px; }
.anatomy-track {
  display: flex; height: 60px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
}
.anat-seg {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.35;
  padding: 4px 8px; text-align: center;
  width: 0; transition: width 1.2s cubic-bezier(0.22,1,0.36,1); overflow: hidden; white-space: nowrap;
}
.anatomy.on .anat-seg { width: calc(var(--w) * 1%); }
.anat-prefill { background: var(--surface-3); color: var(--text-2); }
.anat-think { background: var(--amber-soft); color: var(--amber-bright); }
.anat-decode { background: var(--amber); color: #1a1400; padding: 4px 14px; }
.anat-decode span { overflow: hidden; text-overflow: ellipsis; }
.anat-decode strong { color: #1a1400; }
.anat-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; }
.al-item { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.al-sw { width: 11px; height: 11px; border-radius: 3px; margin-right: 8px; flex-shrink: 0; }
.al-prefill { background: var(--surface-3); }
.al-think { background: var(--amber-soft); border: 1px solid var(--amber); }
.al-decode { background: var(--amber); }
.anatomy-caption { font-size: 13px; color: var(--text-2); margin-top: 14px; font-family: var(--mono); }
.anatomy-caption strong { color: var(--text); }

/* evidence lists */
.evidence { list-style: none; margin: 20px 0 6px; }
.evidence li {
  padding: 13px 0 13px 26px; position: relative;
  border-bottom: 1px solid var(--border); font-size: 15px; max-width: 720px;
}
.evidence li::before {
  content: "→"; position: absolute; left: 0; top: 13px;
  color: var(--blue); font-family: var(--mono);
}
.evidence strong { color: var(--white); }
.hash { font-family: var(--mono); font-size: 12px; color: var(--text-3); }

/* market table */
.mkt { width: 100%; border-collapse: collapse; margin: 22px 0 10px; font-size: 14px; }
.mkt th {
  text-align: left; font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-2); padding: 10px 12px;
  border-bottom: 1px solid var(--border-strong);
}
.mkt td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text); }
.mkt td:first-child { font-weight: 600; white-space: nowrap; color: var(--white); }
.mkt tr.counter td { background: var(--amber-soft); }
.mkt tr.counter td:first-child { color: var(--amber-bright); }

/* pipeline */
.pipe { list-style: none; counter-reset: pipe; margin: 28px 0 10px; }
.pipe li {
  counter-increment: pipe; position: relative;
  padding: 0 0 28px 56px; border-left: 1px solid var(--border); margin-left: 19px;
}
.pipe li:last-child { border-left-color: transparent; padding-bottom: 4px; }
.pipe li::before {
  content: counter(pipe);
  position: absolute; left: -20px; top: -2px;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-3); color: var(--white);
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid var(--bg);
}
.pipe-t { font-family: var(--disp); font-size: 19px; font-weight: 500; margin-right: 10px; color: var(--white); }
.pipe-cost {
  font-family: var(--mono); font-size: 11px; padding: 3px 10px; border-radius: 999px;
  vertical-align: 3px; letter-spacing: 0.02em;
}
.cost-zero { background: var(--blue-soft); color: var(--blue-bright); }
.cost-small { background: var(--surface-3); color: var(--text-2); }
.cost-big { background: var(--amber-soft); color: var(--amber-bright); }
.pipe p { font-size: 14.5px; color: var(--text-2); margin-top: 6px; max-width: 640px; }

/* math bars */
.mathline { margin-top: 12px; }
.mathbar { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 10px; }
.mb-row { display: flex; align-items: center; gap: 12px; }
.mb-label { font-family: var(--mono); font-size: 12px; width: 70px; color: var(--text-2); text-align: right; }
.mb-track { flex: 1; height: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.mb-fill { height: 100%; width: 0; border-radius: 999px; transition: width 1.4s cubic-bezier(0.22,1,0.36,1); }
.mathline.on .mb-fill { width: calc(var(--w) * 1%); }
.mb-amber { background: linear-gradient(90deg, var(--amber), var(--amber-bright)); }
.mb-teal { background: linear-gradient(90deg, var(--blue), var(--blue-bright)); }
.mb-val { font-family: var(--mono); font-size: 13px; width: 78px; color: var(--text); }

/* taxonomy axes */
.axes { display: grid; gap: 14px; margin: 24px 0 12px; }
.axis { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px 24px; }
.axis-head { font-family: var(--disp); font-size: 18px; font-weight: 500; margin-bottom: 8px; color: var(--white); }
.axis-n {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--blue); display: block; margin-bottom: 4px; font-weight: 500;
}
.axis-rule { font-family: var(--mono); font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 8px; }
.axis p { font-size: 14px; color: var(--text-2); margin-bottom: 0; max-width: none; }
.axis p strong { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.chip {
  font-family: var(--mono); font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
}
.chip-ghost { background: none; border-style: dashed; border-color: var(--blue-border); color: var(--blue-bright); }

/* proof steps (legacy) */
.proof-steps { margin: 18px 0 10px 20px; }
.proof-steps li { margin-bottom: 14px; font-size: 15px; max-width: 700px; }
.proof-steps strong { color: var(--white); }

.cta-row { margin-top: 32px; }
.cta {
  border: none; background: var(--blue); color: var(--white);
  font-size: 15px; font-weight: 600; padding: 13px 24px; border-radius: 12px;
  transition: background 0.15s, transform 0.15s;
}
.cta:hover { background: #1f86f0; transform: translateY(-1px); }

/* folded detail sections */
.folds { margin-top: 78px; }
.folds-label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-3); margin-bottom: 14px;
}
details.fold {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  margin-bottom: 12px; overflow: hidden;
}
details.fold > summary {
  cursor: pointer; list-style: none; padding: 18px 22px;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--disp); font-weight: 500; font-size: 16.5px; color: var(--white);
  transition: background 0.15s;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary:hover { background: rgba(255,255,255,0.03); }
.fold-sub { font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: var(--text-3); margin-left: auto; }
.fold-x { position: relative; width: 14px; height: 14px; flex-shrink: 0; }
.fold-x::before, .fold-x::after {
  content: ""; position: absolute; background: var(--text-2); border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.fold-x::before { top: 6px; left: 0; width: 14px; height: 2px; }
.fold-x::after { left: 6px; top: 0; width: 2px; height: 14px; }
details.fold[open] > summary .fold-x::after { transform: rotate(90deg); opacity: 0; }
details.fold[open] > summary { border-bottom: 1px solid var(--border); }
.fold-body { padding: 18px 24px 22px; }
.fold-body > h4 {
  font-family: var(--disp); font-weight: 500; font-size: 17px; color: var(--white);
  margin: 26px 0 10px; letter-spacing: -0.01em;
}
.fold-body > h4:first-child { margin-top: 4px; }
.fold-body p { max-width: none; }
.fold-body .evidence li { max-width: none; }
@media (prefers-reduced-motion: no-preference) {
  details.fold[open] > .fold-body { animation: fold-in 0.28s ease; }
}
@keyframes fold-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.foot { margin-top: 60px; border-top: 1px solid var(--border); padding-top: 24px; }
.foot p { font-size: 12.5px; color: var(--text-3); line-height: 1.75; }
.foot code { font-size: 11px; }
.foot-fine { margin-top: 10px; font-family: var(--mono); font-size: 11px; }

/* ── Simulator view ───────────────────────────────────── */
.view-simulator {
  flex: 1; display: grid; grid-template-columns: minmax(400px, 44%) 1fr;
  min-height: 0; height: calc(100dvh - 56px);
}
.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ph-title {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-2);
}
.ph-reset {
  border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 999px;
  font-family: var(--mono); font-size: 11.5px; padding: 6px 13px; color: var(--text-2);
  transition: all 0.15s;
}
.ph-reset:hover { color: var(--white); border-color: var(--text-2); }

/* left: chat */
.pane-chat { background: var(--bg); border-right: 1px solid var(--border); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 24px 22px 10px; }
.chat-day {
  text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--text-3);
  margin-bottom: 20px;
}
.chat-log { display: flex; flex-direction: column; gap: 13px; }
.msg { max-width: 90%; animation: msg-in 0.35s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg-user { align-self: flex-end; }
.msg-user .bubble {
  background: var(--blue); color: var(--white);
  border-radius: 18px 18px 5px 18px; padding: 11px 16px; font-size: 15px;
}
.msg-bot { align-self: flex-start; }
.msg-bot .bubble {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 18px 18px 18px 5px; padding: 11px 16px; font-size: 15px;
}
.msg-bot .bubble b { font-weight: 600; color: var(--white); }
.msg-note { align-self: center; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%,80%,100%{opacity:0.25} 40%{opacity:1} }

.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.opt {
  border: 1px solid var(--blue-border); background: var(--blue-soft); color: var(--blue-bright);
  border-radius: 999px; padding: 7px 15px; font-size: 13.5px; font-weight: 600;
  transition: all 0.15s;
}
.opt:hover:not(:disabled) { background: rgba(46,150,255,0.22); }
.opt:disabled { opacity: 0.4; cursor: default; }
.opt.picked { background: var(--blue); color: var(--white); border-color: var(--blue); opacity: 1; }

/* blueprint card in chat */
.bp-card {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 18px;
  padding: 18px 20px;
}
.bp-kicker {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--blue); margin-bottom: 8px;
}
.bp-name { font-family: var(--disp); font-size: 22px; font-weight: 500; margin-bottom: 10px; color: var(--white); }
.bp-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bp-row { display: flex; gap: 8px; font-size: 13px; }
.bp-k { font-family: var(--mono); font-size: 11px; color: var(--text-3); width: 64px; flex-shrink: 0; padding-top: 3px; }
.bp-v .pillet {
  display: inline-block; font-family: var(--mono); font-size: 11.5px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 10px; margin: 1px 3px 1px 0; color: var(--text);
}
.bp-v .pillet.hot { background: var(--blue-soft); border-color: var(--blue-border); color: var(--blue-bright); }
.bp-feats { margin: 6px 0 14px 16px; font-size: 13.5px; color: var(--text-2); }
.bp-feats li { margin-bottom: 3px; }
.bp-build {
  width: 100%; border: none; border-radius: 12px; background: var(--blue); color: var(--white);
  font-size: 14.5px; font-weight: 600; padding: 12px; transition: background 0.15s;
}
.bp-build:hover:not(:disabled) { background: #1f86f0; }
.bp-build:disabled { opacity: 0.55; cursor: default; }
.bp-edithint { text-align: center; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); margin-top: 8px; }

/* mock preview card */
.preview-card {
  border: 1px solid var(--border-strong); border-radius: 16px; overflow: hidden;
  background: var(--surface);
}
.preview-bar {
  display: flex; align-items: center; gap: 6px; padding: 9px 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.preview-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
.preview-bar span { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); margin-left: 6px; }
.preview-body { padding: 14px; min-height: 132px; }
.wf { border-radius: 8px; }
.wf-head { height: 22px; border-radius: 6px; margin-bottom: 8px; opacity: 0.92; }
.wf-row { display: flex; gap: 8px; }
.wf-block { border-radius: 6px; flex: 1; }
.preview-done {
  font-family: var(--mono); font-size: 11px; padding: 9px 12px;
  border-top: 1px solid var(--border); color: var(--green);
}

/* suggestions + input */
.chat-input-zone { flex-shrink: 0; border-top: 1px solid var(--border); padding: 14px 18px 18px; background: var(--bg); }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.sug {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px;
  padding: 6px 13px; font-size: 12.5px; color: var(--text); transition: all 0.15s;
}
.sug:hover { border-color: var(--blue-border); color: var(--blue-bright); }
.chat-form { display: flex; gap: 8px; }
#chat-input {
  flex: 1; min-width: 0; font-family: var(--sans); font-size: 15px;
  padding: 13px 18px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface-2); color: var(--white); outline: none;
}
#chat-input::placeholder { color: var(--text-3); }
#chat-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.chat-form button {
  width: 48px; border: none; border-radius: 50%; background: var(--blue);
  color: var(--white); font-size: 18px; flex-shrink: 0; transition: background 0.15s;
}
.chat-form button:hover { background: #1f86f0; }

/* right: engine room */
.pane-engine { background: var(--bg-deep); color: var(--text); font-family: var(--mono); }
.eng-head { border-bottom: 1px solid var(--border); }
.eng-head .ph-title { color: var(--text-3); }
.eng-clock { font-size: 11.5px; color: var(--blue-bright); }
.engine-scroll { flex: 1; overflow-y: auto; padding: 20px 22px 32px; display: flex; flex-direction: column; gap: 16px; }

.eng-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 15px 17px;
}
.eng-block-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.11em;
  color: var(--text-3); margin-bottom: 13px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
}
.eng-legend { display: inline-flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0.02em; font-size: 10px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.dot-teal { background: var(--blue); }
.dot-amber { background: var(--amber); }
.eng-empty { color: var(--text-3); font-size: 12px; }

/* stage bar */
.stagebar { display: flex; gap: 4px; }
.stage {
  flex: 1; text-align: center; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-3); padding-top: 2px;
}
.stage i {
  display: block; height: 4px; border-radius: 999px; background: var(--surface-3);
  margin-bottom: 6px; transition: background 0.3s, box-shadow 0.3s;
}
.stage.active { color: var(--text); }
.stage.active i { background: var(--amber); box-shadow: 0 0 10px rgba(249,171,0,0.5); animation: pulse 1.1s ease-in-out infinite; }
.stage.done { color: var(--green); }
.stage.done i { background: var(--green); box-shadow: 0 0 8px rgba(91,209,139,0.45); animation: none; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.45} }

/* taxonomy panel */
.eng-axis { margin-bottom: 15px; }
.eng-axis:last-child { margin-bottom: 2px; }
.eng-axis-label { font-size: 10px; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.fam-candidates { display: flex; flex-direction: column; gap: 6px; }
.fam-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.fam-name { width: 116px; flex-shrink: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam-track { flex: 1; height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.fam-fill { height: 100%; width: 0; border-radius: 999px; background: var(--text-3); transition: width 0.8s cubic-bezier(0.22,1,0.36,1); }
.fam-row.winner .fam-fill { background: var(--blue); box-shadow: 0 0 8px rgba(46,150,255,0.5); }
.fam-row.winner .fam-name { color: var(--blue-bright); }
.fam-conf { width: 40px; text-align: right; font-size: 10.5px; color: var(--text-3); }
.fam-row.winner .fam-conf { color: var(--blue-bright); }
.fam-signals { margin-top: 9px; font-size: 11px; color: var(--text-3); line-height: 1.9; }
.sig-word {
  background: var(--blue-soft); border: 1px solid var(--blue-border);
  color: var(--blue-bright); border-radius: 5px; padding: 1px 6px; margin-right: 4px;
}
.mod-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mod {
  font-size: 11px; border: 1px dashed var(--border-strong); color: var(--text-3);
  border-radius: 999px; padding: 3px 11px; transition: all 0.3s;
}
.mod.on {
  border-style: solid; border-color: var(--blue-border); color: var(--blue-bright);
  background: var(--blue-soft);
}
.mod.off { text-decoration: line-through; opacity: 0.45; }
.theme-slot { font-size: 12px; }
.theme-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px 4px 5px;
  color: var(--text); animation: msg-in 0.4s both; background: var(--surface-2);
}
.theme-chip b { color: var(--white); }
.theme-swatch { display: inline-flex; border-radius: 999px; overflow: hidden; width: 42px; height: 16px; }
.theme-swatch i { flex: 1; }

/* prompt assembly */
.prompt-compare { display: flex; flex-direction: column; gap: 8px; }
.pc-row { display: flex; align-items: center; gap: 8px; font-size: 10.5px; }
.pc-label { width: 54px; text-align: right; color: var(--text-3); flex-shrink: 0; }
.pc-bar { flex: 1; height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; min-width: 40px; }
.pc-fill { height: 100%; border-radius: 999px; background: var(--amber); transition: width 1s cubic-bezier(0.22,1,0.36,1); }
.pc-new .pc-fill { background: var(--blue); }
.pc-val { color: var(--text-3); white-space: nowrap; flex-shrink: 0; max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
.pc-new .pc-val { color: var(--blue-bright); }
.pc-note { margin-top: 11px; font-size: 10.5px; color: var(--text-3); line-height: 1.75; }
.pc-note .cachetag { color: var(--blue-bright); }

/* file tree */
.file-tree { font-size: 11.5px; line-height: 1.95; }
.ft-group-label { color: var(--text-3); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; margin: 8px 0 3px; }
.ft-file { display: flex; align-items: baseline; gap: 8px; opacity: 0; transform: translateX(-6px); transition: opacity 0.3s, transform 0.3s; }
.ft-file.in { opacity: 1; transform: none; }
.ft-name { color: var(--text); }
.ft-file .dot { margin: 0; flex-shrink: 0; align-self: center; }
.ft-tok { margin-left: auto; font-size: 10px; color: var(--text-3); }
.ft-file.gen .ft-name { color: #f0dcae; }
.ft-file.gen .ft-tok { color: var(--amber-bright); }
.ft-file.gen.streaming .ft-name::after { content: "▌"; color: var(--amber-bright); animation: blink 0.8s infinite; }
.tok-total { margin-top: 11px; font-size: 11px; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 9px; }
.tok-total b { color: var(--amber-bright); font-weight: 500; }
.tok-total .zero { color: var(--green); }

/* race */
.race { display: flex; flex-direction: column; gap: 10px; }
.race-row { display: flex; align-items: center; gap: 8px; font-size: 10.5px; }
.race-label { width: 74px; text-align: right; color: var(--text-3); flex-shrink: 0; }
.race-track { flex: 1; height: 14px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.race-fill { height: 100%; width: 0; border-radius: 999px; transition: width 0.2s linear; }
.race-amber { background: linear-gradient(90deg, var(--amber), var(--amber-bright)); }
.race-teal { background: linear-gradient(90deg, var(--blue), var(--blue-bright)); }
.race-time { width: 42px; font-size: 11px; color: var(--text); flex-shrink: 0; }
.race-note { margin-top: 11px; font-size: 10.5px; color: var(--text-3); line-height: 1.75; min-height: 16px; }
.race-note .win { color: var(--green); }

/* log */
.eng-block-log { flex: 1; min-height: 120px; }
.eng-log { font-size: 11px; line-height: 1.9; color: var(--text-3); }
.log-line { display: flex; gap: 10px; animation: msg-in 0.25s both; }
.log-t { color: var(--surface-3); flex-shrink: 0; width: 46px; }
.log-line.hot .log-m { color: var(--text); }
.log-line.teal .log-m { color: var(--blue-bright); }
.log-line.amber .log-m { color: var(--amber-bright); }

/* ── desktop-only enforcement ─────────────────────────── */
@media (max-width: 1099px) {
  .narrow-notice { display: flex; }
  .app, .gate { display: none !important; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
