.analytics-consent {
  --consent-paper: #fffefa;
  --consent-ink: #17394a;
  --consent-border: #bacdd3;
  --consent-hover: #edf4f5;
  position: fixed;
  z-index: 68;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(27rem, calc(100vw - 12rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: .875rem;
  color: var(--consent-ink);
  background: var(--consent-paper);
  border: 1px solid var(--consent-border);
  border-radius: 1rem;
  box-shadow: 0 12px 36px #0b2f4333;
  text-align: start;
}

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

html[data-theme="dark"] .analytics-consent {
  --consent-paper: #153342;
  --consent-ink: #eef5f6;
  --consent-border: #67828c;
  --consent-hover: #244857;
}

.analytics-consent h2 {
  margin: 0;
  color: inherit;
  font: 700 1rem/1.25 var(--body, system-ui, sans-serif);
  letter-spacing: normal;
}

.analytics-consent p {
  margin: .375rem 0 .75rem;
  color: inherit;
  font-size: .8125rem;
  line-height: 1.45;
}

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

.analytics-consent-actions button {
  min-height: 44px;
  padding: .375rem .5rem;
  border: 1px solid var(--consent-border);
  border-radius: .65rem;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: .875rem;
  font-weight: 650;
  cursor: pointer;
}

.analytics-consent-actions button:hover { background: var(--consent-hover); }
.analytics-consent-notice-link {
  display: inline-block;
  margin-top: .625rem;
  color: inherit;
  font-size: .8125rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.analytics-consent :focus-visible,
.analytics-consent-footer :focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.analytics-consent-footer {
  display: grid;
  justify-items: center;
  padding: .375rem 1rem;
  color: #f4f7f7;
  background: #123748;
}

.analytics-consent-footer button,
.analytics-consent-notice summary {
  min-height: 44px;
  padding: .625rem .875rem;
  color: inherit;
  font: inherit;
  font-size: .8125rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.analytics-consent-footer button {
  border: 0;
  background: transparent;
}

.analytics-consent-notice { max-width: min(100%, 46rem); }

.analytics-consent-notice summary {
  width: fit-content;
  margin-inline: auto;
}

.analytics-consent-notice-body {
  padding: 1rem;
  margin-bottom: .625rem;
  color: inherit;
  background: #204b5c;
  border: 1px solid #668693;
  border-radius: .75rem;
  font-size: .875rem;
  line-height: 1.55;
  text-align: start;
}

.analytics-consent-notice-body p {
  margin: 0 0 .625rem;
  color: inherit;
}

.analytics-consent-notice-body a {
  display: block;
  width: fit-content;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.analytics-consent-notice-body a + a { margin-top: .5rem; }

@media (max-width: 680px) {
  .analytics-consent {
    left: max(.625rem, env(safe-area-inset-left));
    right: max(.625rem, env(safe-area-inset-right));
    bottom: calc(74px + env(safe-area-inset-bottom));
    width: auto;
    max-height: calc(100dvh - 90px - env(safe-area-inset-bottom));
  }
}
