/* Néon theme, as in Bruno's other apps (serverdash / grocery / wedplanner): deep navy page under a faint grid,
   translucent cards with a thin luminous outline and soft glow, numbers that shine, Titillium Web. */
:root {
  --bg: #060C26;
  --text: #EEF3FF;
  --muted: #9FB2DE;
  --line: rgba(125, 170, 255, .40);
  --line-soft: rgba(125, 170, 255, .20);
  --glow: rgba(70, 130, 255, .28);
  --fill: linear-gradient(160deg, rgba(48, 88, 200, .32), rgba(10, 20, 66, .66));
  --well: rgba(5, 11, 38, .55);
  --text-glow: 0 0 14px rgba(140, 185, 255, .50);
  --ok: #4FE3B0; --warn: #FFC857; --bad: #FF5C7A; --info: #6FB6FF;
  --fire: #FF8A2A; --fire-2: #FFC857;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); min-height: 100%; }
body {
  font-family: "Titillium Web", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(110, 150, 255, .055) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, rgba(110, 150, 255, .055) 1px, transparent 1px) 0 0 / 36px 36px,
    radial-gradient(120% 70% at 50% 0%, #16337F 0%, #0B1A4C 42%, #050A22 100%);
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
svg { width: 100%; height: 100%; display: block; }

.shell {
  max-width: 460px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}

.top { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 2px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; letter-spacing: .01em; text-shadow: var(--text-glow); }
.brand-mark { width: 24px; height: 24px; color: var(--fire); filter: drop-shadow(0 0 6px rgba(255, 138, 42, .7)); }
.conn { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn.ok .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.conn.stale .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.conn.bad .dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

.card {
  background: var(--fill); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 0 18px var(--glow), inset 0 0 18px rgba(90, 140, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.muted { color: var(--muted); }

/* Hero: the stove's window on the left, the room temperature on the right, the setpoint below. */
.hero { padding: 16px; }
.hero.burning { border-color: rgba(255, 150, 60, .55); box-shadow: 0 0 22px rgba(255, 120, 40, .30), inset 0 0 22px rgba(255, 140, 60, .10), inset 0 1px 0 rgba(255,255,255,.06); }
.hero.alarm { border-color: color-mix(in srgb, var(--bad) 70%, transparent); box-shadow: 0 0 22px rgba(255, 92, 122, .30), inset 0 0 18px rgba(255, 92, 122, .10); }
.hero.skeleton { min-height: 260px; display: grid; place-items: center; }
.hero-main { display: grid; grid-template-columns: 46% 1fr; align-items: center; gap: 10px; }
.hero-side { text-align: center; }

.state-chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--line-soft); background: rgba(90, 140, 255, .10); color: var(--muted);
  border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600;
}
.burning .state-chip, .igniting .state-chip { color: var(--fire-2); border-color: rgba(255, 170, 70, .5); background: rgba(255, 130, 40, .12); text-shadow: 0 0 10px rgba(255, 160, 60, .7); }
.alarm .state-chip { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: rgba(255, 92, 122, .10); }

.room { margin-top: 8px; line-height: 1; display: flex; justify-content: center; align-items: flex-start; }
.room-value { font-size: 76px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-shadow: var(--text-glow); }
.room-unit { font-size: 22px; font-weight: 600; color: var(--muted); margin: 10px 0 0 3px; }
.room-label { color: var(--muted); font-size: 14px; margin-top: 2px; }

.target {
  margin-top: 14px; display: flex; align-items: center; justify-content: space-between;
  background: var(--well); border: 1px solid var(--line-soft); border-radius: 16px; padding: 8px;
}
.target-mid { text-align: center; }
.target-value { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: var(--text-glow); transition: color .2s; }
.target-value.draft { color: var(--fire-2); text-shadow: 0 0 12px rgba(255, 200, 87, .7); }
.target-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.round {
  width: 54px; height: 54px; border-radius: 14px; padding: 16px; color: var(--text);
  border: 1px solid var(--line); background: rgba(48, 88, 200, .25); box-shadow: 0 0 10px var(--glow);
}
.round:not(:disabled):active { transform: scale(.94); }

.row-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
h2 { font-size: 13px; margin: 0; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: color-mix(in srgb, var(--info) 45%, white); text-shadow: var(--text-glow); }
.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; min-width: 0; height: 46px; border-radius: 12px; font-weight: 700; font-size: 15px;
  border: 1px solid var(--line-soft); background: var(--well); color: var(--muted);
}
.seg button.on {
  color: #04122E; border-color: transparent; background: var(--ok);
  box-shadow: 0 0 14px color-mix(in srgb, var(--ok) 60%, transparent);
}
.fans { display: flex; flex-direction: column; gap: 18px; }
.level.compact .row-head { margin-bottom: 8px; }
.level.compact .seg button { height: 38px; border-radius: 10px; font-size: 13px; }

.btn {
  border-radius: 16px; height: 52px; padding: 0 20px; font-weight: 700; font-size: 17px; letter-spacing: .02em;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent;
}
.btn .ico { width: 22px; height: 22px; }
.btn.big { width: 100%; height: 64px; }
/* Ligar: neon mint. Desligar: neon red. */
.btn.primary { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-color: var(--ok);
  box-shadow: 0 0 18px color-mix(in srgb, var(--ok) 45%, transparent), inset 0 0 14px color-mix(in srgb, var(--ok) 18%, transparent);
  text-shadow: 0 0 10px color-mix(in srgb, var(--ok) 70%, transparent); }
.btn.off { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); border-color: var(--bad);
  box-shadow: 0 0 18px color-mix(in srgb, var(--bad) 45%, transparent), inset 0 0 14px color-mix(in srgb, var(--bad) 18%, transparent);
  text-shadow: 0 0 10px color-mix(in srgb, var(--bad) 70%, transparent); }
.btn.confirm { animation: pulse .9s ease-in-out infinite; }
.btn.confirm.off { background: var(--bad); color: #1a0410; text-shadow: none; }
.btn.confirm.primary { background: var(--ok); color: #04122E; text-shadow: none; }
@keyframes pulse { 50% { transform: scale(1.015); filter: brightness(1.15); } }
.btn:not(:disabled):active { transform: scale(.98); }
.btn.ghost { background: rgba(48, 88, 200, .25); border-color: var(--line); color: var(--text); box-shadow: 0 0 10px var(--glow); height: 44px; font-size: 15px; }
.note { text-align: center; color: var(--muted); font-size: 13px; margin: -4px 0 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 6px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat + .stat { border-left: 1px solid var(--line-soft); }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: var(--text-glow); }

.banner { display: flex; gap: 12px; align-items: center; border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.35; border: 1px solid; }
.banner .ico { width: 22px; height: 22px; flex: none; }
.banner.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 60%, transparent); background: rgba(255, 92, 122, .10); box-shadow: 0 0 16px rgba(255, 92, 122, .25); }
.banner.info { border-color: rgba(255, 200, 87, .45); background: rgba(255, 200, 87, .08); }
.spinner {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2.5px solid rgba(255, 200, 87, .25); border-top-color: var(--warn); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- the stove's window ---- */
.stove-visual { width: 100%; max-width: 170px; margin: 0 auto; }
.stove-visual .sv-body { fill: rgba(10, 20, 66, .7); stroke: var(--line); stroke-width: 1.5; }
.stove-visual .sv-window { fill: #050A1C; stroke: rgba(125, 170, 255, .30); stroke-width: 2; }
.stove-visual .sv-foot { fill: rgba(125, 170, 255, .25); }
.stove-visual .sv-bed ellipse { fill: #2a2f45; }
.stove-visual .f { transform-box: fill-box; transform-origin: 50% 100%; }
.stove-visual .sv-flames, .stove-visual .sv-glow, .stove-visual .sv-smoke { opacity: 0; transition: opacity 1.2s ease; }

/* burning: full flames that dance */
.stove-visual.burning .sv-flames, .stove-visual.burning .sv-glow { opacity: 1; }
.stove-visual.burning .sv-bed ellipse, .stove-visual.dying .sv-bed ellipse, .stove-visual.igniting .sv-bed ellipse { fill: #ff7a1a; filter: drop-shadow(0 0 4px #ff5a1a); }
.stove-visual.burning svg { filter: drop-shadow(0 0 14px rgba(255, 120, 40, .45)); }
.stove-visual.burning .f-outer { animation: flick-a 1.3s ease-in-out infinite; }
.stove-visual.burning .f-left  { animation: flick-b 1.1s ease-in-out infinite .2s; }
.stove-visual.burning .f-right { animation: flick-b 1.2s ease-in-out infinite .5s; }
.stove-visual.burning .f-mid   { animation: flick-a .9s ease-in-out infinite .1s; }
.stove-visual.burning .f-core  { animation: flick-c .7s ease-in-out infinite; }
.stove-visual.burning .sv-glow { animation: breathe 2.4s ease-in-out infinite; }

/* igniting: small flame that tries */
.stove-visual.igniting .sv-flames, .stove-visual.igniting .sv-glow { opacity: 1; }
.stove-visual.igniting .sv-flames { transform: translate(0, 30px) scale(.6); transform-origin: 100px 134px; }
.stove-visual.igniting .f { animation: flick-a .6s ease-in-out infinite; }
.stove-visual.igniting .f-left, .stove-visual.igniting .f-right { opacity: 0; }

/* dying (extinguishing): low flame, slow, fading, with a little smoke */
.stove-visual.dying .sv-flames { opacity: .75; transform: translate(0, 40px) scale(.45); transform-origin: 100px 134px; }
.stove-visual.dying .sv-glow { opacity: .4; }
.stove-visual.dying .f { animation: flick-a 2.2s ease-in-out infinite; }
.stove-visual.dying .f-left, .stove-visual.dying .f-right { opacity: 0; }
.stove-visual.dying .sv-smoke { opacity: 1; }
.stove-visual .sv-smoke circle { fill: rgba(160, 175, 210, .35); }
.stove-visual.dying .sv-smoke circle { animation: smoke 3s ease-out infinite; }
.stove-visual.dying .sv-smoke circle:nth-child(2) { animation-delay: 1s; }
.stove-visual.dying .sv-smoke circle:nth-child(3) { animation-delay: 2s; }

/* off: dark still hearth, cold pellets, no animation */
.stove-visual.off .sv-window { fill: #070C20; }
.stove-visual.off .sv-body { stroke: var(--line-soft); }
/* alarm: red window, no flame */
.stove-visual.alarm .sv-window { fill: #1a0612; stroke: var(--bad); }
.stove-visual.alarm svg { filter: drop-shadow(0 0 10px rgba(255, 92, 122, .4)); }

@keyframes flick-a { 0%,100% { transform: scale(1, 1) skewX(0); } 25% { transform: scale(.96, 1.06) skewX(-2deg); } 50% { transform: scale(1.03, .95) skewX(1.5deg); } 75% { transform: scale(.98, 1.04) skewX(-1deg); } }
@keyframes flick-b { 0%,100% { transform: scale(1, 1) rotate(0); } 40% { transform: scale(.92, 1.1) rotate(-3deg); } 70% { transform: scale(1.04, .92) rotate(2deg); } }
@keyframes flick-c { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(.9, 1.12); } }
@keyframes breathe { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes smoke { 0% { transform: translateY(10px); opacity: 0; } 30% { opacity: .8; } 100% { transform: translateY(-30px) scale(1.6); opacity: 0; } }

/* login */
.login { max-width: 320px; margin: 18vh auto 0; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.login-mark { width: 52px; height: 52px; margin: 0 auto; color: var(--fire); filter: drop-shadow(0 0 10px rgba(255, 138, 42, .8)); }
.login h1 { margin: 0 0 6px; font-size: 26px; text-shadow: var(--text-glow); }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login input {
  height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--well);
  color: var(--text); padding: 0 16px; font: inherit; font-size: 16px; box-shadow: 0 0 10px var(--glow);
}
.login .btn.primary { height: 52px; }
.login-err { color: var(--bad); margin: 0; font-size: 14px; }

#blazor-error-ui {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px;
  background: rgba(255, 92, 122, .15); color: var(--bad); text-align: center; z-index: 10;
}
@media (prefers-reduced-motion: reduce) { .stove-visual * { animation: none !important; } }

/* notifications card */
.small { font-size: 14px; line-height: 1.4; margin: 0; }
.notif-actions { display: flex; gap: 8px; margin-top: 12px; }
.notif-actions .btn { flex: 1; }
.btn.wide { width: 100%; height: 50px; font-size: 16px; }

/* temperature gauge: outer ring = room, inner ring = target */
.gauge { position: relative; width: 100%; max-width: 200px; aspect-ratio: 1; margin: 0 auto; }
.gauge svg { overflow: visible; }
.gauge circle { fill: none; stroke-linecap: round; }
.g-track { stroke: rgba(125, 170, 255, .14); stroke-width: 12; }
.g-track.inner { stroke-width: 7; stroke: rgba(125, 170, 255, .10); }
.g-arc { stroke-width: 12; filter: drop-shadow(0 0 6px var(--c)); transition: stroke-dasharray .8s ease, stroke .8s ease; }
.g-arc.inner { stroke-width: 7; opacity: .9; }
.g-knob { stroke: #060C26; stroke-width: 2.5; filter: drop-shadow(0 0 6px var(--c)); }
.g-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 6px; }
.g-value { line-height: 1; display: flex; align-items: flex-start; font-weight: 700; text-shadow: 0 0 16px currentColor; transition: color .8s; }
.g-value span { font-size: 54px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.g-value small { font-size: 16px; margin: 6px 0 0 2px; opacity: .8; }
.g-label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hero-main { grid-template-columns: 40% 1fr; }
.hero-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero-head { display: flex; justify-content: center; margin-bottom: 8px; }

/* ---- Reconnecting (same behaviour and layout as serverdash's ReconnectModal, néon colours) ---- */
html.wp-reconnecting body::after { content: ""; position: fixed; z-index: 3000; left: 0; right: 0; top: env(safe-area-inset-top, 0px); height: 3px; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--ok), transparent) 0 0 / 40% 100% no-repeat; animation: wp-reconnect-bar 1.1s ease-in-out infinite; }
@keyframes wp-reconnect-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes wp-reconnect-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes wp-fade-in { from { opacity: 0; } to { opacity: 1; } }
.components-reconnect-first-attempt-visible, .components-reconnect-repeated-attempt-visible, .components-reconnect-failed-visible,
.components-pause-visible, .components-resume-failed-visible, .components-rejoining-animation { display: none; }
#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible { display: block; }
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-failed .components-rejoining-animation { display: none; }
#components-reconnect-modal {
    position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100dvh - 32px);
    width: min(22rem, calc(100vw - 32px)); box-sizing: border-box; padding: 28px 24px 24px;
    background: linear-gradient(160deg, rgba(30, 60, 150, .96), rgba(8, 16, 52, .98)); color: var(--text);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 0 24px var(--glow), 0 18px 48px rgba(0, 0, 0, .45); font-family: "Titillium Web", system-ui, sans-serif;
}
#components-reconnect-modal:focus, #components-reconnect-modal:focus-visible { outline: none; }
#components-reconnect-modal[open] { animation: wp-reconnect-in .4s cubic-bezier(.05, .89, .25, 1.02) .3s both; }
#components-reconnect-modal::backdrop { background: rgba(3, 8, 30, .35); -webkit-backdrop-filter: grayscale(1); backdrop-filter: grayscale(1); animation: wp-fade-in .5s ease-in-out; }
.components-reconnect-container { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.components-reconnect-container .reconnect-logo { width: 40px; height: 40px; color: var(--fire); filter: drop-shadow(0 0 8px rgba(255, 138, 42, .8)); }
#components-reconnect-modal p { margin: 0; text-align: center; line-height: 1.45; }
#components-reconnect-modal p b { text-shadow: var(--text-glow); }
#components-reconnect-modal p span { font-size: .875rem; color: var(--muted); }
#components-reconnect-modal button {
    min-height: 44px; padding: 0 22px; border-radius: 14px; cursor: pointer; font: inherit; font-weight: 700;
    background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border: 1px solid var(--ok);
    box-shadow: 0 0 14px color-mix(in srgb, var(--ok) 40%, transparent);
}
.components-rejoining-animation {
    width: 40px; height: 40px; box-sizing: border-box; border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--ok) 20%, transparent); border-top-color: var(--ok);
    box-shadow: 0 0 12px color-mix(in srgb, var(--ok) 30%, transparent);
    animation: spin .9s linear infinite;
}

/* alarm bell (header) and history page */
.top-right { display: flex; align-items: center; gap: 12px; }
.bell {
  position: relative; width: 40px; height: 40px; border-radius: 12px; padding: 9px; display: block;
  color: var(--muted); border: 1px solid var(--line-soft); background: rgba(48, 88, 200, .12); opacity: .55;
  transition: opacity .3s, color .3s, box-shadow .3s;
}
.bell.unread {
  opacity: 1; color: var(--bad); border-color: var(--bad); background: rgba(255, 92, 122, .12);
  box-shadow: 0 0 14px rgba(255, 92, 122, .45); animation: bell-glow 2s ease-in-out infinite;
}
.bell.unread svg { animation: bell-ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #1a0410; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 8px var(--bad);
}
@keyframes bell-glow { 50% { box-shadow: 0 0 22px rgba(255, 92, 122, .7); } }
@keyframes bell-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-5deg); } }

