/* One toolbar outside the projector; reserve its actual height in every room view. */
body{--remote-space:0px;--toolbar-offset:16px;--view-toolbar-height:58px}
body.remote-open{--remote-space:var(--remote-height,170px)}
body .avatar-account{left:50%;top:28px;bottom:auto;transform:translateX(-50%);max-width:min(280px,32vw);z-index:26;font-size:14px;padding:5px 12px;min-height:36px}
body .avatar-account img, .my-playlist-button img{width:28px;height:28px;object-fit:cover;object-position:top;background:#584632;border-radius:50%;flex:none}
body .music-entry-actions{display:flex;align-items:stretch;gap:8px;margin:0 0 10px;min-width:0}
body .record-stack .music-entry-actions .dj-badge{position:static;inset:auto;flex:1;min-width:0;width:auto;max-width:none;min-height:48px;padding:5px 9px;gap:5px;white-space:normal;font-size:14px;line-height:1.4;border:1px solid #c59a6155;background:#2d2016e8;border-radius:12px}
body .music-entry-actions .dj-badge .dj-avatar{width:34px;height:34px}
body .music-entry-actions .my-playlist-button{position:static;inset:auto;display:flex;align-items:center;justify-content:center;gap:6px;flex:none;width:auto;max-width:none;min-height:48px;padding:7px 10px;margin:0;border-radius:12px;font-size:14px;line-height:1.4;white-space:nowrap;background:#302115e8;border:1px solid #c59a6166;color:#f8dfaf;box-shadow:none}
body:not(.far-view) .record-stack{top:124px}
body.far-view .record-stack{top:118px;left:22px;width:clamp(260px,21vw,320px);max-height:calc(100dvh - var(--remote-space) - var(--view-toolbar-height) - var(--toolbar-offset) - 146px);overflow:auto}
body.far-view .record-stack .lp-wall{margin-top:0}
body.far-view .record-stack .music-entry-actions{gap:6px;margin-bottom:8px}
body.far-view .record-stack .dj-badge,body.far-view .music-entry-actions .my-playlist-button{font-size:12px;padding:5px 7px;min-height:44px}
body.far-view .music-entry-actions .dj-badge .dj-avatar{width:28px;height:28px}
body #viewToolbar{position:fixed;inset:auto;left:50%;bottom:calc(var(--remote-space) + var(--toolbar-offset));transform:translateX(-50%);translate:none;width:max-content;max-width:calc(100vw - 48px);margin:0;padding:0;flex-direction:row;justify-content:center;gap:10px;z-index:23;background:none;border:0;box-shadow:none;backdrop-filter:none}
body #viewToolbar button{font-size:13px;padding:9px 11px;min-height:40px}
body:not(.far-view):not(.youtube-size):not(.audio-listening):not(.details-open) .display-wrap{top:124px;left:33%;width:64%;height:clamp(160px,calc(100dvh - var(--view-toolbar-height) - var(--toolbar-offset) - 234px),62dvh);min-height:0;max-height:none}
body.focused:not(.youtube-size):not(.audio-listening):not(.details-open) .display-wrap{left:5%;width:90%;height:clamp(160px,calc(100dvh - var(--view-toolbar-height) - var(--toolbar-offset) - 234px),72dvh)}
/* The remote and DJ already provide these actions. Keep the room view quiet. */
body.far-view .display-wrap>.display-label,body.far-view .display-wrap>.playback-status{display:none}
body.remote-open .lounge-actions{display:none}
body.youtube-size:not(.details-open) .display-wrap{--view-width:min(960px,88vw,calc(max(200px,100dvh - var(--view-toolbar-height) - var(--toolbar-offset) - 232px) * 16 / 9));left:calc((100vw - var(--view-width)) / 2);top:124px;width:var(--view-width);height:calc(var(--view-width)*9/16);margin:0;min-height:200px}
body.audio-listening:not(.details-open) .display-wrap{top:124px;left:calc((100vw - var(--view-width)) / 2);margin:0}
body #displayWrap:fullscreen{inset:0;left:0;top:0;width:100%;height:100%;margin:0;padding:14px;min-height:0;max-height:none;display:flex;flex-direction:column}
body #displayWrap:fullscreen #viewToolbar{position:relative;inset:auto;transform:none;translate:none;width:100%;max-width:none;flex:none;margin-top:auto}
body #displayWrap:fullscreen .screen{height:auto;min-height:0;flex:1}
body.audio-listening #displayWrap:fullscreen .screen{height:203px;flex:none}
/* A draggable avatar has its own ground anchor and never inherits remote offsets. */
body #seatedAvatar[hidden],#playlistAvatarIcon[hidden],#accountAvatarIcon[hidden],#avatarMoveStatus[hidden]{display:none!important}
body #seatedAvatar{display:none;position:fixed;inset:auto;left:var(--avatar-left,21vw);top:var(--avatar-top,80vh);bottom:auto;width:var(--avatar-width,160px);height:auto;margin:0;transform:translate(-50%,-100%);z-index:15;pointer-events:auto;touch-action:none;user-select:none;cursor:grab;filter:drop-shadow(3px 7px 4px #0006);outline-offset:5px;border-radius:20px}
body.far-view #seatedAvatar{display:block}
body.youtube-size #seatedAvatar,body.audio-listening #seatedAvatar,body.details-open #seatedAvatar{display:none}
.seated-avatar img{display:block;width:100%;height:auto;pointer-events:none;user-select:none;-webkit-user-drag:none}
body #seatedAvatar figcaption{font-size:12px;padding:4px 10px;max-width:150px;margin-top:-5px;position:absolute;top:100%;left:50%;transform:translateX(-50%)}
body #seatedAvatar:focus-visible{outline:2px solid #f2c579}
body #seatedAvatar.dragging{cursor:grabbing;filter:drop-shadow(3px 13px 9px #0008);z-index:28}
.avatar-drag-hint{display:none;position:absolute;bottom:100%;left:50%;transform:translateX(-50%);font-size:12px;white-space:nowrap;padding:5px 9px;border-radius:7px;background:#251b12e8;color:#f8dfac;pointer-events:none}
.seated-avatar:hover .avatar-drag-hint,.seated-avatar:focus-visible .avatar-drag-hint,.seated-avatar.dragging .avatar-drag-hint{display:block}
.avatar-move-status{position:fixed;top:78px;left:50%;transform:translateX(-50%);max-width:80vw;z-index:30;margin:0;padding:8px 12px;background:#39291eed;border:1px solid #ae875555;border-radius:8px;color:#f5dfb4;font-size:13px;pointer-events:none}
.seat-choices button{flex:1 1 28%}
@media(min-width:721px) and (max-width:1280px){
  body{--toolbar-offset:8px}
  body #viewToolbar{max-width:94vw}
  body .lounge-actions{bottom:18px}
  body #remoteToggle{bottom:18px}
  body.remote-open #remoteToggle{bottom:calc(var(--remote-space) + 14px)}
  body .avatar-account{max-width:26vw}
  body .record-stack .music-entry-actions{gap:4px}
  body .record-stack .music-entry-actions .dj-badge,body .music-entry-actions .my-playlist-button{font-size:12px;padding:5px 7px}
  body .music-entry-actions .dj-badge .dj-avatar{width:26px;height:26px}
  body .music-entry-actions .my-playlist-button img{width:23px;height:23px}
  body.far-view .record-stack{width:250px;left:15px}
}
@media(max-width:720px){
  body{--toolbar-offset:10px}
  body .avatar-account,body.remote-open .avatar-account{top:88px;left:50%;max-width:82vw;min-height:30px;font-size:12px;padding:3px 10px}
  body .avatar-account img{width:24px;height:24px}
  body #viewToolbar{left:4%;bottom:calc(var(--remote-space) + var(--toolbar-offset));width:92%;max-width:92%;transform:none;flex-direction:column;gap:5px}
  body #viewToolbar .view-group{width:100%;padding:4px}
  body #viewToolbar button{font-size:11px;min-height:36px;padding:7px 5px;white-space:normal;flex:1}
  body #remoteToggle{bottom:calc(var(--view-toolbar-height) + 20px);right:4%;font-size:12px;min-height:36px}
  body.remote-open #remoteToggle{bottom:calc(var(--remote-space) + var(--view-toolbar-height) + 20px)}
  body .lounge-actions{bottom:calc(var(--view-toolbar-height) + 66px);left:4%;right:4%;justify-content:center}
  body:not(.far-view):not(.youtube-size):not(.audio-listening):not(.details-open) .display-wrap,body.focused:not(.youtube-size):not(.audio-listening):not(.details-open) .display-wrap{left:4%;top:146px;width:92%;height:clamp(155px,calc(100dvh - var(--remote-space) - var(--view-toolbar-height) - 264px),270px);min-height:0}
  body:not(.far-view) .record-stack{top:530px;left:4%;width:92%}
  body.far-view .record-stack{top:auto;bottom:calc(var(--view-toolbar-height) + 115px);left:4%;width:92%;max-height:170px;padding:8px 10px}
  body.far-view .record-stack .lp-wall{display:flex;gap:7px;overflow:auto}
  body.far-view .record-stack .music-entry-actions{margin-bottom:3px}
  body .record-stack .music-entry-actions .dj-badge,body .music-entry-actions .my-playlist-button{font-size:13px;min-height:38px}
  body.far-view:not(.details-open) .display-wrap,body.remote-open.far-view:not(.youtube-size):not(.audio-listening):not(.details-open) .display-wrap{left:4%;top:146px;width:92%;height:calc(92vw * .5625);max-height:32dvh;min-height:155px;margin:0;transform:none;position:fixed}
  body.remote-open.far-view .record-stack{display:none}
  body.remote-open.far-view .room{position:fixed;min-height:100dvh}
  body.youtube-size:not(.details-open) .display-wrap{top:146px;left:3%;width:94%;height:calc(94vw * .5625);min-height:200px}
  body.audio-listening:not(.details-open) .display-wrap{top:146px;left:3%;width:94%;height:203px}
  body .avatar-move-status{top:120px;font-size:12px}
  body.far-view #seatedAvatar{display:block}
  body #seatedAvatar figcaption{font-size:10px;padding:3px 7px}
}

/* Desktop controls dock to the viewport bottom and move as one compact group. */
body:not(.mobile-layout){--toolbar-offset:8px}
body:not(.mobile-layout)>#viewToolbar{position:fixed;inset:auto;left:50%;bottom:8px;transform:translateX(-50%);max-width:calc(100vw - 16px);z-index:27;cursor:grab;user-select:none;touch-action:none}
body:not(.mobile-layout)>#viewToolbar[data-moved]{left:var(--toolbar-x);top:var(--toolbar-y);bottom:auto;transform:none}
body:not(.mobile-layout)>#viewToolbar:focus-visible{outline:2px solid #f1cb87;outline-offset:4px;border-radius:10px}
body.toolbar-dragging>#viewToolbar,body.toolbar-dragging>#viewToolbar button{cursor:grabbing}
body.toolbar-dragging .display-wrap iframe{pointer-events:none}
body:not(.mobile-layout).remote-open #oasisRemote{padding-bottom:calc(var(--view-toolbar-height) + 24px)}
@media(min-width:768px) and (max-width:1400px){
 body:not(.mobile-layout) .lounge-actions,body:not(.mobile-layout):not(.remote-open) #remoteToggle{bottom:calc(var(--view-toolbar-height) + 20px)}
}
body:not(.mobile-layout)>[data-free-control]{position:fixed!important;inset:auto!important;left:var(--free-x)!important;top:var(--free-y)!important;bottom:auto!important;right:auto!important;transform:none!important;translate:none!important;margin:0!important;z-index:29!important;transition:background .2s!important;touch-action:none;user-select:none;pointer-events:auto!important}
body.button-dragging iframe{pointer-events:none}body.button-dragging,body.button-dragging button{cursor:grabbing!important}
body.mobile-layout #resetDesktopControls{display:none}

/* v48: stable first-row columns; long labels never become vertical letter stacks. */
body:not(.mobile-layout) .record-stack .music-entry-actions{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);align-items:stretch}
body:not(.mobile-layout) .music-entry-actions .dj-badge{width:100%;min-height:52px;max-height:76px;overflow:hidden}
body:not(.mobile-layout) .music-entry-actions .dj-badge span{word-break:keep-all;font-size:12px;line-height:1.5}
body:not(.mobile-layout) .music-entry-actions .dj-avatar{flex:none;width:26px;height:26px}
body:not(.mobile-layout) .music-entry-actions .my-playlist-button{min-width:0;padding:6px;font-size:12px;min-height:52px;gap:4px}
body:not(.mobile-layout):not(.far-view):not(.focused) .record-stack{position:fixed;left:22px;top:136px;width:clamp(250px,26vw,380px);max-height:calc(100dvh - var(--remote-space) - var(--view-toolbar-height) - 210px);overflow:auto;padding-bottom:10px;box-sizing:border-box}
body:not(.mobile-layout):not(.far-view):not(.focused) .record-equipment{display:none}
body:not(.mobile-layout):not(.far-view):not(.focused):not(.youtube-size):not(.audio-listening):not(.details-open):not(.together-mode) #displayWrap{left:calc(clamp(250px,26vw,380px) + 52px);width:calc(100vw - clamp(250px,26vw,380px) - 78px);top:136px;height:clamp(160px,calc(100dvh - var(--view-toolbar-height) - 266px),60dvh)}
body:not(.mobile-layout) .lounge-actions,body:not(.mobile-layout):not(.remote-open) #remoteToggle{bottom:calc(var(--view-toolbar-height) + 20px)}
body:not(.mobile-layout).remote-open #remoteToggle{bottom:calc(var(--remote-space) + var(--view-toolbar-height) + 26px)}
/* The shelf opens independently of the projector and the remote. */
body #recordStack[hidden]{display:none!important}
body .shelf-toggle{position:fixed;left:22px;top:118px;z-index:23;min-height:36px;padding:6px 13px;border:1px solid #c59a6166;border-radius:18px;background:#302115e8;color:#f8dfaf;font-size:14px;line-height:1.4;white-space:nowrap;box-shadow:0 4px 14px #0003}
body .shelf-toggle:focus-visible{outline:2px solid #f2c579;outline-offset:3px}
body:not(.mobile-layout) #recordStack{top:162px}
body:not(.mobile-layout):not(.far-view):not(.focused) #recordStack{max-height:calc(100dvh - var(--remote-space) - var(--view-toolbar-height) - 236px)}
body:not(.mobile-layout).far-view #recordStack{max-height:calc(100dvh - var(--remote-space) - var(--view-toolbar-height) - var(--toolbar-offset) - 190px)}
body.mobile-layout #shelfToggle{display:none!important}
