/* ---------- Base ---------- */
:root {
  --bg: #f5f1ea;
  --ink: #16121f;
  --ink-soft: #4b4456;
  --ink-faint: #807990;
  --line: #e3dccf;
  --line-soft: #ece6db;
  --paper: #fdfbf6;
  --paper-2: #ffffff;

  /* candy palette — module colors */
  --c-voice: #ff5b9a;     /* hot pink */
  --c-brain: #7c3aed;     /* violet */
  --c-hands: #06b6d4;     /* cyan */
  --c-config: #f59e0b;    /* amber */
  --c-knowledge: #10b981; /* emerald */
  --c-tools: #ef4444;     /* red */
  --c-test: #6366f1;      /* indigo */
  --c-launch: #84cc16;    /* lime */

  --shadow-sm: 0 1px 0 rgba(22, 18, 31, 0.04), 0 2px 8px rgba(22, 18, 31, 0.05);
  --shadow-md: 0 2px 0 rgba(22, 18, 31, 0.06), 0 12px 28px rgba(22, 18, 31, 0.08);
  --shadow-lg: 0 4px 0 rgba(22, 18, 31, 0.08), 0 30px 60px rgba(22, 18, 31, 0.16);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.serif { font-family: "Fraunces", "Times New Roman", Georgia, serif; font-optical-sizing: auto; }
.mono  { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Background texture ---------- */
.canvas {
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124, 58, 237, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(255, 91, 154, 0.08), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, rgba(132, 204, 22, 0.10), transparent 60%),
    var(--bg);
}
.dot-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(22,18,31,0.10) 1px, transparent 1.4px);
  background-size: 24px 24px;
  background-position: 0 0;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 40%, black, transparent 90%);
          mask-image: radial-gradient(80% 70% at 50% 40%, black, transparent 90%);
  pointer-events: none;
  opacity: 0.45;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  backdrop-filter: blur(10px);
  background: rgba(245, 241, 234, 0.78);
  border-bottom: 1px solid var(--line-soft);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 600; letter-spacing: -0.01em;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #ff5b9a 0%, #7c3aed 50%, #06b6d4 100%);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 4px;
  border-radius: 7px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6), transparent 55%);
}
.brand-name { font-size: 15px; }
.brand-sub  { font-size: 12px; color: var(--ink-faint); margin-left: 6px; font-weight: 500; }

.progress-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.progress-bar {
  width: 140px; height: 8px; border-radius: 999px;
  background: var(--line-soft); overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff5b9a, #7c3aed 35%, #06b6d4 70%, #84cc16);
  border-radius: 999px;
  transition: width 600ms cubic-bezier(.2,.8,.2,1);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1200px; margin: 0 auto;
  padding: 56px 28px 24px;
  position: relative;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,0.18); }
.hero h1 {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 18px 0 14px;
  max-width: 14ch;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  background: linear-gradient(120deg, #ff5b9a 0%, #7c3aed 60%, #06b6d4 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero p.lede {
  font-size: 18px; line-height: 1.55; color: var(--ink-soft);
  max-width: 56ch; margin: 0 0 24px;
}
.hero-stats {
  display: flex; gap: 28px; margin-top: 18px; flex-wrap: wrap;
}
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat-num { font-family: "Fraunces", serif; font-weight: 600; font-size: 32px; letter-spacing: -0.02em; }
.stat-lab { font-size: 13px; color: var(--ink-faint); }

/* ---------- Journey map ---------- */
.journey {
  max-width: 1200px; margin: 28px auto 64px;
  padding: 0 28px;
  position: relative;
}
.journey-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  position: relative;
  z-index: 2;
}
.module-card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 20px 18px;
  cursor: pointer;
  transition: transform 280ms cubic-bezier(.2,.8,.2,1), box-shadow 280ms;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: 200px;
  display: flex; flex-direction: column; gap: 12px;
}
.module-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0;
  height: 4px;
  background: var(--accent, #7c3aed);
}
.module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.module-card.locked {
  opacity: 0.55; cursor: not-allowed; filter: saturate(0.4);
}
.module-card.done .module-num {
  background: var(--accent) !important;
  color: white !important;
}
.module-num {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: "Fraunces", serif; font-weight: 600; font-size: 18px;
  background: color-mix(in oklab, var(--accent) 14%, white);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 25%, white);
}
.module-head {
  display: flex; align-items: center; justify-content: space-between;
}
.module-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, white);
}
.module-title {
  font-family: "Fraunces", serif;
  font-weight: 500; font-size: 22px; letter-spacing: -0.015em;
  line-height: 1.1; margin: 0;
}
.module-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; margin: 0; }
.module-meta {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--ink-faint); font-weight: 500;
}
.module-meta .arrow {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--accent) 12%, white);
  color: var(--accent);
  transition: transform 200ms;
}
.module-card:hover .arrow { transform: translateX(3px); }

