/**
 * GainHelm Canonical Porcelain Light Design System (porcelain-v1)
 * Single-source-of-truth Porcelain tokens, layout primitives, WCAG AA contrast,
 * 44x44px touch ergonomics, and CPA print media rules.
 * Zero em-dashes. Zero en-dashes.
 */

:root {
  /* Canonical Porcelain Surfaces */
  --bg-canvas: #fbfcfd;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f6f8;
  --bg-muted: #eef2f6;
  --bg-elevated: #ecfdf5;
  --bg-inset: #f4f6f8;
  --bg-tertiary: #eef2f6;

  /* Surface Compatibility Aliases */
  --bg: #fbfcfd;
  --bg-body: #fbfcfd;
  --bg-primary: #fbfcfd;
  --card-bg: #ffffff;
  --bg-card: #ffffff;

  /* High-Contrast Ink Typography (WCAG AA/AAA Verified) */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  --text-faint: #475569;
  --text-tertiary: #475569;
  --text: #0f172a;
  --text-main: #0f172a;

  /* Tenant Brand & Accent Tokens */
  --brand-primary: #047857;
  --brand-accent: #047857;
  --brand-hover: #065f46;
  --brand-soft: #ecfdf5;
  --brand-border: #a7f3d0;
  --accent: #047857;
  --accent-primary: #047857;
  --accent-blue: #047857;
  --primary: #047857;
  --accent-hover: #065f46;
  --accent-secondary: #065f46;
  --accent-subtle: #ecfdf5;
  --cta-fg: #ffffff;

  /* Borders & Focus Indicators */
  --border-hairline: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;
  --border-focus: #047857;
  --border: #cbd5e1;
  --border-color: #e2e8f0;

  /* Semantic Status Palette (WCAG AA >= 4.5:1 on Light & Tinted Surfaces) */
  --status-positive: #047857;
  --accent-success: #047857;
  --status-positive-bg: #ecfdf5;
  --status-positive-border: #a7f3d0;

  --status-warning: #92400e;
  --status-warning-bg: #fffbeb;
  --status-warning-border: #fde68a;

  --status-danger: #b91c1c;
  --status-negative: #b91c1c;
  --status-danger-bg: #fef2f2;
  --status-negative-bg: #fef2f2;
  --status-danger-border: #fecaca;
  --status-negative-border: #fecaca;

  /* Progressive Bracket Meter Tokens */
  --meter-tier-1: #93c5fd;
  --meter-tier-2: #60a5fa;
  --meter-tier-3: #3b82f6;
  --meter-tier-4: #1d4ed8;
  --meter-tier-5: #1e40af;
  --meter-tier-6: #1e3a8a;
  --meter-tier-7: #0f172a;

  /* Elevation, Radius & Font Stacks */
  --shadow-subtle: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-elevated: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --radius-sm: 6px;
  --radius-md: 8px;
  --border-radius: 8px;
  --radius-card: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Accessibility Skip Link */
.skip-link,
.skip-to-content-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 1rem;
  background-color: var(--brand-primary);
  color: #ffffff;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible,
.skip-to-content-link:focus,
.skip-to-content-link:focus-visible {
  left: 1rem;
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* Layout Container & Locked Vertical Flow Rhythm */
.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-main,
main.main,
main#main-content {
  flex: 1 0 auto;
  width: 100%;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.site-main > .container,
main#main-content > .container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.site-main > .container > *,
main#main-content > .container > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100%;
  max-width: 100%;
}

/* Canonical Header & Mobile Drawer */
.site-header,
.header,
.site-header.header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.25rem 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  border-radius: var(--radius-md);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background-color: var(--brand-primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.nav-desktop-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: var(--radius-md);
}

.nav-links a:hover {
  color: var(--brand-primary);
  background-color: var(--bg-subtle);
}

.mobile-nav-menu {
  display: none;
  position: relative;
}

.mobile-nav-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
}

.mobile-nav-menu > summary::-webkit-details-marker {
  display: none;
}

.mobile-nav-drawer {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(280px, calc(100vw - 2.5rem));
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 0.75rem;
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 250;
}

.mobile-nav-drawer a {
  display: flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
}

.mobile-nav-drawer a:hover {
  background-color: var(--bg-subtle);
  color: var(--brand-primary);
}

