/* Plotti-Chat (1.18–1.20) — eingebunden aus base.html, nur wenn plotti_sichtbar. */
.plotti-start {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(86px + env(safe-area-inset-bottom));   /* über dem WhatsApp-Knopf */
  z-index: 151;
  width: 74px; height: 90px; padding: 0;      /* ganze Figur, Seitenverhältnis 400:490 */
  border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(31,111,104,.35));
  animation: plotti-wippen 3.2s ease-in-out infinite;
}
.plotti-start img, .plotti-start svg { width: 100%; height: 100%; display: block; object-fit: contain; overflow: visible; }
.plotti-start:focus-visible { outline: 3px solid #3FA39A; outline-offset: 3px; border-radius: 12px; }
.plotti-start[aria-expanded="true"] { animation: none; transform: scale(.9); }
body.co-kasse .plotti-start, body.co-kasse .plotti-fenster { display: none; }

.plotti-fenster {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(184px + env(safe-area-inset-bottom));
  z-index: 152;
  width: 370px; max-width: calc(100vw - 32px);
  height: min(560px, calc(100vh - 208px));
  display: flex; flex-direction: column;
  background: #fff; color: #1f1f1f;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.08);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transform-origin: bottom right;
  animation: plotti-auf .22s ease-out;
}
.plotti-fenster[hidden] { display: none; }

.plotti-kopf { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #3FA39A; color: #fff; }
.plotti-gesicht { width: 52px; height: 64px; flex: 0 0 auto; }
.plotti-gesicht img, .plotti-gesicht svg { width: 100%; height: 100%; object-fit: contain; overflow: visible; }
.plotti-kopf.denkt .plotti-gesicht { animation: plotti-nicken 1s ease-in-out infinite; }
.plotti-kopf b { display: block; font-size: 16px; }
.plotti-kopf small { display: block; opacity: .9; font-size: 12px; }
.plotti-zu { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff; font-size: 20px; cursor: pointer; }
.plotti-zu:focus-visible { outline: 2px solid #fff; }

.plotti-verlauf { flex: 1; overflow-y: auto; padding: 14px 12px; background: #F3FAF8; display: flex; flex-direction: column; gap: 8px; }
.plotti-msg { max-width: 85%; padding: 9px 12px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; animation: plotti-plopp .18s ease-out; }
.plotti-msg.plotti { background: #fff; border: 1px solid #DCEFEB; border-bottom-left-radius: 4px; align-self: flex-start; }
.plotti-msg.kunde { background: #1f1f1f; color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.plotti-msg a.plotti-link { display: inline-block; margin-top: 6px; color: #1f6f68; font-weight: 700; }
.plotti-tippt { align-self: flex-start; padding: 10px 14px; background: #fff; border-radius: 16px; border: 1px solid #DCEFEB; }
.plotti-tippt i { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #3FA39A; animation: plotti-punkt 1s infinite; }
.plotti-tippt-text { margin-left: 8px; font-size: 13px; color: #555; animation: plotti-plopp .2s ease-out; }
.plotti-tippt i:nth-child(2) { animation-delay: .15s; } .plotti-tippt i:nth-child(3) { animation-delay: .3s; }

.plotti-karten { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.plotti-karte { display: flex; gap: 10px; align-items: center; padding: 8px; background: #fff; border: 1px solid #DCEFEB;
  border-radius: 12px; color: inherit; text-decoration: none; }
.plotti-karte:hover, .plotti-karte:focus-visible { border-color: #3FA39A; }
.plotti-karte img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: #eee; }
.plotti-karte b { display: block; font-size: 14px; }
.plotti-karte span { display: block; font-size: 12.5px; color: #555; }

.plotti-schnell { display: flex; flex-wrap: wrap; gap: 6px; }
.plotti-schnell button { border: 1px solid #3FA39A; background: #fff; color: #1f6f68; border-radius: 999px;
  padding: 6px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.plotti-schnell button:hover { background: #E6F5F3; }

.plotti-eingabe { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #E5EFED; background: #fff; }
.plotti-eingabe input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #cfdedb; border-radius: 999px; font: inherit; font-size: 16px; }
.plotti-eingabe input:focus { outline: none; border-color: #3FA39A; box-shadow: 0 0 0 3px #DCEFEB; }
.plotti-eingabe button { border: 0; border-radius: 999px; padding: 0 16px; background: #3FA39A; color: #fff; font-weight: 700; cursor: pointer; }
.plotti-eingabe button:disabled { opacity: .5; cursor: wait; }
.plotti-fuss { padding: 0 12px 8px; font-size: 11px; color: #777; background: #fff; }
.plotti-fusslink, .plotti-ja { border: 0; background: none; padding: 0; color: #1f6f68; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.plotti-ja { align-self: flex-start; font-size: 14px; padding: 6px 12px; border: 1px solid #3FA39A; border-radius: 999px; text-decoration: none; background: #fff; }

.plotti-form { align-self: stretch; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: #fff;
  border: 1px solid #DCEFEB; border-radius: 14px; animation: plotti-plopp .18s ease-out; }
.plotti-feld span { display: block; font-size: 12.5px; color: #555; margin-bottom: 2px; }
.plotti-feld input, .plotti-feld textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #cfdedb;
  border-radius: 10px; font: inherit; font-size: 16px; }
.plotti-form fieldset { border: 0; margin: 0; padding: 0; }
.plotti-form legend { font-size: 12.5px; color: #555; margin-bottom: 4px; padding: 0; }
.plotti-kanal { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.plotti-slotliste { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.plotti-slottag { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.plotti-slottag b { width: 100%; font-size: 12.5px; }
.plotti-slot { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid #cfdedb; border-radius: 999px; cursor: pointer; }
.plotti-slot:has(input:checked) { border-color: #3FA39A; background: #E6F5F3; }
.plotti-ok { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: #444; line-height: 1.4; }
.plotti-ok input { margin-top: 2px; flex: 0 0 auto; }
.plotti-ok a { color: #1f6f68; }
.plotti-falle { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.plotti-fehler { color: #8E2F38; font-size: 13px; min-height: 0; }
.plotti-fehler:empty { display: none; }
.plotti-abschicken { border: 0; border-radius: 999px; padding: 10px 16px; background: #3FA39A; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.plotti-abschicken:disabled { opacity: .5; cursor: wait; }

@media (max-width: 860px) {
  .plotti-start { width: 60px; height: 74px; bottom: calc(82px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .plotti-blase { right: 84px; max-width: calc(100vw - 110px); }
  .plotti-fenster { right: 8px; left: 8px; bottom: 8px; width: auto; max-width: none; height: calc(100dvh - 16px); }
}

/* ── Figur: Teile aus plotti-animiert.svg ─────────────────────────────── */
.plotti-svg .p-mund, .plotti-svg .p-arm-hoch { display: none; }
.plotti-svg[data-stimmung="standard"] .p-mund-laecheln,
.plotti-svg[data-stimmung="freude"] .p-mund-freude,
.plotti-svg[data-stimmung="winken"] .p-mund-freude,
.plotti-svg[data-stimmung="augen-zu"] .p-mund-freude,
.plotti-svg[data-stimmung="staunen"] .p-mund-staunen,
.plotti-svg[data-stimmung="nachdenken"] .p-mund-oh { display: inline; }
.plotti-svg[data-stimmung="winken"] .p-arm-l { display: none; }
.plotti-svg[data-stimmung="winken"] .p-arm-hoch { display: inline; transform-box: view-box; transform-origin: 96px 268px;
  animation: plotti-winken .45s ease-in-out 4 alternate; }
.plotti-svg .p-lider { transform-box: view-box; transform-origin: 200px 214px; transform: scaleY(0);
  animation: plotti-blinzeln 5.5s infinite; }
.plotti-svg[data-stimmung="augen-zu"] .p-lider { animation: none; transform: scaleY(1); }
.plotti-svg .p-pupillen { transition: transform .25s ease-out; }
.plotti-svg[data-stimmung="nachdenken"] .p-pupillen { transform: translate(7px, -9px); }
.plotti-svg[data-stimmung="staunen"] .p-pupillen { transform: scale(.85); transform-box: fill-box; transform-origin: center; }
.plotti-svg .p-antenne { transform-box: view-box; transform-origin: 202px 120px; animation: plotti-antenne 3.4s ease-in-out infinite; }
.plotti-svg[data-stimmung="nachdenken"] .p-kugel { animation: plotti-gluehen .9s ease-in-out infinite; }
.plotti-svg[data-stimmung="staunen"] .p-antenne { animation: plotti-knick .5s ease-out 1; }
.plotti-svg .p-ganz { transform-box: view-box; transform-origin: 200px 470px; }
.plotti-svg.huepf .p-ganz { animation: plotti-huepf .6s cubic-bezier(.3,.7,.4,1) 1; }
.plotti-svg.huepf .p-schatten { transform-box: fill-box; transform-origin: center; animation: plotti-schatten .6s ease 1; }

/* ── Sprechblase am Knopf ─────────────────────────────────────────────── */
.plotti-blase { position: fixed; right: calc(max(16px, env(safe-area-inset-right)) + 84px);
  bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 151; max-width: 250px;
  padding: 10px 30px 10px 12px; background: #fff; color: #1f1f1f; border-radius: 16px 16px 4px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16); font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  animation: plotti-auf .2s ease-out; }
.plotti-blase[hidden] { display: none; }
.plotti-blase .plotti-karten { margin-top: 6px; }
.plotti-blase-zu { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 18px; color: #888; cursor: pointer; }
body.co-kasse .plotti-blase { display: none; }

/* ── Bausteine im Chat ───────────────────────────────────────────────── */
.plotti-knopf, .plotti-wahl { display: inline-block; border: 1px solid #3FA39A; background: #fff; color: #1f6f68; border-radius: 999px;
  padding: 7px 12px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.plotti-knopf:hover, .plotti-wahl:hover { background: #E6F5F3; }
.plotti-knopf:disabled { opacity: .5; cursor: wait; }
.plotti-gefahr { border-color: #c9554f; color: #8E2F38; }
.plotti-gefahr:hover { background: #FBEFF0; }
.plotti-wahl { display: block; width: 100%; text-align: left; border-radius: 12px; font-weight: 500; }
.plotti-status { margin: 0; font-weight: 700; }
.plotti-klein { margin: 0; font-size: 12.5px; color: #555; }
.plotti-positionen { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13.5px; }
.plotti-positionen li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed #DCEFEB; }
.plotti-summe { margin: 0; text-align: right; font-weight: 700; }
.plotti-form select { width: 100%; padding: 8px 10px; border: 1px solid #cfdedb; border-radius: 10px; font: inherit; font-size: 16px; background: #fff; }
.plotti-form { position: relative; overflow: hidden; }
.plotti-code { font: 700 22px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; text-align: center;
  padding: 10px; border: 2px dashed #3FA39A; border-radius: 12px; background: #F3FAF8; color: #1f6f68; }
.plotti-konfetti { position: absolute; top: -8px; width: 7px; height: 11px; border-radius: 2px; pointer-events: none;
  animation: plotti-konfetti 1.4s ease-in forwards; }

@keyframes plotti-winken { from { transform: rotate(-8deg) } to { transform: rotate(16deg) } }
@keyframes plotti-blinzeln { 0%, 93%, 100% { transform: scaleY(0) } 95.5% { transform: scaleY(1) } }
@keyframes plotti-antenne { 0%, 100% { transform: rotate(-4deg) } 50% { transform: rotate(5deg) } }
@keyframes plotti-knick { 0% { transform: rotate(0) } 40% { transform: rotate(-14deg) } 100% { transform: rotate(0) } }
@keyframes plotti-gluehen { 0%, 100% { filter: none } 50% { filter: brightness(1.25) drop-shadow(0 0 10px #B8E6D6) } }
@keyframes plotti-huepf { 0% { transform: none } 20% { transform: scale(1.06, .92) } 50% { transform: translateY(-34px) scale(.96, 1.05) }
  80% { transform: scale(1.04, .95) } 100% { transform: none } }
@keyframes plotti-schatten { 50% { transform: scale(.7); opacity: .06 } }
@keyframes plotti-konfetti { from { transform: translateY(0) rotate(0); opacity: 1 } to { transform: translateY(170px) rotate(540deg); opacity: 0 } }
@keyframes plotti-wippen { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }
@keyframes plotti-auf { from { opacity: 0; transform: scale(.85) translateY(12px) } to { opacity: 1; transform: none } }
@keyframes plotti-plopp { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@keyframes plotti-punkt { 0%,100% { opacity: .3 } 50% { opacity: 1 } }
@keyframes plotti-nicken { 0%,100% { transform: rotate(0) } 50% { transform: rotate(-6deg) } }

@media (prefers-reduced-motion: reduce) {
  .plotti-start, .plotti-fenster, .plotti-msg, .plotti-form, .plotti-blase, .plotti-kopf.denkt .plotti-gesicht, .plotti-tippt i,
  .plotti-svg *, .plotti-svg.huepf .p-ganz { animation: none !important; transition: none !important; }
}

/* 1.24.0: Der Verlauf scrollt, einzelne Nachrichten/Formulare schrumpfen nicht. */
.plotti-verlauf{min-height:0;overscroll-behavior:contain;position:relative}
.plotti-verlauf>*{flex-shrink:0}
.plotti-kopf,.plotti-eingabe,.plotti-fuss{flex-shrink:0}
.plotti-eingabe{flex-wrap:wrap}
.plotti-eingabe textarea{flex:1;min-width:0;resize:vertical;max-height:110px;border:1px solid #bbb;border-radius:10px;padding:10px;font:inherit;line-height:1.3}
.plotti-zeichen{width:100%;font-size:11px;color:#555}
@media(max-height:600px){#plotti-fenster{bottom:8px;height:calc(100dvh - 16px)}}
