.consent-banner,
.consent-modal {
  position: fixed;
  z-index: 10000;
  color: var(--text, #101827);
  font-family: Inter, system-ui, sans-serif;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

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

.consent-banner {
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.consent-panel {
  width: min(920px, 100%);
  padding: 22px;
  border: 1px solid var(--border, #d9ddd5);
  border-radius: 18px;
  background: #fff !important;
  opacity: 1 !important;
  box-shadow: 0 24px 80px rgba(16, 24, 39, .2);
  pointer-events: auto;
}

html[data-mode="night"] .consent-panel {
  background: #0b1728 !important;
}

html[data-theme="dark"] .consent-panel,
body[data-theme="dark"] .consent-panel,
.theme-dark .consent-panel {
  background: #0b1728 !important;
}

.consent-banner .consent-panel {
  padding: 16px 18px;
}

.consent-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.consent-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent, #2b59ff);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.consent-panel h2 {
  margin: 0 0 6px;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.15;
  letter-spacing: -.035em;
}

.consent-panel p {
  max-width: 66ch;
  margin: 0;
  color: var(--muted, #657080);
  font-size: 13px;
  line-height: 1.5;
}

.consent-panel a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.consent-button,
.consent-settings-link {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border, #d9ddd5);
  padding: 10px 16px;
  color: var(--text, #101827);
  background: var(--panel, #fff);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.consent-button-quiet {
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-button-primary {
  border-color: var(--accent, #2b59ff);
  color: #fff;
  background: var(--accent, #2b59ff);
}

.consent-button:hover,
.consent-button:focus-visible,
.consent-settings-link:hover,
.consent-settings-link:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.consent-modal {
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 17, 31, .52);
}

.consent-modal .consent-panel {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
}

.consent-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.consent-close {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--border, #d9ddd5);
  border-radius: 50%;
  color: var(--text, #101827);
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.consent-options {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.consent-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border, #d9ddd5);
  border-radius: 14px;
}

.consent-option strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.consent-option span {
  display: block;
  color: var(--muted, #657080);
  font-size: 12.5px;
  line-height: 1.45;
}

.consent-option input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent, #2b59ff);
}

.consent-settings-link {
  min-height: 0;
  margin-top: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
}

@media (max-width: 760px) {
  .consent-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .consent-panel {
    padding: 18px;
  }

  .consent-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .consent-button {
    width: 100%;
  }

  .consent-button-quiet {
    grid-column: 1 / -1;
    min-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consent-button,
  .consent-settings-link {
    transition: none;
  }
}


/* ---------------------------------------------------------------------------
   Globale UI-Elemente (auf jeder Seite geladen)
   --------------------------------------------------------------------------- */

/* Solange das Consent-Banner am unteren Rand steht, weichen die fixierten
   Bedienelemente nach oben aus, damit sie nicht verdeckt werden. */
html[data-consent-open] .floating-switch,
html[data-consent-open] .wa-fab {
  bottom: calc(22px + var(--consent-offset, 0px));
}

.wa-fab {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 39, .08);
  background: #25D366;
  color: #062814;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(16, 24, 39, .18);
  transition: transform 180ms cubic-bezier(.2, .7, .2, 1), box-shadow 180ms ease;
}

.wa-fab svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: #062814;
}

.wa-fab:hover,
.wa-fab:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(16, 24, 39, .24);
}

html[data-mode="night"] .wa-fab {
  border-color: rgba(255, 255, 255, .12);
}

@media (max-width: 760px) {
  .wa-fab {
    right: 14px;
    bottom: 16px;
    height: 50px;
    padding: 0 16px;
  }

  /* Der erste Screen bleibt frei, solange die Consent-Entscheidung offen ist. */
  html[data-consent-open] .wa-fab {
    display: none;
  }

  .wa-fab {
    font-size: 13px;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-fab {
    transition: none;
  }
}

/* Beim Tippen im Formular sollen die fixierten Elemente nicht ueber den
   Feldern liegen. */
@media (max-width: 900px) {
  body:has(form:focus-within) .wa-fab,
  body:has(form:focus-within) .floating-switch {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}
