.analytics-consent {
  position: fixed;
  z-index: 1000;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: max(1rem, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem 2rem;
  width: min(680px, calc(100% - 2rem));
  max-width: 680px;
  margin-inline: auto;
  padding: 1.35rem 1.35rem 1.25rem;
  overflow: hidden;
  color: var(--color-text, #e6e9ec);
  background:
    linear-gradient(135deg, hsl(213 40% 13% / 0.98), hsl(210 15% 7% / 0.98));
  border: 1px solid var(--color-border, #25303a);
  border-radius: 16px;
  box-shadow: 0 24px 80px hsl(210 40% 2% / 0.58), 0 0 0 1px hsl(35 100% 65% / 0.08);
  animation: analytics-consent-enter 240ms ease-out both;
}

[data-theme="light"] .analytics-consent {
  background: linear-gradient(135deg, hsl(0 0% 100% / 0.99), hsl(220 25% 96% / 0.99));
  box-shadow: 0 24px 70px hsl(215 30% 20% / 0.2), 0 0 0 1px hsl(230 85% 55% / 0.06);
}

.analytics-consent__accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-primary, #ffb14a), var(--color-accent, #f23e67));
}

.analytics-consent__copy {
  min-width: 0;
}

.analytics-consent__eyebrow {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--color-primary, #ffb14a);
  font-family: var(--font-mono, monospace);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.analytics-consent h2 {
  margin: 0 2.5rem 0.45rem 0;
  color: var(--color-text, #e6e9ec);
  font-family: var(--font-display, sans-serif);
  font-size: clamp(1.05rem, 2.7vw, 1.3rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.analytics-consent p {
  margin: 0;
  color: var(--color-muted, #9099a1);
  font-family: var(--font-sans, sans-serif);
  font-size: 0.86rem;
  line-height: 1.6;
}

.analytics-consent a {
  color: var(--color-primary, #ffb14a);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.analytics-consent__status {
  margin-top: 0.55rem !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: 0.72rem !important;
}

.analytics-consent__actions {
  display: flex;
  align-items: end;
  gap: 0.65rem;
}

.analytics-consent__button,
.analytics-consent__close {
  min-height: 44px;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.analytics-consent__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 0.65rem 0.95rem;
  border-radius: 10px;
  font-family: var(--font-sans, sans-serif);
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.analytics-consent__button:hover {
  transform: translateY(-1px);
}

.analytics-consent__button--quiet {
  color: var(--color-text, #e6e9ec);
  background: transparent;
  border: 1px solid var(--color-border, #25303a);
}

.analytics-consent__button--accept {
  color: var(--color-bg, #0c1117);
  background: var(--color-primary, #ffb14a);
}

.analytics-consent__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: grid;
  width: 44px;
  padding: 0;
  place-items: center;
  color: var(--color-muted, #9099a1);
  background: transparent;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
}

.analytics-consent__close:hover {
  color: var(--color-text, #e6e9ec);
  background: hsl(210 15% 50% / 0.1);
}

.analytics-consent :focus-visible {
  outline: 2px solid var(--color-primary, #ffb14a);
  outline-offset: 3px;
}

@keyframes analytics-consent-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 620px) {
  .analytics-consent {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.2rem;
  }

  .analytics-consent__actions {
    align-items: stretch;
  }

  .analytics-consent__button {
    flex: 1;
  }
}

@media (max-width: 390px) {
  .analytics-consent__actions {
    flex-direction: column-reverse;
  }

  .analytics-consent__button {
    width: 100%;
  }
}

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