*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#303030;color:#fff;font-family:-apple-system,BlinkMacSystemFont,sans-serif}button{font:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}#remote{position:fixed;inset:0;overscroll-behavior:none;user-select:none;-webkit-user-select:none}#view-toggle{position:absolute;z-index:5;left:50%;top:max(5.2%,env(safe-area-inset-top));transform:translateX(-50%);width:70px;height:39px;border-radius:30px;border:1px solid #d1d1d1;background:#fff;padding:2px;box-shadow:inset 0 1px 3px #0002;cursor:pointer}#view-toggle span{display:block;height:33px;width:33px;border:1px solid #ddd;border-radius:50%;background:#fff;box-shadow:0 2px 4px #0004;transition:transform .16s}#view-toggle[aria-checked=true] span{transform:translateX(30px)}#touchpad{position:absolute;inset:0;touch-action:none}#touchpad .remote-logo{position:fixed;left:50%;top:46%;transform:translate(-50%,-50%);width:min(40vw,40vh);height:min(40vw,40vh);object-fit:contain;filter:brightness(0);opacity:.25;pointer-events:none}#mouse-buttons{position:absolute;inset:76% 0 0;display:flex}#mouse-buttons button{width:50%;background:transparent;border:0;color:transparent;outline-offset:-5px}#mouse-buttons button:active{background:transparent}#keyboard{display:none;position:absolute;inset:19% 5% 7%}body.keyboard-view #keyboard{display:flex;flex-direction:column;justify-content:center;gap:7px}body.keyboard-view #touchpad,body.keyboard-view #mouse-buttons{display:none}.key-row{display:flex;justify-content:center;gap:7px}.key-row button{border:0;border-radius:8px;padding:10px 6px;background:#505050;color:#fff;min-width:6%;flex:0 1 8%;font-size:clamp(16px,3.3vh,27px);box-shadow:0 2px 0 #1e1e1e}.key-row button:active{background:#777}.key-row #space{flex-basis:40%;font-size:14px}.key-row.auxiliary{margin-top:3px}.key-row.auxiliary button{font-size:12px;flex-basis:10%;padding:7px}.key-row #native-keyboard{flex-basis:24%}#letters{display:flex;flex-direction:column;gap:7px}#native-input{background:#3a3a3a;border:1px solid #555;border-radius:8px;resize:none;color:#fff;padding:8px;font:16px sans-serif;width:100%;height:34px;min-height:34px}#connection{position:absolute;bottom:1.4%;left:50%;transform:translateX(-50%);font-size:10px;color:#aaa;margin:0;white-space:nowrap;pointer-events:none}#connect-cover{position:fixed;z-index:20;inset:0;background:#303030;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:35px;text-align:center}#connect-cover[hidden]{display:none}#connect-cover img{width:95px;filter:brightness(0);opacity:.35}#connect-cover h1{font-size:26px;letter-spacing:-1px}#connect-cover p{max-width:420px;font-size:14px;line-height:1.6;color:#ddd}#connect-cover button{background:white;color:#303030;border:0;border-radius:24px;padding:13px 26px;font-weight:600}#connect-cover small{margin-top:22px;color:#aaa;font-size:11px}button:focus-visible{outline:2px solid #fff}@media(orientation:portrait){#keyboard{inset:22% 3% 12%}.key-row{gap:4px}.key-row button{flex-basis:9%;min-width:0;font-size:21px;padding:14px 4px}.key-row.auxiliary button{flex-basis:15%}#touchpad .remote-logo{width:54vw;height:54vw}}

body.native-keyboard-open #letters,body.native-keyboard-open .key-row{display:none}body.native-keyboard-open #keyboard{justify-content:flex-start}

body[data-remote-connection=direct] #connection,body[data-remote-connection=relay] #connection{opacity:0}

/* Reference geometry scales with the phone's landscape height; the invisible
   button remains at least 44 px high while the white pill matches the artwork. */
#view-toggle{top:max(calc(7.41vh - 22px),env(safe-area-inset-top));height:44px;background:transparent;border:0;box-shadow:none;padding:0}
#view-toggle::before{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:clamp(34px,7.94vh,70px);height:clamp(19px,4.42vh,39px);background:#fff;border:1px solid #d1d1d1;border-radius:30px;box-shadow:inset 0 1px 3px #0002}
#view-toggle span{position:absolute;left:calc(50% - clamp(17px,3.97vh,35px) + clamp(1px,.22vh,2px));top:50%;transform:translateY(-50%);width:clamp(16px,3.74vh,33px);height:clamp(16px,3.74vh,33px)}
#view-toggle[aria-checked=true] span{transform:translate(clamp(14px,3.4vh,30px),-50%)}

#connect-cover{overflow-y:auto}#connect-cover button{margin:5px}#nearby-list{max-width:440px;width:100%;display:grid;gap:6px}#nearby-list button{width:100%;border-radius:12px}#install-help{font-size:11px!important;max-width:400px}#install-remote{background:#444!important;color:#fff!important}#remote{height:auto;min-height:100dvh}

