/* ============================================================================
   Votira — Design System v3  ·  "Indigo & Emerald"  (light, mobile-first)
   Single source of truth for the WHOLE product: public marketing site, docs,
   the authenticated app shell and the public survey-respond surface.
   Ported from mockups/v3/assets/theme.css — keep the two in sync.
   Typeface: Inter · Icons: Bootstrap Icons · Grid: Bootstrap 5 utilities only
   Companion sheet: app.css (legacy class-name aliases + app-only components).
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. Tokens  (single light theme)
   ------------------------------------------------------------------------- */
:root {
  /* Brand — indigo */
  --brand: #4F46E5;
  --brand-hover: #4338CA;
  --brand-active: #3730A3;
  --brand-tint: #EEF2FF;
  --brand-tint-2: #E0E7FF;
  --brand-soft: #818CF8;
  --brand-contrast: #FFFFFF;

  /* Accent — emerald (used sparingly for positive/AI signals) */
  --accent: #10B981;
  --accent-hover: #059669;
  --accent-tint: #ECFDF5;
  --accent-tint-2: #D1FAE5;

  /* Neutrals (live app gray scale) */
  --bg: #F9FAFB;
  --surface: #FFFFFF;
  --surface-2: #F3F4F6;
  --surface-3: #E5E7EB;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  --text: #111827;
  --text-body: #374151;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-onbrand: #FFFFFF;

  /* Semantic */
  --success: #059669; --success-tint: #ECFDF5; --success-border: #A7F3D0;
  --warning: #B45309; --warning-tint: #FFFBEB; --warning-border: #FDE68A;
  --danger:  #DC2626; --danger-tint:  #FEF2F2; --danger-border:  #FECACA; --danger-hover: #B91C1C;
  --info:    #0369A1; --info-tint:    #F0F9FF; --info-border:    #BAE6FD;

  /* Effects */
  --focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.28);
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.08), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.10);
  --shadow-lg: 0 20px 48px rgba(17, 24, 39, 0.16);

  /* AI surface — indigo → emerald wash */
  --ai-grad: linear-gradient(135deg, #EEF2FF 0%, #ECFDF5 100%);
  --ai-border: #C7D2FE;

  /* A/B testing accent (violet, distinct from brand indigo) */
  --ab: #7C3AED; --ab-tint: #F3E8FF; --ab-border: #E9D5FF;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-avatar: 10px;

  /* Typography — Inter + fluid scale (mirrors live app) */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-mono: 'SFMono-Regular', ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;
  --fs-hero: clamp(2.25rem, 5vw + 1rem, 3.25rem);
  --fs-h1: clamp(1.75rem, 2.6vw + 0.7rem, 2.375rem);
  --fs-h2: clamp(1.5rem, 1.8vw + 0.7rem, 2rem);
  --fs-h3: clamp(1.125rem, 1vw + 0.6rem, 1.375rem);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.15s var(--ease);
  --t: 0.22s var(--ease);
  --t-slow: 0.32s var(--ease);

  /* -------------------------------------------------------------------------
     Legacy token aliases.
     Templates still carry inline `style="…var(--gray-500)…"` declarations, and
     a few scripts build markup with `element.style.cssText`. Re-pointing the
     old names at the v3 palette keeps every one of those call sites correct
     without touching behaviour.
     ---------------------------------------------------------------------- */
  --indigo-50: var(--brand-tint);
  --indigo-100: var(--brand-tint-2);
  --indigo-400: var(--brand-soft);
  --indigo-600: var(--brand);
  --indigo-700: var(--brand-hover);
  --emerald-50: var(--accent-tint);
  --emerald-500: var(--accent);
  --emerald-600: var(--accent-hover);
  --amber-50: var(--warning-tint);
  --amber-500: #F59E0B;
  --amber-600: var(--warning);
  --red-50: var(--danger-tint);
  --red-500: #EF4444;
  --red-600: var(--danger);
  --sky-500: #0EA5E9;

  --gray-50: var(--bg);
  --gray-100: var(--surface-2);
  --gray-200: var(--border);
  --gray-300: var(--border-strong);
  --gray-400: var(--text-muted);
  --gray-500: var(--text-secondary);
  --gray-600: var(--text-secondary);
  --gray-700: var(--text-body);
  --gray-900: var(--text);

  --sidebar-width: var(--sidebar-w);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;

  --radius-sm: var(--r-xs);
  --radius: var(--r-sm);
  --radius-md: 10px;
  --radius-lg: var(--r-md);
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.08), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.10);
  --shadow-lg: 0 20px 48px rgba(17, 24, 39, 0.16);

  --z-sticky: 90; --z-topbar: 150; --z-backdrop: 190; --z-sidebar: 200; --z-toast: 1080;

  --transition: var(--t-fast);
  --transition-slow: var(--t);

  --fs-title: clamp(1.25rem, 1.5vw + 0.75rem, 1.5rem);

  color-scheme: light;
}

/* ---------------------------------------------------------------------------
   2. Base
   ------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; }
small { font-size: .8125rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
code, pre, .mono { font-family: var(--font-mono); }
::selection { background: var(--brand-tint-2); color: var(--text); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-xs); }

/* Helpers */
.text-secondary-2 { color: var(--text-secondary) !important; }
.text-muted-2 { color: var(--text-muted) !important; }
.text-brand { color: var(--brand) !important; }
.text-accent { color: var(--accent-hover) !important; }
.bg-surface { background: var(--surface) !important; }
.bg-tint { background: var(--brand-tint) !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.eyebrow {
  display: inline-block; font-size: .6875rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 4px;
}
.divider { height: 1px; background: var(--border); border: 0; }
.section { padding: clamp(56px, 9vw, 100px) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lead { font-size: 1.1875rem; color: var(--text-secondary); line-height: 1.6; }
.measure { max-width: 62ch; }

/* ---------------------------------------------------------------------------
   3. Buttons
   ------------------------------------------------------------------------- */
.btn-t {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 600; font-size: .9375rem; line-height: 1;
  padding: 11px 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast),
              box-shadow var(--t-fast), transform var(--t-fast);
}
.btn-t:focus-visible { box-shadow: var(--focus-ring); }
.btn-t i { font-size: 1.05em; }

.btn-t-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
  color: var(--text-onbrand); border-color: var(--brand);
  box-shadow: 0 12px 22px rgba(79, 70, 229, 0.18);
}
.btn-t-primary:hover,
.btn-t-primary:active {
  background: linear-gradient(135deg, var(--brand-hover) 0%, var(--brand-active) 100%);
  color: var(--text-onbrand); transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.btn-t-primary:visited { color: var(--text-onbrand); }
.btn-t-primary:focus-visible { color: var(--text-onbrand); box-shadow: var(--focus-ring), var(--shadow-sm); }

.btn-t-secondary { background: var(--surface); color: var(--text-body); border-color: var(--border-strong); }
.btn-t-secondary:hover { background: var(--surface-2); border-color: var(--text-muted); color: var(--text); transform: translateY(-1px); }

.btn-t-ghost { background: transparent; color: var(--brand); padding: 9px 12px; }
.btn-t-ghost:hover { background: var(--brand-tint); color: var(--brand-hover); }

.btn-t-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-xs); }
.btn-t-accent:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-t-danger { background: var(--danger); color: #fff; box-shadow: var(--shadow-xs); }
.btn-t-danger:hover { background: var(--danger-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-t-ghost.danger { color: var(--danger); }
.btn-t-ghost.danger:hover { background: var(--danger-tint); color: var(--danger-hover); }
.btn-t-secondary.danger-outline { color: var(--danger); border-color: var(--danger-border); }
.btn-t-secondary.danger-outline:hover { background: var(--danger-tint); border-color: var(--danger); color: var(--danger-hover); }
.danger-zone { border-color: var(--danger-border); }

.btn-t-sm { padding: 7px 12px; font-size: .8125rem; gap: 6px; }
.btn-t-lg { padding: 14px 26px; font-size: 1.0625rem; }
.btn-t-block { width: 100%; }
.btn-t[disabled], .btn-t.disabled { opacity: .55; pointer-events: none; }

/* ---------------------------------------------------------------------------
   4. Badges / chips
   ------------------------------------------------------------------------- */
.badge-t {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .6875rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--r-xs); border: 1px solid transparent; line-height: 1;
}
.badge-t.brand   { background: var(--brand-tint); color: var(--brand); border-color: var(--brand-tint-2); }
.badge-t.neutral { background: var(--surface-2); color: var(--text-secondary); border-color: var(--border); }
.badge-t.success { background: var(--success-tint); color: var(--success); border-color: var(--success-border); }
.badge-t.warning { background: var(--warning-tint); color: var(--warning); border-color: var(--warning-border); }
.badge-t.danger  { background: var(--danger-tint); color: var(--danger); border-color: var(--danger-border); }
.badge-t.accent  { background: var(--accent-tint); color: var(--accent-hover); border-color: var(--accent-tint-2); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 600;
  padding: 6px 12px; border-radius: var(--r-xs); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
}
.chip.active { background: var(--brand-tint); border-color: var(--brand-tint-2); color: var(--brand); }
button.chip { cursor: pointer; white-space: nowrap; font-family: var(--font); transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
button.chip:hover { border-color: var(--border-strong); color: var(--text); }
button.chip.active:hover { border-color: var(--brand-tint-2); color: var(--brand); }
label.chip { cursor: pointer; }
label.chip input { accent-color: var(--brand); }

/* Horizontally scrollable row of chips (pool selector). */
.chip-bar { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-bar::-webkit-scrollbar { display: none; }
.chip-bar > * { flex: none; }

/* ---------------------------------------------------------------------------
   5. Cards & surfaces
   ------------------------------------------------------------------------- */
.card-t {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-xs); transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.card-t.pad { padding: 24px; }
.card-t.flush { padding: 0; overflow: hidden; }
.card-t.hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }

.ai-surface { background: var(--ai-grad); border: 1px solid var(--ai-border); border-radius: var(--r-md); padding: 24px; }
.ai-surface .ai-spark { color: var(--brand); }

/* Feature card */
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 26px 24px; box-shadow: var(--shadow-xs); height: 100%; transition: box-shadow var(--t), transform var(--t), border-color var(--t); }
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--brand-tint-2); }
.feature-icon { width: 46px; height: 46px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: 18px; background: var(--brand-tint); color: var(--brand); }
.feature-icon.accent { background: var(--accent-tint); color: var(--accent-hover); }
.feature-icon.danger { background: var(--danger-tint); color: var(--danger); }
a.feature-card { color: inherit; text-decoration: none; }
a.feature-card:hover h3 { color: var(--brand); }
.feature-card h3 { font-size: 1.0625rem; margin-bottom: 7px; }
.feature-card p { font-size: .9375rem; color: var(--text-secondary); margin: 0; }

