/* PWS Chat – Widget. Farben: Einstellungen → sonst PWS-Theme → sonst Standard. Schrift: wie die Website. */
.pwsc {
	--pwsc-navy: var(--pws-c-navy, #012141);
	--pwsc-accent: var(--pws-c-accent, #2BE33B);
	--pwsc-bg: var(--pws-c-bg, #fff);
	--pwsc-text: var(--pws-c-text, #012141);
	--pwsc-line: color-mix(in srgb, var(--pwsc-text) 14%, transparent);
	--pwsc-soft: color-mix(in srgb, var(--pwsc-text) 6%, var(--pwsc-bg));
	--pwsc-me: var(--pwsc-navy);
	--pwsc-on-main: #fff;
	--pwsc-on-accent: #012141;
	position: fixed; right: 24px; bottom: 24px; z-index: 9990;
	font-family: var(--pwsc-font, var(--pws-font, inherit)); font-size: 15px; line-height: 1.45; color: var(--pwsc-text);
	transition: bottom .35s ease;
}
[data-theme="dark"] .pwsc { --pwsc-me: color-mix(in srgb, var(--pwsc-navy) 70%, #fff); }
/* Footer-Leiste des Themes eingeblendet → etwas höher */
body:has(.pws-footbar.is-visible) .pwsc { bottom: 76px; }
.pwsc, .pwsc *, .pwsc *::before, .pwsc *::after { box-sizing: border-box; }
.pwsc .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.pwsc-launch {
	position: relative; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; margin-left: auto;
	border: 0; border-radius: 999px; background: var(--pwsc-accent); color: var(--pwsc-on-accent); font: inherit; font-weight: 600; cursor: pointer;
	box-shadow: 0 6px 24px rgba(1, 33, 65, .22); transition: transform .2s ease;
}
.pwsc-launch:hover { transform: translateY(-2px); }
.pwsc-launch:focus-visible { outline: 3px solid var(--pwsc-navy); outline-offset: 3px; }
.pwsc-launch svg { width: 22px; height: 22px; fill: currentColor; }
.pwsc.is-open .pwsc-launch { display: none; }
/* Noch vor dem eingestellten Bereich: Button ausgeblendet, erscheint weich */
.pwsc-launch { transition: transform .2s ease, opacity .35s ease, visibility 0s; }
.pwsc.is-waiting .pwsc-launch { opacity: 0; visibility: hidden; transform: translateY(16px) scale(.92); pointer-events: none; transition: transform .35s ease, opacity .25s ease, visibility 0s .35s; }
.pwsc-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--pws-c-city, #F0145A); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }

.pwsc-panel {
	display: flex; flex-direction: column; width: min(380px, calc(100vw - 32px)); height: min(600px, calc(100dvh - 48px));
	background: var(--pwsc-bg); border-radius: 16px; overflow: hidden;
	box-shadow: 0 18px 60px rgba(1, 33, 65, .28), 0 0 0 1px var(--pwsc-line);
	animation: pwsc-in .25s ease both;
}
.pwsc-panel[hidden] { display: none; }
@keyframes pwsc-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .pwsc-panel { animation: none; } .pwsc, .pwsc-launch { transition: none; } }

.pwsc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 16px 14px 20px; background: var(--pwsc-navy); color: var(--pwsc-on-main); }
.pwsc-title { margin: 0; font-weight: 700; font-size: 16px; }
.pwsc-sub { margin: 2px 0 0; font-size: 12px; opacity: .85; }
.pwsc-sub.is-live::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--pwsc-accent); vertical-align: 1px; }
.pwsc-head__btns { display: flex; gap: 6px; align-items: center; }
.pwsc-end { height: 30px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--pwsc-on-main) 40%, transparent); border-radius: 999px; background: none; color: var(--pwsc-on-main); font: inherit; font-size: 12px; cursor: pointer; }
.pwsc-end:hover { background: rgba(255,255,255,.12); }
.pwsc-x { position: relative; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--pwsc-on-main); cursor: pointer; }
.pwsc-x:hover { background: rgba(255,255,255,.12); }
.pwsc-x span::before { content: ""; position: absolute; left: 8px; right: 8px; top: 14px; height: 2px; background: currentColor; }

