/* =========================================================================
   Quick Cash · Design System v2
   Banking-grade trust + Stripe-grade polish + interactive payoff
   ========================================================================= */

:root {
  /* Brand */
  --brand-900: #0A1F3D;       /* deepest navy */
  --brand-800: #0B2A4A;       /* navy */
  --brand-700: #143C68;
  --brand-600: #1E5599;
  --brand-100: #DCE7F4;
  --brand-50:  #EFF4FB;

  /* Trust accent (the brand spark) */
  --spark-700: #047857;       /* deep green */
  --spark-600: #0E7C66;       /* mid */
  --spark-500: #14B498;
  --spark-100: #C8F0E3;
  --spark-50:  #E6F9F2;

  /* Action */
  --gold-700: #B45309;
  --gold-500: #F59E0B;
  --gold-50:  #FFFBEB;

  /* Status */
  --danger-700: #991B1B;
  --danger-600: #B42318;
  --danger-50:  #FEF3F2;
  --success-700: #047857;
  --success-600: #027A48;
  --success-50: #ECFDF3;

  /* Neutrals */
  --n-950: #050810;
  --n-900: #0B0F19;
  --n-800: #1D2939;
  --n-700: #344054;
  --n-600: #475467;
  --n-500: #667085;
  --n-400: #98A2B3;
  --n-300: #D0D5DD;
  --n-200: #E4E7EC;
  --n-100: #F2F4F7;
  --n-50:  #F9FAFB;
  --white: #FFFFFF;

  /* Gradients */
  --grad-hero: linear-gradient(135deg, #0A1F3D 0%, #143C68 38%, #0E7C66 100%);
  --grad-cta: linear-gradient(135deg, #047857 0%, #14B498 100%);
  --grad-soft: radial-gradient(1200px circle at 0% 0%, rgba(20,180,152,0.10), transparent 50%),
               radial-gradient(900px circle at 100% 30%, rgba(30,85,153,0.08), transparent 50%);
  --grad-mesh: radial-gradient(circle at 10% 20%, #DCE7F4 0%, transparent 35%),
               radial-gradient(circle at 90% 80%, #C8F0E3 0%, transparent 30%);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-full: 999px;

  /* Shadows — soft, layered */
  --sh-1: 0 1px 2px rgba(11,15,25,0.05), 0 1px 1px rgba(11,15,25,0.04);
  --sh-2: 0 4px 16px -2px rgba(11,15,25,0.08), 0 2px 4px rgba(11,15,25,0.04);
  --sh-3: 0 12px 32px -4px rgba(11,15,25,0.10), 0 6px 12px rgba(11,15,25,0.05);
  --sh-4: 0 24px 64px -12px rgba(11,15,25,0.18), 0 12px 24px rgba(11,15,25,0.06);
  --sh-glow: 0 0 0 1px rgba(20,180,152,0.25), 0 8px 24px rgba(20,180,152,0.20);

  /* Type */
  --font-sans: 'InterVar', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'GeistVar', 'Geist', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;

  --container: 1240px;

  /* ===== v1 backward-compatible aliases (do not remove until all pages migrated) ===== */
  --primary-900: var(--brand-900);
  --primary-700: var(--brand-700);
  --primary-50: var(--brand-50);
  --trust-700: var(--spark-600);
  --trust-50: var(--spark-50);
  --amber: var(--gold-700);
  --amber-50: var(--gold-50);
  --radius: var(--r);
  --radius-sm: var(--r-sm);
  --shadow-sm: var(--sh-1);
  --shadow-md: var(--sh-2);
  --shadow-lg: var(--sh-3);
}

/* ========================================================================
   Reset & base
   ======================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--n-900);
  background: var(--white);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: var(--brand-700); text-decoration: none; transition: color 150ms ease; }
a:hover { color: var(--brand-900); }

::selection { background: var(--spark-100); color: var(--brand-900); }

/* Skip-to-main link — visually hidden until focused */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
  padding: 10px 18px;
  background: var(--brand-900);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 var(--r-sm) 0;
  transform: translateY(-100%);
  transition: transform 160ms ease;
  text-decoration: none;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--spark-500);
  outline-offset: 2px;
}

/* Global focus-visible outline */
:focus-visible {
  outline: 3px solid var(--spark-600);
  outline-offset: 3px;
  border-radius: 3px;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }

/* ========================================================================
   Header
   ======================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--n-200);
  transition: border-color 200ms ease, background 200ms ease;
}
.site-header.is-scrolled {
  background: rgba(255,255,255,0.95);
  box-shadow: var(--sh-1);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--brand-900);
  letter-spacing: -0.022em;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}
.brand-mark:hover { color: var(--brand-900); text-decoration: none; transform: scale(1.02); }
.brand-mark .logo-icon {
  width: 30px; height: 30px;
  background: var(--grad-cta);
  border-radius: 8px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(14,124,102,0.30);
}
.brand-mark .dot { color: var(--spark-700); }

.nav-primary { display: flex; gap: 28px; align-items: center; }
.nav-primary a {
  position: relative;
  color: var(--n-700);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  transition: color 150ms ease;
}
.nav-primary a:hover { color: var(--brand-900); text-decoration: none; }
.nav-primary a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--spark-600);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}
.nav-primary a:hover::after,
.nav-primary a[aria-current]::after { transform: scaleX(1); }

.header-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-900);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 16px -2px rgba(11,15,25,0.25);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.header-cta:hover {
  background: var(--brand-700);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 6px 24px -2px rgba(11,15,25,0.35);
}
.header-cta::after { content: '→'; transition: transform 220ms; }
.header-cta:hover::after { transform: translateX(3px); }

/* ========================================================================
   Hero
   ======================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--brand-900);
  color: #fff;
  padding: 90px 0 96px;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-hero);
  opacity: 0.96;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px circle at 88% 15%, rgba(20,180,152,0.20), transparent 50%),
    radial-gradient(600px circle at 12% 90%, rgba(245,158,11,0.10), transparent 50%);
  pointer-events: none;
}
/* subtle grid pattern */
.hero .pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
  z-index: 1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(20,180,152,0.16);
  border: 1px solid rgba(20,180,152,0.30);
  color: #B7F5DC;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--r-full);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.eyebrow .pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #14B498;
  box-shadow: 0 0 0 0 rgba(20,180,152,0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(20,180,152,0.7); }
  70% { box-shadow: 0 0 0 12px rgba(20,180,152,0); }
  100% { box-shadow: 0 0 0 0 rgba(20,180,152,0); }
}

.h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--brand-900);
  margin: 18px 0 20px;
}
/* H1 stays white only on dark backgrounds (hero, dark sections, dark CTA bands) */
.hero .h1,
.section-dark .h1,
.state-checker .h1,
.aside-card .h1 { color: #fff; }
.h1 .accent {
  background: linear-gradient(90deg, #14B498 0%, #5EEAD4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead {
  font-size: clamp(17px, 1.4vw, 19px);
  color: #B6C2D2;
  margin: 0 0 32px;
  max-width: 560px;
  line-height: 1.55;
}

.hero-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.hero-trust-row {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.hero-trust-row .it {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #B6C2D2;
}
.hero-trust-row .it .ico {
  width: 30px; height: 30px;
  background: rgba(20,180,152,0.16);
  border: 1px solid rgba(20,180,152,0.30);
  color: #5EEAD4;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px;
}

/* ===== Hero interactive card (live calculator) ===== */
.calc-card {
  position: relative;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--n-900);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--sh-4), 0 0 0 1px rgba(255,255,255,0.5) inset;
}
.calc-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--r-lg);
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.calc-card .head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.calc-card .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--n-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.calc-card .badge-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--success-50);
  color: var(--success-700);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-full);
}
.calc-card .badge-live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success-600);
  animation: blink 1.4s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.calc-card .big {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--brand-900);
  line-height: 1;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.calc-card .sub {
  font-size: 13px;
  color: var(--n-500);
  margin-bottom: 22px;
}
/* ------------------------------------------------------------------
   Range slider (v3) — bulletproof. The track pseudo-element paints the
   filled portion via the --range-pct custom property set by JS, so the
   fill is always pixel-aligned with the track and the thumb is centred
   by the standard (trackHeight - thumbHeight)/2 formula.
   ------------------------------------------------------------------ */
