/* ==========================================================================
   Masterplan — Master Stylesheet (Phase 2: single token-driven source)
   --------------------------------------------------------------------------
   Design tokens live at the top. Every component below consumes tokens only.
   Sections: 1 tokens · 2 base · 3 navbar · 4 shared components · 5 forms ·
   6 dashboard · 7 builder wizard · 8 plan result · 9 payment · 10 admin ·
   11 landing (scoped .page-landing) · 12 footer/error · 13 responsive.
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* --- brand & semantic colour roles -------------------------------------
     Brand identity recoloured to the Zambian flag (green field, orange/
     black/red stripe) per user request - kept as a token swap only, so
     every component below (which already consumes tokens exclusively, per
     the file header) picks up the new palette with zero rule-level edits.
     Values are hue-preserving darker stops off the flag's actual colours,
     computed to keep the same WCAG AA guarantee the previous blue→purple
     palette had (white-on-fill and text-on-white ≥4.5:1; verified with a
     contrast script, not eyeballed). Semantic success/warning/danger stay
     as they were - they already read correctly and changing them too would
     make status colour and brand colour indistinguishable. */
  --blue: #128a00;          /* brand primary - flag green (white text 4.51:1) */
  --blue-deep: #0c6e00;     /* deep end for fills with white text (6.47:1) */
  --blue-deepest: #094f00;
  --purple: #b85c00;        /* brand accent - flag orange (white text 4.60:1) */
  --purple-deep: #a85400;   /* (5.34:1) */
  --pink: #de2010;          /* brand accent end - flag red (white text 4.86:1) */
  --green: #047857;         /* success — text/icons/fills (5.48:1 white) */
  --green-deep: #065f46;
  --green-vivid: #059669;   /* decorative accents only (graphics ≥3:1) */
  --orange: #b45309;        /* warning text/icons (5.02:1) */
  --orange-fill: #c2410c;   /* fills with white text (5.18:1) */
  --orange-fill-deep: #9a3412;
  --danger: #dc2626;        /* danger fills (4.83:1 white) */
  --danger-text: #9f1239;   /* danger text on light (8.02:1) */

  /* neutrals */
  --ink: #111827;           /* primary text */
  --ink-2: #1f2937;
  --text-soft: #344054;
  --muted: #475467;         /* secondary text — darkened for AA (7.69:1) */
  --muted-weak: #667085;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --surface: #ffffff;
  --surface-tint: #f8fafc;
  --bg: #f6f8fc;

  /* translucent tints & borders (derived from brand) */
  --blue-tint-weak: rgba(18, 138, 0, 0.08);
  --blue-tint: rgba(18, 138, 0, 0.12);
  --blue-tint-strong: rgba(18, 138, 0, 0.18);
  --blue-line-weak: rgba(18, 138, 0, 0.16);
  --blue-line: rgba(18, 138, 0, 0.26);
  --blue-line-strong: rgba(18, 138, 0, 0.34);
  --purple-tint-weak: rgba(184, 92, 0, 0.08);
  --purple-tint: rgba(184, 92, 0, 0.15);
  --purple-tint-strong: rgba(184, 92, 0, 0.18);
  --green-tint-weak: rgba(16, 185, 129, 0.1);
  --green-tint: rgba(16, 185, 129, 0.12);
  --green-tint-strong: rgba(16, 185, 129, 0.14);
  --orange-tint-weak: rgba(249, 115, 22, 0.08);
  --orange-tint: rgba(249, 115, 22, 0.12);
  --orange-tint-strong: rgba(249, 115, 22, 0.14);
  --pink-tint-weak: rgba(222, 32, 16, 0.06);
  --pink-tint: rgba(222, 32, 16, 0.08);
  --red-tint: rgba(222, 32, 16, 0.12);
  --white-soft: rgba(255, 255, 255, 0.14);
  --white-mid: rgba(255, 255, 255, 0.72);
  --white-strong: rgba(255, 255, 255, 0.92);
  --gray-tint: rgba(102, 112, 133, 0.07);

  /* brand gradient + fills - green → orange → red, the flag's own stripe order */
  --gradient-brand: linear-gradient(135deg, var(--blue), var(--purple), var(--pink));
  --gradient-brand-h: linear-gradient(90deg, var(--blue), var(--pink));
  --gradient-blue: linear-gradient(135deg, var(--blue), var(--blue-deep));
  --gradient-green: linear-gradient(135deg, var(--green), var(--green-deep));
  --gradient-purple: linear-gradient(135deg, var(--purple), var(--purple-deep));
  --gradient-orange: linear-gradient(135deg, var(--orange-fill), var(--orange-fill-deep));

  /* typography */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* type scale — 1.25 ratio, rem base, captions ≥12px */
  --fs-12: 0.75rem;    /* 12px — badges, kickers (minimum) */
  --fs-13: 0.8125rem;  /* 13px — dense metadata */
  --fs-14: 0.875rem;   /* 14px — labels/helpers */
  --fs-16: 1rem;       /* 16px — body minimum */
  --fs-18: 1.125rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-30: 1.875rem;
  --fs-36: 2.25rem;
  --fs-48: 3rem;
  --fs-56: 3.5rem;
  --fs-17: 1.05rem;   /* body emphasis */
  --fs-22: 1.4rem;    /* stat / large icon */
  --fs-27: 1.7rem;    /* feature icon */
  --fs-29: 1.8rem;    /* landing stat number */
  --icon-xs: 0.88rem;
  --icon-sm: 0.9rem;
  --icon-md: 1.15rem;

  /* line heights */
  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-base: 1.6;
  --lh-relaxed: 1.75;

  /* letter spacing */
  --tracking-tight: -0.015em;
  --tracking-normal: 0;
  --tracking-wide: 0.06em;
  --tracking-wider: 0.12em;

  /* measure (60–75ch) */
  --measure: 68ch;

  /* spacing scale — 4px rhythm */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.25rem;
  --s6: 1.5rem;
  --s7: 2rem;
  --s8: 2.5rem;
  --s9: 3rem;
  --s10: 4rem;

  /* radii */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* elevation */
  --shadow-xs: 0 10px 24px rgba(17, 24, 39, 0.06);
  --shadow-sm: 0 12px 26px rgba(17, 24, 39, 0.12);
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.1);
  --shadow-lg: 0 22px 50px rgba(17, 24, 39, 0.14);
  --shadow-xl: 0 26px 60px rgba(17, 24, 39, 0.16);
  --glow-blue: 0 14px 30px rgba(18, 138, 0, 0.24);
  --glow-blue-soft: 0 12px 26px rgba(18, 138, 0, 0.2);
  --glow-blue-weak: 0 10px 22px rgba(18, 138, 0, 0.25);
  --glow-purple: 0 10px 22px rgba(184, 92, 0, 0.25);

  /* motion */
  --dur-fast: 150ms;
  --dur: 200ms;
  --dur-slow: 300ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* focus */
  --ring-color: rgba(12, 110, 0, 0.4);
  --ring-width: 3px;

  /* legacy aliases (consumers keep working while migrating) */
  --text-muted: var(--muted);
  --card-bg: rgba(255, 255, 255, 0.9);
  /* white & glass surfaces */
  --white: #ffffff;
  --glass-86: rgba(255, 255, 255, 0.86);
  --glass-90: rgba(255, 255, 255, 0.9);
  --glass-94: rgba(255, 255, 255, 0.94);
  --white-38: rgba(255, 255, 255, 0.38);
  --white-line: rgba(255, 255, 255, 0.4);
  --line-85: rgba(229, 231, 235, 0.85);
  --line-90: rgba(229, 231, 235, 0.9);
  --indigo-50: #eaf6e6;
  --track: rgba(102, 112, 133, 0.15);
  --ring-soft: rgba(18, 138, 0, 0.14);
  --purple-line: rgba(184, 92, 0, 0.18);
  --orange-text-deep: #7c2d12;
  --whatsapp: #25d366;
  /* Fixed a pre-existing bug here: --scrim's declaration was interleaved
     mid-value inside --bg-wash (no semicolon separated them), so --scrim
     never actually resolved and --bg-wash's real gradient value was a
     dropped/invalid declaration - confirmed by parsing this file's own
     served CSS. Also recoloured both washes to the new green/red brand. */
  --scrim: rgba(15, 23, 42, 0.55);
  --bg-wash:
    linear-gradient(135deg, rgba(18, 138, 0, 0.08), rgba(222, 32, 16, 0.06)),
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 34%);
  --hero-wash:
    radial-gradient(circle at top, rgba(18, 138, 0, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 248, 252, 0.96));
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-16);
  line-height: var(--lh-base);
  background:
    var(--bg-wash),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-snug);
}

