.pa-cookie-banner {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  left: clamp(1rem, 3vw, 2rem);
  z-index: 3200;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: end;
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  color: #f1f8f9;
  background: #101827;
  border: 1px solid #52627a;
  border-radius: 8px;
  box-shadow: 0 1.25rem 3rem rgb(0 0 0 / 35%);
}

html[data-pa-theme="light"] body.pa-body > [data-pa-cookie-banner].pa-cookie-banner #pa-cookie-banner-description {
  position: relative !important;
  z-index: 1 !important;
  background: #101827 !important;
  background-image: none !important;
}

/* Consent must remain the only floating decision surface while it is open.
   The Support Guide can return immediately after either preference is saved. */
body:has(.pa-cookie-banner) > :is(.pa-helpbot, .pp-direct-editor-launcher) {
  display: none !important;
}

.pa-cookie-banner__copy {
  max-width: 52rem;
}

html body [data-pa-cookie-banner].pa-cookie-banner .pa-cookie-banner__eyebrow {
  margin: 0 0 0.25rem;
  color: #c7d4d9 !important;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html body [data-pa-cookie-banner].pa-cookie-banner #pa-cookie-banner-title {
  margin: 0;
  color: #f1f8f9 !important;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

html body [data-pa-cookie-banner].pa-cookie-banner #pa-cookie-banner-description {
  margin: 0.5rem 0 0.4rem;
  color: #c7d4d9 !important;
  line-height: 1.55;
}

html body [data-pa-cookie-banner].pa-cookie-banner a[href$="privacy#analytics"] {
  color: #70e1dc !important;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.18em;
}

.pa-cookie-choice-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(8.75rem, 1fr));
  gap: 0.65rem;
  align-items: stretch;
}

.pa-cookie-choice {
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  color: #fff;
  font: inherit;
  font-weight: 750;
  line-height: 1.2;
  background: #245fba;
  border: 2px solid #8db8ff;
  border-radius: 8px;
  cursor: pointer;
}

.pa-cookie-choice:hover {
  color: #fff;
  background: #174987;
  border-color: #c3d9ff;
}

.pa-cookie-choice:focus-visible,
.pa-cookie-settings summary:focus-visible {
  outline: 3px solid #ffdf75;
  outline-offset: 3px;
}

.pa-cookie-settings {
  position: relative;
}

.pa-cookie-settings summary {
  width: fit-content;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.pa-cookie-settings summary::marker {
  content: "";
}

.pa-cookie-settings__panel {
  width: min(31rem, calc(100vw - 2rem));
  margin-top: 0.75rem;
  padding: 1rem;
  color: #f7f9fc;
  background: #101827;
  border: 1px solid #66758c;
  border-radius: 8px;
  box-shadow: 0 1rem 2.25rem rgb(0 0 0 / 30%);
}

.pa-cookie-settings__panel p {
  margin: 0 0 0.75rem;
  color: #e1e8f3;
  line-height: 1.5;
}

.pa-cookie-settings__panel .pa-cookie-status {
  color: #c9dcff;
  font-weight: 700;
}

/* Footer typography must not paint dark copy onto this dark preference panel.
   Both choices keep the same visual weight in either page theme. */
html body.pa-body:not(.pa-protected-workspace):not(.pa-family-message):not(:has(.pa-home)) .pa-footer .pa-cookie-settings > .pa-cookie-settings__panel {
  color: #f1f8f9 !important;
  background: #101827 !important;
  background-image: none !important;
}

html body.pa-body:not(.pa-protected-workspace):not(.pa-family-message):not(:has(.pa-home)) .pa-footer .pa-cookie-settings__panel :is(p, span, strong, small) {
  color: #f1f8f9 !important;
}

html body.pa-body:not(.pa-protected-workspace):not(.pa-family-message):not(:has(.pa-home)) .pa-footer .pa-cookie-settings__panel .pa-cookie-status {
  color: #c9dcff !important;
}

html body.pa-body:not(.pa-protected-workspace):not(.pa-family-message):not(:has(.pa-home)) .pa-footer .pa-cookie-settings__panel .pa-cookie-choice {
  color: #ffffff !important;
  background: #245fba !important;
  border-color: #8db8ff !important;
}

/* Dark mode uses the shared template palette for both the first-run banner
   and the footer settings panel. Light keeps the existing approved treatment. */
html[data-pa-theme="dark"] body.pa-body:not(.pa-protected-workspace) [data-pa-cookie-banner].pa-cookie-banner,
html[data-pa-theme="dark"] body.pa-body:not(.pa-protected-workspace):not(.pa-family-message):not(:has(.pa-home)) .pa-footer .pa-cookie-settings > .pa-cookie-settings__panel {
  color: var(--text-main) !important;
  background: var(--surface) !important;
  background-image: none !important;
  border-color: var(--border) !important;
}

html[data-pa-theme="dark"] body.pa-body:not(.pa-protected-workspace):not(.pa-family-message):not(:has(.pa-home)) .pa-footer .pa-cookie-settings__panel :is(p, span, small),
html[data-pa-theme="dark"] body.pa-body:not(.pa-protected-workspace) [data-pa-cookie-banner].pa-cookie-banner #pa-cookie-banner-description,
html[data-pa-theme="dark"] body.pa-body:not(.pa-protected-workspace) [data-pa-cookie-banner].pa-cookie-banner .pa-cookie-banner__eyebrow {
  color: var(--text-body) !important;
}

html[data-pa-theme="dark"] body.pa-body:not(.pa-protected-workspace):not(.pa-family-message):not(:has(.pa-home)) .pa-footer .pa-cookie-settings__panel :is(strong, .pa-cookie-status),
html[data-pa-theme="dark"] body.pa-body:not(.pa-protected-workspace) [data-pa-cookie-banner].pa-cookie-banner #pa-cookie-banner-title {
  color: var(--text-main) !important;
}

