.site-chat-widget {
    position: fixed;
    right: 96px;
    bottom: 24px;
    z-index: 2101;
    font-family: "Roboto Condensed", Arial, sans-serif;
}

.site-chat-widget__toggle {
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, #1c3f95, #2aa4d6);
    box-shadow: 0 18px 40px rgba(17, 39, 85, 0.28);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.site-chat-widget__toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(17, 39, 85, 0.34);
}

.site-chat-widget__toggle-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ff6b35;
    color: #fff;
    font-size: 12px;
    line-height: 24px;
    text-align: center;
    display: none;
}

.site-chat-widget__panel {
    position: absolute;
    right: 0;
    bottom: 80px;
    width: 360px;
    max-width: calc(100vw - 24px);
    height: 560px;
    max-height: calc(100vh - 120px);
    border-radius: 24px;
    overflow: hidden;
    background: #f7f9fc;
    box-shadow: 0 30px 60px rgba(14, 26, 57, 0.24);
    border: 1px solid rgba(23, 52, 116, 0.12);
    display: none;
    flex-direction: column;
}

.site-chat-widget--open .site-chat-widget__panel {
    display: flex;
}

.site-chat-widget__header {
    padding: 18px 20px 16px;
    background: linear-gradient(135deg, #173474, #1f7bb6);
    color: #fff;
    position: relative;
}

.site-chat-widget__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.site-chat-widget__subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    opacity: 0.85;
}

.site-chat-widget__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
    font-size: 26px;
    line-height: 40px;
    text-align: center;
    display: none;
}

.site-chat-widget__status {
    margin-top: 10px;
    font-size: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    opacity: 0.9;
}

.site-chat-widget__messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    background: radial-gradient(circle at top right, rgba(42, 164, 214, 0.16), transparent 26%),
    linear-gradient(180deg, #f7f9fc 0%, #eff3fa 100%);
}

.site-chat-widget__empty,
.site-chat-widget__system {
    margin: 12px 0;
    color: #667085;
    font-size: 13px;
    text-align: center;
}

.site-chat-widget__message {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fff;
    color: #213147;
    box-shadow: 0 6px 18px rgba(14, 26, 57, 0.08);
}

.site-chat-widget__message--own {
    background: #dff4ff;
}

.site-chat-widget__meta {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: #546174;
}

.site-chat-widget__author {
    font-weight: 700;
}

.site-chat-widget__body {
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.site-chat-widget__composer {
    border-top: 1px solid rgba(23, 52, 116, 0.12);
    padding: 14px;
    background: #fff;
}

.site-chat-widget__notice {
    margin: 0 0 10px;
    color: #6a7280;
    font-size: 12px;
}

.site-chat-widget__form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.site-chat-widget__input {
    flex: 1;
    min-height: 52px;
    max-height: 120px;
    border: 1px solid rgba(23, 52, 116, 0.16);
    border-radius: 16px;
    padding: 12px 14px;
    background: #f7f9fc;
    color: #213147;
    resize: vertical;
    outline: none;
}

.site-chat-widget__input:focus {
    border-color: #1f7bb6;
    background: #fff;
}

.site-chat-widget__submit {
    min-width: 92px;
    height: 52px;
    border: 0;
    border-radius: 16px;
    background: #173474;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.site-chat-widget__submit:disabled,
.site-chat-widget__input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .site-chat-widget {
        right: 12px;
        bottom: 12px;
    }

    .site-chat-widget__panel {
        position: fixed;
        inset: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: 0;
        right: auto;
        bottom: auto;
    }

    .site-chat-widget--open .site-chat-widget__toggle {
        display: none;
    }

    .site-chat-widget__header {
        padding-right: 64px;
    }

    .site-chat-widget__close {
        display: block;
    }

    .site-chat-widget__messages {
        padding-bottom: 24px;
    }

    .site-chat-widget__composer {
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }
}
