.b-chat-page { max-width: 960px; padding-bottom: clamp(30px, 5vw, 72px); }
.b-chat-page-header { padding-block: 12px 20px; }
.b-chat-page-header h1 { font-size: clamp(38px, 6.4vw, 68px); line-height: 1.04; margin: 0; }
.b-chat-page .b-inquiry-wrap { margin-top: 44px; }
.b-chat { min-width: 0; background: #fbf8f0; color: #282e26; border: 1px solid var(--b-line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.b-chat-notice { padding: 11px 16px; margin: 0; font-size: 12px; line-height: 1.45; color: #50534a; border-bottom: 1px solid var(--b-line); }
.b-chat-notice a, .b-chat-actions a, .b-chat-actions button, .b-chat-sources a { text-decoration: underline; text-underline-offset: 3px; }
.b-chat-thread { flex: 1 1 auto; overflow-y: auto; overscroll-behavior-y: contain; touch-action: pan-y; min-height: 120px; max-height: min(55dvh, 470px); padding: clamp(12px, 2.8vw, 23px); scrollbar-color: #ac9f83 #fbf8f0; }
.b-chat-thread:focus-visible { outline: 2px solid #73623f; outline-offset: -3px; }
.b-chat-bubble { width: fit-content; max-width: min(94%, 660px); padding: 10px 14px 11px; margin-block: 0 10px; border-radius: 16px; line-height: 1.52; font-size: .94rem; overflow-wrap: anywhere; }
.b-chat-bubble p { margin: 2px 0 0; }
.b-chat-bubble p + * { margin-top: 10px; }
.b-chat-reply { background: #f1ebe0; border-end-start-radius: 4px; }
.b-chat-user { margin-inline-start: auto; background: #343e30; color: #fffcf4; border-end-end-radius: 4px; }
.b-chat-speaker { display: block; font-size: .75rem; font-weight: 700; }
.b-chat-prompts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.b-chat-prompts button { padding: 8px 11px; border: 1px solid #b5a782; border-radius: 30px; min-height: 44px; background: #fffcf4; color: #34392d; font: inherit; font-size: .82rem; text-align: left; cursor: pointer; }
.b-chat-prompts button:hover { background: #ede6d7; }
.b-chat-bottom { padding: 11px clamp(12px, 2.8vw, 23px); border-top: 1px solid var(--b-line); background: #fffdf8; }
.b-chat-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0; }
.b-chat-composer input { min-width: 0; min-height: 46px; width: 100%; padding: 8px 12px; font: inherit; font-size: 16px; color: inherit; border: 1px solid #9d947e; border-radius: 11px; background: #fff; }
.b-chat-composer .b-button { min-height: 46px; border-radius: 11px; padding-inline: clamp(10px, 2.5vw, 20px); letter-spacing: .04em; }
.b-chat-composer .b-button:disabled { opacity: .65; cursor: default; }
.b-chat-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.b-chat-actions, .b-chat-direct { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 18px; }
.b-chat-actions > *, .b-chat-direct > * { display: inline-flex; align-items: center; min-height: 42px; }
.b-chat-actions > * { border: 0; color: #394531; background: none; padding: 0; font: inherit; font-size: .84rem; cursor: pointer; }
.b-chat-actions button:disabled { opacity: .65; cursor: default; }
.b-chat-error { margin: 0 0 8px; color: #7b331b; font-size: .88rem; }
.b-chat-sources { display: grid; gap: 7px; }
.b-chat .b-assistant-products { grid-template-columns: minmax(0, 1fr); gap: 7px; margin-block: 9px; }
.b-chat .b-assistant-product { grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px; border-radius: 9px; }
.b-chat .b-assistant-product img { height: 52px; }
.b-chat .b-assistant-product strong { font-size: 18px; }
.b-chat .b-assistant-product span { font-size: .83rem; margin-top: 3px; }
.b-lab-assistance { margin-block: clamp(34px, 7vw, 78px); scroll-margin-top: 100px; }
.b-lab-assistance h2 { margin-bottom: 16px; }
.b-lab-assistance .b-chat { margin-top: 0; }
.b-lab-assistance .b-chat-contact { margin-top: 16px; }
.b-chat-contact:focus { outline: 2px solid #73623f; outline-offset: 4px; }
.b-chat-contact .b-chat-direct { margin-top: 12px; }
.b-assistant-fab.b-chat-launcher { width: 46px; height: 46px; min-height: 46px; padding: 0; justify-content: center; }
.b-chat-launcher svg { width: 20px; height: 20px; }
.b-assistant-fab.b-chat-launcher .b-chat-tip { position: absolute; right: calc(100% + 9px); display: block; width: max-content; max-width: calc(100vw - 85px); padding: 8px 12px; border-radius: 20px; background: #30382b; color: #fff; pointer-events: none; }
.b-chat-handoff { display: grid; gap: 9px; font-size: .9rem; }
.b-chat-handoff form, .b-chat-handoff label { display: grid; gap: 8px; }
.b-chat-handoff h3, .b-chat-handoff p { margin: 0; }
.b-chat-handoff p { line-height: 1.5; }
.b-chat-handoff a { text-decoration: underline; text-underline-offset: 3px; }
.b-chat-handoff textarea { width: 100%; min-height: 54px; padding: 8px 10px; border: 1px solid #9d947e; border-radius: 8px; background: #fff; color: inherit; font: inherit; font-size: 16px; resize: vertical; }
.b-chat-handoff .b-button, .b-chat-handoff .b-text-link { justify-self: start; }
.b-chat-handoff .b-text-link { border: 0; background: transparent; cursor: pointer; min-height: 44px; }
.b-overlay.b-overlay-chat { top: var(--b-dialog-top, 0); bottom: auto; height: var(--b-dialog-vh, 100dvh); overflow: hidden; overscroll-behavior: contain; }
.b-overlay-chat .b-dialog { width: min(640px, 100%); max-height: min(730px, calc(var(--b-dialog-vh, 100dvh) - 48px)); display: flex; flex-direction: column; padding: 16px; border-radius: 23px; overflow: hidden; }
.b-overlay-chat .b-dialog-head { flex: 0 0 auto; margin: 0 0 8px; padding-inline: 3px; }
.b-overlay-chat .b-chat { flex: 1 1 auto; min-height: 0; }
.b-overlay-chat .b-chat-notice { flex: 0 0 auto; }
.b-overlay-chat .b-chat-thread { min-height: 0; max-height: min(46dvh, 360px); }
.b-overlay-chat .b-chat-thread.b-chat-task { max-height: min(68dvh, 500px); }
.b-overlay-chat .b-chat-bottom { flex: 0 0 auto; }
@media(max-width:720px) {
  .b-overlay.b-overlay-chat { padding: 8px; align-items: flex-end; }
  .b-overlay-chat .b-dialog { max-height: calc(var(--b-dialog-vh, 100dvh) - 16px); padding: 9px; border-radius: 18px; }
  .b-overlay-chat .b-dialog-head h2 { font-size: 24px; }
  .b-overlay-chat .b-chat-notice { padding: 8px 11px; }
  .b-chat-bubble { max-width: 98%; }
}


/* Chat Scardi: normale conversazione, disclosure AI discreta e nessuna casella. */
.scardi-chat-heading .b-kicker {
  font-size: .69rem;
  letter-spacing: .11em;
  opacity: .9;
}
.scardi-chat-typing {
  font-style: italic;
  opacity: .7;
  animation: scardi-chat-typing 1.3s ease-in-out infinite alternate;
}
@keyframes scardi-chat-typing { from { opacity:.48; } to { opacity:.9; } }
@media (prefers-reduced-motion:reduce) { .scardi-chat-typing { animation:none; } }
.scardi-chat-dialog .b-chat-direct a:last-child { font-size: .82rem; opacity:.82; }
@media (max-width:640px) {
 .scardi-chat-dialog .b-chat-thread { min-height:0; }
 .scardi-chat-dialog .b-chat-bottom { max-height:min(36dvh, 215px); }
}
