/* MY AI NOW · Assistente interno (26/10/2026) — file separato da app.css */
.ass { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem; }
.ass[hidden] { display: none; }
.ass-apri { font: inherit; font-weight: 800; font-size: var(--t-s); display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.3rem 1.1rem 0.3rem 0.3rem; border: 0; border-radius: 999px; background: var(--magenta-deep); color: var(--white); cursor: pointer; box-shadow: 0 6px 22px rgba(20, 10, 30, 0.22); }
.ass-apri:hover { filter: brightness(1.08); }
.ass-apri:focus-visible, .ass-ico:focus-visible, .ass-invia:focus-visible, .ass-esempi button:focus-visible { outline: 3px solid var(--magenta-deep); outline-offset: 2px; }
.ass.aperto .ass-apri { display: none; }
.ass-pannello { width: min(26rem, calc(100vw - 2rem)); height: min(38rem, calc(100vh - 7rem)); display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--ink-line); border-radius: 20px; box-shadow: 0 16px 48px rgba(20, 10, 30, 0.22); overflow: hidden; }
.ass-pannello[hidden] { display: none; }
.ass-testa { display: flex; align-items: center; gap: 0.25rem; padding: 0.85rem 0.75rem 0.85rem 1.1rem; border-bottom: 1px solid var(--ink-line); background: var(--paper); }
.ass-testa div { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.ass-testa strong { font-size: var(--t-s); }
.ass-testa span { font-size: var(--t-xs); color: var(--ink-soft); }
.ass-ico { display: inline-flex; padding: 0.4rem; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; }
.ass-ico:hover { color: var(--magenta-deep); background: var(--lavender-tint); }
.ass-corpo { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.65rem; font-size: var(--t-s); }
.ass-msg { max-width: 88%; padding: 0.6rem 0.85rem; border-radius: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.ass-msg p { margin: 0 0 0.45rem; } .ass-msg p:last-child { margin-bottom: 0; }
.ass-msg ul, .ass-msg ol { margin: 0.2rem 0 0.45rem; padding-left: 1.3rem; }
.ass-msg ul { list-style: disc; } .ass-msg ol { list-style: decimal; } .ass-msg li { margin: 0.15rem 0; display: list-item; }
.ass-msg code { font-size: 0.9em; background: rgba(0, 0, 0, 0.06); border-radius: 4px; padding: 0 0.25rem; }
.ass-msg a { color: var(--magenta-deep); }
.ass-bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--ink-line); border-bottom-left-radius: 4px; }
.ass-tu { align-self: flex-end; background: var(--magenta-deep); color: var(--white); border-bottom-right-radius: 4px; }
.ass-err { border-color: #e9b8cb; background: #f9dfe9; color: var(--magenta-night); }
.ass-chip { display: inline-block; margin-top: 0.4rem !important; font-size: var(--t-xs); font-weight: 700; color: #1b6b3a; background: #dff3e6; border-radius: 999px; padding: 0.2rem 0.6rem; }
.ass-esempi { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.ass-esempi button { font: inherit; font-size: var(--t-xs); text-align: left; padding: 0.45rem 0.75rem; border: 1px dashed var(--ink-line); border-radius: 12px; background: none; color: var(--ink); cursor: pointer; }
.ass-esempi button:hover { border-color: var(--magenta-deep); color: var(--magenta-deep); }
.ass-attesa { display: flex; align-items: center; gap: 0.3rem; }
.ass-attesa span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-soft); animation: ass-punto 1.2s infinite ease-in-out; }
.ass-attesa span:nth-child(2) { animation-delay: 0.15s; } .ass-attesa span:nth-child(3) { animation-delay: 0.3s; }
.ass-attesa em { font-style: normal; font-size: var(--t-xs); color: var(--ink-soft); margin-left: 0.35rem; }
@keyframes ass-punto { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ass-attesa span { animation: none; } }
.ass-form { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--ink-line); }
.ass-form textarea { flex: 1; font: inherit; font-size: var(--t-s); resize: none; max-height: 8rem; padding: 0.6rem 0.75rem; border: 2px solid var(--ink-line); border-radius: 12px; background: var(--paper); color: var(--ink); }
.ass-form textarea:focus { outline: none; border-color: var(--magenta-deep); }
.ass-invia { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; flex: none; border: 0; border-radius: 12px; background: var(--magenta-deep); color: var(--white); cursor: pointer; }
@media (max-width: 760px) { .ass { right: 0.75rem; bottom: 0.75rem; } .ass-apri span { display: none; } .ass-apri { padding: 0.3rem; } }
.ass-msg a.ass-voce { color: var(--magenta-deep); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; border-radius: 4px; }
.ass-msg a.ass-voce:hover { background: var(--lavender-tint); }
.ass-msg a.ass-voce.qui { text-decoration: none; background: var(--lavender-tint); padding: 0 0.2rem; }
.ass-msg a.ass-voce.qui::after { content: " ●"; font-size: 0.7em; color: var(--magenta); }
/* schermi larghi: chat aperta = colonna fissa a destra, il resto della pagina si stringe e resta tutto visibile */
@media (min-width: 1100px) {
  body.ass-aperta { padding-right: 25rem; }
  .ass.aperto { top: 0; right: 0; bottom: 0; }
  .ass.aperto .ass-pannello { width: 25rem; height: 100vh; border-radius: 0; border-width: 0 0 0 1px; box-shadow: -8px 0 32px rgba(20, 10, 30, 0.08); }
}

