/* Shared visual theme; device commands and observed state are unchanged. */
:root{font-synthesis:none;color:#40352b;background:#f3efe7;--forest:#40352b;--olive:#c4aa7b;--muted:#776b5e;--line:#ded5c7;--accent:#866637;--soft:#eee6d9;--shadow:0 8px 24px #5945260b,0 1px 3px #59452606}
body{background:radial-gradient(ellipse at 8% 0%,#fffdf8 0,transparent 46%),#f3efe7}
button{background:#f5f0e7;color:#514333;border-color:var(--line)}button:hover:not(:disabled){background:#ece2d2;border-color:#b5a184}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline-color:#866637}
input,select{border-color:#cfc4b4;color:#40352b;background:#fffdf9}input[type=checkbox]{accent-color:#866637}label{color:#6b5b49}
.primary,.device-actions .on-command,.schedule-card>button:first-of-type,.schedule-form>button{background:#594735;border-color:#594735;color:#fffaf1;box-shadow:0 4px 9px #59452612}
.primary:hover:not(:disabled),.device-actions .on-command:hover:not(:disabled),.schedule-card>button:first-of-type:hover:not(:disabled),.schedule-form>button:hover:not(:disabled){background:#403225;border-color:#403225}
.secondary{background:#fcfaf5;color:#665039;border-color:#cfc0a9}
.sidebar{background:linear-gradient(165deg,#eee5d7,#f8f4ed 65%);border-left:1px solid #d9cbb5;color:#40352b}
.brand{font-family:Georgia,'Times New Roman',serif;font-size:32px;font-weight:500;letter-spacing:2px;color:#40352b}.brand span{font-size:15px;letter-spacing:2px;font-weight:400}.brand small{color:#7c6b55;font-family:'Segoe UI',Arial,sans-serif;letter-spacing:0}
.sidebar nav button{color:#746450}.sidebar nav button:hover{background:#e9dfce}.sidebar nav button[aria-current]{background:#594735;color:#fffaf1;box-shadow:0 5px 14px #58412417}.aside-foot{color:#75634e}.aside-foot small{color:#7c6b55}.home-mark{color:#a38451}
.app-toolbar{padding-bottom:18px;border-bottom:1px solid #ddd0bd}.app-wordmark{font-size:19px;font-weight:650;letter-spacing:4px;color:#40352b}.app-wordmark>span{font-size:14px;font-weight:400;letter-spacing:3px;color:#77634b}
#app-install,.app-toolbar #logout,.signed-in .app-toolbar #logout{color:#69553d;background:#fcfaf5;border-color:#d7c9b4}
.page-header{position:relative;isolation:isolate;min-height:140px;padding:12px 0 24px}.page-header::before{content:'';position:absolute;z-index:-1;inset:-16px -14px -4px;pointer-events:none;border-radius:26px;background:linear-gradient(116deg,transparent 20%,#fffaf580 21%,#fffaf520 31%,transparent 32%,transparent 40%,#fffaf599 41%,#fffaf522 53%,transparent 54%)}
h1{font-size:48px;font-weight:650;color:#403225;letter-spacing:-1.4px;line-height:1.15;margin:0 0 10px}.page-header p{font-size:18px;color:#80705d}.clock strong{font-weight:350;color:#5f4c36}.clock span,.eyebrow{color:#7c6a55}
.notice{background:#eee4d2;border-color:#d8c4a3;color:#655030}.connection-notice{background:#fff0d5;border-color:#c7a767;color:#6b4815}
.metrics{padding:22px 8px;border-color:#d9cbb7;border-radius:20px;background:linear-gradient(120deg,#fffdf9,#f7f1e7);box-shadow:var(--shadow);margin-bottom:32px}.metric{color:#40352b}.metric:not(:first-child){border-color:#dfd1bc}.metric>span,.metric small{color:#78644c}.metric strong{font-size:34px;font-weight:550;color:#51402d}button.metric:hover{background:#f1e7d7;border-color:#dfd1bc}
.filter-heading h2{font-size:24px;font-weight:600}.filter-heading p{color:#776b5e}.room-chip{background:#faf7f1;border-color:#d6c9b6;color:#725f46;padding:10px 22px;font-size:14px;border-radius:14px;box-shadow:0 2px 5px #59452605}.room-chip[aria-pressed=true]{background:#594735;border-color:#594735;color:#fffaf1;box-shadow:0 4px 10px #59452619}
.device-grid{gap:20px}.device-grid>h3{display:flex;align-items:center;gap:18px;font-size:17px;font-weight:500;color:#7c6447;margin:6px 0}.device-grid>h3::after{content:'';height:1px;flex:1;background:linear-gradient(to left,#c6ae89,transparent)}
.device{background:linear-gradient(125deg,#fffdf9,#faf6ef);border-color:#dbcfbd;border-radius:21px;padding:24px;box-shadow:var(--shadow)}.device-head{gap:16px}.device-head strong{font-size:20px;font-weight:650;color:#493929}.device-head .room{color:#80705c;margin-bottom:4px}
.device-visual{display:grid;place-items:center;width:76px;height:76px;padding:12px;border-radius:17px;border:1px solid #e7ddce;background:radial-gradient(ellipse at 30% 20%,#fffdf8,#e8dfd0);box-shadow:inset 0 1px 2px #fff,0 5px 10px #5b43230a}.device-visual svg{width:50px;height:50px}
.light-bulb{fill:#e6ddce;stroke:#98846a}.light-filament,.light-base,.light-rays{stroke:#968065}.light-visual.on .light-halo{fill:#f8e8be}.light-visual.on .light-bulb{fill:#e8c77f;stroke:#a37d3b}.light-visual.on .light-rays{stroke:#b18a49}.light-visual.on .light-filament{stroke:#8b6327}.light-visual.unknown .light-bulb{fill:#ede7dd}
.device .state{color:#6b553b}.device small{color:#7d6f5f}.device-actions .on-command{background:linear-gradient(115deg,#917243,#73532d);border-color:#87683e;color:white}.device.stale{background:#f5f1e9}.device.stale .state{color:#806136}.device .read-only{background:#eee7db;color:#726047}.device .command-status{color:#75572c}.device .command-status:not(:empty){border:1px solid #ded0b6;background:#f2e9d9}
.shutter-position output,.shutter-target-value{color:#6c5130;font-size:28px;font-weight:550}.shutter-range{accent-color:#997b4c}.shutter-range::-webkit-slider-runnable-track{background:linear-gradient(#d8cebf,#e8e0d3);border:1px solid #cbbda7}.shutter-range::-webkit-slider-thumb{background:linear-gradient(120deg,#d9c397,#9c7b48);border:2px solid #fbf4e6;box-shadow:0 2px 5px #62492440}.shutter-range::-moz-range-track{background:#e2d7c7;border:1px solid #cbbda7}.shutter-range::-moz-range-thumb{background:#a28653;border:2px solid #fbf4e6;box-shadow:0 2px 5px #62492440}.shutter-adjust button{background:#f6efe3;border-color:#d5c5ab}.shutter-adjust span,.shutter-scale{color:#77644b}
.schedule-card,.history-list,.panel{background:linear-gradient(120deg,#fffdf9,#faf6ef);border-color:#dbcfbd;border-radius:21px;box-shadow:var(--shadow)}.schedule-card .card-symbol{background:#eee3ce;color:#907142}.schedule-card p,.history-event{color:#695840}.schedule-card [role=status]:not(:empty){background:#eee4d2}.schedule-card summary{color:#775a32}.days legend{color:#756046}.days label:has(:checked){background:#eee1c9;border-color:#b59969}.history-event{border-color:#e2d7c5}.empty{background:#fcfaf5;border-color:#d0c0a7;color:#77644b}
.auth-panel{border-radius:26px;box-shadow:0 20px 65px #60462310}.auth-symbol{color:#aa8851}footer{color:#7a6c59}
#install-dialog{border-color:#d7c5a8;color:#40352b;background:#fcfaf5;box-shadow:0 25px 90px #3c2c2535}#install-dialog::backdrop{background:#352a205f}#install-close{background:#eee5d7}#install-dialog p{color:#75644f}#install-dialog .install-note{border-color:#e0d3bf}
@media(min-width:761px) and (max-width:1100px){.brand{font-size:17px;letter-spacing:1px}.brand span{font-size:10px;letter-spacing:1px}.device{padding:20px}.device-head strong{font-size:18px}.device-visual{width:60px;height:60px;padding:7px}.metric strong{font-size:28px}}
@media(max-width:760px){
 .sidebar{background:transparent;border:0}.brand{font-size:25px;color:#40352b}.brand span{font-size:13px}.brand small{display:none}.signed-in .sidebar{background:#fcfaf5f5;border-color:#d6c6aa;box-shadow:0 -5px 30px #5945260a}.sidebar nav button{color:#82705a}.sidebar nav button[aria-current]{background:#eee1c9;color:#594122;box-shadow:inset 0 1px 0 #fff5df}.sidebar nav button:hover{background:#f0e7d8}
 .app-toolbar{margin-bottom:20px;padding-bottom:14px}.app-wordmark{font-size:15px;letter-spacing:2px}.app-wordmark>span{font-size:11px;letter-spacing:2px}.page-header{min-height:116px;margin-bottom:18px;padding:16px 0 20px}h1{font-size:38px;letter-spacing:-1px;margin-bottom:8px}.page-header p{font-size:16px}.page-header::before{inset:-10px -10px 0}
 .metrics{padding:17px 3px;margin-bottom:25px;border-radius:17px}.metric strong{font-size:26px;margin:6px 0}.metric small{font-size:9px}.filter-heading h2{font-size:22px}.room-chip{padding:10px 19px}.room-chips::-webkit-scrollbar-thumb{background:#cfbd9e}.device-grid{gap:15px}.device-grid>h3{font-size:14px;margin:2px 0}.device{padding:20px;border-radius:20px}.device-head strong{font-size:20px}.device-visual{width:70px;height:70px;padding:10px}.device .state{margin:16px 0}
}
@media(min-width:560px) and (max-width:760px){.device{padding:17px}.device-head strong{font-size:17px}.device-visual{width:56px;height:56px;padding:6px}}
@media(max-width:360px){.app-wordmark{font-size:13px;letter-spacing:1px}.device{padding:17px}.device-head strong{font-size:18px}h1{font-size:35px}.metric strong{font-size:24px}}

/* Mobile review: keep the first actions within reach while retaining the warm theme. */
@media(min-width:761px) and (max-width:1100px){
 .app-toolbar{padding-bottom:12px;margin-bottom:16px}
 .page-header{min-height:0;padding:8px 0 14px;margin-bottom:18px}h1{font-size:38px}.page-header p{font-size:15px}
 .metrics{padding:14px 4px;margin-bottom:24px}.metric strong{font-size:28px;margin:4px 0}
 .filter-heading{display:flex;align-items:center;gap:12px}.filter-heading h2{font-size:22px;flex-shrink:0}.filter-heading p{font-size:11px;margin:0}
 .filters{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) auto;margin-top:12px;gap:10px}
 .filters .check-label{grid-column:auto;min-height:48px;font-size:12px}
 .room-chips{margin-top:14px}.device-grid{gap:16px}
}
@media(max-width:760px){
 .app-toolbar{margin-bottom:12px;padding-bottom:10px}
 .page-header{min-height:0;padding:6px 0 10px;margin-bottom:14px}
 h1{font-size:34px;margin-bottom:6px}.page-header p{font-size:14px}
 .metrics{padding:10px 3px;margin-bottom:14px}.metric strong{font-size:25px;margin:4px 0}.metric small{display:none}
 .filter-heading h2{font-size:21px}.filters{margin-top:10px;row-gap:4px}
 .room-chips{margin-top:0;padding-bottom:6px}.device-grid{gap:10px}.device-grid>h3{margin:0}
 .device-visual{width:58px;height:58px;padding:7px}.device-visual svg{width:42px;height:42px}
 .device{padding:18px}.device-head strong{font-size:18px}.device .state{margin:10px 0}
}
@media(max-width:360px){
 .app-wordmark{font-size:12px;letter-spacing:1px}.app-toolbar{gap:6px}.app-toolbar-actions{gap:5px}
 h1{font-size:31px}.metric strong{font-size:23px}.device{padding:17px}
}
.boiler-panel{margin-bottom:24px;max-width:760px}
.boiler-panel form{margin-top:24px}
.boiler-panel input{display:block;width:100%;max-width:320px;direction:ltr;margin-top:8px}
.boiler-panel small{display:block;margin-top:16px;line-height:1.6}
.boiler-panel .boiler-state{font-weight:700}
.boiler-panel .boiler-feedback{font-size:.85rem}
@media(min-width:761px) and (max-width:1100px) and (max-height:820px){
 .app-toolbar{margin-bottom:10px;padding-bottom:8px}.page-header{padding:2px 0 8px}h1{font-size:32px}
 .metrics{padding:8px 4px;margin-bottom:16px}.metric small{display:none}
 .filters{margin-top:8px}.room-chips{margin-top:8px}.device{padding:18px}.device .state{margin:12px 0}
}

/* Switch state carries the emphasis; action buttons never imply observed state. */
:root{--home-active-surface:#eee1c9;--home-active-ink:#594735;--home-active-border:#c4aa7b;--home-active-edge:#866637;--home-active-contrast:#fffaf1}
.device[data-kind=switch]{border:1px solid #cbc4b9;border-inline-start:5px solid #aaa194;background:#fffdf9}
.device[data-kind=switch] .device-head{align-items:flex-start;margin-bottom:18px}
.device[data-kind=switch] .device-head>div:first-child{min-width:0}
.device[data-kind=switch] .state{display:inline-flex;align-items:center;gap:7px;max-width:100%;margin:12px 0 0;padding:0;border:0;border-radius:0;background:transparent;color:#48443e;font-size:14px;font-weight:700;line-height:1.5}
.device[data-kind=switch] .state::before{content:'';box-sizing:border-box;width:10px;height:10px;flex-shrink:0;border:2px solid currentColor;border-radius:50%}
.device[data-kind=switch] .device-head .state-note{display:block;color:#655a4b;font-size:12px;line-height:1.5;margin-top:6px}
.device[data-kind=switch] .device-head .state-note[hidden]{display:none}
.device[data-kind=switch] .device-visual{background:#f0ede7;border-color:#c4bdb1;box-shadow:none}
.device[data-kind=switch] .light-bulb{fill:transparent;stroke:#68635b;stroke-width:2.5}
.device[data-kind=switch] .light-filament,.device[data-kind=switch] .light-base{stroke:#68635b}
.device[data-state=on]{background:var(--home-active-surface);border-color:var(--home-active-border);border-inline-start-color:var(--home-active-edge);box-shadow:0 5px 16px #5945260b}
.device[data-state=on] .state{color:var(--home-active-ink)}
.device[data-state=on] .state::before{background:currentColor}
.device[data-state=on] .device-visual{background:var(--home-active-ink);border-color:var(--home-active-ink);box-shadow:none}
.device[data-state=on] .light-halo{fill:transparent}
.device[data-state=on] .light-bulb{fill:transparent;stroke:var(--home-active-contrast);stroke-width:2.5}
.device[data-state=on] .light-rays,.device[data-state=on] .light-filament,.device[data-state=on] .light-base{stroke:var(--home-active-contrast);stroke-width:2.5}
.device[data-state=stale],.device[data-state=unknown]{background:#f5f2ec;border-color:#bcb3a5;border-style:dashed;border-inline-start-style:solid;border-inline-start-color:#a79b88}
.device[data-state=stale] .state,.device[data-state=unknown] .state{color:#63533e}
.device[data-state=stale] .state::before{content:'◷';border:0;width:auto;height:auto;font-size:18px;line-height:1}
.device[data-state=unknown] .state::before{content:'?';border:0;width:auto;height:auto;font-size:16px;line-height:1}
.device[data-kind=switch] .light-visual.old{opacity:1}
.device[data-kind=switch] .light-visual.old .light-halo{fill:transparent}
.device[data-kind=switch] .light-visual.old .light-rays{opacity:0}
.device[data-kind=switch] .light-visual.old .light-bulb{fill:transparent;stroke:#81776a}
.device[data-kind=switch] .light-visual.old .light-filament,.device[data-kind=switch] .light-visual.old .light-base{stroke:#81776a}
.device[data-kind=switch] .device-actions button{background:#fffdf9;color:#514333;border:1px solid #a99b86;box-shadow:none;font-weight:650}
.device[data-kind=switch] .device-actions button:hover:not(:disabled){background:#eee4d3;border-color:#7c6342}
.device[data-pending=true] .command-status{display:flex;align-items:center;gap:9px;background:#ede8df;color:#514333;border:1px solid #b6a78f}
.device[data-pending=true] .command-status::before{content:'';width:14px;height:14px;flex-shrink:0;border:2px solid #b6a78f;border-top-color:#655035;border-radius:50%;animation:device-wait 1s linear infinite}
@keyframes device-wait{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.device[data-pending=true] .command-status::before{animation:none}}
/* Compact shutters: reported state stays distinct from a temporary requested target. */
.device.shutter-card{border-style:solid;align-self:start;padding:20px}
.shutter-card .device-head{gap:12px;align-items:flex-start}
.shutter-card .device-head>div:first-child{min-width:0}
.shutter-card .device-head strong{font-size:18px;line-height:1.45;margin:0;overflow-wrap:anywhere}
.shutter-card .device-head .room{margin:4px 0 0;font-size:13px;color:#72624e;line-height:1.5}
.shutter-card .device-visual{width:48px;height:48px;padding:6px;border-radius:13px;box-shadow:none}
.shutter-card .device-visual svg{width:34px;height:34px}
.device.shutter-card .state{display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 8px;margin:18px 0 10px;color:#59452f;line-height:1.5}
.shutter-card .shutter-opening{font-size:30px;font-weight:600;font-variant-numeric:tabular-nums}
.shutter-card .shutter-unit{font-size:14px;color:#72624e}
.shutter-card .shutter-freshness{flex-basis:100%;font-size:13px;color:#7a5629}
.shutter-card .shutter-freshness[hidden]{display:none}
.shutter-card .shutter-position{margin-top:0;position:relative;padding-top:22px}
.shutter-card .shutter-control-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.shutter-card .shutter-position output{position:absolute;top:0;inset-inline:0;display:block;font-size:14px;line-height:20px;font-weight:500;direction:rtl;margin:0;color:#59452f}
.shutter-card .shutter-position output[hidden]{display:none}
.shutter-card .shutter-adjust{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:12px;margin:0;align-items:start}
.shutter-card .shutter-adjust button{min-width:44px;min-height:44px;width:44px;height:44px;padding:0;border-radius:12px;font-size:23px;color:#59452f;background:#f6efe3;border-color:#c7b79e}
.shutter-card .shutter-track{min-width:0}
.shutter-card .shutter-range{display:block;width:100%;height:44px;min-height:44px;margin:0}
.shutter-card .shutter-scale{font-size:12px;line-height:1.5;color:#72624e}
.shutter-card .shutter-adjust .shutter-scale span{font-size:12px;color:inherit}
.shutter-card .shutter-details{border-top:1px solid #e0d6c6;margin-top:16px;color:#72624e;font-size:13px;line-height:1.6}
.shutter-card .shutter-details summary{display:list-item;min-height:44px;padding:12px 0 4px;cursor:pointer}
.shutter-card .shutter-details p{font-size:13px;margin:8px 0}
.shutter-card .shutter-details small{font-size:12px;color:#72624e;margin:8px 0 0;overflow-wrap:anywhere}
.shutter-card .shutter-details small:empty{display:none}
.device.shutter-card .command-status:not(:empty){padding:9px 11px;font-size:13px;line-height:1.6}
@media(max-width:360px){.device.shutter-card{padding:17px}.shutter-card .shutter-adjust{gap:8px}}
