/* Assistente i-Lab – chat */
#ilab-chat { --o: #FF6600; --k: #1a1a1a; position: fixed; right: 20px; bottom: 20px; z-index: 99990; font-family: 'Montserrat', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; font-size: 15px; line-height: 1.5; color: var(--k); }
#ilab-chat * { box-sizing: border-box; }
#ilab-chat button { font-family: inherit; }

#ilab-chat .ic-launch { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 28px; background: var(--o); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.22); transition: background-color .15s ease, transform .15s ease; }
#ilab-chat .ic-launch:hover { background: #e65c00; }
#ilab-chat .ic-launch:focus-visible { outline: 3px solid var(--k); outline-offset: 3px; }
#ilab-chat.is-open .ic-launch { display: none; }

#ilab-chat .ic-panel { position: absolute; right: 0; bottom: 0; width: 390px; height: min(640px, calc(100vh - 40px)); background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.28); display: flex; flex-direction: column; overflow: hidden; }
#ilab-chat .ic-panel[hidden] { display: none; }

#ilab-chat .ic-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 14px 18px; background: var(--k); color: #fff; }
#ilab-chat .ic-head div { flex: 1; min-width: 0; }
#ilab-chat .ic-head strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
#ilab-chat .ic-head small { display: block; font-size: 12px; color: #bdbdbd; }
#ilab-chat .ic-head small::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--o); margin-right: 6px; vertical-align: 1px; }
#ilab-chat .ic-new { border: 0; background: none; color: #bdbdbd; font-size: 12px; font-weight: 600; cursor: pointer; padding: 8px; border-radius: 6px; }
#ilab-chat .ic-new:hover { color: #fff; }
#ilab-chat .ic-close { border: 0; background: none; color: #fff; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
#ilab-chat .ic-close:hover { background: #333; }
#ilab-chat .ic-head button:focus-visible { outline: 2px solid var(--o); }

#ilab-chat .ic-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; background: #f5f5f5; overscroll-behavior: contain; }
#ilab-chat .ic-msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; word-wrap: break-word; }
#ilab-chat .ic-msg p { margin: 0 0 6px; }
#ilab-chat .ic-msg p:last-child { margin-bottom: 0; }
#ilab-chat .ic-msg ul { margin: 4px 0 6px; padding-left: 18px; }
#ilab-chat .ic-msg li { margin: 2px 0; }
#ilab-chat .ic-msg strong { font-weight: 700; }
#ilab-chat .ic-assistant { align-self: flex-start; background: #fff; border: 1px solid #e6e6e6; border-bottom-left-radius: 4px; }
#ilab-chat .ic-assistant a { color: var(--k); text-decoration: none; border-bottom: 2px solid var(--o); font-weight: 600; }
#ilab-chat .ic-user { align-self: flex-end; background: var(--k); color: #fff; border-bottom-right-radius: 4px; }
#ilab-chat .ic-err { border-color: #f0b4ae; background: #fff6f5; }

#ilab-chat .ic-typing { display: flex; gap: 5px; padding: 14px 16px; }
#ilab-chat .ic-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9a9a9a; animation: ic-dot 1.2s infinite ease-in-out; }
#ilab-chat .ic-typing span:nth-child(2) { animation-delay: .15s; }
#ilab-chat .ic-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ic-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

#ilab-chat .ic-sugg { display: flex; flex-wrap: wrap; gap: 8px; }
#ilab-chat .ic-sugg button { border: 1.5px solid var(--k); background: #fff; color: var(--k); border-radius: 18px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
#ilab-chat .ic-sugg button:hover { background: var(--k); color: #fff; }

#ilab-chat .ic-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#ilab-chat .ic-act { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 20px; background: var(--o); color: #fff !important; border: 0 !important; font-size: 14px; font-weight: 700; text-decoration: none; }
#ilab-chat .ic-act:hover { background: #e65c00; }
#ilab-chat .ic-act.ic-wa { background: var(--k); }
#ilab-chat .ic-act.ic-wa:hover { background: #000; }
#ilab-chat .ic-sent { margin: 0; font-weight: 700; color: #1e6b33; font-size: 14px; }

#ilab-chat .ic-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 6px 14px; border-top: 1px solid #e6e6e6; background: #fff; }
#ilab-chat .ic-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#ilab-chat textarea { flex: 1; resize: none; border: 1.5px solid #cfcfcf; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 16px; line-height: 1.35; max-height: 120px; color: var(--k); background: #fff; margin: 0; box-shadow: none; }
#ilab-chat textarea:focus { outline: none; border-color: var(--o); box-shadow: 0 0 0 3px rgba(255,102,0,.2); }
#ilab-chat .ic-send { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--o); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
#ilab-chat .ic-send:hover { background: #e65c00; }
#ilab-chat .ic-send[disabled] { opacity: .5; cursor: wait; }
#ilab-chat .ic-send:focus-visible { outline: 3px solid var(--k); outline-offset: 2px; }
#ilab-chat .ic-note { margin: 0; padding: 0 14px 10px; font-size: 11px; color: #777; background: #fff; }
#ilab-chat .ic-note a { color: #555; }

@media (max-width: 560px) {
	#ilab-chat { right: 14px; bottom: 14px; }
	#ilab-chat .ic-launch { height: 52px; padding: 0 18px 0 15px; }
	#ilab-chat.is-open { inset: 0; right: 0; bottom: 0; }
	#ilab-chat .ic-panel { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
	#ilab-chat .ic-typing span { animation: none; opacity: .6; }
	#ilab-chat .ic-launch { transition: none; }
}
@media print { #ilab-chat { display: none !important; } }
