.analytics-preferences[hidden],
.analytics-settings[hidden],
.analytics-preferences button[hidden] {
  display: none;
}

.analytics-preferences {
  position: fixed;
  z-index: 80;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  width: min(320px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 12px;
  border: 1px solid #38716f;
  border-radius: 12px;
  background: #081719;
  color: #e9f6f3;
  box-shadow: 0 8px 26px #0008;
  font: 14px/1.45 system-ui, sans-serif;
}

.analytics-preferences h2 {
  margin: 0 0 4px;
  font: 650 15px/1.35 system-ui, sans-serif;
}

.analytics-preferences p { margin: 0; }
.analytics-preferences .analytics-details { margin-top: 6px; color: #b9d2cf; font-size: 13px; }
.analytics-preferences a,
.analytics-settings { color: #a0f0e4; text-decoration: underline; text-underline-offset: .18em; }
.analytics-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.analytics-actions button {
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid #5d9b98;
  border-radius: 7px;
  background: #10272a;
  color: #ebfaf7;
  font: 650 14px/1.3 system-ui, sans-serif;
  cursor: pointer;
}

.analytics-actions button:hover { background: #1b3b3d; }
.analytics-actions button:disabled { cursor: wait; }
.analytics-preferences .analytics-error:not(:empty) { margin-top: 8px; color: #ffd4b8; }

.analytics-close, .analytics-settings {
  border: 0;
  padding: 3px 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.analytics-close { min-height: 36px; color: #a0f0e4; text-decoration: underline; }
.analytics-settings { min-height: 36px; margin-inline-start: .55em; }
.analytics-contact-footer {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 1;
  font: 13px/1.45 system-ui, sans-serif;
}

.analytics-contact-footer .analytics-settings {
  margin: 0;
  padding-inline: 9px;
  border-radius: 6px;
  background: #081719;
}

.analytics-preferences :focus-visible,
.analytics-settings:focus-visible { outline: 2px solid #a0f0e4; outline-offset: 2px; }
.analytics-announcement { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
