.chat-fab {
  position: fixed; right: 16px; bottom: 20px; z-index: 40;
  display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--gold), var(--gold2)); color: #1a1205; font: 600 15px "Prompt", sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.chat-panel {
  position: fixed; right: 16px; bottom: 20px; z-index: 41; width: 380px; height: min(600px, calc(100vh - 40px));
  display: none; flex-direction: column; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
.chat-panel.open { display: flex; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--card); border-bottom: 1px solid var(--line); }
.chat-head .av { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #1a1205; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.chat-head b { display: block; font-size: 15px; }
.chat-head small { color: var(--muted); font-size: 12px; }
.chat-head button { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; padding: 4px 8px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: #1f4a8a; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg a { color: var(--gold); text-decoration: underline; }
.msg.typing { color: var(--muted); }
.chat-quick { display: flex; gap: 6px; padding: 0 12px 8px; flex-wrap: wrap; }
.chat-quick button { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 5px 12px; font: 13px "Prompt", sans-serif; cursor: pointer; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; resize: none; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font: 16px "Prompt", sans-serif; max-height: 110px; }
.chat-form button { background: var(--gold); border: 0; border-radius: 12px; padding: 0 16px; font: 600 15px "Prompt", sans-serif; color: #1a1205; cursor: pointer; }
.chat-form button:disabled { opacity: .5; }
@media (max-width: 640px) {
  .chat-fab { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body[data-page="pay"] .chat-fab { bottom: 20px; }
  .chat-panel { inset: 0; width: auto; height: auto; border-radius: 0; }
}
