.analytics-preferences {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

.analytics-preferences:focus-visible,
.analytics-consent :is(button, a):focus-visible {
  outline: 2px solid #bba9ff;
  outline-offset: 4px;
}

.analytics-consent {
  position: fixed;
  z-index: 15;
  inset-inline-end: max(.75rem, env(safe-area-inset-right));
  inset-block-end: max(.75rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
  width: min(20.5rem, calc(100% - max(.75rem, env(safe-area-inset-left)) - max(.75rem, env(safe-area-inset-right))));
  max-height: calc(100dvh - 1.5rem - env(safe-area-inset-bottom));
  overflow: auto;
  padding: .6875rem .8125rem .5625rem;
  border: 1px solid #b39af65c;
  border-radius: .9375rem;
  background: #171a31;
  color: #f6f4ff;
  box-shadow: 0 8px 28px #03041269, inset 0 1px #e3d8ff12;
  font-family: inherit;
}

@supports (backdrop-filter: blur(1px)) {
  .analytics-consent {
    background: linear-gradient(145deg, #221c3bea, #14182ce8);
    backdrop-filter: blur(18px) saturate(125%);
  }
}

body:has(.early-access-dialog[open], .is-theater) .analytics-consent {
  visibility: hidden;
}

.analytics-consent h2 {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .25rem;
  color: inherit;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.25;
}

.analytics-consent-shield {
  flex: 0 0 1.125rem;
  width: 1.125rem;
  height: 1.125rem;
  color: #b6a1f8;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.analytics-consent p { margin: 0; color: #dfdaef; font-size: .8125rem; line-height: 1.4; }

.analytics-consent-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 .625rem;
  margin-top: .375rem;
}

.analytics-consent a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #ded1fb;
  font-size: .75rem;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.analytics-consent-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(4.25rem, 1fr));
  gap: .375rem;
}

.analytics-consent button {
  min-height: 44px;
  padding: .375rem .5rem;
  border: 1px solid #a891e677;
  border-radius: .5625rem;
  background: #332851;
  color: inherit;
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
}

.analytics-consent button:hover:not(:disabled) { background: #453662; }
.analytics-consent button:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 620px) {
  html:has(.analytics-consent:not([hidden])) {
    scroll-padding-block-end: calc(8.75rem + env(safe-area-inset-bottom));
  }

  body:has(.analytics-consent:not([hidden])) {
    padding-block-end: calc(8.75rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 620px) and (max-height: 560px) {
  .analytics-consent {
    position: static;
    margin: .625rem max(.75rem, env(safe-area-inset-right)) .375rem auto;
  }

  html:has(.analytics-consent:not([hidden])) { scroll-padding-block-end: 0; }
  body:has(.analytics-consent:not([hidden])) { padding-block-end: 0; }

  body:has(.early-access-dialog[open], .is-theater) .analytics-consent {
    display: none;
  }
}
