/* ─── Gemini Live Demo · design tokens ──────────────────────────────── */
:root {
  /* Google brand */
  --gc-blue: #1A73E8;
  --gc-blue-600: #1967D2;
  --gc-blue-50: #E8F0FE;
  --gc-red: #EA4335;
  --gc-yellow: #FBBC04;
  --gc-green: #34A853;

  /* Gemini gradient */
  --gemini-gradient: linear-gradient(135deg, #4285F4 0%, #9B72CB 35%, #D96570 70%, #F9AB00 100%);
  --gemini-soft: linear-gradient(135deg, rgba(66,133,244,.10) 0%, rgba(155,114,203,.10) 50%, rgba(217,101,112,.10) 100%);

  /* Surfaces */
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --surface-2: #F1F3F4;
  --border: #DADCE0;
  --border-soft: #E8EAED;
  --text: #202124;
  --text-secondary: #5F6368;
  --text-tertiary: #80868B;

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(60,64,67,.08), 0 1px 3px rgba(60,64,67,.06);
  --shadow-2: 0 1px 2px rgba(60,64,67,.10), 0 2px 6px rgba(60,64,67,.08);
  --shadow-3: 0 4px 8px rgba(60,64,67,.12), 0 8px 24px rgba(60,64,67,.10);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  --font: "Google Sans", "Google Sans Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: "Google Sans Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ─── Dark theme overrides ───────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #1B1C1E;
  --surface: #26272A;
  --surface-2: #34363A;
  --border: #5F6368;
  --border-soft: #3C4043;
  --text: #E8EAED;
  --text-secondary: #BDC1C6;
  --text-tertiary: #9AA0A6;

  --gc-blue-50: rgba(66, 133, 244, 0.18);
  --gemini-soft: linear-gradient(135deg, rgba(66,133,244,.18) 0%, rgba(155,114,203,.20) 50%, rgba(217,101,112,.18) 100%);

  --shadow-1: 0 1px 2px rgba(0,0,0,.40), 0 1px 3px rgba(0,0,0,.30);
  --shadow-2: 0 1px 2px rgba(0,0,0,.50), 0 2px 6px rgba(0,0,0,.40);
  --shadow-3: 0 4px 8px rgba(0,0,0,.55), 0 8px 24px rgba(0,0,0,.45);

  color-scheme: dark;
}

/* Mermaid diagrams render with light fills — keep their card surface white
   in dark mode so labels and edges stay readable. */
[data-theme="dark"] .diagram-card,
[data-theme="dark"] .diagram-card .mermaid-host,
[data-theme="dark"] .diagram-card .mermaid-host svg {
  background: #FFFFFF;
}
[data-theme="dark"] .diagram-card h3 { color: #202124; }
[data-theme="dark"] .diagram-card .desc { color: #5F6368; }

/* The preview iframe shows user content — keep its overlay light too. */
[data-theme="dark"] .preview-overlay {
  background: rgba(15,15,20,.65);
  color: #BDC1C6;
}
[data-theme="dark"] .preview-overlay .pip {
  background: #2A2B2D;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }

/* ─── Top app bar ────────────────────────────────────────────────── */
.appbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  height: 56px;
  position: sticky; top: 0; z-index: 50;
}
.appbar .logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 18px; letter-spacing: -.01em;
  padding: 4px 8px; margin-left: -8px;
  border-radius: var(--r-sm);
  transition: background .15s;
}
.appbar .logo[role="button"]:hover { background: var(--surface-2); }
.appbar .logo .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--gemini-gradient);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 14px;
}
.appbar .crumb { color: var(--text-secondary); font-size: 14px; }
.appbar .crumb b { color: var(--text); font-weight: 500; }
.appbar .spacer { flex: 1; }

.appbar .pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px; color: var(--text-secondary);
}
.appbar .pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gc-green);
  box-shadow: 0 0 0 4px rgba(52,168,83,.18);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,168,83,.30); }
  50%      { box-shadow: 0 0 0 8px rgba(52,168,83,0); }
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  appearance: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit;
  font-weight: 500; font-size: 14px;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gc-blue); color: white; }
.btn-primary:hover { background: var(--gc-blue-600); box-shadow: var(--shadow-2); }
.btn-secondary { background: var(--surface); color: var(--gc-blue); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--gc-red); color: white; }
.btn-danger:hover { filter: brightness(.95); }
.btn-gradient {
  background: var(--gemini-gradient); color: white;
  box-shadow: 0 4px 14px rgba(155,114,203,.35);
}
.btn-gradient:hover { box-shadow: 0 6px 20px rgba(155,114,203,.45); }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
}

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

/* ─── Hub grid ───────────────────────────────────────────────────── */
.hub {
  max-width: 1240px; margin: 0 auto;
  padding: 56px 32px 96px;
}
.hub h1 {
  margin: 0 0 8px;
  font-size: 44px; font-weight: 500; letter-spacing: -.02em;
}
.hub .sub {
  margin: 0 0 40px;
  color: var(--text-secondary); font-size: 18px;
  max-width: 720px;
}
.hub-grid {
  display: grid; gap: 20px;
  grid-template-columns: 1fr;
}

.scenario-card {
  position: relative;
  display: grid;
  grid-template-columns: 104px 1fr auto;
  align-items: center;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  cursor: pointer;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  min-height: 160px;
  overflow: hidden;
}
.scenario-card:hover {
  box-shadow: var(--shadow-3);
  transform: translateY(-2px);
  border-color: transparent;
}
.scenario-card .glyph {
  width: 96px; height: 96px;
  border-radius: 22px;
  display: grid; place-items: center;
  color: white;
  flex-shrink: 0;
}
.scenario-card .scenario-body {
  min-width: 0;
}
.scenario-card .badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.scenario-card .badge .swatch {
  width: 10px; height: 10px; border-radius: 3px;
}
.scenario-card h3 {
  margin: 0 0 8px;
  font-size: 26px; font-weight: 500; letter-spacing: -.01em;
}
.scenario-card p {
  margin: 0 0 12px;
  color: var(--text-secondary); font-size: 15px;
  line-height: 1.55;
  max-width: 720px;
}
.scenario-card .tags {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.scenario-card .tag {
  font-size: 11px; color: var(--text-secondary);
  background: var(--surface-2);
  padding: 4px 10px; border-radius: var(--r-pill);
}
.scenario-card .scenario-cta {
  flex-shrink: 0;
  padding-right: 4px;
}
.scenario-card .start {
  color: var(--gc-blue); font-weight: 500; font-size: 16px;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .scenario-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px;
  }
  .scenario-card .glyph { width: 72px; height: 72px; border-radius: 18px; }
  .scenario-card h3 { font-size: 22px; }
  .scenario-card .scenario-cta { display: none; }
}

