/* Consent banner and preferences panel (privacy/consent.js). Loaded next to the page's own stylesheet (style.css in the
   app, landing/landing.css on /privacy/) and built only from that page's tokens, so light and dark follow the page.
   The three first-layer buttons share one style on purpose: no option is made more prominent than another. */
.cst, .cst-panel {
  --cst-bg: var(--card);
  --cst-act: var(--ink-2);
  --cst-focus: var(--focus);
  --cst-gap: 12px;
}
.cst {
  position: fixed; z-index: 20; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; max-width: 640px;
  background: var(--cst-bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: var(--shadow-overlay);
  max-height: calc(100vh - 32px); overflow: auto; font-family: var(--font);
}
.cst-in { padding: 16px 20px; }
.cst-h { margin: 0 0 6px; font-size: 17px; line-height: 1.3; }
.cst p { margin: 0 0 var(--cst-gap); font-size: 15px; line-height: 1.5; }
.cst a, .cst-panel a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cst-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* In the banner the choices stay in view while the second layer scrolls. */
.cst .cst-actions { position: sticky; bottom: 0; background: var(--cst-bg); padding: 8px 0 16px; margin-bottom: -16px; }
.cst-btn {
  flex: 1 1 auto; min-height: var(--tap, 44px); padding: 0 16px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  color: var(--ink); background: transparent; border: 1px solid var(--cst-act); border-radius: var(--radius-s);
}
.cst-btn:hover { background: color-mix(in srgb, var(--cst-act) 8%, transparent); }
.cst-btn:focus-visible, .cst-switch:focus-visible, .cst a:focus-visible, .cst-panel a:focus-visible { outline: 3px solid var(--cst-focus); outline-offset: 2px; }
.cst-panel { margin: 0 0 var(--cst-gap); }
.cst-cat { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.cst-cat-text { flex: 1; min-width: 0; }
.cst-cat-h { margin: 0 0 4px; font-size: 15px; line-height: 1.35; }
.cst-cat p { margin: 0 0 4px; font-size: 14px; line-height: 1.5; }
.cst-small { color: var(--muted); font-size: var(--fs-label); }
.cst-panel .cst-status { margin: 12px 0 0; }
.cst-always { flex: none; font-size: var(--fs-label); font-weight: 600; color: var(--muted); padding-top: 2px; }
/* A native checkbox shown as a switch: keyboard, label and screen-reader state come from the input itself. */
.cst-switch {
  flex: none; appearance: none; -webkit-appearance: none; margin: var(--space-0) 0 0; width: 44px; height: 26px; border-radius: var(--radius-pill); cursor: pointer;
  background: var(--line); border: 1.5px solid var(--muted); position: relative; transition: background-color .15s;
}
.cst-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.cst-switch:checked { background: var(--cst-act); border-color: var(--cst-act); }
.cst-switch:checked::after { transform: translateX(18px); background: var(--cst-bg); }
.cst-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Above the phone tab bar in the app. */
@media (max-width: 599px) { body:has(.tabbar:not([hidden])) .cst { bottom: calc(var(--tabbar-h, 56px) + 12px + env(safe-area-inset-bottom)); } }
@media (max-width: 480px) { .cst { left: 8px; right: 8px; bottom: 8px; } .cst-in { padding: 14px 16px; } .cst-btn { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { .cst-switch, .cst-switch::after { transition: none; } }
@media print { .cst { display: none; } }
