/* ============================================================
   COOKIE CONSENT — banner, preferences dialog, consent receipt
   and settings button. Uses the design tokens from tokens.css only.
   (The Cookie Policy page now uses the shared legal page styles.)
============================================================ */

html.ck-lock { overflow: hidden; }

.ck [hidden] { display: none !important; }

/* ── Banner ── */
.ck__banner {
  position: fixed; left: clamp(12px, 2vw, 24px); bottom: clamp(12px, 2vw, 24px); z-index: 260;
  width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto;
  padding: clamp(22px, 3vw, 30px);
  color: var(--white); background: var(--ink);
  background-image: radial-gradient(420px 260px at 100% 0%, rgba(var(--accent-rgb), .34), transparent 62%);
  border: 1px solid var(--line-light); border-top: 3px solid var(--accent-blue);
  box-shadow: 0 30px 70px rgba(var(--black-rgb), .45);
  animation: ck-in .5s var(--ease) both;
}
.ck__eyebrow { margin: 0 0 8px; font: 500 11px var(--font-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--accent-soft); }
.ck__title { margin: 0 0 12px; font-size: 22px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
.ck__text { margin: 0 0 12px; font-size: 14.5px; line-height: 1.7; color: rgba(var(--white-rgb), .74); }
.ck__law { margin: 0 0 12px; font-size: 12.5px; line-height: 1.6; color: rgba(var(--white-rgb), .5); }
.ck__links { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 20px; font-size: 13px; color: rgba(var(--white-rgb), .5); }
.ck__links a { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; }
.ck__links a:hover { color: var(--white); }

.ck__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ck__btn--wide { grid-column: 1 / -1; }

/* ── Buttons ── */
.ck__btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 16px;
  font: 600 13.5px/1.2 var(--font-body); text-align: center; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius);
  transition: background .2s, color .2s, border-color .2s;
}
.ck__btn:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.ck__btn--solid { color: var(--ink); background: var(--white); }
.ck__btn--solid:hover { background: var(--accent-soft); }
.ck__btn--ghost { color: var(--white); background: transparent; border-color: rgba(var(--white-rgb), .3); }
.ck__btn--ghost:hover { background: rgba(var(--white-rgb), .08); border-color: rgba(var(--white-rgb), .55); }

.ck__btn--dark { color: var(--white); background: var(--ink); }
.ck__btn--dark:hover { background: var(--accent); }
.ck__btn--outline { color: var(--text); background: var(--white); border-color: var(--field-border); }
.ck__btn--outline:hover { border-color: var(--accent); color: var(--accent); }

/* ── Preferences dialog ── */
.ck__overlay {
  position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  background: rgba(var(--ink-rgb), .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: ck-fade .3s var(--ease) both;
}
.ck__dialog {
  display: flex; flex-direction: column; width: 100%; max-width: 720px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  color: var(--text); background: var(--white); border-top: 3px solid var(--accent-blue);
  outline: 0; animation: ck-in .45s var(--ease) both;
}
.ck__dhead { flex-shrink: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--line-dark); }
.ck__dhead .ck__eyebrow { color: var(--accent); }
.ck__dtitle { margin: 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.ck__close {
  display: grid; place-items: center; flex-shrink: 0; width: var(--control-h); height: var(--control-h);
  color: var(--text); background: none; border: 1px solid var(--line-dark); border-radius: var(--radius); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.ck__close:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.ck__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ck__dbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: 16px; }
.ck__intro { margin: 0; font-size: 15px; line-height: 1.75; color: var(--muted); }
.ck__intro a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.ck__cat { padding: 20px; background: var(--paper); border: 1px solid var(--line-dark); }
.ck__cat--off { background: transparent; border-style: dashed; }
.ck__cathead { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.ck__cathead h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.ck__cathead p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); }
.ck__always, .ck__off { flex-shrink: 0; padding-top: 2px; font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.ck__always { color: var(--accent); }
.ck__off { color: var(--subtle); }

.ck__more { margin-top: 14px; }
.ck__more summary { cursor: pointer; font: 500 12px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.ck__more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ck__tablewrap { margin-top: 12px; overflow-x: auto; }

.ck__table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--white); }
.ck__table th, .ck__table td { padding: 10px 12px; text-align: left; vertical-align: top; border: 1px solid var(--line-dark); }
.ck__table th { font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); background: var(--paper); }
.ck__table td:first-child { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
.ck__table td { color: var(--muted); }

.ck__gpc { margin: 0; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; color: var(--text); background: rgba(var(--accent-rgb), .07); border-left: 3px solid var(--accent); }

/* ── Consent receipt ── */
.ck__receipt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 14px 16px;
  font: 400 12px/1.5 var(--font-mono); color: var(--muted);
  background: var(--white); border: 1px solid var(--line-dark);
}
.ck__receipt code { font: 500 12px var(--font-mono); color: var(--text); word-break: break-all; }
.ck__copy {
  margin-left: auto; padding: 7px 12px; cursor: pointer;
  font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text);
  background: none; border: 1px solid var(--line-dark); border-radius: var(--radius);
  transition: background .2s, color .2s, border-color .2s;
}
.ck__copy:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.ck__copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ck__dfoot { flex-shrink: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 18px clamp(20px, 3vw, 32px); border-top: 1px solid var(--line-dark); background: var(--white); }

/* ── Switch ── */
.ck__switch { position: relative; flex-shrink: 0; display: inline-block; width: 52px; height: 28px; margin-top: 2px; }
.ck__switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ck__track { position: absolute; inset: 0; background: var(--silver); border-radius: 28px; transition: background .25s; }
.ck__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: var(--white); border-radius: 50%; box-shadow: 0 1px 4px rgba(var(--black-rgb), .3); transition: transform .25s var(--ease); }
.ck__switch input:checked + .ck__track { background: var(--accent); }
.ck__switch input:checked + .ck__track::after { transform: translateX(24px); }
.ck__switch input:focus-visible + .ck__track { outline: 2px solid var(--accent-blue); outline-offset: 3px; }

.ck__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Settings button ── */
.ck__fab {
  position: fixed; left: clamp(12px, 2vw, 24px); bottom: clamp(12px, 2vw, 24px); z-index: 240;
  display: grid; place-items: center; width: 44px; height: 44px;
  color: var(--white); background: var(--ink); border: 1px solid var(--line-light); border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(var(--black-rgb), .35); cursor: pointer;
  transition: background .2s, transform .2s var(--ease);
}
.ck__fab:hover { background: var(--accent); transform: translateY(-2px); }
.ck__fab:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }
.ck__fab .material-icons-round { font-size: 22px; }

/* ── Animations ── */
@keyframes ck-in   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ck-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ck__banner, .ck__overlay, .ck__dialog { animation: none; }
  .ck__fab, .ck__track, .ck__track::after { transition: none; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .ck__banner { left: 0; right: 0; bottom: 0; width: 100%; max-height: 88dvh; border-left: 0; border-right: 0; border-bottom: 0; }
  .ck__overlay { align-items: flex-end; padding: 0; }
  .ck__dialog { max-width: none; max-height: 94dvh; }
  .ck__dfoot { grid-template-columns: 1fr; }
  .ck__cathead { flex-direction: column; gap: 12px; }
  .ck__copy { margin-left: 0; }
}
@media (max-width: 380px) {
  .ck__actions { grid-template-columns: 1fr; }
}