.range-wrap { position: relative; padding: 2px 0 14px; }
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;             /* tall enough to fully contain the 24px thumb */
  background: transparent;  /* the runnable-track draws the visible bar */
  outline: none;
  margin: 0;
  cursor: pointer;
  --range-pct: 0%;
}
/* WebKit / Blink */
.range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: var(--r-full);
  background:
    linear-gradient(var(--spark-600), var(--spark-600)) 0 / var(--range-pct) 100% no-repeat,
    var(--n-100);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px; height: 24px;
  margin-top: -8px;         /* (8px track - 24px thumb) / 2 — centres the thumb */
  background: #fff;
  border: 3px solid var(--spark-600);
  border-radius: 50%;
  box-sizing: border-box;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(14,124,102,0.30);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.range::-webkit-slider-thumb:hover { transform: scale(1.10); }
.range::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.16);
  box-shadow: 0 6px 18px rgba(14,124,102,0.45);
}
/* Firefox */
.range::-moz-range-track {
  height: 8px;
  border-radius: var(--r-full);
  background:
    linear-gradient(var(--spark-600), var(--spark-600)) 0 / var(--range-pct) 100% no-repeat,
    var(--n-100);
}
.range::-moz-range-thumb {
  width: 24px; height: 24px;
  background: #fff;
  border: 3px solid var(--spark-600);
  border-radius: 50%;
  box-sizing: border-box;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(14,124,102,0.30);
}
/* legacy overlay fill — superseded by the track gradient, kept inert */
.range-fill { display: none !important; }

/* ------------------------------------------------------------------
   Tool / calculator page layout grids
   ------------------------------------------------------------------ */
.tool-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  align-items: start;
}
.cmp-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.article-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 860px) {
  .tool-grid, .cmp-controls { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 1024px) {
  .article-2col { grid-template-columns: 1fr; gap: 32px; }
}
.range-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--n-500);
  margin-top: -4px;
}

/* Cost split */
.cost-split {
  background: var(--n-50);
  border-radius: var(--r);
  padding: 18px;
  margin: 18px 0 22px;
}
.cost-split .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  margin-bottom: 8px;
}
.cost-split .row:last-child { margin-bottom: 0; }
.cost-split .row.total {
  border-top: 1px dashed var(--n-300);
  padding-top: 10px;
  margin-top: 10px;
  font-weight: 700;
  color: var(--brand-900);
  font-size: 16px;
}
.cost-split .row .l { color: var(--n-700); }
.cost-split .row .v {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--n-900);
}

.encryption-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--n-500);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* ========================================================================
   Buttons
   ======================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: var(--r-full);
  border: 0;
  cursor: pointer;
  text-align: center;
  transition: transform 160ms cubic-bezier(.2,.7,.2,1), box-shadow 160ms ease, background 160ms ease, color 160ms ease;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-xl { padding: 18px 34px; font-size: 17px; }
