/* ---------- 7play design tokens ---------- */
:root {
  /* warm-neutral stone palette */
  --bg: #fafaf9;
  --bg-elevated: #ffffff;
  --bg-sunken: #f5f5f4;
  --bg-subtle: #f1f0ef;

  --ink: #18181b;
  --ink-2: #3f3f46;
  --ink-muted: #71717a;
  --ink-faint: #a1a1aa;

  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --line-faint: #f0efee;

  /* electric accents — shared chroma, different hue */
  --lime: #a3e635;
  --lime-ink: #3f6212;
  --lime-soft: #ecfccb;

  --cyan: #22d3ee;
  --cyan-ink: #0e7490;
  --cyan-soft: #cffafe;

  --magenta: #e879f9;
  --magenta-ink: #86198f;
  --magenta-soft: #fae8ff;

  --amber: #f59e0b;
  --rose: #f43f5e;

  /* type */
  --font-ui: 'Inter Tight', 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;

  /* shadows (flat — hairline instead) */
  --shadow-sm: 0 1px 0 rgba(0,0,0,0.02);
  --shadow-md: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px -8px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root { min-height: 100vh; }

button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, textarea { font-family: inherit; }

::selection { background: var(--lime); color: var(--ink); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ---------- utilities ---------- */
.mono { font-family: var(--font-mono); font-variant-ligatures: none; letter-spacing: -0.01em; }
.tight { letter-spacing: -0.015em; }
.tighter { letter-spacing: -0.03em; }
.caps { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 500; }

.hairline { border: 1px solid var(--line); }
.hairline-b { border-bottom: 1px solid var(--line); }
.hairline-t { border-top: 1px solid var(--line); }
.hairline-r { border-right: 1px solid var(--line); }
.hairline-l { border-left: 1px solid var(--line); }

/* ---------- app layout ---------- */
.app {
  display: grid;
  height: 100vh;
  overflow: hidden;
}
/* Home: full sidebar + main */
.app.has-sidebar { grid-template-columns: 240px 1fr; }
/* Session (no chat): just main */
.app.no-sidebar.no-chat { grid-template-columns: 1fr; }
/* Session + chat (Build stage): chat on left, main right */
.app.no-sidebar.chat-left { grid-template-columns: 360px 1fr; }
.app.no-sidebar.chat-left.chat-collapsed { grid-template-columns: 40px 1fr; }

/* ---------- sidebar (full, home only) ---------- */
.sidebar.full {
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 12px 14px;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar.full::-webkit-scrollbar { width: 0; }
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.sb-brand .brand-mark { width: 30px; height: 30px; font-size: 15px; flex-shrink: 0; }
.sb-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sb-brand-name { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
.sb-brand-sub { font-size: 10px; color: var(--ink-faint); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }

.sb-cta {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: var(--ink);
  color: var(--lime);
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 14px;
  font-family: inherit;
  letter-spacing: -0.01em;
}
.sb-cta:hover { background: #000; }

.sb-section-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 6px;
  margin: 8px 0 4px;
}

.sb-nav { display: flex; flex-direction: column; gap: 1px; }
.sb-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.sb-nav-item:hover { background: var(--bg-subtle); color: var(--ink); }
.sb-nav-item.active { background: var(--ink); color: var(--bg); }
.sb-nav-item.active .sb-nav-count { background: var(--lime); color: var(--ink); }
.sb-nav-item.disabled { opacity: 0.4; pointer-events: none; }
.sb-nav-item .sb-nav-count {
  margin-left: auto;
  background: var(--bg-subtle);
  color: var(--ink-2);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}

.sb-recent { display: flex; flex-direction: column; gap: 1px; }
.sb-recent-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  min-width: 0;
}
.sb-recent-item:hover { background: var(--bg-subtle); }
.sb-recent-mark {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--bg);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  flex-shrink: 0;
}
.sb-recent-body { min-width: 0; flex: 1; }
.sb-recent-name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-recent-meta {
  font-size: 10px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sb-spacer { flex: 1; }
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}
.sb-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.sb-user-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-user-role {
  font-size: 10px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

/* ---------- sidebar (icon rail) ---------- */
.sidebar.rail {
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 12px;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar.rail::-webkit-scrollbar { width: 0; }
.rail-brand {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  cursor: pointer;
  margin-bottom: 6px;
}
.rail-brand .brand-mark { width: 28px; height: 28px; font-size: 14px; }
.rail-item {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-2);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: background 0.1s, color 0.1s;
  position: relative;
}
.rail-item:hover { background: var(--bg-subtle); color: var(--ink); }
.rail-item.active { background: var(--ink); color: var(--bg); }
.rail-item.active::before {
  content: '';
  position: absolute;
  left: -6px; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--lime);
}
.rail-item.cta {
  background: var(--ink);
  color: var(--lime);
  margin-bottom: 6px;
}
.rail-item.cta:hover { background: #000; color: var(--lime); }
.rail-item.disabled { opacity: 0.35; pointer-events: none; }

.rail-sep {
  width: 24px; height: 1px;
  background: var(--line);
  margin: 6px 0;
}

.rail-session {
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: grid; place-items: center;
  position: relative;
  transition: transform 0.1s;
}
.rail-session:hover { transform: translateY(-1px); }
.rail-session-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
}
.rail-session.active::before {
  content: '';
  position: absolute;
  left: -6px; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--lime);
}
.rail-session.active .rail-session-mark {
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 3px var(--lime);
}

.rail-spacer { flex: 1; }
.rail-avatar {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--lime);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  margin-top: 6px;
}

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  gap: 2px;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 14px 8px;
}
.brand-mark {
  width: 22px; height: 22px;
  background: var(--ink);
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: var(--lime);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.04em;
}
.brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-name .dot { color: var(--ink-faint); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 10px;
  transition: background 0.12s;
}
.nav-cta:hover { background: #000; }
.nav-cta .plus { color: var(--lime); font-weight: 600; }

.nav-section {
  padding: 10px 10px 4px 10px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}
.nav-item:hover { background: var(--bg-subtle); color: var(--ink); }
.nav-item.active { background: var(--ink); color: var(--bg); }
.nav-item.active .nav-count { color: var(--lime); }
.nav-item .nav-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}
.nav-item.disabled { color: var(--ink-faint); cursor: not-allowed; }
.nav-item.disabled::after { content: 'soon'; margin-left: auto; font-size: 10px; color: var(--ink-faint); font-family: var(--font-mono); }

