/* Final mobile layout: one viewport, bounded controls, and independent readers. */
@media(max-width:1024px),(pointer:coarse){
html,body{max-width:100%;width:100%;overflow-x:clip}
body:has(#main:not([data-view=map])){height:100dvh;overflow:hidden}
body:has(#main:not([data-view=map]))>.header{position:fixed!important;inset:0 0 auto!important;width:100%;height:48px!important;min-height:0;padding:4px max(8px,env(safe-area-inset-right)) 4px max(8px,env(safe-area-inset-left))!important;pointer-events:none;background:transparent;border:0;z-index:12}
body:has(#main:not([data-view=map]))>.header .brand,body:has(#main:not([data-view=map]))>.header nav{display:none}
body:has(#main:not([data-view=map]))>.header #my-page{height:40px;padding:0 12px;font-size:11px;pointer-events:auto;margin-left:auto}
body #main:not([data-view=map]){position:relative!important;width:100%;height:100dvh!important;min-height:0!important;margin:0;overflow:hidden}
body #main:not([data-view=map]) #scene,body #main:not([data-view=map]) .scene-vignette{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important}
body #main:not([data-view=map]) .intro,body #main:not([data-view=map]) .page-footer,body #main:not([data-view=map]) .scene-instructions{display:none!important}
body #main:not([data-view=map]) .world-back{top:6px!important;left:max(8px,env(safe-area-inset-left))!important;height:40px!important;min-height:40px!important;padding:0 10px!important;font-size:10px!important}
body #main:not([data-view=map]) .location-chip{top:52px!important;left:8px!important;right:8px!important;transform:none!important;width:auto!important;max-width:none!important;min-width:0!important;min-height:44px!important;height:44px!important;padding:4px 8px!important;gap:8px!important}
body #main:not([data-view=map]) .location-chip>div{min-width:0;flex:1;overflow:hidden}
body #main:not([data-view=map]) .location-chip small{font-size:9px!important;line-height:1.3}
body #main:not([data-view=map]) #location-name{font-size:11px!important;max-width:100%!important;overflow:hidden;text-overflow:ellipsis}
body #main:not([data-view=map]) #all-dogs{flex:none;min-height:36px;font-size:10px;padding:6px 8px;gap:4px}
body #main:not([data-view=map]) #all-dogs .icon{width:17px}
body #main:not([data-view=map]) .space-menu{top:102px!important;left:8px!important;max-width:46%}
body #main:not([data-view=map]) .space-menu>summary,body #main:not([data-view=map]) .floor-menu>summary{min-height:40px!important;padding:10px!important;font-size:10px!important}
body #main[data-view=interior] .floor-navigation{top:102px!important;right:8px!important;left:auto!important;min-width:0!important;width:fit-content!important;max-width:46%!important;padding:0!important}
body #main .floor-menu[open]{width:min(224px,46vw)!important;padding:0 8px 8px!important}
body #main:not([data-view=map]) .scene-tools{top:150px!important;right:8px!important;gap:6px!important}
body #main:not([data-view=map]) .scene-tools button{width:40px!important;height:40px!important;min-height:40px!important}
body #main:not([data-view=map]) .shared-status{top:150px!important;max-width:calc(100% - 120px);font-size:10px;white-space:normal;text-align:center;padding:4px 8px}
body #main:not([data-view=map]) .shared-join{top:auto!important;bottom:86px!important;left:50%!important;transform:translateX(-50%);max-width:calc(100% - 32px);font-size:11px;padding:8px 12px;min-height:40px;white-space:nowrap}
body #main:not([data-view=map]) .care-dock{position:absolute!important;left:8px!important;right:8px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;transform:none!important;width:auto!important;max-width:none!important;padding:4px!important;border-radius:16px!important}
body #main:not([data-view=map]) .care-actions{display:flex;gap:0}
body #main:not([data-view=map]) .care-action{flex:1;min-width:0;min-height:58px!important;font-size:10px!important;padding:5px 2px!important;gap:4px}
body #main:not([data-view=map]) .care-action .icon{width:20px;height:20px}
body #main:not([data-view=map]) .dock-bottom{display:none}
body #main:not([data-view=map]) .friend-card{left:8px!important;top:auto!important;bottom:124px!important;width:128px!important;max-height:230px;overflow:auto}
body #main:not([data-view=map]) .friend-photo{height:60px!important}body #main .friend-content{padding:8px}body #main .friend-heading h2{font-size:12px}body #main .friend-topline{font-size:8px;padding:8px}body #main .friend-guidance button{font-size:9px;padding:7px}
body #main .ambient-toggle{right:8px;bottom:84px;min-height:40px;padding:8px 10px;font-size:10px}
body .manager-speech,body .staff-speech{max-width:180px;font-size:11px}
.center-guide{box-sizing:border-box;width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;padding:12px!important;margin:auto;overflow:auto}
.center-guide header{gap:8px;align-items:flex-start}.center-guide header strong{min-width:0;font-size:14px;overflow-wrap:anywhere}.center-guide header button{flex:none;min-height:44px;padding:8px 12px}
.center-guide-spread{grid-template-columns:minmax(0,1fr)!important;min-height:0!important;margin:12px 0!important}
.center-guide .center-guide-leaf{min-width:0;padding:18px!important;gap:12px!important}.center-guide p{font-size:14px!important;line-height:1.8;overflow-wrap:anywhere}.center-guide h2{font-size:22px!important}.center-guide img{max-width:100%;height:auto;max-height:180px;object-fit:contain}.center-guide small:last-child{display:none}.center-guide footer{position:sticky;bottom:-12px;background:#f8f3e7;padding:8px 0;gap:8px}
.reading-panel[data-kind=consultation],#scene.is-seated .reading-panel[data-kind=consultation]{position:fixed!important;inset:8px!important;transform:none!important;width:auto!important;max-width:none!important;height:calc(100dvh - 16px)!important;max-height:calc(100dvh - 16px)!important;min-height:0!important;padding:10px!important;z-index:100!important;overflow:hidden!important}
.guide-toolbar{min-width:0;gap:8px;font-size:12px}.guide-toolbar>*{min-width:0}.guide-toolbar .reading-close{min-width:44px;min-height:44px;flex:none}.guide-image-pagination{gap:4px!important;font-size:11px}.guide-image-pagination button,.guide-image-pagination a{min-height:44px;padding:8px!important;font-size:11px}
.volunteer-guide{width:calc(100vw - 16px);max-width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);margin:auto}
}
/* Readers own the entire interaction layer; unrelated controls cannot cover a page. */
body:has(.reading-panel[data-kind=consultation]:not([hidden])),body:has(dialog[open]){--reader-open:1}
body:has(.reading-panel[data-kind=consultation]:not([hidden])) :is(.shared-status,.shared-join,.ambient-toggle,.care-dock,.friend-card,.floor-navigation,.space-menu),body:has(dialog[open]) :is(.shared-status,.shared-join,.ambient-toggle){visibility:hidden!important}
@media(orientation:landscape) and (max-height:540px){
body #main:not([data-view=map]) .location-chip{top:6px!important;left:145px!important;right:110px!important;max-width:520px!important;margin:auto}
body #main:not([data-view=map]) .space-menu,body #main[data-view=interior] .floor-navigation{top:56px!important}
body #main:not([data-view=map]) .scene-tools{top:104px!important;flex-direction:column!important}
body #main:not([data-view=map]) .shared-status{top:58px!important}
body #main:not([data-view=map]) .care-dock{left:50%!important;right:auto!important;transform:translateX(-50%)!important;width:min(440px,65%)!important}
body #main:not([data-view=map]) .friend-card{bottom:12px!important;max-height:185px;width:120px!important}
body #main .ambient-toggle{bottom:12px}
.center-guide-spread{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}.center-guide .center-guide-leaf{padding:12px!important}.center-guide img{max-height:100px}
}
.card-save-preview{border:0;border-radius:18px;background:#fffaf0;color:#284d3e;padding:12px;box-sizing:border-box;width:min(460px,calc(100vw - 16px));height:calc(100dvh - 20px);max-height:calc(100dvh - 20px);overflow:hidden}.card-save-preview[open]{display:flex;flex-direction:column;gap:10px}.card-save-preview::backdrop{background:#193c36b8}.card-save-preview header{display:flex;align-items:center;justify-content:space-between;gap:10px}.card-save-preview img{flex:1;min-height:0;width:100%;object-fit:contain}.card-save-preview button{min-height:44px;border-radius:10px;padding:10px;background:#315c47;color:white}.card-save-preview p{font-size:12px;line-height:1.6;margin:0}.card-save-preview .card-save-file{background:#e7eddf;color:#315c47}
@media(max-width:1024px),(pointer:coarse){body #main:not([data-view=map]) .scene-tools,body #main[data-view=interior] .floor-navigation{right:max(8px,env(safe-area-inset-right))!important}body #main:not([data-view=map]) .space-menu,body #main:not([data-view=map]) .friend-card{left:max(8px,env(safe-area-inset-left))!important}.reading-panel[data-kind=consultation],#scene.is-seated .reading-panel[data-kind=consultation]{left:max(8px,env(safe-area-inset-left))!important;right:max(8px,env(safe-area-inset-right))!important}.center-guide,.card-save-preview,.volunteer-guide{max-width:calc(100vw - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right)))!important}.card-save-preview .card-save-file{display:block;text-align:center;padding:9px;border-radius:8px;font-size:12px}.card-save-preview p{flex:none}.card-save-preview header strong{font-size:14px}}

.adoption-photo-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px}.adoption-photo-grid button{padding:10px;background:#fffdf5;border:1px solid #d7e1cc;border-radius:12px;color:#284d3e;text-align:left;min-width:0}.adoption-photo-grid img{width:100%;height:220px;object-fit:contain;background:#edf0df;border-radius:8px}.adoption-photo-grid strong,.adoption-photo-grid small{display:block;margin-top:8px;overflow-wrap:anywhere}.adoption-photo-grid small{font-size:12px}.board-photos-open{position:absolute;left:50%;transform:translateX(-50%);bottom:150px;z-index:8;padding:12px 16px;min-height:44px;border:1px solid #cbd9bd;border-radius:12px;background:#fffbed;color:#284d3e;font-size:13px;font-weight:600}.board-photos-open[hidden]{display:none}body:has(dialog[open]) .board-photos-open{visibility:hidden}@media(max-width:600px){.adoption-photo-grid{grid-template-columns:1fr}.adoption-photo-grid img{height:min(45dvh,360px)}.board-photos-open{bottom:130px;font-size:12px}}

#scene .bench-reading-button.rest-seat-exit{left:50%!important;top:auto!important;bottom:90px!important;transform:translateX(-50%)!important;z-index:20}