.check-badge {
  position: absolute; top: 14px; right: 14px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: white;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px color-mix(in oklab, var(--accent) 40%, transparent);
}

/* Connector lines — drawn as SVG behind grid */
.connectors {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
}
.connectors path {
  fill: none;
  stroke-width: 2;
  stroke-dasharray: 6 8;
  stroke-linecap: round;
  opacity: 0.45;
}

/* span helpers for grid */
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-3 { grid-column: span 3; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }

@media (max-width: 980px) {
  .span-4, .span-6, .span-3, .span-8 { grid-column: span 12; }
}

/* ---------- Lesson overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(22, 18, 31, 0.55);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px;
  overflow-y: auto;
  animation: fade 220ms ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.lesson {
  width: min(1100px, 100%);
  background: var(--paper);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: pop 320ms cubic-bezier(.2,.8,.2,1) both;
  margin: 24px 0 60px;
}
.lesson-top {
  background: var(--accent);
  color: white;
  padding: 24px 30px 22px;
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
}
.lesson-top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 36px;
  background: radial-gradient(60% 100% at 50% 0%, color-mix(in oklab, var(--accent) 30%, white) 0%, transparent 100%);
  opacity: 0.55;
}
.lesson-eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}
.lesson-title { font-family: "Fraunces", serif; font-weight: 500; font-size: 36px; line-height: 1.05; letter-spacing: -0.02em; margin: 6px 0 0; }
.close-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.16); color: white; border: none;
  display: grid; place-items: center; cursor: pointer;
  transition: background 160ms;
}
.close-btn:hover { background: rgba(255,255,255,0.28); }

.lesson-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  background: var(--paper);
}
.lesson-main {
  padding: 32px 32px 28px;
  min-height: 480px;
}
.lesson-side {
  padding: 28px 28px 28px;
  background: var(--paper-2);
  border-left: 1px solid var(--line);
  position: relative;
}
@media (max-width: 920px) {
  .lesson-body { grid-template-columns: 1fr; }
  .lesson-side { border-left: 0; border-top: 1px solid var(--line); }
}

.lesson-step-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px; border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 10%, white);
  color: var(--accent);
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.lesson-heading {
  font-family: "Fraunces", serif; font-weight: 500; font-size: 28px;
  letter-spacing: -0.02em; line-height: 1.15; margin: 12px 0 8px;
}
.lesson-prose { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 18px; }

/* steps progress (inside lesson) */
.step-dots {
  display: flex; gap: 8px; margin-top: 18px;
}
.step-dot {
  flex: 1; height: 6px; border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background 160ms;
}
.step-dot.active { background: var(--accent); }
.step-dot.done   { background: color-mix(in oklab, var(--accent) 60%, white); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600; font-size: 14px;
  border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink);
  cursor: pointer;
  transition: all 180ms;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary {
  background: var(--accent); color: white; border-color: transparent;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 8px 24px color-mix(in oklab, var(--accent) 30%, transparent);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Lesson nav footer */
.lesson-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 30px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}
.lesson-foot-mid { font-size: 13px; color: var(--ink-faint); }

/* ---------- Lesson inner content (simulated UI) ---------- */
.sim {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px;
  margin-top: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), var(--shadow-sm);
}
.sim-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin-bottom: 8px; }

.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice {
  position: relative;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: all 180ms;
  text-align: left;
  font-family: inherit;
  color: var(--ink);
}
.choice:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); }
.choice.selected {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 7%, white);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 14%, transparent);
}
.choice-title { font-weight: 600; font-size: 14px; margin: 0; }
.choice-desc { font-size: 12.5px; color: var(--ink-faint); margin: 4px 0 0; line-height: 1.4; }

.choice-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: color-mix(in oklab, var(--accent) 10%, white); color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 10px;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  font-family: inherit; font-size: 14px;
  color: var(--ink);
  transition: all 160ms;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 14%, transparent); }
textarea.input { resize: vertical; min-height: 100px; line-height: 1.55; font-family: "JetBrains Mono", monospace; font-size: 13px; }

