/* ================================================================
   DataHints DS — Cookie Consent Component
   Requires: tokens.css
   ================================================================ */

  /* ════════════════════════════════════════════
     SWITCH (from switch.md)
  ════════════════════════════════════════════ */
  .dh-switch-wrap {
    display: inline-flex; align-items: center; gap: var(--sp-3);
    cursor: pointer; user-select: none;
  }
  .dh-switch {
    -webkit-appearance: none; appearance: none;
    width: 40px; height: 22px;
    border-radius: var(--r-pill);
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-s);
    cursor: pointer; position: relative; flex-shrink: 0;
    transition: background var(--ease-fast), border-color var(--ease-fast), box-shadow var(--ease-fast);
  }
  .dh-switch::before {
    content: ''; position: absolute;
    width: 16px; height: 16px;
    border-radius: 50%; background: white;
    top: 50%; left: 1.5px;
    transform: translateY(-50%);
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform var(--ease-fast), background var(--ease-fast);
  }
  .dh-switch-sm { width: 32px; height: 18px; }
  .dh-switch-sm::before { width: 12px; height: 12px; }

  .dh-switch:hover:not(:disabled):not(:checked) { border-color: var(--border-a); }
  .dh-switch:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
  .dh-switch:not(.dh-switch-sm):checked::before { transform: translateY(-50%) translateX(18px); }
  .dh-switch.dh-switch-sm:checked::before       { transform: translateY(-50%) translateX(14px); }
  .dh-switch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-sub); border-color: var(--accent); }
  .dh-switch:checked:focus-visible { box-shadow: 0 0 0 3px var(--accent-sub); border-color: var(--accent-fill); }
  .dh-switch:disabled { cursor: not-allowed; }

  /* ════════════════════════════════════════════
     COOKIE CONSENT BANNER
  ════════════════════════════════════════════ */

  /* ── Fixed live banner ── */
  .dh-cookie {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .dh-cookie[hidden] { display: none; }
  .dh-cookie.is-visible { transform: translateY(0); }

  /* Backdrop */
  .cookie-backdrop {
    position: fixed; inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    z-index: -1; pointer-events: none;
  }
  .dh-cookie.is-open .cookie-backdrop {
    opacity: 1; visibility: visible;
    transition: opacity 0.3s ease;
    pointer-events: auto;
  }

  /* Panel — grid trick for height animation */
  .dh-cookie__panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .dh-cookie.is-open .dh-cookie__panel { grid-template-rows: 1fr; }

  .cookie-panel-inner {
    overflow: hidden;
    background: var(--bg-card);
    border-top: 1px solid var(--border-s);
    border-left: 1px solid var(--border-s);
    border-right: 1px solid var(--border-s);
  }

  .cookie-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border-s); gap: var(--sp-4);
  }
  .cookie-panel-title {
    font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-text);
  }
  .cookie-panel-close {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: var(--r-xs); background: none; border: none;
    color: var(--fg-3); cursor: pointer;
    transition: color var(--ease-fast), background var(--ease-fast);
  }
  .cookie-panel-close svg { width: 16px; height: 16px; }
  .cookie-panel-close:hover { color: var(--fg); background: var(--bg-elevated); }
  .cookie-panel-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .cookie-panel-desc {
    font-size: 0.875rem; line-height: 1.55; color: var(--fg-2);
    padding: var(--sp-4) var(--sp-6); margin: 0;
    border-bottom: 1px solid var(--border-s);
  }

  /* Category list */
  .cookie-cats {
    list-style: none; margin: 0; padding: 0;
    max-height: 300px; overflow-y: auto; overscroll-behavior: contain;
  }
  .cookie-cats::-webkit-scrollbar { width: 4px; }
  .cookie-cats::-webkit-scrollbar-track { background: transparent; }
  .cookie-cats::-webkit-scrollbar-thumb { background: var(--border-s); border-radius: 2px; }

  .cookie-cat {
    padding: var(--sp-4) var(--sp-6);
    border-bottom: 1px solid var(--border);
  }
  .cookie-cat:last-child { border-bottom: none; }

  .cookie-cat__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-4); margin-bottom: var(--sp-2);
  }
  .cookie-cat__meta {
    display: flex; align-items: center; gap: var(--sp-3); flex: 1; min-width: 0;
  }
  .cookie-cat__name {
    font-size: 0.9375rem; font-weight: 600; color: var(--fg-heading);
  }
  .cookie-cat__badge {
    font-family: var(--font-mono); font-size: 0.625rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--mint); background: var(--mint-sub);
    padding: 2px var(--sp-2); border-radius: var(--r-pill); white-space: nowrap;
  }
  .cookie-cat__lock {
    display: flex; align-items: center; color: var(--fg-3); flex-shrink: 0;
  }
  .cookie-cat__lock svg { width: 18px; height: 18px; }

  .cookie-cat__desc {
    font-size: 0.875rem; line-height: 1.55; color: var(--fg-2); margin: 0 0 var(--sp-1);
  }
  .cookie-cat__examples {
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-3);
    margin: 0; line-height: 1.5;
  }

  /* Panel actions */
  .cookie-panel-actions {
    display: flex; align-items: center; justify-content: flex-end;
    gap: var(--sp-3); padding: var(--sp-4) var(--sp-6);
    border-top: 1px solid var(--border-s); flex-wrap: wrap;
  }

  /* Strip */
  .dh-cookie__strip {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-4); padding: var(--sp-4) var(--sp-6);
    background: var(--bg-card); border-top: 1px solid var(--border-s);
    box-shadow: var(--shadow-lg); flex-wrap: wrap;
  }
  .cookie-strip__text {
    font-size: 0.875rem; line-height: 1.5; color: var(--fg-2);
    margin: 0; flex: 1; min-width: 200px;
  }
  .cookie-strip__actions {
    display: flex; align-items: center; gap: var(--sp-2);
    flex-shrink: 0; flex-wrap: wrap;
  }

  /* Link */
  .cookie-link {
    color: var(--accent-text); text-decoration: none; transition: opacity var(--ease-fast);
  }
  .cookie-link:hover { opacity: .75; text-decoration: underline; }
  .cookie-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {
    .dh-cookie, .dh-cookie__panel, .cookie-backdrop { transition: none; }
  }

  /* ════════════════════════════════════════════
     STATIC MOCKUP VARIANTS (not fixed)
     Used to preview strip-only and panel-open
     states without taking over the viewport.
  ════════════════════════════════════════════ */
  .dh-cookie--static {
    position: static !important;
    transform: none !important;
  }
  .dh-cookie--static.is-open .cookie-backdrop { display: none; }
  .dh-cookie--static .dh-cookie__panel { grid-template-rows: 1fr; }
