/* GDPR cookie consent — compact bottom strip + optional preferences modal */

.ch-gdpr-root {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 99999;
  padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
  font-family: inherit;
  background: transparent;
  max-height: none;
}

/* Thin horizontal bar — small footprint only */
.ch-gdpr-card {
  pointer-events: auto;
  width: min(920px, calc(100% - 0.5rem));
  max-width: 100%;
  max-height: none;
  overflow: visible;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 8px 28px -6px rgba(15, 23, 42, 0.28);
  padding: 0.4rem 0.45rem 0.4rem 0.75rem;
  animation: chGdprIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: space-between;
}

html.dark .ch-gdpr-card {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #1e293b;
  box-shadow: 0 8px 28px -6px rgba(0, 0, 0, 0.55);
}

@keyframes chGdprIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ch-gdpr-main {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.ch-gdpr-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

html.dark .ch-gdpr-icon {
  background: rgba(79, 70, 229, 0.22);
  color: #a5b4fc;
}

.ch-gdpr-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.ch-gdpr-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-gdpr-text {
  margin: 0.05rem 0 0;
  font-size: 0.65rem;
  line-height: 1.25;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

html.dark .ch-gdpr-text { color: #94a3b8; }

.ch-gdpr-links {
  display: none; /* compact bar: hide policy links; available in prefs modal */
}

.ch-gdpr-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  justify-content: flex-end;
  align-items: center;
  margin: 0;
  flex: 0 0 auto;
}

.ch-gdpr-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1.15;
}

.ch-gdpr-btn--ghost {
  background: #f1f5f9;
  color: #334155;
}

html.dark .ch-gdpr-btn--ghost {
  background: #1e293b;
  color: #e2e8f0;
}

.ch-gdpr-btn--link {
  background: transparent;
  color: #4f46e5;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

html.dark .ch-gdpr-btn--link { color: #a5b4fc; }

.ch-gdpr-btn--primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.35);
}

.ch-gdpr-btn--danger {
  background: #f1f5f9;
  color: #475569;
}

html.dark .ch-gdpr-btn--danger {
  background: #1e293b;
  color: #cbd5e1;
}

.ch-gdpr-btn:hover { filter: brightness(0.97); }

/* —— Preferences modal (only after Preferences click) —— */
.ch-gdpr-root--modal {
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.ch-gdpr-modal {
  pointer-events: auto;
  width: min(420px, 100%);
  max-height: min(86vh, 560px);
  overflow: auto;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.4);
  padding: 1rem 1.05rem 1rem;
  animation: chGdprModalIn 0.22s ease-out;
}

html.dark .ch-gdpr-modal {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #1e293b;
}

@keyframes chGdprModalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ch-gdpr-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.ch-gdpr-modal-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ch-gdpr-modal-head p {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #64748b;
}

html.dark .ch-gdpr-modal-head p { color: #94a3b8; }

.ch-gdpr-close {
  border: 0;
  background: #f1f5f9;
  color: #475569;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

html.dark .ch-gdpr-close {
  background: #1e293b;
  color: #e2e8f0;
}

.ch-gdpr-prefs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  margin: 0.5rem 0 0.75rem;
}

.ch-gdpr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  background: #f8fafc;
  font-size: 0.78rem;
  cursor: pointer;
}

html.dark .ch-gdpr-row { background: #020617; }

.ch-gdpr-row small {
  display: block;
  color: #94a3b8;
  font-size: 0.65rem;
  margin-top: 2px;
  font-weight: 500;
}

.ch-gdpr-row input { width: 1rem; height: 1rem; accent-color: #4f46e5; }

.ch-gdpr-modal-links {
  margin: 0 0 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.ch-gdpr-modal-links a {
  color: #4f46e5;
  text-decoration: none;
}

.ch-gdpr-modal-links a:hover { text-decoration: underline; }
html.dark .ch-gdpr-modal-links a { color: #a5b4fc; }

.ch-gdpr-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

/* Mobile: pill becomes slightly taller, stack actions */
@media (max-width: 640px) {
  .ch-gdpr-card {
    border-radius: 0.85rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.55rem;
    gap: 0.4rem;
  }
  .ch-gdpr-text {
    max-width: none;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .ch-gdpr-title { white-space: normal; }
  .ch-gdpr-actions {
    width: 100%;
    justify-content: stretch;
  }
  .ch-gdpr-actions .ch-gdpr-btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .ch-gdpr-btn--link {
    flex: 0 0 auto;
  }
}

.ch-gdpr-manage {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.85;
  padding: 0;
}
.ch-gdpr-manage:hover { opacity: 1; }
.ch-gdpr-manage-wrap { display: inline-flex; margin-left: 0.75rem; }

/* Legal page prose */
.ch-legal-prose {
  max-width: 48rem;
  margin: 0 auto;
  line-height: 1.7;
  color: #334155;
  font-size: 0.95rem;
}
html.dark .ch-legal-prose { color: #cbd5e1; }
.ch-legal-prose h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
html.dark .ch-legal-prose h2 { color: #f1f5f9; }
.ch-legal-prose h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 800;
}
.ch-legal-prose ul, .ch-legal-prose ol {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}
.ch-legal-prose li { margin: 0.35rem 0; }
.ch-legal-prose a { color: #4f46e5; font-weight: 600; }
.ch-legal-prose p { margin: 0.75rem 0; }