/* ─── Scenario shell ─────────────────────────────────────────────── */
.scenario {
  height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 360px 1fr;
  grid-template-rows: 1fr;
  background: var(--bg);
}
.scenario.single { grid-template-columns: 1fr; }

.panel {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.panel .panel-head {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.panel .panel-head h2 {
  margin: 0; font-size: 18px; font-weight: 500;
}
.panel .panel-head .sub {
  margin: 4px 0 0;
  color: var(--text-secondary); font-size: 13px;
}
.panel .panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.panel .panel-foot {
  padding: 16px 20px; border-top: 1px solid var(--border-soft);
  display: flex; gap: 8px; align-items: center;
}

.stage {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.stage-head {
  height: 52px; padding: 0 20px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  display: flex; align-items: center; gap: 12px;
}
.stage-head .title { font-weight: 500; font-size: 15px; }
.stage-head .spacer { flex: 1; }

.stage-body { flex: 1; overflow: auto; }

/* ─── Voice / connection chip ───────────────────────────────────── */
.conn-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-size: 12px; color: var(--text-secondary);
}
.conn-chip.live { color: var(--gc-green); background: rgba(52,168,83,.08); border-color: rgba(52,168,83,.25); }
.conn-chip.error { color: var(--gc-red); background: rgba(234,67,53,.08); border-color: rgba(234,67,53,.25); }
.conn-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conn-chip.live .dot { animation: pulse-green 1.4s ease-in-out infinite; }
@keyframes pulse-green {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: .6; }
}

/* ─── Transcript ─────────────────────────────────────────────────── */
.transcript {
  display: flex; flex-direction: column; gap: 14px;
}
.bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px; line-height: 1.55;
  word-wrap: break-word;
  unicode-bidi: plaintext;
}
.bubble.user {
  align-self: flex-end;
  background: var(--gc-blue);
  color: white;
  border-bottom-right-radius: 4px;
}
.bubble.ai {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-soft);
  position: relative;
}
.bubble.ai.streaming::after {
  content: "▌";
  display: inline-block;
  margin-left: 2px;
  color: var(--gc-blue);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.bubble .who {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  opacity: .65;
  margin-bottom: 4px;
}

/* ─── Waveform ──────────────────────────────────────────────────── */
.wave {
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  height: 56px;
}
.wave .bar {
  width: 4px;
  background: var(--gemini-gradient);
  border-radius: 2px;
  height: 6px;
  transition: height .08s ease-out;
}
.wave.silent .bar { background: var(--border); }

/* ─── Big mic button ────────────────────────────────────────────── */
.mic-btn {
  width: 76px; height: 76px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--gemini-gradient);
  color: white;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(155,114,203,.45);
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
.mic-btn:hover { transform: scale(1.04); }
.mic-btn.muted {
  background: var(--surface-2); color: var(--text-secondary);
  box-shadow: var(--shadow-2);
}
.mic-btn .halo {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(155,114,203,.5);
  animation: halo 1.6s ease-out infinite;
  pointer-events: none;
}
@keyframes halo {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ─── Diagram viewer ────────────────────────────────────────────── */
.diagram-stage {
  display: flex; flex-direction: column; height: 100%;
  background:
    radial-gradient(circle at 1px 1px, var(--border-soft) 1px, transparent 0) 0 0 / 24px 24px,
    var(--bg);
}
/* Cody's diagram view places the version chooser + approval controls in a
   right-side rail so they don't overlap the rendered Mermaid SVG. */
.diagram-stage.gemi-diagram-stage {
  flex-direction: row;
}
.diagram-rail {
  width: 300px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-left: 1px solid var(--border-soft);
  background: var(--surface);
  overflow-y: auto;
}
@media (max-width: 1100px) {
  .diagram-stage.gemi-diagram-stage { flex-direction: column; }
  .diagram-rail { width: auto; border-left: none; border-top: 1px solid var(--border-soft); }
}
.diagram-canvas {
  flex: 1; overflow: auto;
  padding: 32px;
  display: flex; align-items: center; justify-content: center;
}
.diagram-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-2);
  max-width: 100%; max-height: 100%;
  padding: 32px;
  width: min(960px, 100%);
  overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
}
.diagram-card .mermaid-host {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--r-md);
}
.diagram-card .mermaid-host svg {
  display: block;
  max-width: 100%;
  height: auto;
  background: var(--surface);
}
.diagram-card h3 {
  margin: 0 0 8px;
  font-weight: 500; font-size: 18px;
}
.diagram-card .desc {
  color: var(--text-secondary); font-size: 13px;
  margin-bottom: 24px;
}
.diagram-empty {
  text-align: center; color: var(--text-tertiary);
}
.diagram-empty .ic {
  font-size: 48px; margin-bottom: 12px;
  background: var(--gemini-soft);
  width: 96px; height: 96px;
  border-radius: 24px;
  display: grid; place-items: center;
  margin: 0 auto 16px;
}

.diagram-nav {
  height: 56px;
  padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
}
.diagram-nav .dots {
  display: flex; gap: 6px; align-items: center;
}
.diagram-nav .dots .d {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
}
.diagram-nav .dots .d.active { background: var(--gc-blue); width: 22px; border-radius: 4px; }

