.divpaz-chat-wrapper {
    max-width: 1240px;
    margin: 1.5rem auto;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    background: #f8fafc;
    padding: 1rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-sizing: border-box;
}

.divpaz-chat-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.divpaz-chat-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #111827;
}

.divpaz-chat-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
}

.divpaz-chat-log {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.divpaz-chat-placeholder {
    font-size: 0.9rem;
    color: #6b7280;
    padding: 0.75rem;
}

.divpaz-msg-row {
    display: flex;
    margin-bottom: 0.5rem;
}
/*
.divpaz-msg-row-user {
    justify-content: flex-end;
}

.divpaz-msg-row-assistant {
    justify-content: flex-start;
}
*/
/* Utente: a SINISTRA, blu */
.divpaz-msg-row-user {
    justify-content: flex-start;
}

/* DIV-PAZ: a DESTRA, grigio */
.divpaz-msg-row-assistant {
    justify-content: flex-end;
}



/* Vecchio

.divpaz-msg-bubble {
    max-width: 80%;
    padding: 0.6rem 0.75rem;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.35;
    word-wrap: break-word;
    white-space: pre-wrap;
}


.divpaz-msg-bubble {
    max-width: 80%;
    padding: 0.6rem 0.75rem;
    border-radius: 14px;
    font-size: 1rem;        prima 0.95rem 
    line-height: 1.25;      prima 1.35 
    word-wrap: break-word;
    white-space: pre-wrap;
}

*/

.divpaz-msg-bubble {
    max-width: 80%;
    padding: 0.5rem 0.65rem;
    border-radius: 14px;
    font-size: 1rem;
    line-height: 1.18;      /* più compatto */
    word-wrap: break-word;
    white-space: pre-wrap;
}






/*
.divpaz-msg-user {
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.divpaz-msg-assistant {
    background: #e5e7eb;
    color: #111827;
    border-bottom-left-radius: 4px;
}
*/

/** Bolla utente (domanda) */
.divpaz-msg-user {
    background: #2563eb;
    /*color: #ffffff;*/
	color: #DDFFDD;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 14px;
}

/* Bolla assistente (risposta) */
.divpaz-msg-assistant {
    background: #e5e7eb;
    color: #111827;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 14px;
}


.divpaz-chat-form {
    margin-top: 0.5rem;
}

.divpaz-label {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: #374151;
}

/* Vecchio
.divpaz-textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.6rem;
    resize: vertical;
    font-size: 0.95rem;
    min-height: 90px;
}
*/

.divpaz-textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.6rem;
    resize: vertical;
    font-size: 1rem;   /* leggermente più grande */
    min-height: 90px;
	/*color: #DDFFDD;	*/
	background: #E7FFE7;	
}


.divpaz-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37,99,235,0.25);
}

.divpaz-form-footer {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.divpaz-submit-btn {
    border: none;
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: #2563eb;
    color: #ffffff;
    transition: background 0.15s ease, transform 0.05s ease;
}


.divpaz-reset-btn {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #4b5563;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    margin-left: 0.5rem;
}

.divpaz-reset-btn:hover {
    background: #f3f4f6;
}





.divpaz-submit-btn:hover {
    background: #1d4ed8;
}

.divpaz-submit-btn:active {
    transform: scale(0.98);
}

.divpaz-hint {
    font-size: 0.80rem;
    color: #6b7280;
    max-width: 60%;
}
@media (min-width: 900px) {
    .divpaz-chat-log {
        max-height: 420px;   /* un po’ più alto su desktop */
    }

    .divpaz-chat-wrapper {
        padding: 1.25rem 1.5rem;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .divpaz-chat-wrapper {
        margin: 0.75rem;
        padding: 0.75rem;
    }

    .divpaz-msg-bubble {
        max-width: 100%;
    }

    .divpaz-hint {
        max-width: 100%;
    }
}


/*History*/

.divpaz-history-wrapper {
    margin-top: 1rem;
}

.divpaz-history-title {
    font-weight: 500;
    font-size: 0.95rem;
    color: #374151;
    margin-bottom: 0.25rem;
}

.divpaz-history-log {
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
	line-height: 1.2;   /* aggiungi questa */
}

.divpaz-history-entry {
    margin-bottom: 0.4rem;
}

.divpaz-history-label {
    font-weight: 600;
    margin-right: 0.25rem;
}

.divpaz-history-user .divpaz-history-label {
    color: #2563eb;
}

.divpaz-history-assistant .divpaz-history-label {
    color: #111827;
}

.divpaz-history-text {
    color: #374151;
}


.divpaz-reset-btn {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #4b5563;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    margin-left: 0.5rem;
}

.divpaz-reset-btn:hover {
    background: #f3f4f6;
}

