:root[data-theme="light"] {
  color-scheme: light;
}

.site-header nav {
  margin-left: auto;
}

.theme-toggle {
  flex: 0 0 46px;
  width: 46px;
  min-height: 46px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(21, 33, 29, .08);
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--teal-light);
  border-color: var(--teal);
}

.theme-toggle:active {
  transform: scale(.94);
}

.theme-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform .2s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(12deg);
}

.theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf7f3;
  --body: #c5d5cf;
  --muted: #9aafa7;
  --canvas: #0f1513;
  --surface: #18211e;
  --soft: #222e2a;
  --teal: #17856e;
  --teal-dark: #0f705d;
  --teal-light: #193b32;
  --link: #7fc4ff;
  --danger: #b42318;
  --danger-bg: #3a1b1a;
  --warning: #f0bd58;
  --warning-bg: #392d17;
  --success: #79d9a3;
  --border: #3c4b46;
  --focus: #8dccff;
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

:root[data-theme="dark"] .site-header {
  background: rgba(15, 21, 19, .94);
}

:root[data-theme="dark"] .hero {
  background: linear-gradient(145deg, #101714 55%, #17231f);
}

:root[data-theme="dark"] .skip-link {
  color: #101714;
  background: #edf7f3;
}

:root[data-theme="dark"] .wordmark b,
:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .not-found strong,
:root[data-theme="dark"] .document-number,
:root[data-theme="dark"] .document-preview li > span,
:root[data-theme="dark"] .intent-jump a::after,
:root[data-theme="dark"] .intent-action::after {
  color: #58d0ad;
}

:root[data-theme="dark"] .site-footer,
:root[data-theme="dark"] .process-card,
:root[data-theme="dark"] .progress-card,
:root[data-theme="dark"] .preview-top {
  background: #101b18;
}

:root[data-theme="dark"] .field input[type="text"],
:root[data-theme="dark"] .field input[type="email"],
:root[data-theme="dark"] .field input[type="url"],
:root[data-theme="dark"] .field input[type="tel"],
:root[data-theme="dark"] .field input[type="date"],
:root[data-theme="dark"] .field input[type="number"],
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .choice,
:root[data-theme="dark"] .form-actions,
:root[data-theme="dark"] .policy-toc,
:root[data-theme="dark"] .policy-paper,
:root[data-theme="dark"] .policy-row {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--border);
}

:root[data-theme="dark"] .policy-frame {
  background: #0b100e;
}

:root[data-theme="dark"] .policy-document {
  color: var(--body);
}

:root[data-theme="dark"] .error-summary,
:root[data-theme="dark"] .error-summary a {
  color: #ffb4ad;
}

:root[data-theme="dark"] .pill.published {
  color: var(--success);
  background: #183526;
}

:root[data-theme="dark"] .header-switcher,
:root[data-theme="dark"] .generator-tabs {
  background: #202b27;
}

:root[data-theme="dark"] .generator-hero {
  background: radial-gradient(circle at 82% 18%, #1b4a3c 0, #1b4a3c00 28%), linear-gradient(145deg, #101714 48%, #17231f);
}

:root[data-theme="dark"] .intent-card,
:root[data-theme="dark"] .answer-topics span,
:root[data-theme="dark"] .document-preview,
:root[data-theme="dark"] .flow-row article,
:root[data-theme="dark"] .faq-card {
  color: var(--body);
  background: var(--surface);
  border-color: var(--border);
}

:root[data-theme="dark"] .intent-tag {
  color: #8ae4ca;
}

:root[data-theme="dark"] .included-band {
  background: #131c19;
}

:root[data-theme="dark"] .document-preview li {
  border-color: var(--border);
}

:root[data-theme="dark"] .pricing-band {
  color: #d9e4de;
  background: radial-gradient(circle at 90% 20%, #176b57 0, #176b5700 30%), #101b18;
}

:root[data-theme="dark"] .final-cta {
  background: radial-gradient(circle at 50% 0, #194c3e 0, #194c3e00 44%), var(--canvas);
}

:root[data-theme="dark"] .terms-card::after {
  background: #3a3323;
}

@media (max-width: 820px) {
  .mobile-menu {
    margin-left: auto;
  }
}

@media (max-width: 520px) {
  .header-row {
    gap: .5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-icon {
    transition: none;
  }
}

@media print {
  .theme-toggle,
  .consent-banner {
    display: none !important;
  }

  :root[data-theme="dark"] {
    color-scheme: light;
    --ink: #15211d;
    --body: #34443d;
    --muted: #617169;
    --canvas: #fff;
    --surface: #fff;
    --border: #c9d2cc;
  }

  :root[data-theme="dark"] body,
  :root[data-theme="dark"] .policy-frame,
  :root[data-theme="dark"] .policy-paper {
    color: #27342e;
    background: #fff;
  }
}

[hidden] {
  display: none !important;
}

.footer-link {
  display: inline;
  min-height: 44px;
  padding: .25rem .4rem;
  color: #f1f7f4;
  background: transparent;
  font-size: inherit;
  text-decoration: underline;
}

.footer-link:hover {
  background: #ffffff18;
}

.consent-banner {
  position: fixed;
  z-index: 90;
  inset: auto 1rem 1rem;
  max-width: 760px;
  margin: auto;
  display: block;
  padding: 1.25rem;
  color: var(--body);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(21, 33, 29, .25);
}

.consent-banner h2 {
  margin: 0 0 .35rem;
  color: var(--ink);
  font-size: 1.2rem;
}

.consent-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.consent-banner p {
  margin: 0;
  font-size: .94rem;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
}

.consent-actions button {
  flex: 1 1 120px;
}

.consent-settings > p {
  margin-bottom: 1rem;
}

.consent-options {
  display: grid;
  gap: .65rem;
  margin-bottom: 1rem;
}

.consent-option {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem;
  color: var(--body);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.consent-option strong,
.consent-option small {
  display: block;
}

.consent-option strong {
  color: var(--ink);
}

.consent-option small {
  margin-top: .15rem;
  font-size: .82rem;
}

.consent-option b {
  flex: none;
  color: var(--success);
  font-size: .82rem;
}

.consent-option input {
  flex: none;
  width: 24px;
  height: 24px;
  accent-color: var(--teal);
}

@media (max-width: 700px) {
  .consent-summary {
    align-items: stretch;
    flex-direction: column;
  }
}