/* ─── Architecture diagram (SVG-ish) ────────────────────────────── */
.arch {
  display: grid; gap: 14px;
  grid-template-columns: repeat(3, 1fr);
}
.arch-node {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  background: var(--surface);
  position: relative;
  text-align: center;
}
.arch-node .icn {
  width: 40px; height: 40px; border-radius: 10px;
  margin: 0 auto 8px;
  display: grid; place-items: center;
  background: var(--gc-blue-50);
  color: var(--gc-blue);
  font-size: 20px;
}
.arch-node .lbl { font-weight: 500; font-size: 13px; }
.arch-node .desc-sm { color: var(--text-tertiary); font-size: 11px; margin-top: 2px; }
.arch-node.accent { background: linear-gradient(135deg, #E8F0FE, #FCE8E6); border-color: transparent; }

/* ─── Camera / survey ───────────────────────────────────────────── */
.camera-stage {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  background: #0B0B0F;
}
.camera-frame {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.camera-frame video,
.camera-frame .placeholder {
  max-width: 100%; max-height: 100%;
  width: auto; height: 100%;
  object-fit: contain;
  background: #000;
}
.camera-frame .placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: rgba(255,255,255,.6);
  font-size: 14px;
  background:
    radial-gradient(circle at 50% 30%, rgba(66,133,244,.16), transparent 60%),
    #0B0B0F;
}
.camera-frame .hud-top {
  position: absolute; top: 16px; left: 16px; right: 16px;
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none;
}
.camera-frame .hud-bottom {
  position: absolute; bottom: 16px; left: 16px; right: 16px;
  display: flex; justify-content: center; gap: 12px;
}
.camera-frame .question-card {
  pointer-events: auto;
  background: rgba(15,15,20,.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: white;
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,.12);
  max-width: 420px;
  font-size: 14px; line-height: 1.55;
}
.camera-frame .question-card .who {
  font-size: 10px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .1em; opacity: .7; margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.camera-frame .rec-chip {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(15,15,20,.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  color: white; font-size: 12px;
}
.camera-frame .rec-chip .red {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gc-red);
  animation: pulse 1s ease-in-out infinite;
}

.shutter {
  width: 72px; height: 72px; border-radius: 50%;
  background: white; border: 4px solid rgba(255,255,255,.4);
  cursor: pointer;
  transition: transform .1s;
}
.shutter:hover { transform: scale(1.04); }
.shutter:active { transform: scale(.95); }
.shutter.flash {
  animation: flash .25s ease-out;
}
@keyframes flash {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,1); }
  100% { box-shadow: 0 0 0 60px rgba(255,255,255,0); }
}

/* ─── Capture strip ─────────────────────────────────────────────── */
.capture-strip {
  display: flex; gap: 10px;
  padding: 14px 16px;
  background: #16161D;
  border-top: 1px solid rgba(255,255,255,.08);
  overflow-x: auto;
  min-height: 100px;
}
.capture-strip .cap {
  position: relative;
  flex: 0 0 auto;
  width: 100px; height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #222;
}
.capture-strip .cap img { width: 100%; height: 100%; object-fit: cover; }
.capture-strip .cap.active { border-color: var(--gc-blue); }
.capture-strip .cap .lbl {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(0,0,0,.6); color: white;
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
}
.capture-strip .empty {
  color: rgba(255,255,255,.4); font-size: 13px;
  display: grid; place-items: center;
  flex: 1;
}

/* ─── Tabs ──────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border-soft);
  padding: 0 20px;
  background: var(--surface);
}
.tabs .tab {
  padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  border: none; background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex; align-items: center; gap: 6px;
}
.tabs .tab.active { color: var(--gc-blue); border-bottom-color: var(--gc-blue); }
.tabs .tab:hover:not(.active) { color: var(--text); }
.tabs .tab .count {
  font-size: 11px; background: var(--surface-2);
  padding: 1px 6px; border-radius: var(--r-pill);
}

/* ─── Survey form ───────────────────────────────────────────────── */
.report {
  padding: 24px;
}
.report h2 {
  margin: 0 0 16px;
  font-weight: 500; font-size: 22px;
}
.report .meta {
  color: var(--text-secondary); font-size: 13px; margin-bottom: 24px;
}
.report-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}
.field {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.field .lbl {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-tertiary); margin-bottom: 6px; font-weight: 500;
}
.field .val { font-size: 15px; }
.field .val.empty { color: var(--text-tertiary); font-style: italic; }

.check-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.check-row:last-child { border-bottom: none; }
.check-row .check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 1.5px solid var(--border);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.check-row .check.yes { background: var(--gc-green); border-color: var(--gc-green); color: white; }
.check-row .check.no  { background: var(--gc-red);   border-color: var(--gc-red);   color: white; }
.check-row .check.na  { background: var(--surface-2); }

/* ─── Code stage ────────────────────────────────────────────────── */
.code-block {
  background: #1F1F23;
  color: #E6E6EB;
  border-radius: var(--r-md);
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13px; line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
.code-block .kw  { color: #C792EA; }
.code-block .str { color: #C3E88D; }
.code-block .cm  { color: #6F7585; font-style: italic; }
.code-block .fn  { color: #82AAFF; }

/* ─── Translate ─────────────────────────────────────────────────── */
.translate-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: 100%;
}
.lang-pane {
  padding: 32px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border-soft);
}
.lang-pane:last-child { border-right: none; background: var(--surface); }
.lang-pane .lang-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.lang-pane .lang-name {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .06em;
}
.lang-pane .lang-text {
  font-size: 22px; line-height: 1.45; letter-spacing: -.01em;
  font-weight: 400;
  flex: 1; overflow-y: auto;
}
.lang-pane .lang-text.streaming::after {
  content: "▌"; color: var(--gc-blue); animation: blink 1s steps(1) infinite;
}

.lang-select {
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-pill);
  padding: 6px 30px 6px 12px;
  font-family: inherit; font-size: 13px;
  color: var(--text);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6368' stroke-width='2'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ─── Setup screen ──────────────────────────────────────────────── */
.setup {
  max-width: 480px; margin: 96px auto;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 36px;
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border-soft);
}
.setup h2 {
  margin: 0 0 8px;
  font-weight: 500; font-size: 24px;
}
.setup p {
  color: var(--text-secondary); font-size: 14px; line-height: 1.55;
  margin: 0 0 20px;
}
.setup label {
  display: block; font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-secondary); margin-bottom: 6px;
}
.setup input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: 13px;
  outline: none;
}
.setup input:focus { border-color: var(--gc-blue); box-shadow: 0 0 0 3px rgba(26,115,232,.12); }
.setup .hint {
  font-size: 12px; color: var(--text-tertiary);
  margin: 8px 0 0;
}
.setup .hint a { color: var(--gc-blue); text-decoration: none; }

