#okdak-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  background: rgba(9, 9, 11, 0.97);
  border-top: 1px solid rgba(var(--okdak-accent-rgb), 0.28);
  backdrop-filter: blur(12px);
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  animation: okdak-cookie-slide-up 0.35s ease;
}

/* Sous le gate communauté — ne pas empiler deux overlays */
body.okdak-community-gated #okdak-cookie-banner {
  display: none;
}

/* Sous la messagerie / notifs — sinon flou cookies au premier plan (z 99998) */
body.okdak-top-sheet-open #okdak-cookie-banner,
body.okdak-top-sheet-open .okdak-cookie-overlay,
body.okdak-top-sheet-open .okdak-cookie-panel {
  display: none !important;
}

@keyframes okdak-cookie-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes okdak-cookie-slide-down {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100%); opacity: 0; }
}

#okdak-cookie-banner.is-leaving {
  animation: okdak-cookie-slide-down 0.3s ease forwards;
  pointer-events: none;
}

.okdak-cookie-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.okdak-cookie-banner__text {
  margin: 0;
  flex: 1 1 280px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #e4e4e7;
}

.okdak-cookie-banner__text a {
  color: var(--okdak-accent);
}

.okdak-cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.okdak-cookie-btn {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 44px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
}

.okdak-cookie-btn--primary {
  background: var(--okdak-accent);
  color: #09090b;
}

.okdak-cookie-btn--ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #f2f2f8;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.okdak-cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999;
}

.okdak-cookie-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100000;
  width: min(440px, calc(100vw - 32px));
  background: #18181b;
  color: #e4e4e7;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(var(--okdak-accent-rgb), 0.22);
}

.okdak-cookie-panel h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.okdak-cookie-panel__intro {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: #aaa;
}

.okdak-cookie-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.okdak-cookie-option span {
  color: #999;
  font-size: 0.78rem;
}

.okdak-cookie-option--toggle {
  cursor: pointer;
}

.okdak-cookie-badge {
  font-size: 0.72rem;
  background: rgba(var(--okdak-accent-rgb), 0.18);
  color: var(--okdak-accent);
  padding: 4px 8px;
  border-radius: 999px;
}

.okdak-cookie-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 600px) {
  #okdak-cookie-banner {
    padding: 12px 14px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .okdak-cookie-banner__inner {
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .okdak-cookie-banner__text {
    flex: 1 1 auto;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .okdak-cookie-banner__text a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.15rem 0;
  }

  .okdak-cookie-banner__actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .okdak-cookie-btn {
    flex: none;
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  .okdak-cookie-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-height: min(85dvh, 640px);
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px max(20px, env(safe-area-inset-bottom, 0px));
  }

  .okdak-cookie-panel__actions {
    flex-direction: column;
  }

  .okdak-cookie-panel__actions .okdak-cookie-btn {
    width: 100%;
  }
}

html[data-okdak-theme="light"] #okdak-cookie-banner,
body.light-theme #okdak-cookie-banner {
  background: rgba(244, 244, 245, 0.97);
  border-top-color: rgba(9, 9, 11, 0.12);
}

html[data-okdak-theme="light"] .okdak-cookie-banner__text,
body.light-theme .okdak-cookie-banner__text {
  color: #09090b;
}

html[data-okdak-theme="light"] .okdak-cookie-banner__text a,
body.light-theme .okdak-cookie-banner__text a {
  color: var(--okdak-accent-muted);
}

html[data-okdak-theme="light"] .okdak-cookie-btn--primary,
body.light-theme .okdak-cookie-btn--primary {
  background: var(--okdak-accent-muted);
  color: #fff;
}

html[data-okdak-theme="light"] .okdak-cookie-btn--ghost,
body.light-theme .okdak-cookie-btn--ghost {
  background: rgba(9, 9, 11, 0.06);
  color: #09090b;
  border-color: rgba(9, 9, 11, 0.14);
}

html[data-okdak-theme="light"] .okdak-cookie-panel,
body.light-theme .okdak-cookie-panel {
  background: #fafafa;
  color: #09090b;
  border-color: rgba(9, 9, 11, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

html[data-okdak-theme="light"] .okdak-cookie-panel__intro,
body.light-theme .okdak-cookie-panel__intro,
html[data-okdak-theme="light"] .okdak-cookie-option span,
body.light-theme .okdak-cookie-option span {
  color: rgba(9, 9, 11, 0.62);
}

html[data-okdak-theme="light"] .okdak-cookie-badge,
body.light-theme .okdak-cookie-badge {
  background: rgba(var(--okdak-accent-deep-rgb), 0.16);
  color: var(--okdak-accent-muted);
}
