.analytics-preferences {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.analytics-preferences:focus-visible,
.analytics-consent button:focus-visible,
.analytics-consent a:focus-visible {
  outline: 3px solid #1f9d6a;
  outline-offset: 4px;
}
.analytics-consent {
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  z-index: 10000;
  box-sizing: border-box;
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 24px;
  border: 1px solid #e2d5c6;
  border-radius: 16px;
  background: #fdf7f0;
  color: #1f2933;
  font: 16px/1.5 system-ui, sans-serif;
  box-shadow: 0 18px 48px #0003;
}
.analytics-consent::backdrop { background: #142c2366; }
.analytics-consent h2 { margin: 0 0 12px; font-size: 23px; line-height: 1.25; }
.analytics-consent p { margin: 12px 0; }
.analytics-consent a { color: #176343; text-decoration: underline; }
.analytics-consent-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.analytics-consent-actions button {
  flex: 1 1 180px;
  padding: 12px 16px;
  border: 1px solid #176343;
  border-radius: 10px;
  background: #176343;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.analytics-consent-actions button:disabled { opacity: .5; cursor: default; }
.analytics-consent-close {
  display: block;
  margin: 16px 0 0 auto;
  padding: 8px 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
@media (max-width: 420px) {
  .analytics-consent { padding: 20px; }
  .analytics-consent-actions { flex-direction: column; }
  .analytics-consent-actions button { flex: none; }
}

.audience-settings { padding: 20px; margin: 24px 0; border: 1px solid #176343; border-radius: 12px; scroll-margin-top: 100px; }
.audience-settings .analytics-consent-actions button { font: inherit; cursor: pointer; padding: 12px 20px; border-radius: 8px; border: 1px solid #176343; background: #176343; color: #fff; }
.audience-settings > a { display: inline-block; margin-top: 16px; }

.analytics-preference-toggle { display:flex; gap:12px; align-items:center; margin:16px 0; font-weight:600; cursor:pointer; }
.analytics-preference-toggle input { width:24px; height:24px; flex-shrink:0; }
.analytics-consent summary, .audience-settings summary { cursor:pointer; padding:12px 0; text-decoration:underline; }
.privacy-category { border-top:1px solid #ded5c9; padding:14px 0; }
.privacy-category-line { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.privacy-category-line > div { flex:1; }
.privacy-category h3 { margin:0; font-size:17px; }
.privacy-category-line p { margin:4px 0; font-size:14px; color:#526359; }
.privacy-category-control { display:flex; flex-direction:column; align-items:flex-end; gap:4px; min-width:92px; max-width:112px; font-size:12px; text-align:right; }
.privacy-category input.privacy-category-switch { appearance:none; -webkit-appearance:none; position:relative; width:52px; height:32px; min-width:52px; padding:0; margin:0; border:0; border-radius:999px; background:#78847e; cursor:pointer; }
.privacy-category-switch::before { content:''; position:absolute; left:4px; top:4px; width:24px; height:24px; border-radius:50%; background:white; }
.privacy-category-switch:checked { background:#176343 !important; }
.privacy-category-switch:checked::before { left:24px; }
.privacy-category-switch:disabled { opacity:.5; cursor:default; }
.privacy-category-switch:focus-visible { outline:3px solid #176343; outline-offset:3px; }
.privacy-category summary { padding:10px 0; font-size:14px; }
.privacy-category dl > div { margin:12px 0; }
.privacy-category dt { font-weight:600; }
.privacy-category dd { margin:4px 0; }
.privacy-category-help { font-size:13px; }

/* Keep both equal choices reachable while the category explanations scroll. */
.analytics-consent > .analytics-consent-actions { position:sticky; bottom:-24px; z-index:1; padding:12px 0; background:#fdf7f0; }
@media(max-width:420px) {
 .analytics-consent > .analytics-consent-actions { bottom:-20px; }
 .analytics-consent .privacy-category { padding:10px 0; }
 .analytics-consent .privacy-category summary { padding:8px 0; }
}
