/* Hala Control: stil iOS, culorile Mondo (mondo-byte.ro). Gandit intai pentru telefon.
   Tema: Automat (dupa telefon) sau aleasa din profil (data-theme pe <html>). */
:root {
  --bg: #faf7f4;            /* fundal cald Mondo */
  --cell: #ffffff;          /* blocuri */
  --cell-2: #f3efeb;        /* campuri, butoane secundare */
  --text: #1d2129;
  --muted: #6f747e;
  --sep: rgba(29, 33, 41, .12);
  --tint: #e8611a;          /* portocaliu Mondo, cu contrast pe alb */
  --tint-text: #c4550f;     /* portocaliu pentru text pe fundal deschis */
  --on-tint: #ffffff;
  --tint-soft: #ffe9db;
  --grad: linear-gradient(135deg, #ff9b40 0%, #ff7940 45%, #f26b1d 100%);
  --ok: #2ba44e;
  --ok-soft: #e1f4e6;
  --warn: #c77700;
  --warn-soft: #fff1d6;
  --danger: #e5352b;
  --danger-soft: #fde3e1;
  --heat: #ff7940;
  --go: #1f8f45;            /* Deschide (verde) */
  --on-go: #ffffff;
  --slate: #3a404b;         /* Inchide (ardezie Mondo) */
  --slate-soft: #e6e8ec;
  --heat-soft: #ffe9db;
  --glass: rgba(250, 247, 244, .78);
  --shadow: 0 1px 2px rgba(29, 33, 41, .04), 0 6px 20px -8px rgba(29, 33, 41, .10);
  --radius: 20px;
  --radius-sm: 12px;
  --tabbar: 56px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --spring: cubic-bezier(.32, .72, 0, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171c; --cell: #1d2129; --cell-2: #252a33; --text: #f3f4f6; --muted: #9aa1ad; --sep: rgba(255, 255, 255, .09);
    --tint: #ff8a40; --tint-text: #ff9b40; --on-tint: #1d2129; --tint-soft: #3a2a1f;
    --ok: #32d74b; --ok-soft: #173426; --warn: #ffb340; --warn-soft: #3a2e14; --danger: #ff6159; --danger-soft: #42201d;
    --heat: #ff9b40; --heat-soft: #3a2a1f; --go: #32d74b; --on-go: #10261a; --slate: #5b6270; --slate-soft: #2c313a; --glass: rgba(20, 23, 28, .78);
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171c; --cell: #1d2129; --cell-2: #252a33; --text: #f3f4f6; --muted: #9aa1ad; --sep: rgba(255, 255, 255, .09);
  --tint: #ff8a40; --tint-text: #ff9b40; --on-tint: #1d2129; --tint-soft: #3a2a1f;
  --ok: #32d74b; --ok-soft: #173426; --warn: #ffb340; --warn-soft: #3a2e14; --danger: #ff6159; --danger-soft: #42201d;
  --heat: #ff9b40; --heat-soft: #3a2a1f; --go: #32d74b; --on-go: #10261a; --slate: #5b6270; --slate-soft: #2c313a; --glass: rgba(20, 23, 28, .78);
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 17px/1.35 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
@supports (font: -apple-system-body) { body { font: -apple-system-body; font-family: var(--font); } }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-user-select: none; user-select: none; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono, .num { font-variant-numeric: tabular-nums; }
.app { min-height: 100vh; display: flex; flex-direction: column; }
.splash { flex: 1; min-height: 100vh; display: grid; place-items: center; }
.splash img { border-radius: 18px; animation: pop .6s var(--spring) both; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

/* ---------- bare de navigare ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
  min-height: calc(env(safe-area-inset-top, 0px) + 50px);
  background: transparent; transition: background .2s, border-color .2s;
  border-bottom: .5px solid transparent;
}
.nav.scrolled { background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom-color: var(--sep); }
.nav .title { font-weight: 600; font-size: 1rem; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.nav.scrolled .title { opacity: 1; transform: none; }
.nav .left { justify-self: start; display: flex; align-items: center; }
.nav .right { justify-self: end; display: flex; align-items: center; gap: 8px; }
.navbtn { min-height: 44px; min-width: 44px; padding: 0 6px; border: 0; background: none; color: var(--tint-text); font-size: 1rem; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.navbtn.strong { font-weight: 600; }
.navbtn svg { width: 22px; height: 22px; }
.navbtn:disabled { color: var(--muted); opacity: .5; }

.largetitle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 10px; }
.largetitle h1 { font-size: 2.05rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.largetitle .right { display: flex; align-items: center; gap: 8px; flex: none; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 0; flex: none; cursor: pointer;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .02em;
  background: var(--grad);
}
.avatar.lg { width: 64px; height: 64px; font-size: 1.35rem; }
.avatar.md { width: 40px; height: 40px; font-size: .85rem; }

.testpill { border: 0; cursor: pointer; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }

/* ---------- continut ---------- */
.content {
  flex: 1; width: 100%; max-width: 680px; margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 28px) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 22px;
}
.content.noTabs { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px); }
.view-enter { animation: viewIn .38s var(--spring) both; }
.view-back { animation: viewBack .38s var(--spring) both; }
.tab-enter { animation: fadeIn .25s ease both; }
@keyframes viewIn { from { transform: translateX(28%); opacity: 0; } }
@keyframes viewBack { from { transform: translateX(-20%); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- bara de taburi ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  display: flex; justify-content: center;
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep);
}
.tabbar button {
  flex: 1; max-width: 140px; height: var(--tabbar); border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .66rem; font-weight: 600; letter-spacing: .01em;
}
.tabbar svg { width: 26px; height: 26px; transition: transform .25s var(--spring); }
.tabbar button[aria-selected="true"] { color: var(--tint-text); }
.tabbar button:active svg { transform: scale(.88); }

/* ---------- sectiuni si liste grupate (stil Setari) ---------- */
.section { display: flex; flex-direction: column; gap: 7px; }
.section > .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 0 16px; }
.section > .foot { font-size: .8rem; color: var(--muted); padding: 0 16px; line-height: 1.4; }
.group { background: var(--cell); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cell {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 10px 16px; width: 100%; border: 0; background: none; text-align: left; color: inherit;
}
button.cell, a.cell { cursor: pointer; text-decoration: none; }
button.cell:active, a.cell:active { background: var(--cell-2); }
.cell + .cell::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.cell.ico + .cell::before, .cell + .cell.ico::before { left: 60px; }
.cell .grow { flex: 1; min-width: 0; }
.cell .t { overflow-wrap: anywhere; }
.cell .s { font-size: .8rem; color: var(--muted); margin-top: 1px; overflow-wrap: anywhere; }
.cell .v { color: var(--muted); font-size: .95rem; text-align: right; }
.cell .chev { color: var(--muted); opacity: .55; flex: none; width: 10px; height: 16px; }
.cell.danger { color: var(--danger); justify-content: center; font-weight: 500; }
.cell.action { color: var(--tint-text); font-weight: 500; }
.cell input[type=text], .cell input:not([type]), .cell select {
  border: 0; background: none; min-height: 28px; padding: 0; text-align: right; color: var(--muted); max-width: 60%; font-size: 1rem;
}
.cell input[type=text]:focus { color: var(--text); outline: none; }
.cell select { appearance: none; -webkit-appearance: none; cursor: pointer; text-align-last: right; }
.ibox { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; background: var(--muted); }
.ibox svg { width: 18px; height: 18px; }

/* comutator iOS (pe checkbox) */
input.switch {
  appearance: none; -webkit-appearance: none; flex: none; cursor: pointer; margin: 0;
  width: 51px; height: 31px; border-radius: 16px; background: var(--cell-2); position: relative;
  transition: background .25s; box-shadow: inset 0 0 0 1px var(--sep);
}
input.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 0 1px rgba(0, 0, 0, .2); transition: transform .28s var(--spring);
}
input.switch:checked { background: var(--ok); box-shadow: none; }
input.switch:checked::after { transform: translateX(20px); }
input.switch:disabled { opacity: .45; cursor: default; }

/* ---------- butoane ---------- */
.btn {
  min-height: 50px; padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--cell); color: var(--text); font-weight: 600; font-size: 1.02rem; box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative;
  transition: transform .15s var(--spring), opacity .2s, background .2s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--tint); color: var(--on-tint); box-shadow: 0 8px 20px -10px var(--tint); }