.back { width: 40px; height: 40px; border-radius: 12px; padding: 9px; color: var(--text); border: 1px solid var(--line); background: rgba(48, 88, 200, .25); box-shadow: 0 0 10px var(--glow); }
.top-spacer { width: 40px; }
.alarm-list { padding: 8px 16px; }
.alarm-list .month { margin: 14px 0 4px; text-transform: capitalize; }
.alarm-list .month:first-child { margin-top: 6px; }
.alarm-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.alarm-row:last-child { border-bottom: 0; }
.alarm-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; padding: 7px; color: var(--warn); background: rgba(255, 200, 87, .10); border: 1px solid rgba(255, 200, 87, .35); }
.alarm-row.new .alarm-ico { color: var(--bad); background: rgba(255, 92, 122, .12); border-color: var(--bad); box-shadow: 0 0 10px rgba(255, 92, 122, .4); }
.alarm-main { flex: 1; min-width: 0; }
.alarm-title { font-weight: 600; line-height: 1.3; }
.alarm-row.new .alarm-title::after { content: "novo"; margin-left: 8px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--bad); color: #1a0410; vertical-align: 2px; }
.alarm-sub { font-size: 13px; }
.alarm-when { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px; }
.empty-ico { width: 40px; height: 40px; color: var(--muted); opacity: .6; }

