/* ════════════════════════════════════════
   NAWA — SaaS REDESIGN
   ════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  --font-sans:    "DM Sans", "DM Sans Fallback", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Space Grotesk Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "JetBrains Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --bg:           #000000;
  --bg2:          #0a0a0a;
  --bg3:          #111111;
  --surface:      rgba(14, 14, 14, 0.97);
  --surface2:     rgba(18, 18, 18, 0.99);
  --border:       rgba(255, 255, 255, 0.07);
  --border-hi:    rgba(255, 255, 255, 0.13);
  --text:         #e2e2e2;
  --text2:        #7a7a7a;
  --text3:        #484848;
  --accent:       #2dd4bf;
  --accent-dim:   rgba(45, 212, 191, 0.12);
  --accent-glow:  rgba(45, 212, 191, 0.24);
  --blue:         #3b82f6;
  --blue-dim:     rgba(59, 130, 246, 0.12);
  --warn:         #f59e0b;
  --danger:       #ef4444;
  --danger-dim:   rgba(239, 68, 68, 0.14);
  --green:        #22c55e;
  --scrollbar-track: rgba(255, 255, 255, 0.04);
  --scrollbar-thumb: rgba(255, 255, 255, 0.22);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.34);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.6);
  --shadow:       0 8px 32px rgba(0,0,0,0.75);
  --shadow-lg:    0 20px 60px rgba(0,0,0,0.9);
  --radius:       12px;
  --radius-sm:    7px;
  --radius-lg:    18px;
  --topnav-h:     52px;
  --sidebar-w:    220px;
  --app-bar-h:    48px;
  --sidebar-bg: rgba(0, 0, 0, 0.85);
  --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --sidebar-card-bg: rgba(255, 255, 255, 0.02);
  --sidebar-muted-opacity: 0.7;
  --sidebar-locked-opacity: 0.35;
  --sidebar-stage-opacity: 0.45;
}

[data-theme="light"] {
  --bg:           #f4f7fb;
  --bg2:          #eef3fb;
  --bg3:          #e6edf8;
  --surface:      rgba(255, 255, 255, 0.97);
  --surface2:     rgba(255, 255, 255, 0.99);
  --border:       rgba(15, 23, 42, 0.12);
  --border-hi:    rgba(15, 23, 42, 0.22);
  --text:         #0f172a;
  --text2:        #334155;
  --text3:        #64748b;
  --accent:       #0f766e;
  --accent-dim:   rgba(15, 118, 110, 0.1);
  --accent-glow:  rgba(15, 118, 110, 0.2);
  --blue:         #2563eb;
  --blue-dim:     rgba(37, 99, 235, 0.1);
  --warn:         #b45309;
  --danger:       #dc2626;
  --danger-dim:   rgba(220, 38, 38, 0.1);
  --green:        #16a34a;
  --scrollbar-track: rgba(15, 23, 42, 0.08);
  --scrollbar-thumb: rgba(15, 23, 42, 0.24);
  --scrollbar-thumb-hover: rgba(15, 23, 42, 0.38);
  --shadow-sm:    0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow:       0 8px 28px rgba(15, 23, 42, 0.14);
  --shadow-lg:    0 20px 52px rgba(15, 23, 42, 0.16);
  --sidebar-bg: rgba(248, 250, 252, 0.94);
  --sidebar-hover-bg: rgba(15, 23, 42, 0.08);
  --sidebar-card-bg: rgba(15, 23, 42, 0.04);
  --sidebar-muted-opacity: 0.95;
  --sidebar-locked-opacity: 0.62;
  --sidebar-stage-opacity: 0.7;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4 { margin: 0; font-family: var(--font-display); letter-spacing: -0.02em; }
p { margin: 0; color: var(--text2); line-height: 1.65; }
a { color: inherit; text-decoration: none; }

/* ── Background ── */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.10;
}
.bg-glow-1 { width: 600px; height: 400px; top: -100px; left: -80px; background: radial-gradient(circle, #0f2a4a, transparent 70%); }
.bg-glow-2 { width: 500px; height: 400px; top: 40%; right: -60px; background: radial-gradient(circle, #083a32, transparent 70%); }
.bg-glow-3 { width: 400px; height: 300px; bottom: -60px; left: 35%; background: radial-gradient(circle, #0a1a30, transparent 70%); }
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
}
[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(to right, rgba(15,23,42,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,23,42,0.05) 1px, transparent 1px);
}
.bg-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(0,0,0,0.55) 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(0,0,0,0.55) 0%, transparent 100%);
}
[data-theme="light"] .bg-dots {
  background-image: radial-gradient(circle, rgba(15,23,42,0.12) 1px, transparent 1px);
}

/* ════════════════════════════════════
   GLOBAL TOPNAV
════════════════════════════════════ */
/* Topnav: landing-only — slide away when app view is open */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  z-index: 100;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
[data-theme="light"] .topnav {
  background: rgba(255, 255, 255, 0.94);
}
.topnav--app {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.topnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 1.5rem;
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-logo.small { width: 26px; height: 26px; border-radius: 7px; }
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}
[data-theme="light"] .brand-name {
  color: var(--text);
}
.brand-pill {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 500;
}
.topnav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}
.tnl {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 0.875rem;
  transition: color 0.15s, background 0.15s;
}
.tnl:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.topnav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* ════════════════════════════════════
   BUTTON SYSTEM
════════════════════════════════════ */
button { cursor: pointer; font-family: inherit; font-size: 0.875rem; transition: all 0.15s; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45,212,191,0.45);
  background: linear-gradient(135deg, rgba(45,212,191,0.22) 0%, rgba(59,130,246,0.22) 100%);
  color: var(--accent);
  font-weight: 500;
}
.btn-primary:hover { background: linear-gradient(135deg, rgba(45,212,191,0.32) 0%, rgba(59,130,246,0.32) 100%); border-color: var(--accent); transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59,130,246,0.4);
  background: var(--blue-dim);
  color: #93c5fd;
  font-weight: 500;
}
.btn-secondary:hover { border-color: var(--blue); transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: rgba(255,255,255,0.04);
  color: var(--text2);
  font-weight: 500;
}
.btn-ghost:hover { border-color: var(--border-hi); background: rgba(255,255,255,0.08); color: var(--text); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239,68,68,0.4);
  background: var(--danger-dim);
  color: #fca5a5;
  font-weight: 500;
}
.btn-danger:hover { border-color: var(--danger); transform: translateY(-1px); }

.btn-approve {
  width: 100%;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.1);
  color: #86efac;
  font-weight: 500;
  margin-top: auto;
}
.btn-approve:hover { border-color: var(--green); background: rgba(34,197,94,0.18); transform: translateY(-1px); }

.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; border-radius: var(--radius); }

.btn-primary-sm {
  padding: 0.38rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45,212,191,0.45);
  background: linear-gradient(135deg, rgba(45,212,191,0.22), rgba(59,130,246,0.22));
  color: var(--accent);
  font-weight: 500;
  font-size: 0.82rem;
}
.btn-ghost-sm {
  padding: 0.38rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: transparent;
  color: var(--text2);
  font-size: 0.82rem;
}
.btn-ghost-sm:hover { color: var(--text); background: rgba(255,255,255,0.06); }

button.is-loading { opacity: 0.55; cursor: progress; transform: none !important; }

/* ════════════════════════════════════
   VIEW SYSTEM
════════════════════════════════════ */
.view { display: none; }
.view.is-active { display: block; }
.view-landing {
  padding-top: var(--topnav-h);
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}
.view-app { display: none; flex-direction: column; height: 100vh; }
.view-app.is-active { display: flex; }

.tnl-static {
  cursor: default;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

/* ════════════════════════════════════
   LANDING PAGE (purple, reference layout)
════════════════════════════════════ */
.view-landing {
  --lp-violet:   #8b5cf6;
  --lp-indigo:   #6366f1;
  --lp-violet-2: #a78bfa;
  --lp-cyan:     #22d3ee;
  --lp-panel:    rgba(12, 14, 24, 0.82);
  --lp-soft:     rgba(139, 92, 246, 0.12);
  --lp-border:   rgba(139, 92, 246, 0.30);
  --lp-glow:     rgba(139, 92, 246, 0.38);
}

/* Purple buttons — scoped to the landing only, app keeps its teal brand */
.view-landing .btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border: 1px solid rgba(139, 92, 246, 0.6);
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.30);
}
.view-landing .btn-primary:hover {
  background: linear-gradient(135deg, #9b6bff 0%, #7376f3 100%);
  border-color: var(--lp-violet-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.42);
}
.view-landing .btn-ghost:hover {
  border-color: var(--lp-border);
  background: var(--lp-soft);
  color: #fff;
}

/* ── Hero ── */
.lp-hero {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(3.8rem, 8vw, 6.5rem) 1.5rem 3.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.lp-hero::before {
  content: "";
  position: absolute;
  inset: 0 1.5rem auto;
  height: 540px;
  border-radius: 40px;
  background:
    radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.28), transparent 48%),
    linear-gradient(180deg, rgba(99, 102, 241, 0.08), transparent 72%);
  pointer-events: none;
  z-index: -1;
}
.lp-hero-copy { display: flex; flex-direction: column; align-items: center; gap: 1.35rem; text-align: center; }
.lp-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--lp-border);
  background: var(--lp-soft);
  color: var(--lp-violet-2);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lp-badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lp-violet);
  box-shadow: 0 0 10px var(--lp-glow);
  animation: lp-pulse 2s ease infinite;
}
@keyframes lp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.lp-title {
  font-family: var(--font-display);
  max-width: 980px;
  font-size: clamp(3rem, 7vw, 6.7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.065em;
  color: #fff;
  margin: 0;
}
.lp-grad {
  background: linear-gradient(120deg, #a78bfa 0%, #8b5cf6 45%, #6366f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lp-sub { max-width: 760px; font-size: clamp(1.02rem, 1.8vw, 1.24rem); line-height: 1.7; color: var(--text2); margin: 0; }
.lp-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.4rem; }
.lp-agent-strip {
  width: min(960px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.65rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.lp-agent-strip span {
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(0,0,0,0.22);
}

.lp-stats { display: flex; align-items: center; justify-content: center; gap: 1.6rem; margin-top: 0.3rem; flex-wrap: wrap; }
.lp-stat-val { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: #fff; }
.lp-stat-label { font-size: 0.78rem; color: var(--text3); margin-top: 0.15rem; }
.lp-stat-sep { width: 1px; height: 30px; background: var(--border-hi); }

/* ── Hero product preview ── */
.lp-hero-visual { position: relative; width: min(1040px, 100%); }
.lp-preview-glow {
  position: absolute;
  inset: -18% -8% auto auto;
  width: 70%; height: 70%;
  background: radial-gradient(circle, var(--lp-glow), transparent 70%);
  filter: blur(46px);
  z-index: 0;
  pointer-events: none;
}
.lp-preview {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border-hi);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 18, 32, 0.94), rgba(5, 8, 18, 0.98));
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(139, 92, 246, 0.08);
  overflow: hidden;
}
.lp-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.lp-dot { width: 11px; height: 11px; border-radius: 50%; }
.lp-dot-r { background: #ef4444; }
.lp-dot-y { background: #f59e0b; }
.lp-dot-g { background: #22c55e; }
.lp-preview-title { margin-left: 0.4rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text2); }
.lp-preview-badge {
  margin-left: auto;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--lp-violet-2);
  background: var(--lp-soft);
  border: 1px solid var(--lp-border);
}
.lp-preview-body { padding: clamp(1rem, 2vw, 1.35rem); display: grid; gap: 1rem; }
.lp-preview-row { display: flex; align-items: center; justify-content: space-between; }
.lp-prow-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); font-weight: 700; }
.lp-prow-chip {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--lp-violet-2);
  background: var(--lp-soft);
  border: 1px solid var(--lp-border);
}
.lp-prow-title { font-family: var(--font-display); font-size: 1.25rem; color: #fff; line-height: 1.2; }
.lp-preview-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.lp-kpi {
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  background: rgba(255, 255, 255, 0.035);
}
.lp-kpi strong { display: block; font-family: var(--font-display); font-size: 0.82rem; color: #fff; margin-bottom: 0.2rem; }
.lp-kpi span { font-size: 0.72rem; color: var(--lp-violet-2); }
.lp-rail { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.45rem; }
.lp-rail-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
  padding: 0.6rem 0.3rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.72rem;
  color: var(--text2);
}
.lp-rail-step span { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text3); }
.lp-rail-step.is-done { border-color: rgba(34, 197, 94, 0.25); background: rgba(34, 197, 94, 0.08); color: #86efac; }
.lp-rail-step.is-done span { color: #86efac; }
.lp-rail-step.is-active { border-color: var(--lp-border); background: var(--lp-soft); color: var(--lp-violet-2); }
.lp-rail-step.is-active span { color: var(--lp-violet-2); }
.lp-preview-note {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.10), rgba(139, 92, 246, 0.08));
}
.lp-preview-note strong { font-family: var(--font-display); font-size: 0.82rem; color: #d9f99d; }
.lp-preview-note span { font-size: 0.78rem; color: var(--text2); line-height: 1.5; }
.lp-log { display: grid; gap: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.9rem; }
.lp-log-line { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text2); }
.lp-log-line em { color: var(--lp-violet-2); font-style: normal; margin-right: 0.5rem; }

