:root {
  color-scheme: dark;
  --bg: #0d1213;
  --bg-elevated: #12191a;
  --panel: rgba(24, 32, 33, 0.92);
  --panel-strong: #1b2425;
  --panel-soft: #151d1e;
  --line: rgba(236, 228, 211, 0.10);
  --line-strong: rgba(236, 228, 211, 0.18);
  --text: #f4f0e8;
  --muted: #9ea6a2;
  --muted-strong: #c5c8c2;
  --warm: #ef8a4b;
  --warm-soft: #f5b36f;
  --warm-dim: rgba(239, 138, 75, 0.13);
  --electric: #e5c65e;
  --electric-dim: rgba(229, 198, 94, 0.13);
  --water: #68a9c5;
  --climate: #6fc0a5;
  --violet: #a994ce;
  --danger: #e46c66;
  --danger-dim: rgba(228, 108, 102, 0.13);
  --success: #79bd91;
  --success-dim: rgba(121, 189, 145, 0.13);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  --content: 1360px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -12%, rgba(88, 118, 105, 0.14), transparent 34rem),
    radial-gradient(circle at -8% 22%, rgba(150, 83, 48, 0.09), transparent 31rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(239, 138, 75, 0.52);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  color: #101515;
  background: var(--text);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
}

.brand__mark {
  position: relative;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(239, 138, 75, 0.34);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 70%, rgba(239, 138, 75, 0.23), transparent 60%);
}

.brand__mark::before,
.brand__mark::after,
.brand__mark span {
  position: absolute;
  content: "";
  border-radius: 999px;
  background: var(--warm);
}

.brand__mark::before {
  width: 0.28rem;
  height: 1.05rem;
  transform: rotate(42deg) translate(-0.16rem, -0.04rem);
}

.brand__mark::after {
  width: 0.28rem;
  height: 0.82rem;
  transform: rotate(-35deg) translate(0.2rem, 0.36rem);
}

.brand__mark span {
  width: 0.27rem;
  height: 0.54rem;
  transform: translate(0.08rem, 0.53rem) rotate(8deg);
  background: var(--warm-soft);
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand strong {
  font-size: 0.94rem;
  letter-spacing: -0.015em;
}

.brand small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.app-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 18, 19, 0.96);
}

.header-inner {
  display: flex;
  width: min(100% - 1.5rem, var(--content));
  min-height: 4.4rem;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.app-nav {
  position: fixed;
  z-index: 110;
  right: 0.7rem;
  bottom: calc(0.65rem + var(--safe-bottom));
  left: 0.7rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0.34rem;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(23, 31, 32, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 650;
}

.nav-item__icon {
  font-size: 1.12rem;
  line-height: 1;
}

.nav-item.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
}

.connection-pill {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.72rem;
  font-weight: 650;
}

.status-dot {
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(158, 166, 162, 0.08);
}

.connection-pill.is-online .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-dim);
}

.connection-pill.is-warning .status-dot {
  background: var(--electric);
  box-shadow: 0 0 0 4px var(--electric-dim);
}

.connection-pill.is-offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-dim);
}

.connection-pill.is-loading .status-dot {
  animation: breathe 1.5s ease-in-out infinite;
}

.logout-form {
  display: flex;
}

.icon-button,
.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.icon-button {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 50%;
  font-size: 1rem;
  transform: rotate(-45deg);
}

.icon-button:hover,
.secondary-button:hover {
  color: var(--text);
  border-color: rgba(239, 138, 75, 0.34);
}

.app-main {
  width: min(100% - 1.5rem, var(--content));
  min-height: calc(100vh - 9rem);
  margin: 0 auto;
  padding: 1.35rem 0 7rem;
}

.view-panel {
  animation: panel-in 260ms ease both;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

.page-heading h1 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(1.55rem, 7vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.last-update {
  display: none;
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.issue-banner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(229, 198, 94, 0.22);
  border-radius: var(--radius-sm);
  color: #e6dfcb;
  background: rgba(229, 198, 94, 0.075);
}

.issue-banner.is-critical {
  border-color: rgba(228, 108, 102, 0.25);
  background: var(--danger-dim);
}

.issue-banner__icon {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #181b18;
  background: var(--electric);
  font-weight: 850;
}

.issue-banner.is-critical .issue-banner__icon {
  background: var(--danger);
}

.issue-banner strong,
.issue-banner p {
  display: block;
  margin: 0;
  font-size: 0.78rem;
}

.issue-banner p {
  margin-top: 0.1rem;
  color: var(--muted-strong);
}

.hero-grid,
.detail-grid,
.diagnostic-grid,
.source-grid {
  display: grid;
  gap: 0.85rem;
}

.hero-grid {
  margin-bottom: 0.85rem;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(28, 37, 38, 0.96), rgba(20, 28, 29, 0.94));
  box-shadow: var(--shadow);
}

.buffer-card,
.energy-card,
.detail-card,
.chart-card,
.diagnostic-card {
  padding: 1rem;
}

.buffer-card {
  position: relative;
  background:
    radial-gradient(circle at 12% 80%, rgba(239, 138, 75, 0.14), transparent 18rem),
    linear-gradient(145deg, rgba(31, 39, 39, 0.98), rgba(22, 29, 30, 0.96));
}

.energy-card {
  position: relative;
  background:
    radial-gradient(circle at 90% 16%, rgba(229, 198, 94, 0.12), transparent 18rem),
    linear-gradient(145deg, rgba(30, 38, 38, 0.98), rgba(20, 28, 29, 0.96));
}

.panel-heading,
.chart-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-heading h2,
.chart-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 670;
  letter-spacing: -0.025em;
}

.panel-heading--compact {
  align-items: center;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.62rem;
}