/* Ligar / Desligar: bigger icon and text, upper case (Bruno, 2026-11-18) */
.btn.big { height: 72px; font-size: 22px; text-transform: uppercase; letter-spacing: .08em; gap: 14px; }
.btn.big .ico { width: 30px; height: 30px; }
.btn.big.confirm { font-size: 16px; letter-spacing: .04em; }
.state-chip { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; padding: 5px 14px; }

/* Main ↔ Configurações: two panes side by side; Configurações slides in from the right, back slides it out. */
.slider { display: grid; overflow-x: clip; margin: 0 -16px; }
.pane {
  grid-area: 1 / 1; min-width: 0; padding: 0 16px; display: flex; flex-direction: column; gap: 14px;
  transition: transform .38s cubic-bezier(.22, .8, .24, 1), opacity .38s ease;
}
.pane-settings { transform: translateX(100%); opacity: 0; }
.show-settings .pane-main { transform: translateX(-100%); opacity: 0; }
.show-settings .pane-settings { transform: none; opacity: 1; }
/* the pane out of view doesn't make the page taller */
.slider:not(.show-settings) .pane-settings, .show-settings .pane-main { max-height: 100dvh; overflow: hidden; }
.top button.back { cursor: pointer; }

.btn.settings-link {
  width: 100%; height: 56px; justify-content: space-between; padding: 0 18px 0 20px;
  background: var(--fill); border: 1px solid var(--line); color: var(--text); font-size: 16px;
  text-transform: uppercase; letter-spacing: .08em;
  box-shadow: 0 0 14px var(--glow), inset 0 0 14px rgba(90, 140, 255, .06);
}
.btn.settings-link .chev { width: 22px; height: 22px; color: color-mix(in srgb, var(--info) 60%, white); filter: drop-shadow(0 0 6px var(--info)); }
@media (prefers-reduced-motion: reduce) { .pane { transition: none; } }
/* the grid layer sits behind body: body itself must be see-through, html keeps the colour */
body { background: transparent; }
.btn.settings-link { justify-content: flex-start; gap: 12px; }
.btn.settings-link .gear { width: 22px; height: 22px; flex: none; color: color-mix(in srgb, var(--info) 60%, white); filter: drop-shadow(0 0 6px var(--info)); }
.btn.settings-link .settings-text { flex: 1; text-align: left; }