.pwsc-log { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.pwsc-msg { max-width: 86%; display: grid; gap: 3px; }
.pwsc-msg__who { font-size: 11px; opacity: .7; }
.pwsc-msg__body { padding: 9px 13px; border-radius: 14px; background: var(--pwsc-soft); overflow-wrap: anywhere; }
.pwsc-msg__body p { margin: 0 0 6px; }
.pwsc-msg.is-visitor { align-self: flex-end; }
.pwsc-msg.is-visitor .pwsc-msg__body { background: var(--pwsc-me); color: var(--pwsc-on-main); border-bottom-right-radius: 4px; }
.pwsc-msg.is-bot .pwsc-msg__body, .pwsc-msg.is-agent .pwsc-msg__body { border-bottom-left-radius: 4px; }
.pwsc-msg.is-agent .pwsc-msg__body { background: color-mix(in srgb, var(--pwsc-accent) 22%, var(--pwsc-bg)); }
.pwsc-card { display: grid; gap: 2px; margin-top: 6px; padding: 9px 11px; border-radius: 10px; background: var(--pwsc-bg); color: inherit; text-decoration: none; border: 1px solid var(--pwsc-line); }
.pwsc-card:hover { border-color: var(--pwsc-navy); }
.pwsc-card strong { font-size: 14px; }
.pwsc-card span { font-size: 13px; opacity: .8; }

.pwsc-act { padding: 0 16px 12px; }
.pwsc-act[hidden] { display: none; }
.pwsc-wait { margin: 0; font-size: 13px; opacity: .7; }
.pwsc-form { display: grid; gap: 8px; }
.pwsc-form p { margin: 0; font-size: 13px; }
.pwsc-form input { width: 100%; height: 40px; padding: 0 14px; border: 1px solid var(--pwsc-line); border-radius: 999px; background: var(--pwsc-bg); color: var(--pwsc-text); font: inherit; font-size: 14px; }
.pwsc-form input:focus { outline: none; border-color: var(--pwsc-navy); }
.pwsc-hp { position: absolute !important; left: -9999px; width: 1px !important; height: 1px !important; opacity: 0; }
.pwsc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pwsc-btn { height: 38px; padding: 0 16px; border: 1px solid var(--pwsc-navy); border-radius: 999px; background: none; color: var(--pwsc-text); font: inherit; font-size: 14px; cursor: pointer; }
.pwsc-btn.is-main { background: var(--pwsc-navy); color: var(--pwsc-on-main); }
[data-theme="dark"] .pwsc-btn { border-color: var(--pwsc-text); }
[data-theme="dark"] .pwsc-btn.is-main { background: var(--pwsc-accent); border-color: var(--pwsc-accent); color: var(--pwsc-on-accent); }
.pwsc-btn:disabled { opacity: .5; cursor: default; }
.pwsc-link { justify-self: start; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

.pwsc-input { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--pwsc-line); }
.pwsc-input textarea { flex: 1; min-height: 40px; max-height: 120px; padding: 9px 2px; border: 0; background: none; color: var(--pwsc-text); font: inherit; resize: none; outline: none; }
.pwsc-input textarea:disabled { opacity: .5; }
.pwsc-input button { flex: 0 0 40px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--pwsc-navy); color: var(--pwsc-on-main); cursor: pointer; display: grid; place-items: center; }
[data-theme="dark"] .pwsc-input button { background: var(--pwsc-accent); color: var(--pwsc-on-accent); }
.pwsc-input button:disabled { opacity: .4; cursor: default; }
.pwsc-input svg { width: 17px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pwsc-note { margin: 0; padding: 0 16px 10px; font-size: 11px; opacity: .6; }
.pwsc-note a { color: inherit; }

@media (max-width: 600px) {
	.pwsc { right: 16px; bottom: 16px; }
	.pwsc-launch__text { display: none; }
	.pwsc-launch { width: 56px; height: 56px; padding: 0; justify-content: center; }
	.pwsc.is-open { inset: 0; }
	.pwsc-panel { width: 100%; height: 100dvh; border-radius: 0; }
}