#remote-devices{position:absolute;z-index:6;top:max(18px,env(safe-area-inset-top));right:18px;border:1px solid #ffffff30;border-radius:20px;background:#404040;color:#ddd;padding:8px 14px;font-size:12px}#pair-code-form{display:grid;gap:10px;max-width:300px;margin:10px}#pair-code-form[hidden]{display:none}#pair-code-form label{display:grid;gap:6px;font-size:13px}#tv-code{font:26px system-ui;text-align:center;letter-spacing:.18em;border:1px solid #888;background:#242424;color:white;border-radius:12px;padding:10px;width:100%}#forget-remote{font-size:11px;background:transparent!important;color:#aaa!important;padding:8px!important}#connect-cover{justify-content:flex-start;padding-top:max(24px,env(safe-area-inset-top))}#connect-cover img{width:65px}#connect-cover h1{margin:10px 0}

[hidden]{display:none!important}
#tv-picker{position:fixed;inset:0;z-index:60;overflow:auto;display:flex;flex-direction:column;align-items:center;background:#303030;color:#fff;padding:max(24px,env(safe-area-inset-top)) 35px max(30px,env(safe-area-inset-bottom));font:inherit;text-align:center}
#tv-picker::before{content:"";display:block;flex-shrink:0;width:65px;height:65px;margin:0 0 10px;background:url('/assets/bleumr/logo-mark.png') center/contain no-repeat;filter:brightness(0);opacity:.35}
#tv-picker header{width:100%;max-width:440px}#tv-picker h2{font-size:26px;letter-spacing:-1px;margin:10px 0}#tv-picker h3{max-width:440px;width:100%;font-size:14px;font-weight:600;margin:20px 0 8px;color:#ddd}
#tv-picker p{max-width:420px;font-size:14px;line-height:1.6;color:#ddd;margin:10px 0}#tv-picker [data-saved-tvs],#tv-picker [data-new-tvs]{width:100%;max-width:440px;font-size:14px;color:#aaa}
#tv-picker button{font:inherit;min-height:44px;background:#fff;color:#303030;border:0;border-radius:24px;padding:13px 26px;font-weight:600;margin:5px;max-width:440px;cursor:pointer}
#tv-picker [data-saved-tvs] button,#tv-picker [data-new-tvs] button{display:block;width:100%;margin:6px 0;border-radius:12px}
#tv-picker button[data-picker-done]{position:fixed;top:max(18px,env(safe-area-inset-top));right:18px;z-index:2;min-height:36px;border:1px solid #ffffff30;border-radius:20px;background:#404040;color:#ddd;padding:8px 14px;font-size:12px;font-weight:400}
#tv-picker button[data-picker-refresh]{background:#444;color:#fff}#tv-picker button[aria-label="Forget TVs on this phone"]{background:transparent;color:#aaa;font-size:11px;font-weight:400;padding:8px}
#tv-picker label{display:block;max-width:420px;width:100%;font-size:13px;color:#ddd;margin:20px 0 10px}#tv-picker select{background:#242424;color:#fff;border:1px solid #888;border-radius:12px;font:inherit;font-size:14px;padding:10px;min-height:44px;margin:8px}
#tv-picker small{display:block;max-width:400px;font-size:11px;line-height:1.6;color:#aaa;margin:10px auto}
#touchpad{-webkit-touch-callout:none;user-select:none;-webkit-user-select:none}#mouse-buttons button:active{background:transparent}#remote-confirm{position:fixed;z-index:40;left:50%;top:42%;transform:translate(-50%,-50%);width:min(420px,92vw);background:#1c1c1e;color:#fff;border-radius:18px;padding:18px 16px 14px;box-shadow:0 18px 50px #0008}#remote-confirm h2{margin:0 0 8px;font-size:18px}#remote-confirm p{margin:0 0 14px;color:#ddd;font-size:14px;line-height:1.4}#remote-confirm [data-actions]{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}#remote-confirm button{min-height:44px;padding:8px 16px;border-radius:12px;background:#fff;color:#111}
body[data-connected=false] #touchpad,body[data-connected=false] #mouse-buttons,body[data-connected=false] #keyboard{pointer-events:none;opacity:.45}
/* Landscape-only controls, including the initial pairing UI. This fallback works
   even on browsers that ignore manifest orientation or cannot lock the screen. */