/* Use-case tile */
.usecase { border: 1px solid var(--border); border-radius: var(--r-md); padding: 22px; background: var(--surface); box-shadow: var(--shadow-xs); transition: all var(--t); height: 100%; }
.usecase:hover { border-color: var(--brand-tint-2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.usecase .uc-ico { font-size: 1.5rem; color: var(--brand); }
.usecase h3 { font-size: 1rem; margin: 12px 0 5px; }
.usecase p { font-size: .9rem; color: var(--text-secondary); margin: 0; }

/* Linked hub card (funnels to subpages) */
.hub-card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 26px 24px; box-shadow: var(--shadow-xs); transition: all var(--t); }
.hub-card:hover { border-color: var(--brand-tint-2); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.hub-card h3 { font-size: 1.0625rem; margin: 0 0 8px; color: var(--text); }
.hub-card p { font-size: .9rem; color: var(--text-secondary); }
.hub-arrow { margin-top: auto; padding-top: 12px; font-weight: 700; font-size: .875rem; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.hub-card:hover .hub-arrow i { transform: translateX(3px); }
.hub-arrow i { transition: transform var(--t-fast); }

/* Stat pill */
.stat-pill { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; box-shadow: var(--shadow-xs); text-align: center; }
.stat-pill .n { font-size: 2rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; line-height: 1.1; }
.stat-pill .l { font-size: .85rem; color: var(--text-secondary); margin-top: 4px; }

/* ---------------------------------------------------------------------------
   6. Marketing nav (mobile-first with drawer)
   ------------------------------------------------------------------------- */
.mkt-nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.85); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border); }
.mkt-nav-inner { display: flex; align-items: center; gap: 12px; height: 62px; }
/* Wordmark only — no logo mark/badge to the left of "Votira". */
.mkt-brand { font-weight: 800; font-size: 1.3rem; color: var(--text); letter-spacing: -0.03em; display: inline-flex; align-items: center; }
.mkt-brand:hover { color: var(--text); }
.mkt-links { display: none; gap: 4px; align-items: center; }
.mkt-links a { color: var(--text-secondary); font-weight: 600; font-size: .9375rem; padding: 8px 12px; border-radius: var(--r-sm); }
.mkt-links a:hover { color: var(--text); background: var(--surface-2); }
.mkt-links a.active { color: var(--brand); background: var(--brand-tint); }
.mkt-nav-cta { display: none; align-items: center; gap: 8px; margin-left: auto; }
.nav-top-login { display: none; min-height: 44px; margin-left: auto; padding-inline: 14px; }

.mkt-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: 1.35rem; cursor: pointer;
  box-shadow: var(--shadow-xs); transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.mkt-menu-btn:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }
.mkt-menu-btn:focus-visible { box-shadow: var(--focus-ring); }

@media (max-width: 991px) {
  .nav-top-login { display: inline-flex; }
}

.mkt-mobile { display: none; border-top: 1px solid var(--border); background: var(--surface); padding: 12px 0 18px; }
.mkt-mobile.open { display: block; }
.mkt-mobile > a { display: block; color: var(--text-body); font-weight: 600; font-size: 1rem; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.mkt-mobile > a:hover, .mkt-mobile > a.active { color: var(--brand); }
.mkt-mobile .mkt-mobile-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

@media (min-width: 992px) {
  .mkt-links { display: flex; }
  .mkt-nav-cta { display: flex; }
  .mkt-menu-btn { display: none; }
  .nav-top-login { display: none !important; }
  .mkt-mobile { display: none !important; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .mkt-links a { padding-inline: 8px; font-size: .875rem; white-space: nowrap; }
}

/* ---------------------------------------------------------------------------
   7. Home hero (light, subtle indigo wash)
   ------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: clamp(52px, 8vw, 92px) 0 clamp(48px, 7vw, 80px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(760px 420px at 12% -8%, rgba(79,70,229,0.10), transparent 60%),
    radial-gradient(680px 420px at 100% 0%, rgba(16,185,129,0.08), transparent 55%);
}
.hero > .container { position: relative; z-index: 1; }
.hero h1 { font-size: var(--fs-hero); font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; }
.hero h1 .hl { color: var(--brand); }
.hero .lead { max-width: 600px; }
.hero-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--brand-tint); color: var(--brand); font-size: .8125rem; font-weight: 700; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--brand-tint-2); margin-bottom: 20px; }
.hero-note { color: var(--text-muted); font-size: .85rem; }
.hero-note .bi { color: var(--accent-hover); }

/* Hero product mockup */
.hero-visual { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-lg); }
.hero-visual .mini { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.hero-chip { position: absolute; display: inline-flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); border-radius: 999px; padding: 8px 13px; font-size: .8rem; font-weight: 700; color: var(--text); }

/* Capability strip */
.cap-strip { display: flex; flex-wrap: wrap; gap: 16px 30px; align-items: center; }
.cap-strip span { font-weight: 600; color: var(--text-secondary); font-size: .9375rem; display: inline-flex; gap: 8px; align-items: center; }
.cap-strip .bi { color: var(--brand); font-size: 1.05rem; }

/* ---------------------------------------------------------------------------
   8. Page hero  (compact per-subpage banner — consistent, restrained)
   ------------------------------------------------------------------------- */
.page-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--brand-tint) 0%, var(--surface) 100%); padding: clamp(40px, 6.5vw, 72px) 0 clamp(30px, 4.5vw, 48px); }
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(560px 260px at 90% -20%, rgba(16,185,129,0.10), transparent 60%);
}
.page-hero > .container { position: relative; z-index: 1; }
.page-hero .page-hero-ico { width: 52px; height: 52px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--brand-tint-2); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: var(--shadow-xs); margin-bottom: 18px; }
.page-hero h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.03em; }
.page-hero .lead { max-width: 60ch; margin-bottom: 0; }
.page-hero .page-hero-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; }
.page-hero .page-hero-meta span { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; font-weight: 600; color: var(--text-secondary); }
.page-hero .page-hero-meta .bi { color: var(--accent-hover); }

/* ---------------------------------------------------------------------------
   9. Steps
   ------------------------------------------------------------------------- */