/* ── Orca-inspired product sections, mapped to POC schema ── */
.lp-tour,
.lp-feature-section,
.lp-compare-section,
.lp-faq-section,
.lp-final-cta {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 5.8rem) 1.5rem;
}
.lp-section-kicker {
  width: fit-content;
  margin: 0 auto 0.85rem;
  color: var(--lp-violet-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.lp-section-title {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(2rem, 4.5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  color: #fff;
}
.lp-section-copy {
  max-width: 680px;
  margin: 1rem auto 0;
  text-align: center;
  font-size: 1rem;
  color: var(--text2);
}
.lp-loop-shell {
  margin-top: 2rem;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018));
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
  overflow: hidden;
}
.lp-loop-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.lp-loop-tabs span {
  white-space: nowrap;
  padding: 0.48rem 0.85rem;
  border-radius: 999px;
  color: var(--text2);
  font-size: 0.8rem;
  border: 1px solid transparent;
}
.lp-loop-tabs .is-active {
  color: #fff;
  border-color: var(--lp-border);
  background: var(--lp-soft);
}
.lp-loop-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1rem; padding: 1rem; }
.lp-loop-card {
  min-height: 230px;
  padding: 1.25rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 211, 238, 0.10), transparent 34%),
    var(--lp-panel);
}
.lp-loop-card--wide { grid-row: span 2; min-height: 476px; }
.lp-card-label,
.lp-product-icon {
  width: fit-content;
  margin-bottom: 0.9rem;
  padding: 0.26rem 0.55rem;
  border-radius: 999px;
  color: var(--lp-cyan);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.08);
}
.lp-loop-card h3,
.lp-product-card h3 { color: #fff; font-size: 1.22rem; margin-bottom: 0.55rem; }
.lp-loop-card p,
.lp-product-card p { font-size: 0.9rem; color: var(--text2); }
.lp-checklist { display: grid; gap: 0.7rem; margin-top: 2rem; }
.lp-checklist span {
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text2);
  background: rgba(255,255,255,0.035);
}
.lp-checklist .is-done { color: #86efac; border-color: rgba(34,197,94,0.22); background: rgba(34,197,94,0.08); }
.lp-checklist .is-active { color: var(--lp-violet-2); border-color: var(--lp-border); background: var(--lp-soft); }
.lp-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; }
.lp-product-card {
  padding: 1.25rem;
  min-height: 220px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018));
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.lp-product-card:hover { transform: translateY(-3px); border-color: var(--lp-border); }
.lp-compare-table {
  margin-top: 2rem;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.10);
  overflow: hidden;
  background: rgba(255,255,255,0.025);
}
.lp-compare-row { display: grid; grid-template-columns: 0.9fr 1.1fr 1.1fr; }
.lp-compare-row span {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  color: var(--text2);
}
.lp-compare-row span:nth-child(2) { color: #fff; background: rgba(139,92,246,0.07); }
.lp-compare-head span { border-top: 0; color: #fff; font-family: var(--font-display); font-weight: 700; }
.lp-faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; }
.lp-faq-grid details {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
  padding: 1rem;
}
.lp-faq-grid summary { cursor: pointer; color: #fff; font-family: var(--font-display); font-weight: 700; }
.lp-faq-grid p { margin-top: 0.75rem; font-size: 0.9rem; }
.lp-final-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  border-radius: 30px;
  border: 1px solid var(--lp-border);
  background:
    radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.20), transparent 38%),
    rgba(255,255,255,0.035);
}
.lp-final-cta .lp-section-kicker { margin: 0 0 0.8rem; }
.lp-final-cta h2 { max-width: 760px; font-size: clamp(1.8rem, 3.8vw, 3.4rem); line-height: 1; color: #fff; }
.lp-final-cta p { max-width: 640px; margin-top: 0.9rem; }

/* ── Responsive ── */
@media (max-width: 980px) {
  .lp-loop-grid,
  .lp-feature-grid,
  .lp-faq-grid { grid-template-columns: 1fr; }
  .lp-loop-card--wide { min-height: 300px; }
  .lp-final-cta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .lp-title { font-size: clamp(2.55rem, 16vw, 4rem); }
  .lp-agent-strip { border-radius: 22px; justify-content: flex-start; }
  .lp-preview-kpis { grid-template-columns: 1fr; }
  .lp-rail { grid-template-columns: 1fr; }
  .lp-stats { gap: 1rem; }
  .lp-stat-sep { display: none; }
  .lp-compare-row { grid-template-columns: 1fr; }
  .lp-compare-row span { border-top: 1px solid rgba(255,255,255,0.07); }
}

/* ════════════════════════════════════
   APP VIEW
════════════════════════════════════ */
.app-bar {
  height: var(--app-bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.96);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
  z-index: 50;
}
.app-bar-left { display: flex; align-items: center; gap: 0.6rem; }
.app-back {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: transparent;
  color: var(--text2);
  display: grid;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
}
.app-back:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.app-breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; }
.abc-root { color: var(--text2); }
.abc-page { color: var(--text); font-weight: 500; }
.app-bar-chips { display: flex; align-items: center; gap: 0.4rem; flex: 1; justify-content: center; flex-wrap: wrap; }
.app-bar-left { flex-shrink: 0; }
.app-bar-right { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.app-bar-right .app-user { margin-left: 0.15rem; padding-left: 0.55rem; border-left: 1px solid var(--border); border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0; background: transparent; }
.last-action { font-size: 0.74rem; color: var(--text3); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; padding-right: 0.15rem; }

/* Settings flyout (gear) — Azure-portal style */
.gear-wrap { position: relative; display: flex; }
.gear-btn[aria-expanded="true"] { color: var(--text); background: rgba(255,255,255,0.08); border-color: var(--border-hi); }
.gear-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 264px;
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid var(--border-hi);
  background: var(--surface, #14141b);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.02);
  z-index: 200;
  animation: gearMenuIn 0.14s ease;
}
.gear-menu[hidden] { display: none; }
@keyframes gearMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.gear-menu::before {
  content: ""; position: absolute; top: -5px; right: 12px;
  width: 10px; height: 10px; rotate: 45deg;
  background: var(--surface, #14141b); border-left: 1px solid var(--border-hi); border-top: 1px solid var(--border-hi);
}
.gear-menu-header { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); padding: 0.4rem 0.55rem 0.35rem; }
.gear-menu-item {
  display: flex; align-items: center; gap: 0.65rem; width: 100%;
  padding: 0.6rem 0.55rem; border: 0; border-radius: 9px; background: transparent;
  color: var(--text); cursor: pointer; text-align: left; transition: background 0.12s;
}
.gear-menu-item:hover { background: rgba(255,255,255,0.06); }
.gear-menu-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; color: var(--pg-violet-2); background: var(--pg-soft); border: 1px solid var(--pg-border); }
.gear-menu-body { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.gear-menu-label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.gear-menu-sub { font-size: 0.7rem; color: var(--text3); }
.gear-menu-chev { color: var(--text3); flex-shrink: 0; }
.gear-menu-item:hover .gear-menu-chev { color: var(--text2); }
.gear-menu-soon { font-size: 0.66rem; color: var(--text3); text-align: center; padding: 0.5rem 0.5rem 0.3rem; margin-top: 0.2rem; border-top: 1px solid var(--border); }

/* Notification center */
.notif-wrap { position: relative; display: flex; }
.notif-btn { position: relative; }
.notif-btn[aria-expanded="true"] { color: var(--text); background: rgba(255,255,255,0.08); border-color: var(--border-hi); }
.notif-badge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 0.6rem; font-weight: 800; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--bg, #000); }
.notif-badge[hidden] { display: none; }
@keyframes notifPulse { 0% { transform: scale(1); } 30% { transform: scale(1.18); } 100% { transform: scale(1); } }
.notif-btn.is-pulse svg { animation: notifPulse 0.4s ease; transform-origin: 50% 30%; }
.notif-menu {
  position: absolute; top: calc(100% + 9px); right: 0; width: 320px; max-height: 60vh;
  display: flex; flex-direction: column;
  border-radius: 12px; border: 1px solid var(--border-hi);
  background: var(--surface, #14141b);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  z-index: 200; overflow: hidden; animation: gearMenuIn 0.14s ease;
}
.notif-menu[hidden] { display: none; }
.notif-menu::before { content: ""; position: absolute; top: -5px; right: 12px; width: 10px; height: 10px; rotate: 45deg; background: var(--surface, #14141b); border-left: 1px solid var(--border-hi); border-top: 1px solid var(--border-hi); }
.notif-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0.85rem 0.55rem; font-family: var(--font-display); font-size: 0.78rem; font-weight: 700; color: var(--text); border-bottom: 1px solid var(--border); }
.notif-clear { background: transparent; border: 0; color: var(--pg-violet-2); font-size: 0.72rem; font-weight: 600; cursor: pointer; }
.notif-clear:hover { color: var(--text); }
.notif-list { overflow-y: auto; display: flex; flex-direction: column; }
.notif-item { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.6rem 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.notif-item:last-child { border-bottom: 0; }
.notif-ic { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; }
.notif-success .notif-ic { color: #86efac; background: rgba(34,197,94,0.14); }
.notif-error .notif-ic { color: #fca5a5; background: rgba(239,68,68,0.14); }
.notif-warning .notif-ic { color: #fcd34d; background: rgba(245,158,11,0.14); }
.notif-info .notif-ic { color: var(--pg-violet-2); background: var(--pg-soft); }
.notif-body { flex: 1; min-width: 0; }
.notif-msg { font-size: 0.8rem; color: var(--text); line-height: 1.4; word-break: break-word; }
.notif-time { font-size: 0.66rem; color: var(--text3); margin-top: 0.15rem; }
.notif-empty { padding: 1.6rem 1rem; text-align: center; font-size: 0.78rem; color: var(--text3); }
.notif-list:not(:empty) + .notif-empty { display: none; }

/* Chips */
.chip {
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  background: rgba(255,255,255,0.04);
  color: var(--text2);
  font-size: 0.7rem;
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
}
.chip-status[data-status="idle"] { border-color: var(--border-hi); }
.chip-status[data-status="running"],
.chip-status[data-status="implementation_running"],
.chip-status[data-status="qa_validation"],
.chip-status[data-status="deploying"] { border-color: rgba(45,212,191,0.45); color: var(--accent); }
.chip-status[data-status="paused"],
.chip-status[data-status="needs_input"] { border-color: rgba(245,158,11,0.45); color: #fbbf24; }
.chip-status[data-status="failed"],
.chip-status[data-status="cancelled"] { border-color: rgba(239,68,68,0.45); color: #f87171; }
.chip-project { border-color: rgba(45,212,191,0.2); color: var(--text3); }
.chip-project.has-project { border-color: rgba(45,212,191,0.45); color: var(--accent); }

/* Topnav user widget */
.topnav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: rgba(255,255,255,0.04);
}
.tnu-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tnu-name { font-size: 0.8rem; font-weight: 500; color: var(--text); }
.tnu-logout {
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 0.9rem;
  padding: 0 0.1rem;
  cursor: pointer;
}
.tnu-logout:hover { color: #f87171; }

/* App bar user widget */
.app-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: rgba(255,255,255,0.04);
}
.app-user-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #000;
  font-size: 0.6rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.app-user-name { font-size: 0.75rem; color: var(--text2); }
.app-user-logout {
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 0.85rem;
  padding: 0;
  cursor: pointer;
  line-height: 1;
}
.app-user-logout:hover { color: #f87171; }

/* ════════════════════════════════════
   PROJECTS GALLERY — dashboard redesign
════════════════════════════════════ */
.view-app {
  --pg-violet:   #8b5cf6;
  --pg-indigo:   #6366f1;
  --pg-violet-2: #a78bfa;
  --pg-soft:     rgba(139, 92, 246, 0.12);
  --pg-border:   rgba(139, 92, 246, 0.30);
  --pg-glow:     rgba(139, 92, 246, 0.35);
}

/* Top bar (search + actions) */
.pg-topbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.pg-topbar .pg-headrow-left { flex: 1; min-width: 0; }
.pg-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.85rem;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s, background 0.15s;
}
.pg-search:focus-within { border-color: var(--pg-border); background: var(--pg-soft); }
.pg-search-ic { color: var(--text3); flex-shrink: 0; }
.pg-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
}
.pg-search-input::placeholder { color: var(--text3); }
.pg-topbar-actions { display: flex; align-items: center; gap: 0.55rem; }
.pg-btn-import, .pg-btn-new {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 42px;
  padding: 0 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pg-btn-import { border: 1px solid var(--border-hi); background: rgba(255, 255, 255, 0.03); color: var(--text2); }
.pg-btn-import:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.pg-btn-new {
  border: 1px solid rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3);
}
.pg-btn-new:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(99, 102, 241, 0.42); }

/* Title row + controls */
.pg-headrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.pg-title { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin-bottom: 0.2rem; }
.pg-subtitle { font-size: 0.85rem; color: var(--text2); }
.pg-headrow-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.pg-select {
  height: 36px;
  padding: 0 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-hi);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text2);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}
.pg-select:hover { color: var(--text); border-color: var(--pg-border); }
.pg-btn-reset {
  height: 36px;
  padding: 0 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text3);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.pg-btn-reset:hover { color: var(--text2); border-color: var(--border-hi); }

/* Stat cards */
.pg-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
.pg-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, transform 0.2s;
}
.pg-stat-card:hover { border-color: var(--pg-border); transform: translateY(-2px); }
.pg-stat-head { display: flex; align-items: center; gap: 0.5rem; }
.pg-stat-ic {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--pg-violet-2);
  background: var(--pg-soft);
  border: 1px solid var(--pg-border);
}
.pg-stat-label { font-size: 0.74rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; }
.pg-stat-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--text); letter-spacing: -0.02em; }
.pg-stat-foot { font-size: 0.72rem; color: var(--text3); }

.pg-list-meta { color: var(--text3); font-size: 0.74rem; }

/* Loading / empty / error */
.pg-loading { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 3rem; color: var(--text2); font-size: 0.85rem; }
.pg-loading-ring { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-hi); border-top-color: var(--pg-violet); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pg-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.85rem; padding: 4rem 2rem; text-align: center; }
.pg-empty-illustration { width: 68px; height: 68px; border-radius: 50%; background: var(--pg-soft); border: 1px solid var(--pg-border); display: grid; place-items: center; color: var(--pg-violet-2); }
.pg-empty-title { font-size: 1rem; color: var(--text); }
.pg-empty-sub { font-size: 0.83rem; color: var(--text2); max-width: 320px; }
.pg-error { padding: 1.25rem; border-radius: var(--radius); border: 1px solid rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.06); color: #f87171; font-size: 0.83rem; }
.pg-no-results { border: 1px dashed var(--border-hi); border-radius: var(--radius); color: var(--text3); font-size: 0.8rem; text-align: center; padding: 1.1rem; grid-column: 1 / -1; }

/* Grid */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }

/* Project card */
.pg-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg2);
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
}
.pg-card:hover { border-color: var(--pg-border); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); transform: translateY(-3px); }
.pg-card--active { border-color: var(--pg-violet) !important; box-shadow: 0 0 0 1px var(--pg-border), 0 10px 30px rgba(139, 92, 246, 0.18); }

/* Generated thumbnail */
.pg-card-thumb {
  position: relative;
  height: 132px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background:
    radial-gradient(circle at 80% 0%, hsla(var(--pg-h, 260), 70%, 55%, 0.35), transparent 60%),
    linear-gradient(135deg, hsla(var(--pg-h, 260), 60%, 22%, 0.95), hsla(calc(var(--pg-h, 260) + 40), 55%, 13%, 0.97));
  border-bottom: 1px solid var(--border);
}
.pg-thumb-chrome { display: flex; align-items: center; gap: 0.3rem; }
.pg-thumb-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.pg-thumb-url {
  margin-left: 0.4rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pg-thumb-canvas { flex: 1; display: flex; gap: 0.45rem; min-height: 0; }
.pg-thumb-side { width: 26%; border-radius: 6px; background: rgba(255, 255, 255, 0.10); }
.pg-thumb-main { flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.pg-thumb-bar { height: 30%; border-radius: 6px; background: rgba(255, 255, 255, 0.16); }
.pg-thumb-rows { flex: 1; display: flex; flex-direction: column; gap: 0.32rem; justify-content: center; }
.pg-thumb-rows span { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.10); }
.pg-thumb-rows span:nth-child(1) { width: 90%; }
.pg-thumb-rows span:nth-child(2) { width: 68%; }
.pg-thumb-rows span:nth-child(3) { width: 80%; }
.pg-card-monogram {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.pg-thumb-status {
  position: absolute;
  bottom: 0.55rem; right: 0.55rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid;
  backdrop-filter: blur(4px);
}

/* Card body */
.pg-card-body { padding: 0.85rem 1rem 0.7rem; display: flex; flex-direction: column; gap: 0.5rem; cursor: pointer; flex: 1; }
.pg-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pg-card-name { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s; }
.pg-card--active .pg-card-name, .pg-card-body:hover .pg-card-name { color: var(--pg-violet-2); }
.pg-card-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pg-card-desc { font-size: 0.8rem; line-height: 1.5; color: var(--text2); display: -webkit-box; line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pg-card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }
.pg-tag {
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--pg-violet-2);
  background: var(--pg-soft);
  border: 1px solid var(--pg-border);
  white-space: nowrap;
}
.pg-tag--muted { color: var(--text3); background: rgba(255, 255, 255, 0.03); border-color: var(--border); font-family: "JetBrains Mono", monospace; }

/* Card footer */
.pg-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.6rem 0.8rem 0.6rem 1rem; border-top: 1px solid var(--border); background: rgba(0, 0, 0, 0.18); }
.pg-card-foot-meta { display: flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: var(--text3); min-width: 0; }
.pg-foot-sep { opacity: 0.5; }
.pg-card-ago, .pg-card-runs-n { white-space: nowrap; }
.pg-card-foot-actions { display: flex; align-items: center; gap: 0.3rem; flex-shrink: 0; }
.pg-btn-open {
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--pg-border);
  background: var(--pg-soft);
  color: var(--pg-violet-2);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pg-btn-open:hover { background: rgba(139, 92, 246, 0.22); border-color: var(--pg-violet); }