.btn-block { display: flex; width: 100%; }
.btn-pill { border-radius: var(--r-full); }

.btn-primary {
  background: var(--brand-900);
  color: #fff;
  box-shadow: 0 4px 16px -2px rgba(11,15,25,0.30);
}
.btn-primary:hover { background: var(--brand-700); color: #fff; box-shadow: 0 8px 24px -2px rgba(11,15,25,0.40); }

.btn-spark {
  background: var(--grad-cta);
  color: #fff;
  box-shadow: 0 4px 16px -2px rgba(14,124,102,0.40);
  background-size: 200% 100%;
  background-position: 0% 0%;
}
.btn-spark:hover {
  color: #fff;
  background-position: 100% 0%;
  box-shadow: 0 8px 28px -2px rgba(14,124,102,0.55), var(--sh-glow);
}
.btn-spark::after { content: '→'; transition: transform 220ms; }
.btn-spark:hover::after { transform: translateX(4px); }

/* .btn-trust — alias of .btn-spark (legacy class name used in 93+ pages) */
.btn-trust {
  background: var(--grad-cta);
  color: #fff;
  box-shadow: 0 4px 16px -2px rgba(14,124,102,0.40);
  background-size: 200% 100%;
  background-position: 0% 0%;
}
.btn-trust:hover {
  color: #fff;
  background-position: 100% 0%;
  box-shadow: 0 8px 28px -2px rgba(14,124,102,0.55), var(--sh-glow);
}
.btn-trust::after { content: '→'; transition: transform 220ms; }
.btn-trust:hover::after { transform: translateX(4px); }

.btn-ghost {
  background: transparent;
  color: var(--brand-900);
  border: 1px solid var(--n-200);
}
.btn-ghost:hover { background: var(--n-50); color: var(--brand-900); border-color: var(--n-300); }

.btn-white {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.20);
  backdrop-filter: blur(10px);
}
.btn-white:hover { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.35); }

/* ========================================================================
   Trust strip (under hero)
   ======================================================================== */

.trust-strip {
  background: var(--white);
  border-bottom: 1px solid var(--n-200);
  padding: 24px 0;
  position: relative;
  z-index: 2;
  margin-top: -30px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--sh-2);
}
.trust-strip .row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}
.trust-strip .item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--n-700);
  font-weight: 500;
}
.trust-strip .item .badge-icon {
  width: 32px; height: 32px;
  background: var(--spark-50);
  color: var(--spark-700);
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 16px;
}

/* ========================================================================
   KPI counters (animated)
   ======================================================================== */

.kpi-bar {
  background: var(--n-50);
  padding: 56px 0;
  border-bottom: 1px solid var(--n-200);
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.kpi-cell {
  text-align: center;
}
.kpi-cell .v {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  color: var(--brand-900);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
  line-height: 1;
}
.kpi-cell .v .accent { color: var(--spark-700); }
.kpi-cell .l {
  font-size: 13px;
  color: var(--n-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ========================================================================
   Sections
   ======================================================================== */

.section { padding: 96px 0; }
.section-sm { padding: 56px 0; }
.section-dark {
  background: var(--brand-900);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.section-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-mesh);
  opacity: 0.08;
  pointer-events: none;
}
.section-soft { background: linear-gradient(180deg, var(--n-50) 0%, var(--white) 100%); }

.h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 800;
  letter-spacing: -0.028em;
  color: var(--brand-900);
  margin: 0 0 14px;
  line-height: 1.1;
}
.section-dark .h2 { color: #fff; }
.h2 .accent {
  background: var(--grad-cta);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-sub {
  color: var(--n-600);
  font-size: 17px;
  max-width: 680px;
  margin: 0 0 48px;
  line-height: 1.55;
}
.section-dark .section-sub { color: #B6C2D2; }

.section-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--spark-700);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.section-dark .section-eyebrow { color: #5EEAD4; }

/* ========================================================================
   Steps (how it works)
   ======================================================================== */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}
.step {
  position: relative;
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  padding: 32px;
  transition: transform 240ms cubic-bezier(.2,.7,.2,1), border-color 240ms ease, box-shadow 240ms ease;
}
.step:hover {
  transform: translateY(-4px);
  border-color: var(--spark-500);
  box-shadow: var(--sh-3);
}
.step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: var(--brand-50);
  color: var(--brand-900);
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 18px;
  transition: background 240ms ease, color 240ms ease, transform 240ms ease;
}
.step:hover .num {
  background: var(--grad-cta);
  color: #fff;
  transform: rotate(-4deg) scale(1.05);
}
.step h4 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--brand-900);
  margin: 0 0 8px;
  letter-spacing: -0.015em;
}
.step p { margin: 0; color: var(--n-700); font-size: 15px; }
.step .ms {
  position: absolute;
  top: 32px; right: 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--n-400);
}

/* ========================================================================
   Tile grids (states / money / products)
   ======================================================================== */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--r);
  font-weight: 500;
  font-size: 15px;
  color: var(--n-900);
  overflow: hidden;
  transition: transform 200ms cubic-bezier(.2,.7,.2,1), border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.tile::after {
  content: '→';
  color: var(--n-300);
  font-weight: 500;
  transition: transform 200ms ease, color 200ms ease;
}
.tile:hover {
  text-decoration: none;
  border-color: var(--spark-500);
  box-shadow: var(--sh-2);
  transform: translateY(-2px);
  color: var(--brand-900);
}
.tile:hover::after { color: var(--spark-600); transform: translateX(3px); }
.tile.is-banned { opacity: 0.85; }
.tile.is-banned:hover { border-color: var(--danger-600); }
/* tile-static — a city with no dedicated page yet: informational, not a link */
.tile-static {
  cursor: default;
  background: var(--n-50);
  color: var(--n-500);
}
.tile-static::after { display: none; }
.tile-static:hover {
  transform: none;
  border-color: var(--n-200);
  box-shadow: none;
  color: var(--n-500);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-full);
  letter-spacing: 0.01em;
}
.badge-ok { background: var(--success-50); color: var(--success-700); }
.badge-warn { background: var(--gold-50); color: var(--gold-700); }
.badge-stop { background: var(--danger-50); color: var(--danger-700); }
.badge-bad { background: var(--danger-50); color: var(--danger-700); } /* alias of badge-stop, used in state/city pages */
.badge-neutral { background: var(--n-100); color: var(--n-700); }
.badge-spark {
  background: var(--spark-50);
  color: var(--spark-700);
  border: 1px solid var(--spark-100);
}

