/* Dark mode + baseline focus/skip. Does not claim WCAG certification. */
.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10000;
  background: #fff;
  color: #06162b;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

:where(a, button, summary, input, select, textarea, [role="button"]):focus-visible {
  outline: 3px solid #0b6ea8 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #fff;
}
html.dark :where(a, button, summary, input, select, textarea, [role="button"]):focus-visible {
  outline-color: #c2ff51 !important;
  box-shadow: 0 0 0 2px #06162b;
}

.siteheader .theme-toggle,
.afc-react-siteheader .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  order: 2;
  margin-left: 8px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.siteheader .headerrow { justify-content: flex-start; }
.siteheader .headerrow > a:first-child { order: 0; margin-right: auto; }
.siteheader .primarynav { order: 1; }
.siteheader .menutoggle { order: 3; }
@media (min-width: 1051px) {
  .siteheader .primarynav { margin-left: auto; }
  .siteheader .headerrow > a:first-child { margin-right: 16px; }
}
.theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-moon { display: none; }
html.dark .theme-toggle .icon-sun { display: block; }

/* Light FAQ markers stay navy on white, not lime-on-white. Navy FAQ chips keep lime. */
html:not(.dark) :is(.claim-faq, .pagefaq, .new-faq) summary,
html:not(.dark) :is(.claim-faq, .pagefaq, .new-faq) summary span {
  color: #06162b;
}

html.dark {
  color-scheme: dark;
  --afc-ink: #e8eef6;
  --afc-slate: #b7c6d6;
  --afc-paper: #0c1e32;
  --afc-line: #2a4158;
  --afc-link: #b7dcff;
  --ink: #e8eef6;
  --paper: #0c1e32;
  --muted: #b7c6d6;
  --white: #10283f;
  --line: #2a4158;
  --background: #06162b;
  --foreground: #e8eef6;
  --card: #10283f;
}

html.dark body {
  background: #06162b;
  color: #e8eef6;
}

/* Light surfaces. Navy heroes, footer, and lime CTAs are left alone. */
html.dark :is(
  .bg-white,
  .surface-card,
  .card,
  .benefit-card,
  .loss-card,
  .panel,
  .search-dialog,
  .sidebox,
  .resourcecard,
  .toolpane,
  .new-faq,
  .faq,
  .band-timing,
  .band-path,
  .band-states,
  [data-journal-article],
  [data-journal-checklist],
  [data-journal-scenario],
  [data-journal-bookcta],
  [data-journal-author],
  [data-journal-toc-mobile],
  [data-journal-related]
) {
  background-color: #0e2438 !important;
  color: #e8eef6;
  border-color: #2a4158;
}

html.dark :is(.claim-faq, .pagefaq) details,
html.dark .claim-faq details[open] {
  background: #0e2438 !important;
  color: #e8eef6 !important;
  border-color: #2a4158 !important;
}
html.dark :is(.claim-faq, .pagefaq, .new-faq) summary,
html.dark :is(.claim-faq, .pagefaq, .new-faq) summary span,
html.dark :is(.claim-faq, .pagefaq, .new-faq) p,
html.dark :is(.claim-faq, .pagefaq, .new-faq) h2 {
  color: #f4f7fb !important;
}

html.dark .experience .pagehero {
  background: #07182d !important;
  color: #f4f7fb !important;
}
html.dark .experience .pagehero .intro,
html.dark .experience .breadcrumb,
html.dark .experience .articlebody p,
html.dark .experience .articlebody li,
html.dark .experience .articlebody h2,
html.dark .experience .articlebody h3,
html.dark .experience .sidebox p,
html.dark .experience .sidebox h2,
html.dark .experience .resourcecard p,
html.dark .experience .resourcecard h3 {
  color: #d5e2ee !important;
}
html.dark .experience .articlebody a:not(.primary):not(.button):not(.navcta) {
  color: #d2ec7a !important;
}

html.dark [data-journal-article],
html.dark [data-journal-body],
html.dark [data-journal-body] :is(h2, h3, p, li, strong, blockquote):not(
  [data-journal-callout] *,
  [data-journal-callfirst] *,
  [data-journal-cta] *
) {
  color: #e8eef6;
}
html.dark [data-journal-body] a:not([class*="bg-[#c2ff51]"]):not([class*="bg-[#07182d]"]) {
  color: #f4f7fb;
  text-decoration-color: #c2ff51;
}
html.dark [data-journal-related] :is(h2, h3, p) {
  color: #e8eef6 !important;
}
html.dark [data-journal-related] a.group {
  background: #10283f !important;
  border-color: #2a4158 !important;
}

html.dark .search-dialog,
html.dark .search-dialog h2,
html.dark .search-dialog label,
html.dark .search-dialog strong {
  color: #e8eef6 !important;
}
html.dark .search-dialog input,
html.dark .field input,
html.dark .field select,
html.dark .field textarea {
  background: #07182d !important;
  color: #f4f7fb !important;
  border-color: #2a4158 !important;
}

html.dark #af-chat-panel { background: #0e2438; color: #e8eef6; border-color: #2a4158; }
html.dark #af-chat-form { background: #0e2438; border-top-color: #2a4158; }
html.dark #af-chat-form label.af-field { color: #d5e2ee; }
html.dark #af-chat-form input:not([type="checkbox"]),
html.dark #af-chat-form textarea {
  background: #07182d;
  color: #f4f7fb;
  border-color: #2a4158;
}
html.dark #af-chat-msgs { background: #081624; }
html.dark .af-bot { background: #10283f; color: #e8eef6; border-color: #2a4158; }
html.dark #af-chat-form .af-chat-consent,
html.dark #af-chat-form .af-chat-consent a { color: #d5e2ee; }
html.dark #af-chat-form button[type="submit"] { background: #c2ff51; color: #06162b; }

/* Keep lime CTAs and navy heroes readable. */
html.dark :is(.button.bright, .navcta, .af-af-links a:not(.ghost), .mobilebar a:last-child, .af-mobilebar-4 a[href*="free-claim-review"]) {
  color: #06162b !important;
}
html.dark :is(.launch-hero, .hero-wash, .band-close, .band-journey, .band-book, .band-study, .siteheader, .sitefooter, .topbar) {
  color: #f4f7fb;
}
