/* Clepher Consent banner */
.clepher-consent {
  --cc-bg: #ffffff;
  --cc-fg: #111827;
  --cc-muted: #4b5563;
  --cc-border: #d1d5db;
  --cc-link: #1d4ed8;
  --cc-btn-bg: #1e40af;
  --cc-btn-fg: #ffffff;
  --cc-focus: #1d4ed8;
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 2147483647;
  box-sizing: border-box;
  width: 420px;
  max-width: 100vw;
  padding: 16px;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cc-fg);
  outline: none;
  /* The wrapper's empty padding must not block clicks on the page or the chat bubble. */
  pointer-events: none;
}

.clepher-consent .cc-card {
  pointer-events: auto;
}

.clepher-consent[hidden],
.clepher-consent [hidden] {
  display: none !important;
}

.clepher-consent *,
.clepher-consent *::before,
.clepher-consent *::after {
  box-sizing: border-box;
}

.clepher-consent .cc-card {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  background: var(--cc-bg);
  color: var(--cc-fg);
  border: 1px solid var(--cc-border);
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.clepher-consent .cc-title {
  margin: 0 0 6px;
  padding: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--cc-fg);
}

.clepher-consent .cc-body,
.clepher-consent .cc-links {
  margin: 0 0 10px;
  padding: 0;
  font-size: 15px;
  color: var(--cc-fg);
}

.clepher-consent .cc-links a {
  margin-right: 14px;
  color: var(--cc-link);
  text-decoration: underline;
}

.clepher-consent .cc-prefs {
  margin: 0 0 12px;
  padding: 0;
  border-top: 1px solid var(--cc-border);
}

.clepher-consent .cc-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--cc-border);
  cursor: pointer;
}

/* The theme forces checkboxes to width: 100% !important, so these rules must win. */
.clepher-consent .cc-row input[type="checkbox"] {
  display: inline-block !important;
  flex: 0 0 20px !important;
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  float: none !important;
  position: static !important;
  accent-color: var(--cc-btn-bg);
}

.clepher-consent .cc-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.clepher-consent .cc-label strong {
  display: block;
  font-weight: 600;
}

.clepher-consent .cc-desc {
  display: block;
  font-size: 14px;
  color: var(--cc-muted);
}

.clepher-consent .cc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* All three buttons share one style on purpose: Reject is not weaker than Accept. */
.clepher-consent .cc-btn {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  color: var(--cc-btn-fg);
  background: var(--cc-btn-bg);
  border: 2px solid var(--cc-btn-bg);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: none;
}

.clepher-consent .cc-btn:hover {
  filter: brightness(1.12);
}

.clepher-consent a:focus-visible,
.clepher-consent .cc-btn:focus-visible,
.clepher-consent input:focus-visible {
  outline: 3px solid var(--cc-focus);
  outline-offset: 2px;
}

/* The dialog itself takes focus when it opens; no ring around the whole card. */
.clepher-consent:focus,
.clepher-consent:focus-visible {
  outline: none;
}

@media (max-width: 480px) {
  .clepher-consent {
    width: 100%;
    padding: 8px 8px 84px;
  }

  .clepher-consent .cc-card {
    max-height: calc(100vh - 92px);
    max-height: calc(100dvh - 92px);
  }

  .clepher-consent .cc-btn {
    padding: 10px 8px;
  }
}

@media (prefers-color-scheme: dark) {
  .clepher-consent {
    --cc-bg: #111827;
    --cc-fg: #f3f4f6;
    --cc-muted: #cbd5e1;
    --cc-border: #374151;
    --cc-link: #93c5fd;
    --cc-btn-bg: #93c5fd;
    --cc-btn-fg: #0b1220;
    --cc-focus: #bfdbfe;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .clepher-consent {
    animation: clepher-consent-in 0.25s ease-out;
  }

  @keyframes clepher-consent-in {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