/* Typography Scale & Hierarchy */
h1, .hero-title {
  font-size: 2rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

h2, .section-title {
  font-size: 1.375rem;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

h3, .card-title {
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

h4 {
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.375rem 0;
}

p {
  margin: 0 0 0.75rem 0;
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

ul, ol {
  margin: 0 0 0.875rem 1.25rem;
  padding: 0;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.375rem;
}

code, pre, .font-mono {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  max-width: 100%;
  overflow-x: auto;
}

figure {
  margin: 1rem 0;
  max-width: 100%;
}

/* Links & Universal 44x44px Touch Ergonomics (with WCAG 2.5.8 Inline Prose Exemption) */
a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand-hover);
}

a:not(.skip-link):not(.skip-to-content-link),
button,
#calculate-btn,
[role="button"],
summary,
.touch-target {
  min-height: 44px;
  min-width: 44px;
}

a:not(.skip-link):not(.skip-to-content-link) {
  display: inline-flex;
  align-items: center;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

li a:not(.btn):not(.btn-cta):not(.partner-btn):not(.tool-link):not(.nav-link),
td a:not(.btn):not(.btn-cta):not(.partner-btn) {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

main p a:not(.btn):not(.btn-cta):not(.btn-primary):not(.btn-secondary):not(.partner-btn):not(.touch-target):not([role="button"]),
main dd a:not(.btn):not(.btn-cta):not(.partner-btn):not(.touch-target):not([role="button"]),
main blockquote a:not(.btn):not(.btn-cta):not(.partner-btn):not(.touch-target):not([role="button"]) {
  display: inline;
  min-height: auto;
  min-width: auto;
  padding: 0;
}

main a.inline-prose-link {
  display: inline !important;
  min-height: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
}

/* Visible Keyboard Focus Ring */
a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
summary:focus,
summary:focus-visible,
[role="button"]:focus,
[role="button"]:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Canonical Porcelain Cards (Exact 12px Radius & >= 24px Padding) */
.card,
.pseo-card,
.calc-card,
.interactive-calc-card,
.calculation-container,
.methodology-card,
.faq-card,
.partner-card,
.affiliate-card,
.decision-framework-card,
.hero-section,
.tool-hero,
.comparison-table-section,
.procedure-section,
.tools-directory-grid-section,
.affiliate-section,
.affiliates-section,
.refinance-partner-section,
.partner-quote-intake-drawer,
.post-calc-upgrade-drawer,
.partner-registration-drawer,
.serp-depth-workbench,
.pro-hook-card,
.playbook-capture-card,
.calc-inline-cta {
  background-color: #ffffff !important;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px !important;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* Breadcrumbs, Quick Answer & Above-the-Fold Compliance Strip */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

.breadcrumbs a {
  color: var(--brand-primary);
  text-decoration: none;
  padding: 0.25rem 0.375rem;
  font-weight: 500;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.quick-answer {
  background-color: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
  color: var(--text-primary);
}

.quick-answer p,
.quick-answer .quick-answer-body {
  color: var(--text-primary);
  font-size: 0.96875rem;
  line-height: 1.6;
  margin: 0;
}

.compliance-strip,
.ftc-disclosure-banner {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-primary);
  border-radius: 12px;
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.compliance-strip strong,
.ftc-disclosure-banner strong {
  color: var(--text-primary);
}

/* Buttons & Primary CTAs */
#calculate-btn,
.btn,
.btn-cta,
.btn-primary,
.partner-btn,
a.btn,
a.btn-cta,
a.btn-primary,
.affiliate-cta-link,
a.affiliate-cta-link,
button.btn,
button.btn-cta,
button.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 1.125rem;
  background-color: var(--brand-primary);
  color: #ffffff;
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

#calculate-btn:hover,
.btn:hover,
.btn-cta:hover,
.btn-primary:hover,
.partner-btn:hover,
.affiliate-cta-link:hover,
a.btn:hover,
a.btn-cta:hover,
a.btn-primary:hover,
a.affiliate-cta-link:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #ffffff;
}

.btn-secondary,
.btn-outline,
.btn-preset,
.scenario-preset-link,
.on-this-page-nav a,
.cluster-link,
.calc-switcher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.875rem;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary:hover,
.btn-outline:hover,
.btn-preset:hover,
.scenario-preset-link:hover,
.on-this-page-nav a:hover,
.cluster-link:hover,
.calc-switcher-btn:hover {
  background-color: var(--brand-soft);
  border-color: var(--brand-primary);
  color: var(--brand-hover);
}

/* Calculator Grid, Inputs & Tabular Readouts */
.calc-grid,
.calculator-grid,
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
  align-items: start;
}

.calc-grid > *,
.calculator-grid > *,
.grid-2 > *,
.card {
  min-width: 0;
}

.tools-grid,
.card-grid,
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}

.tools-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.tool-link-item {
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  margin: 0;
}

.form-group,
.input-group,
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-sans);
  font-size: 16px !important;
  line-height: 1.4;
  color: var(--text-primary);
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

input[type="range"] {
  width: 100%;
  min-height: 44px;
  accent-color: var(--brand-primary);
  cursor: pointer;
  background: transparent;
}

input[type="checkbox"],
input[type="radio"] {
  min-width: 44px;
  min-height: 44px;
  accent-color: var(--brand-primary);
}

.result-box,
.results-panel,
.calc-results,
.output-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
}

.output-value,
.metric-val,
.metric-value,
.calc-metric-value,
.res-val,
.kpi-value,
.tabular-nums,
output,
[id^="val-"],
[id^="res-"],
[id^="metric-"] {
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1;
  color: var(--text-primary);
  font-weight: 700;
}

.output-value,
.kpi-value {
  font-size: 1.75rem;
  line-height: 1.2;
}

/* Badges, Status Pills & Bracket Meter */
.badge,
.pill,
.status-badge,
.authority-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background-color: var(--brand-soft);
  color: var(--brand-hover);
  border: 1px solid var(--brand-border);
}

