#dcra-widget,
#dcra-widget * {
    box-sizing: border-box;
}

#dcra-widget {
    --dcra-color: #155eef;
    --dcra-heading-color: #172033;
    --dcra-link-color: #155eef;
    position: fixed;
    z-index: 999999;
    bottom: 22px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    line-height: 1.45;
}

#dcra-widget.dcra-right {
    right: 22px;
}

#dcra-widget.dcra-left {
    left: 22px;
}

#dcra-widget .dcra-launcher {
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: var(--dcra-color);
    color: #fff;
    box-shadow: 0 8px 26px rgb(18 38 79 / 25%);
    cursor: pointer;
    font-size: 27px;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

#dcra-widget .dcra-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 11px 30px rgb(18 38 79 / 30%);
}

#dcra-widget .dcra-laundry-icon {
    font-size: 20px;
    font-weight: 750;
}

#dcra-widget .dcra-launcher img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

#dcra-widget .dcra-launcher:focus-visible,
#dcra-widget button:focus-visible,
#dcra-widget input:focus-visible,
#dcra-widget textarea:focus-visible {
    outline: 3px solid #8bb5ff;
    outline-offset: 3px;
}

#dcra-widget .dcra-launcher.is-hidden {
    display: none;
}

#dcra-widget .dcra-panel {
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 76px;
    right: 0;
    width: min(390px, calc(100vw - 32px));
    height: min(600px, calc(100dvh - 116px));
    min-height: 360px;
    overflow: hidden;
    border: 1px solid #e5e9f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 60px rgb(15 23 42 / 20%);
}

#dcra-widget.dcra-left .dcra-panel {
    right: auto;
    left: 0;
}

#dcra-widget .dcra-panel[hidden] {
    display: none;
}

#dcra-widget .dcra-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 74px;
    padding: 12px 14px;
    background: var(--dcra-color);
    color: #fff;
}

#dcra-widget .dcra-avatar,
#dcra-widget .dcra-preview-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    background: rgb(255 255 255 / 20%);
    color: #fff;
    font-weight: 700;
}

#dcra-widget .dcra-title {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

#dcra-widget .dcra-avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

#dcra-widget .dcra-title strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#dcra-widget .dcra-title span {
    color: rgb(255 255 255 / 82%);
    font-size: 12px;
}

#dcra-widget .dcra-close {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

#dcra-widget .dcra-new-chat {
    display: grid;
    flex: 0 0 36px;
    place-items: center;
    width: 36px;
    height: 34px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 45%);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

#dcra-widget .dcra-new-chat:hover {
    background: rgb(255 255 255 / 15%);
}

#dcra-widget .dcra-close:hover {
    background: rgb(255 255 255 / 15%);
}

#dcra-widget .dcra-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    padding: 18px 16px 10px;
    background: #f8fafc;
    overscroll-behavior: contain;
}

#dcra-widget .dcra-message {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 14px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

#dcra-widget .dcra-message-assistant {
    align-self: flex-start;
    border: 1px solid #e7ebf1;
    border-bottom-left-radius: 5px;
    background: #fff;
}

#dcra-widget .dcra-message-visitor {
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    background: var(--dcra-color);
    color: #fff;
}

#dcra-widget .dcra-message-error {
    border-color: #f4c7c7;
    background: #fff6f6;
    color: #9b1c1c;
}

#dcra-widget .dcra-message-assistant h3,
#dcra-widget .dcra-message-assistant h4 {
    margin: 0 0 7px;
    color: var(--dcra-heading-color);
    font-size: 15px;
    line-height: 1.35;
}

#dcra-widget .dcra-message-assistant h4 {
    font-size: 14px;
}

#dcra-widget .dcra-message-assistant p {
    margin: 0 0 7px;
}

#dcra-widget .dcra-message-assistant p:last-child {
    margin-bottom: 0;
}

#dcra-widget .dcra-message-assistant ul {
    margin: 0 0 7px;
    padding-left: 20px;
}

#dcra-widget .dcra-message-assistant ol {
    margin: 0 0 7px;
    padding-left: 22px;
}

#dcra-widget .dcra-message-assistant a {
    color: var(--dcra-link-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

#dcra-widget .dcra-message-assistant strong {
    color: var(--dcra-heading-color);
}

#dcra-widget .dcra-privacy {
    margin: 0;
    padding: 7px 14px 0;
    background: #fff;
    color: #667085;
    font-size: 10px;
}

#dcra-widget .dcra-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px 14px;
    background: #fff;
}

#dcra-widget .dcra-form textarea {
    min-width: 0;
    flex: 1;
    height: 44px;
    min-height: 44px;
    max-height: 120px;
    padding: 11px 13px;
    border: 1px solid #d5dbe5;
    border-radius: 12px;
    background: #fff;
    color: #172033;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
}

#dcra-widget .dcra-form textarea::placeholder {
    color: #7d8798;
}

#dcra-widget .dcra-form button {
    min-width: 64px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: var(--dcra-color);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
}

#dcra-widget .dcra-form button:disabled {
    cursor: wait;
    opacity: .6;
}

@media (max-width: 480px) {
    #dcra-widget {
        bottom: 12px;
    }

    #dcra-widget.dcra-right {
        right: 12px;
    }

    #dcra-widget.dcra-left {
        left: 12px;
    }

    #dcra-widget .dcra-panel {
        position: fixed;
        right: 8px;
        bottom: 82px;
        left: 8px;
        width: auto;
        height: min(650px, calc(100dvh - 100px));
        min-height: 320px;
        border-radius: 16px;
    }

    #dcra-widget.dcra-left .dcra-panel {
        right: 8px;
        left: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #dcra-widget * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