.step-num { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--brand); color: var(--brand-contrast); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.step-card { position: relative; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 26px 24px; box-shadow: var(--shadow-xs); }
.step-card h3 { font-size: 1.15rem; }
.step-card p { color: var(--text-secondary); margin: 0; }

/* ---------------------------------------------------------------------------
   10. Pricing
   ------------------------------------------------------------------------- */
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px 28px; position: relative; height: 100%; box-shadow: var(--shadow-xs); }
.price-card.featured { border: 1.5px solid var(--brand); box-shadow: var(--shadow-md); }
.price-badge { position: absolute; top: -13px; left: 24px; background: var(--brand); color: var(--brand-contrast); padding: 4px 14px; border-radius: var(--r-xs); font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.price { font-size: 2.75rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }
.price small { font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.price-feat { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: .9375rem; color: var(--text-body); }
.price-feat i { color: var(--accent-hover); margin-top: 3px; }
.price-feat.muted { color: var(--text-muted); }
.price-feat.muted i { color: var(--text-muted); }

/* ---------------------------------------------------------------------------
   11. FAQ (native details/summary — no JS needed)
   ------------------------------------------------------------------------- */
.faq-item { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.faq-item > summary { list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 700; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 1rem; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform var(--t-fast); flex: none; margin-top: -4px; }
.faq-item[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.faq-item > summary:hover { color: var(--brand); }
.faq-item > summary:hover::after { border-color: var(--brand); }
.faq-body { padding: 0 20px 18px; color: var(--text-secondary); font-size: .9375rem; }

/* ---------------------------------------------------------------------------
   12. CTA band
   ------------------------------------------------------------------------- */
.cta-band { position: relative; overflow: hidden; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--brand) 0%, var(--brand-active) 100%); color: #fff; padding: clamp(36px, 5vw, 56px); text-align: center; }
.cta-band::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 100% 0%, rgba(16,185,129,0.30), transparent 60%); pointer-events: none; }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.85); }

/* ---------------------------------------------------------------------------
   13. Footer
   ------------------------------------------------------------------------- */
.mkt-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 48px 0 32px; }
.mkt-footer a { color: var(--text-secondary); font-size: .9rem; display: block; padding: 4px 0; }
.mkt-footer a:hover { color: var(--brand); }
.mkt-footer .foot-head { color: var(--text); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }

/* ---------------------------------------------------------------------------
   14. Alerts
   ------------------------------------------------------------------------- */
.alert-t { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid var(--border); font-size: .9rem; }
.alert-t i { font-size: 1.15rem; flex: none; margin-top: 1px; }
.alert-t > span { flex: 1; min-width: 0; }
.alert-t p:last-child { margin-bottom: 0; }
.alert-t.info    { background: var(--info-tint);    border-color: var(--info-border);    color: var(--text-body); }
.alert-t.info i    { color: var(--info); }
.alert-t.success { background: var(--success-tint); border-color: var(--success-border); color: var(--text-body); }
.alert-t.success i { color: var(--success); }
.alert-t.warning { background: var(--warning-tint); border-color: var(--warning-border); color: var(--text-body); }
.alert-t.warning i { color: var(--warning); }

/* ---------------------------------------------------------------------------
   15. Tables
   ------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.table-t { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table-t th { text-align: left; font-weight: 700; font-size: .8rem; color: var(--text); padding: 14px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-t td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text-body); vertical-align: middle; }
.table-t tbody tr:last-child td { border-bottom: none; }
.table-t td .bi-check-lg { color: var(--accent-hover); }
.table-t td .bi-dash { color: var(--text-muted); }
.table-t .row-head { font-weight: 600; color: var(--text); }
.table-t thead .col-hi { color: var(--brand); }

/* ---------------------------------------------------------------------------
   16. Results bars (used in product mockups)
   ------------------------------------------------------------------------- */
.results-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.results-bar .rb-label { flex: 0 0 40%; font-size: .8125rem; color: var(--text-body); }
.results-bar .rb-track { flex: 1; height: 24px; background: var(--surface-2); border-radius: var(--r-xs); overflow: hidden; }
.results-bar .rb-fill { height: 100%; background: var(--brand); border-radius: var(--r-xs); display: flex; align-items: center; padding-left: 10px; color: #fff; font-size: .7rem; font-weight: 700; }
.results-bar .rb-fill.accent { background: var(--accent); }
.results-bar .rb-fill.muted { background: var(--border-strong); color: var(--text-body); }
.results-bar .rb-val { flex: 0 0 40px; text-align: right; font-size: .8125rem; font-weight: 700; color: var(--text); }

/* ---------------------------------------------------------------------------
   17. Docs
   ------------------------------------------------------------------------- */
.docs-layout { display: block; }
.docs-toc { position: sticky; top: 84px; }
.docs-toc a { display: block; padding: 6px 12px; border-radius: var(--r-sm); color: var(--text-secondary); font-size: .875rem; font-weight: 500; border-left: 2px solid transparent; }
.docs-toc a:hover, .docs-toc a.active { background: var(--brand-tint); color: var(--brand); border-left-color: var(--brand); }
.docs-article h2 { scroll-margin-top: 84px; padding-top: 8px; }
.docs-article h3 { scroll-margin-top: 84px; }
.docs-article p, .docs-article li { color: var(--text-body); }
.docs-article code:not(.code-block) { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: .85em; color: var(--brand-hover); }
.code-block { background: #0E1220; color: #E2E8F0; border: 1px solid #1E293B; border-radius: var(--r-md); padding: 16px 18px; font-size: .8125rem; line-height: 1.7; overflow-x: auto; margin: 0 0 16px; }
.code-block .tok-key { color: #818CF8; }
.code-block .tok-str { color: #6EE7B7; }
.code-block .tok-com { color: #64748B; }
.method-badge { font-size: .6875rem; font-weight: 800; padding: 3px 8px; border-radius: 5px; letter-spacing: .04em; }
.method-badge.get { background: var(--success-tint); color: var(--success); }
.method-badge.post { background: var(--info-tint); color: var(--info); }
.method-badge.patch { background: var(--warning-tint); color: var(--warning); }
.method-badge.delete { background: var(--danger-tint); color: var(--danger); }

@media (min-width: 992px) {
  .docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start; }
}

/* ---------------------------------------------------------------------------
   18. Legal / article prose
   ------------------------------------------------------------------------- */
.prose h2 { font-size: 1.375rem; margin-top: 36px; scroll-margin-top: 84px; }
.prose h3 { font-size: 1.0625rem; margin-top: 24px; }
.prose p, .prose li { color: var(--text-body); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* ---------------------------------------------------------------------------
   19. Persona card (AI Panel showcase)
   ------------------------------------------------------------------------- */
.persona-card { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow-xs); }
.persona-avatar { width: 44px; height: 44px; border-radius: var(--r-avatar); flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; background: var(--brand-tint); color: var(--brand); }
.persona-avatar.a2 { background: var(--accent-tint); color: var(--accent-hover); }
.persona-avatar.a3 { background: #FEF3C7; color: #B45309; }
.persona-card .p-name { font-weight: 700; color: var(--text); font-size: .95rem; }
.persona-card .p-meta { font-size: .8rem; color: var(--text-secondary); }
.persona-card .p-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ===========================================================================
   APP SHELL  ·  sections 20-30
   Private/authenticated product surface. Same tokens as the marketing side so
   the whole product reads as one system; layout concepts carried over from v2
   and re-skinned to the v3 indigo/emerald palette.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   20. App shell — topbar, sidebar, main content
   ------------------------------------------------------------------------- */
:root {
  --sidebar-w: 264px;
  --topbar-h: 58px;
}

/* Mobile topbar (hidden from 992px up) */
.app-topbar {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 16px;
  background: rgba(255,255,255,0.9); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 150;
}
.topbar-brand { font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -0.03em; }
.topbar-brand:hover { color: var(--text); }

.sidebar-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: 1.3rem; cursor: pointer;
  box-shadow: var(--shadow-xs); transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.sidebar-toggle:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }
.sidebar-toggle:focus-visible { box-shadow: var(--focus-ring); }

.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 190;
  background: rgba(17, 24, 39, 0.45);
  opacity: 0; transition: opacity var(--t);
}
.sidebar-backdrop.show { opacity: 1; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  width: var(--sidebar-w); max-width: 82vw;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px;
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto;
  transform: translateX(-100%); transition: transform var(--t-slow);
}
.sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }

.sidebar-brand {
  display: block; padding: 2px 10px 22px;
  font-weight: 800; font-size: 1.3rem; letter-spacing: -0.03em; color: var(--text);
}
.sidebar-brand:hover { color: var(--text); }

.sidebar-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--text-secondary); font-size: .9375rem; font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-nav a i { font-size: 1.125rem; flex: none; }
.sidebar-nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav a.active { background: var(--brand-tint); color: var(--brand); }

.sidebar-divider { height: 1px; background: var(--border); margin: 14px 4px; }
.sidebar-spacer { flex: 1 1 auto; min-height: 16px; }

.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; }
.sidebar-user-link {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  padding: 6px; margin: -6px; border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.sidebar-user-link:hover { background: var(--surface-2); }
.sidebar-user .user-info { min-width: 0; }
.sidebar-user .user-name { font-size: .875rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-email { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout {
  flex: none; width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: var(--r-sm);
  color: var(--text-muted); font-size: 1.05rem; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-logout:hover { background: var(--danger-tint); color: var(--danger); }
.sidebar-logout-form { margin: 0; }

.main-content { padding: 20px 16px 64px; }

@media (min-width: 992px) {
  .app-topbar { display: none; }
  .sidebar-backdrop { display: none; }
  .sidebar { transform: none; box-shadow: none; max-width: none; z-index: 100; }
  .main-content { margin-left: var(--sidebar-w); padding: 32px 40px 72px; }
}

/* Avatar */
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: var(--r-avatar);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand);
  font-weight: 800; font-size: .8125rem; letter-spacing: .02em;
}
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar.lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar.accent { background: var(--accent-tint); color: var(--accent-hover); }

/* Auth screens (login, register, password recovery) */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; background: linear-gradient(180deg, var(--brand-tint) 0%, var(--bg) 55%); }
.auth-box { width: 100%; max-width: 430px; }
.auth-brand { display: block; text-align: center; font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; color: var(--text); margin-bottom: 20px; }
.auth-brand:hover { color: var(--text); }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 32px 26px; }
.auth-card h1 { font-size: 1.375rem; text-align: center; margin-bottom: 6px; }
.auth-card .auth-sub { text-align: center; font-size: .9375rem; color: var(--text-secondary); margin-bottom: 24px; }
.auth-foot { text-align: center; font-size: .875rem; color: var(--text-secondary); margin-top: 20px; }
.auth-sep { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: .8125rem; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn-social { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 11px 16px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text-body); font-size: .9375rem; font-weight: 600; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.btn-social:hover { background: var(--surface-2); border-color: var(--text-muted); color: var(--text); }
@media (min-width: 576px) { .auth-card { padding: 40px 36px; } }

/* Centred status page (error, respond thanks/closed) */
.status-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; text-align: center; }
.status-page .sp-ico { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; background: var(--brand-tint); color: var(--brand); }
.status-page .sp-ico.success { background: var(--success-tint); color: var(--success); }
.status-page .sp-ico.neutral { background: var(--surface-2); color: var(--text-secondary); }
.status-page .sp-ico.danger { background: var(--danger-tint); color: var(--danger); }
.status-page h1 { font-size: clamp(1.375rem, 3vw + .6rem, 1.75rem); }
.status-page p { color: var(--text-secondary); max-width: 48ch; margin: 0 auto 24px; }
.status-page .sp-code { font-size: 3.5rem; font-weight: 800; letter-spacing: -0.04em; color: var(--brand); line-height: 1; margin-bottom: 8px; }
.status-lang { position: absolute; top: 16px; right: 16px; }

