.analytics-panel {
  position: fixed;
  z-index: 40;
  inset-inline-end: clamp(12px, 2vw, 28px);
  inset-block-end: calc(var(--bottom-nav-size, 0px) + 12px + env(safe-area-inset-bottom, 0px));
  width: min(440px, calc(100% - 24px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.analytics-panel[hidden] { display: none; }
.analytics-panel p { margin: 0 0 .75rem; line-height: 1.5; }
.analytics-choices { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.analytics-choices a { margin-inline-end: auto; color: var(--green-dark); }
.analytics-choices button {
  min-height: 44px;
  padding: .45rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green-dark);
  font: inherit;
  cursor: pointer;
}
.analytics-choices button:hover { background: var(--green-soft); }
.analytics-choices button:focus-visible, .analytics-preferences:focus-visible {
  outline: 2px solid var(--green-dark);
  outline-offset: 2px;
}
.analytics-preferences {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

@media (max-width: 1080px) {
  .app-shell ~ .analytics-panel {
    inset-block-end: calc(var(--bottom-nav-size, 72px) + 12px + env(safe-area-inset-bottom, 0px));
  }
}
