.support-chat [hidden], .chat-thread[hidden], .chat-error[hidden], .chat-badge[hidden], .chat-workspace [hidden] { display: none; }
.support-chat { position: fixed; right: 24px; bottom: 24px; z-index: 75; color: #10141c; font-family: var(--font-body); }
.chat-launcher { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 13px 20px; border: 0; border-radius: 999px; background: #b91d0d; color: #fff; box-shadow: 0 8px 30px #0a0e1833; cursor: pointer; font-weight: 650; }
.chat-badge { display: inline-grid; place-items: center; min-width: 23px; height: 23px; padding: 0 5px; border-radius: 20px; background: #fff; color: #a61c0e; font-size: 12px; margin-left: 6px; }
.support-chat-panel { position: absolute; right: 0; bottom: 65px; width: 370px; height: min(540px, calc(100dvh - 110px)); max-width: calc(100vw - 24px); background: #fff; border: 1px solid #e0e2e7; border-radius: 22px; box-shadow: 0 16px 60px #080c1644; overflow: hidden; display: flex; flex-direction: column; }
.support-chat-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 17px 18px; background: #10141c; color: #fff; }
.support-chat-head h2 { font-family: var(--font-body); font-size: 17px; letter-spacing: 0; margin: 0; }
.support-chat-head button { border: 0; border-radius: 9px; width: 32px; height: 32px; color: #fff; background: #ffffff1a; cursor: pointer; font-size: 22px; }
.chat-thread { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: #f4f5f7; }
.chat-empty { color: #606977; text-align: center; font-size: 14px; padding: 14px; }
.chat-message { align-self: flex-start; max-width: 90%; padding: 10px 13px; background: #fff; border: 1px solid #e8e9ed; border-radius: 14px 14px 14px 3px; overflow-wrap: anywhere; }
.chat-message-own { align-self: flex-end; background: #fce9e5; border-color: #f2d4cd; border-radius: 14px 14px 3px 14px; }
.chat-message small { font-size: 10px; color: #616b79; display: block; margin-bottom: 4px; }
.chat-message p { font-size: 14px; line-height: 1.5; margin: 0; white-space: pre-wrap; }
.chat-compose { padding: 12px; border-top: 1px solid #e4e6ea; display: flex; align-items: flex-end; gap: 8px; background: #fff; }
.chat-compose label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chat-compose textarea { min-width: 0; flex: 1; resize: none; max-height: 120px; border: 1px solid #d9dce2; background: #f9fafb; border-radius: 12px; padding: 10px; font-size: 14px; }
.chat-compose button { padding: 10px 12px; border: 0; border-radius: 11px; background: #b91d0d; color: #fff; cursor: pointer; font-size: 12px; min-height: 42px; }
.chat-compose button:disabled { opacity: .5; cursor: default; }
.chat-error { padding: 7px 12px; margin: 0; color: #a11c10; background: #fff0ed; font-size: 12px; }
.chat-workspace { display: grid; grid-template-columns: minmax(200px, 30%) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; height: min(720px, 75vh); background: #fff; }
.chat-inbox { overflow: auto; border-right: 1px solid var(--line); }
.chat-conversation { display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 15px; border: 0; border-bottom: 1px solid #e8e9ed; text-align: left; background: #fff; cursor: pointer; }
.chat-conversation:hover { background: #f5f6f8; }
.chat-conversation.is-selected { background: #fce9e5; }
.chat-conversation strong { font-size: 13px; overflow-wrap: anywhere; }
.chat-conversation span { font-size: 13px; color: #626c7a; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.chat-conversation small { color: #a32617; font-size: 11px; }
.chat-conversation-area { min-width: 0; display: flex; flex-direction: column; }
.chat-conversation-area h2 { margin: 0; padding: 16px; border-bottom: 1px solid var(--line); font-size: 17px; font-family: var(--font-body); }
.chat-more { margin: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: white; }
#staffChatsBadge { background: #b91d0d; color: #fff; }
@media (max-width: 640px) {
  .support-chat { right: 12px; bottom: 12px; }
  .support-chat-panel { width: calc(100vw - 40px); height: min(520px, calc(100dvh - 100px)); }
  .chat-compose textarea { font-size: 16px; }
  .chat-workspace { grid-template-columns: minmax(0, 1fr); height: auto; }
  .chat-inbox { max-height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-conversation-area { height: 480px; max-height: 70dvh; }
}