.badge-success {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background-color: var(--status-positive-bg);
  color: var(--status-positive);
  border: 1px solid var(--status-positive-border);
}

.badge-warning {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background-color: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid var(--status-warning-border);
}

.badge-danger {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background-color: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

.badge-neutral {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.clawback-notice-text {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--status-warning);
  margin-bottom: 0.25rem;
}

.bracket-meter,
#bracket-meter-bar {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 9999px;
  overflow: hidden;
  background-color: var(--bg-muted);
  gap: 2px;
}

.bracket-meter-seg {
  height: 100%;
}

/* Responsive Tables */
.table-wrap,
.pseo-table-wrap,
.calc-matrix-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background-color: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: top;
}

th {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
}

tr:last-child td {
  border-bottom: none;
}

.text-right {
  text-align: right;
}

/* Methodology, Overlay & Governance Semantic Blocks */
.gsc-overlay-container,
#gsc-striking-overlay {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  width: 100%;
  max-width: 100%;
}

.gsc-overlay-container > *,
#gsc-striking-overlay > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100%;
  max-width: 100%;
}

.gsc-remediation-overlay,
.verified-methodology-block,
.editorial-governance-byline,
.multi-dataset-join {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  color: var(--text-primary);
}

.editorial-governance-byline {
  background-color: var(--bg-subtle);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.above-fold-preset-bar,
.serp-preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

details.faq-item,
.faq-list details {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

details.faq-item summary,
.faq-list details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.calculation-manifest,
script,
template {
  display: none !important;
}

/* Canonical Footer & Lead Capture Card */
.site-footer,
.footer,
.site-footer.footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-hairline);
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  margin-top: auto;
  color: var(--text-secondary);
  width: 100%;
}

.footer-lead-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-lead-copy {
  flex: 1 1 320px;
}

.footer-lead-copy h2,
.footer-lead-copy h3 {
  margin-bottom: 0.375rem;
  color: var(--text-primary);
}

.footer-lead-form {
  flex: 1 1 320px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}

.footer-lead-form input[type="email"] {
  flex: 1 1 200px;
  min-width: 180px;
}

.footer-lead-status {
  width: 100%;
  font-size: 0.875rem;
  color: var(--status-positive);
  font-weight: 600;
  min-height: 1.25rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.75rem;
  margin-bottom: 2rem;
}

