.chat-fab { position: fixed; right: 16px; bottom: 16px; z-index: 40; border: 0; border-radius: 999px; padding: 12px 18px; background: #111827; color: #fff; font: inherit; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.2); cursor: pointer; }
@media (max-width: 820px) { .chat-fab { display: none; } }
.chat-panel { position: fixed; right: 16px; bottom: 16px; z-index: 50; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden; }
@media (max-width: 820px) { .chat-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; } }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #111827; color: #fff; }
.chat-x { background: none; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 88%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; line-height: 1.55; }
.chat-msg.user { align-self: flex-end; background: #0f5e9c; color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant { align-self: flex-start; background: var(--surface-alt); border-bottom-left-radius: 4px; }
.chat-msg.pending { opacity: .7; font-style: italic; }
.chat-msg.error { align-self: stretch; background: var(--notice); border: 1px solid var(--notice-border); }
.chat-disclaimer { margin: 0; padding: 6px 12px; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--border); }
.chat-contact { margin: 0 12px 6px; background: none; border: 1px dashed var(--border); border-radius: 10px; padding: 6px; font: inherit; font-size: .88rem; color: var(--link); cursor: pointer; }
.chat-lead { padding: 10px 12px; border-top: 1px solid var(--border); max-height: 42%; overflow-y: auto; }
.chat-lead textarea { min-height: 70px; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.chat-input textarea { flex: 1; min-height: 44px; resize: none; }
.chat-panel[hidden], .chat-lead[hidden], .chat-fab[hidden] { display: none !important; }
.chat-msg.quote { align-self: stretch; max-width: 100%; background: var(--surface); border: 1px solid var(--accent); white-space: normal; }
.quote-table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: .9rem; }
.quote-table td { padding: 4px 2px; border-bottom: 1px solid var(--border); vertical-align: top; }
.quote-table td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.quote-foot { margin: 4px 0 0; font-size: .78rem; color: var(--muted); }
