/* App presentation. All device state and command semantics stay in the existing modules. */
:root{font-family:'Segoe UI',Arial,sans-serif;font-synthesis:weight;color:#26252e;background:#f7f7fb;--forest:#26252e;--olive:#d3c1ff;--muted:#72717c;--line:#e7e6ee;--accent:#6950a1;--soft:#eee8fa}
body{min-width:0}button,input,select{font-size:16px}button{touch-action:manipulation;border-radius:14px;background:#f0eff5;color:#3e3b4a;min-height:48px;font-weight:600}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline-color:#8060b8}
input,select{border-color:#dedde7;border-radius:14px;color:#26252e;min-height:48px}input[type=checkbox]{accent-color:#6950a1}label{color:#65616e}
.primary,.device-actions .on-command,.schedule-card>button:first-of-type,.schedule-form>button{background:#27242f;border-color:#27242f;color:#fff}.secondary{color:#4e4262;border-color:#ded7ec}
.sidebar{background:#24222d;padding-top:38px}.brand{color:#d3c1ff}.brand small{color:#b9b3c8}.sidebar nav button{border-radius:16px;color:#c8c3d4}.sidebar nav button:hover{background:#332f40}.sidebar nav button[aria-current]{background:#d3c1ff;color:#292034}.aside-foot{color:#ccc5d7}.aside-foot small{color:#aaa0b9}.home-mark{color:#b6a3d4}#logout{color:#e0d9ee;border-color:#5b5368}
main{padding-top:24px}.app-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:28px;min-height:48px}.app-wordmark{font-size:16px;font-weight:800;letter-spacing:2px}.app-wordmark>span{font-size:10px;font-weight:500;color:#8b8495;letter-spacing:1px}#app-install{font-size:12px;min-height:44px;background:#fff;border-color:#e2dcea;padding:9px 14px}#app-install span{margin-inline-start:8px;font-size:18px}.page-header{margin-bottom:26px}.page-header .eyebrow{display:none}h1{letter-spacing:-1px;font-weight:750;font-size:38px;margin-top:0}.clock strong{font-variant-numeric:tabular-nums;font-weight:650}.page-header p,.clock span{color:#787280}.eyebrow{color:#81738e}
.notice{background:#f0eafb;border-color:#e2d6f3;color:#59456f}.connection-notice{background:#fff1db;border-color:#efcf94;color:#705113}
.metrics{gap:0;background:#ede7f8;border:1px solid #e1d7ee;border-radius:22px;padding:19px 6px;overflow:hidden;margin-bottom:28px}.metric{background:transparent;border:0;border-radius:0;padding:0 24px;min-width:0}.metric:not(:first-child){border-inline-start:1px solid #d9cde9}.metric>span,.metric small{color:#70607f}.metric strong{font-size:32px;font-weight:750;color:#382843;line-height:1.2;margin:8px 0}.metric small{display:block}button.metric:hover{background:#e4daf2;border-color:#d9cde9}
.filter-heading h2{font-size:22px;font-weight:700}.filters{gap:12px}.check-label{font-size:13px}.room-chip{background:#fff;color:#6e6579;border-color:#e7e1ed;min-height:46px;padding:10px 19px;font-size:13px}.room-chip[aria-pressed=true]{background:#292432;border-color:#292432;color:#fff}.room-chips{gap:9px}.device-grid{gap:16px}.device-grid>h3{font-weight:600;color:#756b82}
.device{border-radius:22px;border-color:#e9e5ef;padding:22px;box-shadow:0 3px 12px #27212f03}.device-head strong{color:#2e2739;font-size:18px}.device-head .room{color:#84768e;font-size:12px}.device .state{font-size:14px;color:#4d4558;margin:18px 0}.device-visual{border-radius:16px;background:#f5f1fa;padding:7px;width:54px;height:54px}.device-visual svg{width:40px;height:40px}.device-actions{gap:10px}.device-actions button{min-height:50px;border-radius:14px}.device small{color:#89808f}.device.stale{border-style:dashed;background:#fcfbfd}.device.stale .state{color:#866741}.device .read-only{background:#f3eff7;color:#746582}.device .command-status{color:#765398;min-height:0;margin:10px 0 0}.device .command-status:empty{display:none}.device .command-status:not(:empty){border-radius:12px;padding:10px;background:#f3edf9}
.shutter-target-value{color:#5b4080}.shutter-range::-webkit-slider-runnable-track{background:#e5dbee}.shutter-range::-webkit-slider-thumb{background:#72529e}.shutter-range::-moz-range-track{background:#e5dbee}.shutter-range::-moz-range-thumb{background:#72529e}
.schedule-card{border-radius:22px;border-color:#e9e5ef}.schedule-card .card-symbol{background:#eee6f7;color:#7b5a9c}.schedule-card p,.history-event{color:#655d6e}.schedule-card [role=status]:not(:empty){background:#f1eaf8}.schedule-card summary{color:#74538c;min-height:48px}.days label:has(:checked){background:#eee5f8;border-color:#bda1d5}.history-list{border-radius:22px}.auth-panel{border-radius:26px;border-color:#e5dfed;box-shadow:0 20px 65px #3c235309}.auth-symbol{color:#9674b7}footer{color:#8b8294}
#install-dialog{width:min(460px,calc(100% - 28px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid #e6dfed;border-radius:26px;padding:28px;color:#302739;background:#fff;box-shadow:0 25px 90px #21132935}#install-dialog::backdrop{background:#211b3280;backdrop-filter:blur(5px)}.install-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}.install-heading img{border-radius:15px}#install-close{font-size:25px;min-width:48px;background:#f5f1f8;border:0}#install-dialog h2{font-size:28px;letter-spacing:-.5px;margin:12px 0}#install-dialog h3{margin:22px 0 6px;font-size:15px}#install-dialog p{font-size:14px;color:#786a83;margin:8px 0}#install-native{width:100%;margin:16px 0}#install-dialog .install-note{border-top:1px solid #e8e0ee;padding-top:16px;margin-top:22px;font-size:12px}
@media(min-width:761px) and (max-width:1100px){.sidebar{width:100px;padding:30px 12px}.brand{font-size:34px;text-align:center}.brand span{font-size:25px}.brand small{font-size:11px}.sidebar nav{margin-top:40px}.sidebar nav button{display:grid;justify-items:center;gap:6px;font-size:11px;padding:12px 3px}.aside-foot p,.aside-foot small,.home-mark{display:none}#logout{padding:12px 2px;font-size:11px}main{margin-right:100px;padding:22px 24px}.metric{padding:0 12px}.metric small{font-size:10px}.device{padding:18px}.device-actions{gap:6px}.device-actions button{padding:10px 6px}.filters{grid-template-columns:2fr 1fr}.device-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){
 .sidebar{background:transparent;padding:22px 20px 0}.brand{color:#3d2c4d}.brand small{color:#81718e}.signed-in .sidebar{background:#fffefef5;border:1px solid #e8e2ee;border-bottom:0;border-radius:24px 24px 0 0;padding:9px max(10px,env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));height:calc(80px + env(safe-area-inset-bottom));box-shadow:0 -5px 30px #35233d08;backdrop-filter:blur(18px)}
 .sidebar nav{gap:5px}.sidebar nav button{color:#8b8095;border-radius:15px;min-height:58px;font-size:11px;gap:5px}.sidebar nav button[aria-current]{background:#eee5fb;color:#563b75}.sidebar nav button:hover{background:#f3edf9}.nav-symbol{font-weight:500}.signed-in #logout{position:static;min-height:44px;padding:9px 12px;font-size:12px;border-radius:12px;color:#746283;background:#f1ecf6;border:1px solid #e3d9ec}.signed-in .aside-foot{position:absolute;bottom:calc(100% + 8px);left:max(14px,env(safe-area-inset-left));margin:0}.signed-in .aside-foot{display:none}
 main{padding:16px max(18px,env(safe-area-inset-right)) 30px max(18px,env(safe-area-inset-left))}.signed-in main{padding-top:max(14px,env(safe-area-inset-top));padding-bottom:calc(108px + env(safe-area-inset-bottom))}.app-toolbar{margin-bottom:24px;min-height:44px}.app-wordmark{font-size:14px}.app-wordmark>span{font-size:9px}#app-install{font-size:11px;padding:8px 11px;min-height:44px}.page-header{gap:12px;margin-bottom:23px}h1{font-size:30px;letter-spacing:-.8px}.clock strong{font-size:23px}.clock{max-width:112px}.page-header p{font-size:12px}.clock span{font-size:10px}
 .metrics{grid-template-columns:repeat(4,minmax(0,1fr));padding:15px 3px;margin-bottom:27px;border-radius:20px}.metric{padding:0 7px}.metric>span{font-size:10px}.metric strong{font-size:25px;margin:6px 0}.metric small{font-size:9px;line-height:1.5}.filter-heading h2{font-size:21px}.filter-heading p{font-size:11px;margin-top:7px}.filters{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:12px;margin-top:16px}.filters label{font-size:12px}.filters .check-label{min-height:44px;margin-top:-4px}.filters input,.filters select{font-size:16px;padding:11px 12px}.room-chips{margin-top:10px;scroll-padding-inline:4px}.room-chip{min-height:46px;padding:10px 17px}.device-grid{grid-template-columns:1fr;gap:12px}.device{padding:20px;border-radius:21px}.device-head strong{font-size:18px}.device .state{margin:15px 0}.device-actions button{min-height:50px}.notice{margin-bottom:18px}.auth-panel{margin-top:20px}.auth-panel .primary{min-height:52px}.app-standalone .app-toolbar{margin-bottom:16px}
 #install-dialog{padding:24px;border-radius:24px}.section-heading h2{font-size:24px}footer{font-size:11px}
}
@media(min-width:560px) and (max-width:760px){.device-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.device{padding:17px}.device-head strong{font-size:16px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important}}
.app-toolbar-actions{display:flex;align-items:center;gap:8px}.app-toolbar #logout,.signed-in .app-toolbar #logout{position:static;margin:0;min-height:44px;padding:9px 12px;font-size:12px;border-radius:12px;color:#746283;background:#f1ecf6;border:1px solid #e3d9ec}.app-toolbar{flex-wrap:wrap}
@media(max-width:760px){.app-toolbar{margin-bottom:14px}.page-header{margin-bottom:18px}.page-header .clock{display:none}h1{font-size:29px;margin-bottom:6px}.metrics{padding:12px 3px;margin-bottom:20px}.metric strong{font-size:24px;margin:4px 0}.metric small{font-size:8px}.filter-heading p{display:none}.filters{margin-top:12px;gap:8px}.filters .check-label{min-height:40px}.room-chips{margin-top:2px}.room-chips::-webkit-scrollbar{height:3px}.room-chips::-webkit-scrollbar-thumb{background:#ded2ea;border-radius:5px}#device-count{margin:8px 0;font-size:11px}.device-grid>h3{margin:0}.device-grid{gap:10px}}
@media(max-width:360px){.app-wordmark>span{display:none}.app-wordmark{font-size:12px;letter-spacing:1px}.app-toolbar{gap:6px}.app-toolbar-actions{gap:5px}#app-install{font-size:10px;padding:8px}.app-toolbar #logout{padding:8px}.metric small{display:none}.metric>span{font-size:9px}.metric{padding:0 5px}.metric strong{margin-bottom:0}}
