/* Phone ergonomics: original scene art, tap access, readable content. */
button{touch-action:manipulation}
@media(max-width:700px){
.rebuilt{overflow-x:hidden}
.rebuilt #store{height:100svh;height:100dvh;overflow:hidden}
.rebuilt .room{min-width:0;min-height:200px;touch-action:pan-y pinch-zoom}
.rebuilt .store-caption{height:auto;min-height:116px;display:grid;grid-template-columns:1fr 1fr;padding:9px 12px calc(9px + env(safe-area-inset-bottom));gap:6px}
.rebuilt .store-caption>span{grid-column:1/-1;min-width:0}
.rebuilt .store-caption button{margin:0;min-height:46px;padding:10px;font-size:14px}
.rebuilt #daily-note{font-size:11px;line-height:1.35;white-space:normal}
.rebuilt .room-location{top:calc(12px + env(safe-area-inset-top));left:14px}
.rebuilt #daily-invitation{top:calc(64px + env(safe-area-inset-top));left:14px;max-width:calc(100% - 28px);font-size:12px;min-height:44px}
.rebuilt .walk-directions{bottom:12px;left:12px;right:12px;gap:6px;justify-content:flex-start;flex-wrap:wrap}
.rebuilt .walk-directions button{min-height:44px;font-size:12px;padding:10px}
.rebuilt .room-instruction{bottom:72px;left:12px;max-width:calc(100% - 24px);font-size:11px;line-height:1.4}
.rebuilt #explore-list{left:8px;right:8px;bottom:calc(132px + env(safe-area-inset-bottom));top:auto;width:auto;max-width:none;max-height:calc(100svh - 180px);max-height:calc(100dvh - 180px);overflow-y:auto;overscroll-behavior:contain;padding:12px;-webkit-overflow-scrolling:touch}
.rebuilt #explore-list button{min-height:44px;font-size:13px;padding:10px 12px;max-width:100%;white-space:normal}
.rebuilt dialog{width:calc(100% - 16px)!important;max-width:calc(100% - 16px)!important;max-height:calc(100svh - 24px);max-height:calc(100dvh - 24px);margin:auto;padding:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y pinch-zoom;-webkit-overflow-scrolling:touch;border-width:6px!important}
.rebuilt dialog .close{position:sticky;top:4px;float:none;display:block;z-index:10;min-width:44px;min-height:44px;margin:4px 4px -48px auto}
.rebuilt #content{min-width:0;overflow:visible}
.rebuilt .view{padding:60px 16px 20px;min-height:0;overflow-wrap:break-word;max-width:100%}
.rebuilt .view.story,.rebuilt .view.notebook{padding:60px 18px 22px}
.rebuilt .view h1,.rebuilt .view.story h1,.rebuilt .view.notebook h1{font-size:30px;line-height:1.15;letter-spacing:-.5px;max-width:100%}
.rebuilt .view p{font-size:16px;line-height:1.6}
.rebuilt .view .paper,.rebuilt .view.story .paper,.rebuilt .view.notebook .paper{padding:16px;max-width:100%;transform:none}
.rebuilt .view button{min-height:44px;max-width:100%;white-space:normal;touch-action:manipulation}
.rebuilt input,.rebuilt select,.rebuilt textarea{font-size:16px;max-width:100%;min-height:44px}
.rebuilt .game-menu{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.rebuilt .game-menu button{margin:0;padding:10px 8px;font-size:12px}
.rebuilt .view.cabinet{border-width:6px}
.rebuilt .game-board{padding:14px;min-height:0;margin-top:16px}
.rebuilt .memory-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.rebuilt .memory-grid button{height:92px;width:100%;aspect-ratio:auto;min-width:0}
.rebuilt .says-grid{gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
.rebuilt .says-grid button{height:74px;font-size:14px}
.rebuilt .difference-pair{grid-template-columns:minmax(0,1fr)}
.rebuilt .difference-photo{min-width:0;min-height:165px}
.rebuilt .camera-controls,.rebuilt .camera-actions,.rebuilt .tuner-controls,.rebuilt .trivia-choice,.rebuilt .archive-tabs{display:flex;flex-wrap:wrap;gap:6px}
.rebuilt .camera-controls button{flex:1 0 28%;font-size:12px;padding:10px 6px;margin:0}
.rebuilt .camera{height:auto;min-height:0;aspect-ratio:4/3;width:100%;overflow:hidden}
.rebuilt .camera-identity{font-size:10px;letter-spacing:0}
.rebuilt .camera-warning{font-size:11px}
.rebuilt .crt{padding:12px;border-width:10px;font-size:19px;min-width:0}
.rebuilt .transmission-view,.rebuilt .recording-screen{aspect-ratio:4/3;width:100%}
.rebuilt .recording-screen p{position:relative;left:auto;right:auto;bottom:auto;margin:0;font-size:16px;padding:12px;background:#050b0d}
.rebuilt .recording-screen:has(p){aspect-ratio:auto}
.rebuilt .recording-screen video{display:block;aspect-ratio:4/3;height:auto}
.rebuilt .film-inspection{grid-template-columns:minmax(0,1fr);gap:18px}
.rebuilt .inspected-case{width:min(240px,100%);height:360px;margin:auto}
.rebuilt .case-back{padding:16px;font-size:14px;overflow-y:auto;overscroll-behavior:contain}
.rebuilt .case-back b,.rebuilt .case-back span,.rebuilt .case-back small{margin-bottom:12px}
.rebuilt .rental-slip{padding:18px;transform:none;min-width:0}
.rebuilt .rental-shelves{gap:12px}
.rebuilt .rental-film{width:calc((100% - 12px)/2);min-width:0;min-height:44px}
.rebuilt .deck{display:flex;flex-direction:column;padding:16px;max-width:100%}
.rebuilt .deck input,.rebuilt .deck select{width:100%}
.rebuilt .guide-row{grid-template-columns:54px minmax(0,1fr);gap:8px}
.rebuilt .guide-row button{font-size:14px;text-align:left}
.rebuilt .wall{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.rebuilt .wall button{padding:8px 2px;font-size:14px}
.rebuilt .file-register{grid-template-columns:minmax(0,1fr)}
.rebuilt .phone,.rebuilt .return-slot{width:100%;max-width:100%;margin:0;padding:16px;border-width:8px}
.rebuilt .keypad{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.rebuilt .keypad button{min-height:48px;font-size:18px}
.rebuilt #held-tape{bottom:122px;top:auto;right:12px;max-width:55%;width:180px}
.rebuilt #put-back-tape{bottom:76px;right:12px;min-height:44px}
.rebuilt #toast{width:calc(100% - 24px);max-width:420px;bottom:140px;font-size:14px;padding:12px}
.rebuilt #rehearsal-banner{left:8px;right:auto;transform:none;max-width:calc(100% - 16px);font-size:10px}
}

body.phone-profile.rebuilt{overflow-x:hidden}
body.phone-profile.rebuilt #store{height:100svh;height:100dvh;overflow:hidden}
body.phone-profile.rebuilt .room{min-width:0;min-height:200px;touch-action:pan-y pinch-zoom}
body.phone-profile.rebuilt .store-caption{height:auto;min-height:116px;display:grid;grid-template-columns:1fr 1fr;padding:9px 12px calc(9px + env(safe-area-inset-bottom));gap:6px}
body.phone-profile.rebuilt .store-caption>span{grid-column:1/-1;min-width:0}
body.phone-profile.rebuilt .store-caption button{margin:0;min-height:46px;padding:10px;font-size:14px}
body.phone-profile.rebuilt #daily-note{font-size:11px;line-height:1.35;white-space:normal}
body.phone-profile.rebuilt .room-location{top:calc(12px + env(safe-area-inset-top));left:14px}
body.phone-profile.rebuilt #daily-invitation{top:calc(64px + env(safe-area-inset-top));left:14px;max-width:calc(100% - 28px);font-size:12px;min-height:44px}
body.phone-profile.rebuilt .walk-directions{bottom:12px;left:12px;right:12px;gap:6px;justify-content:flex-start;flex-wrap:wrap}
body.phone-profile.rebuilt .walk-directions button{min-height:44px;font-size:12px;padding:10px}
body.phone-profile.rebuilt .room-instruction{bottom:72px;left:12px;max-width:calc(100% - 24px);font-size:11px;line-height:1.4}
body.phone-profile.rebuilt #explore-list{left:8px;right:8px;bottom:calc(132px + env(safe-area-inset-bottom));top:auto;width:auto;max-width:none;max-height:calc(100svh - 180px);max-height:calc(100dvh - 180px);overflow-y:auto;overscroll-behavior:contain;padding:12px;-webkit-overflow-scrolling:touch}
body.phone-profile.rebuilt #explore-list button{min-height:44px;font-size:13px;padding:10px 12px;max-width:100%;white-space:normal}
body.phone-profile.rebuilt dialog{width:calc(100% - 16px)!important;max-width:calc(100% - 16px)!important;max-height:calc(100svh - 24px);max-height:calc(100dvh - 24px);margin:auto;padding:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y pinch-zoom;-webkit-overflow-scrolling:touch;border-width:6px!important}
body.phone-profile.rebuilt dialog .close{position:sticky;top:4px;float:none;display:block;z-index:10;min-width:44px;min-height:44px;margin:4px 4px -48px auto}
body.phone-profile.rebuilt #content{min-width:0;overflow:visible}
body.phone-profile.rebuilt .view{padding:60px 16px 20px;min-height:0;overflow-wrap:break-word;max-width:100%}
body.phone-profile.rebuilt .view.story,body.phone-profile.rebuilt .view.notebook{padding:60px 18px 22px}
body.phone-profile.rebuilt .view h1,body.phone-profile.rebuilt .view.story h1,body.phone-profile.rebuilt .view.notebook h1{font-size:30px;line-height:1.15;letter-spacing:-.5px;max-width:100%}
body.phone-profile.rebuilt .view p{font-size:16px;line-height:1.6}
body.phone-profile.rebuilt .view .paper,body.phone-profile.rebuilt .view.story .paper,body.phone-profile.rebuilt .view.notebook .paper{padding:16px;max-width:100%;transform:none}
body.phone-profile.rebuilt .view button{min-height:44px;max-width:100%;white-space:normal;touch-action:manipulation}
body.phone-profile.rebuilt input,body.phone-profile.rebuilt select,body.phone-profile.rebuilt textarea{font-size:16px;max-width:100%;min-height:44px}
body.phone-profile.rebuilt .game-menu{display:grid;grid-template-columns:1fr 1fr;gap:6px}
body.phone-profile.rebuilt .game-menu button{margin:0;padding:10px 8px;font-size:12px}
body.phone-profile.rebuilt .view.cabinet{border-width:6px}
.rebuilt .game-board{padding:14px;min-height:0;margin-top:16px}
body.phone-profile.rebuilt .memory-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
body.phone-profile.rebuilt .memory-grid button{height:92px;width:100%;aspect-ratio:auto;min-width:0}
body.phone-profile.rebuilt .says-grid{gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
body.phone-profile.rebuilt .says-grid button{height:74px;font-size:14px}
body.phone-profile.rebuilt .difference-pair{grid-template-columns:minmax(0,1fr)}
body.phone-profile.rebuilt .difference-photo{min-width:0;min-height:165px}
body.phone-profile.rebuilt .camera-controls,body.phone-profile.rebuilt .camera-actions,body.phone-profile.rebuilt .tuner-controls,body.phone-profile.rebuilt .trivia-choice,body.phone-profile.rebuilt .archive-tabs{display:flex;flex-wrap:wrap;gap:6px}
body.phone-profile.rebuilt .camera-controls button{flex:1 0 28%;font-size:12px;padding:10px 6px;margin:0}
body.phone-profile.rebuilt .camera{height:auto;min-height:0;aspect-ratio:4/3;width:100%;overflow:hidden}
body.phone-profile.rebuilt .camera-identity{font-size:10px;letter-spacing:0}
body.phone-profile.rebuilt .camera-warning{font-size:11px}
body.phone-profile.rebuilt .crt{padding:12px;border-width:10px;font-size:19px;min-width:0}
body.phone-profile.rebuilt .transmission-view,body.phone-profile.rebuilt .recording-screen{aspect-ratio:4/3;width:100%}
body.phone-profile.rebuilt .recording-screen p{position:relative;left:auto;right:auto;bottom:auto;margin:0;font-size:16px;padding:12px;background:#050b0d}
body.phone-profile.rebuilt .recording-screen:has(p){aspect-ratio:auto}
body.phone-profile.rebuilt .recording-screen video{display:block;aspect-ratio:4/3;height:auto}
body.phone-profile.rebuilt .film-inspection{grid-template-columns:minmax(0,1fr);gap:18px}
body.phone-profile.rebuilt .inspected-case{width:min(240px,100%);height:360px;margin:auto}
body.phone-profile.rebuilt .case-back{padding:16px;font-size:14px;overflow-y:auto;overscroll-behavior:contain}
body.phone-profile.rebuilt .case-back b,body.phone-profile.rebuilt .case-back span,body.phone-profile.rebuilt .case-back small{margin-bottom:12px}
body.phone-profile.rebuilt .rental-slip{padding:18px;transform:none;min-width:0}
body.phone-profile.rebuilt .rental-shelves{gap:12px}
body.phone-profile.rebuilt .rental-film{width:calc((100% - 12px)/2);min-width:0;min-height:44px}
body.phone-profile.rebuilt .deck{display:flex;flex-direction:column;padding:16px;max-width:100%}
body.phone-profile.rebuilt .deck input,body.phone-profile.rebuilt .deck select{width:100%}
body.phone-profile.rebuilt .guide-row{grid-template-columns:54px minmax(0,1fr);gap:8px}
body.phone-profile.rebuilt .guide-row button{font-size:14px;text-align:left}
body.phone-profile.rebuilt .wall{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
body.phone-profile.rebuilt .wall button{padding:8px 2px;font-size:14px}
body.phone-profile.rebuilt .file-register{grid-template-columns:minmax(0,1fr)}
body.phone-profile.rebuilt .phone,body.phone-profile.rebuilt .return-slot{width:100%;max-width:100%;margin:0;padding:16px;border-width:8px}
body.phone-profile.rebuilt .keypad{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
body.phone-profile.rebuilt .keypad button{min-height:48px;font-size:18px}
body.phone-profile.rebuilt #held-tape{bottom:122px;top:auto;right:12px;max-width:55%;width:180px}
body.phone-profile.rebuilt #put-back-tape{bottom:76px;right:12px;min-height:44px}
body.phone-profile.rebuilt #toast{width:calc(100% - 24px);max-width:420px;bottom:140px;font-size:14px;padding:12px}
body.phone-profile.rebuilt #rehearsal-banner{left:8px;right:auto;transform:none;max-width:calc(100% - 16px);font-size:10px}

@media(max-width:700px) and (orientation:landscape){.rebuilt .store-caption{min-height:80px;grid-template-columns:1fr auto auto}.rebuilt .store-caption>span{grid-column:1}.rebuilt .store-caption button{grid-row:1/3}.rebuilt #daily-invitation{top:60px}.rebuilt .room-instruction{display:none}.rebuilt #explore-list{bottom:90px;max-height:calc(100dvh - 110px)}}
/* Keep previews bounded to their simulated phone, rather than the host browser. */
body.phone-profile.rebuilt dialog{width:calc(var(--qa-width) - 16px)!important;max-width:calc(var(--qa-width) - 16px)!important;max-height:calc(var(--qa-height) - 24px);left:8px;top:12px;margin:0}
body.phone-profile.rebuilt #explore-list{width:calc(var(--qa-width) - 16px);right:auto;max-height:calc(var(--qa-height) - 180px)}
body.phone-profile.rebuilt #store{height:var(--qa-height)}
body.phone-profile.rebuilt #rehearsal-banner{width:calc(var(--qa-width) - 16px);max-width:calc(var(--qa-width) - 16px)}
/* Footer actions are siblings of the paper view and need the same readable ink. */
.rebuilt dialog[data-surface=story] #content>button,.rebuilt dialog[data-surface=notebook] #content>button{background:#423326;color:#fff0cf;border:1px solid #786044;font:700 14px/1.4 'Courier New',monospace;min-height:44px;padding:12px 16px;margin:6px 8px 6px 0;max-width:100%;white-space:normal}
