/* Scoped, opt-in presentation layer. Desktop product layout and score adapters are untouched. */
.wb-mobile-bar,.wb-mobile-toolbox{display:none}.wb-mobile-guide{box-sizing:border-box;width:min(480px,calc(100vw - 24px));max-height:calc(var(--wb-vh,100dvh) - 24px);overflow:auto;border:2px solid #344640;border-radius:16px;background:#fffdf6;color:#243b34;padding:20px;font:16px/1.5 system-ui,sans-serif}.wb-mobile-guide::backdrop{background:#152c2370}.wb-mobile-guide h2{font:700 24px/1.2 system-ui;margin:0 0 12px}.wb-mobile-guide p{color:inherit;font:inherit}.wb-mobile-guide li+li{margin-top:10px}.wb-mobile-guide-actions{display:flex;gap:10px;position:sticky;bottom:-20px;background:#fffdf6;padding:12px 0}.wb-mobile-guide button{min-height:44px;font:600 16px/1.2 system-ui;padding:10px 16px;background:#dce8de;color:#243b34;border:1px solid #829887;border-radius:8px}.wb-mobile-guide button:last-child{background:#34594c;color:white}
@media(max-width:760px),(max-height:500px) and (max-width:1024px){
 body[data-wb-product]{--wb-top:calc(56px + env(safe-area-inset-top));--wb-bottom:env(safe-area-inset-bottom);--wb-tools:0px;padding-bottom:var(--wb-bottom)}
 body[data-wb-product][data-wb-panel]{--wb-tools:min(42vh,300px)}
 .wb-mobile-bar{box-sizing:border-box;position:sticky;top:0;z-index:60;display:flex!important;align-items:center;gap:8px;padding:6px max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left));padding-top:max(6px,env(safe-area-inset-top));min-height:var(--wb-top);background:#f5f2e8;color:#243b34;border-bottom:1px solid #bbc8bd;font:600 15px/1.2 system-ui}
 .wb-mobile-bar>*{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:6px 10px;box-sizing:border-box;border:1px solid #9baa9e;border-radius:8px;background:#fffef6;color:#243b34;font:inherit;text-decoration:none;margin:0;flex:1}.wb-mobile-bar>a,.wb-mobile-bar>button:last-child{flex:0 0 44px}.wb-mobile-bar[hidden]{display:none!important}
 body[data-wb-product] button,body[data-wb-product] select{min-height:44px;font-size:max(14px,1em)}
 body[data-wb-product] input:not([type=checkbox]):not([type=range]):not([type=radio]),body[data-wb-product] textarea{font-size:16px;min-height:44px}
 body[data-wb-product] input[type=range]{min-height:32px}
 body[data-wb-product] dialog{max-width:calc(100vw - 24px);max-height:calc(var(--wb-vh,100dvh) - 24px);overflow:auto;overscroll-behavior:contain}
 body[data-wb-focus=true]{overflow:hidden;padding-top:var(--wb-top);height:var(--wb-vh,100dvh);box-sizing:border-box}
 body[data-wb-focus=true]>.wb-mobile-bar{position:fixed;inset:0 0 auto}
 body[data-wb-focus=false]>.wb-mobile-bar{position:fixed;inset:0 0 auto}
 body[data-wb-focus=false]{padding-top:var(--wb-top)}
 body[data-wb-focus=true]>.wb-platform-nav,body[data-wb-focus=true]>.wb-product-help,body[data-wb-focus=true]>.wb-platform-footer,body[data-wb-focus=true]>header{display:none!important}
 .wb-mobile-toolbox:not([hidden]){display:flex;flex-direction:column;box-sizing:border-box;position:fixed;z-index:40;inset:auto 0 var(--wb-bottom);height:var(--wb-tools);padding:8px max(12px,env(safe-area-inset-left));border-top:2px solid #81998a;background:#fffdf6;color:#253a32;overflow:hidden}
 .wb-mobile-tabs{display:flex;gap:6px;flex:none;overflow-x:auto;padding-bottom:6px}.wb-mobile-tabs>button{flex:1 0 90px;min-height:44px;max-width:200px;border:1px solid #b6c5b7;border-radius:8px;padding:6px;background:#edf1e7;color:#253a32;font:600 14px/1.25 system-ui}.wb-mobile-tabs>button[aria-pressed=true]{background:#34594c;color:#fff}.wb-mobile-toolgroup{min-height:0;overflow:auto;overscroll-behavior:contain;padding:4px 0 16px}.wb-mobile-toolgroup[hidden]{display:none!important}.wb-mobile-toolgroup>*{max-width:100%;margin:8px 0!important}.wb-mobile-toolgroup input[type=range]{width:100%}.wb-mobile-toolgroup p{font-size:14px}.wb-mobile-toolgroup .toolbar{display:flex;flex-wrap:wrap}.wb-mobile-toolgroup .toolbar>button{flex:1 0 90px}
 /* Estimate: scene, prompt and input are one workspace. Result reading remains scrollable. */
 body[data-wb-product=estimate-game][data-wb-focus=true] .shell{width:auto;max-width:none;padding:0 10px;height:calc(var(--wb-vh,100dvh) - var(--wb-top) - var(--wb-bottom) - var(--wb-tools));overflow:auto}
 body[data-wb-product=estimate-game][data-wb-focus=true] .topbar,body[data-wb-product=estimate-game][data-wb-focus=true] .product-help-footer{display:none}
 body[data-wb-product=estimate-game][data-wb-focus=true] #gameScreen{padding:6px 0}
 body[data-wb-product=estimate-game][data-wb-focus=true] .game-meta{margin:0 0 6px;min-height:34px}.game-meta .kicker{margin:0}
 body[data-wb-product=estimate-game][data-wb-focus=true] .game-layout{display:grid;grid-template-columns:1fr;min-height:0;gap:8px}
 body[data-wb-product=estimate-game][data-wb-focus=true] .scene-card{min-height:0;border-radius:14px}
 body[data-wb-product=estimate-game][data-wb-focus=true] .scene-head{padding:4px 10px;font-size:13px}
 body[data-wb-product=estimate-game][data-wb-focus=true] .scene-surface{flex:none;aspect-ratio:auto;height:clamp(140px,calc((var(--wb-vh,100dvh) - 290px - var(--wb-tools))*.8),360px)}
 body[data-wb-product=estimate-game][data-wb-focus=true] .answer-card{min-height:0;padding:10px;border-radius:14px}
 body[data-wb-product=estimate-game][data-wb-focus=true] :is(.question-state,.reveal-state)>h2{font-size:20px;line-height:1.25;margin:0 0 8px;letter-spacing:0}
 body[data-wb-product=estimate-game][data-wb-focus=true] :is(.question-state>.kicker,.input-help,.render-badge,.world-controls-hint){display:none}
 body[data-wb-product=estimate-game][data-wb-focus=true] #guessForm{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:0;padding:0}
 body[data-wb-product=estimate-game][data-wb-focus=true] #guessForm label{grid-column:1/-1;margin:0;font-size:14px}
 body[data-wb-product=estimate-game][data-wb-focus=true] .number-field{padding:4px 8px;min-height:48px}.number-field input{min-width:0}
 body[data-wb-product=estimate-game][data-wb-focus=true] .submit-button{min-height:48px;margin:0;padding:8px;font-size:15px}
 body[data-wb-product=estimate-game][data-wb-focus=true] .input-error{grid-column:1/-1;margin:0}.input-error:empty{display:none}
 body[data-wb-product=estimate-game][data-wb-focus=true] .intro-screen{min-height:0;padding:18px 0}.intro-screen .intro-art{display:none}
 body[data-wb-product=estimate-game][data-wb-focus=true] .intro-copy h1{font-size:38px;line-height:1.1;letter-spacing:-1px}
 /* Balloon: retain canvas aspect and large buttons; short landscape uses two columns. */
 body[data-wb-product=balloon-platform][data-wb-focus=true]>main{height:calc(var(--wb-vh,100dvh) - var(--wb-top) - var(--wb-bottom) - var(--wb-tools));padding:8px 12px;display:grid;grid-template-rows:minmax(0,1fr) auto;max-width:none;gap:8px}
 body[data-wb-product=balloon-platform][data-wb-focus=true] .scene{height:100%;min-height:0;max-width:100%;width:100%;display:flex;justify-content:center;margin:0}
 body[data-wb-product=balloon-platform][data-wb-focus=true] #game{height:100%;width:auto;max-width:100%;object-fit:contain}
 body[data-wb-product=balloon-platform][data-wb-focus=true] .controls{margin:0;min-width:0}.controls .toolbar button{min-width:44px}
 body[data-wb-product=balloon-platform][data-wb-focus=true] .toolbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 body[data-wb-product=balloon-platform][data-wb-focus=true] .toolbar button{font-size:14px!important;line-height:1.25;min-height:44px;padding:8px!important}
 body[data-wb-product=balloon-platform][data-wb-focus=true] .rule{display:none}
 body[data-wb-product=balloon-platform][data-wb-focus=true] .instruction{font-size:14px;line-height:1.3;margin:0 0 8px}
 /* Puzzle: file intake becomes a tool once the original game is active. */
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true]>main{padding:8px 12px;height:calc(var(--wb-vh,100dvh) - var(--wb-top) - var(--wb-bottom) - var(--wb-tools));overflow:auto}
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true] main>.intro,body[data-wb-product=make-a-jigsaw][data-wb-focus=true] main>footer,body[data-wb-product=make-a-jigsaw][data-wb-focus=true] main>#offlineNotice{display:none}
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true] #game:not([hidden]){height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:6px}
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true] #board{height:100%;min-height:0;max-height:none;width:100%;object-fit:fill}
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true] #game>.hint{font-size:14px;margin:0;line-height:1.3}
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true] main:has(#game:not([hidden]))>#status{display:none}
 /* Editors: visual workspace stays above the independently scrolling tool drawer. */
 body[data-wb-focus=true]:is([data-wb-product=sun-in-my-room],[data-wb-product=tear-out-a-message],[data-wb-product=my-little-gallery]) :is(main,.app-shell,.workspace,.visual-column,.gallery-column){display:contents}
 body[data-wb-focus=true]:is([data-wb-product=sun-in-my-room],[data-wb-product=tear-out-a-message],[data-wb-product=my-little-gallery]) :is(.intro,.topbar,.masthead,main>footer,.save-note){display:none}
 body[data-wb-product=sun-in-my-room][data-wb-focus=true] .scene-panel{position:fixed;top:var(--wb-top);left:10px;right:10px;height:calc(var(--wb-vh,100dvh) - var(--wb-top) - 128px - var(--wb-bottom) - var(--wb-tools));margin:0;padding:6px;display:flex;flex-direction:column}
 body[data-wb-product=sun-in-my-room][data-wb-focus=true] .scene-canvas-frame{flex:1;min-height:0;aspect-ratio:auto;display:flex;justify-content:center}
 body[data-wb-product=sun-in-my-room][data-wb-focus=true] #roomCanvas{height:100%;width:auto;max-width:100%;object-fit:contain}
 body[data-wb-product=sun-in-my-room][data-wb-focus=true] :is(.scene-bottom,.scene-gesture-hint,.timeline-heading .kicker,.timeline-heading h2,.day-chart,.timeline-caption){display:none}
 body[data-wb-product=sun-in-my-room][data-wb-focus=true] .timeline-panel{position:fixed;left:10px;right:10px;bottom:calc(var(--wb-bottom) + var(--wb-tools));height:122px;padding:8px;margin:0;box-sizing:border-box}
 body[data-wb-product=sun-in-my-room][data-wb-focus=true] .timeline-heading{margin:0}.timeline-panel #selectedTime{font-size:24px}
 body[data-wb-product=sun-in-my-room][data-wb-focus=true] #timeSlider{margin:0;width:100%;height:32px}
 body[data-wb-product=tear-out-a-message][data-wb-focus=true] .studio{position:fixed;top:var(--wb-top);left:10px;right:10px;height:calc(var(--wb-vh,100dvh) - var(--wb-top) - var(--wb-bottom) - var(--wb-tools));display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:6px;padding:8px;box-sizing:border-box}
 body[data-wb-product=tear-out-a-message][data-wb-focus=true] .studio-toolbar>span,body[data-wb-product=tear-out-a-message][data-wb-focus=true] .canvas-hint,body[data-wb-product=tear-out-a-message][data-wb-focus=true] .resolution{display:none}
 body[data-wb-product=tear-out-a-message][data-wb-focus=true] .studio-toolbar>div{display:grid;grid-template-columns:repeat(4,1fr);width:100%;gap:6px}
 body[data-wb-product=tear-out-a-message][data-wb-focus=true] .studio-toolbar button{padding:4px;font-size:14px}
 body[data-wb-product=tear-out-a-message][data-wb-focus=true] .canvas-wrap{min-height:0;height:100%;display:flex;justify-content:center}
 body[data-wb-product=tear-out-a-message][data-wb-focus=true] #art{height:100%;width:auto;max-width:100%;object-fit:contain}
 body[data-wb-product=tear-out-a-message][data-wb-focus=true] .export-bar{margin:0;display:flex;gap:8px}.export-bar>button{flex:1}
 body[data-wb-product=my-little-gallery][data-wb-focus=true] .stage-wrap{position:fixed;top:var(--wb-top);left:10px;right:10px;height:calc(var(--wb-vh,100dvh) - var(--wb-top) - var(--wb-bottom) - var(--wb-tools));min-height:0;margin:0}
 body[data-wb-product=my-little-gallery][data-wb-focus=true] #stage{height:100%;min-height:0}
 /* Reading/list tools keep ordinary scrolling, with compact entry chrome. */
 body[data-wb-product=both-awake][data-wb-focus=true]>main{height:calc(var(--wb-vh,100dvh) - var(--wb-top) - var(--wb-bottom) - var(--wb-tools));overflow:auto;padding:8px 12px}
 body[data-wb-product=both-awake][data-wb-focus=true] main>:is(header,.intro,footer){display:none}
 body[data-wb-product=both-awake][data-wb-focus=true] .result{padding:10px;margin:0}.wb-mobile-toolbox #people button{min-width:44px}
 body[data-wb-product=spend-tiktok-profit][data-wb-focus=true]{overflow:auto}
 body[data-wb-product=spend-tiktok-profit][data-wb-focus=true]>main{padding:8px 12px}
 body[data-wb-product=spend-tiktok-profit][data-wb-focus=true] .bank{padding:10px;position:sticky;top:var(--wb-top);z-index:5}.bank strong{overflow-wrap:anywhere}
 body[data-wb-product=spend-tiktok-profit][data-wb-focus=true] .bank-meta :is(#growth,#quip){display:none}
 body[data-wb-product=spend-tiktok-profit] .catalog button{min-width:44px}
}
@media(max-height:500px) and (min-width:600px) and (max-width:1024px){
 body[data-wb-product][data-wb-panel]{--wb-tools:0px}
 body[data-wb-panel]>.wb-mobile-toolbox:not([hidden]){top:var(--wb-top);left:auto;width:42vw;height:calc(var(--wb-vh,100dvh) - var(--wb-top) - var(--wb-bottom));bottom:var(--wb-bottom)}
 body[data-wb-panel]:is([data-wb-product=sun-in-my-room],[data-wb-product=tear-out-a-message],[data-wb-product=my-little-gallery]) :is(.scene-panel,.timeline-panel,.studio,.stage-wrap){right:43vw}
 body[data-wb-product=balloon-platform][data-wb-focus=true]>main{grid-template-columns:minmax(0,1fr) minmax(220px,40%);grid-template-rows:minmax(0,1fr);align-items:center}
 body[data-wb-product=estimate-game][data-wb-focus=true] .game-layout{grid-template-columns:1fr 1fr}.game-meta{min-height:24px}
 body[data-wb-product=estimate-game][data-wb-focus=true] .scene-surface{height:calc(var(--wb-vh,100dvh) - var(--wb-top) - 100px)}
}

@media(max-width:760px),(max-height:500px) and (max-width:1024px){
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true] #game>.toolbar{display:flex;gap:6px;flex-wrap:wrap}
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true] #game>.toolbar button{padding:6px;font-size:14px}
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true] #game>.toolbar label{display:flex;align-items:center;min-height:44px;font-size:14px}
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true] #game>.toolbar #boardZoom{width:70px}
 body[data-wb-product=make-a-jigsaw][data-wb-focus=true] #game>.toolbar #timer{font-size:13px}
}
@media(max-width:760px),(max-height:500px) and (max-width:1024px){
 body[data-wb-product=sun-in-my-room][data-wb-focus=true][data-wb-panel] .scene-panel{height:calc(var(--wb-vh,100dvh) - var(--wb-top) - var(--wb-bottom) - var(--wb-tools))}
 body[data-wb-product=sun-in-my-room][data-wb-focus=true][data-wb-panel] .timeline-panel{display:none}
 body[data-wb-product=estimate-game][data-wb-focus=true] .actual-row{margin:4px 0}.actual-row strong{font-size:42px}
 body[data-wb-product=estimate-game][data-wb-focus=true] .reveal-state>.explanation{font-size:14px;line-height:1.3;margin:4px 0}
}

