.analytics-banner {
  position: fixed;
  inset-inline-start: max(0.75rem, env(safe-area-inset-left));
  inset-block-end: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 20;
  box-sizing: border-box;
  width: min(25rem, calc(100% - 1.5rem));
  max-height: 55vh;
  overflow: auto;
  padding: 0.85rem 1rem;
  border: 1px solid #aaa;
  border-radius: 0.5rem;
  background: #fff;
  color: #222;
  box-shadow: 0 4px 18px #0003;
  font: 0.875rem/1.4 system-ui, sans-serif;
}

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

.analytics-banner p {
  margin: 0 0 0.6rem;
}

.analytics-banner a {
  color: inherit;
  text-decoration: underline;
}

.analytics-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.analytics-banner-actions button {
  flex: 1;
  min-height: 44px;
  padding: 0.35rem 0.6rem;
  border: 1px solid #555;
  border-radius: 0.25rem;
  background: #fff;
  color: #222;
  font: inherit;
  cursor: pointer;
}

.analytics-settings {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: underline;
  cursor: pointer;
}

.analytics-banner :focus-visible,
.analytics-settings:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

body:has(.analytics-banner:not([hidden])) {
  padding-bottom: max(12rem, env(safe-area-inset-bottom));
}