.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field-hint { font-size: 12px; color: var(--ink-faint); margin-top: 6px; }

.toggle-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink-soft);
  cursor: pointer;
  transition: all 160ms;
}
.chip:hover { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); color: var(--ink); }
.chip.on {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, white);
  color: var(--accent);
}

/* voice waveform */
.wave {
  display: flex; align-items: center; gap: 3px; height: 28px;
}
.wave span {
  display: inline-block; width: 3px; border-radius: 2px;
  background: currentColor;
  animation: waving 1.1s ease-in-out infinite;
}
@keyframes waving {
  0%, 100% { height: 6px; }
  50% { height: 24px; }
}

/* voice picker */
.voice-source {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--accent) 6%, white);
  border: 1px dashed color-mix(in oklab, var(--accent) 30%, var(--line));
  margin-bottom: 12px;
  font-size: 13px;
}
.voice-source-status { display: flex; align-items: center; gap: 8px; }
.voice-source-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.voice-source-dot.real { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,0.18); }
.voice-source-dot.fake { background: #94a3b8; box-shadow: 0 0 0 4px rgba(148,163,184,0.18); }

.voice-key-form {
  padding: 14px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.voice-error {
  padding: 10px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
  margin-bottom: 12px;
  word-break: break-word;
}

.voice-real-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #10b981;
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

.voice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.voice-card {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: border-color 160ms, background 160ms, transform 160ms;
}
.voice-card:hover { border-color: color-mix(in oklab, var(--vc) 35%, var(--line)); }
.voice-card.on {
  border-color: var(--vc);
  background: color-mix(in oklab, var(--vc) 7%, white);
}
.voice-card.playing {
  border-color: var(--vc);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--vc) 18%, transparent);
}
.voice-avatar {
  width: 54px; height: 54px; border-radius: 14px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--vc) 0%, color-mix(in oklab, var(--vc) 70%, black) 100%);
  color: white;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.voice-avatar::after {
  content: ""; position: absolute; inset: 4px;
  border-radius: 11px;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.45), transparent 55%);
  pointer-events: none;
}
.voice-avatar .wave { height: 30px; gap: 3px; position: relative; z-index: 1; }
.voice-avatar .wave span { width: 3px; animation-duration: 1.6s; opacity: 0.85; }
.voice-avatar .wave.live span { animation-duration: 0.55s; opacity: 1; }
.voice-meta { flex: 1; min-width: 0; }
.voice-name { font-weight: 600; font-size: 14.5px; letter-spacing: -0.005em; }
.voice-tag  { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.voice-play {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  border: 1.5px solid color-mix(in oklab, var(--vc) 30%, var(--line));
  background: white;
  color: var(--vc);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all 160ms;
  flex-shrink: 0;
}
.voice-play:hover { background: color-mix(in oklab, var(--vc) 10%, white); transform: translateY(-1px); }
.voice-play.on {
  background: var(--vc);
  color: white;
  border-color: var(--vc);
}
.voice-play:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.voice-play.loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Module 5 — Integration cards ===== */
.integration-card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  overflow: hidden;
  transition: border-color 160ms, box-shadow 160ms;
}
.integration-card.on {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 5%, white);
}
.integration-card.open {
  box-shadow: var(--shadow-sm);
  grid-column: span 2;
}
.integration-head {
  display: flex; align-items: stretch;
  gap: 0;
}
.integration-toggle {
  flex: 1;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: transparent; border: none;
  cursor: pointer; text-align: left;
  font-family: inherit; color: inherit;
  min-width: 0;
}
.integration-toggle:hover { background: color-mix(in oklab, var(--accent) 5%, transparent); }
.integration-expand {
  display: grid; place-items: center;
  width: 38px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--line);
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 160ms;
}
.integration-expand:hover { background: color-mix(in oklab, var(--accent) 10%, white); color: var(--accent); }

.integration-body {
  padding: 4px 16px 16px;
  border-top: 1px dashed var(--line);
  background: color-mix(in oklab, var(--accent) 3%, white);
  animation: slideDown 220ms ease-out;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.integration-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--line);
  margin-bottom: 12px;
}
.integration-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
}
.integration-link:hover { text-decoration: underline; }
.integration-link svg { width: 11px; height: 11px; }

.integration-steps-title {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
  margin-bottom: 8px;
}
.integration-steps {
  margin: 0; padding-left: 20px;
  font-size: 13.5px; line-height: 1.6; color: var(--ink);
}
.integration-steps li { margin-bottom: 6px; }
.integration-steps li::marker { color: var(--accent); font-weight: 700; }