/* ========================================================================
   Cards
   ======================================================================== */

.card {
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: transform 240ms cubic-bezier(.2,.7,.2,1), box-shadow 240ms ease, border-color 240ms ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--spark-100);
  box-shadow: var(--sh-3);
}
.card.is-highlight {
  border: 2px solid var(--spark-500);
  box-shadow: var(--sh-glow);
  position: relative;
}
.card.is-highlight::before {
  content: 'BEST CHOICE';
  position: absolute;
  top: -12px;
  left: 28px;
  background: var(--grad-cta);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  padding: 4px 12px;
  border-radius: var(--r-full);
}
.card h4 {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--brand-900);
  margin: 0 0 8px;
  letter-spacing: -0.012em;
}

/* ========================================================================
   Comparison table (interactive)
   ======================================================================== */

.compare-tool {
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--sh-2);
}
.compare-tool .controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--n-200);
}
.compare-tool .controls .field { margin: 0; }
.compare-result {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.cr-card {
  position: relative;
  background: var(--n-50);
  border: 1px solid var(--n-200);
  border-radius: var(--r);
  padding: 18px;
  text-align: left;
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}
.cr-card.is-best {
  background: var(--spark-50);
  border-color: var(--spark-500);
}
.cr-card.is-worst {
  background: var(--danger-50);
  border-color: #FECDCA;
}
.cr-card:hover { transform: translateY(-2px); }
.cr-card .name { font-size: 13px; color: var(--n-700); margin-bottom: 4px; font-weight: 600; }
.cr-card .total {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-900);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cr-card.is-best .total { color: var(--spark-700); }
.cr-card.is-worst .total { color: var(--danger-700); }
.cr-card .apr {
  font-size: 12px;
  color: var(--n-500);
  margin-top: 2px;
}

/* Visual bar comparing cost */
.cost-bars {
  margin-top: 28px;
}
.cost-bar {
  display: grid;
  grid-template-columns: 130px 1fr 80px;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}
.cost-bar .nm { color: var(--n-700); font-weight: 500; }
.cost-bar .track {
  height: 14px;
  background: var(--n-100);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}
.cost-bar .fill {
  height: 100%;
  background: var(--brand-700);
  border-radius: var(--r-full);
  width: 0%;
  transition: width 800ms cubic-bezier(.2,.7,.2,1);
}
.cost-bar.is-best .fill { background: var(--grad-cta); }
.cost-bar.is-worst .fill { background: linear-gradient(90deg, var(--danger-600), var(--danger-700)); }
.cost-bar .val {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-900);
  text-align: right;
}

/* ========================================================================
   Article (long-form)
   ======================================================================== */

.article {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  gap: 56px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 100px;
  padding: 22px;
  background: var(--n-50);
  border-radius: var(--r);
  font-size: 14px;
}
.toc strong {
  display: block;
  color: var(--brand-900);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.toc a {
  display: block;
  color: var(--n-700);
  padding: 6px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -12px;
  transition: color 150ms ease, border-color 150ms ease;
}
.toc a:hover { color: var(--brand-900); border-color: var(--spark-500); text-decoration: none; }

.byline {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13.5px;
  color: var(--n-600);
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--n-200);
}
.byline .avatar {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--grad-cta);
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(14,124,102,0.30);
}

