/* Nerddi OS adaptive viewport layer. Console surfaces own the viewport; document pages opt out. */
:root{--os-hud-h:54px;--os-gap:clamp(8px,1.15vmin,16px);--os-edge:clamp(14px,3.3vw,64px)}
html:has(body[data-os-page]){width:100%;height:100%;height:100dvh;overflow:hidden;background:#02050a}
body[data-os-page]{width:100%;height:100%;height:100dvh;min-height:0!important;overflow:hidden!important;overscroll-behavior:none;margin:0}
body[data-os-page] .console-shell{box-sizing:border-box;width:100%;height:100dvh;min-height:0!important;padding-top:var(--os-hud-h)!important;overflow:hidden!important;display:grid;grid-template-rows:minmax(0,1fr)}
body[data-os-page] .console-page{box-sizing:border-box;height:calc(100dvh - var(--os-hud-h));min-height:0!important;max-height:calc(100dvh - var(--os-hud-h));overflow:hidden!important;padding:var(--os-gap) var(--os-edge)!important}
body[data-os-page] .console-bar{height:var(--os-hud-h)!important}
body[data-os-page] .page-hero{min-height:0!important}
body[data-os-page] .console-section,body[data-os-page] section,body[data-os-page] article{min-height:0}
body[data-os-page] *{box-sizing:border-box}

/* HOME: one viewport, three machine-like rows. */
body[data-os-page="home"]{height:100dvh;overflow:hidden!important}
body[data-os-page="home"] .console-home{height:100dvh;min-height:0!important;max-height:100dvh;padding:var(--os-hud-h) 0 0!important;overflow:hidden!important;display:grid;grid-template-rows:minmax(0,1fr) clamp(86px,12dvh,116px) clamp(154px,23dvh,214px);gap:0}
body[data-os-page="home"] .console-home-hero{height:auto!important;min-height:0!important;padding:clamp(12px,2.2dvh,28px) var(--os-edge)!important;gap:clamp(18px,4vw,72px);overflow:hidden!important}
body[data-os-page="home"] .console-hero-copy{min-width:0;align-self:center}
body[data-os-page="home"] .console-hero-copy h1{font-size:clamp(36px,min(6.2vw,8.8dvh),96px);margin:clamp(8px,1.2dvh,14px) 0;max-height:2em;overflow:hidden}
body[data-os-page="home"] .console-hero-copy p{font-size:clamp(10px,1.25vw,13px);line-height:1.45;margin:0 0 clamp(10px,1.5dvh,18px);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
body[data-os-page="home"] .console-hero-art img{width:min(32vw,38dvh,390px);max-height:38dvh}
body[data-os-page="home"] .console-section{height:100%;margin:0!important;padding:0 var(--os-edge)!important;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden!important}
body[data-os-page="home"] .console-section-head{margin:0 0 clamp(3px,.65dvh,8px)!important;align-items:center}
body[data-os-page="home"] .console-section-head h2{font-size:clamp(12px,1.45vw,18px);margin:1px 0}
body[data-os-page="home"] .console-game-rail,body[data-os-page="home"] .console-resume-rail{height:100%;min-height:0;overflow-x:auto!important;overflow-y:hidden!important;padding:2px 2px clamp(5px,.8dvh,10px)!important;align-items:stretch;scrollbar-width:none}
body[data-os-page="home"] .console-game-card{height:100%!important;min-height:0!important;min-width:clamp(124px,12vw,188px);width:clamp(124px,12vw,188px);padding:clamp(8px,1vw,14px);border-radius:clamp(12px,1.2vw,18px)}
body[data-os-page="home"] .console-game-card img{height:58%;min-height:0}
body[data-os-page="home"] .console-game-card small{margin-top:clamp(3px,.5dvh,8px)}
body[data-os-page="home"] .console-game-card b{font-size:clamp(11px,1.1vw,15px);margin-top:2px}
body[data-os-page="home"] .console-game-card span{font-size:clamp(7px,.7vw,9px);margin-top:2px}
body[data-os-page="home"] .home-resume .resume-card,body[data-os-page="home"] .home-resume .resume-empty{height:100%;min-height:0!important;min-width:clamp(235px,25vw,320px);padding:clamp(8px,1vw,13px)}
body[data-os-page="home"] .home-resume .resume-card{grid-template-columns:clamp(54px,6vw,72px) 1fr}
body[data-os-page="home"] .home-resume .resume-card img{width:clamp(48px,5vw,64px);height:clamp(48px,5vw,64px)}

/* Generic compact console-page masthead. */
body[data-os-page]:not([data-os-page="home"]):not([data-os-page="native-game"]):not([data-os-page="vba-bridge"]) .page-hero.compact{height:clamp(92px,18dvh,172px);display:grid;grid-template-columns:minmax(0,1fr) auto;gap:clamp(12px,3vw,40px);padding:0 0 var(--os-gap);overflow:hidden}
body[data-os-page]:not([data-os-page="home"]):not([data-os-page="native-game"]):not([data-os-page="vba-bridge"]) .page-hero.compact h1{font-size:clamp(30px,min(4.2vw,7.2dvh),66px);line-height:.82;margin:clamp(5px,.8dvh,10px) 0}
body[data-os-page]:not([data-os-page="home"]):not([data-os-page="native-game"]):not([data-os-page="vba-bridge"]) .page-hero.compact p{font-size:clamp(9px,.9vw,12px);line-height:1.4;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body[data-os-page] .page-hero-stat{width:clamp(72px,9dvh,116px);height:clamp(72px,9dvh,116px)}
body[data-os-page] .page-hero-stat strong{font-size:clamp(28px,4dvh,48px)}

/* LIBRARY: horizontal console catalog; never document scroll. */
body[data-os-page="library"] .console-page{display:grid;grid-template-rows:auto minmax(0,1fr);gap:var(--os-gap)}
body[data-os-page="library"] .library-full{height:100%;min-height:0;padding:0!important;display:grid;grid-auto-flow:column;grid-template-rows:repeat(2,minmax(0,1fr));grid-auto-columns:clamp(310px,38vw,590px);gap:var(--os-gap);overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x proximity;scrollbar-width:none}
body[data-os-page="library"] .library-full::-webkit-scrollbar{display:none}
body[data-os-page="library"] .library-console-card{height:100%;min-height:0!important;grid-template-columns:38% 62%;scroll-snap-align:start}
body[data-os-page="library"] .library-console-art{min-height:0!important;height:100%}
body[data-os-page="library"] .library-console-art i{width:min(14dvh,120px);height:min(14dvh,120px)}
body[data-os-page="library"] .library-console-copy{padding:clamp(10px,1.4vw,20px);overflow:hidden}
body[data-os-page="library"] .library-console-copy h2{font-size:clamp(17px,2vw,27px);margin:4px 0}
body[data-os-page="library"] .library-console-copy p{font-size:clamp(8px,.75vw,11px);line-height:1.35;margin:0 0 6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body[data-os-page="library"] .feature-chips{max-height:30px;overflow:hidden}
body[data-os-page="library"] .library-console-copy footer{padding-top:6px}

/* GAME DETAIL: art + choices consume the remaining screen, with choice rail internal. */
body[data-os-page="game"] .game-detail{height:calc(100dvh - var(--os-hud-h));min-height:0!important;overflow:hidden!important;padding:clamp(12px,2dvh,24px) var(--os-edge)!important;display:grid;grid-template-columns:minmax(260px,.82fr) minmax(0,1.18fr);gap:clamp(18px,4vw,64px);align-items:center}
body[data-os-page="game"] .detail-art{height:min(70dvh,640px);min-height:0!important}
body[data-os-page="game"] .detail-art img{max-height:58dvh}
body[data-os-page="game"] .detail-copy{min-height:0;max-height:100%;overflow:hidden;display:flex;flex-direction:column}
body[data-os-page="game"] .detail-copy h1{font-size:clamp(38px,min(5.4vw,8dvh),82px);margin:clamp(5px,1dvh,12px) 0}
body[data-os-page="game"] .detail-copy .lead{font-size:clamp(9px,.9vw,12px);line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body[data-os-page="game"] .mode-grid{min-height:0;overflow-x:auto!important;overflow-y:hidden!important;display:flex!important;gap:var(--os-gap);padding:4px 2px 8px;scrollbar-width:none}
body[data-os-page="game"] .mode-grid::-webkit-scrollbar{display:none}
body[data-os-page="game"] .mode-card{flex:0 0 clamp(210px,22vw,310px);min-height:0!important;height:clamp(118px,21dvh,180px);padding:clamp(12px,1.4vw,18px)}
body[data-os-page="game"] .mode-card span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body[data-os-page="game"] .detail-meta{margin-top:auto}

/* GAME ROOM browser: masthead + local/public panes + small online strip. */
body[data-os-page="gameroom"] .gameroom-main{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto minmax(0,1fr) auto;gap:var(--os-gap)}
body[data-os-page="gameroom"] .room-page-hero{grid-column:1/-1}
body[data-os-page="gameroom"] .console-rail-section,body[data-os-page="gameroom"] .public-room-section{padding:clamp(10px,1.2vw,18px)!important;margin:0!important;border:1px solid rgba(255,255,255,.07);border-radius:18px;background:rgba(5,13,19,.72);overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr)}
body[data-os-page="gameroom"] .my-room-grid,body[data-os-page="gameroom"] .public-room-grid{min-height:0;overflow:auto!important;align-content:start}
body[data-os-page="gameroom"] .network-entry{grid-column:1/-1;margin:0!important;min-height:0!important;padding:clamp(8px,1vw,14px) clamp(12px,1.4vw,20px)!important;display:flex;align-items:center;gap:18px;overflow:hidden}
body[data-os-page="gameroom"] .network-entry p{display:none}
body[data-os-page="gameroom"] .network-entry h2{font-size:clamp(15px,1.5vw,22px);margin:2px 0}
body[data-os-page="gameroom"] .run4-section-head{margin-bottom:8px}

/* CONTROLLERS: manager owns center; principles become compact machine status cards. */
body[data-os-page="controllers"] .console-page{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:var(--os-gap)}
body[data-os-page="controllers"] .controller-manager-section{min-height:0;padding:0!important;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden}
body[data-os-page="controllers"] .controller-manager-grid{min-height:0;overflow:auto!important;align-content:start}
body[data-os-page="controllers"] .controller-principles{padding:0!important;display:grid;grid-template-columns:repeat(3,1fr);gap:var(--os-gap)}
body[data-os-page="controllers"] .controller-principles article{padding:clamp(9px,1vw,14px)}
body[data-os-page="controllers"] .controller-principles b{font-size:clamp(12px,1.2vw,17px);margin:3px 0}
body[data-os-page="controllers"] .controller-principles p{font-size:clamp(7px,.7vw,10px);line-height:1.3;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body[data-os-page="controllers"] .controller-device-visual{width:clamp(78px,10dvh,128px);height:clamp(122px,16dvh,198px)}

/* PROFILE: summary + auth + two internal content lanes, no document scroll. */
body[data-os-page="profile"] .profile-page{height:calc(100dvh - var(--os-hud-h));padding:var(--os-gap) var(--os-edge)!important;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);grid-template-rows:auto minmax(0,1fr);gap:var(--os-gap);overflow:hidden!important}
body[data-os-page="profile"] .profile-identity-panel{grid-column:1/-1;margin:0!important;padding:clamp(12px,1.4vw,20px);border-radius:18px}
body[data-os-page="profile"] .profile-avatar-large{width:clamp(64px,8dvh,92px);height:clamp(64px,8dvh,92px);border-radius:22px;font-size:clamp(20px,3dvh,30px)}
body[data-os-page="profile"] .profile-identity-panel h1{font-size:clamp(25px,3.2vw,40px);margin:3px 0}
body[data-os-page="profile"] .profile-identity-panel p{font-size:clamp(8px,.8vw,11px);line-height:1.35;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body[data-os-page="profile"] .profile-stats article{min-width:76px;padding:9px}
body[data-os-page="profile"] .profile-stats strong{font-size:clamp(20px,2.5vw,30px)}
body[data-os-page="profile"] .cloud-auth,body[data-os-page="profile"] .profile-grid,body[data-os-page="profile"] .cloud-panels{min-height:0;max-height:100%;overflow:auto!important;margin:0!important;padding:clamp(12px,1.4vw,20px)}
body[data-os-page="profile"] .cloud-auth{grid-column:1/-1}
body[data-os-page="profile"] .profile-grid{grid-column:1;grid-row:2;display:grid;grid-template-columns:1fr!important;align-content:start;border:1px solid #1c394c;border-radius:20px;background:#050d13}
body[data-os-page="profile"] .cloud-panels{grid-column:2;grid-row:2;display:grid!important;grid-template-columns:1fr!important;gap:10px;border:1px solid #1b394c;border-radius:20px;background:#040a0f}
body[data-os-page="profile"] .cloud-panel{min-height:0!important;padding:14px;border-radius:16px}
body[data-os-page="profile"] .profile-form,body[data-os-page="profile"] .future-profile{padding:14px}

/* ONLINE: masthead + two-by-two operational grid, note tucked into footer strip. */
body[data-os-page="network"] .network-main{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto minmax(0,1fr) auto;gap:var(--os-gap);padding:var(--os-gap) var(--os-edge)!important}
body[data-os-page="network"] .network-hero{grid-column:1/-1}
body[data-os-page="network"] .network-grid,body[data-os-page="network"] .network-grid.lower{min-height:0;margin:0!important;display:grid;grid-template-columns:1fr 1fr;gap:var(--os-gap);overflow:hidden}
body[data-os-page="network"] .network-grid{grid-column:1;grid-row:2;grid-template-columns:1fr}
body[data-os-page="network"] .network-grid.lower{grid-column:2;grid-row:2;grid-template-columns:1fr}
body[data-os-page="network"] .network-panel{min-height:0;padding:clamp(10px,1.2vw,18px);border-radius:18px;overflow:hidden}
body[data-os-page="network"] .presence-list,body[data-os-page="network"] .leaderboard-list,body[data-os-page="network"] .match-handoff{min-height:0;max-height:none!important;overflow:auto!important}
body[data-os-page="network"] .quick-match-games{margin:8px 0;grid-template-columns:repeat(3,1fr)}
body[data-os-page="network"] .network-copy{font-size:clamp(8px,.75vw,11px);line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body[data-os-page="network"] .network-note{grid-column:1/-1;grid-row:3;margin:0!important;padding:clamp(8px,1vw,12px) clamp(12px,1.5vw,18px);min-height:0}
body[data-os-page="network"] .network-note p{font-size:clamp(7px,.65vw,9px);line-height:1.3;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
body[data-os-page="network"] .network-signal{width:min(15dvh,140px)}

/* Pairing room is already a staged console screen; clamp it to the same viewport contract. */
body[data-os-page="room"] .room-shell{height:100dvh!important;overflow:hidden!important}
body[data-os-page="room"] .pair-stage{height:calc(100dvh - var(--os-hud-h));min-height:0!important;max-height:calc(100dvh - var(--os-hud-h));overflow:hidden!important;padding:clamp(12px,2dvh,24px) var(--os-edge)!important}
body[data-os-page="room"] .party-rack{min-height:0;overflow:auto!important}

/* Native game and VBA bridge already own the viewport; reinforce that invariant. */
body[data-os-page="native-game"],body[data-os-page="vba-bridge"]{height:100dvh!important;min-height:0!important;overflow:hidden!important}
body[data-os-page="vba-bridge"] .vba-bridge{height:100dvh!important;min-height:0!important;overflow:hidden!important}

/* Short laptops prioritize function over explanatory copy. */
:root[data-viewport-density="compact"]{--os-hud-h:48px;--os-edge:clamp(12px,2.5vw,34px);--os-gap:7px}
:root[data-viewport-density="compact"] body[data-os-page="home"] .console-home{grid-template-rows:minmax(0,1fr) 72px 132px}
:root[data-viewport-density="compact"] body[data-os-page="home"] .console-home-hero{grid-template-columns:1.35fr .65fr;padding-top:7px!important;padding-bottom:7px!important}
:root[data-viewport-density="compact"] body[data-os-page="home"] .console-hero-copy p{-webkit-line-clamp:2;margin-bottom:8px}
:root[data-viewport-density="compact"] body[data-os-page="home"] .console-hero-actions a{padding:9px 14px}
:root[data-viewport-density="compact"] body[data-os-page="home"] .console-section-head small{display:none}
:root[data-viewport-density="compact"] body[data-os-page] .page-hero.compact{height:78px}
:root[data-viewport-density="compact"] body[data-os-page] .page-hero.compact p{display:none}
:root[data-viewport-density="compact"] body[data-os-page="controllers"] .controller-principles p{display:none}
:root[data-viewport-density="compact"] body[data-os-page="network"] .network-note p{display:none}

/* Cinema mode uses more of the physical display without changing composition. */
:root[data-viewport-density="cinema"]{--os-hud-h:68px;--os-edge:clamp(52px,4vw,110px);--os-gap:20px}
:root[data-viewport-density="cinema"] body[data-os-page="home"] .console-home{grid-template-rows:minmax(0,1fr) 150px 260px}
:root[data-viewport-density="cinema"] body[data-os-page="home"] .console-game-card{min-width:230px;width:230px}

/* Handheld OS mode: one compact hero plus swipeable shelves/panels, still no body scroll. */
:root[data-viewport-density="handheld"]{--os-hud-h:48px;--os-edge:12px;--os-gap:8px}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-system-hud{height:48px;padding:0 12px}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .hud-status span,:root[data-viewport-density="handheld"] body[data-os-page="home"] .hud-profile b,:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-system-hud time{display:none}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-home{grid-template-rows:minmax(0,1fr) 0 minmax(128px,24dvh)}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .home-resume{display:none!important}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-home-hero{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;text-align:center;padding:8px 14px!important}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-hero-art{grid-row:1;position:absolute;inset:60px 0 auto;opacity:.22;pointer-events:none}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-hero-art img{width:min(56vw,28dvh);max-height:28dvh}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-hero-copy{align-self:end;z-index:3}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-hero-copy h1{font-size:clamp(34px,12vw,54px)}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-hero-copy p{font-size:10px;-webkit-line-clamp:2;margin-bottom:8px}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-hero-actions{justify-content:center}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-secondary:last-child{display:none}
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-game-card{min-width:112px;width:112px}
:root[data-viewport-density="handheld"] body[data-os-page] .console-bar{padding:0 12px!important}
:root[data-viewport-density="handheld"] body[data-os-page] .console-bar .brand-lockup small,:root[data-viewport-density="handheld"] body[data-os-page] .console-bar .run4-user>div:last-child,:root[data-viewport-density="handheld"] body[data-os-page] .console-bar>.os-live{display:none!important}
:root[data-viewport-density="handheld"] body[data-os-page] .console-page{padding:8px 12px!important}
:root[data-viewport-density="handheld"] body[data-os-page] .page-hero.compact{height:74px;grid-template-columns:1fr auto}
:root[data-viewport-density="handheld"] body[data-os-page] .page-hero.compact p,:root[data-viewport-density="handheld"] body[data-os-page] .page-hero-stat{display:none}
:root[data-viewport-density="handheld"] body[data-os-page="library"] .library-full{grid-template-rows:1fr;grid-auto-columns:minmax(82vw,1fr)}
:root[data-viewport-density="handheld"] body[data-os-page="library"] .library-console-card{grid-template-columns:34% 66%}
:root[data-viewport-density="handheld"] body[data-os-page="game"] .game-detail{grid-template-columns:1fr;padding:8px 12px!important;align-content:start}
:root[data-viewport-density="handheld"] body[data-os-page="game"] .detail-art{height:22dvh;opacity:.55}
:root[data-viewport-density="handheld"] body[data-os-page="game"] .detail-art img{max-height:19dvh}
:root[data-viewport-density="handheld"] body[data-os-page="game"] .detail-copy h1{font-size:34px}
:root[data-viewport-density="handheld"] body[data-os-page="game"] .feature-chips,:root[data-viewport-density="handheld"] body[data-os-page="game"] .detail-meta{display:none}
:root[data-viewport-density="handheld"] body[data-os-page="game"] .mode-card{flex-basis:72vw;height:132px}
:root[data-viewport-density="handheld"] body[data-os-page="gameroom"] .gameroom-main{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr) minmax(0,1fr)}
:root[data-viewport-density="handheld"] body[data-os-page="gameroom"] .room-page-hero,:root[data-viewport-density="handheld"] body[data-os-page="gameroom"] .network-entry{display:none}
:root[data-viewport-density="handheld"] body[data-os-page="controllers"] .console-page{grid-template-rows:auto minmax(0,1fr)}
:root[data-viewport-density="handheld"] body[data-os-page="controllers"] .controller-principles{display:none}
:root[data-viewport-density="handheld"] body[data-os-page="profile"] .profile-page{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);padding:8px 12px!important}
:root[data-viewport-density="handheld"] body[data-os-page="profile"] .profile-identity-panel{grid-column:1;padding:10px;grid-template-columns:auto 1fr}
:root[data-viewport-density="handheld"] body[data-os-page="profile"] .profile-stats{display:none}
:root[data-viewport-density="handheld"] body[data-os-page="profile"] .profile-grid,:root[data-viewport-density="handheld"] body[data-os-page="profile"] .cloud-auth{grid-column:1;grid-row:2}
:root[data-viewport-density="handheld"] body[data-os-page="profile"] .cloud-panels{display:none!important}
:root[data-viewport-density="handheld"] body[data-os-page="network"] .network-main{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);padding:8px 12px!important}
:root[data-viewport-density="handheld"] body[data-os-page="network"] .network-grid{grid-column:1;grid-row:2}
:root[data-viewport-density="handheld"] body[data-os-page="network"] .network-grid.lower,:root[data-viewport-density="handheld"] body[data-os-page="network"] .network-note{display:none}
:root[data-viewport-density="handheld"] body[data-os-page="room"] .pair-stage{padding:8px 12px!important}

@media (prefers-reduced-motion:reduce){body[data-os-page] *{scroll-behavior:auto!important}}

/* Profile dashboard wrapper owns row 2; signed-in panels never create implicit rows. */
body[data-os-page="profile"] .profile-page{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr)}
body[data-os-page="profile"] .cloud-auth{grid-column:1;grid-row:2;min-height:0;overflow:auto!important;margin:0!important;padding:clamp(16px,2vw,28px)}
body[data-os-page="profile"] [data-cloud-dashboard]:not([hidden]){grid-column:1;grid-row:2;min-height:0;overflow:hidden;display:grid!important;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:var(--os-gap)}
body[data-os-page="profile"] [data-cloud-dashboard]>.profile-grid{grid-column:1;grid-row:1;min-height:0;height:100%;overflow:auto!important;margin:0!important}
body[data-os-page="profile"] [data-cloud-dashboard]>.cloud-panels{grid-column:2;grid-row:1;min-height:0;height:100%;overflow:auto!important;margin:0!important}
body[data-os-page="profile"] [data-cloud-dashboard]>.legal-links{display:none}
:root[data-viewport-density="handheld"] body[data-os-page="profile"] [data-cloud-dashboard]:not([hidden]){grid-template-columns:1fr}
:root[data-viewport-density="handheld"] body[data-os-page="profile"] [data-cloud-dashboard]>.profile-grid{grid-column:1}
:root[data-viewport-density="handheld"] body[data-os-page="profile"] [data-cloud-dashboard]>.cloud-panels{display:none!important}

/* In handheld mode the installed-games shelf is explicitly the bottom row. */
:root[data-viewport-density="handheld"] body[data-os-page="home"] .console-section:not(.home-resume){grid-row:3}

/* Presentation Run scroll policy: system layers are sealed; entered OS pages may breathe vertically. */
body.console-standby,body.console-booting,body.console-powering,body.console-sleeping{height:100dvh!important;overflow:hidden!important;overscroll-behavior:none}
html:has(body.console-entered[data-os-page]:not([data-os-page="native-game"]):not([data-os-page="vba-bridge"])){height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto}
body.console-entered[data-os-page]:not([data-os-page="native-game"]):not([data-os-page="vba-bridge"]){height:auto!important;min-height:100dvh!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-y:auto}
body.console-entered[data-os-page]:not([data-os-page="native-game"]):not([data-os-page="vba-bridge"]) .console-shell{height:auto!important;min-height:100dvh!important;overflow:visible!important;display:block!important;padding-top:var(--os-hud-h)!important}
body.console-entered[data-os-page]:not([data-os-page="native-game"]):not([data-os-page="vba-bridge"]) .console-page{height:auto!important;max-height:none!important;min-height:calc(100dvh - var(--os-hud-h))!important;overflow:visible!important}
