/* Cookie banner + settings dialog (site/assets/js/analytics.js).
 * Uses the design-system tokens, so light/dark follow the site theme
 * (OS preference or the in-page toggle) with no extra rules. Non-blocking:
 * the banner is a small bottom sheet that never covers the page on desktop
 * and leaves the page scrollable on mobile. */
.pi-consent {
  position: fixed;
  z-index: 1000;
  left: 1rem;
  bottom: 1rem;
  max-width: 34rem;
  box-sizing: border-box;
  padding: 1rem 1.1rem;
  background: var(--panel, #fff);
  color: var(--paper, #0c2723);
  border: 1px solid var(--rule-strong, rgba(12, 39, 35, .17));
  border-radius: var(--r-2, 12px);
  box-shadow: var(--shadow-lg, 0 12px 34px rgba(12, 39, 35, .13));
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: var(--step--1, .875rem);
  line-height: 1.45;
}
.pi-consent-text { margin: 0 0 .75rem; }
.pi-consent a,
.pi-cookie-link { color: var(--teal, #0d9488); text-decoration: underline; text-underline-offset: 2px; }
.pi-consent-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.pi-consent-btn {
  font: inherit;
  font-weight: 600;
  min-height: 44px;           /* touch target */
  padding: .5rem 1rem;
  border-radius: var(--r-1, 8px);
  border: 1px solid var(--rule-strong, rgba(12, 39, 35, .17));
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.pi-consent-btn.is-primary {
  background: var(--accent-fill, #0d9488);
  border-color: var(--accent-fill, #0d9488);
  color: var(--on-accent, #fff);
}
.pi-consent-btn.is-link { border-color: transparent; text-decoration: underline; }
.pi-consent-btn:focus-visible,
.pi-cookie-link:focus-visible,
.pi-consent-toggle input:focus-visible {
  outline: 2px solid var(--teal, #0d9488);
  outline-offset: 2px;
}
.pi-cookie-link {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

.pi-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, .45);
}
.pi-consent-dialog {
  box-sizing: border-box;
  width: 100%;
  max-width: 32rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.25rem;
  background: var(--panel, #fff);
  color: var(--paper, #0c2723);
  border-radius: var(--r-2, 12px);
  box-shadow: var(--shadow-lg, 0 12px 34px rgba(12, 39, 35, .13));
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: var(--step-0, 1rem);
  line-height: 1.5;
}
.pi-consent-title { margin: 0 0 .75rem; font-size: var(--step-1, 1.2rem); font-family: var(--font-display, inherit); }
.pi-consent-toggle { display: flex; gap: .6rem; align-items: flex-start; margin: .75rem 0; }
.pi-consent-toggle input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; accent-color: var(--teal, #0d9488); }
.pi-consent-note { color: var(--paper-dim, inherit); font-size: var(--step--1, .875rem); }

@media (max-width: 600px) {
  .pi-consent { left: .5rem; right: .5rem; bottom: .5rem; max-width: none; }
  .pi-consent-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .pi-consent { animation: pi-consent-in var(--dur-2, 200ms) var(--ease, ease-out); }
  @keyframes pi-consent-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media print { .pi-consent, .pi-consent-overlay { display: none; } }
