.maca-site-chat {
    --maca-chat-accent: #1f6f4a;
    --maca-chat-bg: #ffffff;
    --maca-chat-border: #d8e2dc;
    font-family: inherit;
    max-width: 420px;
}

.maca-site-chat--floating {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 99990;
    max-width: min(420px, calc(100vw - 32px));
}

.maca-site-chat-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 56px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--maca-chat-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.maca-site-chat-panel {
    margin-top: 12px;
    border: 1px solid var(--maca-chat-border);
    border-radius: 16px;
    background: var(--maca-chat-bg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.maca-site-chat--floating .maca-site-chat-panel {
    margin-top: 0;
}

.maca-site-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #f4f8f5;
    border-bottom: 1px solid var(--maca-chat-border);
}

.maca-site-chat-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.maca-site-chat-title {
    font-weight: 600;
}

.maca-site-chat-avatar,
.maca-site-chat-toggle-avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.maca-site-chat-toggle-avatar {
    display: block;
}

.maca-site-chat-toggle:has(.maca-site-chat-toggle-avatar) {
    min-width: 56px;
    min-height: 56px;
    padding: 4px;
}

.maca-site-chat-close {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}

.maca-site-chat-messages {
    min-height: 180px;
    max-height: 320px;
    overflow: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.maca-site-chat-message {
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.maca-site-chat-message--user {
    align-self: flex-end;
    background: #e8f3ec;
}

.maca-site-chat-message--assistant {
    align-self: flex-start;
    background: #f5f5f5;
}

.maca-site-chat-message-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.maca-site-chat-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    border: 0;
    border-radius: 10px;
    padding: 8px 14px;
    background: var(--maca-chat-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.maca-site-chat-cta--booking {
    width: 100%;
}

.maca-site-chat-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.maca-site-chat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--maca-chat-border);
    background: #fff;
    color: var(--maca-chat-accent);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
}

.maca-site-chat-link:hover,
.maca-site-chat-link:focus {
    background: #eef6f0;
}

.maca-site-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--maca-chat-border);
}

.maca-site-chat-input {
    width: 100%;
    resize: vertical;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--maca-chat-border);
    border-radius: 10px;
    font: inherit;
}

.maca-site-chat-send {
    align-self: end;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--maca-chat-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.maca-site-chat-send:disabled {
    opacity: 0.6;
    cursor: wait;
}

.maca-site-chat--admin-test {
    max-width: 640px;
    margin-top: 12px;
}

.maca-site-chat--admin-test .maca-site-chat-panel {
    margin-top: 0;
}

.maca-site-chat--admin-test .maca-site-chat-messages {
    min-height: 220px;
    max-height: 420px;
}

@media (max-width: 480px) {
    .maca-site-chat--floating {
        right: 12px;
        bottom: 12px;
    }

    .maca-site-chat-messages {
        max-height: 50vh;
    }
}

.maca-site-chat-avatar-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.maca-site-chat-avatar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 96px;
    padding: 10px;
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: center;
}

.maca-site-chat-avatar-option:has(input:checked) {
    border-color: #1f6f4a;
    box-shadow: 0 0 0 1px #1f6f4a;
}

.maca-site-chat-avatar-option input {
    margin: 0;
}

.maca-site-chat-avatar-option img,
.maca-site-chat-avatar-preview img {
    border-radius: 50%;
    object-fit: cover;
}

.maca-site-chat-avatar-option-custom-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f0f0f1;
    color: #50575e;
    font-size: 28px;
    line-height: 1;
}

.maca-site-chat-avatar-custom {
    margin-top: 4px;
}