.btn.tinted { background: var(--tint-soft); color: var(--tint-text); box-shadow: none; }
.btn.danger { background: var(--danger); color: #fff; box-shadow: 0 8px 20px -10px var(--danger); }
.btn.dangersoft { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn.block { width: 100%; }
.btn.big { min-height: 58px; font-size: 1.08rem; border-radius: 16px; }
.btn.capsule { border-radius: 999px; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: .88rem; border-radius: 999px; box-shadow: none; }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.btn .lbl { transition: opacity .15s; }
.btn.busy .lbl, .btn.done .lbl { opacity: 0; }
.btn.busy::after, .btn.done::after { content: ""; position: absolute; }
.btn.busy::after { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.done::after { width: 12px; height: 22px; border: solid currentColor; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-2px, -2px); animation: pop .35s var(--spring) both; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reason { font-size: .82rem; color: var(--muted); text-align: center; }
.reason.bad { color: var(--danger); }

.segmented { display: flex; background: var(--cell-2); border-radius: 11px; padding: 3px; gap: 2px; }
.segmented button { flex: 1; min-height: 36px; border: 0; border-radius: 9px; background: none; font-weight: 500; font-size: .9rem; cursor: pointer; color: var(--text); transition: background .2s; }
.segmented button[aria-pressed="true"] { background: var(--cell); font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .segmented button[aria-pressed="true"] { background: #3a404b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button[aria-pressed="true"] { background: #3a404b; } }

/* ---------- elemente de stare ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--cell); color: var(--muted); box-shadow: var(--shadow); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); }
.pill.bad { color: var(--danger); }
.pill.warn { color: var(--warn); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--cell-2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.accent { background: var(--tint-soft); color: var(--tint-text); }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--cell); box-shadow: var(--shadow); font-size: .92rem; }
.banner .ibox { width: 34px; height: 34px; }
.banner.warn .ibox { background: var(--warn); }
.banner.bad .ibox { background: var(--danger); }
.banner.ok .ibox { background: var(--ok); }
.banner b { display: block; font-weight: 600; }
.banner .s { color: var(--muted); font-size: .82rem; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { width: 44px; height: 44px; opacity: .5; }
.empty b { color: var(--text); font-size: 1.05rem; }

/* scheleti la incarcare */
.skel { background: linear-gradient(90deg, var(--cell) 0%, var(--cell-2) 50%, var(--cell) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- foaie (bottom sheet) ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .32); display: flex; align-items: flex-end; justify-content: center; animation: dimIn .25s ease both; }
.sheet-back.closing { animation: dimOut .22s ease both; }
@keyframes dimIn { from { background: rgba(0, 0, 0, 0); } }
@keyframes dimOut { to { background: rgba(0, 0, 0, 0); } }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 20px) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 16px;
  animation: sheetIn .42s var(--spring) both; touch-action: pan-y;
}
.sheet-back.closing .sheet { animation: sheetOut .25s ease-in both; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--sep); align-self: center; flex: none; cursor: grab; }
.sheet .head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.sheet .head h2 { font-size: 1.05rem; font-weight: 600; text-align: center; }
.sheet .head .navbtn:last-child { justify-self: end; }

/* ---------- toast (banner sus) ---------- */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 10px); z-index: 40;
  transform: translateX(-50%); max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); font-weight: 600; font-size: .92rem;
  animation: toastIn .45s var(--spring) both;
}
.toast::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.toast.bad::before { background: var(--danger); }
@keyframes toastIn { from { transform: translate(-50%, -140%); } }

