.demo-cookie-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 18px;
  font-size: .875rem;
}

.demo-cookie-links > :is(a, button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  color: inherit;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.demo-cookie-links > button {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.demo-cookie-links > :focus-visible,
.demo-cookie-menu > summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.demo-cookie-footer {
  margin-inline: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left)) max(clamp(16px, 4vw, 40px), env(safe-area-inset-right));
  padding: 6px 0 max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(16, 33, 46, .16);
  color: #344b5b;
}

.demo-cookie-footer .demo-cookie-links {
  justify-content: center;
}

.demo-cookie-menu {
  display: none;
}

/* The immersive 2D view hides the site footer and cannot scroll to it. */
@media (max-width: 760px) {
  .demo-cookie-menu {
    position: relative;
    display: block;
  }

  .demo-cookie-menu > summary {
    display: grid;
    min-height: 44px;
    padding-inline: 8px;
    place-items: center;
    color: #e7efea;
    font-size: .75rem;
    font-weight: 650;
    list-style: none;
    cursor: pointer;
  }

  .demo-cookie-menu > summary::-webkit-details-marker {
    display: none;
  }

  .demo-cookie-menu > .demo-cookie-links {
    position: absolute;
    inset-block-start: calc(100% + 4px);
    inset-inline-end: 0;
    display: grid;
    width: max-content;
    max-width: min(16rem, calc(100vw - 4.5rem));
    padding: 4px 14px;
    color: #eef6f0;
    background: #18241f;
    border: 1px solid #4a5c52;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
  }
}

/* The showcase uses a separate stylesheet from the main site's dialog. */
.mobile-crystal-site > .cookie-consent {
  position: fixed;
  z-index: 1000;
  inset-inline-end: max(12px, env(safe-area-inset-right));
  inset-block-end: max(12px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  width: min(28rem, calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
  padding: 16px;
  border: 1px solid #cad7e8;
  border-radius: 16px;
  color: #10212e;
  background: #f6f9fd;
  box-shadow: 0 8px 30px rgba(16, 33, 46, .16);
  font-size: .875rem;
  line-height: 1.45;
}

.mobile-crystal-site > .cookie-consent .cookie-consent-copy strong {
  color: inherit;
}

.mobile-crystal-site .cookie-consent-copy p {
  margin: .4em 0;
}

.mobile-crystal-site .cookie-consent-links,
.mobile-crystal-site .cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
}

.mobile-crystal-site .cookie-consent-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #174a9d;
  text-decoration: underline;
}

.mobile-crystal-site .cookie-internal {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.mobile-crystal-site .cookie-consent-actions {
  gap: 8px;
  margin-top: 8px;
}

.mobile-crystal-site .cookie-consent .cookie-button {
  flex: 1 1 10em;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #6480a8;
  border-radius: 8px;
  color: #17385f;
  background: transparent;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.mobile-crystal-site .cookie-consent .cookie-button-primary {
  border-color: #164fa9;
  color: #fff;
  background: #164fa9;
}