.session-recent {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.session-recent:hover { background: var(--bg-subtle); }
.session-recent .sr-title {
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 4px 0 4px;
}
.session-recent .sr-meta {
  font-size: 10px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  padding: 0 4px 4px 4px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 8px 2px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
}
.avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--magenta-soft);
  color: var(--magenta-ink);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
}
.sidebar-footer .u-name { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .u-meta { font-size: 10px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- main panel ---------- */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.topbar {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 52px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  gap: 16px;
  flex-shrink: 0;
}
.topbar .title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.topbar .crumb {
  color: var(--ink-faint);
  font-size: 13px;
  white-space: nowrap;
}
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.topbar-home {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-right: -4px;
  transition: background 0.1s;
}
.topbar-home:hover { background: var(--bg-subtle); }
.topbar .crumb { cursor: pointer; transition: color 0.1s; }
.topbar .crumb:hover { color: var(--ink); }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 40px 60px 40px;
}
.content.flush { padding: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  transition: all 0.12s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); background: var(--bg-subtle); }
.btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn.primary:hover { background: #000; }
.btn.accent {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--lime);
  font-weight: 600;
}
.btn.accent:hover { background: #9cd32a; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-subtle); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.lg { padding: 10px 18px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.danger { color: var(--rose); }
.btn.danger:hover { background: color-mix(in oklch, var(--rose) 8%, transparent); }

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.lime { background: var(--lime-soft); color: var(--lime-ink); border-color: color-mix(in oklch, var(--lime) 30%, transparent); }
.chip.cyan { background: var(--cyan-soft); color: var(--cyan-ink); border-color: color-mix(in oklch, var(--cyan) 30%, transparent); }
.chip.magenta { background: var(--magenta-soft); color: var(--magenta-ink); border-color: color-mix(in oklch, var(--magenta) 30%, transparent); }
.chip.warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.chip.danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.chip.solid-ink { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
}
.dot.live {
  background: var(--cyan);
  box-shadow: 0 0 0 0 color-mix(in oklch, var(--cyan) 50%, transparent);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--cyan) 50%, transparent); }
  70% { box-shadow: 0 0 0 8px color-mix(in oklch, var(--cyan) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--cyan) 0%, transparent); }
}
.dot.success { background: var(--lime-ink); }
.dot.warn { background: var(--amber); }
.dot.danger { background: var(--rose); }
.dot.neutral { background: var(--ink-faint); }

