/* Чат-консультант «Усадьба Быково». Все классы с префиксом uc- , чтобы не пересекаться со стилями сайта. */

.uc-chat {
    --uc-bg: #ffffff;
    --uc-text: #1f2933;
    --uc-muted: #6b7785;
    --uc-accent: #3f6b4f;
    --uc-accent-text: #ffffff;
    --uc-user-bg: #e8f0ea;
    --uc-bot-bg: #f3f4f6;
    --uc-border: #d9dee3;

    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    height: 560px;
    max-height: calc(100vh - 32px);
    background: var(--uc-bg);
    color: var(--uc-text);
    border: 1px solid var(--uc-border);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    overflow: hidden;
}

.uc-chat *,
.uc-chat *::before,
.uc-chat *::after {
    box-sizing: border-box;
}

.uc-head {
    padding: 12px 16px;
    background: var(--uc-accent);
    color: var(--uc-accent-text);
    font-weight: 600;
}

.uc-head small {
    display: block;
    font-weight: 400;
    opacity: 0.85;
    font-size: 12px;
}

.uc-list {
    flex: 1 1 auto;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uc-msg {
    max-width: 88%;
    padding: 8px 12px;
    border-radius: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.uc-msg--bot {
    align-self: flex-start;
    background: var(--uc-bot-bg);
}

.uc-msg a {
    color: var(--uc-accent);
    text-decoration: underline;
}

.uc-msg--user {
    align-self: flex-end;
    background: var(--uc-user-bg);
}

.uc-msg--wait {
    color: var(--uc-muted);
    font-style: italic;
}

.uc-fb {
    align-self: flex-start;
    display: flex;
    gap: 6px;
    margin: -4px 0 0 6px;
}

.uc-fb-btn {
    padding: 2px 8px;
    border: 1px solid var(--uc-border);
    border-radius: 999px;
    background: #fff;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

.uc-fb-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.uc-fb-btn--picked,
.uc-fb-btn--picked:disabled {
    opacity: 1;
    border-color: var(--uc-accent);
    background: var(--uc-user-bg);
}

.uc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 8px;
}

.uc-chip {
    padding: 5px 10px;
    border: 1px solid var(--uc-border);
    border-radius: 999px;
    background: #fff;
    color: var(--uc-text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.uc-chip:hover {
    border-color: var(--uc-accent);
}

.uc-form {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--uc-border);
}

.uc-input {
    flex: 1 1 auto;
    min-height: 40px;
    max-height: 96px;
    padding: 8px 10px;
    border: 1px solid var(--uc-border);
    border-radius: 10px;
    font: inherit;
    resize: none;
}

.uc-input:focus {
    outline: 2px solid var(--uc-accent);
    outline-offset: -1px;
}

.uc-send {
    flex: 0 0 auto;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: var(--uc-accent);
    color: var(--uc-accent-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.uc-send:disabled {
    opacity: 0.5;
    cursor: default;
}

.uc-reset {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--uc-accent);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.uc-note {
    padding: 0 12px 10px;
    color: var(--uc-muted);
    font-size: 11.5px;
}

/* Плавающий режим (data-mode="float"). */
.uc-head {
    position: relative;
}

.uc-close {
    position: absolute;
    top: 8px;
    right: 10px;
    padding: 0 6px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.uc-root--float {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
}

.uc-root--float .uc-chat {
    display: none;
    width: 380px;
    max-width: calc(100vw - 32px);
}

.uc-root--float.uc-root--open .uc-chat {
    display: flex;
}

.uc-root--float.uc-root--open .uc-launcher {
    display: none;
}

.uc-launcher {
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: #3f6b4f;
    color: #ffffff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

@media (max-width: 480px) {
    .uc-root--float {
        right: 8px;
        left: 8px;
        bottom: 8px;
    }

    .uc-root--float .uc-chat {
        width: 100%;
        max-width: none;
    }

    .uc-launcher {
        float: right;
    }
}

@media (max-width: 480px) {
    .uc-chat {
        max-width: none;
        height: calc(100vh - 24px);
        border-radius: 10px;
    }
}