.footer-col h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.625rem 0;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.footer-links li {
  margin: 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.25rem 0.375rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.footer-links a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.footer-entity-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.footer-bottom {
  border-top: 1px solid var(--border-hairline);
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visual Primitives, Workbench, Overlay & Partner Component Rules */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  max-width: 100%;
  box-sizing: border-box;
}

.serp-incumbent-depth-workbench,
.overlay-section,
.affiliate-cta-section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.serp-sub-inputs-grid,
.serp-metrics-grid,
.post-calc-upgrade-pillars,
.features-grid,
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.serp-metric-box,
.calc-metric-card,
.post-calc-upgrade-pillar,
.feature-card,
.scenario-card,
.affiliate-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  min-width: 0;
}

.serp-sub-input,
.serp-sub-select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.serp-archetype-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.serp-archetype-btn:hover,
.serp-archetype-btn.active {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background-color: var(--bg-elevated);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background-color: var(--brand-primary);
  margin-right: 0.375rem;
  vertical-align: middle;
}

.calc-tooltip {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

details.faq-accordion {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  margin-bottom: 0.625rem;
}

details.faq-accordion > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  min-width: 44px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
}

details.faq-accordion > summary::-webkit-details-marker {
  display: none;
}

.hero-range-anchor,
.state-first-hero-bar,
.above-fold-preset-bar,
.pro-hook-card,
.calc-inline-cta,
.lead-capture-card,
.playbook-capture-card {
  max-width: 100%;
  box-sizing: border-box;
}

/* Complete Porcelain Light Coverage for All Estate UI Components */
.brand-name {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.hero-subtitle,
.hero-desc,
.section-subtitle,
.section-desc,
.section-lead,
.tool-desc,
.partners-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 0.75rem 0;
}
.verified-date-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0.5rem 0 0 0;
}

.section-subtitle {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-register-firm-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
}

.hero-register-firm-link:hover {
  background-color: var(--brand-soft);
  border-color: var(--brand-primary);
  color: var(--brand-hover);
}

.byline-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0.75rem 0;
}

.byline-author {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-style: normal;
}

.byline-label,
.byline-sep,
.byline-date {
  color: var(--text-muted);
}

.byline-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.25rem 0.375rem;
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.byline-link:hover {
  text-decoration: underline;
}

.byline-org {
  color: var(--brand-primary);
  font-weight: 600;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background-color: var(--brand-soft);
  color: var(--brand-hover);
  border: 1px solid var(--brand-border);
  margin-bottom: 0.5rem;
}

.pill-trust-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.pill-trust {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3125rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background-color: var(--bg-subtle);
  color: var(--brand-primary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.separator {
  color: var(--text-muted);
  margin: 0 0.25rem;
  user-select: none;
}

.quick-answer-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.direct-answer-block {
  margin-bottom: 1rem;
}

/* Card Sub-Regions & Semantic Section Containers */
.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border-hairline);
}

.card-body,
.quotable-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.article-content,
.benchmark-table-section,
.calculation-methodology-section,
.calculation-scenarios-section,
.commercial-handoff-vetting,
.comparison-container,
.faq-section,
.methodology,
.partner-cta-section,
.partners-section,
.related-tools-section,
.scenario-container,
.sensitivity-matrix-section,
.statutory-comparison-table-section,
.statutory-compliance-section,
.statutory-provenance-box,
.three-tier-cluster-section,
.tools-directory-section,
.cluster-nav,
.regulatory-lead-magnet-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.regulatory-lead-magnet-card {
  background-color: var(--bg-subtle);
}

.baseline-output-summary,
.commentary-box,
.statutory-edge-case-trap,
.overlay-partner-guardrail,
.ymyl-public-service-guardrail {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.statutory-edge-case-trap {
  border-left-color: var(--status-warning);
}

.overlay-partner-guardrail,
.ymyl-public-service-guardrail {
  border-left-color: var(--status-positive);
  background-color: var(--bg-subtle);
}

.ymyl-disclaimer-banner,
.ymyl-warning-card,
.above-the-fold-compliance,
.ftc-disclosure-card,
.regulatory-forfeiture-warning {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--status-warning);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.125rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.statutory-accuracy-benchmarks {
  display: none;
}

.commentary-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}
.variant-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.commentary-text,
.framework-objective,
.statutory-provenance-note {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.section-takeaways,
.commentary-takeaways,
.calculation-steps,
.procedure-steps,
.extractable-steps-list,
.autonomous-citation-list,
.related-tools-list,
.overlay-hub-list {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.related-tools-list,
.overlay-hub-list {
  list-style: none;
  margin-left: 0;
  display: grid;
  gap: 0.625rem;
}

.takeaway {
  background-color: var(--brand-soft);
  border-left: 3px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.highlight {
  background-color: var(--brand-soft);
  color: var(--text-primary);
  border-color: var(--brand-border);
}

.framework-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}

/* Interactive Calculator Components (.interactive-calculator-container & .calc-*) */
.interactive-calculator-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.calc-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 0.875rem;
}

.calc-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.calc-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
}

