:root {
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --surface-light: #f8f9fa;
  --indigo: #6366f1;
  --indigo-hover: #4f46e5;
  --indigo-glow: rgba(99, 102, 241, 0.35);
  --purple-glow: rgba(168, 85, 247, 0.25);
  --pink-glow: rgba(236, 72, 153, 0.2);
  --danger: #ef4444;
  --good: #10b981;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "Lora", Georgia, serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: ui-monospace, "Cascadia Code", monospace;
  --glass-soft: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-strong: rgba(30, 41, 59, 0.7);
  --radius-lg: 20px;
  --radius-xl: 24px;
  --transition: 500ms ease-in-out;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

body.home-active {
  color: #fff;
  background: var(--slate-900);
}

body.workspace-active {
  color: var(--slate-900);
  background: var(--surface-light);
}

button, input { font: inherit; }
.hidden { display: none !important; }

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Logo ── */
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.logo-mark {
  display: grid;
  place-items: center;
  color: var(--indigo);
  transition: transform var(--transition);
}
.site-logo:hover .logo-mark {
  transform: rotate(180deg);
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

/* ── Home header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  transition: background var(--transition), backdrop-filter var(--transition);
}
body.home-active .site-header {
  color: #fff;
}
body.home-active .site-header.is-scrolled {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}
.nav-pill a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}
.nav-pill a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.header-cta {
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--slate-900);
  background: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}
.header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.3);
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 100px 24px 32px;
  overflow: hidden;
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 900px;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 20%, var(--indigo-glow), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 60%, var(--purple-glow), transparent 55%),
    radial-gradient(ellipse 45% 35% at 15% 70%, var(--pink-glow), transparent 50%),
    linear-gradient(180deg, var(--slate-900) 0%, #0c1222 55%, rgba(15, 23, 42, 0.95) 100%);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 80%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 80%);
}

.hero > *:not(.hero-atmosphere) {
  position: relative;
  z-index: 1;
}

.hero-avatars {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  max-width: 680px;
}
.hero-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 68px;
}
.hero-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, border-color 0.3s;
}
.hero-avatar svg { display: block; width: 100%; height: 100%; }
.hero-avatar-wrap:hover .hero-avatar {
  transform: translateY(-4px) scale(1.05);
  border-color: rgba(99, 102, 241, 0.5);
}
.hero-avatar-role {
  font-size: 0.62rem;
  color: var(--slate-400);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  margin-bottom: 24px;
  border-radius: 999px;
  background: var(--glass-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}
.badge-new {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--indigo);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.hero-title {
  margin: 0 0 20px;
  max-width: 900px;
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
}

.hero-sub {
  margin: 0 0 40px;
  min-height: 1.6em;
  font-size: 1.1rem;
  color: var(--slate-400);
  font-weight: 400;
}
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--indigo);
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

.hero-form {
  width: 100%;
  max-width: 720px;
}

/* ── Vibe Input ── */
.vibe-input-wrap {
  position: relative;
  width: 100%;
}
.vibe-input-glow {
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-xl) + 4px);
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  opacity: 0.35;
  filter: blur(16px);
  transition: opacity 0.4s ease, filter 0.4s ease;
  z-index: 0;
}
.vibe-input-wrap:hover .vibe-input-glow,
.vibe-input-wrap:focus-within .vibe-input-glow {
  opacity: 0.55;
  filter: blur(20px);
}

.prompt-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.3s ease;
}
.prompt-card:focus-within {
  box-shadow: 0 8px 40px rgba(99, 102, 241, 0.2);
}

.prompt-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.prompt-plus-wrap {
  position: relative;
  flex-shrink: 0;
  padding-top: 4px;
}

.plus-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  width: 280px;
  padding: 14px;
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 50;
  pointer-events: none;
}
.prompt-plus-wrap.is-open .plus-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.popover-label {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-400);
}

