:root { color-scheme: light; }

.theme-toggle {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid #c6c9de;
  border-radius: 999px;
  background: rgba(255, 255, 255, .76);
  color: #111426;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(41, 46, 89, .08);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: #8d93c6; }
.theme-toggle-icon { font-size: 16px; }

html[data-theme="dark"] {
  color-scheme: dark;
  --background: #0d1020;
  --foreground: #f5f3ff;
  --navy: #f5f3ff;
  --muted: #b8bdd3;
  --pale: #181c31;
  --line: #343a57;
  --brand-start: #232a54;
  --brand-end: #392b53;
  --brand-gradient: linear-gradient(120deg, var(--brand-start), var(--brand-end));
}
html[data-theme="dark"] body { background: linear-gradient(145deg, #0b0e1b, #12162a 55%, #171125); color: #f5f3ff; }
html[data-theme="dark"] body :where(h1,h2,h3,h4,h5,h6,p,li,summary,label,small,strong,b,span,a,figcaption,td,th) { color: #f5f3ff; }
html[data-theme="dark"] header { background: rgba(13, 16, 32, .94); border-color: #343a57; }
html[data-theme="dark"] :where(.hero,.hero-refresh,.pagehero,.pale,.one-account-band,.cta,footer,.card.feature,.announcement) { background: linear-gradient(125deg, #171c37 0%, #23284c 55%, #30223f 100%); color: #f5f3ff; }
html[data-theme="dark"] :where(.card,.tile,.sidebox,.bank,.sample,.floating-card,.press-card,.authority-card,.client,.contactform,.resource-example,.resultpanel,.sheet,.shared-account-callout,.qb-explorer,.qb-card,.qb-filters,#qb-error,.searchbar,.notice,.article-cover,.badge,.chip,.testtypes span,.taglinks a) { background: #171b2e; border-color: #343a57; color: #f5f3ff; box-shadow: 0 12px 34px rgba(0, 0, 0, .2); }
html[data-theme="dark"] :where(.lead,p,.stat span,.hero-jobs span,.floating-card span,.card p,.feature p,.footergrid p,.articlemeta,.source-label,.search-result small,.board-note,.qb-explorer .qb-intro,.qb-explorer .qb-footnote p,#qb-status) { color: #bfc4d9; }
html[data-theme="dark"] :where(input,textarea,select,option) { background: #101427; border-color: #3b4261; color: #f5f3ff; }
html[data-theme="dark"] :where(input,textarea)::placeholder { color: #8f96b2; }
html[data-theme="dark"] :where(.btn,.store,.pagination a.active) { background: linear-gradient(120deg, #b9c5ff, #dbcdf4); border-color: #cdd1ff; color: #101426; }
html[data-theme="dark"] :where(.btn,.store,.pagination a.active) :where(span,strong,small) { color: #101426; }
html[data-theme="dark"] .btn.light { background: #1c2138; border-color: #454c6c; color: #f5f3ff; }
html[data-theme="dark"] :is(.btn,.store,.pagination a.active),
html[data-theme="dark"] :is(.btn,.store,.pagination a.active) * { color: #101426 !important; }
html[data-theme="dark"] .btn.light,
html[data-theme="dark"] .btn.light * { color: #f5f3ff !important; }
html[data-theme="dark"] .theme-toggle { background: #1b2038; border-color: #464d70; color: #f8f6ff; box-shadow: 0 7px 22px rgba(0, 0, 0, .24); }
html[data-theme="dark"] .announcement.promo-announcement { background: linear-gradient(110deg, #222952 0%, #3b2b55 100%); }
html[data-theme="dark"] .announcement.promo-announcement :is(strong,span) { color: #fff; }
html[data-theme="dark"] .announcement.promo-announcement a { background: #f5f3ff; color: #171a31; }
html[data-theme="dark"] :where(.hero-offer-pill,.offer-chip) { background: #232945; border-color: #485071; color: #f5f3ff; }
html[data-theme="dark"] .hero-offer-pill span { background: #bec8ff; color: #101426; }
html[data-theme="dark"] :where(.hero-refresh h1 span,.icon,.feature .icon,.article-cover,.qb-number,.qb-answer > div) { background: #292f50; color: #f5f3ff; }
html[data-theme="dark"] :where(.options span,.qb-option,.checklist li,details,.related,.copyright,.resource-footer,.resource-columns h3,.search-result,th,td) { border-color: #343a57; }
html[data-theme="dark"] :is(.paper,.mini-paper) { background: #fff; color: #111426 !important; }
html[data-theme="dark"] :is(.paper,.mini-paper) * { color: #111426 !important; }
html[data-theme="dark"] .handfree-phone { mix-blend-mode: normal; filter: drop-shadow(0 22px 28px rgba(0, 0, 0, .38)); }
html[data-theme="dark"] .phone-orbit { background: radial-gradient(circle, #394371, rgba(28, 34, 63, 0) 70%); }
html[data-theme="dark"] .navlinks.open { background: #15192c; }
html[data-theme="dark"] img:not(.handfree-phone) { opacity: .94; }

@media (max-width: 1100px) {
  .theme-toggle-label { display: none; }
  .theme-toggle { padding: 8px; }
}
@media (max-width: 760px) {
  .theme-toggle { order: 2; min-width: 40px; min-height: 40px; }
  .menu { order: 3; }
  .navlinks { order: 5; }
}
@media (prefers-reduced-motion: reduce) { .theme-toggle { transition: none; } }
