.site-preferences-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: rgba(0, 0, 0, 0.9);
}

.site-preferences-text {
  margin: 0;
  color: rgba(0, 0, 0, 0.82);
  font-size: 0.95rem;
  line-height: 1.25rem;
}

.site-preferences-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.site-preferences-actions .btn,
.site-preferences-card__footer .btn {
  padding: 0.25rem 0.5rem !important;
  border-radius: 10px;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
}

.site-preferences-policy-link {
  color: rgba(0, 0, 0, 0.82);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-preferences-policy-link:hover {
  color: rgba(0, 0, 0, 0.95);
}

.footer-site-pref,
.footer-site-pref a {
  display: inline !important;
  white-space: nowrap;
}

.site-pref-link {
  color: rgba(0, 0, 0, 0.9) !important;
  text-decoration: none !important;
}

.site-pref-link:hover,
.site-pref-link:focus {
  text-decoration: none !important;
}

.site-preferences-card {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  color: #111;
  background: none;
}

.site-preferences-card[hidden] {
  display: none !important;
}

.site-preferences-card__panel {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  color: #111;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.site-preferences-card__header,
.site-preferences-card__footer {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.site-preferences-card__header {
  border-bottom: 1px solid #e4e7ec;
}

.site-preferences-card__footer {
  justify-content: flex-end;
  border-top: 1px solid #e4e7ec;
}

.site-preferences-card__title {
  margin: 0;
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.site-preferences-card__close {
  width: 32px;
  height: 32px;
  padding: 0;
  color: inherit;
  line-height: 1;
  background: transparent;
  border: 0;
}

.site-preferences-card__body {
  padding: 16px;
  overflow-y: auto;
}

.site-preferences-card .form-check-input:checked {
  background-color: #8b5cdc !important;
  border-color: #8b5cdc !important;
}

.site-preferences-card .form-check-input:focus {
  border-color: #8b5cdc !important;
  box-shadow: 0 0 0 0.25rem rgba(139, 92, 220, 0.25) !important;
}

.site-preferences-category {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.14);
}

.site-preferences-category:last-child {
  border-bottom: 0;
}

.site-preferences-category-title {
  font-weight: 600;
}

.site-preferences-category-desc {
  margin-top: 2px;
  font-size: 0.9rem;
  opacity: 0.8;
}

body.dark-mode .site-preferences-bar,
body.dark-mode .site-preferences-bar .site-preferences-text,
body.dark-mode .site-preferences-bar .site-preferences-text * {
  color: rgba(255, 255, 255, 0.95) !important;
}

body.dark-mode .site-preferences-bar {
  background: rgba(20, 20, 20, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

body.dark-mode .site-preferences-bar #sitePrefsAcceptAll {
  color: #fff !important;
  font-weight: 700;
  background: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
}

body.dark-mode .site-preferences-bar #sitePrefsAcceptAll:hover,
body.dark-mode .site-preferences-bar #sitePrefsAcceptAll:focus {
  color: #fff !important;
  background: #7c3aed !important;
  border-color: #7c3aed !important;
}

body.dark-mode .site-preferences-policy-link,
body.dark-mode .site-pref-link {
  color: rgba(255, 255, 255, 0.95) !important;
}

body.dark-mode .site-preferences-card__panel {
  color: #fff;
  background: #1a1a1a;
  border-color: #404040;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

body.dark-mode .site-preferences-card__header,
body.dark-mode .site-preferences-card__footer {
  border-color: #404040;
}

body.dark-mode .site-preferences-category {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body:not(.dark-mode) .site-preferences-bar .btn.btn-outline-light,
body:not(.dark-mode) .site-preferences-card .btn.btn-outline-light {
  color: rgba(0, 0, 0, 0.88) !important;
  background: transparent !important;
  border-color: rgba(0, 0, 0, 0.28) !important;
}

body:not(.dark-mode) .site-preferences-bar .btn.btn-light,
body:not(.dark-mode) .site-preferences-card .btn.btn-light {
  color: #fff !important;
  background: #111 !important;
  border-color: #111 !important;
}

@media (max-width: 576px) {
  .site-preferences-bar {
    right: 10px;
    bottom: 10px;
    left: 10px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .site-preferences-actions {
    justify-content: center;
  }

  .site-preferences-card {
    padding: 10px;
  }

  .site-preferences-card__footer {
    flex-wrap: wrap;
  }
}