.article-body { font-size: 17.5px; line-height: 1.75; color: var(--n-900); max-width: 740px; }
.article-body > h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.022em;
  color: var(--brand-900);
  margin: 56px 0 16px;
  line-height: 1.15;
}
.article-body > h2:first-child { margin-top: 0; }
.article-body h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-900);
  margin: 32px 0 10px;
  letter-spacing: -0.015em;
}
.article-body p { margin: 0 0 18px; }
.article-body ul, .article-body ol { padding-left: 24px; margin: 0 0 18px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--n-900); font-weight: 600; }
.article-body code {
  background: var(--n-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--brand-900);
}
/* Code inside a <pre> block is a plain dark code block — strip inline-code styling */
.article-body pre {
  background: var(--n-900);
  color: #5EEAD4;
  padding: 18px;
  border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
}
.article-body pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 15px;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.article-body th, .article-body td {
  border-bottom: 1px solid var(--n-200);
  padding: 12px 16px;
  text-align: left;
}
.article-body th {
  background: var(--n-50);
  font-weight: 600;
  color: var(--brand-900);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.article-body tr:last-child td { border-bottom: 0; }
.article-body tr:hover td { background: var(--n-50); }

.callout {
  background: var(--brand-50);
  border-left: 4px solid var(--brand-700);
  padding: 18px 20px;
  border-radius: var(--r-sm);
  margin: 24px 0;
  font-size: 16px;
  line-height: 1.6;
}
.callout-warn { background: var(--gold-50); border-left-color: var(--gold-700); }
.callout-stop { background: var(--danger-50); border-left-color: var(--danger-600); }
.callout-ok { background: var(--spark-50); border-left-color: var(--spark-700); }

.aside-card {
  position: sticky;
  top: 100px;
  background: linear-gradient(180deg, var(--brand-900) 0%, var(--brand-700) 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--sh-3);
  overflow: hidden;
  position: sticky;
}
.aside-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(20,180,152,0.30), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.aside-card h4 {
  font-family: var(--font-display);
  font-size: 22px;
  color: #fff;
  margin: 0 0 10px;
  letter-spacing: -0.015em;
  position: relative;
}
.aside-card p {
  position: relative;
  color: #B6C2D2;
  font-size: 14.5px;
  margin: 0 0 18px;
}
.aside-card hr {
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 24px 0;
}
/* Non-button links on the dark aside card need a light, high-contrast color */
.aside-card a:not(.btn) {
  color: #5EEAD4;
  text-decoration: none;
}
.aside-card a:not(.btn):hover {
  color: #C8F0E3;
  text-decoration: underline;
}
.aside-card .mini-stats {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 12px;
  margin-top: 18px;
}
.aside-card .ms-cell .v {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.aside-card .ms-cell .l {
  font-size: 11px;
  color: #93a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ========================================================================
   Legal block (state hub status)
   ======================================================================== */

.legal-block {
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--r-lg);
  padding: 28px;
  margin: 0 0 32px;
  position: relative;
  overflow: hidden;
}
.legal-block.banned { background: var(--danger-50); border-color: #FECDCA; }
.legal-block.allowed { background: var(--success-50); border-color: #ABEFC6; }
.legal-block.restricted { background: var(--gold-50); border-color: #FED7AA; }
.legal-block h2 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.015em;
}
.legal-block .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  font-size: 15px;
  margin-top: 18px;
}
.legal-block .row dt { color: var(--n-600); font-weight: 500; }
.legal-block .row dd { margin: 0 0 6px; font-weight: 600; color: var(--n-900); }

/* ========================================================================
   Alternative cards (banned-state layout)
   ======================================================================== */

.alt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.alt-card {
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--r);
  padding: 24px;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1), border-color 220ms ease, box-shadow 220ms ease;
  position: relative;
  overflow: hidden;
}
.alt-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-cta);
  transform: translateX(-100%);
  transition: transform 360ms cubic-bezier(.2,.7,.2,1);
}
.alt-card:hover {
  transform: translateY(-3px);
  border-color: var(--spark-100);
  box-shadow: var(--sh-3);
}
.alt-card:hover::before { transform: translateX(0); }
.alt-card h4 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  color: var(--brand-900);
  font-size: 18px;
  letter-spacing: -0.015em;
}
.alt-card p { margin: 0 0 14px; color: var(--n-700); font-size: 14.5px; }
.alt-card .meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--n-500);
  border-top: 1px solid var(--n-200);
  padding-top: 12px;
  font-weight: 500;
}
.alt-card .rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--spark-700);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
}

/* ========================================================================
   Multistep form
   ======================================================================== */

