:root {
  color-scheme: light;
  font-size: calc(100% * var(--accessibility-scale, 1));
}

:focus-visible {
  outline: 3px solid #005ea8 !important;
  outline-offset: 3px !important;
}

.accessibility-skip-link {
  position: fixed;
  z-index: 100001;
  top: -100px;
  left: 1rem;
  padding: .8rem 1rem;
  border: 2px solid #000;
  background: #ffeb3b;
  color: #000;
  font: 700 1rem/1.3 system-ui, sans-serif;
}

.accessibility-skip-link:focus {
  top: 1rem;
}

.accessibility-tools {
  position: fixed;
  z-index: 100000;
  right: 1rem;
  bottom: 6rem;
  width: min(22rem, calc(100vw - 2rem));
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #182e42;
  font: 500 .9rem/1.45 system-ui, sans-serif;
}

.accessibility-tools > summary {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  padding: .7rem 1rem;
  border: 2px solid #244a64;
  border-radius: .5rem;
  background: #fff;
  color: #182e42;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px #0003;
}

.accessibility-tools-panel {
  display: grid;
  gap: .55rem;
  margin-bottom: .5rem;
  padding: 1rem;
  border: 2px solid #244a64;
  border-radius: .5rem;
  background: #fff;
  box-shadow: 0 2px 14px #0004;
}

.accessibility-tools-panel select,
.accessibility-tools-panel button {
  min-height: 2.5rem;
  padding: .4rem .65rem;
  border: 1px solid #526577;
  border-radius: .3rem;
  background: #fff;
  color: #182e42;
  font: inherit;
}

.accessibility-tools-panel button {
  font-weight: 650;
  cursor: pointer;
}

.accessibility-tools-panel button:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.accessibility-check,
.accessibility-text-controls,
.accessibility-speech-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.accessibility-text-controls > span,
.accessibility-speech-controls > span {
  flex: 1 1 100%;
  font-weight: 650;
}

.accessibility-status {
  min-height: 1.4em;
  margin: 0;
  overflow-wrap: anywhere;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background-color: #111827 !important;
  color: #f3f4f6;
}

html[data-theme="dark"] body :is(.bg-white, .bg-gray-50, .bg-gray-100, .bg-slate-50, .portal-panel, .portal-button, .metric-card, .row-menu-content, .access-selector, .cms-managed-section, .cms-card, .cms-nav) {
  background-color: #1f2937 !important;
  color: #f9fafb !important;
  border-color: #64748b !important;
}

html[data-theme="dark"] body :is(.text-gray-900, .text-gray-800, .text-gray-700, .text-gray-600, .text-gray-500, .text-slate-900, .text-slate-700, .text-slate-600, .text-\[\#244A64\], .text-primary, .text-secondary, .text-gray, .cms-card p, .cms-card-link) {
  color: #e5e7eb !important;
}

html[data-theme="dark"] body :is(input, select, textarea, .portal-table th) {
  background-color: #111827 !important;
  color: #f9fafb !important;
  border-color: #64748b !important;
}

html[data-theme="dark"] body :is(.portal-table td, .portal-table th, .portal-table tr, .border, .border-b, .border-t) {
  border-color: #475569 !important;
}

html[data-theme="dark"] body .accessibility-tools,
html[data-theme="dark"] body .accessibility-tools * {
  color: #182e42 !important;
}

html[data-theme="dark"] body .accessibility-tools :is(select, button) {
  background-color: #fff !important;
  color: #182e42 !important;
  border-color: #526577 !important;
}

html[data-theme="dark"] body :is(.cms-skip-link, .accessibility-skip-link),
html[data-contrast="high"] body :is(.cms-skip-link, .accessibility-skip-link) {
  background-color: #000 !important;
  color: #ffeb3b !important;
  border-color: #ffeb3b !important;
}

html[data-theme="dark"] :focus-visible,
html[data-contrast="high"] :focus-visible {
  outline-color: #ffeb3b !important;
}

html[data-theme="dark"] .accessibility-tools :focus-visible,
html[data-contrast="high"] .accessibility-tools :focus-visible {
  outline-color: #005ea8 !important;
}

html[data-transparency="reduced"] body :is(.bg-black\/50, .bg-black\/60, #news-modal, #doc-modal, #reset-password-modal, #inquiry-modal, #sidebar-backdrop) {
  background-color: #000 !important;
}

html[data-transparency="reduced"] body * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-transparency="reduced"] dialog::backdrop,
html[data-transparency="reduced"] .site-dialog::backdrop {
  background: #000 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-contrast="high"] body {
  background: #000 !important;
  color: #fff !important;
}

html[data-contrast="high"] body :is(header, nav, main, section, article, footer, aside, div, form, .portal-panel, .bg-white, .bg-gray-50, .bg-gray-100) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #ffeb3b !important;
}

html[data-contrast="high"] body :is(a, a *) {
  color: #ffeb3b !important;
}

html[data-contrast="high"] body button:not(.accessibility-tools button) {
  background-color: #000 !important;
  color: #ffeb3b !important;
  border-color: #ffeb3b !important;
}

html[data-contrast="high"] body :is(input, select, textarea) {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #ffeb3b !important;
}

html[data-contrast="high"] body .accessibility-tools,
html[data-contrast="high"] body .accessibility-tools * {
  background-color: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
}

html[data-contrast="high"] body .accessibility-tools :is(input, select, textarea) {
  background-color: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
}

@media (max-width: 768px) {
  body:has(.analytics-consent-panel:not([hidden])) .accessibility-tools:not([open]) {
    top: 6rem;
    bottom: auto;
  }

  .analytics-consent-panel {
    max-height: max(3rem, calc(100vh - 16rem));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  [data-aos],
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}