/* ---------- cards ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.card-body { padding: 16px; }
.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- stepper ---------- */
/* default (numbered segmented) */
.stepper {
  display: flex;
  align-items: stretch;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: 12px;
}
.stepper .step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 14px;
  border-right: 1px solid var(--line);
  color: var(--ink-faint);
  position: relative;
  white-space: nowrap;
}
.stepper .step:last-child { border-right: 0; }
.stepper .step .num {
  font-family: var(--font-mono);
  font-size: 10px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}
.stepper .step.done { color: var(--ink-2); }
.stepper .step.done .num { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.stepper .step.current { color: var(--ink); background: var(--bg-subtle); font-weight: 500; }
.stepper .step.current .num { background: var(--lime); color: var(--ink); border-color: var(--lime); }

/* stepper variant: pills */
.stepper.pills { background: transparent; border: 0; gap: 6px; }
.stepper.pills .step {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--bg-elevated);
}
.stepper.pills .step.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stepper.pills .step.current .num { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.stepper.pills .step.done { background: var(--lime-soft); border-color: color-mix(in oklch, var(--lime) 40%, transparent); color: var(--lime-ink); }
.stepper.pills .step.done .num { background: var(--lime-ink); color: var(--lime); border-color: var(--lime-ink); }

/* stepper variant: breadcrumb dots */
.stepper.dots {
  background: transparent;
  border: 0;
  gap: 4px;
}
.stepper.dots .step {
  border: 0;
  padding: 4px 8px;
  gap: 6px;
}
.stepper.dots .step::after {
  content: '';
  width: 14px; height: 1px;
  background: var(--line-strong);
  margin-left: 8px;
}
.stepper.dots .step:last-child::after { display: none; }
.stepper.dots .step .num {
  width: 8px; height: 8px; border-radius: 50%;
  border: 0;
}
.stepper.dots .step.done .num { background: var(--lime-ink); }
.stepper.dots .step.current .num { background: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.stepper.dots .step:not(.done):not(.current) .num { background: var(--line-strong); }

/* ---------- chat panel (left-docked on Build) ---------- */
.chat {
  border-right: 1px solid var(--line);
  border-left: none;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-head {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-head .title { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.chat-head .sub { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); white-space: nowrap; }
.chat-head .btn.ghost.sm { padding: 4px 6px; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.msg-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.msg-head .tag { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.msg-head .tag.agent { color: var(--cyan-ink); }
.msg-body {
  color: var(--ink-2);
  line-height: 1.5;
}
.msg.agent .msg-body {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.msg.agent.thinking .msg-body { color: var(--ink-muted); font-style: italic; }
.msg.system .msg-body {
  background: var(--lime-soft);
  color: var(--lime-ink);
  border: 1px solid color-mix(in oklch, var(--lime) 30%, transparent);
  border-radius: var(--r-md);
  padding: 8px 12px;
  font-size: 12px;
}
.msg.user .msg-body {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-md);
  padding: 10px 12px;
  align-self: flex-end;
}
.msg.user { align-items: flex-end; }

.chat-sub {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  font-size: 11px;
  color: var(--ink-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-wrap {
  border-top: 1px solid var(--line);
  padding: 10px 12px 12px 12px;
  background: var(--bg);
}
.chat-input {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.12s;
}
.chat-input:focus-within { border-color: var(--ink); }
.chat-input textarea {
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  padding: 2px;
  min-height: 22px;
  max-height: 140px;
}
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-input-row .mini {
  padding: 2px 6px; font-size: 10px; color: var(--ink-faint); font-family: var(--font-mono); border-radius: 3px;
}
.chat-input-row .mini:hover { background: var(--bg-subtle); color: var(--ink); }
.chat-input-send {
  margin-left: auto;
  background: var(--ink);
  color: var(--bg);
  width: 22px; height: 22px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 11px;
}
.chat-input-send:hover { background: var(--lime); color: var(--ink); }

.chat-collapsed-bar {
  border-right: 1px solid var(--line);
  border-left: none;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 16px;
}
.chat-collapsed-bar .ic-btn {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  cursor: pointer;
}
.chat-collapsed-bar .ic-btn:hover { background: var(--bg-subtle); }

/* ---------- tables ---------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--line-faint);
  color: var(--ink-2);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tr.hoverable { cursor: pointer; transition: background 0.08s; }
.table tr.hoverable:hover { background: var(--bg-subtle); }
.game-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-icon {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.game-name { font-weight: 500; color: var(--ink); }
.game-pub { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); }

/* progress line (inline table) */
.progress-line {
  display: flex;
  align-items: center;
  gap: 3px;
}
.progress-line .seg {
  width: 22px; height: 3px; border-radius: 2px;
  background: var(--line-strong);
}
.progress-line .seg.done { background: var(--ink); }
.progress-line .seg.current { background: var(--lime); }

/* ---------- placeholder imagery ---------- */
.img-placeholder {
  position: relative;
  background:
    repeating-linear-gradient(135deg, var(--bg-subtle) 0 6px, var(--bg-sunken) 6px 12px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  overflow: hidden;
}
.img-placeholder.dark {
  background: repeating-linear-gradient(135deg, #1f1f23 0 6px, #18181b 6px 12px);
  color: #71717a;
  border-color: #27272a;
}

/* ---------- new session wizard ---------- */
.wizard {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 0 80px 0;
}
.wizard h1 {
  font-size: 34px;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0 0 6px 0;
  line-height: 1.05;
}
.wizard h1 em {
  font-style: normal;
  background: var(--lime);
  padding: 0 6px;
  border-radius: 4px;
}
.wizard .lede {
  color: var(--ink-muted);
  font-size: 15px;
  margin: 0 0 36px 0;
}
.wizard-step {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}
.wizard-step.active { border-color: var(--ink); }
.wizard-step.done .ws-num {
  background: var(--ink); color: var(--lime); border-color: var(--ink);
}
.wizard-step.locked { opacity: 0.5; }
.ws-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ws-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  display: grid; place-items: center;
}
.wizard-step.active .ws-num { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.ws-title { font-weight: 600; letter-spacing: -0.01em; font-size: 15px; flex: 1; white-space: nowrap; }
.ws-sub { color: var(--ink-faint); font-size: 12px; margin-left: auto; font-family: var(--font-mono); flex-shrink: 0; white-space: nowrap; }

.input-row { display: flex; gap: 10px; }
.input {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: 0;
  width: 100%;
  transition: border-color 0.12s;
}
.input:focus { border-color: var(--ink); }
.input::placeholder { color: var(--ink-faint); }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  padding: 26px 20px;
  text-align: center;
  transition: all 0.15s;
  cursor: pointer;
  background: var(--bg-sunken);
}
.dropzone:hover, .dropzone.hot {
  border-color: var(--ink);
  background: var(--lime-soft);
}
.dropzone-hint { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.dropzone-sub { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); }

.asset-tile {
  width: 68px;
  height: 68px;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  background: var(--bg-sunken);
  flex-shrink: 0;
}
.asset-tile.detected {
  border-color: var(--lime-ink);
}
.asset-tile .badge {
  position: absolute;
  top: 3px; left: 3px;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.asset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ---------- reference pack ---------- */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.ref-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.15s;
  position: relative;
}
.ref-card:hover { border-color: var(--ink); }
.ref-card.selected { border-color: var(--ink); box-shadow: 0 0 0 3px var(--lime); }
.ref-thumb {
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
  position: relative;
}
.ref-meta {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.ref-name { font-size: 12px; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-size { font-size: 10px; color: var(--ink-faint); font-family: var(--font-mono); }

/* ---------- strategy (redesigned — narrative flow) ---------- */
.strategy-stage {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 920px;
}

/* Hero */
.strat-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.strat-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 6px 0 6px;
  color: var(--ink);
  line-height: 1.2;
}
.strat-subtitle {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.55;
  max-width: 620px;
}
.strat-hero-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Steps */
.strat-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.strat-step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.strat-step-head > div:nth-child(2) { flex: 1; min-width: 0; }
.strat-step-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.strat-step-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.strat-step-desc {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-top: 2px;
}
.strat-step-status {
  flex: none;
  font-size: 11px;
  color: var(--ink-muted);
  padding: 3px 8px;
  background: var(--bg-subtle);
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Shared brief card — wraps all 4 fields as one unit */
.strat-brief-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  overflow: hidden;
  margin-left: 40px; /* aligns with step title */
}

/* Connector between steps */
.strat-connector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 13px; /* centers with step-num */
}
.strat-connector-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.strat-connector-line:first-child { flex: 0 0 14px; }
.strat-connector-label {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* Strategy field — each row inside the brief card */
.strategy-field {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-faint);
  background: var(--bg-elevated);
  transition: background 150ms;
}
.strategy-field:last-child { border-bottom: 0; }
.strategy-field[data-focused="yes"] {
  background: var(--bg);
}
.strategy-field .sf-gutter {
  display: flex;
  justify-content: center;
  padding-top: 3px;
}
.strategy-field .sf-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  background: var(--bg);
  transition: all 150ms;
}
.strategy-field .sf-dot[data-filled="yes"] {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}
.strategy-field .sf-body {
  min-width: 0;
}
.strategy-field .sf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.strategy-field .sf-head .sf-label { flex: 1; min-width: 0; }
.strategy-field .sf-label {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strategy-field .sf-hint {
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.4;
  margin-bottom: 6px;
}
.strategy-field .sf-suggest {
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 120ms;
}
.strategy-field:hover .sf-suggest,
.strategy-field[data-focused="yes"] .sf-suggest { opacity: 1; }
.strategy-field .sf-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
  padding: 8px 10px;
  margin-left: -10px;
  border-radius: var(--r-sm);
  resize: vertical;
  min-height: 44px;
  outline: none;
  font-family: var(--font-sans);
  transition: all 120ms;
}
.strategy-field .sf-input:hover {
  background: var(--bg-subtle);
}
.strategy-field .sf-input:focus {
  background: var(--bg);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.strategy-field .sf-input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

/* Variants grid */
.strat-variants-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-left: 40px;
}

/* Hypothesis card — Strategy stage (distinct from Review .variant-card) */
.hyp-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 150ms, box-shadow 150ms;
}
.hyp-card:hover {
  border-color: var(--line-strong, var(--ink-muted));
}
.hyp-card:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.vc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.vc-card-id {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vc-card-ordinal {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.vc-card-name {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: var(--r-sm);
  outline: none;
  transition: all 120ms;
}
.vc-card-name:hover { background: var(--bg-subtle); }
.vc-card-name:focus {
  background: var(--bg);
  border-color: var(--ink);
}
.vc-card-name::placeholder {
  color: var(--ink-faint);
  font-weight: 500;
}
.vc-card-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vc-card-field label {
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 500;
}
.vc-card-hook {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  outline: none;
  resize: vertical;
  min-height: 56px;
  font-family: var(--font-sans);
  transition: border-color 120ms;
}
.vc-card-hook:focus {
  border-color: var(--ink);
}
.vc-card-hook::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}
.vc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px dashed var(--line-faint);
}

/* IPM with explanation */
.vc-ipm { width: 100%; }
.vc-ipm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.vc-ipm-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 4px;
}
.vc-ipm-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0;
  transition: all 120ms;
}
.vc-ipm-info:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}
.hyp-ipm-input {
  width: 56px;
  border: 1px solid var(--line);
  background: var(--bg);
  font: inherit;
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  outline: none;
  text-align: right;
  color: var(--ink);
}
.hyp-ipm-input:focus { border-color: var(--ink); }
.vc-ipm-explain {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.5;
  border-left: 2px solid var(--ink);
}
.vc-ipm-explain b { color: var(--ink); }

/* Add-variant slot */
.strat-variant-add {
  border: 1.5px dashed var(--line);
  background: transparent;
  border-radius: var(--r-lg);
  padding: 14px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 120ms;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
}
.strat-variant-add:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--bg-subtle);
}
.strat-variant-add .hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-faint);
}