/* ---------- formulare simple ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); }
.input { min-height: 50px; width: 100%; padding: 0 16px; border-radius: 14px; border: 0; background: var(--cell); box-shadow: var(--shadow); font-size: 1.05rem; color: var(--text); }
.input:focus { outline: 2px solid var(--tint); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: inline-flex; position: relative; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { min-width: 38px; height: 34px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--cell-2); font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.days input:checked + span { background: var(--tint); color: var(--on-tint); }
.days input:focus-visible + span { outline: 2px solid var(--tint); outline-offset: 2px; }
.times { display: flex; gap: 10px; align-items: center; }
.times input { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: var(--cell-2); padding: 0 10px; font-size: 1rem; }
.sched { display: flex; flex-direction: column; gap: 10px; padding: 4px 16px 14px 16px; }

:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

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

/* ================= ecrane ================= */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.center { text-align: center; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; min-height: 28px; }
.pill svg { width: 15px; height: 15px; }
.skel-pill { color: transparent; width: 110px; }
.ibox.tint { background: var(--grad); }
.ibox.heat { background: var(--heat); }
.ibox.sm { width: 30px; height: 30px; border-radius: 50%; background: var(--cell-2); color: var(--muted); }
.ibox.sm svg { width: 16px; height: 16px; }
.ibox.sm.heat { background: var(--heat-soft); color: var(--heat); }
.banner.heat .ibox { background: var(--heat); }
.banner .s2 { font-size: .88rem; }
.checkmark { color: var(--tint-text); width: 20px; height: 20px; flex: none; }
.checkmark svg { width: 20px; height: 20px; }
.linkbtn { border: 0; background: none; color: var(--tint-text); font-size: .85rem; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; min-height: 32px; }
.linkbtn svg { width: 16px; height: 16px; }

