.privacy-dialog {
  position: fixed;
  z-index: 999;
  box-sizing: border-box;
  inset: auto 0 max(.75rem, env(safe-area-inset-bottom));
  width: fit-content;
  max-width: min(56rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - max(.75rem, env(safe-area-inset-bottom)) - .75rem);
  margin: 0 auto;
  padding: .875rem 1.25rem;
  border: 1px solid #2d3f5929;
  border-radius: .875rem;
  background: #f5ebdc;
  color: #2d3f59;
  box-shadow: 0 -.5rem 2rem #1721331a;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: inherit;
  font-size: .875rem;
  line-height: 1.5;
}

.privacy-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
}

.privacy-dialog[inert],
.privacy-dialog[aria-hidden="true"] {
  visibility: hidden;
}

.privacy-copy {
  min-width: 0;
  max-width: 32rem;
}

.privacy-dialog h2 {
  margin: 0 0 .375rem;
  font-size: 1.125rem;
  line-height: 1.3;
  text-transform: none;
}

.privacy-dialog p {
  margin: 0 0 .25rem;
  font-size: inherit;
  line-height: inherit;
}

.privacy-dialog a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.privacy-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .625rem;
  margin: 0;
}

.privacy-button {
  min-height: 44px;
  min-width: 7rem;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .875rem;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}

.privacy-button[data-consent-choice="denied"] {
  border-color: var(--light-red);
  background-color: transparent;
  color: var(--red);
}

.privacy-button[data-consent-choice="denied"]:hover {
  border-color: var(--red);
  background-color: var(--red);
  color: var(--white);
}

.privacy-dialog :focus-visible,
.privacy-settings:focus-visible {
  outline: 2px solid #2d3f59;
  outline-offset: 3px;
}

.privacy-dialog h2:focus {
  outline: none;
}

.privacy-settings {
  min-height: 44px;
  max-width: 100%;
  padding: .5rem 0;
  border: 0;
  background: transparent;
  color: #2d3f59;
  font: inherit;
  font-size: .875rem;
  text-align: left;
  text-transform: uppercase;
  white-space: normal;
  cursor: pointer;
}

.privacy-settings:hover {
  text-decoration: underline;
  text-underline-offset: .2em;
}

/* Match the adjacent .footer-link.auto typography. */
footer .privacy-settings {
  font-size: var(--body-size-desktop--tiny);
  font-variation-settings: "wght" 450;
  line-height: 150%;
  transition: font-variation-settings .3s;
}

footer .privacy-settings:hover {
  font-variation-settings: "wght" 700;
}

/* Centre the link's text beside the button's 44px touch target, also on hover. */
footer .nav-grid.second > .footer-link.auto {
  align-self: center;
}

.privacy-utility-settings {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  padding: .6rem 1rem;
  border-radius: .5rem;
  background: #f5ebdc;
}

.privacy-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .privacy-dialog[open] { grid-template-columns: minmax(0, 1fr); gap: .625rem; }
  .privacy-dialog { padding: .75rem 1rem; }
  .privacy-actions { justify-self: start; }
}

@media (max-width: 479px) {
  .privacy-dialog h2 { font-size: 1rem; }
  .privacy-actions { width: 100%; }
  .privacy-button { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .privacy-button { transition: none; }
}
