:root{--home-temperature-bg:#fff9f2;--home-temperature-accent:#A4512D;font-family:Arial,system-ui,-apple-system,"Segoe UI",sans-serif;color:#14213d;background:#d5e7f5;font-synthesis:none;line-height:1.25}
*{box-sizing:border-box}body{margin:0}main{max-width:460px;margin:auto;padding:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
p,h2,h3{margin:0}.update-line{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 12px;font-size:.8125rem;color:#344b63;margin-bottom:10px}
.appointments>h2{display:flex;gap:10px;align-items:center;font-size:1.4375rem;letter-spacing:-.4px;margin:15px 0 10px}.appointments svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.appointment{display:grid;grid-template-columns:76px minmax(0,1fr);gap:12px;padding:3px;border:1px solid #e5ebf1;border-radius:14px;margin-bottom:7px;background:#fbfcfe}.date-box{border-radius:11px;background:#eaf0f4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:10px 3px;min-height:69px;font-size:1.0625rem}.date-box strong{font-size:1.1875rem}.nearest{background:#fde8eb;color:#7f171e}.event-content{padding:6px 7px 6px 0;min-width:0;align-self:center}.event-time{font-size:1.0625rem;font-weight:750;margin-bottom:2px}h3{font-size:1.25rem;line-height:1.2;font-weight:750;overflow-wrap:anywhere}.location{font-size:.875rem;color:#4a5b70;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px}.duration{font-size:.875rem;margin-bottom:3px;color:#4a5b70}.notice{font-size:.8125rem;line-height:1.35;color:#536277;margin:8px 2px 0}.empty{border:1px solid #e5ebf1;border-radius:14px;padding:18px 14px;font-size:1.125rem;color:#40516b}

.electricity{border:1px solid #dfede5;border-radius:18px;padding:12px;background:#eff8f2}
.energy-heading{display:flex;align-items:center;gap:12px;margin-bottom:12px}.energy-heading h2{font-size:clamp(1.25rem,5.5vw,1.625rem);line-height:1.15}.bolt{flex-shrink:0;display:grid;place-items:center;background:#137a38;color:white;border-radius:50%;height:44px;width:44px}.bolt svg{width:25px;height:33px;fill:currentColor}
.price-card{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center;gap:12px;padding:15px 12px;border-radius:15px;margin-top:9px;--accent:#137a38;--face:#16843c;background:#dff4e5}.price-card.almost-free{--accent:#075b27;--face:#08702d;background:#bce9cb}.price-card.affordable{--accent:#805600;--face:#c18400;background:#fff3ce}.price-card.expensive{--accent:#854400;--face:#d97706;background:#fff0dc}.price-card.very-expensive{--accent:#861826;--face:#a51c28;background:#f8d6da}.state-icon svg{display:block;width:48px;height:48px}.face{fill:var(--face)}.expression{fill:white}.expression path{fill:none;stroke:white;stroke-width:4;stroke-linecap:round}.card-content{min-width:0}.price-card h3{font-size:clamp(1.0625rem,4.7vw,1.375rem);color:var(--accent);line-height:1.15;margin-bottom:5px}.card-hours{font-size:clamp(1.25rem,6.2vw,1.875rem);line-height:1.25;letter-spacing:-.5px;font-weight:800;color:#14213d}.time-block{white-space:nowrap;display:inline-block}.period-separator{font-weight:400;color:#536277}.price-criterion{font-size:.8125rem;line-height:1.35;color:#4a5b70;margin-top:5px}.source-note{font-size:.9375rem;line-height:1.4;margin-top:12px;color:#4a5b70}
@media(min-width:700px){main{max-width:600px}.price-card{grid-template-columns:60px minmax(0,1fr);gap:16px;padding:18px}.state-icon svg{width:60px;height:60px}.price-card h3{font-size:1.5rem}.card-hours{font-size:1.875rem}}
@media(max-width:350px){main{padding-left:10px;padding-right:10px}.price-card{grid-template-columns:36px minmax(0,1fr);gap:8px;padding:12px 9px}.state-icon svg{width:36px;height:36px}}
/* Dial and compact two-column category summary. */
.electricity{background:#fff;padding:12px}.energy-heading{background:#eff8f2;border-radius:12px;padding:10px;margin:-4px -4px 0}.energy-heading h2{font-size:clamp(1.125rem,5vw,1.625rem)}
.tariff-dial{display:block;width:100%;height:auto;margin:0 auto 4px;overflow:visible}.dial-segment{fill:#78b942;stroke:#fff;stroke-width:2;stroke-linejoin:round}.dial-segment.almost-free{fill:#078332}.dial-segment.affordable{fill:#edbd27}.dial-segment.expensive{fill:#f39a27}.dial-segment.very-expensive{fill:#a71929}.dial-marker{fill:#14213d;stroke:white;stroke-width:2}.dial-label{fill:#14213d;font-size:24px;font-weight:800;text-anchor:middle;dominant-baseline:central}.dial-hours{fill:#14213d;font-size:22px;font-weight:800;text-anchor:middle}.dial-caption{fill:#536277;font-size:15px;text-anchor:middle}.dial-bulb{fill:#ffd02b}.bulb-base{fill:#415367}.bulb-rays{fill:none;stroke:#edbb14;stroke-width:6;stroke-linecap:round}
.category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.category-grid .price-card{display:block;margin:0;padding:12px 9px;position:relative}.category-grid .state-icon{float:left;margin:0 7px 5px 0}.category-grid .state-icon svg{width:28px;height:28px}.category-grid .price-card h3{font-size:1rem;line-height:1.2;letter-spacing:-.2px;min-height:28px;padding-top:3px;margin-bottom:5px}.category-grid .card-hours{clear:both;font-size:1rem;line-height:1.35;letter-spacing:-.3px}.category-grid .time-block{display:block}.category-grid .period-separator{display:none}.category-mean{font-size:1rem;font-weight:750;color:#14213d;margin-top:5px;line-height:1.35}.category-mean span{font-size:.8125rem;white-space:nowrap}.category-grid .price-card.cheap{--accent:#336414;--face:#78b942;background:#edf6df}.category-grid .price-card.almost-free{background:#def2e5}
@media(min-width:400px){.category-grid .price-card{padding:13px 11px}.category-grid .price-card h3{font-size:1.125rem}.category-grid .card-hours,.category-mean{font-size:1.125rem}}
@media(min-width:700px){.tariff-dial{max-width:450px}.category-grid .price-card h3{font-size:1.375rem}.category-grid .state-icon svg{width:36px;height:36px}.category-grid .card-hours,.category-mean{font-size:1.25rem}}

.current-price rect{fill:#78b942}.current-price text{fill:#10250d;text-anchor:middle}.current-price.almost-free rect{fill:#08702d}.current-price.almost-free text,.current-price.very-expensive text{fill:#fff}.current-price.affordable rect{fill:#edbd27}.current-price.expensive rect{fill:#f39a27}.current-price.expensive text{fill:#3c2406}.current-price.very-expensive rect{fill:#a71929}.current-price.unavailable rect{fill:#eaf0f4}.current-price.unavailable text{fill:#34475b}.current-label{font-size:17px;font-weight:700}.current-value{font-size:23px;font-weight:800}.current-unit{font-size:15px}.current-missing{font-size:18px;font-weight:700}
/* Today's weather: broad horizontal cards, separate from electricity and appointments. */
.weather-panel{container-type:inline-size;container-name:weather-card;margin-top:12px;border:1px solid #dfe8ef;border-radius:18px;padding:12px;background:#fff}.weather-panel>h2{display:flex;align-items:center;gap:9px;background:#e8f3fb;border-radius:12px;padding:10px;font-size:1.4375rem;line-height:1.2;margin:-4px -4px 10px}.weather-panel>h2>span{display:grid;place-items:center;flex-shrink:0;width:34px;height:34px;border-radius:50%;background:#1684bd;color:#fff;font-size:26px}.rain-alert{display:flex;align-items:center;gap:10px;background:#146ac2;color:#fff;border-radius:12px;padding:12px;font-size:1.25rem;font-weight:750;margin-bottom:10px}.rain-alert>span{font-size:30px;line-height:1}.weather-rows{display:grid;gap:8px}.weather-row{display:grid;grid-template-columns:70px minmax(0,1fr) 90px;gap:8px;align-items:center;border-radius:13px;padding:12px 10px;background:#f1f4f7}.weather-row.current-period{background:#dceefa}.weather-time h3{font-size:1.0625rem;line-height:1.2}.weather-time p{font-size:.8125rem;color:#536277;margin-top:5px;white-space:nowrap}.weather-condition{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;text-align:center}.weather-condition img{display:block;width:42px;height:42px}.weather-description{font-weight:700;font-size:1rem;line-height:1.2;overflow-wrap:anywhere}.rain-indicator{font-size:.875rem;color:#42536a;margin-top:4px}.rain-indicator strong{color:#1269ac}.weather-temperatures{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;border-left:1px solid #d4dfe7;padding-left:8px;text-align:center}.weather-temperatures span{display:block;font-size:.6875rem;color:#536277;margin-bottom:4px}.weather-temperatures strong{font-size:1.5rem;line-height:1;white-space:nowrap}.temperature-low{color:#096ca9}.temperature-high{color:#b32624}.weather-source{font-size:.6875rem;color:#536277;text-align:right;margin-top:8px}.weather-source a{color:inherit}.weather-notice{font-size:.9375rem;color:#536277;line-height:1.4;margin-top:8px}
@container weather-card (min-width:470px){.weather-row{grid-template-columns:90px minmax(0,1fr) 112px;padding:14px 12px;gap:12px}.weather-condition{flex-direction:row;text-align:left;gap:10px}.weather-condition img{width:50px;height:50px}.weather-temperatures strong{font-size:1.875rem}.weather-temperatures span{font-size:.8125rem}.weather-time h3{font-size:1.1875rem}.weather-time p{font-size:.9375rem}}
@media(max-width:350px){.weather-panel{padding:10px}.weather-row{grid-template-columns:62px minmax(0,1fr) 80px;padding:11px 7px;gap:5px}.weather-temperatures{padding-left:5px;gap:3px}.weather-time h3{font-size:1rem}.weather-time p{font-size:.75rem}.weather-description{font-size:.9375rem}}

.weather-panel>h2>span svg{display:block;fill:currentColor}.rain-alert>span svg{display:block}
/* Read-only relay status, visually separate from electricity and weather. */
.termo-panel{margin-top:12px;border:1px solid #dfe8ef;border-radius:18px;padding:16px;background:#fff}.termo-panel h2{display:flex;align-items:center;gap:10px;font-size:1.4375rem;line-height:1.2;margin-bottom:12px}.termo-panel h2 svg{width:30px;height:30px;fill:none;stroke:#415367;stroke-width:2;stroke-linecap:round}.termo-status{display:flex;align-items:center;gap:12px;padding:14px;border-radius:12px;background:#f1f4f7;color:#415367;font-size:clamp(1.375rem,6vw,1.75rem);line-height:1.2}.termo-status.on{background:#def2e5;color:#075b27}.termo-status.off{background:#edf0f3;color:#46515e}.termo-dot{flex-shrink:0;width:16px;height:16px;border-radius:50%;background:currentColor}.termo-since{font-size:1.0625rem;color:#536277;margin:10px 2px 0}

/* Appointments share the enclosing card used by the other dashboard sections. */
.appointments{margin-top:12px;border:1px solid #dfe8ef;border-radius:18px;padding:12px;background:#fff}.appointments>h2{margin:0 0 10px}.appointments>.appointment:last-of-type{margin-bottom:0}

/* One heading pattern across all dashboard cards. */
.termo-panel{padding:12px}
.electricity .section-heading,.termo-panel .section-heading,.weather-panel .section-heading,.appointments .section-heading,.automation-panel .section-heading{display:flex;align-items:center;gap:12px;padding:10px;margin:-4px -4px 12px;border-radius:12px;background:var(--heading-bg,#eff8f2);color:#14213d;font-size:clamp(1.125rem,5vw,1.625rem);font-weight:700;line-height:1.2;letter-spacing:normal}
.section-heading h2{font:inherit;margin:0}
.section-heading.heading-termo{--heading-bg:#e7f4f3;--heading-accent:#147b77}.section-heading.heading-weather{--heading-bg:#e8f3fb;--heading-accent:#1684bd}.section-heading.heading-calendar{--heading-bg:#f0edf9;--heading-accent:#6b51a3}
.section-heading .heading-icon{display:grid;place-items:center;flex-shrink:0;width:44px;height:44px;border-radius:50%;background:var(--heading-accent,#137a38);color:#fff}
.section-heading .heading-icon svg{display:block;width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.section-heading .heading-icon.bolt svg{width:25px;height:33px;fill:currentColor;stroke:none}.section-heading.heading-weather .heading-icon svg{fill:currentColor;stroke:none}
/* Fixed, explicit manual actions remain available regardless of cached state. */
.termo-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}.termo-actions button{appearance:none;border:1px solid #c4dccc;border-radius:12px;min-height:58px;padding:12px 8px;font:inherit;font-size:clamp(1.125rem,5vw,1.375rem);font-weight:750;cursor:pointer;color:#075b27;background:#def2e5}.termo-actions .termo-off{background:#edf0f3;color:#364553;border-color:#d6dfe6}.termo-actions button:focus-visible{outline:3px solid #146ac2;outline-offset:3px}.termo-actions button:disabled{opacity:.6;cursor:wait}.termo-feedback{margin-top:10px;font-size:1rem;line-height:1.4;color:#415367}.termo-feedback.error{color:#9c2230}.termo-feedback[hidden]{display:none}

/* Elapsed time shares the status strip; label left, compact duration right. */
.termo-status{gap:8px;flex-wrap:nowrap}.termo-status>strong{white-space:nowrap}.termo-status .termo-since{margin:0 0 0 auto;color:inherit;font-size:clamp(1rem,4.3vw,1.25rem);font-weight:650;white-space:nowrap;line-height:1.2;text-align:right;flex-shrink:0;font-variant-numeric:tabular-nums}.termo-status .termo-since[hidden]{display:none}
@media(max-width:400px){.termo-status{font-size:clamp(1.125rem,5.5vw,1.375rem);padding:12px;gap:7px}.termo-status .termo-dot{width:12px;height:12px}.termo-status .termo-since{font-size:1rem}}
/* Small, independent automation setting at the bottom of the dashboard. */
.automation-panel{margin-top:16px;padding:14px;border:1px solid #dfe8ef;border-radius:16px;background:#fff}.automation-panel h2{font-size:1.125rem;line-height:1.25;margin-bottom:8px}.automation-status{font-size:1.0625rem;font-weight:700;color:#536277;margin-bottom:12px}.automation-status.on{color:#075b27}.automation-panel button{appearance:none;width:100%;min-height:48px;padding:11px 12px;border:1px solid #d6dfe6;border-radius:11px;background:#edf0f3;color:#364553;font:inherit;font-size:1.0625rem;font-weight:700;cursor:pointer}.automation-panel button[data-rule-enabled=true]{background:#def2e5;color:#075b27;border-color:#c4dccc}.automation-panel button:disabled{opacity:.6;cursor:wait}.automation-panel button:focus-visible{outline:3px solid #146ac2;outline-offset:3px}.automation-note{font-size:.875rem;color:#536277;line-height:1.4;margin-top:10px}.automation-feedback{font-size:1rem;line-height:1.4;margin-top:8px;color:#415367}.automation-feedback.error{color:#9c2230}.automation-feedback[hidden]{display:none}

/* Native disclosure: only the familiar section heading is visible on opening. */
.automation-panel{padding:12px;border-radius:18px}.automation-panel .section-heading{cursor:pointer;list-style:none}.automation-panel .section-heading h2{font:inherit;margin:0;flex:1;min-width:0}.automation-disclosure>summary::-webkit-details-marker{display:none}.automation-disclosure>summary::marker{content:""}.automation-disclosure:not([open])>summary{margin-bottom:-4px}.automation-chevron{width:20px;height:20px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.automation-disclosure[open] .automation-chevron{transform:rotate(180deg)}.automation-disclosure>summary:focus-visible{outline:3px solid #146ac2;outline-offset:3px}

/* Independent automation rules share the existing folded panel. */
.automation-rule{padding:12px 0;border-top:1px solid #e4ebef}.automation-rule:first-child{border-top:0;padding-top:0}.automation-rule h3{font-size:1.125rem;line-height:1.3;margin:0 0 5px;color:#14213d}.automation-description{font-size:1rem;line-height:1.4;color:#536277;margin:0 0 10px}.automation-actions{display:flex;align-items:center;gap:12px;justify-content:space-between}.automation-actions .automation-status{margin:0;font-size:1.0625rem}.automation-actions button{width:auto;min-width:112px;flex-shrink:0}.automation-content{padding:2px 2px 0}

/* Both PVPC days are rendered from the same components; switching is local. */
.electricity .energy-heading{gap:8px}.energy-heading h2{flex:1;min-width:0}.energy-toggle{appearance:none;flex-shrink:0;min-height:44px;padding:8px 10px;border:1px solid #bad9c6;border-radius:11px;background:#fff;color:#075b27;font:inherit;font-size:1rem;font-weight:700;cursor:pointer}.energy-toggle:focus-visible{outline:3px solid #146ac2;outline-offset:3px}.energy-toggle[hidden],.energy-view[hidden]{display:none}.energy-date{font-size:1rem;font-weight:700;color:#415367;margin:0 4px 2px}.current-label.tomorrow-label{font-size:15px}.minimum-period{font-size:14px;font-weight:700;text-anchor:middle}

.energy-rollover{font-size:1rem;color:#536277;padding:16px 4px}.energy-rollover[hidden]{display:none}

/* Independent, on-demand device controls. */
.termo-actions.single-action{grid-template-columns:1fr}.device-retry,.temperature-controls button,.climate-modes button{appearance:none;min-height:50px;border:1px solid #cbd9df;border-radius:12px;padding:10px;font:inherit;font-size:1.125rem;font-weight:700;background:#edf3f4;color:#1b4948;cursor:pointer}.device-retry{width:100%;margin-top:10px}.device-panel button:disabled{opacity:.55;cursor:wait}.device-panel button:focus-visible{outline:3px solid #146ac2;outline-offset:3px}.climate-settings{margin-top:14px}.climate-caption{font-size:1rem;color:#536277;text-align:center}.temperature-controls{display:grid;grid-template-columns:64px 1fr 64px;gap:12px;align-items:center;margin-top:8px}.temperature-controls button{font-size:1.75rem;line-height:1;min-height:54px}.climate-target{text-align:center;font-size:1.75rem;font-weight:750;white-space:nowrap}.climate-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}.climate-modes button[aria-pressed=true]{background:#def2e5;border-color:#84bda0;color:#075b27}.climate-note,.climate-inside{font-size:.875rem;line-height:1.4;color:#536277;text-align:center;margin-top:9px}.device-feedback{font-size:1rem;line-height:1.4;color:#415367;margin-top:10px}.device-feedback.error{color:#9c2230}.device-retry[hidden],.device-feedback[hidden],.climate-note[hidden],.climate-inside[hidden]{display:none}

/* Soft blue exterior; each dashboard card retains its own background. */
html,body,main#dashboard{background:#d5e7f5}.update-line{color:#344b63}

/* Four separate rules, with touch-friendly individual weekdays. */
.automation-rules{display:grid;gap:12px}.automation-rule,.automation-rule:first-child{padding:12px;border:1px solid #dfe8ef;border-radius:14px;background:#f7fafc}.automation-weekdays{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:10px 0 14px}.automation-weekdays button{width:100%;min-width:0;min-height:44px;padding:8px 0;border-radius:9px;font-size:1.0625rem;background:#edf0f3;color:#46515e}.automation-weekdays button[aria-pressed=true]{background:#147b77;color:#fff;border-color:#147b77}.automation-actions{gap:8px}.automation-actions button{min-width:96px}

.home-temperature{margin-top:12px;padding:12px;border:1px solid #dfe8ef;border-radius:18px;background:var(--home-temperature-bg)}.home-temperature .section-heading{display:flex;align-items:center;gap:12px;padding:10px;margin:-4px -4px 6px;border-radius:12px;background:var(--card-accent-soft,#fbe7d4);color:#14213d;font-size:clamp(1.125rem,5vw,1.625rem);line-height:1.2}.heading-home .heading-icon{background:var(--home-temperature-accent)}.heading-home svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.home-rooms{display:grid;gap:0}.home-room{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:10px;row-gap:3px;padding:10px 2px;border-bottom:1px solid #e5ebf0}.home-room:last-child{border-bottom:0}.home-room h3{font-size:1.0625rem;line-height:1.25;margin:0;font-weight:600}.home-values{display:grid;grid-template-columns:5rem 3rem;align-items:baseline;column-gap:12px;margin:0;padding-left:10px;border-left:1px solid #d4dfe7;white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}.home-values strong{font-size:1.5rem;color:var(--home-temperature-accent)}.home-values strong span{font-size:1rem;color:inherit}.home-humidity{font-family:inherit;font-size:1rem;font-weight:400;color:#64748b}.home-source{color:#536277;font-size:.75rem;line-height:1.4;margin-top:8px}.home-battery,.home-room-note{grid-column:1/-1;margin:0;font-size:.8125rem;line-height:1.3}.home-battery{color:#983b07;font-weight:600}.home-room-note{color:#855111}.home-feedback{color:#983b07;font-size:.875rem;margin-top:8px}.home-feedback[hidden]{display:none}
@media(max-width:360px){.home-room{column-gap:8px}.home-values{grid-template-columns:4.25rem 2.75rem;column-gap:10px;padding-left:8px}.home-values strong{font-size:1.25rem}.home-room h3{font-size:1rem}}
