:root {
  --p10-bg: #f8fafc;
  --p10-card: #ffffff;
  --p10-text: #0f172a;
  --p10-muted: #475569;
  --p10-border: #e2e8f0;
  --p10-accent: #2775ca;
  --p10-emerald: #059669;
}

html[data-theme="dark"] {
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: #1e293b;
  --paper: #0a0d14;
  --wash: #101722;
  --violet: #2775ca;
  --violet-dark: #6db4f5;
  --mint: #10b981;
  --navy: #0a0d14;
  --p10-bg: #0a0d14;
  --p10-card: #161f30;
  --p10-text: #f8fafc;
  --p10-muted: #94a3b8;
  --p10-border: #1e293b;
  --p10-accent: #6db4f5;
  --p10-emerald: #10b981;
  color-scheme: dark;
}

body { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); transition: background-color .18s ease, color .18s ease; }
.theme-controls { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; flex-shrink: 0; white-space: nowrap; }
.theme-toggle, .theme-system {
  align-items: center;
  border: 1px solid var(--p10-border, #e2e8f0);
  border-radius: 10px;
  background: var(--p10-card, #fff);
  color: var(--p10-text, #0f172a);
  cursor: pointer;
  display: inline-flex;
  font: 700 12px/1 system-ui, sans-serif;
  justify-content: center;
  min-height: 38px;
  min-width: 38px;
  padding: 8px;
  flex-shrink: 0;
  white-space: nowrap;
  word-break: keep-all;
}
.theme-system { color: var(--p10-muted, #475569); }
.theme-system[aria-pressed="true"] { border-color: #2775ca; color: #2775ca; }
.theme-toggle:hover, .theme-system:hover { border-color: #2775ca; }
footer.footer,
footer.site-footer,
body > footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0;
  color: #475569 !important;
}
footer.footer h3,
footer.footer h4,
footer.site-footer h3,
footer.site-footer h4,
body > footer h3,
body > footer h4 { color: #0f172a !important; }
footer.footer a,
footer.site-footer a,
body > footer a { color: #334155 !important; }
footer.footer p,
footer.site-footer p,
body > footer p { color: #475569; }
.legal-shield {
  border-top: 1px solid #e2e8f0;
  color: #64748b !important;
  font: 11px/1.5 system-ui, sans-serif !important;
  margin: 26px 0 0 !important;
  max-width: 1120px !important;
  padding-top: 22px;
  white-space: pre-line;
}
.dynamic-footer { margin-top: 36px; padding: 24px; }
.dynamic-footer .footer-links { color: #475569; font: 13px/1.8 system-ui, sans-serif; margin: 0; }
.dynamic-footer .footer-links a { color: #334155; }
html[data-theme="dark"] footer.footer,
html[data-theme="dark"] footer.site-footer,
html[data-theme="dark"] body > footer { background: #0a0d14 !important; border-color: #1e293b; color: #94a3b8 !important; }
html[data-theme="dark"] footer.footer h3,
html[data-theme="dark"] footer.footer h4,
html[data-theme="dark"] footer.site-footer h3,
html[data-theme="dark"] footer.site-footer h4,
html[data-theme="dark"] body > footer h3,
html[data-theme="dark"] body > footer h4 { color: #f8fafc !important; }
html[data-theme="dark"] footer.footer a,
html[data-theme="dark"] footer.site-footer a,
html[data-theme="dark"] body > footer a { color: #cbd5e1 !important; }
html[data-theme="dark"] footer.footer p,
html[data-theme="dark"] footer.site-footer p,
html[data-theme="dark"] body > footer p { color: #94a3b8; }
html[data-theme="dark"] .legal-shield { border-color: #1e293b; color: #94a3b8 !important; }
.dynamic-theme-nav { align-items: center; background: var(--p10-card); border-bottom: 1px solid var(--p10-border); display: flex; justify-content: flex-end; padding: 8px 18px; }
.dynamic-theme-nav .theme-controls { margin-left: 0; }

html[data-theme="dark"] body,
html[data-theme="dark"] .page,
html[data-theme="dark"] .min-h-screen { background: #0a0d14 !important; color: #f8fafc !important; }
html[data-theme="dark"] .hero { background: radial-gradient(circle at 80% 20%, #142a46 0, transparent 36%), #0a0d14 !important; }
html[data-theme="dark"] .hero h1,
html[data-theme="dark"] .hero h2,
html[data-theme="dark"] .hero h3 { color: #f8fafc !important; }
html[data-theme="dark"] .hero p,
html[data-theme="dark"] .hero-copy { color: #94a3b8 !important; }
html[data-theme="dark"] .hero-panel { background: #161f30 !important; border-color: #1e293b !important; }
html[data-theme="dark"] .step,
html[data-theme="dark"] .module,
html[data-theme="dark"] .travel-card,
html[data-theme="dark"] .explorer,
html[data-theme="dark"] .card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .delete-panel,
html[data-theme="dark"] .rounded-xl,
html[data-theme="dark"] .rounded-2xl { background: #161f30 !important; border-color: #1e293b !important; color: #f8fafc !important; }
html[data-theme="dark"] .explorer-side { background: #101722 !important; }
html[data-theme="dark"] .section.alt,
html[data-theme="dark"] .legal-hero { background: #101722 !important; }
html[data-theme="dark"] .section.dark { background: #080b11 !important; }
html[data-theme="dark"] .step-number,
html[data-theme="dark"] .bucket,
html[data-theme="dark"] .value,
html[data-theme="dark"] .network,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .followups button,
html[data-theme="dark"] .navItemActive { background: #172a43 !important; color: #6db4f5 !important; }
html[data-theme="dark"] .mode { background: #161f30 !important; border-color: #1e293b !important; }
html[data-theme="dark"] .mode.optional { background: #1a2336 !important; }
html[data-theme="dark"] .rebate-note { background: #0d2b25 !important; color: #6ee7b7 !important; }
html[data-theme="dark"] .warning,
html[data-theme="dark"] .delete-warning { background: #292316 !important; color: #fbbf24 !important; }
html[data-theme="dark"] .status,
html[data-theme="dark"] .form-status,
html[data-theme="dark"] .voice { background: #101722 !important; color: #94a3b8 !important; }
html[data-theme="dark"] .button.light,
html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .secondary { background: #161f30 !important; color: #f8fafc !important; border-color: #1e293b !important; }
html[data-theme="dark"] .select,
html[data-theme="dark"] .input,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .amount { background: #0f1724 !important; color: #f8fafc !important; border-color: #334155 !important; }
html[data-theme="dark"] nav { background: rgba(10, 13, 20, .95) !important; border-color: #1e293b !important; }
html[data-theme="dark"] .logo-mark { background: #f8fafc; color: #0f172a; }
html[data-theme="dark"] nav a { color: #cbd5e1 !important; }
html[data-theme="dark"] nav a.button { color: #fff !important; }
html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] strong,
html[data-theme="dark"] .amount,
html[data-theme="dark"] .name { color: #f8fafc !important; }
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .note,
html[data-theme="dark"] .label,
html[data-theme="dark"] .legal,
html[data-theme="dark"] .notice,
html[data-theme="dark"] .provider,
html[data-theme="dark"] .attribution,
html[data-theme="dark"] .facts dd { color: #94a3b8 !important; }
html[data-theme="dark"] main .legal-doc,
html[data-theme="dark"] main .legal-doc *,
html[data-theme="dark"] main [data-custom-class="body"],
html[data-theme="dark"] main [data-custom-class="body"] *,
html[data-theme="dark"] main [data-custom-class="body_text"],
html[data-theme="dark"] main [data-custom-class="body_text"] * { background: transparent !important; color: #cbd5e1 !important; }
html[data-theme="dark"] main [data-custom-class="title"],
html[data-theme="dark"] main [data-custom-class="title"] *,
html[data-theme="dark"] main [data-custom-class="heading_1"],
html[data-theme="dark"] main [data-custom-class="heading_1"] *,
html[data-theme="dark"] main [data-custom-class="heading_2"],
html[data-theme="dark"] main [data-custom-class="heading_2"] *,
html[data-theme="dark"] main .legal-doc b,
html[data-theme="dark"] main .legal-doc strong { color: #f8fafc !important; }
html[data-theme="dark"] main [data-custom-class="subtitle"],
html[data-theme="dark"] main [data-custom-class="subtitle"] * { color: #94a3b8 !important; }
html[data-theme="dark"] main [data-custom-class="link"],
html[data-theme="dark"] main [data-custom-class="link"] *,
html[data-theme="dark"] main a { color: #6db4f5 !important; }
html[data-theme="dark"] td,
html[data-theme="dark"] th { border-color: #1e293b !important; }

.sovereign-seal {
  background: color-mix(in srgb, var(--p10-emerald) 10%, var(--p10-card));
  border: 1px solid color-mix(in srgb, var(--p10-emerald) 45%, var(--p10-border));
  border-radius: 14px;
  color: var(--p10-text);
  display: grid;
  gap: 5px;
  line-height: 1.5;
  margin: 16px 0;
  padding: 14px;
}
.sovereign-seal strong { color: var(--p10-emerald); font-size: 13px; letter-spacing: .02em; }
.sovereign-seal span { color: var(--p10-muted); font-size: 12px; }
.comparison-pills { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.comparison-pill {
  background: var(--p10-card);
  border: 1px solid var(--p10-border);
  border-radius: 999px;
  color: var(--p10-muted);
  font-size: 11px;
  font-weight: 750;
  padding: 7px 10px;
}
.comparison-pill.rebate { border-color: var(--p10-emerald); color: var(--p10-emerald); }
.regional-posture { color: var(--p10-muted); font-size: 13px; line-height: 1.65; margin: 14px 0; }
.matrix-wrap { border: 1px solid var(--p10-border); border-radius: 16px; margin-top: 18px; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.matrix { border-collapse: collapse; min-width: 660px; width: 100%; }
.matrix th, .matrix td { border-bottom: 1px solid var(--p10-border); padding: 15px 17px; text-align: left; vertical-align: top; word-break: normal; }
.matrix th { background: var(--wash, #f1f5f9); color: var(--ink, #0f172a); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.matrix td { background: var(--paper, #fff); color: var(--muted, #475569); font-size: 14px; line-height: 1.55; }
.matrix td:first-child { color: var(--ink, #0f172a); font-weight: 800; }
.matrix tr:last-child td { border-bottom: 0; }
.rollout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.rollout-grid .card { min-width: 0; }
.rollout-grid .card h3 { line-height: 1.35; }

#ai-mentor { scroll-margin-top: 92px; }
.ai-mentor-launcher {
  align-items: center;
  background: #4338ca;
  border: 2px solid #ffffff;
  border-radius: 999px;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 10px 30px rgba(49, 46, 129, .28);
  color: #ffffff !important;
  display: inline-flex;
  font: 800 14px/1.25 system-ui, sans-serif;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  position: fixed;
  right: 22px;
  text-decoration: none;
  z-index: 1000;
}
.ai-mentor-launcher:hover, .ai-mentor-launcher:focus-visible { background: #3730a3; outline: 3px solid #a5b4fc; outline-offset: 3px; }

@media (max-width: 700px) {
  .theme-controls { margin-left: 0; }
  .rollout-grid { grid-template-columns: 1fr; }
  .ai-mentor-launcher { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); font-size: 13px; max-width: calc(100vw - 28px); min-height: 48px; padding: 11px 15px; right: 14px; }
  body:has(.cookie-notice) .ai-mentor-launcher { bottom: calc(220px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 480px) {
  .nav-inner { gap: 8px; }
  .nav .wrap { width: calc(100% - 16px); }
  .nav-links { flex-shrink: 1; gap: 5px; min-width: 0; }
  .nav-links .button { font-size: 10px; min-height: 48px; padding: 7px 8px; }
  .nav .logo { font-size: 17px; gap: 6px; }
  .nav .logo-mark { font-size: 14px; height: 28px; width: 28px; }
  .nav .theme-system { display: none; }
  .nav .theme-toggle { min-height: 48px; min-width: 48px; padding: 6px; }
}

.button[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}
