:root {
  --bg: #f4f2ef;
  --surface: #ffffff;
  --surface-2: #efece8;
  --text: #1c1d20;
  --muted: #6b6d73;
  --line: #e2ded8;
  --heat: #f2652d;
  --heat-soft: #fde4d8;
  --cool: #2f7de1;
  --cool-soft: #dbe9fb;
  --ok: #2c9a5a;
  --warn: #c98a12;
  --bad: #d23c3c;
  --accent: var(--heat);
  --radius: 18px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.05);
  color-scheme: light;
}
/* Dark theme: follows the system unless the Appearance setting forces one (data-theme on <html>).
   Forcing matters for privacy browsers like Mullvad/Tor, which always report "light". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101114;
    --surface: #1a1c21;
    --surface-2: #23262c;
    --text: #eceae6;
    --muted: #9a9ca3;
    --line: #2c2f36;
    --heat: #ff7a3a;
    --heat-soft: #3a2218;
    --cool: #4c9aff;
    --cool-soft: #172638;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101114;
  --surface: #1a1c21;
  --surface-2: #23262c;
  --text: #eceae6;
  --muted: #9a9ca3;
  --line: #2c2f36;
  --heat: #ff7a3a;
  --heat-soft: #3a2218;
  --cool: #4c9aff;
  --cool-soft: #172638;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-right: auto; }
.brand img { width: 26px; height: 26px; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); }
.pill.bad { color: var(--bad); }
.pill.mock { color: var(--warn); }
#device-picker { max-width: 40vw; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; }

main { max-width: 720px; margin: 0 auto; padding: 4px 16px 24px; }
.view > h2 { font-size: 22px; margin: 8px 0 14px; }
h3 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px; border: 1px solid var(--line);
}
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; flex-wrap: nowrap; }
.row.between > :first-child { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack > * + * { margin-top: 10px; }

/* alert banner */
#alert-banner { max-width: 720px; margin: 0 auto; padding: 0 16px; }
#alert-banner .alert { margin-bottom: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: var(--heat-soft); color: var(--text); border-left: 4px solid var(--bad); }
.alert.medium { border-left-color: var(--warn); }
.alert.low { border-left-color: var(--muted); }
.alert b { display: block; }

/* home: dial */
.dial-wrap { display: grid; place-items: center; padding: 6px 0 4px; }
.dial { position: relative; width: min(300px, 78vw); aspect-ratio: 1; }
.dial svg { width: 100%; height: 100%; transform: rotate(135deg); }
.dial .track { fill: none; stroke: var(--surface-2); stroke-width: 14; stroke-linecap: round; }
.dial .arc { fill: none; stroke: var(--muted); stroke-width: 14; stroke-linecap: round; transition: stroke-dasharray .5s, stroke .3s; }
.dial.heating .arc { stroke: var(--heat); }
.dial.cooling .arc { stroke: var(--cool); }
.dial .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial .now { font-size: clamp(56px, 18vw, 76px); font-weight: 300; letter-spacing: -2px; line-height: 1; }
.dial .now sup { font-size: .35em; letter-spacing: 0; vertical-align: top; position: relative; top: .35em; margin-left: 2px; }
.dial .action { margin-top: 8px; font-weight: 600; font-size: 14px; }
.dial.heating .action { color: var(--heat); }
.dial.cooling .action { color: var(--cool); }
.dial .humid { color: var(--muted); font-size: 18px; font-weight: 550; margin-top: 4px; }
/* Outside panel: top-right corner of the dial card on wide screens, a strip above the dial on phones. */
.dial-card { position: relative; }
.wx { --gd: var(--ok); --fc: var(--cool); margin: 0 0 6px auto; width: fit-content; min-width: 168px; padding: 9px 12px 10px; border-radius: 14px;
  background: linear-gradient(145deg, var(--cool-soft), var(--surface-2) 70%); border: 1px solid var(--line); font-size: 14px; }
