/* design BAUELEMENTE — Chatfenster (js/chat.js) */
.chat-knopf {
	position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 45;
	display: inline-flex; align-items: center; gap: .55rem; min-height: 52px; padding: 0 1.2rem 0 1rem;
	border: 0; border-radius: 999px; background: var(--color-primary); color: #fff; cursor: pointer;
	font: 600 .98rem/1 var(--font-body); box-shadow: 0 6px 22px rgba(2, 42, 51, .28);
	transition: background var(--transition), transform var(--transition);
}
.chat-knopf:hover { background: var(--color-primary-dark); transform: translateY(-1px); }
.chat-knopf:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.chat-knopf.is-offen .chat-knopf__text { display: none; }
.chat-knopf.is-offen { padding: 0 .95rem; }
.chat-knopf__punkt { position: absolute; top: 4px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--color-accent); border: 2px solid #fff; }
.chat-knopf__punkt[hidden] { display: none; }

.chat-fenster {
	position: fixed; right: 1.25rem; bottom: 5.4rem; z-index: 46;
	width: 370px; max-width: calc(100vw - 2rem); height: min(560px, calc(100vh - 7.5rem)); height: min(560px, calc(100dvh - 7.5rem));
	display: flex; flex-direction: column; overflow: hidden;
	background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
	box-shadow: 0 18px 50px rgba(2, 42, 51, .22); font-family: var(--font-body); color: var(--color-text);
}
.chat-fenster[hidden] { display: none; }
.chat-kopf { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; background: var(--color-primary); color: #fff; }
.chat-kopf__bild { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--color-primary); font: 600 1rem/1 var(--font-heading); letter-spacing: .03em; }
.chat-kopf__text { flex: 1; min-width: 0; }
.chat-kopf__name { font: 600 1.05rem/1.2 var(--font-heading); }
.chat-kopf__rolle { font-size: .82rem; opacity: .85; }
.chat-kopf__zu { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.chat-kopf__zu:hover { background: rgba(255, 255, 255, .14); }
.chat-verlauf { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .55rem; background: var(--color-bg); }
.chat-msg { max-width: 85%; padding: .6rem .8rem; border-radius: 14px; font-size: .95rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg--inhaber { align-self: flex-start; background: #fff; border: 1px solid var(--color-border); border-bottom-left-radius: 4px; color: var(--color-text); }
.chat-msg--besucher { align-self: flex-end; background: var(--color-primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg--hinweis { align-self: stretch; max-width: none; background: transparent; padding: .1rem .2rem; font-size: .85rem; color: var(--color-text-muted); text-align: center; }
.chat-msg__meta { font-size: .72rem; opacity: .7; margin-top: .2rem; text-align: right; }
.chat-kontakt { align-self: stretch; display: grid; gap: .45rem; padding: .8rem; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); }
.chat-kontakt p { margin: 0 0 .2rem; font-size: .9rem; }
.chat-kontakt input { width: 100%; min-height: 40px; padding: .45rem .65rem; border: 1px solid var(--color-border); border-radius: 8px; font: inherit; font-size: .95rem; }
.chat-kontakt__knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; }
.chat-kontakt__ok, .chat-kontakt__nein { min-height: 40px; padding: 0 1rem; border-radius: 8px; font: 600 .9rem/1 var(--font-body); cursor: pointer; }
.chat-kontakt__ok { border: 0; background: var(--color-primary); color: #fff; }
.chat-kontakt__nein { border: 1px solid var(--color-border); background: #fff; color: var(--color-text); }
.chat-fehler { padding: .5rem 1rem; font-size: .85rem; color: #b42318; background: #fef3f2; }
.chat-fehler[hidden] { display: none; }
.chat-eingabe { display: flex; align-items: flex-end; gap: .5rem; padding: .7rem .75rem; border-top: 1px solid var(--color-border); background: #fff; }
.chat-eingabe textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: .65rem .8rem; border: 1px solid var(--color-border); border-radius: 12px; font: inherit; font-size: 1rem; line-height: 1.35; color: var(--color-text); }
.chat-eingabe textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 0; border-color: transparent; }
.chat-senden { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--color-accent); color: #fff; cursor: pointer; }
.chat-senden:hover { background: var(--color-accent-dark); }
.chat-senden:disabled { opacity: .55; cursor: default; }
.chat-falle { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.chat-fuss { display: flex; justify-content: space-between; align-items: center; padding: .1rem 1rem .55rem; background: #fff; font-size: .78rem; }
.chat-fuss a { color: var(--color-text-muted); }
.chat-fuss__neu { border: 0; background: none; padding: .3rem 0; color: var(--color-text-muted); font: inherit; text-decoration: underline; cursor: pointer; }
.chat-fuss__neu[hidden] { display: none; }

@media (max-width: 560px) {
	.chat-knopf { right: 1rem; bottom: 1rem; min-height: 50px; padding: 0 1rem 0 .9rem; }
	.chat-fenster { right: 0; left: 0; bottom: 0; width: auto; max-width: none; height: 82vh; height: 82dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
	.chat-fenster:not([hidden]) ~ .chat-knopf { display: none; }
}
@media print { .chat-knopf, .chat-fenster { display: none !important; } }
