:root { color-scheme:dark; --bg:#080e18; --panel:#101a2a; --panel2:#111e30; --border:#263449; --text:#f0f5ff; --muted:#889bb4; --mint:#45e4b6; --mint-bg:#122f2c; --font:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
*{box-sizing:border-box} html,body{margin:0;min-height:100%;font-family:var(--font);background:var(--bg);color:var(--text)}
body{background-image:radial-gradient(ellipse 70vw 40vw at 95% -10%,rgba(25,83,107,.16),transparent 75%)}
button,input{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,a:focus-visible{outline:2px solid var(--mint);outline-offset:3px}a{color:inherit;text-decoration:none}[hidden]{display:none!important}
.login-screen{display:grid;place-items:center;min-height:100vh;min-height:100dvh;padding:22px}
.login-card{width:min(100%,430px);padding:38px;border:1px solid var(--border);border-radius:22px;background:linear-gradient(160deg,#132034,#0e1725 80%);box-shadow:0 24px 80px rgba(0,0,0,.35)}
.brand-icon,.mark{color:var(--mint);background:#183c39;border:1px solid #27665a;display:grid;place-items:center;font-size:28px;font-weight:800}.brand-icon{width:58px;height:58px;border-radius:17px;margin-bottom:27px}.mark{width:42px;height:42px;border-radius:12px;font-size:23px}
.eyebrow{margin:0 0 10px;color:var(--mint);font-size:11px;font-weight:800;letter-spacing:2px}.login-card h1,.intro h1{font-size:clamp(29px,4vw,43px);letter-spacing:-1.3px;line-height:1.12;margin:0}.lead{color:var(--muted);font-size:14px;line-height:1.65;margin:16px 0 24px}
.login-card label{display:block;margin:16px 0 8px;font-size:13px;font-weight:650}.login-card input{width:100%;background:#0b1522;border:1px solid #354259;color:var(--text);border-radius:11px;height:49px;padding:0 15px}.login-card input:focus{border-color:var(--mint);outline:none;box-shadow:0 0 0 3px #45e4b61c}.error{background:#51262d;color:#ffc3cb;padding:12px;border-radius:9px;font-size:13px}
.primary{color:#05221b;background:var(--mint);border:0;border-radius:10px;padding:14px 20px;font-weight:800}.wide{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;margin-top:28px}.primary:hover{background:#78f2d0}.footnote{text-align:center;margin:25px 0 0;font-size:12px;color:var(--muted)}
.header{height:75px;padding:0 clamp(20px,4vw,58px);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;background:rgba(9,17,27,.95)}
.headbrand{display:flex;align-items:center;gap:12px}.headbrand strong{display:block;font-size:17px;letter-spacing:-.3px}.headbrand small{display:block;margin-top:4px;color:var(--muted);font-size:9px;letter-spacing:1.6px;font-weight:700}.header-actions{display:flex;align-items:center;gap:24px}.encrypted{color:var(--mint);font-size:12px}.ghost{border:0;background:transparent;color:var(--text);padding:11px 4px;font-size:13px}.ghost:hover{color:var(--mint)}
.main{max-width:1400px;margin:auto;padding:43px clamp(20px,4vw,58px) 65px}.intro{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:29px}.intro h1 em{font-style:normal;color:var(--mint)}.intro .lead{margin-bottom:0}.outline{display:inline-block;color:var(--text);background:#121e2d;border:1px solid #354760;border-radius:10px;padding:11px 16px;font-size:13px;font-weight:650;white-space:nowrap}.outline:hover{border-color:var(--mint);color:var(--mint)}
.stat-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:28px 0 36px}.stat-strip>div{border:1px solid var(--border);background:#101a2a;border-radius:13px;padding:18px 23px;display:flex;flex-direction:column;gap:7px}.stat-strip b{font-size:20px;letter-spacing:-.3px}.stat-strip span{font-size:12px;color:var(--muted)}
.section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:15px;gap:12px}.section-heading h2{font-size:17px;margin:0}.small-muted,.muted{color:var(--muted);font-size:12px;line-height:1.65}
.device-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.device-card{display:flex;align-items:center;gap:23px;min-width:0;min-height:230px;padding:23px;background:linear-gradient(145deg,#142237,#0f1928);border:1px solid #293b54;border-radius:16px;color:var(--text);text-align:left;transition:transform .15s,border-color .15s,box-shadow .15s}.device-card:hover{transform:translateY(-3px);border-color:#3b9a8d;box-shadow:0 15px 45px #0005}.device-info{min-width:0;display:flex;flex-direction:column;align-items:flex-start}.device-info h3{font-size:17px;margin:0 0 8px}.device-info p{margin:0 0 18px;color:var(--muted);font-size:12px}.device-status{font-size:11px;padding:7px 10px;border-radius:100px}.available{color:#79efd1;background:#163b35}.unavailable{color:#ffbf76;background:#37291d}.card-action{margin-top:24px;font-size:12px;color:var(--mint);font-weight:750}
.phone-art{width:89px;height:180px;flex:none;border:5px solid #32435e;border-radius:20px;background:#0a111d;padding:6px 5px 8px;box-shadow:7px 11px 23px #0005;position:relative}.phone-camera{position:absolute;top:8px;left:50%;transform:translateX(-50%);width:31px;height:6px;border-radius:0 0 5px 5px;background:#202c44;z-index:2}.phone-surface{height:100%;width:100%;border-radius:9px;background:linear-gradient(160deg,#367ba1,#143e61 55%,#0b2337);position:relative;overflow:hidden}.phone-surface:before{content:"";position:absolute;left:-20px;top:55px;width:110px;height:70px;border-radius:70%;transform:rotate(-35deg);background:linear-gradient(90deg,#45dcc288,#42abde00)}.phone-clock{position:absolute;left:9px;top:19px;color:white;font-size:12px;font-weight:750}.phone-symbol{position:absolute;font-size:54px;color:#b7fce674;left:20px;top:52px}.phone-dock{position:absolute;left:8px;right:8px;bottom:12px;display:flex;justify-content:space-between}.phone-dock i{width:11px;height:11px;background:#dcefff9f;border-radius:4px}.phone-home{position:absolute;bottom:5px;left:33px;width:22px;height:3px;background:#ccd5e2;border-radius:2px}
.help{padding:18px;margin-top:28px;border:1px solid #284354;background:#10202c;border-radius:11px;color:#b0c4d9;font-size:12px;line-height:1.65}.help b{color:var(--mint)}
.viewer{padding:16px clamp(16px,3vw,40px) 30px;max-width:1600px;margin:auto}.viewer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;border-bottom:1px solid var(--border);padding:0 2px 16px}.viewer-toolbar>div{display:flex;align-items:center;gap:24px}.viewer-toolbar strong{font-size:18px}.viewer-tools{gap:9px!important}.viewer-body{display:grid;grid-template-columns:minmax(0,1fr) 260px;align-items:start;gap:20px;margin-top:18px}.viewer-shell{display:flex;flex-direction:column;align-items:center;min-height:min(750px,75vh);border:1px solid var(--border);background:#050a11;border-radius:15px;padding:10px;overflow:hidden}.viewer-notice{color:var(--muted);font-size:12px;padding:8px;text-align:center}.viewer-shell iframe{border:0;width:100%;height:min(760px,78vh);min-height:420px;background:#050a11;border-radius:8px}.viewer-shell:fullscreen{height:100%;border-radius:0}.viewer-shell:fullscreen iframe{flex:1;height:calc(100vh - 50px)}.viewer-aside{padding:22px;background:var(--panel);border:1px solid var(--border);border-radius:14px}.viewer-aside h3{margin:0 0 12px;font-size:18px}.viewer-aside p{color:var(--muted);line-height:1.65;font-size:12px}.viewer-aside a{margin-top:8px}
@media(max-width:1050px){.device-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.viewer-body{grid-template-columns:1fr}.viewer-aside{display:none}}
@media(max-width:640px){.header{height:68px;padding:0 17px}.header-actions .encrypted{display:none}.main{padding:27px 17px 45px}.intro{display:block}.intro .outline{margin-top:18px}.stat-strip{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.stat-strip>div{padding:13px}.stat-strip b{font-size:17px}.device-grid{grid-template-columns:1fr}.device-card{min-height:200px}.section-heading{align-items:flex-start;flex-direction:column}.viewer{padding:8px}.viewer-toolbar{align-items:flex-start}.viewer-toolbar>div{gap:10px}.viewer-tools{flex-direction:column}.viewer-tools .outline{padding:7px 10px;font-size:11px}.viewer-shell iframe{height:74vh;min-height:400px}.login-card{padding:28px 23px}}

.stream-diagnostics {border:1px solid #446a79; border-radius:10px; padding:10px 13px; color:#cee5f1;background:#112533;font-size:12px;line-height:1.5;width:100%;max-width:720px;margin:5px auto 12px;} .stream-diagnostics.warning {border-color:#a87934;color:#ffe0a8;background:#302316;}

/* V6: phone-first immersive controls, keeping the existing six-phone grid. */
.viewer-body{display:block;margin:12px auto 0;max-width:1120px}
.viewer-shell{position:relative;width:100%;height:min(86dvh,940px);min-height:480px;padding:0;display:block;overflow:hidden;border-radius:14px;background:#000}
.viewer-shell iframe{display:block;width:100%;height:100%;min-height:0;max-height:none;border:0;border-radius:0;background:#000}
.immersive-back{position:absolute;z-index:500;top:calc(env(safe-area-inset-top, 0px) + 7px);left:calc(env(safe-area-inset-left, 0px) + 7px);width:38px;height:38px;border:1px solid #ffffff24;border-radius:20px;color:#fff;background:#0008;font-size:30px;line-height:28px;opacity:.38;transition:opacity .2s;touch-action:manipulation}
.immersive-back:focus,.immersive-back:hover,.immersive-back:active{opacity:1}
.viewer-shell:fullscreen,.viewer-shell:-webkit-full-screen{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;min-height:0!important;max-height:none!important;border:0!important;border-radius:0!important;margin:0!important;padding:0!important;background:#000}
.viewer-shell:fullscreen iframe,.viewer-shell:-webkit-full-screen iframe{height:100dvh!important;width:100vw!important;min-height:0!important;max-height:none!important;display:block}
.viewer-shell:fullscreen .stream-diagnostics,.viewer-shell:-webkit-full-screen .stream-diagnostics{display:none}
@media (max-width: 680px){
  body.device-active{height:100dvh;overflow:hidden}
  body.device-active .header{display:none}
  .viewer{padding:0!important;width:100vw;max-width:none;height:100dvh;overflow:hidden}
  .viewer-toolbar{position:absolute;z-index:100;left:48px;right:5px;top:calc(env(safe-area-inset-top,0px) + 3px);padding:0;border:0;background:transparent;pointer-events:none}
  .viewer-toolbar>div:first-child{display:none}
  .viewer-tools{display:none!important}
  .viewer-body{margin:0;height:100dvh;max-width:none}
  .viewer-shell{height:100dvh;width:100vw;min-height:0;border:0;border-radius:0}
  .viewer-shell iframe{height:100dvh!important;min-height:0!important}
  .immersive-back{opacity:.24}
}

/* V8: pantalla completamente inmersiva con pestaña superior centrada.
   Eliminar botón circular de volver, conservar input táctil/video. */
body.device-active { overflow: hidden; }
body.device-active .header { display:none!important; }
.viewer.viewer-v8{position:fixed;inset:0;z-index:3000;width:100vw;height:100dvh;max-width:none;margin:0!important;padding:0!important;background:#000;overflow:hidden}
.viewer-v8 .viewer-body{position:absolute;inset:0;margin:0!important;width:100%;height:100%!important;max-width:none!important}
.viewer-v8 .viewer-shell{position:absolute;inset:0;width:100%;height:100%!important;min-height:0;max-height:none;border:0;border-radius:0;padding:0!important;display:block;background:black}
.viewer-v8 .viewer-shell iframe{width:100%;height:100%!important;max-height:none;min-height:0;border:0;display:block}
.immersive-back{display:none!important}
.viewer-v8 .controls-tab{position:absolute;z-index:510;top:env(safe-area-inset-top, 0px);left:50%;transform:translateX(-50%);width:70px;height:24px;display:flex;align-items:center;justify-content:center;gap:7px;color:#fff;background:rgba(14,22,32,.85);border:1px solid #64748b66;border-top:0;border-radius:0 0 13px 13px;box-shadow:0 4px 16px #0008;cursor:pointer;touch-action:manipulation;opacity:.7}
.viewer-v8 .controls-tab:hover,.viewer-v8 .controls-tab:focus-visible,.viewer-v8 .controls-tab.expanded{opacity:1}
.viewer-v8 .controls-tab-grip{width:18px;height:3px;border-radius:2px;background:#8ef0d1}
.viewer-v8 .controls-tab-chevron{font-size:17px;line-height:1;transition:transform .2s}
.viewer-v8 .controls-tab.expanded .controls-tab-chevron{transform:rotate(180deg)}
.viewer-v8 .floating-controls{position:absolute;z-index:509;top:calc(env(safe-area-inset-top, 0px) + 25px);left:50%;transform:translateX(-50%);width:min(94vw,630px);background:rgba(11,19,31,.96);backdrop-filter:blur(14px);border:1px solid #51607a;border-radius:0 0 16px 16px;padding:18px 15px 11px;box-shadow:0 18px 35px #000a;color:#f1f5f9}
.viewer-v8 .floating-heading{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:12px}
.viewer-v8 .floating-heading strong{font-size:15px}
.viewer-v8 .floating-heading span{color:#a4aec0;font-size:9px;letter-spacing:1.7px}
.viewer-v8 .floating-actions{display:flex;flex-wrap:wrap;gap:8px}
.viewer-v8 .floating-action{flex:1 1 125px;white-space:nowrap;border:1px solid #3c4e63;border-radius:9px;background:#182b3c;color:#f2f8fb;font-size:12px;font-weight:650;padding:11px 10px}
.viewer-v8 .floating-action:hover{border-color:#7ef2d4;color:#7ef2d4}
.viewer-v8 .floating-tip{color:#889db2;font-size:10px;margin:10px 0 0}
.viewer-v8 .stream-diagnostics{margin:10px 0 0;max-width:none}
.viewer-v8 .viewer-shell:fullscreen,.viewer-v8 .viewer-shell:-webkit-full-screen{border:0!important;inset:0!important;height:100dvh!important;width:100vw!important}
@media(max-width:680px){.viewer-v8 .floating-controls{width:min(96vw,520px);padding:16px 10px 10px}.viewer-v8 .floating-action{flex-basis:calc(50% - 5px)}.viewer-v8 .viewer-shell iframe{height:100dvh!important}.viewer-v8 .controls-tab{width:74px;height:29px}.viewer-v8 .floating-controls{top:calc(env(safe-area-inset-top, 0px) + 30px)}}

/* V9: pestaña solo esquina superior DERECHA; sin banda lateral del portal */
.viewer-v8 .controls-tab{left:auto!important;right:calc(env(safe-area-inset-right, 0px) + 6px)!important;transform:none!important;top:calc(env(safe-area-inset-top, 0px) + 5px)!important;width:35px!important;height:30px!important;border-radius:10px!important;border:1px solid rgba(129,158,176,.38)!important;background:rgba(9,18,28,.75)!important;box-shadow:0 2px 10px #0005!important;opacity:.38!important;z-index:99999!important}
.viewer-v8 .controls-tab:hover,.viewer-v8 .controls-tab:focus-visible,.viewer-v8 .controls-tab.expanded{opacity:.95!important}
.viewer-v8 .controls-tab-grip{width:12px!important;height:2px!important}
.viewer-v8 .controls-tab-chevron{font-size:14px!important}
.viewer-v8 .floating-controls{left:auto!important;right:calc(env(safe-area-inset-right, 0px) + 6px)!important;transform:none!important;top:calc(env(safe-area-inset-top, 0px) + 37px)!important;width:min(90vw,350px)!important;max-height:calc(100dvh - 52px);overflow:auto!important;border-radius:12px!important;z-index:99998!important}
.viewer-v8 .floating-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
.viewer-v8 .floating-action{min-width:0!important;flex:none!important}
.viewer-v8 .viewer-body,.viewer-v8 .viewer-shell,.viewer-v8 .viewer-shell iframe{width:100%!important;height:100%!important;margin:0!important;padding:0!important;border:0!important}
body.device-active .viewer-v8 .viewer-shell{display:block!important}
@media(max-width:680px){.viewer-v8 .controls-tab{width:32px!important;height:28px!important;right:calc(env(safe-area-inset-right, 0px) + 4px)!important}.viewer-v8 .floating-controls{right:4px!important;width:min(92vw,330px)!important}}
