.analytics-consent {
  --consent-ink: var(--ink, #090a08);
  --consent-white: var(--white, #ffffff);
  --consent-ice: var(--ice, #eef0e9);
  --consent-muted: var(--muted, #555b50);
  --consent-lime: var(--lime, #c7ff00);
  position: fixed;
  z-index: 10000;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: grid;
  width: min(31rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  gap: 1.25rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  border: 2px solid var(--consent-ice);
  clip-path: polygon(0 0, calc(100% - 1.25rem) 0, 100% 1.25rem, 100% 100%, 0 100%);
  background: var(--consent-ink);
  color: var(--consent-white);
  font-family: industry, "Arial Narrow", Arial, sans-serif;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.analytics-consent[hidden] {
  display: none;
}

.analytics-consent--visible {
  opacity: 1;
  transform: translateY(0);
}

.analytics-consent__copy {
  display: grid;
  gap: 0.7rem;
}

.analytics-consent h2,
.analytics-consent h3,
.analytics-consent p {
  margin: 0;
}

.analytics-consent h2 {
  max-width: 16ch;
  color: var(--consent-white);
  font-size: clamp(1.65rem, 5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-transform: uppercase;
}

.analytics-consent p {
  color: color-mix(in srgb, var(--consent-white) 78%, transparent);
  font-size: 0.95rem;
  line-height: 1.5;
}

.analytics-consent__status {
  padding-left: 0.7rem;
  border-left: 3px solid var(--consent-lime);
  color: var(--consent-ice) !important;
  font-weight: 700;
}

.analytics-consent__settings,
.analytics-consent__details a {
  width: fit-content;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--consent-white);
  font: inherit;
  font-weight: 700;
  line-height: 2.75rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--consent-white) 42%, transparent);
  text-underline-offset: 0.22em;
  cursor: pointer;
}

.analytics-consent__settings:hover,
.analytics-consent__details a:hover {
  color: var(--consent-lime);
}

.analytics-consent__details {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.8rem;
  border-top: 1px solid color-mix(in srgb, var(--consent-ice) 35%, transparent);
}

.analytics-consent__details[hidden] {
  display: none;
}

.analytics-consent__details h3 {
  margin-top: 0.45rem;
  color: var(--consent-lime);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.analytics-consent__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.analytics-consent__button {
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 2px solid transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 155ms ease-out, background-color 155ms ease-out, color 155ms ease-out;
}

.analytics-consent__button:active {
  transform: scale(0.97);
}

.analytics-consent__button--allow {
  border-color: var(--consent-lime);
  background: var(--consent-lime);
  color: var(--consent-ink);
}

.analytics-consent__button--deny {
  border-color: var(--consent-ice);
  background: var(--consent-ice);
  color: var(--consent-ink);
}

.analytics-consent__button--deny:hover {
  border-color: var(--consent-white);
  background: var(--consent-white);
}

.analytics-consent :focus-visible {
  outline: 3px solid var(--consent-lime);
  outline-offset: 3px;
}

@media (max-width: 31rem) {
  .analytics-consent {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: calc(100vw - 1.5rem);
  }

  .analytics-consent__actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .analytics-consent,
  .analytics-consent__button {
    transition: none;
  }
}