/* Tip block */
.strat-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  margin-left: 40px;
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.strat-tip b { color: var(--ink); }
.strat-tip > svg, .strat-tip > .icon { flex: none; margin-top: 2px; }

/* Approve card */
.strat-approve-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  margin-left: 40px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-lg);
  flex-wrap: wrap;
}
.strat-approve-card[data-ready="no"] {
  background: var(--bg-subtle);
  border-style: dashed;
  border-color: var(--line);
  opacity: 0.88;
}
.strat-approve-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.strat-approve-sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 3px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .strat-variants-grid { grid-template-columns: 1fr; }
  .strat-brief-card,
  .strat-variants-grid,
  .strat-tip,
  .strat-approve-card { margin-left: 0; }
  .strat-connector { margin-left: 0; }
}

/* (legacy .variant-hyp still used in review stage preview — keep minimal) */
.variant-hyp {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.variant-hyp .vh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.variant-hyp .vh-name { font-weight: 600; font-size: 13px; letter-spacing: -0.01em; }
.variant-hyp .vh-hook { font-size: 12px; color: var(--ink-muted); }

/* ---------- build stage ---------- */
.build-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.build-preview {
  aspect-ratio: 9/16;
  max-height: 560px;
  background: #0a0a0a;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}
.build-preview .scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(255,255,255,0.02) 2px 4px);
  pointer-events: none;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
}
.tl-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  padding: 8px 0;
  align-items: flex-start;
  position: relative;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 8px; top: 26px; bottom: -6px;
  width: 1px;
  background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-faint);
  position: relative;
  z-index: 1;
  margin-top: 3px;
  margin-left: 4px;
}
.tl-item.done .tl-icon { background: var(--ink); border-color: var(--ink); color: var(--lime); }
.tl-item.current .tl-icon {
  background: var(--lime); border-color: var(--lime); color: var(--ink);
  box-shadow: 0 0 0 3px var(--lime-soft);
}
.tl-item.failed .tl-icon { background: var(--rose); border-color: var(--rose); color: #fff; }
.tl-title { font-size: 13px; color: var(--ink); font-weight: 500; }
.tl-item:not(.done):not(.current):not(.failed) .tl-title { color: var(--ink-faint); }
.tl-meta { font-size: 11px; font-family: var(--font-mono); color: var(--ink-faint); }
.tl-body { font-size: 12px; color: var(--ink-muted); margin-top: 3px; line-height: 1.45; }

/* ---------- review ---------- */
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.variant-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.12s;
}
.variant-card:hover { border-color: var(--line-strong); }
.variant-card.selected { border-color: var(--ink); }
.variant-card.approved { border-color: var(--lime-ink); box-shadow: inset 0 0 0 1px var(--lime-ink); }

