/* Omolab: one visual system for the controller, management and diagnostic pages. */
:root{color-scheme:light;--ui-bg:#f5f5f7;--ui-panel:#fff;--ui-surface:#f1f1f4;--ui-line:#e5e5ea;--ui-field:#a5a5ae;--ui-text:#1d1d1f;--ui-muted:#66666e;--ui-blue:#0066cc;--ui-blue-soft:#edf5ff;--ui-green:#187344;--ui-green-soft:#edf7f0;--ui-red:#b92b25;--ui-red-soft:#fff0ee;--ui-amber:#8b6100;--ui-amber-soft:#fff7e6;font:16px/1.55 -apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;color:var(--ui-text);background:var(--ui-bg)}
*{box-sizing:border-box}
html{background:var(--ui-bg)}
body{margin:0;max-width:none;min-height:100vh;padding:0;background:var(--ui-bg);color:var(--ui-text);font:inherit;-webkit-font-smoothing:antialiased;overflow-x:visible}
a{color:var(--ui-blue);text-decoration:none;cursor:pointer}
a:hover{text-decoration:underline}
.omolab-masthead{display:flex;align-items:center;justify-content:space-between;gap:24px;max-width:1160px;min-height:76px;margin:0 auto;padding:12px 28px;border-bottom:1px solid var(--ui-line)}
.omolab-brand{display:inline-flex;align-items:center;gap:10px;min-height:44px;color:var(--ui-text);text-decoration:none!important;flex-shrink:0}
.omolab-mark{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:9px;background:var(--ui-text)}
.omolab-mark svg{width:22px;height:22px;display:block}
.omolab-wordmark{font-size:21px;font-weight:650;letter-spacing:-.7px}
.omolab-links{display:flex;align-items:center;gap:24px;font-size:13px}
.omolab-links a{display:inline-flex;align-items:center;min-height:44px;white-space:nowrap;color:var(--ui-muted)}
.omolab-links a:hover{color:var(--ui-blue);text-decoration:none}
body>header{max-width:1160px;margin:0 auto;padding:28px 28px 12px;background:transparent;color:var(--ui-text)}
body>header h1{max-width:none;margin:0;color:var(--ui-text);font-size:28px;font-weight:650;letter-spacing:-.7px;white-space:normal;overflow:visible}
body>header h1 a{display:inline-flex;min-height:44px;align-items:center;margin-left:12px;color:var(--ui-blue)!important;font-size:13px!important;font-weight:500;letter-spacing:0}
main,main.wrap{width:100%;max-width:1160px;margin:0 auto;padding:24px 28px 40px;min-width:0}
main>h1{margin:4px 0 10px;font-size:30px;letter-spacing:-.8px}
main>p{max-width:850px;margin:0 0 26px}
h1,h2,h3{color:var(--ui-text);line-height:1.35;font-weight:600}
h1{font-size:30px;letter-spacing:-.8px}
h2{font-size:20px;letter-spacing:-.3px;margin:0 0 16px}
h3{font-size:17px;letter-spacing:-.2px;margin:0 0 12px}
p{color:var(--ui-muted);line-height:1.75;margin:10px 0 18px}
small,.hint{color:var(--ui-muted);font-size:12px;line-height:1.7}
.muted,.label,.pool-card .label,.action-title,.action-value,.action-time,.chart-title,.item span,.status-legend{color:var(--ui-muted)}
.ok,.good,.status-online,.running,.pool-card .running,.level-info{color:var(--ui-green)}
.bad,.err,.error,.status-offline,.level-error{color:var(--ui-red)}
.pending,.pool-card .pending,.level-warn{color:var(--ui-amber)}
.panel,main>.card{margin:0 0 20px;padding:26px;background:var(--ui-panel);border:1px solid var(--ui-line);border-radius:18px;box-shadow:0 2px 8px rgb(0 0 0 / 3%);min-width:0}
.card{border-color:var(--ui-line);border-radius:14px;padding:20px;background:var(--ui-panel);color:var(--ui-text);box-shadow:none;min-width:0}
.card strong{color:var(--ui-text);font-size:24px;font-weight:600;font-variant-numeric:tabular-nums}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:18px;min-width:0}
.grid>*{min-width:0}
.settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
label{display:block;margin:0 0 18px;color:var(--ui-muted);font-size:13px;font-weight:500;line-height:1.5;min-width:0}
input,select,textarea{display:block;width:100%;min-width:0;max-width:100%;min-height:46px;margin:8px 0 0;padding:11px 13px;background:var(--ui-panel);border:1px solid var(--ui-field);border-radius:10px;color:var(--ui-text);font:inherit;font-size:16px;font-weight:400;line-height:1.4;accent-color:var(--ui-blue);box-sizing:border-box}
input::placeholder{color:var(--ui-muted);opacity:1}
input[readonly],input:disabled{background:var(--ui-surface)}
input[type=checkbox],input[type=radio]{display:inline-block;vertical-align:middle;width:18px;height:18px;min-height:18px;margin:0 8px 0 0;flex-shrink:0}
label:has(input[type=checkbox]){min-height:44px;display:flex;align-items:center;color:var(--ui-text)}
input[type=file]{min-height:46px;padding:7px;font-size:13px;background:var(--ui-surface);border-color:var(--ui-line)}
input[type=file]::file-selector-button{padding:7px 10px;border:0;border-radius:6px;background:var(--ui-panel);color:var(--ui-text);font:inherit;margin-right:10px;cursor:pointer}
button,button.primary,button.secondary{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:auto;min-height:44px;height:auto;margin:0;padding:10px 18px;border:1px solid transparent;border-radius:10px;background:var(--ui-blue);color:#fff;font:inherit;font-size:14px;font-weight:500;line-height:1.5;cursor:pointer;transition:background-color .18s ease,box-shadow .18s ease,border-color .18s ease}
button:hover,button.primary:hover{background:#0059b3}
button:active{background:#004f9f}
button.secondary,.secondary{background:var(--ui-surface);color:var(--ui-text)}
button.secondary:hover{background:#e6e6ec}
button.stop,button.danger,#manualStopBtn:not(:disabled),#motorStop,#allStop,#pumpStop{background:var(--ui-red);color:#fff;border-color:var(--ui-red)}
button.stop:hover,button.danger:hover,#manualStopBtn:not(:disabled):hover,#motorStop:hover,#allStop:hover,#pumpStop:hover{background:#9e221d;border-color:#9e221d}
button.delete{color:var(--ui-red);background:var(--ui-red-soft)}
button:disabled{opacity:.45;cursor:default}
:where(a,button,input,select,textarea,summary):focus-visible{outline:3px solid var(--ui-blue);outline-offset:3px}
a,button,summary{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.hidden,[hidden]{display:none!important}
/* Authentication and account creation share the same card. */
main.auth-wrap{max-width:492px;margin:36px auto 0;padding:12px 24px 48px}
.auth-wrap .panel{padding:34px}
.auth-wrap h2,body:has(#login)> .panel h2{font-size:28px;letter-spacing:-.7px;margin-bottom:12px}
.auth-wrap .panel>p.muted{font-size:14px;margin:0 0 24px}
.auth-wrap .auth-actions{display:grid;grid-template-columns:1fr;gap:10px;margin-top:24px}
.auth-actions button{width:100%}
.auth-wrap label{margin-bottom:20px}
#authMsg:empty{display:none}
#authMsg:not(:empty){margin:18px 0 0;padding:12px 14px;background:var(--ui-blue-soft);border-radius:10px;font-size:13px;color:var(--ui-text)}
body:has(#login)> .panel{width:calc(100% - 40px);max-width:440px;margin:64px auto;padding:34px}
body:has(#login)> .panel>p{font-size:14px}
body:has(#login) #login{width:100%;margin:8px 0 10px}
body:has(#login) #change{width:100%}
.msg{color:var(--ui-red);font-size:13px;min-height:0}
/* Primary navigation and account toolbar. */
#appPage>nav{display:flex;align-items:center;flex-wrap:wrap;gap:4px;width:max-content;max-width:calc(100% - 56px);margin:12px 0 20px max(28px,calc((100% - 1104px)/2));padding:4px;background:#e8e8ed;border-radius:12px;overflow:visible;white-space:normal}
#appPage>nav button{flex:initial;border:0;border-radius:9px;background:transparent;color:var(--ui-muted);padding:9px 22px;min-height:40px;font-size:14px}
#appPage>nav button.active{background:var(--ui-panel);color:var(--ui-text);box-shadow:0 1px 4px rgb(0 0 0 / 9%);font-weight:500}
#appPage>nav button:not(.active):hover{background:rgb(255 255 255 / 50%)}
.userbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;max-width:1104px;margin:0 auto;padding:16px 20px;background:var(--ui-panel);border:1px solid var(--ui-line);border-radius:14px;font-size:13px}
.userbar .muted{margin-right:auto;min-width:0;overflow-wrap:anywhere}
.userbar label{font-size:12px}
.userbar select{width:auto;min-width:180px;max-width:360px;margin:0;font-size:14px;min-height:44px}
.userbar button{font-size:13px;padding:9px 14px}
.subnav{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 20px;padding:0;background:transparent;border:0;overflow:visible;white-space:normal}
.subnav button{flex:initial;min-height:40px;padding:8px 14px;border:0;border-radius:9px;background:transparent;color:var(--ui-muted);font-size:13px}
.subnav button.active{color:var(--ui-blue);background:var(--ui-blue-soft);font-weight:500}
.subnav button:not(.active):hover{background:#eaeaf0;color:var(--ui-text)}
.notice{padding:14px 16px;margin:16px 0;border:1px solid #d4e5fb;border-radius:12px;background:var(--ui-blue-soft);color:#28517b;font-size:13px;line-height:1.8}
.notice strong{color:inherit}
.scan-bind{max-width:1104px;margin:20px auto 0;padding:24px}
.scan-bind-actions,.auth-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.scan-bind-actions>label{flex:1 1 230px;max-width:420px}
.scan-bind video{border-radius:12px}
.scan-list{max-height:280px;overflow:auto;border:1px solid var(--ui-line);border-radius:12px;margin:16px 0}
.scan-item{padding:14px 16px;border-color:var(--ui-line);min-height:44px}
.scan-item:hover{background:var(--ui-blue-soft)}
/* Device status, six pools and trend charts. */
.device-status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 32px}
.device-status-item{display:flex;justify-content:space-between;align-items:baseline;gap:16px;min-width:0;border-bottom:1px solid var(--ui-line);padding:12px 0;font-size:14px}
.device-status-item>span:last-child{min-width:0;text-align:right;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.device-status-item .label{white-space:nowrap;font-size:13px}
.status-online,.status-offline{font-weight:500}
.pool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.pool-card{padding:18px;background:#fff;border-color:var(--ui-line);border-radius:14px}
.pool-card h3{margin:0 0 14px;color:var(--ui-text);font-size:17px}
.pool-card p{margin:6px 0}
.pool-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 16px}
.pool-action{padding:12px 10px;min-width:0;background:#f8f8fa;border:0;border-radius:10px}
.action-title{font-size:12px;margin-bottom:8px}
.led-row{display:flex;align-items:center;gap:7px;font-size:14px;font-weight:500}
.led{width:9px;height:9px;border:0;background:var(--ui-red);box-shadow:none;flex-shrink:0}
.led.on{background:var(--ui-green);border:0;box-shadow:none}
.action-value,.action-time{font-size:12px;line-height:1.55;margin-top:7px;white-space:normal;overflow-wrap:anywhere}
.chart-title{font-size:12px;font-weight:500;margin:0 0 6px}
.history-chart{height:112px;background:#fbfbfd;border-color:var(--ui-line);border-radius:8px;margin-top:0}
.chart-empty{fill:var(--ui-muted);font-size:11px}
.history-chart polyline{stroke:var(--ui-blue)}
.history-chart circle{fill:var(--ui-blue)}
.history-chart text:not(.chart-empty){fill:var(--ui-muted)}
.history-chart text.threshold-guide{fill:var(--ui-amber)}
.valve-state{padding:5px 9px;border-radius:8px;background:var(--ui-surface);color:var(--ui-muted);font-size:13px}
.valve-on{background:var(--ui-green-soft);color:var(--ui-green)}
/* Data tables retain local horizontal scrolling rather than widening the page. */
table,.device-table,.log-table{width:100%;border-collapse:collapse;margin:16px 0;font-size:13px}
th,td,.device-table th,.device-table td,.log-table th,.log-table td{padding:12px;border:0;border-bottom:1px solid var(--ui-line);text-align:left;vertical-align:middle;line-height:1.55;font-variant-numeric:tabular-nums}
th,.device-table th,.log-table th{background:#f8f8fa;color:var(--ui-muted);font-weight:500;font-size:12px}
.table-wrap,.device-table-wrap,.history-table-wrap,.log-wrap,.scroll{max-width:100%;overflow:auto;border-radius:10px;-webkit-overflow-scrolling:touch;min-width:0}
.device-table{min-width:1080px}
.log-table{min-width:680px}
.device-actions{display:flex;gap:8px;flex-wrap:wrap;min-width:160px}
.device-actions button{font-size:12px;padding:8px 12px}
.badge,.device-badge{display:inline-block;padding:4px 9px;border-radius:999px;font-size:12px;white-space:nowrap}
.online,.device-online{background:var(--ui-green-soft);color:var(--ui-green)}
.offline,.device-offline{background:var(--ui-red-soft);color:var(--ui-red)}
.disabled,.device-disabled{background:var(--ui-surface);color:var(--ui-muted)}
.unknown{background:var(--ui-amber-soft);color:var(--ui-amber)}
.secret,.secret-box{padding:14px;border-radius:10px;background:var(--ui-surface);color:var(--ui-text);font-size:13px;overflow-wrap:anywhere}
code{font:12px/1.6 ui-monospace,"SFMono-Regular",monospace;overflow-wrap:anywhere}
.log-toolbar{gap:12px}
.log-toolbar label{margin-bottom:0}
.log-toolbar button{height:auto}
.history-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr));gap:16px;align-items:end}
.history-filters label{margin-bottom:0}
.setting-panel table,#page-calibration table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.setting-panel table input,#page-calibration table input{min-width:110px;margin:0}
.setting-panel table th,#page-calibration table th{min-width:120px}
.setting-panel table th:first-child,#page-calibration table th:first-child{min-width:64px}
#page-calibration .panel>.secondary,#page-calibration .panel>.primary{margin:8px 8px 0 0}
#saveBtn,#otaLatestBtn{margin-top:16px}
/* Optical diagnostics and USB programmer. */
.item,.value{min-width:0;padding:16px;border:1px solid var(--ui-line);border-radius:12px;background:#f8f8fa;color:var(--ui-muted);font-size:13px}
.item span{font-size:12px;margin-bottom:8px}
.item b,.value b{display:block;color:var(--ui-text);font-size:21px;font-weight:600;letter-spacing:-.4px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;margin-top:6px}
.item b.good{color:var(--ui-green)}
.item b.bad{color:var(--ui-red)}
.values{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.row{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:18px}
.row:has(>div){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:18px}
.actions button{width:100%}
.message,.status{padding:12px 16px;margin-top:16px;border-radius:10px;background:var(--ui-surface);color:var(--ui-muted);font-size:13px;line-height:1.8;white-space:pre-line;overflow-wrap:anywhere}
.message.good,.status.ok{color:var(--ui-green);background:var(--ui-green-soft)}
.message.bad,.status.err{color:var(--ui-red);background:var(--ui-red-soft)}
summary{cursor:pointer;min-height:44px;padding:12px 0;color:var(--ui-muted);font-size:13px}
pre{padding:16px;border-radius:10px;background:var(--ui-surface);color:var(--ui-muted);font:12px/1.7 ui-monospace,"SFMono-Regular",monospace;white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;overflow:auto}
body:has(#port)>h1,body:has(#port)>p,body:has(#port)>section{width:calc(100% - 56px);max-width:900px;margin-left:auto;margin-right:auto}
body:has(#port)>h1{margin-top:32px;font-size:28px}
body:has(#port)>section{padding:26px;border:1px solid var(--ui-line);border-radius:18px;background:var(--ui-panel);margin-top:20px;margin-bottom:20px}
body:has(#port)>p{font-size:14px}
body:has(#port)>section>button{width:100%;margin:12px 0}
body:has(#port) .row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
#factoryReset{margin-top:8px}
@media(max-width:1000px){.pool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.userbar,.scan-bind{margin-left:28px;margin-right:28px}.userbar select{max-width:320px}}
@media(max-width:650px){
 :root{font-size:16px}body{overflow-x:visible}
 .omolab-masthead{padding:10px 20px;gap:0;min-height:68px;flex-wrap:wrap}.omolab-brand{min-height:44px}.omolab-wordmark{font-size:20px}.omolab-links{gap:18px;width:100%;justify-content:space-between;font-size:12px}.omolab-links a{min-height:40px}
 body>header{padding:24px 20px 8px}body>header h1{font-size:23px;white-space:normal;overflow:visible;text-overflow:clip}body>header h1 a{margin:8px 0 0;display:flex}
 main,main.wrap{padding:18px 20px 32px}main>h1{font-size:25px;margin:4px 0 12px}h2{font-size:19px}h3{font-size:17px}
 .panel,main>.card{padding:20px;border-radius:16px;margin-bottom:16px}.panel h2{font-size:19px;margin:0 0 16px}.card{padding:16px}
 main.auth-wrap{padding:12px 20px 32px;margin-top:20px}.auth-wrap .panel{padding:26px}.auth-wrap h2{font-size:26px}.auth-wrap .panel h2{font-size:26px}
 body:has(#login)> .panel{margin:32px auto;padding:26px}
 .grid,.settings{grid-template-columns:1fr;gap:14px}.pool-grid{grid-template-columns:1fr;gap:14px}
 .pool-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.pool-card h3{margin-bottom:14px}.pool-action{padding:12px}
 .action-value,.action-time{font-size:12px}.history-chart{height:120px}.led-label{font-size:12px}
 #appPage>nav{max-width:calc(100% - 40px);margin:12px 20px 16px}#appPage>nav button{padding:9px 16px;font-size:13px}
 .userbar{margin:0 20px;padding:16px;gap:12px}.userbar>.muted{width:100%}.userbar label{width:100%;display:flex!important;flex-wrap:wrap;gap:8px!important}.userbar select{width:100%;max-width:100%;min-width:0;flex:1;font-size:14px}.userbar button{flex:1}
 .subnav{margin:0 0 18px;padding:0;flex-wrap:wrap;overflow:visible;gap:4px}.subnav button{padding:8px 11px;font-size:12px;flex:initial;min-height:40px;white-space:normal}
 .scan-bind{margin:16px 20px 0;padding:20px}.scan-bind-actions{align-items:stretch}.scan-bind-actions>label{max-width:100%;flex-basis:100%}
 .device-status-grid{grid-template-columns:1fr;gap:0}.device-status-item{font-size:13px;padding:12px 0}.device-status-item .label{font-size:12px}
 .history-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.history-filters input{font-size:14px;padding:11px 8px}.history-table-wrap table{min-width:540px}
 table,.device-table,.log-table{font-size:12px}th,td{padding:10px}.setting-panel table th,.setting-panel table td{min-width:initial}.setting-panel table th{min-width:120px}.setting-panel table th:first-child{min-width:64px}
 .notice{font-size:13px;padding:12px 14px;line-height:1.8}.row{gap:8px}.row button{flex:1 1 140px}.row:has(>div){grid-template-columns:1fr}
 .values{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.item,.value{padding:14px}.item b,.value b{font-size:20px}.actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.actions button{padding:10px;font-size:13px}
 body:has(#port)>h1,body:has(#port)>p,body:has(#port)>section{width:calc(100% - 40px)}body:has(#port)>section{padding:20px}body:has(#port)>h1{margin-top:24px;font-size:25px}body:has(#port) .row{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* Authenticated controller: direct device selection with settings tabs above the content. */
body:has(#appPage)>header{max-width:1480px}
#appPage>nav{margin-left:max(28px,calc((100% - 1424px)/2))}
#appPage>.userbar{width:calc(100% - 56px);max-width:1424px;margin:0 auto}
.controller-workspace{display:grid;grid-template-columns:228px minmax(0,1fr);gap:24px;align-items:start;width:100%;max-width:1480px;margin:0 auto;padding:24px 28px 40px}
.controller-content{min-width:0}
.controller-content>main{max-width:none;padding:0;margin:0}
.controller-content>.scan-bind{max-width:none;margin:0 0 20px}
.device-sidebar{position:sticky;top:24px;min-width:0;padding:18px 10px;background:var(--ui-panel);border:1px solid var(--ui-line);border-radius:18px;box-shadow:0 2px 8px rgb(0 0 0 / 3%)}
.sidebar-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 8px 14px}
.sidebar-heading h2{font-size:15px;margin:0;letter-spacing:0}
.device-count{min-width:24px;padding:2px 7px;border-radius:7px;background:var(--ui-surface);color:var(--ui-muted);font-size:12px;text-align:center;font-variant-numeric:tabular-nums}
.device-list{display:flex;flex-direction:column;gap:6px;max-height:calc(100dvh - 120px);overflow:auto;padding:4px;scroll-padding:6px}
.device-list-empty{margin:0;padding:10px 6px;color:var(--ui-muted);font-size:13px;line-height:1.7}
button.device-choice{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 18px;gap:4px 6px;justify-content:stretch;align-items:center;width:100%;min-height:66px;padding:12px 10px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--ui-text);text-align:left;touch-action:manipulation}
button.device-choice:hover{background:var(--ui-surface)}
button.device-choice:active{background:#e2edfa}
button.device-choice.selected{background:var(--ui-blue-soft);color:var(--ui-blue);border-color:#c9def8}
.device-choice-name{grid-column:1;min-width:0;font-size:14px;font-weight:600;line-height:1.5;overflow-wrap:anywhere}
.device-choice-id{grid-column:1;min-width:0;font-size:12px;font-weight:400;line-height:1.5;overflow-wrap:anywhere;color:var(--ui-muted)}
.device-choice-mark{grid-column:2;grid-row:1 / span 2;visibility:hidden;text-align:center;font-size:15px;font-weight:600}
.selected>.device-choice-mark{visibility:visible}
#page-settings{display:block;min-width:0}
#page-settings>.subnav{display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;margin:0 0 20px;padding:0;background:transparent;border:0;overflow:visible;white-space:normal}
#page-settings>.subnav button{width:auto;min-height:44px;padding:8px 14px;touch-action:manipulation}
#page-settings>.setting-panel,#page-settings>#page-calibration{min-width:0}
.settings-actions{grid-column:1;grid-row:2;display:flex;align-items:center;justify-content:flex-end;gap:12px;min-width:0}
.settings-actions>#saveMsg{font-size:13px;min-width:0;overflow-wrap:anywhere;text-align:right}
.settings-actions>#saveBtn{flex-shrink:0}
#page-settings:has(#page-calibration:not(.hidden))>.settings-actions,#page-settings:has(#setting-history:not(.hidden))>.settings-actions,#page-settings:has(#setting-logs:not(.hidden))>.settings-actions,#page-settings:has(#setting-ota:not(.hidden))>.settings-actions{display:none}
@media(max-width:1100px){
 .controller-workspace{grid-template-columns:204px minmax(0,1fr);gap:18px}
 #page-settings .panel{padding:22px}
}
@media(max-width:800px){
 .controller-workspace{grid-template-columns:1fr;gap:18px;padding:20px 28px 32px}
 .device-sidebar{position:static;padding:14px 12px}
 .sidebar-heading{padding:0 6px 8px}
 .device-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));max-height:232px}
}
@media(max-width:650px){
 #appPage>nav{margin-left:20px}
 #appPage>.userbar{width:calc(100% - 40px);margin:0 auto}
 .controller-workspace{padding:18px 20px 32px;gap:16px}
 .controller-content>.scan-bind{margin:0 0 16px}
 #page-settings .panel{padding:20px}
 #page-settings>.subnav{gap:4px;margin-bottom:18px}
 #page-settings>.subnav button{font-size:12px;padding:8px 11px}
 .settings-actions{align-items:flex-end;flex-wrap:wrap}
 .settings-actions>#saveMsg{flex:1 1 150px}
}
.device-sidebar>[hidden]{display:none!important}
#setting-device .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:650px){#setting-device .grid{grid-template-columns:1fr}}