/* ─── Theme picker (segmented control) ─────────────────────────── */
.theme-picker {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-pill);
  padding: 4px;
  gap: 2px;
}
.theme-opt {
  appearance: none; border: none; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  transition: background .12s, color .12s;
}
.theme-opt:hover:not(.active) { color: var(--text); }
.theme-opt.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

/* ─── Empty state ───────────────────────────────────────────────── */
.empty {
  display: grid; place-items: center;
  padding: 64px 24px; text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}
.empty .ic {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: var(--gemini-soft);
  display: grid; place-items: center;
  margin: 0 auto 16px;
  color: var(--gc-blue);
}

/* ─── Misc ──────────────────────────────────────────────────────── */
.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-secondary);
}
.divider { height: 1px; background: var(--border-soft); margin: 16px 0; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--text-secondary); }
.tiny  { font-size: 12px; }

.scroll-y { overflow-y: auto; }

/* Scrollbars */
.scroll-y::-webkit-scrollbar, .panel-body::-webkit-scrollbar, .stage-body::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-y::-webkit-scrollbar-thumb, .panel-body::-webkit-scrollbar-thumb, .stage-body::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 8px;
}

/* ─── Phase stepper (Cody) ─────────────────────────────── */
.phase-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px; height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.phase {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500;
  color: var(--text-tertiary);
  background: transparent;
  border: 1px solid transparent;
  cursor: default;
  white-space: nowrap;
}
.phase .num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--text-tertiary);
}
.phase.done { color: var(--gc-green); }
.phase.done .num { background: var(--gc-green); color: white; }
.phase.active {
  color: var(--text);
  background: var(--gc-blue-50);
  border-color: rgba(26,115,232,.25);
}
.phase.active .num { background: var(--gc-blue); color: white; }
.phase-arrow {
  color: var(--border);
  font-size: 14px;
}

/* ─── Architecture version list (Cody) ─────────────────────── */
.arch-versions {
  position: absolute;
  top: 16px; right: 16px;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  z-index: 5;
  overflow: hidden;
}
.arch-versions .head {
  padding: 10px 14px;
  font-size: 11px; font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.arch-versions .v {
  padding: 10px 14px;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  transition: background .12s;
}
.arch-versions .v:last-child { border-bottom: none; }
.arch-versions .v:hover { background: var(--surface-2); }
.arch-versions .v.current { background: var(--gc-blue-50); color: var(--gc-blue-600); font-weight: 500; }
.arch-versions .v .badge-approved {
  font-size: 10px;
  background: var(--gc-green);
  color: white;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  font-weight: 500;
}
.arch-versions .v .vid {
  width: 22px; height: 22px;
  background: var(--surface-2);
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--text-secondary);
}
.arch-versions .v.current .vid {
  background: var(--gc-blue); color: white;
}

.approve-bar {
  position: absolute;
  bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-pill);
  padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow-3);
  display: flex; align-items: center; gap: 12px;
  z-index: 4;
  animation: slideUp .25s ease-out;
}
/* In-rail variant: stacks vertically inside .diagram-rail, no overlay. */
.approve-bar.inline {
  position: static;
  transform: none;
  animation: none;
  border-radius: var(--r-md);
  padding: 14px;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  box-shadow: var(--shadow-1);
}
.approve-bar.inline .lbl { text-align: center; margin-bottom: 4px; }
.approve-bar.inline .btn { width: 100%; justify-content: center; }
.arch-versions.inline {
  position: static;
  width: auto;
  box-shadow: none;
}
@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.approve-bar .lbl {
  font-size: 13px; color: var(--text-secondary);
}
.approve-bar .lbl b { color: var(--text); font-weight: 500; }

/* ─── Build progress (Cody) ─────────────────────────────── */
.build-progress {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 24px;
}
.build-progress .spinner {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #4285F4, #9B72CB, #D96570, #F9AB00, #4285F4);
  mask: radial-gradient(circle 26px, transparent 99%, black 100%);
  -webkit-mask: radial-gradient(circle 26px, transparent 99%, black 100%);
  animation: spin 1.4s linear infinite;
  margin-bottom: 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.build-progress .title {
  font-size: 18px; font-weight: 500; margin-bottom: 6px;
}
.build-progress .sub {
  color: var(--text-secondary); font-size: 14px;
  max-width: 420px;
  unicode-bidi: plaintext;
}
.build-progress .elapsed-chip {
  margin-top: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: rgba(66,133,244,.10);
  color: var(--gc-blue-600);
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.build-progress .file-trail {
  margin-top: 28px;
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-secondary);
  text-align: left;
  min-width: 260px;
}
.build-progress .file-trail .row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}
.build-progress .file-trail .row.writing { border-color: var(--gc-blue); color: var(--gc-blue-600); }
.build-progress .file-trail .row.done .ic { color: var(--gc-green); }

/* ─── Preview pane ────────────────────────────────────── */
.preview-shell {
  height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface-2);
}
.preview-toolbar {
  height: 44px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 8px;
}
.preview-toolbar .url {
  flex: 1;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.preview-toolbar .url .lock { color: var(--gc-green); }
.preview-frame-wrap {
  flex: 1;
  padding: 16px;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
  position: relative;
}
.preview-frame {
  background: white;
  width: 100%; height: 100%;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  border: none;
  display: block;
}
.preview-overlay {
  position: absolute; inset: 16px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  color: var(--gc-blue);
  font-size: 14px; font-weight: 500;
  pointer-events: none;
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.preview-overlay .pip {
  display: flex; align-items: center; gap: 8px;
  background: white;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-2);
}
.preview-overlay .pip .d {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gc-blue);
  animation: pulse 1s ease-in-out infinite;
}

