:root {
  --bg: #070b14;
  --bg-elev: #0f172a;
  --surface: rgba(15, 23, 42, 0.82);
  --surface-solid: #111a2e;
  --surface-2: #18233c;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --muted: #8b9bb4;
  --brand: #3b82f6;
  --brand-2: #6366f1;
  --brand-soft: rgba(59, 130, 246, 0.14);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.14);
  --red: #ef4444;
  --shadow: 0 12px 32px -12px rgba(2, 6, 23, 0.7);
  --radius: 16px;
  --radius-sm: 10px;
}

[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-elev: #ffffff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --surface-2: #f1f5f9;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.2);
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --brand-soft: rgba(37, 99, 235, 0.1);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.12);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.12);
  --purple: #9333ea;
  --purple-soft: rgba(147, 51, 234, 0.12);
  --shadow: 0 10px 28px -12px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.24;
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 18s ease-in-out infinite alternate;
}
[data-theme="light"] .bg-orb { opacity: 0.13; }
.orb-1 {
  width: 480px; height: 480px;
  top: -150px; left: -120px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
}
.orb-2 {
  width: 440px; height: 440px;
  bottom: -140px; right: -100px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
  animation-delay: -6s;
}
.orb-3 {
  width: 340px; height: 340px;
  top: 40%; right: 20%;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  opacity: 0.14;
  animation-delay: -11s;
}
@keyframes floatOrb {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(26px, -22px, 0) scale(1.06); }
  100% { transform: translate3d(-18px, 24px, 0) scale(0.96); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes shimmerMove {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* HERO BANNER */
.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  align-items: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(99, 102, 241, 0.1) 50%, var(--surface));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  padding: 24px 26px;
  box-shadow: var(--shadow);
  animation: riseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid rgba(59, 130, 246, 0.28);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulseRing 2.1s infinite;
}
.hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.38rem, 2.6vw, 1.95rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.grad-text {
  background: linear-gradient(90deg, #60a5fa, #a78bfa, #34d399, #60a5fa);
  background-size: 240% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmerMove 8s linear infinite;
}
.hero-desc {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--text-soft);
  max-width: 62ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.countdown-box {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.cd-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--purple);
}
.cd-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text);
  margin: 2px 0;
}
.cd-sub { font-size: 0.78rem; color: var(--muted); }

.icon-btn.spinning .spin-icon { animation: spin 0.75s linear infinite; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.87rem; margin: 0; }
a { color: var(--brand); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 18px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px -6px rgba(59, 130, 246, 0.55);
  flex-shrink: 0;
}
.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}
.brand-sub { font-size: 0.8rem; color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.conn-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.conn-pill.live {
  background: var(--green-soft);
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--green);
}
.conn-pill.live .dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}
.conn-pill.snapshot {
  background: var(--amber-soft);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--amber);
}
.conn-pill.snapshot .dot { background: var(--amber); }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}
.icon-btn:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.icon-btn:active:not(:disabled) { transform: scale(0.98); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: rgba(59,130,246,0.3); }
.badge-ok { background: var(--green-soft); color: var(--green); border-color: rgba(34,197,94,0.3); }
.badge-warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(245,158,11,0.3); }

/* KPI BENTO GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.16s, box-shadow 0.18s;
  box-shadow: var(--shadow);
  animation: riseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 65ms);
}
.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 14px 32px -12px rgba(59, 130, 246, 0.35);
}

.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.kpi-icon.blue { background: var(--brand-soft); color: var(--brand); }
.kpi-icon.green { background: var(--green-soft); color: var(--green); }
.kpi-icon.purple { background: var(--purple-soft); color: var(--purple); }
.kpi-icon.amber { background: var(--amber-soft); color: var(--amber); }

.kpi-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.kpi-label { font-size: 0.74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 1.05rem; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-meta { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mini-progress {
  height: 5px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
}
.mini-progress > div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--green));
  transition: width 0.3s ease;
}

/* TABBAR */
.tabbar {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(59, 130, 246, 0.55);
}
.tab-tag {
  font-size: 0.67rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
}

