/* The icon follows the existing language controls on desktop and the AI icon on mobile. */
.language-switch .theme-divider {
  display: inline-block;
  width: 1px;
  height: 20px;
  margin: 0 2px 0 4px;
  flex: 0 0 1px;
  align-self: center;
  background: rgba(13, 59, 102, .26);
}
.language-switch .theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 32px;
  min-width: 34px;
  min-height: 32px;
  padding: 0 !important;
  border: 1px solid rgba(35, 85, 126, .26);
  border-radius: 9px;
  background: #e8f2f8;
  color: #23557e;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(33, 79, 120, .08);
}
.language-switch .theme-toggle:hover { background: #dceaf3; border-color: #86aac4; }
.language-switch .theme-toggle:focus-visible { outline: 2px solid #d49419; outline-offset: 2px; }
.theme-icon { width: 19px; height: 19px; pointer-events: none; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-icon-moon { display: none; }

/* Both palettes use light paper for text-heavy standalone pages. */
html[data-theme="dark"] body.legal-page {
  background-color: #416f91 !important;
  background-image: image-set(url("../img/tax_documents_bg_v1010.webp") type("image/webp"), url("../img/tax_documents_bg_v1010.png") type("image/png")) !important;
  background-blend-mode: multiply !important;
  background-position: center top !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}
html[data-theme="dark"] body.legal-page .site-footer,
html[data-theme="dark"] body.legal-page .site-footer .footer-note,
html[data-theme="dark"] body.legal-page .site-footer .footer-links a {
  color: #f3f7fa !important;
  text-shadow: 0 1px 3px rgba(8, 31, 48, .42);
}
html[data-theme="dark"] body.legal-page .site-footer .footer-links a:hover { color: #fff0c5 !important; }

@media (max-width: 820px) {
  .language-switch-mobile .theme-divider {
    height: 18px !important;
    margin: 0 1px 0 2px !important;
  }
  .language-switch-mobile .theme-toggle {
    flex: 0 0 31px !important;
    width: 31px !important;
    min-width: 31px !important;
    height: 25px !important;
    min-height: 25px !important;
    border-radius: 8px !important;
  }
  .language-switch-mobile .theme-icon { width: 16px; height: 16px; }
  .language-switch-mobile .mobile-ai-onboarding-hint { right: 73px !important; }
  html[data-theme="dark"] body.legal-page { background-attachment: scroll !important; }
  .legal-page .language-switch .theme-toggle {
    width: 27px !important;
    min-width: 27px !important;
    height: 25px !important;
    min-height: 25px !important;
  }
  .legal-page .main-nav > .language-switch {
    position: absolute !important;
    top: 11px !important;
    right: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    align-items: center !important;
  }
}
@media (max-width: 390px) {
  .language-switch-mobile .theme-toggle { flex-basis: 28px !important; width: 28px !important; min-width: 28px !important; }
  .language-switch-mobile .mobile-ai-onboarding-hint { right: 67px !important; }
}