/* ---------------------------------------------------------------------------
   21. Page header, section titles, action bar
   ------------------------------------------------------------------------- */
.page-header {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 24px;
}
.page-title { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.025em; color: var(--text); margin: 0; }
.page-subtitle { font-size: .9375rem; color: var(--text-secondary); margin: 6px 0 0; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.section-title { font-size: 1.125rem; font-weight: 700; color: var(--text); margin: 0 0 14px; letter-spacing: -0.015em; }
.subsection-title { font-size: .9375rem; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.muted-text { font-size: .8125rem; color: var(--text-secondary); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 14px; }
.back-link:hover { color: var(--brand); }

/* Sticky bottom action bar (survey editor) */
.action-bar {
  position: sticky; bottom: 0; z-index: 90;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 28px -16px -64px; padding: 14px 16px;
  background: rgba(255,255,255,0.94); backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--border);
}
.action-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.action-bar-mobile { display: none; }
.action-menu .dropdown-item { display: flex; align-items: center; gap: 10px; }
.action-menu .dropdown-item i { width: 18px; text-align: center; color: var(--text-muted); }
.action-menu .dropdown-item.danger, .action-menu .dropdown-item.danger i { color: var(--danger); }
.action-menu .dropdown-item.danger:hover { background: var(--danger-tint); color: var(--danger-hover); }
@media (max-width: 767.98px) {
  .action-bar-desktop { display: none; }
  .action-bar-mobile {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center; gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }
  .action-bar-mobile .action-primary { width: 100%; min-width: 0; min-height: 44px; padding-inline: 12px; }
  .action-bar-mobile .action-icon { width: 44px; height: 44px; padding: 0; font-size: 1.125rem; }
  .action-bar-mobile .dropup { width: 44px; }
  .action-bar-mobile .action-menu { min-width: 220px; margin-bottom: 8px !important; }
}
@media (min-width: 992px) {
  .action-bar { margin: 32px -40px -72px; padding: 16px 40px; }
}

/* ---------------------------------------------------------------------------
   21b. Content primitives
   The building blocks every authenticated screen repeats: card headings,
   metadata rows, action grids, label/value pairs. They exist so no template
   has to carry inline `style="…"` declarations, which is what let the private
   area drift away from the public pages in the first place. Mobile-first.
   ------------------------------------------------------------------------- */
.card-t-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 1rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em; margin: 0 0 4px;
}
.card-t-title .bi { flex: none; color: var(--brand); font-size: 1.05em; }
.card-t-title .bi.muted { color: var(--text-muted); }
.card-t-title.danger, .card-t-title.danger .bi { color: var(--danger); }
.card-t-sub { font-size: .8125rem; color: var(--text-secondary); margin: 0 0 18px; }
.card-t-sub:last-child { margin-bottom: 0; }

.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 14px;
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar-spacer { flex: 1 1 auto; }

/* Icon + text metadata line (created date, question count, …). */
.meta-row { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8125rem; color: var(--text-muted); }
.meta-row > span { display: inline-flex; align-items: center; gap: 5px; }

/* Trailing action grid inside a card. Two columns on phones so the labels stay
   readable, three from 576px up. `display:contents` keeps the CSRF-protected
   delete <form> from breaking the grid. */
.card-actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px;
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border);
}
.card-actions form { display: contents; }
.card-actions .btn-t { width: 100%; justify-content: flex-start; }
@media (min-width: 576px) { .card-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

.kv-grid { display: grid; grid-template-columns: 1fr; gap: 14px 24px; }
.kv-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 3px; }
.kv-value { font-size: .9375rem; font-weight: 600; color: var(--text); }
.kv-value.lg { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
@media (min-width: 576px) { .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .kv-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Input paired with a submit button (promo code, custom domain, new API key). */
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.inline-form > .input-t, .inline-form > .select-t, .inline-form > .form-control, .inline-form > .form-select { flex: 1 1 220px; min-width: 0; }
.field-sm { max-width: 280px; }

/* Inline checkbox + label pair. */
.select-all { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .8125rem; color: var(--text-body); cursor: pointer; }

/* Sticky-feeling bar that appears when rows are ticked. */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; }
.bulk-bar.d-none { display: none; }

/* Read-only code sample inside a modal. */
.code-sample {
  white-space: pre-wrap; word-break: break-word; margin: 0;
  padding: 12px; border-radius: var(--r-sm); background: var(--surface-2);
  font-family: var(--font-mono); font-size: .75rem; color: var(--text-body);
}

/* Purchasable AI credit packs (billing + organization). */
.pack-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 576px) { .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .pack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pack-card {
  display: flex; flex-direction: column; gap: 4px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.pack-card:hover { border-color: var(--brand-tint-2); box-shadow: var(--shadow-sm); }
.pack-card .pk-credits { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; line-height: 1.1; }
.pack-card .pk-label { font-size: .8125rem; color: var(--text-secondary); }
.pack-card .pk-price { font-size: 1.125rem; font-weight: 700; color: var(--brand); margin-top: 6px; }
.pack-card form { margin-top: auto; padding-top: 12px; }

/* Survey card (dashboard grid). */
.survey-card { display: flex; flex-direction: column; height: 100%; padding: 20px; }
.survey-card .sc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.survey-card .sc-count { display: inline-flex; align-items: center; gap: 5px; font-size: .8125rem; font-weight: 700; color: var(--text-secondary); }
.survey-card .sc-count .bi { color: var(--brand); }
.survey-card .sc-title { font-size: 1.0625rem; font-weight: 700; line-height: 1.35; color: var(--text); margin: 0 0 8px; }
.survey-card .sc-title a { color: inherit; }
.survey-card .sc-title a:hover { color: var(--brand); }
.survey-card .sc-desc { font-size: .875rem; color: var(--text-secondary); margin: 0 0 14px; }
.survey-card .meta-row { margin-bottom: 4px; }

/* Visually hidden, still exposed to assistive tech. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.fieldset-bare { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Subscription / plan summary box (settings + billing). */
.plan-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 24px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
}
.plan-box.active { border-color: var(--success-border); background: var(--success-tint); }
.plan-box.trial { border-color: var(--brand-tint-2); background: var(--brand-tint); }
.plan-box.danger { border-color: var(--danger-border); background: var(--danger-tint); }
.plan-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; color: var(--text); }
.plan-status { display: flex; align-items: center; gap: 5px; font-size: .8125rem; margin-top: 3px; color: var(--text-secondary); }
.plan-box.active .plan-status { color: var(--success); }
.plan-box.trial .plan-status { color: var(--brand); }
.plan-meta { font-size: .875rem; color: var(--text-secondary); margin-top: 2px; }

