.footer-links .analytics-preferences {
  appearance: none;
  font: inherit;
  line-height: inherit;
  color: var(--text-muted);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: none;
}
.footer-links .analytics-preferences:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-links { row-gap: 8px; }
.analytics-consent {
  position: fixed;
  inset: auto max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) auto;
  z-index: 10000;
  width: min(440px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 20px;
  color: var(--text-normal);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  line-height: 1.5;
  font-size: 14px;
}
body:has(#ghosty-widgetbot-crate) .analytics-consent {
  right: calc(100px + env(safe-area-inset-right, 0px));
}
.analytics-consent[hidden] { display: none; }
.analytics-consent h2 { color: var(--text-heading); font-size: 18px; margin-bottom: 10px; }
.analytics-consent p { margin: 0 0 10px; }
.analytics-consent .analytics-types { color: var(--text-muted); font-size: 13px; padding: 10px 0; border-top: 1px solid var(--border); }
.analytics-consent .analytics-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 14px; }
.analytics-consent a { color: var(--text-link); }
.analytics-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.analytics-actions button { flex: 1 1 150px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-modifier); color: var(--text-normal); font: inherit; font-weight: 600; padding: 10px 12px; min-height: 44px; cursor: pointer; }
.analytics-actions button:hover { background: var(--bg-hover); }
.analytics-actions button:focus-visible, .analytics-preferences:focus-visible, .analytics-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.analytics-close { float: right; border: 0; background: none; color: var(--text-muted); font-size: 22px; cursor: pointer; line-height: 1; padding: 2px 5px; }
.analytics-error { color: var(--danger); font-size: 13px; }
@media (max-width: 640px) {
  .analytics-consent {
    inset: auto max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    padding: 16px;
  }
  body:has(#ghosty-widgetbot-crate) .analytics-consent {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 112px - env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 400px) {
  .analytics-actions button { flex-basis: 100%; }
}