.export-menu {
  position: absolute; top: 48px; right: 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  min-width: 220px;
  z-index: 20;
  overflow: hidden;
}
.export-menu .item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  font-size: 13px;
  cursor: pointer;
  border: none; background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: var(--text);
}
.export-menu .item:hover { background: var(--surface-2); }
.export-menu .item .meta { color: var(--text-tertiary); font-size: 11px; }
.export-menu .divider-line { height: 1px; background: var(--border-soft); }

/* ─── GitHub modal ─────────────────────────────────── */
.modal-shade {
  position: fixed; inset: 0;
  background: rgba(15,15,20,.45);
  display: grid; place-items: center;
  z-index: 100;
  animation: fadeIn .15s;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 28px;
  width: 440px;
  box-shadow: var(--shadow-3);
}
.modal h2 { margin: 0 0 8px; font-weight: 500; font-size: 20px; }
.modal .desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.modal input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 13px;
  margin-bottom: 12px;
  outline: none;
}
.modal input:focus { border-color: var(--gc-blue); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

.gh-success {
  background: rgba(52,168,83,.08);
  border: 1px solid rgba(52,168,83,.25);
  border-radius: var(--r-md);
  padding: 16px;
  font-size: 13px;
  display: flex; gap: 12px; align-items: flex-start;
  margin: 16px 0;
}
.gh-success .ic {
  width: 28px; height: 28px;
  background: var(--gc-green); color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* ─── Preview stage: preview-shell + agent activity rail side-by-side ─── */
.preview-stage {
  display: flex;
  height: 100%;
  min-height: 0;
}
.preview-stage .preview-shell { flex: 1; min-width: 0; }

/* ─── Code shimmer (writing UI splash) ──────────────────────────────── */
.code-shimmer {
  margin-top: 28px;
  width: min(420px, 80%);
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--font-mono);
}
.code-shimmer .line {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    rgba(66,133,244,.16) 0%,
    rgba(155,114,203,.28) 35%,
    rgba(217,101,112,.16) 70%,
    rgba(249,171,0,.18) 100%);
  background-size: 200% 100%;
  animation: codeShimmer 1.6s linear infinite;
}
.code-shimmer .line:nth-child(odd) { animation-delay: -.4s; }
@keyframes codeShimmer {
  from { background-position: 200% 0; }
  to   { background-position:  -200% 0; }
}
.logo-chip {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gemini-soft);
  color: #6E4D9C;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
}

/* ─── Agent activity rail (right of preview) ────────────────────────── */
.agent-rail {
  width: 300px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border-soft);
  display: flex; flex-direction: column;
  min-height: 0;
}
.agent-rail-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(135deg, rgba(66,133,244,.05), rgba(155,114,203,.06));
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.agent-rail-head .t { font-size: 13px; font-weight: 500; }
.agent-rail-head .s { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.agent-rail-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.agent-empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 28px 12px;
}
.agent-empty .ic {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gemini-soft);
  display: grid; place-items: center;
  margin: 0 auto 10px;
}
.agent-empty .t { font-size: 13px; color: var(--text-secondary); font-weight: 500; margin-bottom: 4px; }
.agent-empty .s { font-size: 11px; }