/* Main screen fills the phone: the stove/temperature panel takes all free height, the buttons sit at the bottom. */
.pane-main { min-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom))); }
.pane-main > .hero { flex: 1; display: flex; flex-direction: column; }
.pane-main > .hero .hero-main { flex: 1; align-content: center; }
.pane-main > .hero .gauge { max-width: 240px; }
.pane-main > .hero .stove-visual { max-width: 190px; }
@media (min-height: 760px) {
  .pane-main > .hero .hero-main { grid-template-columns: 1fr; justify-items: center; gap: 18px; }
  .pane-main > .hero .stove-visual { max-width: 150px; }
  .pane-main > .hero .gauge { max-width: 250px; }
  .pane-main > .hero .hero-side { width: 100%; }
}
/* the number scales with the ring */
.gauge { container-type: inline-size; }
.g-value span { font-size: 30cqi; }
.g-value small { font-size: 9cqi; margin-top: 3cqi; }
.g-label { font-size: max(13px, 6.5cqi); }
.g-knob { fill: var(--c) !important; }

/* ---- livelier fire (Bruno, 2026-11-18): irregular flicker, sway, detaching tongues, flying sparks ---- */
.stove-visual .sv-tongues, .stove-visual .sv-sparks { opacity: 0; }
.stove-visual .tongue { transform-box: fill-box; transform-origin: 50% 100%; }
.stove-visual.burning .sv-tongues, .stove-visual.burning .sv-sparks { opacity: 1; }
.stove-visual.burning .sv-flames { animation: sway 3.1s ease-in-out infinite; transform-origin: 100px 130px; }
.stove-visual.burning .f-outer { animation: lick-a 1.05s ease-in-out infinite; }
.stove-visual.burning .f-left  { animation: lick-b .83s ease-in-out infinite .15s; }
.stove-visual.burning .f-right { animation: lick-b .97s ease-in-out infinite .4s; }
.stove-visual.burning .f-mid   { animation: lick-c .71s ease-in-out infinite .05s; }
.stove-visual.burning .f-core  { animation: lick-c .53s ease-in-out infinite .2s; }
.stove-visual.burning .t1 { animation: tongue 1.3s ease-out infinite; }
.stove-visual.burning .t2 { animation: tongue 1.1s ease-out infinite .45s; }
.stove-visual.burning .t3 { animation: tongue 1.5s ease-out infinite .8s; }
.stove-visual.burning .sv-glow { animation: flare 1.7s ease-in-out infinite; }
.stove-visual.burning .sv-bed ellipse { animation: ember 1.9s ease-in-out infinite; }
.stove-visual.burning .sv-bed ellipse:nth-child(odd) { animation-duration: 2.6s; animation-delay: .4s; }