.apply-shell {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 0;
}
.progress {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
}
.progress .seg {
  height: 6px;
  flex: 1;
  background: var(--n-200);
  border-radius: var(--r-full);
  transition: background 280ms ease;
}
.progress .seg.done { background: var(--spark-500); }
.progress .seg.now {
  background: var(--brand-900);
  position: relative;
  overflow: hidden;
}
.progress .seg.now::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.8s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.step-label {
  text-align: center;
  font-size: 13px;
  color: var(--n-500);
  margin-bottom: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.step-h {
  font-family: var(--font-display);
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  color: var(--brand-900);
  margin: 0 0 10px;
  letter-spacing: -0.028em;
  line-height: 1.15;
}
.step-sub {
  text-align: center;
  color: var(--n-600);
  font-size: 15.5px;
  margin: 0 0 36px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.step-card {
  animation: stepIn 380ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.field { display: block; margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--n-800);
  margin-bottom: 8px;
}
.field label .hint { color: var(--n-500); font-weight: 400; }
.field input, .field select {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--n-300);
  background: #fff;
  color: var(--n-900);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input:hover, .field select:hover { border-color: var(--n-400); }
.field input:focus, .field select:focus {
  border-color: var(--spark-600);
  outline: 3px solid rgba(14,124,102,0.12);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field .help { display: block; margin-top: 6px; font-size: 12px; color: var(--n-500); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--n-50);
  border: 1px solid var(--n-200);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--n-700);
  line-height: 1.5;
  transition: border-color 160ms ease, background 160ms ease;
}
.consent:hover { border-color: var(--n-300); background: #fff; }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--spark-600); }
.consent strong { color: var(--n-900); }

.tcpa-disclosure {
  font-size: 12.5px;
  color: var(--n-600);
  background: var(--brand-50);
  border-left: 3px solid var(--brand-700);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 18px;
  line-height: 1.55;
}

/* Range slider in apply */
.amount-display {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 800;
  color: var(--brand-900);
  text-align: center;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 14px;
}

/* Live social proof ticker */
.proof-ticker {
  background: var(--spark-50);
  border: 1px solid var(--spark-100);
  border-radius: var(--r-full);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--spark-700);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.proof-ticker .dot {
  width: 8px; height: 8px;
  background: var(--spark-600);
  border-radius: 50%;
  animation: blink 1.4s infinite;
}

/* ========================================================================
   FAQ
   ======================================================================== */

.faq { max-width: 720px; margin: 0 auto; }
.faq details {
  border: 1px solid var(--n-200);
  border-radius: var(--r);
  padding: 0;
  margin-bottom: 10px;
  background: #fff;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.faq details[open] {
  border-color: var(--spark-500);
  box-shadow: var(--sh-1);
}
.faq summary {
  font-weight: 600;
  font-size: 16px;
  color: var(--brand-900);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  user-select: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  color: var(--n-400);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  transition: transform 240ms ease, color 240ms ease;
}
.faq details[open] summary::after { transform: rotate(45deg); color: var(--spark-600); }
.faq summary:hover { color: var(--brand-700); }
.faq details p {
  margin: 0;
  padding: 0 24px 22px;
  color: var(--n-700);
  font-size: 15.5px;
  line-height: 1.65;
}

/* ========================================================================
   State checker (interactive widget)
   ======================================================================== */

.state-checker {
  background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 40px;
  box-shadow: var(--sh-3);
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.state-checker::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(20,180,152,0.30), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.state-checker h3 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  color: #fff;
  position: relative;
}
.state-checker p {
  color: #B6C2D2;
  font-size: 15px;
  margin: 0 0 22px;
  position: relative;
}
.state-checker .input-stack {
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 2;
}
.state-checker select {
  flex: 1;
  background: rgba(255,255,255,0.95);
  border: 0;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--n-900);
}
.state-checker .result {
  position: relative;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r);
  padding: 22px;
  min-height: 180px;
  z-index: 2;
}
.state-checker .result .name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.state-checker .result .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  margin: 10px 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.state-checker .result .status.allowed { background: var(--success-700); color: #fff; }
.state-checker .result .status.restricted { background: var(--gold-700); color: #fff; }
.state-checker .result .status.banned { background: var(--danger-700); color: #fff; }
.state-checker .result dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  font-size: 13.5px;
  margin: 0;
}
.state-checker .result dt { color: #93a3b8; }
.state-checker .result dd { margin: 0 0 4px; font-weight: 600; color: #fff; }

/* ========================================================================
   Choropleth + research page elements
   ======================================================================== */

.choropleth {
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--sh-1);
  position: relative;
}
/* The cartogram SVG has viewBox 0 0 600 400 + width="100%" but no height —
   pin it here so it scales proportionally instead of blowing up the layout. */
.choropleth svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 720px;
  margin: 0 auto;
}
.choropleth .legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--n-600);
  margin-top: 18px;
  align-items: center;
}
.choropleth .legend .key {
  display: inline-flex; align-items: center; gap: 6px;
}
.choropleth .legend .sw {
  width: 18px; height: 12px; border-radius: 3px;
}
.choropleth-tooltip {
  position: absolute;
  background: var(--n-900);
  color: #fff;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 8px));
  transition: opacity 120ms ease;
  z-index: 10;
  box-shadow: var(--sh-3);
  white-space: nowrap;
}
.choropleth-tooltip strong { color: #fff; }
.choropleth-tooltip .ct-sub { font-size: 11px; color: #93a3b8; margin-top: 2px; }
.choropleth-tooltip.show { opacity: 1; }

/* SVG state cell hover */
.us-cell {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 2;
  transition: opacity 180ms ease, stroke-width 180ms ease, transform 180ms ease;
  transform-origin: center;
}
.us-cell:hover {
  opacity: 0.85;
  stroke-width: 3;
}

/* KPI row research */
.kpi-row-r {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 24px 0 36px;
}
.kpi-r {
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.kpi-r::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 4px;
  width: 100%;
  background: var(--grad-cta);
  transform: translateX(-100%);
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
}
.kpi-r.in-view::after { transform: translateX(0); }
.kpi-r .l { font-size: 12px; color: var(--n-500); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.kpi-r .v {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  color: var(--brand-900);
  letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 8px 0 4px;
}
.kpi-r .s { font-size: 13px; color: var(--n-600); }

/* ========================================================================
   Footer
   ======================================================================== */

.site-footer {
  background: var(--brand-900);
  color: #B6C2D2;
  padding: 80px 0 32px;
  margin-top: 0;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--spark-500), transparent);
  opacity: 0.5;
}
.site-footer a { color: #B6C2D2; transition: color 150ms ease; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 56px;
  margin-bottom: 48px;
}
.footer-grid h5 {
  font-family: var(--font-display);
  color: #fff;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  margin: 0 0 18px;
  font-weight: 700;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 12px; }
.footer-disclosure {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 28px;
  font-size: 12px;
  color: #7b8a9d;
  line-height: 1.7;
}
.state-disclosure {
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--spark-500);
  padding: 18px 22px;
  margin: 24px 0;
  border-radius: 4px;
  font-size: 13px;
  color: var(--n-700);
  background: var(--n-50);
  border-color: var(--brand-700);
}

/* ========================================================================
   Local stats (city page)
   ======================================================================== */

.local-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--sh-1);
}
.local-stats .stat .label {
  font-size: 12px;
  color: var(--n-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.local-stats .stat .value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--brand-900);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}
.local-stats .stat .sub {
  font-size: 12px;
  color: var(--n-500);
  margin-top: 2px;
}

/* ========================================================================
   Preview-only ribbon + variant bar
   ======================================================================== */

