/* LiveChat – Besucher-Widget Styles */
#lc-widget {
    --lc-color: #2f6fed;
    --lc-text: #1f2733;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147483000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#lc-widget * { box-sizing: border-box; }
#lc-widget .lc-hidden { display: none !important; }

/* Bubble */
#lc-bubble {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--lc-color);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,.22);
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative;
}
#lc-bubble:hover { transform: scale(1.06); }
#lc-bubble.lc-open { transform: scale(.92); }
#lc-bubble-badge {
    position: absolute; top: -3px; right: -3px;
    background: #e23c3c; color: #fff;
    min-width: 20px; height: 20px; border-radius: 10px;
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px; border: 2px solid #fff;
}

/* Auto-Begrüßung (Teaser) */
#lc-teaser {
    position: absolute;
    bottom: 74px; right: 4px;
    width: 250px; max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.22);
    padding: 14px 16px 14px 16px;
    font-size: 14px; line-height: 1.45; color: var(--lc-text);
    cursor: pointer;
    animation: lc-in .25s ease;
}
#lc-teaser::after {
    content: ''; position: absolute; bottom: -7px; right: 22px;
    width: 14px; height: 14px; background: #fff; transform: rotate(45deg);
    box-shadow: 3px 3px 6px rgba(0,0,0,.06);
}
#lc-teaser-close {
    position: absolute; top: 4px; right: 6px;
    background: none; border: none; font-size: 18px; line-height: 1;
    color: #b3bccb; cursor: pointer;
}
#lc-teaser-close:hover { color: #5a6a82; }
#lc-teaser-text { padding-right: 8px; }

/* Panel */
#lc-panel {
    position: absolute;
    bottom: 76px; right: 0;
    width: 360px; max-width: calc(100vw - 32px);
    height: 520px; max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,.25);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: lc-in .18s ease;
}
@keyframes lc-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

#lc-head {
    background: var(--lc-color);
    color: #fff;
    padding: 16px 18px;
    display: flex; align-items: center; justify-content: space-between;
}
#lc-title { font-weight: 700; font-size: 16px; }
#lc-status { font-size: 12px; opacity: .92; display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.lc-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #c9d4ea; }
.lc-status-dot.online { background: #41d27e; box-shadow: 0 0 0 3px rgba(65,210,126,.25); }
#lc-close { background: none; border: none; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; opacity: .85; }
#lc-close:hover { opacity: 1; }

#lc-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f7fb;
    display: flex; flex-direction: column; gap: 10px;
}

/* Nachrichten */
.lc-msg { max-width: 80%; display: flex; flex-direction: column; }
.lc-msg-me { align-self: flex-end; align-items: flex-end; }
.lc-msg-them { align-self: flex-start; align-items: flex-start; }
.lc-msg-sys { align-self: center; max-width: 90%; }
.lc-msg-name { font-size: 11px; color: #7a8aa0; margin: 0 0 3px 4px; font-weight: 600; }
.lc-bubble-text {
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px; line-height: 1.45;
    word-wrap: break-word; white-space: pre-wrap;
    color: var(--lc-text);
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.lc-msg-me .lc-bubble-text { background: var(--lc-color); color: #fff; border-bottom-right-radius: 4px; }
.lc-msg-them .lc-bubble-text { border-bottom-left-radius: 4px; }
.lc-msg-sys .lc-bubble-text { background: #e8edf6; color: #5a6a82; font-size: 12px; text-align: center; box-shadow: none; }
.lc-msg-time { font-size: 10px; color: #9aa7ba; margin: 3px 4px 0; }

/* Eingabe */
#lc-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #eceff4; background: #fff; }
#lc-input {
    flex: 1; border: 1px solid #d8dee9; border-radius: 22px;
    padding: 10px 16px; font-size: 14px; outline: none;
}
#lc-input:focus { border-color: var(--lc-color); }
#lc-send {
    width: 42px; height: 42px; border-radius: 50%; border: none;
    background: var(--lc-color); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
#lc-send:hover { filter: brightness(1.07); }

/* Pre-Chat */
#lc-precaht { padding: 16px; border-top: 1px solid #eceff4; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.lc-pre-hint { margin: 0; font-size: 13px; color: #5a6a82; }
#lc-precaht input, #lc-precaht textarea { border: 1px solid #d8dee9; border-radius: 10px; padding: 10px 14px; font-size: 14px; outline: none; font-family: inherit; }
#lc-precaht textarea { resize: vertical; min-height: 60px; }
#lc-precaht input:focus, #lc-precaht textarea:focus { border-color: var(--lc-color); }
.lc-pre-known { font-size: 13px; color: #3a4a60; background: #f1f4fa; border-radius: 8px; padding: 8px 12px; }
#lc-precaht button { background: var(--lc-color); color: #fff; border: none; border-radius: 10px; padding: 11px; font-size: 14px; font-weight: 600; cursor: pointer; }

/* Tippt-Anzeige (Support) */
#lc-typing-them { display: flex; gap: 4px; align-items: center; padding: 4px 18px 8px; }
#lc-typing-them.lc-hidden { display: none; }
#lc-typing-them span { width: 7px; height: 7px; border-radius: 50%; background: #b3bccb; animation: lc-bounce 1.2s infinite; }
#lc-typing-them span:nth-child(2) { animation-delay: .2s; }
#lc-typing-them span:nth-child(3) { animation-delay: .4s; }
@keyframes lc-bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Anhang-Button */
#lc-attach { width: 38px; height: 42px; border: none; background: none; cursor: pointer; font-size: 18px; flex-shrink: 0; padding: 0; }
#lc-attach:hover { filter: brightness(.8); }

/* Anhänge in Nachrichten */
.lc-att-img img { max-width: 190px; max-height: 190px; border-radius: 8px; display: block; margin-top: 4px; }
.lc-att-file { display: inline-block; margin-top: 4px; font-size: 13px; text-decoration: underline; color: inherit; }

/* DSGVO-Checkbox */
.lc-gdpr { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #5a6a82; line-height: 1.4; cursor: pointer; }
.lc-gdpr a { color: var(--lc-color); }
.lc-gdpr-err { color: #e23c3c; }
.lc-gdpr-err input { outline: 2px solid #e23c3c; }

/* ---- Chat-Bewertung (CSAT) ---- */
.lc-rate { align-self: center; max-width: 90%; text-align: center; background: #f1f4fa; border-radius: 12px;
    padding: 12px 16px; margin-top: 4px; }
.lc-rate-q { font-size: 13px; color: #3a4a60; margin-bottom: 8px; }
.lc-rate-btns { display: flex; gap: 12px; justify-content: center; }
.lc-rate-btns button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #d8dee9; background: #fff;
    font-size: 20px; cursor: pointer; line-height: 1; transition: transform .1s, border-color .15s; }
.lc-rate-btns button:hover { border-color: var(--lc-color); transform: scale(1.12); }

@media (max-width: 480px) {
    #lc-widget { right: 14px; bottom: 14px; }
    #lc-panel { width: calc(100vw - 28px); height: calc(100vh - 100px); }
}