.tab-panel { display: none; flex-direction: column; gap: 16px; animation: fadeIn 0.2s ease; }
.tab-panel.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* CARDS & LAYOUT */
.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.card-head.wrap { flex-wrap: wrap; align-items: center; }
.card-head h2 { margin: 0 0 2px; font-size: 1.06rem; font-weight: 700; letter-spacing: -0.01em; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.callout {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--brand-soft);
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-size: 0.87rem;
}
.callout.ok { background: var(--green-soft); border-color: rgba(34, 197, 94, 0.32); }
.callout.warn { background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.35); }
.callout strong { font-size: 0.9rem; }
.callout code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82em;
  background: rgba(0, 0, 0, 0.2);
  padding: 1px 5px;
  border-radius: 4px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 20px -6px rgba(59, 130, 246, 0.55);
  transition: transform 0.12s, filter 0.15s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
}
.btn-outline:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.btn-outline.small { padding: 6px 11px; font-size: 0.78rem; }

/* CHAT SHELL */
.chat-shell {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.chat-agent-meta { display: flex; align-items: center; gap: 12px; }
.agent-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.chat-agent-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
  font-size: 0.98rem;
}
.chat-agent-sub { font-size: 0.81rem; color: var(--muted); }

.chat-feed {
  min-height: 360px;
  max-height: 58vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 4px;
}

.msg {
  max-width: 86%;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 0.92rem;
  position: relative;
}
.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 8px 20px -10px rgba(59, 130, 246, 0.65);
}
.msg.assistant {
  align-self: flex-start;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.msg.user .msg-head { color: rgba(255, 255, 255, 0.8); }

.copy-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* 3-STEP LIVE STATUS STEPPER */
.stepper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}
.step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--muted);
}
.step-row.done { color: var(--green); }
.step-row.active { color: var(--brand); font-weight: 600; }
.step-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.step-row.done .step-dot { background: var(--green); border-color: var(--green); color: #fff; font-size: 10px; }
.step-row.active .step-dot {
  border-color: var(--brand);
  border-top-color: transparent;
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.starter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.starter-pill {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.starter-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.composer {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.composer textarea {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.92rem;
  resize: vertical;
  min-height: 54px;
  outline: none;
  transition: border-color 0.15s;
}
.composer textarea:focus { border-color: var(--brand); }

/* 8-WEEK ROADMAP */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.rm-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.rm-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.rm-item.available {
  background: linear-gradient(150deg, var(--brand-soft), var(--surface-2));
  border-color: rgba(59, 130, 246, 0.45);
}
.rm-item.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.rm-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.rm-num { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; color: var(--brand); }
.rm-item:not(.available) .rm-num { color: var(--muted); }
.rm-title { font-size: 0.88rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.rm-desc { font-size: 0.77rem; color: var(--muted); line-height: 1.4; }

.roadmap-detail {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.rmd-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.rmd-title { font-weight: 800; font-size: 0.94rem; }
.rmd-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.rmd-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 13px;
}
.rmd-box.out {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(145deg, var(--green-soft), var(--surface-2));
}
.rmd-k {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  margin-bottom: 3px;
}
.rmd-box.out .rmd-k { color: var(--green); }
.rmd-v { font-size: 0.84rem; color: var(--text-soft); line-height: 1.45; }
.rmd-arrow { color: var(--brand); font-weight: 800; font-size: 1.1rem; text-align: center; }

/* MINI FLOW STRIP IN CHAT */
.mini-flow-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.77rem;
  color: var(--text-soft);
}
.mf-node {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.mf-node strong { color: var(--brand); }
.mf-arrow { color: var(--muted); font-weight: 700; }

/* VISUAL FLOWCHARTS HUB */
.flow-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ftab {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
  transition: all 0.15s;
}
.ftab:hover { color: var(--text); border-color: var(--border-strong); }
.ftab.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px -6px rgba(59, 130, 246, 0.55);
}

.flow-stage {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.flow-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.flow-intro h3 { margin: 0 0 3px; font-size: 1rem; font-weight: 800; }
.flow-intro p { margin: 0; font-size: 0.84rem; color: var(--muted); }

/* LINEAR STEPPER FLOW */
.flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 12px;
}
.fstep {
  position: relative;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s, box-shadow 0.2s;
  animation: riseIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--s, 0) * 65ms);
}
.fstep:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
}
.fstep.tour-active {
  transform: translateY(-4px) scale(1.015);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28), 0 14px 30px -10px rgba(59, 130, 246, 0.45);
}
.dbranch {
  animation: riseIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--s, 0) * 70ms);
  transition: transform 0.18s, border-color 0.18s;
}
.dbranch:hover { transform: translateY(-2px); border-color: var(--border-strong); }

