.support-entry,.support-panel{--support-theme:#252c3b;--support-hover:#3a465d}
.support-entry{position:fixed;z-index:6;right:24px;bottom:20px;display:inline-flex;align-items:center;gap:9px;border:1px solid var(--support-theme);border-radius:14px;background:var(--support-theme);color:#fff;padding:11px 16px;font:inherit;font-size:14px;font-weight:650;cursor:pointer;box-shadow:0 7px 21px #17243b29;transition:background .16s}
.support-entry:hover,.support-entry[aria-expanded=true]{background:var(--support-hover)}
.support-icon{position:relative;display:block;width:17px;height:13px;border:1.5px solid currentColor;border-radius:5px}
.support-icon::after{content:'';position:absolute;bottom:-3px;left:3px;width:4px;height:4px;border-bottom:1.5px solid currentColor;border-right:1.5px solid currentColor;background:inherit;transform:skewY(-35deg);background-color:var(--support-theme)}
.support-entry:hover .support-icon::after,.support-entry[aria-expanded=true] .support-icon::after{background-color:var(--support-hover)}
.support-panel{position:fixed;z-index:6;right:24px;bottom:78px;display:flex;flex-direction:column;width:min(408px,calc(100vw - 48px));max-height:calc(100dvh - 92px);overflow:hidden;border:1px solid #d9e0eb;border-radius:18px;background:#fff;color:var(--support-theme);box-shadow:0 20px 65px #17243b30;opacity:0;visibility:hidden;transform:translateY(10px) scale(.98);transform-origin:bottom right;transition:opacity .2s ease,transform .22s ease,visibility 0s linear .22s}
.support-panel.is-open{opacity:1;visibility:visible;transform:none;transition-delay:0s}
.support-panel:has(#support-room:not([hidden])){height:660px}
.support-heading{display:flex;align-items:center;justify-content:space-between;flex:none;padding:12px 16px;background:var(--support-theme);color:#fff}
.support-heading h2{margin:0;font-size:17px;outline:none}
#close-support{display:grid;place-items:center;width:34px;height:32px;padding:0;border:0;border-radius:8px;background:transparent;color:inherit;font:inherit;font-size:24px;cursor:pointer}
#close-support:hover{background:#ffffff25}
.support-content{display:flex;flex:1;flex-direction:column;min-height:0;padding:15px 16px 16px;overflow:auto;overscroll-behavior:contain}
#support-guest p{margin:0 0 14px;font-size:14px;color:#56657a}
#support-room{display:flex;flex:1;flex-direction:column;min-height:0}
#support-room>button{align-self:flex-start;margin-bottom:7px}
#support-room .chat-list{flex:1;min-height:64px;max-height:none}
#support-room form{flex:none}
#support-room textarea{display:block;width:100%;min-height:74px;padding:10px 12px;border:1px solid #ccd3df;border-radius:9px;background:#f8f9fb;color:inherit;font:inherit;resize:vertical}
#support-room textarea:focus-visible{outline:2px solid #7890cb;outline-offset:1px}
#support-room label{margin:8px 0 6px}
.chat-list{display:flex;flex-direction:column;gap:10px;overflow:auto;overscroll-behavior:contain;max-height:min(42dvh,360px);min-height:115px;margin:0 0 12px;padding:11px;border:1px solid #dce2ed;border-radius:12px;background:#f5f7fa}
.chat-empty{margin:auto;color:#66747d;font-size:14px}
.chat-message{align-self:flex-start;max-width:88%;padding:9px 12px;background:white;border:1px solid #e0e5ed;border-radius:11px}
.chat-message.own{align-self:flex-end;background:#e8edf6;border-color:#d9e2f1}
.chat-message p{margin:0}
.chat-meta{font-size:12px;color:#52637d}
.chat-text{white-space:pre-wrap;overflow-wrap:anywhere;color:#252c3b}
.chat-message .chat-text,.chat-image{margin-top:5px}
.chat-image{display:block}
.chat-image img{display:block;width:auto;max-width:100%;height:auto;max-height:220px;border-radius:6px}
.chat-send{display:flex;justify-content:flex-end;margin-top:10px}
.chat-attachment{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px;padding:8px;border:1px solid #dce2ed;border-radius:9px;background:#f5f7fa}
.chat-attachment img{display:block;max-width:calc(100% - 112px);max-height:68px;object-fit:contain;border-radius:5px}
.chat-attachment .button{padding:7px 9px;font-size:12px}
[data-chat-status]{min-height:1.35em;margin:4px 0;font-size:13px}
[data-chat-status]:empty{min-height:0;margin:0}
.support-nav{display:flex;align-items:center;justify-content:space-between;gap:8px}
.support-badge{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:22px;height:22px;padding:0 5px;border-radius:999px;background:#a62d37;color:white;font-size:12px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}
#manager-support-dialog{width:min(1056px,calc(100vw - 48px));height:min(740px,calc(100dvh - 48px));max-width:none;max-height:none;overflow:hidden;background:#fff}
#manager-support-dialog[open]{display:flex;flex-direction:column}
.support-dialog-heading{display:flex;align-items:center;justify-content:space-between;flex:none;gap:16px;padding:10px 18px 10px 22px;border-bottom:1px solid #e0e6ef}
.support-dialog-heading h2{display:flex;align-items:center;gap:10px;margin:0;font-size:20px}
.support-dialog-close{display:grid;place-items:center;min-width:44px;height:44px;border:0;border-radius:10px;background:transparent;color:#35435a;font-size:25px;line-height:1}
.support-dialog-close:hover{background:#edf1f7}
.support-inbox{display:grid;grid-template-columns:minmax(230px,30%) minmax(0,1fr);flex:1;min-height:0}
.support-inbox-sidebar{display:flex;flex-direction:column;min-height:0;padding:15px 12px;border-right:1px solid #e0e6ef;background:#f7f9fc}
.support-inbox-sidebar h3{margin:0 8px 12px;color:#4b5c73;font-size:13px}
#support-thread-list{display:grid;align-content:start;gap:7px;min-height:0;overflow:auto;overscroll-behavior:contain;padding:2px}
#support-thread-list .chat-empty{padding:16px 8px}
.support-thread{display:grid;gap:4px;min-width:0;min-height:68px;width:100%;padding:9px 10px;text-align:left;border:1px solid transparent;border-radius:10px;background:#fff;color:#24334a}
.support-thread:hover{border-color:#b8c7da;background:#f6f9fd}
.support-thread[aria-pressed=true]{border-color:#829dbe;background:#e8f0fa;box-shadow:inset 3px 0 #425e84}
.support-thread-head{display:flex;align-items:center;gap:8px;min-width:0}
.support-thread-head strong,.support-thread-preview{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.support-thread-head strong{flex:1;font-size:14px}
.support-thread-preview,.support-thread small{color:#53657d;font-size:12px}
#support-next{align-self:flex-start;margin:10px 0 0 2px}
#support-inbox-status{margin:8px;color:#53657d;font-size:13px;overflow-wrap:anywhere}
#support-inbox-status:empty{display:none}
#support-select-prompt{padding:20px;text-align:center}
#manager-support-room{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;padding:18px 20px 16px}
.support-user{flex:none;padding-bottom:12px;border-bottom:1px solid #e0e6ef}
#manager-support-title{overflow-wrap:anywhere;margin:0 0 8px;font-size:19px}
.support-user-details{display:flex;flex-wrap:wrap;gap:8px 22px;margin:0}
.support-user-details div{display:grid;gap:2px;min-width:0}
.support-user-details dt{color:#53657d;font-size:12px}
.support-user-details dd{margin:0;color:#24334a;font-size:14px;font-weight:600;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
#support-user-balance{color:#2b5246}
#manager-support-room [data-chat-more]{align-self:flex-start;flex:none}
#manager-support-room .chat-list{flex:1;min-height:40px;max-height:none;margin:0}
#manager-support-room form{flex:none}
#manager-support-room label{margin:0 0 5px}
#manager-support-message{display:block;min-height:56px;max-height:100px;padding:9px 10px;font-size:16px;resize:vertical}
.support-compose-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}
.support-compose-actions button{margin-left:auto;flex:none}
#support-back{display:none}
#manager-support-dialog button:focus-visible,#open-manager-support:focus-visible{outline:2px solid #46658d;outline-offset:2px}
@media(max-width:640px){
  .support-entry{right:12px;bottom:12px}
  .support-panel{right:12px;bottom:67px;width:min(408px,calc(100vw - 24px));max-height:calc(100dvh - 79px)}
  #manager-support-dialog{width:calc(100vw - 16px);height:calc(100dvh - 16px);border-radius:14px}
  .support-dialog-heading{padding:6px 10px 6px 14px}
  .support-dialog-heading h2{font-size:18px}
  .support-inbox{grid-template-columns:minmax(0,1fr)}
  .support-inbox-sidebar{border:0}
  #support-select-prompt,#manager-support-dialog:not(.has-conversation) #manager-support-room,#manager-support-dialog.has-conversation .support-inbox-sidebar{display:none}
  #support-back{display:inline-flex;align-items:center;min-height:44px;margin-bottom:8px}
  #manager-support-room{padding:12px;gap:8px}
  #manager-support-title{font-size:17px}
  .support-user-details{gap:6px 14px}
}
@media(prefers-reduced-motion:reduce){.support-entry,.support-panel{transition:none}}
