/* Chat layout responds to the space left after navigation, not device pixels. */
.profile-button{padding:0!important;display:grid!important;place-items:center;flex:0 0 44px;width:44px;height:44px;background:transparent!important;overflow:visible!important}.profile-button>.avatar{width:36px!important;height:36px!important;min-width:36px;display:grid;place-items:center;margin:0;line-height:1;overflow:hidden}.avatar{flex-shrink:0;line-height:1}.avatar img{display:block;width:100%;height:100%;object-fit:cover}.profile-shortcut .avatar{display:grid;place-items:center}
.chat-list{padding:8px;overscroll-behavior:contain}.chat-list-heading{padding:8px;font-size:11px}.chat-folders{display:flex;gap:5px;align-items:center;overflow:auto;scrollbar-width:none;padding:5px 0 12px;overscroll-behavior-x:contain}.chat-folders::-webkit-scrollbar{display:none}.chat-folders button{white-space:nowrap;min-height:38px;padding:8px 11px;font-size:12px;background:#f3eef8;color:#817092;border-radius:14px;border:0;cursor:pointer}.chat-folders [aria-selected=true]{background:#786094;color:white}.chat-folders small{font-size:10px;background:#ffffff33;border-radius:8px;padding:1px 4px}.chat-row{position:relative;border-radius:14px}.chat-list-item{width:100%;margin:0;padding:11px 35px 11px 8px;border-radius:14px;min-height:70px}.chat-row-actions{position:absolute;right:1px;top:50%;transform:translateY(-50%);width:32px;height:44px;border:0;background:transparent;border-radius:12px;font-size:20px;color:#8c769f;cursor:pointer}.chat-row-actions:hover{background:#e4daef}.chat-pin-icon{font-size:13px;color:#9477ac}.chat-folder-empty{padding:20px 10px;font-size:13px;color:#9784a6;line-height:1.5}.folder-chat-checks{max-height:36dvh;overflow:auto;border:1px solid #e5deed;border-radius:12px;padding:10px;margin:12px 0}.folder-chat-checks label{display:flex;align-items:center;gap:8px;font-size:13px;padding:8px}.folder-chat-checks input{flex:none;width:18px;height:18px}.thread-loading{flex-shrink:0;background:#f5eff9;color:#8f799e;text-align:center;padding:6px;font-size:12px}.thread-overflow{position:relative}.thread-overflow>summary{list-style:none;display:grid;place-items:center;font-size:23px;cursor:pointer;color:#75568d;width:42px;height:42px;border-radius:50%}.thread-overflow>div{position:absolute;right:0;top:45px;padding:6px;background:#fff;border:1px solid #e4d9ed;border-radius:14px;box-shadow:0 5px 22px #23153c22;z-index:45;display:flex;gap:4px}.thread-heading>div:first-of-type{min-width:0;flex:1}.thread-heading h3{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.thread-heading p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-pins{flex-shrink:0!important;max-height:58px!important;overflow:hidden!important}.chat-pins .pinned-snippet{max-height:58px;padding:8px 12px;font-size:12px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;overflow-wrap:anywhere}.chat-pins .pinned-snippet:not(:first-child){display:none}.message .bubble>p{font-size:14px;line-height:1.45}.chat-attachments video.chat-video{display:block;width:100%;max-width:360px;max-height:340px;border-radius:12px;background:#252032}.media-access-refresh{min-height:32px}.chat-attachment [data-chat-asset]{font-size:12px}.chat-attachment [data-chat-file-link]{font-size:12px}.chat-compose{grid-template-columns:38px minmax(100px,1fr) 44px 44px 44px}.chat-compose textarea{min-width:100px!important}.attachment-status{grid-column:1/-1;font-size:12px;color:#816a93}.chat-file-field:not(:has(#chat-selected-files:not(:empty))):not(:has(#chat-file-status:not(:empty))):not(:has(progress:not([hidden]))){margin:0;min-height:0}.chat-file-field p:empty{margin:0}.chat-action-dialog .attachment-preview{width:100%;max-height:40dvh;object-fit:contain;background:#f8f5fb;border-radius:14px;margin:8px 0}.attachment-choice{display:flex;gap:8px;flex-wrap:wrap}.attachment-choice button{padding:10px;border:1px solid #d9cbe6;border-radius:12px;color:#674d81;background:#f5effb;font-size:13px;cursor:pointer;flex:1;min-width:140px}.attachment-choice button[aria-pressed=true]{background:#7c5a9a;color:#fff}.attachment-file-row{padding:10px;border:1px solid #e4daed;border-radius:12px;margin:8px 0;overflow-wrap:anywhere}.attachment-file-row p{font-size:12px}.attachment-actions{display:flex;gap:8px;margin-top:14px}.attachment-actions button{font-size:13px;padding:10px;border-radius:12px}.message-actions-backdrop{position:fixed;inset:0;background:#241a3b44;z-index:70;border:0;cursor:default}.message-actions-backdrop[hidden]{display:none}.bubble.message-actions-open{z-index:75;box-shadow:0 6px 24px #2d1a4333}.message-menu-panel{z-index:80;width:280px;max-width:calc(100vw - 16px);padding:8px;border-radius:18px}.message-menu-panel .reaction-picker{display:flex;overflow-x:auto;overflow-y:hidden;gap:4px;margin-bottom:6px;padding-bottom:5px;border-bottom:1px solid #eee7f5;max-height:58px;scrollbar-width:thin;overscroll-behavior:contain}.reaction-picker button{flex:0 0 36px;width:36px;height:40px}.quick-reaction-feedback{animation:reaction-flash .25s ease-out}@keyframes reaction-flash{50%{box-shadow:0 0 0 3px #ab85cd77}}
@media(min-width:1101px) and (max-width:1500px){.chat-page .sidebar{width:78px;padding:20px 8px}.chat-page .sidebar .workspace-label,.chat-page .sidebar .sidebar-bottom p,.chat-page .sidebar .prototype-label,.chat-page #sidebar-name{display:none}.chat-page .sidebar .nav-button{justify-content:center;padding:13px 6px}.chat-page .sidebar .nav-button>span:not(.nav-symbol):not(.chat-global-badge){display:none}.chat-page .sidebar .brand{height:44px;background:url('/favicon.svg') center/34px no-repeat;margin-bottom:25px}.chat-page .sidebar .brand img{display:none}.chat-page .sidebar .profile-shortcut{padding:0;justify-content:center}.chat-page .shell{margin-left:78px}.chat-page .chat-layout{grid-template-columns:285px minmax(0,1fr)}}
@media(max-width:1100px){.chat-page .sidebar{display:none}.chat-page .shell{margin-left:0}.chat-page:not(.chat-open) .mobile-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr))}.chat-page:not(.chat-open) .shell{padding-bottom:90px}.chat-page:not(.chat-open) .chat-layout{display:block;min-height:280px;height:calc(100dvh - 260px);max-height:none}.chat-page:not(.chat-open) .chat-list{height:100%;width:100%}.chat-page:not(.chat-open) .chat-thread{display:none}.chat-page:not(.chat-open) .page-heading{margin-bottom:12px}.chat-page:not(.chat-open) #main{padding:16px}.chat-open{overflow:hidden;position:static;inset:auto;width:100%;height:auto;overscroll-behavior:auto}.chat-open .shell{height:auto;min-height:0;padding:0;margin:0}.chat-open .topbar,.chat-open .page-heading,.chat-open .page-footer,.chat-open .mobile-nav{display:none!important}.chat-open #main{position:fixed;left:0;right:0;top:var(--chat-vtop,0px);height:var(--chat-vheight,100dvh);padding:0!important;margin:0;max-width:none;overflow:hidden;box-sizing:border-box}.chat-open .chat-layout{height:100%;width:100%;min-height:0;margin:0;border-radius:0;border:0;display:flex}.chat-open .chat-layout>.chat-list{display:none}.chat-open .chat-thread{display:flex;width:100%;height:100%;overflow:hidden}.chat-open .thread-back{display:grid;place-items:center;width:38px;height:42px;min-width:38px}.chat-open .thread-heading{padding:calc(8px + env(safe-area-inset-top,0px)) 10px 8px;min-height:60px;gap:8px}.chat-open .thread-heading h3{font-size:15px}.chat-open .thread-heading p{font-size:11px}.chat-open .messages{padding:12px;flex:1 1 0;min-height:0!important}.chat-open .message .bubble{max-width:min(88%,600px)}.chat-open .chat-compose{max-height:60%;padding:8px 8px calc(8px + env(safe-area-inset-bottom,0px));grid-template-columns:36px minmax(100px,1fr) 44px;gap:4px}.chat-open .chat-compose .send-message-button{grid-column:3;grid-row:1;width:44px;min-width:44px}.chat-open .chat-compose textarea{grid-column:2;grid-row:1}.chat-open .recording-controls [data-attach-chat]{grid-column:1;grid-row:1;width:36px}.chat-open .recording-controls [data-record=voice]{grid-row:2;grid-column:1;width:40px}.chat-open .recording-controls [data-record=video_note]{grid-row:2;grid-column:2;justify-self:start;width:40px}.chat-open .recording-controls>[data-stop-record]{grid-row:4;grid-column:1/3}.chat-open .recording-controls>[data-discard-record]{grid-row:4;grid-column:3;font-size:11px;padding:5px;min-width:44px}.chat-open .chat-compose:has(#reply-banner:not([hidden])) textarea,.chat-open .chat-compose:has(#edit-message-banner:not([hidden])) textarea,.chat-open .chat-compose:has(#reply-banner:not([hidden])) [data-attach-chat],.chat-open .chat-compose:has(#edit-message-banner:not([hidden])) [data-attach-chat],.chat-open .chat-compose:has(#reply-banner:not([hidden])) .send-message-button,.chat-open .chat-compose:has(#edit-message-banner:not([hidden])) .send-message-button{grid-row:2}.chat-open .chat-compose:has(#reply-banner:not([hidden])) [data-record]{grid-row:3}.chat-open .chat-members{max-height:30%;padding:5px 12px;overflow:auto}.chat-open .chat-members summary{font-size:12px;padding:2px 0}.chat-open .jump-bottom{bottom:145px}.chat-description{font-size:12px;max-height:48px}.thread-overflow>summary{height:42px;width:42px}.thread-tools{flex:none}.chat-folder-empty{padding:24px}.voice-player{min-width:165px}.player-stage,.player-timeline{min-width:0}}
@media(max-width:380px){.chat-open .message .bubble{max-width:94%}.chat-open .thread-heading{gap:4px;padding-left:4px;padding-right:4px}.chat-open .thread-heading h3{font-size:13px}.chat-open .thread-heading .avatar{width:30px;height:30px;min-width:30px}.chat-open .thread-back{width:30px;min-width:30px}.round-player{width:195px}.thread-overflow>summary{width:32px}}
@media(prefers-reduced-motion:reduce){.quick-reaction-feedback{animation:none}}
.attachment-dialog{width:min(540px,calc(100vw - 28px));max-height:85dvh;overflow:auto;border:1px solid #ded5e9;border-radius:20px;padding:20px;color:#302548}.attachment-dialog::backdrop{background:#20133266}.attachment-dialog>button{padding:12px;margin:8px 8px 0 0;border-radius:12px;border:0;background:#eee7f7;color:#57406e}.attachment-dialog p{font-size:13px;line-height:1.5;overflow-wrap:anywhere}.attachment-preview-grid{display:flex;gap:10px;overflow:auto}.attachment-preview{min-width:150px;max-width:100%}.attachment-preview img,.attachment-preview video{max-width:100%;width:220px;max-height:180px;object-fit:contain;border-radius:12px;background:#f4f0f9}.attachment-chip{font-size:12px;overflow-wrap:anywhere;padding:5px 0}.attachment-chip button{border:0;border-radius:50%;min-width:32px;min-height:32px;color:#725287;background:#eee6f7}.chat-compose .chat-file-field{grid-column:1/-1}
.chat-pins{display:flex;align-items:center}.chat-pins .pinned-snippet{flex:1;min-width:0}.chat-pins [data-all-pins]{flex:none;background:#f1e9f7;color:#79618e;font-size:11px;border:0;padding:10px;border-radius:10px;margin-right:8px}
/* Keep preview tracks at their content height; compressed auto tracks let the
   camera overlap the Stop button on short viewports. Scroll the composer instead. */
.chat-compose{grid-auto-rows:max-content;align-content:start}.chat-compose .recording-controls>[data-stop-record],.chat-compose .recording-controls>[data-discard-record]{grid-row:2}.chat-compose #record-status{grid-row:3}.chat-compose #record-preview{grid-row:4;align-self:start;min-height:0;display:block}.chat-compose #record-preview:empty{display:none}.chat-compose .chat-file-field{grid-row:5}.chat-compose #record-preview .video-note,.chat-compose #record-preview .round-player{margin:0 auto}.chat-compose #record-preview .camera-preview{width:min(180px,26dvh);height:min(180px,26dvh)}.chat-compose #reply-banner,.chat-compose #edit-message-banner{grid-row:1!important}
.chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) .recording-controls>[data-stop-record],.chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) .recording-controls>[data-discard-record]{grid-row:3}.chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) #record-status{grid-row:4}.chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) #record-preview{grid-row:5}.chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) .chat-file-field{grid-row:6}
@media(max-width:1100px){.chat-open .chat-compose .recording-controls>[data-stop-record],.chat-open .chat-compose .recording-controls>[data-discard-record]{grid-row:3}.chat-open .chat-compose #record-status{grid-row:4}.chat-open .chat-compose #record-preview{grid-row:5}.chat-open .chat-compose .chat-file-field{grid-row:6}.chat-open .chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) [data-record]{grid-row:3}.chat-open .chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) .recording-controls>[data-stop-record],.chat-open .chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) .recording-controls>[data-discard-record]{grid-row:4}.chat-open .chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) #record-status{grid-row:5}.chat-open .chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) #record-preview{grid-row:6}.chat-open .chat-compose:has(#reply-banner:not([hidden]),#edit-message-banner:not([hidden])) .chat-file-field{grid-row:7}}
.onboarding-dialog{width:460px;max-width:calc(100vw - 24px);max-height:85dvh;overflow:auto;border:1px solid #e1d8ec;border-radius:24px;padding:24px;color:#302548;background:#fff;box-shadow:0 10px 50px #24193433}.onboarding-dialog::backdrop{background:#20163066}.onboarding-dialog h2{font-size:21px;margin:0 0 14px}.onboarding-dialog p{font-size:14px;line-height:1.6;margin:10px 0}.onboarding-dialog .onboarding-note{font-size:13px;color:#81718e;background:#f6f1fa;border-radius:14px;padding:12px}.onboarding-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}.onboarding-actions .button{min-height:44px;font-size:14px;flex:1;white-space:normal}.onboarding-help{display:flex;gap:8px;flex-wrap:wrap}
.thread-overflow>div{flex-direction:column;min-width:180px}.thread-overflow .chat-icon-button{display:flex;align-items:center;gap:8px;width:100%;justify-content:flex-start;white-space:nowrap;padding:8px}.thread-overflow .chat-icon-button::after{content:attr(title);font-size:13px}

/* iOS must scroll the history natively while the outer chat fills the viewport. */
.chat-thread .messages{overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y;min-height:0}
@media(max-width:1100px){input,textarea,select,.chat-compose textarea{font-size:16px!important}.chat-open #main{height:var(--chat-vheight,100dvh)}}