a { text-decoration: none; }

:focus-visible {
  outline: var(--ring-width) solid var(--ring-color);
  outline-offset: 2px;
}

/* ==========================================================================
   3. NAVBAR / BRAND
   ========================================================================== */
.app-navbar {
  background: transparent;
  box-shadow: none;
  padding-top: var(--s4);
  padding-bottom: var(--s4);
}

.navbar-brand,
.app-navbar .nav-link { color: var(--ink); font-weight: 800; }

.navbar-brand:hover,
.app-navbar .nav-link:hover { color: var(--ink); }

.navbar-toggler { border-color: var(--blue-line-weak); }

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
}

.brand-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--white);
  background: var(--gradient-brand);
  box-shadow: var(--glow-blue-soft);
}

.nav-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue-line-weak);
  border-radius: var(--radius-pill);
  padding: 0.55rem var(--s4) !important;
  color: var(--blue) !important;
  background: var(--blue-tint-weak);
  font-weight: 800;
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.nav-pill:hover {
  color: var(--blue) !important;
  background: var(--blue-tint);
  transform: translateY(-1px);
}

/* ==========================================================================
   4. SHARED COMPONENTS
   ========================================================================== */
.page-shell { padding: var(--s9) 0; }

.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: var(--s3);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--blue-tint-weak);
  color: var(--blue);
  font-size: var(--fs-12);
  font-weight: 800;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.content-card,
.auth-card,
.payment-card,
.revenue-card {
  border: 1px solid var(--line-85);
  border-radius: var(--radius-lg);
  background: var(--glass-86);
  box-shadow: var(--shadow-sm);
}

.content-card,
.auth-card { padding: var(--s5); }

.auth-card { max-width: 520px; margin: 0 auto; }

/* --- buttons --- */
.btn {
  border-radius: var(--radius-pill);
  font-weight: 800;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.btn:hover { transform: translateY(-1px); }

.btn-gradient {
  border: 0;
  color: var(--white);
  background: var(--gradient-brand);
  box-shadow: var(--glow-blue);
}
.btn-gradient:hover { color: var(--white); }

.btn-soft {
  border: 1px solid var(--blue-line-weak);
  color: var(--blue);
  background: var(--blue-tint-weak);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.65;
  pointer-events: none;
}

/* --- forms --- */
.form-control,
.form-select {
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 0.25rem var(--ring-soft);
}

/* ==========================================================================
   5. DASHBOARD (personal + admin shared bits)
   ========================================================================== */
.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s6);
}

.dashboard-title {
  margin-bottom: 0.35rem;
  font-size: clamp(var(--fs-36), 6vw, var(--fs-48));
  line-height: var(--lh-tight);
}

.dashboard-welcome {
  color: var(--blue);
  font-size: var(--fs-14);
  font-weight: 800;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.dashboard-metric-bar,
.metric-bar {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  border-radius: 28px;
  padding: 0.55rem 0.75rem;
  color: var(--white);
  box-shadow: var(--shadow);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.dashboard-metric-bar:hover,
.metric-bar:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.metric-blue { background: var(--gradient-blue); }
.metric-green { background: var(--gradient-green); }
.metric-purple { background: var(--gradient-purple); }
.metric-orange { background: var(--gradient-orange); }

.metric-bar-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--white);
  background: var(--white-soft);
  font-size: var(--icon-sm);
}

.metric-bar-label {
  font-weight: 800;
  font-size: var(--icon-sm);
  color: var(--white-strong);
}

.metric-bar .metric-number {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.15rem, 4vw, 1.55rem);
}

.dashboard-metric-bar .metric-bar-icon {
  width: 32px;
  height: 32px;
  font-size: var(--icon-xs);
}

.dashboard-metric-bar .metric-bar-label { font-size: var(--fs-13); }

.dashboard-metric-bar .metric-number {
  margin: 0;
  color: var(--white);
  font-size: var(--fs-20);
}

/* --- project list --- */
.project-list { display: grid; gap: 0.85rem; }

.dashboard-project-card { padding: 1.1rem; }

.btn-project-new { min-height: 44px; padding: 0.55rem var(--s4); }

.project-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--blue-tint-weak);
  font-size: var(--fs-13);
}

.project-count { color: var(--muted); font-weight: 700; }

.project-page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.project-page-size .form-select {
  width: 76px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-13);
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.68rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.project-row h3 { font-size: var(--fs-14); margin-bottom: 0.1rem; }
.project-row p { font-size: var(--fs-13); }
.project-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: end; }
.project-actions .btn {
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  font-size: var(--fs-13);
}

.status-badge {
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: var(--fs-12);
}
.status-badge.free { background: var(--blue-tint-weak); color: var(--blue); }
.status-badge.enhanced { background: var(--orange-tint-strong); color: var(--orange-fill); }

.empty-state {
  padding: var(--s7);
  border: 1px dashed var(--blue-line);
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--blue-tint-weak);
}

.project-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: var(--fs-13);
  font-weight: 800;
}

/* ==========================================================================
   6. BUILDER WIZARD (guided plan form)
   ========================================================================== */
.builder-card {
  max-width: 1080px;
  margin: 0 auto;
}

.builder-form-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.34fr);
  gap: 1.25rem;
  align-items: end;
  margin-bottom: var(--s6);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.builder-progress { display: grid; gap: 0.45rem; }

