:root { color-scheme: light; }
.preferences-form { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--background); }
.danger { color: var(--red); border-color: var(--red); }
.danger:hover:not(:disabled) { background: #fff0ed; }

/* Home follows the same light surfaces as the rest of the application. */
:root:not([data-theme=dark]) #heating-home {
  --home-ink: var(--ink); --home-muted: #5d6b78; --home-line: #e1e7ec;
  background: radial-gradient(ellipse at 0 0, #fff7ed, transparent 65%), #f3f6f8;
  border-color: var(--line); box-shadow: inset 0 1px 0 #fff;
}
:root:not([data-theme=dark]) #heating-home .tile {
  --tile-accent: #4f6375;
  background: #fff; box-shadow: 0 5px 16px #2233440a; border-color: #dce4ea;
}
:root:not([data-theme=dark]) #heating-home .tile-zone { --tile-accent: #28763d; }
:root:not([data-theme=dark]) #heating-home .tile-aku { --tile-accent: #b14630; }
:root:not([data-theme=dark]) #heating-home .tile-env { --tile-accent: #925a1e; }
:root:not([data-theme=dark]) #heating-home .tile-tuv { --tile-accent: #216e9f; }
:root:not([data-theme=dark]) #heating-home .tile-head { background: #f3f6f8; }
:root:not([data-theme=dark]) #heating-home .tile-icon { background: #f1f5f7; }
:root:not([data-theme=dark]) #heating-home .tile-times b,
:root:not([data-theme=dark]) #heating-home .tile-stop-info b { color: var(--ink); }
:root:not([data-theme=dark]) #heating-home .tile-flag { color: #677786; background: #f2f5f7; }
:root:not([data-theme=dark]) #heating-home .tile-flag i { color: #5d6b78; }
:root:not([data-theme=dark]) #heating-home .tile-flag.is-on { color: #956010; background: #fff4d9; border-color: #e8cd94; }
:root:not([data-theme=dark]) #heating-home .tile-flag.is-on i { color: #79500d; }
:root:not([data-theme=dark]) #heating-home .tile-flag.is-alert { color: #a42c25; background: #fff0ed; border-color: #dba19a; }
:root:not([data-theme=dark]) #heating-home .tile-flag.is-alert i { color: #a42c25; }
:root:not([data-theme=dark]) #heating-home .tile-state.is-on { color: #9f5e13; }
:root:not([data-theme=dark]) #heating-home .tile-stop { background: #f6f8fa; }
:root:not([data-theme=dark]) #heating-home .tile-stop.is-blocked { background: #fff0ec; }
:root:not([data-theme=dark]) #heating-home .tile-stop.is-blocked .tile-stop-info b { color: #a52d24; }
:root:not([data-theme=dark]) #heating-home .tile-line b { color: var(--ink); }
:root:not([data-theme=dark]) #heating-home .tile-line b.is-on { color: #236c38; }
:root:not([data-theme=dark]) #heating-home .tile-season { color: #33779d; }
:root:not([data-theme=dark]) #heating-home .tile-season.is-summer { color: #a66a0e; }
:root:not([data-theme=dark]) #heating-home .pump-dot.is-on { background: #2a873f; }
:root:not([data-theme=dark]) #heating-home .tile .zone-edit-button { background: #fffaf5; color: #99410b; border-color: #e8cdb4; }
:root:not([data-theme=dark]) #heating-home .tile .zone-edit-button:hover:not(:disabled) { background: #fff0df; border-color: #c7a27f; }
:root:not([data-theme=dark]) #heating-home .badge { background: #e5ebf0; color: #465969; border-color: #c5d1d9; }
:root:not([data-theme=dark]) #heating-home .badge.online { background: #e8f5eb; color: #236c38; border-color: #a9cfb0; }