.pg-btn-icon, .pg-btn-delete {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text3);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s;
}
.pg-btn-icon:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: var(--border-hi); }
.pg-btn-delete:hover { color: #f87171; border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.08); }

/* New project tile */
.pg-card-new {
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 280px;
  padding: 1.5rem;
  text-align: center;
  border: 1px dashed var(--border-hi);
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}
.pg-card-new:hover { border-color: var(--pg-violet); background: var(--pg-soft); transform: translateY(-3px); }
.pg-card-new-plus {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--pg-violet-2);
  background: var(--pg-soft);
  border: 1px solid var(--pg-border);
  margin-bottom: 0.3rem;
}
.pg-card-new-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text); }
.pg-card-new-sub { font-size: 0.78rem; color: var(--text2); max-width: 22ch; line-height: 1.45; }
.pg-card-new-cta { margin-top: 0.5rem; padding: 0.45rem 1rem; border-radius: 8px; background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; font-size: 0.8rem; font-weight: 600; }

/* Run rows inside project drawer (kept) */
.pg-runs-loading, .pg-runs-empty { padding: 0.85rem 1rem; font-size: 0.78rem; color: var(--text3); text-align: center; }
.proj-run-row { padding: 0.6rem 1rem; }
.proj-run-row:not(:last-child) { border-bottom: 1px solid var(--border); }

@media (max-width: 1100px) {
  .pg-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .pg-topbar { flex-wrap: wrap; }
  .pg-search { min-width: 100%; order: 2; }
  .pg-topbar-actions { width: 100%; }
  .pg-btn-new { flex: 1; justify-content: center; }
  .pg-headrow { flex-direction: column; align-items: flex-start; }
  .pg-headrow-right { width: 100%; flex-wrap: wrap; }
  .pg-stats { grid-template-columns: 1fr; }
  .pg-grid { grid-template-columns: 1fr; }
}
/* App layout */
.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;   /* sidebar-less: linear landing → projects → execution */
  overflow: hidden;
}
.abc-root[role="button"] { cursor: pointer; }
.abc-root[role="button"]:hover { color: var(--text); }
#monitorGearBtn svg { transition: transform 0.4s ease; }
#monitorGearBtn:hover svg { transform: rotate(60deg); }
.app-bar .app-user { padding: 0.2rem 0.3rem 0.2rem 0.5rem; }

/* ── Sidebar (dashboard) ── */
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow-y: auto;
  padding: 1rem 0.8rem;
}
.sb-brand { display: flex; align-items: center; gap: 0.55rem; padding: 0.15rem 0.3rem 0.2rem; }
.sb-brand .brand-logo.small { width: 30px; height: 30px; flex-shrink: 0; }
.sb-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sb-brand-name { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; color: var(--text); line-height: 1.15; }
.sb-brand-tag { font-size: 0.62rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; }

.sb-nav-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text3); padding: 0 0.35rem; margin-bottom: 0.4rem; }

/* Active project pill */
.sb-active-project {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--sidebar-card-bg);
  transition: border-color 0.15s, background 0.15s;
}
.sb-active-project.sb-has-project { border-color: var(--pg-border); background: var(--pg-soft); }
.sb-ap-icon { font-size: 0.95rem; flex-shrink: 0; }
.sb-ap-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; }
.sb-ap-name { font-size: 0.78rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-no-project .sb-ap-name { color: var(--text3); font-weight: 400; }
.sb-has-project .sb-ap-name { color: var(--pg-violet-2); }
.sb-ap-hint { font-size: 0.66rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-ap-clear { flex-shrink: 0; background: transparent; border: none; color: var(--text3); font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 0.15rem; border-radius: 4px; }
.sb-ap-clear:hover { color: #f87171; }

/* Nav */
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav-btn {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text2);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: all 0.14s;
}
.sb-nav-text { flex: 1; }
.sb-nav-btn:hover { color: var(--text); background: var(--sidebar-hover-bg); }
.sb-nav-btn.active { border-color: var(--pg-border); color: var(--pg-violet-2); background: var(--pg-soft); }
.sb-icon { width: 17px; height: 17px; flex-shrink: 0; }
.sb-stage-num { font-family: "JetBrains Mono", monospace; font-size: 0.6rem; font-weight: 600; color: var(--text3); opacity: var(--sidebar-stage-opacity); letter-spacing: 0.04em; }
.sb-nav-btn.active .sb-stage-num { opacity: 0.9; color: var(--pg-violet-2); }
.sb-nav-btn--locked { opacity: var(--sidebar-locked-opacity); cursor: not-allowed; }
.sb-nav-btn--locked:hover { background: transparent; color: var(--text2); }

/* Usage */
.sb-usage { display: flex; flex-direction: column; gap: 0.65rem; padding: 0.2rem 0.1rem 0; }
.sb-usage-item { display: flex; flex-direction: column; gap: 0.3rem; }
.sb-usage-top { display: flex; align-items: center; justify-content: space-between; font-size: 0.7rem; color: var(--text2); }
.sb-usage-top span:last-child { font-family: "JetBrains Mono", monospace; color: var(--text3); font-size: 0.66rem; }
.sb-usage-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.sb-usage-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #8b5cf6, #6366f1); transition: width 0.6s ease; }

/* Upgrade card */
.sb-upgrade {
  margin-top: auto;
  padding: 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--pg-border);
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.16), rgba(99, 102, 241, 0.08));
  display: flex; flex-direction: column; gap: 0.3rem;
  text-align: left;
}
.sb-upgrade-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #8b5cf6, #6366f1); margin-bottom: 0.1rem; }
.sb-upgrade-title { font-family: var(--font-display); font-size: 0.84rem; font-weight: 700; color: var(--text); }
.sb-upgrade-sub { font-size: 0.7rem; line-height: 1.45; color: var(--text2); }
.sb-upgrade-btn { margin-top: 0.45rem; width: 100%; padding: 0.5rem; border-radius: 8px; border: none; background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: filter 0.15s; }
.sb-upgrade-btn:hover { filter: brightness(1.12); }

/* Profile */
.sb-profile {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--sidebar-card-bg);
}
.sb-profile .app-user-avatar { width: 30px; height: 30px; font-size: 0.7rem; background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; }
.sb-profile-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-profile .app-user-name { font-size: 0.78rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-profile-role { font-size: 0.66rem; color: var(--text3); }
.sb-profile .app-user-logout { flex-shrink: 0; background: transparent; border: none; color: var(--text3); font-size: 0.9rem; cursor: pointer; line-height: 1; }
.sb-profile .app-user-logout:hover { color: #f87171; }
/* ── App main ── */
.app-main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1rem;
  gap: 1rem;
}



/* ════════════════════════════════════
   STAGE PANELS
════════════════════════════════════ */
.stage-panel { display: none; flex-direction: column; gap: 1rem; }
.stage-panel.is-active { display: flex; }

/* Stage header */
.stage-hdr {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.5rem;
}
.stage-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.35;
  line-height: 1;
  flex-shrink: 0;
}
.stage-title { font-size: 1.15rem; color: var(--text); margin-bottom: 0.2rem; }
.stage-desc { font-size: 0.83rem; color: var(--text2); }

/* Landing hero panel */
.stage-hero-panel {
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.stage-hero-panel::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,212,191,0.12), transparent 70%);
  pointer-events: none;
}
.shp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.shp-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease infinite;
}
.shp-title { font-size: clamp(1.4rem, 2.5vw, 1.9rem); color: #fff; line-height: 1.2; margin-bottom: 0.85rem; }
.shp-sub { font-size: 0.9rem; max-width: 580px; margin-bottom: 1.75rem; }
.shp-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}
.shp-stage {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  font-size: 0.78rem;
  color: var(--text2);
}
.shps-n {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* Cards */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg2);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}
.card-title { font-size: 0.88rem; font-weight: 600; color: var(--text); font-family: var(--font-display); }
.card-sub { font-size: 0.75rem; color: var(--text2); }
.card-body { padding: 1rem; }
.card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  flex-wrap: wrap;
}
.card-sec-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
  opacity: 0.7;
  margin-bottom: 0.75rem;
}

/* Approval gates */
.gate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.gate-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.gate-card:hover { border-color: var(--border-hi); }
.gate-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.2);
  color: #86efac;
  display: grid;
  place-items: center;
  margin-bottom: 0.25rem;
}
.gate-name { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.gate-sub { font-size: 0.78rem; color: var(--text2); margin-bottom: 0.5rem; flex: 1; }

/* Btn row */
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Fields */
.fld-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 0.35rem;
}
.fld-hint { color: var(--text2); opacity: 0.6; font-weight: 400; }
.fld-input, .fld-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  color-scheme: dark;
  transition: border-color 0.15s, box-shadow 0.15s;
}
[data-theme="light"] .fld-input,
[data-theme="light"] .fld-textarea {
  color-scheme: light;
}
.fld-input option,
.fld-input optgroup {
  background: #0f1115;
  color: #e2e2e2;
}
[data-theme="light"] .fld-input option,
[data-theme="light"] .fld-input optgroup {
  background: #ffffff;
  color: #0f172a;
}
.fld-input:focus, .fld-textarea:focus {
  outline: none;
  border-color: rgba(45,212,191,0.5);
  box-shadow: 0 0 0 3px rgba(45,212,191,0.1);
}
.fld-textarea { resize: vertical; }
.fld-mono { font-family: "JetBrains Mono", monospace; font-size: 0.8rem; }
.fld-grid { display: grid; gap: 0.75rem; }
.fld-grid.two { grid-template-columns: 1fr 1fr; }
.fld-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.fld-group { display: flex; flex-direction: column; }
.fld-group.span2 { grid-column: span 2; }
.mt-fld { margin-top: 0.75rem; }

/* JSON badge */
.json-badge {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  width: fit-content;
  border: 1px solid var(--border-hi);
  color: var(--text2);
  background: rgba(255,255,255,0.03);
}
.json-badge.valid { border-color: rgba(34,197,94,0.4); color: #86efac; }
.json-badge.invalid { border-color: rgba(239,68,68,0.4); color: #f87171; }

/* Observability grid */
.obs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Code outputs */
.code-out {
  margin: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.9);
  color: #7dd3fc;
  min-height: 80px;
  max-height: 240px;
  overflow: auto;
  padding: 0.85rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.6;
}
.code-out-tall { min-height: 260px; max-height: 480px; }
.code-out-exec { min-height: 380px; max-height: calc(100vh - 320px); flex: 1; }

/* Shared small-button size and live dot */
.btn-sm { padding: 0.28rem 0.7rem; font-size: 0.76rem; }
.fld-textarea--exec { min-height: 160px; resize: vertical; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; transition: background 0.3s; }
.live-dot--idle         { background: var(--border-hi); }
.live-dot--connecting   { background: #fbbf24; animation: pulse-dot 1s infinite; }
.live-dot--connected    { background: #34d399; animation: pulse-dot 2s infinite; }
.live-dot--reconnecting { background: #f87171; animation: pulse-dot 0.6s infinite; }
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:0.35; } }

/* ── Execution stage layout ── */

#stage-execution {
  gap: 0.7rem;
  min-height: 0;
}

.exec-context-card {
  min-height: 0;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.exec-context-card .card-header {
  padding: 0.65rem 0.8rem;
}

.exec-brief-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 0.6rem;
  flex: 1;
  min-height: 0;
}

/* Mission control header */
.exec-mission-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  background: rgba(255,255,255,0.025);
  flex-wrap: wrap; gap: 0.6rem;
  margin-bottom: 0;
}
.exec-mission-left  { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.exec-mission-meta  { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.exec-mission-item  { display: flex; align-items: center; gap: 0.35rem; }
.exec-mission-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text3); }
.exec-mission-val   { font-size: 0.78rem; color: var(--text); font-weight: 500; }
.exec-mission-sep   { color: var(--border-hi); font-size: 0.9rem; }
.exec-mission-actions { display: flex; align-items: center; gap: 0.45rem; margin-left: auto; }

/* Phase indicator */
.exec-phase-indicator { display: flex; align-items: center; gap: 0.45rem; }
.exec-phase-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.exec-phase-dot--idle       { background: var(--border-hi); }
.exec-phase-dot--running    { background: #fbbf24; animation: pulse-dot 1s infinite; }
.exec-phase-dot--thinking   { background: #818cf8; animation: pulse-dot 0.8s infinite; }
.exec-phase-dot--coding     { background: #34d399; animation: pulse-dot 1.2s infinite; }
.exec-phase-dot--reviewing  { background: #f59e0b; animation: pulse-dot 1s infinite; }
.exec-phase-dot--qa         { background: #60a5fa; animation: pulse-dot 1s infinite; }
.exec-phase-dot--done       { background: #34d399; }
.exec-phase-dot--error      { background: #f87171; }
.exec-phase-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }

/* ── Agent Pipeline ── */
.exec-agent-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.015);
  margin: 0;
}

.exec-agent-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  color: var(--text2);
}

.exec-agent-summary::-webkit-details-marker { display: none; }
.exec-agent-summary-hint { font-size: 0.68rem; color: var(--text3); }

.exec-agent-panel[open] .exec-agent-summary {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.agent-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0;
  padding: 0.6rem;
}

.agent-card {
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  padding: 0.55rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: border-color 0.25s, background 0.25s;
}
.agent-card.agent--active {
  border-color: rgba(129,140,248,0.6);
  background: rgba(129,140,248,0.06);
  box-shadow: 0 0 16px rgba(129,140,248,0.12);
}
.agent-card.agent--done   { border-color: rgba(52,211,153,0.4); background: rgba(52,211,153,0.04); }
.agent-card.agent--error  { border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.04); }

.agent-card-header { display: flex; align-items: flex-start; gap: 0.5rem; }
.agent-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1; margin-top: 0.1rem; }
.agent-info { flex: 1; }
.agent-name { font-size: 0.74rem; font-weight: 600; color: var(--text); }
.agent-role { display: none; }
.agent-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 0.25rem;
  transition: background 0.3s;
}
.agent-dot--waiting  { background: var(--border-hi); }
.agent-dot--active   { background: #818cf8; animation: pulse-dot 0.9s infinite; }
.agent-dot--done     { background: #34d399; }
.agent-dot--error    { background: #f87171; }

.agent-activity {
  font-size: 0.66rem; color: var(--text2); line-height: 1.4;
  font-family: "JetBrains Mono", monospace;
  min-height: 1.3em;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; line-clamp: 1; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.agent--active .agent-activity { color: #c4b5fd; }
.agent--done   .agent-activity { color: #6ee7b7; }

.agent-progress-bar {
  height: 3px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden; margin-top: 0.15rem;
}
.agent-progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #818cf8, #34d399);
  transition: width 0.6s ease;
}
.agent--done .agent-progress-fill { width: 100% !important; background: #34d399; }

.agent-connector {
  display: none;
}
.agent-connector-line  { width: 24px; height: 2px; background: var(--border); }
.agent-connector-arrow { font-size: 0.55rem; color: var(--text3); margin-top: -2px; }

/* Body */
.exec-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
}

.exec-runtime-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0.6rem;
  min-height: 320px;
  height: calc(100vh - 520px);
}

.exec-workbench {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  overflow: hidden;
}

.exec-workbench-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.exec-wb-tab {
  border: none;
  border-right: 1px solid rgba(255,255,255,0.04);
  background: transparent;
  color: var(--text2);
  padding: 0.62rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.exec-wb-tab:last-child {
  border-right: none;
}

.exec-wb-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.exec-wb-tab.is-active {
  color: var(--accent);
  background: rgba(45,212,191,0.08);
}

.exec-workbench-panels {
  flex: 1;
  min-height: 0;
}

.exec-wb-panel {
  display: none;
  height: 100%;
  min-height: 0;
}

.exec-wb-panel.is-active {
  display: block;
}

.exec-iteration-body,
.exec-preview-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.68rem 0.85rem 0.75rem;
}

.exec-iteration-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.exec-iteration-pill {
  font-size: 0.64rem;
  color: #86efac;
  border: 1px solid rgba(34,197,94,0.28);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
}

.exec-iteration-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
}

.exec-field-wide {
  grid-column: span 1;
}

.exec-iteration-textarea {
  min-height: 74px;
  max-height: 140px;
  resize: vertical;
}

.exec-iteration-note,
.exec-preview-summary {
  font-size: 0.68rem;
  color: var(--text3);
  line-height: 1.45;
  padding: 0.1rem 0.2rem;
  border-left: 2px solid rgba(45,212,191,0.35);
}

.exec-iteration-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.05rem;
}

.exec-preview-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  border: none;
  border-radius: 0;
  background: transparent;
}

.exec-preview-body {
  flex: 1;
  min-height: 0;
}

.exec-preview-list,
.exec-preview-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 110px;
  overflow-y: auto;
}

