:root{color-scheme:dark;--bg:#101820;--card:#1b2936;--line:#364a5d;--text:#edf4fa;--muted:#b5c4d1;--accent:#68d5c1;font:16px system-ui,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}main,header{max-width:1200px;margin:auto;padding:24px}.login{max-width:460px;margin:8vh auto}h1{font-size:28px}h2{font-size:22px}p{line-height:1.5}label{display:block;margin:14px 0 6px}input,select,textarea,button{font:inherit;border-radius:8px;border:1px solid var(--line);padding:11px;background:var(--card);color:var(--text)}input,textarea{width:100%}button{cursor:pointer;margin:8px 4px 8px 0}button:hover{border-color:var(--accent)}button:disabled{opacity:.5;cursor:wait}:focus-visible{outline:3px solid var(--accent);outline-offset:3px}.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.toolbar input{flex:1;min-width:180px}.muted{color:var(--muted)}.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:14px;margin:20px 0}.card{padding:18px;background:var(--card);border:1px solid var(--line);border-radius:12px;text-align:left;width:100%;margin:0}.card h2{font-size:18px}.online{color:var(--accent)}.warning{color:#f6d78b}.problem{color:#ffa09c}[hidden]{display:none!important}dialog{background:var(--bg);color:var(--text);border:1px solid var(--line);border-radius:12px;width:min(700px,94vw);max-height:90vh;overflow:auto}dialog::backdrop{background:#0009}dl{display:grid;grid-template-columns:1fr 1fr;gap:10px}dt{color:var(--muted)}dd{margin:0;overflow-wrap:anywhere}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--card);padding:14px;border-radius:8px;max-height:40vh;overflow:auto}progress{width:100%;accent-color:var(--accent)}table{width:100%;border-collapse:collapse}td,th{text-align:left;padding:10px;border-bottom:1px solid var(--line)}.table-scroll{overflow-x:auto}header{display:flex;justify-content:space-between;align-items:center;gap:12px}.badge{font-size:13px}.notes{white-space:pre-wrap}@media(max-width:600px){main,header{padding:14px}dl{grid-template-columns:1fr}dd{margin-bottom:8px}.cards{grid-template-columns:1fr}}

input[type=checkbox]{width:auto}

#viewer{width:98vw;max-width:none;max-height:98vh;padding:14px}#viewer:fullscreen{width:100vw;height:100vh;border:0;border-radius:0;max-height:none;overflow:auto}#remote-viewport{height:60vh;min-height:200px;position:relative;overflow:hidden;background:#05090d;display:flex;align-items:center;justify-content:center}#remote-surface{position:relative;flex:none;transform-origin:center;line-height:0}#remote-screen{display:block;touch-action:none;cursor:none;outline-offset:-3px}#remote-pointer{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.remote-keys{gap:4px}.remote-keys button{padding:7px;font-size:13px;margin:2px}.remote-help{font-size:13px}#viewer .toolbar label{margin:4px 0}#viewer .toolbar input:not([type=checkbox]){min-width:140px}#viewer:fullscreen #remote-viewport{height:65vh}@media(max-width:600px){#viewer{padding:8px;width:100vw}#remote-viewport{height:48vh}.remote-keys{max-height:100px;overflow:auto}.remote-help{margin:6px 0}}

/* Keep the remote desktop visible while opening controls or the mobile keyboard. */
#viewer[open]{display:flex;flex-direction:column;height:98dvh;max-height:98dvh;overflow:hidden}
#viewer:fullscreen{height:100dvh;max-height:100dvh}
#viewer #remote-viewport{flex:1;min-height:100px;height:auto}
.remote-bar{flex-wrap:nowrap;gap:6px;flex:none}
#remote-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.remote-bar button{margin:0;padding:10px;font-size:14px;min-height:44px}
#remote-keyboard-panel,#remote-options-panel{flex:none;max-height:40%;overflow:auto;padding:8px 0}
#remote-keyboard-panel .toolbar{gap:6px}
#remote-keyboard-panel button{min-height:44px;margin:2px 0}
#remote-keyboard-panel .remote-keys{max-height:none;overflow:visible}
.remote-function-keys summary{cursor:pointer;padding:10px;border:1px solid var(--line);border-radius:8px}
#viewer #video-status{flex:none;font-size:12px;margin:6px 0}
@media(pointer:coarse){#viewer .remote-help{display:none}#viewer{border-radius:0;padding:8px;padding-bottom:max(8px,env(safe-area-inset-bottom))}#remote-options-panel{font-size:14px}#remote-keyboard-panel{max-height:48%}}
@media(max-width:420px){.remote-bar{flex-wrap:wrap}#remote-name{flex-basis:100%;font-size:14px}.remote-bar button{flex:1}}

#gate button,#unlock button{display:block;margin-top:20px}
.cards{display:flex;flex-direction:column;gap:0;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.card{display:flex;align-items:center;gap:14px;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:12px 16px;min-height:60px}
.card:last-child{border-bottom:0}.card:hover{background:#243747}
.device-led{width:10px;height:10px;flex:none;border-radius:50%;background:#73808b;box-shadow:0 0 0 3px #73808b22}
.device-led.connected{background:#58d68d;box-shadow:0 0 0 3px #58d68d22}
.device-info{display:flex;flex:2;min-width:0;flex-direction:column;gap:3px}.device-name{font-weight:600;overflow-wrap:anywhere}.device-id{font:12px ui-monospace,monospace}.device-group,.device-tags{flex:1;min-width:0;font-size:13px;overflow-wrap:anywhere}
.session-tabs{display:flex;gap:8px;flex:none}.session-tabs button{margin:0 0 8px;padding:10px 16px}.session-tabs [aria-selected=true]{border-color:var(--accent);color:var(--accent)}
#desktop-panel{display:flex;flex-direction:column;flex:1;min-height:0}
#powershell-panel{display:flex;flex-direction:column;flex:1;min-height:0;gap:6px}
#powershell-panel #output{flex:1;min-height:80px;max-height:none;margin:0;font:14px ui-monospace,monospace}
#powershell-panel #command{font:14px ui-monospace,monospace;resize:none}
#powershell-panel label,#powershell-panel p{margin:4px 0}#powershell-panel button{margin:2px 0}
#viewer.expanded{position:fixed;inset:0;width:100vw;max-width:none;max-height:100dvh;margin:0;border:0;border-radius:0}
@media(max-width:600px){.device-tags{display:none}.device-group{flex:.8}.card{padding:12px;gap:10px}}

/* Fullscreen controls float above the desktop instead of consuming its height. */
#remote-controls{display:contents}
#remote-menu{display:none}
#viewer.expanded{padding:0}
#viewer:is(.expanded,.keyboard-open) #remote-menu{display:block;position:absolute;z-index:5;right:max(10px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top));width:44px;height:44px;margin:0;padding:6px;font-size:24px;background:#1b2936d9;border-color:#ffffff55;box-shadow:0 2px 10px #0006}
#viewer:is(.expanded,.keyboard-open) #remote-controls{display:none}
#viewer:is(.expanded,.keyboard-open).controls-open #remote-controls{display:flex;flex-direction:column;gap:8px;position:absolute;z-index:4;right:8px;top:62px;width:min(520px,calc(100% - 16px));max-height:calc(100% - 72px);overflow:auto;background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:14px;box-shadow:0 8px 30px #0009}
#viewer:is(.expanded,.keyboard-open) #remote-controls .session-tabs{flex-wrap:wrap}
#viewer:is(.expanded,.keyboard-open) #remote-controls #remote-options-panel,#viewer:is(.expanded,.keyboard-open) #remote-controls #remote-keyboard-panel{max-height:none;overflow:visible}
#viewer:is(.expanded,.keyboard-open) #remote-controls .remote-help{display:none}
#viewer.expanded #powershell-panel{padding:62px 12px 12px}

#remote-viewport[data-dragging=true]::after{content:"Arrastrando · levanta el dedo para soltar";position:absolute;bottom:12px;left:50%;transform:translateX(-50%);padding:6px 12px;border-radius:8px;background:#101820dd;color:var(--accent);font-size:12px;white-space:nowrap;pointer-events:none}
@media(max-width:600px){.session-tabs{gap:6px;flex-wrap:wrap}.session-tabs button{font-size:14px;padding:10px 8px;min-height:44px}}

.ui-icon{width:18px;height:18px;flex:none;vertical-align:middle;pointer-events:none}
button:has(.ui-icon){display:inline-flex;align-items:center;justify-content:center;gap:8px}
#gate button,#unlock button{display:flex}
button{transition:background-color .15s,border-color .15s,box-shadow .15s}
button:hover{background:#253a49}button:active{background:#304b5a}
#enter,#desktop,#run,#remote-type,#gate button{background:var(--accent);color:#102c27;border-color:var(--accent);font-weight:600}
#logout,#close-viewer{color:#ffa09c}#stop:not(:disabled){border-color:#ffa09c;color:#ffa09c}
#viewer:is(.expanded,.keyboard-open) #remote-menu{display:flex;align-items:center;justify-content:center}
#remote-menu .ui-icon{width:24px;height:24px}
.search-field{display:flex;align-items:center;flex:1;min-width:180px;gap:10px;padding-left:12px;background:var(--card);border:1px solid var(--line);border-radius:8px}
.search-field>.ui-icon{color:var(--muted)}.search-field input{min-width:0!important;border:0;background:transparent;flex:1}
.search-field:focus-within{border-color:var(--accent)}
.session-tabs [aria-selected=true]{background:#68d5c114;box-shadow:inset 0 -2px var(--accent)}
@media(max-width:600px){.session-tabs button{gap:4px;font-size:12px;padding:8px 6px}.session-tabs .ui-icon{width:16px;height:16px}#remote-fullscreen .button-label{max-width:82px}.remote-bar button{gap:5px;padding:8px}.search-field{min-width:0;flex-basis:100%}}

#remote-live-row{gap:8px}#remote-live-row input{flex:1;min-width:120px!important}#remote-live-row .muted{font-size:12px}#remote-bulk-text summary{cursor:pointer;color:var(--muted);padding:8px 0}#remote-live-row label{font-size:14px}

/* A separate keyboard dock stays visible when the floating menu closes. */
#remote-keyboard-panel{padding:4px;max-height:45%;border-top:1px solid var(--line);background:var(--bg)}
#remote-live-row{flex-wrap:nowrap;gap:4px}
#remote-live-input{flex:1;min-width:0;width:0;height:42px;min-height:42px;padding:8px;resize:none;overflow:hidden;font-size:16px}
#remote-live-row button{flex:none;padding:7px;font-size:14px;white-space:nowrap;min-height:42px;margin:0}
#remote-keyboard-extra>summary{cursor:pointer;color:var(--muted);font-size:12px;padding:5px}
#viewer.keyboard-open .remote-help{display:none}
.password-field{position:relative}.password-field input{padding-right:54px}#unlock #password-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:42px;height:38px;padding:8px;margin:0;border:0;background:transparent}
#remote-text{flex:1;min-width:140px;resize:vertical;font-size:16px}
/* Console output gets the remaining space; input and actions stay compact. */
#powershell-panel{gap:4px}
#powershell-panel #output{min-height:0;padding:10px;line-height:1.45;background:#080f16;border:1px solid var(--line);border-radius:8px;overflow:auto;tab-size:4}
#shell-command{display:flex;align-items:stretch;gap:6px;flex:none}
#shell-command .shell-command-label{display:none}
#powershell-panel #command{flex:1;min-width:0;width:0;height:44px;min-height:44px;max-height:100px;padding:10px;font-size:16px}
#shell-command #run{flex:none;margin:0}
#shell-state{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:none}
#shell-input-options{flex:none;max-height:35%;overflow:auto}
#shell-input-options summary{font-size:12px;color:var(--muted);cursor:pointer;padding:4px}
.shell-toolbar{flex:none;gap:6px}
#powershell-panel .shell-toolbar button{font-size:13px;padding:7px;min-height:36px}
#powershell-panel .shell-toolbar label{font-size:13px}
#viewer.powershell-active .remote-help{display:none}
@media(max-width:600px){#viewer.powershell-active .remote-bar{display:none}#powershell-panel .shell-toolbar{flex-wrap:nowrap}#shell-clear .button-label,#stop .button-label{display:none}#shell-clear,#stop{width:36px}#shell-open{flex:1}#powershell-panel #output{font-size:13px}.powershell-active .session-tabs button{margin-bottom:2px;padding:6px 8px;min-height:36px}#shell-command #run{padding:8px;font-size:13px}}
#shell-terminal{flex:1;min-height:0;overflow:hidden;background:#080f16;padding:6px;border:1px solid var(--line);border-radius:8px}
#terminal-keys{flex:none;flex-wrap:nowrap;overflow-x:auto;gap:4px;padding:2px}
#terminal-keys button{flex:none;padding:6px 9px;min-height:36px;font-size:13px;margin:0}
#terminal-ctrl[aria-pressed=true]{color:var(--accent);border-color:var(--accent)}
#shell-terminal .xterm{height:100%}
/* Anchor the modal to the visible viewport instead of centering it behind the phone keyboard. */
#viewer.mobile-session[open]{position:fixed;inset:auto;top:var(--viewport-top,0px);left:var(--viewport-left,0px);width:var(--viewport-width,100vw);max-width:none;max-height:var(--viewport-height,100dvh);margin:0;border:0;border-radius:0;padding:6px}
#viewer.powershell-active #video-status{display:none}
#powershell-panel .shell-toolbar label{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
#powershell-panel .shell-toolbar input[type=checkbox]{width:auto;min-width:0;flex:none;margin:0}
#powershell-panel.terminal-running #shell-open{display:none}
#powershell-panel.terminal-running .shell-toolbar{justify-content:flex-end}
#powershell-panel.terminal-running .shell-toolbar label{margin-right:auto}
@media(max-width:600px){#viewer.powershell-active .session-tabs{flex-wrap:nowrap;gap:4px}#viewer.powershell-active .session-tabs button{white-space:nowrap;font-size:12px;padding:6px;gap:4px}#viewer.powershell-active .session-tabs .ui-icon{width:16px;height:16px}#powershell-panel.terminal-running #shell-state{display:none}}
#viewer.mobile-session.expanded{padding:0}#viewer.mobile-session.expanded.powershell-active{padding:6px}
.card{padding:0;gap:0}
.contact-connect{display:flex;align-items:center;gap:14px;flex:1;min-width:0;min-height:60px;padding:12px 16px;margin:0;border:0;border-radius:0;background:transparent;text-align:left}
.contact-connect:hover{background:#ffffff08}
.contact-inventory{flex:none;width:44px;height:44px;padding:10px;margin:4px 8px 4px 0}
@media(max-width:600px){.contact-connect{gap:10px;padding:12px}.contact-inventory{margin-right:6px}}
#shell-terminal.terminal-with-scrollbar{display:grid;grid-template-columns:minmax(0,1fr) 24px;grid-template-rows:minmax(0,1fr);gap:4px}
.terminal-surface{min-width:0;min-height:0;height:100%;overflow:hidden}
#shell-terminal .terminal-scrollbar{writing-mode:vertical-lr;direction:ltr;appearance:none;width:24px;height:100%;min-width:0;min-height:0;margin:0;padding:0;border:0;border-radius:6px;background:#1b2936;touch-action:none;cursor:ns-resize;accent-color:var(--accent)}
#shell-terminal .terminal-scrollbar::-webkit-slider-runnable-track{width:8px;background:var(--line);border-radius:4px}
#shell-terminal .terminal-scrollbar::-webkit-slider-thumb{appearance:none;width:20px;height:32px;border-radius:6px;background:var(--accent);border:2px solid var(--card);margin-left:-6px}
#shell-terminal .terminal-scrollbar::-moz-range-track{width:8px;background:var(--line);border-radius:4px}
#shell-terminal .terminal-scrollbar::-moz-range-thumb{width:20px;height:32px;border-radius:6px;background:var(--accent);border:2px solid var(--card)}
#shell-terminal .terminal-scrollbar:disabled{opacity:.35;cursor:default}
#shell-terminal.terminal-with-scrollbar .xterm-scrollable-element>.scrollbar.vertical{opacity:0!important;pointer-events:none!important}

.terminal-horizontal-viewport{min-width:0;min-height:0;width:100%;height:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.terminal-surface{min-width:0;min-height:0;overflow:hidden}

/* Mobile controls overlay the desktop without changing its height. */
#remote-mobile-tools{display:none}
#viewer.mobile-session:not(.powershell-active) #remote-controls{display:none}
#viewer.mobile-session #remote-menu{display:flex;align-items:center;justify-content:center;position:absolute;z-index:5;right:max(10px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top));width:44px;height:44px;margin:0;padding:8px;background:#1b2936ed;border-color:#ffffff55;box-shadow:0 2px 10px #0006}
#viewer.mobile-session.controls-open #remote-controls{display:flex;flex-direction:column;gap:8px;position:absolute;z-index:4;right:max(8px,env(safe-area-inset-right));top:62px;width:min(420px,calc(100% - 16px));max-height:calc(100% - 76px);overflow:auto;overscroll-behavior:contain;background:var(--bg);border:1px solid var(--line);border-radius:16px;padding:12px;box-shadow:0 8px 30px #0009}
#viewer.mobile-session #remote-controls #remote-options-panel{max-height:none;overflow:visible;gap:8px}
#viewer.mobile-session #remote-options-panel label{display:flex;align-items:center;gap:8px;min-height:44px}
#viewer.mobile-session #remote-controls .remote-help{display:none}
#viewer.mobile-session #desktop-panel{position:relative}
#viewer.mobile-session:not(.expanded):not(.keyboard-open):not(.powershell-active):not(.controls-open) #remote-mobile-tools{display:flex;position:absolute;z-index:3;bottom:max(10px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);gap:4px;padding:4px;border:1px solid #ffffff33;border-radius:16px;background:#1b2936ed;box-shadow:0 4px 16px #0006;max-width:calc(100% - 20px)}
#remote-mobile-tools button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;margin:0;padding:8px 10px;border-color:transparent;background:transparent;font-size:18px;white-space:nowrap}
#remote-mobile-tools button span{font-size:12px}
#remote-mobile-tools [aria-pressed=true]{background:#68d5c124;color:var(--accent);border-color:var(--accent)}
#viewer.mobile-session:not(.powershell-active){padding:0}
#viewer.mobile-session.powershell-active:not(.expanded):not(.keyboard-open):not(.controls-open) #remote-menu{display:none}
#viewer.mobile-session #remote-controls .session-tabs{flex-wrap:wrap}
@media(max-height:450px){#remote-mobile-tools button span{display:none}#remote-mobile-tools button{min-width:44px}}

/* Reserve the floating menu's footprint in the console action row. */
#viewer.powershell-active:is(.expanded,.keyboard-open) #powershell-panel{padding:0 6px 6px}
#viewer.powershell-active:is(.expanded,.keyboard-open) .shell-toolbar{min-height:54px;padding-right:calc(54px + env(safe-area-inset-right));flex-wrap:wrap}
#viewer.mobile-session.powershell-active.controls-open .shell-toolbar{min-height:54px;padding-right:calc(54px + env(safe-area-inset-right));flex-wrap:wrap}

/* Session menu uses a reachable sheet with distinct navigation and settings. */
.remote-menu-heading{display:none}
.remote-option-group{display:flex;flex-direction:column;align-items:stretch;min-width:0;padding:12px;background:var(--card);border:1px solid var(--line);border-radius:12px;gap:8px}
.remote-option-group h3{display:block;font-size:12px;color:var(--muted);margin:0 0 4px}
.remote-zoom-controls{display:flex;align-items:center;gap:6px}
.remote-video-details{font-size:13px}
.remote-video-details summary{cursor:pointer;padding:10px;color:var(--muted)}
.remote-gesture-help{font-size:13px}
.remote-gesture-help summary{cursor:pointer;padding:10px;color:var(--muted)}
#viewer #remote-controls #remote-options-panel .remote-help{display:block;margin:0;padding:8px;line-height:1.5}
.remote-video-details>div{display:flex;flex-wrap:wrap;gap:8px;padding:8px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open #remote-controls{top:auto;bottom:max(8px,env(safe-area-inset-bottom));right:max(8px,env(safe-area-inset-right));width:min(420px,calc(100% - 16px));max-height:calc(100% - 72px);gap:12px;padding:14px;border-radius:20px;overscroll-behavior:contain}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .remote-menu-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px}
#remote-menu-close{width:44px;height:44px;margin:0;padding:8px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .session-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .session-tabs button{display:flex;flex-direction:column;gap:7px;min-width:0;min-height:68px;margin:0;padding:10px 4px;font-size:12px;white-space:normal}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .session-tabs .button-label{max-width:none;overflow-wrap:anywhere}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .remote-bar{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open #remote-name{grid-column:1/-1;font-size:13px;color:var(--muted)}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open #close-viewer{grid-column:1/-1;background:#ffa09c0c;border-color:#ffa09c44}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open #remote-options-panel{display:flex;flex-direction:column;align-items:stretch;gap:10px;padding:0;max-height:none;overflow:visible}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .remote-option-group{display:flex;flex-direction:column;align-items:stretch;padding:12px;background:var(--card);border:1px solid var(--line);border-radius:12px;gap:8px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .remote-option-group h3{display:block;font-size:12px;color:var(--muted);margin:0 0 4px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .remote-option-group label{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;min-height:44px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .remote-option-group select{min-width:0;max-width:100%;min-height:44px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .remote-zoom-controls{display:grid;grid-template-columns:minmax(0,1fr) 44px 54px 44px;gap:4px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .remote-zoom-controls button{margin:0;min-height:44px;padding:8px;font-size:13px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open #remote-zoom{text-align:center;font-size:12px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .remote-video-details>div{flex-direction:column;font-size:12px}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .remote-bar button[aria-expanded=true]{border-color:var(--accent);color:var(--accent);background:#68d5c114}

/* Use the same settings groups on desktop and in the compact session sheet. */
#remote-options-panel{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));align-items:start;gap:12px}
#remote-options-panel>.remote-video-details,#remote-options-panel>.remote-gesture-help{min-width:0;align-self:start}
#remote-options-panel .remote-option-group>label:not(.trackpad-toggle){display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;min-height:44px}
#remote-options-panel select{min-width:0;max-width:100%}
#viewer #remote-controls #remote-options-panel .trackpad-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;margin:0;padding:8px 0 0;border-top:1px solid var(--line);cursor:pointer;font-size:14px}
#viewer #remote-controls #remote-options-panel #touch-drag{appearance:none;flex:none;min-width:40px;width:40px;height:24px;min-height:24px;margin:0;padding:0;border:1px solid var(--line);border-radius:20px;background:radial-gradient(circle at 11px 50%,var(--muted) 7px,transparent 8px) #101820;cursor:pointer}
#viewer #remote-controls #remote-options-panel #touch-drag:checked{background:radial-gradient(circle at 27px 50%,#102c27 7px,transparent 8px) var(--accent);border-color:var(--accent)}
@media(forced-colors:active){#viewer #remote-controls #remote-options-panel #touch-drag{appearance:auto;width:auto;min-width:0;accent-color:auto}}
/* Remote files use their own scroll area, leaving session navigation available. */
#files-panel{display:flex;flex:1;flex-direction:column;min-height:0;gap:6px;overflow:hidden}
#files-location{flex-wrap:nowrap}#files-location input{min-width:0;flex:1;width:0;font-size:16px}
#files-list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:8px}
.file-row{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line);padding:0 8px}
.file-name{text-align:left;flex:1;min-width:0;overflow-wrap:anywhere;background:transparent;border:0;margin:0;padding:12px 4px;min-height:44px}
.file-row span{flex:none;font-size:12px;color:var(--muted)}#files-status{margin:4px 0;font-size:13px;overflow-wrap:anywhere}
#files-panel button{margin:0}.files-toolbar{gap:6px}.files-toolbar button{padding:8px;min-height:40px}
#viewer.files-active #video-status,#viewer.files-active .remote-help,#viewer.files-active #remote-mobile-tools{display:none}
#viewer.files-active:is(.expanded,.keyboard-open) #files-panel{padding:54px 8px 8px}
#viewer.mobile-session.files-active{padding:8px}
#viewer.mobile-session.files-active:not(.controls-open) #remote-controls{display:none}
#viewer:is(.mobile-session,.expanded,.keyboard-open).controls-open .session-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:600px){#files-panel .files-toolbar{padding-right:48px}.file-row{gap:4px}#files-panel .toolbar button{font-size:13px}}
#viewer:is(.mobile-session,.expanded,.keyboard-open).files-active #files-location{padding-right:calc(54px + env(safe-area-inset-right))}

.session-tabs button{min-height:44px}

/* Shared workspace treatment: neutral surfaces and a single connection accent. */
:root{--bg:#171c1e;--card:#252d30;--line:#445459;--text:#f1f5f5;--muted:#bdcacc;--accent:#79d2c2}
main,header{max-width:1440px}
header{border-bottom:1px solid var(--line)}
header h1{font-size:22px;font-weight:600;margin:0}
header .badge{margin-left:8px;font-size:12px;font-weight:400}
.login{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:24px}
.login h2{margin-top:0;font-size:20px;font-weight:600}
.cards,#files-list{border-radius:12px}
.card{background:var(--card)}
.card:hover{background:#303b3e}
.contact-connect:hover{background:#ffffff0b}
button:hover{background:#344247}
button:active{background:#405156}
#enter,#desktop,#run,#remote-type,#gate button{color:#102d29}
.session-tabs [aria-selected=true]{background:#79d2c214;box-shadow:inset 0 -2px var(--accent)}
#viewer:is(.expanded,.keyboard-open) #remote-menu,
#viewer.mobile-session #remote-menu,
#viewer.mobile-session:not(.expanded):not(.keyboard-open):not(.powershell-active):not(.controls-open) #remote-mobile-tools{background:#252d30ed}
@media(max-width:600px){.login{margin:24px auto;padding:20px}header h1{font-size:18px}}