/* erou (poarta, usa) */
.hero { background: var(--cell); border-radius: 26px; box-shadow: var(--shadow); padding: 26px 20px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; min-height: 250px; }
.hero.skel { box-shadow: none; }
.ring { width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; position: relative; margin-bottom: 8px; color: var(--muted); background: radial-gradient(circle at 50% 38%, var(--cell-2), transparent 72%); }
.ring svg { width: 60px; height: 60px; position: relative; z-index: 1; }
.ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid currentColor; opacity: .9; }
.ring.closed { color: var(--ok); background: radial-gradient(circle at 50% 38%, var(--ok-soft), transparent 72%); }
.ring.open, .ring.stopped { color: var(--tint); background: radial-gradient(circle at 50% 38%, var(--tint-soft), transparent 72%); }
.ring.moving::after { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.09); opacity: .25; } }
.hero-state { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.hero-sub { color: var(--muted); font-size: .92rem; max-width: 32ch; }
.hero-info { color: var(--muted); font-size: .85rem; max-width: 40ch; background: var(--cell-2); border-radius: 14px; padding: 10px 12px; margin-top: 4px; animation: fadeIn .25s ease both; }
.hero .empty { padding: 20px 0; }
.stopbtn { min-height: 62px; font-size: 1.15rem; letter-spacing: .12em; font-weight: 700; }
.btn.counting { opacity: 1; background: var(--go); color: var(--on-go); box-shadow: none; }
.btn.counting svg { animation: none; }

/* dale incalzire (ca in aplicatia Locuinta) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.tile {
  background: var(--cell); border: 0; border-radius: 22px; box-shadow: var(--shadow); padding: 14px 14px 13px; min-height: 132px;
  display: flex; flex-direction: column; gap: 4px; text-align: left; color: var(--text); cursor: default;
  transition: transform .15s var(--spring);
}
button.tile { cursor: pointer; }
button.tile:active { transform: scale(.96); }
.tile.skel { box-shadow: none; }
.tile-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile-name { font-weight: 600; font-size: .98rem; min-width: 0; overflow-wrap: anywhere; }
.tile-temp { font-size: 2.3rem; font-weight: 600; letter-spacing: -.03em; line-height: 1; margin-top: auto; }
.tile-temp small { font-size: 1.1rem; color: var(--muted); font-weight: 500; vertical-align: top; margin-left: 1px; }
.tile-sub { font-size: .8rem; color: var(--muted); }
.tile-hum { font-size: .72rem; color: var(--muted); opacity: .8; }
.tile.heating .tile-sub { color: var(--heat); font-weight: 600; }
.tile.pending .tile-sub { color: var(--tint-text); animation: pulse 1.2s ease-in-out infinite; }
.tile.off { opacity: .55; }
.tile.stale .tile-temp { opacity: .5; }
@keyframes pulse { 50% { opacity: .35; } }

/* roata tintei */
.dial-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dial { position: relative; width: min(78vw, 280px); aspect-ratio: 1; max-width: 100%; }
.dial-svg { width: 100%; height: 100%; touch-action: none; cursor: pointer; display: block; }
.dial-track { fill: none; stroke: var(--cell-2); stroke-width: 16; stroke-linecap: round; }
.dial-fill { fill: none; stroke: var(--heat); stroke-width: 16; stroke-linecap: round; }
.dial-knob { fill: #fff; stroke: var(--heat); stroke-width: 3.5; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); }
.dial-now { fill: var(--text); opacity: .55; }
.dial-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.dial-lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.dial-val { font-size: 3.6rem; font-weight: 300; letter-spacing: -.04em; line-height: 1.05; }
.dial-now-lbl { font-size: .85rem; color: var(--muted); }
.dial-steps { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 320px; gap: 12px; }
.round { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--cell); box-shadow: var(--shadow); font-size: 1.8rem; font-weight: 400; cursor: pointer; display: grid; place-items: center; transition: transform .15s var(--spring); }
.round:active { transform: scale(.9); }

/* profil */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding-top: 4px; }
.profile-head h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }

