﻿/* JER2-inspired surfaces, orange accents and a separate everyday control view. */
:root {
  --ink: #1c252d; --muted: #6b7580; --line: #e2e6ea; --paper: #fff;
  --background: #f5f6f8; --blue: #e8590c; --green: #278344; --red: #bd3434;
  --accent-soft: #fff1e6; --water: #187ba6; --water-soft: #eaf6fb;
  --sidebar-width: 226px; --radius: 14px;
}
body { background: radial-gradient(ellipse at 95% 0, #fff6ee 0, transparent 32%), var(--background); font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
h1 { font-size: 32px; font-weight: 650; letter-spacing: -.8px; margin: 5px 0 8px; }
h2 { font-weight: 650; letter-spacing: -.3px; }
h3 { font-weight: 620; }
button, input, select, textarea { border-radius: 8px; font: inherit; min-height: 42px; }
button { font-weight: 550; transition: background .15s, border-color .15s; }
button:hover { background: #f5f6f8; border-color: #b8c0c8; }
button:disabled { cursor: not-allowed; opacity: .45; }
input[type=checkbox] { min-height: 0; accent-color: var(--blue); }
.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.primary:hover { background: #d64f09; border-color: #d64f09; }
input:focus, select:focus, button:focus-visible { outline-color: var(--blue); }
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); height: 100vh; padding: 27px 18px; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; border: 0; border-right: 1px solid var(--line); z-index: 20; background: #fff; }
.app-sidebar .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; letter-spacing: .2px; padding: 0 3px 25px; }
.app-sidebar .brand > span { font-size: 15px; letter-spacing: .2px; color: inherit; }
.app-sidebar .brand .brand-symbol { display: grid; place-items: center; width: 38px; height: 42px; border-radius: 12px; color: #fff; background: var(--blue); font-size: 29px; flex-shrink: 0; }
.app-sidebar .brand small { display: block; font-size: 10px; margin-top: 3px; color: var(--muted); font-weight: 400; letter-spacing: .8px; }
.app-sidebar #session-nav { flex-direction: column; align-items: stretch; justify-content: flex-start; width: 100%; gap: 6px; margin-top: 15px; }
.app-sidebar #session-nav button, .app-sidebar #session-nav a { display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 13px; text-align: left; min-height: 46px; text-decoration: none; }
.app-sidebar #session-nav button:hover, .app-sidebar #session-nav a:hover { background: #f5f6f8; color: var(--ink); }
.app-sidebar #session-nav button[aria-current=page] { color: var(--blue); background: var(--accent-soft); border-color: #ffe4cd; }
.app-sidebar #whoami { order: 3; text-align: left; padding: 24px 12px 6px; margin: 20px 0 0; border-top: 1px solid var(--line); font-size: 11px; overflow-wrap: anywhere; }
.app-sidebar #logout { order: 4; }
.sidebar-caption { margin-top: auto; padding: 30px 12px 0; font-size: 19px; font-weight: 550; line-height: 1.6; color: #a3aab0; letter-spacing: -.4px; }
main { max-width: 1680px; margin-left: var(--sidebar-width); margin-right: auto; padding: 35px 38px; min-height: calc(100vh - 65px); }
footer { margin-left: var(--sidebar-width); height: auto; min-height: 65px; padding: 22px 38px; font-size: 10px; }
.heading { margin-bottom: 26px; }
.eyebrow { font-size: 10px; font-weight: 650; letter-spacing: 1.5px; color: #8b939b; }
.mode { color: var(--blue); background: var(--accent-soft); border: 1px solid #ffe0c6; border-radius: 7px; letter-spacing: .6px; font-weight: 600; }
.panel { border-radius: var(--radius); box-shadow: 0 2px 4px #152b3a03; }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stats article { border-radius: 11px; border: 1px solid var(--line); padding: 18px 22px; }
.stats article:first-child { border-top: 1px solid var(--line); }
.stats strong { font-size: 29px; font-weight: 620; line-height: 1.2; margin: 12px 0 6px; }
.stats article:first-child strong { color: var(--green); }
.stats small { color: #87919a; }
.badge { font-weight: 550; padding: 5px 10px; font-size: 11px; }
.badge.online { background: #ecf8ee; color: var(--green); }
.badge.online::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.toolbar { padding: 24px; }
.toolbar h2 { font-size: 17px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 18px; padding: 0 24px 24px; }
.unit-card { display: flex; flex-direction: column; min-width: 0; padding: 21px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.unit-card:hover { border-color: #e7b492; box-shadow: 0 4px 18px #26354507; }
.unit-card-head, .zone-card-head { display: flex; align-items: center; gap: 12px; }
.unit-card-head > div, .zone-card-head > div { min-width: 0; }
.unit-card-head h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.unit-card-head .badge { margin-left: auto; }
.unit-card-head .muted { font-size: 11px; }
.type-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; color: var(--blue); background: var(--accent-soft); }
.ui-icon, #detail-content .ui-icon { display: inline-block; width: 21px; height: 21px; flex-shrink: 0; vertical-align: middle; }
.unit-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 25px 0; }
.unit-metrics > div { display: flex; flex-direction: column; gap: 4px; }
.unit-metrics .ui-icon { width: 16px; height: 16px; color: #a0a8ae; margin-bottom: 3px; }
.unit-metrics strong { font-size: 19px; font-weight: 630; white-space: nowrap; font-variant-numeric: tabular-nums; }
.unit-metrics span { font-size: 11px; color: var(--muted); }
.unit-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.unit-card-foot > span { color: var(--muted); font-size: 10px; }
.unit-card-foot button { white-space: nowrap; font-size: 12px; padding: 8px 11px; }
.unit-card-foot .ui-icon { width: 16px; height: 16px; margin-left: 5px; }
.unit-offline { background: #fcfcfc; }
.device-warning { font-size: 11px; color: var(--red); overflow-wrap: anywhere; margin-bottom: 0; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 45px 20px; color: var(--muted); }
.empty-state > .ui-icon { width: 42px; height: 42px; color: #b8c0c6; }
.empty-state h3 { color: var(--ink); text-transform: none; font-size: 20px; }
.empty-state p { max-width: 480px; margin-inline: auto; }
.tabs { border-bottom: 1px solid var(--line); padding: 0 24px; gap: 5px; margin-bottom: 24px; }
.tabs button { padding: 13px 12px; color: var(--muted); border-radius: 0; border: 0; border-bottom: 2px solid transparent; min-height: 46px; background: transparent; }
.tabs button:hover { color: var(--ink); background: #fafbfc; }
.tabs .selected { color: var(--blue); background: transparent; border-color: var(--blue); font-weight: 650; }
.has-detail #dashboard .heading, .has-detail #dashboard .stats, .has-detail #dashboard .device-list-panel, .has-detail #dashboard .footnote { display: none; }
#detail { margin-top: 0; background: transparent; border: 0; box-shadow: none; overflow: visible; }
#detail > .tabs { padding-inline: 0; }
.detail-heading { padding: 0 0 24px; align-items: flex-start; }
.detail-heading h2 { font-size: 27px; margin: 4px 0 6px; }
.device-information summary { font-size: 11px; color: var(--muted); cursor: pointer; }
.device-information p { max-width: 700px; font-size: 11px; }
#detail-content { overflow-x: auto; padding-bottom: 8px; }
#detail-content > table, #detail-content > .table-scroll { background: #fff; }
.overview-topline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.overview-topline .weather { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: var(--muted); }
.weather .ui-icon { color: #ca8526; }
.weather b { color: var(--ink); font-size: 16px; }
.heat-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; align-items: stretch; margin-bottom: 28px; }
.boiler-panel, .aku-panel { background: radial-gradient(ellipse at 10% 120%, #ffe9d3, transparent 65%), #fffdfb; border: 1px solid #efdfd1; border-radius: var(--radius); padding: 22px; }
.aku-panel { background: #fff; border-color: var(--line); }
.boiler-panel .zone-card-head b.device-flag { margin-left: auto; font-size: 10px; }
.boiler-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0 18px; }
.boiler-metrics > div { display: flex; flex-direction: column; gap: 3px; }
.boiler-metrics span { font-size: 10px; color: var(--muted); }
.boiler-metrics strong { font-size: clamp(20px, 1.9vw, 27px); font-weight: 620; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.stat-rows { display: grid; gap: 2px; border-top: 1px solid #eff1f3; padding-top: 10px; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 0; font-size: 12px; }
.stat-row > span { color: var(--muted); font-size: 11px; }
.stat-row > b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.stat-row b.is-on { color: var(--green); }
.is-alert, .stat-row b.is-alert, .device-flag.is-alert { color: var(--red); }
.zone-block { margin: 14px 0 0; padding: 10px 13px; border-radius: 8px; background: #fff1ef; border: 1px solid #f0cfca; color: #9c3535; font-size: 12px; }
.zone-card .zone-demand { margin-top: 8px; }
.boiler-visual { display: flex; align-items: center; gap: 23px; }
.boiler-symbol { display: grid; place-items: center; width: 82px; height: 110px; border: 2px solid #f1c39e; border-radius: 16px; background: #fff8f1; color: var(--blue); box-shadow: inset 0 -12px #ffe5cc; flex-shrink: 0; }
#detail-content .boiler-symbol .ui-icon { width: 43px; height: 43px; }
.boiler-visual h3 { margin: 1px 0; font-size: 16px; }
.boiler-visual strong { display: block; font-size: 35px; font-weight: 620; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.boiler-visual .muted { display: block; font-size: 11px; }
.flow-copy { padding-left: 30px; }
.flow-copy h3 { font-size: 19px; margin: 0 0 9px; }
.flow-copy p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.flow-copy small { display: block; color: #93989e; font-size: 10px; }
.flow-connection { display: grid; gap: 15px; }
.flow-connection i { position: relative; height: 5px; border-radius: 5px; background: #e6d3c2; overflow: hidden; }
.flow-connection i:last-child { background: #d4e4eb; }
.is-flowing .flow-connection i::after { content: ""; position: absolute; inset: 0 auto 0 -30%; width: 30%; background: #e99549; animation: heat-flow 2.4s linear infinite; border-radius: 5px; }
.is-flowing .flow-connection i:last-child::after { background: #8ab8cc; animation-direction: reverse; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 16px; }
.section-heading h3 { margin: 0; font-size: 16px; }
.zone-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 0; }
.zone-card { background: #fff; border-radius: var(--radius); padding: 22px; animation: card-arrive .35s ease-out both; }
.zone-card:nth-child(2) { animation-delay: .04s; }
.zone-card:nth-child(3) { animation-delay: .08s; }
.zone-card .zone-card-head h3 { margin: 0; font-size: 15px; color: var(--ink); }
.zone-card .zone-card-head span.muted { font-size: 11px; }
.water-card .type-icon { color: var(--water); background: var(--water-soft); }
.zone-temperature { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; margin: 24px 0 20px; }
.zone-temperature strong { font-size: clamp(28px, 2.8vw, 39px); font-weight: 620; letter-spacing: -1px; margin: 0; line-height: 1.25; font-variant-numeric: tabular-nums; }
.zone-card .zone-temperature > span { font-size: 10px; }
.zone-health { color: var(--red); font-size: 11px; margin: -10px 0 15px; }
.read-only-caption { font-size: 12px; color: var(--muted); margin: 0 0 18px; }
.zone-demand { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid #eff1f3; padding-top: 14px; }
.zone-demand b { white-space: nowrap; font-size: 13px; font-weight: 600; }
.zone-edit-button { width: 100%; margin-top: 20px; color: var(--blue); border-color: #f3dac4; background: #fffaf6; font-size: 12px; }
.zone-edit-button .ui-icon { width: 15px; height: 15px; margin-right: 5px; }
.water-card .zone-edit-button { background: #f6fbfd; color: var(--water); border-color: #cce4ef; }
.quick-edit { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.quick-edit label { font-size: 11px; font-weight: 600; color: var(--muted); }
.quick-edit .muted { font-size: 10px; line-height: 1.6; }
.quick-edit > button { font-size: 12px; }
.temperature-stepper { display: flex; min-width: 0; border: 1px solid #d7dde2; border-radius: 9px; overflow: hidden; }
.temperature-stepper > button { flex: 0 0 44px; border: 0; border-radius: 0; padding: 4px; background: #f8f9fa; color: var(--ink); font-size: 24px; min-height: 50px; }
.temperature-stepper > input { min-width: 0; width: 100%; padding: 5px 0; border: 0; border-radius: 0; text-align: center; font-size: 23px; font-weight: 600; appearance: textfield; -moz-appearance: textfield; }
.temperature-stepper input::-webkit-inner-spin-button, .temperature-stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.thermostat-control { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.zone-card .thermostat-control > span { font-size: 11px; }
.segmented { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; background: #f7f8fa; }
.segmented button { flex: 1; font-size: 10px; border: 0; padding: 5px 2px; background: transparent; min-height: 36px; }
.segmented button[aria-pressed=true] { background: #fff; box-shadow: 0 1px 4px #1c252d15; color: var(--blue); }
.zone-card .thermostat-control p { font-size: 10px; margin-top: 7px; }
.overview-bottom { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 22px; }
.source-section, .overview-shortcuts { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; min-width: 0; }
.source-section .section-heading { align-items: flex-start; }
.source-section .section-heading button { font-size: 11px; padding: 6px 10px; white-space: nowrap; min-height: 34px; }
.source-indicators { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.source-indicators > span { border-radius: 7px; padding: 9px 12px; background: #f6f7f8; color: #727d86; font-size: 11px; }
.source-indicators > .source-active { background: #edf8ef; color: var(--green); }
.source-mode-grid { display: grid; grid-template-columns: minmax(70px, auto) 1fr; align-items: center; gap: 9px 14px; }
.source-mode-grid select { min-width: 0; width: 100%; }
.overview-shortcuts h3 { margin: 0 0 10px; font-size: 16px; }
.overview-shortcuts button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 10px 0; border-bottom: 1px solid #f0f1f3; border-radius: 0; color: var(--muted); font-size: 12px; }
.overview-shortcuts button:hover { color: var(--blue); }
.overview-shortcuts button span { margin-left: auto; font-size: 18px; }
.overview-shortcuts .ui-icon { width: 18px; height: 18px; }
.heating-notice, .quick-command-status { padding: 13px 17px; margin: 15px 0; border: 1px solid #edd4a6; background: #fff8e9; border-radius: 9px; font-size: 12px; line-height: 1.7; }
.alarm-notice { color: #9c3535; background: #fff1ef; border-color: #f0cfca; }
.quick-command-status.success { border-color: #c5e6ce; background: #f0faf3; color: #22703c; }
.control-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.control-panel #operation-form { max-width: 900px; }
#configuration-form, #operation-fields { grid-template-columns: minmax(0, 1fr); }
.configuration-tools { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); min-width: 0; }
.configuration-tools .stack { grid-template-columns: minmax(0, 1fr); margin-top: 20px; }
.configuration-backup-list { display: grid; gap: 10px; padding: 0; list-style: none; }
.configuration-backup-list li { padding: 14px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.configuration-backup-list strong, .configuration-backup-list small { display: block; }
.configuration-backup-list small { color: var(--muted); margin-top: 7px; }
@media (max-width: 550px) {
  .configuration-table-scroll thead { display: none; }
  .configuration-table-scroll table { white-space: normal; }
  .configuration-table-scroll tbody { display: block; }
  .configuration-table-scroll tr { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 0 10px; border-bottom: 1px solid var(--line); }
  .configuration-table-scroll td { padding: 12px 0; border: 0; }
.configuration-table-scroll tr.config-group { display: block; padding-top: 16px; }
.configuration-table-scroll tr.config-group td { display: block; padding: 4px 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: #a34d12; border: 0; }
.configuration-table-scroll tr.config-group td:last-child { grid-column: auto; font-size: 12px; color: #a34d12; }
.configuration-table-scroll select { max-width: 100%; }
  .configuration-table-scroll td:last-child { grid-column: 1 / -1; padding-top: 0; font-size: 11px; color: var(--muted); }
}
.control-panel > details, .control-panel #control-approval { margin-top: 18px; }
.command-summary { padding: 16px 18px; border-radius: 9px; background: var(--accent-soft); color: #893b0f; font-size: 17px; font-weight: 600; }
dialog { border: 0; border-radius: 16px; box-shadow: 0 18px 70px #162b3c35; }
dialog .notice { font-size: 11px; border-radius: 8px; }
dialog summary { font-size: 11px; color: var(--muted); cursor: pointer; }
.login { border-top: 4px solid var(--blue); padding: 36px; margin-top: 7vh; }
.login h1 { font-size: 29px; line-height: 1.25; letter-spacing: -.7px; }
.login .primary { min-height: 48px; }
.chart, .signal-grid:not(.zone-grid) { background: #fff; border-radius: 12px; padding-block: 20px; }
.chart label { font-size: 13px; }
@keyframes heat-flow { to { left: 110%; } }
@keyframes card-arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1180px) {
  :root { --sidebar-width: 200px; }
  main { padding: 28px 24px; }
  .app-sidebar { padding-inline: 12px; }
  .zone-grid { gap: 12px; }
  .zone-card { padding: 17px; }
  .zone-card-head { gap: 9px; }
  .zone-card-head .type-icon { width: 34px; height: 36px; }
  .zone-card .zone-card-head h3 { font-size: 13px; }
  .zone-demand { flex-wrap: wrap; }
  .flow-copy { padding-left: 22px; }
}
@media (max-width: 850px) {
  .app-sidebar { position: relative; inset: auto; width: 100%; height: auto; min-height: 0; padding: 18px 22px; border-right: 0; border-bottom: 1px solid var(--line); gap: 0; }
  .app-sidebar .brand { padding: 0; }
  .sidebar-caption { display: none; }
  .app-sidebar #session-nav { flex-direction: row; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
  .app-sidebar #session-nav button, .app-sidebar #session-nav a { flex: 1 1 auto; font-size: 11px; padding: 9px 10px; justify-content: center; gap: 6px; min-height: 40px; }
  .app-sidebar #whoami { order: -1; width: 100%; border: 0; margin: 0 0 3px; padding: 0; font-size: 10px; }
  .app-sidebar #logout { order: 0; }
  main { margin: 0; padding: 24px; min-height: calc(100vh - 220px); }
  footer { margin-left: 0; padding: 20px 24px; }
  .detail-heading { flex-direction: row; }
  .overview-topline { gap: 9px; }
  .overview-topline .weather { margin-left: 0; }
  .zone-temperature strong { font-size: 30px; }
}
@media (max-width: 650px) {
  .zone-grid { grid-template-columns: 1fr; gap: 14px; }
  .zone-card { padding: 22px; }
  .zone-temperature { margin: 20px 0; }
  .zone-temperature strong { font-size: 40px; }
  .zone-card .zone-card-head h3 { font-size: 16px; }
  .zone-demand { flex-wrap: nowrap; }
  .zone-card .zone-card-head .type-icon { width: 42px; height: 42px; }
  .overview-bottom { grid-template-columns: 1fr; }
  .heat-flow { gap: 14px; }
  .flow-connection { display: none; }
  .flow-copy { padding: 17px 0 0; border-top: 1px solid #f0e0d0; }
  .flow-copy h3 { font-size: 16px; margin-bottom: 6px; }
  .flow-copy p { margin-bottom: 7px; font-size: 12px; }
  .boiler-visual { gap: 22px; }
  .boiler-symbol { width: 74px; height: 100px; }
  .boiler-visual strong { font-size: 38px; }
  .section-heading > .muted { display: none; }
  .source-section .section-heading { flex-wrap: wrap; }
  .detail-heading { gap: 15px; flex-wrap: wrap; }
  .detail-heading h2 { font-size: 24px; }
  .detail-heading > button { font-size: 11px; padding: 7px 10px; min-height: 36px; }
  #detail > .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
  #detail > .tabs button { white-space: nowrap; font-size: 11px; flex-shrink: 0; }
  main { padding: 22px 16px; }
  .app-sidebar { padding: 16px; }
  .app-sidebar #session-nav button .ui-icon { width: 16px; height: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats article { padding: 15px; }
  .stats strong { font-size: 25px; }
  .unit-grid { padding: 0 16px 16px; }
  .device-list-panel .toolbar { padding: 19px 16px; }
  .unit-metrics strong { font-size: 20px; }
  .overview-topline > .muted { order: 3; width: 100%; font-size: 10px; }
  .overview-topline .weather { margin-left: auto; }
  .overview-topline .weather b { font-size: 13px; }
  .overview-topline .weather .ui-icon { width: 17px; height: 17px; }
  .overview-topline .badge { font-size: 10px; }
  .control-panel { padding: 16px; }
  .login { padding: 25px; margin-top: 18px; }
  .login h1 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  .zone-card, .is-flowing .flow-connection i::after { animation: none; }
  button { transition: none; }
}

/* Tile wall - Home view */
.tile-wall { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.tile-col { display: flex; flex-direction: column; gap: 14px; flex: 0 1 218px; min-width: 200px; }
.tile { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 18px rgba(43, 54, 66, 0.08); }
.tile-head { padding: 8px 14px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
.tile-kotel > .tile-head { background: #4a5b6e; }
.tile-env > .tile-head { background: #b06a2b; }
.tile-zone > .tile-head { background: #2e9e57; }
.tile-aku > .tile-head { background: #c0392b; }
.tile-tuv > .tile-head { background: #3a5fcd; }
.tile-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #eef1f4; }
.tile-row:last-child { border-bottom: 0; }
.tile-icon .ui-icon { width: 22px; height: 22px; color: #6c7a8a; }
.tile-cell { margin-left: auto; text-align: right; }
.tile-value { font-size: 19px; font-weight: 700; line-height: 1.15; }
.tile-value b { font-size: 19px; }
.tile-value small { font-size: 10px; font-weight: 400; }
.tile-label { display: block; font-size: 11px; color: #7b8794; }
.tile-times { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px 14px; border-bottom: 1px solid #eef1f4; }
.tile-times b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.tile-times span { font-size: 10px; color: #7b8794; }
.tile-flags { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; }
.tile-flag { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #b7c0ca; }
.tile-flag .ui-icon { width: 22px; height: 22px; }
.tile-flag i { font-size: 9px; font-style: normal; color: #9aa6b2; }
.tile-flag.is-on { color: #e07b39; }
.tile-flag.is-on i { color: #a34d12; }
.tile-flag.is-alert { color: #c0392b; }
.tile-flag.is-alert i { color: #c0392b; }
.tile-state { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; color: #b7c0ca; }
.tile-state .ui-icon { width: 44px; height: 44px; }
.tile-state.is-on { color: #e07b39; }
.tile-state.is-on .ui-icon { filter: drop-shadow(0 0 6px rgba(224, 123, 57, 0.5)); }
.tile-stop { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.stop-badge { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 40px; background: #c3ccd4; color: #fff; font-size: 11px; font-weight: 800; clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.tile-stop.is-blocked .stop-badge { background: #c0392b; box-shadow: 0 0 8px rgba(192, 57, 43, 0.6); }
.tile-stop-info { display: flex; flex-direction: column; }
.tile-stop-info b { font-size: 15px; }
.tile-stop.is-blocked .tile-stop-info b { color: #c0392b; }
.tile-line { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; border-top: 1px solid #eef1f4; font-size: 12px; }
.tile-line b { font-size: 12px; }
.tile-line b.is-on { color: #2e9e57; }
.tile-season { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 14px; color: #4a90d9; }
.tile-season .ui-icon { width: 34px; height: 34px; }
.tile-season.is-summer { color: #e0a030; }
.tile-season b { font-size: 18px; }
.pump-dot { display: inline-block; width: 10px; height: 10px; margin-left: 6px; border-radius: 50%; background: #c3ccd4; }
.tile-value > .pump-dot { margin-left: 0; margin-right: 6px; }
.pump-dot.is-on { background: #2e9e57; box-shadow: 0 0 5px rgba(46, 158, 87, 0.6); }
.tile-pump { display: inline-flex; align-items: center; gap: 6px; }
.tile-pump .ui-icon { width: 16px; height: 16px; color: #6c7a8a; }
.tile-pump .pump-dot { margin-left: 0; }
.tile-pump-ic { position: relative; display: inline-flex; }
.tile-pump-ic .pump-dot { position: absolute; right: -5px; bottom: -2px; margin-left: 0; width: 8px; height: 8px; }
.tile .zone-edit-button { margin: 0 14px 12px; }
.tile [data-zone-editor] .quick-edit { margin: 0 14px 12px; }
@media (max-width: 700px) {
  .tile-col { flex: 1 1 46%; min-width: 160px; }
}
@media (max-width: 430px) {
  .tile-col { flex: 1 1 100%; }
}

/* Home is a separate instrument panel; the everyday overview stays light. */
#heating-home {
  --home-ink: #f2f5f8;
  --home-muted: #bdc8d3;
  --home-line: rgba(215, 228, 240, .13);
  color: var(--home-ink);
  padding: 16px;
  border: 1px solid #344658;
  border-radius: 18px;
  background: radial-gradient(ellipse at 0 0, #354a5d 0, transparent 55%), #23313f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
#heating-home .overview-topline { margin-bottom: 12px; gap: 10px; }
#heating-home .muted, #heating-home .overview-topline > .muted { color: var(--home-muted); }
#heating-home .weather { color: var(--home-muted); }
#heating-home .weather b { color: var(--home-ink); }
#heating-home .read-only-caption { color: var(--home-muted); }
#heating-home .badge { background: #465566; color: #fff; border: 1px solid #667687; }
#heating-home .badge.online { background: #244b40; color: #b9f2cb; border-color: #448768; }
#heating-home .tile-wall { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
#heating-home .tile-col { gap: 12px; min-width: 0; }
#heating-home .tile-col:has(> [hidden]):not(:has(> :not([hidden]))) { display: none; }
#heating-home .tile {
  --tile-accent: #b4c9db;
  min-width: 0;
  border: 1px solid var(--home-line);
  border-radius: 12px;
  background: linear-gradient(145deg, #435363, #394857);
  box-shadow: 0 8px 20px rgba(9, 18, 26, .18), inset 0 1px 0 rgba(255, 255, 255, .04);
  animation: home-reveal .35s ease-out both;
}
#heating-home .tile-zone { --tile-accent: #91d79c; }
#heating-home .tile-aku { --tile-accent: #f3977d; }
#heating-home .tile-env { --tile-accent: #edc28b; }
#heating-home .tile-tuv { --tile-accent: #99cbef; }
#heating-home .tile-head {
  display: flex; align-items: center; justify-content: flex-start; gap: 9px;
  height: auto; min-height: 0; padding: 8px 12px;
  border-bottom: 1px solid var(--home-line);
  background: rgba(19, 31, 42, .35);
  color: var(--tile-accent);
  font-size: 12px; font-weight: 750; letter-spacing: .12em;
}
#heating-home .tile-head::before {
  content: ""; width: 7px; height: 7px; flex-shrink: 0;
  border-radius: 2px; background: var(--tile-accent);
}
#heating-home .thermo-state.is-forced { color: #f8c86a; }
#heating-home .tile-row { padding: 7px 10px; gap: 8px; border-color: var(--home-line); min-height: 54px; }
#heating-home .tile-icon {
  display: grid; place-items: center; flex: 0 0 28px;
  height: 28px; border-radius: 8px; background: rgba(15, 28, 40, .2);
}
#heating-home .tile-icon .ui-icon { width: 20px; height: 20px; color: var(--tile-accent); }
#heating-home .tile-cell { min-width: 0; }
#heating-home .tile-value, #heating-home .tile-value b {
  color: var(--home-ink); font-size: clamp(19px, 1.5vw, 24px);
  font-weight: 550; letter-spacing: -.6px; font-variant-numeric: tabular-nums;
  line-height: 1.2; overflow-wrap: anywhere;
}
#heating-home .tile-value small { display: block; font-size: 10px; letter-spacing: 0; }
#heating-home .tile-label { margin-top: 2px; color: var(--home-muted); font-size: 11px; line-height: 1.3; }
#heating-home .tile-times { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; border-color: var(--home-line); }
#heating-home .tile-times > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
#heating-home .tile-times b { color: #fff; font-size: 20px; letter-spacing: .03em; font-weight: 500; }
#heating-home .tile-times span { color: var(--home-muted); font-size: 11px; }
#heating-home .tile-flags { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px; }
#heating-home .tile-flag {
  min-width: 0; padding: 6px 3px; border: 1px solid transparent; border-radius: 8px;
  color: #a7b4c1; background: rgba(18, 31, 43, .15);
}
#heating-home .tile-flag i { color: #c0cbd5; font-size: 10px; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
#heating-home .tile-flag .ui-icon { width: 22px; height: 22px; }
#heating-home .tile-flag.is-on { color: #f8c86a; border-color: rgba(248, 200, 106, .25); background: rgba(248, 200, 106, .09); }
#heating-home .tile-flag.is-on i { color: #ffe1a1; }
#heating-home .tile-flag.is-on .tile-pump-ic .ui-icon { color: inherit; }
#heating-home .tile-flag.is-on .pump-dot.is-on { background: #f8c86a; box-shadow: 0 0 0 3px rgba(248, 200, 106, .12); }
#heating-home .tile-flag.is-alert { color: #ffaba2; border-color: #b16b66; background: #633e42; }
#heating-home .tile-flag.is-alert i { color: #ffd4cf; }
#heating-home .tile-state { min-height: 64px; padding: 10px; flex-direction: row; justify-content: center; gap: 8px; color: var(--home-muted); font-size: 12px; }
#heating-home .tile-state .ui-icon { width: 32px; height: 32px; }
#heating-home .tile-state.is-on { color: #ffce7f; }
#heating-home .tile-stop { gap: 8px; padding: 8px 10px; border-top: 1px solid var(--home-line); background: rgba(18, 31, 43, .1); }
#heating-home .stop-badge { background: #647484; color: #e4ebf1; width: 28px; height: 28px; flex-shrink: 0; font-size: 9px; }
#heating-home .tile-stop-info { flex: 1; min-width: 0; font-size: 11px; }
#heating-home .tile-stop-info b { color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
#heating-home .tile-stop.is-blocked { background: rgba(211, 78, 65, .16); }
#heating-home .tile-stop.is-blocked .stop-badge { background: #ce4b41; color: #fff; }
#heating-home .tile-stop.is-blocked .tile-stop-info b { color: #ffb0a3; }
#heating-home .tile-line { padding: 8px 10px; gap: 8px; border-color: var(--home-line); color: var(--home-muted); font-size: 11px; }
#heating-home .tile-line b { color: #e3eaf0; font-size: 11px; }
#heating-home .tile-line b.is-on { color: #b4edbc; }
#heating-home .tile-season { flex-direction: row; gap: 10px; padding: 12px; color: #b6e5fc; }
#heating-home .tile-season .ui-icon { width: 32px; height: 32px; }
#heating-home .tile-season b { font-size: 16px; font-weight: 550; letter-spacing: .06em; }
#heating-home .tile-season.is-summer { color: #ffd081; }
#heating-home .pump-dot { width: 8px; height: 8px; background: #7c8b9a; vertical-align: middle; }
#heating-home .tile-pump .ui-icon { width: 15px; height: 15px; color: var(--home-muted); }
#heating-home .pump-dot.is-on { background: #a3e9a4; box-shadow: 0 0 0 3px rgba(163, 233, 164, .12); }
#heating-home .tile .zone-edit-button {
  width: calc(100% - 24px); margin: 4px 12px 12px;
  border: 1px solid #738697; color: #e7eef4; background: rgba(19, 31, 42, .15);
}
#heating-home .tile .zone-edit-button:hover:not(:disabled) { background: #526779; border-color: #a2b8c9; }
#heating-home .quick-edit, #heating-home .thermostat-control { color: var(--ink); background: #f4f7f9; border-radius: 8px; padding: 12px; }
#heating-home .quick-edit .muted, #heating-home .thermostat-control .muted { color: #53616e; }
@keyframes home-reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1280px) {
  #heating-home .tile-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  #heating-home { padding: 16px; }
  #heating-home .tile-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 520px) {
  #heating-home { padding: 12px; border-radius: 12px; }
  #heating-home .tile-wall { grid-template-columns: minmax(0, 1fr); }
  #heating-home .tile-value, #heating-home .tile-value b { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  #heating-home .tile { animation: none; }
}