.preview-ribbon {
  background: linear-gradient(90deg, var(--brand-900), var(--brand-700));
  color: #fff;
  font-size: 12.5px;
  padding: 9px 0;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.preview-ribbon a { color: #5EEAD4; }
.preview-ribbon strong {
  background: rgba(20,180,152,0.20);
  border: 1px solid rgba(20,180,152,0.30);
  padding: 2px 8px;
  border-radius: var(--r-full);
  margin-right: 6px;
}
.variant-bar {
  background: var(--brand-900);
  color: #fff;
  padding: 9px 0;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.variant-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.variant-bar a { color: #5EEAD4; }
.variant-bar a.active { color: #fff; border-bottom: 1px dashed #5EEAD4; }

/* ========================================================================
   Scroll-reveal animations
   ======================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms cubic-bezier(.2,.7,.2,1), transform 700ms cubic-bezier(.2,.7,.2,1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-reveal-delay="100"] { transition-delay: 100ms; }
.reveal[data-reveal-delay="200"] { transition-delay: 200ms; }
.reveal[data-reveal-delay="300"] { transition-delay: 300ms; }
.reveal[data-reveal-delay="400"] { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ========================================================================
   Responsive
   ======================================================================== */

@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .article { grid-template-columns: 1fr; gap: 32px; }
  .toc, .aside-card { position: static; }
  .nav-primary { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .compare-result { grid-template-columns: repeat(2, 1fr); }
  .state-checker { grid-template-columns: 1fr; gap: 24px; padding: 28px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-row-r { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .alt-grid { grid-template-columns: 1fr; }
  .local-stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 64px 0; }
}

@media (max-width: 600px) {
  .hero { padding: 56px 0 64px; }
  .container { padding: 0 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .h1 { font-size: 36px; }
  .h2 { font-size: 28px; }
  .calc-card { padding: 24px; }
  .calc-card .big { font-size: 50px; }
  .legal-block .row { grid-template-columns: 1fr; }
  .step { padding: 24px; }
  .apply-shell { padding: 24px 0; }
  .compare-tool { padding: 22px; }
  .compare-tool .controls { grid-template-columns: 1fr; gap: 12px; }
  .step-h { font-size: 26px; }
  .amount-display { font-size: 56px; }
}

/* ========================================================================
   UNIFIED NAVIGATION v3 — global header dropdowns, mobile drawer,
   5-column mega-footer. Loaded after base rules so it wins cascade.
   Owner: FE Engineer · 2026-05-24
   ======================================================================== */

/* --- Header layout --- */
.site-header .container { gap: 20px; }
.header-actions { display: flex; align-items: center; gap: 14px; }

/* --- Primary nav --- */
.nav-primary { display: flex; gap: 22px; align-items: center; }
.nav-primary > a,
.nav-primary .nav-link {
  position: relative;
  color: var(--n-700);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  white-space: nowrap;
  transition: color 150ms ease;
}
.nav-primary > a:hover,
.nav-primary .nav-link:hover { color: var(--brand-900); text-decoration: none; }

/* --- Dropdown --- */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-caret {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  transition: transform 180ms ease;
}
.nav-item:hover .nav-caret,
.nav-item:focus-within .nav-caret { transform: rotate(180deg); }

.nav-dd {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 248px;
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 48px -12px rgba(11,15,25,0.28);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
  z-index: 120;
}
.nav-item:hover .nav-dd,
.nav-item:focus-within .nav-dd {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* invisible hover bridge so the menu doesn't close in the 10px gap */
.nav-dd::before {
  content: '';
  position: absolute;
  top: -12px; left: 0; right: 0;
  height: 14px;
}
.nav-dd a {
  display: block;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--n-700);
  border-radius: 7px;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}
.nav-dd a::after { display: none; }
.nav-dd a:hover {
  background: var(--n-100);
  color: var(--brand-900);
  text-decoration: none;
}
.nav-dd .nav-dd-all {
  margin-top: 6px;
  border-top: 1px solid var(--n-200);
  border-radius: 0 0 7px 7px;
  color: var(--brand-700);
  font-weight: 700;
}
.nav-dd .nav-dd-all:hover { background: var(--brand-900); color: #fff; }

/* --- Hamburger toggle (hidden on desktop) --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--n-200);
  border-radius: 9px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  margin: 0 auto;
  background: var(--brand-900);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 160ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Mobile drawer (full-screen overlay) --- */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #fff;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-nav.is-open { display: block; }
body.nav-locked { overflow: hidden; }
.mobile-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--n-200);
  position: sticky; top: 0;
  background: #fff;
}
.mobile-nav-close {
  width: 42px; height: 42px;
  font-size: 24px; line-height: 1;
  background: transparent;
  border: 1px solid var(--n-200);
  border-radius: 9px;
  color: var(--n-700);
  cursor: pointer;
}
.mobile-nav-body { padding: 12px 20px 40px; }
.mobile-nav .m-cta {
  display: block;
  text-align: center;
  background: var(--brand-900);
  color: #fff;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--r-full);
  margin: 8px 0 18px;
}
.mobile-nav .m-cta:hover { background: var(--brand-700); text-decoration: none; color: #fff; }
.mobile-nav details {
  border-bottom: 1px solid var(--n-200);
}
.mobile-nav details > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--brand-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-nav details > summary::-webkit-details-marker { display: none; }
.mobile-nav details > summary::after {
  content: '+';
  font-size: 20px;
  color: var(--n-500);
  font-weight: 400;
}
.mobile-nav details[open] > summary::after { content: '–'; }
.mobile-nav .m-links { padding: 0 4px 14px; }
.mobile-nav .m-links a {
  display: block;
  padding: 12px 0;
  min-height: 44px;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--n-700);
  font-weight: 500;
}
.mobile-nav .m-links a:hover { color: var(--brand-900); text-decoration: none; }
.mobile-nav > .mobile-nav-body > a.m-flat {
  display: block;
  padding: 16px 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--brand-900);
  border-bottom: 1px solid var(--n-200);
}

/* --- 5-column mega-footer (overrides base 4-col) --- */
.footer-grid {
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1.1fr;
  gap: 40px;
}
.footer-grid li { margin-bottom: 10px; line-height: 1.5; }
.footer-grid li a { font-size: 13.5px; }
.footer-brand p { color: #7b8a9d; }

/* --- Hub / index page grids --- */
.hub-section { margin: 0 0 44px; }
.hub-section > h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--brand-900);
  margin: 0 0 6px;
}
.hub-section > .hub-note { color: var(--n-600); font-size: 14.5px; margin: 0 0 18px; }
.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.hub-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.hub-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.hub-card {
  display: block;
  background: #fff;
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.hub-card:hover {
  border-color: var(--brand-700);
  box-shadow: var(--sh-1);
  transform: translateY(-2px);
  text-decoration: none;
}
.hub-card .hc-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--brand-900);
  margin: 0 0 4px;
}
.hub-card .hc-sub { font-size: 13px; color: var(--n-600); line-height: 1.5; }
.hub-card .hc-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--r-full);
  margin-top: 8px;
}
.hc-tag.t-allowed   { background: #DCFCE7; color: #166534; }
.hc-tag.t-restricted{ background: #FEF9C3; color: #854D0E; }
.hc-tag.t-installment{ background: #DBEAFE; color: #1E40AF; }
.hc-tag.t-banned    { background: #FEE2E2; color: #991B1B; }

@media (max-width: 1024px) {
  .nav-toggle { display: flex; }
  .header-cta.header-cta-desktop { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .hub-grid, .hub-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hub-grid, .hub-grid.cols-3, .hub-grid.cols-2 { grid-template-columns: 1fr; }
  .site-header .container { gap: 12px; }
}

/* ========================================================================
   MOBILE LAYER v1 (cycle 13) — full small-screen adaptation.
   Loaded last; `!important` is used only where it must defeat the many
   inline desktop styles (font-size / grid-template-columns) baked into
   the page HTML, which a normal media-query rule cannot override.
   Goal: identical content & functionality as desktop, reflowed for phones.
   ======================================================================== */
@media (max-width: 768px) {

  /* --- overflow guards: media never pushes the page wider than the screen --- */
  img, svg, video { max-width: 100%; height: auto; }
  iframe { max-width: 100%; }
  pre { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .container { padding-left: 18px; padding-right: 18px; }

  /* --- typography: shrink headings + any oversized inline font-size --- */
  h1, .h1 { font-size: 30px !important; line-height: 1.18 !important; }
  h2, .h2 { font-size: 23px !important; line-height: 1.26 !important; }
  h3, .h3 { font-size: 19px !important; line-height: 1.3 !important; }
  [style*="font-size:32px"], [style*="font-size: 32px"],
  [style*="font-size:34px"], [style*="font-size: 34px"],
  [style*="font-size:36px"], [style*="font-size: 36px"],
  [style*="font-size:38px"], [style*="font-size: 38px"],
  [style*="font-size:40px"], [style*="font-size: 40px"],
  [style*="font-size:42px"], [style*="font-size: 42px"],
  [style*="font-size:44px"], [style*="font-size: 44px"],
  [style*="font-size:46px"], [style*="font-size: 46px"],
  [style*="font-size:48px"], [style*="font-size: 48px"],
  [style*="font-size:50px"], [style*="font-size: 50px"],
  [style*="font-size:54px"], [style*="font-size: 54px"],
  [style*="font-size:56px"], [style*="font-size: 56px"],
  [style*="font-size:60px"], [style*="font-size: 60px"],
  [style*="font-size:64px"], [style*="font-size: 64px"] {
    font-size: 30px !important;
    line-height: 1.2 !important;
  }

  /* --- layout: every multi-column grid collapses to a single column --- */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .footer-grid, .hub-grid, .hub-grid.cols-2, .hub-grid.cols-3,
  .tool-grid, .cmp-controls, .article, .article-2col,
  .alt-grid, .kpi-grid, .kpi-row-r, .steps, .compare-result,
  .compare-tool .controls, .local-stats, .field-row,
  .legal-block .row, .hero-inner {
    grid-template-columns: 1fr !important;
  }

  /* --- tables scroll horizontally instead of breaking the page --- */
  table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* --- sticky side rails release so they don't overlap content --- */
  .toc, .aside-card { position: static !important; top: auto !important; }

  /* --- form fields: 16px min stops iOS from auto-zooming on focus --- */
  input, select, textarea { font-size: 16px !important; }

  /* --- large CTAs span the width for an easy tap target --- */
  .btn-lg { width: 100%; justify-content: center; }

  /* --- trim the airiest section padding on small screens --- */
  .section { padding: 44px 0; }
  .hero { padding: 48px 0 56px; }
}

@media (max-width: 430px) {
  h1, .h1, [style*="font-size:38px"], [style*="font-size:40px"],
  [style*="font-size:42px"], [style*="font-size:46px"],
  [style*="font-size:48px"], [style*="font-size:54px"] {
    font-size: 26px !important;
  }
  .container { padding-left: 15px; padding-right: 15px; }
}

/* ========================================================================
   MOBILE HEADER FIX (cycle 14) — MUST be last in the file.
   The cycle-7 nav rule `.nav-primary { display:flex }` sits AFTER the
   `@media(max-width:1024px){ .nav-primary{display:none} }` block, so on
   phones the desktop nav never collapsed (same specificity → later wins).
   This final, !important rule guarantees the hamburger replaces the
   desktop nav on every screen <=1024px.
   ======================================================================== */
@media (max-width: 1024px) {
  .site-header .nav-primary { display: none !important; }
  .site-header .nav-toggle { display: flex !important; }
  .header-cta-desktop { display: none !important; }
}