.builder-progress strong {
  color: var(--blue);
  font-size: var(--fs-14);
}

.progress { height: 12px; border-radius: var(--radius-pill); }
.progress-bar { background: var(--gradient-brand-h); }

.step-strip { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: var(--s6); }

.step-pill {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: var(--indigo-50);
  font-weight: 800;
}
.step-pill.active { color: var(--white); background: var(--gradient-blue); }

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.step-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--s4);
}

.word-target {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--white);
  background: var(--gradient-blue);
  font-size: var(--fs-13);
  font-weight: 800;
  white-space: nowrap;
}

.helper-text {
  padding: var(--s4);
  border-radius: 18px;
  color: var(--text-soft);
  background: linear-gradient(135deg, var(--blue-tint-weak), var(--green-tint-weak));
}

.helper-text p { margin: 0; }

.starter-sentences {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--blue-line-weak);
  font-size: var(--fs-14);
  line-height: 1.65;
}

.starter-sentences strong {
  color: var(--blue);
  font-size: var(--fs-13);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.starter-sentences span { color: var(--muted-weak); }

.word-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: var(--fs-14);
}

.word-count-row strong { color: var(--orange); }
.word-count-row.valid strong { color: var(--green); }
.word-count-row.over strong { color: var(--orange); }

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  margin-top: 1.25rem;
}

/* --- "Your Numbers" financials --- */
.step-pill-numbers { font-size: var(--fs-14); }

.fin-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--s4) 1.1rem;
  margin-bottom: var(--s4);
  background: var(--surface);
}

.fin-group-title {
  font-size: var(--fs-17);
  font-weight: 800;
  margin-bottom: 0.2rem;
  color: var(--blue);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.fin-group-helper {
  color: var(--muted);
  font-size: var(--fs-14);
  margin-bottom: 0.8rem;
}

.fin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}

.fin-field .form-label { font-size: var(--fs-14); margin-bottom: 0.25rem; }

.fin-field .input-group-text {
  font-weight: 800;
  color: var(--purple);
  background: var(--purple-tint-weak);
  border-color: var(--line);
}

/* ==========================================================================
   7. PLAN RESULT
   ========================================================================== */
.result-heading {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  margin-bottom: 1.75rem;
  text-align: center;
}

.result-title {
  width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: var(--fs-48);
  font-weight: 800;
  line-height: var(--lh-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.enhanced-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: var(--s4);
  padding: var(--s4) 1.25rem;
  border-radius: 18px;
  color: var(--white);
  background: var(--gradient-orange);
}

/* --- document preview --- */
.document-preview {
  padding: clamp(1.25rem, 4vw, var(--s9));
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.document-preview section { margin-bottom: var(--s7); }
.document-preview h2 {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  color: var(--blue);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-normal);
}
.document-preview h3 {
  margin-top: 1.25rem;
  color: var(--pink);
  font-size: var(--fs-17);
}
.document-preview ul {
  margin-bottom: var(--s4);
  padding-left: 1.2rem;
}

.plan-table-wrap {
  overflow-x: auto;
  margin: var(--s4) 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.plan-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-14);
}
.plan-table th,
.plan-table td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.plan-table th {
  color: var(--white);
  background: var(--gradient-blue);
}
.plan-table tr:nth-child(even) td {
  background: var(--blue-tint-weak);
}

/* --- live enhancement progress --- */
.enhancement-progress {
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1.6rem;
  margin-bottom: 1.6rem;
  border: 1px solid var(--purple-line);
}

.enhancement-progress-head {
  display: flex;
  gap: var(--s4);
  align-items: center;
  margin-bottom: 1.1rem;
}

.spinner-ring {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  border: 4px solid var(--purple-tint);
  border-top-color: var(--purple);
  animation: mp-spin 0.9s linear infinite;
}
@keyframes mp-spin { to { transform: rotate(360deg); } }

.enhancement-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.55rem;
}
.enhancement-checklist li {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  font-weight: 600;
  background: var(--gray-tint);
  color: var(--muted);
  transition: all 0.25s ease;
}
.enhancement-checklist li.status-working {
  background: var(--blue-tint-weak);
  color: var(--blue);
}
.enhancement-checklist li.status-done {
  background: var(--green-tint);
  color: var(--green);
}
.enhancement-checklist .check-icon { width: 1.2rem; text-align: center; }
.enhancement-checklist li.status-done .check-icon i { color: var(--green); }

/* --- readiness scorecard --- */
.readiness-card {
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--orange-tint-strong);
  padding: var(--s6);
  margin-bottom: 1.6rem;
}
.readiness-card.is-enhanced { border-color: var(--green-tint-strong); }

.readiness-head {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  flex-wrap: wrap;
}

.score-ring {
  --score: 0;
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background:
    radial-gradient(closest-side, var(--surface) 74%, transparent 75% 100%),
    conic-gradient(var(--ring-color, var(--orange-fill)) calc(var(--score) * 1%), var(--track) 0);
}
.score-ring strong { font-size: var(--fs-24); line-height: 1; }
.score-ring span { font-size: var(--fs-12); color: var(--muted); }
.score-ring.band-good { --ring-color: var(--green); }
.score-ring.band-mid { --ring-color: var(--orange); }
.score-ring.band-low { --ring-color: var(--danger); }

.gap-list {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.gap-list li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: var(--orange-tint-weak);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-weight: 600;
}
.gap-list i { color: var(--orange); margin-top: 0.2rem; }

.readiness-cta {
  display: flex;
  gap: var(--s4);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 1.1rem;
  padding: var(--s4) 1.1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue-tint-weak), var(--pink-tint));
}

.section-grades { margin-top: 1.1rem; }
.section-grades summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--blue);
}
.section-grades > ul {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.section-grade-row { display: flex; gap: 0.6rem; align-items: center; }
.grade-pill {
  min-width: 42px;
  text-align: center;
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.5rem;
  font-weight: 800;
  color: var(--white);
}
.grade-pill.good { background: var(--green); }
.grade-pill.mid { background: var(--orange); }
.grade-pill.low { background: var(--danger); }
.grade-gaps { margin: 0.3rem 0 0 var(--s9); padding: 0; list-style: disc inside; color: var(--muted); }

/* --- document pack --- */
.doc-pack {
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--green-tint-strong);
  padding: var(--s6);
  margin-bottom: 1.6rem;
}
.doc-pack-head { margin-bottom: var(--s4); }
.doc-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
}
.doc-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: var(--s4);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}
.doc-card strong { font-size: var(--fs-14); }
.doc-card > span:last-child { color: var(--muted); font-size: var(--fs-13); }
.doc-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-size: var(--icon-md);
  color: var(--white);
  margin-bottom: 0.35rem;
}
.doc-word { background: var(--blue); }
.doc-excel { background: var(--green); }
.doc-ppt { background: var(--orange-fill); }

/* ==========================================================================
   8. PAYMENT
   ========================================================================== */