@media(max-width:760px),(max-height:500px) and (max-width:1024px){
 body[data-wb-product=tear-out-a-message][data-wb-focus=true] .studio{width:auto;min-width:0}
 body[data-wb-product=tear-out-a-message] .wb-mobile-toolgroup .cuttings{display:block}
 body[data-wb-product=tear-out-a-message] .wb-mobile-toolgroup .section-label{font-size:14px}
 body[data-wb-product=tear-out-a-message] .wb-mobile-toolgroup .selection label{font-size:14px;min-height:28px}
 body[data-wb-product=my-little-gallery] .wb-mobile-toolgroup .delivery{display:block}
 body[data-wb-product=my-little-gallery] .wb-mobile-toolgroup .scene-tools{flex-wrap:wrap}
}
@media(max-width:760px),(max-height:500px) and (max-width:1024px){
 body[data-wb-product=both-awake][data-wb-focus=true] .section-head{margin-bottom:8px}
 body[data-wb-product=both-awake][data-wb-focus=true] #summary{font-size:16px;line-height:1.4;margin:8px 0}
 body[data-wb-product=both-awake][data-wb-focus=true] .timeline{margin-top:10px}
 body[data-wb-product=both-awake][data-wb-focus=true] #drag-note{margin:6px 0}
 body[data-wb-product=both-awake][data-wb-focus=true] #clocks{margin-top:10px;gap:8px}
 body[data-wb-product=both-awake][data-wb-focus=true] .clock{padding:8px}
 body[data-wb-product=both-awake][data-wb-focus=true] .clock strong{font-size:24px;margin:4px 0}
 body[data-wb-product=both-awake][data-wb-focus=true] .actions{display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;margin-top:10px}
 body[data-wb-product=both-awake][data-wb-focus=true] .actions button{font-size:14px;min-width:90px;padding:6px}
}
@media(max-width:760px) and (max-height:700px){
 body[data-wb-product=estimate-game][data-wb-focus=true]:has(#revealState:not([hidden])) .scene-surface{height:140px}
 body[data-wb-product=estimate-game][data-wb-focus=true]:has(#revealState:not([hidden])) .scene-head{display:none}
 body[data-wb-product=estimate-game][data-wb-focus=true] #revealState>.kicker{font-size:12px;margin:0 0 4px}
 body[data-wb-product=estimate-game][data-wb-focus=true] #nextButton{min-height:44px;padding:8px;margin-top:6px;font-size:15px}
}
@media(max-width:760px),(max-height:500px) and (max-width:1024px){
 body[data-wb-focus=true]:is([data-wb-product=sun-in-my-room],[data-wb-product=tear-out-a-message],[data-wb-product=my-little-gallery]) :is(.scene-panel,.timeline-panel,.studio,.stage-wrap){left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right))}
 body[data-wb-product=balloon-platform][data-wb-focus=true]>main,body[data-wb-product=make-a-jigsaw][data-wb-focus=true]>main{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
 body[data-wb-product=estimate-game][data-wb-focus=true] .shell{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
}
@media(max-height:500px) and (min-width:600px) and (max-width:1024px){
 body[data-wb-panel]:is([data-wb-product=sun-in-my-room],[data-wb-product=tear-out-a-message],[data-wb-product=my-little-gallery]) :is(.scene-panel,.timeline-panel,.studio,.stage-wrap){right:43vw}
}
