/* The scrollport itself stops inside the frame; padding alone cannot clip text. */
#panel{--panel-safe:clamp(18px,1.3vw,30px);--close-size:clamp(46px,3.5vw,64px)}
#panel .board{inset:calc(var(--panel-safe) + var(--close-size) + 4px) var(--panel-safe) var(--panel-safe);padding:0 4% 18px;overflow:auto;scrollbar-width:thin;scroll-padding:16px;overflow-wrap:anywhere}
#close{z-index:3;top:var(--panel-safe);right:var(--panel-safe);width:var(--close-size);height:var(--close-size);padding:0;display:grid;place-items:center;color:#a12819;line-height:1;background:none;border:0}
#close span{display:block;font-family:'Fraunces',Georgia,serif;font-size:clamp(48px,3.8vw,70px);font-weight:700;font-style:italic;line-height:.8;transform:rotate(-8deg);text-shadow:.5px .8px 0 #7a2015,-.6px 0 0 #b73921}
#close:hover{color:#c33b24}
#close:focus-visible{outline:2px solid #a12819;outline-offset:0}
#utility-close{z-index:4;top:32px;right:32px}
.utility-surface{padding-top:82px}
#room-viewport{display:contents}
#panel-wordmark{max-width:calc(100% - var(--close-size) * 2)}
/* Reserve real space for the wider display lettering at smaller desktop sizes. */
@media(min-width:901px) and (max-width:1250px){
 #global{padding-left:68px;padding-right:24px;gap:8px}
 #global .pilot-light{left:32px;width:28px;height:28px}
 #global button{font-size:clamp(19px,2.05vw,26px);letter-spacing:0;flex-shrink:1}
 #motion{padding-left:27px;padding-right:27px;gap:0;max-width:41%}
 #motion button{font-size:13px;padding:6px;min-height:40px}
}
/* Mobile uses separate rows: navigation, complete room, controls, units, details. */
@media(max-width:900px){
 #stage{display:flex;flex-direction:column;aspect-ratio:auto;overflow:clip;background:#554334;gap:8px;padding-bottom:12px}
 #global{position:relative;inset:auto;order:0;width:100%;height:auto;min-height:124px;display:flex;flex-wrap:wrap;justify-content:center;gap:2px 8px;margin:0;padding:12px 28px;border-width:8px}
 #global button{font-size:clamp(20px,5.4vw,28px);min-height:44px;min-width:44px;line-height:1.2;padding:5px 7px;letter-spacing:0}
 #global>.metal-surface{inset:7px 32px}
 #motion>.metal-surface{inset:6px 20px}
 #global .pilot-light{left:4px;top:12px;transform:none;width:24px;height:24px}
 #global .screw-left,#global .screw-right{width:24px;height:24px;top:auto;bottom:4px;transform:rotate(var(--screw-angle))}
 #global .screw-left{left:3px}#global .screw-right{right:3px}
 #room-viewport{display:block;position:relative;order:1;width:100%;aspect-ratio:1804/872;overflow:hidden;isolation:isolate}
 #stage #brand,#stage:not([data-state=idle]):has(#panel[data-side=left]) #brand{left:4%;right:auto;top:4%;width:27%;transform:none}
 #stage[data-state=idle] #brand{width:51%;left:24.5%;top:48%;transform:translateY(-50%)}
 #stage #motion,#stage:not([data-state=idle]):has(#panel[data-side=left]) #motion{position:relative;inset:auto;order:2;align-self:center;max-width:100%;min-height:58px;width:100%;justify-content:center;padding:4px 26px;border-width:8px;gap:0}
 #motion button{font-size:14px;min-height:44px;padding:6px 8px}
 #motion #details{display:none}
 #rail{position:relative;inset:auto;order:3;flex:none;min-height:96px;height:96px;width:100%;padding:6px 20px;gap:4px}
 #rail button{width:50%;min-width:0;min-height:64px;padding:4px}
 #rail button[data-product] img{width:100%;height:100%;max-width:220px}
 #rail button[data-product="surf-reverb-unit"] img{width:84%;height:90%}
 #rail>.hardware-screw{width:23px;height:23px}
 #stage #status,#stage:not([data-state=idle]):has(#panel[data-side=left]) #status{position:relative;inset:auto;order:4;align-self:center;max-width:calc(100% - 24px);margin:0;font-size:14px;text-align:center}
 #panel,#panel[data-side=left]{display:none;position:relative;inset:auto;order:5;align-self:center;width:calc(100% - 16px);height:auto;max-height:none;transform:none;transition:none;overflow:hidden;--panel-safe:18px;--close-size:48px}
 #panel.open{display:block}
 #panel[data-populated]::before{background:none;border:20px solid transparent;border-image:url('/shared/assets/webp-v01/photoreal-png/02-shared-product-panel-blank-alpha_v04.webp') 80 fill / 20px / 0 repeat}
 #panel .board{position:relative;inset:auto;min-height:0;margin:70px 18px 20px;padding:0 8px 12px;overflow:visible;scrollbar-gutter:auto}
 #panel-wordmark{max-width:100%;margin-bottom:12px}
 #panel[data-product="freakbeat-rhythm-unit"] #panel-wordmark{width:92%;height:auto;max-height:82px}
 #panel[data-product="surf-reverb-unit"] #panel-wordmark{width:78%;height:62px}
 #kicker,#panel h2{font-size:22px}
 #subline{font-size:17px}
 #about p,#availability,#purchase{font-size:18px;line-height:1.5}
 #bezel{width:100%;max-width:460px}
 #play{font-size:15px;gap:6px;min-height:36px}
 #play small{display:none}
 #utility{width:calc(100% - 16px);max-height:calc(100dvh - 16px);margin:auto}
 .utility-surface{max-height:calc(100dvh - 16px);border-width:32px;padding:74px 12px 22px;overflow:auto}
 #utility-title{font-size:30px;overflow-wrap:anywhere}
 #utility-intro,#utility-content{font-size:18px;overflow-wrap:anywhere}
 #utility-close{position:absolute;top:18px;right:18px;width:48px;height:48px;font-size:42px;color:#f9e6c1;z-index:3}
 .menu-units{grid-template-columns:1fr;gap:20px}
 .menu-unit+.menu-unit{border-left:0;border-top:1px solid #ece0c436;padding:20px 0 0}
 .menu-actions,.utility-footer{flex-wrap:wrap;gap:16px}
 .menu-action,#utility-back{min-height:44px;font-size:18px}
 #utility>.hardware-screw{width:24px;height:24px}
}