.payment-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1fr);
  overflow: hidden;
}
.payment-summary {
  padding: var(--s7);
  color: var(--white);
  background: var(--gradient-blue);
}
.payment-summary h1 { color: var(--white); font-weight: 700; }
.payment-form-panel { padding: var(--s7); background: var(--surface); }
.fee-pill {
  display: inline-flex;
  margin: var(--s4) 0;
  padding: 0.55rem var(--s4);
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
}
.revenue-card { padding: var(--s4) 1.25rem; }
.revenue-card span { display: block; color: var(--muted); font-weight: 700; }
.revenue-card strong { font-size: var(--fs-22); }

.payment-benefits {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.payment-benefits li { display: flex; gap: 0.6rem; align-items: center; font-weight: 600; }
.payment-benefits i { color: var(--green); }

.pay-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  background: var(--blue-tint-weak);
  border-radius: var(--radius-pill);
  padding: 0.35rem;
}
.pay-tab {
  flex: 1;
  border: 0;
  border-radius: var(--radius-pill);
  min-height: 44px;
  padding: 0.6rem var(--s4);
  font-weight: 800;
  color: var(--muted);
  background: transparent;
  transition: all var(--dur-fast) var(--ease);
}
.pay-tab.active {
  color: var(--white);
  background: var(--gradient-blue);
  box-shadow: var(--glow-blue-weak);
}
.pay-panel { display: none; }
.pay-panel.active { display: block; }

.voucher-input {
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 800;
  text-align: center;
}

.momo-steps {
  margin: 0 0 1.2rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
}

.unlock-banner {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  border-radius: var(--radius-md);
  padding: var(--s4) 1.1rem;
  margin-bottom: var(--s4);
}
.unlock-banner i { font-size: var(--fs-22); margin-top: 0.15rem; }
.unlock-banner.success { background: var(--green-tint); color: var(--green-deep); }
.unlock-banner.success i { color: var(--green); }
.unlock-banner.pending { background: var(--orange-tint); color: var(--orange-text-deep); }
.unlock-banner.pending i { color: var(--orange); }

/* ==========================================================================
   9. ADMIN
   ========================================================================== */
.admin-section {
  margin-bottom: var(--s6);
  width: 100%;
}

.admin-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: var(--s4);
}

.admin-section-controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-section-controls .form-select {
  min-height: 44px;
  padding: 0.3rem 2rem 0.3rem 0.8rem;
  font-size: var(--fs-14);
}

/* Breathing room under column headers, before the first data row. */
.admin-section table thead th {
  padding-bottom: var(--s4);
}

/* Pagination bar shared by every admin table. */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: var(--s10);
  padding-top: var(--s6);
  border-top: 1px solid var(--line);
}

.table-pagination .page-size-control {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--fs-14);
  color: var(--muted);
  white-space: nowrap;
}

.table-pagination .page-size-control select {
  min-height: 40px;
  margin: 0 0.15rem;
  padding: 0.2rem 1.8rem 0.2rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: var(--fs-14);
}

.table-pagination .page-nav {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.table-pagination .page-status {
  font-size: var(--fs-14);
  color: var(--muted);
  font-weight: 700;
  min-width: 60px;
  text-align: center;
  padding: 0 0.25rem;
}

.table-loading {
  text-align: center;
  color: var(--muted);
  padding: 1.2rem 0;
  font-size: var(--fs-14);
}

.badge-unused { background: var(--blue-tint) !important; color: var(--blue) !important; }
.badge-redeemed { background: var(--green-tint) !important; color: var(--green) !important; }

.voucher-code-text {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.voucher-actions,
.new-voucher-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.voucher-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: all var(--dur-fast) var(--ease);
}

.voucher-action-btn:hover { transform: translateY(-1px); color: var(--white); }
.voucher-action-btn.copy:hover { background: var(--blue); border-color: var(--blue); }
.voucher-action-btn.email:hover { background: var(--purple); border-color: var(--purple); }
.voucher-action-btn.whatsapp:hover { background: var(--whatsapp); border-color: var(--whatsapp); }

.voucher-codes {
  background: var(--green-tint-weak);
  border-radius: 14px;
  padding: 0.9rem var(--s4);
  margin-bottom: var(--s4);
}
.voucher-codes code {
  display: inline-block;
  margin: 0.2rem 0.25rem 0 0;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.new-voucher-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--green-tint-strong);
  margin-bottom: 0.4rem;
}
.new-voucher-row:last-child { margin-bottom: 0; }

/* Voucher count input (admin "Generate" form) */
/* Touch targets (44px minimum) for dense action rows */
.project-pagination .btn,
.table-pagination .page-nav .btn { min-height: 44px; }
.admin-section tbody .btn { min-height: 44px; }
.voucher-count-input { width: 5.625rem; }

/* Plan name column inside admin tables — truncates instead of wrapping */
.claim-project {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   10. GOOGLE SIGN-IN
   ========================================================================== */
.btn-google {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
  padding: 0.8rem var(--s4);
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 800;
  color: var(--ink);
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn-google:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* Token-styled danger alert (auth pages) */
.alert-mp-danger {
  border: 0;
  border-radius: var(--radius-md);
  background: var(--red-tint);
  color: var(--danger-text);
}

/* Small print under auth actions */
.auth-note { font-size: var(--fs-14); }

/* ==========================================================================
   11. LANDING PAGE (scoped under .page-landing)
   --------------------------------------------------------------------------
   Formerly an inline <style> inside home.ejs. Scoped so these rules can never
   collide with the app pages. Copy is untouched.
   ========================================================================== */
.page-landing body,
body.page-landing {
  color: var(--ink);
  font-family: var(--font-ui);
}

/* Nav overlays the hero on the landing page only. */
body.page-landing .app-navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: transparent !important;
  box-shadow: none !important;
}

body.page-landing .app-navbar .navbar-collapse.show,
body.page-landing .app-navbar .navbar-collapse.collapsing {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--blue-line-weak);
  border-radius: 18px;
  background: var(--glass-90);
  backdrop-filter: blur(14px);
}

.mp-hero {
  padding: 7rem var(--s4) var(--s10);
  text-align: center;
  background: var(--hero-wash);
}

.mp-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-normal);
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: var(--lh-tight);
  max-width: 850px;
  margin: 0 auto 1.2rem;
}

.mp-hero h1 span,
.mp-h2 span { color: var(--blue); }

/* Two-line hero subheadline — the long paragraph lives in the funding-pack
   expander below (mp-dialog), so the hero stays scannable. */
.hero-sub {
  max-width: 34rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: var(--fs-18);
  line-height: 1.55;
}

.btn-gold {
  background: var(--gradient-brand);
  color: var(--white);
  border: none;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.4rem;
  box-shadow: var(--glow-blue);
}
.btn-gold:hover { color: var(--white); filter: brightness(1.04); }

.btn-inverse {
  border: 1px solid var(--white-line);
  background: var(--surface);
  color: var(--blue);
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.5rem;
}