/* GLOSSARY */
.glossary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.gpill {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.81rem;
  font-weight: 600;
  transition: all 0.15s;
}
.gpill:hover { border-color: var(--brand); color: var(--brand); }
.gpill.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}
.glossary-detail {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: 12px;
  padding: 13px 16px;
  animation: riseIn 0.22s ease both;
}
.glossary-detail strong { display: block; font-size: 0.94rem; margin-bottom: 3px; }
.glossary-detail p { margin: 0 0 6px; font-size: 0.86rem; color: var(--text-soft); }
.glossary-detail .g-ref { font-size: 0.76rem; color: var(--muted); }

/* ACCORDION SECTIONS FOR MODULE NOTES */
.note-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.acc-list { display: flex; flex-direction: column; gap: 10px; }
.acc-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  transition: border-color 0.16s;
}
.acc-item[open] { border-color: rgba(59, 130, 246, 0.35); }
.acc-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  user-select: none;
}
.acc-summary::-webkit-details-marker { display: none; }
.acc-summary:hover { background: var(--surface-2); }
.acc-chevron {
  transition: transform 0.2s ease;
  color: var(--muted);
  flex-shrink: 0;
}
.acc-item[open] .acc-chevron { transform: rotate(180deg); color: var(--brand); }
.acc-body {
  padding: 2px 16px 16px;
  border-top: 1px solid var(--border);
  animation: riseIn 0.22s ease both;
}

/* TOAST */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--brand);
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.55);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: riseIn 0.22s ease both;
}

.flow-tabs { margin-bottom: 12px; }
.flow-controls { display: flex; align-items: center; gap: 8px; }

@media (max-width: 900px) {
  .hero-card { grid-template-columns: 1fr; padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.fstep.highlight {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(155deg, var(--green-soft), var(--surface-solid));
}
.fstep.warn {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(155deg, var(--amber-soft), var(--surface-solid));
}
.fstep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fstep-num {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.fstep.highlight .fstep-num { background: var(--green); }
.fstep.warn .fstep-num { background: var(--amber); }
.fstep-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 999px;
}
.fstep-title { font-weight: 700; font-size: 0.9rem; color: var(--text); line-height: 1.3; }
.fstep-desc { font-size: 0.81rem; color: var(--text-soft); line-height: 1.48; }
.fstep-next {
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand);
}

/* DECISION TREE / BRANCH FLOW */
.decision-root {
  background: linear-gradient(135deg, var(--brand-soft), var(--surface-solid));
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 12px;
  padding: 13px 16px;
  text-align: center;
  margin-bottom: 14px;
}
.decision-root strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.decision-branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dbranch {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dbranch-cond {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 8px;
  align-self: flex-start;
}
.dbranch.green .dbranch-cond { color: var(--green); background: var(--green-soft); }
.dbranch.amber .dbranch-cond { color: var(--amber); background: var(--amber-soft); }
.dbranch.purple .dbranch-cond { color: var(--purple); background: var(--purple-soft); }
.dbranch-title { font-size: 0.94rem; font-weight: 800; color: var(--text); }
.dbranch-chain {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.81rem;
  color: var(--text-soft);
}
.dbranch-chain div {
  padding-left: 12px;
  border-left: 2px solid var(--border-strong);
}

/* ZOOM FLOW CARD */
.zoom-flow-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zf-step {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
}
.zf-step strong { display: block; font-size: 0.85rem; }
.zf-badge {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 800;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.zf-arrow { text-align: center; color: var(--purple); font-weight: 800; font-size: 0.85rem; line-height: 1; }

.flow-footer-note {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* VIDEO CARDS */
.video-grid { display: flex; flex-direction: column; gap: 10px; }
.video-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  transition: border-color 0.15s;
}
.video-card:hover { border-color: var(--brand); }
.video-meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.video-name { font-weight: 700; font-size: 0.92rem; color: var(--text); display: block; }
.video-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.watch-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
}
.watch-btn:hover { background: var(--brand); color: #fff; text-decoration: none; }

/* MINDMAP */
.mindmap-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: zoom-in;
  position: relative;
}
.mindmap-frame img { width: 100%; display: block; transition: transform 0.25s ease; }
.mindmap-frame:hover img { transform: scale(1.02); }

/* WHATSAPP */
.desc-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.83rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}

.wa-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 11px;
  width: 260px;
}
.search-wrap svg { color: var(--muted); flex-shrink: 0; }
.search-wrap input {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 8px 0;
  width: 100%;
  outline: none;
  font: inherit;
  font-size: 0.84rem;
}

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.fpill {
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.fpill.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(59, 130, 246, 0.4);
}

