:root {
    --dh-red: #ff6f61;
    --dh-red-hover: #d4584c;
    --dh-dark: #1e293b;
    --dh-bg: #f8fafc;
    --dh-border: #e2e8f0;
    --dh-text: #334155;
    --dh-dusty: #94a3b8;
}

/* Pulsante Fluttuante */
.dh-fab { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; background: var(--dh-red); color: white; padding: 1.25rem; border: none; cursor: pointer; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); transition: all 0.3s; display: flex; align-items: center; justify-content: center; outline: none; }
.dh-fab:hover { background: var(--dh-red-hover); transform: scale(1.1); }
.dh-fab.dh-hidden { opacity: 0; pointer-events: none; }

/* Finestra Chat - Allargata (30rem) e proporzionata */
.dh-window { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999999; width: 100%; max-width: 30rem; height: 600px; max-height: calc(100vh - 3rem); background: white; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); border: 1px solid var(--dh-border); display: flex; flex-direction: column; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; box-sizing: border-box; }
.dh-window * { box-sizing: border-box; }

/* Header */
.dh-header { background: var(--dh-red); color: white; padding: 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.dh-header-title { display: flex; align-items: center; gap: 0.75rem; }
.dh-header-text { display: flex; flex-direction: column; }
.dh-header-text strong { font-size: 1.35rem; line-height: 1.2; margin: 0; }
.dh-header-text span { font-size: 0.85rem; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px; }
.dh-close { background: transparent; border: none; color: white; cursor: pointer; padding: 0.25rem; transition: background 0.2s; display: flex; align-items: center; }
.dh-close:hover { background: rgba(255,255,255,0.2); }

/* Area Messaggi */
.dh-chat { flex: 1; overflow-y: auto; overflow-anchor: none; padding: 1.5rem; background: var(--dh-bg); display: flex; flex-direction: column; gap: 1.25rem; }
.dh-msg-row { display: flex; width: 100%; }
.dh-msg-row.dh-user { justify-content: flex-end; }
.dh-msg-row.dh-model { justify-content: flex-start; }
.dh-bubble-wrap { max-width: 92%; }

/* Testi più grandi (1.1rem) */
.dh-bubble { padding: 1.15rem 1.25rem; font-size: 1.1rem; line-height: 1.6; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); word-break: break-word; }
.dh-msg-row.dh-user .dh-bubble { background: var(--dh-red); color: white; border-bottom-right-radius: 0; }
.dh-msg-row.dh-model .dh-bubble { background: white; border: 1px solid var(--dh-border); color: var(--dh-text); }

/* Formattazione Testo interno (Markdown) */
.dh-bubble .markdown-body p { margin: 0 0 0.85rem 0; }
.dh-bubble .markdown-body p:last-child { margin: 0; }
.dh-bubble .markdown-body strong { color: var(--dh-dark); font-weight: 700; }
.dh-msg-row.dh-user .dh-bubble strong { color: white; }
.dh-bubble .markdown-body a { color: var(--dh-red); font-weight: 600; text-decoration: none; }
.dh-bubble .markdown-body a:hover { text-decoration: underline; }

/* Prodotti Consigliati */
.dh-models { display: grid; gap: 0.75rem; margin-top: 1rem; }
.dh-model-link { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.15rem; border: 1px solid rgba(148,163,184,0.3); background: white; text-decoration: none; color: inherit; transition: background 0.2s; }
.dh-model-link:hover { background: rgba(148,163,184,0.1); }
.dh-model-cat { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dh-dusty); margin-bottom: 0.35rem; line-height: 1; }
.dh-model-name { font-weight: bold; font-size: 1.1rem; color: var(--dh-dark); margin: 0 0 0.35rem 0; }
.dh-model-note { font-size: 0.95rem; color: var(--dh-dusty); margin-top: 0.25rem; line-height: 1.4; }
.dh-model-btn { color: var(--dh-red); font-size: 0.9rem; font-weight: 600; flex-shrink: 0; margin-top: 2px;}

/* Quick Replies */
.dh-qr-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.dh-qr { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.15rem; font-size: 1rem; font-weight: 600; border: 1px solid rgba(148,163,184,0.5); background: white; color: var(--dh-dark); cursor: pointer; transition: background 0.2s; }
.dh-qr:hover:not(:disabled) { background: rgba(148,163,184,0.2); }
.dh-qr:disabled { opacity: 0.5; cursor: not-allowed; }
.dh-qr svg { color: var(--dh-red); }

/* Loader */
.dh-loader { display: flex; justify-content: flex-start; }
.dh-loader-box { background: white; border: 1px solid var(--dh-border); padding: 1.15rem; display: flex; align-items: center; justify-content: center; }
.dh-spin { animation: dh-spin 1s linear infinite; color: var(--dh-red); }
@keyframes dh-spin { 100% { transform: rotate(360deg); } }

/* Footer / Input */
.dh-footer { padding: 1.15rem 1.25rem; border-top: 1px solid var(--dh-border); background: white; }
.dh-input-row { display: flex; gap: 0.5rem; }
.dh-input { flex: 1; border: 1px solid var(--dh-border); padding: 0.85rem 1rem; font-size: 1.05rem; outline: none; transition: border-color 0.2s; background: white; color: var(--dh-dark); margin: 0; }
.dh-input:focus { border-color: var(--dh-red); }
.dh-send { background: var(--dh-red); color: white; border: none; padding: 0.85rem 1.15rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; margin: 0; }
.dh-send:hover:not(:disabled) { background: var(--dh-red-hover); }
.dh-send:disabled { opacity: 0.5; cursor: not-allowed; }
.dh-footer-note { margin-top: 0.85rem; text-align: center; font-size: 0.8rem; color: var(--dh-dusty); }