.rapid-chat-root[hidden], .rapid-chat-form[hidden], .rapid-chat-status[hidden] { display: none !important; }
.rapid-chat-root, .rapid-chat-root * { box-sizing: border-box; }
.rapid-chat-root { position: fixed; inset: 0; z-index: 10050; display: flex; justify-content: center; align-items: flex-end; height: 100dvh; background: rgba(15,31,42,.42); font-family: Arial,sans-serif; animation: rapid-chat-backdrop-in .24s ease-out both; }
.rapid-chat-window { display: grid; grid-template-rows: auto auto minmax(180px,1fr) auto auto; width: min(620px,100%); max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom))); border-radius: 20px 20px 0 0; background: #fff; box-shadow: 0 -18px 50px rgba(0,0,0,.18); overflow: hidden; animation: rapid-chat-window-in .3s cubic-bezier(.2,.75,.25,1) both; }
.rapid-chat-window > header { grid-row: 1; display: flex; align-items: flex-start; justify-content: space-between; min-height: 54px; padding: 9px 14px 8px 16px; border-bottom: 1px solid #dce4ea; }
.rapid-chat-window > header div { display: grid; gap: 2px; }
.rapid-chat-window > header strong { color: #172330; font-size: 18px; }
.rapid-chat-window > header span { color: #687786; font-size: 13px; }
.rapid-chat-window > header button { width: 30px; height: 30px; margin-top: -3px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #087db8; font-size: 26px; line-height: 1; cursor: pointer; }
.rapid-chat-guidance { grid-row: 2; padding: 9px 18px; background: #eef8fc; color: #526675; font-size: 12px; line-height: 1.35; }
.rapid-chat-cliente .rapid-chat-guidance { display: none; }
.rapid-chat-fornecedor .rapid-chat-guidance { display: none; }
.rapid-chat-messages { grid-row: 3; display: flex; flex-direction: column; gap: 10px; min-height: 220px; padding: 16px; overflow-y: auto; background: #f5f7f8; }
.rapid-chat-message { align-self: flex-start; width: fit-content; max-width: 82%; padding: 9px 11px; border-radius: 4px 13px 13px 13px; background: #fff; box-shadow: 0 2px 8px rgba(20,50,70,.07); }
.rapid-chat-message.is-own { align-self: flex-end; border-radius: 13px 4px 13px 13px; background: #dff2fb; }
.rapid-chat-message.is-admin { border: 1px solid #9ed5ed; }
.rapid-chat-message strong { display: block; margin-bottom: 3px; color: #087db8; font-size: 11px; }
.rapid-chat-message p { margin: 0; color: #172330; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.rapid-chat-message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 4px; }
.rapid-chat-message time { color: #7b8994; font-size: 10px; text-align: right; }
.rapid-chat-receipt { color: #82909a; font-size: 12px; font-weight: 700; letter-spacing: -3px; line-height: 1; }
.rapid-chat-receipt.is-lida { color: #087db8; }
.rapid-chat-empty, .rapid-chat-loading { margin: auto; color: #687786; text-align: center; }
.rapid-chat-status { grid-row: 4; padding: 9px 16px; background: #fff7df; color: #7a5b08; font-size: 12px; text-align: center; }
.rapid-chat-form { grid-row: 5; display: block; gap: 0; margin: 0; padding: 8px 12px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid #dce4ea; background: #fff; }
.rapid-chat-composer { display: grid; grid-template-columns: minmax(0,1fr) 46px; gap: 8px; align-items: start; }
.rapid-chat-input-column { min-width: 0; }
.rapid-chat-form textarea { width: 100%; min-height: 48px; max-height: 82px; padding: 8px 11px; resize: none; border: 1px solid #cfdbe2; border-radius: 8px; font: inherit; outline: none; }
.rapid-chat-form textarea:focus { border-color: #087db8; box-shadow: 0 0 0 3px rgba(8,125,184,.1); }
.rapid-chat-input-meta { min-height: 14px; padding: 2px 2px 0; color: #687786; font-size: 10px; line-height: 1.1; text-align: right; }
.rapid-chat-fornecedor .rapid-chat-input-meta { text-align: right; }
.rapid-chat-form .rapid-chat-send { display: grid; place-items: center; width: 46px; height: 40px; margin-top: 4px; padding: 0; border: 0; border-radius: 7px; background: #087db8; color: #fff; cursor: pointer; }
.rapid-chat-send svg { width: 21px; height: 21px; fill: currentColor; transform: translateX(1px); }
.rapid-chat-form button:disabled { opacity: .55; }
.rapid-chat-panel { justify-content: flex-end; align-items: stretch; background: rgba(15,31,42,.18); }
.rapid-chat-panel .rapid-chat-window { width: min(410px,100%); max-height: none; height: 100%; border-radius: 0; box-shadow: -18px 0 50px rgba(0,0,0,.16); }
@media (min-width: 700px) { .rapid-chat-sheet { align-items: center; } .rapid-chat-sheet .rapid-chat-window { max-height: min(760px,calc(100vh - 40px)); border-radius: 16px; } }
@keyframes rapid-chat-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rapid-chat-window-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
.rapid-chat-root.is-closing { pointer-events: none; animation: rapid-chat-backdrop-out .28s ease both; }
.rapid-chat-root.is-closing .rapid-chat-window { animation: rapid-chat-window-out .28s cubic-bezier(.4,0,1,1) both; }
.rapid-chat-panel.is-closing .rapid-chat-window { animation-name: rapid-chat-panel-out; }
@keyframes rapid-chat-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes rapid-chat-window-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(22px); } }
@keyframes rapid-chat-panel-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(32px); } }
@media (prefers-reduced-motion: reduce) {
    .rapid-chat-root,
    .rapid-chat-window,
    .rapid-chat-root.is-closing,
    .rapid-chat-root.is-closing .rapid-chat-window { animation: none; }
}
