/* ADXI: Invicta site chat panel (web copy only). */
:root { --chat-w: 380px; }
body.chat-open main, body.chat-open header.top { margin-right: var(--chat-w); }
.chat {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--chat-w); z-index: 50;
  display: none; flex-direction: column;
  background: var(--panel, #10161f); color: var(--ink, #e6edf3);
  border-left: 1px solid var(--line, #2a3442); font-size: 14px;
}
body.chat-open .chat { display: flex; }
body.chat-open .chat-tab { display: none; }
.chat-head { display: flex; align-items: flex-start; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line, #2a3442); }
.chat-title { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.chat-title span { color: var(--muted, #8b98a8); font-size: 12px; }
.chat-btn {
  background: transparent; color: inherit; border: 1px solid var(--line, #2a3442);
  border-radius: 6px; padding: 4px 8px; font: inherit; font-size: 12px; cursor: pointer;
}
.chat-btn:hover { border-color: var(--accent, #d4a64a); }
.chat-x { font-size: 16px; line-height: 1; padding: 2px 8px; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 8px 11px; border-radius: 10px; line-height: 1.45; max-width: 92%; overflow-wrap: anywhere; }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 4px 0 6px; padding-left: 20px; }
.msg pre { background: rgba(0,0,0,.3); padding: 8px; border-radius: 6px; overflow-x: auto; font-size: 12px; }
.msg code { font-size: 12.5px; }
.msg a { color: var(--accent, #d4a64a); }
.msg-user { align-self: flex-end; background: var(--panel2, #132c4d); border: 1px solid var(--line, #234a75); }
.msg-assistant { align-self: flex-start; background: rgba(255,255,255,.04); border: 1px solid var(--line, #2a3442); }
.msg-error { border-color: #c0504d; }
.chat-note { color: var(--muted, #8b98a8); font-size: 12px; padding-left: 4px; }
.chat-typing { color: var(--muted, #8b98a8); }
.chat-proposal {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--accent, #d4a64a); color: inherit; text-decoration: none;
}
.chat-proposal span { color: var(--muted, #8b98a8); font-size: 12px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line, #2a3442); }
.chat-input {
  flex: 1; resize: none; font: inherit; color: inherit; background: rgba(0,0,0,.25);
  border: 1px solid var(--line, #2a3442); border-radius: 8px; padding: 8px;
}
.chat-send {
  align-self: flex-end; background: var(--accent, #d4a64a); color: #111; border: 0;
  border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-tab {
  position: fixed; right: 16px; bottom: 16px; z-index: 50; background: var(--accent, #d4a64a); color: #111;
  border: 0; border-radius: 20px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.chat-modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
.chat-modal-box {
  width: min(360px, 90vw); background: var(--panel, #10161f); color: var(--ink, #e6edf3);
  border: 1px solid var(--line, #2a3442); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.chat-modal-box h3 { margin: 0; }
.chat-modal-box p { margin: 0; color: var(--muted, #8b98a8); font-size: 13px; }
.chat-modal-box input {
  font: inherit; color: inherit; background: rgba(0,0,0,.25); border: 1px solid var(--line, #2a3442);
  border-radius: 8px; padding: 8px;
}
.chat-modal-row { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 900px) {
  :root { --chat-w: 100vw; }
  body.chat-open main, body.chat-open header.top { margin-right: 0; }
}