/* viso di Seb: pulsante e testata della chat */
.ass-viso { width: 2.75rem; height: 2.75rem; border-radius: 50%; object-fit: cover; object-position: 50% 40%; background: var(--paper); border: 2px solid var(--white); flex: none; display: block; }
.ass-viso-testa { width: 2.4rem; height: 2.4rem; border-color: var(--lavender-tint); margin-right: 0.5rem; }
.ass-apri:hover .ass-viso { transform: rotate(-6deg); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.ass.in-benvenuto .ass-apri { opacity: 0; pointer-events: none; }

/* benvenuto animato di Seb (tutti gli utenti) */
.seb-benv { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 45; display: flex; align-items: flex-end; gap: 0.25rem; max-width: min(30rem, calc(100vw - 1.5rem)); pointer-events: none; }
.seb-benv > * { pointer-events: auto; }
.seb-posa { width: 8.75rem; height: auto; flex: none; border-radius: 22px; background: #eef2f8; box-shadow: 0 12px 36px rgba(20, 10, 30, 0.18); transform: translateY(120%) rotate(8deg); opacity: 0; transform-origin: 50% 100%; }
.seb-nuvola { position: relative; background: var(--white); border: 1px solid var(--ink-line); border-radius: 20px 20px 4px 20px; padding: 1rem 2.25rem 1rem 1.1rem; margin-bottom: 4.5rem; box-shadow: 0 12px 36px rgba(20, 10, 30, 0.16); font-size: var(--t-s); line-height: 1.45; opacity: 0; transform: translateY(12px) scale(0.96); transform-origin: 100% 100%; }
.seb-nuvola p { margin: 0 0 0.4rem; } .seb-nuvola p:last-of-type { margin-bottom: 0; }
.seb-nuvola strong { color: var(--magenta-deep); }
.seb-x { position: absolute; top: 0.4rem; right: 0.4rem; display: inline-flex; padding: 0.3rem; border: 0; background: none; color: var(--ink-soft); border-radius: 8px; cursor: pointer; }
.seb-x:hover { color: var(--magenta-deep); background: var(--lavender-tint); }
.seb-x svg { width: 16px; height: 16px; }
.seb-parla { font: inherit; font-weight: 700; font-size: var(--t-xs); margin-top: 0.7rem; padding: 0.5rem 0.9rem; border: 0; border-radius: 999px; background: var(--magenta-deep); color: var(--white); cursor: pointer; }
.seb-cliccabile .seb-posa { cursor: pointer; }
.seb-benv.entra .seb-posa { animation: seb-entra 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards, seb-saluta 1.6s 0.9s ease-in-out 2; }
.seb-benv.entra .seb-nuvola { animation: seb-nuvola 0.6s 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.seb-benv.esce { transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.7, 0, 0.84, 0); opacity: 0; transform: translateY(24px); }
.seb-benv.esce .seb-posa, .seb-benv.esce .seb-nuvola { opacity: 1; transform: none; }
@keyframes seb-entra { to { transform: translateY(0) rotate(0); opacity: 1; } }
@keyframes seb-saluta { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(4deg); } }
@keyframes seb-nuvola { to { opacity: 1; transform: none; } }
.seb-parla:focus-visible, .seb-x:focus-visible { outline: 3px solid var(--magenta-deep); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .seb-benv.entra .seb-posa, .seb-benv.entra .seb-nuvola { animation: none; opacity: 1; transform: none; }
}
@media (max-width: 760px) { .seb-benv { right: 0.75rem; bottom: 0.75rem; } .seb-posa { width: 6.5rem; } .seb-nuvola { margin-bottom: 3rem; } }

/* pagina "Chat di Seb" */
.seb-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.seb-log > li { border: 1px solid var(--ink-line); border-radius: 16px; background: var(--white); padding: 0.85rem 1rem; }
.seb-log-riga { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.seb-log-testo { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; flex: 1; }
.seb-log-prima { font-size: var(--t-s); color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seb-log-chat { margin-top: 0.8rem; border-top: 1px solid var(--ink-line); padding-top: 0.8rem; }
.seb-log-corpo { max-height: 32rem; padding: 0; }

/* pulsante Invia con il viso di Seb */
.ass-invia { width: 3rem; height: 3rem; padding: 0; border-radius: 50%; background: var(--magenta-deep); box-shadow: 0 4px 14px rgba(184, 50, 122, 0.3); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.ass-invia:hover { transform: scale(1.06) rotate(-6deg); }
.ass-invia:active { transform: scale(0.95); }
.ass-viso-invia { width: calc(100% - 6px); height: calc(100% - 6px); border: 0; }
.ass-invia:disabled, .ass-form[aria-busy="true"] .ass-invia { opacity: 0.6; }

/* 26/10/2026 · Seb senza sfondo, con alone sui contorni */
.ass-viso { background: radial-gradient(circle at 50% 45%, #f3e9f6 0%, #d9c6ec 60%, #b8a3d8 100%); object-fit: cover; object-position: 50% 50%; }
.ass-apri .ass-viso, .ass-invia .ass-viso-invia { box-shadow: 0 0 0 2px var(--white), 0 0 14px 2px rgba(217, 74, 146, 0.55); }
.ass-invia .ass-viso-invia { border: 0; }
.seb-posa { width: 12rem; height: auto; border-radius: 0; background: none; box-shadow: none;
  filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 10px rgba(217, 74, 146, 0.55)) drop-shadow(0 0 22px rgba(137, 123, 184, 0.45)); }
@media (max-width: 760px) { .seb-posa { width: 8.5rem; } }

/* Allegati della chat (26/10/2026): graffetta, anteprime prima dell'invio, allegati nei messaggi, trascinamento */
.ass-clip { align-self: center; flex: none; }
.ass-pannello { position: relative; }
.ass-pannello.ass-drop::after { content: ""; position: absolute; inset: 0.5rem; border: 3px dashed var(--magenta-deep); border-radius: 16px; background: rgba(217, 74, 146, 0.08); pointer-events: none; }
.ass-allegati { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.6rem 0.75rem 0; border-top: 1px solid var(--ink-line); }
.ass-allegati[hidden], .ass-avviso[hidden] { display: none; }
.ass-allegati + .ass-avviso + .ass-form, .ass-allegati:not([hidden]) ~ .ass-form { border-top: 0; }
.ass-all { display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%; padding: 0.2rem 0.2rem 0.2rem 0.25rem; border: 1px solid var(--ink-line); border-radius: 10px; background: var(--paper); font-size: 0.8rem; color: var(--ink); }
.ass-all img { width: 2.25rem; height: 2.25rem; object-fit: cover; border-radius: 6px; flex: none; }
.ass-all i { display: inline-flex; color: var(--magenta-deep); flex: none; }
.ass-all span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11rem; }
.ass-all button { display: inline-flex; padding: 0.15rem; border: 0; border-radius: 6px; background: none; color: var(--ink-soft); cursor: pointer; flex: none; }
.ass-all button svg { width: 14px; height: 14px; }
.ass-all button:hover { color: var(--magenta-deep); background: var(--lavender-tint); }
.ass-all.carico { opacity: 0.6; }
.ass-all.carico span::after { content: " …"; }
.ass-avviso { margin: 0; padding: 0.4rem 0.75rem 0; font-size: 0.8rem; color: var(--magenta-deep); }
.ass-msg-all { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.ass-msg-all:first-child { margin-top: 0; }
.ass-msg-img img { display: block; max-width: 11rem; max-height: 8rem; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.5); background: var(--white); }
.ass-msg-doc { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.5rem; border-radius: 8px; background: rgba(255, 255, 255, 0.18); color: inherit; font-size: 0.8rem; text-decoration: none; max-width: 100%; }
.ass-msg-doc svg { width: 16px; height: 16px; flex: none; }
.ass-msg-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ass-msg-doc:hover { text-decoration: underline; }
.ass-bot .ass-msg-doc { background: var(--lavender-tint); }
.ass-tu .ass-msg-doc, .ass-tu .ass-msg-doc:visited { color: var(--white); background: rgba(255, 255, 255, 0.2); }
.ass-bot .ass-msg-doc, .ass-bot .ass-msg-doc:visited { color: var(--ink); }