.stove-visual .sv-sparks circle { fill: #ffd27a; filter: drop-shadow(0 0 2px #ff9a2a) drop-shadow(0 0 4px #ff6a00); opacity: 0; }
.stove-visual.burning .sv-sparks circle { animation: spark var(--d) cubic-bezier(.2, .6, .4, 1) infinite var(--delay); }
/* igniting: a few sparks, no tongues */
.stove-visual.igniting .sv-sparks { opacity: 1; }
.stove-visual.igniting .sv-sparks circle:nth-child(-n+6) { animation: spark var(--d) ease-out infinite var(--delay); }

@keyframes sway { 0%,100% { transform: skewX(0) translateX(0); } 30% { transform: skewX(-3deg) translateX(-1.5px); } 65% { transform: skewX(2.5deg) translateX(1.5px); } }
@keyframes lick-a {
  0%,100% { transform: scale(1, 1) skewX(0); } 18% { transform: scale(.94, 1.12) skewX(-3deg); }
  37% { transform: scale(1.05, .9) skewX(2deg); } 55% { transform: scale(.97, 1.08) skewX(-1deg); } 78% { transform: scale(1.03, .94) skewX(3deg); } }
@keyframes lick-b {
  0%,100% { transform: scale(1, 1) rotate(0); } 25% { transform: scale(.88, 1.18) rotate(-5deg); }
  50% { transform: scale(1.06, .86) rotate(3deg); } 75% { transform: scale(.94, 1.1) rotate(-2deg); } }
@keyframes lick-c { 0%,100% { transform: scale(1, 1); } 30% { transform: scale(.88, 1.16); } 60% { transform: scale(1.06, .9); } }
@keyframes tongue {
  0% { transform: translateY(6px) scale(.5); opacity: 0; } 20% { opacity: 1; }
  100% { transform: translateY(-46px) scale(.15, .6); opacity: 0; } }
@keyframes flare { 0%,100% { opacity: .8; } 23% { opacity: 1; } 41% { opacity: .7; } 67% { opacity: .95; } }
@keyframes ember { 0%,100% { fill: #ff7a1a; } 50% { fill: #ffb14a; } }
@keyframes spark {
  0% { transform: translate(0, 0); opacity: 0; } 8% { opacity: 1; }
  70% { opacity: .9; } 100% { transform: translate(var(--dx), var(--h)); opacity: 0; } }
.stove-visual .sv-sparks circle { fill: #ffe29a; filter: drop-shadow(0 0 3px #ffa02a) drop-shadow(0 0 6px #ff6a00); }
.pane-main > .hero .stove-visual { max-width: 170px; }

.hero-head { flex-direction: column; align-items: center; gap: 6px; }
.run-time { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.run-time b { color: var(--fire-2); font-weight: 700; text-shadow: 0 0 10px rgba(255, 200, 87, .55); }

/* Main screen fits exactly in the viewport, no scroll: fixed height, the hero shrinks its picture and ring to fit. */
.pane-main { height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom))); min-height: 0; }
.pane-main > * { flex: none; }
.pane-main > .hero { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.pane-main > .hero .hero-main { min-height: 0; }
.pane-main > .hero .stove-visual { max-width: min(150px, 15dvh); }
.pane-main > .hero .gauge { max-width: min(250px, 28dvh); }
@media (max-height: 759.98px) {
  .pane-main > .hero .stove-visual { max-width: min(170px, 22dvh); }
  .pane-main > .hero .gauge { max-width: min(240px, 30dvh); }
}
.pane-main .target { margin-top: 10px; }

/* command outcome + confirm dialog */
.banner.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 60%, transparent); background: rgba(79, 227, 176, .10); box-shadow: 0 0 16px rgba(79, 227, 176, .25); }
.banner.ok .muted { color: var(--muted); }
.banner .grow { flex: 1; }
.banner-btn { border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 10px; padding: 6px 14px; font-weight: 700; }
.confirm-backdrop {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px;
  background: rgba(3, 8, 30, .55); -webkit-backdrop-filter: blur(6px) grayscale(.6); backdrop-filter: blur(6px) grayscale(.6);
  animation: wp-fade-in .2s ease;
}
.confirm-box {
  width: min(22rem, 100%); text-align: center; padding: 26px 22px 20px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(30, 60, 150, .97), rgba(8, 16, 52, .98)); border: 1px solid var(--ok);
  box-shadow: 0 0 26px color-mix(in srgb, var(--ok) 35%, transparent), 0 18px 48px rgba(0, 0, 0, .5);
  animation: wp-reconnect-in .3s cubic-bezier(.05, .89, .25, 1.02);
}
.confirm-box.danger { border-color: var(--bad); box-shadow: 0 0 26px rgba(255, 92, 122, .4), 0 18px 48px rgba(0, 0, 0, .5); }
.confirm-ico { display: block; width: 44px; height: 44px; margin: 0 auto 8px; color: var(--ok); filter: drop-shadow(0 0 8px var(--ok)); }
.confirm-box.danger .confirm-ico { color: var(--bad); filter: drop-shadow(0 0 8px var(--bad)); }
.confirm-box h3 { margin: 0 0 6px; font-size: 22px; text-transform: uppercase; letter-spacing: .05em; text-shadow: var(--text-glow); }
.confirm-box p { margin: 0 0 18px; font-size: 14px; line-height: 1.4; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; height: 50px; font-size: 16px; text-transform: uppercase; letter-spacing: .06em; }
.btn.solid.off { background: var(--bad); color: #1a0410; text-shadow: none; }
.btn.solid.primary { background: var(--ok); color: #04122E; text-shadow: none; }

/* schedules */
.add-btn { width: 34px; height: 34px; border-radius: 10px; padding: 8px; border: 1px solid var(--ok); background: rgba(79, 227, 176, .12); color: var(--ok); box-shadow: 0 0 10px rgba(79, 227, 176, .3); }
.sched-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.sched-row:first-of-type { border-top: 0; }
.sched-row.disabled .sched-main { opacity: .45; }
.sched-main { flex: 1; display: flex; align-items: center; gap: 14px; background: none; border: 0; padding: 0; text-align: left; min-width: 0; }
.sched-time { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: var(--text-glow); }
.sched-info { display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
.sched-action { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.sched-action.on { color: var(--ok); } .sched-action.off { color: var(--bad); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 15px; background: var(--well); border: 1px solid var(--line); transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + span { background: rgba(79, 227, 176, .2); border-color: var(--ok); box-shadow: 0 0 10px rgba(79, 227, 176, .35); }
.switch input:checked + span::after { left: 23px; background: var(--ok); }
.sched-edit { text-align: left; display: flex; flex-direction: column; gap: 14px; }
.sched-edit h3 { text-align: center; }
.action-seg button.on.off { background: var(--bad); box-shadow: 0 0 14px rgba(255, 92, 122, .5); }
.time-input {
  font: inherit; font-size: 40px; font-weight: 700; text-align: center; color: var(--text); color-scheme: dark;
  background: var(--well); border: 1px solid var(--line); border-radius: 14px; height: 70px; width: 100%; text-shadow: var(--text-glow);
}
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.day { height: 42px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--well); color: var(--muted); font-weight: 700; font-size: 13px; padding: 0; }
.day.on { background: var(--ok); color: #04122E; border-color: transparent; box-shadow: 0 0 10px rgba(79, 227, 176, .45); }
.day-presets { display: flex; gap: 6px; }
.day-presets button { flex: 1; height: 34px; border-radius: 10px; border: 1px solid var(--line-soft); background: transparent; color: var(--muted); font-size: 13px; }
.btn.danger-text { color: var(--bad); border-color: rgba(255, 92, 122, .5); }
.sched-edit .confirm-actions .btn { font-size: 14px; }
.day-presets button { white-space: nowrap; font-size: 12px; padding: 0 4px; }

/* The hero sizes its picture and ring to the room it really has (it shrinks when a notice shows above it), so nothing
   overlaps: tall → stacked, short → side by side. */
.pane-main > .hero { container-type: size; }
@container (min-height: 440px) {
  .hero-main { grid-template-columns: 1fr !important; justify-items: center; gap: 14px; }
  .hero-main .stove-visual { max-width: min(150px, calc((100cqh - 220px) * .42)) !important; }
  .hero-main .gauge { max-width: min(250px, calc((100cqh - 220px) * .58)) !important; }
  .hero-side { width: 100%; }
}
@container (max-height: 439.98px) {
  .hero-main { grid-template-columns: 42% 1fr !important; justify-items: center; }
  .hero-main .stove-visual { max-width: min(170px, calc(100cqh - 210px)) !important; }
  .hero-main .gauge { max-width: min(240px, calc(100cqh - 190px)) !important; }
  .hero-side { width: 100%; }
}

/* on/off in progress: the notice's own background fills left→right over 60 s */
.banner.progress { position: relative; overflow: hidden; padding: 14px 16px; }
.banner.progress::before {
  content: ""; position: absolute; inset: 0; z-index: 0; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, rgba(255, 200, 87, .14), rgba(255, 200, 87, .30));
  box-shadow: inset -2px 0 0 rgba(255, 200, 87, .8);
  animation: cmd-progress 60s linear forwards; animation-delay: var(--elapsed, 0s);
}
.banner.progress > * { position: relative; z-index: 1; }
@keyframes cmd-progress { to { transform: scaleX(1); } }

/* A apagar: over one minute the flame dies down to nothing; sparks and tongues stop first, embers cool after. */
.stove-visual.dying .sv-flames { opacity: 1; transform: none; animation: die-flame 60s linear forwards; animation-delay: var(--die-delay, 0s); transform-origin: 100px 134px; }
.stove-visual.dying .sv-glow { opacity: 1; animation: die-fade 60s linear forwards; animation-delay: var(--die-delay, 0s); }
.stove-visual.dying .sv-sparks, .stove-visual.dying .sv-tongues { opacity: 1; animation: die-fade 25s linear forwards; animation-delay: var(--die-delay, 0s); }
.stove-visual.dying .sv-sparks circle { animation: spark var(--d) cubic-bezier(.2, .6, .4, 1) infinite var(--delay); }
.stove-visual.dying .t1 { animation: tongue 1.6s ease-out infinite; }
.stove-visual.dying .t2 { animation: tongue 1.4s ease-out infinite .5s; }
.stove-visual.dying .f-left, .stove-visual.dying .f-right { opacity: 1; animation: lick-b 1.1s ease-in-out infinite; }
.stove-visual.dying .f-outer, .stove-visual.dying .f-mid { animation: lick-a 1.2s ease-in-out infinite; }
.stove-visual.dying .f-core { animation: lick-c .8s ease-in-out infinite; }
.stove-visual.dying .sv-bed ellipse { animation: die-embers 90s linear forwards; animation-delay: var(--die-delay, 0s); filter: none; }
.stove-visual.dying .sv-smoke { opacity: 0; animation: die-smoke 60s linear forwards; animation-delay: var(--die-delay, 0s); }
@keyframes die-flame {
  0% { transform: none; opacity: 1; }
  70% { transform: translate(0, 18px) scale(.45, .4); opacity: .9; }
  100% { transform: translate(0, 34px) scale(.05, .02); opacity: 0; } }
@keyframes die-fade { to { opacity: 0; } }
@keyframes die-embers { 0% { fill: #ff7a1a; } 60% { fill: #a8401a; } 100% { fill: #3a2f3a; } }
@keyframes die-smoke { 0%, 40% { opacity: 0; } 70%, 100% { opacity: 1; } }

/* A ligar: the flame grows from nothing to full over the expected ignition time (learned from past ignitions). */
.banner.progress::before { animation-duration: var(--dur, 60s); }
.stove-visual.igniting .sv-flames { opacity: 1; transform-origin: 100px 134px; transform: translate(0, 34px) scale(.02);
  animation: ignite var(--ign-dur, 12min) cubic-bezier(.45, 0, .35, 1) forwards; animation-delay: var(--ign-delay, 0s); }
.stove-visual.igniting .sv-glow { animation: ignite-glow var(--ign-dur, 12min) linear forwards; animation-delay: var(--ign-delay, 0s); }
.stove-visual.igniting .f-left, .stove-visual.igniting .f-right { opacity: 1; animation: lick-b 1s ease-in-out infinite; }
.stove-visual.igniting .f-outer, .stove-visual.igniting .f-mid { animation: lick-a 1.1s ease-in-out infinite; }
.stove-visual.igniting .f-core { animation: lick-c .7s ease-in-out infinite; }
.stove-visual.igniting .sv-bed ellipse { filter: none; animation: ignite-embers var(--ign-dur, 12min) linear forwards; animation-delay: var(--ign-delay, 0s); }
.stove-visual.igniting .sv-sparks { opacity: 0; animation: ignite-sparks var(--ign-dur, 12min) linear forwards; animation-delay: var(--ign-delay, 0s); }
.stove-visual.igniting .sv-sparks circle { animation: spark var(--d) cubic-bezier(.2, .6, .4, 1) infinite var(--delay); }
.stove-visual.igniting .sv-tongues { opacity: 0; animation: ignite-sparks var(--ign-dur, 12min) linear forwards; animation-delay: var(--ign-delay, 0s); }
.stove-visual.igniting .t1 { animation: tongue 1.3s ease-out infinite; }
.stove-visual.igniting .t2 { animation: tongue 1.1s ease-out infinite .45s; }
@keyframes ignite {
  0%   { transform: translate(0, 34px) scale(.02); opacity: 0; }
  12%  { transform: translate(0, 33px) scale(.08, .06); opacity: .9; }
  45%  { transform: translate(0, 24px) scale(.3, .28); opacity: 1; }
  80%  { transform: translate(0, 9px) scale(.72, .7); }
  100% { transform: none; opacity: 1; } }
@keyframes ignite-glow { 0%, 10% { opacity: 0; } 100% { opacity: 1; } }
@keyframes ignite-embers { 0% { fill: #3a2f3a; } 15% { fill: #a8401a; } 35%, 100% { fill: #ff7a1a; } }
@keyframes ignite-sparks { 0%, 40% { opacity: 0; } 70%, 100% { opacity: 1; } }
/* growth anchored at the pellet bed (scale only, no drop below the window); tongues only once it's nearly full */
.stove-visual.igniting .sv-flames { transform-origin: 100px 130px; }
@keyframes ignite {
  0%   { transform: scale(.02); opacity: 0; }
  10%  { transform: scale(.1, .08); opacity: .9; }
  40%  { transform: scale(.32, .3); opacity: 1; }
  75%  { transform: scale(.7, .68); }
  100% { transform: none; opacity: 1; } }
.stove-visual.igniting .sv-tongues { animation-name: ignite-tongues; }
@keyframes ignite-tongues { 0%, 85% { opacity: 0; } 100% { opacity: 1; } }

/* iOS draws date/time inputs wider than their box: strip the native look and keep them inside the card */
.time-input, .date-input {
  -webkit-appearance: none; appearance: none; display: block; box-sizing: border-box;
  width: 100%; min-width: 0; max-width: 100%; margin: 0;
}
.time-input::-webkit-date-and-time-value, .date-input::-webkit-date-and-time-value { text-align: center; margin: 0; }
.time-input::-webkit-calendar-picker-indicator, .date-input::-webkit-calendar-picker-indicator { display: none; }
.date-input {
  font: inherit; font-size: 20px; font-weight: 700; text-align: center; color: var(--text); color-scheme: dark;
  background: var(--well); border: 1px solid var(--line); border-radius: 14px; height: 52px;
}
.repeat-seg button { font-size: 13px; height: 40px; }
.sched-edit { overflow: hidden; }

/* next scheduled action (within 24 h) */
.next-action { --c: var(--ok); display: flex; align-items: center; gap: 10px; margin-top: 2px;
  padding: 5px 12px 5px 6px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 8%, transparent); }
.next-action.off { --c: var(--bad); }
.na-ring { position: relative; width: 38px; height: 38px; flex: none; }
.na-ring svg circle { fill: none; stroke-width: 3.5; stroke-linecap: round; }
.na-track { stroke: color-mix(in srgb, var(--c) 18%, transparent); }
.na-fill { stroke: var(--c); filter: drop-shadow(0 0 3px var(--c)); transition: stroke-dasharray .8s ease; }
.na-pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; }
.na-pct small { font-size: 8px; }
.na-text { display: flex; flex-direction: column; line-height: 1.2; font-size: 12px; color: var(--muted); }
.na-text b { color: var(--c); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.na-pct { display: flex; align-items: center; justify-content: center; } .na-pct small { margin-left: 1px; }

/* edit dialog: Cancelar + Guardar side by side, Apagar on its own row below so nothing is cut on a phone */
.sched-edit .confirm-actions { flex-wrap: wrap; }
.sched-edit .confirm-actions .btn { min-width: 0; padding: 0 10px; white-space: nowrap; }
.sched-edit .confirm-actions .danger-text { order: 3; flex: 1 0 100%; height: 42px; background: transparent; }
.confirm-box { max-width: calc(100vw - 32px); }

/* next scheduled action: the badge's own background is the progress (like the ligar/desligar notice) */
.next-action { position: relative; overflow: hidden; padding: 7px 16px; gap: 0; }
.next-action::before {
  content: ""; position: absolute; inset: 0; width: var(--fill, 0%); z-index: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 14%, transparent), color-mix(in srgb, var(--c) 30%, transparent));
  box-shadow: inset -2px 0 0 color-mix(in srgb, var(--c) 80%, transparent);
  transition: width 1s linear;
}
.next-action > b { position: relative; z-index: 1; color: var(--c); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }

/* on/off button carries the progress (ligar / desligar) or the time to a scheduled action */
.btn.big { position: relative; overflow: hidden; }
.btn.big > * { position: relative; z-index: 1; }
.btn.big.progress::before, .btn.big.sched::before {
  content: ""; position: absolute; inset: 0; z-index: 0; transform-origin: left center;
  background: linear-gradient(90deg, color-mix(in srgb, currentColor 10%, transparent), color-mix(in srgb, currentColor 30%, transparent));
  box-shadow: inset -2px 0 0 currentColor;
}
.btn.big.progress::before { transform: scaleX(0); animation: cmd-progress var(--dur, 60s) linear forwards; animation-delay: var(--elapsed, 0s); }
.btn.big.progress { cursor: default; }
.btn.big.sched::before { width: var(--fill, 0%); transition: width 1s linear; }
.btn-time { font-size: .8em; opacity: .85; letter-spacing: .04em; padding-left: 12px; border-left: 2px solid color-mix(in srgb, currentColor 40%, transparent); }
/* time burning, under the flame */
.visual-col { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.visual-col .run-time { font-size: 15px; font-weight: 700; color: var(--fire-2); text-shadow: 0 0 10px rgba(255, 200, 87, .55); font-variant-numeric: tabular-nums; }

/* bigger flame window now that the head is just the state chip (Bruno, 2026-11-19) */
@container (min-height: 440px) {
  .hero-main { gap: 8px; align-content: space-evenly; }
  .hero-main .stove-visual { max-width: min(230px, calc((100cqh - 230px) * .55)) !important; }
  .hero-main .gauge { max-width: min(250px, calc((100cqh - 230px) * .5)) !important; }
}
@container (max-height: 439.98px) {
  .hero-main .stove-visual { max-width: min(200px, calc(100cqh - 190px)) !important; }
}
.hero-head { margin-bottom: 2px; }
@container (min-height: 440px) {
  .hero-main { gap: 6px; align-content: center; }
  .hero-main .stove-visual { max-width: min(240px, calc((100cqh - 210px) * .6)) !important; }
  .hero-main .gauge { max-width: min(250px, calc((100cqh - 210px) * .54)) !important; }
}

/* while lighting up or switching off: neutral colours, no reaction to taps (Bruno, 2026-11-19) */
.btn.big.neutral { color: var(--text); border-color: var(--line); background: rgba(48, 88, 200, .18);
  box-shadow: 0 0 12px var(--glow); text-shadow: var(--text-glow); pointer-events: none; }
.btn.big.neutral::before { background: linear-gradient(90deg, rgba(140, 185, 255, .10), rgba(140, 185, 255, .28)); box-shadow: inset -2px 0 0 rgba(160, 200, 255, .8); }

/* floating notices: over the page, never moving it; fade out by themselves (tap to close sooner) */
.toast {
  position: fixed; z-index: 1500; left: 50%; top: calc(max(16px, env(safe-area-inset-top)) + 54px);
  width: min(420px, calc(100vw - 32px)); transform: translateX(-50%);
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.35;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); cursor: pointer;
  animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.1), toast-out .5s ease-in 7.5s forwards;
}
.toast .ico { width: 22px; height: 22px; flex: none; }
.toast .grow { flex: 1; }
.toast.danger { color: var(--bad); background: rgba(40, 8, 24, .88); border: 1px solid color-mix(in srgb, var(--bad) 70%, transparent); box-shadow: 0 0 22px rgba(255, 92, 122, .35), 0 12px 30px rgba(0, 0, 0, .45); }
.toast.danger .grow, .toast.danger div { color: var(--text); }
.toast.danger strong { color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -14px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -10px); visibility: hidden; } }

/* No zoom gestures anywhere; the main screen never scrolls — only the Configurações panel scrolls, inside itself. */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html:has(.slider), html:has(.slider) body { overflow: hidden; height: 100%; overscroll-behavior: none; }
.slider { height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom))); }
.pane-settings { height: 100%; max-height: none !important; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.slider:not(.show-settings) .pane-settings { overflow: hidden; }
.pane-main { overflow: hidden; }

/* Configurações: fixed header, compact cards so everything fits on one screen */
.pane-settings > .top { position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: 4px 16px 8px;
  background: linear-gradient(var(--bg) 70%, transparent); }
.pane-settings { gap: 10px; }
.pane-settings .card { padding: 12px 14px; }
.pane-settings .row-head { margin-bottom: 8px; }
.pane-settings .seg button { height: 40px; }
.pane-settings .level.compact .seg button { height: 34px; }
.pane-settings .fans { gap: 10px; }
.pane-settings .stats { padding: 8px 6px; }
.pane-settings .stat .v { font-size: 17px; }
.pane-settings .notif .row-head, .pane-settings .sched .row-head { margin-bottom: 0; align-items: center; }
.pane-settings .notif .btn.wide, .pane-settings .notif-actions .btn { height: 40px; font-size: 14px; }
.pane-settings .notif-actions { margin-top: 8px; }
.pane-settings .notif .btn.wide { margin-top: 8px; }
.pane-settings .small { margin-top: 4px; }
.sched-row { padding: 6px 0; }
.sched-time { font-size: 26px; }
.add-btn { width: 44px; height: 44px; border-radius: 12px; padding: 10px; }
.toast.warn { color: var(--warn); background: rgba(40, 28, 6, .9); border: 1px solid color-mix(in srgb, var(--warn) 70%, transparent); box-shadow: 0 0 22px rgba(255, 200, 87, .3), 0 12px 30px rgba(0, 0, 0, .45); animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.1), toast-out .5s ease-in 11.5s forwards; }
.toast.warn div { color: var(--text); } .toast.warn strong { color: var(--warn); }
