/* Scene-first controls: one compact header, one daily-action bar, secondary tools on demand. */
html[data-theme="temple"][data-compact-ui] {--temple-dock-height:56px;--temple-dock-offset:max(8px,env(safe-area-inset-bottom,0px))}
html[data-theme="temple"][data-compact-ui] .temple-masthead {display:none}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-header {top:max(8px,env(safe-area-inset-top,0px));left:max(10px,env(safe-area-inset-left,0px));right:max(10px,env(safe-area-inset-right,0px));gap:8px}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-room-tools {padding:0 3px!important;min-height:46px;height:46px}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) #game-room {height:44px;min-height:44px;min-width:64px;padding:0 8px;gap:8px}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) #game-room>span {font-size:14px;letter-spacing:1px}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) #game-room-name {font-size:14px;line-height:1.2;letter-spacing:0;white-space:nowrap}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) #game-people {min-width:48px;height:44px;padding:0 5px;font-size:11px;font-variant-numeric:tabular-nums}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-tools {padding:0 2px!important;height:46px;min-height:46px;width:auto!important}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-tools .liquid-nav-source {display:flex;width:auto!important;height:44px;gap:0}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-tools .tool {width:44px;min-width:44px;height:44px;min-height:44px;padding:3px}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .temple-controls-open {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;font-size:10px;line-height:1;letter-spacing:0}
html[data-theme="temple"][data-compact-ui] .temple-controls-open svg {width:18px;height:18px}
html[data-theme="temple"][data-compact-ui] .temple-controls-open[data-model-error] {color:#f1ad8d}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-bottom {width:min(330px,calc(100% - 20px));bottom:calc(var(--sansa-ui-bottom,0px) + var(--temple-dock-offset));gap:4px}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-modes[data-liquid-nav] {box-sizing:border-box;height:56px;padding:2px 4px;width:100%}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-modes[data-liquid-nav]:after {display:none}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-modes .liquid-nav-source {display:flex;height:50px;gap:1px}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-modes .liquid-nav-source>button {box-sizing:border-box;min-width:44px;height:50px;min-height:44px;padding:3px 2px;gap:2px;font-size:12px;line-height:1.2;letter-spacing:0}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-modes button svg {width:19px;height:19px}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-modes button kbd {display:none}
/* The music controls in More replace the repeated floating invitation. */
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .chant-invite {display:none!important}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-hint[data-essential=false] {display:none}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-context {top:calc(max(8px,env(safe-area-inset-top,0px)) + 54px)}
html[data-theme="temple"][data-compact-ui] .sansa-game {--practice-controls-bottom:calc(var(--temple-dock-offset) + 68px);--practice-stage-bottom:calc(var(--temple-dock-offset) + 128px)}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .sansa-moktak-view {bottom:calc(var(--temple-dock-offset) + 68px)}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .cafe25-context-actions {bottom:calc(var(--temple-dock-offset) + 66px)}
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .devotional-dock {bottom:calc(var(--temple-dock-offset) + 66px)!important;max-width:calc(100vw - 20px);font-size:12px;padding:5px 9px!important}
html[data-theme="temple"][data-compact-ui] :is(.courtyard-trip,.temple-practice-trip,.culture-seat-journey,.incense-trip-cancel) {bottom:calc(var(--temple-dock-offset) + 70px);padding:8px 12px;font-size:12px}
/* A native, scrollable sheet contains the original controls and their original handlers. */
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet {box-sizing:border-box;position:fixed;inset:auto max(10px,env(safe-area-inset-right,0px)) calc(var(--temple-dock-offset) + 4px) auto;margin:0;width:360px;max-width:calc(100vw - 20px);max-height:calc(100dvh - max(12px,env(safe-area-inset-top,0px)) - var(--temple-dock-offset) - 12px);overflow:auto;overscroll-behavior:contain;padding:18px!important;border:1px solid #b49660!important;border-top:2px solid #773129!important;border-radius:0!important;background:#f2e7d0!important;box-shadow:0 12px 40px #140d0a55!important;font:16px/1.5 var(--sansa-ui);color:#3c2b23}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet::backdrop {background:#1b15104a;backdrop-filter:none}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet>header {display:flex;align-items:center;gap:8px;padding:0 0 12px;margin:0 0 14px;border-bottom:1px solid #b4996866}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet>header:before {display:none}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet h2 {margin:0;font-size:19px!important;letter-spacing:1px!important;line-height:1.4}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet .dialog-close {display:grid;place-items:center;width:44px;height:44px;min-width:44px;margin-left:auto;font-size:25px}
html[data-theme="temple"][data-compact-ui] .temple-menu-activities {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:14px}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet :is(#courtyard-guide,#temple-practice-open,#temple-culture-open) {position:static;inset:auto;box-sizing:border-box;min-width:0;min-height:44px;margin:0;padding:7px 5px;font-size:14px;line-height:1.4;letter-spacing:0;border:1px solid #b79a68;background:#e5d6b8;color:#65452e;white-space:normal}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet #local-tools {position:static;inset:auto;box-sizing:border-box;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;max-width:none;padding:0;margin:0;border:0;background:transparent;box-shadow:none;font-size:14px}
html[data-theme="temple"][data-compact-ui] #local-tools>span:not(.temple-music-feedback) {display:none}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet #local-tools button {box-sizing:border-box;min-height:44px;padding:8px;font:14px/1.4 var(--sansa-ui);letter-spacing:0;border:1px solid #b79a68;color:#65452e;background:#e5d6b8}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet #local-tools #ambient {background:#84342c;color:#ffe8be;border-color:#84342c}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet #local-tools #temple-track {width:100%;min-height:44px;padding:8px!important;color:#65452e;border-color:#b79a68;background:#fff7e6}
html[data-theme="temple"][data-compact-ui] #local-tools .temple-track-picker {min-width:0}
html[data-theme="temple"][data-compact-ui] #local-tools .temple-track-picker:has([aria-expanded=true]) {grid-column:1/-1}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet #local-tools .temple-track-options {position:static;inset:auto;width:100%;max-width:none;max-height:none;padding:4px;margin-top:6px;box-sizing:border-box;background:#fff7e6;box-shadow:none}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet #local-tools .temple-track-options button {min-height:60px;width:100%;padding:8px;text-align:left;border:0;background:transparent;color:#65452e}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet #local-tools .temple-track-options button+button {border-top:1px solid #b79a6860}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet #local-tools .temple-track-options button[aria-selected=true] {background:#e5d6b8}
html[data-theme="temple"][data-compact-ui] #local-tools .temple-track-options button strong {font-size:15px;letter-spacing:0}
html[data-theme="temple"][data-compact-ui] #local-tools .temple-track-options button small {font-size:12px;color:#765b3e}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet #local-tools .temple-music-feedback {position:static;inset:auto;grid-column:1/-1;width:auto;max-width:none;padding:6px 0;margin:0;border:0;box-shadow:none;background:transparent;color:#705238;font-size:13px;letter-spacing:0}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet #local-tools .temple-music-feedback[data-state=error] {color:#8b3029}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet .temple-hall-identity {position:static;inset:auto;width:auto;max-width:none;margin:16px 0 0;padding:10px 0 0;border:0;border-top:1px solid #b4996866;box-shadow:none;background:transparent;color:#65452e;font-size:14px}
html[data-theme="temple"][data-compact-ui] .temple-hall-identity summary {display:flex;align-items:center;gap:8px;min-height:44px;list-style:none}
html[data-theme="temple"][data-compact-ui] .temple-hall-identity summary::-webkit-details-marker {display:none}
html[data-theme="temple"][data-compact-ui] .temple-hall-identity summary:after {content:"+";margin-left:auto;font-size:20px}
html[data-theme="temple"][data-compact-ui] .temple-hall-identity[open] summary:after {content:"−"}
html[data-theme="temple"][data-compact-ui] .temple-hall-identity h2 {font-size:16px!important;font-weight:500;letter-spacing:0!important;margin:0}
html[data-theme="temple"][data-compact-ui] .temple-hall-identity p {font-size:14px;line-height:1.7}
html[data-theme="temple"][data-compact-ui] .temple-hall-tradition {color:#765b3e}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet .temple-menu-settings {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:12px 0 0;margin:12px 0 0;border-top:1px solid #b4996866}
html[data-theme="temple"][data-compact-ui] .temple-menu-settings .tool {display:flex;align-items:center;justify-content:center;gap:5px;width:auto;min-width:0;min-height:44px;height:auto;padding:7px 4px;border:1px solid #b79a68;background:transparent;color:#65452e;white-space:normal;font-size:14px}
html[data-theme="temple"][data-compact-ui] .temple-menu-settings .tool svg {width:16px;height:16px;flex-shrink:0}
html[data-theme="temple"][data-compact-ui] .temple-menu-settings .support-tool>span:first-child {display:none}
html[data-theme="temple"][data-compact-ui] .temple-menu-settings .tool>.temple-menu-label {font:14px/1.4 var(--sansa-ui);color:inherit}
html[data-theme="temple"][data-compact-ui] .temple-menu-settings .tool>.temple-menu-label:before {content:none}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet :is(button,summary):focus-visible {outline:2px solid #8b3029;outline-offset:2px}
@media(max-width:700px) {
 html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) #game-room>span {display:none}
 html[data-theme="temple"][data-compact-ui] #temple-controls-sheet {inset:auto max(10px,env(safe-area-inset-right,0px)) calc(var(--temple-dock-offset) + 4px) max(10px,env(safe-area-inset-left,0px));width:auto;max-width:none;padding:14px!important}
 html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-dialog:not(#temple-controls-sheet) {max-height:calc(100dvh - max(16px,env(safe-area-inset-top,0px)) - max(16px,env(safe-area-inset-bottom,0px)));padding:18px!important}
 html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-dialog .dialog-close {width:44px;height:44px;min-width:44px}
}
@media(max-height:500px) {
 html[data-theme="temple"][data-compact-ui] #temple-controls-sheet {width:360px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);inset:12px max(12px,env(safe-area-inset-right,0px)) 12px auto;padding:12px 16px!important}
 html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .game-bottom {width:300px}
}
@media(forced-colors:active) {
 html[data-theme="temple"][data-compact-ui] #temple-controls-sheet {background:Canvas!important;color:CanvasText;border-color:CanvasText!important}
 html[data-theme="temple"][data-compact-ui] #temple-controls-sheet button {color:ButtonText!important;background:ButtonFace!important;border-color:ButtonText!important}
}

/* Match native tool labels to the paper sheet instead of their former dark header. */
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet .temple-menu-settings .tool {color:#65452e!important}
html[data-theme="temple"][data-compact-ui] #temple-controls-sheet .temple-menu-settings .tool>.temple-menu-label {color:#65452e!important}
/* Nearby actions stay beside the scene rather than over the character. */
html[data-theme="temple"][data-compact-ui] :is(.sansa-game,body) .cafe25-context-actions {left:max(10px,env(safe-area-inset-left,0px));right:auto;transform:none;justify-content:flex-start;width:auto;max-width:calc(100% - 20px)}
