
*{box-sizing:border-box;margin:0;padding:0}
body{background:#f0f0f0;font-family:Tahoma,Arial,sans-serif;display:none;justify-content:center;align-items:flex-start;min-height:100vh;padding:15px}
.box{width:100%;max-width:380px;background:#fff;padding:20px;border-radius:18px;box-shadow:0 4px 20px rgba(0,0,0,.1);text-align:center}
.title{font-size:20px;font-weight:bold;margin-bottom:15px;color:#333}
.btn{width:100%;padding:14px;margin-top:10px;font-size:16px;font-weight:bold;color:#fff;border:none;border-radius:12px;cursor:pointer;transition:transform .2s;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.btn:active:not(:disabled){transform:scale(.97)}
.btn-green{background:#43a047}.btn-red{background:#e53935}.btn-gray{background:#666}.btn-blue{background:#1976d2}.btn-orange{background:#fb8c00}.btn-purple{background:#8e24aa}.btn-pink{background:#d81b60}.btn-darkgray{background:#455a64}.btn-yellow{background:#ffc107;color:#333}
.status-display{width:100%;padding:12px;margin-top:10px;margin-bottom:10px;font-size:15px;font-weight:bold;border-radius:12px;border:1px solid #ddd}.status-opening{background:#e8f5e9;color:#2e7d32;border-color:#c8e6c9}.status-closing{background:#ffebee;color:#c62828;border-color:#ffcdd2}.status-stopped{background:#eee;color:#424242;border-color:#d6d6d6}.status-error{background:#fff3e0;color:#ef6c00;border-color:#ffe0b2}.status-offline{background:#eceff1;color:#455a64;border-color:#cfd8dc}
.door-card{background:#eef6ff;border:1px solid #b9d7ff;border-radius:12px;padding:10px;margin:10px 0;font-size:14px;font-weight:bold;color:#145da0}
.battery-status-card,.power-status-card{background:#f9f9f9;border:1px solid #ddd;border-radius:15px;padding:15px;margin:15px 0}.battery-percent{font-size:24px;font-weight:bold;color:#2e7d32}.battery-bar-container{width:100%;height:12px;background:#e0e0e0;border-radius:6px;overflow:hidden;margin:10px 0}.battery-bar{width:0;height:100%;background:linear-gradient(90deg,#4caf50,#8bc34a);transition:width .25s}
.status-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:15px}.status-item{background:#fff;padding:8px;border-radius:8px;border:1px solid #eee}.status-label{font-size:11px;color:#888}.status-value{font-size:13px;font-weight:bold;color:#333}.power-state-badge{font-size:15px;font-weight:bold;margin-bottom:8px}.alert-box{display:none;background:#ffebee;color:#c62828;border:1px solid #ffcdd2;padding:8px 12px;border-radius:8px;font-size:12px;font-weight:bold;margin-top:10px;line-height:1.5}

body{display:flex}.btn:disabled{opacity:1;cursor:not-allowed;box-shadow:inset 0 0 0 2px rgba(0,0,0,.18)}input{width:100%;padding:12px;border:1px solid #bbb;border-radius:10px;margin-top:10px;direction:ltr}p{line-height:1.7;font-size:13px;margin:8px 0}.link{display:block;text-decoration:none;text-align:center}.hidden,[hidden]{display:none!important}.door-choice{display:grid;grid-template-columns:1fr 1fr;gap:6px}.door-choice button[aria-pressed=true]{background:#1976d2}.status-value{overflow-wrap:anywhere}details{text-align:right;margin-top:12px}button:focus-visible,a:focus-visible{outline:3px solid #0ea5e9;outline-offset:2px}

.sensor-icon{font-size:30px;margin-bottom:5px}.health-note{font-size:12px;color:#455a64;margin:6px 0}.local-tools{border-top:1px solid #ddd;margin-top:15px;padding-top:8px}.local-tools p{color:#455a64}.door-choice{margin-bottom:8px}

.alarm-live{background:#f3f4f6;color:#374151;border:1px solid #d1d5db;padding:10px 12px;border-radius:10px;font-size:13px;font-weight:bold;margin:8px 0}

/* Stable numeric fields and reserved status area prevent layout jumps. */
.status-value,.battery-percent{font-variant-numeric:tabular-nums}.status-value{min-height:1.4em}.status-display,.alarm-live{min-height:2.8em;overflow-wrap:anywhere}.health-note{min-height:1.7em}.btn{min-height:48px}
@media(prefers-reduced-motion:reduce){.btn,.battery-bar{transition:none}}

.btn{transition:transform .2s,background-color .2s,color .2s} .btn.pressed{transform:scale(.97)}
.door-choice .btn{margin-top:10px;padding:14px 6px;font-size:14px}.door-choice{gap:6px;margin-bottom:0}.door-choice + #alarmButton{margin-top:10px}
.brand-status{display:flex;align-items:center;justify-content:center;gap:9px}.brand-status #networkBadge{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;color:#2e7d32}.brand-status #networkBadge.is-offline{color:#607d8b}.brand-status svg{width:21px;height:21px;display:block}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.brand-status #networkBadge svg[hidden]{display:none!important}.btn:disabled{opacity:1}.btn:active:not(:disabled){transform:scale(.97)}

/* Separate management view; approved main controls and their press effect are unchanged. */
.mg-panel{margin:18px 0;border:1px solid #dbe3eb;border-radius:14px;padding:12px;text-align:right;background:#f8fafc;scroll-margin-top:8px}.mg-panel[hidden],.mg-panel [hidden]{display:none!important}.mg-head,.mg-row{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}.mg-head h2{font-size:17px;color:#145da0}.mg-back,.mg-small{border:1px solid #cbd5e1;background:white;color:#334155;border-radius:8px;padding:9px;font:inherit;font-size:12px;cursor:pointer;transition:transform .2s}.mg-small:active,.mg-back:active{transform:scale(.97)}.mg-small:disabled{cursor:not-allowed;opacity:.6}.mg-danger{color:#b91c1c;border-color:#fecaca}.mg-help,.mg-item p{font-size:12px;line-height:1.8;color:#475569;margin:7px 0}.mg-list{display:grid;gap:8px;margin:12px 0}.mg-item{border:1px solid #e2e8f0;border-radius:10px;padding:11px;background:#fff;overflow-wrap:anywhere}.mg-item strong{font-size:14px;color:#1e293b}.mg-details{border:1px solid #e2e8f0;border-radius:10px;padding:10px;margin:12px 0;background:white}.mg-details summary{font-size:14px;font-weight:bold;color:#145da0;cursor:pointer}.mg-details label{display:block;font-size:13px;color:#334155;margin:10px 0 2px}.mg-details select{width:100%;border:1px solid #cbd5e1;border-radius:9px;padding:11px;background:#fff;color:#334155;font:inherit}.mg-checks{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:8px 0}.mg-checks label{display:flex;align-items:center;gap:6px;margin:0}.mg-checks input{width:auto;margin:0;accent-color:#1976d2}.mg-code{background:white;border:1px solid #dbe3eb;padding:12px;border-radius:10px;text-align:center}.mg-code p{font-size:13px;font-weight:bold;margin:6px 0}.mg-code #guestCodeImage{display:flex;justify-content:center;margin:12px auto;min-height:210px}.mg-code img,.mg-code canvas{max-width:100%}.mg-panel #managementMessage{overflow-wrap:anywhere;min-height:32px}

/* 31J.4o2 — local-page visual parity. Only management/pair views are affected. */
/* The main stop remains visible during management, including when the RF motor is started elsewhere. */
body:has(#controls:not([hidden]) #managementPanel:not([hidden])) .box > :not(#controls),
body:has(#controls:not([hidden]) #managementPanel:not([hidden])) #controls > :not(#managementPanel):not(#stop){display:none!important}
body:has(#controls:not([hidden]) #managementPanel:not([hidden])) #stop{position:sticky;top:8px;z-index:4;margin:0 0 10px;min-height:44px}
body:has(#controls:not([hidden]) #managementPanel:not([hidden])) .box{padding:0;background:transparent;box-shadow:none;max-width:380px}
body:has(#controls:not([hidden]) #managementPanel:not([hidden]) #remoteManagement:not([hidden])){background:#ebebeb}
body:has(#controls:not([hidden]) #managementPanel:not([hidden]) #guestManagement:not([hidden])){background:radial-gradient(ellipse at top right,#233b62 0,#0b1730 65%)}
body:has(#controls:not([hidden]) #managementPanel:not([hidden]) #guestManagement:not([hidden])) .box{max-width:560px}
#managementPanel{margin:0 0 16px;padding:25px 20px;border-radius:20px;border:0;background:#fff;box-shadow:0 10px 25px #0000001a;text-align:center;min-width:0}
#managementPanel .mg-head{justify-content:center;margin-bottom:12px}
#managementPanel .mg-head h2{background:#3b5998;color:#fff;display:inline-block;padding:8px 15px;border-radius:6px;font-size:18px;margin:0}
#managementPanel .mg-back{width:100%;padding:14px;margin:10px 0 0;border-radius:12px;background:#607d8b;color:white;font-size:15px;font-weight:bold;border:0}
#managementPanel .mg-small,#managementPanel .mg-back,#managementPanel summary{transition:transform .2s;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#managementPanel .mg-small:active:not(:disabled),#managementPanel .mg-back:active,#managementPanel summary:active{transform:scale(.97)}
#managementPanel #managementMessage{background:#e8f5e9;color:#1b5e20;border:1px solid #c8e6c9;border-radius:10px;padding:10px;font-weight:bold;line-height:1.8;min-height:36px}
#remoteManagement .mg-help{text-align:right;color:#666;font-size:12px}
#remoteManagement #remoteList{height:420px;overflow-y:auto;display:block;margin:15px 0;border:1px solid #e0e0e0;border-radius:12px;padding:10px;background:#fdfdfd;overscroll-behavior:contain}
#remoteManagement #remoteList::-webkit-scrollbar{width:8px}#remoteManagement #remoteList::-webkit-scrollbar-track{background:#f1f1f1;border-radius:10px}#remoteManagement #remoteList::-webkit-scrollbar-thumb{background:#999;border-radius:10px}
#remoteManagement .mg-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:center;text-align:right;padding:12px 10px;border:1px solid #e8e8e8;border-radius:10px;margin-bottom:8px;background:white;color:#333}
#remoteManagement .mg-item strong{grid-column:1;font-size:15px;color:#333}#remoteManagement .mg-item p{grid-column:1;margin:0;color:#666;font-size:11px}#remoteManagement .mg-item .mg-row{grid-column:2;grid-row:1/3;flex-direction:column;align-items:stretch;gap:6px}
#remoteManagement .mg-small{background:#607d8b;border:0;color:white;padding:7px 10px;border-radius:6px;font-size:12px;font-weight:bold}
#remoteManagement .mg-small.mg-enable{background:#16845b}#remoteManagement .mg-small.mg-disable{background:#d97706}#remoteManagement .mg-small.mg-danger{background:#f05050;color:white}
#remoteManagement .mg-small:disabled{opacity:.5;cursor:not-allowed}
#remoteManagement .remote-learn{border:0;padding:0;margin:12px 0;background:transparent}
#remoteManagement .remote-learn summary{list-style:none;background:#7952b3;color:white;border-radius:12px;padding:14px;text-align:center;font:bold 15px Tahoma,Arial;cursor:pointer}#remoteManagement .remote-learn summary::-webkit-details-marker{display:none}
#remoteManagement .remote-learn[open]{background:#fff;border:1px solid #e0e0e0;border-radius:15px;padding:10px}
#remoteManagement .remote-learn[open] summary{margin-bottom:12px}#remoteManagement #learnInfo{background:#0a0e24;color:#00ff9a;padding:10px;border-radius:8px;margin:10px 0;line-height:1.8;overflow-wrap:anywhere}
#remoteManagement input,#remoteManagement select{font:15px Tahoma,Arial;border:1px solid #ccc;border-radius:8px;padding:12px;margin:6px 0 10px;text-align:right;direction:rtl}
#remoteManagement #learnStart{background:#28a745}#remoteManagement #learnCancel{background:#666}
/* QR source: dark blue gradient, gold issuance, blue headings, white QR frame. */
#managementPanel:has(#guestManagement:not([hidden])){padding:19px;background:linear-gradient(145deg,#1b2c49,#14233e);border:1px solid #2b3e5e;border-radius:19px;box-shadow:0 14px 36px #0005;text-align:right;color:#f7f9ff}
#managementPanel:has(#guestManagement:not([hidden])) .mg-head{justify-content:flex-start}
#managementPanel:has(#guestManagement:not([hidden])) .mg-head h2{background:none;color:#f7f9ff;padding:0;font-size:20px}
#managementPanel:has(#guestManagement:not([hidden])) #managementMessage{background:#0d1c34;color:#a6d3ff;border-color:#2f6f9f;text-align:center}
#guestManagement .mg-help{color:#a9bad4;line-height:1.9;font-size:13px}
#guestManagement .guest-form{background:#16273f;border:1px solid #304666;border-radius:13px;padding:13px}
#guestManagement .guest-form summary{color:#4fc3ff;font-size:15px;line-height:1.8}
#guestManagement .guest-form label{color:#d9e4f4;font-size:12px;margin:12px 0 6px}
#guestManagement .guest-form input:not([type=checkbox]),#guestManagement .guest-form select{box-sizing:border-box;min-width:0;width:100%;height:52px;background:#0e1d36;color:white;border:1px solid #2d4263;border-radius:12px;padding:0 11px;font:16px Tahoma,Arial;margin:0;color-scheme:dark}
#guestManagement #guestName{direction:rtl;text-align:right}
#guestManagement .mg-checks{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin:12px 0}
#guestManagement .mg-checks label{display:flex;align-items:center;justify-content:flex-start;gap:12px;min-height:48px;padding:12px;margin:0;border:1px solid #304666;border-radius:11px;background:#16273f;color:#e5edf9;font-size:14px;line-height:1.7;cursor:pointer}
#guestManagement .mg-checks label:has(input:checked){border-color:#f5a000;background:#302b26;color:#ffdc96}#guestManagement .mg-checks input{width:20px;height:20px;flex:0 0 20px;accent-color:#f5a000}
#guestManagement #guestCreate{background:#f5a000;color:#171c27;font-size:14px;min-height:52px}
#guestManagement .guest-list-panel{background:#0f1e33;border:1px solid #2b3e5e;border-radius:14px;padding:14px;margin:16px 0 0}#guestManagement .guest-list-panel h3{font-size:17px;color:#4fc3ff;margin:0 0 10px}
#guestManagement #guestList{margin:12px 0 0}#guestManagement .mg-item{background:#14273f;border:1px solid #2e4463;border-radius:12px;padding:12px;color:#f7f9ff}#guestManagement .mg-item strong{color:#fff;font-size:15px}#guestManagement .mg-item p{color:#a9bad4}#guestManagement .mg-item p:nth-of-type(2){color:#4fc3ff}
#guestManagement .mg-item .mg-row{display:grid;grid-template-columns:1fr;gap:8px}#guestManagement .mg-small,#guestManagement #guestReload,#guestManagement #guestCopy{background:#203653;border:1px solid #3a5072;color:white;border-radius:9px;min-height:42px;font-weight:bold}#guestManagement .mg-small.mg-danger{background:#b93440;color:white;border-color:#b93440}
#guestManagement .mg-code{background:#102039;border:1px solid #354968;border-radius:16px;padding:15px;color:#d9e4f4;margin:16px 0}#guestManagement .mg-code #guestCodeImage{box-sizing:border-box;background:#fff;padding:16px;width:min(242px,100%);min-height:0;aspect-ratio:1;border-radius:15px;align-items:center}#guestManagement .mg-code img,#guestManagement .mg-code canvas{max-width:100%;height:auto;object-fit:contain;image-rendering:pixelated}
#managementPanel:has(#guestManagement:not([hidden])) .mg-back{background:#203653;border:1px solid #3a5072}
/* Online pairing uses the local login theme without changing the authentication mechanism. */
body:has(#pairSection:not([hidden])){background:#101d32;color:white}
body:has(#pairSection:not([hidden])) .box{max-width:440px;background:#172840;color:#fff;border-radius:20px;padding:20px}
body:has(#pairSection:not([hidden])) .box>.title,body:has(#pairSection:not([hidden])) .box>.brand-status{display:none}
#pairSection .pair-heading{font-size:23px;color:#f5ad21;margin:10px 0 14px;direction:ltr}
#pairSection input{box-sizing:border-box;background:#101d32;color:white;border:1px solid #405575;border-radius:12px;font:inherit;margin:7px 0;padding:14px}
#pairSection #pairButton{background:#f5ad21;color:#172840}#pairSection #paste{background:#203653;border:1px solid #405575}
@media(max-width:480px){#managementPanel{padding:18px 12px}#managementPanel:has(#guestManagement:not([hidden])){padding:13px}#remoteManagement .mg-item{padding:10px 8px}#remoteManagement .mg-item .mg-row{max-width:115px}}
@media(prefers-reduced-motion:reduce){#managementPanel .mg-small,#managementPanel .mg-back,#managementPanel summary{transition:none}}

.exact-shell{position:fixed;inset:0;z-index:10000;display:flex;flex-direction:column;background:#ebebeb}.exact-bar{display:flex;gap:6px;padding:6px;background:#fff;flex-shrink:0}.exact-bar .btn{flex:1;width:auto;margin:0;padding:8px;font-size:13px}.exact-shell iframe{width:100%;flex:1;min-height:0;border:0;background:#ebebeb}

.brand-status #networkBadge.is-offline{color:#d32f2f}.brand-status .link-indicator{display:inline-flex;width:22px;height:22px;color:#16845b}.brand-status .link-indicator.is-offline{color:#d32f2f}.brand-status .link-indicator.pending{color:#607d8b}.guest-shell .btn:disabled{opacity:.55}.guest-shell .sensor-icon{font-size:30px}.guest-shell .alarm-live{background:#f3f4f6;padding:10px;border-radius:10px;margin:8px 0;font-size:13px}.guest-shell #networkText{font-size:12px;color:#455a64}

#alarmLiveStatus[hidden]{display:none!important}

.aria-topology{width:100%;color:#145da0;text-align:center;font-weight:bold}.aria-topology svg{display:block;width:100%;max-width:340px;margin:4px auto;overflow:visible}.aria-topology svg text{stroke:none;fill:#475569;font:12px Tahoma,Arial;text-anchor:middle}.aria-topology [data-state=unknown]{color:#8795a1}.aria-topology [data-state=up]{color:#159447}.aria-topology [data-state=down]{color:#dc2626}.aria-topology .link-cross{display:none}.aria-topology [data-state=down] .link-cross{display:inline}.aria-topology #ariaLinkText{font-size:12px;min-height:1.5em}.aria-shutter{width:28px;height:28px;vertical-align:middle;margin-inline-start:6px;pointer-events:none}

/* 31J.5i: override legacy 21px brand SVG selector only for topology. */
.brand-status .aria-topology > svg{width:100%;height:auto;max-width:300px;aspect-ratio:340/105;margin:10px auto 6px}.brand-status .aria-topology{min-width:0}.brand-status .aria-topology > div:first-child{font-size:16px}.brand-status #connection,.brand-status #networkText{margin:5px 0 0;padding:0;border:0;background:transparent;min-height:0;font-size:12px;line-height:1.7;color:#145da0}.brand-status #ariaLinkText{font-size:13px;line-height:1.6}

/* Compact icon-only connectivity: preserve live DOM for protocol and accessibility. */
.brand-status .aria-topology{width:100%;min-width:0;position:relative}
.brand-status .aria-topology > svg{display:block;width:100%!important;height:auto!important;max-width:340px;aspect-ratio:340/88;margin:8px auto 0}
.brand-status .aria-topology > svg text{display:none}
.brand-status .aria-topology #connection,.brand-status .aria-topology #networkText,.brand-status .aria-topology #ariaLinkText{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;margin:0!important;padding:0!important;border:0!important}
