/* Berti: Symbol und Sprechblase (wird mit der Seite geladen, bewusst klein) */
.bu-berti { --bb-green: #078082; --bb-green-d: #05666a; --bb-ink: #12282a; --bb-mint: #e9f5f3; --bb-line: #dfe8e7; --bb-orange: #ed7a28;
  position: fixed; right: calc(14px + env(safe-area-inset-right, 0px)); top: 320px; z-index: 9989; font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--bb-ink); line-height: 1.45; }
.bu-berti *, .bu-berti *::before, .bu-berti *::after { box-sizing: border-box; }
.bu-berti [hidden] { display: none !important; }
.bu-berti__knopf { display: grid; place-items: end center; width: 52px; height: 52px; padding: 0; overflow: hidden; border: 1px solid var(--bb-line); border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 8px 22px rgba(24,59,58,.18); transition: transform .25s ease, box-shadow .25s ease; }
.bu-berti__knopf img { width: 44px; height: auto; margin-bottom: -2px; }
.bu-berti__knopf:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(24,59,58,.24); }
.bu-berti__knopf:focus-visible, .bu-berti button:focus-visible, .bu-berti a:focus-visible { outline: 3px solid var(--bb-orange); outline-offset: 2px; }
.bu-berti__knopf::after { content: ""; position: absolute; right: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--bb-orange); border: 2px solid #fff; }
.bu-berti__knopf { position: relative; }
.bu-berti[data-offen="1"] .bu-berti__knopf::after { display: none; }