/* Secondary block inside a card, separated by a rule. */
.card-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.card-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* Member role selector with its deliberate two-step Save button. */
.role-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.role-form .form-select { width: auto; }
.new-user-pw { max-width: 400px; }

/* Inline help trigger next to a card heading. */
.help-btn {
  flex: none; padding: 0; border: none; background: transparent; line-height: 1;
  color: var(--brand); cursor: pointer; font-size: 1rem;
}
.help-btn:hover { color: var(--brand-hover); }

/* Compact icon-only action inside a table row. */
.icon-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: none; border-radius: var(--r-xs); background: transparent;
  color: var(--brand); font-size: .95rem; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-action:hover { background: var(--brand-tint); }
.icon-action.danger { color: var(--danger); }
.icon-action.danger:hover { background: var(--danger-tint); }
.icon-action[disabled] { opacity: .5; cursor: not-allowed; }
.inline-actions { display: inline-flex; align-items: center; gap: 4px; }
.inline-actions form { display: inline-flex; margin: 0; }

/* Secret shown once (API / MCP key). */
.code-inline {
  flex: 1; min-width: 0; word-break: break-all;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); font-family: var(--font-mono); font-size: .8125rem; color: var(--text);
}
.mono-cell { font-family: var(--font-mono); font-size: .8125rem; color: var(--text-secondary); word-break: break-all; }

/* ---------------------------------------------------------------------------
   22. Forms
   ------------------------------------------------------------------------- */
.form-label-t { display: block; font-size: .875rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-hint { font-size: .8125rem; color: var(--text-secondary); margin-top: 6px; }
.form-error { font-size: .8125rem; color: var(--danger); margin-top: 6px; }

.input-t, .select-t {
  width: 100%; font-family: var(--font); font-size: .9375rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 11px 13px; line-height: 1.4;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input-t::placeholder { color: var(--text-muted); }
.input-t:focus, .select-t:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.input-t[disabled], .select-t[disabled] { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; }
textarea.input-t { min-height: 110px; resize: vertical; }

.select-t {
  appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236B7280'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}

.input-group-t { display: flex; align-items: stretch; }
.input-group-t .input-t { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-t .btn-t { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Toggle switch */
.switch-t { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-t input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-t .track {
  position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px;
  background: var(--surface-3); transition: background var(--t-fast);
}
.switch-t .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs);
  transition: transform var(--t-fast);
}
.switch-t input:checked + .track { background: var(--brand); }
.switch-t input:checked + .track::after { transform: translateX(18px); }
.switch-t input:focus-visible + .track { box-shadow: var(--focus-ring); }

/* Selectable option row (radio / checkbox surface) */
.option-row {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; min-height: 46px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.option-row:hover { border-color: var(--brand-soft); background: var(--brand-tint); }
.option-row.selected { border-color: var(--brand); background: var(--brand-tint); }
.option-row .opt-mark {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border-strong); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
}
.option-row.multi .opt-mark { border-radius: 5px; }
.option-row.selected .opt-mark { border-color: var(--brand); background: var(--brand); color: #fff; font-size: .7rem; }
.option-row .opt-text { font-size: .9375rem; color: var(--text-body); }

/* Password strength meter */
.pw-meter { display: flex; gap: 4px; margin-top: 8px; }
.pw-meter span { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-3); transition: background var(--t-fast); }
.pw-meter.s1 span:nth-child(1) { background: var(--danger); }
.pw-meter.s2 span:nth-child(-n+2) { background: var(--warning); }
.pw-meter.s3 span:nth-child(-n+3) { background: var(--brand); }
.pw-meter.s4 span { background: var(--accent); }

/* ---------------------------------------------------------------------------
   23. Stat cards, empty states, skeletons, progress
   ------------------------------------------------------------------------- */
.stat-card {
  display: flex; align-items: center; gap: 14px; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 18px 20px; box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t), transform var(--t);
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-icon {
  flex: none; width: 44px; height: 44px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem;
  background: var(--brand-tint); color: var(--brand);
}
.stat-icon.accent { background: var(--accent-tint); color: var(--accent-hover); }
.stat-icon.neutral { background: var(--surface-2); color: var(--text-secondary); }
.stat-icon.warning { background: var(--warning-tint); color: var(--warning); }
.stat-icon.lg { width: 48px; height: 48px; border-radius: var(--r-md); font-size: 1.5rem; }
.stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--text); letter-spacing: -0.02em; }
.stat-label { font-size: .8125rem; font-weight: 600; color: var(--text-secondary); }

.empty-state {
  text-align: center; padding: 56px 24px;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-md);
}
.empty-state .es-ico {
  width: 60px; height: 60px; margin: 0 auto 18px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand); font-size: 1.6rem;
}
.empty-state h3 { font-size: 1.0625rem; margin-bottom: 6px; }
.empty-state p { font-size: .9375rem; color: var(--text-secondary); max-width: 46ch; margin: 0 auto 20px; }
.empty-state p:last-child { margin-bottom: 0; }
.empty-state.flush { border: none; background: transparent; padding: 48px 24px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; border-radius: var(--r-xs); animation: sk 1.4s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.progress-t { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-t > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width var(--t); }
.progress-t.accent > i { background: var(--accent); }
.progress-t.credits-bar { height: 22px; border-radius: var(--r-xs); }
.progress-t.credits-bar > i { border-radius: var(--r-xs); }

/* Checkout view on the billing page: readable measure, centred. */
.billing-checkout { max-width: 880px; margin: 24px auto 0; }

/* AI credits pill */
.credits-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--brand-tint); border: 1px solid var(--brand-tint-2);
  color: var(--brand); font-size: .8125rem; font-weight: 700;
}

/* ---------------------------------------------------------------------------
   24. Status badges & banners
   ------------------------------------------------------------------------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--surface-2); color: var(--text-secondary);
}
.status-badge.published, .status-badge.active { background: var(--success-tint); color: var(--success); }
.status-badge.draft { background: var(--surface-2); color: var(--text-secondary); }
.status-badge.closed, .status-badge.expired { background: var(--danger-tint); color: var(--danger); }
.status-badge.trialing { background: var(--brand-tint); color: var(--brand); }
.status-badge.warning { background: var(--warning-tint); color: var(--warning); }

.trial-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 13px 16px; margin-bottom: 22px;
  border: 1px solid var(--warning-border); background: var(--warning-tint);
  border-radius: var(--r-sm); font-size: .9rem; color: var(--text-body);
}
.trial-banner > i { font-size: 1.15rem; color: var(--warning); flex: none; }
.trial-banner .trial-text { flex: 1 1 260px; }
.trial-banner.trial-banner-ended { border-color: var(--danger-border); background: var(--danger-tint); }
.trial-banner.trial-banner-ended > i { color: var(--danger); }

/* Disabled control because the plan/licence does not allow the action */
.is-locked { opacity: .5; pointer-events: none; }