/* tier pills */
.tier-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tier-free     { background: #10b981; color: white; }
.tier-freemium { background: #f59e0b; color: white; }
.tier-paid     { background: #94a3b8; color: white; }

.tier-legend { display: flex; gap: 5px; }

@media (max-width: 720px) {
  .integration-card.open { grid-column: span 1; }
}
.voice-check {
  position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--vc); color: white;
  display: grid; place-items: center;
  font-size: 10px;
}
@media (max-width: 720px) {
  .voice-grid { grid-template-columns: 1fr; }
}

/* side panel content */
.tips {
  background: color-mix(in oklab, var(--accent) 7%, white);
  border: 1px solid color-mix(in oklab, var(--accent) 18%, white);
  padding: 16px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
}
.tips-title {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.tips p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.tips-list { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.65; color: var(--ink); }
.tips-list li { margin-bottom: 4px; }
.tips-list li::marker { color: var(--accent); }

.snippet {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  background: #16121f;
  color: #d8d4e2;
  padding: 14px 16px;
  border-radius: 12px;
  line-height: 1.6;
  overflow-x: auto;
}
.snippet .k { color: #ff5b9a; }
.snippet .s { color: #84cc16; }
.snippet .c { color: #807990; font-style: italic; }

/* Chat simulator (Test module) */
.chat {
  background: #f7f3ec;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  height: 320px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.bubble {
  max-width: 78%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  animation: bubbleIn 360ms cubic-bezier(.2,.8,.2,1) both;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.bubble.user { align-self: flex-end; background: var(--ink); color: white; border-bottom-right-radius: 4px; }
.bubble.agent { align-self: flex-start; background: white; color: var(--ink); border-bottom-left-radius: 4px; border: 1px solid var(--line); }
.bubble.system { align-self: center; background: transparent; color: var(--ink-faint); font-size: 12px; font-style: italic; }
.typing { display: inline-flex; gap: 3px; align-items: center; }
.typing span {
  width: 6px; height: 6px; background: var(--ink-faint); border-radius: 50%;
  animation: typingDot 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Tool grid */
.tool-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.tool-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: all 160ms;
  text-align: left;
}
.tool-tile:hover { border-color: color-mix(in oklab, var(--accent) 30%, var(--line)); }
.tool-tile.on {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, white);
}
.tool-logo {
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center; color: white;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.tool-name { font-weight: 600; font-size: 13.5px; }
.tool-sub  { font-size: 11.5px; color: var(--ink-faint); }
.tool-check {
  margin-left: auto;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.tool-tile.on .tool-check {
  border-color: var(--accent); background: var(--accent); color: white;
}

/* Stat highlight (knowledge module) */
.kpi { display: flex; align-items: baseline; gap: 6px; }
.kpi-num { font-family: "Fraunces", serif; font-weight: 600; font-size: 32px; letter-spacing: -0.02em; color: var(--accent); }
.kpi-lab { font-size: 12px; color: var(--ink-faint); }

/* Floating reward toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: white;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: pop 260ms cubic-bezier(.2,.8,.2,1) both;
}
.toast-emoji {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--c-launch); display: grid; place-items: center;
  font-size: 14px;
}

/* Completion sparkle */
.sparkle {
  position: absolute; pointer-events: none;
  width: 18px; height: 18px;
  animation: sparkle 800ms ease-out both;
}
@keyframes sparkle {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(1.6) rotate(45deg); opacity: 0; }
}

/* footer / scaffolding */
.scaffold-foot {
  max-width: 1200px; margin: 60px auto 40px;
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--ink-faint);
  border-top: 1px solid var(--line-soft);
  padding-top: 22px;
}

/* utility */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.muted { color: var(--ink-faint); }
.strong { font-weight: 600; }
.center { text-align: center; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px;
  background: var(--line-soft); color: var(--ink-soft);
  font-size: 11px; font-weight: 500;
}

.completion-banner {
  background: linear-gradient(135deg, #84cc16, #06b6d4);
  color: white;
  padding: 36px;
  border-radius: var(--r-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: 32px;
}
.completion-banner h2 { font-family: "Fraunces", serif; font-weight: 500; font-size: 38px; margin: 0 0 8px; }
.completion-banner p { margin: 0 0 18px; font-size: 16px; opacity: 0.92; }