/* Sprechblase: 1 bis 2 kurze Zeilen */
.bu-berti__blase { position: absolute; right: 62px; top: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 10px; width: min(300px, calc(100vw - 100px)); padding: 10px 34px 10px 10px; border: 1px solid var(--bb-line); border-radius: 16px 4px 16px 16px; background: #fff; box-shadow: 0 12px 30px rgba(24,59,58,.18); animation: bu-berti-ein .3s ease both; }
.bu-berti__blase img { grid-row: 1 / 3; width: 34px; height: auto; align-self: start; }
.bu-berti__blase p { margin: 0; font-size: .9rem; color: var(--bb-ink); }
.bu-berti__blase-auf { justify-self: start; margin: 0; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--bb-green-d); color: #fff; font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer; }
.bu-berti__blase-zu { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: var(--bb-mint); color: var(--bb-green-d); font-size: 18px; line-height: 1; cursor: pointer; }
@keyframes bu-berti-ein { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }

/* Dialog-Rahmen (Inhalt wird nach Klick geladen) */
.bu-berti__dialog { position: fixed; right: calc(76px + env(safe-area-inset-right, 0px)); top: max(calc(var(--bb-top, 90px) + 12px), calc(50vh - 340px)); width: min(380px, calc(100vw - 92px)); max-height: calc(100vh - max(calc(var(--bb-top, 90px) + 12px), calc(50vh - 340px)) - 16px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--bb-line); border-radius: 20px; background: #fff; box-shadow: 0 18px 44px rgba(24,59,58,.22); animation: bu-berti-ein .3s ease both; }

/* Handy: Symbol über der Kontaktleiste, Dialog als Feld am unteren Rand */
@media (max-width: 760px) {
  .bu-berti { top: auto; right: calc(10px + env(safe-area-inset-right, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .bu-berti__knopf { width: 48px; height: 48px; }
  .bu-berti__knopf img { width: 40px; }
  .bu-berti__blase { right: 0; top: auto; bottom: 58px; width: min(320px, calc(100vw - 20px)); }
  .bu-berti__blase { border-radius: 16px 16px 4px 16px; }
  .bu-berti__dialog { position: fixed; left: calc(10px + env(safe-area-inset-left, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); top: auto; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); transform: none; width: auto; max-height: calc(100dvh - 140px); animation: bu-berti-ein .3s ease both; }
}
@media (prefers-reduced-motion: reduce) { .bu-berti__blase, .bu-berti__dialog, .bu-berti__knopf { animation: none; transition: none; } }
/* Hoher Dialog auf kleinen Bildschirmen: oben ausrichten, intern scrollen */


/* 1.0.1: Theme-Button-Regeln sicher übersteuern */
.bu-berti .bu-berti__knopf, .bu-berti .bu-berti__knopf:hover, .bu-berti .bu-berti__knopf:focus, .bu-berti .bu-berti__knopf:active { background: #fff !important; color: var(--bb-ink) !important; border: 1px solid var(--bb-line) !important; padding: 0 !important; }
.bu-berti .bu-berti__blase-auf, .bu-berti .bu-berti__blase-auf:hover, .bu-berti .bu-berti__blase-auf:focus, .bu-berti .bu-berti__blase-auf:active { background: var(--bb-green-d) !important; color: #fff !important; border: 0 !important; padding: 6px 12px !important; }
.bu-berti .bu-berti__blase-auf:hover, .bu-berti .bu-berti__blase-auf:focus-visible { background: #04595c !important; }
.bu-berti .bu-berti__blase-zu, .bu-berti .bu-berti__blase-zu:hover, .bu-berti .bu-berti__blase-zu:focus, .bu-berti .bu-berti__blase-zu:active { background: var(--bb-mint) !important; color: var(--bb-green-d) !important; border: 0 !important; padding: 0 !important; }

/* 1.1 Einflug beim ersten Seitenaufruf: Berti kommt in die Bildmitte, sagt Hallo und fliegt auf seinen Platz */
.bu-berti { transition: transform 1.1s cubic-bezier(.3,.9,.3,1); }
.bu-berti--intro { transform: translate(var(--bb-dx, 0px), var(--bb-dy, 0px)) scale(var(--bb-scale, 1.8)); z-index: 9995; transition: none; }
.bu-berti--intro .bu-berti__knopf { box-shadow: 0 18px 44px rgba(24,59,58,.3); animation: bu-berti-wackeln 1.2s ease-in-out .3s 2; }
.bu-berti--intro .bu-berti__blase { right: auto; left: 60px; top: 2px; bottom: auto; width: max-content; max-width: min(240px, 60vw); padding-right: 12px; border-radius: 4px 16px 16px 16px; transform-origin: left center; animation: bu-berti-ein .3s ease both; }
.bu-berti--intro .bu-berti__blase img, .bu-berti--intro .bu-berti__blase-zu, .bu-berti--intro .bu-berti__blase-auf { display: none; }
.bu-berti--intro .bu-berti__blase p { font-size: 1rem; font-weight: 600; color: var(--bb-green-d); grid-column: 1 / -1; }
.bu-berti--intro .bu-berti__knopf::after { display: none; }
.bu-berti--flug .bu-berti__blase { display: none; }
@keyframes bu-berti-wackeln { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@media (max-width: 760px) { .bu-berti--intro .bu-berti__blase { left: 50%; top: 56px; transform: translateX(-50%); animation: none; width: max-content; max-width: 60vw; border-radius: 16px; } .bu-berti--intro .bu-berti__blase p { font-size: .8rem; white-space: nowrap; } }
@media (prefers-reduced-motion: reduce) { .bu-berti { transition: none; } .bu-berti--intro .bu-berti__knopf { animation: none; } }

/* Handy: Berti in der Kontaktleiste (gleiche Größe wie die Symbole dort) */
#bu-contact .bc-mobile .bu-berti__knopf--dock { width: 38px; height: 38px; flex: 0 0 38px; margin: 0; border: 2px solid #e7f3f1; background: #e7f3f1; box-shadow: none; }
#bu-contact .bc-mobile .bu-berti__knopf--dock img { width: 32px; margin-bottom: -1px; }
#bu-contact .bc-mobile .bu-berti__knopf--dock::after { width: 9px; height: 9px; right: -1px; top: -1px; }
@media (max-width: 760px) { .bu-berti--angedockt .bu-berti__blase { right: 0; bottom: 64px; } }
