/*
 * Partner-Chat (Affiliate) fuer die statische Seite /partner/affiliate/.
 * Eigenstaendig, mit festen Markenfarben als Fallback, damit es ohne
 * tokens.css funktioniert. Gleiches Aussehen wie der Chat auf
 * /partnerprogramm/ (PartnerChatWidget.astro). Keine Cookie-Leiste hier,
 * daher kein --zustimmung-hoehe-Versatz.
 */
.pcw-ausloeser {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 70; width: 58px; height: 58px; border-radius: 50%; border: none;
  background: var(--farbe-primaer, #14663f); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 22px rgba(20, 102, 63, 0.35);
  transition: background .16s ease, transform .16s ease;
}
.pcw-ausloeser:hover { background: var(--farbe-primaer-dunkel, #0e4a2e); transform: translateY(-1px); }
.pcw-ausloeser:active { transform: scale(0.96); }
.pcw-icon-zu { display: none; }
.pcw-ausloeser[aria-expanded="true"] .pcw-icon-zu { display: block; }
.pcw-ausloeser[aria-expanded="true"] .pcw-icon-chat { display: none; }

.pcw-fenster {
  position: fixed; right: 18px; bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 70; width: min(392px, calc(100vw - 36px)); max-height: min(560px, calc(100vh - 120px));
  background: #fff; border: 1px solid var(--farbe-rand, #dce5e0); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 14px 44px rgba(20, 32, 28, 0.22); animation: pcw-auf 220ms ease-out;
}
.pcw-fenster[hidden] { display: none; }
@keyframes pcw-auf { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.pcw-kopf { background: var(--farbe-akzent, #0e4a2e); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcw-kopf-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pcw-avatar { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,0.14); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pcw-kopf-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pcw-kopf-text strong { font-size: 0.9rem; }
.pcw-status { font-size: 0.72rem; opacity: 0.85; display: inline-flex; align-items: center; gap: 5px; }
.pcw-punkt { width: 8px; height: 8px; border-radius: 50%; background: #7ee0a6; }
.pcw-zu { background: none; border: none; color: rgba(255,255,255,0.8); cursor: pointer; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -6px -8px -6px 0; border-radius: 10px; }
.pcw-zu:hover { color: #fff; background: rgba(255,255,255,0.12); }

.pcw-verlauf { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f6f9f7; }
.pcw-eingabe { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--farbe-rand, #dce5e0); background: #fff; }
.pcw-aktion { display: flex; padding: 10px 12px 0; background: #fff; }
.pcw-reg { flex: 1; font: inherit; font-size: 0.86rem; font-weight: 600; padding: 10px 14px; min-height: 44px; border: 1px solid var(--farbe-primaer, #14663f); border-radius: 10px; background: var(--farbe-primaer, #14663f); color: #fff; cursor: pointer; text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; transition: background .16s ease; }
.pcw-reg:hover { background: var(--farbe-primaer-dunkel, #0e4a2e); }
.pcw-hinweis { margin: 0; padding: 0 12px 10px; background: #fff; font-size: 0.72rem; line-height: 1.4; color: #5a6b62; }
.pcw-hinweis a { color: var(--farbe-primaer, #14663f); }
.pcw-eingabe input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 11px 14px; border: 1px solid var(--farbe-rand, #dce5e0); border-radius: 10px; background: #f6f9f7; outline: none; }
.pcw-eingabe input:focus { border-color: var(--farbe-primaer, #14663f); box-shadow: 0 0 0 3px rgba(20,102,63,0.12); }
.pcw-senden { width: 40px; height: 40px; border-radius: 10px; border: none; background: var(--farbe-primaer, #14663f); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: background .16s ease, transform .16s ease; }
.pcw-senden:disabled { background: #c9d6cf; cursor: not-allowed; }
.pcw-senden:not(:disabled):hover { background: var(--farbe-primaer-dunkel, #0e4a2e); }
.pcw-senden:not(:disabled):active { transform: scale(0.95); }

.pcw-zeile { display: flex; gap: 8px; align-items: flex-end; }
.pcw-zeile.pcw-ich { justify-content: flex-end; }
.pcw-blase { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 0.9rem; line-height: 1.5; overflow-wrap: break-word; word-break: break-word; hyphens: none; }
.pcw-zeile.pcw-bot .pcw-blase { background: #fff; border: 1px solid var(--farbe-rand, #dce5e0); color: #17211c; border-bottom-left-radius: 4px; }
.pcw-zeile.pcw-ich .pcw-blase { background: var(--farbe-primaer, #14663f); color: #fff; border-bottom-right-radius: 4px; }
.pcw-blase a { color: var(--farbe-primaer, #14663f); font-weight: 600; }
.pcw-zeile.pcw-ich .pcw-blase a { color: #fff; }
.pcw-vorschlaege { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.pcw-vorschlag { font: inherit; font-size: 0.8rem; padding: 8px 13px; border: 1px solid #c9d6cf; border-radius: 999px; background: #fff; color: var(--farbe-primaer, #14663f); cursor: pointer; max-width: 100%; overflow-wrap: break-word; text-align: left; transition: background .16s ease, border-color .16s ease; }
.pcw-vorschlag:hover { background: #e8f2ec; border-color: var(--farbe-primaer, #14663f); }
.pcw-tippt { display: inline-flex; gap: 4px; padding: 12px 16px; }
.pcw-tippt span { width: 7px; height: 7px; border-radius: 50%; background: #9ab0a4; animation: pcw-huepf 1.4s infinite; }
.pcw-tippt span:nth-child(2) { animation-delay: 0.2s; }
.pcw-tippt span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pcw-huepf { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

.pcw-teaser {
  position: fixed; right: 18px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 79;
  width: min(320px, calc(100vw - 36px)); display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--farbe-rand, #dce5e0); border-radius: 16px 16px 4px 16px;
  padding: 14px 34px 14px 14px; box-shadow: 0 12px 34px rgba(20,32,28,0.2); animation: pcw-auf 260ms ease-out;
}
.pcw-teaser[hidden] { display: none; }
.pcw-teaser-figur { flex: 0 0 44px; animation: pcw-wink 1.4s ease-in-out 2; transform-origin: 50% 90%; }
@keyframes pcw-wink { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.pcw-teaser-text { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; line-height: 1.35; color: #1f2a25; }
.pcw-teaser-text strong { font-size: 0.98rem; }
.pcw-teaser-text span { color: #5a6b63; font-size: 0.86rem; }
.pcw-teaser-ja { align-self: flex-start; margin-top: 6px; border: none; cursor: pointer; background: var(--farbe-primaer, #14663f); color: #fff; font: inherit; font-weight: 700; font-size: 0.9rem; padding: 8px 16px; border-radius: 999px; }
.pcw-teaser-ja:hover { background: var(--farbe-primaer-dunkel, #0e4a2e); }
.pcw-teaser-zu { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: none; background: transparent; color: #5a6b63; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.pcw-teaser-zu:hover { background: #f1f4f2; }

@media (max-width: 51.999rem) {
  .pcw-ausloeser { width: 44px; height: 44px; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .pcw-fenster { right: 0; left: 0; top: 0; bottom: 0; width: auto; max-height: none; height: 100vh; height: 100dvh; border: none; border-radius: 0; box-shadow: none; z-index: 85; }
  .pcw-kopf { padding-top: calc(14px + env(safe-area-inset-top)); }
  .pcw-eingabe { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  body.pcw-offen .pcw-ausloeser { display: none; }
}
body.pcw-offen { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .pcw-teaser, .pcw-teaser-figur { animation: none; }
  .pcw-fenster { animation: none; }
  .pcw-ausloeser:hover, .pcw-ausloeser:active, .pcw-senden:active { transform: none; }
  .pcw-tippt span { animation: none; }
}
