/* Phone layout is a single conversation with an optional navigation drawer. */
@media(max-width:700px), (max-width:1000px) and (max-height:500px){
 html,body{width:100%;overscroll-behavior:none}
 .app{display:grid!important;grid-template-columns:minmax(0,1fr)!important;height:calc(var(--sol-viewport-height,100dvh) - var(--phone-nav-height,64px))!important;width:100%;overflow:hidden}
 .main{grid-column:1;min-width:0;min-height:0;display:flex;flex-direction:column}
 .servers{display:none!important}.channels{display:none!important;position:fixed;left:60px!important;top:0;bottom:var(--phone-nav-height,64px);width:calc(min(100vw,390px) - 60px)!important;z-index:61!important}
 body.phone-drawer-open .servers{display:flex!important;position:fixed;left:0;top:0;bottom:var(--phone-nav-height,64px);width:60px;z-index:62}
 body.phone-drawer-open .channels{display:flex!important}
 .phone-drawer-scrim{position:fixed;inset:0;z-index:60;background:#0009;border:0;width:100%;height:100%}
 .topbar{height:56px!important;min-height:56px;padding:0 8px!important;gap:6px!important;overflow:hidden}.top-title{flex:1;min-width:0;max-width:none!important;font-size:16px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .topbar .search,.top-hash,.top-sep,.topic,.members-count{display:none!important}.top-actions{flex:0 0 auto;margin-left:0!important;gap:0}.top-actions>button{display:none!important}.feature-buttons{display:flex;gap:0}.feature-buttons>button{display:none!important}.feature-buttons #voiceControls,.feature-buttons #inbox{display:grid!important}.topbar .icon-btn{width:44px!important;height:44px!important;min-width:44px}.mobile-menu{display:grid!important}
 .chat{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}.welcome{padding:18px 16px 8px!important}.welcome-icon,.welcome-kicker,.welcome-rule,.welcome>p{display:none!important}.welcome h1{font-size:20px!important;line-height:1.3;margin:0!important;overflow-wrap:anywhere}
 .message{padding:12px 14px!important;gap:10px!important;min-width:0;position:relative}.message>.avatar{width:32px!important;height:32px!important;flex-shrink:0}.msg-content,.message-body{min-width:0}.msg-text{overflow-wrap:anywhere}.message-actions{position:static!important;background:none!important;box-shadow:none!important;border:0!important;margin:4px 0 0!important;padding:0!important;justify-content:flex-end}.message-actions .select-message{display:none!important}.message-actions .touch-message-actions{display:inline-flex!important;min-width:44px;min-height:36px;align-items:center;justify-content:center;background:transparent!important}.message-actions:has(input:checked) .select-message{display:inline-flex!important}
 .composer-wrap{flex:none!important;padding:6px 10px 8px!important;min-width:0}.composer{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:2px!important;padding:6px!important;min-width:0}.composer textarea{order:0;flex:1 0 100%!important;width:100%!important;min-width:0;font-size:16px!important;line-height:1.45;max-height:100px!important;padding:6px 8px!important}.composer>button{order:1;flex:0 0 40px;width:40px!important;min-width:40px!important;min-height:40px!important}.composer .send{margin-left:auto!important}.hint{display:none!important}
 .mobile-bottom-nav{height:auto;min-height:56px;padding:4px 6px calc(4px + env(safe-area-inset-bottom))!important;gap:2px;z-index:70}.mobile-bottom-nav button{flex:1;min-width:0;min-height:44px;padding:8px 4px!important;border:0!important;background:transparent!important;font-size:13px!important}.mobile-bottom-nav button[aria-expanded=true]{color:var(--accent)}
 .mobile-keyboard-open .app{height:var(--sol-viewport-height,100dvh)!important}.mobile-keyboard-open .mobile-bottom-nav{display:none!important}.mobile-keyboard-open .composer-wrap{padding-bottom:8px!important}.mobile-keyboard-open .channels,.mobile-keyboard-open .servers{bottom:0!important}
 .poll-card{max-width:100%;min-width:0}.poll-card footer{flex-wrap:wrap}.modal{max-width:calc(100vw - 16px)!important;max-height:calc(var(--sol-viewport-height,100dvh) - 16px)!important}.message-attachments{max-width:100%}
}

@media(max-width:700px), (max-width:1000px) and (max-height:500px){
 .mobile-bottom-nav{display:none!important}
 .app{height:var(--sol-viewport-height,100dvh)!important}
 .channels,body.phone-drawer-open .servers{bottom:0!important}
 .composer-wrap{padding-bottom:max(8px,env(safe-area-inset-bottom))!important}
 .feature-buttons #inbox{display:none!important}
 .feature-buttons #phoneSearch,.feature-buttons #phoneSettings{display:grid!important}
 .phone-people{display:block;width:100%;text-align:left;padding:14px 18px;min-height:48px;background:transparent;color:var(--text);border-bottom:1px solid var(--border);font-weight:700;font-size:16px}
}
@media(min-width:701px) and (min-height:501px), (min-width:1001px){#phoneSearch,#phoneSettings,.phone-people{display:none!important}}

@media(max-width:700px), (max-width:1000px) and (max-height:500px){
 body:not([data-theme-mode=light]) .main,body:not([data-theme-mode=light]) .chat,body:not([data-theme-mode=light]) .composer-wrap{background:color-mix(in srgb,var(--bg) 35%,#050505)!important}
 body:not([data-theme-mode=light]) .topbar{background:color-mix(in srgb,var(--accent) 6%,#100908)!important}
 .topbar{height:60px!important;min-height:60px}.top-title{font-size:18px!important;line-height:1.3}.feature-buttons #voiceControls,.feature-buttons #phoneSettings{display:none!important}
 .message{padding:10px 14px 14px!important;gap:10px!important;content-visibility:visible!important;contain-intrinsic-size:none!important}.message>.avatar{width:36px!important;height:36px!important}.msg-body{flex:1;min-width:0}.msg-head{display:flex;flex-wrap:wrap;gap:6px!important;padding-right:24px}.msg-name{font-size:16px!important;font-weight:750!important}.msg-time{font-size:11px!important;white-space:nowrap}.msg-text{font-weight:450!important;line-height:1.5!important}.message-actions{height:0;margin:0!important;overflow:visible}.message-actions .touch-message-actions{position:absolute;right:6px;top:2px;min-width:32px;min-height:36px;opacity:.5;padding:0!important;font-size:16px!important}.select-message{display:none!important}
 .reply-quote{font-size:13px!important;line-height:1.4;max-height:42px;overflow:hidden;border-left:2px solid var(--border);padding-left:10px;opacity:.8}.reaction-row{gap:5px;margin-top:7px!important}.reaction,.reaction-add{min-height:32px!important;border-radius:10px!important;padding:4px 9px!important;font-size:13px!important}.reaction-add{width:34px;min-width:34px!important}
 .phone-has-messages .welcome{display:none!important}.history-controls{font-size:12px;flex-wrap:wrap}.date-separator{font-size:11px!important;margin:14px 0!important}
 .composer{flex-wrap:nowrap!important;border-radius:22px!important;gap:0!important;padding:5px 4px!important;min-height:52px}.composer textarea{order:1!important;flex:1 1 0!important;width:auto!important;min-width:0!important;padding:8px 4px!important;font-size:16px!important;max-height:120px!important}.composer #attach{order:0!important}.composer #emoji,.composer #recordVoiceMessage,.composer .send{order:2!important}.composer #pollCreate,.composer #gifPicker{display:none!important}.composer>button{flex:0 0 38px!important;min-width:38px!important;width:38px!important;min-height:42px!important;border:0!important;background:transparent!important}.composer .send{display:none!important;margin:0!important}.composer.phone-composing .send{display:grid!important;border-radius:50%;background:var(--accent)!important}.composer.phone-composing #recordVoiceMessage{display:none!important}.composer-wrap{padding:8px 12px max(10px,env(safe-area-inset-bottom))!important}.typing{font-size:11px!important;min-height:0!important}.typing:empty{display:none}.upload-queue{max-height:110px;overflow:auto}.reply-composer{font-size:13px!important}
 .phone-drawer-actions{display:grid;padding:8px;gap:2px;border-bottom:1px solid var(--border)}.phone-drawer-actions button{min-height:44px;text-align:left;background:transparent;color:var(--text);padding:10px;font-size:14px;font-weight:650}.phone-add-menu{display:grid;gap:6px}.phone-add-menu button{min-height:52px;text-align:left;background:var(--panel2);color:var(--text);border:1px solid var(--border);border-radius:10px;padding:12px 16px;font:inherit}.phone-add-menu button:disabled{opacity:.4}
 .modal-backdrop{padding:8px!important;align-items:center!important}.modal{width:100%!important;min-width:0!important;margin:0!important;overflow:hidden!important;border-radius:16px!important;display:flex;flex-direction:column;padding:16px!important}.modal-body{overflow-y:auto!important;min-height:0;max-width:100%;padding:10px 0!important}.modal-head{flex:none}.modal input:not([type=checkbox]):not([type=range]):not([type=color]),.modal textarea,.modal select{font-size:16px!important;min-height:44px;max-width:100%}.modal button{min-height:44px}.modal .modal-title{font-size:20px!important}.modal.user-settings{display:flex!important;max-height:calc(var(--sol-viewport-height,100dvh) - 16px)!important}.user-settings .settings-nav{flex:none;padding:8px 0!important;max-height:60px}.user-settings #modalBody{padding:12px 0!important;flex:1}.user-settings>.appearance-footer{flex:none;padding:10px 0!important}.settings-cards{margin:12px 0}.settings-intro{font-size:20px}.expression-grid,.gif-results{max-width:100%}.profile-editor{min-width:0}.profile-editor aside{max-width:100%}.context-menu{max-width:calc(100vw - 16px)!important;max-height:calc(var(--sol-viewport-height,100dvh) - 24px)!important;overflow:auto}.poll-card button{white-space:normal;overflow-wrap:anywhere}.poll-card footer{font-size:11px}.voice-player{max-width:100%;min-width:0;flex-wrap:wrap}.voice-waveform{min-width:0}.call-grid{grid-template-columns:minmax(0,1fr)!important}.call-controls{flex-wrap:wrap}
}
@media(min-width:701px) and (min-height:501px), (min-width:1001px){.phone-drawer-actions{display:none}}

@media(max-width:700px), (max-width:1000px) and (max-height:500px){.phone-drawer-actions{display:flex;gap:0;padding:4px}.phone-drawer-actions button{flex:1;min-width:0;padding:8px 4px;text-align:center;font-size:11px}.channels .product-launcher{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;padding:4px}.channels .product-launcher button{padding:6px 2px;font-size:11px;min-height:36px}.phone-people{font-size:14px;min-height:44px;padding:10px 14px}.channel-scroll{min-height:0;overflow-y:auto}.channel-label{overflow:hidden;text-overflow:ellipsis}.channel-gear,.channel-move{min-width:32px;min-height:36px}.friends-page{padding:16px!important}.friends-heading{flex-wrap:wrap}.friend-row{min-width:0}.friend-actions{flex-wrap:wrap}.reply-quote{margin:0 0 5px!important}.emoji-only-message .msg-text{font-size:var(--emoji-message-size)!important}}

.phone-reply-bar{display:none}@media(max-width:700px), (max-width:1000px) and (max-height:500px){.phone-reply-bar:not([hidden]){display:flex;align-items:center;justify-content:space-between;font-size:13px;color:var(--muted);padding:0 8px}.phone-reply-bar button{width:44px;height:36px;background:transparent;color:var(--text);font-size:22px}}

@media(max-width:700px), (max-width:1000px) and (max-height:500px){body{zoom:1!important}body .app{height:var(--sol-viewport-height,100dvh)!important}body .modal{max-width:calc(100vw - 16px)!important;max-height:calc(var(--sol-viewport-height,100dvh) - 16px)!important}.settings-nav{overflow-y:hidden!important;scrollbar-width:none}.settings-nav::-webkit-scrollbar{display:none}.modal-body{scrollbar-width:thin}.modal-body>form,.modal-body .product-grid,.modal-body .form-grid{min-width:0}.expression-grid{height: min(360px,45dvh)!important}.expression-toolbar{flex-wrap:wrap;gap:8px}.expression-toolbar input{flex:1;min-width:0}.expression-toolbar select{width:auto;max-width:130px}.expression-tabs{scrollbar-width:none}.expression-footer{flex-wrap:wrap}.upload-item{min-width:0;max-width:100%}.gif-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

@media(max-width:700px), (max-width:1000px) and (max-height:500px){body [hidden],body #composer[hidden]{display:none!important}.composer-wrap:has(#composer[hidden]){display:none!important}.mobile-bottom-nav{display:none!important}}

@media(max-width:700px), (max-width:1000px) and (max-height:500px){.call-panel{inset:60px 8px 12px 8px!important;max-height:calc(var(--sol-viewport-height,100dvh) - 72px);padding:14px!important}.call-panel:not(:has(.call-person)){top:auto!important;max-height:calc(var(--sol-viewport-height,100dvh) - 24px)}.call-stage:empty{display:none}.call-panel button,.call-dock button{min-height:44px}.call-dock{left:10px!important;right:10px;bottom:max(10px,env(safe-area-inset-bottom));max-width:calc(100vw - 20px)}body:not([data-theme-mode=light]) .composer{background:color-mix(in srgb,var(--accent) 12%,#180909)!important;border-color:color-mix(in srgb,var(--accent) 18%,#302222)!important}.message{padding-bottom:calc(8px + var(--message-spacing,16px) / 2)!important}}

/* Compact phone proportions derived from the supplied mobile reference. */
@media(max-width:700px), (max-width:1000px) and (max-height:500px){
 body{font-size:14px!important}
 body .topbar{height:52px!important;min-height:52px!important;padding:0 8px!important}
 body .topbar .top-title{font-size:16px!important;font-weight:700!important}
 body .message{padding:7px 12px calc(4px + var(--phone-message-spacing,12px)/2)!important;gap:10px!important}
 body .message>.avatar{width:34px!important;height:34px!important;font-size:14px!important}
 body .message .msg-head{gap:5px!important;line-height:1.25;margin-bottom:2px}
 body .message .msg-name{font-size:14px!important;font-weight:700!important}
 body .message .msg-time{font-size:10px!important}
 body .message .msg-text{font-size:var(--phone-chat-font,14px)!important;line-height:1.4!important;font-weight:400!important}
 body #messages .message .msg-text.emoji-only-message{font-size:calc(var(--emoji-message-size,2)*12px)!important;line-height:1.2!important}
 body .message .reply-quote{font-size:12px!important;line-height:1.35!important;max-height:33px;padding-left:8px;margin-bottom:4px!important}
 body .reaction-row{margin-top:5px!important;gap:4px}
 body .message :is(.reaction,.reaction-add){min-height:28px!important;padding:3px 7px!important;font-size:12px!important;border-radius:8px!important}
 body .message .reaction-add{width:29px!important;min-width:29px!important}
 body .message .reaction .inline-emoji{width:17px;height:17px}
 body .composer-wrap{padding:6px 10px max(8px,env(safe-area-inset-bottom))!important}
 body .composer{min-height:48px!important;padding:3px!important;border-radius:19px!important}
 body .composer textarea{font-size:16px!important;line-height:1.3!important;padding:7px 3px!important}
 body .composer>button{width:34px!important;min-width:34px!important;flex-basis:34px!important;min-height:40px!important}
 body .composer button svg{width:19px!important;height:19px!important}
 body .message .poll-card{padding:12px!important;font-size:13px!important}
 body .message .poll-card strong{font-size:14px!important}
 body .message .poll-card button{font-size:13px!important;padding:9px 10px!important}
 body .message :is(.custom-sticker,.solfire-sticker){max-width:132px;max-height:144px}
 body .channels :is(.channel-label,.workspace-title){font-size:14px!important}
 body .channels .channel{min-height:36px!important;padding-top:6px!important;padding-bottom:6px!important}
 body .modal .modal-title{font-size:18px!important}
 body .modal :is(.modal-body,.modal-body label){font-size:13px!important}
}

@media(max-width:700px), (max-width:1000px) and (max-height:500px){html,body{height:100%;overflow:hidden!important}body .app{transition:none!important}body.mobile-keyboard-open .composer-wrap{padding-bottom:4px!important}body.mobile-keyboard-open #connectionStatus{display:none!important}.chat{overflow-anchor:auto}.composer textarea{scroll-margin:0!important}}

@media(max-width:700px), (max-width:1000px) and (max-height:500px){
 body #featureModal{z-index:1000!important;inset:0!important;width:100%!important;height:100%!important;overflow:hidden}
 body #featureModal .modal.user-settings{width:100%!important;max-width:100%!important;height:100%!important;max-height:100%!important;border-radius:0!important;padding:12px!important;display:flex!important;box-sizing:border-box}
 body #featureModal:has(.user-settings){padding:0!important}
 body .user-settings .settings-nav{flex:none!important;width:100%;max-height:90px!important;display:flex!important;flex-direction:row!important;flex-wrap:wrap;overflow:auto!important;padding:4px 0!important;border-right:0;gap:2px}
 body .user-settings .settings-nav button{font-size:12px!important;padding:7px!important;min-height:36px!important}
 body .user-settings #modalBody{flex:1!important;min-height:0;overflow:auto!important;padding:10px 0!important}
 body .user-settings .settings-intro{font-size:16px!important;margin:0 0 8px!important}
 body .user-settings .settings-cards{gap:8px;margin:12px 0}
 body .user-settings .settings-cards button{padding:12px!important}
 body .user-settings .settings-cards b{font-size:14px!important}
 body .user-settings .settings-cards span{font-size:12px!important;line-height:1.4!important;margin-top:4px}
}
