/* RST Website-Chat
   Nur Widget-spezifische Styles. Bootstrap wird von der Website bereits geladen. */

.rst-chat-root {
    --rst-chat-dark: #2d444e;
    --rst-chat-dark-2: #20343c;
    --rst-chat-accent: #9a1e3e;
    --rst-chat-gold: #dabe73;
    --rst-chat-bg: #f4f1ea;
    --rst-chat-text: #212529;
    --rst-chat-muted: #6c757d;
    --rst-chat-border: rgba(45, 68, 78, .18);
    --rst-chat-shadow: 0 18px 45px rgba(0, 0, 0, .22);

    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: 'Montserrat', var(--bs-font-sans-serif, Arial, Helvetica, sans-serif);
    font-size: 14px;
    line-height: 1.45;
    color: var(--rst-chat-text);
}

.rst-chat-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: var(--rst-chat-dark);
    color: #fff;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .24);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .2px;
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.rst-chat-toggle::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--rst-chat-gold);
    box-shadow: 0 0 0 4px rgba(218, 190, 115, .18);
}

.rst-chat-toggle:hover,
.rst-chat-toggle:focus-visible {
    background: var(--rst-chat-dark-2);
    transform: translateY(-1px);
    box-shadow: 0 13px 32px rgba(0, 0, 0, .28);
}

.rst-chat-toggle-hidden {
    display: none;
}

.rst-chat-panel {
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 590px;
    max-height: calc(100vh - 48px);
    background: #fff;
    border: 1px solid var(--rst-chat-border);
    border-radius: 8px;
    box-shadow: var(--rst-chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rst-chat-panel-hidden {
    display: none;
}

.rst-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--rst-chat-dark);
    color: #fff;
    padding: 13px 15px;
    border-bottom: 3px solid var(--rst-chat-gold);
}

.rst-chat-heading {
    min-width: 0;
}

.rst-chat-title {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .25px;
    line-height: 1.1;
}

.rst-chat-subtitle {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .72);
}

.rst-chat-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 2px;
    transition: background-color .15s ease;
}

.rst-chat-close:hover,
.rst-chat-close:focus-visible {
    background: rgba(255, 255, 255, .18);
}

.rst-chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    background:
        linear-gradient(180deg, rgba(244, 241, 234, .95), rgba(255, 255, 255, .96));
    scrollbar-width: thin;
    scrollbar-color: rgba(45, 68, 78, .35) transparent;
}

.rst-chat-list::-webkit-scrollbar {
    width: 8px;
}

.rst-chat-list::-webkit-scrollbar-thumb {
    background: rgba(45, 68, 78, .28);
    border-radius: 20px;
}

.rst-chat-message {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.rst-chat-message-user {
    align-items: flex-end;
}

.rst-chat-message-assistant {
    align-items: flex-start;
}

.rst-chat-bubble {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 10px;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    font-size: 13.5px;
}

.rst-chat-message-user .rst-chat-bubble {
    background: var(--rst-chat-dark);
    color: #fff;
    border-bottom-right-radius: 3px;
    box-shadow: 0 5px 16px rgba(45, 68, 78, .18);
}

.rst-chat-message-assistant .rst-chat-bubble {
    background: #fff;
    color: var(--rst-chat-text);
    border: 1px solid rgba(45, 68, 78, .13);
    border-left: 3px solid var(--rst-chat-gold);
    border-bottom-left-radius: 3px;
    box-shadow: 0 5px 17px rgba(0, 0, 0, .055);
}

.rst-chat-answer-line:last-child,
.rst-chat-answer-list:last-child {
    margin-bottom: 0 !important;
}

.rst-chat-answer-spacer {
    height: 6px;
}

.rst-chat-answer-list {
    margin: 0 0 6px 0;
    padding-left: 18px !important;
}

.rst-chat-answer-list li {
    margin-bottom: 4px;
}

.rst-chat-inline-link {
    color: var(--rst-chat-accent);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(154, 30, 62, .35);
}

.rst-chat-inline-link:hover,
.rst-chat-inline-link:focus-visible {
    color: var(--rst-chat-dark);
    border-bottom-color: var(--rst-chat-dark);
}

/* Quellen bleiben intern/API-seitig erhalten, aber im Besucher-Frontend unsichtbar. */
.rst-chat-sources {
    display: none !important;
}

.rst-chat-feedback {
    max-width: 88%;
    margin-top: 6px;
    font-size: 12px;
    color: var(--rst-chat-muted);
}

.rst-chat-feedback-btn {
    border: 1px solid rgba(45, 68, 78, .16);
    background: #fff;
    color: var(--rst-chat-dark);
    padding: 4px 8px;
    margin-right: 5px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.3;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.rst-chat-feedback-btn:hover {
    background: var(--rst-chat-bg);
    border-color: rgba(45, 68, 78, .28);
}

.rst-chat-feedback-btn:disabled {
    opacity: .55;
    cursor: default;
}

.rst-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(45, 68, 78, .12);
    background: #fff;
}

.rst-chat-input {
    flex: 1;
    min-height: 42px;
    max-height: 104px;
    resize: none;
    border: 1px solid rgba(45, 68, 78, .22);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.35;
    outline: none;
    color: var(--rst-chat-text);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.rst-chat-input::placeholder {
    color: rgba(33, 37, 41, .48);
}

.rst-chat-input:focus {
    border-color: rgba(154, 30, 62, .55);
    box-shadow: 0 0 0 .18rem rgba(154, 30, 62, .12);
}

.rst-chat-send {
    min-height: 42px;
    border: 1px solid var(--rst-chat-dark);
    background: var(--rst-chat-dark);
    color: #fff;
    padding: 0 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.rst-chat-send:hover,
.rst-chat-send:focus-visible {
    background: var(--rst-chat-accent);
    border-color: var(--rst-chat-accent);
}

.rst-chat-send:active {
    transform: translateY(1px);
}

.rst-chat-send:disabled {
    opacity: .58;
    cursor: default;
    transform: none;
}

@media (max-width: 480px) {
    .rst-chat-root {
        right: 10px;
        bottom: 10px;
        left: 10px;
    }

    .rst-chat-toggle {
        float: right;
    }

    .rst-chat-panel {
        width: 100%;
        height: calc(100vh - 20px);
        max-width: none;
        max-height: none;
        border-radius: 8px;
    }

    .rst-chat-bubble {
        max-width: 94%;
    }

    .rst-chat-form {
        padding: 10px;
    }
}

.rst-chat-table-wrap {
    max-width: 100%;
    margin: 6px 0 8px;
}

.rst-chat-table {
    margin-bottom: 0;
    font-size: 12.5px;
    background: #fff;
    border: 1px solid rgba(45, 68, 78, .12);
}

.rst-chat-table th {
    background: rgba(244, 241, 234, .9);
    color: var(--rst-chat-dark);
    font-weight: 600;
    white-space: nowrap;
}

.rst-chat-table td,
.rst-chat-table th {
    padding: 5px 7px !important;
    vertical-align: top;
}