.section-dot,
.level-dot,
.legend-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.section-dot--warm,
.legend-dot--orange { background: var(--warm); }
.section-dot--electric,
.legend-dot--electric { background: var(--electric); }
.section-dot--fire,
.legend-dot--red { background: var(--danger); }
.section-dot--water,
.legend-dot--blue { background: var(--water); }
.section-dot--climate,
.legend-dot--climate { background: var(--climate); }
.legend-dot--sand { background: var(--warm-soft); }
.legend-dot--amber { background: #d79055; }
.legend-dot--brick { background: #aa6054; }
.legend-dot--green { background: var(--climate); }
.legend-dot--violet { background: var(--violet); }

.state-badge {
  display: inline-flex;
  min-height: 1.65rem;
  max-width: 48%;
  align-items: center;
  padding: 0.25rem 0.58rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.66rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-badge.is-good {
  color: #a9d7b8;
  border-color: rgba(121, 189, 145, 0.24);
  background: var(--success-dim);
}

.state-badge.is-neutral {
  color: #e1d7b6;
  border-color: rgba(229, 198, 94, 0.21);
  background: rgba(229, 198, 94, 0.07);
}

.state-badge.is-alert {
  color: #efaaa6;
  border-color: rgba(228, 108, 102, 0.25);
  background: var(--danger-dim);
}

.state-badge.is-stale {
  color: #e3c57f;
  border-color: rgba(229, 198, 94, 0.25);
  background: var(--electric-dim);
}

.state-badge__icon {
  display: inline-grid;
  width: 0.82rem;
  flex: 0 0 auto;
  place-items: center;
  margin-right: 0.22rem;
  line-height: 1;
}

.state-badge__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buffer-main {
  display: grid;
  grid-template-columns: minmax(9rem, 0.9fr) minmax(8rem, 1.1fr);
  align-items: center;
  gap: 0.7rem;
  margin: 1rem 0 0.8rem;
}

.tank-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
}

.tank {
  position: relative;
  display: grid;
  width: 3.65rem;
  height: 7rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(245, 179, 111, 0.28);
  border-radius: 1.15rem;
  background: rgba(5, 10, 10, 0.4);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.32), 0 0 28px rgba(239, 138, 75, 0.06);
}

.tank progress {
  width: 5.7rem;
  height: 2.65rem;
  overflow: hidden;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  transform: rotate(-90deg);
  appearance: none;
}

.tank progress::-webkit-progress-bar {
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.035);
}

.tank progress::-webkit-progress-value {
  border-radius: 0.55rem;
  background: linear-gradient(90deg, #c85d38, var(--warm), var(--warm-soft));
  box-shadow: 0 0 15px rgba(239, 138, 75, 0.3);
  transition: width 700ms ease;
}

.tank progress::-moz-progress-bar {
  border-radius: 0.55rem;
  background: linear-gradient(90deg, #c85d38, var(--warm), var(--warm-soft));
}

.tank__cap {
  position: absolute;
  left: 50%;
  width: 1.55rem;
  height: 0.22rem;
  border-radius: 999px;
  background: rgba(245, 179, 111, 0.28);
  transform: translateX(-50%);
}

.tank__cap--top { top: -0.36rem; }
.tank__cap--bottom { bottom: -0.36rem; }

.tank-reading {
  min-width: 0;
}

.big-reading,
.hero-reading,
.large-metric,
.metric-value {
  display: flex;
  align-items: baseline;
  white-space: nowrap;
}

.big-reading strong {
  font-size: clamp(2.35rem, 11vw, 4.1rem);
  font-weight: 570;
  letter-spacing: -0.075em;
  line-height: 0.95;
}

.big-reading span {
  margin-left: 0.2rem;
  color: var(--warm-soft);
  font-size: 1rem;
}

.tank-reading small,
.metric-label,
.metric-sub {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}

.tank-reading small {
  margin-top: 0.35rem;
}

.temperature-stack {
  display: grid;
  gap: 0.2rem;
}

.temperature-row {
  display: flex;
  min-height: 2.4rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--line);
}

.temperature-row:last-child {
  border-bottom: 0;
}

.temperature-row__label {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--muted-strong);
  font-size: 0.75rem;
}

.level-dot--hot { background: var(--warm-soft); }
.level-dot--mid { background: var(--warm); }
.level-dot--low { background: #b45b45; }

.temperature-row__value {
  white-space: nowrap;
}

.temperature-row__value strong {
  font-size: 1.05rem;
  font-weight: 650;
}

.temperature-row__value small {
  margin-left: 0.12rem;
  color: var(--muted);
}

.panel-foot {
  display: flex;
  min-height: 2.1rem;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
}

.panel-foot strong {
  color: var(--muted-strong);
}

.freshness-label {
  margin-left: auto;
  text-align: right;
}

.is-stale,
.is-stale .freshness-label,
.freshness-label.is-stale {
  color: #d9b977;
}

.panel.is-stale {
  opacity: 0.8;
  border-style: dashed;
}

.eta-entry-stale {
  color: #d9b977 !important;
  opacity: 0.68;
  text-decoration: underline dotted rgba(217, 185, 119, 0.62);
  text-underline-offset: 0.2em;
}

.eta-entry-stale::after {
  content: " \25F7 " attr(data-eta-age);
  display: inline-block;
  margin-left: 0.18rem;
  color: #d9b977;
  font-size: 0.58em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}

.state-badge.eta-entry-stale::after {
  font-size: 0.72em;
}

.power-focus {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.1rem 0 0.55rem;
}

.power-direction {
  display: grid;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(229, 198, 94, 0.23);
  border-radius: 50%;
  color: var(--electric);
  background: var(--electric-dim);
  font-size: 1.5rem;
}

.power-focus p {
  margin: 0 0 0.1rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.hero-reading strong {
  font-size: clamp(2.15rem, 11vw, 3.85rem);
  font-weight: 570;
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.hero-reading small {
  margin-left: 0.3rem;
  color: var(--electric);
  font-size: 0.9rem;
}

.energy-flow {
  display: grid;
  grid-template-columns: auto minmax(2rem, 1fr) auto;
  align-items: center;
  margin: 0.7rem 0;
}

.flow-node {
  display: grid;
  min-width: 3.2rem;
  justify-items: center;
  gap: 0.15rem;
  color: var(--muted);
  font-size: 0.64rem;
}

.flow-node__icon {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  font-size: 1.05rem;
}

.flow-node--active .flow-node__icon {
  color: var(--electric);
  border-color: rgba(229, 198, 94, 0.25);
  background: var(--electric-dim);
}

.flow-line {
  position: relative;
  height: 1px;
  overflow: hidden;
  background: linear-gradient(90deg, transparent, rgba(229, 198, 94, 0.62), transparent);
}

.flow-line span {
  position: absolute;
  top: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--electric);
  box-shadow: 0 0 9px var(--electric);
  animation: flow 2s linear infinite;
}

.metric-pair,
.split-readings,
.climate-zones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-pair {
  margin-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.metric-pair > div {
  padding: 0.7rem 0;
}

.metric-pair > div + div {
  padding-left: 0.8rem;
  border-left: 1px solid var(--line);
}

.metric-value {
  margin-top: 0.18rem;
  color: var(--muted-strong);
  font-size: 0.74rem;
}

.metric-value strong {
  margin-right: 0.22rem;
  color: var(--text);
  font-size: 1.05rem;
}

.detail-card {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.17);
}

.eta-card-foot {
  margin-top: 0.8rem;
}

.dial-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1rem 0;
}

.temperature-dial {
  display: grid;
  width: 5.3rem;
  height: 5.3rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(239, 138, 75, 0.25);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(239, 138, 75, 0.10) 0 54%, transparent 55%),
    conic-gradient(from -110deg, var(--warm) 0 42%, rgba(255, 255, 255, 0.06) 42% 82%, transparent 82%);
}

.temperature-dial > span {
  display: grid;
  width: 4.2rem;
  height: 4.2rem;
  place-content: center;
  border-radius: 50%;
  background: #182020;
  text-align: center;
}

