.chat-widget {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1200;
    width: min(360px, calc(100vw - 24px));
    font-family: Arial, sans-serif;
}

.chat-toggle {
    width: 100%;
    border: 0;
    border-radius: 999px;
    background: #0f766e;
    color: #fff;
    padding: 12px 16px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.chat-panel {
    margin-top: 10px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #d7e2e1;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.17);
    display: flex;
    flex-direction: column;
    max-height: min(600px, calc(100vh - 110px));
}

.chat-header {
    background: #115e59;
    color: #fff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-close {
    border: 0;
    background: transparent;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.chat-close:hover,
.chat-close:focus-visible {
    background: rgba(255, 255, 255, 0.18);
}

.chat-messages {
    height: 280px;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
}

.chat-message {
    max-width: 85%;
    padding: 9px 11px;
    border-radius: 10px;
    line-height: 1.4;
    font-size: 14px;
}

.chat-message.user {
    margin-left: auto;
    background: #0f766e;
    color: #fff;
}

.chat-message.bot {
    margin-right: auto;
    background: #fff;
    border: 1px solid #dce7e6;
    color: #1f2937;
}

.chat-options {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #ecf0f4;
    background: #fff;
    height: 116px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.chat-options.is-disabled {
    pointer-events: none;
    opacity: 0.7;
}

.chat-option-btn {
    border: 1px solid #0f766e;
    border-radius: 999px;
    background: #fff;
    color: #0f766e;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.chat-option-btn:hover,
.chat-option-btn:focus-visible {
    background: #0f766e;
    color: #fff;
}

.chat-option-btn--primary {
    background: #0f766e;
    color: #fff;
}

.chat-option-btn--ghost {
    border-style: dashed;
    color: #334155;
    border-color: #94a3b8;
}

.chat-contact-form {
    width: 100%;
    display: grid;
    gap: 6px;
}

.chat-contact-label {
    font-size: 12px;
    color: #334155;
    font-weight: 600;
}

.chat-contact-input {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.chat-contact-input:invalid {
    border-color: #dc2626;
}

.chat-contact-submit {
    margin-top: 4px;
    border: 0;
    border-radius: 8px;
    padding: 9px 10px;
    background: #0f766e;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.chat-loading {
    font-size: 12px;
    color: #475569;
    padding: 0 12px 10px;
    min-height: 26px;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.chat-loading.is-visible {
    opacity: 1;
}

@media (max-width: 640px) {
    .chat-widget {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 74px;
    }

    .chat-messages {
        height: 240px;
    }

    .chat-options {
        height: 104px;
    }
}
