.analytics-choice[hidden],
.analytics-choice [hidden] {
  display: none !important;
}

.analytics-choice {
  position: fixed;
  z-index: 1000;
  left: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(480px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid #566372;
  border-radius: 14px;
  background: #111b25;
  color: #f5f7fa;
  box-shadow: 0 12px 40px #0005;
  font: 0.875rem/1.55 Inter, sans-serif;
  text-align: left;
}

.analytics-choice-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.analytics-choice h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: inherit;
  font: 600 1.125rem/1.3 Inter, sans-serif;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.analytics-choice .analytics-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #566372;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: 400 26px/1 Inter, sans-serif;
  cursor: pointer;
}

.analytics-choice-copy {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #566372 transparent;
}

.analytics-choice p {
  margin: 0;
  color: #dce4ed;
  overflow-wrap: anywhere;
}

.analytics-choice a {
  align-self: flex-start;
  min-width: 0;
  max-width: 100%;
  color: #c4e5ff;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.analytics-choice [data-error] {
  color: #ffd0ca;
}

.analytics-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 auto;
  gap: 10px;
}

.analytics-actions button {
  box-sizing: border-box;
  min-width: 0;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #91a2b5;
  border-radius: 8px;
  background: #213345;
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.analytics-actions button:hover,
.analytics-choice .analytics-close:hover {
  background: #334c64;
}

.analytics-choice button:focus-visible,
.analytics-settings:focus-visible {
  outline: 3px solid #9bd0ff;
  outline-offset: 3px;
}

.analytics-choice button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.analytics-settings {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  overflow-wrap: anywhere;
  cursor: pointer;
}

@media (max-width: 520px) {
  .analytics-choice {
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    gap: 16px;
    padding: 20px;
    border-radius: 12px;
  }

  .analytics-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}
