/* Stable heights: longer localized labels use horizontal room, not taller rows. */
body.referenceHUD :is(#settingsDialog,#accountDialog,#friendsPanel,#globalChat,.gameSelectionDialog) button:not(.emojiGrid button):not(.gifGrid button):not(.emojiOpen):not(.accountAvatarEdit){height:34px;min-height:34px;max-height:34px;padding-block:5px;line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;flex-shrink:0}
body.referenceHUD :is(input:not([type=range]):not([type=checkbox]):not([type=file]),textarea):focus{outline:2px solid #ffdb59!important;outline-offset:1px;border-color:#ffdb59!important;box-shadow:0 0 0 2px #ffdb5925!important}
#friendsPanel #friendSearch{display:flex;align-items:center;flex-wrap:nowrap;gap:8px;margin:8px 12px!important;padding:0!important;flex:none}
#friendSearch .gameSelectTrigger{flex:0 1 110px;min-width:70px}#friendSearch input{flex:1 1 100px!important;min-width:60px;width:auto!important;height:34px!important}#friendSearch>button[type=submit]{flex:none}#friendNewGroup{flex:none}
#friendsPanel:not(.inConversation):not(.inRoomInfo) #friendsBody{flex:1;min-height:0;overflow-y:auto;padding:6px 12px 12px!important}#friendsPanel #friendsStatus:empty{display:none}#friendsTabs{margin:4px 12px!important;flex:none}#friendsPanel .conversationCard{padding-block:6px!important}.conversationCard button{height:64px!important;min-height:64px!important;max-height:64px!important;white-space:normal!important}
:is(#chatPanel .chatScreenshot,#friendsPanel .friendScreenshot){display:block;width:auto;max-width:min(170px,100%);max-height:92px;object-fit:contain;border-radius:7px;cursor:zoom-in}#friendsPanel .friendMessages .friendScreenshot{max-height:92px;max-width:170px}#chatAttachmentPreview,.friendAttachment{max-height:70px!important;max-width:120px!important;object-fit:contain}.viewableImage:focus-visible{outline:2px solid #ffdb59;outline-offset:3px}
body.referenceHUD dialog.imageViewer{position:fixed;inset:0;margin:auto;padding:0;width:min(1000px,94vw);max-width:94vw;height:min(680px,90dvh);max-height:90dvh;border:1px solid #bfefff;border-radius:14px;background:#154f72;overflow:hidden;box-shadow:0 20px 70px #001d3dcc}dialog.imageViewer[open]{display:flex;flex-direction:column}.imageViewer::backdrop{background:#001529c9!important}.imageViewerBar{display:flex;align-items:center;gap:8px;padding:10px 12px;background:#1b6489;flex:none}.imageViewerBar strong{flex:1}.imageViewerBar button{height:34px;min-width:36px;padding:5px 10px}.imageViewerCanvas{position:relative;flex:1;min-height:0;display:grid;place-items:center;overflow:hidden;touch-action:none;cursor:grab;user-select:none}.imageViewerCanvas.dragging{cursor:grabbing}.imageViewerCanvas img{max-width:85%;max-height:100%;object-fit:contain;user-select:none;touch-action:none;transform-origin:center;will-change:transform}.imageViewerHint{font-size:11px;color:#c7eaff;text-align:center;padding:8px;flex:none}
body.referenceHUD dialog.gameSelectionDialog,body.referenceHUD dialog.gameSelectionDialog.languageChoiceOverlay{width:min(480px,calc(100vw - 28px));padding:20px;max-height:calc(100dvh - 28px)}.gameSelectionDialog .gameSelectionOptions{gap:10px}.gameSelectionDialog .gameSelectionOptions button{height:44px!important;min-height:44px!important;max-height:44px!important;font-size:15px;text-align:left;padding:9px 15px!important;line-height:24px!important;border-radius:8px;white-space:nowrap!important}.gameSelectionDialog .dialogHead{margin:0 0 16px}.gameSelectionDialog .dialogHead h2{font-size:20px!important;line-height:1.3}.gameSelectionDialog .dialogHead button{width:34px;height:34px;padding:0;flex:none}
body.referenceHUD #settingsDialog{width:min(760px,calc(100vw - 28px));max-width:760px;height:min(660px,calc(100dvh - 28px));max-height:calc(100dvh - 28px);padding:0;overflow:hidden;background:linear-gradient(145deg,#237ca7,#185d86)}#settingsDialog[open]{display:flex;flex-direction:column}#settingsDialog>.dialogHead{padding:16px 20px;margin:0;border-bottom:1px solid #c5efff44;flex:none}#settingsDialog>.dialogHead h2{font-size:24px;margin:0}#settingsContent{flex:1;min-height:0;overflow-y:auto;overflow-x:auto;padding:0 20px;scrollbar-width:thin;scrollbar-color:#bfefff #145371}#settingsContent .settingsSection{padding:14px 0;border-bottom:1px solid #c5efff33}#settingsContent h3{font-size:14px;font-weight:600;letter-spacing:.3px;margin:0 0 5px;color:#bfefff}#settingsContent label{display:flex!important;align-items:center;justify-content:space-between;flex-wrap:nowrap!important;gap:14px!important;min-height:46px;height:46px;max-height:46px;padding:6px 0!important;border:0!important;font-size:13px;line-height:20px;white-space:nowrap}#settingsContent label>span{display:flex;align-items:center;gap:10px;flex:0 0 auto}#settingsContent label input[type=range]{width:180px;flex:0 0 180px;max-width:none;margin:0}#settingsContent label>output{margin-left:auto;min-width:55px;text-align:right}#settingsContent label input[type=checkbox]{appearance:none;width:38px;height:22px;border-radius:11px;background:#10486a;border:1px solid #bfefff77;position:relative;flex:none;margin:0}#settingsContent label input[type=checkbox]::after{content:'';position:absolute;width:14px;height:14px;border-radius:50%;top:3px;left:3px;background:#c5dce7}#settingsContent label input[type=checkbox]:checked{background:#8bd3ed}#settingsContent label input[type=checkbox]:checked::after{left:19px;background:#164c68}#settingsContent input[type=number]{width:100px;flex:none;height:34px!important}#settingsContent .gameSelectTrigger,#settingsContent #systemLanguageOpen,#settingsContent #chatLanguageOpen{min-width:180px;max-width:320px;margin-left:auto;font-size:13px}#settingsContent p:not(:empty){font-size:11px;line-height:1.4;margin:5px 0;color:#c4e7f7}#settingsContent p:empty{display:none}#settingsContent .settingsSection>button{margin:5px 8px 5px 0}#settingsContent #creatorLinks{margin:0;padding:0;border:0}#settingsContent #creatorLinks legend{display:none}#settingsContent #creatorLinks a{font-size:12px;margin-right:14px}.settingsFooter{padding:12px 20px;border-top:1px solid #c5efff44;display:flex;align-items:center;gap:10px;flex:none;background:#155476}.settingsFooter .sessionActions{display:flex;gap:10px;flex:1;margin:0!important;flex-wrap:wrap}.settingsFooter button{margin:0!important}
body.referenceHUD #warpConfirmDialog{width:min(450px,calc(100vw - 28px));padding:20px;background:linear-gradient(145deg,#298db5,#165a80)}#warpConfirmDialog .dialogHead{margin-bottom:16px;gap:12px}#warpConfirmDialog h1{font-size:23px;margin:0}.warpSummary{display:grid;gap:12px;background:#104d7399;border:1px solid #bfefff55;border-radius:10px;padding:14px}.warpSummaryRow{display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:32px}.warpSummaryRow>span{font-size:12px;color:#bfefff}.warpSummaryRow :is(p,strong){margin:0;color:white;font-size:14px;line-height:1.3;text-align:right;overflow-wrap:anywhere}.warpSummaryRow #warpDestination{font-size:18px;font-weight:500}.warpActions{display:flex;justify-content:flex-end;gap:12px;margin-top:18px}.warpActions button{height:36px;padding:6px 18px}.warpActions .primary{background:#bfefff;color:#13496a;letter-spacing:0}
@media(max-height:500px){#settingsDialog>.dialogHead{padding:10px 16px}.settingsFooter{padding:8px 16px}#settingsContent{padding:0 16px}.settingsSection{padding-block:10px!important}.gameSelectionDialog .gameSelectionOptions{gap:7px}.gameSelectionDialog .gameSelectionOptions button{height:40px!important;min-height:40px!important;max-height:40px!important}}
@media(max-width:560px){#friendsPanel #friendSearch{flex-wrap:wrap}#friendSearch input{flex-basis:100px}#friendNewGroup{margin-left:auto}#settingsContent label{min-width:480px}.settingsFooter{flex-wrap:wrap}.settingsFooter .sessionActions{gap:7px}.settingsFooter button{font-size:12px}}
[hidden],#retiredControls{display:none!important}
body.referenceHUD dialog.gameSelectionDialog[open],body.referenceHUD dialog.gameSelectionDialog.languageChoiceOverlay[open]{display:block!important;place-items:normal;align-items:normal}body.referenceHUD .gameSelectionDialog>.dialogHead{width:100%;justify-content:space-between}body.referenceHUD .gameSelectionDialog>.gameSelectionOptions{display:grid;width:100%!important;justify-items:stretch;grid-template-columns:minmax(0,1fr)}body.referenceHUD .gameSelectionDialog .gameSelectionOptions>button{width:100%!important;max-width:none;text-align:left}
body.referenceHUD #settingsDialog .settingsFooter .sessionActions{flex-wrap:nowrap;gap:8px}body.referenceHUD #settingsDialog .settingsFooter .sessionActions>button{flex:0 0 auto;min-width:72px;padding-inline:10px}.settingsFooter{overflow-x:auto;min-height:58px}
body.referenceHUD #settingsDialog .settingsFooter .sessionActions{display:flex;flex-wrap:nowrap}body.referenceHUD #settingsDialog .settingsFooter{height:58px;max-height:58px;min-height:58px;flex-wrap:nowrap}#friendSearch input::placeholder{color:#c5eaff!important}
body:has(#boot:not(.hidden)) dialog.imageViewer,body:has(#rotatePrompt.visible) dialog.imageViewer{display:none!important}

body.referenceHUD #freeCameraConfirmDialog{width:min(450px,calc(100vw - 28px));padding:20px;background:linear-gradient(145deg,#298db5,#165a80);color:white;border:2px solid #9de8ff;border-radius:16px}#freeCameraConfirmDialog h1{font-size:23px;margin:0}#freeCameraMessage{color:#d8f5ff}