/* Flash / toast stack */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.alert-t .alert-close {
  margin-left: auto; flex: none; border: none; background: transparent; cursor: pointer;
  color: var(--text-muted); font-size: .9rem; padding: 2px 4px; border-radius: var(--r-xs);
}
.alert-t .alert-close:hover { color: var(--text); background: rgba(17,24,39,.06); }
.alert-t.danger, .alert-t.error { background: var(--danger-tint); border-color: var(--danger-border); color: var(--text-body); }
.alert-t.danger i, .alert-t.error i { color: var(--danger); }

/* ---------------------------------------------------------------------------
   25. Tabs & segmented control
   ------------------------------------------------------------------------- */
.tabs-t { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tabs-t button {
  border: none; background: transparent; cursor: pointer; white-space: nowrap;
  padding: 11px 14px; font-size: .9375rem; font-weight: 600; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tabs-t button:hover { color: var(--text); }
.tabs-t button.active { color: var(--brand); border-bottom-color: var(--brand); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--r-sm); }
.segmented button, .segmented a {
  border: none; background: transparent; cursor: pointer;
  padding: 7px 14px; border-radius: var(--r-xs);
  font-size: .8125rem; font-weight: 700; color: var(--text-secondary);
  transition: background var(--t-fast), color var(--t-fast);
}
.segmented button.active, .segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.segmented a:hover { color: var(--text); }

/* ---------------------------------------------------------------------------
   26. Modals
   ------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(17, 24, 39, 0.5); padding: 0;
}
.modal-overlay.open { display: flex; }
.modal-t {
  width: 100%; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg);
}
.modal-t-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 22px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-t-header h3 { margin: 0; font-size: 1.0625rem; }
.modal-t-header .modal-close {
  margin-left: auto; flex: none; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-secondary); cursor: pointer;
}
.modal-t-header .modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-t-body { padding: 20px 22px; }
.modal-t-footer {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
  padding: 16px 22px 20px; border-top: 1px solid var(--border);
}
@media (min-width: 768px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .modal-t { max-width: 540px; border-radius: var(--r-lg); }
  .modal-t.lg { max-width: 860px; }
}

/* ---------------------------------------------------------------------------
   27. Data table (desktop table → stacked cards on mobile)
   ------------------------------------------------------------------------- */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table thead { display: none; }
.data-table tbody tr {
  display: block; margin-bottom: 10px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.data-table td { display: flex; gap: 12px; padding: 5px 0; border: none; color: var(--text-body); }
.data-table td::before {
  content: attr(data-label); flex: 0 0 40%;
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted);
}
@media (min-width: 992px) {
  .data-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
  .data-table thead { display: table-header-group; }
  .data-table th { text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
  .data-table tbody tr { display: table-row; margin: 0; padding: 0; border: none; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border); }
  .data-table tbody tr:last-child { border-bottom: none; }
  .data-table td { display: table-cell; padding: 13px 16px; vertical-align: middle; }
  .data-table td::before { display: none; }
}

/* Filter bar above a table */
.filter-bar { display: grid; gap: 10px; margin-bottom: 18px; }
@media (min-width: 768px) { .filter-bar { grid-template-columns: repeat(4, 1fr); align-items: end; } }

/* ---------------------------------------------------------------------------
   28. Survey editor
   ------------------------------------------------------------------------- */
.q-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.q-card:hover { border-color: var(--border-strong); }
.q-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.q-index { flex: none; width: 26px; height: 26px; border-radius: var(--r-xs); background: var(--brand-tint); color: var(--brand); font-size: .75rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.q-type { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }

/* Question card built client-side by the survey editor. */
.q-card .q-num { font-size: .8125rem; font-weight: 700; color: var(--text-muted); }
.q-card .q-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: var(--r-xs);
  font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--brand-tint); color: var(--brand);
}
.q-card .q-tag.req { background: var(--warning-tint); color: var(--warning); }
.q-card .q-tag.ab { background: var(--ab-tint); color: var(--ab); }
.q-card .q-text { font-size: .9375rem; font-weight: 600; color: var(--text); }
.q-card .q-preview { margin-top: 12px; padding-left: 28px; }
.q-card .q-opt { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: .8125rem; color: var(--text-secondary); }
.q-card .q-opt .bi { font-size: .75rem; }
.q-card .q-hint { font-size: .75rem; color: var(--text-muted); }
.q-card .q-stars { color: var(--border-strong); font-size: 1.25rem; }
.icon-action.on { color: var(--brand); }
.icon-action.on.ab { color: var(--ab); }
.icon-action.off { color: var(--text-muted); }

.drag-handle { flex: none; cursor: grab; color: var(--text-muted); font-size: 1.05rem; padding: 4px; border-radius: var(--r-xs); }
.drag-handle:hover { color: var(--text-secondary); background: var(--surface-2); }
.drag-handle:active { cursor: grabbing; }
.sortable-ghost { opacity: .45; background: var(--brand-tint); }
.sortable-chosen { box-shadow: var(--shadow-md); }

.page-band { background: var(--brand-tint); border: 1px solid var(--brand-tint-2); border-radius: var(--r-sm); padding: 10px 14px; font-size: .875rem; font-weight: 700; color: var(--brand); margin: 18px 0 10px; }
.add-tile { width: 100%; border: 2px dashed var(--border-strong); border-radius: var(--r-sm); background: transparent; color: var(--text-muted); font-size: .8125rem; font-weight: 600; padding: 12px; cursor: pointer; transition: all var(--t-fast); }
.add-tile:hover { border-color: var(--brand-soft); color: var(--brand); background: var(--brand-tint); }

.qtype-tile {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; transition: all var(--t-fast);
}
.qtype-tile:hover { border-color: var(--brand); background: var(--brand-tint); }
.qtype-tile i { color: var(--brand); font-size: 1.1rem; flex: none; }
.qtype-tile .qt-name { font-size: .875rem; font-weight: 700; color: var(--text); }
.qtype-tile .qt-desc { font-size: .75rem; color: var(--text-secondary); }