:root[data-theme=dark] {
  color-scheme: dark;
  --ink: #e6edf3; --muted: #afbdc9; --line: #3d4d5c; --paper: #25323e;
  --background: #18232d; --blue: #ffb16f; --green: #a2dfaf; --red: #ffaaa0;
  --accent-soft: #44372d; --water: #9dd3ec; --water-soft: #294552;
}
[data-theme=dark] body { background: radial-gradient(ellipse at 95% 0, #2b3945, transparent 45%), var(--background); }
[data-theme=dark] .app-sidebar,
[data-theme=dark] .stats article,
[data-theme=dark] .panel,
[data-theme=dark] .login,
[data-theme=dark] .boiler-panel,
[data-theme=dark] .aku-panel,
[data-theme=dark] .zone-card,
[data-theme=dark] .source-section,
[data-theme=dark] .overview-shortcuts,
[data-theme=dark] .control-panel,
[data-theme=dark] #detail-content > table,
[data-theme=dark] #detail-content > .table-scroll { background: var(--paper); }
[data-theme=dark] input,
[data-theme=dark] select,
[data-theme=dark] textarea,
[data-theme=dark] button,
[data-theme=dark] dialog { background: #1d2b36; color: var(--ink); border-color: #586977; }
[data-theme=dark] button:hover:not(:disabled) { background: #354958; border-color: #889fac; }
[data-theme=dark] button.primary { background: #b84908; color: #fff; border-color: #dd782e; }
[data-theme=dark] button.primary:hover:not(:disabled) { background: #d15c14; color: #fff; }
[data-theme=dark] button.danger { color: var(--red); border-color: #be7b76; }
[data-theme=dark] th { background: #1c2a35; }
[data-theme=dark] td,
[data-theme=dark] .overview-shortcuts button,
[data-theme=dark] .zone-demand,
[data-theme=dark] .stat-row { border-color: var(--line); }
[data-theme=dark] tbody tr:hover { background: #30414f; }
[data-theme=dark] .chart svg text { fill: var(--muted); }
[data-theme=dark] .tabs .selected,
[data-theme=dark] .app-sidebar #session-nav button[aria-current=page] { background: #44372d; color: #ffbc85; border-color: #6b4a31; }
[data-theme=dark] .app-sidebar #session-nav button:hover { background: #34434f; }
[data-theme=dark] .app-sidebar #session-nav a { color: var(--ink); }
[data-theme=dark] .notice,
[data-theme=dark] #message,
[data-theme=dark] .heating-notice,
[data-theme=dark] .quick-command-status { background: #40372a; color: #ffe0b2; border-color: #907147; }
[data-theme=dark] .alarm-notice,
[data-theme=dark] .zone-block { background: #4f3030; color: #ffd0c8; border-color: #94635b; }
[data-theme=dark] .quick-command-status.success { background: #264336; color: #c0edc9; border-color: #587b60; }
[data-theme=dark] .badge,
[data-theme=dark] .source-indicators > span { background: #354754; color: #cad5dd; }
[data-theme=dark] .badge.online,
[data-theme=dark] .source-indicators > .source-active { background: #284b3b; color: #b7e9c3; }
[data-theme=dark] .secret { background: #1a2a35; border-color: #547085; }
[data-theme=dark] .segmented,
[data-theme=dark] .temperature-stepper > button { background: #1b2a36; }
[data-theme=dark] .segmented button[aria-pressed=true] { background: #475b6a; color: #ffd5b2; }
[data-theme=dark] .zone-edit-button,
[data-theme=dark] .water-card .zone-edit-button { background: #314352; color: #f5c193; border-color: #5d7485; }
[data-theme=dark] .boiler-symbol { background: #43352a; box-shadow: inset 0 -12px #59422d; border-color: #9b724c; }
[data-theme=dark] .configuration-table-scroll tr.config-group td,
[data-theme=dark] .configuration-table-scroll tr.config-group td:last-child { color: #ffc592; }
[data-theme=dark] #heating-home .quick-edit,
[data-theme=dark] #heating-home .thermostat-control { color: var(--ink); background: #25323e; }
[data-theme=dark] #heating-home .quick-edit .muted,
[data-theme=dark] #heating-home .thermostat-control .muted { color: var(--muted); }
