.d1-audit-assistant {
    position: fixed;
    right: 24px;
    bottom: 100px;
    z-index: 2147483647;
    font-family: Montserrat, Arial, sans-serif;
}

.d1-audit-button {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: #7367f0;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 14px 35px rgba(31, 38, 135, 0.28);
    cursor: pointer;
}

.d1-audit-window {
    display: none;
    width: min(380px, calc(100vw - 32px));
    max-height: min(620px, calc(100vh - 104px));
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid rgba(34, 41, 47, 0.12);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(34, 41, 47, 0.24);
}

.d1-audit-assistant.is-open .d1-audit-window {
    display: flex;
    flex-direction: column;
}

.d1-audit-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #7367f0;
    color: #fff;
}

.d1-audit-title {
    font-size: 15px;
    font-weight: 700;
}

.d1-audit-subtitle {
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.86;
}

.d1-audit-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
}

.d1-audit-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
    max-height: 340px;
    overflow-y: auto;
    padding: 14px;
    background: #f8f8fb;
}

.d1-audit-message {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 10px;
    color: #2f3440;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.d1-audit-message.is-user {
    align-self: flex-end;
    background: #7367f0;
    color: #fff;
}

.d1-audit-message.is-assistant {
    align-self: flex-start;
    background: #fff;
    border: 1px solid rgba(34, 41, 47, 0.08);
}

.d1-audit-message.is-pending {
    color: #6e6b7b;
}

.d1-audit-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(34, 41, 47, 0.08);
    background: #fff;
}

.d1-audit-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(34, 41, 47, 0.16);
    border-radius: 8px;
    padding: 10px 11px;
    font-size: 13px;
}

.d1-audit-form button {
    border: 0;
    border-radius: 8px;
    background: #7367f0;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 0 14px;
    cursor: pointer;
}

.d1-audit-form button:disabled,
.d1-audit-form input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (max-width: 575px) {
    .d1-audit-assistant {
        right: 16px;
        bottom: 92px;
    }

    .d1-audit-button {
        width: 54px;
        height: 54px;
    }
}

@media print {
    .d1-audit-assistant {
        display: none !important;
    }
}