/* Template picker (survey creation modal). */
.template-picker { min-height: 420px; }
.template-picker-list { border-bottom: 1px solid var(--border); }
.template-search { padding: 16px 20px 12px; }
.template-scroll { max-height: 50vh; overflow-y: auto; padding: 0 20px 16px; }
.template-picker-preview { background: var(--surface-2); }
.template-preview-bar { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
@media (min-width: 992px) {
  .template-picker-list { border-bottom: none; border-right: 1px solid var(--border); }
}
.template-card {
  width: 100%; padding: 16px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.template-card:hover { border-color: var(--border-strong); }
.template-card.selected { border-color: var(--brand); box-shadow: var(--focus-ring); }
.template-card .tc-icon { flex: none; width: 42px; height: 42px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 1.125rem; }
.template-card .tc-name { font-size: .9375rem; font-weight: 700; color: var(--text); }
.template-card .tc-cat { font-size: .6875rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--r-xs); }
.template-card .tc-desc { font-size: .8125rem; color: var(--text-secondary); margin-bottom: 8px; }
.template-card .tc-count { font-size: .75rem; font-weight: 600; color: var(--text-muted); margin-right: 4px; }
.template-card .template-check { flex: none; color: var(--brand); font-size: 1.25rem; visibility: hidden; }
.template-card.selected .template-check { visibility: visible; }
.chip.sm { font-size: .6875rem; padding: 2px 8px; border-radius: 999px; }
.min-w-0 { min-width: 0; }

/* Dashed note used when a builder section has nothing to configure. */
.empty-note {
  padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: .8125rem; color: var(--text-secondary);
}
/* Read-only echo of an existing value inside a modal. */
.readonly-box {
  padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: .875rem; color: var(--text-body);
}
/* Label + narrow number input + unit (A/B traffic split). */
.split-row { display: flex; align-items: center; gap: 8px; }
.split-row > span:first-child { width: 70px; font-size: .8125rem; color: var(--text-secondary); }
.split-row .form-control { width: 90px; }

/* Bottom padding so the sticky action bar never covers the last field. */
.main-content.has-action-bar { padding-bottom: 120px; }
@media (max-width: 767.98px) {
  .main-content.has-action-bar { padding-bottom: 88px; }
}

/* Drop-off funnel (results) */
.funnel-step { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.funnel-step .fs-label { flex: 0 0 34%; font-size: .8125rem; color: var(--text-body); }
.funnel-step .fs-track { flex: 1; height: 22px; background: var(--surface-2); border-radius: var(--r-xs); overflow: hidden; }
.funnel-step .fs-fill { height: 100%; background: linear-gradient(90deg, var(--brand) 0%, var(--brand-soft) 100%); }
.funnel-step .fs-val { flex: 0 0 56px; text-align: right; font-size: .8125rem; font-weight: 700; color: var(--text); }

/* ---------------------------------------------------------------------------
   28b. Results read-out
   Charts on the results page are data-driven, so bar widths and computed
   colours stay inline. Everything static lives here instead.
   ------------------------------------------------------------------------- */
.q-result { padding: 24px; margin-bottom: 18px; }
.q-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.q-result-num { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.q-result-meta { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.q-result-text { font-size: 1.0625rem; font-weight: 700; color: var(--text); line-height: 1.4; margin: 8px 0 20px; }

/* Generic distribution row: label + track + count. */
.dist-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; font-size: .8125rem; }
.dist-row .dr-label { flex: 0 0 92px; color: var(--text-body); text-align: right; }
.dist-row .dr-label.wide { flex-basis: 110px; text-align: left; }
.dist-row .dr-track { flex: 1; height: 22px; background: var(--surface-2); border-radius: var(--r-xs); overflow: hidden; }
.dist-row .dr-fill { height: 100%; border-radius: var(--r-xs); background: var(--brand); }
.dist-row .dr-val { flex: 0 0 46px; text-align: right; color: var(--text-secondary); }

/* Headline metric inside a result card. */
.big-metric { text-align: center; padding: 12px 0; }
.big-metric .bm-val { font-size: clamp(2.5rem, 9vw, 4rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--text); }
.big-metric .bm-lab { font-size: .875rem; color: var(--text-secondary); margin-top: 4px; }
.metric-split { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 28px; margin-top: 18px; text-align: center; }
.metric-split .ms-val { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.metric-split .ms-lab { font-size: .75rem; color: var(--text-secondary); }
.metric-pos { color: var(--success); }
.metric-neg { color: var(--danger); }
.metric-neutral { color: var(--text-muted); }
.metric-warn { color: var(--warning); }
.metric-stars { color: var(--amber-500); font-size: 1.5rem; }

/* Verbatim answers and contact lists. */
.quote-card { padding: 13px 16px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); font-size: .875rem; color: var(--text-body); line-height: 1.55; }
.quote-card.compact { padding: 8px 12px; }
.list-note { text-align: center; font-size: .8125rem; color: var(--text-muted); margin-top: 10px; }
.rank-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.rank-row .rk-pos { flex: none; width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-tint); color: var(--brand); font-weight: 800; font-size: .8125rem; }
.rank-row .rk-opt { flex: 1; min-width: 0; font-size: .9375rem; color: var(--text-body); }
.rank-row .rk-val { flex: none; font-size: .8125rem; color: var(--text-secondary); }

/* AI insight read-out. Rendered client-side, so these classes are the contract
   between the template literals in results/index.html and the design system. */
.ai-result { padding: 24px; border: 1px solid var(--ai-border); border-radius: var(--r-md); background: var(--surface); }
.ai-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--brand); color: var(--text-onbrand); font-size: .6875rem; font-weight: 700; }
.ai-summary { font-size: .9375rem; color: var(--text-body); line-height: 1.6; margin: 16px 0 18px; }
.ai-section-title { display: flex; align-items: center; gap: 7px; font-size: .875rem; font-weight: 700; color: var(--text); margin: 18px 0 8px; }
.ai-section-title .bi { color: var(--brand); }
.ai-section-title .bi.amber { color: var(--amber-500); }
.ai-item { padding: 12px 16px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.ai-item-title { font-size: .875rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ai-item-title .ai-item-freq { font-weight: 400; font-size: .75rem; color: var(--text-muted); }
.ai-item-body { font-size: .8125rem; color: var(--text-body); line-height: 1.5; }
.ai-item-quote { font-size: .8125rem; color: var(--text-secondary); font-style: italic; margin-top: 6px; }
.ai-insights { margin: 0; padding-left: 20px; }
.ai-insights li { font-size: .875rem; color: var(--text-body); padding: 4px 0; }
.ai-note { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--success-border); border-radius: var(--r-sm); background: var(--success-tint); }
.ai-note-label { display: flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--success); margin-bottom: 4px; }
.ai-note-body { font-size: .875rem; color: var(--text-body); line-height: 1.5; }
.ai-note.moderate { border-color: var(--warning-border); background: var(--warning-tint); }
.ai-note.moderate .ai-note-label { color: var(--warning); }
.ai-note.weak { border-color: var(--danger-border); background: var(--danger-tint); }
.ai-note.weak .ai-note-label { color: var(--danger); }
.ai-note.neutral { border-color: var(--border); background: var(--surface-2); }
.ai-note.neutral .ai-note-label { color: var(--text-secondary); }
.sentiment-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.sentiment-cell { padding: 12px; text-align: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.sentiment-cell .sc-val { font-size: 1.25rem; font-weight: 800; }
.sentiment-cell .sc-lab { font-size: .75rem; color: var(--text-secondary); }
.dropoff-worst { padding: 10px; border-radius: var(--r-sm); background: var(--danger-tint); }

/* ---------------------------------------------------------------------------
   29. Public respond surface
   ------------------------------------------------------------------------- */
.respond-shell { max-width: 720px; margin: 0 auto; padding: 20px 16px 56px; }
.respond-head { margin-bottom: 22px; }
.respond-head h1 { font-size: clamp(1.375rem, 3vw + .6rem, 1.875rem); margin-bottom: 8px; }
.respond-head p { color: var(--text-secondary); font-size: .9375rem; }
.respond-footer { text-align: center; font-size: .8125rem; color: var(--text-muted); padding: 28px 16px 0; }

.q-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow-xs); }
.q-block .q-label { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.q-block .q-help { font-size: .8125rem; color: var(--text-secondary); margin-bottom: 14px; }
.q-block .q-req { color: var(--danger); margin-left: 3px; }

/* NPS 0-10 */
.nps-scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.nps-scale button {
  min-height: 44px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-body); font-weight: 700; font-size: .875rem; cursor: pointer;
  transition: all var(--t-fast);
}
.nps-scale button:hover { border-color: var(--brand); color: var(--brand); }
.nps-scale button.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (min-width: 576px) { .nps-scale { grid-template-columns: repeat(11, 1fr); } }

/* Star rating */
.star-rating { display: flex; gap: 6px; }
.star-rating button {
  min-width: 44px; min-height: 44px; border: none; background: transparent; cursor: pointer;
  color: var(--surface-3); font-size: 1.75rem; line-height: 1; padding: 0;
  transition: color var(--t-fast), transform var(--t-fast);
}
.star-rating button:hover { transform: scale(1.08); }
.star-rating button.sel { color: #F59E0B; }

/* Emoji scale */
.emoji-scale { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-scale button { min-width: 52px; min-height: 52px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); font-size: 1.5rem; cursor: pointer; transition: all var(--t-fast); }
.emoji-scale button:hover { border-color: var(--brand-soft); }
.emoji-scale button.sel { border-color: var(--brand); background: var(--brand-tint); }

/* Likert / matrix */
.matrix-wrap { overflow-x: auto; }
.matrix-t { width: 100%; border-collapse: collapse; font-size: .8125rem; min-width: 460px; }
.matrix-t th { padding: 10px 6px; font-weight: 700; color: var(--text-secondary); text-align: center; font-size: .75rem; }
.matrix-t th:first-child { text-align: left; }
.matrix-t td { padding: 10px 6px; text-align: center; border-top: 1px solid var(--border); }
.matrix-t td:first-child { text-align: left; color: var(--text-body); font-weight: 600; }
.matrix-t input { width: 22px; height: 22px; accent-color: var(--brand); cursor: pointer; }

/* Linear scale */
.scale-row { display: flex; flex-wrap: wrap; gap: 6px; }
.scale-row button { min-width: 44px; min-height: 44px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); font-weight: 700; font-size: .875rem; color: var(--text-body); cursor: pointer; transition: all var(--t-fast); }
.scale-row button.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.scale-legend { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-muted); margin-top: 8px; }

