.shell [hidden] { display: none !important; }

:root {
  color-scheme: light;
  --wine: #761d20;
  --red: #c54b37;
  --cream: #fff0dc;
  --navy: #462a22;
  --blue: #b86b4b;
  --ink: var(--navy);
  --muted: #81594a;
  --forest: var(--navy);
  --mint: #e6a05b;
  --paper: var(--cream);
  --glass-line: rgba(255, 255, 255, .56);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  isolation: isolate;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse at 8% 3%, rgba(197, 75, 55, .2), transparent 34rem),
    radial-gradient(ellipse at 92% 18%, rgba(230, 160, 91, .28), transparent 30rem),
    radial-gradient(ellipse at 50% 100%, rgba(255, 240, 220, .9), transparent 38rem),
    linear-gradient(145deg, #fffaf2 0%, var(--cream) 52%, #f0d4bd 100%);
  content: '';
}

.shell { width: min(100% - 36px, 700px); margin: 0 auto; padding: 42px 0 32px; }
.topbar { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.74); border-radius: 23px; background: rgba(255,255,255,.43); box-shadow: 0 8px 30px rgba(40,65,54,.06), inset 0 1px rgba(255,255,255,.8); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); }
.eyebrow { margin: 0 0 5px; color: #91a39a; font-size: 9px; font-weight: 750; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; color: #22332b; font-size: 19px; font-weight: 720; letter-spacing: -.045em; }
.topbar h1 { overflow-wrap: anywhere; line-height: 1.08; }
.topbar .brand-title { min-width: 0; flex: 1; }
.refresh { display: grid; width: 40px; height: 40px; margin-left: auto; place-items: center; border: 1px solid rgba(255,255,255,.82); border-radius: 50%; color: #315a46; background: rgba(255,255,255,.64); box-shadow: 0 2px 8px rgba(33,62,48,.06), inset 0 1px rgba(255,255,255,.95); font-size: 23px; cursor: pointer; transition: transform .25s, background .2s, box-shadow .2s; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.refresh:hover { background: rgba(255,255,255,.9); box-shadow: 0 5px 16px rgba(33,62,48,.12); }
.refresh:active { transform: rotate(35deg) scale(.96); }

.hero-card { position: relative; overflow: hidden; padding: 27px; border: 1px solid rgba(255,255,255,.42); border-radius: 33px; color: #f7fbf7; background: linear-gradient(145deg, rgba(44,82,65,.88), rgba(22,48,39,.84) 58%, rgba(24,43,40,.86)); box-shadow: 0 28px 70px rgba(32,67,50,.18), inset 0 1px 0 rgba(255,255,255,.38), inset 0 -1px 0 rgba(255,255,255,.06); backdrop-filter: blur(34px) saturate(155%); -webkit-backdrop-filter: blur(34px) saturate(155%); }
.hero-card::before { position: absolute; top: -170px; left: -85px; width: 440px; height: 310px; border-radius: 50%; background: radial-gradient(ellipse, rgba(194,239,209,.19), transparent 70%); content: ''; pointer-events: none; }
.hero-card::after { position: absolute; top: -118px; right: -88px; width: 285px; height: 285px; border: 1px solid rgba(225,249,229,.13); border-radius: 50%; content: ''; box-shadow: 0 0 0 26px rgba(225,249,229,.035), 0 0 0 56px rgba(225,249,229,.025); pointer-events: none; }
.card-topline, .card-footer { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.device-status-stack { display: flex; width: 100%; flex-direction: row; align-items: center; justify-content: space-between; gap: 9px; }
.stove-power-toggle { display: inline-flex; min-width: 78px; height: 30px; align-items: center; justify-content: center; gap: 5px; padding: 4px 9px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; transition: background .22s, color .22s, box-shadow .22s, border-color .22s, transform .14s; }
.stove-power-toggle.is-off { color: rgba(244,249,245,.72); background: rgba(14,31,23,.4); border-color: rgba(255,255,255,.18); box-shadow: inset 0 1px rgba(255,255,255,.06); }
.stove-power-toggle.is-on { color: #123b27; background: linear-gradient(145deg, #e6ffea, #99e3a9); border-color: rgba(233,255,235,.95); box-shadow: 0 0 0 2px rgba(161,240,174,.15), 0 0 16px rgba(144,237,160,.55), inset 0 1px white; }
.power-toggle-icon { font-size: 14px; line-height: 1; }
.stove-power-toggle:active:not(:disabled) { transform: scale(.96); }
.stove-power-toggle:disabled { cursor: not-allowed; }
.stove-power-toggle:focus-visible { outline: 3px solid rgba(194,240,203,.65); outline-offset: 3px; }
.online-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: rgba(245,250,246,.88); background: rgba(255,255,255,.09); box-shadow: inset 0 1px rgba(255,255,255,.1); font-size: 10px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.online-pill i { width: 7px; height: 7px; border-radius: 50%; background: #f2c779; box-shadow: 0 0 0 3px rgba(242,199,121,.16), 0 0 10px rgba(242,199,121,.55); }
.online-pill.online i { background: #9ee6a9; box-shadow: 0 0 0 3px rgba(158,230,169,.16), 0 0 10px rgba(158,230,169,.6); }
.online-pill.offline i { background: #f18e82; box-shadow: 0 0 0 3px rgba(241,142,130,.16), 0 0 10px rgba(241,142,130,.5); }
.status-block { position: relative; z-index: 1; display: flex; align-items: center; gap: 15px; margin: 36px 0 32px; }
.status-block .eyebrow, .temperature-block .eyebrow { color: rgba(218,237,223,.66); }
h2 { margin: 0; font-size: clamp(22px, 5.7vw, 29px); font-weight: 700; letter-spacing: -.05em; }
.temperature-overview { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.temperature-block { position: relative; z-index: 1; display: flex; min-width: 0; align-items: center; gap: 11px; padding: 13px; border: 1px solid rgba(255,255,255,.22); border-radius: 21px; background: linear-gradient(120deg, rgba(255,255,255,.13), rgba(255,255,255,.055)); box-shadow: inset 0 1px rgba(255,255,255,.16), 0 10px 26px rgba(8,27,19,.08); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.overview-dashboard-link { min-height: 0; height: 100%; margin: 0; padding: 12px; border-radius: 18px; font-size: 14px; }
.temperature-symbol { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,.66); border-radius: 13px; color: #204633; background: linear-gradient(145deg, rgba(226,255,231,.96), rgba(167,224,184,.82)); box-shadow: inset 0 1px 2px white, 0 7px 18px rgba(4,25,14,.15); font-size: 28px; font-weight: 500; line-height: 1; }
.temperature-block .eyebrow { margin-bottom: 5px; }
.temperature-value { display: flex; align-items: flex-start; gap: 3px; font-size: clamp(30px, 8vw, 45px); font-weight: 700; letter-spacing: -.075em; line-height: .94; font-variant-numeric: tabular-nums; }
.temperature-value .unit { padding-top: 4px; font-size: 16px; font-weight: 500; letter-spacing: -.04em; }

.readings { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 13px 0 5px; }
.control-group { position: relative; z-index: 1; display: grid; gap: 10px; margin-top: 15px; padding: 17px; border: 1px solid rgba(255,255,255,.24); border-radius: 24px; background: linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.065)); box-shadow: inset 0 1px rgba(255,255,255,.16), 0 9px 24px rgba(8,27,19,.07); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.control-group-heading { padding: 0 2px 2px; }
.control-group-heading .eyebrow { margin-bottom: 5px; color: rgba(218,237,223,.63); }
.control-group-heading h3 { margin: 0; color: #f7fbf7; font-size: 18px; font-weight: 700; letter-spacing: -.035em; }
.temperature-readings { margin: 0; }
.temperature-readings .reading { min-height: 62px; }
.control-group .relax-control, .control-group .fan-controls { margin-top: 0; }
.control-group .setpoint-control { padding: 14px 15px 13px; }
#setpoint-control .fan-control-heading { justify-content: center; text-align: center; }
#setpoint-control .fan-help { text-align: center; }
.mode-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mode-switches .mode-option { min-width: 0; margin: 0; padding: 13px 12px; }
.mode-option h3 { font-size: 14px; }
.mode-option .relax-description { font-size: 9px; line-height: 1.35; }
.mode-option .mode-switch { width: 46px; height: 28px; }
.mode-option .mode-switch span { width: 20px; height: 20px; }
.mode-option .mode-switch.enabled span { transform: translateX(18px); }
.stepper { display: grid; grid-template-columns: 54px minmax(75px, 1fr) 54px; align-items: center; gap: 14px; margin: 13px auto 10px; max-width: 280px; }
.stepper output { color: #f8fbf8; text-align: center; font-size: clamp(25px, 7vw, 34px); line-height: 1; font-weight: 750; font-variant-numeric: tabular-nums; }
.stepper button { width: 54px; height: 54px; border: 1px solid rgba(255,255,255,.62); border-radius: 18px; color: #17422f; background: linear-gradient(145deg, #e5f8e8, #addfb7); box-shadow: inset 0 1px white, 0 5px 13px rgba(4,25,14,.14); font: inherit; font-size: 28px; line-height: 1; font-weight: 500; cursor: pointer; transition: transform .14s, opacity .14s; }
.stepper button:active:not(:disabled) { transform: scale(.94); }
.stepper button:disabled { opacity: .38; cursor: not-allowed; }
.stepper button:focus-visible { outline: 3px solid rgba(194,240,203,.65); outline-offset: 3px; }
.fan-stepper { grid-template-columns: 34px minmax(20px, 1fr) 34px; gap: 4px; max-width: 230px; margin: 8px auto 2px; }
.fan-stepper output { font-size: 21px; }
.fan-stepper button { width: 34px; height: 34px; border-radius: 11px; font-size: 21px; }
.reading { display: flex; min-height: 74px; flex-direction: column; justify-content: center; gap: 8px; padding: 13px 15px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,.115), rgba(255,255,255,.055)); box-shadow: inset 0 1px rgba(255,255,255,.1), 0 5px 17px rgba(8,27,19,.05); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.reading-label { color: rgba(218,237,223,.62); font-size: 8px; font-weight: 750; letter-spacing: .13em; }
.reading strong { color: #f7fbf7; font-size: 19px; line-height: 1; font-variant-numeric: tabular-nums; }
.reading small { margin-left: 4px; color: rgba(231,244,233,.73); font-size: 11px; font-weight: 500; }
.fan-controls { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 8px; margin-top: 13px; }
.fan-control { min-width: 0; padding: 10px 9px 9px; border: 1px solid rgba(255,255,255,.19); border-radius: 16px; background: linear-gradient(130deg, rgba(255,255,255,.13), rgba(255,255,255,.055)); box-shadow: inset 0 1px rgba(255,255,255,.12), 0 6px 18px rgba(8,27,19,.06); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.fan-control-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fan-control-heading .reading-label { margin: 0; color: rgba(218,237,223,.72); }
.fan-control-heading strong { color: #f7fbf7; font-size: 13px; font-weight: 650; }
.fan-control-heading output { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,255,255,.32); border-radius: 12px; color: #183e2d; background: linear-gradient(145deg, #e0f7e2, #a8dfb2); box-shadow: inset 0 1px white; font-size: 16px; font-weight: 750; }
.fan-controls > .fan-help { grid-column: 1 / -1; }
.fan-control input[type="range"] { width: 100%; height: 5px; margin: 15px 0 11px; accent-color: #a7e8b2; cursor: pointer; }
.fan-control input[type="range"]:disabled { opacity: .45; cursor: not-allowed; }
.fan-apply { width: 100%; padding: 9px 12px; border: 1px solid rgba(255,255,255,.27); border-radius: 12px; color: #f2f8f2; background: rgba(255,255,255,.1); box-shadow: inset 0 1px rgba(255,255,255,.09); font: inherit; font-size: 10px; font-weight: 680; cursor: pointer; transition: background .18s, transform .15s; }
.fan-apply:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.fan-apply:active:not(:disabled) { transform: scale(.99); }
.fan-apply:disabled { opacity: .42; cursor: not-allowed; }
.fan-help { margin: 0 3px; color: rgba(65,89,74,.75); font-size: 10px; line-height: 1.5; }
.relax-control { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 13px; padding: 16px 17px; border: 1px solid rgba(255,255,255,.19); border-radius: 20px; background: linear-gradient(130deg, rgba(255,255,255,.13), rgba(255,255,255,.055)); box-shadow: inset 0 1px rgba(255,255,255,.12), 0 6px 18px rgba(8,27,19,.06); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.relax-control .eyebrow { margin-bottom: 5px; color: rgba(218,237,223,.61); }
.relax-control h3 { margin: 0; color: #f7fbf7; font-size: 15px; letter-spacing: -.025em; }
.relax-description { margin: 4px 0 0; color: rgba(231,242,233,.69); font-size: 10px; }
.mode-switch { position: relative; width: 52px; height: 31px; flex: 0 0 auto; padding: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(15,31,24,.48); box-shadow: inset 0 1px 3px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.08); cursor: pointer; transition: background .22s, border-color .22s; }
.mode-switch span { position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: linear-gradient(145deg, #fff, #e4eee7); box-shadow: 0 2px 5px rgba(0,0,0,.2), inset 0 1px white; transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.mode-switch.enabled { border-color: rgba(189,241,198,.75); background: linear-gradient(120deg, #74c78c, #a2e4a9); }
.mode-switch.enabled span { transform: translateX(21px); }
.mode-switch:disabled { opacity: .48; cursor: wait; }
.mode-switch:focus-visible { outline: 3px solid rgba(194,240,203,.65); outline-offset: 3px; }

.pellet-card { position: relative; z-index: 1; margin-top: 15px; padding: 19px; border: 1px solid rgba(255,255,255,.22); border-radius: 24px; background: linear-gradient(145deg, rgba(11,34,25,.31), rgba(255,255,255,.075)); box-shadow: inset 0 1px rgba(255,255,255,.13), 0 10px 24px rgba(8,27,19,.08); backdrop-filter: blur(22px) saturate(130%); -webkit-backdrop-filter: blur(22px) saturate(130%); }
.pellet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pellet-heading .eyebrow { color: rgba(218,237,223,.61); }
.pellet-heading h3 { margin: 0; font-size: 16px; font-weight: 680; letter-spacing: -.03em; }
.pellet-percent { color: #c4f0c9; font-size: 25px; font-variant-numeric: tabular-nums; }
.pellet-track { height: 8px; overflow: hidden; margin: 16px 0 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 999px; background: rgba(255,255,255,.14); box-shadow: inset 0 1px 3px rgba(0,0,0,.15); }
.pellet-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #83dca0, #d0f0a5); box-shadow: 0 0 12px rgba(150,231,163,.42); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.pellet-amount, .consumption-line, .pellet-help { margin: 0; color: rgba(231,242,233,.72); font-size: 10px; }
.consumption-line { margin-top: 5px; color: rgba(237,247,237,.89); }
.pellet-label { display: block; margin-top: 17px; color: rgba(245,250,246,.93); font-size: 10px; font-weight: 650; }
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.slider-row input { width: 100%; height: 5px; accent-color: #a7e8b2; cursor: pointer; }
.slider-row output { min-width: 42px; color: #c4f0c9; font-size: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.save-level { width: 100%; margin-top: 11px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.6); border-radius: 14px; color: #173d2d; background: linear-gradient(180deg, rgba(221,255,226,.96), rgba(179,232,191,.9)); box-shadow: 0 5px 14px rgba(3,24,13,.12), inset 0 1px rgba(255,255,255,.9); font: inherit; font-size: 11px; font-weight: 720; cursor: pointer; transition: transform .15s, filter .15s, box-shadow .15s; }
.save-level:hover { filter: brightness(1.035); box-shadow: 0 7px 18px rgba(3,24,13,.18), inset 0 1px rgba(255,255,255,.95); }
.save-level:active { transform: scale(.99); }
.save-level:disabled { opacity: .6; cursor: wait; }
.pellet-help { margin-top: 10px; line-height: 1.55; }
.card-footer { padding-top: 17px; color: rgba(226,239,228,.62); font-size: 10px; }
.card-footer time { color: rgba(247,251,247,.9); font-weight: 650; font-variant-numeric: tabular-nums; }
.notice { min-height: 18px; margin: 14px 5px 0; color: #75847b; font-size: 11px; }
.notice.error { color: #a5473d; }
.page-footer { display: flex; justify-content: center; gap: 8px; margin-top: 23px; color: #89958e; font-size: 10px; }
.footer-dot { color: #b0bbb4; }
.loading { animation: pulse 1.4s ease-in-out infinite; }

.refill-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 23px;
  border: 1px solid rgba(88,11,12,.2);
  border-radius: 18px;
  color: #580b0c;
  background: #fff9dd;
  box-shadow: 0 22px 70px rgba(37,18,12,.28);
}
.refill-dialog::backdrop { background: rgba(22,16,14,.48); backdrop-filter: blur(4px); }
.refill-dialog .eyebrow { margin: 0 0 7px; color: #71302a; font-size: 10px; font-weight: 750; letter-spacing: .16em; }
.refill-dialog h2 { margin: 0; color: #580b0c; font-size: clamp(20px, 5vw, 25px); letter-spacing: -.035em; }
.refill-dialog p:not(.eyebrow) { margin: 9px 0 0; color: #71302a; font-size: 13px; line-height: 1.5; }
.refill-dialog .refill-slider-label { display: block; margin-top: 20px; color: #580b0c; font-size: 12px; font-weight: 700; }
.refill-dialog .slider-row { margin-top: 12px; }
.refill-dialog .slider-row input { accent-color: #9e2d2b; }
.refill-dialog .slider-row output { color: #580b0c; }
.refill-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.refill-dialog-actions button { min-height: 42px; padding: 9px 17px; border: 1px solid rgba(88,11,12,.24); border-radius: 10px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.refill-dialog-actions .refill-no { color: #580b0c; background: #fffdf3; }
.refill-dialog-actions .refill-yes { color: #fff9dd; border-color: #580b0c; background: #580b0c; }
.refill-dialog-actions button:disabled { cursor: wait; opacity: .65; }
.refill-dialog-notice { min-height: 18px; }
.refill-dialog-notice.error { color: #9e2d2b !important; }

/* SmartEK63 palette: wine, signal red, warm cream, deep navy and steel blue. */
body { color: var(--navy); }
.topbar { border-color: rgba(102,155,188,.32); background: rgba(253,240,213,.58); box-shadow: 0 8px 30px rgba(0,48,73,.08), inset 0 1px rgba(255,255,255,.85); }
.eyebrow { color: var(--blue); }
h1 { color: var(--navy); }
.refresh { color: var(--navy); border-color: rgba(102,155,188,.4); background: rgba(253,240,213,.78); }
.hero-card { border-color: rgba(102,155,188,.5); background: linear-gradient(145deg, rgba(0,48,73,.97), rgba(0,48,73,.92) 58%, rgba(0,35,54,.97)); box-shadow: 0 28px 70px rgba(0,48,73,.24), inset 0 1px 0 rgba(253,240,213,.22), inset 0 -1px 0 rgba(102,155,188,.13); }
.hero-card::before { background: radial-gradient(ellipse, rgba(102,155,188,.25), transparent 70%); }
.hero-card::after { border-color: rgba(102,155,188,.2); box-shadow: 0 0 0 26px rgba(102,155,188,.06), 0 0 0 56px rgba(102,155,188,.035); }
.stove-power-toggle.is-off { color: rgba(253,240,213,.8); background: rgba(120,0,0,.42); border-color: rgba(253,240,213,.2); }
.stove-power-toggle.is-on { color: #fffaf0; background: linear-gradient(145deg, var(--red), var(--wine)); border-color: rgba(253,240,213,.65); box-shadow: 0 0 0 2px rgba(193,18,31,.2), 0 0 18px rgba(193,18,31,.5), inset 0 1px rgba(255,255,255,.28); }
.online-pill i { background: #e6b85c; box-shadow: 0 0 0 3px rgba(230,184,92,.16), 0 0 10px rgba(230,184,92,.5); }
.online-pill.online i { background: #8dc5d8; box-shadow: 0 0 0 3px rgba(102,155,188,.2), 0 0 10px rgba(102,155,188,.65); }
.online-pill.offline i { background: #f05c62; box-shadow: 0 0 0 3px rgba(193,18,31,.2), 0 0 10px rgba(193,18,31,.55); }
.temperature-symbol { color: var(--navy); background: linear-gradient(145deg, #fffaf0, var(--cream)); }
.stepper button, .fan-control-heading output { color: var(--navy); background: linear-gradient(145deg, #fffaf0, #e6d9c1); border-color: rgba(102,155,188,.55); }
.mode-switch.enabled { border-color: rgba(102,155,188,.8); background: linear-gradient(120deg, var(--navy), var(--blue)); }
.pellet-card { border-color: rgba(102,155,188,.34); background: linear-gradient(145deg, rgba(0,48,73,.22), rgba(102,155,188,.14)); }
.pellet-percent, .slider-row output { color: #b6d7e8; }
.pellet-track span { background: linear-gradient(90deg, var(--blue), #b6d7e8); box-shadow: 0 0 12px rgba(102,155,188,.5); }
.save-level { color: #fffaf0; border-color: rgba(253,240,213,.45); background: linear-gradient(180deg, var(--red), var(--wine)); box-shadow: 0 5px 14px rgba(0,20,34,.22), inset 0 1px rgba(255,255,255,.2); }
.save-level:hover { filter: brightness(1.12); }
.notice { color: #4c7183; }
.notice.error { color: var(--red); }
.page-footer { color: #4c7183; }
/* Keep secondary copy readable over the translucent navy cards. */
.status-block .eyebrow, .temperature-block .eyebrow,
.control-group-heading .eyebrow, .relax-control .eyebrow,
.reading-label, .fan-control-heading .reading-label,
.pellet-heading .eyebrow, .card-footer,
.pellet-amount, .consumption-line, .pellet-help,
.pellet-label, .relax-description, .fan-help {
  color: #fdf0d5;
  opacity: .96;
}
.reading small { color: #fdf0d5; }
.control-group-heading h3, .relax-control h3, .pellet-heading h3,
.fan-control-heading strong, .stepper output { color: #fffaf0; }
.online-pill { color: #fffaf0; background: rgba(0,20,34,.62); border-color: rgba(253,240,213,.52); }
.stove-power-toggle.is-off { color: #fffaf0; border-color: rgba(253,240,213,.48); }
.pellet-card { background: linear-gradient(145deg, rgba(0,48,73,.96), rgba(0,48,73,.9)); }
.notice { color: #003049; font-weight: 650; }
.page-footer { color: #003049; font-weight: 600; }
.version-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 5px; margin: 8px 0 0; color: #003049; font-size: 9px; line-height: 1.5; text-align: center; }
.version-footer a { color: #780000; font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.version-footer a:hover { color: #c1121f; }
@keyframes pulse { 50% { opacity: .48; } }

/* Warm ember palette. */
body::before {
  background:
    radial-gradient(ellipse at 8% 3%, rgba(197, 75, 55, .2), transparent 34rem),
    radial-gradient(ellipse at 92% 18%, rgba(230, 160, 91, .28), transparent 30rem),
    radial-gradient(ellipse at 50% 100%, rgba(255, 240, 220, .92), transparent 38rem),
    linear-gradient(145deg, #fffaf2 0%, var(--cream) 52%, #f0d4bd 100%);
}
.topbar { border-color: rgba(184,107,75,.32); background: rgba(255,240,220,.7); box-shadow: 0 8px 30px rgba(70,42,34,.08), inset 0 1px rgba(255,255,255,.9); }
.refresh { color: var(--wine); border-color: rgba(184,107,75,.42); background: rgba(255,240,220,.86); }
.hero-card { border-color: rgba(230,160,91,.45); background: linear-gradient(145deg, #572b24, #3b2420 58%, #2e211e); box-shadow: 0 28px 70px rgba(70,42,34,.22), inset 0 1px 0 rgba(255,240,220,.2), inset 0 -1px 0 rgba(230,160,91,.12); }
.hero-card::before { background: radial-gradient(ellipse, rgba(230,160,91,.24), transparent 70%); }
.hero-card::after { border-color: rgba(255,210,158,.16); box-shadow: 0 0 0 26px rgba(230,160,91,.05), 0 0 0 56px rgba(230,160,91,.03); }
.stove-power-toggle.is-on { color: #fffaf2; background: linear-gradient(145deg, #d56a3b, #a6322c); border-color: rgba(255,220,175,.7); box-shadow: 0 0 0 2px rgba(230,160,91,.19), 0 0 18px rgba(213,106,59,.4), inset 0 1px rgba(255,255,255,.3); }
.online-pill.online i { background: #efb866; box-shadow: 0 0 0 3px rgba(239,184,102,.18), 0 0 10px rgba(239,184,102,.65); }
.online-pill.offline i { background: #f27461; box-shadow: 0 0 0 3px rgba(242,116,97,.18), 0 0 10px rgba(242,116,97,.52); }
.power-toggle-icon { position: relative; z-index: 1; }
.temperature-symbol { color: #642f25; background: linear-gradient(145deg, #fff8eb, #f4d4ad); }
.stepper button, .fan-control-heading output { color: #542c25; background: linear-gradient(145deg, #fff8ec, #efc998); border-color: rgba(184,107,75,.48); }
.mode-switch.enabled { border-color: rgba(239,184,102,.82); background: linear-gradient(120deg, #a94432, #e6a05b); }
.pellet-card { border-color: rgba(230,160,91,.38); background: linear-gradient(145deg, rgba(70,35,29,.96), rgba(88,45,34,.92)); }
.pellet-percent, .slider-row output { color: #ffd28b; }
.pellet-track span { background: linear-gradient(90deg, #c54b37, #f3b85f); box-shadow: 0 0 12px rgba(230,160,91,.48); }
.save-level { color: #fffaf2; border-color: rgba(255,220,175,.52); background: linear-gradient(180deg, #c54b37, #761d20); }
.notice { color: #603b30; }
.notice.error { color: #a32328; }
.page-footer, .version-footer { color: #603b30; }
.version-footer a { color: #761d20; }
.version-footer a:hover { color: #c54b37; }
@media (prefers-reduced-motion: reduce) {
  .loading { animation: none !important; }
  .pellet-track span, .refresh, .stove-power-toggle { transition-duration: .01ms; }
}

/* Two-page Control / Dashboard navigation and data view. */
.status-block > div { min-width: 0; }
.dashboard-link, .control-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 38px; margin-left: auto; padding: 8px 12px;
  border: 1px solid rgba(255,220,175,.42); border-radius: 13px;
  color: #fff6e9; background: linear-gradient(140deg, rgba(197,75,55,.44), rgba(230,160,91,.24));
  box-shadow: inset 0 1px rgba(255,255,255,.13), 0 5px 14px rgba(30,16,13,.12);
  font-size: 11px; font-weight: 750; text-decoration: none; white-space: nowrap;
  transition: transform .15s, filter .15s, background .15s;
}
.dashboard-link:hover, .control-link:hover { filter: brightness(1.13); transform: translateY(-1px); }
.dashboard-link:focus-visible, .control-link:focus-visible { outline: 3px solid #f2bd70; outline-offset: 3px; }
.dashboard-page { width: min(100% - 36px, 900px); }
.dashboard-page .topbar { margin-bottom: 17px; }
.dashboard-page .control-link { color: #5a3027; border-color: rgba(184,107,75,.35); background: rgba(255,248,238,.8); box-shadow: 0 4px 14px rgba(70,42,34,.08); }
.dashboard-overview {
  padding: 24px; border: 1px solid rgba(255,220,175,.42); border-radius: 27px;
  color: #fff7eb; background: linear-gradient(145deg, #572b24, #3b2420 70%, #30211e);
  box-shadow: 0 18px 42px rgba(70,42,34,.16), inset 0 1px rgba(255,240,220,.15);
}
.dashboard-overview-heading, .dashboard-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.dashboard-overview .eyebrow, .dashboard-card .eyebrow { margin-bottom: 6px; color: #f3c987; }
.dashboard-overview h2 { font-size: clamp(21px, 4vw, 27px); }
.dashboard-live-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 20px; }
.dashboard-live-value { display: grid; min-width: 0; gap: 7px; padding: 13px; border: 1px solid rgba(255,240,220,.18); border-radius: 17px; background: rgba(255,240,220,.09); }
.dashboard-live-value > span, .telemetry-grid span { color: #f3d8bd; font-size: 10px; font-weight: 650; }
.dashboard-live-value strong { overflow-wrap: anywhere; color: #fff9ef; font-size: clamp(19px, 3vw, 25px); font-variant-numeric: tabular-nums; }
.dashboard-live-value small { margin-left: 3px; font-size: 12px; font-weight: 500; }
.dashboard-updated { margin: 13px 1px 0; color: #f3d8bd; font-size: 10px; }
.dashboard-updated time { color: #fff9ef; font-weight: 700; }
.dashboard-period { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 19px 2px 12px; color: #603b30; font-size: 11px; font-weight: 700; }
.period-buttons { display: flex; gap: 5px; padding: 4px; border: 1px solid rgba(184,107,75,.28); border-radius: 14px; background: rgba(255,248,238,.75); }
.period-buttons button { min-height: 33px; padding: 6px 10px; border: 0; border-radius: 10px; color: #70483b; background: transparent; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.period-buttons button[aria-pressed="true"] { color: #fff8ec; background: linear-gradient(135deg, #9d3b30, #ca6644); box-shadow: 0 3px 9px rgba(95,37,30,.2); }
.dashboard-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; margin-bottom: 11px; }
.dashboard-card { min-width: 0; margin-bottom: 11px; padding: 19px; border: 1px solid rgba(184,107,75,.22); border-radius: 23px; color: #4b2c24; background: rgba(255,249,240,.88); box-shadow: 0 10px 28px rgba(77,43,34,.07), inset 0 1px white; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.dashboard-metrics .dashboard-card { margin: 0; }
.dashboard-card .eyebrow { color: #8d4a37; }
.metric-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; color: #542b23; font-size: clamp(25px, 5vw, 34px); line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-main small { color: #805749; font-size: 11px; font-weight: 650; letter-spacing: 0; }
.metric-detail { margin: 9px 0 0; color: #745245; font-size: 10px; line-height: 1.55; }
.metric-detail b { color: #4c2c24; }
.dashboard-card-heading { margin-bottom: 14px; }
.dashboard-card-heading h2 { margin: 0; color: #4b2922; font-size: 18px; letter-spacing: -.035em; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; color: #68483c; font-size: 9px; font-weight: 650; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { display: inline-block; width: 16px; height: 3px; border-radius: 5px; background: #c54b37; }
.chart-legend .legend-target { background: #d89b45; }
.chart-caption { color: #805749; font-size: 9px; font-weight: 600; text-align: right; }
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { display: block; width: 100%; height: auto; min-height: 175px; overflow: visible; }
.pellet-chart-wrap svg { min-height: 145px; }
.chart-grid { stroke: rgba(117,73,57,.16); stroke-width: 1; }
.chart-axis-label { fill: #765345; font-size: 10px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.chart-line { fill: none; stroke: #bd4936; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-line.target-line { stroke: #d69539; stroke-width: 2.5; stroke-dasharray: 7 6; }
#pellet-chart .chart-line { stroke: #c17a37; }
.chart-empty { fill: #805749; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.chart-note { margin: 5px 0 0; color: #805749; font-size: 10px; line-height: 1.5; }
.telemetry-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.telemetry-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 11px 12px; border: 1px solid rgba(184,107,75,.17); border-radius: 13px; background: rgba(245,224,201,.38); }
.telemetry-grid span { color: #805749; }
.telemetry-grid strong { color: #512d24; font-size: 11px; text-align: right; }
.activity-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.activity-list li { display: flex; align-items: baseline; gap: 15px; padding: 10px 2px; border-top: 1px solid rgba(184,107,75,.15); color: #4f3028; font-size: 11px; }
.activity-list time { flex: 0 0 108px; color: #805749; font-size: 9px; font-variant-numeric: tabular-nums; }
.activity-empty { color: #805749 !important; }
.dashboard-page .notice { color: #603b30; }
.dashboard-page .page-footer { color: #704b3c; }
@media (max-width: 620px) {
  .dashboard-page { width: min(100% - 26px, 900px); }
  .dashboard-live-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-metrics { grid-template-columns: 1fr; }
  .dashboard-period { align-items: flex-start; flex-direction: column; }
  .period-buttons { width: 100%; }
  .period-buttons button { flex: 1; }
  .dashboard-overview { padding: 18px; border-radius: 23px; }
  .dashboard-card { padding: 15px; }
  .chart-legend { gap: 7px; }
  .telemetry-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .telemetry-grid > div { align-items: flex-start; flex-direction: column; }
  .telemetry-grid strong { text-align: left; }
  .activity-list li { gap: 9px; }
  .activity-list time { flex-basis: 92px; }
}
@media (max-width: 380px) {
  .dashboard-overview-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-overview-heading .online-pill { align-self: flex-end; }
  .dashboard-card-heading { align-items: flex-start; flex-direction: column; }
  .chart-caption { text-align: left; }
  .dashboard-link { padding: 7px 9px; font-size: 10px; }
}

@media (max-width: 480px) {
  .shell { width: min(100% - 26px, 700px); padding-top: max(22px, env(safe-area-inset-top)); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 15px; border-radius: 20px; }
  .hero-card { padding: 19px; border-radius: 28px; }
  .status-block { margin: 29px 0 20px; }
  .temperature-block { gap: 9px; padding: 11px; border-radius: 19px; }
  .temperature-overview { gap: 8px; }
  .temperature-value { font-size: clamp(27px, 7.4vw, 36px); }
  .temperature-value .unit { font-size: 14px; }
  .readings { gap: 7px; }
  .reading { min-height: 68px; padding: 11px 12px; border-radius: 16px; }
  .relax-control { padding: 14px; border-radius: 18px; }
  .pellet-card { padding: 16px; border-radius: 21px; }
  .page-footer { flex-wrap: wrap; margin-top: 18px; }
}

@media (max-width: 360px) {
  .hero-card { padding: 16px; }
  .temperature-overview { gap: 6px; }
  .temperature-block { gap: 7px; padding: 9px 8px; }
  .temperature-symbol { width: 30px; height: 30px; border-radius: 10px; font-size: 22px; }
  .temperature-value { font-size: clamp(23px, 7vw, 29px); }
  .temperature-value .unit { font-size: 12px; }
  .fan-control { padding: 9px 7px 8px; }
  .fan-stepper { grid-template-columns: 30px minmax(16px, 1fr) 30px; gap: 3px; }
  .fan-stepper button { width: 30px; height: 30px; font-size: 19px; }
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .topbar { background: rgba(255,255,255,.88); }
  .hero-card { background: linear-gradient(145deg, #572b24, #30211e); }
  .reading, .pellet-card { background: rgba(70,42,34,.93); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.shell [hidden] { display: none !important; }

.logout-form { margin: 0; }
.logout-button { padding: 9px 11px; border: 1px solid rgba(0,48,73,.24); border-radius: 999px; color: var(--navy); background: rgba(253,240,213,.88); font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.logout-button:focus-visible, .login-form button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.login-shell { width: min(100%, 420px); }
.login-card { padding: 30px; border: 1px solid rgba(102,155,188,.55); border-radius: 28px; color: #fffaf0; background: linear-gradient(145deg, #003049, #002336); box-shadow: 0 24px 65px rgba(0,48,73,.25); }
.login-brand { display: grid; width: 54px; height: 54px; margin-bottom: 20px; place-items: center; border: 0; border-radius: 17px; background: transparent; }
.login-brand img { width: 54px; height: 54px; border-radius: 17px; object-fit: cover; }
.login-card .eyebrow { margin-bottom: 7px; color: #b6d7e8; }
.login-card h1 { margin: 0 0 10px; color: #fffaf0; font-size: 27px; letter-spacing: -.04em; }
.login-description { margin: 0 0 22px; color: #fdf0d5; font-size: 13px; line-height: 1.55; }
.login-error { margin: 0 0 16px; padding: 11px 12px; border: 1px solid rgba(255,160,160,.65); border-radius: 12px; color: #fff; background: rgba(120,0,0,.5); font-size: 12px; }
.login-form { display: grid; gap: 9px; }
.login-form label { margin-top: 5px; color: #fffaf0; font-size: 12px; font-weight: 700; }
.login-form input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid rgba(253,240,213,.72); border-radius: 12px; color: var(--navy); background: #fffaf0; font: inherit; font-size: 16px; }
.login-form input:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.login-form button { min-height: 47px; margin-top: 12px; border: 1px solid rgba(253,240,213,.7); border-radius: 13px; color: #fffaf0; background: linear-gradient(145deg, var(--red), var(--wine)); font: inherit; font-size: 14px; font-weight: 750; cursor: pointer; }

.logout-button { border-color: rgba(118,29,32,.26); color: var(--wine); background: rgba(255,240,220,.9); }
.login-card { border-color: rgba(184,107,75,.55); background: linear-gradient(145deg, #572b24, #30211e); box-shadow: 0 24px 65px rgba(70,42,34,.24); }
.login-card .eyebrow { color: #f3c987; }
.login-error { border-color: rgba(242,116,97,.7); background: rgba(118,29,32,.72); }
.login-form input { border-color: rgba(255,220,175,.72); }
.login-form input:focus-visible { outline-color: #e6a05b; }

/* Full-viewport layout without a single outer dashboard card. */
.shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: max(20px, env(safe-area-inset-top)) clamp(16px, 3vw, 48px) max(24px, env(safe-area-inset-bottom));
}
.dashboard-page { width: 100%; }
.hero-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #4b2922;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.hero-card::before, .hero-card::after { display: none; }
.card-topline, .status-block, .temperature-overview, .pellet-card, .card-footer { grid-column: 1 / -1; }
.card-topline { margin-bottom: 1px; }
.status-block { margin: 0; }
.temperature-group, .ventilation-group { margin-top: 0; }
.pellet-card { margin-top: 0; }
.card-footer { padding: 3px 2px 0; color: #704b3c; }
.card-footer time { color: #542b23; }
.hero-card .status-block .eyebrow,
.hero-card .temperature-block .eyebrow,
.hero-card .control-group-heading .eyebrow,
.hero-card .relax-control .eyebrow,
.hero-card .reading-label,
.hero-card .fan-control-heading .reading-label,
.hero-card .pellet-heading .eyebrow,
.hero-card .pellet-amount,
.hero-card .consumption-line,
.hero-card .pellet-help,
.hero-card .pellet-label,
.hero-card .relax-description,
.hero-card .fan-help {
  color: #795548;
  opacity: 1;
}
.hero-card h2, .hero-card .temperature-value,
.hero-card .control-group-heading h3, .hero-card .relax-control h3,
.hero-card .pellet-heading h3, .hero-card .fan-control-heading strong,
.hero-card .stepper output, .hero-card .reading strong {
  color: #4b2922;
}
.hero-card .online-pill {
  color: #5a3027;
  border-color: rgba(184,107,75,.35);
  background: rgba(255,248,238,.86);
}
.hero-card .online-pill.online i { background: #c17a37; box-shadow: 0 0 0 3px rgba(193,122,55,.15), 0 0 10px rgba(193,122,55,.45); }
.hero-card .online-pill.offline i { background: #c54b37; box-shadow: 0 0 0 3px rgba(197,75,55,.15), 0 0 10px rgba(197,75,55,.38); }
.hero-card .temperature-block,
.hero-card .control-group,
.hero-card .reading,
.hero-card .fan-control,
.hero-card .relax-control {
  border-color: rgba(184,107,75,.22);
  color: #4b2922;
  background: rgba(255,249,240,.88);
  box-shadow: 0 8px 22px rgba(77,43,34,.055), inset 0 1px white;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.hero-card .reading-label, .hero-card .fan-control-heading .reading-label { color: #795548; }
.hero-card .reading small { color: #805749; }
.hero-card .fan-control-heading output,
.hero-card .stepper button {
  border-color: rgba(184,107,75,.4);
  color: #542b23;
  background: linear-gradient(145deg, #fff8ec, #efc998);
  box-shadow: inset 0 1px white, 0 4px 12px rgba(70,42,34,.08);
}
.hero-card .mode-switch { border-color: rgba(118,29,32,.24); background: rgba(118,29,32,.13); }
.hero-card .mode-switch.enabled { border-color: rgba(193,122,55,.7); background: linear-gradient(120deg, #a94432, #e6a05b); }
.hero-card .stove-power-toggle.is-off { color: #603b30; border-color: rgba(118,29,32,.24); background: rgba(255,248,238,.9); }
.hero-card .stove-power-toggle.is-on { color: #fffaf2; }
.hero-card .pellet-card {
  border-color: rgba(184,107,75,.24);
  color: #4b2922;
  background: rgba(255,249,240,.9);
  box-shadow: 0 8px 22px rgba(77,43,34,.055), inset 0 1px white;
}
.hero-card .pellet-percent, .hero-card .slider-row output { color: #8f3d30; }
.hero-card .pellet-track { background: rgba(117,73,57,.12); }
.hero-card .pellet-track span { background: linear-gradient(90deg, #c54b37, #f3b85f); }
.hero-card .save-level { color: #fffaf2; }
.hero-card .fan-help { color: #795548; }
.dashboard-page .topbar { width: 100%; }
.dashboard-page .dashboard-overview,
.dashboard-page .dashboard-card { width: 100%; }
@media (max-width: 760px) {
  .hero-card { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .temperature-group, .ventilation-group, .pellet-card { grid-column: 1; }
}
@media (max-width: 480px) {
  .shell { padding: max(16px, env(safe-area-inset-top)) 13px max(20px, env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 14px; }
  .hero-card { gap: 11px; }
}

@media (max-width: 480px) {
  .login-page { padding: 16px; }
  .login-card { padding: 24px; border-radius: 24px; }
}

/* State-aware palettes sampled from the two user-provided color palettes. */
body.theme-cold {
  --ui-page: #f0edd9;
  --ui-page-glow: #dbe3e5;
  --ui-surface: #fbfaf3;
  --ui-surface-soft: #e5e9e5;
  --ui-text: #0c1422;
  --ui-secondary: #365268;
  --ui-muted: #365268;
  --ui-border: rgba(29,48,71,.2);
  --ui-primary: #1d3047;
  --ui-accent: #365268;
  --ui-highlight: #7891ac;
  --ui-header-text: #f0edd9;
  --ui-control-text: #0c1422;
  --ui-chart-target: #7891ac;
  color: var(--ui-text);
  background-color: var(--ui-page);
}
body.theme-warm {
  --ui-page: #fff2b2;
  --ui-page-glow: #f8e7a4;
  --ui-surface: #fff9dd;
  --ui-surface-soft: #f5e9c6;
  --ui-text: #580b0c;
  --ui-secondary: #71302a;
  --ui-muted: #71302a;
  --ui-border: rgba(88,11,12,.2);
  --ui-primary: #9e2d2b;
  --ui-accent: #9e2d2b;
  --ui-highlight: #e2a13b;
  --ui-header-text: #fff2b2;
  --ui-control-text: #580b0c;
  --ui-chart-target: #e2a13b;
  color: var(--ui-text);
  background-color: var(--ui-page);
}
body.theme-cold::before {
  background:
    radial-gradient(ellipse at 6% 0%, rgba(120,145,172,.23), transparent 38rem),
    radial-gradient(ellipse at 95% 12%, rgba(54,82,104,.11), transparent 34rem),
    linear-gradient(145deg, #f0edd9 0%, #e9ece7 52%, #dbe3e5 100%);
}
body.theme-warm::before {
  background:
    radial-gradient(ellipse at 7% 0%, rgba(226,161,59,.2), transparent 38rem),
    radial-gradient(ellipse at 96% 12%, rgba(158,45,43,.1), transparent 34rem),
    linear-gradient(145deg, #fff2b2 0%, #fff5cb 54%, #f8e7a4 100%);
}
body.theme-cold .topbar, body.theme-warm .topbar {
  color: var(--ui-text);
  border-color: var(--ui-border);
  background: color-mix(in srgb, var(--ui-surface) 88%, transparent);
  box-shadow: 0 8px 26px rgba(12,20,34,.07), inset 0 1px white;
}
body.theme-cold h1, body.theme-warm h1,
body.theme-cold .eyebrow, body.theme-warm .eyebrow {
  color: var(--ui-text);
}
body.theme-cold .eyebrow, body.theme-warm .eyebrow { color: var(--ui-secondary); }
body.theme-cold .refresh, body.theme-warm .refresh {
  color: var(--ui-primary);
  border-color: var(--ui-border);
  background: var(--ui-surface);
}
body.theme-cold .hero-card, body.theme-warm .hero-card { color: var(--ui-text); }
body.theme-cold .hero-card .status-block .eyebrow,
body.theme-cold .hero-card .temperature-block .eyebrow,
body.theme-cold .hero-card .control-group-heading .eyebrow,
body.theme-cold .hero-card .relax-control .eyebrow,
body.theme-cold .hero-card .reading-label,
body.theme-cold .hero-card .fan-control-heading .reading-label,
body.theme-cold .hero-card .pellet-heading .eyebrow,
body.theme-cold .hero-card .pellet-amount,
body.theme-cold .hero-card .consumption-line,
body.theme-cold .hero-card .pellet-help,
body.theme-cold .hero-card .pellet-label,
body.theme-cold .hero-card .relax-description,
body.theme-cold .hero-card .fan-help,
body.theme-warm .hero-card .status-block .eyebrow,
body.theme-warm .hero-card .temperature-block .eyebrow,
body.theme-warm .hero-card .control-group-heading .eyebrow,
body.theme-warm .hero-card .relax-control .eyebrow,
body.theme-warm .hero-card .reading-label,
body.theme-warm .hero-card .fan-control-heading .reading-label,
body.theme-warm .hero-card .pellet-heading .eyebrow,
body.theme-warm .hero-card .pellet-amount,
body.theme-warm .hero-card .consumption-line,
body.theme-warm .hero-card .pellet-help,
body.theme-warm .hero-card .pellet-label,
body.theme-warm .hero-card .relax-description,
body.theme-warm .hero-card .fan-help {
  color: var(--ui-secondary);
  opacity: 1;
}
body.theme-cold .hero-card h2, body.theme-warm .hero-card h2,
body.theme-cold .hero-card .temperature-value, body.theme-warm .hero-card .temperature-value,
body.theme-cold .hero-card .control-group-heading h3, body.theme-warm .hero-card .control-group-heading h3,
body.theme-cold .hero-card .relax-control h3, body.theme-warm .hero-card .relax-control h3,
body.theme-cold .hero-card .pellet-heading h3, body.theme-warm .hero-card .pellet-heading h3,
body.theme-cold .hero-card .fan-control-heading strong, body.theme-warm .hero-card .fan-control-heading strong,
body.theme-cold .hero-card .stepper output, body.theme-warm .hero-card .stepper output,
body.theme-cold .hero-card .reading strong, body.theme-warm .hero-card .reading strong {
  color: var(--ui-text);
}
body.theme-cold .hero-card .temperature-block,
body.theme-cold .hero-card .control-group,
body.theme-cold .hero-card .reading,
body.theme-cold .hero-card .fan-control,
body.theme-cold .hero-card .relax-control,
body.theme-cold .hero-card .pellet-card,
body.theme-warm .hero-card .temperature-block,
body.theme-warm .hero-card .control-group,
body.theme-warm .hero-card .reading,
body.theme-warm .hero-card .fan-control,
body.theme-warm .hero-card .relax-control,
body.theme-warm .hero-card .pellet-card {
  border-color: var(--ui-border);
  color: var(--ui-text);
  background: color-mix(in srgb, var(--ui-surface) 94%, transparent);
  box-shadow: 0 8px 22px rgba(12,20,34,.045), inset 0 1px white;
}
body.theme-cold .hero-card .reading small, body.theme-warm .hero-card .reading small,
body.theme-cold .hero-card .fan-help, body.theme-warm .hero-card .fan-help {
  color: var(--ui-secondary);
}
body.theme-cold .hero-card .temperature-symbol {
  color: #f0edd9;
  border-color: rgba(29,48,71,.24);
  background: linear-gradient(145deg, #365268, #1d3047);
}
body.theme-warm .hero-card .temperature-symbol {
  color: #580b0c;
  border-color: rgba(88,11,12,.18);
  background: linear-gradient(145deg, #fff2b2, #e2a13b);
}
body.theme-cold .hero-card .stepper button,
body.theme-cold .hero-card .fan-control-heading output {
  color: #f0edd9;
  border-color: #365268;
  background: linear-gradient(145deg, #365268, #1d3047);
}
body.theme-warm .hero-card .stepper button,
body.theme-warm .hero-card .fan-control-heading output {
  color: #580b0c;
  border-color: rgba(88,11,12,.24);
  background: linear-gradient(145deg, #f1bd5f, #e2a13b);
}
body.theme-cold .hero-card .mode-switch { background: rgba(29,48,71,.16); border-color: rgba(29,48,71,.3); }
body.theme-cold .hero-card .mode-switch.enabled { background: linear-gradient(120deg, #365268, #7891ac); border-color: #365268; }
body.theme-warm .hero-card .mode-switch { background: rgba(88,11,12,.12); border-color: rgba(88,11,12,.28); }
body.theme-warm .hero-card .mode-switch.enabled { background: linear-gradient(120deg, #9e2d2b, #e2a13b); border-color: #9e2d2b; }
body.theme-cold .hero-card .online-pill, body.theme-cold .hero-card .stove-power-toggle.is-off {
  color: #0c1422;
  border-color: rgba(29,48,71,.26);
  background: #e5e9e5;
}
body.theme-warm .hero-card .online-pill, body.theme-warm .hero-card .stove-power-toggle.is-off {
  color: #580b0c;
  border-color: rgba(88,11,12,.24);
  background: #fff2b2;
}
body.theme-cold .hero-card .online-pill.online i { background: #365268; box-shadow: 0 0 0 3px rgba(54,82,104,.14), 0 0 8px rgba(54,82,104,.35); }
body.theme-warm .hero-card .online-pill.online i { background: #e2a13b; box-shadow: 0 0 0 3px rgba(226,161,59,.18), 0 0 8px rgba(226,161,59,.45); }
body.theme-cold .hero-card .online-pill.offline i { background: #1d3047; box-shadow: 0 0 0 3px rgba(29,48,71,.14), 0 0 8px rgba(29,48,71,.3); }
body.theme-warm .hero-card .online-pill.offline i { background: #580b0c; box-shadow: 0 0 0 3px rgba(88,11,12,.14), 0 0 8px rgba(88,11,12,.3); }
body.theme-cold .hero-card .stove-power-toggle.is-on {
  color: #f0edd9;
  border-color: #365268;
  background: linear-gradient(145deg, #365268, #1d3047);
  box-shadow: 0 0 0 2px rgba(54,82,104,.14), 0 5px 14px rgba(12,20,34,.16);
}
body.theme-warm .hero-card .stove-power-toggle.is-on {
  color: #580b0c;
  border-color: #e2a13b;
  background: linear-gradient(145deg, #fff2b2, #e2a13b);
  box-shadow: 0 0 0 2px rgba(226,161,59,.18), 0 5px 14px rgba(88,11,12,.16);
}
body.theme-cold .hero-card .pellet-percent, body.theme-cold .hero-card .slider-row output { color: #1d3047; }
body.theme-warm .hero-card .pellet-percent, body.theme-warm .hero-card .slider-row output { color: #9e2d2b; }
body.theme-cold .hero-card .pellet-track { background: rgba(29,48,71,.14); }
body.theme-cold .hero-card .pellet-track span { background: linear-gradient(90deg, #365268, #7891ac); }
body.theme-warm .hero-card .pellet-track { background: rgba(88,11,12,.12); }
body.theme-warm .hero-card .pellet-track span { background: linear-gradient(90deg, #9e2d2b, #e2a13b); }
body.theme-cold .hero-card .save-level {
  color: #f0edd9;
  border-color: #1d3047;
  background: linear-gradient(145deg, #365268, #1d3047);
}
body.theme-warm .hero-card .save-level {
  color: #fff2b2;
  border-color: #580b0c;
  background: linear-gradient(145deg, #9e2d2b, #580b0c);
}
body.theme-cold .dashboard-overview { background: linear-gradient(145deg, #0c1422, #1d3047 72%, #365268); }
body.theme-warm .dashboard-overview { background: linear-gradient(145deg, #580b0c, #9e2d2b 72%, #71302a); }
body.theme-cold .dashboard-overview .eyebrow,
body.theme-cold .dashboard-live-value > span,
body.theme-cold .dashboard-updated { color: #dce4e2; }
body.theme-warm .dashboard-overview .eyebrow,
body.theme-warm .dashboard-live-value > span,
body.theme-warm .dashboard-updated { color: #fff2b2; }
body.theme-cold .dashboard-overview h2, body.theme-cold .dashboard-live-value strong,
body.theme-cold .dashboard-updated time { color: #f0edd9; }
body.theme-warm .dashboard-overview h2, body.theme-warm .dashboard-live-value strong,
body.theme-warm .dashboard-updated time { color: #fff2b2; }
body.theme-cold .dashboard-overview .online-pill {
  color: #f0edd9;
  border-color: rgba(240,237,217,.34);
  background: rgba(12,20,34,.48);
}
body.theme-warm .dashboard-overview .online-pill {
  color: #fff2b2;
  border-color: rgba(255,242,178,.36);
  background: rgba(88,11,12,.42);
}
body.theme-cold .dashboard-overview .online-pill.online i { background: #7891ac; box-shadow: 0 0 0 3px rgba(120,145,172,.18), 0 0 8px rgba(120,145,172,.42); }
body.theme-warm .dashboard-overview .online-pill.online i { background: #e2a13b; box-shadow: 0 0 0 3px rgba(226,161,59,.18), 0 0 8px rgba(226,161,59,.44); }
body.theme-cold .dashboard-overview .online-pill.offline i { background: #7891ac; box-shadow: 0 0 0 3px rgba(120,145,172,.18), 0 0 8px rgba(120,145,172,.36); }
body.theme-warm .dashboard-overview .online-pill.offline i { background: #580b0c; box-shadow: 0 0 0 3px rgba(88,11,12,.18), 0 0 8px rgba(88,11,12,.36); }
body.theme-cold .dashboard-card { color: #0c1422; border-color: var(--ui-border); background: rgba(251,250,243,.94); }
body.theme-warm .dashboard-card { color: #580b0c; border-color: var(--ui-border); background: rgba(255,249,221,.96); }
body.theme-cold .dashboard-card .eyebrow, body.theme-cold .metric-detail,
body.theme-cold .metric-main small, body.theme-cold .chart-caption,
body.theme-cold .chart-note, body.theme-cold .chart-legend,
body.theme-cold .telemetry-grid span, body.theme-cold .activity-list time { color: #365268; }
body.theme-warm .dashboard-card .eyebrow, body.theme-warm .metric-detail,
body.theme-warm .metric-main small, body.theme-warm .chart-caption,
body.theme-warm .chart-note, body.theme-warm .chart-legend,
body.theme-warm .telemetry-grid span, body.theme-warm .activity-list time { color: #71302a; }
body.theme-cold .dashboard-card-heading h2, body.theme-cold .metric-main,
body.theme-cold .metric-detail b, body.theme-cold .telemetry-grid strong,
body.theme-cold .activity-list li { color: #0c1422; }
body.theme-warm .dashboard-card-heading h2, body.theme-warm .metric-main,
body.theme-warm .metric-detail b, body.theme-warm .telemetry-grid strong,
body.theme-warm .activity-list li { color: #580b0c; }
body.theme-cold .telemetry-grid > div { background: rgba(229,233,229,.72); border-color: var(--ui-border); }
body.theme-warm .telemetry-grid > div { background: rgba(245,233,198,.72); border-color: var(--ui-border); }
body.theme-cold .chart-grid { stroke: rgba(29,48,71,.17); }
body.theme-warm .chart-grid { stroke: rgba(88,11,12,.16); }
body.theme-cold .chart-axis-label, body.theme-cold .chart-empty { fill: #365268; }
body.theme-warm .chart-axis-label, body.theme-warm .chart-empty { fill: #71302a; }
body.theme-cold .chart-line { stroke: #365268; }
body.theme-cold .chart-line.target-line { stroke: #7891ac; }
body.theme-cold #pellet-chart .chart-line { stroke: #1d3047; }
body.theme-warm .chart-line { stroke: #9e2d2b; }
body.theme-warm .chart-line.target-line { stroke: #e2a13b; }
body.theme-warm #pellet-chart .chart-line { stroke: #9e2d2b; }
body.theme-cold .chart-legend i { background: #365268; }
body.theme-cold .chart-legend .legend-target { background: #7891ac; }
body.theme-warm .chart-legend i { background: #9e2d2b; }
body.theme-warm .chart-legend .legend-target { background: #e2a13b; }
body.theme-cold .period-buttons { background: rgba(251,250,243,.9); border-color: var(--ui-border); }
body.theme-warm .period-buttons { background: rgba(255,249,221,.9); border-color: var(--ui-border); }
body.theme-cold .period-buttons button { color: #365268; }
body.theme-warm .period-buttons button { color: #71302a; }
body.theme-cold .period-buttons button[aria-pressed="true"] { color: #f0edd9; background: #1d3047; }
body.theme-warm .period-buttons button[aria-pressed="true"] { color: #fff2b2; background: #9e2d2b; }
body.theme-cold .dashboard-page .control-link { color: #0c1422; border-color: var(--ui-border); background: #e5e9e5; }
body.theme-warm .dashboard-page .control-link { color: #580b0c; border-color: var(--ui-border); background: #fff2b2; }
body.theme-cold .logout-button { color: #0c1422; border-color: var(--ui-border); background: #e5e9e5; }
body.theme-warm .logout-button { color: #580b0c; border-color: var(--ui-border); background: #fff2b2; }
body.theme-cold .dashboard-link { color: #f0edd9; border-color: #365268; background: linear-gradient(140deg, #365268, #1d3047); }
body.theme-warm .dashboard-link { color: #580b0c; border-color: #e2a13b; background: linear-gradient(140deg, #fff2b2, #e2a13b); }
body.theme-cold .notice, body.theme-cold .dashboard-page .notice,
body.theme-cold .page-footer, body.theme-cold .version-footer { color: #365268; }
body.theme-warm .notice, body.theme-warm .dashboard-page .notice,
body.theme-warm .page-footer, body.theme-warm .version-footer { color: #71302a; }
body.theme-cold .notice.error { color: #9e2d2b; }
body.theme-warm .notice.error { color: #580b0c; }
body.theme-cold .version-footer a { color: #1d3047; }
body.theme-warm .version-footer a { color: #9e2d2b; }
body.theme-cold .login-card { background: linear-gradient(145deg, #0c1422, #1d3047); }
body.theme-warm .login-card { background: linear-gradient(145deg, #580b0c, #9e2d2b); }
body.theme-cold .login-card .eyebrow { color: #dce4e2; }
body.theme-warm .login-card .eyebrow { color: #fff2b2; }
body.theme-warm .login-card h1 { color: var(--ui-header-text); }

/* Fine visual polish: unboxed header, aligned actions and clear status lights. */
.topbar {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.topbar > .online-pill {
  flex: 0 0 auto;
  min-width: 88px;
  max-width: 116px;
  justify-content: center;
  padding: 7px 9px;
  border-color: rgba(88,11,12,.2);
  color: #580b0c;
  background: rgba(255,249,221,.94);
  font-size: 9px;
  text-align: center;
}
.hero-card { border-radius: 25px; }
.control-group, .dashboard-overview { border-radius: 19px; }
.temperature-block, .relax-control, .pellet-card, .dashboard-card { border-radius: 17px; }
.fan-control, .reading, .telemetry-grid > div { border-radius: 12px; }
.dashboard-link, .control-link, .save-level, .logout-button, .login-form button { border-radius: 12px; }
.stove-power-toggle { border-radius: 12px; }
.online-pill, .refresh, .period-buttons button { border-radius: 11px; }
.stepper button, .mode-switch { border-radius: 10px; }
.online-pill i { background: #d99a00 !important; box-shadow: 0 0 0 3px rgba(217,154,0,.17), 0 0 9px rgba(217,154,0,.42) !important; }
.online-pill.online i { background: #258342 !important; box-shadow: 0 0 0 3px rgba(37,131,66,.16), 0 0 9px rgba(37,131,66,.42) !important; }
.online-pill.offline i { background: #d99a00 !important; box-shadow: 0 0 0 3px rgba(217,154,0,.18), 0 0 9px rgba(217,154,0,.44) !important; }
@media (max-width: 480px) {
  .hero-card { border-radius: 21px; }
}

/* Stove state row: the power control stays beside the live stove status. */
.status-block { align-items: center; justify-content: space-between; gap: 16px; margin: 0; }
.status-summary { display: flex; min-width: 0; flex: 0 1 auto; align-items: center; gap: 10px; }
.status-summary .eyebrow { margin-bottom: 5px; }
.status-summary .stove-power-toggle {
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 12px;
}
.status-summary .power-toggle-icon { font-size: 19px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.status-summary > *:focus-visible { outline: 3px solid var(--ui-highlight); outline-offset: 3px; }
.inventory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.inventory-grid > div { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 6px; padding: 13px 15px; border: 1px solid var(--ui-border); border-radius: 12px; background: var(--ui-surface-soft); }
.inventory-grid span, .inventory-primary small { color: var(--ui-secondary); font-size: 10px; font-weight: 650; }
.inventory-grid strong { color: var(--ui-text); font-size: 16px; font-variant-numeric: tabular-nums; }
.inventory-primary strong { font-size: 25px; letter-spacing: -.04em; }
.inventory-primary small { font-size: 9px; }
.stock-form { display: grid; gap: 7px; margin-top: 13px; }
.stock-form label { color: var(--ui-text); font-size: 11px; font-weight: 700; }
.stock-form label small { color: var(--ui-secondary); font-weight: 500; }
.stock-form-row { display: flex; align-items: center; gap: 8px; }
.stock-form input { width: 145px; min-height: 38px; padding: 8px 10px; border: 1px solid var(--ui-border); border-radius: 10px; color: var(--ui-text); background: var(--ui-surface); font: inherit; font-size: 12px; }
.stock-form input:focus-visible { outline: 3px solid var(--ui-highlight); outline-offset: 2px; }
.stock-form .save-level { min-height: 38px; padding: 8px 12px; border-radius: 10px; }
.stock-help { margin: 0; color: var(--ui-secondary); font-size: 10px; line-height: 1.45; }
.push-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.push-actions .save-level { min-height: 38px; padding: 8px 13px; border-radius: 10px; }
.push-actions span { color: var(--ui-secondary); font-size: 11px; line-height: 1.45; }
.push-actions button:disabled { cursor: not-allowed; opacity: .65; }
body.theme-cold .inventory-grid > div { background: rgba(229,233,229,.72); }
body.theme-warm .inventory-grid > div { background: rgba(245,233,198,.72); }
@media (max-width: 760px) {
  .status-block { gap: 10px; }
  .status-summary { gap: 8px; }
}
@media (max-width: 480px) {
  .status-block { display: flex; gap: 8px; }
  .status-summary { grid-column: auto; }
  .temperature-overview { gap: 6px; }
  .temperature-block { min-height: 78px; gap: 7px; padding: 9px; border-radius: 16px; }
  .temperature-symbol { width: 30px; height: 30px; border-radius: 10px; font-size: 22px; }
  .temperature-block .eyebrow { font-size: 8px; letter-spacing: .11em; }
  .temperature-value { font-size: clamp(25px, 7vw, 32px); }
  .temperature-value .unit { font-size: 12px; }
  .overview-dashboard-link { min-height: 78px; gap: 5px; padding: 8px; font-size: 12px; }
  .inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-grid > div:last-child { grid-column: 1 / -1; }
  .stock-form-row { align-items: stretch; }
  .stock-form input { width: 110px; }
}
@media (max-width: 360px) {
  .overview-dashboard-link { font-size: 11px; }
}
.temperature-overview > .overview-dashboard-link {
  width: 100%;
  margin: 0;
  justify-self: stretch;
  box-sizing: border-box;
}
body.theme-cold .hero-card .status-summary .stove-power-toggle {
  color: #f0edd9;
  border-color: #365268;
  background: linear-gradient(140deg, #365268, #1d3047);
  box-shadow: 0 4px 13px rgba(12,20,34,.2), inset 0 1px rgba(240,237,217,.18);
}
body.theme-warm .hero-card .status-summary .stove-power-toggle {
  color: #580b0c;
  border-color: #e2a13b;
  background: linear-gradient(140deg, #fff2b2, #e2a13b);
  box-shadow: 0 4px 13px rgba(88,11,12,.16), inset 0 1px rgba(255,255,255,.58);
}
@media (max-width: 480px) {
  .status-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }
  .status-summary {
    min-width: 0;
    flex: 1 1 auto;
    gap: 6px;
  }
  .status-summary > div { min-width: 0; }
  .status-summary h2 { font-size: clamp(17px, 5vw, 22px); }
  .status-summary .stove-power-toggle { width: 48px; min-width: 48px; height: 48px; }
}
@media (max-width: 360px) {
  .status-summary .stove-power-toggle { width: 42px; min-width: 42px; height: 42px; }
}
body.theme-cold .status-summary .stove-power-toggle {
  color: #f0edd9;
  border-color: #365268;
  background: linear-gradient(140deg, #365268, #1d3047);
  box-shadow: 0 4px 13px rgba(12,20,34,.2), inset 0 1px rgba(240,237,217,.18);
}
body.theme-warm .status-summary .stove-power-toggle {
  color: #580b0c;
  border-color: #e2a13b;
  background: linear-gradient(140deg, #fff2b2, #e2a13b);
  box-shadow: 0 4px 13px rgba(88,11,12,.16), inset 0 1px rgba(255,255,255,.58);
}
@media (prefers-reduced-motion: reduce) {
  body, body::before, .topbar, .dashboard-card, .hero-card .control-group { transition: none !important; }
}