.agent-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 12px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
  overflow: hidden;
}
.agent-card .hdr {
  display: flex; align-items: center; gap: 8px;
}
.agent-card .badge {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--border-soft);
  color: var(--text-secondary);
  white-space: nowrap;
}
.agent-card .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gc-green);
}
.agent-card[data-status="running"] .dot {
  background: var(--gc-blue);
  animation: pulse 1s ease-in-out infinite;
}
.agent-card[data-status="error"] .dot { background: var(--gc-red, #D93025); }
.agent-card .time {
  margin-left: auto;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 10px;
}
.agent-card .summary {
  color: var(--text);
  line-height: 1.4;
}
.agent-card .err {
  font-size: 11px;
  color: #D93025;
  background: rgba(217,48,37,.08);
  padding: 6px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
}
.agent-card .link {
  font-size: 11px;
  color: var(--gc-blue-600);
  text-decoration: none;
  margin-top: 2px;
}
.agent-card .link:hover { text-decoration: underline; }

/* Per-agent accents */
.agent-card[data-agent="designer"]  .badge { background: rgba(155,114,203,.18); color: #6E4D9C; }
.agent-card[data-agent="qa"]        .badge { background: rgba(249,171,0,.22);  color: #8A6500; }
.agent-card[data-agent="logo"]      .badge { background: rgba(66,133,244,.18); color: #1A6CDB; }
.agent-card[data-agent="developer"] .badge { background: rgba(15,157,88,.18);  color: #137333; }
.agent-card[data-agent="editor"]    .badge { background: rgba(0,172,193,.18);  color: #00838F; }
.agent-card[data-agent="editor"]    { border-color: rgba(0,172,193,.35); }
.agent-card[data-agent="host"]      .badge { background: rgba(234,67,53,.18);  color: #C5221F; }
.agent-card[data-agent="host"]      { border-color: rgba(234,67,53,.35); }

.agent-card[data-status="running"]::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(66,133,244,.7), transparent);
  background-size: 200% 100%;
  animation: codeShimmer 1.4s linear infinite;
}

@media (max-width: 1100px) {
  .preview-stage { flex-direction: column; }
  .agent-rail { width: auto; border-left: none; border-top: 1px solid var(--border-soft); max-height: 240px; }
}

/* ─── Pair with Gemi · Left-panel tabs (History / Transcript) ─── */
.left-tabs {
  display: flex;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  flex-shrink: 0;
}
.left-tabs .tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: none;
  border: none;
  padding: 10px 12px;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.left-tabs .tab:hover { background: var(--surface-2); color: var(--text); }
.left-tabs .tab.active {
  color: var(--gc-blue-600);
  border-bottom-color: var(--gc-blue);
  background: var(--gc-blue-50);
}
.left-tabs .tab .count {
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px; font-weight: 600;
  color: var(--text-secondary);
}
.left-tabs .tab.active .count {
  background: rgba(26,115,232,.18);
  color: var(--gc-blue-600);
}
.left-tab-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.left-tab-body .transcript {
  padding: 16px 20px;
}

/* ─── Pair with Gemi · History pane (saved projects) ─── */
.history-pane {
  display: flex; flex-direction: column;
}
.history-actions {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; gap: 8px;
}
.history-actions .btn-sm {
  font-size: 11px; padding: 5px 10px;
}
.history-list {
  display: flex; flex-direction: column;
  padding: 8px;
  gap: 6px;
}
.history-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.history-row:hover {
  border-color: var(--gc-blue);
  background: var(--gc-blue-50);
}
.history-row.current {
  border-color: var(--gc-blue);
  background: var(--gc-blue-50);
  cursor: default;
}
.history-row .thumb {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: rgba(26,115,232,.12);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.history-row .meta-col {
  flex: 1; min-width: 0;
}
.history-row .name {
  font-weight: 500; font-size: 13px;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.history-row .arch-only-badge {
  font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: rgba(251,188,4,.18);
  color: #8A6500;
  white-space: nowrap;
  flex-shrink: 0;
}
.legacy-arch-banner {
  background: rgba(251,188,4,.10);
  border: 1px solid rgba(251,188,4,.35);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin: 0 0 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.legacy-arch-banner .ttl {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.legacy-arch-banner .sub {
  font-size: 12px; color: var(--text-secondary);
  line-height: 1.5;
}
.legacy-arch-banner .btn {
  align-self: flex-start;
  margin-top: 6px;
}
.history-row .meta {
  font-size: 10px; color: var(--text-tertiary);
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-row .current-badge {
  margin-left: 6px;
  color: var(--gc-green);
  font-weight: 600;
}
.history-row .del {
  background: transparent;
  border: none;
  width: 22px; height: 22px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-tertiary);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.history-row .del:hover {
  background: rgba(234,67,53,.10);
  color: var(--gc-red);
}
.history-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-tertiary);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.history-empty .ic {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(26,115,232,.10);
  display: grid; place-items: center;
  margin-bottom: 4px;
}
.history-empty .t {
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
}
.history-empty .s {
  font-size: 12px; line-height: 1.5;
  max-width: 240px;
}

/* ─── Online Interview · setup screen ───────────────────────────── */
.interview-setup {
  max-width: 980px;
  margin: 32px auto 64px;
  padding: 0 32px;
}
.interview-setup h1 {
  font-weight: 500; font-size: 32px; letter-spacing: -.01em;
  margin: 0 0 8px;
}
.interview-setup .sub {
  color: var(--text-secondary); font-size: 15px; line-height: 1.55;
  margin: 0 0 32px; max-width: 720px;
}

.iv-section { margin-bottom: 32px; }
.iv-section h3 {
  font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

.iv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.iv-card {
  appearance: none;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
  display: flex; flex-direction: column; gap: 8px;
}
.iv-card:hover {
  border-color: var(--gc-blue);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.iv-card.selected {
  border-color: var(--gc-blue);
  background: rgba(26,115,232,.06);
  box-shadow: 0 0 0 2px rgba(26,115,232,.18);
}
.iv-card-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--gc-blue);
}
.iv-card.selected .iv-card-icon {
  background: var(--gc-blue);
  color: white;
}
.iv-card-name {
  font-size: 14px; font-weight: 500; color: var(--text);
  line-height: 1.3;
}
.iv-card-cat {
  font-size: 11px; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .06em;
}

.iv-custom {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 14px;
}
.iv-custom span {
  font-size: 12px; color: var(--text-secondary);
  font-weight: 500;
}
.iv-custom input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit; font-size: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.iv-custom input:focus {
  border-color: var(--gc-blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,.12);
}

.iv-row {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.iv-pill {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 12px 16px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all .15s ease;
  min-width: 160px;
}
.iv-pill:hover { border-color: var(--gc-blue); }
.iv-pill.selected {
  border-color: var(--gc-blue);
  background: rgba(26,115,232,.06);
  box-shadow: 0 0 0 2px rgba(26,115,232,.18);
}
.iv-pill-name {
  font-size: 14px; font-weight: 500; color: var(--text);
}
.iv-pill-desc {
  font-size: 12px; color: var(--text-tertiary);
  margin-top: 2px;
}
.iv-pill-lang { min-width: 140px; }
.iv-flag { font-size: 16px; margin-right: 4px; }
.iv-row-wrap { flex-wrap: wrap; }

.iv-actions {
  display: flex; align-items: center; gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.iv-summary {
  flex: 1; min-width: 240px;
  color: var(--text-secondary); font-size: 14px;
  line-height: 1.5;
}
.iv-summary strong { color: var(--text); font-weight: 500; }

/* ─── Online Interview · live screen ────────────────────────────── */
.interview-live {
  max-width: 880px;
  margin: 16px auto 0;
  padding: 0 32px 24px;
  display: flex; flex-direction: column;
  min-height: calc(100vh - 80px);
}
.iv-live-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--border-soft);
}
.iv-live-role {
  font-size: 20px; font-weight: 500; color: var(--text);
  letter-spacing: -.01em;
}
.iv-live-meta {
  font-size: 13px; color: var(--text-secondary);
  margin-top: 2px;
}
.iv-stage {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 48px;
  padding: 32px 0;
  min-height: 0;
  flex-wrap: wrap;
}

/* ── Candidate camera card with talking halo ── */
.iv-camera-wrap {
  --iv-intensity: 0;
  position: relative;
  border-radius: 28px;
  padding: 6px;
  background: var(--surface);
  transition: box-shadow .25s ease, transform .25s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.iv-camera-wrap::before {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 32px;
  padding: 3px;
  background: var(--gemini-gradient);
  opacity: calc(.25 + .75 * var(--iv-intensity));
  filter: blur(calc(2px + 14px * var(--iv-intensity)));
  z-index: 0;
  transition: opacity .15s ease, filter .15s ease;
  pointer-events: none;
}
.iv-camera-wrap[data-talking="idle"]::before {
  background: var(--gemini-gradient);
  opacity: .18;
  filter: blur(2px);
  animation: none;
}
.iv-camera-wrap[data-talking="user"]::before {
  background: linear-gradient(135deg, #34A853, #1A73E8);
  animation: iv-pulse-ring 1.4s ease-in-out infinite;
}
@keyframes iv-pulse-ring {
  0%, 100% { transform: scale(1);     opacity: calc(.35 + .55 * var(--iv-intensity)); }
  50%      { transform: scale(1.015); opacity: calc(.55 + .45 * var(--iv-intensity)); }
}
.iv-camera-frame {
  position: relative;
  width: 480px; max-width: min(70vw, 560px);
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  overflow: hidden;
  background: #0b0f14;
  z-index: 1;
}
.iv-camera {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror like a webcam preview */
  display: block;
  background: #0b0f14;
}
.iv-camera-label {
  position: absolute; bottom: 12px; left: 12px;
  padding: 4px 10px;
  background: rgba(0,0,0,.55);
  color: white;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
}
.iv-camera-error {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-secondary);
  background: #0b0f14;
  text-align: center; padding: 24px;
}
.iv-camera-error-sub {
  font-size: 12px; color: var(--text-tertiary);
}

/* ── Interviewer audio-only "orb" ── */
.iv-interviewer-orb {
  position: relative;
  width: 220px; height: 220px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.iv-interviewer-orb .orb-core {
  position: absolute;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--gemini-gradient);
  box-shadow: 0 8px 32px rgba(155,114,203,.45);
  z-index: 2;
  transition: transform .2s ease, box-shadow .2s ease;
}
.iv-interviewer-orb.talking .orb-core {
  transform: scale(1.08);
  box-shadow: 0 10px 44px rgba(155,114,203,.7);
  animation: iv-orb-breath 1.1s ease-in-out infinite;
}
@keyframes iv-orb-breath {
  0%, 100% { transform: scale(1.04); }
  50%      { transform: scale(1.14); }
}
.iv-interviewer-orb .orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(155,114,203,.35);
  opacity: 0;
}
.iv-interviewer-orb.talking .orb-ring {
  animation: iv-orb-ripple 2.2s ease-out infinite;
}
.iv-interviewer-orb.talking .orb-ring.r1 { animation-delay: 0s; }
.iv-interviewer-orb.talking .orb-ring.r2 { animation-delay: .55s; }
.iv-interviewer-orb.talking .orb-ring.r3 { animation-delay: 1.1s; }
@keyframes iv-orb-ripple {
  0%   { width: 96px; height: 96px; opacity: .55; }
  100% { width: 220px; height: 220px; opacity: 0; }
}
.iv-interviewer-orb .orb-label {
  position: absolute; bottom: -8px;
  font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-secondary);
}

@media (max-width: 720px) {
  .iv-stage { gap: 24px; padding: 20px 0; }
  .iv-camera-frame { width: 92vw; }
  .iv-interviewer-orb { width: 160px; height: 160px; }
  .iv-interviewer-orb .orb-core { width: 72px; height: 72px; }
  @keyframes iv-orb-ripple {
    0%   { width: 72px; height: 72px; opacity: .55; }
    100% { width: 160px; height: 160px; opacity: 0; }
  }
}

.iv-live-footer {
  display: flex; align-items: center; gap: 20px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border-soft);
}
.iv-live-status {
  flex: 1;
}
.iv-live-status-line {
  font-size: 14px; font-weight: 500; color: var(--text);
}
.iv-live-status-hint {
  font-size: 12px; color: var(--text-tertiary);
  margin-top: 2px;
}
.iv-toggle-transcript {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.iv-toggle-transcript.on {
  background: rgba(26,115,232,.10);
  color: var(--gc-blue);
}

/* ── Slide-in conversation drawer ── */
.iv-transcript-drawer {
  position: fixed;
  top: 64px; right: 0;
  width: min(420px, 96vw);
  bottom: 0;
  background: var(--surface);
  border-left: 1px solid var(--border-soft);
  box-shadow: -8px 0 32px rgba(0,0,0,.10);
  display: flex; flex-direction: column;
  z-index: 30;
  animation: iv-drawer-in .22s ease-out;
}
@keyframes iv-drawer-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.iv-transcript-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-secondary);
}
.iv-transcript-drawer-body {
  flex: 1; overflow-y: auto;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.iv-transcript-empty {
  color: var(--text-tertiary);
  font-size: 13px; text-align: center;
  padding: 32px 16px;
}

/* ─── Online Interview · feedback / done screen ────────────────── */
.interview-feedback {
  max-width: 880px;
  margin: 32px auto 64px;
  padding: 0 32px;
}
.interview-feedback h1 {
  font-weight: 500; font-size: 30px; letter-spacing: -.01em;
  margin: 0 0 8px;
}
.interview-feedback .sub {
  color: var(--text-secondary); font-size: 14px; line-height: 1.55;
  margin: 0 0 24px;
}

.iv-feedback-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
}
.iv-feedback-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 20px;
}
.iv-feedback-label {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.iv-feedback-value {
  font-size: 15px; font-weight: 500; color: var(--text);
}

.iv-feedback-block {
  margin-top: 18px;
}
.iv-feedback-block h4 {
  margin: 0 0 8px;
  font-size: 13px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-secondary);
}
.iv-feedback-block p {
  margin: 0;
  font-size: 15px; line-height: 1.6; color: var(--text);
}
.iv-feedback-block ul {
  margin: 0; padding-left: 20px;
}
.iv-feedback-block li {
  font-size: 14px; line-height: 1.55; color: var(--text);
  margin-bottom: 6px;
}

.iv-rec {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500;
  letter-spacing: -.005em;
}
.iv-rec.rec-strong_hire  { background: rgba(52,168,83,.16);  color: #1E8E3E; }
.iv-rec.rec-hire         { background: rgba(52,168,83,.10);  color: #34A853; }
.iv-rec.rec-lean_hire    { background: rgba(251,188,4,.16);  color: #B06000; }
.iv-rec.rec-lean_no_hire { background: rgba(249,171,0,.16);  color: #B06000; }
.iv-rec.rec-no_hire      { background: rgba(234,67,53,.14);  color: #C5221F; }

.iv-feedback-loading {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0 20px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(155,114,203,.10), rgba(66,133,244,.08));
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  font-size: 14px; color: var(--text-secondary);
}
.iv-loading-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-tertiary);
  animation: iv-bounce 1.1s infinite ease-in-out;
}
.iv-loading-dot:nth-child(2) { animation-delay: .15s; }
.iv-loading-dot:nth-child(3) { animation-delay: .3s; }
@keyframes iv-bounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .4; }
  40%           { transform: scale(1);  opacity: 1; }
}
.iv-feedback-error {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0 20px;
  padding: 12px 16px;
  background: rgba(234,67,53,.06);
  border: 1px solid rgba(234,67,53,.18);
  border-radius: var(--r-md);
  font-size: 13px; color: var(--text);
}
.iv-feedback-error .btn { margin-left: auto; padding: 4px 12px; font-size: 12px; }

.iv-transcript-details {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 12px 20px;
}
.iv-transcript-details summary {
  cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  padding: 4px 0;
}
.iv-transcript-details[open] summary {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 10px;
}
.iv-prompt-details summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.iv-prompt-details summary > span { flex: 1; }
.iv-prompt-details summary .btn-icon {
  padding: 4px 12px; font-size: 12px; min-width: auto; height: auto;
}
.iv-prompt-pre {
  margin: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.55; color: var(--text);
  background: var(--surface-strong, rgba(0,0,0,.03));
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  max-height: 520px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
}
.iv-transcript {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 480px; overflow-y: auto;
  padding: 4px 0;
}
.iv-bubble {
  padding: 10px 14px;
  border-radius: var(--r-md);
  max-width: 86%;
}
.iv-bubble .who {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.iv-bubble.user {
  align-self: flex-end;
  background: rgba(26,115,232,.10);
}
.iv-bubble.ai {
  align-self: flex-start;
  background: var(--surface-2);
}

/* ─── Gemi (Code) — Mode gate (Talk / Type) ─────────────────────── */
.gemi-mode-gate {
  max-width: 980px;
  margin: 0 auto;
  padding: 64px 40px 80px;
}
.gemi-mode-gate h1 {
  font-size: 44px; font-weight: 500; letter-spacing: -.02em;
  margin: 0 0 10px;
}
.gemi-mode-gate .sub {
  color: var(--text-secondary); font-size: 17px;
  margin: 0 0 36px;
}
.gemi-mode-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.gemi-mode-card {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 28px 28px 24px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.gemi-mode-card:hover {
  box-shadow: var(--shadow-3);
  transform: translateY(-2px);
  border-color: transparent;
}
.gemi-mode-icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.gemi-mode-card h3 {
  margin: 0 0 8px;
  font-size: 22px; font-weight: 500; letter-spacing: -.01em;
  color: var(--text);
}
.gemi-mode-card p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 14px; line-height: 1.55;
}
.gemi-mode-cta {
  color: var(--gc-blue); font-weight: 500; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.gemi-mode-hint {
  margin-top: 28px;
  color: var(--text-tertiary); font-size: 13px;
}
@media (max-width: 720px) {
  .gemi-mode-grid { grid-template-columns: 1fr; }
}

/* ─── Gemi text-chat footer ─────────────────────────────────────── */
.gemi-chat-foot {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}
.gemi-chat-row {
  display: flex; gap: 10px; align-items: flex-end;
}
.gemi-send-btn { white-space: nowrap; }
.gemi-chat-status {
  font-size: 11px; color: var(--text-tertiary);
  padding-left: 2px;
}
.gemi-chat-input {
  flex: 1;
  resize: none;
  font-family: inherit;
  font-size: 14px; line-height: 1.45;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  min-height: 44px;
  max-height: 160px;
  transition: border-color .15s, box-shadow .15s;
}
.gemi-chat-input:focus {
  border-color: var(--gc-blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,.18);
}
.gemi-chat-input:disabled { opacity: .6; cursor: not-allowed; }

/* ─── Fast Mode toggle + splash banner ──────────────────────────── */
.gemi-fast-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-soft);
}
.gemi-fast-toggle.on {
  background: rgba(249, 171, 0, 0.10);
  border-color: rgba(249, 171, 0, 0.45);
  color: #B25C00;
}
.fast-mode-banner {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(249, 171, 0, 0.12);
  color: #B25C00;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
  margin-bottom: 14px;
  border: 1px solid rgba(249, 171, 0, 0.3);
}

/* ── Avatar Interview ─────────────────────────────────────────────────────── */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.avatar-card {
  background: var(--surface);
  border: 2px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 12px 8px 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.avatar-card:hover { border-color: #9B72CB; background: rgba(155,114,203,.06); }
.avatar-card.selected { border-color: #9B72CB; background: rgba(155,114,203,.10); }
.avatar-card img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 8px; }
.avatar-card-name { font-size: 13px; font-weight: 500; color: var(--text); }

/* ── Avatar interview: side-by-side stage ─────────────────────────────────── */
/* Override the base .iv-stage so avatar + camera sit in a fixed row */
.iv-avatar-stage {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 24px;
  padding: 24px 32px;
  min-height: 0;
}

/* Avatar video container — takes up remaining horizontal space */
.iv-avatar-wrap {
  position: relative;
  flex: 1 1 0;
  min-width: 260px; max-width: 580px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #111;
  display: flex; align-items: center; justify-content: center;
}
.iv-avatar-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.iv-avatar-label {
  position: absolute; bottom: 10px; left: 14px;
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,.85);
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  pointer-events: none;
}
.iv-avatar-connecting, .iv-avatar-error {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 24px; color: rgba(255,255,255,.7); font-size: 14px; text-align: center;
}
.iv-avatar-connecting .iv-loading-dot { background: rgba(255,255,255,.5); }

/* User camera panel — fixed width, same height as avatar via stretch */
.iv-avatar-cam-col {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.iv-avatar-cam-col .iv-camera-wrap {
  flex: 1;
  padding: 5px;
}
.iv-avatar-cam-col .iv-camera-frame {
  height: 100%;
}
.iv-avatar-cam-col .iv-camera {
  width: 100%; height: 100%; object-fit: cover;
}