/* Ranking */
.rank-item { display: flex; align-items: center; gap: 11px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); min-height: 46px; }
.rank-item .rank-num { flex: none; width: 24px; height: 24px; border-radius: var(--r-xs); background: var(--brand-tint); color: var(--brand); font-size: .75rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* Image choice */
.img-choice { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.img-choice button { padding: 0; border: 2px solid var(--border); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; cursor: pointer; transition: border-color var(--t-fast); }
.img-choice button.sel { border-color: var(--brand); }
.img-choice .ic-ph { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-muted); font-size: 1.6rem; }
.img-choice .ic-cap { padding: 8px 10px; font-size: .8125rem; font-weight: 600; color: var(--text-body); }
@media (min-width: 576px) { .img-choice { grid-template-columns: repeat(3, 1fr); } }

/* ---------------------------------------------------------------------------
   30. Language switcher
   ------------------------------------------------------------------------- */
.lang-switcher { position: relative; }
.lang-switcher-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-body); font-size: .8125rem; font-weight: 700; cursor: pointer;
}
.lang-switcher-toggle:hover { background: var(--surface-2); }
.lang-switcher-sidebar .lang-switcher-toggle { width: 100%; justify-content: flex-start; }

/* ---------------------------------------------------------------------------
   31. Motion — scroll reveal
   ------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--t-slow), transform var(--t-slow); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------------
   32. Marketing page building blocks
   Shared by the public pages (features, use cases, how it works, plans,
   personas). Mobile-first: every block is a single column by default and only
   gains a second column / sticky behaviour from the 992px breakpoint up.
   ------------------------------------------------------------------------- */

/* --- In-page anchor navigation (sticky under the marketing nav) ----------- */
.anchor-nav {
  position: sticky; top: 62px; z-index: 80;
  background: rgba(255, 255, 255, 0.88); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.anchor-nav-inner {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.anchor-nav-inner::-webkit-scrollbar { display: none; }
.anchor-nav a {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
  font-size: .8125rem; font-weight: 700; white-space: nowrap;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.anchor-nav a:hover { color: var(--brand); border-color: var(--brand-tint-2); background: var(--brand-tint); }
.anchor-nav a:focus-visible { box-shadow: var(--focus-ring); }
.anchor-nav a .bi { font-size: .95rem; }

/* --- Alternating text + visual section ----------------------------------- */
.split-media {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-md);
}
.split-media.plain { background: var(--ai-grad); border-color: var(--ai-border); box-shadow: var(--shadow-xs); }
.split-caption { font-size: .8rem; color: var(--text-muted); text-align: center; margin-top: 12px; }

/* --- KPI row (expected-value pills) --------------------------------------- */
.kpi-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px; box-shadow: var(--shadow-xs);
}
.kpi .k-val { font-size: 1.05rem; font-weight: 800; color: var(--text); letter-spacing: -0.015em; line-height: 1.25; }
.kpi .k-lab { font-size: .8125rem; color: var(--text-secondary); margin-top: 3px; line-height: 1.45; }
.kpi .bi { color: var(--accent-hover); margin-right: 6px; }
@media (min-width: 768px) { .kpi-row { grid-template-columns: repeat(3, 1fr); } }

/* --- Disclosure (rich expandable content, native details/summary) --------- */
.disclosure {
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  margin-bottom: 12px; box-shadow: var(--shadow-xs); overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.disclosure[open] { border-color: var(--brand-tint-2); box-shadow: var(--shadow-sm); }
.disclosure > summary {
  list-style: none; cursor: pointer; display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 20px;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover .d-title { color: var(--brand); }
.disclosure > summary:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--r-md); }
.disclosure .d-ico {
  flex: none; width: 38px; height: 38px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem;
  background: var(--brand-tint); color: var(--brand);
}
.disclosure .d-ico.accent { background: var(--accent-tint); color: var(--accent-hover); }
.disclosure .d-head { flex: 1; min-width: 0; }
.disclosure .d-title { font-weight: 700; color: var(--text); font-size: 1.0125rem; line-height: 1.35; transition: color var(--t-fast); }
.disclosure .d-sub { font-size: .875rem; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.disclosure .d-caret {
  flex: none; margin-top: 10px; width: 9px; height: 9px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg); transition: transform var(--t-fast);
}
.disclosure[open] .d-caret { transform: rotate(-135deg); margin-top: 14px; }
.disclosure .d-body { padding: 0 20px 20px; }
@media (min-width: 768px) { .disclosure .d-body { padding-left: 72px; } }
.disclosure .d-body p { color: var(--text-secondary); font-size: .9375rem; line-height: 1.7; }
.disclosure .d-body p:last-child { margin-bottom: 0; }
.disclosure .d-list { list-style: none; padding: 0; margin: 0; }
.disclosure .d-list li { display: flex; gap: 10px; padding: 5px 0; font-size: .9125rem; color: var(--text-body); }
.disclosure .d-list li .bi { color: var(--accent-hover); margin-top: 4px; flex: none; }
.d-note {
  border-left: 3px solid var(--brand); background: var(--brand-tint);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 12px 16px;
  font-size: .875rem; color: var(--text-body); line-height: 1.6;
}
.d-note b { color: var(--text); }

/* --- Vertical timeline (evolution line) ----------------------------------- */
.timeline { position: relative; }
.timeline-item { position: relative; display: flex; gap: 18px; align-items: flex-start; }
.timeline-item:not(:last-child) { padding-bottom: 28px; }
.timeline-item:not(:last-child)::before {
  content: ""; position: absolute; left: 21px; top: 50px; bottom: 4px; width: 2px;
  background: linear-gradient(180deg, var(--brand-tint-2) 0%, var(--border) 100%);
}
.timeline-marker {
  flex: none; position: relative; z-index: 1;
  width: 44px; height: 44px; border-radius: var(--r-sm);
  background: var(--brand); color: var(--brand-contrast);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.0625rem; box-shadow: var(--shadow-sm);
}
.timeline-item.optional .timeline-marker { background: var(--accent); }
.timeline-body { flex: 1; min-width: 0; padding-bottom: 4px; }
.timeline-body h3 { font-size: 1.1875rem; margin-bottom: 6px; }
.timeline-meta {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin-bottom: 10px;
}
.timeline-meta .bi { color: var(--accent-hover); }

/* --- Comparison table modifier -------------------------------------------- */
.compare-table th:first-child, .compare-table td:first-child { text-align: left; min-width: 190px; }
.compare-table th:not(:first-child), .compare-table td:not(:first-child) { text-align: center; white-space: nowrap; }
.compare-table tbody .row-group td {
  background: var(--surface-2); font-weight: 700; color: var(--text);
  font-size: .8125rem; text-transform: uppercase; letter-spacing: .05em; text-align: left;
}
.compare-table .bi-check-lg { color: var(--accent-hover); font-size: 1.05rem; }
.compare-table .bi-dash { color: var(--text-muted); }

/* --- Product UI mockups (pure CSS, decorative) ---------------------------- */
.ui-mock { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; }
.ui-mock-bar { display: flex; gap: 6px; padding: 2px 2px 14px; }
.ui-mock-bar span { width: 10px; height: 10px; border-radius: 999px; background: var(--surface-3); }
.ui-skel { display: block; height: 12px; border-radius: var(--r-xs); background: var(--surface-2); }
.ui-opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 11px 12px; margin-bottom: 9px; }
.ui-opt:last-child { margin-bottom: 0; }
.ui-opt .ui-radio { width: 16px; height: 16px; border-radius: 999px; border: 2px solid var(--border-strong); flex: none; }
.ui-opt.is-sel { border-color: var(--brand); background: var(--brand-tint); }
.ui-opt.is-sel .ui-radio { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); }

/* --- Sample question card (use cases) ------------------------------------- */
.example-q { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: 16px 18px; }
.example-q .eq-q { font-weight: 600; color: var(--text); font-size: .9375rem; line-height: 1.5; }
.example-q .eq-q + .eq-q { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.example-q .eq-type {
  display: inline-block; margin-top: 6px; font-size: .6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--brand);
  background: var(--brand-tint); border-radius: var(--r-xs); padding: 2px 8px;
}

/* --- Credit cost grid (pricing) -------------------------------------------- */
.credit-cost { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.credit-cost:last-child { border-bottom: none; }
.credit-cost .cc-label { font-size: .9375rem; color: var(--text-body); display: flex; align-items: center; gap: 10px; }
.credit-cost .cc-label .bi { color: var(--brand); }
.credit-cost .cc-val { flex: none; font-weight: 800; color: var(--text); font-size: .9375rem; }
.credit-cost .cc-val.free { color: var(--accent-hover); }

/* ---------------------------------------------------------------------------
   33. Print
   ------------------------------------------------------------------------- */
@media print {
  .no-print, .app-topbar, .sidebar, .sidebar-backdrop, .action-bar { display: none !important; }
  body { background: #fff; }
  .main-content { margin-left: 0; padding: 0; }
  .card-t, .table-wrap, .stat-card, .q-card, .q-block { box-shadow: none; break-inside: avoid; }
}