.wa-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 4px;
}
.wa-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.wa-card.mentor {
  border-left: 3px solid var(--green);
  background: linear-gradient(90deg, var(--green-soft), var(--surface-2) 32%);
}
.wa-card.me {
  border-left: 3px solid var(--brand);
}
.wa-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 0.79rem;
}
.wa-sender { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.wa-quote {
  font-size: 0.78rem;
  color: var(--muted);
  border-left: 2px solid var(--border-strong);
  padding-left: 9px;
  margin-bottom: 6px;
}
.wa-text { white-space: pre-wrap; word-break: break-word; font-size: 0.89rem; color: var(--text-soft); }

/* CHECKLIST & ZOOM */
.progress-bar-wrap {
  height: 9px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--green));
  transition: width 0.3s ease;
}

.checklist-stack { display: flex; flex-direction: column; gap: 10px; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.check-item:hover { border-color: var(--border-strong); }
.check-item input {
  margin-top: 3px;
  width: 17px; height: 17px;
  accent-color: var(--green);
  flex-shrink: 0;
}
.check-item.done { opacity: 0.72; }
.check-item.done .check-text { text-decoration: line-through; color: var(--muted); }
.check-text { font-size: 0.89rem; }

.zoom-rules { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.rule-chip {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid rgba(168, 85, 247, 0.28);
}

/* MARKDOWN */
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 16px 0 8px; line-height: 1.3; letter-spacing: -0.01em; }
.markdown-body h1 { font-size: 1.25rem; }
.markdown-body h2 { font-size: 1.06rem; padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 0.96rem; color: var(--brand); }
.markdown-body p { margin: 7px 0; color: var(--text-soft); }
.markdown-body ul, .markdown-body ol { margin: 7px 0; padding-left: 20px; color: var(--text-soft); }
.markdown-body li { margin: 4px 0; }
.markdown-body strong { color: var(--text); }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.markdown-body code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.84em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.markdown-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  overflow-x: auto;
}
.markdown-body pre code { border: none; padding: 0; background: transparent; }
.markdown-body blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 10px 10px 0;
}
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.84rem;
  display: block;
  overflow-x: auto;
}
.markdown-body th, .markdown-body td {
  border: 1px solid var(--border);
  padding: 8px 11px;
  text-align: left;
}
.markdown-body th { background: var(--surface-2); color: var(--text); font-weight: 700; }

/* FOOTER & LIGHTBOX */
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 4px 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}
.lightbox-close {
  position: fixed;
  top: 18px; right: 22px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.6rem;
  display: grid;
  place-items: center;
}

@media (max-width: 960px) {
  .kpi-grid, .roadmap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app-shell { padding: 12px 12px 28px; }
  .grid-2, .decision-branches { grid-template-columns: 1fr; }
  .rmd-flow { grid-template-columns: 1fr; }
  .rmd-arrow { transform: rotate(90deg); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .roadmap-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .msg { max-width: 96%; }
  .search-wrap { width: 100%; }
  .composer { flex-direction: column; }
  .composer button { width: 100%; }
  .video-card { flex-direction: column; align-items: flex-start; }
  .video-actions { flex-direction: row; align-items: center; }
}