html[data-pa-theme="dark"] body.pa-body:not(.pa-protected-workspace):not(.pa-family-message):not(:has(.pa-home)) .pa-footer .pa-cookie-settings__panel .pa-cookie-choice,
html[data-pa-theme="dark"] body.pa-body:not(.pa-protected-workspace) [data-pa-cookie-banner].pa-cookie-banner .pa-cookie-choice {
  color: var(--page-bg) !important;
  background: var(--primary-teal) !important;
  border-color: var(--bright-teal) !important;
}

html[data-pa-theme="dark"] body.pa-body:not(.pa-protected-workspace) :is(.pa-cookie-choice, .pa-cookie-settings summary):focus-visible {
  outline-color: var(--aqua-accent) !important;
}

@media (min-width: 64rem) {
  .pa-cookie-settings__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.5rem);
    z-index: 4;
  }
}

@media (max-width: 63.99rem) {
  /* The in-flow preferences need the footer's full width, not one link column. */
  .pa-footer-grid > div:has(.pa-cookie-settings) {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .pa-footer li:has(> .pa-cookie-settings),
  .pa-footer .pa-cookie-settings {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .pa-footer .pa-cookie-settings__panel {
    width: min(31rem, 100%);
    max-width: 100%;
  }
}

@media (min-width: 48rem) and (max-width: 63.99rem) {
  .pa-cookie-banner {
    gap: 1rem;
    align-items: center;
    padding: 1rem;
  }

  .pa-cookie-choice-form {
    grid-template-columns: minmax(10.5rem, 1fr);
  }
}

@media (max-width: 47.99rem) {
  .pa-cookie-banner {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    max-height: calc(100vh - 2rem);
    padding: 0.85rem;
    overflow-y: auto;
  }

  html body [data-pa-cookie-banner].pa-cookie-banner #pa-cookie-banner-title {
    font-size: 1rem;
    line-height: 1.15;
  }

  html body [data-pa-cookie-banner].pa-cookie-banner #pa-cookie-banner-description {
    margin: 0.35rem 0 0.25rem;
    font-size: 0.9rem;
    line-height: 1.42;
  }

  .pa-cookie-choice-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .pa-cookie-choice {
    padding-inline: 0.45rem;
    font-size: 0.875rem;
  }
}

@media (forced-colors: active) {
  .pa-cookie-banner,
  .pa-cookie-settings__panel,
  .pa-cookie-choice {
    border: 2px solid CanvasText;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pa-cookie-banner *,
  .pa-cookie-settings * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* The undecided Light preference remains prominent without covering route
   copy or controls. Its Razor placement is immediately before main, so this
   bounded notice participates in normal document and keyboard flow. */
html[data-pa-theme="light"] body:not(.pa-protected-workspace) > [data-pa-cookie-banner].pa-cookie-banner {
  position: relative;
  inset: auto;
  z-index: 5;
  width: min(72rem, calc(100% - 2rem));
  max-height: none;
  margin: 1rem auto 0;
  overflow: visible;
}

html[data-pa-theme="light"] body:not(.pa-protected-workspace) > [data-pa-cookie-banner].pa-cookie-banner + .pa-main {
  margin-top: 2rem;
}

/* Keep consent copy and its actions in separate paint layers at narrow widths. */
html[data-pa-theme="light"] body > [data-pa-cookie-banner].pa-cookie-banner .pa-cookie-banner__copy {
  position: relative !important;
  z-index: 2 !important;
  min-width: 0 !important;
  isolation: isolate !important;
}

html[data-pa-theme="light"] body > [data-pa-cookie-banner].pa-cookie-banner #pa-cookie-banner-description {
  position: relative !important;
  z-index: 3 !important;
  display: block !important;
  isolation: isolate !important;
  padding-block: 0.0625rem !important;
  background: #101827 !important;
  background-image: none !important;
  transform: none !important;
}

html[data-pa-theme="light"] body > [data-pa-cookie-banner].pa-cookie-banner .pa-cookie-choice-form {
  position: relative !important;
  z-index: 1 !important;
}

html[data-pa-theme="light"] body.pa-protected-workspace > [data-pa-cookie-banner].pa-cookie-banner {
  position: relative !important;
  inset: auto !important;
  z-index: 5 !important;
  width: min(72rem, calc(100% - 2rem)) !important;
  max-height: none !important;
  margin: 1rem auto 0 !important;
  overflow: visible !important;
}

html[data-pa-theme="light"] body.pa-protected-workspace > [data-pa-cookie-banner].pa-cookie-banner + .pa-main {
  margin-top: 2rem !important;
}