.wx-h { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.wx-row { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 6px; line-height: 1.6; }
.wx-k { color: var(--muted); white-space: nowrap; }
.wx-k::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.wx-row.gd .wx-k::before { background: var(--gd); }
.wx-row.fc .wx-k::before { background: var(--fc); }
.wx-row b { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.wx-row b.cold { color: var(--cool); }
.wx-row b.hot { color: var(--heat); }
.wx-hum { font-size: 12px; color: var(--muted); white-space: nowrap; }
.wx-hum::before { content: "💧"; font-size: 10px; margin-right: 1px; }
.wx-track { position: relative; height: 6px; margin: 8px 4px 4px; border-radius: 99px; background: linear-gradient(90deg, var(--cool), var(--line) 50%, var(--heat)); opacity: .9; }
.wx-track i { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); transition: left .5s; }
.wx-track i.gd { background: var(--gd); }
.wx-track i.fc { background: var(--fc); }
.wx-say { font-size: 12px; color: var(--muted); text-align: center; }
.wx-when { font-size: 11px; color: var(--muted); text-align: right; margin-top: -2px; }
@media (min-width: 880px) { .wx { position: absolute; top: 14px; right: 14px; margin: 0; z-index: 1; } }
.flame { display: inline-block; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.setpoints { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 12px; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 99px; padding: 4px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--surface); font-size: 26px; cursor: pointer; box-shadow: var(--shadow); touch-action: manipulation; }
.stepper button:active { transform: scale(.94); }
.stepper .val { min-width: 92px; text-align: center; }
.stepper .val b { display: block; font-size: 28px; font-weight: 600; line-height: 1.1; }
.stepper .val span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stepper.heat .val b { color: var(--heat); }
.stepper.cool .val b { color: var(--cool); }
.stepper.pending .val b { opacity: .55; }

.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 9px; cursor: pointer; font-weight: 550; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button.on[data-v="heat"] { color: var(--heat); }
.seg button.on[data-v="cool"] { color: var(--cool); }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 6px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.fact { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-weight: 600; margin-top: 2px; }

/* buttons & inputs */
.btn { border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 11px; cursor: pointer; font-weight: 550; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=number], input[type=time], input[type=datetime-local], input[type=password], select, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0;
}
input[type=number] { width: 84px; }
textarea { width: 100%; min-height: 80px; font: 12px/1.4 ui-monospace, Consolas, monospace; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.field > input, label.field > select { color: var(--text); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }

/* schedule */
.entry { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: var(--surface); }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.days button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.timeline { position: relative; height: 34px; border-radius: 10px; overflow: hidden; background: var(--surface-2); margin: 6px 0 2px; }
.timeline div { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; border-right: 1px solid var(--surface); overflow: hidden; white-space: nowrap; }
.timeline .now-mark { width: 2px; background: var(--text); border: 0; z-index: 2; }
.tl-row { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; }
.tl-row > span { font-size: 12px; color: var(--muted); }

/* history */
.chart { width: 100%; min-height: 330px; } /* keep its height while redrawing */
.uplot { font-family: inherit; }
.u-legend { font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.bars .b { flex: 1; background: var(--heat); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; opacity: .85; }
.bars .b.cool { background: var(--cool); }
.bars .b:hover { opacity: 1; }
.bars-x { display: flex; gap: 3px; font-size: 10px; color: var(--muted); }
.bars-x span { flex: 1; text-align: center; overflow: hidden; }

/* lists */
.log { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.log li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.log li time { color: var(--muted); white-space: nowrap; min-width: 92px; }
.empty { text-align: center; color: var(--muted); padding: 18px 0; }

/* bottom tabs */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; max-width: 120px; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 10px; font-size: 11px; color: var(--muted); position: relative;
}
.tabs button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.active { color: var(--accent); }
.tabs button.main { font-weight: 650; }
.tabs .tab-sep { flex: none; width: 1px; margin: 12px 2px 14px; background: var(--line); }
.tabs svg .fill { fill: currentColor; stroke: none; opacity: .55; transition: width .5s; }
.tabs button.active svg .fill { opacity: .9; }
.tabs svg .fill.low { fill: var(--bad); opacity: 1; }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--bad); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }

dialog { border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 18px; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.45); }

#toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100vw - 32px); z-index: 10;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.error { background: var(--bad); color: #fff; }

ol.steps { padding-left: 20px; margin: 8px 0; }
ol.steps li { margin-bottom: 4px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.grid2 label.field > input, .grid2 label.field > select { width: 100%; }
.boost-row { display: flex; justify-content: center; margin: -2px 0 6px; }
.boost-on { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin: -2px 0 6px; padding: 6px 10px; border-radius: 12px; background: var(--heat-soft); }
.alert .btn { flex: none; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.meter > div { height: 100%; border-radius: 99px; }
/* Equipment status under the dial */
.status-strip { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 14px; }
.chip b { font-weight: 600; }
.chip.on.heat { background: var(--heat-soft); color: var(--heat); }
.chip.on.cool { background: var(--cool-soft); color: var(--cool); }
.chip.on.fan { background: var(--cool-soft); color: var(--cool); }
.chip:not(.on) > span:first-child { filter: grayscale(1); opacity: .55; }
.fan-icon { display: inline-flex; line-height: 0; }
.fan-icon.spin { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fan-icon.spin, .flame { animation: none; } }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain[disabled] .entry { opacity: .75; }
/* dismissable alerts */
.alert { touch-action: pan-y; position: relative; }
.alert-x { flex: none; align-self: flex-start; width: 36px; height: 36px; margin: -6px -8px 0 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.alert-x:hover, .alert-x:active { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
.alert a { color: inherit; text-decoration: underline; }
/* History chart readout */
.chart { min-height: 300px; }
.chart-time { font-size: 13px; color: var(--muted); margin: 0 2px 6px; min-height: 1.4em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip-s { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 13px; cursor: pointer; }
.chip-s b { font-weight: 650; min-width: 2.4em; text-align: right; font-variant-numeric: tabular-nums; }
.chip-s i { width: 14px; height: 0; border-top: 3px solid var(--c); border-radius: 2px; }
.chip-s i.dash { border-top: 2px dashed var(--c); }
.chip-s i.lane { height: 8px; border: 0; background: var(--c); border-radius: 2px; width: 14px; }
.chip-s.off { opacity: .45; }
.chip-s.off b { opacity: .6; }
.chip-s.static { cursor: default; }

/* who's in charge line */
.control-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: -2px 0 12px; border-radius: 12px; background: var(--surface-2); }
.control-line .ci { font-size: 20px; line-height: 1.2; }
.control-line b { font-weight: 600; }
.control-line.hand, .control-line.window { background: var(--heat-soft); }
.control-line.boost, .control-line.warmup { background: var(--heat-soft); }
.control-line.vacation, .control-line.away { background: var(--cool-soft); }
/* ⓘ explainers */
.info { border: 0; background: none; color: var(--muted); font-size: 14px; line-height: 1; padding: 2px 3px; margin-left: 2px; cursor: pointer; vertical-align: baseline; border-radius: 50%; }
.info:hover, .info:focus-visible { color: var(--text); }
/* toast with an action */
#toast.has-action { pointer-events: auto; }
.toast-btn { margin-left: 10px; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px 6px; }

/* stacked history panels */
.chart { min-height: 0; }
.panel-label { position: relative; }
.panel-label::before { content: attr(data-label); position: absolute; left: 46px; top: 6px; font-size: 11px; color: var(--muted); z-index: 1; pointer-events: none; }
.dot-legend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }

.check-row { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; }
.check-row input { margin-top: 3px; flex: none; }

/* collapsible settings sections */
details.fold { padding: 0; }
details.fold > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '›'; color: var(--muted); font-size: 20px; line-height: 1; transition: transform .15s; margin-left: 4px; }
details.fold[open] > summary::after { transform: rotate(90deg); }
details.fold > summary .sum-title { font-weight: 650; font-size: 15px; }
details.fold > summary .sum-hint { margin-left: auto; color: var(--muted); font-size: 13px; text-align: right; }
details.fold > .stack { padding: 0 16px 16px; }
.now-offline { font-size: 64px; font-weight: 300; letter-spacing: -2px; line-height: 1.1; }
.now-offline sup { font-size: .35em; letter-spacing: 0; vertical-align: top; position: relative; top: .35em; }

/* Smart plugs */
.chip-check { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border: 1px solid rgba(128,128,128,.35); border-radius: 999px; font-size: 13px; cursor: pointer; user-select: none; }
.chip-check input { margin: 0; }
.warn { color: var(--warn, #d9822b); }
.plug-row + .plug-row { border-top: 1px solid rgba(128,128,128,.2); padding-top: 12px; }

/* battery tab */
.batt-hero { padding-bottom: 12px; }
.batt-top { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0 6px; }
.batt-ico { display: block; flex: none; }
.batt-ico rect:nth-of-type(3) { transition: width .6s ease; }
.batt-soc { font-size: 56px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.batt-soc span { font-size: 26px; margin-left: 2px; font-weight: 650; }
.batt-say { text-align: center; margin: 4px 0 6px; }
.batt-say b { font-size: 17px; }
.flow { display: block; width: 100%; max-width: 420px; margin: 4px auto 0; }
.flow-line { stroke-width: 4; stroke-linecap: round; }
.flow-line.on { stroke-dasharray: 2 10; animation: batt-flow 1.2s linear infinite; }
@keyframes batt-flow { to { stroke-dashoffset: -24; } }
.flow-v { font-size: 15px; font-weight: 700; fill: var(--text); }
.flow-l { font-size: 12px; fill: var(--muted); }
.batt-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 12px; text-align: center; }
.batt-facts > div { display: flex; flex-direction: column; gap: 2px; }
.batt-facts b { font-size: 17px; font-variant-numeric: tabular-nums; }
.batt-range { margin: 12px 0 8px; }
.batt-read { min-height: 1.4em; color: var(--muted); margin-bottom: 4px; }
.batt-read b { color: var(--text); }
.batt-chart-wrap { position: relative; }
.batt-chart { display: block; width: 100%; height: 190px; touch-action: pan-y; cursor: crosshair; }
.batt-ax { position: absolute; left: 4px; transform: translateY(2px); font-size: 11px; color: var(--muted); pointer-events: none; }
.batt-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.batt-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 2px; }
.batt-cell { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.batt-cell b { font-size: 17px; font-variant-numeric: tabular-nums; }
.batt-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.batt-week > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.batt-week .bars { display: flex; gap: 3px; align-items: flex-end; height: 70px; }
.batt-week .bars i { display: block; width: 9px; min-height: 2px; border-radius: 3px 3px 0 0; }
.batt-down { display: flex; gap: 14px; align-items: center; }
.batt-foot { display: flex; justify-content: center; margin: 4px 0 8px; }
.chip.batt { cursor: pointer; border: 0; font: inherit; }
.chip.batt.low { background: var(--heat-soft); color: var(--bad); }
@media (prefers-reduced-motion: reduce) { .flow-line.on { animation: none; } }
@media (max-width: 380px) { .batt-soc { font-size: 46px; } .batt-top { gap: 12px; } }
.batt-warn { padding: 10px 12px; border-radius: 12px; background: var(--heat-soft); }
#battery-settings .fold { margin-top: 4px; }
.batt-sensors { margin-top: 12px; }
.batt-sensors:has(> :only-child) { grid-template-columns: 1fr; }
.batt-sens { flex-direction: column; align-items: flex-start; gap: 2px; }
.batt-sens b { font-size: 22px; }
.batt-sens-say::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--muted); }
.batt-sens.ok .batt-sens-say::before { background: var(--ok); }
.batt-sens.warn { background: var(--heat-soft); }
.batt-sens.warn .batt-sens-say::before { background: var(--warn); }
.batt-sens.bad { background: var(--heat-soft); }
.batt-sens.bad .batt-sens-say { color: var(--bad); }
.batt-sens.bad .batt-sens-say::before { background: var(--bad); }
.batt-gap { display: block; width: 100%; height: 50px; }
.batt-minmax { font-size: 10px; color: var(--muted); white-space: nowrap; }
.batt-week .bars i { width: 7px; }