.calc-hub-subtitle,
.calc-column-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.calc-panel-title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.calc-switcher-panel {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.calc-switcher-header,
.calc-panel-header,
.calc-scenarios-header,
.calc-matrix-header,
.calc-entrypoints-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.calc-switcher-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.calc-switcher-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.calc-switcher-pills,
.preset-wrap,
.scenario-presets-bar,
.runway-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.calc-switcher-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: var(--brand-primary);
  flex-shrink: 0;
}

.calc-switcher-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: inherit;
}

.calc-inputs-column,
.calc-results-column,
.calc-inputs-panel,
.calc-outputs-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.calc-inputs-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.calc-outputs-panel {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.calc-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.625rem;
}

.calc-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.calc-label,
.form-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.calc-unit {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.calc-input-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  overflow: hidden;
}

.calc-input-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  border-right: 1px solid var(--border-subtle);
}

.calc-input-wrap .calc-number-input {
  border: none;
  border-radius: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.calc-input,
.calc-number-input,
.calc-select,
.form-input,
.form-select {
  width: 100%;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.calc-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.calc-slider,
.form-range,
.range-slider,
.slider-control {
  width: 100%;
  min-height: 44px;
  accent-color: var(--brand-primary);
  cursor: pointer;
  background: transparent;
}

.calc-value-badge,
.calc-audit-pill,
.calc-live-pill,
.calc-scenarios-badge,
.calc-matrix-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--brand-soft);
  color: var(--brand-hover);
  border: 1px solid var(--brand-border);
  white-space: nowrap;
}

.calc-live-pill,
.calc-audit-pill {
  background-color: var(--status-positive-bg);
  color: var(--status-positive);
  border-color: var(--status-positive-border);
}

.calc-metrics-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 0.875rem;
}

.metric-box,
.result-card,
.kpi-block {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  min-width: 0;
}

.calc-metric-label,
.metric-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.calc-metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.calc-metric-highlight {
  background-color: var(--brand-soft);
  border-color: var(--brand-border);
}

.calc-geo-answer-box,
.calc-statutory-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
}

.calc-geo-answer-title,
.calc-statutory-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.calc-geo-answer-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
}

.calc-statutory-list {
  margin: 0.375rem 0 0 1.25rem;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.calc-objection-takeaway {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.calc-scenarios-container,
.calc-matrix-container,
.calc-entrypoints-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.calc-scenarios-grid,
.calc-entrypoints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}

.calc-scenario-card,
.calc-entrypoint-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
}

.calc-entrypoint-card:hover {
  border-color: var(--brand-primary);
  background-color: var(--brand-soft);
}

.calc-scenario-q,
.calc-entrypoint-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.calc-scenario-ans {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.calc-scenario-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-hairline);
}

.calc-scenario-cite {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.calc-entrypoint-action {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-primary);
}

.calc-scenario-btn,
.preset-btn,
.runway-chip,
.scenario-preset-pill,
.query-pill,
.contextual-cluster-link,
.btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.875rem;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.calc-scenario-btn:hover,
.preset-btn:hover,
.runway-chip:hover,
.scenario-preset-pill:hover,
.query-pill:hover,
.contextual-cluster-link:hover,
.btn-share:hover {
  background-color: var(--brand-soft);
  border-color: var(--brand-primary);
  color: var(--brand-hover);
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-hairline);
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.breakdown-val,
.breakdown-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.runway-chart-wrap {
  width: 100%;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
}

.share-pro-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.calculation-variant {
  padding: 1rem 1.125rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  margin-top: 0.75rem;
}