.exec-preview-frame-wrap {
  position: relative;
  border: 1px solid rgba(45,212,191,0.2);
  border-radius: var(--radius-sm);
  background: rgba(5,10,12,0.9);
  min-height: 250px;
  flex: 1;
  overflow: hidden;
}

.exec-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
  background: #fff;
}

.exec-preview-empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  font-size: 0.74rem;
  color: var(--text3);
  line-height: 1.5;
}

.exec-preview-live-link {
  font-size: 0.72rem;
  color: #6ee7b7;
  font-family: "JetBrains Mono", monospace;
  text-decoration: none;
  word-break: break-all;
}

.exec-kpi-value[data-status="completed"] { color: #6ee7b7; }
.exec-kpi-value[data-status="failed"],
.exec-kpi-value[data-status="cancelled"] { color: #fca5a5; }
.exec-kpi-value[data-status="implementation_running"],
.exec-kpi-value[data-status="qa_validation"],
.exec-kpi-value[data-status="deploying"] { color: #fcd34d; }

.exec-preview-service {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  background: rgba(255,255,255,0.02);
}

.exec-preview-service.is-live { border-color: rgba(34,197,94,0.24); background: rgba(34,197,94,0.04); }
.exec-preview-service.is-configured { border-color: rgba(96,165,250,0.24); background: rgba(96,165,250,0.04); }

.exec-preview-service-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.exec-preview-service-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.exec-preview-service-pill {
  font-size: 0.66rem;
  color: var(--text2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}

.exec-preview-service-meta,
.exec-preview-service-empty,
.exec-preview-empty {
  margin-top: 0.28rem;
  font-size: 0.7rem;
  color: var(--text3);
}

.exec-preview-service-link,
.exec-preview-link {
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.exec-preview-link {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  background: rgba(255,255,255,0.02);
}

/* Objective/mission brief */
.exec-obj-preview {
  padding: 0.35rem 0.65rem;
  font-size: 0.74rem; color: var(--text2); line-height: 1.55;
  overflow: auto;
  flex: 1;
  min-height: 0;
  white-space: pre-wrap; word-break: break-word;
}

.exec-instruction-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.exec-instruction {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.3rem 0.35rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.exec-instruction-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.26rem;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.24);
}

.exec-instruction-text {
  color: var(--text2);
  font-size: 0.72rem;
  line-height: 1.45;
}

.exec-instruction--active {
  border-color: rgba(59,130,246,0.38);
  background: rgba(59,130,246,0.12);
}

.exec-instruction--active .exec-instruction-dot {
  background: #60a5fa;
  border-color: rgba(147,197,253,0.9);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.24);
}

.exec-instruction--done {
  border-color: rgba(34,197,94,0.26);
  background: rgba(34,197,94,0.11);
}

.exec-instruction--done .exec-instruction-dot {
  background: #22c55e;
  border-color: rgba(134,239,172,0.9);
}

.exec-instruction--done .exec-instruction-text {
  color: #bbf7d0;
}

.exec-brief-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0 0.65rem;
}

.exec-brief-chip {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  padding: 0.25rem 0.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.3rem;
}

.exec-brief-chip-label {
  font-size: 0.62rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.exec-brief-chip-val {
  font-size: 0.7rem;
  color: var(--text2);
  font-family: "JetBrains Mono", monospace;
}

/* Stats card */
.exec-stats-body { display: flex; flex-direction: column; gap: 0.5rem; }
.exec-stat { display: flex; justify-content: space-between; align-items: center; font-size: 0.76rem; }
.exec-stat-label { color: var(--text3); }
.exec-stat-val   { font-weight: 600; color: var(--text); text-align: right; }

/* Terminal column */
.exec-terminal-col {
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #000;
  height: 100%;
  min-height: 0;
}
.exec-terminal-bar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.exec-terminal-dots { display: flex; gap: 0.35rem; }
.etd { width: 11px; height: 11px; border-radius: 50%; }
.etd--red    { background: #f87171; }
.etd--yellow { background: #fbbf24; }
.etd--green  { background: #34d399; }
.exec-terminal-title { flex: 1; font-size: 0.72rem; color: var(--text3); font-family: "JetBrains Mono", monospace; }
.exec-terminal-actions { display: flex; align-items: center; gap: 0.4rem; }
.exec-terminal-filter {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.exec-terminal-body { flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; }

/* Welcome placeholder */
.exec-welcome {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; gap: 0.5rem; padding: 2rem; color: var(--text3);
}
.exec-welcome-icon  { font-size: 2.5rem; }
.exec-welcome-title { font-size: 0.95rem; font-weight: 600; color: var(--text2); }
.exec-welcome-sub   { font-size: 0.76rem; text-align: center; line-height: 1.6; }

/* Stream pre */
.exec-stream {
  flex: 1; margin: 0; border: none; border-radius: 0; background: transparent;
  padding: 0.75rem 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem; line-height: 1.7;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 0;
  word-break: break-word;
}
.tl-line {
  display: flex; align-items: baseline; gap: 0.5rem;
  padding: 0.08rem 0;
  white-space: pre-wrap; word-break: break-word;
  border-bottom: 1px solid rgba(255,255,255,0.025);
}
.tl-line:last-child { border-bottom: none; }
.tl-ts     { color: #333; font-size: 0.65rem; flex-shrink: 0; user-select: none; min-width: 52px; }
.tl-prefix { flex-shrink: 0; opacity: 0.7; user-select: none; min-width: 1.2rem; }
.tl-msg    { flex: 1; }
.tl-badge {
  flex-shrink: 0;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  line-height: 1.35;
  border: 1px solid transparent;
}
.tl-badge--control {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
}

/* Reference docs badge */
.exec-ref-docs { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.65rem 0.9rem; border-radius: var(--radius-sm); border: 1px solid rgba(45,212,191,0.25); background: rgba(45,212,191,0.05); font-size: 0.78rem; }
.exec-ref-icon  { font-size: 1.1rem; flex-shrink: 0; }
.exec-ref-title { font-weight: 600; color: var(--accent); margin-bottom: 0.2rem; }
.exec-ref-paths { color: var(--text2); font-family: "JetBrains Mono", monospace; font-size: 0.68rem; line-height: 1.6; }

/* Log filters */
.log-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.log-filter {
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  background: rgba(255,255,255,0.04);
  color: var(--text2);
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
}
.log-filter.active { border-color: rgba(45,212,191,0.45); color: var(--accent); background: var(--accent-dim); }

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 200;
  display: grid;
  gap: 0.4rem;
  width: min(340px, calc(100vw - 2rem));
}
.toast {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: rgba(8,8,8,0.98);
  color: var(--text);
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  box-shadow: var(--shadow);
  animation: toast-in 0.16s ease;
}
.toast.success { border-color: rgba(45,212,191,0.5); }
.toast.error { border-color: rgba(239,68,68,0.6); }
.toast.info { border-color: rgba(59,130,246,0.5); }
@keyframes toast-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* ════════════════════════════════════
   INTAKE — CONVERSATIONAL AI
════════════════════════════════════ */

/* Project meta bar */
.intake-meta-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.intake-reset-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.78rem;
  align-self: flex-end;
}

.intake-journey-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.72rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(45,212,191,0.18);
  background:
    radial-gradient(circle at top right, rgba(59,130,246,0.08), transparent 38%),
    linear-gradient(180deg, rgba(45,212,191,0.05), rgba(255,255,255,0.02)),
    var(--surface);
}

.intake-journey-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.intake-journey-sub {
  margin: 0.18rem 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text2);
  max-width: 980px;
}

.intake-journey-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.intake-journey-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.68rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}

.intake-journey-step.is-active {
  border-color: rgba(59,130,246,0.4);
  background: rgba(59,130,246,0.1);
}

.intake-journey-step.is-done {
  border-color: rgba(45,212,191,0.34);
  background: rgba(45,212,191,0.1);
}

.intake-journey-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text2);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.intake-journey-step.is-active .intake-journey-step-num,
.intake-journey-step.is-done .intake-journey-step-num {
  color: var(--accent);
  background: rgba(45,212,191,0.14);
  border-color: rgba(45,212,191,0.25);
}

.intake-journey-step-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.intake-journey-step-copy {
  margin-top: 0.1rem;
  font-size: 0.71rem;
  line-height: 1.4;
  color: var(--text2);
}

.intake-seed-card {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(59,130,246,0.18);
  background:
    linear-gradient(180deg, rgba(59,130,246,0.06), rgba(45,212,191,0.04)),
    var(--surface);
}

.intake-seed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.intake-seed-kicker {
  display: inline-flex;
  margin-bottom: 0.5rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(59,130,246,0.24);
  background: rgba(59,130,246,0.08);
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.intake-seed-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.intake-seed-sub {
  margin: 0.18rem 0 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text2);
  max-width: 900px;
}

.intake-seed-textarea {
  min-height: 88px;
}

.intake-template-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.intake-template-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text2);
}

.intake-template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.intake-template-chip {
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(59,130,246,0.24);
  background: rgba(59,130,246,0.08);
  color: #bfdbfe;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.15s;
}

.intake-template-chip:hover {
  border-color: rgba(59,130,246,0.42);
  background: rgba(59,130,246,0.14);
  color: #dbeafe;
}

.intake-dropzone {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(45,212,191,0.26);
  background: rgba(45,212,191,0.05);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.intake-dropzone:hover,
.intake-dropzone.is-dragover {
  border-color: rgba(45,212,191,0.52);
  background: rgba(45,212,191,0.1);
  transform: translateY(-1px);
}

.intake-dropzone:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45,212,191,0.12);
}

.intake-dropzone-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid rgba(45,212,191,0.22);
  background: rgba(45,212,191,0.12);
}

.intake-dropzone-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.intake-dropzone-sub {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--text2);
}

.intake-seed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.intake-seed-hint {
  font-size: 0.76rem;
  color: var(--text2);
}

.intake-seed-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.intake-seed-summary {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}

.intake-seed-summary.is-empty {
  border-style: dashed;
}

.intake-seed-summary.is-ready {
  border-color: rgba(45,212,191,0.28);
  background: rgba(45,212,191,0.06);
}

.intake-next-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.72rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
}

.intake-next-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.intake-next-sub {
  font-size: 0.73rem;
  line-height: 1.45;
  color: var(--text2);
}

.intake-next-list {
  display: grid;
  gap: 0.5rem;
}

.intake-next-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.42rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}

.intake-next-item.is-active {
  border-color: rgba(59,130,246,0.28);
  background: rgba(59,130,246,0.08);
}

.intake-next-item.is-done {
  border-color: rgba(45,212,191,0.28);
  background: rgba(45,212,191,0.08);
}

.intake-next-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text2);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
}

.intake-next-item.is-active .intake-next-icon,
.intake-next-item.is-done .intake-next-icon {
  color: var(--accent);
  border-color: rgba(45,212,191,0.22);
  background: rgba(45,212,191,0.12);
}

.intake-next-item-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.intake-next-item-copy {
  margin-top: 0.08rem;
  font-size: 0.7rem;
  line-height: 1.38;
  color: var(--text2);
}

.intake-seed-summary-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.intake-seed-summary-copy {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text2);
}

.intake-seed-summary-preview {
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.16);
  font-size: 0.76rem;
  line-height: 1.65;
  color: var(--text2);
  white-space: pre-wrap;
}

.intake-seed-summary-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.intake-seed-summary-file {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(45,212,191,0.2);
  background: rgba(45,212,191,0.08);
  color: var(--text2);
  font-size: 0.72rem;
}

.intake-attachment-shell {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 1rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
}

.intake-attachment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.intake-attachment-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.intake-attachment-sub {
  margin-top: 0.2rem;
  font-size: 0.74rem;
  color: var(--text2);
}

.intake-attachment-count {
  flex-shrink: 0;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text2);
  font-size: 0.7rem;
}

/* Chat card */
.chat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  min-height: 420px;
}

.chat-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.68rem 0.85rem 0.62rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.chat-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.chat-card-sub {
  margin: 0.2rem 0 0;
  font-size: 0.73rem;
  line-height: 1.42;
  color: var(--text2);
  max-width: 760px;
}

.chat-card-tip {
  flex-shrink: 0;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(45,212,191,0.2);
  background: rgba(45,212,191,0.08);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
}

/* Chat window scrollable area */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

/* Message bubbles */
.chat-msg {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  max-width: 82%;
  animation: msg-in 0.2s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
}
.chat-msg.ai .chat-msg-avatar {
  background: linear-gradient(135deg, rgba(45,212,191,0.3), rgba(59,130,246,0.3));
  border: 1px solid rgba(45,212,191,0.35);
  color: var(--accent);
}
.chat-msg.user .chat-msg-avatar {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-hi);
  color: var(--text2);
}

.chat-bubble {
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: 100%;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg.ai .chat-bubble {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
  color: var(--text);
}
.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, rgba(45,212,191,0.18), rgba(59,130,246,0.18));
  border: 1px solid rgba(45,212,191,0.28);
  border-top-right-radius: 4px;
  color: var(--text);
}

/* Chip choices inside AI bubble */
.chat-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.chat-choice-chip {
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(45,212,191,0.3);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.chat-choice-chip:hover {
  background: rgba(45,212,191,0.28);
  border-color: var(--accent);
}

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem 0;
}
.typing-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(45,212,191,0.3), rgba(59,130,246,0.3));
  border: 1px solid rgba(45,212,191,0.35);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  border-top-left-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}
.typing-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text2);
  animation: dot-pulse 1.2s ease infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
  0%,80%,100% { opacity: 0.25; transform: scale(0.85); }
  40%          { opacity: 1;    transform: scale(1); }
}

/* Requirement summary */
.chat-summary {
  margin: 0 1rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45,212,191,0.25);
  background: rgba(45,212,191,0.06);
  overflow: hidden;
}
.cs-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid rgba(45,212,191,0.15);
  background: rgba(45,212,191,0.08);
}
.cs-text {
  margin: 0;
  padding: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text2);
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
}

/* Chat input bar */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.chat-input-help {
  padding: 0 1rem 0.85rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text2);
}
.chat-attach-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: rgba(255,255,255,0.04);
  color: var(--text2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.15s;
}
.chat-attach-btn:hover {
  color: var(--text);
  border-color: rgba(45,212,191,0.4);
  background: rgba(45,212,191,0.12);
}
.chat-input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  resize: none;
  line-height: 1.5;
  min-height: 38px;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input:focus {
  outline: none;
  border-color: rgba(45,212,191,0.45);
  box-shadow: 0 0 0 3px rgba(45,212,191,0.08);
}
.chat-send-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45,212,191,0.4);
  background: linear-gradient(135deg, rgba(45,212,191,0.2), rgba(59,130,246,0.2));
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.15s;
}
.chat-send-btn:hover { background: linear-gradient(135deg, rgba(45,212,191,0.32), rgba(59,130,246,0.32)); border-color: var(--accent); }
.chat-send-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1rem 0.85rem;
}
.chat-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(45,212,191,0.28);
  background: rgba(45,212,191,0.08);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.28rem 0.2rem 0.6rem;
  max-width: 100%;
}
.chat-attachment-name {
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.chat-attachment-remove {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.22);
  color: var(--text2);
  font-size: 0.68rem;
  line-height: 1;
  padding: 0;
  display: grid;
  place-items: center;
}
.chat-attachment-remove:hover {
  color: #fca5a5;
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.15);
}

