/* Assistent unten links: Knopf „Fragen?“ und kleines Chatfenster in den Praxisfarben */
.pe-assistent {
  --pe-primary: #4f6558;
  --pe-primary-dark: #3d4f44;
  --pe-knopf: #8e5e22;
  --pe-knopf-dark: #754d1b;
  --pe-shade: #f3f5f3;
  --pe-line: #e2e6e3;
  --pe-head: #333;
  --pe-body: #555;
  font-family: Poppins, sans-serif;
}
.pe-assistent__start { position: fixed; left: 20px; bottom: 20px; z-index: 990; height: 54px; padding: 0 22px 0 16px; display: inline-flex; align-items: center; gap: 9px; border: 0; border-radius: 999px; cursor: pointer; background: var(--pe-primary); color: #fff; font-family: Montserrat, sans-serif; font-weight: 600; font-size: 16px; line-height: 1; box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 6px 22px rgba(0,0,0,.25); transition: background-color .2s ease, transform .2s ease; }
.pe-assistent__start svg { width: 24px; height: 24px; display: block; }
.pe-assistent__start:hover { background: var(--pe-primary-dark); transform: translateY(-2px); }
.pe-assistent__start:focus-visible { outline: 3px solid var(--pe-knopf); outline-offset: 3px; }
.pe-assistent__icon, .pe-assistent__x { display: flex; }
.pe-assistent__start .pe-icon { width: 28px; height: 28px; }

/* Icon: Blase und Zipfel in Textfarbe, Fragezeichen in Kontrastfarbe */
.pe-icon { overflow: visible; }
.pe-icon__blase, .pe-icon__zipfel { fill: currentColor; }
.pe-icon__frage { fill: var(--pe-frage, var(--pe-primary)); font-family: Montserrat, sans-serif; font-weight: 700; font-size: 13.5px; transition: fill .2s ease; }
.pe-icon__zipfel { transform-box: view-box; transform-origin: 12px 11.5px; transition: transform .4s cubic-bezier(.34, 1.4, .64, 1); }
.pe-assistent__start:hover .pe-icon__zipfel,
.pe-assistent__start:focus-visible .pe-icon__zipfel { transform: rotate(90deg); }
.pe-assistent__start:hover { --pe-frage: var(--pe-primary-dark); }
.pe-assistent__x, .pe-assistent.is-offen .pe-assistent__icon { display: none; }
.pe-assistent.is-offen .pe-assistent__x { display: flex; }
.pe-assistent.is-offen .pe-assistent__start { background: var(--pe-knopf); }

.pe-assistent__fenster { position: fixed; left: 20px; bottom: 86px; z-index: 991; width: min(380px, calc(100vw - 32px)); max-height: min(600px, calc(100dvh - 110px)); display: flex; flex-direction: column; background: #fff; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; animation: pe-assistent-auf .2s ease; }
.pe-assistent__fenster[hidden] { display: none; }
@keyframes pe-assistent-auf { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pe-assistent__kopf { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 18px; background: var(--pe-primary); color: #fff; }
.pe-assistent__kopf strong { display: block; font-family: Montserrat, sans-serif; font-size: 17px; line-height: 1.2; color: #fff; }
.pe-assistent__kopf small { font-size: 13px; color: rgba(255,255,255,.8); }
.pe-assistent__avatar { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; background: #fff; color: var(--pe-primary); --pe-frage: #fff; }
.pe-assistent__avatar svg { width: 26px; height: 26px; }
.pe-assistent__zu { margin-left: auto; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer; }
.pe-assistent__zu svg { width: 22px; height: 22px; }
.pe-assistent__zu:hover { background: rgba(255,255,255,.15); }
.pe-assistent__zu:focus-visible { outline: 2px solid #fff; }

.pe-assistent__verlauf { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--pe-shade); }
.pe-assistent__blase { align-self: flex-start; max-width: 92%; margin: 0; padding: 11px 14px; border-radius: 4px 16px 16px 16px; background: #fff; color: var(--pe-head); font-size: 15px; font-weight: 400; line-height: 1.5; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.pe-assistent__blase p { margin: 0; }
.pe-assistent__blase p + p { margin-top: 8px; }
.pe-assistent__blase:focus { outline: none; }
.pe-assistent__blase--frage { align-self: flex-end; border-radius: 16px 4px 16px 16px; background: var(--pe-primary); color: #fff; }
.pe-assistent__hinweis { margin: 6px 0 0; font-size: 13px; color: var(--pe-body); }
.pe-assistent__themen { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-assistent__thema, .pe-assistent__knopf { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 999px; font-family: Montserrat, sans-serif; font-weight: 500; font-size: 14px; line-height: 1.25; text-align: left; text-decoration: none; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.pe-assistent__thema { border: 1.5px solid var(--pe-primary); background: #fff; color: var(--pe-primary); }
.pe-assistent__thema:hover, .pe-assistent__thema:focus-visible { background: var(--pe-primary); color: #fff; }
.pe-assistent__knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pe-assistent__knopf, .pe-assistent__knopf:visited { border: 0; background: var(--pe-knopf); color: #fff; font-weight: 600; }
.pe-assistent__knopf:hover, .pe-assistent__knopf:focus-visible { background: var(--pe-knopf-dark); color: #fff; text-decoration: none; }
.pe-assistent__notruf { margin: 0; padding: 10px 16px; border-top: 1px solid var(--pe-line); background: #fff; font-size: 13px; color: var(--pe-body); }
.pe-assistent__notruf a { color: var(--pe-head); font-weight: 700; }

/* Auf dem Handy liegt der Footer-Credit mittig: Platz lassen, damit der Knopf ihn nicht verdeckt */
@media (max-width: 40rem) {
  .pe-assistent__start { left: 16px; bottom: 16px; height: 50px; padding: 0 18px 0 14px; }
  .pe-assistent__fenster { left: 16px; bottom: 76px; max-height: calc(100dvh - 96px); }
  .tm-page > footer { padding-bottom: 5rem; }
}
@media (max-height: 560px) {
  .pe-assistent__kopf { padding: 8px 10px 8px 14px; }
  .pe-assistent__kopf small { display: none; }
  .pe-assistent__avatar { width: 30px; height: 30px; }
  .pe-assistent__notruf { padding: 6px 14px; font-size: 12px; }
  .pe-assistent__verlauf { padding: 12px; }
  .pe-assistent__fenster { bottom: 12px; max-height: calc(100dvh - 24px); }
  .pe-assistent.is-offen .pe-assistent__start { display: none; }
}
@media print { .pe-assistent { display: none; } }
@media (prefers-reduced-motion: reduce) { .pe-assistent__fenster { animation: none; } .pe-assistent__start, .pe-icon__zipfel { transition: none; } }
