body:has(.remote-dialog[open]){overflow:hidden}
.remote-dialog{width:100dvw;height:100dvh}
.remote-shell{height:100dvh;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;background:#050709}
.remote-commandbar{min-height:68px;padding:9px 14px!important;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #293038!important;background:#11161b!important;box-shadow:none;z-index:3}
.remote-identity,.remote-actions{display:flex;align-items:center;gap:11px;min-width:0}
.remote-identity>div{min-width:0}
.remote-identity strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;letter-spacing:.01em}
.remote-identity small{display:block;margin-top:3px;color:#86a1af!important;font-size:11px}
.remote-link-badge{padding:5px 8px;border:1px solid #3b4650;border-radius:6px;background:#1a2026;color:#9ba8b2;font-size:8px;font-weight:800;letter-spacing:.08em;white-space:nowrap}
.remote-link-badge.connected{border-color:#3e6859;background:#17261f;color:#9bcab8}
.remote-actions{justify-content:flex-end;flex-wrap:wrap}
.account-switcher{display:grid;grid-template-columns:auto minmax(130px,190px);align-items:center;gap:7px;margin:0;color:#7f8d98;font-size:9px;font-weight:700;letter-spacing:.04em}
.account-switcher select{height:36px;min-width:0;padding:0 28px 0 10px;border:1px solid #3a444d;border-radius:8px;background:#1a2026;color:#e0e5e9;font-size:11px;font-weight:700;outline:none}
.account-switcher select:focus{border-color:#6689a0;box-shadow:0 0 0 3px rgba(90,126,149,.16)}
.account-switcher select:disabled{opacity:.62}
.farm-switch{display:flex;align-items:center;gap:8px;margin:0;padding:9px 11px!important;border:1px solid #274654;border-radius:10px;background:#07131c;color:#c0d4df;font-size:12px;white-space:nowrap}
.farm-control{display:grid;gap:3px;min-width:150px}
.farm-control .farm-switch{justify-content:center}
.farm-control small{display:block;max-width:190px;color:#d6a75d;font-size:8px;font-weight:750;line-height:1.2;text-align:center;white-space:normal}
.farm-control small.ready{color:#62e9ad}
.farm-switch:has(input:disabled){cursor:wait;opacity:.58}
.view-modes{display:inline-flex;align-items:center;padding:3px;border:1px solid #294654;border-radius:10px;background:#050e15}
.view-mode{padding:7px 10px;border-radius:7px;background:transparent;color:#7796a7;font-size:11px;font-weight:800}
.view-mode:hover{color:#d8f1fc}
.view-mode.active{background:#14384b;color:#6edaff;box-shadow:inset 0 0 0 1px #286079}
.quality-toggle{display:grid;grid-template-columns:1fr;gap:1px;min-width:104px;padding:6px 10px!important;text-align:left}
.quality-toggle span{color:#73828e;font-size:8px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.quality-toggle strong{color:#c7d0d6;font-size:10px}
.quality-toggle.active{border-color:#617d90!important;background:#202b33!important}
.quality-toggle.active strong{color:#e5f1f7}
.remote-commandbar .ghost{padding:9px 11px;font-size:11px;white-space:nowrap}
.remote-close-button{min-width:38px;padding:7px 12px!important;font-size:20px!important;line-height:1}
.remote-progress{display:grid;grid-template-columns:minmax(330px,1.55fr) repeat(3,minmax(180px,.72fr));align-items:stretch;gap:9px;padding:10px 14px 12px;border-bottom:1px solid #25333c;background:linear-gradient(180deg,#0e151a,#0a1014);color:#d7e0e5;z-index:2}
.remote-progress-main{display:flex;align-items:flex-start;gap:11px;min-width:0;padding:6px 8px 4px}.remote-progress-main>span{width:10px;height:10px;margin-top:22px;flex:none;border-radius:50%;background:#57c8f4;box-shadow:0 0 0 4px rgba(87,200,244,.09);animation:progress-pulse 1.4s ease-in-out infinite}.remote-progress-main>span.success{background:#42e9a6;box-shadow:0 0 0 4px rgba(66,233,166,.1);animation:none}.remote-progress-main>span.warning{background:#ffcc68;box-shadow:0 0 0 4px rgba(255,204,104,.1);animation:none}.remote-progress-copy{min-width:0;flex:1}.remote-progress-kicker{display:block;color:#5fa9c8;font-size:8px;font-weight:900;letter-spacing:.13em}.remote-progress-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-top:3px}.remote-progress-heading b{min-width:0;color:#f0f6f8;font-size:15px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.remote-progress-heading strong{flex:none;color:#8dd8f5;font-size:10px}.remote-progress-main small{display:block;margin-top:3px;color:#91a7b2;font-size:11px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.remote-progress-main em{display:block;margin-top:4px;color:#d4e1e7;font-size:10px;font-style:normal;font-weight:700;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.remote-progress-fact{min-width:0;padding:10px 11px;border:1px solid #243640;border-radius:9px;background:#101a20}.remote-progress-fact.farm{border-color:#285847;background:#10221c}.remote-progress-fact small,.remote-progress-fact b,.remote-progress-fact span{display:block}.remote-progress-fact small{color:#6f8b99;font-size:8px;font-weight:900;letter-spacing:.1em}.remote-progress-fact b{margin-top:5px;color:#eef5f7;font-size:12px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.remote-progress-fact.farm b{color:#7ff0be}.remote-progress-fact span{margin-top:4px;color:#91a4ae;font-size:10px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.remote-progress-meter{grid-column:1/-1;height:7px;border-radius:999px;background:#202a31;overflow:hidden}.remote-progress-meter span{display:block;height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,#168fbd,#42e9a6);box-shadow:0 0 12px rgba(66,233,166,.22);transition:width .35s ease}
.remote-progress-fact.farm.active{border-color:#3b8a69;background:#102a21;box-shadow:inset 3px 0 #42e9a6}.remote-progress-fact.farm.scheduled{border-color:#365769;background:#10202a;box-shadow:inset 3px 0 #52bde8}.remote-progress-fact.farm.disabled{border-color:#303941;background:#12171b;box-shadow:none}.remote-progress-fact.farm.disabled b{color:#8c9aa2}
.remote-stage-wrap{position:relative;min-width:0;min-height:0;overflow:hidden;background:#050709}
.remote-stage{position:absolute;inset:0;min-width:0;min-height:0;overflow:auto;display:flex;padding:0;outline:none;overscroll-behavior:contain;scrollbar-gutter:stable;touch-action:none}
.remote-stage.fit-mode{align-items:center;justify-content:center;overflow:hidden}
.remote-stage.width-mode{align-items:flex-start;justify-content:center;overflow:auto}
.remote-stage.native-mode{align-items:flex-start;justify-content:flex-start;overflow:auto}
.remote-stage:focus-visible{box-shadow:inset 0 0 0 2px #38c7ff}
.remote-stage img{display:block;max-width:none;max-height:none;flex:none;object-fit:fill;user-select:none;-webkit-user-drag:none;image-rendering:auto;cursor:default}
.remote-stage.fit-mode img{box-shadow:0 0 0 1px rgba(94,185,225,.16),0 22px 60px rgba(0,0,0,.34)}
.remote-stage img.frame-pending{visibility:hidden}
.remote-loading{position:absolute;left:50%;top:50%;translate:-50% -50%;z-index:2;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:2px 10px;padding:13px 17px;border:1px solid #284653;border-radius:14px;background:rgba(4,15,22,.94);color:#a9c0cb;font-size:12px;box-shadow:0 14px 45px #000}
.remote-loading span{width:16px;height:16px;border:2px solid #28424e;border-top-color:#38c7ff;border-radius:50%;animation:spin .8s linear infinite}
.remote-loading span{grid-row:1/3}.remote-loading b{color:#cce2eb}.remote-loading small{color:#718d9b;font-size:9px}
.remote-hud{position:absolute;right:12px;bottom:11px;display:flex;gap:7px;pointer-events:none;z-index:2}
.remote-hud span{padding:5px 8px;border:1px solid rgba(52,100,120,.72);border-radius:7px;background:rgba(2,12,17,.78);backdrop-filter:blur(8px);color:#7fa5b7;font-size:8px;font-weight:900;letter-spacing:.1em}
.remote-hud #remote-stream-label{color:#60edb2;border-color:rgba(66,233,166,.3)}
.remote-hud #remote-stream-label.degraded{color:#ffcc68;border-color:rgba(255,204,104,.34)}
.remote-footer{display:grid!important;gap:7px;height:auto;padding:10px 14px!important;border-top:1px solid #18313d!important;background:linear-gradient(180deg,#07121a,#050d13)!important;z-index:3}
.remote-text-form{display:grid;grid-template-columns:auto minmax(180px,1fr) auto auto;align-items:center;gap:8px;width:min(100%,1040px);margin:0 auto}
.remote-text-form label{display:flex;flex-direction:column;gap:2px;margin:0;white-space:nowrap}
.remote-text-form label b{font-size:11px;color:#c7dce6}
.remote-text-form label small{font-size:9px;color:#657f8d}
.remote-text-form input{min-width:0;margin:0;padding:10px 12px;font-size:16px}
.remote-text-form button{margin:0;white-space:nowrap}
.remote-privacy{display:flex;justify-content:space-between;gap:12px;width:min(100%,1040px);margin:0 auto;color:#637d89;font-size:9px}
.automation-settings{border-color:#44515b!important;color:#d0d8de!important}
.automation-dialog{color-scheme:light;width:min(880px,calc(100dvw - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid #d4cec3;border-radius:14px;background:#f4f1eb;color:#202a31;box-shadow:0 24px 70px rgba(0,0,0,.5)}
.automation-dialog::backdrop{background:rgba(8,10,12,.76);backdrop-filter:blur(2px)}
.automation-card{position:relative;display:grid;gap:12px;min-width:0;max-height:calc(100dvh - 24px);overflow-x:hidden;overflow-y:auto;padding:22px;background:#f4f1eb;color:#202a31}
.automation-card>*{min-width:0}
.settings-heading{padding:0 38px 16px 0;border-bottom:1px solid #d7d1c7}
.automation-card .panel-kicker{color:#647580;letter-spacing:.12em}
.automation-card h2{margin:4px 0 0;color:#182229;font-size:24px;letter-spacing:-.02em}.automation-lead{margin:5px 0 0;color:#64717a;font-size:13px}
.automation-card .dialog-close{color:#68747b}.automation-card .dialog-close:hover{color:#202a31}
.automation-section{display:grid;gap:12px;min-width:0;padding:16px;border:1px solid #d9d3c9;border-radius:10px;background:#fffdf9;box-shadow:0 1px 2px rgba(28,37,43,.04)}
.automation-section-title{display:flex;justify-content:space-between;gap:12px;align-items:center}.automation-section-title b{display:block;color:#253139;font-size:14px}.automation-section-title small{display:block;margin-top:3px;color:#68757d;font-size:11px}
.safe-badge{padding:5px 8px;border:1px solid #d5cec1;border-radius:6px;background:#eeeae2;color:#57666f;font-size:9px;font-weight:750;letter-spacing:.02em;white-space:nowrap}
.mode-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.mode-grid label{display:block;margin:0;cursor:pointer}.mode-grid input{position:absolute;opacity:0}.mode-grid span{display:block;height:100%;padding:12px;border:1px solid #d8d1c7;border-radius:8px;background:#faf8f3;color:#27343b}.mode-grid b,.mode-grid small{display:block}.mode-grid small{margin-top:4px;color:#69767d;font-size:10px;line-height:1.35}.mode-grid input:checked+span{border-color:#6e8999;background:#e8eef1;box-shadow:inset 3px 0 #58788a}.mode-grid input:focus-visible+span{outline:3px solid rgba(88,120,138,.2);outline-offset:1px}
.reserve-row{display:grid;grid-template-columns:minmax(0,1fr) 86px auto;align-items:center;gap:8px;margin:0;color:#27343b}.reserve-row span b,.reserve-row span small{display:block}.reserve-row span small{color:#6c7a82}.reserve-row input{margin:0}.reserve-row em{font-style:normal;color:#5f7079}
.automation-card input[type=number],.automation-card select{border-color:#cfc8bd;background:#fff;color:#1f2a31;box-shadow:none}.automation-card input:focus,.automation-card select:focus{border-color:#58788a;box-shadow:0 0 0 3px rgba(88,120,138,.14)}
.unit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.unit-row{display:grid;grid-template-columns:auto minmax(0,1fr) 90px;align-items:center;gap:8px;padding:9px 10px;border:1px solid #ded8cf;border-radius:8px;background:#f7f4ee}.unit-row>input[type=checkbox]{width:17px;height:17px;accent-color:#58788a}.unit-row b{color:#2b373e;font-size:11px}.unit-row label{margin:0;color:#6b777e;font-size:9px}.unit-row input[type=number]{margin:0;padding:7px 8px;font-size:12px}
.village-control-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.village-control-list label,.module-control-grid label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:11px 12px;border:1px solid #ded8cf;border-radius:8px;background:#f7f4ee;color:#2b373e}.village-control-list span b,.village-control-list span small,.module-control-grid span b,.module-control-grid span small{display:block}.village-control-list span small,.module-control-grid span small{margin-top:3px;color:#6b777e;font-size:9px}.village-control-list input,.module-control-grid input{width:18px;height:18px;accent-color:#58788a}
.module-control-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.automation-actions{position:sticky;bottom:-22px;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 -22px -22px;padding:13px 22px;border-top:1px solid #d7d1c7;background:rgba(244,241,235,.97);backdrop-filter:blur(8px)}#automation-status{color:#627078;font-size:11px}.automation-actions .primary{width:auto;margin:0;background:#4f7183;color:#fff;box-shadow:none}.automation-actions .primary:hover{background:#405f70;filter:none}.automation-actions .primary:disabled{cursor:wait;opacity:.62}
.module-control-grid.single-module{grid-template-columns:minmax(0,1fr)}
.automation-village-list{display:grid;gap:8px}.automation-village-row{display:grid;grid-template-columns:minmax(140px,1fr) minmax(138px,.7fr) auto auto;align-items:center;gap:10px;padding:12px;border:1px solid #ded8cf;border-radius:8px;background:#f7f4ee}.automation-village-identity b,.automation-village-identity small{display:block}.automation-village-identity b{color:#2b373e}.automation-village-identity small{margin-top:3px;color:#6b777e;font-size:9px}.automation-village-role{display:grid;gap:4px;color:#66747c;font-size:9px}.automation-village-role select{min-width:0;height:36px;padding:0 10px;border:1px solid #cfc8bd;border-radius:7px;background:#fff;color:#1f2a31}.automation-village-toggle{display:flex;align-items:center;gap:7px;margin:0;color:#344149;font-size:10px;white-space:nowrap}.automation-village-toggle input{width:18px;height:18px;accent-color:#58788a}
@keyframes spin{to{transform:rotate(1turn)}}

@media(max-width:1050px){
  .remote-commandbar{align-items:flex-start;flex-direction:column;gap:8px}
  .remote-identity,.remote-actions{width:100%}
  .remote-actions{justify-content:space-between}
  .remote-shell{grid-template-rows:auto auto minmax(0,1fr) auto}
  .remote-progress{grid-template-columns:minmax(0,1.5fr) repeat(2,minmax(160px,1fr))}.remote-progress-fact.last{display:none}.remote-progress-meter{grid-column:1/-1}
}

@media(max-width:700px){
  .remote-commandbar{padding:8px!important}
  .remote-progress{grid-template-columns:1fr 1fr;padding:9px 10px;gap:7px}.remote-progress-main{grid-column:1/-1;padding:4px}.remote-progress-heading b{font-size:14px}.remote-progress-main small{font-size:10px}.remote-progress-main em{font-size:10px}.remote-progress-fact{padding:8px 9px}.remote-progress-fact b{font-size:11px}.remote-progress-fact.next{display:block}.remote-progress-fact.last{display:none}.remote-progress-meter{grid-column:1/-1}
  .remote-identity{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px}
  .remote-link-badge{font-size:7px}
  .remote-commandbar .remote-actions{display:grid;grid-template-columns:minmax(150px,1fr) auto auto auto;gap:6px}
  .account-switcher{grid-column:1/-1;grid-template-columns:auto minmax(0,1fr)}
  .farm-switch{justify-content:center}
  .view-modes{justify-content:stretch}
  .view-mode{flex:1;padding:8px 7px}
  #remote-refresh{display:none}
  #remote-fullscreen{padding:9px!important}
  .remote-stage{touch-action:none}
  .remote-footer{padding:8px!important}
  .remote-text-form{grid-template-columns:minmax(0,1fr) auto auto;gap:6px}
  .remote-text-form label{grid-column:1/-1;flex-direction:row;align-items:baseline;gap:7px}
  .remote-text-form input{width:100%}
  .remote-privacy{display:block;line-height:1.35}
  .remote-privacy span:last-child{display:none}
  .remote-hud{right:7px;bottom:7px;left:7px;justify-content:flex-end;flex-wrap:wrap}
  .remote-hud span{font-size:7px}
  .automation-settings{grid-column:1/2}
  .quality-toggle{min-width:96px}
  .automation-card{padding:16px}.mode-grid{grid-template-columns:repeat(2,1fr)}.unit-grid,.village-control-list,.module-control-grid{grid-template-columns:1fr}.automation-village-row{grid-template-columns:1fr 1fr}.automation-village-identity{grid-column:1/-1}.automation-actions{bottom:-16px;margin:0 -16px -16px;padding:12px 16px}
}
@media(max-width:520px){.remote-progress{grid-template-columns:1fr}.remote-progress-fact.next{display:none}.remote-progress-heading{align-items:flex-start;flex-direction:column;gap:2px}.remote-progress-main em{white-space:normal}.automation-village-row{grid-template-columns:1fr}.automation-village-identity{grid-column:auto}.automation-village-toggle{justify-content:space-between;padding:7px 0;border-top:1px solid #d8d1c7}.automation-actions{align-items:stretch;flex-direction:column}.automation-actions .primary{width:100%}}

@media(max-width:430px){
  .remote-commandbar{gap:7px}
  .remote-identity{grid-template-columns:auto minmax(0,1fr)}
  .remote-link-badge{grid-column:2}
  .remote-commandbar .remote-actions{grid-template-columns:minmax(82px,1fr) auto auto auto}
  .farm-switch{font-size:11px}
  .farm-control{min-width:0}
  .farm-control small{display:none}
  .automation-settings{grid-column:auto;padding-inline:8px!important}
  .view-modes{display:none}
  .quality-toggle{min-width:66px;padding-inline:7px!important}
  .remote-close-button{position:absolute;top:8px;right:8px}
  .remote-identity{padding-right:42px}
  #remote-fullscreen{font-size:0}
  #remote-fullscreen:after{content:"⛶";font-size:17px}
  .remote-text-form{grid-template-columns:minmax(0,1fr) auto}
  #remote-text-visibility{grid-column:2}
  .remote-text-form .secondary{grid-column:1/-1;padding:11px}
}
