.analytics-consent {
  position: fixed;
  z-index: 10000;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 16px 48px rgb(15 23 42 / 22%);
}

.analytics-consent {
  right: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  left: clamp(12px, 3vw, 28px);
  display: flex;
  max-width: 760px;
  margin-left: auto;
  padding: clamp(16px, 3vw, 24px);
  border-radius: 18px;
  gap: var(--space-md, 20px);
  align-items: center;
  justify-content: space-between;
}

.analytics-consent h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.analytics-consent p {
  max-width: 58ch;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.analytics-consent a {
  color: var(--primary);
  font-size: 0.86rem;
}

.analytics-consent__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.analytics-consent button {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--card);
  color: var(--primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.analytics-consent button:hover,
.analytics-consent button:focus-visible {
  background: color-mix(in srgb, var(--primary) 10%, var(--card));
}

.analytics-preferences {
  --analytics-preferences-surface: var(--card, #fff);
  --analytics-preferences-border: var(--border, #dfe3ea);
  --analytics-preferences-text: var(--text, #0f172a);
  --analytics-preferences-muted: var(--muted, #6b7280);
  --analytics-preferences-primary: var(--primary, #2563eb);

  width: min(92vw, 34rem);
  margin: auto;
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid var(--analytics-preferences-border);
  border-radius: 18px;
  background: var(--analytics-preferences-surface);
  color: var(--analytics-preferences-text);
  box-shadow: 0 20px 64px rgb(15 23 42 / 28%);
}

html.dark .analytics-preferences,
body:has(#root > .dark) .analytics-preferences {
  --analytics-preferences-surface: var(--card, #020617);
  --analytics-preferences-border: var(--border, #1e293b);
  --analytics-preferences-text: var(--text, #e6e6e6);
  --analytics-preferences-muted: var(--muted, #94a3b8);
  --analytics-preferences-primary: var(--primary, #8ab4f8);
}

.analytics-preferences::backdrop {
  background: rgb(15 23 42 / 52%);
}

.analytics-preferences__header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.analytics-preferences h2 {
  margin: 0;
  font-size: 1.15rem;
}

.analytics-preferences p {
  margin: 12px 0;
  color: var(--analytics-preferences-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.analytics-preferences .analytics-preferences__status {
  color: var(--analytics-preferences-text);
  font-weight: 700;
}

.analytics-preferences__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 14px;
}

.analytics-preferences button {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--analytics-preferences-primary);
  border-radius: 999px;
  background: var(--analytics-preferences-surface);
  color: var(--analytics-preferences-primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.analytics-preferences button[aria-pressed="true"],
.analytics-preferences button:hover,
.analytics-preferences button:focus-visible {
  background: color-mix(
    in srgb,
    var(--analytics-preferences-primary) 10%,
    var(--analytics-preferences-surface)
  );
}

.analytics-preferences .analytics-preferences__close {
  min-width: 42px;
  padding: 6px;
  font-size: 1.35rem;
  line-height: 1;
}

.analytics-preferences a {
  color: var(--analytics-preferences-primary);
  font-size: 0.86rem;
}

@media (max-width: 640px) {
  .analytics-consent {
    align-items: stretch;
    flex-direction: column;
  }

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

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