:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-soft: #eef2ff;
  --accent: #0ea5e9;

  --score-strong: #16a34a;
  --score-good: #2563eb;
  --score-needs: #d97706;
  --score-weak: #ea580c;
  --score-no: #dc2626;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.06);

  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 0.5em 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 1.25em; }

p { margin: 0 0 0.75em 0; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* Layout */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Top bar */
.topbar {
  background: #0b1120;
  color: #f8fafc;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: #f8fafc; }
.brand-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  padding: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
}
.brand-logo {
  height: 26px;
  width: auto;
  display: block;
}
.brand-sep {
  color: #475569;
  font-weight: 500;
  margin: 0 2px;
}
.brand-name { font-weight: 600; color: #f8fafc; }

.topnav { display: flex; gap: 8px; align-items: center; }
.org-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 0.82rem;
  color: var(--muted);
}
.org-switcher-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted);
}
.org-switcher select {
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  padding-right: 4px;
  cursor: pointer;
  outline: none;
}
.org-switcher select:focus { color: var(--primary); }
.topnav a {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
}
.topnav a.active { background: var(--primary-soft); color: var(--primary); }
.topnav a[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.topnav a[aria-disabled="true"]:hover { text-decoration: none; }

.topnav a.reset-link {
  color: #94a3b8;
  font-size: 0.85rem;
}
.topnav a.reset-link:hover {
  color: #fca5a5;
  text-decoration: none;
  background: transparent;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 2px;
  gap: 2px;
}
.lang-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--primary-soft); color: var(--primary); }

/* Views */
.view { padding: 40px 0 60px; }
.page-title { margin-bottom: 24px; }
.page-title h1 { margin-bottom: 4px; }

/* Dashboard — "My Plans" */
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.dash-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.dash-tab:hover { color: var(--text); }
.dash-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.dash-card { padding: 0; overflow: hidden; }
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.dash-table thead th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  padding: 12px 14px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}
.dash-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table tbody tr.dash-row:hover { background: #fafafa; cursor: pointer; }
.dash-client {
  font-weight: 600;
  color: var(--text);
}
.dash-status-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.dash-status-in_progress,
.dash-status-draft,
.dash-status-in_call { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.dash-status-ready_to_implement,
.dash-status-ready_for_implementation,
.dash-status-running { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.dash-status-pending_closer_review { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.dash-status-closer_working { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.dash-status-archived { background: #e5e7eb; color: #4b5563; border-color: #d1d5db; }
.dash-col-actions { width: 50px; }
.dash-row-menu-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}
.dash-row-menu-btn:hover { color: var(--text); background: #fff; border-color: var(--primary); }
.dash-muted { color: var(--muted); }
.dash-empty td { text-align: center; padding: 36px !important; }

/* Small modal for row actions (assign / archive) */
.dash-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.dash-modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.dash-modal h3 { margin: 0 0 14px; }
.dash-modal label { display: block; font-size: 0.85rem; font-weight: 600; margin: 12px 0 6px; }
.dash-modal select, .dash-modal input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.95rem;
}
.dash-modal-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px;
}

/* Change-password modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-card {
  background: #fff; border-radius: var(--radius);
  padding: 28px 28px 22px; width: 380px; max-width: calc(100vw - 32px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.modal-card h3 { margin: 0 0 18px; font-size: 1.1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

/* Form */
.form-card { max-width: 720px; }
.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field label {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 6px;
}
.req { color: var(--score-weak); }

input[type="text"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}
textarea { resize: vertical; }

.field-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.optional {
  margin-top: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: #fafbff;
}
.optional summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  list-style: none;
}
.optional summary::-webkit-details-marker { display: none; }
.optional summary::before {
  content: "+ ";
  display: inline-block;
  width: 1em;
  color: var(--primary);
  font-weight: 700;
}
.optional[open] summary::before { content: "− "; }
.optional-inner { margin-top: 12px; }

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.btn.primary {
  background: var(--primary);
  color: white;
}
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn.ghost:hover { background: #f1f5f9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Loading */
.loading {
  max-width: 560px;
  text-align: center;
  padding-top: 40px;
}
.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Shared loading card (scan + segments) ────────────────────────── */
.loading-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px 28px;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  text-align: center;
}
.loading-progress-wrap {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0 8px;
}
.loading-progress-bar {
  height: 100%;
  background: var(--brand-accent, var(--primary));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.loading-steps {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  text-align: left;
}
.loading-steps li {
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s, color 0.2s;
}
.loading-steps li::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #fff;
}
.loading-steps li.done {
  color: var(--text);
}
.loading-steps li.done::before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #16a34a;
  border-color: #16a34a;
}
.loading-steps li.active {
  color: var(--text);
  font-weight: 600;
  background: var(--surface);
}
.loading-steps li.active::before {
  border-color: var(--brand-accent, var(--primary));
  border-width: 2px;
  border-top-color: transparent;
  animation: spin-step 0.8s linear infinite;
  background: transparent;
}
@keyframes spin-step {
  to { transform: rotate(360deg); }
}

/* Results */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 20px;
}
.crumb { margin-bottom: 6px; }
.crumb a { font-size: 0.9rem; }

.score-badge {
  min-width: 180px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  box-shadow: var(--shadow);
}
.score-badge-num {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.score-badge-denom {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 2px;
}
.score-badge-label {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.score-badge.tier-strong { border-color: var(--score-strong); }
.score-badge.tier-strong .score-badge-label { color: var(--score-strong); }
.score-badge.tier-good { border-color: var(--score-good); }
.score-badge.tier-good .score-badge-label { color: var(--score-good); }
.score-badge.tier-needs { border-color: var(--score-needs); }
.score-badge.tier-needs .score-badge-label { color: var(--score-needs); }
.score-badge.tier-weak { border-color: var(--score-weak); }
.score-badge.tier-weak .score-badge-label { color: var(--score-weak); }
.score-badge.tier-no { border-color: var(--score-no); }
.score-badge.tier-no .score-badge-label { color: var(--score-no); }

.result-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
  align-items: start;
}
.result-row-2,
.result-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}
.market-size {
  padding: 10px 0 0;
}
.market-size-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.market-size-label {
  margin-top: 2px;
}
@media (max-width: 900px) {
  .result-grid { grid-template-columns: 1fr; }
  .result-row-2,
  .result-row-3 { grid-template-columns: 1fr; }
  .result-header { flex-direction: column; }
  .field-row { grid-template-columns: 1fr; }
}

.dimension-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.dimension-score {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.dimension-score span { color: var(--primary); }

.criteria {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.criterion {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  align-items: center;
}
.criterion-name {
  font-weight: 500;
  font-size: 0.95rem;
}
.criterion-value {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.criterion-value .weighted { color: var(--muted); font-weight: 400; margin-left: 4px; font-size: 0.85rem; }
.criterion-bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 3px;
  background: #eef1f6;
  overflow: hidden;
}
.criterion-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}
.criterion-bar-fill.s1 { background: var(--score-no); }
.criterion-bar-fill.s2 { background: var(--score-weak); }
.criterion-bar-fill.s3 { background: var(--score-needs); }
.criterion-bar-fill.s4 { background: var(--score-good); }
.criterion-bar-fill.s5 { background: var(--score-strong); }
.criterion-note {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: -2px;
}

.chart-wrap {
  position: relative;
  height: 280px;
}

.recommendation p { margin: 0; }

/* Extracted */
.extracted-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 24px;
}
@media (max-width: 900px) {
  .extracted-grid { grid-template-columns: 1fr; }
}
.bullet {
  padding-left: 18px;
  margin: 0;
}
.bullet li { margin-bottom: 4px; }

.kw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.kw-table th, .kw-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.kw-table th { color: var(--muted); font-weight: 500; }
.kw-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 500;
}

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

/* --- Narrow container (offers + funnel model) --- */
.container.narrow { max-width: 820px; }

/* ---------------------------------------------------------------- */
/* Results view — 3 peer cards (Offer / Messaging / Channel)         */
/* ---------------------------------------------------------------- */

.peer-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 0 0 22px 0;
}
@media (max-width: 900px) { .peer-cards { grid-template-columns: 1fr; } }

.peer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 160px;
}

.peer-head { margin-bottom: 10px; }
.peer-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.peer-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 400;
}

.peer-score {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin: 6px 0 4px;
}
.peer-score-denom {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 3px;
}

