/* Cookie consent (js/consent.js): a card at the bottom left, a sheet at the bottom on phones. Shown only when
   js/consent-config.js lists services, or with ?consent-preview. "Reject all" and "Accept all" look the same. */
.consent {
  position: fixed; z-index: 60; left: var(--pad); bottom: 20px; width: min(460px, calc(100vw - 2 * var(--pad)));
  max-height: calc(100vh - 120px); overflow: auto; padding: 22px 22px 16px; border-radius: 18px;
  background: var(--nav-solid); color: var(--fg); border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(var(--shadow-rgb), calc(0.55 * var(--shadow-k))), 0 0 0 1px rgba(var(--lav-rgb), 0.08);
}
.consent[hidden], .consent [hidden] { display: none !important; }
.consent h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; padding-right: 36px; outline: none; }
.consent p { margin-top: 8px; font-size: 14px; line-height: 1.55; color: rgba(var(--fg-rgb), 0.78); }
.consent p a { color: var(--accent); font-weight: 600; white-space: nowrap; }
.consent-x {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font: inherit; font-size: 22px; line-height: 1; color: var(--fg); background: none; border: 1px solid var(--line); cursor: pointer;
}
.consent-cats { display: grid; gap: 10px; margin-top: 14px; }
.consent-cat {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(var(--panel-rgb), 0.5);
}
.consent-cat span { font-size: 13px; line-height: 1.45; color: rgba(var(--fg-rgb), 0.72); }
.consent-cat b { display: block; margin-bottom: 2px; font-size: 14px; color: var(--fg); }
.consent-cat small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
/* switches: off by default, the necessary one is on and locked */
.consent-cat input {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 40px; height: 24px; margin: 0; border-radius: 99px;
  background: rgba(var(--fg-rgb), 0.2); cursor: pointer; transition: background 0.2s;
}
.consent-cat input::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--fg); transition: transform 0.2s;
}
.consent-cat input:checked { background: var(--accent); }
.consent-cat input:checked::after { transform: translateX(16px); }
.consent-cat input:disabled { opacity: 0.55; cursor: default; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.consent-btn {
  min-height: 44px; padding: 0 14px; border-radius: 12px; border: 0; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; background: var(--btn-bg); color: var(--btn-fg);
}
.consent-btn:hover { box-shadow: 0 0 0 2px rgba(var(--lav-rgb), 0.45); }
.consent-link {
  grid-column: 1 / -1; justify-self: center; min-height: 44px; padding: 0 12px; cursor: pointer; background: none; border: 0;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
.consent :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.footer-links .consent-open { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.footer-links .consent-open:hover { color: var(--fg); text-decoration: underline; }
@media (max-width: 560px) {
  .consent {
    left: 0; right: 0; bottom: 0; width: auto; max-height: 85vh; border-radius: 18px 18px 0 0; border-bottom: 0;
    padding: 20px var(--pad) calc(12px + env(safe-area-inset-bottom));
  }
  .consent-btn { padding: 0 8px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .consent-cat input, .consent-cat input::after { transition: none; } }