.mp-section {
  padding: var(--s10) var(--s4);
}

.mp-section-inner {
  max-width: 1140px;
  margin: auto;
}

.mp-h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  margin-bottom: var(--s4);
}

.section-text {
  max-width: 720px;
  margin: 0 auto var(--s7);
  color: var(--muted);
  line-height: var(--lh-relaxed);
  font-size: var(--fs-16);
}

/* --- feature & step cards --- */
.feature-card,
.step-card {
  height: 100%;
  background: var(--glass-90);
  border: 1px solid var(--line-90);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.feature-card:hover,
.step-card:hover {
  transform: translateY(-4px);
  border-color: var(--blue-line-strong);
}

.feature-card i {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--blue-tint-weak);
  color: var(--blue);
  font-size: var(--icon-sm);
  margin-bottom: var(--s2);
}

.feature-card h3,
.step-card h4 {
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 0.4rem;
  font-size: var(--fs-18);
}

.feature-card p,
.step-card p {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
  font-size: var(--fs-14);
}

.step-number {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue-tint-weak);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: var(--s3);
}

/* --- documents showcase --- */
.doc-showcase-card {
  height: 100%;
  background: var(--glass-94);
  border: 1px solid var(--line-90);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  text-align: left;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.doc-showcase-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-line-strong);
}

.doc-showcase-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: var(--icon-sm);
}

.doc-showcase-card h4 {
  font-size: var(--fs-14);
  font-weight: 800;
  margin-bottom: 0.15rem;
  color: var(--ink);
}

.doc-showcase-card p {
  color: var(--muted);
  font-size: var(--fs-13);
  line-height: 1.45;
  margin-bottom: 0.3rem;
}

.doc-format-badge {
  display: inline-block;
  font-size: var(--fs-12);
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.6rem;
}

.doc-format-badge.word { background: var(--blue-tint-weak); color: var(--blue); }
.doc-format-badge.excel { background: var(--green-tint); color: var(--green); }
.doc-format-badge.ppt { background: var(--orange-tint); color: var(--orange-fill); }
.doc-format-badge.free { background: var(--purple-tint-weak); color: var(--purple); }

.doc-bg-word { background: var(--blue); }
.doc-bg-excel { background: var(--green); }
.doc-bg-ppt { background: var(--orange-fill); }

/* --- landing metrics tiles --- */
.metrics-section { padding: var(--s9) var(--s4); }

.metrics-box {
  max-width: 1140px;
  margin: auto;
  border: 1px solid var(--line-90);
  border-radius: 18px;
  overflow: hidden;
  background: var(--glass-90);
  box-shadow: var(--shadow);
}

.metrics-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

/* Landing metric tiles are self-contained vertical panels — fully scoped here
   so they never inherit the compact row layout used by dashboard bars. */
body.page-landing .metrics-bars .metric-bar {
  min-height: 0;
  display: block;
  padding: 1.1rem;
  text-align: center;
  border-right: 1px solid var(--white-soft);
  color: var(--white);
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: none;
  border-radius: 0;
  grid-template-columns: none;
  align-items: initial;
  gap: initial;
}
body.page-landing .metrics-bars .metric-bar:last-child { border-right: none; }

body.page-landing .metrics-bars .metric-bar-icon {
  display: block;
  width: auto;
  height: auto;
  border-radius: 0;
  color: var(--white);
  background: transparent;
  font-size: var(--fs-22);
  margin-bottom: 0.5rem;
}

body.page-landing .metrics-bars .metric-bar-label {
  display: block;
  color: var(--white-strong);
  font-size: var(--fs-13);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

body.page-landing .metrics-bars .metric-number {
  display: block;
  margin: 0.35rem 0 0;
  color: var(--white);
  font-size: var(--fs-29);
}

/* --- final CTA --- */
.cta-box {
  max-width: 1000px;
  margin: auto;
  background: var(--gradient-brand);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--s9) var(--s7);
  box-shadow: var(--glow-blue);
}

.cta-box h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-normal);
}

.cta-box p { color: var(--white-strong); font-size: var(--fs-16); }

.cta-box .section-kicker {
  color: var(--white);
  border-color: var(--white-38);
  background: var(--white-soft);
}

/* ---------------------------------------------------------------------------
   11b. LANDING EXPANDER → MODAL ("Learn more" pattern)
   ---------------------------------------------------------------------------
   Baseline: a native <details>/<summary> — the full text is reachable with
   JavaScript disabled. When JS is available (client.js adds the
   html.mp-modal-ready class) the inline panel is hidden and the same content
   is shown in a dialog-style modal.
   --------------------------------------------------------------------------- */
.mp-dialog {
  max-width: 620px;
  margin: 0 auto var(--s7);
  text-align: left;
}

.mp-dialog summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
  border-bottom: 1px solid var(--blue-line);
  padding-bottom: 0.15rem;
  transition: border-color var(--dur-fast) var(--ease);
}
.mp-dialog summary:hover { border-color: var(--blue-line-strong); }
.mp-dialog summary::-webkit-details-marker { display: none; }
.mp-dialog summary i {
  font-size: var(--fs-12);
  transition: transform var(--dur) var(--ease);
}
.mp-dialog[open] summary i { transform: rotate(180deg); }

.mp-dialog-content {
  margin-top: var(--s4);
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--line-90);
  border-radius: var(--radius-md);
  padding: var(--s5);
  box-shadow: var(--shadow-xs);
}
.mp-dialog-content p { margin: 0; line-height: var(--lh-relaxed); }

/* When JS enhances the expanders into modals, hide the inline (fallback) panel. */
html.mp-modal-ready details[data-mp-dialog] > .mp-dialog-content { display: none; }

/* --- dialog modal --- */
.mp-modal {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
}
.mp-modal[hidden] { display: none; }

.mp-modal-overlay {
  position: absolute;
  inset: 0;
  background: var(--scrim);
}

.mp-modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 620px;
  max-height: min(86vh, 680px);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.mp-modal-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s5) var(--s5) 0;
}
.mp-modal-title {
  margin: 0;
  font-size: var(--fs-20);
  font-weight: 800;
  color: var(--ink);
}

.mp-modal-close {
  flex: 0 0 auto;
  margin-left: auto;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--gray-tint);
  color: var(--ink);
  font-size: var(--fs-20);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.mp-modal-close:hover { background: var(--line); transform: translateY(-1px); }

.mp-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--s4) var(--s5) var(--s5);
  overflow-y: auto;
  color: var(--text-soft);
  line-height: var(--lh-relaxed);
}
.mp-modal-body p:first-child { margin-top: 0; }
.mp-modal-body p:last-child { margin-bottom: 0; }

.mp-modal-cta {
  display: block;
  text-align: center;
  margin-top: var(--s5);
}

/* Sheet on phones, centred dialog on desktop. */
@media (max-width: 560px) {
  .mp-modal { align-items: flex-end; padding: 0; }
  .mp-modal-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
}

/* ==========================================================================
   12. FOOTER & ERROR
   ========================================================================== */
