.analytics-consent[hidden],
[data-analytics-preferences][hidden] {
  display: none !important;
}

[data-analytics-preferences] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 0;
  padding: 6px 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.policy-links {
  align-items: center;
}

.analytics-consent {
  position: fixed;
  z-index: 50;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  box-sizing: border-box;
  padding: 20px;
  border: 1px solid var(--line, #d9dfd8);
  border-radius: 16px;
  background: var(--surface, #fffdf8);
  color: var(--ink, #192c36);
  box-shadow: 0 10px 40px #0003;
  font: 14px/1.5 system-ui, sans-serif;
}

.analytics-consent h2 {
  margin: 0 40px 12px 0;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: normal;
}

.analytics-consent p {
  margin: 10px 0;
}

.analytics-consent a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.analytics-status {
  color: var(--muted, #68747a);
  font-size: 12px;
}

.analytics-close {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: 24px/1 system-ui, sans-serif;
  cursor: pointer;
}

.analytics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.analytics-actions button {
  flex: 1 1 144px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line, #d9dfd8);
  border-radius: 9px;
  background: var(--soft, #f1f5ee);
  color: var(--ink, #192c36);
  font: 600 13px/1.4 system-ui, sans-serif;
  cursor: pointer;
}

#analytics-allow {
  background: var(--button, #192c36);
  color: var(--on-button, #fffdf8);
}

.analytics-consent :focus-visible,
[data-analytics-preferences]:focus-visible {
  outline: 3px solid var(--ink, #192c36);
  outline-offset: 3px;
}