/* Intake action bar */
.intake-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
}
.intake-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text2);
}
.intake-status.ready {
  color: var(--accent);
}
.intake-actions { display: flex; gap: 0.5rem; }

/* Disabled primary btn */
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ════════════════════════════════════
   PRD GENERATING SCREEN
════════════════════════════════════ */
.prd-generating {
  border-radius: var(--radius);
  border: 1px solid rgba(45,212,191,0.2);
  background: var(--surface);
  padding: 2.5rem 1.5rem;
  display: flex;
  justify-content: center;
}
.prd-gen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
}
.prd-gen-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(45,212,191,0.15), rgba(59,130,246,0.15));
  border: 1px solid rgba(45,212,191,0.3);
  color: var(--accent);
  display: grid;
  place-items: center;
  animation: gen-icon-pulse 2s ease infinite;
}
@keyframes gen-icon-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(45,212,191,0.3); }
  50%      { box-shadow: 0 0 0 10px rgba(45,212,191,0); }
}
.prd-gen-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.25rem;
}
.prd-gen-sub {
  font-size: 0.82rem;
  color: var(--text2);
  min-height: 1.2em;
  transition: opacity 0.3s;
}
.prd-gen-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
  margin: 0.5rem 0 0.25rem;
}
.prd-gen-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.prd-steps {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.5rem;
}
.prd-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--text3);
  transition: color 0.25s;
  padding: 0.2rem 0;
}
.prd-step.active { color: var(--accent); }
.prd-step.done   { color: var(--text2); }
.step-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-hi);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: all 0.25s;
  position: relative;
}
.prd-step.active .step-icon {
  border-color: var(--accent);
  background: var(--accent-dim);
  animation: step-pulse 1s ease infinite;
}
.prd-step.done .step-icon {
  border-color: var(--accent);
  background: var(--accent);
}
.prd-step.done .step-icon::after {
  content: "";
  display: block;
  width: 5px; height: 8px;
  border: 2px solid #0d1117;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}
@keyframes step-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(45,212,191,0.45); }
  50%      { box-shadow: 0 0 0 5px rgba(45,212,191,0); }
}

/* ════════════════════════════════════
   PRD DOCUMENT SHELL
════════════════════════════════════ */
.prd-doc-shell {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  animation: msg-in 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Toolbar */
.prd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  gap: 1rem;
  flex-wrap: wrap;
}
.prd-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.prd-doc-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(45,212,191,0.25), rgba(59,130,246,0.25));
  border: 1px solid rgba(45,212,191,0.35);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
}
.prd-toolbar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.prd-status-pill {
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.3);
  color: #fbbf24;
}
.prd-toolbar-right { display: flex; align-items: center; gap: 0.5rem; }
.ptb-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: rgba(255,255,255,0.04);
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.ptb-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); border-color: var(--text3); }
.ptb-btn--primary {
  background: linear-gradient(135deg, rgba(45,212,191,0.2), rgba(59,130,246,0.2));
  border-color: rgba(45,212,191,0.45);
  color: var(--accent);
}
.ptb-btn--primary:hover {
  background: linear-gradient(135deg, rgba(45,212,191,0.32), rgba(59,130,246,0.32));
  border-color: var(--accent);
  color: #fff;
}

/* Document layout */
.prd-doc-layout {
  display: grid;
  grid-template-columns: 190px 1fr;
  min-height: 480px;
  overflow: hidden;
}

/* TOC sidebar */
.prd-toc {
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(255,255,255,0.01);
  overflow-y: auto;
}
.prd-toc-label {
  padding: 0 1rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
}
.prd-toc-nav {
  display: flex;
  flex-direction: column;
}
.prd-toc-item {
  display: block;
  padding: 0.42rem 1rem;
  font-size: 0.78rem;
  color: var(--text2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prd-toc-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.prd-toc-item.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); }
.prd-toc-meta {
  margin-top: auto;
  padding: 1rem 1rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.prd-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text3);
}
.prd-meta-val {
  font-size: 0.72rem;
  color: var(--text2);
  font-weight: 500;
}
.prd-meta-val.draft {
  color: #fbbf24;
}

/* Document content area */
.prd-doc-content {
  overflow-y: auto;
  padding: 0;
  max-height: 560px;
}

/* Document sections */
.pdoc-section {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.5rem 1.5rem 0;
  transition: background 0.15s;
}
.pdoc-section:last-child { border-bottom: none; }
.pdoc-section:hover { background: rgba(255,255,255,0.015); }
.pdoc-sec-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text3);
  padding-top: 0.2rem;
  text-align: center;
  letter-spacing: 0.05em;
}
.pdoc-sec-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.pdoc-sec-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.1rem;
  letter-spacing: -0.01em;
}
.pdoc-hint {
  font-size: 0.75rem;
  color: var(--text3);
  margin: 0;
  line-height: 1.5;
}
.pdoc-subfield {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.pdoc-subtitle {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
}
.pdoc-field {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.75;
}
.pdoc-field.pdoc-list ul {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.pdoc-field.pdoc-list li { color: var(--text); }
.pdoc-field.pdoc-list li::marker { color: var(--accent); }
.pdoc-edit {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45,212,191,0.35);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.7;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pdoc-edit:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,212,191,0.08);
}
.pdoc-section--raw .pdoc-sec-title { color: var(--text2); }
.pdoc-raw {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.73rem;
  color: var(--text2);
  white-space: pre-wrap;
  line-height: 1.7;
  max-height: 220px;
  overflow-y: auto;
}

/* ════════════════════════════════════
   DOCUMENT TABS
════════════════════════════════════ */
.doc-tab-bar {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  margin-bottom: 1rem;
}
.doc-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  bottom: -1px;
}
.doc-tab:hover:not(:disabled) { color: var(--text); background: rgba(255,255,255,0.04); }
.doc-tab.is-active {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  color: var(--accent);
}
.doc-tab:disabled { opacity: 0.4; cursor: not-allowed; }
.doc-tab-badge {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(45,212,191,0.18);
  border: 1px solid rgba(45,212,191,0.3);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.doc-tab-panel { display: flex; flex-direction: column; }

/* Pending state */
.doc-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  gap: 0.75rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border-hi);
  background: rgba(255,255,255,0.01);
  text-align: center;
}
.doc-pending-icon { color: var(--text3); opacity: 0.5; }
.doc-pending-title { font-size: 0.95rem; font-weight: 700; color: var(--text2); }
.doc-pending-desc { font-size: 0.82rem; color: var(--text3); max-width: 320px; line-height: 1.6; margin: 0; }

/* Plan phases */
.plan-phases { display: flex; flex-direction: column; gap: 0.75rem; }
.plan-phase {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
.plan-phase-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.plan-phase-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(59,130,246,0.25));
  border: 1px solid rgba(139,92,246,0.35);
  color: #a78bfa;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.plan-phase-name { font-size: 0.85rem; font-weight: 600; color: var(--text); flex: 1; }
.plan-phase-days {
  font-size: 0.72rem;
  color: var(--text3);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.plan-phase-tasks {
  padding: 0.5rem 0.9rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.plan-phase-task {
  font-size: 0.8rem;
  color: var(--text2);
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  line-height: 1.5;
}
.plan-phase-task::before {
  content: "→";
  color: #a78bfa;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.stack-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.3);
  color: #a78bfa;
  margin: 0.2rem 0.2rem 0 0;
}

/* ════════════════════════════════════
   APPROVAL PIPELINE
════════════════════════════════════ */
.ap-pipeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.ap-card {
  flex: 1;
  border-radius: var(--radius);
  border: 1px solid rgba(45,212,191,0.3);
  background: var(--surface);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.2s;
  min-width: 0;
}
.ap-card--locked {
  border-color: var(--border);
  opacity: 0.6;
  transition: opacity 0.3s, border-color 0.3s;
}
.ap-card--locked.is-active { opacity: 1; border-color: rgba(45,212,191,0.3); }
.ap-card--done { border-color: rgba(45,212,191,0.5); opacity: 1; }
.ap-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ap-card-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.05em;
}
.ap-card-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(45,212,191,0.08);
  border: 1px solid rgba(45,212,191,0.2);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ap-card--locked .ap-card-icon { background: rgba(255,255,255,0.03); border-color: var(--border); color: var(--text3); }
.ap-pill {
  margin-left: auto;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ap-pill--active  { background: rgba(45,212,191,0.12); border: 1px solid rgba(45,212,191,0.3); color: var(--accent); }
.ap-pill--pending { background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text3); }
.ap-pill--done    { background: rgba(45,212,191,0.18); border: 1px solid rgba(45,212,191,0.4); color: var(--accent); }
.ap-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.ap-card-desc {
  font-size: 0.78rem;
  color: var(--text2);
  line-height: 1.6;
  margin: 0;
}
.ap-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.ap-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0.5rem 0;
  flex-shrink: 0;
  color: var(--text3);
}
.ap-conn-line {
  width: 1px;
  height: 0;
  flex: 1;
}
.ptb-btn--execute {
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(59,130,246,0.2));
  border-color: rgba(139,92,246,0.4);
  color: #a78bfa;
}
.ptb-btn--execute:not(:disabled):hover {
  background: linear-gradient(135deg, rgba(139,92,246,0.35), rgba(59,130,246,0.35));
  border-color: #a78bfa;
  color: #fff;
}
.ap-mini-progress { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.5rem 0; }
.ap-mini-label { font-size: 0.75rem; color: var(--accent); }
.ap-exec-objective {
  font-size: 0.75rem;
  color: var(--text2);
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  line-height: 1.55;
  max-height: 80px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: "JetBrains Mono", monospace;
}

/* ════════════════════════════════════
   OBSERVABILITY grid
════════════════════════════════════ */
/* ════════════════════════════════════
   PROJECTS PAGE
════════════════════════════════════ */
.projects-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 2rem; gap: 0.6rem; text-align: center;
  border-radius: var(--radius); border: 1px dashed var(--border-hi);
  background: rgba(255,255,255,0.01);
}
.projects-empty-icon  { font-size: 2.2rem; }
.projects-empty-title { font-size: 0.95rem; font-weight: 700; color: var(--text2); }
.projects-empty-sub   { font-size: 0.82rem; color: var(--text3); max-width: 300px; line-height: 1.6; }

.projects-list { display: flex; flex-direction: column; gap: 0.6rem; }

.proj-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg2);
  overflow: hidden;
  transition: border-color 0.2s;
}
.proj-card:hover { border-color: var(--border-hi); }
.proj-card--active {
  border-color: rgba(45,212,191,0.45) !important;
  background: rgba(45,212,191,0.04);
}
.proj-card--active .proj-name { color: var(--accent); }

/* Open / New Run buttons — hide by default, show on hover */
.proj-open-btn, .proj-newrun-btn {
  opacity: 0;
  transition: opacity 0.15s;
}
.proj-card--active .proj-open-btn { display: none; } /* already active */
.proj-card-head:hover .proj-open-btn,
.proj-card-head:hover .proj-newrun-btn { opacity: 1; }

.proj-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1rem;
  cursor: pointer;
  gap: 0.75rem;
  user-select: none;
}
.proj-card-head:hover { background: rgba(255,255,255,0.025); }
.proj-card-left  { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.proj-card-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

.proj-icon { font-size: 1.4rem; flex-shrink: 0; }
.proj-info { min-width: 0; }
.proj-name { font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-meta { font-size: 0.72rem; color: var(--text3); display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.1rem; }
.proj-id   { font-family: "JetBrains Mono", monospace; color: var(--text3); }
.proj-sep  { color: var(--border-hi); }

.proj-status-pill {
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem; font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}
.proj-chevron { font-size: 0.65rem; color: var(--text3); }

/* Runs list inside a project card */
.proj-runs {
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
  padding: 0.5rem 0;
}
.proj-runs-loading, .proj-no-runs {
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: var(--text3);
}

.proj-run-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 1rem;
  gap: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.035);
  transition: background 0.15s;
}
.proj-run-row:last-child { border-bottom: none; }
.proj-run-row:hover { background: rgba(255,255,255,0.02); }