/* autorizare */
.enroll {
  flex: 1; width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 26px;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 28px) max(20px, env(safe-area-inset-left, 0px));
  animation: fadeIn .4s ease both;
}
.enroll-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.enroll-head h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.enroll-icon { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 14px 30px -12px rgba(242, 107, 29, .6); animation: pop .6s var(--spring) both; }
.enroll-face { width: 84px; height: 84px; border-radius: 22px; display: grid; place-items: center; color: var(--tint-text); background: var(--tint-soft); }
.enroll-face svg { width: 48px; height: 48px; animation: pulse 1.6s ease-in-out infinite; }
.enroll-form { display: flex; flex-direction: column; gap: 12px; }
.steps { display: flex; gap: 6px; justify-content: center; }
.steps i { width: 26px; height: 4px; border-radius: 2px; background: var(--sep); transition: background .3s; }
.steps i.on { background: var(--tint); }
.otp { position: relative; display: flex; justify-content: center; gap: 8px; cursor: text; }
.otp-box { width: 46px; height: 58px; border-radius: 14px; background: var(--cell); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; transition: box-shadow .15s; }
.otp-box.full { animation: pop .2s var(--spring) both; }
.otp-box.cur { box-shadow: 0 0 0 2px var(--tint); }
.otp-gap { width: 8px; }
.otp-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; color: transparent; caret-color: transparent; background: transparent; }
@media (max-width: 360px) { .otp-box { width: 40px; height: 52px; } }