.vc-head {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.vc-name {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px; letter-spacing: -0.01em;
  min-width: 0;
}
.vc-name > span:last-child, .vc-name {
  white-space: nowrap;
}
.vc-name .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink-2);
}
.vc-preview {
  background: #0a0a0a;
  aspect-ratio: 9/16;
  max-height: 380px;
  margin: 14px auto 0 auto;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  width: 60%;
}
.vc-foot {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
.vc-hypothesis {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.45;
  padding-top: 14px;
}
.vc-actions { display: flex; gap: 6px; align-items: center; }
.vc-hist {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

/* ---------- export ---------- */
.export-row {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr auto;
  padding: 16px;
  gap: 18px;
  border-bottom: 1px solid var(--line-faint);
  align-items: center;
}
.export-row:last-child { border-bottom: 0; }
.export-row .name { font-weight: 600; font-size: 14px; }
.check-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-2);
  line-height: 1.35;
}
.check-list > div {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.35;
}
.check-list > div > svg { margin-top: 2px; flex-shrink: 0; }
.check-list > div > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-list .ok { color: var(--lime-ink); }
.check-list .warn { color: var(--amber); }
.check-list .fail { color: var(--rose); }

/* ---------- banners ---------- */
.banner {
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
}
.banner.warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.banner.info { background: var(--cyan-soft); border-color: color-mix(in oklch, var(--cyan) 30%, transparent); color: var(--cyan-ink); }
.banner.lime { background: var(--lime-soft); border-color: color-mix(in oklch, var(--lime) 30%, transparent); color: var(--lime-ink); }
.banner .title { font-weight: 600; }
.banner .actions { margin-left: auto; display: flex; gap: 6px; }