.proj-run-left  { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.proj-run-right { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }

.proj-run-id   { font-family: "JetBrains Mono", monospace; font-size: 0.7rem; color: var(--text3); }
.proj-run-title { font-size: 0.8rem; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 500px; }
.proj-run-req  { font-size: 0.8rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 500px; }
.proj-run-meta { font-size: 0.7rem; color: var(--text3); }
.proj-run-status { font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.proj-delete-btn {
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}
.proj-card-head:hover .proj-delete-btn { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   OUTPUT STAGE
═══════════════════════════════════════════════════════════ */
.out-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(16,16,20,0.9), rgba(20,20,28,0.9));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.out-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.out-hero-left { display: flex; align-items: center; gap: 1.2rem; }
.out-hero-icon { font-size: 2.4rem; line-height: 1; filter: drop-shadow(0 0 12px rgba(99,102,241,0.5)); }
.out-hero-name { font-size: 1.35rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin-bottom: 0.35rem; }
.out-hero-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; }
.out-meta-sep  { color: var(--text3); }
.out-run-status {
  font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.55rem;
  border-radius: 99px; background: rgba(52,211,153,0.12); color: #34d399;
  border: 1px solid rgba(52,211,153,0.25);
}
.out-run-status[data-status="failed"] { background: rgba(248,113,113,0.12); color: #f87171; border-color: rgba(248,113,113,0.25); }
.out-run-status[data-status="running"] { background: rgba(96,165,250,0.12); color: #60a5fa; border-color: rgba(96,165,250,0.25); }
.out-run-id    { font-family: "JetBrains Mono", monospace; font-size: 0.7rem; color: var(--text3); }
.out-file-count { color: var(--text3); font-size: 0.75rem; }
.out-hero-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* Section labels */
.out-section-label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text3);
  margin-bottom: 0.85rem; margin-top: 2rem;
}
.out-section-label--row { display: flex; align-items: center; justify-content: space-between; }
.btn-xs {
  font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border); color: var(--text2);
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.btn-xs:hover { border-color: rgba(255,255,255,0.18); color: var(--text); }

/* Links grid */
.out-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.out-link-card {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  cursor: pointer;
}
.out-link-card:hover {
  border-color: rgba(99,102,241,0.45);
  background: rgba(99,102,241,0.06);
  transform: translateY(-1px);
}
.out-link-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.2));
  border: 1px solid rgba(99,102,241,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.out-link-body { flex: 1; min-width: 0; }
.out-link-label { font-size: 0.8rem; font-weight: 600; color: var(--text); margin-bottom: 0.15rem; }
.out-link-url   { font-size: 0.7rem; color: #818cf8; font-family: "JetBrains Mono", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.out-link-arrow { color: var(--text3); font-size: 0.8rem; flex-shrink: 0; }

/* Services grid */
.out-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.out-svc-card {
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.out-svc-card:hover { border-color: rgba(255,255,255,0.12); }
.out-svc-header { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.5rem; }
.out-svc-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 5px rgba(52,211,153,0.6); flex-shrink: 0; }
.out-svc-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.out-svc-url  { font-size: 0.7rem; color: #818cf8; font-family: "JetBrains Mono", monospace; margin-top: 0.2rem; }
.out-svc-url a { color: inherit; text-decoration: none; }
.out-svc-url a:hover { text-decoration: underline; }
.out-svc-no-url { font-size: 0.7rem; color: var(--text3); font-style: italic; }
.out-svc-badge {
  font-size: 0.64rem; font-weight: 600; padding: 0.1rem 0.45rem;
  border-radius: 99px; background: rgba(99,102,241,0.15); color: #818cf8;
  border: 1px solid rgba(99,102,241,0.25); margin-left: auto;
}
.out-svc-ver {
  font-size: 0.65rem; color: var(--text3); font-family: "JetBrains Mono", monospace;
}

/* Files tree */
.out-files-tree {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text2);
  max-height: 420px;
  overflow-y: auto;
}
.out-tree-dir {
  margin-bottom: 0.1rem;
}
.out-tree-dir-label {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--text); font-weight: 600; cursor: pointer;
  padding: 0.15rem 0;
  user-select: none;
}
.out-tree-dir-label:hover { color: #818cf8; }
.out-tree-dir-arrow { font-size: 0.6rem; transition: transform 0.15s; color: var(--text3); display: inline-block; }
.out-tree-dir.is-open > .out-tree-dir-label .out-tree-dir-arrow { transform: rotate(90deg); }
.out-tree-children { padding-left: 1.2rem; border-left: 1px solid rgba(255,255,255,0.06); margin-left: 0.3rem; display: none; }
.out-tree-dir.is-open > .out-tree-children { display: block; }
.out-tree-file {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.1rem 0; color: var(--text2);
}
.out-tree-file-name { color: var(--text2); }
.out-tree-file-size { color: var(--text3); font-size: 0.68rem; margin-left: auto; }

/* ── Cost Analysis ── */
.out-cost-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) { .out-cost-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .out-cost-grid { grid-template-columns: 1fr; } }

.out-cost-card {
  padding: 1.1rem 1.2rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.out-cost-card:hover { border-color: rgba(255,255,255,0.1); }
.out-cost-card--total {
  background: linear-gradient(135deg, rgba(16,18,28,0.95), rgba(20,22,34,0.95));
  border-color: rgba(99,102,241,0.3);
}
.out-cost-card--total:hover { border-color: rgba(99,102,241,0.5); }

.out-cost-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 0.5rem;
}
.out-cost-value {
  font-size: 1.6rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.03em; line-height: 1; margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.out-cost-card--total .out-cost-value { color: #a78bfa; }
.out-cost-value--sm { font-size: 1.25rem; }
.out-cost-sub { font-size: 0.72rem; color: var(--text3); }

/* Per-run breakdown */
.out-cost-breakdown { margin-top: 0.5rem; }
.out-cb-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 0.5rem;
}
.out-cb-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.3rem 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.out-cb-row:last-child { border-bottom: none; }
.out-cb-row--current { background: rgba(99,102,241,0.04); border-radius: var(--radius-sm); padding-left: 0.5rem; padding-right: 0.5rem; }
.out-cb-id    { font-family: "JetBrains Mono", monospace; font-size: 0.75rem; color: var(--text2); display: flex; align-items: center; gap: 0.4rem; }
.out-cb-badge { font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 99px; background: rgba(99,102,241,0.2); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }
.out-cb-tokens { font-size: 0.75rem; color: var(--text2); text-align: right; }
.out-cb-cost   { font-size: 0.8rem; font-weight: 600; color: #a78bfa; text-align: right; font-variant-numeric: tabular-nums; }
.out-cb-bar    { grid-column: 1 / -1; height: 3px; background: rgba(255,255,255,0.05); border-radius: 99px; overflow: hidden; }
.out-cb-fill   { height: 100%; background: linear-gradient(90deg, #6366f1, #a78bfa); border-radius: 99px; transition: width 0.6s ease; }

@media (max-width: 780px) {
  .intake-meta-bar { flex-direction: column; align-items: stretch; }
  .intake-journey-steps { grid-template-columns: 1fr; }
  .intake-template-row { flex-direction: column; align-items: stretch; }
  .intake-dropzone { align-items: flex-start; }
  .intake-attachment-head { flex-direction: column; align-items: stretch; }
  .intake-seed-actions { flex-direction: column; align-items: stretch; }
  .intake-seed-btns { width: 100%; }
  .intake-seed-btns > * { flex: 1; }
  .chat-card-head { flex-direction: column; align-items: stretch; }
  .gate-grid { grid-template-columns: 1fr; }
  .obs-grid { grid-template-columns: 1fr; }
  #stage-execution { min-height: 0; }
  .exec-runtime-grid { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .exec-brief-meta { grid-template-columns: 1fr; }
  .exec-agent-summary-hint { display: none; }
  .agent-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exec-body { height: auto; min-height: 0; }
  .exec-workbench { min-height: 0; }
  .exec-iteration-grid { grid-template-columns: 1fr; }
  .exec-terminal-col { height: 420px; min-height: 420px; }
  .exec-iteration-card .card-header { flex-wrap: wrap; }
  .fld-grid.two, .fld-grid.three { grid-template-columns: 1fr; }
  .fld-group.span2 { grid-column: span 1; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .app-bar-chips { display: none; }
  .topnav-links { display: none; }
  .hero-h1 { font-size: 2rem; }
}

/* ════════════════════════════════════
   NEW PROJECT MODAL
════════════════════════════════════ */
.npm-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: npm-bg-in 0.18s ease;
}
@keyframes npm-bg-in { from { opacity:0 } to { opacity:1 } }

.npm-card {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  width: 100%; max-width: 520px;
  animation: npm-card-in 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes npm-card-in { from { opacity:0; transform:scale(0.94) translateY(12px) } to { opacity:1; transform:scale(1) translateY(0) } }

.npm-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.npm-header-left { display: flex; align-items: flex-start; gap: 0.85rem; }
.npm-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(45,212,191,0.1); border: 1px solid rgba(45,212,191,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0;
}
.npm-title    { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
.npm-subtitle { font-size: 0.78rem; color: var(--text2); margin: 0.2rem 0 0; }
.npm-close {
  background: none; border: none; cursor: pointer;
  color: var(--text3); padding: 0.25rem; border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.npm-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.npm-body   { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.npm-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.npm-field  { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.npm-row    { display: flex; gap: 1rem; }
.npm-label  { font-size: 0.78rem; font-weight: 600; color: var(--text2); }
.npm-required { color: var(--accent); }
.npm-optional { font-weight: 400; color: var(--text3); }
.npm-hint   { font-size: 0.72rem; color: var(--text3); }

.npm-input, .npm-textarea, .npm-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  padding: 0.55rem 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%; box-sizing: border-box;
}
.npm-input:focus, .npm-textarea:focus, .npm-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(45,212,191,0.12);
}
.npm-input[readonly] { color: var(--text3); cursor: default; }
.npm-textarea { resize: vertical; min-height: 72px; }
.npm-select { cursor: pointer; }
.npm-select option { background: #111; }

.npm-error {
  font-size: 0.8rem; color: #f87171;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

/* ════════════════════════════════════
   PROJECT DETAIL DRAWER
════════════════════════════════════ */
.pdd-overlay {
  position: fixed; inset: 0; z-index: 390;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  animation: pdd-fade-in 0.2s ease;
}
@keyframes pdd-fade-in { from { opacity:0 } to { opacity:1 } }

.pdd-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 400;
  width: min(560px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border-hi);
  box-shadow: -16px 0 48px rgba(0,0,0,0.55);
  display: flex; flex-direction: column;
  animation: pdd-slide-in 0.24s cubic-bezier(0.25,0.46,0.45,0.94);
  overflow: hidden;
}
@keyframes pdd-slide-in { from { transform:translateX(100%) } to { transform:translateX(0) } }

.pdd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem; flex-shrink: 0;
}
.pdd-header-left  { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.pdd-header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.pdd-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: rgba(45,212,191,0.1); border: 1px solid rgba(45,212,191,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0;
}
.pdd-title    { font-size: 0.95rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.pdd-subtitle { font-size: 0.73rem; color: var(--text3); margin-top: 0.1rem; }
.pdd-close {
  background: none; border: none; cursor: pointer;
  color: var(--text3); padding: 0.3rem; border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.pdd-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }

/* Tabs */
.pdd-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  padding: 0 0.75rem; gap: 0; flex-shrink: 0;
  overflow-x: auto; scrollbar-width: none;
}
.pdd-tabs::-webkit-scrollbar { display: none; }
.pdd-tab {
  background: none; border: none; cursor: pointer;
  font-size: 0.78rem; font-weight: 500; color: var(--text3);
  padding: 0.65rem 0.85rem; border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s; white-space: nowrap;
}
.pdd-tab:hover    { color: var(--text2); }
.pdd-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* Body / panels */
.pdd-body { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.pdd-panel { display: none; padding: 1rem 1.25rem; }
.pdd-panel.is-active { display: block; }

.pdd-section { margin-bottom: 1.5rem; }
.pdd-section-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text3); margin-bottom: 0.7rem;
}
.pdd-loading { font-size: 0.82rem; color: var(--text3); padding: 1.5rem 0; text-align: center; }
.pdd-empty-msg { font-size: 0.82rem; color: var(--text3); padding: 1rem 0; }

/* KPI grid */
.pdd-kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin-bottom: 0.25rem; }
.pdd-kpi {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.pdd-kpi-val { font-size: 1.35rem; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }
.pdd-kpi-lbl { font-size: 0.72rem; color: var(--text3); }

/* Info grid */
.pdd-info-grid { display: flex; flex-direction: column; gap: 0; }
.pdd-info-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0.45rem 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 1rem;
}
.pdd-info-row:last-child { border-bottom: none; }
.pdd-info-lbl { font-size: 0.75rem; color: var(--text3); flex-shrink: 0; }
.pdd-info-val { font-size: 0.82rem; color: var(--text); text-align: right; word-break: break-all; }
.pdd-mono     { font-family: "JetBrains Mono", monospace; font-size: 0.75rem; }

/* Services */
.pdd-service-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--border);
  margin-bottom: 0.4rem;
}
.pdd-svc-dot  { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); flex-shrink: 0; }
.pdd-svc-dot.is-live { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.pdd-svc-name { font-size: 0.82rem; font-weight: 600; color: var(--text); flex: 1; }
.pdd-svc-status { font-size: 0.7rem; font-weight: 600; color: var(--text3); }
.pdd-svc-link { font-size: 0.74rem; font-weight: 600; color: var(--pg-violet-2); white-space: nowrap; }
.pdd-svc-link:hover { color: var(--text); }
.pdd-svc-type { font-size: 0.72rem; color: var(--text3); }
.pdd-svc-url  { font-size: 0.72rem; color: var(--accent); font-family: "JetBrains Mono", monospace; }

/* Runs list */
.pdd-runs-list { display: flex; flex-direction: column; gap: 0; padding: 0.75rem 0; }
.pdd-run-row {
  padding: 0.75rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.pdd-run-row:last-child { border-bottom: none; }
.pdd-run-row--current { background: var(--pg-soft); border-radius: 8px; padding-left: 0.6rem; padding-right: 0.6rem; }
.pdd-versions-note { font-size: 0.72rem; color: var(--text3); line-height: 1.5; padding: 0 0 0.7rem; margin-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
.pdd-run-left  { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.pdd-run-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.pdd-run-id    { font-family: "JetBrains Mono", monospace; font-size: 0.7rem; color: var(--text3); }
.pdd-run-title { font-size: 0.82rem; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.pdd-run-req   { font-size: 0.8rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.pdd-run-ago   { font-size: 0.7rem; color: var(--text3); }
.pdd-run-status{ font-size: 0.72rem; font-weight: 600; }

/* Docs */
.pdd-doc-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.85rem; }
.pdd-doc-tab {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.78rem; font-weight: 500;
  color: var(--text3); padding: 0.35rem 0.75rem; cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.pdd-doc-tab:hover    { color: var(--text); border-color: var(--border-hi); }
.pdd-doc-tab.is-active { color: var(--accent); border-color: var(--accent); background: rgba(45,212,191,0.06); }
.pdd-doc-body {
  font-size: 0.82rem; color: var(--text2); line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem;
  max-height: 520px; overflow-y: auto;
}
/* Rendered markdown */
.md-doc { white-space: normal; word-break: normal; color: var(--text2); }
.md-doc .md-h { font-family: var(--font-display); color: var(--text); font-weight: 700; margin: 1rem 0 0.45rem; line-height: 1.3; }
.md-doc h3.md-h { font-size: 1rem; } .md-doc h4.md-h { font-size: 0.9rem; } .md-doc h5.md-h, .md-doc h6.md-h { font-size: 0.82rem; color: var(--text2); }
.md-doc .md-h:first-child { margin-top: 0; }
.md-doc .md-p { margin: 0.5rem 0; }
.md-doc .md-list { margin: 0.5rem 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.25rem; }
.md-doc .md-list li { line-height: 1.55; }
.md-doc .md-quote { margin: 0.6rem 0; padding: 0.4rem 0.8rem; border-left: 3px solid var(--pg-border); background: var(--pg-soft); color: var(--text2); border-radius: 0 6px 6px 0; }
.md-doc code { font-family: "JetBrains Mono", monospace; font-size: 0.92em; background: rgba(255,255,255,0.06); padding: 0.05rem 0.32rem; border-radius: 4px; color: var(--pg-violet-2); }
.md-doc .md-code { margin: 0.7rem 0; padding: 0.8rem; background: #0d0d12; border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; }
.md-doc .md-code code { background: none; padding: 0; color: var(--text); font-size: 0.78rem; line-height: 1.55; }
.md-doc hr { border: 0; border-top: 1px solid var(--border); margin: 0.9rem 0; }
.md-doc strong { color: var(--text); font-weight: 700; }

/* File tree */
.pdd-tree { font-family: "JetBrains Mono", monospace; font-size: 0.75rem; line-height: 1.8; color: var(--text2); }
.pdd-tree-dir  { color: var(--accent); }
.pdd-tree-file { color: var(--text3); }
.pdd-tree-indent { padding-left: 1.25rem; }

/* Cost per-run table */
.pdd-cost-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.pdd-cost-table th {
  text-align: left; padding: 0.35rem 0.5rem;
  font-size: 0.7rem; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.pdd-cost-table td {
  padding: 0.45rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text2); font-family: "JetBrains Mono", monospace;
}
.pdd-cost-table tr:last-child td { border-bottom: none; }

/* ════════════════════════════════════
   LIVE THINKING STRIP
════════════════════════════════════ */
.think-strip {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  background: rgba(45,212,191,0.05);
  border-top: 1px solid rgba(45,212,191,0.15);
  border-bottom: 1px solid rgba(45,212,191,0.10);
  font-size: 0.78rem; line-height: 1.5;
  min-height: 2.5rem; flex-shrink: 0;
}
.think-badge {
  background: rgba(45,212,191,0.12); color: var(--accent);
  border: 1px solid rgba(45,212,191,0.25); border-radius: 9999px;
  padding: 0.1rem 0.55rem; font-size: 0.7rem; font-weight: 600;
  white-space: nowrap; flex-shrink: 0; margin-top: 0.05rem;
}
.think-text {
  color: #c8f3ef; flex: 1; word-break: break-word;
  font-family: "JetBrains Mono", monospace; font-size: 0.76rem;
  white-space: pre-wrap; max-height: 6rem; overflow: hidden;
}
.think-cursor {
  color: var(--accent); animation: blink 1s step-end infinite; flex-shrink: 0;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* Make model lines in timeline wrap nicely */
.tl-line.tl-model { white-space: pre-wrap; word-break: break-word; }

/* ════════════════════════════════════
   DEPLOY STAGE
════════════════════════════════════ */
.deploy-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 860px) {
  .deploy-grid { grid-template-columns: 1fr; }
  .deploy-cred-template-row { grid-template-columns: 1fr; }
  .deploy-cred-main { grid-template-columns: 1fr; }
}

.deploy-left  { display: flex; flex-direction: column; gap: 1rem; }
.deploy-right { display: flex; flex-direction: column; gap: 0.85rem; }

.deploy-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
}
.deploy-section-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text3); margin-bottom: 0.7rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.deploy-badge {
  background: rgba(45,212,191,0.12); color: var(--accent);
  border: 1px solid rgba(45,212,191,0.2); border-radius: 9999px;
  font-size: 0.68rem; font-weight: 600; padding: 0.1rem 0.55rem;
}

/* File tree */
.deploy-tree { font-family: "JetBrains Mono", monospace; font-size: 0.74rem; line-height: 1.9; }
.deploy-tree-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
}
.deploy-tree-row:hover { background: rgba(255,255,255,0.04); }
.deploy-tree-row--selected { background: rgba(45,212,191,0.14); }
.deploy-tree-icon { flex-shrink: 0; }
.deploy-tree-dir  { color: var(--accent); }
.deploy-tree-file { color: var(--text3); }
.deploy-tree-size { color: var(--text3); font-size: 0.68rem; margin-left: auto; opacity: 0.6; }

.deploy-preview-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.deploy-preview-empty {
  color: var(--text3);
  font-size: 0.78rem;
  padding: 0.4rem 0;
}

.deploy-preview-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.deploy-preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text2);
  padding: 0.42rem 0.58rem;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.deploy-preview-item:hover {
  border-color: rgba(45,212,191,0.35);
  background: rgba(45,212,191,0.08);
}

.deploy-preview-item-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text);
}

.deploy-preview-item-meta {
  font-size: 0.68rem;
  color: var(--text3);
  font-family: "JetBrains Mono", monospace;
}

.deploy-preview-note {
  margin-bottom: 0.35rem;
  color: var(--text3);
  font-size: 0.72rem;
}

.deploy-preview-code {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f0f0f;
  color: var(--text2);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.71rem;
  line-height: 1.55;
  padding: 0.72rem;
  max-height: 360px;
  overflow: auto;
  white-space: pre;
}
[data-theme="light"] .deploy-preview-code {
  background: #f8fafc;
}

/* Control bar */
.deploy-control-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem 1rem; gap: 0.75rem;
}
.deploy-status-group { display: flex; align-items: center; gap: 0.5rem; }
.deploy-status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); flex-shrink: 0;
}
.deploy-status-dot--running {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251,191,36,0.2);
  animation: pulse-ring 1.5s ease infinite;
}
.deploy-status-dot--done  { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
.deploy-status-dot--error { background: #ef4444; }
@keyframes pulse-ring { 0%,100%{opacity:1} 50%{opacity:0.5} }
.deploy-status-label { font-size: 0.82rem; color: var(--text2); }
.deploy-control-actions { display: flex; align-items: center; gap: 0.5rem; }

.deploy-port-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  border: 1px solid rgba(59,130,246,0.24);
  background: rgba(59,130,246,0.1);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.deploy-port-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #93c5fd;
  font-weight: 700;
}

.deploy-port-value {
  font-family: "JetBrains Mono", monospace;
  color: #dbeafe;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(147,197,253,0.35);
  background: rgba(15,23,42,0.4);
  border-radius: 6px;
  padding: 0.08rem 0.45rem;
}

.deploy-port-url {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--text2);
}

.deploy-flow {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.deploy-flow-steps {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.deploy-flow-step {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  padding: 0.16rem 0.52rem;
  color: var(--text3);
  background: rgba(255,255,255,0.03);
}

.deploy-flow-step[data-state="running"] {
  color: #fbbf24;
  border-color: rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.12);
}

.deploy-flow-step[data-state="done"] {
  color: #22c55e;
  border-color: rgba(34,197,94,0.42);
  background: rgba(34,197,94,0.14);
}

.deploy-flow-step[data-state="error"] {
  color: #f87171;
  border-color: rgba(248,113,113,0.45);
  background: rgba(248,113,113,0.14);
}

.deploy-flow-note {
  font-size: 0.73rem;
  color: var(--text2);
}

.deploy-qa {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.deploy-qa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.deploy-qa-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  font-weight: 700;
}

.deploy-qa-summary {
  font-size: 0.73rem;
  color: var(--text2);
}

.deploy-qa-cards {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 240px;
  overflow: auto;
  padding-right: 0.1rem;
}

.deploy-qa-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  padding: 0.52rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.deploy-qa-card[data-state="pass"] {
  border-color: rgba(34,197,94,0.38);
  background: rgba(34,197,94,0.08);
}

.deploy-qa-card[data-state="fail"] {
  border-color: rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.1);
}

.deploy-qa-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.deploy-qa-card-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text);
}

