.da-chat {
    --da-accent: var(--primary-color, #0072BF);
    --da-accent-2: var(--secondary-color, #009EFF);
    --da-surface: #16181d;
    --da-surface-2: #1e2128;
    --da-surface-3: #272b34;
    --da-text: #eef1f6;
    --da-text-dim: #9aa3b2;
    --da-border: rgba(255, 255, 255, .09);
    --da-radius: 16px;
    --da-shadow: 0 18px 50px rgba(0, 0, 0, .45);
    --da-fab-size: 60px;
    --da-edge: 24px;

    font-family: inherit;
    color: var(--da-text);
}

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

.da-chat-fab {
    position: fixed;
    right: var(--da-edge);
    bottom: calc(var(--da-edge) + 66px);
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--da-fab-size);
    padding: 0 22px 0 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--da-accent), var(--da-accent-2));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .2px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 114, 191, .38);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.da-chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 38px rgba(0, 114, 191, .5);
}

.da-chat-fab:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.da-chat-fab__logo {
    width: 30px;
    height: 30px;
    flex: none;
    padding: 4px;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.da-chat-fab__label {
    white-space: nowrap;
}

.da-chat-fab__label--short {
    display: none;
}

.da-chat[data-open="true"] .da-chat-fab {
    opacity: 0;
    pointer-events: none;
}

.da-chat-panel {
    position: fixed;
    right: var(--da-edge);
    bottom: var(--da-edge);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    width: 420px;
    height: min(620px, calc(100vh - 2 * var(--da-edge)));
    border: 1px solid var(--da-border);
    border-radius: var(--da-radius);
    background: var(--da-surface);
    box-shadow: var(--da-shadow);
    overflow: hidden;
    transform: translateY(16px) scale(.98);
    opacity: 0;
    visibility: hidden;
    transition: transform .2s ease, opacity .2s ease, visibility .2s;
}

.da-chat[data-open="true"] .da-chat-panel {
    transform: none;
    opacity: 1;
    visibility: visible;
}

.da-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 14px 16px 18px;
    background: linear-gradient(135deg, var(--da-accent), var(--da-accent-2));
    color: #fff;
}

.da-chat-head__avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    background: #fff;
}

.da-chat-head__avatar img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.da-chat-head__text {
    min-width: 0;
    flex: 1;
}

.da-chat-head__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.da-chat-head__status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: .9;
}

.da-chat-head__status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34e07a;
}

.da-chat-head__close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
    transition: background .15s ease;
}

.da-chat-head__close:hover {
    background: rgba(255, 255, 255, .28);
}

.da-chat-head__close svg {
    width: 18px;
    height: 18px;
}

.da-chat-intro {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px 26px;
    text-align: center;
}

.da-chat-intro__icon {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.da-chat-intro__icon img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.da-chat-intro h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--da-text);
}

.da-chat-intro p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--da-text-dim);
}

.da-chat-intro__btn {
    margin-top: 6px;
    padding: 13px 30px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--da-accent), var(--da-accent-2));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease;
}

.da-chat-intro__btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.da-chat-intro__btn:disabled {
    opacity: .6;
    cursor: default;
}

.da-chat-intro__note {
    font-size: 11.5px;
    color: var(--da-text-dim);
}

.da-chat-intro__note a {
    color: var(--da-accent-2);
}

.da-chat-out-of-hours {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 183, 77, .12);
    color: #ffb74d;
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 1024px) {
    .da-chat {
        --da-edge: 18px;
    }
}

@media (max-width: 640px) {
    .da-chat {
        --da-edge: 14px;
        --da-fab-size: 54px;
    }

    .da-chat-fab {
        padding: 0 18px 0 14px;
        gap: 8px;
        bottom: calc(var(--da-edge) + env(safe-area-inset-bottom, 0px));
    }

    .da-chat-fab__label {
        display: none;
    }

    .da-chat-fab__label--short {
        display: inline;
        font-size: 14px;
    }

    .da-chat-panel {
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .da-chat-head {
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
    }
}

@media (max-height: 480px) and (max-width: 900px) {
    .da-chat-panel {
        inset: 0;
        width: 100%;
        height: 100dvh;
        border-radius: 0;
    }

    .da-chat-intro {
        gap: 10px;
        padding: 16px;
    }

    .da-chat-intro__icon {
        display: none;
    }
}

@media (min-width: 1600px) {
    .da-chat {
        --da-edge: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .da-chat-fab,
    .da-chat-panel {
        transition: none;
    }
}

body:not(.dark-scheme) .da-chat-panel {
    box-shadow: 0 18px 50px rgba(20, 30, 50, .28);
}
