/* Zeitgeist Insight — cookie consent UI. Uses the Pick Me Up design-system
   tokens (loaded via /ds/tokens/*.css). .zi- prefixed to avoid collisions. */

.zi-noscroll { overflow: hidden; }

/* ---------- Banner ---------- */
.zi-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 160%);
  width: min(700px, calc(100% - 32px));
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 18px 20px;
  z-index: 2147483000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  font-family: var(--font-text);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.zi-banner--show { transform: translate(-50%, 0); }
.zi-banner__text { flex: 1 1 320px; font-size: 14px; line-height: 1.5; color: var(--color-text-muted); }
.zi-banner__text a { color: var(--color-primary); }
.zi-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Buttons (match DS Button) ---------- */
.zi-btn {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide);
  border-radius: var(--radius-pill);
  padding: 0 18px;
  height: 42px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.zi-btn--primary { background: var(--color-primary); color: var(--on-primary); }
.zi-btn--primary:hover { filter: brightness(0.94); }
.zi-btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.zi-btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.zi-btn--link { background: none; border: 0; color: var(--color-text-muted); text-decoration: underline; padding: 0 8px; height: 42px; }
.zi-btn--link:hover { color: var(--color-primary); }

/* ---------- Preferences modal ---------- */
.zi-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  background: rgba(6, 10, 12, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.zi-modal[hidden] { display: none; }
.zi-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: clamp(20px, 4vw, 32px);
  font-family: var(--font-text);
  box-shadow: var(--shadow-lg);
}
.zi-modal__x {
  position: absolute; top: 14px; right: 16px;
  background: none; border: 0; font-size: 24px; line-height: 1;
  color: var(--color-text-muted); cursor: pointer;
}
.zi-modal__x:hover { color: var(--color-text); }
.zi-modal__title { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.zi-modal__lede { margin: 0 0 20px; color: var(--color-text-muted); font-size: 15px; line-height: 1.55; }
.zi-modal__lede a { color: var(--color-primary); }
.zi-modal__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 24px; }

.zi-row { padding: 16px 0; border-top: 1px solid var(--color-border); }
.zi-row__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.zi-row__head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--color-text); }
.zi-row__desc { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--color-text-muted); }
.zi-row__always { font-size: 12px; color: var(--color-primary); font-weight: 600; }

/* Toggle switch */
.zi-switch { position: relative; display: inline-flex; width: 44px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.zi-switch--locked { cursor: default; opacity: 0.7; }
.zi-switch__input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: inherit; }
.zi-switch__track { position: absolute; inset: 0; border-radius: 999px; background: var(--color-surface-alt); border: 1px solid var(--color-border); transition: background 0.2s, border-color 0.2s; }
.zi-switch__track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--color-text-muted); box-shadow: 0 1px 3px rgba(0,0,0,0.4); transition: transform 0.2s, background 0.2s;
}
.zi-switch__input:checked + .zi-switch__track { background: var(--color-primary); border-color: var(--color-primary); }
.zi-switch__input:checked + .zi-switch__track::after { transform: translateX(20px); background: var(--on-primary); }
.zi-switch__input:focus-visible + .zi-switch__track { outline: 2px solid var(--color-primary); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .zi-banner, .zi-btn, .zi-switch__track, .zi-switch__track::after { transition: none; }
}
