/* Consent banner and preference centre. Self-contained, so it renders the same on every page. */
.consent {
  position: fixed; z-index: 70;
  inset: auto 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  inset-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px));
  max-width: 30rem; margin-left: auto;
}
.consent__panel {
  background: #fff; border: 1px solid #dfe0eb; color: #15172b;
  border-radius: 1rem; padding: 1.1rem;
  box-shadow: 0 16px 40px rgb(29 34 72 / 0.2);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.consent__panel--prefs { max-height: min(80vh, 38rem); overflow-y: auto; }
.consent .consent__title { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 700; line-height: 1.3; letter-spacing: 0; color: #15172b; }
.consent .consent__text { margin: 0 0 0.85rem; font-size: 0.9rem; line-height: 1.5; color: #4d5170; }
.consent .consent__text a { color: #3c34d4; text-decoration: underline; text-underline-offset: 2px; }
.consent__cats { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.consent__cat { border: 1px solid #dfe0eb; border-radius: 0.75rem; padding: 0.75rem; background: #f8f8fc; }
.consent__cat-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.consent__cat-title { font-size: 0.9rem; font-weight: 650; line-height: 1.2; color: #15172b; }
.consent .consent__cat-body { margin: 0.5rem 0 0; font-size: 0.85rem; line-height: 1.5; color: #4d5170; }
.consent__cat-detail { display: block; margin-top: 0.35rem; font-family: ui-monospace, monospace; font-size: 0.75rem; color: #626579; }
.consent__always { font-size: 0.8rem; font-weight: 650; color: #626579; }
/* A real checkbox kept in the accessibility tree, visually replaced. */
.consent__switch { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.consent__switch input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; white-space: nowrap; clip: rect(0 0 0 0); clip-path: inset(50%); }
.consent__switch-track { flex: none; width: 40px; height: 24px; border-radius: 999px; background: #dfe0eb; border: 1px solid #c9cbea; position: relative; transition: background 120ms ease-out; }
.consent__switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); transition: transform 120ms ease-out; }
.consent__switch input:checked + .consent__switch-track { background: #3c34d4; border-color: #3c34d4; }
.consent__switch input:checked + .consent__switch-track::after { transform: translateX(16px); }
.consent__switch input:disabled + .consent__switch-track { opacity: 0.6; }
.consent__switch input:focus-visible + .consent__switch-track { outline: 3px solid #3c34d4; outline-offset: 2px; }
.consent__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.consent__btn { flex: 1 1 8rem; min-height: 44px; border-radius: 0.7rem; cursor: pointer; border: 1.5px solid #c9cbea; background: #fff; color: #232957; padding: 0 0.75rem; font: 700 0.9rem/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.consent__btn:hover { background: #f3f3fa; }
.consent__btn--primary { background: #3c34d4; border-color: #3c34d4; color: #fff; }
.consent__btn--primary:hover { background: #251dbd; }
.consent__btn:focus-visible { outline: 3px solid #3c34d4; outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .consent { animation: consent-in 160ms ease-out; } }
@keyframes consent-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Phones: a slim bar flush with the bottom edge, so the first screen keeps its call to action. */
@media (max-width: 639px) {
  .consent { inset: auto 0 0; margin: 0; max-width: none; }
  .consent__panel:not(.consent__panel--prefs) {
    border-radius: 0.9rem 0.9rem 0 0; border-width: 1px 0 0;
    padding: 0.7rem 0.75rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  }
  .consent__panel:not(.consent__panel--prefs) .consent__title {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .consent__panel:not(.consent__panel--prefs) .consent__text { margin-bottom: 0.55rem; font-size: 0.82rem; line-height: 1.4; }
  .consent__panel:not(.consent__panel--prefs) .consent__actions { flex-wrap: nowrap; gap: 0.4rem; }
  .consent__panel:not(.consent__panel--prefs) .consent__btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 0.4rem; font-size: 0.82rem; white-space: nowrap; }
  .consent__panel--prefs { border-radius: 0.9rem 0.9rem 0 0; max-height: 85vh; }
}
