/* Kontakt-/Live-Chat-Widget */
.ts-chat-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1000;
    width: 3.5rem;
    height: 3.5rem;
    border: none;
    border-radius: 50%;
    background: #4a6b3a;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
    transition: transform .15s ease, background .15s ease;
}
.ts-chat-fab:hover { transform: translateY(-2px); background: #3c5730; }
.ts-chat-fab.is-open { background: #3c5730; }
.ts-chat-fab__icon { pointer-events: none; }

.ts-chat {
    position: fixed;
    right: 1.25rem;
    bottom: 5.25rem;
    z-index: 1000;
    width: min(22rem, calc(100vw - 2.5rem));
    max-height: min(34rem, calc(100vh - 7rem));
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
    font-size: .95rem;
    color: #222;
}
.ts-chat[hidden] { display: none; }

.ts-chat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1rem;
    background: #4a6b3a;
    color: #fff;
}
.ts-chat__title { font-weight: 600; }
.ts-chat__close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .25rem;
}

.ts-chat__body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f4f3ee;
    min-height: 8rem;
}
.ts-chat__intro { margin: 0 0 .5rem; color: #555; }
.ts-chat__note {
    margin: .6rem 0;
    text-align: center;
    color: #777;
    font-size: .85rem;
    font-style: italic;
}
.ts-chat__msg { margin: .35rem 0; display: flex; }
.ts-chat__msg--me { justify-content: flex-end; }
.ts-chat__msg span {
    display: inline-block;
    max-width: 80%;
    padding: .45rem .7rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e0d6;
    white-space: pre-wrap;
    word-break: break-word;
}
.ts-chat__msg--me span { background: #4a6b3a; color: #fff; border-color: #4a6b3a; }

.ts-chat__form { padding: .6rem; border-top: 1px solid #e6e4da; background: #fff; }
.ts-chat__form[hidden] { display: none; }
.ts-chat__name { width: 100%; margin-bottom: .4rem; }
.ts-chat__row { display: flex; gap: .4rem; }
.ts-chat__name, .ts-chat__input {
    padding: .5rem .6rem;
    border: 1px solid #ccc8b8;
    border-radius: 8px;
    font: inherit;
}
.ts-chat__input { flex: 1; min-width: 0; }
.ts-chat__send {
    border: none;
    border-radius: 8px;
    padding: .5rem .9rem;
    background: #c8861f;
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.ts-chat__send:hover { background: #ad7319; }

@media (prefers-color-scheme: dark) {
    .ts-chat { background: #1f1f1d; color: #e8e6df; }
    .ts-chat__body { background: #161614; }
    .ts-chat__intro, .ts-chat__note { color: #aaa; }
    .ts-chat__msg span { background: #2a2a27; border-color: #3a3a35; color: #e8e6df; }
    .ts-chat__form { background: #1f1f1d; border-top-color: #34332e; }
    .ts-chat__name, .ts-chat__input { background: #2a2a27; border-color: #44433d; color: #e8e6df; }
}