.temperature-dial strong {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.temperature-dial small {
  margin-left: 0.12rem;
  color: var(--muted);
}

.dial-copy p {
  margin: 0.3rem 0 0;
  color: var(--muted-strong);
  font-size: 0.78rem;
}

.compact-metrics,
.diagnostic-list {
  margin: 0;
}

.compact-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.compact-metrics div {
  padding-top: 0.72rem;
}

.compact-metrics div + div {
  padding-left: 0.8rem;
  border-left: 1px solid var(--line);
}

.compact-metrics dt,
.compact-metrics dd {
  margin: 0;
}

.compact-metrics dt {
  color: var(--muted);
  font-size: 0.66rem;
}

.compact-metrics dd {
  margin-top: 0.2rem;
  color: var(--muted-strong);
  font-size: 0.77rem;
}

.compact-metrics dd strong {
  color: var(--text);
  font-size: 1rem;
}

.split-readings {
  margin: 1rem 0;
}

.split-readings > div + div {
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.large-metric {
  margin: 0.35rem 0 0.18rem;
}

.large-metric strong {
  font-size: 1.75rem;
  font-weight: 590;
  letter-spacing: -0.055em;
}

.large-metric small {
  margin-left: 0.2rem;
  color: var(--muted);
}

.outside-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.7rem;
}

.outside-strip strong {
  color: var(--text);
  font-size: 0.88rem;
}

.climate-zones {
  margin: 1rem 0;
}

.climate-zones section + section {
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.zone-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.zone-details {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.62rem;
}

.zone-details strong {
  color: var(--muted-strong);
  font-weight: 650;
}

.range-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0.26rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.page-heading--history {
  align-items: stretch;
  flex-direction: column;
}

.page-heading--history .range-control {
  width: 100%;
}

.range-control button {
  min-width: 3rem;
  min-height: 2.2rem;
  padding: 0 0.6rem;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
}

.range-control button.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.085);
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.history-summary > div {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.history-summary strong {
  display: inline-block;
  margin-top: 0.32rem;
  font-size: 1.25rem;
  font-weight: 620;
  letter-spacing: -0.035em;
}

.history-summary small {
  color: var(--muted);
}

.history-summary p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.chart-stack {
  display: grid;
  gap: 0.85rem;
}

.chart-card {
  padding: 1rem 0.8rem 0.75rem;
}

.chart-heading {
  display: block;
  padding: 0 0.2rem 0.75rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.62rem;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.canvas-wrap {
  position: relative;
  min-height: 14rem;
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 14rem;
  touch-action: pan-y;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  margin: 0;
  place-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  pointer-events: none;
}

.chart-note {
  margin: 0.4rem 0.3rem 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.secondary-button {
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.85rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.secondary-button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.source-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.85rem;
}

.source-card {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.source-card__icon {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border-radius: 50%;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.055);
}

.source-card strong,
.source-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-card strong {
  margin-top: 0.16rem;
  font-size: 0.78rem;
}

.source-card small {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.62rem;
}

.source-light {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--muted);
}

.source-card.is-online .source-light { background: var(--success); box-shadow: 0 0 0 4px var(--success-dim); }
.source-card.is-stale .source-light { background: var(--electric); box-shadow: 0 0 0 4px var(--electric-dim); }
.source-card.is-offline .source-light { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-dim); }

.netatmo-connect-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 0.9rem;
  border: 1px solid rgba(111, 192, 165, 0.24);
  border-radius: var(--radius-sm);
  background: rgba(111, 192, 165, 0.075);
}

.netatmo-connect-card strong,
.netatmo-connect-card p {
  display: block;
  margin: 0;
}

.netatmo-connect-card strong {
  font-size: 0.78rem;
}

.netatmo-connect-card p {
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.primary-link {
  display: inline-flex;
  min-height: 2.5rem;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 11px;
  color: #111716;
  background: var(--climate);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 780;
}

.primary-link:hover {
  filter: brightness(1.07);
}

.diagnostic-grid {
  grid-template-columns: 1fr;
}

.diagnostic-card {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.diagnostic-list {
  display: grid;
  gap: 0;
  margin-top: 0.7rem;
}

.diagnostic-list div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.62rem 0;
  border-top: 1px solid var(--line);
}

.diagnostic-list dt,
.diagnostic-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.diagnostic-list dt {
  color: var(--muted);
  font-size: 0.7rem;
}

.diagnostic-list dd {
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 640;
  text-align: right;
}

.diagnostic-note {
  max-width: 48rem;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.55;
  text-align: center;
}

.app-footer {
  display: none;
  width: min(100% - 2rem, var(--content));
  margin: 0 auto;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.65rem;
}

.noscript-alert {
  position: fixed;
  z-index: 500;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  padding: 1rem;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #381f1d;
  text-align: center;
}

/* Login */
.login-page {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 74% 35%, rgba(239, 138, 75, 0.13), transparent 25rem),
    radial-gradient(circle at 18% 4%, rgba(105, 163, 144, 0.09), transparent 24rem),
    #0c1112;
}

.login-shell {
  display: grid;
  width: min(100% - 1.5rem, 72rem);
  min-height: 100vh;
  margin: 0 auto;
  place-items: center;
  padding: 1.25rem 0;
}

.login-card {
  width: min(100%, 27rem);
  padding: 1.3rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(20, 28, 29, 0.9);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(20px);
}

.brand--login {
  margin-bottom: 3.2rem;
}

.login-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 10vw, 3.1rem);
  font-weight: 620;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.login-heading > p:last-child {
  max-width: 31ch;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.form-alert {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.7rem;
  border: 1px solid rgba(228, 108, 102, 0.25);
  border-radius: 11px;
  background: var(--danger-dim);
}

.form-alert > span {
  display: grid;
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #161616;
  background: var(--danger);
  font-size: 0.68rem;
  font-weight: 850;
}

.form-alert p {
  margin: 0;
  color: #edc2bf;
  font-size: 0.72rem;
}

.login-form {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.7rem;
}

.login-form > label {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 650;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  height: 3.25rem;
  padding: 0 5.3rem 0 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--text);
  background: rgba(4, 9, 9, 0.35);
  font-size: 1rem;
}

