.scene-action{position:absolute;left:32px;top:114px;padding:10px 12px;border:1px solid var(--line);background:var(--paper);font-size:10px}
#leave-hall{top:156px}#hall-flowers,#burial-ceiling{top:198px}#hall-flowers[aria-pressed=true]{color:var(--red)}
.panel-action{display:block;margin:0 0 18px;padding:12px;border:1px solid var(--line);color:var(--red);text-align:left;width:100%}
#tour-controls{position:absolute;left:32px;bottom:150px;background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:12px;font-size:10px;max-width:calc(100vw - 40px)}
#tour-controls p{margin:0 0 10px}#tour-controls button{padding:6px 9px;border:1px solid var(--line);margin-right:6px}
button:disabled{opacity:.35;cursor:default}body:has(#places:not([hidden])) .scene-action{visibility:hidden}
.masthead h1{font-size:17px;letter-spacing:0;font-weight:700;line-height:1.2;margin:7px 0 3px}
.masthead p{font-size:11px;letter-spacing:0;color:var(--muted)}
.top-actions #places-toggle{display:flex;align-items:center;gap:6px;width:auto;height:32px;padding:0 11px;border:1px solid var(--line);border-radius:999px;font:inherit;font-size:12px;font-weight:700;background:var(--paper)}
#places-toggle span{font-size:inherit;margin:0}
/* Caption and controls share normal flow; no independent bottom offsets. */
#interface-footer{position:absolute;left:max(16px,env(safe-area-inset-left));right:max(20px,env(safe-area-inset-right));bottom:max(28px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:25px;pointer-events:none;z-index:3}
#interface-footer .bottom-left{position:static;left:auto;bottom:auto;transform:none;pointer-events:none}
#interface-footer #hover-name{margin:0;font-size:11px;padding:5px 7px}
#interface-footer .bottom-left p{font-size:9px;line-height:1.5;margin:6px 0 0 7px}
#interface-footer .bottom-tools{position:static;display:block;pointer-events:none}
#interface-footer .tools{position:static;left:auto;right:auto;bottom:auto;transform:none;display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;max-width:none;white-space:nowrap;pointer-events:none}
#interface-footer .camera-tools{display:flex;gap:5px;align-items:center}
#interface-footer .tool-group{display:flex;align-items:center;flex:none;gap:0;padding:4px;border:1px solid var(--line);border-radius:999px;background:var(--control-bg);box-shadow:0 0 0 1px color-mix(in srgb,var(--line) 30%,transparent);pointer-events:auto}
#interface-footer .tool-group button{display:grid;place-items:center;flex:none;min-width:30px;width:30px;height:30px;padding:0;font-size:16px;line-height:1;border-radius:50%}
#interface-footer #view-label{font-size:8px;letter-spacing:.7px;padding:0 3px;min-width:43px;text-align:center}
#interface-footer .zoom-tools button{width:30px;min-width:30px}
#interface-footer .utility-tools{gap:6px;padding:4px;background:var(--control-bg)}
#interface-footer .utility-tools button{width:30px;min-width:30px;height:30px;border:1px solid var(--line);background:color-mix(in srgb,var(--ink) 5%,transparent)}
#interface-footer svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#interface-footer button:hover,#interface-footer button[aria-expanded=true]{background:color-mix(in srgb,var(--ink) 10%,transparent);color:var(--red)}
:root{--control-bg:#f9faf5f2}
html[data-time=night]{--paper:#0c1320;--ink:#e4dfd0;--muted:#acb5bd;--line:#364151;--red:#edb772;--green:#b8c4ad;--control-bg:#121e2df2;background:#0c1320;color-scheme:dark}
html[data-time=night] .top-actions button,html[data-time=night] aside,html[data-time=night] #hover-name{background:#121e2df2}
html[data-time=night] aside p,html[data-time=night] dialog p{color:#c1c7cd}
html[data-time=night] #place-list button{border-bottom-color:var(--line)}
html[data-time=night] dialog::backdrop{background:#050c17c9}
aside{border-radius:10px}aside p,dialog p{font-size:13px;line-height:1.6}aside h2{font-size:17px;font-weight:600}#details p{margin-bottom:14px}
#settings-panel{position:absolute;top:auto;left:auto;right:max(20px,env(safe-area-inset-right));bottom:calc(max(28px,env(safe-area-inset-bottom)) + 58px);width:240px;max-height:none;padding:8px;border-radius:15px;z-index:5;background:var(--control-bg);box-shadow:0 8px 24px #0002}
#settings-panel .panel-head{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.setting-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 7px;font-size:10px;border-radius:10px;background:color-mix(in srgb,var(--ink) 4%,transparent)}
.setting-row div{display:flex;gap:2px}.setting-row button{padding:4px 6px;border-radius:7px;font-size:9px}.setting-row button[aria-pressed=true]{background:color-mix(in srgb,var(--ink) 12%,transparent);color:var(--ink)}
body:has(#details:not([hidden])) #interface-footer .bottom-left,body:has(#tour-controls:not([hidden])) #interface-footer .bottom-left{display:none}
body:has(#settings-panel:not([hidden])) #interface-footer .bottom-left{visibility:hidden}
@media(max-width:720px){
 .masthead{top:max(20px,env(safe-area-inset-top));left:12px}.masthead .eyebrow{font-size:7px;letter-spacing:1.5px}.masthead p{font-size:9px}
 .top-actions{top:max(36px,env(safe-area-inset-top));right:20px;gap:0}.top-actions #places-toggle{height:30px;font-size:12px}
 #interface-footer{left:15px;right:20px;bottom:max(28px,env(safe-area-inset-bottom));gap:25px}
 #interface-footer .bottom-left p{font-size:8px}
 #details{top:auto;bottom:146px;right:12px;left:12px;width:auto;max-height:45dvh;padding:14px 15px}
 #details h2{margin:9px 0 7px;font-size:17px}#details p{font-size:12px;line-height:1.55;margin-bottom:12px}#detail-source{font-size:11px}
 #tour-controls{left:12px;right:12px;bottom:82px;width:auto;max-width:none;padding:9px 10px;z-index:4}
 #tour-controls p{font-size:11px;margin-bottom:6px}#tour-controls button{font-size:10px;padding:6px 7px;margin-right:3px}
 body:has(#tour-controls:not([hidden])) #details{bottom:185px;max-height:30dvh}
 .scene-action{left:14px;top:98px;padding:8px 10px;font-size:10px}#leave-hall{top:136px}#hall-flowers,#burial-ceiling{top:174px}
 #settings-panel{right:20px}
}
@media(max-width:375px){
 #interface-footer .tools{gap:8px}
 #interface-footer .tool-group{padding:4px}
 #interface-footer .tool-group button,#interface-footer .utility-tools button,#interface-footer .zoom-tools button{width:26px;min-width:26px;height:26px}
 #interface-footer #view-label{min-width:36px;font-size:7px}
 #interface-footer .utility-tools{gap:4px;padding:4px}

}
@media(max-width:360px){
 #interface-footer{left:10px;right:10px}#interface-footer .tools{gap:6px}
 #interface-footer .tool-group button{width:24px;min-width:24px;height:24px}#interface-footer #view-label{min-width:36px;font-size:7px}
 #interface-footer .utility-tools{gap:4px;padding:4px}#interface-footer .utility-tools button{width:24px;min-width:24px;height:24px}
 #interface-footer .zoom-tools button{width:24px;min-width:24px;height:24px}#interface-footer .camera-tools{gap:4px}
 #settings-panel{right:10px}#tour-controls button{font-size:9px;padding:6px 5px}
}

/* Keep browser page gestures separate from the diorama camera.
   Native one-finger scrolling remains available inside information panels. */
html,body{touch-action:pan-x pan-y}
button,a{touch-action:manipulation}
#scene{touch-action:none}


/* Keep identity and location captions readable over the detailed diorama. */
.masthead{max-width:min(230px,calc(100vw - 132px));padding:11px 13px;border:0;border-radius:0;background:var(--control-bg);box-shadow:none;z-index:4}
.masthead h1{margin:0 0 5px}.masthead p{margin:0;line-height:1.45}
#interface-footer .bottom-left{width:max-content;max-width:min(320px,calc(100vw - 32px));padding:7px 9px;border:0;border-radius:0;background:var(--control-bg);box-shadow:none}
#interface-footer #hover-name{display:block;width:max-content;max-width:100%;padding:0;background:transparent;font-size:11px;line-height:1.4}
#interface-footer .bottom-left p{margin:4px 0 0;max-width:100%;color:var(--muted);line-height:1.45}

/* Discovery help shares the Places area without covering the scene. */
.top-actions{flex-direction:row;gap:16px;align-items:center}
.help-launch{position:absolute;top:max(108px,calc(env(safe-area-inset-top) + 86px));left:max(32px,env(safe-area-inset-left));z-index:4;display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:var(--control-bg);font-size:12px;font-weight:700;box-shadow:0 2px 10px #0003}
.help-launch:hover{border-color:var(--red);color:var(--red)}
#help-panel{position:fixed;left:var(--help-left,32px);right:auto;top:var(--help-top,146px);width:min(340px,calc(100vw - 24px));max-height:var(--help-max-height,calc(100dvh - 160px));z-index:6;border-radius:12px;padding:18px;background:var(--paper)}
#help-panel ol{padding-left:20px;margin:18px 0 0}#help-panel li{font-size:12px;line-height:1.7;margin:0 0 16px;padding-left:4px}#help-panel li:last-child{margin-bottom:0}
.help-places-preview{display:flex;align-items:center;gap:6px;width:max-content;margin:10px 0 2px;padding:6px 11px;border:1px solid var(--line);border-radius:999px;background:var(--paper);font-size:12px;font-weight:700;line-height:1.2}
.help-device{display:grid;gap:3px;margin-top:10px}.help-device strong{font-size:11px;color:var(--red)}.help-device span{font-size:11px;line-height:1.6}
.help-controls{margin:18px 0 0 24px;padding-top:14px;border-top:1px solid var(--line)}
.help-controls h3{font-size:10px;letter-spacing:.6px;margin:0 0 8px}
.help-control-list{display:grid}
.help-control-row{display:flex;align-items:center;gap:11px;padding:10px 0;border-top:1px solid #e7e8e1}
.help-control-row>div{min-width:0}
.help-control-row strong{display:block;font-size:11px;font-weight:700;color:var(--ink)}
.help-control-row p{margin:3px 0 0;font-size:11px;line-height:1.45;color:var(--muted)}
.help-control-icon{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;gap:1px;flex:none;border:1px solid #ffffff28;border-radius:50%;background:#17212f;color:#f3e8cf}
.help-control-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.help-control-icon svg+svg{width:13px;height:13px;margin-left:-5px;color:#e8b45f}
#interface-footer .bottom-left p{max-width:330px}
body:has(#help-panel:not([hidden])) .scene-action{visibility:hidden}
@media(max-width:720px){.masthead{max-width:min(210px,calc(100vw - 125px));padding:9px 10px}.masthead h1{font-size:16px}.help-launch{top:max(84px,calc(env(safe-area-inset-top) + 66px));left:12px;min-height:34px;padding:0 12px;font-size:11px}#interface-footer .bottom-left{max-width:min(280px,calc(100vw - 30px))}.top-actions{gap:0}#interface-footer .bottom-left p{max-width:280px}}

/* Keep the Places menu opposite the help button; hide the caption while it is open. */
#places{left:auto;right:32px}
body:has(#places:not([hidden])) #interface-footer .bottom-left{display:none}
@media(max-width:720px){#places{left:auto;right:20px}}

/* Keep the author with the title, away from the scene controls. */
.site-credit{display:block;width:max-content;max-width:100%;pointer-events:auto;color:var(--muted);font-size:10px;line-height:1.5;text-decoration:none}
.site-credit:hover{color:var(--ink);text-decoration:underline;text-underline-offset:2px}
