#consent-banner {
  position: fixed;
  bottom: 20px;
  width: var(--consent-banner-width, 340px);
  padding: 16px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--consent-font-size, 14px);
  z-index: 999999;
  transition: right 0.35s ease, left 0.35s ease, opacity 0.25s ease;
  opacity: 0;
}

/* rechts / links */
#consent-banner.position-right {
  right: -400px;
}

#consent-banner.position-right.show {
  right: 20px;
  opacity: 1;
}

#consent-banner.position-right.hide {
  right: -400px;
  opacity: 0;
}

#consent-banner.position-left {
  left: -400px;
}

#consent-banner.position-left.show {
  left: 20px;
  opacity: 1;
}

#consent-banner.position-left.hide {
  left: -400px;
  opacity: 0;
}

/* versteckt */
#consent-banner.hidden {
  opacity: 0;
}

/* =========================
   Theme-Farben via Klassen
   ========================= */

/* Default (falls nichts gesetzt) -> leicht dunkel */
#consent-banner {
  --consent-bg: #202020ee;
  --consent-text: #f5f5f5;
  --consent-muted: #c7c7c7;
  --consent-border: #3a3a3a;
  --consent-link: #7ab6ff;
  --consent-link-hover: #a5cdff;

  --consent-btn-primary-bg: #0a84ff;
  --consent-btn-primary-text: #ffffff;
  --consent-btn-secondary-bg: #333333;
  --consent-btn-secondary-text: #f5f5f5;
  --consent-btn-ghost-border: #444444;
  --consent-btn-ghost-text: #dddddd;
}

/* Theme: dark */
#consent-banner.theme-dark {
  --consent-bg: #202020ee;
  --consent-text: #f5f5f5;
  --consent-muted: #c7c7c7;
  --consent-border: #3a3a3a;
  --consent-link: #7ab6ff;
  --consent-link-hover: #a5cdff;

  --consent-btn-primary-bg: #0a84ff;
  --consent-btn-primary-text: #ffffff;
  --consent-btn-secondary-bg: #333333;
  --consent-btn-secondary-text: #f5f5f5;
  --consent-btn-ghost-border: #444444;
  --consent-btn-ghost-text: #dddddd;
}

/* Theme: light */
#consent-banner.theme-light {
  --consent-bg: #ffffff;
  --consent-text: #202020;
  --consent-muted: #555555;
  --consent-border: #dddddd;
  --consent-link: #0a84ff;
  --consent-link-hover: #005fcc;

  --consent-btn-primary-bg: #0a84ff;
  --consent-btn-primary-text: #ffffff;
  --consent-btn-secondary-bg: #f0f0f0;
  --consent-btn-secondary-text: #222222;
  --consent-btn-ghost-border: #cccccc;
  --consent-btn-ghost-text: #333333;
}

/* Theme: auto -> Light, bei Dark-Mode-System dunkler */
#consent-banner.theme-auto {
  --consent-bg: #ffffff;
  --consent-text: #202020;
  --consent-muted: #555555;
  --consent-border: #dddddd;
  --consent-link: #0a84ff;
  --consent-link-hover: #005fcc;

  --consent-btn-primary-bg: #0a84ff;
  --consent-btn-primary-text: #ffffff;
  --consent-btn-secondary-bg: #f0f0f0;
  --consent-btn-secondary-text: #222222;
  --consent-btn-ghost-border: #cccccc;
  --consent-btn-ghost-text: #333333;
}

@media (prefers-color-scheme: dark) {
  #consent-banner.theme-auto {
    --consent-bg: #202020ee;
    --consent-text: #f5f5f5;
    --consent-muted: #c7c7c7;
    --consent-border: #3a3a3a;
    --consent-link: #7ab6ff;
    --consent-link-hover: #a5cdff;

    --consent-btn-primary-bg: #0a84ff;
    --consent-btn-primary-text: #ffffff;
    --consent-btn-secondary-bg: #333333;
    --consent-btn-secondary-text: #f5f5f5;
    --consent-btn-ghost-border: #444444;
    --consent-btn-ghost-text: #dddddd;
  }
}

/* Anwendung der Variablen */
#consent-banner {
  background: var(--consent-bg);
  color: var(--consent-text);
  border: 1px solid var(--consent-border);
}

/* =========================
   Inhalt
   ========================= */

#consent-content h3 {
  color: var(--consent-text);
  margin: 0 0 6px;
  font-size: calc(var(--consent-font-size, 14px) + 1px);
  font-weight: 600;
}

#consent-content p {
  margin: 0 0 8px;
  line-height: 1.4;
  color: var(--consent-text);
}

/* Kategorien */
#consent-categories {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#consent-categories .consent-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  font-size: var(--consent-font-size, 14px);
}

#consent-categories .consent-item input[type="checkbox"] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;

  width: 16px !important;
  height: 16px !important;
  margin-top: 2px !important;
}

#consent-categories .consent-text {
  display: inline;
}

#consent-categories .consent-title {
  font-weight: 600;
  margin-right: 0.25em;
}

#consent-categories .consent-desc {
  color: var(--consent-muted);
}

/* =========================
   Buttons
   ========================= */

#consent-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

#consent-actions button {
  all: unset;
  display: inline-block;
  padding: var(--consent-button-padding, 8px) 10px;
  border-radius: var(--consent-button-radius, 6px);
  cursor: pointer;
  font-size: calc(var(--consent-font-size, 14px) - 1px);
  font-family: inherit;
  text-align: center;
  user-select: none;
  white-space: nowrap;
}

/* Primary */
#consent-actions .primary {
  background: var(--consent-btn-primary-bg);
  color: var(--consent-btn-primary-text);
}
#consent-actions .primary:hover {
  filter: brightness(1.05);
}

/* Secondary */
#consent-actions .secondary {
  background: var(--consent-btn-secondary-bg);
  color: var(--consent-btn-secondary-text);
}
#consent-actions .secondary:hover {
  filter: brightness(0.97);
}

/* Ghost */
#consent-actions .ghost {
  border: 1px solid var(--consent-btn-ghost-border);
  color: var(--consent-btn-ghost-text);
  background: transparent;
}
#consent-actions .ghost:hover {
  background: rgba(255,255,255,0.03);
}

/* Footer-Links */
#consent-footer-links {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  font-size: calc(var(--consent-font-size, 14px) - 1px);
}

#consent-footer-links a {
  color: var(--consent-link);
  text-decoration: none;
}
#consent-footer-links a:hover {
  color: var(--consent-link-hover);
  text-decoration: underline;
}

/* =========================
   Reiter (Tab)
   ========================= */

#consent-tab {
  position: fixed;
  bottom: 20px;
  width: 40px;
  height: 40px;
  background: #00000000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999998;
  opacity: 0;
  overflow: hidden;
  border-radius: 4px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* rechts / links */
#consent-tab.position-right {
  right: 20px;
}

#consent-tab.position-left {
  left: 20px;
}

/* sichtbar */
#consent-tab.show {
  opacity: 0.7;
}

#consent-tab.hidden {
  opacity: 0;
  pointer-events: none;
}

#consent-tab:hover {
  opacity: 1;
  transform: scale(1.5);
}

#consent-tab img {
  width: 100%;
  height: 100%;
  object-fit: scale-down;
}
