/* Cookie notice and consent dialog, shared by the public pages and the guide.
   The palette is self-contained: it follows data-theme when a page sets it (the
   guide), otherwise the system scheme, like the public pages. */
.consent {
  --c-surface: #181b1f;
  --c-alt: #15181b;
  --c-rule: #272c31;
  --c-rule-strong: #3a4147;
  --c-text: #d5d9dc;
  --c-strong: #f3f4f5;
  --c-muted: #9ba3aa;
  --c-faint: #858e95;
  --c-link: #5eead4;
  --c-accent: #5eead4;
  --c-on-accent: #06201d;
  --c-shadow: #000000;
  --c-focus: #5eead4;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .consent {
    --c-surface: #ffffff;
    --c-alt: #eceff1;
    --c-rule: #dde1e4;
    --c-rule-strong: #c2c8cd;
    --c-text: #262c31;
    --c-strong: #0d1114;
    --c-muted: #525b63;
    --c-faint: #5c656d;
    --c-link: #0b6b64;
    --c-accent: #0f766e;
    --c-on-accent: #ffffff;
    --c-shadow: #0d1114;
    --c-focus: #0f766e;
  }
}
:root[data-theme="light"] .consent {
  --c-surface: #ffffff;
  --c-alt: #eceff1;
  --c-rule: #dde1e4;
  --c-rule-strong: #c2c8cd;
  --c-text: #262c31;
  --c-strong: #0d1114;
  --c-muted: #525b63;
  --c-faint: #5c656d;
  --c-link: #0b6b64;
  --c-accent: #0f766e;
  --c-on-accent: #ffffff;
  --c-shadow: #0d1114;
  --c-focus: #0f766e;
}

.consent {
  box-sizing: border-box;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 20px 20px 18px;
  overflow-y: auto;
  border: 1px solid var(--c-rule-strong);
  border-radius: 8px;
  background: var(--c-surface);
  box-shadow: 0 18px 50px -12px color-mix(in srgb, var(--c-shadow) 45%, transparent);
  color: var(--c-text);
  font: 14px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  text-align: left;
}
.consent *, .consent *::before, .consent *::after { box-sizing: border-box; }
.consent :focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.consent-panel { position: fixed; inset: auto auto 24px 24px; z-index: 90; }
.consent-modal { width: min(520px, calc(100vw - 32px)); margin: auto; padding: 28px 28px 24px; }
.consent-modal::backdrop { background: color-mix(in srgb, #000000 55%, transparent); backdrop-filter: blur(2px); }
html.consent-open { overflow: hidden; }
.consent h2 { max-width: none; margin: 0 36px 8px 0; color: var(--c-strong); font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: 0; outline: none; }
.consent-modal h2 { font-size: 19px; }
.consent p { margin: 0; color: var(--c-muted); }
.consent p a { color: var(--c-link); text-underline-offset: 3px; }
.consent-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--c-muted); cursor: pointer; }
.consent-close:hover { background: var(--c-alt); color: var(--c-strong); }
.consent-close svg { width: 16px; height: 16px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.consent-btn { flex: 1 1 0; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; }
.consent-modal .consent-btn { height: 42px; font-size: 15px; }
.consent-btn:only-child { flex: 0 0 auto; min-width: 104px; }
.consent-choice { border-color: var(--c-rule-strong); background: var(--c-alt); color: var(--c-strong); }
.consent-choice:hover { border-color: var(--c-text); }
.consent-more { flex: 1 1 100%; height: 32px; border: 0; background: none; color: var(--c-muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.consent-modal .consent-more { height: 32px; font-size: 14px; }
.consent-more:hover { color: var(--c-strong); }
.consent-categories { margin: 14px 0 0; padding: 0; border-top: 1px solid var(--c-rule); list-style: none; }
.consent-categories li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--c-rule); }
.consent-categories strong, .consent-categories label { color: var(--c-strong); font-weight: 600; }
.consent-categories span { grid-column: 1; color: var(--c-muted); font-size: 13px; }
.consent-categories .state { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--c-faint); font-size: 13px; white-space: nowrap; }
.consent-switch { grid-column: 2; grid-row: 1 / span 2; align-self: center; position: relative; width: 40px; height: 22px; margin: 0; appearance: none; -webkit-appearance: none; border: 1px solid var(--c-rule-strong); border-radius: 999px; background: var(--c-alt); cursor: pointer; transition: background-color .15s, border-color .15s; }
.consent-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--c-muted); transition: transform .15s, background-color .15s; }
.consent-switch:checked { border-color: var(--c-accent); background: var(--c-accent); }
.consent-switch:checked::after { transform: translateX(18px); background: var(--c-on-accent); }

@media (max-width: 600px) {
  .consent-panel { inset: auto auto 16px 16px; }
  .consent-modal { padding: 22px 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .consent-switch, .consent-switch::after { transition: none; }
}
@media print {
  .consent { display: none; }
}