.app-footer {
  padding: var(--s7) 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: transparent;
}

.error-panel {
  max-width: 620px;
  margin: var(--s9) auto;
  text-align: center;
  padding: 2.5rem 1.75rem;
}

.error-emoji {
  display: block;
  font-size: var(--fs-48);
  line-height: 1;
  margin-bottom: var(--s4);
}

.error-panel h1 { margin-bottom: 0.6rem; }

.error-message {
  max-width: 46ch;
  margin: 0 auto 1.75rem;
  font-size: var(--fs-17);
  line-height: 1.6;
}

.error-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   13. RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
  .builder-form-header,
  .payment-card { grid-template-columns: 1fr; }
  .dashboard-heading { align-items: start; flex-direction: column; }
  .dashboard-metrics { grid-template-columns: 1fr; }
  .project-row { grid-template-columns: 1fr; }
  .project-actions { justify-content: start; }
  .project-pagination { justify-content: space-between; }
  .app-navbar .navbar-nav { padding-top: 0.75rem; align-items: stretch !important; }
  .nav-pill { width: 100%; }
}

@media (max-width: 768px) {
  body.page-landing .metrics-bars { grid-template-columns: repeat(2, 1fr); }
  body.page-landing .metrics-bars .metric-bar:nth-child(2) { border-right: none; }
  body.page-landing .metrics-bars .metric-bar:nth-child(-n + 2) { border-bottom: 1px solid var(--white-soft); }
}

@media (max-width: 560px) {
  .container {
    padding-left: var(--s4);
    padding-right: var(--s4);
  }

  .page-shell {
    padding-left: var(--s4);
    padding-right: var(--s4);
    padding-top: var(--s6);
    padding-bottom: var(--s6);
  }

  .result-title { font-size: var(--fs-30); }
  .result-actions .btn { flex: 1 1 100%; }
  .wizard-actions,
  .wizard-actions .d-flex { flex-direction: column; }
  .wizard-actions .btn { width: 100%; }
  .step-heading,
  .word-count-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .project-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  /* Landing */
  body.page-landing .metrics-bars { grid-template-columns: 1fr; }
  body.page-landing .metrics-bars .metric-bar {
    border-right: none;
    border-bottom: 1px solid var(--white-soft);
  }
  body.page-landing .metrics-bars .metric-bar:last-child { border-bottom: none; }
  body.page-landing .mp-hero { padding-top: 5.5rem; }
}

@media (max-width: 560px) {
  .error-panel { margin: var(--s6) auto; padding: var(--s7) 1.25rem; }
  .error-actions .btn { width: 100%; }
}

/* ==========================================================================
   14. MOTION — honour prefers-reduced-motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .spinner-ring { animation: none; }
}

/* ==========================================================================
   14. REBUILD (Oct 2026): interview wizard, result page, money check,
       tiers, payment, dashboard, landing extras. Tokens only.
   ========================================================================== */