.prompt-plus {
  width: 36px;
  height: 36px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: var(--surface-light);
  color: var(--slate-500);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.prompt-plus:hover {
  background: #fff;
  color: var(--indigo);
  border-color: rgba(99, 102, 241, 0.3);
}

.prompt-input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 1.15rem;
  color: var(--slate-900);
  background: transparent;
  min-width: 0;
  padding: 6px 0;
  line-height: 1.5;
}
.prompt-input::placeholder { color: var(--slate-400); }

.prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--slate-100);
}
.prompt-hint {
  font-size: 0.78rem;
  color: var(--slate-400);
}

.prompt-cta {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--indigo);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px var(--indigo-glow);
}
.prompt-cta:hover {
  background: var(--indigo-hover);
  transform: translateY(-1px);
}
.prompt-cta:disabled { opacity: 0.5; cursor: wait; transform: none; }

.workflow-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.workflow-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass-soft);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  color: #fff;
  transition: border-color 0.2s, background 0.2s;
}
.workflow-btn strong { font-family: var(--font-display); font-size: 0.95rem; }
.workflow-btn.active {
  border-color: var(--indigo);
  background: rgba(99, 102, 241, 0.2);
}

.mode-switch {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  width: 100%;
}
.mode-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--slate-400);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: color 0.2s, background 0.2s;
}
.mode-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
}

.hero-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.starter-chip {
  border: 1px solid var(--glass-border);
  background: var(--glass-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.starter-chip:hover {
  color: #fff;
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.12);
}

/* ── Feature scroll-spy (light section, editable content) ── */
.features {
  background: var(--surface-light);
  color: var(--slate-900);
  padding: 80px 24px 120px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.features-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 48px 64px;
  align-items: start;
}

.feature-nav {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
}

.feature-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--slate-400);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}
.feature-nav-link:hover { color: var(--slate-700); }

.feature-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}
.feature-nav-link.active {
  color: var(--slate-900);
  font-weight: 700;
}
.feature-nav-link.active .feature-nav-dot {
  background: var(--slate-900);
  transform: scale(1.15);
}

.features-content {
  display: flex;
  flex-direction: column;
  gap: 120px;
}

.feature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  scroll-margin-top: 100px;
}
.feature-block--reverse .feature-visual { order: 2; }
.feature-block--reverse .feature-copy { order: 1; }

.feature-visual {
  min-width: 0;
}

.feature-mockup {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: 0 4px 40px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.mockup-screen {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: linear-gradient(145deg, #1a1033 0%, #0f172a 100%);
  display: grid;
  place-items: center;
  border: 1px dashed rgba(139, 92, 246, 0.4);
}
.mockup-label {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  font-family: var(--font-display);
}

.feature-mockup--photo {
  padding: 10px;
  max-width: min(100%, 360px);
  margin: 0 auto;
}
.feature-mockup--photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  border-radius: 14px;
}
.feature-mockup--wide {
  max-width: min(100%, 420px);
}
.feature-mockup--wide img {
  max-height: 220px;
}

.feature-code {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--slate-900);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.15);
}
.feature-code pre {
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.feature-blueprint {
  padding: 24px;
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--slate-900);
}
.feature-blueprint svg { width: 100%; height: auto; display: block; }

.feature-templates-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}
.template-card {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--surface-light);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--slate-700);
}

.feature-copy { min-width: 0; text-align: left; }
.feature-title {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--slate-900);
}
.feature-lead {
  margin: 0 0 28px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--slate-500);
  max-width: 42ch;
}
.feature-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.feature-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--slate-700);
}
.point-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--slate-900);
  flex-shrink: 0;
}
.point-icon {
  color: var(--indigo);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 2px;
}

body.home-active.header-light .nav-pill a:hover { color: var(--slate-900); background: rgba(15, 23, 42, 0.05); }

/* ── About ── */
.section-head {
  text-align: center;
  margin-bottom: 40px;
}
.section-head--dark .section-title { color: #fff; }
.section-head--dark .section-lead { color: var(--slate-400); }
.section-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--slate-900);
}
.section-lead {
  margin: 0;
  font-size: 1rem;
  color: var(--slate-500);
  line-height: 1.6;
}