/* ---------- page-header pattern ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.1;
}
.page-sub {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* ---------- section label ---------- */
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--ink-faint);
  margin: 0 0 10px 0;
}

/* ---------- key-value ---------- */
.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 16px;
  font-size: 12px;
}
.kv dt { color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.kv dd { color: var(--ink); margin: 0; }

/* ---------- tweaks panel ---------- */
.tweaks-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 260px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: 14px;
  font-size: 13px;
}
.tweaks-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tweaks-head .t-title { font-weight: 600; font-size: 13px; letter-spacing: -0.01em; }
.tweaks-head .close { margin-left: auto; color: var(--ink-faint); cursor: pointer; font-size: 14px; padding: 0 4px; }
.tweak-group { margin-bottom: 10px; }
.tweak-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.tweak-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.tweak-opt {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 11px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-elevated);
}
.tweak-opt:hover { background: var(--bg-subtle); }
.tweak-opt.active {
  background: var(--ink);
  color: var(--lime);
  border-color: var(--ink);
}

/* ---------- animations ---------- */
@keyframes fadein {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.fadein { animation: fadein 0.4s ease-out; }

@keyframes shimmer {
  0% { background-position: -120% 0; }
  100% { background-position: 220% 0; }
}
.shimmer {
  background: linear-gradient(90deg,
    var(--bg-subtle) 0%,
    var(--bg-elevated) 50%,
    var(--bg-subtle) 100%);
  background-size: 220% 100%;
  animation: shimmer 1.8s infinite;
}

/* icon base */
.ic { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 1.6; }
.ic.sm { width: 13px; height: 13px; }
.ic.lg { width: 18px; height: 18px; }

/* divider */
.hr { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- phone mock ---------- */
.phone-screen {
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.phone-notch {
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 18px;
  background: #000;
  border-radius: 10px;
  z-index: 3;
}

/* tiny spec line */
.spec {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.01em;
}

/* ==================== Build · two-phase ==================== */

/* Phase header — mini progress strip above the build content */
.build-phase-header {
  margin: -4px 0 18px;
}
.bph-steps {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.bph-step {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  min-width: 0;
  flex: 1;
  transition: border-color 0.12s, background 0.12s;
}
.bph-step:hover { border-color: var(--line-strong); }
.bph-step.done { background: var(--bg); }
.bph-step.done .bph-num { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.bph-step.active { border-color: var(--ink); }
.bph-step.active .bph-num { background: var(--lime); color: var(--ink); border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.bph-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg-subtle);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-faint);
  flex-shrink: 0;
}
.bph-label { display: block; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.bph-sub { display: block; font-size: 11px; color: var(--ink-muted); margin-top: 1px; }
.bph-connector {
  width: 28px;
  align-self: center;
  height: 1px;
  background: var(--line);
  margin: 0 4px;
}
.bph-connector.done { background: var(--ink); }

/* Baseline phase · cost strip below the preview */
.baseline-cost-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
}

/* Smoke tests grid */
.smoke-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.smoke-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--ink-faint);
  background: var(--bg);
}
.smoke-item.done { color: var(--ink); border-color: var(--line-strong); }
.smoke-item.current { color: var(--ink); border-color: var(--lime-ink); background: var(--lime-soft); }
.smoke-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: grid; place-items: center;
  color: var(--ink-faint);
  flex-shrink: 0;
}
.smoke-item.done .smoke-dot { background: var(--ink); color: var(--lime); }
.smoke-item.current .smoke-dot { background: transparent; }

