/*
 * IDB Accessibility Layer 1.0
 * Presentation-only safeguards shared by active public surfaces.
 */
:root {
  color-scheme: light dark;
  --a11y-focus: #075c9e;
  --a11y-focus-inverse: #8fd7ff;
  --a11y-safe-top: env(safe-area-inset-top, 0px);
  --a11y-safe-right: env(safe-area-inset-right, 0px);
  --a11y-safe-bottom: env(safe-area-inset-bottom, 0px);
  --a11y-safe-left: env(safe-area-inset-left, 0px);
}

html {
  min-width: 320px;
  overflow-wrap: break-word;
  scroll-padding-top: 5.5rem;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-inline: var(--a11y-safe-left) var(--a11y-safe-right);
  padding-bottom: var(--a11y-safe-bottom);
}

main,
[role="main"] {
  min-width: 0;
}

img,
svg,
video {
  max-width: 100%;
}

.library-hero__media,
.resource-hub-hero__media {
  aspect-ratio: 16 / 10;
}

.library-hero__media img,
.resource-hub-hero__media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.premium-band > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:not([disabled]),
input[type="button"]:not([disabled]),
input[type="submit"]:not([disabled]),
input[type="reset"]:not([disabled]),
[role="button"]:not([aria-disabled="true"]),
.button,
.btn,
.suggestion,
.answer-link,
.menu-toggle,
.vita-button,
.wellness-carousel-button {
  min-width: 44px;
  min-height: 44px;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--a11y-focus) !important;
  outline-offset: 3px !important;
  box-shadow: none;
}

.skip-link,
.idb-skip-link {
  position: fixed !important;
  inset: max(.75rem, var(--a11y-safe-top)) auto auto max(.75rem, var(--a11y-safe-left)) !important;
  z-index: 10000 !important;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: .65rem 1rem;
  color: #fff !important;
  background: #073f38 !important;
  border-radius: .625rem;
  transform: translateY(-220%);
  transition: transform 120ms ease;
}

.skip-link:focus,
.idb-skip-link:focus {
  transform: translateY(0);
}

.sr-only,
.idb-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[role="alert"] {
  border-width: 2px !important;
}

.a11y-alert-heading {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .55rem;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.3;
}

.a11y-alert-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 1.5rem;
  display: inline-grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: .9rem;
  line-height: 1;
}

@media (max-width: 640px) {
  .idb-medical-search__submit {
    top: 7px !important;
    left: 7px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .idb-medical-search__input {
    padding-left: 58px !important;
  }

  input,
  select,
  textarea {
    font-size: max(16px, 1em);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (prefers-contrast: more) {
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline-width: 4px !important;
    outline-offset: 4px !important;
  }

  button,
  .button,
  .btn,
  input,
  select,
  textarea,
  [role="alert"] {
    border-width: 2px !important;
  }
}

@media (forced-colors: active) {
  * {
    forced-color-adjust: auto;
  }

  .status-dot,
  .a11y-alert-icon {
    border: 2px solid CanvasText;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --a11y-focus: var(--a11y-focus-inverse);
    --white: #111a18;
    --surface: #17211f;
    --ink: #f1f7f5;
    --muted: #c2cfcb;
    --line: #42514d;
    --idb-white: #101816;
    --idb-canvas: #17211f;
    --idb-ink-950: #f2f8f6;
    --idb-ink-800: #dce8e4;
    --idb-ink-650: #c1d0cb;
    --idb-ink-500: #aabdb7;
    --idb-line: #3b4d47;
    --idb-line-strong: #60756e;
    --idb-green-50: #142620;
    --idb-green-100: #19372e;
    --idb-blue-100: #142b36;
  }

  html,
  body {
    color: #f1f7f5 !important;
    background: #0d1513 !important;
  }

  :where(.site-header, .chat, .composer, .card, .idb-card, .idb-header, .idb-footer, .section, .section-soft, .section-mist, .library-search-section, .medical-search-result, .idb-medical-search__form, .idb-medical-search__panel) {
    color: #f1f7f5 !important;
    background-color: #111a18 !important;
    border-color: #3b4d47 !important;
  }

  :where(h1, h2, h3, h4, h5, h6, .brand-title, .section-head p, .library-intro p, .trust-system-description, #search-status) {
    color: #f1f7f5 !important;
  }

  :where(.lead, .scope, .chat-header span, .composer-note, footer) {
    color: #c2cfcb !important;
  }

  .brand img {
    padding: .2rem;
    background: #fff;
    border-radius: .5rem;
  }

  :where(.eyebrow, .idb-eyebrow, .library-category__index) {
    color: #62d6b4 !important;
  }

  :where(article, [class$="-card"], [class*="__card"], .library-category, .trust-system, .trust-system-card, .principle-card, .process-list li) {
    color: #f1f7f5 !important;
    background-color: #111a18 !important;
    border-color: #3b4d47 !important;
  }

  :where(article p, article span, .muted, .idb-muted, [class*="description"], .process-list p) {
    color: #c2cfcb !important;
  }

  :where(article a, .library-category__index, .library-recent-list__type, .library-recent-list article > span) {
    color: #7de0c3 !important;
  }

  :where(.button, .btn, .back-link) {
    color: #fff !important;
    background-color: #0f5f52 !important;
    border-color: #7de0c3 !important;
  }

  :where(.button--quiet, .button-secondary) {
    color: #f1f7f5 !important;
    background-color: #26332f !important;
    border-color: #7b9089 !important;
  }

  :where(.chat-header strong, .idb-sources a, .official-trust a) {
    color: #8ce6cb !important;
  }

  :where(.card-number, .official-link-card span, .assist-panel .section-kicker) {
    color: #8ce6cb !important;
  }

  .premium-band {
    color: #f1f7f5 !important;
    background: #0b1916 !important;
  }

  .premium-band :where(.eyebrow, h2, p) {
    color: #f1f7f5 !important;
  }

  .official-vita-card .button {
    color: #fff !important;
    background: #0b4f45 !important;
  }

  .page-contact .section :where(.eyebrow, h2, li) {
    color: #f1f7f5 !important;
  }

  .page-contact .contact-notice {
    color: #f1f7f5 !important;
    background: #30211f !important;
    border-color: #9d7770 !important;
  }

  .resource-rail-link {
    color: #073f38 !important;
  }

  .idb-vita .button {
    color: #fff !important;
    background: #0f5f52 !important;
  }

  .principle-number {
    color: #fff !important;
    background: #176c59 !important;
  }

  :where(.transparency-card p, .transparency-card li, .transparency-card strong, .metadata-list li, .metadata-list strong) {
    color: #dce8e4 !important;
  }

  :where(input, textarea, select) {
    color: #f1f7f5 !important;
    background: #111a18 !important;
    border-color: #60756e !important;
  }

  :where(.message--vita, .scope) {
    color: #f1f7f5 !important;
    background: #17211f !important;
    border-color: #42514d !important;
  }

  .message--alert {
    color: #ffd8d4;
    background: #401b1b;
    border-color: #f08f86;
  }

  .message--safety-orange {
    color: #ffe7b0;
    background: #3b2a0d;
    border-color: #f2c96f;
  }

  .message--safety-blocked {
    color: #eee5ff;
    background: #292137;
    border-color: #bfa9e2;
  }
}

@media print {
  .skip-link,
  .idb-skip-link,
  .menu-toggle,
  .composer {
    display: none !important;
  }
}