/* --- shared bits --- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-85);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: var(--s5);
  margin-bottom: var(--s5);
}
.panel-title { font-size: var(--fs-20); font-weight: 800; color: var(--ink); margin-bottom: var(--s3); display: flex; gap: var(--s2); align-items: center; }
.panel-title i { color: var(--blue); }
.side-h { font-size: var(--fs-16); font-weight: 800; margin: var(--s4) 0 var(--s2); display: flex; align-items: center; gap: var(--s2); }
.q-help { color: var(--muted); font-size: var(--fs-14); margin: var(--s1) 0 var(--s2); }
.link-more { font-weight: 700; color: var(--blue); text-decoration: none; display: inline-flex; gap: var(--s1); align-items: center; margin-top: var(--s3); }
.badge-soft {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--blue-tint-weak); color: var(--blue-deep);
  border-radius: var(--radius-pill); padding: 0.25rem 0.7rem; font-size: var(--fs-13); font-weight: 700;
}
.badge-wait { background: var(--orange-tint); color: var(--orange); }
.badge-tier { border-radius: var(--radius-pill); padding: 0.25rem 0.7rem; font-size: var(--fs-13); font-weight: 800; background: var(--gray-tint); color: var(--text-soft); }
.badge-tier.tier-plan { background: var(--blue-tint); color: var(--blue-deep); }
.badge-tier.tier-pack { background: var(--purple-tint); color: var(--purple-deep); }
.count-pill { margin-left: auto; font-size: var(--fs-13); background: var(--blue-tint-weak); color: var(--blue-deep); border-radius: var(--radius-pill); padding: 0.1rem 0.6rem; }
.alert-box {
  display: flex; gap: var(--s3); align-items: flex-start;
  border-radius: var(--radius-md); padding: var(--s4); margin-bottom: var(--s4);
  border: 1px solid var(--line); background: var(--surface-tint);
}
.alert-box > i { margin-top: 0.2rem; font-size: var(--fs-18); }
.alert-info { background: var(--blue-tint-weak); border-color: var(--blue-line-weak); }
.alert-info > i { color: var(--blue); }
.alert-warn { background: var(--orange-tint-weak); border-color: var(--orange-tint-strong); }
.alert-warn > i { color: var(--orange); }
.alert-ok { background: var(--green-tint-weak); border-color: var(--green-tint-strong); }
.alert-ok > i { color: var(--green); }
.nav-pill-cta { background: var(--gradient-brand) !important; color: var(--white) !important; border: 0 !important; }

/* --- wizard --- */
.wizard-shell { max-width: 820px; }
.wizard-top { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.wizard-exit { color: var(--muted); font-weight: 700; text-decoration: none; white-space: nowrap; font-size: var(--fs-14); }
.wizard-exit:hover { color: var(--blue); }
.wizard-progress { flex: 1; height: 8px; background: var(--track); border-radius: var(--radius-pill); overflow: hidden; }
.wizard-progress span { display: block; height: 100%; width: 0; background: var(--gradient-brand-h); transition: width var(--dur-slow) var(--ease); }
.wizard-count { font-size: var(--fs-13); color: var(--muted); font-weight: 700; white-space: nowrap; }
.wstep-title { font-size: var(--fs-30); font-weight: 800; color: var(--ink); margin-bottom: var(--s2); outline: none; }
.wstep-lead { color: var(--muted); font-size: var(--fs-17); margin-bottom: var(--s5); }
.wstep-lead i { color: var(--blue); }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.choice-grid-small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-card {
  position: relative; display: flex; gap: var(--s3); align-items: center;
  padding: var(--s4); border: 2px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); cursor: pointer; min-height: 72px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.choice-card:hover { border-color: var(--blue-line-strong); transform: translateY(-1px); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card:has(input:checked) { border-color: var(--blue); background: var(--blue-tint-weak); box-shadow: var(--glow-blue-soft); }
.choice-card:has(input:focus-visible) { outline: var(--ring-width) solid var(--ring-color); outline-offset: 2px; }
.choice-icon { flex: 0 0 44px; height: 44px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--blue-tint); color: var(--blue-deep); font-size: var(--fs-18); }
.choice-card:has(input:checked) .choice-icon { background: var(--blue); color: var(--white); }
.choice-text { display: flex; flex-direction: column; line-height: 1.25; }
.choice-text strong { font-size: var(--fs-16); color: var(--ink); }
.choice-text small { color: var(--muted); font-size: var(--fs-13); margin-top: 0.15rem; }
.choice-card-small { flex-direction: column; text-align: center; gap: var(--s2); padding: var(--s3); min-height: 96px; justify-content: center; }
.choice-card-small .choice-icon { flex: 0 0 auto; width: 40px; height: 40px; }
.choice-card-small .choice-text strong { font-size: var(--fs-14); }
.status-note { margin-top: var(--s4); display: flex; gap: var(--s2); background: var(--orange-tint-weak); border: 1px solid var(--orange-tint-strong); border-radius: var(--radius-md); padding: var(--s3) var(--s4); color: var(--ink); font-size: var(--fs-14); }
.status-note i { color: var(--orange); margin-top: 0.2rem; }

.q { margin-bottom: var(--s5); }
.q-label { display: block; font-weight: 800; color: var(--ink); font-size: var(--fs-16); margin-bottom: var(--s1); }
.q-req { color: var(--pink); }
.q textarea, .q input.form-control { font-size: var(--fs-16); }
.pill-options { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.pill-option { position: relative; cursor: pointer; }
.pill-option input { position: absolute; opacity: 0; pointer-events: none; }
.pill-option span { display: inline-block; padding: 0.6rem 1rem; min-height: 44px; border: 2px solid var(--line); border-radius: var(--radius-pill); font-weight: 700; color: var(--text-soft); background: var(--surface); }
.pill-option input:checked + span { border-color: var(--blue); background: var(--blue-tint); color: var(--blue-deep); }
.pill-option input:focus-visible + span { outline: var(--ring-width) solid var(--ring-color); outline-offset: 2px; }

.money-block { border-top: 1px solid var(--line); padding-top: var(--s5); margin-top: var(--s5); }
.money-block:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.money-h { font-size: var(--fs-18); font-weight: 800; display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.money-num { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: var(--white); font-size: var(--fs-14); }
.money-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.money-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.money-grid-4 .q-label { font-size: var(--fs-14); }
.money-grid-4 input { margin-top: var(--s1); }
.rows { display: flex; flex-direction: column; gap: var(--s2); margin: var(--s2) 0; }
.row-line { display: grid; grid-template-columns: minmax(0, 1fr) 150px 40px; gap: var(--s2); align-items: center; }
.amount { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.amount > span { padding: 0 0.6rem; color: var(--muted); font-weight: 700; }
.amount input { border: 0 !important; box-shadow: none !important; text-align: right; min-width: 0; }
.amount-lg input { font-size: var(--fs-18); font-weight: 700; }
.amount-sm { max-width: 260px; }
.amount-sm input { text-align: center; }
.row-del { width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: var(--gray-tint); color: var(--muted); }
.row-del:hover { background: var(--red-tint); color: var(--danger-text); }
.row-total { text-align: right; font-size: var(--fs-16); margin-top: var(--s2); color: var(--text-soft); }
.row-total strong { color: var(--ink); font-size: var(--fs-18); }
.calc { margin-top: var(--s2); }
.calc summary { color: var(--blue); font-weight: 700; cursor: pointer; }
.calc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin: var(--s2) 0; }
.calc-grid label { font-size: var(--fs-13); font-weight: 700; color: var(--text-soft); }

.money-check {
  position: sticky; bottom: var(--s3); z-index: 5;
  margin-top: var(--s6); padding: var(--s4); border-radius: var(--radius-md);
  background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow-lg);
}
.money-check-head { display: flex; gap: var(--s2); align-items: center; margin-bottom: var(--s1); color: var(--ink); }
.money-check p { margin-bottom: var(--s1); font-weight: 700; }
.money-check ul, .check-list { margin: 0; padding-left: 1.1rem; font-size: var(--fs-14); color: var(--text-soft); }
.money-check li.warn, .check-list li.warn { color: var(--orange); }
.money-check[data-level="strong"], .money-check[data-level="ok"] { border-color: var(--green); }
.money-check[data-level="tight"] { border-color: var(--orange); }
.money-check[data-level="risky"], .money-check[data-level="loss"] { border-color: var(--danger); }

.review-box dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s4); margin: 0 0 var(--s4); }
.review-box dt { color: var(--muted); font-weight: 700; }
.review-box dd { margin: 0; font-weight: 700; color: var(--ink); }
.review-check { background: var(--blue-tint-weak); border-radius: var(--radius-md); padding: var(--s3); font-weight: 700; }

.wizard-nav { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s6); }
.wizard-nav [data-wnext] { margin-left: auto; min-width: 160px; }

.writing { max-width: 640px; margin: var(--s8) auto; }
.writing-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s7); text-align: center; box-shadow: var(--shadow); }
.writing-card .spinner-ring { margin: 0 auto var(--s4); width: 48px; height: 48px; }
.writing-steps { text-align: left; display: inline-block; color: var(--muted); margin-top: var(--s3); }
.writing-inline { padding: var(--s5); margin-bottom: var(--s5); }

/* --- result page --- */
.result-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); align-items: flex-end; margin-bottom: var(--s5); }
.result-badges { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); }
.result-name { font-size: var(--fs-36); font-weight: 800; color: var(--ink); margin: 0; line-height: var(--lh-tight); }
.result-meta { color: var(--muted); margin: var(--s1) 0 0; }
.result-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.result-main, .result-side { min-width: 0; }
.result-side { position: sticky; top: var(--s4); }
.money-verdict { font-size: var(--fs-18); font-weight: 800; color: var(--ink); display: flex; gap: var(--s2); }
.money-panel.level-strong .money-verdict i, .money-panel.level-ok .money-verdict i { color: var(--green); }
.money-panel.level-tight .money-verdict i { color: var(--orange); }
.money-panel.level-risky .money-verdict i, .money-panel.level-loss .money-verdict i { color: var(--danger); }
.money-panel.level-risky, .money-panel.level-loss { border-color: var(--red-tint); }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); margin: var(--s4) 0; }
.stat { background: var(--surface-tint); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3); }
.stat span { display: block; font-size: var(--fs-12); color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.stat strong { display: block; font-size: var(--fs-20); color: var(--ink); }
.stat small { color: var(--muted); font-size: var(--fs-12); }

.doc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); margin-top: var(--s4); }
.doc-item { display: flex; gap: var(--s3); align-items: center; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); background: var(--surface); min-height: 56px; }
a.doc-item:hover { border-color: var(--blue-line-strong); background: var(--blue-tint-weak); }
.doc-item > i { font-size: var(--fs-24); width: 28px; text-align: center; }
.doc-item span { display: flex; flex-direction: column; line-height: 1.25; }
.doc-item small { color: var(--muted); font-size: var(--fs-13); }
.doc-item.is-waiting { opacity: 0.6; }
.doc-word { color: var(--blue-deep); }
.doc-excel { color: var(--green); }

