.support-chat { position: fixed; right: 22px; bottom: 22px; z-index: 1080; font-family: inherit; }
.support-chat-launcher { display: flex; align-items: center; gap: 9px; border: 0; border-radius: 999px; padding: 13px 18px; color: #fff; background: #176b4a; box-shadow: 0 8px 28px #143d2d44; font-weight: 700; }
.support-chat-launcher i { font-size: 20px; }
.support-chat-launcher:hover { background: #10583b; }
.support-chat-panel { position: absolute; right: 0; bottom: 62px; display: flex; flex-direction: column; width: min(360px, calc(100vw - 28px)); height: min(500px, calc(100dvh - 130px)); overflow: hidden; border: 1px solid #dbe4df; border-radius: 16px; background: #fff; box-shadow: 0 14px 48px #173b2d33; }
.support-chat-panel[hidden] { display: none; }
.support-chat-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; color: #fff; background: #176b4a; }
.support-chat-header strong, .support-chat-header small { display: block; }
.support-chat-header small { margin-top: 3px; opacity: .85; }
.support-chat-close { border: 0; background: transparent; color: inherit; font-size: 20px; }
.support-chat-name { margin: 10px 12px 0; border: 1px solid #d7e1db; border-radius: 8px; padding: 7px 9px; outline-color: #176b4a; }
.support-chat-messages { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 14px; background: #f7faf8; }
.support-chat-empty { margin: auto; max-width: 250px; color: #66736c; text-align: center; }
.support-chat-message, .support-inbox-message { max-width: 88%; padding: 9px 11px; border-radius: 12px; overflow-wrap: anywhere; }
.support-chat-message.from-support, .support-inbox-message.from-support { align-self: flex-start; background: #fff; border: 1px solid #e3ebe6; }
.support-chat-message.from-ai, .support-inbox-message.from-ai { border-color: #b7d8c4; background: #f0f8f3; }
.support-chat-message.from-visitor, .support-inbox-message.from-visitor { align-self: flex-end; color: #fff; background: #176b4a; }
.support-chat-message strong, .support-chat-message time, .support-inbox-message strong, .support-inbox-message time { display: block; font-size: .75rem; opacity: .8; }
.support-chat-message-text { white-space: pre-wrap; }
.support-chat-form, .support-inbox-form { display: flex; gap: 8px; align-items: end; padding: 10px; border-top: 1px solid #e7ece9; background: #fff; }
.support-chat-form textarea, .support-inbox-form textarea { flex: 1; resize: none; border: 1px solid #d7e1db; border-radius: 10px; padding: 9px 10px; outline-color: #176b4a; }
.support-chat-form button { width: 40px; height: 40px; border: 0; border-radius: 10px; color: #fff; background: #176b4a; }
.support-chat-note, .support-inbox-note { padding: 0 11px 9px; margin: 0; color: #758079; font-size: .75rem; }

.support-inbox { max-width: 1280px; margin: 0 auto; }
.support-inbox-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.support-inbox-heading h1 { margin: 0; font-size: 1.55rem; }
.support-inbox-heading p { margin: 4px 0 0; color: #68756e; }
.support-inbox-layout { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); height: min(72vh, 760px); min-height: 480px; overflow: hidden; border: 1px solid #dfe7e2; border-radius: 14px; background: #fff; box-shadow: 0 5px 24px #18382914; }
.support-inbox-list-pane { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid #e5ebe7; }
.support-inbox-tabs { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid #e5ebe7; }
.support-inbox-tabs button { flex: 1; border: 0; border-radius: 8px; padding: 9px; background: transparent; color: #5a675f; }
.support-inbox-tabs button.active { background: #e8f4ed; color: #176b4a; font-weight: 700; }
.support-inbox-list { flex: 1; overflow-y: auto; }
.support-inbox-item { display: flex; flex-direction: column; gap: 4px; width: 100%; border: 0; border-bottom: 1px solid #edf1ee; padding: 12px; background: #fff; text-align: left; }
.support-inbox-item.active, .support-inbox-item:hover { background: #f0f7f2; }
.support-inbox-item span { overflow: hidden; color: #5e6b63; text-overflow: ellipsis; white-space: nowrap; }
.support-inbox-item small { color: #79857e; }
.support-inbox-chat { min-width: 0; position: relative; }
.support-inbox-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #78847d; text-align: center; }
.support-inbox-empty i { font-size: 36px; }
.support-inbox-active { height: 100%; display: flex; flex-direction: column; }
.support-inbox-active[hidden] { display: none; }
.support-inbox-chat-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid #e5ebe7; }
.support-inbox-chat-header strong, .support-inbox-chat-header small { display: block; overflow-wrap: anywhere; }
.support-inbox-chat-header small { color: #76827b; }
.support-inbox-messages { flex: 1; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; padding: 16px; background: #f8faf9; }
.support-inbox-form { padding: 12px; }

@media (max-width: 767.98px) {
    .support-chat { right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); }
    .support-chat-panel { right: -4px; bottom: 60px; width: min(360px, calc(100vw - 20px)); height: min(470px, calc(100dvh - 155px)); }
    .support-inbox-heading { align-items: flex-start; flex-direction: column; }
    .support-inbox-layout { display: flex; flex-direction: column; height: calc(100dvh - 230px); min-height: 480px; }
    .support-inbox-list-pane { flex: 1; min-height: 120px; border-right: 0; }
    .support-inbox-layout:has(.support-inbox-active:not([hidden])) .support-inbox-list-pane { display: none; }
    .support-inbox-chat { flex: 1; min-height: 0; }
    .support-inbox-chat:has(.support-inbox-active:not([hidden])) { min-height: 0; }
}