/* administrare */
.searchbar { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: 12px; background: var(--cell-2); color: var(--muted); }
.searchbar input { flex: 1; border: 0; background: none; min-height: 36px; font-size: 1rem; color: var(--text); outline: none; min-width: 0; }
.searchbar svg { width: 18px; height: 18px; flex: none; }
.user-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.user-head h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; }
.pincard { background: var(--cell); box-shadow: var(--shadow); border-radius: var(--radius); padding: 22px 16px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; animation: pop .45s var(--spring) both; }
.pinring { position: relative; width: 210px; max-width: 100%; aspect-ratio: 1; }
.pinring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pinring .trk { fill: none; stroke: var(--cell-2); stroke-width: 8; }
.pinring .prg { fill: none; stroke: var(--tint); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.pinring .in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.pindigits { font-size: 2.3rem; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--text); }
.pinleft { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.logcell .s.detail { white-space: pre-wrap; }
.ibox.c-ok { background: var(--ok); } .ibox.c-bad { background: var(--danger); } .ibox.c-tint { background: var(--grad); }
.ibox.c-heat { background: var(--heat); } .ibox.c-gray { background: #8e8e93; } .ibox.c-blue { background: #2f7cf6; } .ibox.c-purple { background: #8e5cf6; }
.morebtn { align-self: center; }
.cell.sub { padding-left: 32px; min-height: 42px; }
.sched + .cell::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.sched { padding-left: 32px; }
.cell .s.bad { color: var(--danger); }
.cell.skel { min-height: 58px; border-radius: 0; }
.cell.skel + .cell.skel::before { display: none; }
.ibox.lgbox { width: 64px; height: 64px; border-radius: 18px; }
.ibox.lgbox svg { width: 34px; height: 34px; }
.cell select option { color: #1d2129; }
.input[type=search], select.input { appearance: none; -webkit-appearance: none; }
/* animatiile laterale nu au voie sa lateasca pagina (pe telefon ar produce zoom) */
.app { overflow-x: clip; }
.sheet .head > div:last-child { justify-self: end; }
.sheet .head > div:first-child { justify-self: start; }
.content > div:empty { display: none; }
.tile > * { width: 100%; }
.navbtn { text-decoration: none; }

/* ================= rand de status (poarta, usa) ================= */
.statusrow { display: flex; align-items: center; gap: 14px; background: var(--cell); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; min-height: 64px; }
.statusrow.skel { box-shadow: none; }
.statusrow .st { font-size: 1rem; }
.statusrow .st b { font-weight: 700; }
.statusrow .st b.on { color: var(--ok); }
.statusrow .st b.off { color: var(--danger); }
.statusrow .s { font-size: .8rem; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.wifi { display: flex; flex-direction: column; align-items: center; gap: 1px; flex: none; min-width: 64px; }
.wifi svg { width: 30px; height: 30px; }
.wifi path { fill: none; stroke: var(--sep); stroke-width: 2.4; stroke-linecap: round; }
.wifi circle.dot { fill: var(--sep); }
.wifi .on { stroke: var(--ok); }
.wifi circle.on { fill: var(--ok); stroke: none; }
.wifi.lvl2 .on { stroke: var(--warn); } .wifi.lvl2 circle.on { fill: var(--warn); }
.wifi.lvl1 .on { stroke: var(--danger); } .wifi.lvl1 circle.on { fill: var(--danger); }
.wifi span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.netbadge { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.netbadge svg { width: 24px; height: 24px; }
.netbadge.on { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok); }
.netbadge.off { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 2px var(--danger); }

/* ================= flacara centralei ================= */
.flame { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--cell-2); }
.flame svg { width: 26px; height: 26px; overflow: visible; }
.flame.burning { background: var(--heat-soft); }
.flame .fl-outer { fill: var(--heat); transform-origin: 12px 21px; animation: flick 1.6s ease-in-out infinite; }
.flame .fl-inner { fill: #ffd236; transform-origin: 12px 19px; animation: flick2 1.1s ease-in-out infinite; }
.flame .fl-off { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linejoin: round; }
.flame .fl-cut-bg { stroke: var(--cell-2); stroke-width: 5; stroke-linecap: round; }
.flame .fl-cut { stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
@keyframes flick {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  25% { transform: scale(.97, 1.05) rotate(-2deg); }
  50% { transform: scale(1.02, .96) rotate(1.5deg); }
  75% { transform: scale(.98, 1.04) rotate(-1deg); }
}
@keyframes flick2 {
  0%, 100% { transform: scale(1, 1); opacity: 1; }
  40% { transform: scale(.9, 1.12); opacity: .85; }
  70% { transform: scale(1.06, .92); opacity: 1; }
}

/* ================= regula unica pentru campuri =================
   Toate campurile de text, cautare, ora, numar si selectiile arata la fel:
   fara chenar, colturi rotunjite, fundal din tema, text de 17 px (iOS nu mai face zoom),
   cursor si focus in portocaliul aplicatiei. In liste (.cell) devin campuri „inline”. */
input[type=text], input[type=search], input[type=time], input[type=date], input[type=number], input[type=password], input[type=email], input[type=tel], input:not([type]), select, textarea {
  -webkit-appearance: none; appearance: none;
  font: inherit; font-size: 17px; color: var(--text);
  background-color: var(--cell-2); border: 0; border-radius: 12px; box-shadow: none;
  min-height: 46px; padding: 0 14px; width: 100%;
  caret-color: var(--tint); accent-color: var(--tint);
  transition: box-shadow .15s, background-color .15s;
}
textarea { padding: 12px 14px; min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 2px var(--tint); }
select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238a909a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
select option { color: initial; background: initial; }
input[type=time] { font-variant-numeric: tabular-nums; text-align: center; }
input[type=time]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }
input[type=search]::-webkit-search-cancel-button {
  -webkit-appearance: none; width: 18px; height: 18px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='9' fill='%238a909a'/%3E%3Cpath d='M7 7l6 6M13 7l-6 6' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* pe fundalul paginii (inrolare, foi): bloc alb cu umbra, ca restul listelor */
.input, .sheet input[type=text], .sheet select { background-color: var(--cell); box-shadow: var(--shadow); min-height: 50px; padding-left: 16px; }
.input:focus, .sheet input[type=text]:focus, .sheet select:focus { box-shadow: 0 0 0 2px var(--tint); }
/* in liste: inline, aliniat la dreapta, fara fundal; sageata o da randul (chev) */
.cell input[type=text], .cell input:not([type]), .cell select {
  background: none; box-shadow: none; min-height: 30px; padding: 0; width: auto; max-width: 62%;
  text-align: right; text-align-last: right; color: var(--muted); border-radius: 6px;
}
.cell input[type=text]:focus, .cell select:focus { color: var(--text); box-shadow: none; }
.cell select { background-image: none; padding-right: 0; }
/* cautare: camp in bara cu lupa */
.searchbar input[type=search] { background: none; min-height: 38px; padding: 0; box-shadow: none; }
.searchbar:focus-within { box-shadow: 0 0 0 2px var(--tint); }
/* interval orar */
.times input[type=time] { min-height: 40px; background-color: var(--cell-2); }
/* PIN: campul real e invizibil peste cele sase casute */
.otp .otp-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; min-height: 0; background: none; box-shadow: none; color: transparent; caret-color: transparent; }
.statusrow .grow { flex: 1; min-width: 0; }
.netbadge svg { width: 26px; height: 26px; }

/* comenzile portii: Deschide verde, Inchide ardezie, STOP singurul rosu */
.btn.go { background: var(--go); color: var(--on-go); box-shadow: 0 8px 20px -10px var(--go); }
.btn.slate { background: var(--slate); color: #fff; box-shadow: 0 8px 20px -10px var(--slate); }
/* cercul de stare al portii are culoarea butonului care duce in starea aceea */
.ring.g-open { color: var(--go); background: radial-gradient(circle at 50% 38%, var(--ok-soft), transparent 72%); }
.ring.g-closed { color: var(--slate); background: radial-gradient(circle at 50% 38%, var(--slate-soft), transparent 72%); }
.ring.g-stopped { color: var(--tint); background: radial-gradient(circle at 50% 38%, var(--tint-soft), transparent 72%); }

/* programari */
.ministep { display: flex; align-items: center; gap: 6px; flex: none; }
.ministep button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--cell-2); font-size: 1.25rem; cursor: pointer; display: grid; place-items: center; color: var(--text); }
.ministep button:active { transform: scale(.9); }
.ministep output { min-width: 58px; text-align: center; font-weight: 600; font-size: 1.05rem; }
.linkcell { border: 0; background: none; text-align: left; padding: 0; color: inherit; cursor: pointer; min-width: 0; }
input[type=date] { font-variant-numeric: tabular-nums; }
.dial-seg { fill: none; stroke-width: 16; stroke-linecap: butt; }
.dial-val { transition: color .2s; }
