/* One closed light control lives in the footer; settings open above the docks. */
.bottom-bar .torch-controls{position:relative;inset:auto;flex:none;width:auto;margin:0;padding:0;border:0;border-radius:5px;background:transparent;font:inherit;z-index:auto}
.bottom-bar .torch-controls>summary{display:flex;align-items:center;justify-content:center;gap:6px;min-height:32px;padding:6px 9px;border:1px solid var(--line,#ffffff30);border-radius:4px;background:#121324cc;color:inherit;font:inherit;line-height:1.2;list-style:none;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-user-select:none}
.bottom-bar .torch-controls>summary::-webkit-details-marker{display:none}
.bottom-bar .torch-controls>summary::before{content:'';width:6px;height:6px;flex:none;border:1px solid #c6cbb8;border-radius:50%;background:transparent}
.bottom-bar .torch-controls:has(#torch-toggle[aria-pressed=true])>summary::before{background:#ffe6a3;border-color:#ffe6a3;box-shadow:0 0 5px #ffe6a366}
.bottom-bar .torch-controls[open]>summary,.bottom-bar .torch-controls>summary:hover{border-color:#c7d2ae;background:#283c43}
.bottom-bar .torch-controls>summary:focus-visible{outline:3px solid var(--gold,#ffd58a);outline-offset:3px}
.bottom-bar .torch-panel{position:fixed;right:310px;bottom:118px;width:248px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 205px);overflow:auto;overscroll-behavior:contain;padding:11px;border:1px solid #84988a;border-radius:8px;background:#142631f7;box-shadow:0 8px 28px #08121a66;font:11px/1.35 Arial,sans-serif}
.bottom-bar .torch-controls:not([open])>.torch-panel{display:none}
.bottom-bar .torch-panel #torch-toggle{display:block;width:100%;min-height:34px;margin:0 0 10px;font-size:11px}
.bottom-bar .torch-panel #torch-toggle[aria-pressed=true]{background:#d4dda9;color:#1a2c2c;border-color:#d4dda9}
.bottom-bar .torch-panel label{display:grid;grid-template-columns:86px minmax(0,1fr);align-items:center;gap:9px;margin:8px 0}
.bottom-bar .torch-panel select{min-width:0;width:100%;min-height:32px;padding:4px;border:1px solid #77918a;border-radius:4px;background:#172d38;color:#edf0e2;font:11px Arial,sans-serif}
.bottom-bar .torch-panel input[type=range]{width:100%;min-width:0;min-height:28px;margin:0;accent-color:#d4dda9}
.bottom-bar .torch-panel input[type=color]{width:100%;height:30px;border:1px solid #77918a;border-radius:4px;padding:2px;background:#172d38;cursor:pointer}
.bottom-bar .torch-panel small{display:block;border:0;padding:7px 0 0;margin:0;color:#b8c9c5;font-size:10px;line-height:1.4}
.bottom-bar:has(.torch-controls[open]){z-index:40}
.bottom-bar:has(.torch-controls)>div:first-child{flex:1;min-width:0;overflow:hidden}
.bottom-bar:has(.torch-controls)>div:last-child{flex:none}
.bottom-bar:has(.torch-controls) #location{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bottom-bar:has(.torch-controls) #fps{flex:none;white-space:nowrap}
@media(min-width:651px) and (max-width:850px) and (pointer:fine){
 .bottom-bar .torch-panel{bottom:194px;max-height:calc(100dvh - 244px)}
}
@media(max-width:650px),(pointer:coarse){
 .bottom-bar:has(.torch-controls){padding-bottom:max(8px,env(safe-area-inset-bottom))}
 .bottom-bar .torch-controls>summary{min-height:36px;padding:6px 8px;font-size:10px;gap:5px}
 .bottom-bar .torch-panel{position:fixed;right:10px;bottom:calc(194px + env(safe-area-inset-bottom));width:248px;max-height:calc(100dvh - 244px - env(safe-area-inset-bottom));padding:10px}
 .bottom-bar .torch-panel #torch-toggle,.bottom-bar .torch-panel select{min-height:36px}
 .bottom-bar .torch-panel input[type=range]{min-height:32px}
 .bottom-bar .torch-panel input[type=color]{height:36px}
}
@media(orientation:landscape) and (pointer:coarse){
 .bottom-bar .torch-panel{right:calc(150px + env(safe-area-inset-right));width:min(248px,calc(100vw - 164px - env(safe-area-inset-right)))}
}