.password-field input:focus {
  border-color: rgba(239, 138, 75, 0.55);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  min-height: 2.35rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.primary-button {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.3rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 13px;
  color: #1c1713;
  background: linear-gradient(105deg, var(--warm), var(--warm-soft));
  box-shadow: 0 10px 30px rgba(239, 138, 75, 0.18);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 780;
}

.primary-button:hover {
  filter: brightness(1.06);
}

.primary-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.login-note {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.65rem;
  text-align: center;
}

.login-note span {
  margin-right: 0.25rem;
  color: var(--success);
  font-size: 0.55rem;
}

.login-ambient {
  display: none;
}

@media (min-width: 520px) {
  .app-main,
  .header-inner {
    width: min(100% - 2.4rem, var(--content));
  }

  .app-main {
    padding-top: 1.8rem;
  }

  .last-update {
    display: block;
  }

  .buffer-card,
  .energy-card,
  .detail-card,
  .diagnostic-card {
    padding: 1.25rem;
  }

  .chart-card {
    padding: 1.25rem 1rem 0.9rem;
  }

  .source-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .canvas-wrap,
  .canvas-wrap canvas {
    min-height: 17rem;
    height: 17rem;
  }
}

@media (min-width: 760px) {
  .app-header {
    background: rgba(13, 18, 19, 0.86);
    backdrop-filter: blur(18px);
  }

  .header-inner {
    min-height: 4.8rem;
  }

  .brand strong {
    font-size: 1rem;
  }

  .app-nav {
    position: static;
    display: flex;
    width: auto;
    padding: 0.25rem;
    border-color: var(--line);
    border-radius: 13px;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: none;
  }

  .nav-item {
    min-height: 2.4rem;
    padding: 0 0.75rem;
    font-size: 0.72rem;
  }

  .nav-item__icon {
    font-size: 0.95rem;
  }

  .app-main {
    padding-bottom: 3.25rem;
  }

  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .climate-card {
    grid-column: 1 / -1;
  }

  .page-heading--history {
    align-items: center;
    flex-direction: row;
  }

  .page-heading--history .range-control {
    width: auto;
  }

  .chart-heading {
    display: flex;
    align-items: flex-end;
  }

  .chart-legend {
    justify-content: flex-end;
    margin-top: 0;
  }

  .diagnostic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagnostic-card--wide {
    grid-column: 1 / -1;
  }

  .diagnostic-list--columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
  }

  .app-footer {
    display: flex;
    justify-content: space-between;
  }
}

@media (min-width: 1020px) {
  .app-main {
    padding-top: 2.25rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  }

  .buffer-card,
  .energy-card {
    min-height: 22rem;
    padding: 1.45rem;
  }

  .buffer-main {
    margin-top: 1.45rem;
  }

  .tank {
    width: 4.4rem;
    height: 8rem;
  }

  .tank progress {
    width: 6.7rem;
    height: 3.3rem;
  }

  .detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .climate-card {
    grid-column: auto;
  }

  .chart-card {
    padding: 1.3rem 1.2rem 1rem;
  }

  .chart-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-stack .chart-card:first-child {
    grid-column: 1 / -1;
  }

  .diagnostic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .canvas-wrap,
  .canvas-wrap canvas {
    min-height: 20rem;
    height: 20rem;
  }

  .login-shell {
    grid-template-columns: minmax(22rem, 0.82fr) minmax(25rem, 1.18fr);
    gap: 4rem;
  }

  .login-card {
    justify-self: end;
    padding: 1.7rem;
  }

  .login-ambient {
    position: relative;
    display: grid;
    width: min(42vw, 34rem);
    aspect-ratio: 1;
    place-items: center;
  }

  .ambient-orbit {
    position: absolute;
    border: 1px solid rgba(239, 138, 75, 0.13);
    border-radius: 50%;
  }

  .ambient-orbit::before,
  .ambient-orbit::after {
    position: absolute;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--warm);
    box-shadow: 0 0 18px rgba(239, 138, 75, 0.65);
    content: "";
  }

  .ambient-orbit--one {
    inset: 10%;
    animation: orbit 30s linear infinite;
  }

  .ambient-orbit--one::before {
    top: 17%;
    right: 8%;
  }

  .ambient-orbit--one::after {
    bottom: 3%;
    left: 27%;
    background: var(--electric);
  }

  .ambient-orbit--two {
    inset: 23%;
    border-color: rgba(111, 192, 165, 0.13);
    animation: orbit 24s linear infinite reverse;
  }

  .ambient-orbit--two::before {
    top: 4%;
    left: 28%;
    background: var(--climate);
  }

  .ambient-orbit--two::after {
    right: 2%;
    bottom: 24%;
    background: var(--water);
  }

  .ambient-core {
    display: grid;
    width: 14rem;
    height: 14rem;
    place-content: center;
    border: 1px solid rgba(239, 138, 75, 0.18);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(239, 138, 75, 0.15), rgba(19, 27, 28, 0.72) 61%, transparent 62%);
    box-shadow: 0 0 80px rgba(239, 138, 75, 0.10);
    text-align: center;
  }

  .ambient-core__value,
  .ambient-core__label {
    display: block;
  }

  .ambient-core__value {
    font-size: 2.35rem;
    font-weight: 570;
    letter-spacing: -0.055em;
  }

  .ambient-core__label {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
  }
}

@media (min-width: 1240px) {
  .detail-card {
    min-height: 18rem;
  }

  .source-card {
    padding: 1rem;
  }
}