.about {
  background: var(--slate-900);
  color: #fff;
  padding: 100px 24px 120px;
  scroll-margin-top: 80px;
}
.about-inner {
  max-width: 820px;
  margin: 0 auto;
}
.about-panel {
  padding: 32px 36px;
  border-radius: var(--radius-xl);
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}
.about-panel p {
  margin: 0 0 20px;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--slate-200);
}
.about-panel p:last-child {
  margin-bottom: 0;
}

/* ── FAQ ── */
.faq-section {
  background: #fff;
  padding: 100px 24px 120px;
  scroll-margin-top: 80px;
}
.faq-inner {
  max-width: 48rem;
  margin: 0 auto;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  border-radius: 14px;
  background: #f3f4f6;
  overflow: hidden;
  transition: background 0.2s;
}
.faq-item.is-open { background: #eef0f3; }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-900);
}
.faq-chevron {
  flex-shrink: 0;
  color: var(--slate-400);
  transition: transform 0.3s ease;
}
.faq-item.is-open .faq-chevron {
  transform: rotate(180deg);
  color: var(--indigo);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.faq-answer p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--slate-500);
}
.faq-answer code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: rgba(15, 23, 42, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

body.home-active.header-light .site-header {
  color: var(--slate-900);
  background: rgba(248, 249, 250, 0.9);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
body.home-active.header-light .site-header .logo-mark { color: var(--indigo); }
body.home-active.header-light .nav-pill {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.08);
}
body.home-active.header-light .nav-pill a { color: var(--slate-500); }
body.home-active.header-light .nav-pill a:hover { color: var(--slate-900); background: rgba(15, 23, 42, 0.05); }

/* ── Workspace ── */
body.workspace-active {
  overflow: hidden;
  height: 100%;
}
body.workspace-active .app {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: rise 0.45s ease both;
}

.workspace-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  transition: background var(--transition);
}
.workspace-logo { color: var(--slate-900); }
.workspace-header-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.head-actions { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }

.workspace-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 16px;
  padding: 16px 20px 20px;
}

.panel-glass {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.workspace-active .panel-glass--dark {
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--glass-border);
  color: #fff;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ghost {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: transparent;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--slate-500);
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.ghost:hover { color: var(--slate-900); border-color: var(--slate-900); }
.ghost-primary {
  background: var(--slate-900);
  color: #fff;
  border-color: var(--slate-900);
}
.ghost-primary:hover {
  background: var(--slate-800);
  border-color: var(--slate-800);
  color: #fff;
}
#cancelBtn:hover { color: var(--danger); border-color: var(--danger); background: transparent; }

.roster { min-width: 0; overflow-x: hidden; }

.agent-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.agent-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas: "avatar meta" "avatar state";
  gap: 4px 10px;
  align-items: start;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.agent-card .avatar { grid-area: avatar; align-self: center; }
.agent-meta { grid-area: meta; min-width: 0; }
.agent-state {
  grid-area: state;
  font-size: 0.68rem;
  color: var(--slate-400);
  font-family: var(--font-mono);
}
.agent-card.working {
  background: color-mix(in srgb, var(--agent-accent) 8%, white);
  border-color: color-mix(in srgb, var(--agent-accent) 25%, white);
}
.agent-card.done { opacity: 0.7; }

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  background: var(--agent-accent);
  overflow: hidden;
}
.avatar-cartoon { border-radius: 50%; background: transparent; }
.avatar-cartoon svg { width: 100%; height: 100%; display: block; }

.agent-meta strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.agent-meta span {
  display: block;
  font-size: 0.74rem;
  color: var(--slate-500);
  overflow-wrap: anywhere;
}
.watch-tag {
  display: block;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--slate-400);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.roster-foot {
  margin: auto 0 0;
  padding: 12px 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.8rem;
  color: var(--slate-500);
}

.timeline-panel { min-width: 0; min-height: 0; }

