/* Mobile keeps the original Luna artwork, without desktop-sized blank windows. */
@media (max-width:650px), (max-width:950px) and (max-height:500px) {
 html {height:100%;overscroll-behavior:none;touch-action:manipulation}
 body {touch-action:manipulation}
 body {position:fixed;top:var(--mobile-top,0px);left:0;width:100%;height:var(--mobile-height,100dvh);text-size-adjust:100%;-webkit-text-size-adjust:100%;overscroll-behavior:none;background:#fff;--bar-height:26px;--safe-bottom:env(safe-area-inset-bottom,0px);--window-top:96px}
 #desktop {inset:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) calc(var(--bar-height) + var(--safe-bottom)) env(safe-area-inset-left,0px)}
 #canvas-tools {top:8px;width:min(350px,calc(100% - 24px));max-width:none}
 #canvas-tools .titlebar {height:24px;min-height:24px}
 .canvas-tool-row {padding:5px;gap:4px}
 .canvas-create {font-size:10px;padding:4px 6px}
 .canvas-toolbar-footer {font-size:8px;padding:0 6px 5px}
 #canvas-search {font-size:16px}
 #desktop .window:not([hidden]), #desktop #player-window:not([hidden]) {left:var(--window-left,50%)!important;right:auto!important;top:var(--window-y,calc(var(--window-top) + var(--window-offset,0px)))!important;bottom:auto!important;transform:var(--window-translate,translateX(-50%));width:min(350px,calc(100% - 24px))!important;min-width:0!important;min-height:0!important;max-height:calc(100% - var(--window-top) - var(--window-offset,0px) - 12px)!important;resize:none!important}
 #desktop #chat-window {height:440px!important}
 #desktop #chat-window:has(#chat-signin:not([hidden])) {height:350px!important}
 #desktop #gallery-window,#desktop #profile-window {height:470px}
 #desktop #player-window:not([hidden]) {--window-offset:28px;width:min(300px,calc(100% - 24px))!important;height:286px}
 #player-window .media-volume input {width:48px}
 #player-window .media-controls {width:270px}
 #player-window #media-open {left:auto;right:6px}
 #desktop .window.maximized:not([hidden]), #desktop #player-window.maximized:not([hidden]), #desktop #chat-window.maximized:not([hidden]), #desktop #chat-window.maximized:has(#chat-signin:not([hidden])) {top:6px!important;left:6px!important;transform:none;width:calc(100% - 12px)!important;height:calc(100% - 12px)!important;max-height:calc(100% - 12px)!important}
 .window .titlebar {flex-shrink:0;touch-action:none;cursor:grab}
 button,a {touch-action:manipulation}
 .window .window-controls button,#player-window .window-controls button {width:27px;min-width:27px;height:27px;background-position:center!important;background-repeat:no-repeat!important}
 .window-controls button:after {left:9px;top:9px}
 .window .titlebar h1,.window .titlebar h2 {font-size:12px}
 .window .menubar {flex-shrink:0;min-height:25px}
 #chat-window .messenger-brand {height:34px;min-height:34px;padding:4px 10px}
 .messenger-signin {padding:14px 16px}
 .messenger-signin>img {width:28px;height:28px;margin-bottom:6px}
 .messenger-signin h3 {font-size:15px}
 .messenger-signin>p:first-of-type {margin-bottom:12px}
 .messenger-signin input, #message, .window input:not([type=range]), .window textarea, .live-generator input {font-size:16px}
 .messenger-signin .xp-button {min-height:30px}
 .messenger-session {grid-template-columns:minmax(0,1fr) 56px}
 .conversation-avatars img {width:42px;height:42px}
 .conversation-avatars {gap:5px;padding-right:4px}
 .conversation-avatars>div {padding:3px}
 .messenger-me {padding:5px 8px;min-height:48px}
 .messenger-me>img {width:32px;height:32px}
 .profile-content {padding:8px}
 .profile-actions {padding:6px;gap:5px;flex-wrap:wrap}
 .profile-actions .xp-button {font-size:10px;min-height:28px}
 .window.dialog {overflow:hidden}
 .dialog .about-copy,.dialog .settings-content,.dialog .wizard,.dialog .live-generator {min-height:0;overflow:auto;overscroll-behavior:contain}
 .dialog-footer {flex-shrink:0;padding:8px}
 #taskbar {bottom:var(--safe-bottom);height:var(--bar-height);padding:0 env(safe-area-inset-right,0px) 0 env(safe-area-inset-left,0px);align-items:flex-start;background-color:#245edb;background-position:left top,left bottom;background-size:auto 4px,auto 26px;overflow:hidden}
 #start-button {width:72px;min-width:72px;height:26px;align-self:flex-start;padding:0 12px 0 6px;gap:2px;flex:0 0 72px}
 #start-button>img {width:18px;height:18px}
 #start-button span {font-size:17px;line-height:26px;top:0}
 #taskbar .quick-launch {display:flex;align-items:center;flex:0 0 27px;height:26px;margin:0 1px 0 2px;padding:0 1px}
 #taskbar .quick-launch button {display:flex;align-items:center;justify-content:center;width:25px;height:26px;padding:0}
 #taskbar .quick-launch img {width:17px;height:17px}
 #task-buttons {height:26px;align-items:flex-start;flex:1 1 0;gap:3px;padding:2px 4px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain}
 #task-buttons::-webkit-scrollbar {display:none}
 #task-buttons .task-button {flex:0 0 32px;min-width:32px;max-width:32px;height:22px;min-height:22px;padding:0;justify-content:center}
 .task-button span {display:none}
 .task-button img {width:16px;height:16px;flex-shrink:0}
 #taskbar .system-tray {height:26px;min-height:26px;margin:0;align-self:flex-start;align-items:center;gap:4px;padding:0 7px 0 17px;flex:0 0 auto}
 .system-tray>img {display:none}
 #taskbar #tray-sound {width:18px;min-width:18px;height:26px;margin:0;padding:0;border:0;display:flex;align-items:center;justify-content:center;line-height:0;background:none}
 #taskbar #tray-sound img {display:block;width:16px;height:16px;margin:0;flex:none;object-fit:contain}
 #clock {font-size:10px;line-height:26px;min-width:46px;white-space:nowrap;margin:0}
 #desktop #start-menu {left:4px;bottom:0;width:min(350px,calc(100% - 8px));max-width:none;max-height:calc(100% - 8px);display:flex;flex-direction:column}
 #start-menu>header {height:48px;min-height:48px;padding:5px 8px;flex-shrink:0}
 #start-menu>header img {width:36px;height:36px}
 #start-menu>header strong {font-size:15px;min-width:0;overflow:hidden;text-overflow:ellipsis}
 #start-menu .start-columns {height:320px;max-height:none;min-height:0;flex:1 1 auto}
 #start-menu .start-left,#start-menu .start-right {padding:4px;overscroll-behavior:contain}
 #start-menu .start-columns button {font-size:10px;gap:5px;min-height:32px}
 #start-menu .start-columns button img {width:24px;height:24px;flex-shrink:0}
 #start-menu .start-columns button>span>small {font-size:9px}
 #start-menu>footer {height:38px;min-height:38px;flex-shrink:0;padding:4px 6px;gap:8px}
 #start-menu>footer button {font-size:10px}
 #start-menu>footer img {width:22px;height:22px}
 body[data-mobile-keyboard=true] {--window-top:6px;--safe-bottom:0px}
 body[data-mobile-keyboard=true] #canvas-tools {z-index:4}
 body[data-mobile-keyboard=true] #chat-window .messenger-brand,body[data-mobile-keyboard=true] .messenger-me,body[data-mobile-keyboard=true] .room-heading {display:none}
 body[data-mobile-keyboard=true] .messenger-signin>img,body[data-mobile-keyboard=true] .messenger-signin>p:first-of-type {display:none}
 body[data-mobile-keyboard=true] .messenger-signin {padding:8px 12px}
 body[data-mobile-keyboard=true] #chat-log {min-height:24px}
 body[data-mobile-keyboard=true] .conversation-avatars {display:none}
 body[data-mobile-keyboard=true] .messenger-session {grid-template:'log' minmax(24px,1fr) 'compose' 100px 'status' 23px / minmax(0,1fr)}
}
@media (max-width:650px) and (max-height:500px), (max-width:950px) and (max-height:500px) {
 body {--window-top:6px}
 #desktop #player-window:not([hidden]) {--window-offset:0px}
 .messenger-session {grid-template-rows:36px 22px minmax(20px,1fr) 92px 20px}
 .messenger-session>.messenger-me {padding:2px 8px}
 .messenger-me>img {width:28px;height:28px}
}

/* Give mobile conversations the space previously occupied by the composer. */
@media (max-width:650px), (max-width:950px) and (max-height:500px) {
 #desktop #chat-window {height:500px!important}
 #desktop #chat-window .messenger-session {grid-template-rows:44px 25px minmax(40px,1fr) 76px 23px;grid-template-columns:minmax(0,1fr) 80px}
 #chat-window .messenger-me {min-height:0;padding:4px 8px}
 #chat-window .messenger-brand {height:28px;min-height:28px}
 #chat-window .chat-compose {padding-bottom:3px}
 #chat-window .compose-tools {height:25px;margin-bottom:2px}
 #chat-window #message {height:38px;min-height:38px;padding:4px;font-size:16px;line-height:20px}
 #chat-window #chat-form .xp-button {min-height:38px}
 #chat-window #chat-log {padding:8px}
 #chat-window .chat-message p {font-size:13px;line-height:19px}
 #chat-window .chat-message {gap:6px;margin-bottom:13px}
 #chat-window .chat-message>img {width:23px;height:23px}
 #chat-window .chat-message time {float:none;display:block;margin-top:2px}
 body[data-mobile-keyboard=true] #desktop #chat-window .messenger-session {grid-template:'log' minmax(24px,1fr) 'compose' 76px 'status' 23px / minmax(0,1fr)}
}