.tier-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.tier-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: left; }
.tier-card { position: relative; display: flex; flex-direction: column; border: 2px solid var(--line); border-radius: var(--radius-lg); padding: var(--s5); background: var(--surface); }
.tier-card h3 { font-size: var(--fs-20); font-weight: 800; margin-bottom: var(--s1); }
.tier-card ul { list-style: none; padding: 0; margin: var(--s3) 0 var(--s4); flex: 1; font-size: var(--fs-14); }
.tier-card li { display: flex; gap: var(--s2); margin-bottom: var(--s2); color: var(--text-soft); }
.tier-card li i { color: var(--green); margin-top: 0.2rem; }
.tier-card.is-featured { border-color: var(--purple); box-shadow: var(--glow-purple); }
.tier-card.is-owned { opacity: 0.7; }
.tier-flag { position: absolute; top: -12px; left: var(--s4); background: var(--purple); color: var(--white); font-size: var(--fs-12); font-weight: 800; border-radius: var(--radius-pill); padding: 0.2rem 0.7rem; }
.tier-price { font-size: var(--fs-36); font-weight: 800; color: var(--ink); margin: 0; line-height: 1.1; }
.tier-price small { font-size: var(--fs-14); color: var(--muted); font-weight: 700; }
.tier-pick .tier-card { cursor: pointer; }
.tier-pick .tier-card input { position: absolute; opacity: 0; }
.tier-pick .tier-card:has(input:checked) { border-color: var(--blue); background: var(--blue-tint-weak); box-shadow: var(--glow-blue-soft); }
.tier-pick .tier-card:has(input:focus-visible) { outline: var(--ring-width) solid var(--ring-color); outline-offset: 2px; }
.owned-note { font-weight: 700; color: var(--green); }

.plan-preview .plan-section { padding: var(--s4) 0; border-top: 1px solid var(--line); }
.plan-preview .plan-section:first-of-type { border-top: 0; }
.plan-section h3 { font-size: var(--fs-18); font-weight: 800; color: var(--ink); }
.plan-section h3 span { color: var(--purple); margin-right: 0.2rem; }
.plan-section p { color: var(--text-soft); line-height: var(--lh-relaxed); }
.plan-table td.num, .plan-table th.num { text-align: right; white-space: nowrap; }
.plan-table tr.total td { font-weight: 800; background: var(--blue-tint-weak); }

.readiness-panel .readiness-head { display: flex; gap: var(--s3); align-items: center; }
.readiness-verdict { font-weight: 800; color: var(--ink); margin: 0; }
.readiness-panel .gap-list li { font-size: var(--fs-14); }
.doc-checklist { list-style: none; padding: 0; margin: 0; }
.doc-checklist li { padding: var(--s2) 0; border-bottom: 1px dashed var(--line); }
.doc-checklist label { display: flex; gap: var(--s2); align-items: flex-start; cursor: pointer; font-size: var(--fs-14); }
.doc-checklist input { width: 20px; height: 20px; margin-top: 0.1rem; accent-color: var(--blue); flex: 0 0 auto; }
.doc-checklist input:checked + span { text-decoration: line-through; color: var(--muted); }

/* --- editor --- */
.edit-shell { max-width: 860px; }
.edit-top { margin-bottom: var(--s5); }
.edit-label { font-weight: 800; font-size: var(--fs-18); color: var(--ink); }
.edit-label span { color: var(--purple); }
.edit-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: var(--s3); padding: var(--s3) 0; background: linear-gradient(180deg, transparent, var(--bg) 35%); }

/* --- payment --- */
.pay-shell { max-width: 820px; }
.pay-h { font-size: var(--fs-20); font-weight: 800; display: flex; gap: var(--s2); align-items: center; margin: var(--s6) 0 var(--s4); }
.momo-numbers { list-style: none; padding: 0; margin: var(--s2) 0; }
.momo-num { font-size: var(--fs-20); font-weight: 800; letter-spacing: 0.03em; }
.pay-code { font-family: ui-monospace, monospace; background: var(--blue-tint); padding: 0.1rem 0.4rem; border-radius: 6px; }

/* --- dashboard --- */
.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s4); margin-bottom: var(--s5); }
.plan-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.plan-card { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s5); box-shadow: var(--shadow-xs); }
.plan-card-title { font-size: var(--fs-20); font-weight: 800; color: var(--ink); margin: var(--s1) 0; }
.plan-card-actions { display: flex; justify-content: space-between; align-items: center; }
.empty-start { text-align: center; padding: var(--s7) var(--s5); }
.steps-mini { list-style: none; padding: 0; margin: var(--s5) auto; max-width: 520px; text-align: left; }
.steps-mini li { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0; }
.steps-mini i { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-tint); color: var(--blue-deep); }

/* --- landing extras --- */
.trust-strip { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s5); padding: 0; margin: var(--s5) 0 0; color: var(--muted); font-weight: 700; font-size: var(--fs-14); }
.trust-strip i { color: var(--blue); }
.funder-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin-top: var(--s4); }
.funder-chip { display: inline-flex; gap: var(--s2); align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-pill); padding: 0.5rem 1rem; font-weight: 700; color: var(--text-soft); }
.funder-chip i { color: var(--blue); }
.step-card h3 { font-size: var(--fs-16); font-weight: 800; }
.step-card h3 i { color: var(--purple); margin-right: 0.2rem; }
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: var(--s3) 0; }
.faq summary { font-weight: 800; cursor: pointer; color: var(--ink); }
.faq p { margin: var(--s2) 0 0; color: var(--text-soft); }
.voucher-form { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: flex-end; }
.voucher-form label { display: flex; flex-direction: column; gap: 2px; }

/* --- responsive --- */
@media (max-width: 992px) {
  .result-grid { grid-template-columns: minmax(0, 1fr); }
  .result-side { position: static; }
  .tier-cards-3 { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .choice-grid { grid-template-columns: 1fr; }
  .choice-grid-small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .money-grid, .tier-cards, .plan-cards, .doc-list { grid-template-columns: 1fr; }
  .money-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-line { grid-template-columns: minmax(0, 1fr) 120px 40px; }
  .calc-grid { grid-template-columns: 1fr; }
  .wstep-title { font-size: var(--fs-24); }
  .result-name { font-size: var(--fs-30); }
  .wizard-count { display: none; }
  .wizard-nav { position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, var(--bg) 30%); padding: var(--s3) 0; margin-top: var(--s4); }
  .money-check { position: static; }
  .result-actions .btn { flex: 1 1 auto; }
}

.inapp-notice { margin-top: var(--s4); padding: var(--s4); border-radius: 14px; background: #fff7e6; border: 1px solid #f0c36d; color: var(--ink); }
@media (max-width: 560px) {
  .plan-table { font-size: 13px; }
  .plan-table th, .plan-table td { padding: 0.5rem 0.55rem; }
}