.idea-chip {
  flex: 1;
  font-size: 0.8rem;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workflow-pill {
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.workflow-pill.wf-mgx { background: rgba(99, 102, 241, 0.12); color: var(--indigo); }
.workflow-pill.wf-sop { background: rgba(16, 185, 129, 0.12); color: #059669; }

.timeline {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.15) transparent;
}
.timeline::-webkit-scrollbar { width: 6px; }
.timeline::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.12);
  border-radius: 3px;
}

.event { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.event-rail { display: flex; flex-direction: column; align-items: center; }
.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 8px var(--indigo-glow);
}
.event-rail::after {
  content: "";
  width: 2px;
  flex: 1;
  background: var(--slate-200);
  min-height: 16px;
}
.event:last-child .event-rail::after { display: none; }

.event-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-light);
  border: 1px solid rgba(15, 23, 42, 0.06);
  text-align: left;
  transition: box-shadow 0.2s;
}
.event-card:hover { box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06); }
.event-card.user {
  background: var(--slate-900);
  color: #fff;
  border-color: transparent;
}
.event-card.error { background: #fef2f2; border-color: #fecaca; }
.event-card p { margin: 0; white-space: pre-wrap; line-height: 1.55; font-size: 0.9rem; }
.thought { font-style: italic; color: var(--slate-500); border-left: 3px solid var(--indigo); padding-left: 10px; }

.route { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.route-path { font-size: 0.72rem; color: var(--slate-400); font-family: var(--font-mono); }
.event-card.user .route-path { color: rgba(255, 255, 255, 0.5); }
.route-badge {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-family: var(--font-display);
}
.route-mgx-dispatch { background: rgba(99, 102, 241, 0.15); color: var(--indigo); }
.route-mgx-reply { background: rgba(99, 102, 241, 0.08); color: #4338ca; }
.route-mgx-work { background: var(--slate-100); color: var(--slate-500); }
.route-sop-chain { background: rgba(16, 185, 129, 0.12); color: #059669; }
.route-user { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.8); }
.route-generic { background: var(--slate-100); color: var(--slate-500); }
.sop-trigger-card { background: rgba(16, 185, 129, 0.06); border-color: rgba(16, 185, 129, 0.2); }
.dot-sop { background: #10b981 !important; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4) !important; }

.stream-dock {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: var(--slate-900);
  color: var(--slate-200);
  padding: 14px 18px;
  max-height: 200px;
}
.stream-meta { font-size: 0.72rem; color: #a5b4fc; font-family: var(--font-mono); }
.stream-body {
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
}

.artifacts .count {
  font-size: 0.75rem;
  background: var(--slate-100);
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--slate-500);
}
.artifact-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.artifact-tab {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: transparent;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.artifact-tab:hover { border-color: var(--indigo); color: var(--indigo); }
.artifact-tab.active {
  background: var(--slate-900);
  color: #fff;
  border-color: var(--slate-900);
}
.artifact-view {
  margin: 0;
  padding: 16px;
  overflow: auto;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--slate-500);
  text-align: left;
  background: var(--surface-light);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .nav-pill { display: none; }
  .features-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .feature-nav {
    position: relative;
    top: auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }
  .feature-nav-link { padding: 8px 12px; font-size: 0.85rem; }
  .feature-block,
  .feature-block--reverse {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .feature-block--reverse .feature-visual,
  .feature-block--reverse .feature-copy { order: unset; }
  .features-content { gap: 80px; }
  body.workspace-active { overflow: auto; }
  body.workspace-active .app { height: auto; min-height: 100vh; overflow: visible; }
  .workspace-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: calc(100vh - 60px);
  }
  .roster { max-height: 28vh; }
  .artifacts { max-height: 32vh; }
}

@media (max-width: 600px) {
  .site-header { padding: 12px 16px; }
  .header-cta { display: none; }
  .hero { padding: 100px 16px 48px; min-height: 100vh; }
  .hero-avatar { width: 44px; height: 44px; }
  .workspace-header { flex-wrap: wrap; padding: 12px 16px; }
  .workspace-header-meta { order: 3; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
