.ccm-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  color: var(--text);
  padding: 16px;
  z-index: 99998;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 -10px 30px rgba(0,0,0,.25);
}

.ccm-banner.ccm-visible {
  opacity: 1;
}

/* slide vs fade */
.ccm-banner.ccm-anim-slide.ccm-visible {
  transform: translateY(0);
}

.ccm-banner.ccm-anim-fade {
  transform: translateY(0);
}

.ccm-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.ccm-msg {
  margin: 0 0 12px;
}

.ccm-link {
  color: var(--link);
  text-decoration: underline;
}

.ccm-link:hover {
  color: var(--linkh);
}

.ccm-link:visited {
  color: var(--linkv);
}

.ccm-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ccm-buttons.align-left {
  justify-content: flex-start;
}

.ccm-buttons.align-center {
  justify-content: center;
}

.ccm-buttons.align-right {
  justify-content: flex-end;
}

.ccm-btn {
  padding: 12px 16px;
  border-radius: 8px;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  flex: 1 0 0;
  max-width: 200px;
  font-weight: 600;
  text-align: center;
}

.ccm-accept { background: var(--accept); }
.ccm-reject { background: var(--reject); }
.ccm-prefs  { background: var(--prefs); }
.ccm-save   { background: var(--save); }

/* Modal */

.ccm-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ccm-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.ccm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.7);
}

.ccm-modal-dialog {
  position: relative;
  background: #0b1220;
  color: #e5e7eb;
  padding: 20px 20px 16px;
  border-radius: 16px;
  width: min(560px, 94vw);
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.ccm-modal.is-open .ccm-modal-dialog {
  transform: translateY(0);
}

.ccm-modal h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.ccm-modal p {
  margin-top: 0;
  margin-bottom: 12px;
}

.ccm-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: transparent;
  color: #9ca3af;
  font-size: 22px;
  cursor: pointer;
}

.ccm-modal-body {
  margin-top: 8px;
}

.ccm-modal-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148,163,184,0.4);
}

.ccm-modal-row:last-child {
  border-bottom: 0;
}

.ccm-modal-footer {
  margin-top: 16px;
  text-align: right;
}

/* Toggle switch */

.ccm-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.ccm-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ccm-switch span {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #6b7280;
  transition: .2s;
  border-radius: 999px;
}

.ccm-switch span:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  transition: .2s;
  border-radius: 999px;
}

.ccm-switch input:checked + span {
  background: #22c55e;
}

.ccm-switch input:checked + span:before {
  transform: translateX(20px);
}

/* Mobile */

@media (max-width: 700px) {
  .ccm-buttons {
    flex-direction: column;
  }
  .ccm-btn {
    max-width: none;
  }
  .ccm-modal-dialog {
    width: min(94vw, 480px);
    padding: 18px 16px 14px;
  }
}

/* Persistent / inline preferences controls */
.ccm-reopen {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 99997;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(15,23,42,.14);
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  color: rgba(15,23,42,.68);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: .72;
  transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
}

.ccm-reopen:hover,
.ccm-reopen:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.13);
}

.ccm-reopen:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.ccm-reopen-icon {
  display: block;
  font-size: 20px;
  line-height: 1;
}

.ccm-screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ccm-inline-preferences {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.ccm-reopen[hidden],
.ccm-banner[hidden],
.ccm-modal[hidden] {
  display: none !important;
}
