/* Consent controls (ADR-078; the banner's look is prototypes/cookie-banner).
   Colours come from the tokens.css tokens, so the card follows the theme. Every
   page loads tokens.css first (_cookie_head.html), so the colour var() calls
   carry no fallbacks. */
.cookie-banner, .cookie-dialog, .cookie-error { box-sizing: border-box; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); font: var(--fs-body)/var(--lh-body) var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif); box-shadow: var(--shadow-2); }
.cookie-dialog, .cookie-error { padding: var(--space-20); }

/* The card: bottom right, one title, one line, two buttons, and the dog cropped
   by the card's bottom and right edges. Fixed width so the forced line break in
   the sentence lands the same everywhere; on a phone it shrinks to the viewport
   minus the gutters. */
.cookie-banner { position: fixed; right: calc(16px + var(--xm-gutter, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: calc(var(--z-top) + 2); width: min(340px, calc(100vw - 32px)); padding: var(--space-12) var(--space-16); overflow: hidden; transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.cookie-banner.leaving { opacity: 0; transform: translateY(8px); pointer-events: none; }
.cookie-title { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-semibold); letter-spacing: var(--ls-tight-1); line-height: var(--lh-tight); }
.cookie-line { margin: var(--space-4) 0 0; min-height: 34px; color: var(--text-2); font-size: var(--fs-sub); line-height: var(--lh-snug); white-space: nowrap; }
.cookie-line a { color: inherit; text-decoration: underline dotted; text-decoration-color: var(--muted-2); text-underline-offset: 3px; }
.cookie-line a:hover { color: var(--text); text-decoration-style: solid; }
.cookie-banner .cookie-actions { margin-top: var(--space-16); }
/* Accept is .btn .btn-primary .btn-sm, Essentials only .btn .btn-ghost .btn-sm
   (sm0o.22, F1): the page sets only the 32px floor. */
.cookie-banner .cookie-actions button { min-height: 32px; }
.cookie-art { position: absolute; right: -12px; bottom: -2px; width: 144px; height: auto; pointer-events: none; user-select: none; }

.cookie-dialog p { margin: 0 0 var(--space-16); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: var(--space-8); }
/* The dialog's three are .btn .btn-ghost, equally prominent (ADR-078; sm0o.22, F2):
   the page sets only the 44px touch floor. */
.cookie-dialog .cookie-actions button { min-height: 44px; }
[data-cookie-settings]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cookie-dialog a { color: var(--accent); text-decoration: underline; }
.cookie-dialog { width: min(540px, calc(100% - 32px)); max-height: calc(100% - 48px); overflow-y: auto; }
.cookie-dialog::backdrop { background: color-mix(in srgb, var(--text) 33%, transparent); }
.cookie-dialog h2 { font-size: var(--fs-figure); margin: 0 0 var(--space-16); }
.cookie-dialog label { display: flex; gap: var(--space-8); align-items: center; font-weight: var(--fw-semibold); margin-bottom: var(--space-8); }
.cookie-error { position: fixed; z-index: calc(var(--z-top) + 3); bottom: 16px; left: 16px; right: 16px; }
/* Cookie settings beside the legal links is .btn-link (sm0o.22, F5): it keeps the
   links' ink and underline offset. */
.legal-links .btn-link, .foot .btn-link { color: inherit; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .cookie-banner { transition: none; } }

/* The card is fixed, so it hides whatever sits under it at the bottom of the
   page. While it shows, the page gets that much room underneath (card height at
   the narrowest width, two-line title and line included, plus its 16px gutters),
   so every control and legal link can be scrolled clear of it. A choice, or the
   fade that follows it, takes the room away again. Phones only: from 721px up
   the card sits in the corner clear of the centred auth card. */
@media (max-width: 720px) {
  body:has(.cookie-banner:not([hidden], .leaving)) { --cookie-banner-room: 150px; padding-bottom: calc(var(--cookie-banner-room) + env(safe-area-inset-bottom, 0px)); }
}
