.support-chat{position:fixed;right:16px;bottom:calc(84px + env(safe-area-inset-bottom));z-index:950;}
.support-chat-toggle{display:grid;place-items:center;width:48px;height:48px;border:1px solid var(--border-strong);border-radius:16px;background:var(--surface-2);color:var(--primary);cursor:pointer;}
.support-chat-panel{position:absolute;right:0;bottom:58px;display:flex;flex-direction:column;width:min(360px,calc(100vw - 32px));max-height:min(560px,calc(100dvh - 180px));padding:14px;gap:10px;border:1px solid var(--border);border-radius:16px;background:var(--surface);color:var(--text-primary);box-shadow:0 12px 40px #0005;}
.support-chat-panel[hidden]{display:none;}
.support-chat-panel header{display:flex;align-items:center;justify-content:space-between;}
.support-chat-panel button{min-height:44px;min-width:44px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2);color:var(--text-primary);cursor:pointer;}
.support-chat-status,.support-chat-panel>a{font-size:12px;margin:0;color:var(--text-secondary);}
.support-chat-messages{min-height:80px;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:8px;}
.support-chat-message{align-self:flex-end;max-width:90%;padding:4px 8px;background:var(--surface-2);border-radius:10px;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;}
.support-chat-message.staff{align-self:flex-start;border:1px solid var(--border);}
.support-chat-message time{display:block;font-size:10px;color:var(--text-secondary);margin-top:4px;}
.support-chat-panel form{position:relative;display:block;padding:4px;border:0;border-radius:20px;background:var(--surface-2);}
.support-chat-panel textarea{display:block;width:100%;min-width:0;min-height:36px;max-height:110px;font:inherit;font-size:14px;line-height:1.5;resize:none;padding:6px 10px;border:0;outline:0;box-shadow:none;background:transparent;color:var(--text-primary);}
.support-chat-toolbar{display:flex;align-items:center;justify-content:flex-start;gap:0;}
.support-chat-toolbar button{display:grid;place-items:center;width:44px;height:44px;padding:0;background:transparent;border:0;color:var(--text-secondary);}
.support-chat-toolbar button[type=submit]{color:var(--primary);margin-inline-start:auto;}
.support-chat-toolbar button:focus-visible{outline:1px solid var(--primary);}
.support-chat-emojis{position:absolute;bottom:100%;left:0;right:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding:6px;border:1px solid var(--border);border-radius:12px;background:var(--surface);max-height:200px;overflow-y:auto;}
.support-chat-emojis[hidden]{display:none;}
.support-chat-emojis button{border:0;background:transparent;font-size:24px;}
.support-chat-error{font-size:12px;color:var(--danger);margin:0;}
body.conversation-workspace .support-chat{display:none;}
body.conversation-workspace .support-chat.has-composer-anchor{display:block;}
.support-chat.has-composer-anchor .support-chat-panel{position:fixed;top:var(--support-panel-top,16px);bottom:auto;right:16px;max-height:var(--support-panel-height,calc(100dvh - 32px));}
.support-chat-uploads{display:flex;gap:6px;flex-wrap:wrap;}
.support-chat-uploads:empty{display:none;}
.support-chat-uploads>div{display:flex;align-items:center;gap:4px;max-width:100%;font-size:11px;border:1px solid var(--border);border-radius:8px;padding:3px;}
.support-chat-uploads span{max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.support-chat-uploads img{width:40px;height:40px;object-fit:cover;border-radius:5px;}
.support-chat-attachment{display:block;margin:4px 0;color:var(--primary);font-size:12px;}
.support-chat-attachment img{display:block;max-width:100%;max-height:160px;border-radius:6px;object-fit:contain;}
.support-chat-upload-progress{font-size:12px;margin:0;color:var(--text-secondary);}
.support-chat-brand{display:flex;align-items:center;gap:8px;min-width:0;font-size:12px;}
.support-chat-avatar{display:block;flex:0 0 36px;width:36px;height:36px;border-radius:50%;object-fit:cover;}
:root[data-theme] #supportChatText,:root[data-theme] #supportChatText:is(:focus,:focus-visible){border:0 !important;outline:0 !important;box-shadow:none !important;}
.support-chat-composer:has(:focus-visible){outline:1px solid var(--border);outline-offset:0;}
.support-chat-status[data-online=true]::before{content:'';display:inline-block;width:7px;height:7px;margin-right:5px;border-radius:50%;background:var(--success,#3ac58a);}
@media(min-width:861px){.support-chat{bottom:24px;}}
@media(max-height:480px){.support-chat-panel{position:fixed;right:12px;bottom:12px;max-height:calc(100dvh - 24px);overflow-y:auto;}.support-chat-messages{min-height:0;flex:1 1 auto;}}

/* Approved support sheet: compact header, scrollable history, fixed composer. */
.support-chat-panel{width:min(390px,calc(100vw - 24px));height:min(580px,calc(100dvh - 120px));max-height:none;padding:0;gap:0;overflow:hidden;border:1px solid var(--border);border-radius:18px;background:var(--surface)}
.support-chat-panel header{flex:none;padding:12px 14px;border-bottom:1px solid var(--border);gap:12px}
.support-chat-brand{gap:10px;font-size:14px}.support-chat-brand>span{display:flex;flex-direction:column;gap:3px;min-width:0}.support-chat-avatar{width:40px;height:40px;flex-basis:40px}.support-chat-brand strong{font-size:15px;font-weight:600}
.support-chat-panel [data-support-close]{border:0;background:transparent;font-size:26px;min-width:44px;min-height:44px;padding:0}
.support-chat-help{flex:none;font-size:12px;text-align:center;color:var(--text-secondary);margin:0;padding:8px 12px}
.support-chat-messages{flex:1;min-height:0;padding:10px 14px;gap:10px}
.support-chat-message{position:relative;font-size:13px;line-height:1.5;padding:6px 9px;max-width:88%;border-radius:10px 10px 3px 10px;background:color-mix(in srgb,var(--primary) 10%,var(--surface-2))}
.support-chat-message.staff{border:0;background:var(--surface-2);border-radius:10px 10px 10px 3px}
.support-chat-message time{margin-top:3px;text-align:right;font-size:10px;white-space:normal}
.support-chat-day{align-self:center;display:block;font-size:11px;color:var(--text-secondary);margin:2px 0}
.support-chat-empty{font-size:13px;color:var(--text-secondary);line-height:1.6;margin:0}
.support-chat-typing{font-size:12px;color:var(--text-secondary);margin:0;padding:4px 14px}
.support-chat-panel .support-chat-composer{flex:none;margin:6px 10px 0;padding:4px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2)}
.support-chat-panel textarea{min-height:38px;max-height:90px;padding:5px 8px;box-sizing:border-box}
.support-chat-panel>a{flex:none;padding:10px 12px;text-align:center;color:var(--primary);min-height:40px;box-sizing:border-box}
.support-chat-error,.support-chat-upload-progress{flex:none;padding:4px 12px}.support-chat-uploads{flex:none;padding:0 10px;max-height:80px;overflow-y:auto}
.support-chat-handle{display:none}.support-chat-open .support-chat-toggle{visibility:hidden}
body.conversation-workspace .support-chat.support-chat-open{display:block}
@media(max-width:860px){.support-chat-open{position:fixed;inset:0;z-index:1500;pointer-events:none}.support-chat-open .support-chat-panel{pointer-events:auto;position:fixed;left:0;right:0;top:calc(var(--support-viewport-top,0px) + 8px);bottom:auto;width:100%;height:calc(var(--support-viewport-height,100dvh) - 8px);max-height:none;border:0;border-radius:18px 18px 0 0;box-sizing:border-box;padding-bottom:env(safe-area-inset-bottom)}.support-chat-handle{display:block;flex:none;width:32px;height:4px;border-radius:4px;background:var(--text-secondary);opacity:.5;margin:8px auto 0}.support-chat-panel header{padding:6px 12px}.support-chat-panel textarea{font-size:16px}}

/* Centered, dismissible support dialog across all viewport sizes. */
body.support-chat-modal-open{overflow:hidden}
.support-chat.support-chat-open{position:fixed;left:0;right:0;top:var(--support-viewport-top,0px);bottom:auto;height:var(--support-viewport-height,100dvh);z-index:1600;display:grid;place-items:center;padding:16px 12px;box-sizing:border-box;background:rgb(0 0 0 / .38);pointer-events:auto;overscroll-behavior:contain}
.support-chat.support-chat-open .support-chat-panel{position:relative;left:auto;right:auto;top:auto;bottom:auto;width:min(420px,100%);height:min(580px,calc(var(--support-viewport-height,100dvh) - 32px));max-height:100%;border:1px solid var(--border);border-radius:18px;padding-bottom:0;box-sizing:border-box;box-shadow:0 14px 48px rgb(0 0 0 / .28)}
.support-chat.support-chat-open .support-chat-toggle{display:none}
@media(max-width:860px){.support-chat.support-chat-open .support-chat-panel{height:min(560px,calc(var(--support-viewport-height,100dvh) - 32px))}.support-chat-handle{display:none}}
/* A small support launcher and matching conversation edge tails. */
.support-chat-toggle{position:relative;display:flex;align-items:center;justify-content:center;gap:5px;width:auto;height:44px;min-height:44px;padding:0 10px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);color:var(--text-primary);font:inherit;font-size:12px;font-weight:400;box-shadow:0 3px 12px rgb(0 0 0 / .10)}
.support-chat-toggle::after{content:'';position:absolute;right:0;bottom:-5px;width:8px;height:8px;background:inherit;clip-path:polygon(0 0,100% 0,100% 100%)}
.support-chat-toggle>svg{width:16px;height:16px;flex:none}
.support-chat-toggle [data-support-online]{width:6px;height:6px;border-radius:50%;background:var(--text-secondary);flex:none}
.support-chat-toggle [data-support-online=true]{background:#00d83a;animation:support-launcher-online 1.8s ease-in-out infinite}
.support-chat-toggle:hover{background:var(--surface-hover,var(--surface))}
.support-chat-toggle:focus-visible{outline:2px solid var(--primary);outline-offset:3px}
.support-chat-messages{gap:12px;padding-bottom:14px}
.support-chat-message{border-bottom-right-radius:0}
.support-chat-message::after{content:'';position:absolute;right:0;bottom:-6px;width:9px;height:9px;background:inherit;clip-path:polygon(0 0,100% 0,100% 100%)}
.support-chat-message.staff{border-bottom-right-radius:10px;border-bottom-left-radius:0}
.support-chat-message.staff::after{right:auto;left:0;clip-path:polygon(0 0,100% 0,0 100%)}
@keyframes support-launcher-online{50%{opacity:.35}}
@media(prefers-reduced-motion:reduce){.support-chat-toggle [data-support-online=true]{animation:none}}
.support-chat-availability{display:block;margin:2px 0;font-size:11px;font-weight:400;line-height:16px;color:var(--text-secondary)}
.support-chat-panel header{align-items:center;gap:8px}
.support-chat-brand{flex:1;min-width:0}
.support-chat-brand>span{flex:1;min-width:0}
.support-chat-status-row{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;width:100%}
.support-chat-status-row .support-chat-status{flex:1;min-width:0;font-size:11px;line-height:16px;white-space:normal}
.support-chat-status-row .support-chat-availability{flex:none;margin:0;font-size:10px;line-height:16px;white-space:nowrap}
.support-chat-panel header [data-support-close]{flex:none}
.support-chat-status-row{justify-content:flex-start;align-items:baseline;gap:7px;flex-wrap:wrap}
.support-chat-status-row .support-chat-status{flex:0 1 auto}
.support-chat-status-row .support-chat-availability{padding-left:7px;border-left:1px solid var(--border-strong,var(--border))}

/* Attachment previews retain their natural proportions in the composer. */
.support-chat-uploads>div{position:relative;min-width:0;max-width:100%;gap:6px;padding:5px;border-radius:8px}
.support-chat-uploads img{display:block;width:56px;height:56px;object-fit:contain;opacity:1!important;visibility:visible!important;border-radius:5px;background:var(--surface-alt,transparent)}
.support-chat-uploads>div>button{flex-shrink:0;min-width:28px;min-height:28px}
.support-chat-attachment img{display:block;opacity:1!important;visibility:visible!important}


.support-chat-toggle{position:relative}.support-unread-badge{position:absolute;top:-7px;right:-7px;display:flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 4px;box-sizing:border-box;border-radius:12px;background:#ad303a;color:#fff;font:600 11px/1 Arial,sans-serif;border:2px solid var(--surface);pointer-events:none}.support-unread-badge[hidden]{display:none!important}.staff-support-launcher .support-chat-panel{padding:16px;box-sizing:border-box}.staff-support-launcher .support-chat-toggle{display:flex;width:auto;min-width:100px;gap:8px;padding:10px 14px;align-items:center;justify-content:center;color:var(--text-primary)}.staff-support-action{display:grid;gap:5px;padding:12px;border:1px solid var(--border);border-radius:10px;text-decoration:none;color:var(--text-primary);min-height:44px}.staff-support-action:hover{background:var(--surface-2)}.staff-support-action span,.staff-support-note,.staff-support-role{font-size:12px;line-height:1.5;color:var(--text-secondary)}.staff-support-note,.staff-support-role{margin:0}.staff-support-launcher .support-chat-panel header button{border:0;background:transparent;font-size:23px}.staff-support-launcher{bottom:20px}@media(max-width:860px){.staff-support-launcher{bottom:calc(84px + env(safe-area-inset-bottom))}.staff-support-launcher .support-chat-panel{max-height:calc(100dvh - 180px);overflow:auto}}

.staff-support-launcher .support-chat-panel{height:auto;gap:10px}.staff-support-launcher .support-chat-panel header{padding:0 0 6px}

/* Account forms keep help available without covering passwords or consent. */
.auth-access-page>.support-chat:not(.support-chat-open){position:relative;right:auto;bottom:auto;z-index:950;width:max-content;max-width:calc(100% - 24px);margin:0 var(--auth-support-inset,max(20px,calc((100% - 440px)/2))) 20px auto}

/* Keep familiar controls visually modest without shrinking their touch targets. */
.support-chat-panel button>svg,.support-chat-panel .guide-assistant-avatar svg{width:20px;height:20px;stroke-width:1.7}
.support-chat-panel .guide-assistant-avatar{width:26px;height:26px;flex:0 0 26px}


/* Desktop Help opens beneath the shared header; native keeps its familiar sheet. */
.support-chat-panel>header{position:relative}
.support-assigned-team{display:flex;align-items:center;flex:none;margin-left:auto;gap:0}
.support-assigned-team[hidden],.support-person-status[hidden],.support-last-reply[hidden]{display:none!important}
.support-chat-panel .support-person-avatar{position:relative;display:grid;place-items:center;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;border:0;border-radius:50%;padding:7px;background:transparent;color:var(--text-primary);font-size:12px;overflow:hidden;box-shadow:inset 0 0 0 7px var(--surface-2);background:var(--bg)}
.support-person-avatar img{position:absolute;inset:7px;width:30px;height:30px;object-fit:cover;border-radius:50%}
.support-person-status{position:absolute;top:100%;left:12px;right:12px;z-index:3;margin:4px 0 0;padding:10px 12px;background:var(--surface-2);color:var(--text-primary);border-radius:10px;font-size:12px;box-shadow:0 6px 20px rgb(0 0 0/.15)}
.support-chat-status-row{display:flex;flex-wrap:wrap;gap:2px 8px;min-width:0}
.support-last-reply{margin:0;font-size:11px;color:var(--text-secondary);font-weight:400}
#supportTeam{position:relative}
.support-team-tools{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 12px;color:var(--text-secondary);font-size:12px;min-width:0}
.support-team-tools>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.support-chat-panel .support-team-tools>button{flex:none;min-height:44px;border:0;padding:6px 8px;background:transparent;color:var(--primary);font-size:12px}
.support-compose-categories{position:absolute;z-index:4;bottom:76px;left:12px;right:12px;max-height:calc(100% - 88px);box-sizing:border-box;overflow:auto;padding:6px;background:var(--surface);border-radius:12px;box-shadow:0 8px 24px rgb(0 0 0/.22)}
.support-compose-categories[hidden]{display:none!important}
.support-compose-category-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-left:8px;font-size:13px}
.support-compose-category-heading button{width:44px;height:44px;min-width:44px;padding:0;border:0;background:transparent;color:var(--text-primary);font-size:22px}
.support-compose-categories .support-category-options>[data-support-compose-category]{display:flex;align-items:center;width:100%;min-height:44px;padding:8px;border:0;border-radius:8px;background:transparent;color:var(--text-primary);font-family:inherit;font-size:13px;font-weight:400;line-height:1.4;text-align:left}
.support-compose-categories .support-category-options>[data-support-compose-category]:hover{background:var(--surface-2)}
.support-chat-panel>header{border:0;border-radius:0 0 12px 12px;background:var(--surface-2)}
.support-chat-brand strong{font-size:14px;line-height:1.35}
.support-chat-panel .support-chat-tabs{border:0;background:transparent;border-radius:0;gap:8px}
.support-chat-panel .support-chat-tabs>button{border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;box-shadow:none;min-height:44px;padding:8px}
.support-chat-panel .support-chat-tabs>button[aria-selected="true"]{border-bottom-color:var(--primary);color:var(--primary);background:transparent}
@media(min-width:861px){
 .support-chat.support-chat-open.support-from-header{place-items:start end;padding-top:calc(var(--support-anchor-top,56px) + 8px)}
 .support-chat.support-chat-open.support-from-header .support-chat-panel{height:min(580px,calc(var(--support-viewport-height,100dvh) - var(--support-anchor-top,56px) - 24px));border-radius:12px}
}

.support-compose-categories .support-category-options>button{gap:8px}.support-compose-categories .support-category-options>button>svg{flex:none;width:20px;height:20px}.support-compose-categories .support-category-options>button>span:first-of-type{flex:1;min-width:0}.support-compose-categories .support-category-options>button>span:last-child{flex:none}