@media (max-width: 420px) {
  .brand__copy small,
  .connection-pill span:not(.status-dot) {
    display: none;
  }

  .connection-pill {
    width: 2.25rem;
    padding: 0;
    justify-content: center;
  }

  .buffer-main {
    grid-template-columns: minmax(8rem, 0.92fr) minmax(7.6rem, 1.08fr);
  }

  .tank {
    width: 3.1rem;
    height: 6.5rem;
  }

  .tank progress {
    width: 5.2rem;
    height: 2.2rem;
  }

  .tank-wrap {
    gap: 0.5rem;
  }

  .big-reading strong {
    font-size: 2.2rem;
  }

  .temperature-row__label {
    font-size: 0.68rem;
  }

  .history-summary strong {
    font-size: 1.05rem;
  }

  .netatmo-connect-card {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@keyframes breathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes flow {
  from { left: 0; }
  to { left: 100%; }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

/* ========================================================================== 
   Monitor dashboard / wallboard layout
   This block intentionally follows the legacy rules so the login page keeps
   its established presentation while the authenticated app gets a compact,
   interruption-free always-on layout.
   ========================================================================== */

body.app-page {
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  color: #edf2ef;
  background: #080d0f;
  font-variant-numeric: tabular-nums lining-nums;
}

.app-page *,
.app-page *::before,
.app-page *::after {
  animation: none !important;
}

.app-page .app-header,
.app-page .app-footer,
.app-page .page-heading,
.app-page .panel-foot,
.app-page .freshness-label {
  display: none !important;
}

.app-page .app-nav {
  position: fixed;
  z-index: 120;
  inset: 0 auto 0 0;
  display: flex;
  width: 4rem;
  padding: 0.75rem 0.55rem;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 0.65rem;
  border: 0;
  border-right: 1px solid #253136;
  border-radius: 0;
  background: #0d1417;
  box-shadow: none;
  backdrop-filter: none;
}

.app-page .nav-item {
  position: relative;
  display: grid;
  width: 2.8rem;
  min-width: 2.8rem;
  height: 2.8rem;
  min-height: 2.8rem;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  color: #89979c;
  background: transparent;
  cursor: pointer;
}

.app-page .nav-item:hover,
.app-page .nav-item:focus-visible {
  color: #edf2ef;
  border-color: #34434a;
  background: #172125;
}

.app-page .nav-item.is-active {
  color: #ffd0aa;
  border-color: #5b3d2d;
  background: #2b1f19;
}

.app-page .nav-item__icon {
  font-size: 1.3rem;
  line-height: 1;
}

.app-page .nav-item__label {
  position: absolute;
  left: calc(100% + 0.8rem);
  top: 50%;
  z-index: 10;
  width: max-content;
  padding: 0.38rem 0.55rem;
  border: 1px solid #34434a;
  border-radius: 0.45rem;
  color: #edf2ef;
  background: #121b1f;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.app-page .nav-item:hover .nav-item__label,
.app-page .nav-item:focus-visible .nav-item__label {
  opacity: 1;
}

.app-page .app-main {
  width: auto;
  max-width: none;
  min-height: 100dvh;
  margin: 0 0 0 4rem;
  padding: 0.85rem;
}

.app-page .view-panel {
  width: 100%;
  min-width: 0;
}

.app-page .view-panel.is-active {
  animation: none;
}

.app-page .issue-banner {
  display: grid;
  min-height: 3rem;
  margin: 0 0 0.65rem;
  padding: 0.6rem 0.85rem;
  grid-template-columns: 1.8rem minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  border: 1px solid #665323;
  border-radius: 0.75rem;
  color: #f4e9c5;
  background: #211d12;
  box-shadow: none;
}

.app-page .issue-banner.is-critical {
  border-color: #743d3a;
  color: #f5d7d4;
  background: #251617;
}

.app-page .issue-banner__icon {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: #e7c65e;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 800;
}

.app-page .issue-banner.is-critical .issue-banner__icon {
  color: #ed8a82;
  background: transparent;
}

.app-page .issue-banner strong,
.app-page .issue-banner p {
  display: inline;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.app-page .issue-banner p::before {
  content: " · ";
  color: #9faaa7;
}

.app-page .overview-grid {
  display: grid;
  min-width: 0;
  gap: 0.65rem;
}

.app-page .panel {
  min-width: 0;
  border: 1px solid #263238;
  border-radius: 1rem;
  color: #edf2ef;
  background: #11191c;
  box-shadow: none;
}

.app-page .panel.is-stale {
  border-color: #665323;
  opacity: 0.76;
}

.app-page .eta-entry-stale {
  opacity: 0.7;
  text-decoration: none;
  text-decoration-style: unset;
}

.app-page .eta-entry-stale::after,
.app-page .state-badge.eta-entry-stale::after {
  display: none !important;
  content: none !important;
}

.app-page .section-kicker,
.app-page .metric-label {
  color: #8e9b9f;
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.105em;
  line-height: 1.25;
  text-transform: uppercase;
}

.app-page .section-kicker {
  margin: 0 0 0.16rem;
}

.app-page h1,
.app-page h2,
.app-page p {
  margin-top: 0;
}

.app-page h1,
.app-page h2,
.app-page strong {
  font-weight: 620;
}

.app-page .system-heading,
.app-page .module-heading,
.app-page .panel-heading,
.app-page .chart-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.app-page .system-heading {
  align-items: center;
}

.app-page .system-heading__icon {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #573c2e;
  border-radius: 0.7rem;
  color: #f3a36a;
  background: #251b17;
  font-size: 1.15rem;
}

.app-page .system-heading > div {
  flex: 1;
}

.app-page .system-heading h1,
.app-page .module-heading h2,
.app-page .panel-heading h2,
.app-page .chart-heading h2 {
  margin: 0;
  color: #f2f5f2;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.app-page .system-heading h1 {
  font-size: 1.55rem;
}

.app-page .module-heading h2,
.app-page .panel-heading h2,
.app-page .chart-heading h2 {
  font-size: 1.08rem;
}

.app-page .state-badge {
  display: inline-flex;
  min-height: 1.65rem;
  max-width: 52%;
  padding: 0.28rem 0.55rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #39464a;
  border-radius: 999px;
  color: #c4cdca;
  background: #172024;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.app-page .state-badge.is-good {
  color: #a9dbb8;
  border-color: #315b40;
  background: #14241a;
}

.app-page .state-badge.is-neutral {
  color: #d4d9d6;
  border-color: #3b484c;
  background: #182125;
}

.app-page .state-badge.is-alert {
  color: #f0aaa4;
  border-color: #6e3b38;
  background: #291819;
}

.app-page .state-badge.is-stale {
  color: #e8cc75;
  border-color: #665323;
  background: #211d12;
}

.app-page .heat-system-card {
  display: grid;
  min-width: 0;
  padding: 0.9rem;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  border-color: #3f332d;
  background: #12191b;
}

.app-page .heat-modules {
  display: grid;
  min-width: 0;
  gap: 0.55rem;
}

.app-page .heat-module {
  display: flex;
  min-width: 0;
  padding: 0.8rem;
  flex-direction: column;
  border: 1px solid #2b373b;
  border-radius: 0.8rem;
  background: #0d1417;
}

.app-page .boiler-card {
  border-top-color: #77472d;
}

.app-page .buffer-card {
  border-top-color: #74512f;
}

.app-page .water-card {
  border-top-color: #31566a;
}

.app-page .boiler-focus {
  display: grid;
  margin: auto 0;
  padding: 1rem 0 0.85rem;
  place-items: center;
  text-align: center;
}

.app-page .primary-temperature {
  display: inline-flex;
  margin: 0.15rem 0 0.05rem;
  align-items: flex-start;
  color: #f6b27d;
  line-height: 1;
}

.app-page .primary-temperature strong {
  font-size: clamp(2.8rem, 4.1vw, 4.8rem);
  font-weight: 560;
  letter-spacing: -0.075em;
}

.app-page .primary-temperature small {
  margin: 0.34rem 0 0 0.28rem;
  color: #c7a48b;
  font-size: 0.8rem;
}

.app-page .metric-sub {
  color: #8e9b9f;
  font-size: 0.72rem;
}

.app-page .metric-sub strong {
  color: #d8dedb;
}

.app-page .compact-metrics,
.app-page .diagnostic-list {
  padding: 0;
  margin: 0;
}

.app-page .compact-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #263238;
}

.app-page .compact-metrics div {
  display: grid;
  padding: 0.7rem 0.35rem 0;
  gap: 0.18rem;
}

.app-page .compact-metrics div + div {
  border-left: 1px solid #263238;
}

.app-page .compact-metrics dt,
.app-page .compact-metrics dd {
  margin: 0;
  text-align: center;
}

.app-page .compact-metrics dt {
  color: #89979c;
  font-size: 0.65rem;
}

.app-page .compact-metrics dd {
  color: #bbc6c3;
  font-size: 0.7rem;
}

.app-page .compact-metrics dd strong {
  color: #eef2ef;
  font-size: 1.15rem;
}

.app-page .storage-main {
  display: grid;
  min-width: 0;
  margin: auto 0;
  grid-template-columns: minmax(5.8rem, 0.78fr) minmax(7.4rem, 1.22fr);
  align-items: center;
  gap: 0.7rem;
}

.app-page .storage-level {
  display: grid;
  min-width: 0;
  place-items: center;
  text-align: center;
}

.app-page .tank {
  position: relative;
  width: 3.65rem;
  height: 7.8rem;
  margin-bottom: 0.45rem;
  overflow: hidden;
  border: 2px solid #536064;
  border-radius: 0.75rem 0.75rem 0.55rem 0.55rem;
  background: #182125;
  box-shadow: none;
}

.app-page .tank::before {
  position: absolute;
  z-index: 2;
  inset: 0.32rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
  content: "";
  pointer-events: none;
}

.app-page .tank progress {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 7.8rem;
  height: 3.65rem;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
  transform: translate(-50%, 50%) rotate(-90deg);
  transform-origin: center;
}

.app-page .tank progress::-webkit-progress-bar {
  background: #182125;
}

.app-page .tank progress::-webkit-progress-value {
  background: #d8884c;
}

.app-page .tank progress::-moz-progress-bar {
  background: #d8884c;
}

.app-page .tank--water progress::-webkit-progress-value {
  background: #5797b4;
}

.app-page .tank--water progress::-moz-progress-bar {
  background: #5797b4;
}

.app-page .charge-reading {
  display: inline-flex;
  align-items: flex-start;
  color: #eef2ef;
  line-height: 1;
}

.app-page .charge-reading strong {
  font-size: 1.55rem;
  letter-spacing: -0.055em;
}

.app-page .charge-reading small {
  margin: 0.18rem 0 0 0.12rem;
  color: #94a19e;
  font-size: 0.63rem;
}

.app-page .storage-level > .metric-label {
  margin-top: 0.2rem;
  font-size: 0.55rem;
}

.app-page .temperature-stack {
  display: grid;
  min-width: 0;
  gap: 0;
  border-top: 1px solid #263238;
}

.app-page .temperature-row {
  display: flex;
  min-width: 0;
  min-height: 2.45rem;
  padding: 0.45rem 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  border-bottom: 1px solid #263238;
}

.app-page .temperature-row > span {
  min-width: 0;
  color: #929fa3;
  font-size: 0.66rem;
}

.app-page .temperature-row--source > span small {
  display: block;
  margin-top: 0.1rem;
  color: #66757a;
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.app-page .temperature-row > strong {
  flex: 0 0 auto;
  color: #e7ece9;
  font-size: 0.83rem;
  white-space: nowrap;
}

.app-page .temperature-row > strong span {
  font-size: 1.13rem;
}

.app-page .heating-strip {
  display: grid;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  grid-template-columns: minmax(6.5rem, 1.15fr) repeat(3, minmax(5.4rem, 1fr));
  align-items: center;
  gap: 0;
  border: 1px solid #2b373b;
  border-radius: 0.8rem;
  background: #0d1417;
}

.app-page .heating-strip > div {
  display: grid;
  min-width: 0;
  padding: 0 0.75rem;
  gap: 0.16rem;
}

.app-page .heating-strip > div:first-child {
  padding-left: 0;
}

.app-page .heating-strip > div + div {
  border-left: 1px solid #263238;
}

.app-page .heating-strip h2 {
  margin: 0;
  font-size: 1rem;
}

.app-page .heating-strip strong {
  overflow: hidden;
  color: #e9efeb;
  font-size: 1rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-page .energy-card,
.app-page .climate-card {
  display: flex;
  min-width: 0;
  padding: 0.9rem;
  flex-direction: column;
  background: #11191c;
}

.app-page .energy-card {
  border-top-color: #64572d;
}

.app-page .climate-card {
  border-top-color: #315448;
}

.app-page .power-focus {
  display: flex;
  margin: auto 0;
  padding: 0.7rem 0;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.app-page .power-direction {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #675a31;
  border-radius: 50%;
  color: #ebce66;
  background: #24200f;
  font-size: 1.25rem;
}

.app-page .power-focus p {
  margin: 0 0 0.15rem;
  color: #9ca7a5;
  font-size: 0.7rem;
}

.app-page .hero-reading {
  display: inline-flex;
  align-items: flex-start;
  color: #f1d36d;
  line-height: 1;
}

.app-page .hero-reading strong {
  font-size: clamp(2.5rem, 3.8vw, 4.5rem);
  font-weight: 570;
  letter-spacing: -0.075em;
}

.app-page .hero-reading small {
  margin: 0.35rem 0 0 0.28rem;
  color: #b2a56d;
  font-size: 0.72rem;
}

.app-page .energy-path {
  display: grid;
  margin: 0 0 0.8rem;
  grid-template-columns: auto minmax(2rem, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  color: #7e8b8f;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-page .energy-path i {
  position: relative;
  display: block;
  height: 1px;
  overflow: hidden;
  background: #4a4a35;
}

.app-page .energy-path i::after {
  position: absolute;
  top: -2px;
  right: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e5c65e;
  content: "";
}

.app-page .metric-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #29353a;
}

.app-page .metric-pair > div {
  display: grid;
  min-width: 0;
  min-height: 4.4rem;
  padding: 0.65rem 0.7rem 0;
  align-content: center;
  gap: 0.24rem;
}

.app-page .metric-pair > div:first-child {
  padding-left: 0;
}

.app-page .metric-pair > div + div {
  border-left: 1px solid #29353a;
}

.app-page .metric-value {
  color: #e8edeb;
  font-size: 0.72rem;
}

.app-page .metric-value strong {
  font-size: 1.45rem;
}

.app-page .state-badge--metric {
  max-width: 100%;
  width: fit-content;
  justify-self: start;
}

.app-page .climate-zones {
  display: grid;
  min-width: 0;
  margin: auto 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.app-page .climate-zones section {
  display: grid;
  min-width: 0;
  padding: 0.75rem;
  align-content: center;
}

.app-page .climate-zones section:first-child {
  padding-left: 0;
}

.app-page .climate-zones section + section {
  padding-right: 0;
  border-left: 1px solid #29353a;
}

.app-page .zone-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #96a39f;
  font-size: 0.7rem;
}

.app-page .large-metric {
  display: inline-flex;
  margin: 0.45rem 0 0.55rem;
  align-items: flex-start;
  color: #8dd0b7;
  line-height: 1;
}

.app-page .climate-zones section + section .large-metric {
  color: #82b9d1;
}

.app-page .large-metric strong {
  font-size: clamp(2.05rem, 2.9vw, 3.35rem);
  font-weight: 570;
  letter-spacing: -0.07em;
}

.app-page .large-metric small {
  margin: 0.25rem 0 0 0.22rem;
  color: #8eaaa1;
  font-size: 0.65rem;
}

.app-page .zone-details {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
  color: #8f9c9f;
  font-size: 0.62rem;
}

.app-page .zone-details strong {
  color: #cfd7d4;
}

.app-page .climate-note {
  margin: 0;
  padding-top: 0.55rem;
  border-top: 1px solid #29353a;
  color: #90aaa1;
  font-size: 0.66rem;
}

.app-page .history-toolbar,
.app-page .diagnostics-toolbar {
  display: flex;
  min-height: 3.4rem;
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid #263238;
  border-radius: 0.85rem;
  background: #11191c;
}

.app-page .history-toolbar h1,
.app-page .diagnostics-toolbar h1 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
}

.app-page .range-control {
  display: grid;
  width: auto;
  padding: 0.2rem;
  grid-template-columns: repeat(4, minmax(2.8rem, auto));
  border: 1px solid #2f3a3e;
  border-radius: 0.65rem;
  background: #0b1214;
}

.app-page .range-control button {
  min-height: 2rem;
  padding: 0.2rem 0.6rem;
  border: 0;
  border-radius: 0.45rem;
  color: #8e9b9f;
  background: transparent;
  font-size: 0.67rem;
  font-weight: 700;
  cursor: pointer;
}

.app-page .range-control button.is-active {
  color: #f0d0b9;
  background: #34241c;
}

.app-page .history-summary {
  display: grid;
  margin: 0 0 0.65rem;
  padding: 0.6rem 0.75rem;
  grid-template-columns: repeat(3, minmax(6rem, auto)) minmax(10rem, 1fr);
  align-items: center;
  gap: 0;
  border: 1px solid #263238;
  border-radius: 0.85rem;
  background: #11191c;
}

.app-page .history-summary > div {
  display: grid;
  min-width: 0;
  padding: 0 1rem;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: start;
  column-gap: 0.2rem;
}

.app-page .history-summary > div:first-child {
  padding-left: 0;
}

.app-page .history-summary > div + div {
  border-left: 1px solid #29353a;
}

.app-page .history-summary .metric-label {
  grid-column: 1 / -1;
}

.app-page .history-summary strong {
  color: #e9eeeb;
  font-size: 1.22rem;
}

.app-page .history-summary small {
  color: #89979c;
  font-size: 0.62rem;
}

.app-page .history-summary p {
  margin: 0;
  justify-self: end;
  color: #8d9a9e;
  font-size: 0.65rem;
  text-align: right;
}

.app-page .chart-stack {
  display: grid;
  min-width: 0;
  gap: 0.65rem;
}

.app-page .chart-card {
  min-width: 0;
  padding: 0.8rem 0.75rem 0.65rem;
}

.app-page .chart-heading {
  min-height: 3.2rem;
  margin-bottom: 0.45rem;
  align-items: flex-start;
}

.app-page .chart-legend {
  display: flex;
  margin: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.28rem 0.55rem;
}

.app-page .chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: #89979c;
  font-size: 0.58rem;
  white-space: nowrap;
}

.app-page .legend-dot {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
}

.app-page .canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 15.5rem;
  height: 15.5rem;
}

.app-page .canvas-wrap canvas {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 15.5rem;
  height: 15.5rem;
  border-radius: 0.55rem;
  cursor: crosshair;
  touch-action: pan-y;
}

.app-page .chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  margin: 0;
  place-items: center;
  color: #77868a;
  background: #0c1315;
  font-size: 0.7rem;
  pointer-events: none;
}

.app-page .chart-tooltip {
  position: absolute;
  z-index: 5;
  display: grid;
  min-width: 9.5rem;
  max-width: min(15rem, calc(100% - 1rem));
  padding: 0.55rem 0.65rem;
  gap: 0.25rem;
  border: 1px solid #47565b;
  border-radius: 0.55rem;
  color: #edf2ef;
  background: #0b1214;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
  font-size: 0.62rem;
  pointer-events: none;
}

.app-page .chart-tooltip__time {
  padding-bottom: 0.22rem;
  border-bottom: 1px solid #2d393d;
  color: #cbd4d1;
  font-size: 0.64rem;
}

.app-page .chart-tooltip__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: #96a3a6;
}

.app-page .chart-tooltip__row strong {
  white-space: nowrap;
}

.app-page .chart-note {
  margin: 0.38rem 0 0;
  color: #78878b;
  font-size: 0.58rem;
}

.app-page .diagnostics-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.app-page .logout-form {
  margin: 0;
}

.app-page .secondary-button,
.app-page .primary-link {
  display: inline-flex;
  min-height: 2.2rem;
  padding: 0.35rem 0.7rem;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid #354247;
  border-radius: 0.55rem;
  color: #d0d8d5;
  background: #151e21;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.app-page .secondary-button:hover,
.app-page .primary-link:hover {
  color: #f1f4f2;
  border-color: #526166;
  background: #1a2529;
}

.app-page .source-grid {
  display: grid;
  margin-bottom: 0.65rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.app-page .source-card {
  display: grid;
  min-width: 0;
  min-height: 5rem;
  padding: 0.7rem;
  grid-template-columns: 2.1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid #263238;
  border-radius: 0.8rem;
  background: #11191c;
}

.app-page .source-card__icon {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 1px solid #344146;
  border-radius: 0.6rem;
  color: #aab5b2;
  background: #182125;
}

.app-page .source-card > div {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.app-page .source-card strong,
.app-page .source-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-page .source-card strong {
  color: #e2e8e5;
  font-size: 0.76rem;
}

.app-page .source-card small {
  color: #849297;
  font-size: 0.6rem;
}

.app-page .source-light {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #526065;
}

.app-page .source-card.is-online .source-light {
  background: #71b78a;
  box-shadow: 0 0 0 3px rgba(113, 183, 138, 0.12);
}

.app-page .source-card.is-stale .source-light {
  background: #dec15b;
  box-shadow: 0 0 0 3px rgba(222, 193, 91, 0.12);
}

.app-page .source-card.is-offline .source-light {
  background: #df716b;
  box-shadow: 0 0 0 3px rgba(223, 113, 107, 0.12);
}

.app-page .netatmo-connect-card {
  display: flex;
  margin-bottom: 0.65rem;
  padding: 0.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid #675a31;
  border-radius: 0.8rem;
  background: #211d12;
}

.app-page .netatmo-connect-card strong,
.app-page .netatmo-connect-card p {
  margin: 0;
}

.app-page .netatmo-connect-card strong {
  font-size: 0.78rem;
}

.app-page .netatmo-connect-card p {
  margin-top: 0.15rem;
  color: #aaa58d;
  font-size: 0.64rem;
}

.app-page .diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.app-page .diagnostic-card {
  min-width: 0;
  padding: 0.8rem;
}

.app-page .diagnostic-card--wide {
  grid-column: 1 / -1;
}

.app-page .diagnostic-list {
  display: grid;
  margin-top: 0.6rem;
}

.app-page .diagnostic-list div {
  display: flex;
  min-width: 0;
  min-height: 2rem;
  padding: 0.4rem 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  border-top: 1px solid #263238;
}

.app-page .diagnostic-list dt,
.app-page .diagnostic-list dd {
  min-width: 0;
  margin: 0;
  font-size: 0.67rem;
}

.app-page .diagnostic-list dt {
  color: #89979c;
}

.app-page .diagnostic-list dd {
  overflow-wrap: anywhere;
  color: #d7dfdc;
  text-align: right;
}

.app-page .diagnostic-list--columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
}

@media (min-width: 1200px) {
  .app-page .overview-grid {
    min-height: calc(100dvh - 1.7rem);
    grid-template-columns: minmax(0, 7fr) minmax(20rem, 5fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .app-page:has(.issue-banner:not([hidden])) .overview-grid {
    min-height: calc(100dvh - 5.35rem);
  }

  .app-page .heat-system-card {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .app-page .energy-card {
    grid-column: 2;
    grid-row: 1;
  }

  .app-page .climate-card {
    grid-column: 2;
    grid-row: 2;
  }

  .app-page .heat-modules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-page .chart-stack {
    grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  }

  .app-page .chart-stack .chart-card:first-child {
    grid-column: auto;
  }

  .app-page .canvas-wrap,
  .app-page .canvas-wrap canvas {
    min-height: calc(100dvh - 18.6rem);
    height: calc(100dvh - 18.6rem);
  }
}

@media (min-width: 760px) and (max-width: 1199px) {
  .app-page .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-page .heat-system-card {
    grid-column: 1 / -1;
  }

  .app-page .heat-modules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-page .energy-card,
  .app-page .climate-card {
    min-height: 19rem;
  }

  .app-page .chart-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-page .chart-stack .chart-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1600px) {
  .app-page .app-main {
    padding: 1rem;
  }

  .app-page .overview-grid {
    min-height: calc(100dvh - 2rem);
    gap: 0.8rem;
  }

  .app-page:has(.issue-banner:not([hidden])) .overview-grid {
    min-height: calc(100dvh - 5.65rem);
  }

  .app-page .heat-system-card,
  .app-page .energy-card,
  .app-page .climate-card {
    padding: 1.05rem;
  }

  .app-page .heat-modules {
    gap: 0.7rem;
  }

  .app-page .heat-module {
    padding: 0.95rem;
  }

  .app-page .heating-strip {
    padding-block: 0.82rem;
  }
}

@media (max-width: 759px) {
  body.app-page {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .app-page .app-nav {
    inset: auto 0 0;
    display: grid;
    width: auto;
    height: calc(4.25rem + env(safe-area-inset-bottom, 0px));
    padding: 0.35rem 0.55rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    border: 0;
    border-top: 1px solid #2b373b;
    background: #0d1417;
  }

  .app-page .nav-item {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 3.25rem;
    min-height: 3.25rem;
    padding: 0.35rem 0.25rem;
    flex-direction: column;
    gap: 0.2rem;
    border-radius: 0.65rem;
  }

  .app-page .nav-item__icon {
    font-size: 1.05rem;
  }

  .app-page .nav-item__label {
    position: static;
    width: auto;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    box-shadow: none;
    font-size: 0.58rem;
    opacity: 1;
    transform: none;
  }

  .app-page .app-main {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: 0.55rem 0.55rem calc(4.8rem + env(safe-area-inset-bottom, 0px));
  }

  .app-page .issue-banner {
    min-height: 0;
    padding: 0.55rem 0.65rem;
    grid-template-columns: 1.55rem minmax(0, 1fr);
    gap: 0.5rem;
  }

  .app-page .issue-banner__icon {
    width: 1.45rem;
    height: 1.45rem;
  }

  .app-page .issue-banner strong,
  .app-page .issue-banner p {
    display: block;
    font-size: 0.67rem;
  }

  .app-page .issue-banner p::before {
    content: none;
  }

  .app-page .overview-grid,
  .app-page .heat-modules,
  .app-page .chart-stack,
  .app-page .diagnostic-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-page .heat-system-card,
  .app-page .energy-card,
  .app-page .climate-card,
  .app-page .chart-card,
  .app-page .diagnostic-card {
    padding: 0.72rem;
  }

  .app-page .heat-modules {
    gap: 0.5rem;
  }

  .app-page .heat-module {
    min-height: 18rem;
  }

  .app-page .boiler-focus {
    padding-block: 0.8rem;
  }

  .app-page .primary-temperature strong,
  .app-page .hero-reading strong {
    font-size: 3rem;
  }

  .app-page .tank {
    width: 3.8rem;
    height: 7.2rem;
  }

  .app-page .tank progress {
    width: 7.2rem;
    height: 3.8rem;
  }

  .app-page .heating-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-page .heating-strip > div {
    min-height: 3.7rem;
    padding: 0.55rem;
    align-content: center;
    border-left: 0 !important;
  }

  .app-page .heating-strip > div:nth-child(even) {
    border-left: 1px solid #263238 !important;
  }

  .app-page .heating-strip > div:nth-child(n + 3) {
    border-top: 1px solid #263238;
  }

  .app-page .energy-card,
  .app-page .climate-card {
    min-height: 18rem;
  }

  .app-page .history-toolbar,
  .app-page .diagnostics-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .app-page .range-control {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .app-page .history-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-page .history-summary > div {
    padding: 0 0.55rem;
  }

  .app-page .history-summary strong {
    font-size: 1rem;
  }

  .app-page .history-summary p {
    grid-column: 1 / -1;
    margin-top: 0.55rem;
    padding-top: 0.5rem;
    justify-self: stretch;
    border-top: 1px solid #29353a;
    text-align: left;
  }

  .app-page .chart-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-page .chart-legend {
    justify-content: flex-start;
  }

  .app-page .canvas-wrap,
  .app-page .canvas-wrap canvas {
    min-height: 15rem;
    height: 15rem;
  }

  .app-page .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-page .source-card {
    min-height: 4.5rem;
    grid-template-columns: 1.8rem minmax(0, 1fr) auto;
  }

  .app-page .source-card__icon {
    width: 1.8rem;
    height: 1.8rem;
  }

  .app-page .netatmo-connect-card {
    align-items: stretch;
    flex-direction: column;
  }

  .app-page .diagnostic-card--wide {
    grid-column: auto;
  }

  .app-page .diagnostic-list--columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 389px) {
  .app-page .storage-main {
    grid-template-columns: minmax(5.2rem, 0.72fr) minmax(6.8rem, 1.28fr);
  }

  .app-page .climate-zones {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-page .climate-zones section,
  .app-page .climate-zones section:first-child,
  .app-page .climate-zones section + section {
    padding: 0.65rem 0;
    border-left: 0;
  }

  .app-page .climate-zones section + section {
    border-top: 1px solid #29353a;
  }

  .app-page .source-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.app-page .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