/* ----- Gate ----- */
.build-gate {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 28px;
  align-items: start;
}
.bg-preview-col .build-preview { max-height: 520px; }
.bg-gate-card {
  padding: 24px 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--bg-elevated);
}
.bg-gate-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.bg-gate-title {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  font-weight: 600;
}
.bg-gate-sub {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.55;
  margin: 0 0 18px;
  max-width: 58ch;
}
.bg-gate-sub b { color: var(--ink); font-weight: 600; }

.bg-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.bg-metric {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}
.bg-metric.good { border-color: var(--lime-ink); }
.bg-metric.warn { border-color: var(--amber-ink, #b8860b); }
.bg-metric-v {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2px 0 1px;
}

.bg-reuse { margin-bottom: 16px; }
.bg-reuse-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}

.bg-costs {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--bg);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.bg-cost-v {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: var(--font-mono);
}
.bg-cost-arrow {
  font-size: 20px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

.bg-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.bg-actions .btn.primary {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--lime-ink);
  font-weight: 600;
  padding: 10px 18px;
}
.bg-actions .btn.primary:hover { background: var(--lime-ink); color: var(--bg); }

/* ----- Variants phase ----- */
.variants-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
}
.variants-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.variant-build-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: border-color 0.12s;
}
.variant-build-card.current { border-color: var(--cyan-ink, #0891b2); box-shadow: inset 0 0 0 1px var(--cyan-ink, #0891b2); }
.variant-build-card.done { border-color: var(--lime-ink); }
.vbc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.vbc-name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }

.vbc-body {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 14px;
}
.vbc-preview {
  width: 140px;
  aspect-ratio: 9/16;
  background: #0a0a0a;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.vbc-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vbc-hypothesis {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.45;
}
.vbc-diff-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}
.vbc-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--ink-faint);
  min-width: 0;
  line-height: 1.45;
}
.vbc-step > span:last-child { min-width: 0; flex: 1; }
.vbc-step.done { color: var(--ink); }
.vbc-step.current { color: var(--ink); font-weight: 500; }
.vbc-dot {
  width: 14px; height: 14px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  border-radius: 50%;
  background: var(--bg-subtle);
  flex-shrink: 0;
}
.vbc-step.done .vbc-dot { background: var(--ink); color: var(--lime); }
.vbc-step.current .vbc-dot { background: var(--lime); color: var(--ink); }
.vbc-foot {
  display: flex; align-items: center; gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

@media (max-width: 1080px) {
  .build-gate { grid-template-columns: 1fr; }
  .bg-metrics { grid-template-columns: repeat(2, 1fr); }
  .vbc-diff-steps { grid-template-columns: repeat(2, 1fr); }
}

/* ==================== Build v2 · focused baseline workspace ==================== */

.build-v2 {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Status strip above the preview */
.bv-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  gap: 14px;
}
.bv-status-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bv-status-title { font-weight: 600; font-size: 13px; letter-spacing: -0.01em; }
.bv-status-right { display: flex; align-items: center; gap: 10px; }
.bv-cost {
  display: flex; align-items: baseline; gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
}
.bv-cost-v { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }

/* Main two-column layout: preview + run log */
.bv-main {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}
.bv-main.log-closed { grid-template-columns: 1fr; }

/* Preview column */
.bv-preview-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.bv-preview-frame {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  overflow: hidden;
}
.bv-browser-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}
.bv-dots { display: flex; gap: 5px; }
.bv-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.bv-url {
  flex: 1;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bv-chrome-btn {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  color: var(--ink-2);
  cursor: pointer;
}
.bv-chrome-btn:hover { background: var(--bg); }

.bv-preview-stage {
  padding: 28px;
  background: repeating-conic-gradient(var(--bg) 0% 25%, var(--bg-subtle) 0% 50%) 50% / 20px 20px;
  display: grid;
  place-items: center;
  min-height: 480px;
  position: relative;
}
.bv-phone {
  width: 280px;
  aspect-ratio: 9/16;
  background: #0a0a0a;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25), inset 0 0 0 6px #000;
  position: relative;
}
.bv-committed-badge {
  position: absolute;
  top: 14px; right: 14px;
  padding: 4px 10px;
  background: var(--lime);
  color: var(--ink);
  border: 1px solid var(--lime-ink);
  border-radius: 999px;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}

/* Milestone/metrics row with Commit CTA */
.bv-milestone {
  display: grid;
  grid-template-columns: repeat(3, auto) 1fr;
  gap: 24px;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.bv-milestone-v {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 1px;
  display: flex; align-items: center; gap: 5px;
}
.bv-milestone-actions {
  margin-left: auto;
  display: flex; gap: 8px;
  justify-content: flex-end;
}
.bv-milestone-actions .btn.primary {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--lime-ink);
  font-weight: 600;
  padding: 9px 16px;
}
.bv-milestone-actions .btn.primary:hover { background: var(--lime-ink); color: var(--bg); }

/* Variants offer — the opt-in card that shows up after commit */
.bv-variants-offer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--lime-soft) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--lime-ink);
  border-radius: var(--r-xl);
}
.bv-offer-icon {
  width: 42px; height: 42px;
  background: var(--ink);
  color: var(--lime);
  border-radius: 10px;
  display: grid; place-items: center;
}
.bv-offer-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.bv-offer-sub {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  max-width: 62ch;
}
.bv-offer-sub b { color: var(--ink); font-weight: 600; }
.bv-offer-actions {
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-end;
}
.bv-offer-actions .btn.primary {
  background: var(--ink);
  color: var(--lime);
  border-color: var(--ink);
  font-weight: 600;
}
.bv-offer-actions .btn.primary:hover { background: #000; }

/* Variants fanned-out state */
.bv-variants-fanned {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
}
.bv-variants-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.bv-variants-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.bv-variant-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.bv-variant-mini {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.bv-variant-mini.current { border-color: var(--cyan-ink, #0891b2); }
.bv-variant-mini.done { border-color: var(--lime-ink); }
.bv-variant-mini-preview {
  aspect-ratio: 9/16;
  background: #0a0a0a;
  position: relative;
  overflow: hidden;
}
.bv-variant-mini-body { padding: 10px; }
.bv-variant-mini-head {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  margin-bottom: 6px;
}
.bv-variant-mini-name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.bv-variant-mini-hyp {
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.4;
  margin-top: 3px;
}

/* Right-column run log */
.bv-runlog {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  position: sticky;
  top: 0;
}
.bv-runlog-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}

.bv-thinking-toggle {
  width: 100%;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
}
.bv-thinking-toggle:hover { border-color: var(--line-strong); }
.bv-thinking-list {
  margin-top: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
}
.bv-thinking-item {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  color: var(--ink-2);
  line-height: 1.4;
}
.bv-thinking-item .spec { color: var(--ink-faint); min-width: 60px; }

/* Compact smoke grid for the run-log panel */
.smoke-grid.compact { grid-template-columns: 1fr; gap: 3px; }
.smoke-grid.compact .smoke-item {
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.3;
  min-height: 24px;
}
.smoke-grid.compact .smoke-item > span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

@media (max-width: 1280px) {
  .bv-variant-cards { grid-template-columns: repeat(2, 1fr); }
  .bv-main { grid-template-columns: 1fr; }
  .bv-runlog { position: static; max-height: none; }
  .bv-milestone { grid-template-columns: 1fr 1fr; }
  .bv-milestone-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