/* Subsidy Meter & Legend */
.subsidy-meter-wrap {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
}

.subsidy-meter-header,
.subsidy-meter-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.subsidy-meter-bar {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 9999px;
  overflow: hidden;
  background-color: var(--bg-muted);
  gap: 2px;
}

.subsidy-meter-seg {
  height: 100%;
  transition: width 0.2s ease;
}

.subsidy-meter-seg-pay {
  background-color: var(--brand-primary);
}

.subsidy-meter-seg-sub {
  background-color: var(--status-positive);
}

.subsidy-meter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.dot-pay,
.dot-sub,
.dot-int {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  flex-shrink: 0;
}

.dot-pay {
  background-color: var(--brand-primary);
}

.dot-sub {
  background-color: var(--status-positive);
}

.dot-int {
  background-color: var(--status-warning);
}

/* Quick Unlock, Lead Capture, Post-Calc Upgrade & Partner Quote Forms */
.calc-result-quick-unlock-bar,
.inline-lead-box {
  background-color: var(--bg-elevated);
  border: 1px solid var(--brand-border);
  border-left: 4px solid var(--status-positive);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.calc-inline-cta-copy,
.quick-unlock-value-summary {
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.lead-capture-form,
.inline-worksheet-capture-form,
.newsletter-form,
.partner-registration-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}

.lead-capture-status-readout,
.partner-registration-status,
.partner-quote-status,
.serp-blueprint-status {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--status-positive);
  min-height: 1.25rem;
}

.post-calc-upgrade-header,
.partner-quote-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}

.post-calc-upgrade-badge,
.partner-quote-badge,
.partner-badge,
.affiliate-badge,
.affiliate-disclosure-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--brand-soft);
  color: var(--brand-hover);
  border: 1px solid var(--brand-border);
}

.affiliate-disclosure-badge {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.post-calc-upgrade-title,
.partner-title,
.affiliate-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.25rem 0;
}

.post-calc-upgrade-summary,
.post-calc-pillar-copy,
.affiliate-desc,
.partner-quote-frictionless-note,
.partner-status-note {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.post-calc-pillar-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.post-calc-sample-schedule-preview {
  background-color: var(--bg-subtle);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.post-calc-preview-slot {
  min-height: 0;
}

.post-calc-upgrade-actions,
.partner-quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
  margin-top: 0.75rem;
}

.post-calc-quick-unlock-btn,
.post-calc-upgrade-btn,
.partner-quote-submit-btn,
.pro-hook-link,
.pro-hook-direct-checkout,
.pro-hook-quote-jump,
.pro-hook-sample-unlock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 1rem;
  background-color: var(--brand-primary);
  color: var(--cta-fg);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.post-calc-quick-unlock-btn:hover,
.post-calc-upgrade-btn:hover,
.partner-quote-submit-btn:hover,
.pro-hook-link:hover,
.pro-hook-direct-checkout:hover,
.pro-hook-quote-jump:hover,
.pro-hook-sample-unlock:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--cta-fg);
}

.pro-hook-quote-jump,
.pro-hook-sample-unlock {
  background-color: var(--bg-surface);
  color: var(--brand-primary);
}

.pro-hook-quote-jump:hover,
.pro-hook-sample-unlock:hover {
  background-color: var(--brand-soft);
  color: var(--brand-hover);
}

.partner-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}

.partner-quote-form-body {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.partner-quote-consent-row {
  margin: 0.5rem 0;
}

.partner-quote-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.375rem 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
  cursor: pointer;
}

/* SERP Workbench, Cliff Visualizer, Comparator & Blueprint */
.serp-workbench-intro {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.serp-intent-banner {
  background-color: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  margin: 0.75rem 0;
}

.serp-intent-banner-text {
  flex: 1 1 280px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.55;
}

.serp-intent-banner-btn,
.serp-blueprint-btn,
.serp-comparator-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.875rem;
  background-color: var(--brand-primary);
  color: var(--cta-fg);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.serp-intent-banner-btn:hover,
.serp-blueprint-btn:hover,
.serp-comparator-btn:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--cta-fg);
}