.peer-tier {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.peer-footer {
  margin-top: auto;
  padding-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}
.peer-expand {
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

/* Tier-based top border + tier label color for offer card */
.peer-offer.tier-strong { border-top-color: var(--score-strong); }
.peer-offer.tier-strong .peer-tier { color: var(--score-strong); }
.peer-offer.tier-good   { border-top-color: var(--score-good); }
.peer-offer.tier-good   .peer-tier { color: var(--score-good); }
.peer-offer.tier-needs  { border-top-color: var(--score-needs); }
.peer-offer.tier-needs  .peer-tier { color: var(--score-needs); }
.peer-offer.tier-weak   { border-top-color: var(--score-weak); }
.peer-offer.tier-weak   .peer-tier { color: var(--score-weak); }
.peer-offer.tier-no     { border-top-color: var(--score-no); }
.peer-offer.tier-no     .peer-tier { color: var(--score-no); }

/* Messaging tier colors */
.peer-messaging.tier-strong_messaging { border-top-color: var(--score-strong); }
.peer-messaging.tier-solid_with_gaps  { border-top-color: var(--score-good); }
.peer-messaging.tier-significant_gaps { border-top-color: var(--score-needs); }
.peer-messaging.tier-main_blocker     { border-top-color: var(--score-no); }
.peer-messaging .peer-tier.tier-strong_messaging { color: var(--score-strong); }
.peer-messaging .peer-tier.tier-solid_with_gaps  { color: var(--score-good); }
.peer-messaging .peer-tier.tier-significant_gaps { color: var(--score-needs); }
.peer-messaging .peer-tier.tier-main_blocker     { color: var(--score-no); }

/* Channel card is informational — neutral top border */
.peer-channel { border-top-color: #8b5cf6; }

.messaging-placeholder p { margin: 0; }

/* Confidence badge */
.confidence-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.confidence-high   { background: #dcfce7; color: #166534; }
.confidence-medium { background: #fef3c7; color: #92400e; }
.confidence-low    { background: #fee2e2; color: #991b1b; }

/* Channel card content */
.channel-primary-line {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.channel-primary-line .combinator {
  color: var(--muted);
  font-weight: 500;
  margin: 0 4px;
}
.channel-split {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.channel-split-bar {
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: #eef1f6;
  display: flex;
  margin-top: 2px;
}
.channel-split-bar > span { display: block; height: 100%; }
.channel-split-bar > span.split-meta     { background: #1877f2; }
.channel-split-bar > span.split-google   { background: #4285f4; }
.channel-split-bar > span.split-linkedin { background: #0a66c2; }

/* Messaging detail card */
.messaging-detail, .channel-detail { padding: 22px 26px; margin-bottom: 20px; }
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}
.detail-head h3 { margin: 0; }
.section-sub {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin: 24px 0 10px;
}

.messaging-dims {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 700px) { .messaging-dims { grid-template-columns: 1fr; } }

.m-dim {
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.m-dim-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.m-dim-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.m-dim-score {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.m-dim-score.s1 { color: var(--score-no); }
.m-dim-score.s2 { color: var(--score-weak); }
.m-dim-score.s3 { color: var(--score-needs); }
.m-dim-score.s4 { color: var(--score-good); }
.m-dim-score.s5 { color: var(--score-strong); }
.m-dim-score-denom { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.m-dim-why { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }

.messaging-recs { display: flex; flex-direction: column; gap: 10px; }
.m-rec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 14px 18px;
}
.m-rec.impact-high   { border-left-color: var(--score-no); }
.m-rec.impact-medium { border-left-color: var(--score-needs); }
.m-rec.impact-low    { border-left-color: var(--score-good); }

.m-rec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.m-rec-dim {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.m-rec-impact {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}
.m-rec-impact.high   { background: #fee2e2; color: #991b1b; }
.m-rec-impact.medium { background: #fef3c7; color: #92400e; }
.m-rec-impact.low    { background: #dcfce7; color: #166534; }

.m-rec-current {
  padding: 6px 10px;
  background: #fef2f2;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 0.88rem;
  color: #7f1d1d;
  font-family: inherit;
}
.m-rec-current::before { content: "Current: "; font-weight: 600; color: var(--muted); }

.m-rec-suggested {
  padding: 6px 10px;
  background: #f0fdf4;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: #14532d;
  font-weight: 500;
}
.m-rec-suggested::before { content: "Suggested: "; font-weight: 600; color: var(--muted); font-weight: 700; }
.m-rec-reason {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
}

/* Channel breakdown */
.channel-rationale {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: #fafbff;
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
}

.channel-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ch-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 120px 60px 1fr;
  gap: 14px;
  align-items: center;
}
.ch-row.recommended { border-color: var(--primary); background: #fafbff; }
.ch-row.ruled-out   { opacity: 0.7; }
.ch-name {
  font-weight: 700;
  font-size: 1rem;
}
.ch-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: right;
}
.ch-score-denom { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.ch-why { font-size: 0.88rem; color: var(--text); line-height: 1.4; }
.ch-ruled {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  margin-left: 8px;
}

/* Channel editor (override recommendation) */
.channel-editor {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.channel-editor .editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.channel-editor .editor-head h4 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.ed-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
}
.ed-status.modified {
  background: #fef3c7;
  color: #92400e;
}

.ed-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
@media (max-width: 700px) { .ed-row { grid-template-columns: 1fr; } }
.ed-row > label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ed-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ed-pill {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.ed-pill:hover:not(.disabled) { background: #f1f5f9; }
.ed-pill.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}
.ed-pill.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ed-slider-row.hidden { display: none; }
.ed-slider-wrap .ed-slider {
  margin: 4px 0 8px;
}
.ed-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
}

.ed-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}


/* --- Mode toggle (website vs manual) --- */
.mode-toggle {
  display: flex;
  max-width: 720px;
  margin: 0 auto 16px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.mode-btn {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* --- URL-only form --- */
.form-card.url-only {
  max-width: 720px;
  padding: 28px 32px;
  margin: 0 auto 14px;
  border: 1px solid var(--border);
}
.form-card.url-only .field-url label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.form-card.url-only .field-url input {
  font-size: 1.15rem;
  padding: 14px 16px;
  font-weight: 500;
}
.form-card.url-only .form-actions { margin-top: 8px; }

.advanced {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}
.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  list-style: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before {
  content: "+ ";
  display: inline-block;
  width: 1em;
  color: var(--primary);
  font-weight: 700;
}
.advanced[open] summary::before { content: "− "; }
.advanced-inner {
  margin-top: 12px;
  padding: 14px 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #fafbff;
}
.advanced-inner .field { margin-bottom: 12px; }

/* --- Clarify view --- */
.extracted-card {
  padding: 20px 24px;
  margin-bottom: 22px;
}

/* Case studies table */
.case-studies-card {
  padding: 16px 16px 14px;
  margin-bottom: 18px;
}
.cs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.cs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 1200px;
}
.cs-table thead th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  white-space: nowrap;
}
.cs-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cs-table tbody tr:last-child td { border-bottom: none; }
.cs-table input,
.cs-table select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  background: #fff;
  color: var(--text);
  min-width: 120px;
}
.cs-table input:focus,
.cs-table select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}
.cs-col-remove { width: 36px; }
.cs-remove-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.cs-remove-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.cs-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.cs-hint { margin: 8px 0 0; }
.extracted-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.extracted-head h3 { margin: 0; font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.extracted-head h3 span { color: var(--text); font-weight: 600; }
.btn-small { padding: 4px 10px; font-size: 0.8rem; }

.extracted-list {
  margin: 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  row-gap: 8px;
  column-gap: 14px;
  font-size: 0.9rem;
}
.extracted-list dt {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding-top: 2px;
}
.extracted-list dd { margin: 0; color: var(--text); font-weight: 500; }
.extracted-list .extracted-unknown { color: var(--muted); font-style: italic; font-weight: 400; }
.extracted-edit-input {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}
.extracted-edit-input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}
.extracted-list .extracted-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
}
.extracted-list .extracted-badge.warn { background: #fef3c7; color: #92400e; }
.extracted-list .extracted-badge.bad  { background: #fee2e2; color: #991b1b; }

.clarify-questions { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.service-picker { margin-bottom: 16px; }
.service-picker h3 { font-size: 1rem; margin-bottom: 4px; }
.service-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.service-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); transition: background 0.15s;
}
.service-option:has(input:checked) { background: var(--primary-soft, #eff6ff); border-color: var(--primary); }
.service-option input[type=radio] { margin-top: 3px; flex-shrink: 0; accent-color: var(--primary); }
.service-option-label { display: flex; flex-direction: column; gap: 2px; font-weight: 500; }
.service-option-desc { font-weight: 400; font-size: 0.82rem; }
.service-manual-wrap { margin-top: 10px; }
.service-updating { opacity: 0.7; pointer-events: none; }
.service-updating::after { content: " ↻ Updating…"; font-size: 0.8rem; color: var(--muted); }
.service-manual-wrap input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; }

.clarify-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.clarify-card.answered { border-left-color: var(--score-strong); background: #fafdfb; }
.clarify-card.optional { border-left-color: var(--muted); background: #fbfbfc; }
.clarify-card.optional.answered { border-left-color: var(--score-strong); }

.clarify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.clarify-q {
  font-weight: 600;
  font-size: 1rem;
}
.clarify-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  flex-shrink: 0;
}
.clarify-badge.required { background: #fee2e2; color: #991b1b; }
.clarify-badge.optional { background: #f1f5f9; color: var(--muted); }
.clarify-why {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.clarify-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.clarify-option {
  padding: 8px 14px;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
}
.clarify-option:hover { background: #e2e8f0; }
.clarify-option.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.clarify-text-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.clarify-text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,64,175,0.12);
}
.clarify-suggestion {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}
.clarify-suggestion a {
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
}

/* Multi-select + custom values */
.clarify-options.multi .clarify-option {
  background: var(--surface);
  border: 1px solid var(--border);
}
.clarify-options.multi .clarify-option::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: -3px;
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
}
.clarify-options.multi .clarify-option.selected {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}
.clarify-options.multi .clarify-option.selected::before {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px var(--surface);
}
.clarify-custom {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.clarify-custom-input { flex: 1; }
.clarify-chosen {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.clarify-chip {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 4px 10px;
  font-size: 0.82rem;
  border-radius: 999px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.clarify-chip button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
}
.clarify-chip button:hover { opacity: 1; }

/* ---------------------------------------------------------------- */
/* Segments view                                                     */
/* ---------------------------------------------------------------- */

.offer-recap {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .offer-recap { grid-template-columns: 1fr; } }

.recap-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 2px; }
.recap-sub { font-size: 0.88rem; }

.recap-scores {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recap-score {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: baseline;
  gap: 8px;
  font-size: 0.95rem;
}
.recap-score-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.recap-score-value { font-size: 1.25rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.recap-score-denom { color: var(--muted); font-size: 0.88rem; }
.recap-score.total .recap-score-value { color: var(--primary); font-size: 1.55rem; }

.recap-chart {
  position: relative;
  height: 160px;
}

/* Loading state */
.seg-loading {
  margin-bottom: 20px;
}
.seg-current-step {
  font-size: 0.85rem;
  font-weight: 600;
  color: #166534;
  margin: 6px 0 0;
  min-height: 1.2em;
  text-align: center;
}
.seg-loading-why {
  max-width: 540px;
  margin: 0 auto 24px;
  font-size: 0.9rem;
  line-height: 1.65;
  text-align: left;
  padding: 14px 16px;
  background: var(--primary-soft, #eff6ff);
  border-left: 3px solid var(--brand-accent, var(--primary));
  border-radius: 4px;
}
/* seg-progress-wrap/bar now use .loading-progress-* shared classes */
.seg-loading h3 { margin-bottom: 16px; }
.seg-steps {
  max-width: 480px;
  margin: 16px auto 0;
}

/* Recommendation */
.recommendation-card {
  padding: 22px 24px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary);
}
.rec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.rec-head h3 { margin: 0; }
.strategy-pills {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px;
}
.pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pill:hover { color: var(--text); }
.pill.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.rec-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.rec-reasoning { font-size: 0.92rem; line-height: 1.55; }

/* Segment list */
.seg-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 8px 0;
}
.seg-list-head h3 { margin: 0; }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}
.toggle input { accent-color: var(--primary); }

.segment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seg-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.15s;
}
.seg-item:hover { border-color: #cbd5e1; }
.seg-item.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,64,175,0.08), var(--shadow-sm); }
.seg-item.pruned { opacity: 0.55; }
.seg-item.recommended { border-color: var(--primary); background: linear-gradient(180deg, #fafbff 0%, #ffffff 80%); }

.seg-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
}
.seg-rank {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.seg-rank.broad { color: #94a3b8; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.seg-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.seg-title .dim-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.seg-title .dim-tag--custom {
  background: #fef3c7;
  color: #92400e;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Custom segment form ──────────────────────────────────────────────────── */
.custom-seg-form { margin-top: 24px; }

/* Trigger: collapsed CTA */
.csf-trigger-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  text-align: left;
  font-family: inherit;
}
.csf-trigger-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.csf-trigger-btn .csf-t-arrow {
  margin-left: auto;
  font-size: 1.1rem;
  font-weight: 400;
  transition: transform 0.25s ease;
  line-height: 1;
}
.custom-seg-form.csf-open .csf-trigger-btn .csf-t-arrow { transform: rotate(90deg); }
.custom-seg-form.csf-open .csf-trigger-btn {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-style: solid;
}

/* Expandable body */
.csf-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.custom-seg-form.csf-open .csf-body {
  max-height: 800px;
  opacity: 1;
}

.csf-body-inner {
  padding: 20px 22px 18px;
  border: 1.5px solid var(--primary);
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  background: var(--bg-card);
}

/* Header inside expanded form */
.csf-head { margin-bottom: 16px; }
.csf-head-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}
.csf-head-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* Progress bar (hidden by default) */
.csf-progress {
  display: none;
  margin-bottom: 14px;
}
.custom-seg-form.csf-loading .csf-progress { display: block; }
.csf-progress-track {
  height: 4px;
  background: var(--primary-soft);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  margin-bottom: 6px;
}
.csf-progress-fill {
  position: absolute;
  top: 0; bottom: 0; left: -40%;
  width: 40%;
  background: var(--primary);
  border-radius: 4px;
  animation: csf-indeterminate 1.6s ease-in-out infinite;
}
@keyframes csf-indeterminate {
  0%   { left: -40%; width: 40%; }
  50%  { left: 25%;  width: 60%; }
  100% { left: 100%; width: 40%; }
}
.csf-progress-msg {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
  margin: 0;
}

/* Success flash */
.csf-success {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  margin-bottom: 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  color: #15803d;
  font-size: 0.83rem;
  font-weight: 500;
}
.csf-success.csf-visible { display: flex; }

/* Fields */
.csf-fields {
  display: grid;
  gap: 11px;
  margin-bottom: 16px;
  transition: opacity 0.2s;
}
.custom-seg-form.csf-loading .csf-fields {
  opacity: 0.35;
  pointer-events: none;
}
.csf-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.csf-field label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.csf-field .csf-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.73rem;
}
.csf-field input,
.csf-field textarea {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.csf-field input:focus,
.csf-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.csf-field input::placeholder,
.csf-field textarea::placeholder { color: #9ca3af; }

/* Footer: submit + cancel */
.csf-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s;
}
.custom-seg-form.csf-loading .csf-footer {
  opacity: 0.35;
  pointer-events: none;
}
.csf-cancel-btn {
  font-size: 0.85rem;
  padding: 8px 14px;
}

/* Flash highlight when a new custom segment lands in the list */
@keyframes seg-flash {
  0%   { background: #eef2ff; box-shadow: 0 0 0 2px var(--primary); }
  100% { background: transparent; box-shadow: none; }
}
.seg-item--flash { animation: seg-flash 1.4s ease-out forwards; }
.seg-title .rec-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}
.seg-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.seg-meta span::after { content: "·"; margin-left: 10px; color: #cbd5e1; }
.seg-meta span:last-child::after { content: ""; margin: 0; }

.seg-total {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
  min-width: 74px;
}
.seg-total.strong { color: var(--score-strong); }
.seg-total.good   { color: var(--score-good); }
.seg-total.needs  { color: var(--score-needs); }
.seg-total.weak   { color: var(--score-weak); }
.seg-total.no     { color: var(--score-no); }
.seg-total-denom { color: var(--muted); font-size: 0.9rem; font-weight: 500; }

.seg-chevron {
  color: var(--muted);
  font-size: 1.1rem;
  transition: transform 0.15s;
}
.seg-item.expanded .seg-chevron { transform: rotate(90deg); }

/* Expanded detail */
.seg-detail {
  display: none;
  padding: 6px 22px 24px;
  border-top: 1px solid var(--border);
  background: #fafbfd;
}
.seg-item.expanded .seg-detail { display: block; }

.seg-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 14px;
}
@media (max-width: 900px) { .seg-detail-grid { grid-template-columns: 1fr; } }

.seg-detail h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 10px 0 4px 0;
  font-weight: 700;
}
.seg-detail p { margin: 0 0 6px 0; font-size: 0.9rem; }
.seg-pain {
  padding: 12px 14px;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text);
  margin: 10px 0;
  font-size: 0.92rem;
}

.seg-attribute-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px 0;
}
.seg-attribute-list li {
  padding: 2px 0 2px 14px;
  position: relative;
  font-size: 0.9rem;
}
.seg-attribute-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.seg-kw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.seg-kw-table th, .seg-kw-table td {
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid #eef1f6;
}
.seg-kw-table th { color: var(--muted); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; }
.seg-kw-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.seg-case-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.seg-case-row label {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}
.seg-case-row input[type="number"] {
  width: 64px;
  padding: 6px 10px;
  text-align: center;
  font-weight: 600;
}
.seg-case-proof {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
}
.seg-case-proof strong { color: var(--text); font-weight: 600; }

.seg-radar-wrap {
  position: relative;
  height: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.seg-radar-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}
.seg-radar-legend .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.seg-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.seg-prune-reason {
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
  margin: 4px 0 0 54px;
}

/* Channel tag on segment row */
.seg-channel-tag {
  background: #ede9fe;
  color: #6d28d9;
  padding: 1px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.78rem;
}

/* Channel block inside segment detail */
.seg-channel-block {
  margin-top: 4px;
}
.seg-channel-primary {
  font-size: 1rem;
  font-weight: 700;
  color: #6d28d9;
  margin-bottom: 6px;
}
.seg-channel-rationale {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #faf5ff;
  border-left: 2px solid #8b5cf6;
  border-radius: 0 4px 4px 0;
}
.seg-channel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.seg-ch-row {
  display: grid;
  grid-template-columns: 90px 48px 1fr;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.seg-ch-row.rec { border-color: #ddd6fe; background: #faf5ff; }
.seg-ch-row.out { opacity: 0.7; }
.seg-ch-name { font-weight: 600; }
.seg-ch-out-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #fef3c7;
  color: #92400e;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  margin-left: 4px;
}
.seg-ch-score { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.seg-ch-why { color: var(--text); line-height: 1.4; }

/* Channel context label on main Results card */
.channel-context {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.channel-context strong { color: var(--text); }

/* Channel pills (override control) */
.channel-pills {
  display: flex;
  gap: 6px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}
.ch-pill {
  appearance: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ch-pill:hover { border-color: var(--primary); }
.ch-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.ch-pill-score {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.75;
}
.ch-pill.active .ch-pill-score { opacity: 1; color: #fff; }
.channel-why {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 4px;
}
.channel-why-hint {
  margin-top: 2px;
}
.channel-why-item {
  margin-top: 6px;
}
.channel-why-item:first-child { margin-top: 0; }
.channel-why-item strong { color: var(--text); }

/* --- Offers view --- */
.offers-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 18px;
}

.offer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}
.offer-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}
.offer-card-head .offer-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.offer-card-head .offer-name-input {
  width: 100%;
  padding: 6px 0;
  font-size: 1.35rem;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid var(--border);
  background: transparent;
  border-radius: 0;
  color: var(--text);
}
.offer-card-head .offer-name-input:focus {
  outline: none;
  border-bottom-color: var(--primary);
  box-shadow: none;
}
.offer-profit-box {
  flex-shrink: 0;
  background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 12px 20px;
  text-align: center;
  min-width: 150px;
}
.offer-profit-box .kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #166534;
  font-weight: 600;
  margin-bottom: 2px;
}
.offer-profit-box .kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #15803d;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.offer-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.offer-meta-row.single { grid-template-columns: 1fr; }
@media (max-width: 700px) { .offer-meta-row { grid-template-columns: 1fr; } }

/* Single-handle slider (used for upsell rate) */
.upsell-rate-field {
  background: #fafbff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.upsell-rate-field label {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.single-slider {
  position: relative;
  height: 28px;
  margin: 8px 4px 4px;
}
.single-slider .track {
  position: absolute;
  top: 12px;
  left: 0; right: 0;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
}
.single-slider .single-range {
  position: absolute;
  top: 12px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  pointer-events: none;
}
.single-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 28px;
  background: transparent;
  z-index: 2;
  margin: 0;
}
.single-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.1s;
}
.single-slider input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
.single-slider input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.single-slider-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 6px;
  padding: 0 4px;
}
.single-slider-value strong {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.single-slider-value .muted-xs {
  margin-top: 0;
  display: inline;
}

.meta-field label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.meta-field .static-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  padding: 8px 0;
}
.meta-field input,
.meta-field select {
  padding: 8px 10px;
  font-size: 0.92rem;
}

.deliverable-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.deliverable-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.deliverable-table th {
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.deliverable-table td {
  padding: 4px 3px;
  border-bottom: 1px solid #f1f3f7;
}
.deliverable-table td.num { text-align: right; }
.deliverable-table th.num { text-align: right; }
.deliverable-table input {
  padding: 8px 10px;
  font-size: 0.9rem;
  border: 1px solid transparent;
  background: #fafbfd;
  border-radius: 6px;
  width: 100%;
}
.deliverable-table input:focus {
  border-color: var(--primary);
  background: var(--surface);
}
.deliverable-table input[type="number"] { text-align: right; }
.deliverable-table .name-col { width: 45%; }
.deliverable-table .qty-col  { width: 12%; }
.deliverable-table .cost-col { width: 20%; }
.deliverable-table .price-col { width: 23%; }
.deliverable-table .row-delete {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.deliverable-table .row-delete:hover { color: var(--score-no); }

.deliverable-add {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  font-weight: 500;
}
.deliverable-add:hover { border-color: var(--primary); color: var(--primary); }

/* --- Funnel model view --- */
.funnel-card { padding: 24px 28px; margin-bottom: 24px; }

/* Offer reminder strip at the top of the funnel page */
.offer-reminder {
  padding: 16px 20px;
  margin-bottom: 18px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
}
.offer-reminder-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.offer-reminder-icon { font-size: 1.2rem; }
.offer-reminder-title {
  font-weight: 700;
  color: #78350f;
}
.offer-reminder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.offer-reminder-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
}
.offer-reminder-card.entry { border-top: 3px solid var(--primary); }
.offer-reminder-card.upsell { border-top: 3px solid #8b5cf6; }
.offer-reminder-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}
.offer-reminder-name {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  margin-bottom: 10px;
}
.offer-reminder-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 0;
}
.offer-reminder-kpis dt {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.offer-reminder-kpis dd {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.offer-reminder-kpis .highlight dd { color: var(--primary); }
.offer-reminder-kpis dd.negative { color: #b91c1c; }
.offer-reminder-extra {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
@media (max-width: 900px) {
  .offer-reminder-grid { grid-template-columns: 1fr; }
}

.channel-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.channel-bar label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}
.channel-bar select {
  padding: 6px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  width: 160px;
}
.channel-bar .btn { margin-left: auto; }

.stage-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Funnel sections (Marketing / Sales) */
.funnel-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}
.funnel-section.marketing-section { border-color: #dbeafe; }
.funnel-section.sales-section     { border-color: #e5e7eb; }

.funnel-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fafbff;
  border-bottom: 1px solid var(--border);
  width: 100%;
  text-align: left;
  font-family: inherit;
  border: none;
  cursor: default;
}
.marketing-section .funnel-section-head { background: #eff6ff; border-bottom-color: #dbeafe; }
.funnel-section-head.collapsible { cursor: pointer; }
.funnel-section-head.collapsible:hover { background: #f1f5f9; }

.funnel-section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.section-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1e40af;
}
.section-tag.sales { background: #ede9fe; color: #6d28d9; }
.section-sub-note {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 400;
}

.chevron {
  font-size: 0.9rem;
  color: var(--muted);
  transition: transform 0.15s;
}
.funnel-section.collapsed .chevron { transform: rotate(-90deg); }

.funnel-section-body {
  padding: 4px 16px 12px;
}
.funnel-section.collapsed .funnel-section-body { display: none; }

.funnel-section-summary {
  display: none;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
}
.funnel-section.collapsed .funnel-section-summary { display: block; }
.funnel-section-summary .summary-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.funnel-section-summary .summary-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.funnel-section-summary .summary-value strong {
  font-size: 1.55rem;
  font-weight: 800;
  color: #6d28d9;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.funnel-section-summary .summary-range {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stage {
  padding: 14px 2px 14px;
  border-bottom: 1px solid #f1f3f7;
}
.stage:last-child { border-bottom: none; }
.stage.computed { opacity: 1; }

.stage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.stage-label {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
}
.stage-label .hint {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
  margin-left: 8px;
}
.stage-cost {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.stage-cost strong {
  color: var(--text);
  font-weight: 600;
}
.stage-cost .cost-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 600;
}

/* Dual-handle range slider */
.range-slider {
  position: relative;
  height: 28px;
  margin: 6px 12px 4px;
}
.range-slider .track {
  position: absolute;
  top: 12px;
  left: 0; right: 0;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
}
.range-slider .range {
  position: absolute;
  top: 12px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  pointer-events: none;
}
.range-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 28px;
  background: transparent;
  pointer-events: none; /* only thumb gets pointer events */
  z-index: 3;
  margin: 0;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.1s;
}
.range-slider input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
.range-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.range-slider input[type="range"]::-webkit-slider-runnable-track { background: transparent; border: none; }

.range-labels {
  display: flex;
  justify-content: space-between;
  margin: 4px 12px 0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.range-labels .lbl-worst,
.range-labels .lbl-best {
  color: var(--muted);
  font-weight: 500;
}
.range-labels .lbl-expected {
  color: var(--primary);
  font-weight: 700;
}
.range-labels .lbl-expected::before {
  content: "★ ";
  opacity: 0.7;
}
.range-labels.single {
  justify-content: center;
}
.range-labels.single .lbl-current {
  color: var(--primary);
  font-weight: 700;
}
.range-slider.single .slider-bubble.bubble-single {
  transform: translateX(-50%);
}

/* Fixed (computed) stages — no slider */
.stage.computed .stage-body {
  padding: 4px 12px;
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.stage.computed .stage-body strong { color: var(--text); font-weight: 600; }

/* Scenarios summary */
.scenarios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.scenarios.single { grid-template-columns: 1fr; }
@media (max-width: 900px) { .scenarios { grid-template-columns: 1fr; } }

.scenario {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--border);
}
.scenario-worst    { border-top-color: var(--score-weak); }
.scenario-expected { border-top-color: var(--primary); background: #fafbff; }
.scenario-best     { border-top-color: var(--score-strong); }

.scenario-head { margin-bottom: 12px; }
.scenario-head h3 {
  margin: 0 0 2px 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
}
.scenario-worst .scenario-head h3 { color: var(--score-weak); }
.scenario-expected .scenario-head h3 { color: var(--primary); }
.scenario-best .scenario-head h3 { color: var(--score-strong); }

.scenario-kpis {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scenario-kpis > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #f1f3f7;
}
.scenario-kpis > div:last-child { border-bottom: none; }
.scenario-kpis dt {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  margin: 0;
}
.scenario-kpis dd {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.scenario-kpis .highlight {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: none;
  margin-top: 4px;
}
.scenario-kpis .highlight dt { font-weight: 600; color: var(--text); }
.scenario-kpis .highlight dd {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.scenario-worst .scenario-kpis .highlight dd { color: var(--score-weak); }
.scenario-expected .scenario-kpis .highlight dd { color: var(--primary); }
.scenario-best .scenario-kpis .highlight dd { color: var(--score-strong); }
.scenario-kpis dd.negative {
  color: var(--score-no) !important;
}

/* Compact KPI rows reused in upsell blocks */
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.kpi-green {
  background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: #86efac;
}
.kpi-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #166534;
  line-height: 1.4;
}
.muted-xs {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  display: block;
  margin-top: 2px;
}
.kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #15803d;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Upsell blocks */
.upsell-block {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  box-shadow: var(--shadow-sm);
}
.upsell-block h3 {
  margin: 0 0 14px 0;
  font-size: 1.05rem;
  color: var(--primary);
}
.upsell-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-bottom: 18px;
}
.upsell-table tr td {
  padding: 8px 6px;
  border-bottom: 1px solid #f1f3f7;
}
.upsell-table tr:last-child td { border-bottom: none; }
.upsell-table .label-col { color: var(--text); font-weight: 500; }
.upsell-table .value-col { text-align: right; width: 150px; }
.upsell-table .value-box {
  display: inline-block;
  min-width: 130px;
  padding: 6px 14px;
  background: #eef1f6;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.footbar {
  border-top: 1px solid var(--border);
  padding: 16px 0 24px;
  margin-top: 40px;
}

/* Floating tooltip for radar chart axis labels */
.radar-tooltip {
  position: fixed;
  background: #0f172a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 10000;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  max-width: 280px;
}
.radar-tooltip.visible { opacity: 1; }
.radar-tooltip strong { color: #fff; font-weight: 700; }
.footbar code {
  background: #eef1f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ============================================================
   Stage 1 — Journey rail + Welcome view
   ============================================================ */

/* Session badge next to brand */
.brand-session {
  margin-left: 12px;
  padding: 4px 10px;
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  font-weight: 500;
}
.brand-session:empty { display: none; }

/* Journey rail (9-stage progress, sticky under topbar) */
.journey-rail {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 59px;
  z-index: 9;
}
.journey-rail-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 24px;
}
.journey-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: space-between;
  overflow-x: hidden;
}
.journey-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
  flex: 0 1 auto;
  min-width: 0;
}
.journey-step:hover {
  background: #f1f5f9;
  color: var(--text);
}
.journey-step.locked {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}
.journey-step .js-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e5e7eb;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0 4px;
  flex: 0 0 auto;
}
.journey-step .js-label {
  font-weight: 500;
}
.journey-step.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(30, 64, 175, 0.15);
}
.journey-step.active .js-num {
  background: var(--primary);
  color: white;
}
.journey-step.done {
  color: var(--score-strong);
}
.journey-step.done .js-num {
  background: var(--score-strong);
  color: white;
}

/* Welcome view shell */
.welcome-container {
  max-width: 920px;
}
.welcome-step[hidden] { display: none !important; }
.welcome-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}
.welcome-title {
  font-size: 2rem;
  margin-bottom: 6px;
}
.welcome-title em { color: var(--muted); font-style: normal; }
.welcome-sub {
  margin-bottom: 24px;
  font-size: 1.02rem;
}
.welcome-card {
  max-width: 720px;
}
.welcome-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.welcome-actions.between {
  justify-content: space-between;
}

/* Why clients buy — node graphic */
.buy-graph {
  padding: 28px 24px;
}
.buy-nodes {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
}
.buy-node {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-top: 6px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
  opacity: 0.28;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

/* Per-node accent colors when revealed — Problem / Solution / Gap / Product */
.buy-node[data-node="1"].revealed {
  opacity: 1;
  transform: translateY(0);
  background: linear-gradient(180deg, #fee2e2 0%, #fef2f2 60%, #ffffff 100%);
  border-color: #fca5a5;
  border-top-color: #dc2626;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.22);
}
.buy-node[data-node="1"].revealed .buy-node-icon { color: #dc2626; font-size: 1.4rem; }
.buy-node[data-node="1"].revealed .buy-node-title { color: #991b1b; }

.buy-node[data-node="2"].revealed {
  opacity: 1;
  transform: translateY(0);
  background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 60%, #ffffff 100%);
  border-color: #93c5fd;
  border-top-color: #0284c7;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.22);
}
.buy-node[data-node="2"].revealed .buy-node-icon { color: #0284c7; font-size: 1.4rem; }
.buy-node[data-node="2"].revealed .buy-node-title { color: #075985; }

.buy-node[data-node="3"].revealed {
  opacity: 1;
  transform: translateY(0);
  background: linear-gradient(180deg, #fef3c7 0%, #fffbeb 60%, #ffffff 100%);
  border-color: #fcd34d;
  border-top-color: #f59e0b;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.28);
}
.buy-node[data-node="3"].revealed .buy-node-icon { color: #d97706; font-size: 1.4rem; }
.buy-node[data-node="3"].revealed .buy-node-title { color: #92400e; }

.buy-node[data-node="4"].highlight.revealed {
  opacity: 1;
  transform: translateY(0);
  background: linear-gradient(180deg, #bbf7d0 0%, #dcfce7 60%, #ffffff 100%);
  border-color: #16a34a;
  border-top-color: #16a34a;
  box-shadow: 0 10px 28px rgba(22, 163, 74, 0.3);
}
.buy-node[data-node="4"].highlight.revealed .buy-node-icon { color: #16a34a; font-size: 1.4rem; }
.buy-node[data-node="4"].highlight.revealed .buy-node-title { color: #14532d; }

/* Small colored tag that appears inside each revealed node so the node
   identity reads at a glance even on cached styles. */
.buy-node::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: white;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.buy-node.revealed::after { opacity: 1; }
.buy-node[data-node="1"]::after { content: "Pain";    background: #dc2626; }
.buy-node[data-node="2"]::after { content: "Wanted";  background: #0284c7; }
.buy-node[data-node="3"]::after { content: "Stuck";   background: #f59e0b; }
.buy-node[data-node="4"]::after { content: "Answer";  background: #16a34a; }

.buy-node-icon {
  font-size: 1.25rem;
  color: var(--muted);
  font-weight: 700;
  transition: color 0.4s ease;
}
.buy-node-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  transition: color 0.4s ease;
}
.buy-node-text {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.buy-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
  font-size: 1.4rem;
  font-weight: 700;
  opacity: 0.4;
  transition: color 0.4s ease, opacity 0.4s ease, transform 0.4s ease;
}
.buy-arrow[data-arrow="1"].revealed {
  color: #dc2626; opacity: 1;
}
.buy-arrow[data-arrow="2"].revealed {
  color: #f59e0b; opacity: 1;
}
.buy-arrow[data-arrow="3"].revealed {
  color: #16a34a; opacity: 1;
  transform: scale(1.15);
}

.buy-lesson {
  margin-top: 24px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  border: 1px solid rgba(30, 64, 175, 0.2);
  border-radius: var(--radius);
  animation: fadeInUp 0.4s ease;
}
.buy-lesson p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
}
.lesson-badge {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.reveal-actions .btn:disabled { opacity: 0.35; }

/* Why most funnels fail — grouped by symptom, selectable */
.fail-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.fail-group {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.fail-group:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.fail-group:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.fail-group[aria-checked="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
  background: var(--primary-soft);
}
.fail-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.fail-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.fail-group-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fail-group-check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: #fff;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.fail-group[aria-checked="true"] .fail-group-check {
  border-color: var(--primary);
  background: var(--primary);
}
.fail-group[aria-checked="true"] .fail-group-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.fail-group-simple .fail-group-body {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.fail-cards {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 4px;
}
.fail-group[aria-checked="true"] .fail-cards {
  display: grid;
}
.fail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
}
.fail-card h3 {
  font-size: 1rem;
  margin-top: 12px;
  margin-bottom: 6px;
}
.fail-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.fail-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.9rem;
}

.bubble-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius);
}
.bubble-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex: 0 0 auto;
}
.bubble-callout p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #78350f;
}

/* Roadmap list */
.roadmap {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.roadmap li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.roadmap-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}
.roadmap-text {
  flex: 1;
  font-size: 0.98rem;
  line-height: 1.55;
}
.roadmap-text strong { color: var(--text); }

/* Responsive */
@media (max-width: 900px) {
  .buy-nodes {
    grid-template-columns: 1fr;
  }
  .buy-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }
  .fail-cards {
    grid-template-columns: 1fr;
  }
  .journey-steps {
    gap: 4px;
  }
  .journey-step .js-label {
    display: none;
  }
  .score-sides {
    grid-template-columns: 1fr !important;
  }
  .score-sides .side-demand {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }
}

/* ============================================================
   Stage 2 — Pre-score teaching + action items
   ============================================================ */

.prescore-teaching { padding-top: 12px; }
.prescore-teaching[hidden] { display: none !important; }

.score-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  overflow: hidden;
}
.score-side {
  padding: 22px 24px;
}
.score-side.side-demand {
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 70%);
}
.score-side.side-desire {
  background: linear-gradient(180deg, #fef3ec 0%, #ffffff 70%);
}
.side-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 14px;
  min-height: 62px;
}
.side-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.side-badge.demand {
  background: #dbeafe;
  color: #1e40af;
}
.side-badge.desire {
  background: #fed7aa;
  color: #9a3412;
}
.side-question {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}
.side-question em { color: var(--muted); font-style: normal; }
.side-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.side-items li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text);
  cursor: help;
  transition: border-color 0.15s, background 0.15s;
}
.side-items li:hover {
  border-color: var(--primary);
  background: #f8faff;
}
.side-items li[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 320px;
  padding: 10px 12px;
  background: #0f172a;
  color: white;
  font-size: 0.82rem;
  line-height: 1.45;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 20;
  white-space: normal;
  text-align: left;
  font-weight: 400;
}
.side-items li[data-tip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #0f172a;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 20;
}
.side-items li:hover::after,
.side-items li:hover::before {
  opacity: 1;
}
.dim-hint {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  transition: background 0.15s, color 0.15s;
}
.side-items li:hover .dim-hint {
  background: var(--primary);
  color: white;
}
.dim-w {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: #f1f5f9;
  font-variant-numeric: tabular-nums;
}

.bubble-callout.small-callout {
  padding: 12px 16px;
  margin-bottom: 16px;
}
.bubble-callout.small-callout p {
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Action items card in results */
.action-items-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.action-items-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.action-items-head h3 { margin: 0; }
.action-items-head .muted { font-size: 0.85rem; }

.action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.action-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.action-row .action-main strong {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  font-weight: 600;
}
.action-row .action-main .action-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.chip.effort-low { background: #dcfce7; color: #166534; }
.chip.effort-med { background: #fef3c7; color: #92400e; }
.chip.effort-high { background: #fee2e2; color: #991b1b; }
.chip.impact { background: var(--primary-soft); color: var(--primary); }
.chip.mode-self { background: #e0e7ff; color: #3730a3; }
.chip.mode-dfy  { background: #ccfbf1; color: #115e59; }

@media (max-width: 720px) {
  .action-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* ============================================================
   Stage 3 — Website check (messaging clarity)
   ============================================================ */

.wc-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wc-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}
.wc-item:hover { border-color: #cbd5e1; }
.wc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.92rem;
  flex: 0 0 auto;
}
.wc-main strong {
  display: block;
  font-size: 1.02rem;
  margin-bottom: 4px;
  color: var(--text);
}
.wc-main .wc-question {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-style: italic;
}
.wc-main .wc-note {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.5;
}
.wc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
  flex: 0 0 auto;
}
.wc-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.wc-status.present { background: #dcfce7; color: #166534; }
.wc-status.present::before { background: #16a34a; }
.wc-status.weak { background: #fef3c7; color: #92400e; }
.wc-status.weak::before { background: #f59e0b; }
.wc-status.missing { background: #fee2e2; color: #991b1b; }
.wc-status.missing::before { background: #dc2626; }

@media (max-width: 720px) {
  .wc-item {
    grid-template-columns: auto 1fr;
    grid-template-areas: "num main" "status status";
    gap: 10px;
  }
  .wc-num { grid-area: num; }
  .wc-main { grid-area: main; }
  .wc-status { grid-area: status; justify-self: start; }
}

/* ============================================================
   Stage 4 — Segment pre-teaching (awareness ladder + reminder)
   ============================================================ */

.preseg-teaching[hidden] { display: none !important; }

.awareness-card {
  padding: 22px 24px;
}
.awareness-head {
  margin-bottom: 4px;
}
.awareness-ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.aw-step {
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: white;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: transform 0.15s;
}
.aw-step:hover { transform: translateY(-2px); }
.aw-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  align-self: flex-start;
}
.aw-cold {
  background: linear-gradient(180deg, #eff6ff 0%, #fff 80%);
  border-color: #dbeafe;
}
.aw-cold .aw-badge {
  background: #dbeafe;
  color: #1e40af;
}
.aw-sweet {
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 80%);
  border-color: #bbf7d0;
}
.aw-sweet .aw-badge {
  background: #dcfce7;
  color: #166534;
}
.aw-warm {
  background: linear-gradient(180deg, #fef3c7 0%, #fff 80%);
  border-color: #fde68a;
}
.aw-warm .aw-badge {
  background: #fef3c7;
  color: #92400e;
}
.aw-name {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
}
.aw-note {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.aw-order {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--primary);
  padding: 2px 8px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: white;
  margin-bottom: 2px;
}
.aw-step[data-start="1"] {
  box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(30, 64, 175, 0.18);
  border-color: var(--primary);
}

.awareness-arrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 4px 2px;
}
.arrow-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #0ea5e9 0%, #cbd5e1 100%);
  position: relative;
}
.arrow-line::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border-left: 2px solid #0ea5e9;
  border-bottom: 2px solid #0ea5e9;
}
.arrow-line::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
  width: 8px;
  height: 8px;
  border-right: 2px solid #cbd5e1;
  border-top: 2px solid #cbd5e1;
}
.arrow-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.arrow-label.arrow-start { color: #0284c7; }
.arrow-label.arrow-end { color: var(--muted); }

@media (max-width: 720px) {
  .awareness-arrow {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .arrow-label { white-space: normal; }
}

/* ============================================================
   Stage 5 — Message framework
   ============================================================ */

.msg-block {
  padding: 20px 22px;
}
.msg-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.msg-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.msg-block-title h3 {
  margin: 0;
  font-size: 1.08rem;
}
.msg-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}
.msg-count { margin-left: 6px; }

.msg-regen {
  padding: 6px 12px;
  font-size: 0.82rem;
}
.msg-regen:disabled { opacity: 0.4; }

.msg-editable {
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbff;
  font-size: 0.98rem;
  line-height: 1.55;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.msg-editable:hover { background: #f3f6ff; }
.msg-editable:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

/* Problem statements list */
.msg-problems {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: prob;
}
.msg-problems li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  transition: border-color 0.15s, background 0.15s;
}
.msg-problems li:hover {
  border-color: #cbd5e1;
  background: #fafbff;
}
.msg-problems li::before {
  counter-increment: prob;
  content: counter(prob);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  grid-column: 1;
}
.msg-problem-text {
  outline: none;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 2px 0;
}
.msg-problem-text:focus {
  background: #fffde7;
  border-radius: 4px;
  padding: 2px 6px;
  margin: -2px -6px;
}
.msg-problem-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.msg-problems li:hover .msg-problem-remove { opacity: 1; }
.msg-problem-remove:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* Benefits */
.msg-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg-benefits li {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 0.95rem;
  outline: none;
}
.msg-benefits li:focus {
  border-color: var(--primary);
  background: #fffde7;
}
.msg-benefits li::before {
  content: "→ ";
  color: var(--primary);
  font-weight: 700;
  margin-right: 4px;
}

/* Proof block */
.msg-proof-summary {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f0fdf4;
}
.msg-proof-summary.weak { background: #fef3c7; }
.msg-proof-summary.missing { background: #fee2e2; }
.msg-proof-icon {
  font-size: 1.3rem;
  line-height: 1;
}
.msg-proof-body strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 2px;
}
.msg-proof-body p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ============================================================
   Stage 6 — Microtests
   ============================================================ */

.mt-pitch {
  padding: 24px 26px;
}
.mt-pitch-compact {
  padding: 14px 18px;
  margin-top: 16px;
}
.mt-pitch-compact .mt-stat { padding: 4px 0; }
.mt-pitch-compact .mt-stat-val { font-size: 1.3rem; }
.mt-pitch-compact .mt-stat-lbl { font-size: 0.8rem; }

/* Merged message view — reminder graph + layout */
.buy-graph-reminder {
  padding: 12px 16px;
  margin-top: 6px;
  margin-bottom: 18px;
}
.buy-graph-reminder .buy-nodes { gap: 8px; }
.buy-graph-reminder .buy-node {
  padding: 10px 12px;
  opacity: 1;
  transform: none;
}
.buy-graph-reminder .buy-node-icon { font-size: 1.2rem; }
.buy-graph-reminder .buy-node-title { font-size: 0.85rem; margin-top: 2px; }
.buy-graph-reminder .buy-node-text { font-size: 0.78rem; margin-top: 2px; }
.buy-graph-reminder .buy-arrow { font-size: 1rem; opacity: 1; }

.msg-headline {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 18px 0 10px;
  color: var(--text);
}
.msg-headline em { color: var(--muted); font-style: normal; }
.msg-source-tag {
  margin: -6px 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
}
.msg-source-tag .pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 8px;
}
.msg-source-tag .pill.pill-real { background: #dcfce7; color: #166534; }
.msg-source-tag .pill.pill-mock { background: #fef3c7; color: #92400e; }

.msg-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 12px;
}
.msg-layout-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 6px;
}
.msg-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.msg-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mt-legend-mini {
  font-size: 0.82rem;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 1 1 320px;
}
.mt-legend-mini strong { color: var(--text); }
@media (max-width: 900px) {
  .msg-layout { grid-template-columns: 1fr; }
  .msg-action-bar { flex-direction: column; align-items: flex-start; }
}
.mt-pitch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  text-align: center;
}
.mt-stat {
  padding: 10px 0;
}
.mt-stat-val {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.mt-stat-lbl {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 2px;
}

.mt-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px;
}
.mt-legend-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.mt-legend-item strong { color: var(--text); }
.mt-dot-pair {
  display: inline-flex;
  gap: 3px;
}
.mt-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.mt-green { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18); }
.mt-red   { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18); }
.mt-grey  { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18); }

/* Spreadsheet-style results */
.mt-sheet-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
}
.mt-demo-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mt-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}
.mt-sheet-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.mt-sheet-tag {
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
  background: var(--muted);
}
.mt-sheet-tag.mt-tofu { background: #475569; }
.mt-sheet-tag.mt-bofu { background: #0f766e; }

.mt-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.mt-grid th,
.mt-grid td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  vertical-align: top;
  text-align: left;
}
.mt-grid thead th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}
.mt-grid th.col-nr  { width: 36px; text-align: center; }
.mt-grid th.col-stmt { width: auto; }
.mt-grid th.col-kpi { width: 78px; text-align: center; }
.mt-grid td.col-nr  {
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.78rem;
  background: #f8fafc;
}
.mt-grid td.col-stmt {
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text);
}
.mt-grid td.col-kpi {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  transition: background 0.3s ease, color 0.3s ease;
}
.mt-grid td.col-kpi.empty {
  color: #cbd5e1;
}
.mt-grid td.col-kpi.kpi-green {
  background: #dcfce7;
  color: #166534;
  animation: kpiPop 0.35s ease;
}
.mt-grid td.col-kpi.kpi-red {
  background: #fee2e2;
  color: #991b1b;
  animation: kpiPop 0.35s ease;
}
.mt-grid td.col-kpi.kpi-dash {
  color: #94a3b8;
  background: #f8fafc;
  animation: kpiPop 0.35s ease;
}
.mt-grid tbody tr:last-child td { border-bottom: none; }
.mt-grid tbody tr.row-green td.col-stmt { background: #f0fdf4; }
.mt-grid tbody tr.row-red   td.col-stmt { background: #fef2f2; }

@keyframes kpiPop {
  0% { transform: scale(0.88); opacity: 0; }
  60% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); }
}

.mt-demo-note {
  padding: 12px 16px;
  margin-top: 6px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: #78350f;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .mt-sheet { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .mt-pitch-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Stage 7 — Funnel pre-teaching + flow diagram + ROI months
   ============================================================ */

.prefunnel-teaching[hidden] { display: none !important; }

.funnel-flow {
  padding: 24px 20px;
}
.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  justify-content: center;
}
.flow-step {
  flex: 0 1 auto;
  min-width: 96px;
  padding: 14px 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--border);
  background: white;
  transition: transform 0.15s;
}
.flow-step:hover { transform: translateY(-2px); }
.flow-step.flow-marketing {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #eef2ff 0%, #fff 80%);
}
.flow-step.flow-sales {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fef2f2 0%, #fff 80%);
}
.flow-step.flow-won {
  border-color: #86efac;
  background: linear-gradient(180deg, #dcfce7 0%, #fff 80%);
}
.flow-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
}
.flow-step.flow-sales .flow-n { background: #dc2626; }
.flow-step.flow-won .flow-n   { background: #16a34a; }
.flow-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}
.flow-label em {
  font-style: italic;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}
.flow-arrow {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 1.1rem;
  flex: 0 0 auto;
}
.flow-break {
  flex: 0 0 100%;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 0 2px;
  position: relative;
}
.flow-break::before,
.flow-break::after {
  content: "";
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--border);
  vertical-align: middle;
  margin: 0 10px;
}

.prefunnel-bubbles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.roi-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.roi-month {
  padding: 18px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.roi-month-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.roi-month-roi {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.roi-month:nth-child(1) .roi-month-roi { color: var(--muted); }
.roi-month:nth-child(2) .roi-month-roi { color: #0284c7; }
.roi-month:nth-child(3) .roi-month-roi { color: #16a34a; }
.roi-month p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ============================================================
   Stage 7.5 — Optimization loop + AI/team grid
   ============================================================ */

.loop-card {
  padding: 22px 20px;
}
.loop-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  justify-content: center;
}
.loop-step {
  flex: 1 1 120px;
  min-width: 110px;
  max-width: 150px;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  background: white;
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.loop-step.loop-run       { border-color: #c7d2fe; background: linear-gradient(180deg, #eef2ff 0%, #fff 80%); }
.loop-step.loop-measure   { border-color: #bae6fd; background: linear-gradient(180deg, #f0f9ff 0%, #fff 80%); }
.loop-step.loop-analyze   { border-color: #fde68a; background: linear-gradient(180deg, #fffbeb 0%, #fff 80%); }
.loop-step.loop-implement { border-color: #fecaca; background: linear-gradient(180deg, #fef2f2 0%, #fff 80%); }
.loop-step.loop-feedback  { border-color: #86efac; background: linear-gradient(180deg, #f0fdf4 0%, #fff 80%); }
.loop-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.74rem;
}
.loop-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.loop-sub {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.3;
}
.loop-arrow {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 1.1rem;
  flex: 0 0 auto;
}
.loop-arrow.loop-loop {
  color: #16a34a;
  font-weight: 700;
  font-size: 1.3rem;
}

.ai-team-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.ai-card, .team-card {
  padding: 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.ai-card { border-left: 4px solid #4f46e5; }
.team-card { border-left: 4px solid #0d9488; }
.ai-card h3, .team-card h3 { margin-top: 0; }
.ai-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-card ul li {
  font-size: 0.95rem;
  line-height: 1.45;
  padding-left: 20px;
  position: relative;
}
.ai-card ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #4f46e5;
  font-weight: 700;
}
.team-card p { margin: 0; font-size: 0.95rem; line-height: 1.55; }

@media (max-width: 900px) {
  .prefunnel-bubbles { grid-template-columns: 1fr; }
  .roi-months { grid-template-columns: 1fr; }
  .ai-team-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Funnel viz — narrowing bars + per-row sliders + cost cells
   ============================================================ */

.funnel-viz {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 0 10px;
}
.funnel-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fr-head {
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  align-items: center;
  gap: 18px;
}
.fr-stage-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fr-stage-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
}
.fr-stage-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
}
.fr-stage-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}
.fr-stage-tag.tag-mkt     { background: #dbeafe; color: #1e40af; }
.fr-stage-tag.tag-sales   { background: #fee2e2; color: #991b1b; }
.fr-stage-tag.tag-gate    { background: #fef3c7; color: #92400e; }
.fr-stage-tag.tag-handoff { background: #e0e7ff; color: #3730a3; }
.fr-stage-tag.tag-ai      { background: #f0fdfa; color: #134e4a; border: 1px solid #99f6e4; }

.fr-gate-note {
  font-size: 0.78rem;
  color: #78350f;
  background: rgba(255, 255, 255, 0.65);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-weight: 600;
  display: inline-block;
}

/* ============================================================
   Stage 8 — AI optimization: KPI tracking + lead quality
   ============================================================ */

.opt-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
}

.kpi-track-card, .lead-qual-card, .diag-card {
  padding: 20px 22px;
  margin-bottom: 14px;
}

/* Bottleneck + Fix diagnosis table */
.diag-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}
.diag-table thead th {
  padding: 8px 10px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
  text-align: center;
}
.diag-table thead th.diag-row-label { background: transparent; border-bottom-color: transparent; }
.diag-table tbody tr:last-child td { border-bottom: none; }
.diag-row-label {
  text-align: left !important;
  font-weight: 700;
  color: var(--text);
  font-size: 0.88rem;
  padding: 10px 12px;
  min-width: 180px;
  white-space: nowrap;
}
.diag-row-label.bottleneck { color: #991b1b; }
.diag-row-label.fix        { color: #166534; }

/* Diagnosis rows merged into the KPI tracking table */
.kpi-track tbody td.kpi-row-label.bottleneck {
  color: #991b1b;
  background: #fef2f2;
}
.kpi-track tbody td.kpi-row-label.fix {
  color: #166534;
  background: #ecfdf5;
}
.kpi-track tbody td.kpi-target.diag-target {
  background: #f8fafc;
  color: #94a3b8;
  border-left-color: transparent;
  border-right-color: transparent;
  font-weight: 500;
}
.kpi-track tbody tr.diag-row + tr:not(.diag-row) td {
  border-top: 3px solid #cbd5e1;
}

.diag-cell {
  position: relative;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  cursor: help;
  transition: background 0.3s ease, color 0.3s ease;
}
.diag-cell.empty { color: #cbd5e1; font-weight: 400; }
.diag-cell.diag-bottleneck-cell {
  background: #fef2f2;
  color: #991b1b;
  animation: kpiPop 0.35s ease;
}
.diag-cell.diag-bottleneck-cell.onTrack {
  background: #dcfce7;
  color: #166534;
}
.diag-cell.diag-fix-cell {
  background: #ecfdf5;
  color: #115e59;
  animation: kpiPop 0.35s ease;
}
.diag-cell.diag-fix-cell.onTrack {
  background: #dbeafe;
  color: #1e40af;
}

/* Tooltip on hover — appears BELOW the cell since diag rows sit at the
   very top of the table */
.diag-cell[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 320px;
  padding: 10px 12px;
  background: #0f172a;
  color: white;
  font-size: 0.82rem;
  line-height: 1.45;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 30;
  white-space: normal;
  text-align: left;
  font-weight: 400;
}
.diag-cell[data-tip]::before {
  content: "";
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #0f172a;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 30;
}
.diag-cell[data-tip]:hover::after,
.diag-cell[data-tip]:hover::before {
  opacity: 1;
}
.kpi-track-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.kpi-track-head h3 { margin: 0; }

.kpi-track-scroll {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
@media (max-width: 900px) {
  .kpi-track-scroll { overflow-x: auto; }
}

.kpi-track, .lead-qual {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}
.kpi-track th, .kpi-track td,
.lead-qual th, .lead-qual td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  text-align: center;
  white-space: nowrap;
}
.kpi-track thead th, .lead-qual thead th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}
.kpi-track tbody tr:last-child td,
.lead-qual tbody tr:last-child td { border-bottom: none; }

.kpi-row-label {
  text-align: left !important;
  font-weight: 600;
  background: #f8fafc;
  min-width: 220px;
}
.kpi-track tbody td.kpi-row-label {
  color: var(--text);
  font-weight: 600;
}
.kpi-track thead th.kpi-target {
  background: var(--primary-soft);
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.kpi-track tbody td.kpi-target {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-soft);
  font-variant-numeric: tabular-nums;
  border-left: 2px solid var(--primary);
  border-right: 2px solid var(--primary);
  position: relative;
}
.kpi-track tbody tr.section-row td {
  /* keep the section header banding across the target column too */
}
.kpi-track tbody td.kpi-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 0.3s ease, color 0.3s ease;
}
.kpi-track tbody td.kpi-cell.empty { color: #cbd5e1; }
.kpi-track tbody td.kpi-cell.kpi-green {
  background: #dcfce7;
  color: #166534;
  animation: kpiPop 0.35s ease;
}
.kpi-track tbody td.kpi-cell.kpi-red {
  background: #fee2e2;
  color: #991b1b;
  animation: kpiPop 0.35s ease;
}
.kpi-track tbody td.kpi-cell.kpi-amber {
  background: #fef3c7;
  color: #92400e;
  animation: kpiPop 0.35s ease;
}
.kpi-track tbody tr.section-row td {
  background: #0f172a;
  color: white;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  padding: 8px 12px;
}
.kpi-track tbody tr.section-row.sales td { background: #7f1d1d; }

/* Lead quality table */
.lead-qual thead th.lq-check-col {
  background: var(--primary-soft);
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.lead-qual thead th.lq-outcome-col {
  background: #0f172a;
  color: white;
  border-bottom-color: #0f172a;
}
.lead-qual tbody td {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 0.3s ease, color 0.3s ease;
}
.lead-qual tbody td.lq-col-nr,
.lead-qual tbody td.lq-col-date,
.lead-qual tbody td.lq-col-source {
  text-align: left;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 500;
}
.lead-qual tbody td.lq-yes {
  background: #dcfce7;
  color: #166534;
  animation: kpiPop 0.35s ease;
}
.lead-qual tbody td.lq-no {
  background: #fee2e2;
  color: #991b1b;
  animation: kpiPop 0.35s ease;
}
.lead-qual tbody td.lq-empty { color: #cbd5e1; }
.lead-qual tbody tr.lq-mql td.lq-mql-cell {
  background: #dcfce7;
  color: #14532d;
  font-weight: 700;
}
.lead-qual tbody tr.lq-nomql td.lq-mql-cell {
  background: #fee2e2;
  color: #7f1d1d;
  font-weight: 700;
}

/* Editable KPI cells */
.kpi-track tbody td.kpi-editable { cursor: text; }
.kpi-track tbody td.kpi-editable:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.kpi-edit-input {
  width: 100%; border: none; background: transparent;
  font: inherit; text-align: center; color: inherit; outline: none;
  padding: 0;
}

/* Clickable lead quality yes/no toggles */
.lead-qual tbody td.lq-clickable { cursor: pointer; user-select: none; }
.lead-qual tbody td.lq-clickable:hover { filter: brightness(0.92); }

/* Recommendation reasoning hint in segment detail */
.seg-rec-hint {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--primary);
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.feedback-note {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  margin-top: 14px;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  border: 1px solid rgba(30, 64, 175, 0.2);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
}
.feedback-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex: 0 0 auto;
}
.feedback-body strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1rem;
}
.feedback-body p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
}
.feedback-body p strong { display: inline; color: var(--primary); }

.funnel-explainer {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  margin: 18px 0 14px;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  border: 1px solid rgba(30, 64, 175, 0.2);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
}
.funnel-explainer-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex: 0 0 auto;
}
.funnel-explainer p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}
.funnel-explainer p strong {
  color: var(--primary);
}

/* ============================================================
   Stage 9 — Implementation
   ============================================================ */

.guarantee-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 24px;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 80%);
  border: 1px solid #86efac;
  border-left: 4px solid #16a34a;
  border-radius: var(--radius);
}
.guarantee-icon {
  font-size: 2rem;
  line-height: 1;
  flex: 0 0 auto;
}
.guarantee-body strong {
  display: block;
  color: #14532d;
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.guarantee-body p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #166534;
}

/* Strategy Report (Stage 10) */
.impl-section-head {
  margin-top: 36px;
  margin-bottom: 6px;
  font-size: 1.2rem;
  color: var(--text);
}
.strategy-empty {
  padding: 22px 24px;
  margin-bottom: 22px;
}
.strategy-report {
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
}
.strategy-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.strategy-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.strategy-section-head h3 { margin: 0; font-size: 1.05rem; color: var(--text); }
.strategy-section-tag {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.strategy-section p, .strategy-section li { font-size: 0.95rem; line-height: 1.55; }
.strategy-section ul { margin: 6px 0 0; padding-left: 18px; }
.strategy-section ul li { margin-bottom: 4px; }

.strategy-positioning {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left: 4px solid var(--primary);
}
.strategy-positioning .strategy-quote {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
  color: #1e3a8a;
  line-height: 1.5;
}

.strategy-angles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.strategy-angle {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.strategy-angle h4 { margin: 0 0 4px; font-size: 0.95rem; color: var(--text); }
.strategy-angle .strategy-hook { font-weight: 600; color: var(--text); margin: 0 0 6px; }
.strategy-angle .strategy-why { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.45; }

.strategy-obj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.strategy-obj-table th, .strategy-obj-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.strategy-obj-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.strategy-obj-table tbody tr:last-child td { border-bottom: none; }

.strategy-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 18px;
}
.strategy-status-pill {
  display: inline-flex;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.strategy-status-pill.draft     { background: #fef3c7; color: #92400e; }
.strategy-status-pill.confirmed { background: #dcfce7; color: #166534; }

.impl-steps-card {
  padding: 24px 28px;
}
.impl-steps-card h3 { margin-top: 0; margin-bottom: 14px; }

.impl-steps {
  list-style: none;
  counter-reset: impl;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.impl-steps > li {
  counter-increment: impl;
  padding: 14px 18px 14px 56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
}
.impl-steps > li::before {
  content: counter(impl);
  position: absolute;
  left: 16px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.88rem;
}
.impl-steps > li strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0;
}
.impl-step-details {
  width: 100%;
}
.impl-step-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
}
.impl-step-details summary::-webkit-details-marker { display: none; }
.impl-step-details summary::after {
  content: "›";
  font-size: 1.2rem;
  color: var(--muted);
  transition: transform 0.18s;
  flex-shrink: 0;
}
.impl-step-details[open] summary::after {
  transform: rotate(90deg);
}
.impl-step-note {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.impl-substeps {
  list-style: none;
  padding: 8px 0 0 0;
  margin: 6px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
}
.impl-substeps li {
  padding: 6px 10px 6px 22px;
  font-size: 0.88rem;
  color: var(--text);
  position: relative;
  background: var(--primary-soft);
  border-radius: 6px;
}
.impl-substeps li::before {
  content: "▸";
  position: absolute;
  left: 8px;
  color: var(--primary);
  font-weight: 700;
}

/* Final CTA */
.impl-cta-card {
  margin-top: 22px;
  padding: 32px 28px;
  text-align: center;
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
  border: 1px solid rgba(30, 64, 175, 0.2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.impl-cta-card h2 {
  color: var(--text);
  margin-bottom: 8px;
}
.impl-cta-card > p {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 22px;
  font-size: 1rem;
  line-height: 1.55;
}
.impl-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.btn.btn-large {
  padding: 14px 28px;
  font-size: 1.02rem;
}
.impl-proposal-link {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: underline;
}
.impl-proposal-link:hover { color: var(--primary); }

.impl-calendar-placeholder {
  padding: 40px 20px;
  background: #f8fafc;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

/* ============================================================
   Stage 7 — Funnel walkthrough
   ============================================================ */

.wt-container { max-width: 1180px; }

/* Top stepper */
.wt-stepper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.wt-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: max-content;
}
.wt-step-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  user-select: none;
}
.wt-step-chip:hover { background: #f1f5f9; color: var(--text); }
.wt-step-chip .wt-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e5e7eb;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  flex: 0 0 auto;
}
.wt-step-chip.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(30, 64, 175, 0.15);
}
.wt-step-chip.active .wt-step-num {
  background: var(--primary);
  color: white;
}
.wt-step-chip.done { color: var(--score-strong); }
.wt-step-chip.done .wt-step-num {
  background: var(--score-strong);
  color: white;
}
.wt-step-arrow {
  color: #cbd5e1;
  font-size: 0.9rem;
}

/* Main layout — single full-width canvas (right rail was retired; each
   station card now owns its own "Behind the scenes" column) */
.wt-layout {
  display: block;
  margin-bottom: 18px;
}

.wt-canvas {
  min-height: 420px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.wt-station {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  animation: fadeInUp 0.25s ease;
}
.wt-station[hidden] { display: none; }
.wt-station h2 {
  margin-top: 0;
  color: var(--primary);
  font-size: 1.35rem;
  margin-bottom: 8px;
}
.wt-station-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.wt-station-placeholder {
  padding: 60px 30px;
  text-align: center;
  background: #fafbff;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  margin-top: 16px;
}
.wt-station-placeholder-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

/* Right rail */
.wt-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wt-rail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.wt-rail-build {
  border-left: 4px solid var(--primary);
}
.wt-rail-kpi {
  border-left: 4px solid #16a34a;
}
.wt-rail-meta {
  border-left: 4px solid #7c3aed;
  background: #f5f3ff;
}
.wt-rail-panel h4 {
  font-size: 0.78rem;
  margin: 0 0 10px 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.wt-rail-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wt-rail-panel ul li {
  font-size: 0.88rem;
  line-height: 1.45;
  padding-left: 18px;
  position: relative;
  color: var(--text);
}
.wt-rail-build ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}
.wt-rail-kpi ul li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: #16a34a;
  font-weight: 700;
}
.wt-rail-kpi ul li {
  font-weight: 600;
  color: #166534;
}
.wt-rail-kpi ul li small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
  margin-top: 2px;
}
.wt-rail-kpi ul li.empty {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}
.wt-rail-kpi ul li.empty::before { content: "—"; color: var(--muted); }
.wt-rail-meta p {
  font-size: 0.86rem;
  line-height: 1.45;
  color: #5b21b6;
  margin: 0;
}

/* Pacing bar */
.wt-pacing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  margin-bottom: 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.wt-station-counter {
  font-weight: 500;
}

@media (max-width: 900px) {
  .wt-layout { grid-template-columns: 1fr; }
}

/* ── Station 1 · Ad card ─────────────────────────────────────────── */
.ad-card {
  max-width: 520px;
  margin: 14px auto 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.ad-meta-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.ad-meta-avatar {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.ad-meta-who strong { display: block; font-size: 0.9rem; }
.ad-meta-who span { font-size: 0.75rem; color: var(--muted); }
.ad-microtest-hint {
  padding: 10px 14px;
  margin-bottom: 14px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.45;
  color: #78350f;
}
.ad-microtest-hint strong { color: #78350f; }
.ad-structure-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.ad-structure-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ad-structure-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}
.ad-struct-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
  flex: 0 0 auto;
}
.ad-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
}
.ad-cta-url { font-size: 0.8rem; color: var(--muted); }
.ad-cta-btn {
  padding: 8px 18px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ad-cta-btn:hover { background: #e2e8f0; }
.ad-mode-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 999px;
  margin: 0 auto 14px;
  width: max-content;
}
.ad-mode-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--muted);
}
.ad-mode-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Portrait (9:16) video wrap for the Meta reels / stories ad */
.ad-video-portrait {
  margin: 0 auto 12px;
  max-width: 300px;
}
.ad-video-ratio {
  padding: 177.78% 0 0 0;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f172a;
}
.ad-video-ratio iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ── Station 2 · Instant Form ────────────────────────────────────── */
.form-mock {
  max-width: 440px;
  margin: 14px auto 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
}
.form-logo {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
}
.form-headline {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.form-desc {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.45;
}
.form-q { margin-bottom: 14px; }
.form-q-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-options { display: flex; flex-direction: column; gap: 6px; }
.form-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color 0.15s, background 0.15s;
}
.form-opt input { accent-color: var(--primary); }
.form-opt:hover { border-color: var(--primary); background: #f8faff; }
.form-opt.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.form-submit {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.form-submit:disabled { background: #cbd5e1; cursor: not-allowed; }
.form-submit:hover:not(:disabled) { background: var(--primary-hover); }
.form-status {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--score-strong);
  font-weight: 600;
  text-align: center;
}
.form-status.unsubmitted { color: var(--muted); font-weight: 400; }

/* Long form with contact info + SMS section */
.form-mock-long { max-width: 480px; }
.form-section-divider {
  margin: 20px 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.form-field { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.form-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.form-field input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: #fafbff;
}
.form-field input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}
.form-sms {
  margin-top: 14px;
  padding: 14px 14px 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-sm);
}
.form-sms input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-family: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2em;
  text-align: center;
  margin-top: 6px;
}
.form-sms-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #3730a3;
}

/* Calendar intro card (Station 4, initial state) */
.cal-intro-card {
  max-width: 460px;
  margin: 14px auto 0;
  padding: 24px 26px;
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
  border: 1px solid #c7d2fe;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.cal-intro-card h3 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 1.2rem;
}
.cal-intro-card p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  margin: 10px 0;
}
.cal-intro-card p strong { color: var(--text); }
.cal-intro-card .btn { margin-top: 14px; }

/* Sales-process intro slide (Station 5) */
.sp-intro-card {
  max-width: 760px;
  margin: 14px auto 0;
  padding: 28px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.sp-intro-card h3 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 8px;
}
.sp-intro-sub {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.55;
}
.sp-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: stretch;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.sp-step {
  flex: 1 1 150px;
  min-width: 140px;
  max-width: 190px;
  padding: 16px 14px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.sp-step:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(30, 64, 175, 0.1); }
.sp-step-icon { font-size: 1.6rem; }
.sp-step-body strong {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.sp-step-body span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.sp-step.sp-step-won {
  border-top-color: #16a34a;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 80%);
}
.sp-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 700;
}
@media (max-width: 720px) {
  .sp-steps { flex-direction: column; }
  .sp-arrow { transform: rotate(90deg); }
}

/* ============================================================
   Walkthrough · split-screen layout (Lead view + Behind the scenes)
   ============================================================ */

.wt-station-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.wt-lead-view, .wt-backend-view {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
}
.wt-lead-view {
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  border: 1px solid #bae6fd;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.08);
}
.wt-backend-view {
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
  border: 1px dashed #c4b5fd;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.08);
}
.wt-column-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
}
.wt-lead-view .wt-column-label {
  background: #0ea5e9;
  color: white;
}
.wt-backend-view .wt-column-label {
  background: #7c3aed;
  color: white;
}
.wt-lead-content, .wt-backend-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wt-kpi-block, .wt-backend-block {
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.wt-kpi-block h5, .wt-backend-block h5 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.wt-kpi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wt-kpi-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #dcfce7;
  color: #14532d;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.wt-kpi-chip.muted {
  background: #f1f5f9;
  color: var(--muted);
  font-style: italic;
  font-weight: 500;
}
.wt-note, .wt-backend-block p {
  margin: 6px 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}
.wt-note-inline {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  margin-left: 6px;
}
.sp-steps-vertical {
  flex-direction: column;
  gap: 8px;
}
.sp-steps-vertical .sp-step {
  flex: none;
  max-width: none;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}
.sp-steps-vertical .sp-step-icon { font-size: 1.3rem; flex: 0 0 auto; }

@media (max-width: 900px) {
  .wt-station-split { grid-template-columns: 1fr; }
}

/* ── Station 3 · Bot gate ────────────────────────────────────────── */
.gate-card {
  max-width: 440px;
  margin: 14px auto 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.gate-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--text);
  margin-bottom: 12px;
}
.gate-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.gate-check {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}
.gate-check.pass {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
  animation: kpiPop 0.35s ease;
}
.gate-check-icon { font-weight: 700; }
.gate-verdict {
  margin-top: 14px;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.gate-verdict.shown { opacity: 1; }

/* ── Station 4 · AI research ─────────────────────────────────────── */
.research-card {
  max-width: 520px;
  margin: 14px auto 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.research-subject {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 0.88rem;
}
.research-subject dt { color: var(--muted); font-weight: 600; }
.research-subject dd { margin: 0; color: var(--text); }
.research-log { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.research-log li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid var(--border);
  background: white;
  transition: background 0.3s, border-color 0.3s;
  animation: kpiPop 0.4s ease;
}
.research-log li.pass {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.research-log li.fail {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}
.research-verdict {
  margin-top: 14px;
  text-align: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.research-verdict.pass { background: #dcfce7; color: #14532d; }
.research-verdict.fail { background: #fee2e2; color: #7f1d1d; }

/* ── System event popup (purple dashed) ──────────────────────────── */
.sys-event {
  margin-top: 14px;
  padding: 14px 16px;
  background: #f5f3ff;
  border: 2px dashed #8b5cf6;
  border-radius: var(--radius-sm);
}
.sys-event-badge {
  display: inline-block;
  padding: 2px 10px;
  background: #7c3aed;
  color: white;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.sys-event-body {
  font-size: 0.9rem;
  color: #4c1d95;
  line-height: 1.45;
}

/* ── Disqualified preview (full station override) ───────────────── */
.disq-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: #78350f;
  line-height: 1.5;
}
.disq-banner strong { color: #78350f; }
.disq-lead-preview {
  max-width: 440px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.disq-lead-preview .form-logo { margin-bottom: 18px; }
.disq-lead-preview h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  color: var(--text);
}
.disq-lead-preview p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.5;
}
.disq-learn-btn {
  display: inline-block;
  padding: 10px 22px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.disq-learn-btn:hover { background: var(--primary-hover); text-decoration: none; }
.disq-back-row {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

/* ── Station 5 · Calendar ───────────────────────────────────────── */
.cal-card {
  max-width: 460px;
  margin: 14px auto 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.cal-card h3 { margin-top: 0; font-size: 1.05rem; text-align: center; }
.cal-slots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}
.cal-slot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s, border-color 0.15s;
}
.cal-slot:hover { border-color: var(--primary); background: #f8faff; }
.cal-slot.booked {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
  cursor: default;
}
.cal-slot-book {
  padding: 4px 12px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8rem;
}
.cal-slot.booked .cal-slot-book { background: #16a34a; }

/* ── Station 6 · Offer document ──────────────────────────────────── */
.doc-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.doc-preview {
  max-width: 380px;
  margin: 14px auto 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.doc-preview .form-logo { margin: 0 auto 14px; }
.doc-preview h3 { font-size: 1.1rem; margin-bottom: 6px; }
.doc-preview .doc-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.doc-preview ul {
  text-align: left;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.doc-preview ul li {
  padding: 6px 0 6px 20px;
  position: relative;
  font-size: 0.88rem;
}
.doc-preview ul li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--score-strong);
  font-weight: 700;
}
.doc-preview .doc-cta {
  padding: 10px 18px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  display: inline-block;
  font-weight: 600;
  font-size: 0.88rem;
}

/* ── Station 7 · Goodwill call ───────────────────────────────────── */
.gw-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 999px;
  margin: 0 auto 14px;
  width: max-content;
}
.gw-toggle-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--muted);
}
.gw-toggle-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.gw-script {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.gw-script h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--text);
}
.gw-script blockquote {
  border-left: 3px solid var(--primary);
  padding: 4px 14px;
  margin: 10px 0 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  background: #fafbff;
  border-radius: 4px;
}
.gw-goal {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Station 8 · Discovery call ─────────────────────────────────── */
.disc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.disc-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.disc-panel h3 { margin-top: 0; font-size: 0.95rem; }
.disc-script ol {
  margin: 0; padding-left: 20px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}
.disc-checklist {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.disc-check {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbff;
  font-size: 0.85rem;
}
.disc-check.auto { background: #f1f5f9; color: var(--muted); }
.disc-check-buttons { display: flex; gap: 4px; }
.disc-yn {
  padding: 3px 10px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}
.disc-yn.active-y { background: #dcfce7; border-color: #16a34a; color: #166534; }
.disc-yn.active-n { background: #fee2e2; border-color: #dc2626; color: #991b1b; }
.disc-verdict {
  margin-top: 14px;
  padding: 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.disc-verdict.sql { background: #dcfce7; color: #14532d; }
.disc-verdict.nosql { background: #fee2e2; color: #7f1d1d; }
.disc-verdict.pending { background: #f1f5f9; color: var(--muted); }
@media (max-width: 700px) {
  .disc-grid { grid-template-columns: 1fr; }
}

/* ── Station 9 · Sales closing call ──────────────────────────────── */
.close-agenda {
  max-width: 460px;
  margin: 14px auto 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.close-agenda h3 { font-size: 1rem; margin-top: 0; margin-bottom: 12px; }
.close-agenda ol {
  margin: 0; padding-left: 22px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.close-outcome {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 14px;
}
.close-outcome-btn {
  padding: 10px 20px;
  border: 2px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.close-outcome-btn:hover { border-color: var(--primary); }
.close-outcome-btn.won.active { background: #dcfce7; border-color: #16a34a; color: #166534; }
.close-outcome-btn.pending.active { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.close-outcome-btn.lost.active { background: #fee2e2; border-color: #dc2626; color: #991b1b; }

/* ── Station 10 · Won ────────────────────────────────────────────── */
.won-card {
  max-width: 480px;
  margin: 14px auto 0;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  border: 2px solid #86efac;
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.2);
}
.won-trophy { font-size: 3rem; margin-bottom: 4px; }
.won-card h3 {
  font-size: 1.3rem;
  color: #14532d;
  margin-bottom: 16px;
}
.won-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.won-metric {
  padding: 10px 8px;
  background: white;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
}
.won-metric-lbl {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.won-metric-val {
  font-size: 1.05rem;
  color: #14532d;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.fr-bar-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}
.fr-bar {
  position: relative;
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  transition: width 0.2s ease;
  min-width: 240px;
}
.funnel-row:nth-child(1) .fr-bar { background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 100%); border-color: #93c5fd; }
.funnel-row:nth-child(2) .fr-bar { background: linear-gradient(180deg, #e0e7ff 0%, #eef2ff 100%); border-color: #a5b4fc; }
.funnel-row:nth-child(3) .fr-bar { background: linear-gradient(180deg, #ede9fe 0%, #f5f3ff 100%); border-color: #c4b5fd; }
.funnel-row:nth-child(4) .fr-bar { background: linear-gradient(180deg, #fef3c7 0%, #fffbeb 100%); border-color: #fcd34d; }
.funnel-row:nth-child(5) .fr-bar { background: linear-gradient(180deg, #fed7aa 0%, #ffedd5 100%); border-color: #fdba74; }
.funnel-row:nth-child(6) .fr-bar { background: linear-gradient(180deg, #fecaca 0%, #fee2e2 100%); border-color: #fca5a5; }
.funnel-row:nth-child(7) .fr-bar { background: linear-gradient(180deg, #fbcfe8 0%, #fce7f3 100%); border-color: #f9a8d4; }
.funnel-row:nth-child(8) .fr-bar { background: linear-gradient(180deg, #bbf7d0 0%, #dcfce7 100%); border-color: #86efac; }

.fr-bar-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fr-cost {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-self: stretch;
  justify-content: center;
}
.fr-cost-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
}
.fr-cost-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.gate-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: white;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 4px;
}

/* Slider value bubble (live, follows thumb) */
.range-slider { position: relative; }
.slider-bubble {
  position: absolute;
  top: -26px;
  transform: translateX(-50%);
  padding: 3px 8px;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.15s ease;
  z-index: 5;
}
.slider-bubble.visible { opacity: 1; }
.slider-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--primary);
}

@media (max-width: 900px) {
  .fr-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .fr-bar {
    width: 100% !important;
    min-width: 0;
  }
}

/* Per-row "How to improve" accordion — amber "tip" chip */
.fr-tips-toggle {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  margin-right: 2px;
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  border-radius: 999px;
  color: #78350f;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(146, 64, 14, 0.15), 0 2px 6px rgba(251, 191, 36, 0.2);
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.fr-tips-toggle:hover {
  background: linear-gradient(180deg, #fde68a 0%, #fcd34d 100%);
  box-shadow: 0 2px 4px rgba(146, 64, 14, 0.2), 0 4px 14px rgba(251, 191, 36, 0.32);
  transform: translateY(-1px);
}
.fr-tips-toggle.active {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  border-color: #b45309;
  color: white;
  box-shadow: 0 1px 2px rgba(146, 64, 14, 0.25);
}
.fr-tips-icon {
  font-size: 0.9rem;
  line-height: 1;
}
.fr-tips-chev {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}
.fr-tips-toggle.active .fr-tips-chev {
  transform: rotate(-180deg);
}

.fr-tips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 18px 20px;
  margin-top: 4px;
  background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  animation: fadeInUp 0.22s ease;
}
.fr-tips[hidden] { display: none; }
.fr-tips-section h4 {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.fr-tips-section p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}
.fr-tips-section p strong {
  color: var(--primary);
}
.fr-tips-help {
  background: var(--primary-soft);
  padding: 10px 12px;
  margin: -10px -12px;
  border-radius: var(--radius-sm);
}
.fr-tips-help h4 { color: var(--primary); }

@media (max-width: 900px) {
  .fr-tips { grid-template-columns: 1fr; }
  .fr-tips-help { margin: 0; }
}

/* Sales psychology reminder at the bottom of segments view */
.seg-reminder {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 22px;
  margin: 20px 0 14px;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  border: 1px solid rgba(30, 64, 175, 0.15);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
}
.seg-reminder-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex: 0 0 auto;
}
.seg-reminder-body strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}
.seg-reminder-body p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

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

/* ─── Login screen ──────────────────────────────────────────────────────── */
.login-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 32px 16px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.login-logo-img { height: 40px; width: auto; }
.login-title {
  text-align: center;
  margin: 0;
  font-size: 1.4rem;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-btn { width: 100%; justify-content: center; margin-top: 4px; }
.login-error { margin: 0; color: #dc2626; }

/* ─── Implementation view team portraits ─────────────────────────────────── */
.impl-team-portraits {
  display: flex; gap: 48px; justify-content: center;
  align-items: flex-start; margin-top: 28px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.impl-portrait { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.impl-portrait-img {
  width: 160px; height: 160px; border-radius: 50%;
  object-fit: cover; object-position: top;
  border: 3px solid var(--primary);
}
.impl-portrait-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.impl-portrait-role { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.impl-booking-cta {
  font-size: 1rem;
  padding: 12px 28px;
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.22);
}
.impl-booking-cta:hover { box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.35); }

/* ─── Topnav booking CTA ─────────────────────────────────────────────────── */
.topnav-booking {
  background: var(--primary);
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow 0.15s;
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.22);
}
.topnav-booking:hover { box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.35); }

/* ─── Topnav user area ──────────────────────────────────────────────────── */
/* User dropdown menu */
.user-menu { position: relative; }
.user-menu-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 8px 4px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.user-menu-trigger::after {
  content: "▾";
  font-size: 0.7rem;
  opacity: 0.6;
  flex-shrink: 0;
}
.user-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;          /* flush — no gap so mouse stays inside .user-menu */
  padding-top: 6px;   /* visual spacing handled inside, not as a gap */
  background: transparent; /* wrapper is transparent; card below has bg */
  min-width: 170px;
  z-index: 200;
}
.user-menu-dropdown-inner {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden;
}
/* Show on hover OR when .open class is set (click/keyboard) */
.user-menu:hover .user-menu-dropdown,
.user-menu.open .user-menu-dropdown { display: block; }
.user-menu-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.user-menu-item:hover { background: var(--surface); }
.user-menu-item + .user-menu-item { border-top: 1px solid var(--border); }

/* legacy refs kept for JS compatibility */
.topnav-user { display: flex; align-items: center; gap: 8px; }
.topnav-user-name {
  font-size: 0.85rem;
  color: #94a3b8;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Ghost buttons inside the dark topbar need light text */
.topbar .btn.ghost {
  color: #f8fafc;
  border-color: #334155;
}
.topbar .btn.ghost:hover {
  background: #1e293b;
}
.btn-sm {
  font-size: 0.8rem;
  padding: 4px 10px;
}

/* ─── Admin panel ───────────────────────────────────────────────────────── */
.admin-form-card {
  padding: 24px 28px;
  margin-bottom: 16px;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .admin-form-grid { grid-template-columns: 1fr; }
}
.af-org-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.af-org-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }
.af-org-check input { width: 16px; height: 16px; cursor: pointer; }
.admin-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.admin-table td.role-badge {
  font-size: 0.82rem;
  font-weight: 600;
}
.admin-table .inactive { opacity: 0.5; }

/* ─── Scan error state ──────────────────────────────────────────────────── */
.scan-error-card {
  max-width: 480px;
  margin: 80px auto;
  padding: 40px 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.scan-error-icon { font-size: 2.5rem; line-height: 1; }
.scan-error-card h2 { margin: 0; }
.scan-error-card p  { margin: 0; max-width: 340px; line-height: 1.6; }

/* ─── PDF template editor ────────────────────────────────────────────────── */
.pdf-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}
@media (max-width: 900px) { .pdf-editor-grid { grid-template-columns: 1fr; } }
.pdf-editor-pane { display: flex; flex-direction: column; gap: 6px; }
.pdf-editor-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.pdf-editor-textarea {
  width: 100%;
  height: 68vh;
  min-height: 400px;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  resize: vertical;
  background: #fafafa;
  color: var(--text);
  box-sizing: border-box;
}
.pdf-editor-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