.deploy-qa-card-pill {
  font-size: 0.64rem;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  border: 1px solid var(--border-hi);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.deploy-qa-card[data-state="pass"] .deploy-qa-card-pill {
  color: #22c55e;
  border-color: rgba(34,197,94,0.45);
  background: rgba(34,197,94,0.12);
}

.deploy-qa-card[data-state="fail"] .deploy-qa-card-pill {
  color: #f87171;
  border-color: rgba(248,113,113,0.45);
  background: rgba(248,113,113,0.14);
}

.deploy-qa-card-copy {
  font-size: 0.71rem;
  color: var(--text2);
  white-space: pre-wrap;
}

.deploy-qa-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.deploy-qa-select {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text2);
}

/* Options */
.deploy-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.8rem 1rem;
}
.deploy-opt-group { display: flex; flex-direction: column; gap: 0.3rem; }
.deploy-opt-label { font-size: 0.72rem; color: var(--text3); font-weight: 600; }
.deploy-opt-group--full { grid-column: 1 / -1; }

.deploy-cred-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.deploy-cred-template-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.45rem;
}

.deploy-cred-hint {
  font-size: 0.72rem;
  color: var(--text3);
}

.deploy-cred-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 260px;
  overflow: auto;
  padding-right: 0.1rem;
}

.deploy-cred-empty {
  color: var(--text3);
  font-size: 0.76rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.deploy-cred-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.deploy-cred-main {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) 1fr;
  gap: 0.45rem;
}

.deploy-cred-key {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
}

.deploy-cred-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
}

.deploy-bug-textarea {
  min-height: 92px;
  resize: vertical;
}

.deploy-bug-actions {
  display: flex;
  justify-content: flex-end;
}

.deploy-cred-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  color: var(--text3);
  font-size: 0.68rem;
}

.deploy-cred-badge {
  border: 1px solid rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.16);
  color: #fbbf24;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Deploy terminal */
.deploy-terminal {
  background: #0c0c0c; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  height: calc(100vh - 390px);
  min-height: 360px;
}
[data-theme="light"] .deploy-terminal {
  background: #f8fafc;
}
.deploy-terminal-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.85rem; background: #161616; border-bottom: 1px solid var(--border);
}
[data-theme="light"] .deploy-terminal-bar {
  background: #eaf0fa;
}
.deploy-terminal-title {
  flex: 1; font-size: 0.75rem; color: var(--text3); font-family: "JetBrains Mono", monospace;
}

/* ════════════════════════════════════
   MONITORING STAGE
════════════════════════════════════ */
/* ── Monitoring — project-gallery / execution identity ── */
.mon-content { display: flex; flex-direction: column; gap: 1.3rem; }
.mon-headrow { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.mon-headrow-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text); }

.mon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.1rem;
  align-items: start;
}
.mon-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  transition: border-color 0.2s, transform 0.2s;
}
.mon-card:hover { border-color: var(--pg-border); transform: translateY(-2px); }
.mon-card--error { border-color: rgba(239,68,68,0.28); background: rgba(239,68,68,0.05); }

.mon-card-head { display: flex; align-items: center; gap: 0.7rem; }
.mon-card-monogram {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 11px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 0.92rem; color: #fff;
  background: linear-gradient(135deg, hsl(var(--pg-h, 260) 70% 58%), hsl(calc(var(--pg-h, 260) + 40) 68% 46%));
}
.mon-card-id { flex: 1; min-width: 0; }
.mon-card-name { font-size: 0.98rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-card-sub { font-size: 0.72rem; color: var(--text3); font-family: "JetBrains Mono", monospace; margin-top: 0.1rem; }
.mon-card-status { padding: 0.2rem 0.6rem; border-radius: 999px; border: 1px solid; font-size: 0.66rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; }

.mon-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.mon-stat { border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.02); padding: 0.55rem 0.65rem; display: flex; flex-direction: column; gap: 0.1rem; }
.mon-stat-val { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--text); }
.mon-stat-lbl { font-size: 0.63rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }

.mon-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.mon-card-actions { display: flex; gap: 0.5rem; margin-top: auto; }
.mon-act-btn { flex: 1; padding: 0.5rem 0.7rem; border-radius: 9px; font-size: 0.76rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border-hi); background: rgba(255,255,255,0.03); color: var(--text2); transition: all 0.15s; }
.mon-act-btn:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.mon-act-btn--primary { border: 1px solid rgba(139,92,246,0.6); background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; }
.mon-act-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(99,102,241,0.35); }

.mon-service-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.mon-service-row {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.mon-service-row.is-live { border-color: rgba(34,197,94,0.24); background: rgba(34,197,94,0.04); }
.mon-service-row.is-configured { border-color: rgba(251,191,36,0.24); background: rgba(251,191,36,0.04); }
.mon-service-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.mon-service-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
}
.mon-service-row.is-live .mon-service-dot { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.mon-service-row.is-configured .mon-service-dot { background: #fbbf24; }
.mon-service-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.mon-service-pill {
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 0.64rem;
  font-weight: 700;
}
.mon-service-row.is-live .mon-service-pill { color: #86efac; border-color: rgba(34,197,94,0.26); background: rgba(34,197,94,0.12); }
.mon-service-row.is-configured .mon-service-pill { color: #fcd34d; border-color: rgba(251,191,36,0.26); background: rgba(251,191,36,0.1); }
.mon-service-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.68rem;
  color: var(--text3);
}
.mon-service-meta span {
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}
.mon-service-link-row {
  min-height: 1.15rem;
}
.mon-service-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.mon-service-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.mon-service-link {
  font-size: 0.72rem;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
}
.mon-service-note {
  font-size: 0.7rem;
  color: var(--text3);
}
.mon-service-empty,
.mon-card-error {
  font-size: 0.78rem;
  color: var(--text3);
  line-height: 1.6;
}

@media (max-width: 720px) {
  .mon-card-stats { grid-template-columns: 1fr; }
  .mon-grid { grid-template-columns: 1fr; }
}

/* ── Resources page ── */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; margin-top: 1.2rem; align-items: start; }
.res-card { display: flex; flex-direction: column; gap: 0.8rem; padding: 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.02); transition: border-color 0.2s, transform 0.2s; }
.res-card:hover { border-color: var(--pg-border); transform: translateY(-2px); }
.res-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.res-card-name { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.res-card-type { font-size: 0.72rem; color: var(--text3); margin-top: 0.12rem; }
.res-badge { padding: 0.18rem 0.55rem; border-radius: 999px; font-size: 0.64rem; font-weight: 700; border: 1px solid; white-space: nowrap; flex-shrink: 0; }
.res-badge.is-available { color: #86efac; border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.12); }
.res-badge.is-unavailable { color: var(--text3); border-color: var(--border-hi); background: rgba(255,255,255,0.03); }
.res-card-keys { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.res-key-chip { padding: 0.16rem 0.5rem; border-radius: 6px; font-size: 0.68rem; font-family: "JetBrains Mono", monospace; color: var(--pg-violet-2); background: var(--pg-soft); border: 1px solid var(--pg-border); }
.res-card-nokeys { font-size: 0.72rem; color: var(--text3); }
.res-card-actions { display: flex; gap: 0.5rem; margin-top: auto; }
.res-del:hover { color: #f87171; }

/* Resource card analytics */
.res-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.res-stat { border-radius: 9px; border: 1px solid var(--border); background: rgba(255,255,255,0.02); padding: 0.5rem 0.55rem; display: flex; flex-direction: column; gap: 0.08rem; }
.res-stat-val { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--text); }
.res-stat-lbl { font-size: 0.6rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }
.res-card-usedby { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; min-height: 1.1rem; }
.res-usedby-lbl { font-size: 0.66rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; }
.res-usedby-chip { padding: 0.14rem 0.5rem; border-radius: 999px; font-size: 0.68rem; color: var(--text2); background: rgba(255,255,255,0.04); border: 1px solid var(--border-hi); }
.res-usedby-more { color: var(--pg-violet-2); border-color: var(--pg-border); background: var(--pg-soft); }
.res-usedby-none { font-size: 0.68rem; color: var(--text3); }

/* Resource modal extras */
.npm-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text2); cursor: pointer; }
.npm-check input { width: 16px; height: 16px; accent-color: var(--pg-violet); }
.res-addkey { align-self: flex-start; margin-top: 0.55rem; }
.res-keys { display: flex; flex-direction: column; gap: 0.45rem; }
.res-key-row { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 0.5rem; align-items: center; }
.res-key-rm { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-hi); background: transparent; color: var(--text3); font-size: 1.1rem; cursor: pointer; line-height: 1; }
.res-key-rm:hover { color: #f87171; border-color: rgba(239,68,68,0.4); }
.res-key-val-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.res-key-val-wrap .res-key-val { width: 100%; padding-right: 2.2rem; min-width: 0; box-sizing: border-box; }
.res-key-eye { position: absolute; right: 0.45rem; background: none; border: none; cursor: pointer; color: var(--text3); padding: 0; display: none; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0; }
.res-key-eye:hover { color: var(--text1); }

@media (max-width: 720px) {
  .res-grid { grid-template-columns: 1fr; }
}

/* ── Users & Roles (access control) ── */
.acc-tabs { display: inline-flex; gap: 0.25rem; margin: 1.2rem 0 1.1rem; padding: 0.25rem; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,0.02); }
.acc-tab { padding: 0.45rem 1rem; border: 0; border-radius: 8px; background: transparent; color: var(--text2); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.acc-tab:hover { color: var(--text); }
.acc-tab.is-active { background: var(--pg-soft); color: var(--pg-violet-2); border: 1px solid var(--pg-border); }
.acc-panel { display: none; }
.acc-panel.is-active { display: block; }

.acc-users { display: flex; flex-direction: column; gap: 0.6rem; }
.acc-user-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,0.02); }
.acc-user-row:hover { border-color: var(--pg-border); }
.acc-user-av { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 0.82rem; color: #fff; background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.acc-user-meta { flex: 1; min-width: 0; }
.acc-user-name { font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-user-email { font-size: 0.74rem; color: var(--text3); font-family: "JetBrains Mono", monospace; }
.acc-user-role { width: auto; min-width: 150px; flex-shrink: 0; }
.acc-user-rm { flex-shrink: 0; padding: 0.4rem 0.7rem; border-radius: 8px; border: 1px solid var(--border-hi); background: transparent; color: var(--text3); font-size: 0.76rem; font-weight: 600; cursor: pointer; }
.acc-user-rm:hover { color: #f87171; border-color: rgba(239,68,68,0.4); }

.acc-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1.1rem; align-items: start; }
.acc-role-card { display: flex; flex-direction: column; gap: 0.8rem; padding: 1.1rem; border: 1px solid var(--border); border-radius: 15px; background: rgba(255,255,255,0.02); }
.acc-role-card:hover { border-color: var(--pg-border); }
.acc-role-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.acc-role-name { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text); }
.acc-role-desc { font-size: 0.74rem; color: var(--text3); margin-top: 0.12rem; }
.acc-role-badge { padding: 0.18rem 0.55rem; border-radius: 999px; font-size: 0.62rem; font-weight: 700; color: var(--pg-violet-2); background: var(--pg-soft); border: 1px solid var(--pg-border); white-space: nowrap; flex-shrink: 0; }
.acc-role-del { padding: 0.25rem 0.6rem; border-radius: 7px; border: 1px solid var(--border-hi); background: transparent; color: var(--text3); font-size: 0.72rem; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.acc-role-del:hover { color: #f87171; border-color: rgba(239,68,68,0.4); }
.acc-role-meta { font-size: 0.72rem; color: var(--text3); padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
.acc-privs { display: flex; flex-direction: column; gap: 0.15rem; }
.acc-priv { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.2rem; cursor: pointer; }
.acc-priv-body { display: flex; flex-direction: column; gap: 0.08rem; flex: 1; min-width: 0; }
.acc-priv-label { font-size: 0.8rem; font-weight: 500; color: var(--text); }
.acc-priv-desc { font-size: 0.68rem; color: var(--text3); }
.acc-priv-toggle { appearance: none; -webkit-appearance: none; width: 38px; height: 21px; border-radius: 999px; background: var(--border-hi); position: relative; cursor: pointer; flex-shrink: 0; transition: background 0.18s; }
.acc-priv-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform 0.18s; }
.acc-priv-toggle:checked { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.acc-priv-toggle:checked::after { transform: translateX(17px); }
.acc-priv-toggle:disabled { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 720px) {
  .acc-roles { grid-template-columns: 1fr; }
  .acc-user-row { flex-wrap: wrap; }
}

/* ════════════════════════════════════
   EXECUTION IDE WORKSPACE (bolt-style)
════════════════════════════════════ */
.ide-stage.is-active {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  gap: 0.7rem;
  flex: 1;
  min-height: 0;
  height: calc(100vh - var(--app-bar-h) - 2rem);
  padding: 0;
}
.ide-stage[data-ide-tab="preview"] { grid-template-columns: 320px minmax(0, 1fr); }
.ide-stage[data-ide-tab="preview"] .ide-rightpreview { display: none; }
.ide-chat, .ide-main, .ide-rightpreview {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg2);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ide-legacy { display: none !important; }

/* Left: chat / mission control */
.ide-chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; padding: 0.85rem 0.9rem; border-bottom: 1px solid var(--border); }
.ide-chat-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; color: var(--text); }
.ide-chat-sub { font-size: 0.74rem; color: var(--text3); margin-top: 0.15rem; }
.ide-icon-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border-hi); background: transparent; color: var(--text2); cursor: pointer; flex-shrink: 0; }
.ide-icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.ide-brief { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--border); background: linear-gradient(160deg, var(--pg-soft), transparent); }
.ide-brief-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.65rem; font-family: var(--font-display); font-size: 0.8rem; font-weight: 700; color: var(--text); }
.ide-brief-dot { width: 9px; height: 9px; border-radius: 50%; background: #6b7280; box-shadow: 0 0 8px currentColor; }
.ide-steps { display: flex; flex-direction: column; gap: 0.45rem; }
.ide-step { display: flex; align-items: center; gap: 0.55rem; font-size: 0.76rem; color: var(--text3); }
.ide-step-ic { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-hi); flex-shrink: 0; position: relative; transition: all 0.2s; }
.ide-step.is-done { color: var(--text2); }
.ide-step.is-done .ide-step-ic { background: var(--pg-violet); border-color: var(--pg-violet); }
.ide-step.is-done .ide-step-ic::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.6rem; color: #fff; }
.ide-step.is-active { color: var(--pg-violet-2); font-weight: 600; }
.ide-step.is-active .ide-step-ic { border-color: var(--pg-violet); box-shadow: 0 0 0 3px var(--pg-soft); }

