/* Cookie consent banner (inc/consent.php). */
.aai-cc {
  position: fixed; left: 50%; bottom: clamp(12px, 2.5vw, 24px); z-index: 80;
  width: min(760px, calc(100vw - 24px)); transform: translate(-50%, 16px); opacity: 0;
  color: var(--text-primary); background: var(--surface-card);
  border-radius: 16px; box-shadow: inset 0 0 0 1px var(--border-strong), 0 24px 60px -18px rgba(0, 0, 0, .8);
  transition: opacity .3s cubic-bezier(.16, 1, .3, 1), transform .3s cubic-bezier(.16, 1, .3, 1);
  max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain;
}
.aai-cc[hidden] { display: none; }
.aai-cc.is-open { opacity: 1; transform: translate(-50%, 0); }
.aai-cc__inner { display: grid; gap: 16px; padding: 20px 22px; }
.aai-cc__title { margin: 0; font-size: 16px; font-weight: 700; }
.aai-cc__text { margin: 6px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--text-secondary); }
.aai-cc__text a { color: var(--text-primary); text-decoration: underline; }
.aai-cc__btns { display: flex; flex-wrap: wrap; gap: 10px; }
.aai-cc__btns .aai-btn { flex: 1 1 140px; justify-content: center; }
.aai-cc__btns [hidden] { display: none; }

.aai-cc__prefs { display: grid; gap: 4px; border-top: 1px solid var(--border-strong); padding-top: 8px; }
.aai-cc__prefs[hidden] { display: none; }
.aai-cc__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 10px 0; cursor: pointer; }
.aai-cc__row + .aai-cc__row { border-top: 1px solid rgba(255, 255, 255, .06); }
.aai-cc__lab, .aai-cc__row > div { display: block; }
.aai-cc__name { display: block; margin: 0; font-size: 14.5px; font-weight: 700; }
.aai-cc__desc { display: block; margin: 2px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.aai-cc__always { font-size: 12.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

/* Toggle switch */
.aai-cc__switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.aai-cc__switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.aai-cc__switch span { position: absolute; inset: 0; border-radius: 26px; background: var(--border-strong); transition: background .2s ease; }
.aai-cc__switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.aai-cc__switch input:checked + span { background: var(--accent); }
.aai-cc__switch input:checked + span::after { transform: translateX(20px); }
.aai-cc__switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 560px) {
  .aai-cc__inner { padding: 16px; gap: 12px; }
  .aai-cc__btns .aai-btn { flex: 1 1 calc(50% - 5px); }
}
@media (prefers-reduced-motion: reduce) { .aai-cc { transition: none; } }
@media print { .aai-cc { display: none !important; } }

/* Footer "Cookie settings" link, styled like the links beside it. */
.aai-cc-link { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.aai-cc-link:hover { color: var(--text-primary); text-decoration: underline; }