.serp-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.serp-field-label,
.serp-metric-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.serp-metric-val {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.serp-input-cell,
.serp-select-input {
  width: 100%;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.75rem;
  font-size: 16px;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.serp-svg-chart-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 0.75rem 0;
}

.serp-visual-breakdown-svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.serp-cliff-visualizer,
.serp-scenario-comparator,
.serp-decision-blueprint {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
}

/* Tables, Scenarios, Overlays, Affiliates & Topic Clusters */
.comparison-table,
.data-table,
.calc-matrix-table,
.calculation-table,
.proprietary-calculation-table,
.scenario-table,
.serp-cliff-matrix-table,
.serp-scenario-comparator-table,
.serp-statutory-reference-table,
.statutory-pitfalls-table,
.overlay-comparison-table,
.overlay-decision-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.td-plan-name {
  font-weight: 600;
  color: var(--text-primary);
}

.scenario-baseline,
.scenario-conservative,
.scenario-moderate-contraction,
.scenario-moderate-expansion,
.scenario-aggressive {
  font-variant-numeric: tabular-nums;
}

.scenario-ast-eval {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text-primary);
}

.scenario-cliff-delta {
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.scenario-presets-section,
.scenario-presets-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.topic-cluster-tier {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  margin-bottom: 0.875rem;
}

.connected-queries-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
}

.connected-query {
  margin-bottom: 0.875rem;
}

.next-step-prompt {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.overlay-autonomous-assertions,
.overlay-headings,
.overlay-scenarios,
.overlay-comparison,
.overlay-ai-decision-matrix,
.overlay-hub-links,
.overlay-partner-offer,
.overlay-faqs {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.overlay-comparison-row,
.overlay-decision-matrix-row {
  transition: background-color 0.15s ease;
}

.overlay-comparison-row:hover,
.overlay-decision-matrix-row:hover {
  background-color: var(--bg-subtle);
}

.affiliate-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.affiliate-disclosure {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.affiliate-cta {
  margin-top: 0.75rem;
}

/* Mobile Responsive Breakpoints */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .nav-links,
  a.btn.btn-cta.nav-cta-desktop,
  a.btn-cta.nav-cta-desktop,
  .nav-cta-desktop {
    display: none;
  }

  .mobile-nav-menu {
    display: block;
  }

  h1, .hero-title {
    font-size: 1.625rem;
  }

  h2, .section-title {
    font-size: 1.25rem;
  }

  h3, .card-title {
    font-size: 1.0625rem;
  }

  .card,
  .pseo-card,
  .calc-card,
  .interactive-calc-card,
  .calculation-container,
  .hero-section,
  .tool-hero {
    padding: 1.25rem;
  }

  .footer-grid,
  .calc-grid,
  .calculator-grid,
  .grid-2,
  .calc-metrics-grid,
  .metric-grid,
  .serp-sub-inputs-grid,
  .serp-metrics-grid,
  .calc-scenarios-grid,
  .calc-entrypoints-grid,
  .partner-matrix-grid,
  .framework-steps-grid,
  .post-calc-upgrade-pillars,
  .features-grid,
  .scenarios-grid,
  .tools-grid,
  .card-grid,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  div[style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .pill-trust-group,
  .calc-switcher-pills,
  .scenario-presets-bar,
  .runway-preset-chips,
  .post-calc-upgrade-actions,
  .partner-quote-actions {
    flex-wrap: wrap;
  }

  .pill-trust,
  .badge,
  .badge-tag,
  .pill,
  .status-badge,
  .authority-badge {
    max-width: 100%;
  }

  .calc-inline-cta a,
  .comparison-table-cta-bar a,
  .pro-hook-card a,
  .affiliate-card a,
  .partner-card a,
  .btn-cta,
  .btn-primary,
  .partner-cta,
  .affiliate-cta-link {
    white-space: normal !important;
    overflow-wrap: break-word;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Executive CPA & Statutory Workpaper Print Stylesheet */
@media print {
  .header,
  .site-header,
  .nav-wrap,
  .mobile-nav-menu,
  .skip-link,
  .affiliate-section,
  .affiliates-section,
  .refinance-partner-section,
  .footer-lead-card,
  .site-footer,
  .footer,
  .btn,
  .btn-cta {
    display: none !important;
  }

  body,
  .card,
  .pseo-card {
    background: #ffffff;
    color: #000000;
    box-shadow: none;
  }
}