#rotate-remote{display:none;position:fixed;inset:0;z-index:100;overflow:auto;flex-direction:column;align-items:center;justify-content:center;padding:max(35px,env(safe-area-inset-top)) 30px;background:#303030;color:white;text-align:center}
#rotate-remote img{width:95px;filter:brightness(0);opacity:.35}#rotate-remote h1{font-size:26px;letter-spacing:-1px;margin:20px 0 10px}#rotate-remote p{max-width:360px;font-size:14px;line-height:1.6;color:#ddd}#rotate-remote button{background:white;color:#303030;border:0;border-radius:24px;padding:13px 26px;min-height:44px;font-weight:600}#rotate-remote small{max-width:360px;font-size:11px;line-height:1.6;color:#aaa;margin-top:18px}
@media(orientation:portrait){#rotate-remote{display:flex}#remote,#connect-cover,#tv-picker{visibility:hidden!important;pointer-events:none!important}}

#touchpad .remote-logo,#pad-app{z-index:3}
#pad-app{position:absolute;left:12px;right:12px;bottom:32px;margin:0;text-align:center;font-size:12px;letter-spacing:.04em;color:#ffffff38;pointer-events:none}
#remote-panel,#remote-slider{position:fixed;z-index:18;inset:0;background:#303030;color:#fff;display:flex;flex-direction:column;justify-content:center;gap:10px;padding:max(16px,env(safe-area-inset-top)) 8% max(16px,env(safe-area-inset-bottom));touch-action:manipulation}
#remote-slider{z-index:19}
#remote-panel header,#remote-slider header{display:flex;align-items:center;justify-content:space-between;gap:12px}
#remote-panel header strong,#remote-slider header strong{font-size:13px;font-weight:500;letter-spacing:.06em;color:#ffffff66}
#remote-panel header button,#remote-slider header button{border:0;background:transparent;color:#ffffff88;font-size:13px;min-height:44px;padding:8px 4px}
#remote-panel-status{margin:0;font-size:12px;color:#ffffff40}
#remote-panel-actions{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}
#remote-panel-actions button{text-align:left;background:transparent;color:#ffffffd0;border:0;border-bottom:1px solid #ffffff14;min-height:44px;padding:8px 0;font-size:14px}
#remote-panel label,#remote-slider label{display:grid;gap:4px;font-size:12px;color:#ffffff55}
#remote-panel input[type=range],#remote-slider input[type=range]{width:100%;accent-color:#fff;height:28px}
#remote-slider-percent,#remote-bright-out,#remote-volume-out{color:#ffffff55}
#remote-slider-percent{margin:0;text-align:center;font-size:42px;font-weight:500;letter-spacing:-.03em}
#remote-sound{position:absolute;z-index:6;top:max(6px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));height:28px;min-height:28px;padding:0 10px;border:1px solid #ffffff30;border-radius:16px;background:#404040;color:#ddd;font-size:11px}
#window-adjust{position:fixed;z-index:15;inset:0;background:#171a20f2;padding:calc(14px + env(safe-area-inset-top)) 18px 18px;display:flex;flex-direction:column;touch-action:none;user-select:none}#window-adjust[hidden]{display:none}#window-adjust header{display:flex;align-items:center;justify-content:space-between;gap:12px}#window-adjust header div{display:grid;gap:4px}#window-adjust header strong{font-size:18px}#window-adjust small{color:#b8c4d8;font-size:12px}#window-adjust header button{border:0;border-radius:12px;background:#345f9d;color:#fff;padding:11px 17px;font-weight:700}#window-adjust p{font-size:13px;color:#c3cce0;margin:13px 0}#adjust-canvas{position:relative;flex:1;min-height:120px;border-radius:16px;background:linear-gradient(135deg,#202938,#10141b);border:1px solid #ffffff22;overflow:hidden;touch-action:none}#adjust-frame{position:absolute;border:2px solid #258bff;background:#258bff1c;border-radius:9px;min-width:80px;min-height:60px;touch-action:none}#adjust-frame i{position:absolute;display:block;background:#228bff;border:2px solid white;border-radius:9px;width:18px;height:18px;touch-action:none;z-index:2}#adjust-frame [data-edge=n]{top:-1px;left:50%;transform:translateX(-50%);width:40px}#adjust-frame [data-edge=s]{bottom:-1px;left:50%;transform:translateX(-50%);width:40px}#adjust-frame [data-edge=e]{right:-1px;top:50%;transform:translateY(-50%);height:40px}#adjust-frame [data-edge=w]{left:-1px;top:50%;transform:translateY(-50%);height:40px}#adjust-frame [data-edge=nw]{left:-1px;top:-1px}#adjust-frame [data-edge=ne]{right:-1px;top:-1px}#adjust-frame [data-edge=sw]{left:-1px;bottom:-1px}#adjust-frame [data-edge=se]{right:-1px;bottom:-1px}

/* Keep slider gestures on the touched control instead of scrolling the panel. */
#remote-panel input[type=range],#remote-slider input[type=range]{touch-action:none;min-height:44px;margin:0;position:relative;z-index:1}
#remote-panel label{position:relative;gap:5px}
#remote-panel{overflow-y:auto;justify-content:flex-start;justify-content:safe center;overscroll-behavior:contain}
#remote-panel label{grid-template-columns:1fr auto;align-items:center}
#remote-panel label input[type=range]{grid-column:1 / -1}
