:root {
  --bg: #eef3f6;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --text: #111b24;
  --muted: #647381;
  --line: #d8e1e8;
  --nav: #202d37;
  --green: #19b968;
  --red: #d94940;
  --amber: #f3a51d;
  --blue: #2878d4;
  --cyan: #17a7c8;
  --shadow: 0 8px 24px rgba(24, 39, 51, .08);
}

.system-page .page-shell .phone-header { height:42px; }
.system-page .page-shell .phone-header h1 { margin:0; font-size:20px; }
.diagnostic-page { padding:16px 14px; }
.diagnostic-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.diagnostic-heading h2 { margin:0; font-size:20px; }
.diagnostic-heading button { min-height:36px; padding:6px 10px; font-size:13px; }
.diagnostic-heading button svg { width:16px; height:16px; }
.diagnostic-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px; margin:10px 0 14px; color:#69777d; font-size:12px; }
.diagnostic-tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.diagnostic-tile { min-width:0; min-height:133px; padding:12px 7px; display:flex; flex-direction:column; align-items:center; justify-content:space-between; gap:9px; border:1px solid #dce3e7; border-radius:8px; background:#f8fafb; text-align:center; }
.diagnostic-label { color:#53636d; font-size:13px; overflow-wrap:anywhere; }
.diagnostic-symbol { height:36px; display:flex; align-items:center; justify-content:center; color:#839097; }
.diagnostic-symbol > svg { width:32px; height:32px; stroke-width:1.8; }
.diagnostic-value { font-size:25px; line-height:1.2; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.diagnostic-value.diagnostic-unknown { font-size:16px; font-weight:500; color:#69777d; }
.diagnostic-pump { position:relative; width:45px; height:36px; display:grid; place-items:center; }
.diagnostic-pump:before,.diagnostic-pump:after { content:''; position:absolute; width:9px; height:11px; border-top:2px solid currentColor; border-bottom:2px solid currentColor; top:12px; }
.diagnostic-pump:before { left:0; } .diagnostic-pump:after { right:0; }
.diagnostic-rotor { width:34px; height:34px; border:2px solid currentColor; border-radius:50%; display:grid; place-items:center; background:#f8fafb; z-index:1; }
.diagnostic-rotor svg { width:23px; height:23px; }
[data-diagnostic='fan'].is-active .diagnostic-symbol { color:#17a7c8; }
[data-diagnostic='fan'].is-active .diagnostic-fan,[data-diagnostic='pump'].is-active .diagnostic-rotor svg { animation:diagnostic-spin 2s linear infinite; }
[data-diagnostic='water'] .diagnostic-symbol,[data-diagnostic='pump'].is-active .diagnostic-symbol { color:#19ab68; }
[data-diagnostic='acs'].is-active .diagnostic-symbol { color:#19ab68; }
[data-diagnostic='fumes'] .diagnostic-symbol { color:#2878d4; }
[data-diagnostic='setpoint'] .diagnostic-symbol { color:#697d8c; }
[data-diagnostic='power'] .diagnostic-symbol { color:#ef6934; }
.diagnostic-bridge { margin-top:16px; border-top:1px solid var(--line); padding-top:12px; }
.diagnostic-bridge summary { cursor:pointer; padding:8px 0; font-size:14px; }
.diagnostic-bridge .system-summary { margin:12px 0; }
@keyframes diagnostic-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .diagnostic-tile .diagnostic-fan,.diagnostic-rotor svg { animation:none !important; } }
@media (max-width:350px) { .diagnostic-page { padding:12px 9px; } .diagnostic-tiles { gap:7px; } .diagnostic-value { font-size:22px; } }
@media (max-height:760px) {
  .diagnostic-page { padding-top:10px; }
  .diagnostic-meta { margin:6px 0 10px; }
  .diagnostic-tiles { gap:7px; }
  .diagnostic-tile { min-height:90px; padding:6px 7px; gap:4px; }
  .diagnostic-symbol { height:28px; }
  .diagnostic-symbol > svg { width:27px; height:27px; }
  .diagnostic-pump { height:28px; }
  .diagnostic-pump:before,.diagnostic-pump:after { top:8px; }
  .diagnostic-rotor { width:28px; height:28px; }
  .diagnostic-rotor svg { width:20px; height:20px; }
  .diagnostic-value { font-size:22px; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.app {
  min-height: 100vh;
  display: block;
}

.appbar {
  display: none;
}

.sidebar {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 750;
  margin-bottom: 26px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 0 12px;
  border-radius: 7px;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-size: 15px;
  margin-bottom: 5px;
}

.nav-link.active {
  background: rgba(255,255,255,.13);
  color: #fff;
  font-weight: 650;
}

.main {
  min-width: 0;
  padding: 0 0 76px;
}

.phone-shell {
  max-width: 540px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  height: calc(100vh - 76px);
  min-height: 0;
  overflow: hidden;
}

.phone-header {
  height: 66px;
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  background: #3d3d3d;
  color: #fff;
}

.phone-shell .phone-header {
  grid-template-columns: 1fr;
}

.page-shell .phone-header {
  grid-template-columns: 1fr;
}

.phone-header h1 {
  text-align: center;
  font-size: 22px;
  font-weight: 720;
}

.icon-action {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: currentColor;
  text-decoration: none;
  border: 0;
  background: transparent;
}

.icon-action.power-top {
  color: #19e75f;
}

.icon-action.power-top.is-on {
  color: #f04a43;
}

.phone-content {
  position: relative;
  padding: 10px 0 0;
  height: calc(100vh - 142px);
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.home-power-button {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 58px;
  height: 58px;
  min-height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid #19e75f;
  background: #fff;
  color: #19e75f;
  padding: 0;
}

.home-alert-button {
  position: absolute;
  top: 23px;
  left: 22px;
  z-index: 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #6f777d;
  text-decoration: none;
}

.home-alert-button svg {
  width: 30px;
  height: 30px;
  stroke-width: 2.4;
}

.home-alert-button span {
  position: absolute;
  top: 6px;
  right: 5px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e33f47;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .18s ease, transform .18s ease;
}

.home-alert-button.has-alert {
  color: #111c24;
}

.home-alert-button.has-alert span {
  opacity: 1;
  transform: scale(1);
}

.home-power-button.is-on {
  border-color: #f04a43;
  color: #f04a43;
}

.home-power-button svg {
  width: 36px;
  height: 36px;
  stroke-width: 2.8;
}

.update-line {
  color: #9aa2aa;
  text-align: center;
  font-size: 14px;
  margin-bottom: 10px;
}

.boiler-state {
  text-align: center;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 460;
  margin: 8px 0 0;
}

.boiler-substate {
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  margin-top: 6px;
}

.gauge-wrap {
  position: relative;
  min-height: 286px;
  display: grid;
  place-items: end center;
  padding: 0 18px 2px;
  overflow: visible;
  flex: 1 1 auto;
}

.gauge {
  width: min(360px, 84vw);
  aspect-ratio: 1.22 / 1;
  transform: translateY(-96px);
}

.gauge text {
  fill: var(--text);
}

.gauge .tick-cool,
.gauge .tick-warm,
.gauge .tick-heat,
.gauge .tick-off {
  stroke: #dfe4e8;
  stroke-width: 4;
  stroke-linecap: round;
}

.gauge .tick-blue-active {
  stroke: #1f7de0;
}

.gauge .tick-orange-active {
  stroke: #f0a22a;
}

.gauge .tick-red-active {
  stroke: #f46a2b;
}

.gauge-main-value {
  font-size: 76px;
  font-weight: 520;
}

.gauge-unit {
  font-size: 26px;
  fill: var(--muted);
}

.gauge-setpoint {
  font-size: 76px;
  font-weight: 520;
  cursor: pointer;
  transition: fill .18s ease;
}

.gauge-set-label {
  fill: var(--text);
  font-size: 38px;
  font-weight: 520;
}

.gauge-setpoint.setpoint-pending {
  fill: #e33f47;
}

.gauge-setpoint.setpoint-sent {
  fill: #20c768;
}

.gauge-line {
  stroke: var(--text);
  stroke-width: 3;
}

.round-control {
  position: absolute;
  bottom: 182px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
  display: grid;
  place-items: center;
}

.round-control.minus {
  left: 28px;
  color: #1f7de0;
}

.round-control.plus {
  right: 28px;
  color: #e74040;
}

.home-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: auto;
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #d7d7d7;
}

.home-tile {
  min-height: 118px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
  padding: 9px 6px 4px;
  text-align: center;
  border-right: 1px solid #c5c5c5;
  color: #6a6a6a;
}

.home-tile:last-child {
  border-right: 0;
}

.tile-title {
  font-size: 14px;
  text-transform: uppercase;
  line-height: 1.35;
}

.tile-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
}

.tile-value {
  font-size: 25px;
  font-weight: 760;
  color: #606060;
}

.bars {
  display: flex;
  gap: 5px;
  align-items: end;
  height: 38px;
}

.bar {
  width: 8px;
  height: 30px;
  border-radius: 5px;
  background: #9a9a9a;
}

.bar.active {
  background: #f01818;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
}

h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e8eef3;
  color: #536371;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.badge.ok {
  background: #e7f6ef;
  color: #157a47;
}

.badge.warn {
  background: #faeceb;
  color: #aa2d27;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mini-stats span {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.mini-stats strong {
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 720;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(280px, .88fr) minmax(340px, 1.12fr);
  gap: 14px;
}

.hero-status {
  padding: 18px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.state {
  font-size: 36px;
  line-height: 1;
  font-weight: 800;
}

.power {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(25,185,104,.35);
  background: rgba(25,185,104,.12);
  color: var(--green);
  display: grid;
  place-items: center;
}

.temp-main {
  text-align: center;
  padding: 10px 0 16px;
}

.temp-main .value {
  font-size: 82px;
  line-height: .9;
  font-weight: 800;
}

.temp-main .unit {
  font-size: 30px;
  color: var(--muted);
  font-weight: 650;
}

.temp-main .label {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button,
.button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
}

.on {
  background: var(--green);
  color: #fff;
}

.off {
  background: var(--red);
  color: #fff;
}

.clear {
  background: var(--amber);
  color: #241700;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  padding: 14px;
}

.metric .label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric .value {
  font-size: 31px;
  line-height: 1;
  font-weight: 800;
}

.metric .note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.wide {
  margin-top: 14px;
  padding: 16px;
}

.chart {
  height: 300px;
  width: 100%;
}

svg {
  width: 100%;
  height: 100%;
  display: block;
}

.graphs-page .combined-chart {
  height: auto;
  aspect-ratio: 400 / 350;
  width: 100%;
}

.graphs-page .combined-chart svg {
  width: 100%;
  height: 100%;
}

.graphs-page .combined-chart text {
  font-size: 16px;
  font-weight: 600;
}

.chart-axis-fumi { fill: var(--red); }
.chart-axis-acqua { fill: var(--blue); }

.graphs-page .mini-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.graphs-page .mini-stats span {
  font-size: 18px;
}

.graphs-page .mini-stats span:first-child { color: var(--red); }
.graphs-page .mini-stats span:nth-child(2) { color: var(--blue); }

.graphs-page .temperature-chart-section {
  padding: 12px 8px;
}

.graphs-page .temperature-chart-section h2 {
  margin: 0 8px 12px;
  font-size: 18px;
}

.axis {
  fill: var(--muted);
  font-size: 12px;
}

.grid-line {
  stroke: #dbe4eb;
  stroke-width: 1;
}

.line-fumi {
  fill: none;
  stroke: var(--red);
  stroke-width: 3;
}

.line-acqua {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
}

.line-ref {
  stroke: #ff7d35;
  stroke-width: 2;
  stroke-dasharray: 7 7;
}

.error-list,
.system-list {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 12px 14px;
}

.row + .row {
  border-top: 1px solid var(--line);
}

.time {
  color: var(--muted);
  font-size: 14px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf2f6;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip.ok {
  background: #e7f6ef;
  color: #157a47;
}

.status-chip.warn {
  background: #faeceb;
  color: #aa2d27;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.small-button.warn {
  background: var(--amber);
  color: #241700;
}

.row.current {
  background: #fbfefd;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.page-shell {
  max-width: 540px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: calc(100vh - 76px);
}

.page-content {
  padding: 16px;
}

.compact-page {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.system-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.compact-section {
  display: grid;
  gap: 10px;
}

.compact-section h2 {
  margin: 0;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mini-card {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  display: grid;
  align-content: center;
  gap: 5px;
}

.mini-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
}

.mini-card strong {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.diagnostics-grid .mini-card {
  min-height: 54px;
}


.page-card {
  border-top: 1px solid var(--line);
  padding: 16px;
}

.mobile-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(540px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #f1f1f1;
  border-top: 1px solid #c9c9c9;
  box-shadow: 0 -6px 20px rgba(22, 35, 45, .10);
  z-index: 10;
  height: 76px;
}

.mobile-nav a {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #686868;
  text-decoration: none;
  font-size: 11px;
  line-height: 1.1;
}

.mobile-nav svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.6;
}

.mobile-nav a.active {
  color: #111;
  font-weight: 750;
}

@media (max-width: 820px) {
  .phone-shell {
    max-width: none;
    height: calc(100vh - 76px);
    min-height: 0;
    border: 0;
    box-shadow: none;
  }

  .phone-content {
    height: calc(100vh - 134px);
    min-height: 0;
  }

  .update-line {
    margin-bottom: 8px;
  }

  .boiler-state {
    font-size: 30px;
    margin-top: 4px;
  }

  .boiler-substate {
    font-size: 17px;
    margin-top: 5px;
  }

  .gauge-wrap {
    min-height: 254px;
    align-items: start;
    padding-top: 0;
  }

  .gauge {
    width: min(330px, 82vw);
    transform: translateY(-44px);
  }

  .gauge-main-value {
    font-size: 68px;
  }

  .round-control {
    bottom: 106px;
    width: 50px;
    height: 50px;
  }

  .round-control.minus {
    left: 18px;
  }

  .round-control.plus {
    right: 18px;
  }

  .page-shell {
    max-width: none;
    min-height: calc(100vh - 76px);
    border: 0;
    box-shadow: none;
  }

  .page-content {
    padding: 12px;
  }

  .compact-page {
    padding: 10px;
    gap: 10px;
  }

  .topbar {
    align-items: flex-start;
  }

  h1 {
    font-size: 20px;
  }

  .home-grid,
  .system-grid {
    grid-template-columns: 1fr;
  }

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

  .mini-stats {
    grid-template-columns: 1fr;
  }

  .metrics .metric:first-child {
    grid-column: 1 / -1;
  }

  .temp-main .value {
    font-size: 72px;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .status-chip {
    justify-self: start;
  }

  .mobile-nav { left: 0; transform: none; width: 100%; }
}

@media (max-width: 420px) {
  .phone-header {
    height: 58px;
    grid-template-columns: 52px 1fr 52px;
  }

  .phone-header h1 {
    font-size: 20px;
  }

  .compact-grid {
    gap: 7px;
  }

  .mini-card {
    min-height: 50px;
    padding: 7px 8px;
    gap: 4px;
  }

  .mini-card span {
    font-size: 11px;
  }

  .mini-card strong {
    font-size: 14px;
  }

  .diagnostics-grid .mini-card {
    min-height: 48px;
  }

  .compact-section h2 {
    font-size: 16px;
  }

  .gauge-wrap {
    min-height: 292px;
    padding-top: 16px;
  }

  .gauge {
    width: min(318px, 80vw);
  }

  .gauge-main-value {
    font-size: 64px;
  }

  .round-control {
    bottom: 114px;
    width: 48px;
    height: 48px;
  }

  .round-control.minus {
    left: 18px;
  }

  .round-control.plus {
    right: 18px;
  }

  .home-tile {
    min-height: 104px;
    gap: 4px;
    padding-top: 7px;
  }

  .tile-title {
    font-size: 12px;
  }

  .tile-icon {
    width: 32px;
    height: 32px;
  }

  .tile-value {
    font-size: 22px;
  }

  .tile-small-value {
    font-size: 12px;
  }

  .bars {
    height: 29px;
  }

  .bar {
    width: 7px;
    height: 25px;
  }

  .mobile-nav {
    height: 70px;
  }

  .mobile-nav a {
    min-height: 70px;
  }

  .mobile-nav svg {
    width: 26px;
    height: 26px;
  }

  .main {
    padding-bottom: 70px;
  }

  .phone-shell {
    height: calc(100svh - 70px);
  }

  .phone-content {
    height: calc(100svh - 128px);
  }
}

@media (max-width: 420px) {
  .phone-header {
    height: 58px;
    grid-template-columns: 52px 1fr 52px;
  }

  .phone-header h1 {
    font-size: 20px;
  }

  .compact-grid {
    gap: 7px;
  }

  .mini-card {
    min-height: 50px;
    padding: 7px 8px;
    gap: 4px;
  }

  .mini-card span {
    font-size: 11px;
  }

  .mini-card strong {
    font-size: 14px;
  }

  .diagnostics-grid .mini-card {
    min-height: 48px;
  }

  .compact-section h2 {
    font-size: 16px;
  }

  .gauge-wrap {
    min-height: 244px;
  }

  .gauge {
    width: min(312px, 79vw);
    transform: translateY(-42px);
  }

  .gauge-main-value {
    font-size: 62px;
  }

  .round-control {
    bottom: 104px;
    width: 48px;
    height: 48px;
  }

  .round-control.minus {
    left: 18px;
  }

  .round-control.plus {
    right: 18px;
  }

  .home-tile {
    min-height: 112px;
  }

  .tile-title {
    font-size: 13px;
  }

  .tile-value {
    font-size: 26px;
  }
}

@media (max-width: 820px) {
  .main {
    padding-bottom: 70px;
  }

  .phone-shell {
    height: calc(100svh - 70px);
  }

  .phone-content {
    height: calc(100svh - 128px);
    padding-top: 8px;
  }

  .update-line {
    margin-bottom: 6px;
  }

  .boiler-state {
    font-size: 30px;
    margin-top: 2px;
  }

  .boiler-substate {
    font-size: 17px;
    margin-top: 4px;
  }

  .gauge-wrap {
    min-height: 244px;
    padding-top: 0;
    align-items: start;
  }

  .gauge {
    width: min(318px, 80vw);
    transform: translateY(-42px);
  }

  .gauge-main-value {
    font-size: 62px;
  }

  .round-control {
    bottom: 104px;
    width: 48px;
    height: 48px;
  }

  .round-control.minus {
    left: 18px;
  }

  .round-control.plus {
    right: 18px;
  }

  .home-tile {
    min-height: 96px;
    gap: 3px;
    padding: 6px 5px 3px;
  }

  .tile-title {
    font-size: 12px;
    line-height: 1.25;
  }

  .tile-icon {
    width: 30px;
    height: 30px;
  }

  .tile-value {
    font-size: 21px;
  }

  .tile-small-value {
    font-size: 12px;
  }

  .bars {
    height: 27px;
  }

  .bar {
    width: 7px;
    height: 23px;
  }

  .mobile-nav {
    height: 70px;
  }

  .mobile-nav a {
    min-height: 70px;
  }

  .mobile-nav svg {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 820px) and (max-height: 760px) {
  .gauge-wrap {
    min-height: 224px;
  }

  .gauge {
    width: min(300px, 77vw);
    transform: translateY(-42px);
  }

  .round-control {
    bottom: 96px;
  }

  .home-tile {
    min-height: 88px;
  }
}

/* Home gauge finale: stile 4Heat, arco grande e controlli sotto al ventaglio. */
.phone-content .gauge-wrap {
  min-height: 322px;
  padding: 0 10px 2px;
  place-items: start center;
}

.phone-content .gauge-180 {
  width: min(420px, 98vw);
  transform: none;
}

.phone-content .round-control {
  top: 214px;
  bottom: auto;
  width: 54px;
  height: 54px;
}

.phone-content .round-control.minus {
  left: 34px;
}

.phone-content .round-control.plus {
  right: 34px;
}

@media (max-width: 820px) {
  .phone-content .gauge-wrap {
    min-height: 300px;
  }

  .phone-content .gauge-180 {
    width: min(410px, 96vw);
  }

  .phone-content .round-control {
    top: 202px;
    width: 52px;
    height: 52px;
  }

  .phone-content .round-control.minus {
    left: 24px;
  }

  .phone-content .round-control.plus {
    right: 24px;
  }
}

@media (max-width: 420px) {
  .phone-content .gauge-wrap {
    min-height: 286px;
  }

  .phone-content .gauge-180 {
    width: min(390px, 96vw);
  }

  .phone-content .round-control {
    top: 192px;
    width: 50px;
    height: 50px;
  }

  .phone-content .round-control.minus {
    left: 20px;
  }

  .phone-content .round-control.plus {
    right: 20px;
  }
}

@media (max-width: 820px) and (max-height: 760px) {
  .phone-content .gauge-wrap {
    min-height: 266px;
  }

  .phone-content .gauge-180 {
    width: min(368px, 92vw);
  }

  .phone-content .round-control {
    top: 180px;
  }
}

.gauge-180 {
  aspect-ratio: 1.65 / 1;
}

.phone-content .gauge-wrap {
  min-height: 304px;
  place-items: center;
  padding: 8px 18px 2px;
}

.phone-content .gauge-180 {
  width: min(390px, 92vw);
  transform: none;
}

.phone-content .round-control {
  top: 132px;
  bottom: auto;
}

@media (max-width: 820px) {
  .phone-content .gauge-wrap {
    min-height: 264px;
    padding-top: 4px;
  }

  .phone-content .gauge-180 {
    width: min(380px, 91vw);
    transform: none;
  }

  .phone-content .round-control {
    top: 116px;
    width: 50px;
    height: 50px;
  }

  .phone-content .round-control.minus {
    left: 20px;
  }

  .phone-content .round-control.plus {
    right: 20px;
  }
}

@media (max-width: 420px) {
  .phone-content .gauge-wrap {
    min-height: 254px;
  }

  .phone-content .gauge-180 {
    width: min(360px, 90vw);
  }

  .phone-content .round-control {
    top: 112px;
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 820px) and (max-height: 760px) {
  .phone-content .gauge-wrap {
    min-height: 236px;
  }

  .phone-content .gauge-180 {
    width: min(340px, 88vw);
  }

  .phone-content .round-control {
    top: 104px;
  }
}

/* Override finale: gauge grande e pulsanti setpoint sotto al gauge. */
.phone-content .gauge-wrap {
  min-height: 350px;
  display: grid;
  grid-template-columns: 74px 1fr 74px;
  grid-template-rows: auto 64px;
  align-items: start;
  justify-items: center;
  padding: 0 8px 2px;
}

.phone-content .gauge-180 {
  grid-column: 1 / -1;
  grid-row: 1;
  width: min(430px, 100vw);
  transform: none;
}

.phone-content .round-control {
  position: static;
  grid-row: 2;
  top: auto;
  bottom: auto;
  width: 54px;
  height: 54px;
  margin-top: -20px;
}

.phone-content .round-control.minus {
  grid-column: 1;
  left: auto;
}

.phone-content .round-control.plus {
  grid-column: 3;
  right: auto;
}

@media (max-width: 820px) {
  .phone-content .gauge-wrap {
    min-height: 326px;
    grid-template-columns: 66px 1fr 66px;
    grid-template-rows: auto 60px;
  }

  .phone-content .gauge-180 {
    width: min(418px, 99vw);
  }

  .phone-content .round-control {
    width: 52px;
    height: 52px;
    margin-top: -18px;
  }
}

@media (max-width: 420px) {
  .phone-content .gauge-wrap {
    min-height: 312px;
    grid-template-columns: 62px 1fr 62px;
  }

  .phone-content .gauge-180 {
    width: min(402px, 99vw);
  }

  .phone-content .round-control {
    width: 50px;
    height: 50px;
    margin-top: -16px;
  }
}

@media (max-width: 820px) and (max-height: 760px) {
  .phone-content .gauge-wrap {
    min-height: 292px;
  }

  .phone-content .gauge-180 {
    width: min(382px, 96vw);
  }
}

/* Correzione setpoint: pulsanti sotto il gauge, ma sopra le finestre grigie. */
.phone-content .gauge-wrap {
  min-height: 300px;
  grid-template-rows: auto 54px;
}

.phone-content .round-control {
  margin-top: -42px;
}

.phone-content .boiler-state {
  margin-left: 78px;
  margin-right: 78px;
  font-size: 26px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@media (max-width: 400px) {
  .phone-content .boiler-state {
    font-size: 22px;
  }
}

@media (max-width: 820px) {
  .phone-content .gauge-wrap {
    min-height: 286px;
  }

  .phone-content .round-control {
    margin-top: -44px;
  }
}

@media (max-width: 420px) {
  .phone-content .gauge-wrap {
    min-height: 276px;
  }

  .phone-content .round-control {
    margin-top: -44px;
  }
}

@media (max-width: 820px) and (max-height: 760px) {
  .phone-content .gauge-wrap {
    min-height: 258px;
  }

  .phone-content .round-control {
    margin-top: -46px;
  }
}
