/* Extend the SLOW LOCK palette and typography; the equipment list is the working surface. */
.devices-page [hidden]{display:none!important}
.devices-page main{max-width:1440px;margin:50px auto 80px;padding:0 56px}
.devices-page nav{display:flex;gap:24px;font-size:13px;align-items:center}
.devices-page nav a{color:var(--muted);text-decoration:none;white-space:nowrap}
.devices-page nav a[aria-current]{color:var(--ink);text-decoration:underline;text-underline-offset:7px}
.devices-page .page-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:26px}
.devices-page h1{font-family:"Noto Serif TC","Songti TC",serif;font-weight:700;font-size:clamp(30px,3.6vw,52px);line-height:1.35;letter-spacing:-.025em;margin:15px 0 18px}
.devices-page h2{font-size:21px;margin:0 0 8px}
.devices-page h3{font-size:17px;margin:26px 0 12px}
.devices-page .brand-name{font-size:14px;margin:0;color:var(--green)}
.devices-page .brand-name span{color:var(--muted);margin-left:10px}
.devices-page .intro{color:var(--muted);margin:0}
.devices-page .mode-label{border:1px solid var(--amber);color:var(--amber);border-radius:30px;padding:7px 15px;font-size:12px;white-space:nowrap}
.devices-page .mode-notice{background:#f2efe5;border-left:3px solid var(--amber);padding:14px 18px;font-size:13px;line-height:1.8}
.devices-page :is(#notice,#aguard-notice){min-height:24px;font-size:14px;overflow-wrap:anywhere}
.devices-page :is(#notice,#aguard-notice).error,.devices-page .error{color:var(--red)}
.devices-page :is(#auth,#aguard-auth){padding:30px 0;border-top:1px solid var(--line)}
.devices-page .button-link{display:inline-block;padding:10px 22px;background:var(--green);color:white;border-radius:24px;text-decoration:none;margin:10px 12px 10px 0}
.devices-page .connection-bar{display:flex;justify-content:space-between;gap:24px;padding:24px 0 30px;border-bottom:1px solid var(--line)}
.devices-page .connection-bar p{margin:4px 0}
.devices-page .source-tag{font-size:11px;font-weight:400;background:var(--soft);padding:4px 9px;border-radius:6px;vertical-align:middle;margin-left:6px}
.devices-page .toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.devices-page button{font-size:13px;min-height:42px;white-space:normal}
.devices-page .fine{font-size:12px;color:var(--muted);line-height:1.75}
.devices-page .inventory-heading{display:flex;justify-content:space-between;align-items:baseline;gap:15px;margin:32px 0 18px}
.devices-page .filters{display:flex;gap:16px;align-items:end;flex-wrap:wrap;margin-bottom:22px}
.devices-page label{display:flex;flex-direction:column;gap:8px;font-size:12px;color:var(--muted);min-width:0}
.devices-page input,.devices-page select{width:100%;min-height:43px;padding:9px 12px;border:1px solid var(--line);border-radius:7px;background:var(--paper);color:var(--ink);font:inherit;font-size:14px;min-width:0}
.devices-page .filters label:first-child{flex:1;min-width:180px}
.devices-page .filters label:not(:first-child){min-width:150px}
.devices-page .check-label{flex-direction:row;align-items:center;gap:8px;padding:10px 0;color:var(--ink)}
.devices-page input[type=checkbox]{width:17px;min-height:17px;accent-color:var(--green)}
.devices-page .equipment-workspace{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:38px;align-items:start}
.devices-page .equipment-inventory{min-width:0}
.devices-page .list-columns{display:flex;justify-content:space-between;color:var(--muted);font-size:11px;padding:0 16px 10px;border-bottom:1px solid var(--line)}
.devices-page .device-row{width:100%;display:flex;gap:12px;justify-content:space-between;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;padding:18px 16px;min-height:86px;color:var(--ink)}
.devices-page .device-row[aria-pressed=true]{background:var(--soft);box-shadow:inset 3px 0 var(--green)}
.devices-page .device-row:hover{background:var(--soft)}
.devices-page .device-name{display:block;font-size:15px;margin-bottom:5px;overflow-wrap:anywhere}
.devices-page .device-subtitle{display:block;font-size:11px;color:var(--muted)}
.devices-page .device-row-meta{max-width:46%;text-align:right;font-size:12px;overflow-wrap:anywhere}
.devices-page .device-state{display:block;color:var(--muted);margin-top:5px}
.devices-page .equipment-detail{border:1px solid var(--line);border-radius:12px;padding:26px;min-width:0;background:var(--paper)}
.devices-page .device-facts{display:grid;gap:9px;margin:18px 0;font-size:12px}
.devices-page .device-facts div{display:grid;grid-template-columns:95px minmax(0,1fr);gap:12px}
.devices-page dt{color:var(--muted)}
.devices-page dd{margin:0;overflow-wrap:anywhere}
.devices-page .operation-buttons{display:flex;gap:10px;flex-wrap:wrap}
.devices-page .operation-buttons [data-operation],.devices-page .locker-presets button,.devices-page .device-access-review [data-access-profile]{min-width:88px;min-height:44px;padding:10px 24px;border:1px solid var(--line);border-radius:999px;background:var(--paper);color:var(--ink);font-weight:600;white-space:nowrap}
.devices-page .operation-buttons [data-operation="on"][aria-pressed="true"]{background:var(--green);border-color:var(--green);color:#fff}
.devices-page .operation-buttons [data-operation]:not(:disabled):hover,.devices-page .locker-presets button:not(:disabled):hover,.devices-page .device-access-review [data-access-profile]:not(:disabled):hover{box-shadow:0 0 0 2px var(--line)}
.devices-page .device-editor{border-top:1px solid var(--line);margin-top:25px;padding-top:20px}
.devices-page .device-editor summary{cursor:pointer;font-size:14px}
.devices-page .device-editor form{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:20px}
.devices-page .span-all{grid-column:1/-1}
.devices-page .room-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:240px;overflow:auto;border:1px solid var(--line);padding:12px;border-radius:7px}
.devices-page .room-choices .check-label{padding:5px 0;font-size:13px;overflow-wrap:anywhere}
.devices-page .events{border-top:1px solid var(--line);margin-top:38px;padding-top:22px}
.devices-page .events summary{cursor:pointer}
.devices-page .event-row{display:flex;justify-content:space-between;gap:20px;border-bottom:1px solid var(--line);padding:12px 0;font-size:12px}
.devices-page dialog{width:min(580px,calc(100% - 28px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid var(--line);border-radius:14px;background:var(--paper);color:var(--ink);padding:28px}
.devices-page dialog::backdrop{background:#20201e70}
.devices-page dialog form>label{margin:18px 0}
.devices-page .dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}
.devices-page dialog p{font-size:13px}
.devices-page small{font-size:11px;line-height:1.7}
.devices-page .form-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:18px}
.devices-page .empty{padding:28px 16px;color:var(--muted);font-size:14px;line-height:1.8}
.devices-page .state-warning{color:var(--amber)}
@media(max-width:960px){.devices-page main{padding:0 28px}.devices-page .equipment-workspace{gap:22px}.devices-page .connection-bar{flex-direction:column}.devices-page .equipment-detail{padding:20px}}
@media(max-width:680px){.devices-page .topbar{align-items:flex-start;gap:18px;flex-direction:column}.devices-page nav{gap:22px;flex-wrap:wrap}.devices-page main{margin-top:30px;padding:0 20px}.devices-page .page-heading{flex-direction:column;gap:18px}.devices-page .inventory-heading{align-items:flex-start;flex-direction:column;gap:0}.devices-page .equipment-workspace{grid-template-columns:1fr}.devices-page .equipment-inventory{max-height:420px;overflow:auto}.devices-page .equipment-detail{padding:20px}.devices-page .filters{gap:12px}.devices-page .filters label:first-child{flex-basis:100%}.devices-page .filters label:not(:first-child){min-width:0;flex:1}.devices-page .filters :is(#pendingLabel,#aguard-pendingLabel){flex-basis:100%}.devices-page .toolbar button{flex:1}.devices-page .device-editor form{grid-template-columns:1fr}.devices-page .device-facts div{grid-template-columns:88px minmax(0,1fr)}.devices-page .event-row{flex-direction:column;gap:4px}.devices-page dialog{padding:20px}.devices-page .mode-label{font-size:11px}.devices-page .room-choices{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.devices-page *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.provider-workspace{margin:0;padding:0 0 40px}.provider-workspace .connection-bar h2{font-family:inherit}.provider-workspace .inventory-heading{margin-top:24px}.provider-workspace .device-row{box-shadow:none}.provider-label{display:inline-block;font-size:12px;padding:5px 12px;border:1px solid var(--line);border-radius:18px;margin-top:8px}

.devices-page .operation-buttons [data-operation="off"][aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.devices-page .power-status{font-size:14px;font-weight:600;margin:14px 0 4px}

.devices-page .device-automation{border-top:1px solid var(--line);margin-top:24px;padding-top:20px}
.devices-page .device-automation summary{cursor:pointer;font-size:14px;line-height:1.8}
.devices-page .rule-badge{display:inline-block;border:1px solid var(--amber);border-radius:20px;padding:1px 9px;margin-left:6px;font-size:11px;color:var(--amber)}
.devices-page .rule-notice{border-left:3px solid var(--amber);padding:10px 14px;background:var(--soft);font-size:12px;line-height:1.8;margin-top:18px}
.devices-page .device-rules-form fieldset{border:0;padding:0;margin:22px 0 0;min-width:0}
.devices-page .device-rules-form legend{font-size:15px;font-weight:600;margin-bottom:14px}
.devices-page .device-rules-form>fieldset>label{margin:14px 0}
.devices-page .rule-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:18px 0}
.devices-page .rule-guards{border-block:1px solid var(--line);margin:22px 0;padding:12px 0}
.devices-page .rule-guards p{font-size:13px;font-weight:600;margin:6px 0}
.devices-page .rule-guards .check-label{line-height:1.8;align-items:flex-start}
.devices-page .rule-guards input{flex-shrink:0;margin-top:3px}
.devices-page .rule-events{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;margin-top:12px}
.devices-page .rule-preview{background:var(--soft);padding:16px;margin-top:22px;font-size:13px;line-height:1.9;border-radius:8px}
.devices-page .rule-preview h4{margin:0 0 8px;font-size:13px}.devices-page .rule-preview p{margin:0}
.devices-page .device-rules-form .form-actions{flex-wrap:wrap}
@media(max-width:680px){.devices-page .rule-fields,.devices-page .rule-events{grid-template-columns:1fr}.devices-page .device-rules-form .form-actions button{width:100%}}

.devices-page .order-preview{border-block:1px solid var(--line);padding:26px 0;margin-top:10px}
.devices-page .preview-toolbar{display:flex;gap:16px;align-items:end;flex-wrap:wrap;margin:18px 0}
.devices-page .preview-toolbar label{min-width:140px}
.devices-page .preview-row{display:grid;grid-template-columns:170px minmax(0,1fr) auto;gap:10px 20px;padding:20px 0;border-bottom:1px solid var(--line);font-size:13px}
.devices-page .preview-row time{font-size:12px;color:var(--muted)}
.devices-page .preview-row p{margin:6px 0}.devices-page .preview-row small{display:block;overflow-wrap:anywhere}
.devices-page .preview-result{align-self:start;border:1px solid var(--line);border-radius:20px;padding:5px 12px;font-size:11px}
.devices-page .preview-result.protected{color:var(--green);border-color:var(--green)}.devices-page .preview-result.blocked{color:var(--amber);border-color:var(--amber)}
.devices-page .preview-row .preview-reason{grid-column:2/-1;color:var(--muted);font-size:12px;line-height:1.8}
.devices-page .preview-row button{grid-column:2/-1;justify-self:start}
.devices-page .order-preview details{margin-top:18px}.devices-page .order-preview summary{cursor:pointer;font-size:13px}
@media(max-width:680px){.devices-page .preview-row{grid-template-columns:minmax(0,1fr) auto;gap:10px}.devices-page .preview-row time{grid-column:1/-1}.devices-page .preview-row .preview-reason,.devices-page .preview-row button{grid-column:1/-1}.devices-page .preview-toolbar{gap:12px}.devices-page .preview-toolbar label{min-width:0;flex:1}.devices-page .preview-toolbar button{width:100%}}

.devices-page .locker-setup{margin-top:18px}.devices-page .locker-presets{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}

.device-access-review { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line, #dedbd4); overflow-wrap: anywhere; }
.device-access-review .device-facts { margin-block: 14px; }
.device-access-review li { margin-block: 8px; line-height: 1.7; }

/* Advanced tools are opened from the shared header, leaving the inventory primary. */
.devices-page .management-dialog{width:min(680px,calc(100% - 32px))}
.devices-page .preview-dialog{width:min(1100px,calc(100% - 32px))}
.devices-page :is(.management-dialog,.preview-dialog){max-height:calc(100dvh - 40px);overscroll-behavior:contain;scrollbar-gutter:stable}
.devices-page :is(.management-dialog,.preview-dialog) > .dialog-heading{padding-bottom:16px;border-bottom:1px solid var(--line)}
.devices-page :is(.management-dialog,.preview-dialog) .dialog-heading h2{margin:0;font-size:19px;line-height:1.6}
.devices-page [data-dismiss-panel]{min-width:50px;flex:none;border:1px solid var(--line);border-radius:999px;padding:8px 12px;background:var(--paper);color:var(--ink)}
.devices-page .management-dialog .connection-bar{flex-direction:column;border:0;padding-bottom:0}
.devices-page .preview-dialog .order-preview{margin:0;padding:18px 0 0;border:0}
.devices-page .equipment-refresh{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:9px 16px;border:1px solid var(--line);border-radius:999px;background:var(--paper);color:var(--ink);font-size:12px;white-space:nowrap}
.devices-page .equipment-refresh:not(:disabled):hover{background:var(--soft)}
.devices-page[aria-busy=true] .equipment-refresh svg{animation:equipment-refresh-spin .9s linear infinite;transform-origin:center}
@keyframes equipment-refresh-spin{to{transform:rotate(360deg)}}
.devices-page dialog :is(button,input,select,summary):focus-visible{outline:2px solid var(--green);outline-offset:3px}
@media(max-width:820px){
 .devices-page .inventory-heading{align-items:center}
 .devices-page :is(.management-dialog,.preview-dialog){padding:20px 16px}
 .devices-page .preview-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
 .devices-page .preview-toolbar button{grid-column:1/-1}
 .devices-page .preview-row{padding-inline:0}
}
@media(prefers-reduced-motion:reduce){.devices-page[aria-busy=true] .equipment-refresh svg{animation:none}}

.equipment-detail-screen{min-width:0}
.devices-page .equipment-back{display:none}
@media(max-width:820px){
 .provider-workspace .filters{display:none}
 .provider-workspace .inventory-heading{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:4px 12px;text-align:left}
 .provider-workspace .inventory-heading > div{display:contents}
 .provider-workspace .inventory-heading h2{grid-area:1/1;margin:0;font-size:18px;line-height:1.6}
 .provider-workspace .inventory-heading .fine{grid-area:2/1/auto/-1;font-size:11px;margin:0}
 .provider-workspace .equipment-refresh{grid-area:1/2;align-self:center;min-width:44px;width:44px;height:44px;padding:0;margin:0}
 .provider-workspace .equipment-refresh span{display:none}
 .provider-workspace .equipment-refresh svg{width:18px;height:18px}
 .provider-workspace .equipment-workspace{display:block}
 .provider-workspace .equipment-inventory{max-height:none;overflow:visible}
 .provider-workspace .equipment-detail-screen{display:none}
 .provider-workspace.device-detail-active .equipment-detail-screen{display:block;animation:equipment-detail-in .2s ease-out}
 .provider-workspace.device-detail-active :is(.inventory-heading,.filters,.equipment-inventory,.events){display:none}
 .provider-workspace .equipment-back{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:9px 15px;margin:4px 0 16px;border:1px solid var(--line);border-radius:999px;background:var(--paper);color:var(--ink)}
 .provider-workspace .equipment-detail:focus{outline:none}
 body.aguard-mobile-detail #workspaceHeading{display:none}
}
@keyframes equipment-detail-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.provider-workspace.device-detail-active .equipment-detail-screen{animation:none}}
.motion-paused .provider-workspace.device-detail-active .equipment-detail-screen{animation:none}
