/* ═══════════════════════════════════════════════════════════════════
   Consent banner (consent.js) — styled off the shared design tokens
   (tokens.css) with hardcoded fallbacks, same pattern as the legal
   pages, so the one component serves both the dashboard shell and the
   self-contained Pulse page. Compact bottom bar, not a modal: the page
   stays fully usable, and Accept/Decline carry equal visual weight
   (dark-pattern avoidance is part of the defensibility story — D5).
   ═══════════════════════════════════════════════════════════════════ */

#aiv-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--surface, #ffffff);
  border-top: 1px solid var(--border, #d9e6f2);
  box-shadow: 0 -6px 24px rgba(6, 35, 96, 0.10);
  font-family: 'Inter Variable', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 0.875rem;
  color: var(--text, #062360);
}

#aiv-consent-banner .aiv-consent-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

#aiv-consent-banner .aiv-consent-copy {
  flex: 1 1 320px;
  margin: 0;
  line-height: 1.45;
  color: var(--text-dim, #5c6474);
}

#aiv-consent-banner .aiv-consent-copy a {
  color: var(--accent-shade, #00798c);
  text-decoration: underline;
}

#aiv-consent-banner .aiv-consent-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* Accept and Decline are the SAME button style on purpose. */
#aiv-consent-banner .aiv-consent-btn {
  appearance: none;
  border: 1px solid var(--border, #d9e6f2);
  border-radius: 8px;
  background: var(--surface2, #f5f8fc);
  color: var(--text, #062360);
  font: inherit;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}

#aiv-consent-banner .aiv-consent-btn:hover {
  border-color: var(--accent, #00bbd8);
}

#aiv-consent-banner .aiv-consent-link {
  appearance: none;
  border: none;
  background: none;
  color: var(--text-dim, #5c6474);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.45rem 0.25rem;
}

#aiv-consent-banner .aiv-consent-prefs {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border, #d9e6f2);
}

/* The display:flex above outranks the UA's [hidden] { display:none } (author
   origin wins), which left the preferences panel permanently expanded and
   the Preferences toggle visually dead — found in Phase 2 QA. Any element
   here that consent.js collapses via the hidden attribute needs this. */
#aiv-consent-banner .aiv-consent-prefs[hidden] {
  display: none;
}

#aiv-consent-banner .aiv-consent-prefs label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--text-dim, #5c6474);
}

#aiv-consent-banner .aiv-consent-prefs input[type="checkbox"] {
  accent-color: var(--accent, #00bbd8);
  width: 1rem;
  height: 1rem;
}

#aiv-consent-banner .aiv-consent-gpc-note {
  margin: 0;
  flex-basis: 100%;
  font-size: 0.8rem;
  color: var(--text-dim, #5c6474);
}

/* Footer affordances (Cookie preferences / Do Not Sell or Share) render as
   <button>s per the JS-actions-are-buttons rule, styled to sit among the
   surrounding footer links on whichever surface hosts them. */
button[data-consent-preferences] {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

@media print {
  #aiv-consent-banner { display: none; }
}