.ide-chat-slot { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
/* the moved chat-card fills the slot */
.ide-chat-slot .chat-card { flex: 1; min-height: 0; border: 0; border-radius: 0; background: transparent; display: flex; flex-direction: column; }
.ide-chat-slot .chat-card-head { display: none; }
.ide-chat-slot .chat-window { flex: 1; min-height: 0; overflow-y: auto; }
.ide-chat-slot .chat-input-help { display: none; }

.ide-actions { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem 0.9rem; border-top: 1px solid var(--border); }
.ide-action { padding: 0.6rem 0.9rem; border-radius: 9px; border: 1px solid var(--pg-border); background: var(--pg-soft); color: var(--pg-violet-2); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.ide-action--primary { border: 1px solid rgba(139,92,246,0.6); background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; }
.ide-action--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(99,102,241,0.35); }
.ide-action:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.ide-action-note { font-size: 0.76rem; color: var(--text3); text-align: center; padding: 0.3rem; }

/* Center: editor zone */
.ide-topbar { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); }
.ide-tabs { display: flex; gap: 0.2rem; }
.ide-tab { padding: 0.4rem 0.85rem; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text2); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.ide-tab:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.ide-tab.is-active { color: var(--pg-violet-2); background: var(--pg-soft); border-color: var(--pg-border); }
.ide-crumb { flex: 1; display: flex; align-items: center; gap: 0.5rem; justify-content: center; min-width: 0; }
.ide-crumb-name { font-size: 0.82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-private { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); border: 1px solid var(--border-hi); border-radius: 999px; padding: 0.1rem 0.45rem; }
.ide-topbar-actions { display: flex; align-items: center; gap: 0.4rem; }
.ide-btn-ghost { padding: 0.4rem 0.7rem; border-radius: 8px; border: 1px solid var(--border-hi); background: transparent; color: var(--text2); font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.ide-btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.ide-btn-primary { padding: 0.4rem 0.9rem; border-radius: 8px; border: 1px solid rgba(139,92,246,0.6); background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.ide-btn-primary:hover { transform: translateY(-1px); }

.ide-body { flex: 1; min-height: 0; display: flex; }
.ide-view { display: none; flex: 1; min-width: 0; min-height: 0; }
.ide-view.is-active { display: flex; }
.ide-view[data-ide="code"].is-active { flex-direction: row; }
.ide-view[data-ide="preview"].is-active,
.ide-view[data-ide="changes"].is-active { flex-direction: column; }

.ide-filetree { width: 200px; flex-shrink: 0; border-right: 1px solid var(--border); overflow-y: auto; padding: 0.4rem; display: flex; flex-direction: column; gap: 1px; }
/* File/folder tree */
.ide-tree-dir, .ide-tree-children { display: flex; flex-direction: column; gap: 1px; }
.ide-tree-row { display: flex; align-items: center; gap: 0.35rem; width: 100%; text-align: left; padding: 0.3rem 0.45rem; border-radius: 6px; border: none; background: transparent; color: var(--text2); font-family: "JetBrains Mono", monospace; font-size: 0.71rem; cursor: pointer; white-space: nowrap; overflow: hidden; }
.ide-tree-row:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.ide-tree-file.is-active { background: var(--pg-soft); color: var(--pg-violet-2); }
.ide-tree-arrow { width: 0.7rem; flex-shrink: 0; font-size: 0.58rem; color: var(--text3); text-align: center; }
.ide-tree-dirrow { color: var(--text); font-weight: 500; }
.ide-tree-ic { flex-shrink: 0; font-size: 0.72rem; line-height: 1; }
.ide-tree-name { overflow: hidden; text-overflow: ellipsis; }
.ide-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ide-editor-bar { padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--border); font-family: "JetBrains Mono", monospace; font-size: 0.73rem; color: var(--text2); background: rgba(0,0,0,0.2); }
.ide-editor-body { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 0.85rem 1rem; font-family: "JetBrains Mono", monospace; font-size: 0.76rem; line-height: 1.6; color: var(--text); white-space: pre; }
/* highlight.js fills the editor; keep its own theme background + our padding */
.ide-editor-body code.hljs { display: block; padding: 0; background: transparent; font: inherit; }
/* line-number gutter (highlightjs-line-numbers.js) */
.ide-editor-body .hljs-ln { border-collapse: collapse; }
.ide-editor-body .hljs-ln td { padding: 0; vertical-align: top; }
.ide-editor-body .hljs-ln-numbers { text-align: right; color: var(--text3); border-right: 1px solid var(--border); padding-right: 0.9rem !important; padding-left: 0.2rem; user-select: none; -webkit-user-select: none; min-width: 2.2rem; }
.ide-editor-body .hljs-ln-code { padding-left: 0.9rem !important; }

.ide-preview-bar, .ide-rp-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.2); }
.ide-preview-label { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pg-violet-2); background: var(--pg-soft); border: 1px solid var(--pg-border); border-radius: 5px; padding: 0.12rem 0.4rem; flex-shrink: 0; }
.ide-preview-url { flex: 1; font-family: "JetBrains Mono", monospace; font-size: 0.73rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-preview-open, .ide-rp-open { font-size: 0.76rem; color: var(--pg-violet-2); font-weight: 600; }
.ide-preview-wrap, .ide-rp-wrap { position: relative; flex: 1; min-height: 0; background: #0a0a0a; }
.ide-preview-frame, .ide-rp-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.ide-preview-empty, .ide-rp-wrap .ide-empty { position: absolute; inset: 0; display: grid; place-items: center; }

.ide-changes { flex: 1; min-height: 0; overflow-y: auto; padding: 0.4rem 0.6rem; }
.ide-change-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.76rem; }
.ide-change-path { font-family: "JetBrains Mono", monospace; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-change-size { color: var(--text3); flex-shrink: 0; font-family: "JetBrains Mono", monospace; font-size: 0.7rem; }

/* Bottom console */
.ide-console { height: 220px; flex-shrink: 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; background: rgba(0,0,0,0.25); }
.ide-console-bar { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0.7rem; border-bottom: 1px solid var(--border); }
.ide-console-title { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); }
.ide-console-actions { display: flex; align-items: center; gap: 0.35rem; }
.ide-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; }
.ide-btn-mini { padding: 0.22rem 0.5rem; border-radius: 6px; border: 1px solid var(--border-hi); background: transparent; color: var(--text2); font-size: 0.7rem; cursor: pointer; }
.ide-btn-mini:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.ide-console-slot { flex: 1; min-height: 0; overflow: auto; }
/* moved live agent terminal inside console slot */
.ide-console-slot .exec-terminal-col { height: 100%; border: 0; border-radius: 0; background: transparent; display: flex; flex-direction: column; min-height: 0; }
.ide-console-slot .exec-terminal-bar { display: none; }
.ide-console-slot .exec-terminal-body { flex: 1; min-height: 0; overflow: auto; }

/* Right: live preview */
.ide-rp-title { flex: 1; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); }

.ide-empty { padding: 1.5rem 1rem; text-align: center; color: var(--text3); font-size: 0.8rem; line-height: 1.5; }

@media (max-width: 1200px) {
  .ide-stage.is-active { grid-template-columns: 300px minmax(0, 1fr); height: auto; }
  .ide-rightpreview { display: none; }
}
@media (max-width: 820px) {
  .ide-stage.is-active { grid-template-columns: 1fr; }
  .ide-view[data-ide="code"].is-active { flex-direction: column; }
  .ide-filetree { width: auto; max-height: 160px; border-right: 0; border-bottom: 1px solid var(--border); }
}

/* Conversational progress cards inside the IDE chat */
.ide-chat-card { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.15rem; }
.ide-chat-card-title { font-family: var(--font-display); font-size: 0.86rem; font-weight: 700; color: var(--text); }
.ide-chat-card-body { font-size: 0.8rem; line-height: 1.5; color: var(--text2); }
.ide-chat-action { align-self: flex-start; margin-top: 0.2rem; padding: 0.45rem 0.85rem; border-radius: 8px; border: 1px solid rgba(139,92,246,0.6); background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.ide-chat-action:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(99,102,241,0.35); }
.ide-chat-action:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

.ide-chat-progress { padding: 0.7rem 0.8rem; border: 1px solid var(--pg-border); border-radius: 11px; background: linear-gradient(160deg, rgba(139,92,246,0.13), rgba(99,102,241,0.04)); }
.ide-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; font-family: var(--font-display); font-size: 0.82rem; font-weight: 700; color: var(--text); }
.ide-progress-percent { font-size: 0.72rem; color: var(--pg-violet-2); font-variant-numeric: tabular-nums; }
.ide-progress-status { color: var(--text2); }
.ide-progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(148,163,184,0.18); border: 1px solid rgba(148,163,184,0.16); }
.ide-progress-fill { height: 100%; width: 15%; border-radius: inherit; background: linear-gradient(90deg, var(--pg-violet), #22d3ee); box-shadow: 0 0 16px rgba(139,92,246,0.4); transition: width 0.45s ease; }
.ide-chat-progress.is-complete .ide-progress-fill { background: linear-gradient(90deg, #22c55e, #34d399); }
.ide-chat-progress.is-error { border-color: rgba(248,113,113,0.45); background: rgba(127,29,29,0.12); }
.ide-chat-progress.is-error .ide-progress-fill { background: #f87171; }

/* Execution-brief (instruction list) card in chat */
.ide-brief-list { margin: 0.3rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ide-brief-item { font-size: 0.8rem; color: var(--text); }
.ide-brief-item-head { font-weight: 600; color: var(--text); }
.ide-brief-tasks { margin: 0.2rem 0 0; padding-left: 1rem; display: flex; flex-direction: column; gap: 0.15rem; }
.ide-brief-tasks li { font-size: 0.76rem; color: var(--text2); line-height: 1.45; }
.ide-chat-actions-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.3rem; }
.ide-chat-action--ghost { background: transparent; border: 1px solid var(--border-hi); color: var(--text2); }
.ide-chat-action--ghost:hover { color: var(--text); background: rgba(255,255,255,0.06); box-shadow: none; transform: none; }

/* ── Live mission tracking — a chat card that ticks done/active/pending ── */
.ide-chat-mission { gap: 0.55rem; padding: 0.7rem 0.8rem; border: 1px solid var(--pg-border); border-radius: 11px; background: linear-gradient(160deg, var(--pg-soft), transparent); }
.ide-mission-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text3); }
.ide-mission-count { font-family: var(--font-display); color: var(--pg-violet-2); }
.ide-mission-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.ide-mission-item { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.76rem; line-height: 1.4; color: var(--text3); }
.ide-mission-dot { width: 14px; height: 14px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--border-hi); flex-shrink: 0; position: relative; transition: all 0.2s; }
.ide-mission-item.is-done { color: var(--text2); }
.ide-mission-item.is-done .ide-mission-dot { background: var(--pg-violet); border-color: var(--pg-violet); }
.ide-mission-item.is-done .ide-mission-dot::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.55rem; color: #fff; }
.ide-mission-item.is-active { color: var(--pg-violet-2); font-weight: 600; }
.ide-mission-item.is-active .ide-mission-dot { border-color: var(--pg-violet); box-shadow: 0 0 0 3px var(--pg-soft); animation: ideMissionPulse 1.4s ease-in-out infinite; }
@keyframes ideMissionPulse { 0%, 100% { box-shadow: 0 0 0 2px var(--pg-soft); } 50% { box-shadow: 0 0 0 4px var(--pg-soft); } }

/* ── Collapsible sidebar (wider chat in the Execution IDE) ── */
.app-layout { transition: grid-template-columns 0.22s ease; }
.sidebar { transition: opacity 0.18s ease; }
body.sidebar-collapsed .app-layout { grid-template-columns: 0 1fr; }
body.sidebar-collapsed .sidebar { opacity: 0; pointer-events: none; }
body.sidebar-collapsed .ide-stage.is-active { grid-template-columns: 440px minmax(0, 1fr) 360px; }
body.sidebar-collapsed .ide-stage[data-ide-tab="preview"].is-active { grid-template-columns: 440px minmax(0, 1fr); }
#sidebarToggle.app-back[title] { color: var(--text2); }
body.sidebar-collapsed #sidebarToggle { color: var(--pg-violet-2); background: var(--pg-soft); border-color: var(--pg-border); }

/* Drop the raw "requirements captured" summary block — the execution brief covers it */
.ide-chat-slot .chat-summary { display: none !important; }
