/* Klima Home — светол дизајн: плочки за собите + тркалезен регулатор */
:root {
  --bg: #eef2f5;
  --paper: #ffffff;
  --ink: #1b2430;
  --slate: #6b7685;
  --hair: #e1e6ec;
  --track: #e8edf2;
  --cool: #2f7bf6;
  --heat: #f2703a;
  --auto: #1fb57a;
  --dry: #12a7b8;
  --fan: #7c8794;
  --danger: #e5484d;
  --mode: var(--fan);
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 16px calc(28px + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:focus-visible, input:focus-visible { outline: 2.5px solid var(--cool); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

[data-mode="cool"] { --mode: var(--cool); }
[data-mode="heat"] { --mode: var(--heat); }
[data-mode="auto"] { --mode: var(--auto); }
[data-mode="dry"] { --mode: var(--dry); }
[data-mode="fan"] { --mode: var(--fan); }

/* ---------- Најава ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login {
  width: 100%; max-width: 360px; background: var(--paper); border-radius: 28px; padding: 32px 24px 24px;
  box-shadow: 0 1px 2px rgba(27, 36, 48, .04), 0 12px 40px rgba(27, 36, 48, .08);
}
.login .logo { width: 52px; height: 52px; margin-bottom: 18px; }
.login h1 { font-size: 28px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.02em; }
.login p { margin: 0 0 24px; color: var(--slate); }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; color: var(--slate); margin: 0 0 6px 4px; }
.field input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid transparent;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 17px; transition: border-color .15s, background .15s;
}
.field input:focus { outline: none; border-color: var(--cool); background: var(--paper); }
.btn-primary {
  width: 100%; padding: 15px; border-radius: 14px; background: var(--ink); color: #fff;
  font-weight: 600; font-size: 17px; margin-top: 10px;
}
.btn-primary:disabled { opacity: .5; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 12px; text-align: center; }

/* ---------- Заглавие ---------- */
.top {
  max-width: 980px; margin: 0 auto; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 28px 4px 18px;
}
.top h1 { font-size: 34px; font-weight: 800; margin: 0; letter-spacing: -0.03em; line-height: 1.1; }
.summary { color: var(--slate); font-size: 15px; margin-top: 4px; }
.summary.err { color: var(--danger); }
.top-actions { display: flex; gap: 8px; margin-bottom: 4px; }
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(27, 36, 48, .08);
}
.round-btn svg { width: 19px; height: 19px; }
.round-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner {
  max-width: 980px; margin: 0 auto 14px; padding: 11px 16px; border-radius: 14px;
  background: #fff6d6; color: #7a5a00; font-size: 14px;
}

/* ---------- Плочки за собите ---------- */
.rooms {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 720px) { .rooms { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }

.tile {
  position: relative; text-align: left; background: var(--paper); border-radius: 26px; padding: 16px 16px 18px;
  min-height: 164px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 1px 2px rgba(27, 36, 48, .04);
  transition: background-color .25s, transform .12s;
}
.tile:active { transform: scale(.98); }
.tile-ac.on { background: color-mix(in srgb, var(--mode) 11%, #fff); }
.tile.offline { opacity: .5; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile-power, .tile-icon {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--track); color: var(--slate); transition: background .2s, color .2s;
}
.tile-power svg, .tile-icon svg { width: 22px; height: 22px; }
.tile.on .tile-power, .tile-icon { background: var(--mode); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--mode) 35%, transparent); }
.tile-big { font-size: 44px; font-weight: 300; letter-spacing: -0.04em; line-height: 1; margin-top: 18px; }
.tile-big sup { font-size: 20px; font-weight: 400; vertical-align: 16px; margin-left: 1px; color: var(--slate); }
.tile-name { font-size: 17px; font-weight: 700; margin-top: 10px; letter-spacing: -0.01em; }
.tile-state { font-size: 14px; color: var(--slate); margin-top: 1px; }
.tile-ac.on .tile-state { color: color-mix(in srgb, var(--mode) 75%, var(--ink)); font-weight: 600; }
.tile-dot {
  position: absolute; top: 18px; right: 18px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--mode); opacity: 0; transition: opacity .2s;
}
.tile.busy .tile-dot { opacity: 1; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.empty { grid-column: 1 / -1; text-align: center; color: var(--slate); padding: 56px 16px; }

/* ---------- Apple Home ---------- */
.homekit {
  max-width: 980px; margin: 22px auto 0; display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center;
  padding: 16px 18px; border-radius: 22px; background: var(--paper);
}
.homekit .hk-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: linear-gradient(180deg, #ffb340, #ff9500); color: #fff;
}
.homekit .hk-icon svg { width: 24px; height: 24px; }
.homekit .hk-body { flex: 1; min-width: 180px; }
.homekit .t { font-weight: 700; }
.homekit .s { color: var(--slate); font-size: 14px; }
.pin {
  font-size: 20px; font-weight: 700; letter-spacing: .06em; padding: 8px 12px;
  border-radius: 12px; background: var(--bg); white-space: nowrap;
}

/* ---------- Детален панел ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(27, 36, 48, .28); opacity: 0; transition: opacity .25s;
  z-index: 10;
}
.scrim.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; margin: 0 auto; max-width: 480px;
  background: var(--paper); border-radius: 30px 30px 0 0; max-height: 94vh; overflow-y: auto;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -10px 40px rgba(27, 36, 48, .12);
}
.sheet.open { transform: translateY(0); }
@media (min-width: 720px) {
  .sheet { bottom: auto; top: 50%; border-radius: 30px; transform: translateY(-46%) scale(.97); opacity: 0;
    transition: transform .25s, opacity .25s; pointer-events: none; }
  .sheet.open { transform: translateY(-50%); opacity: 1; pointer-events: auto; }
}
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--hair); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-title { flex: 1; min-width: 0; }
.name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sheet-head h2 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-sub { color: var(--slate); font-size: 15px; margin-top: 2px; }

.switch {
  width: 56px; height: 34px; border-radius: 17px; background: var(--hair); position: relative; flex: none;
  transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .18); transition: transform .2s;
}
.switch[aria-checked="true"] { background: var(--mode); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.close-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; color: var(--slate); }
.close-btn svg { width: 16px; height: 16px; }

/* Регулатор */
.dial-wrap { position: relative; width: 280px; max-width: 100%; margin: 14px auto 0; aspect-ratio: 1; touch-action: none; user-select: none; }
.dial-wrap svg { width: 100%; height: 100%; display: block; }
.dial-track { stroke: var(--track); }
.dial-tick { stroke: var(--hair); }
.dial-value { stroke: var(--mode); transition: stroke .25s; }
.dial-knob { fill: #fff; stroke: var(--mode); transition: stroke .25s; }
.sheet.off .dial-value, .sheet.off .dial-knob { stroke: #c5ccd5; }
.dial-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.dial-mode { font-size: 15px; font-weight: 700; color: var(--mode); }
.sheet.off .dial-mode { color: var(--slate); }
.dial-temp { font-size: 64px; font-weight: 300; letter-spacing: -0.04em; line-height: 1; margin: 2px 0; }
.dial-temp sup { font-size: 24px; vertical-align: 30px; margin-left: 2px; color: var(--slate); }
.sheet.off .dial-temp { color: #b5bdc8; }
.dial-room { font-size: 14px; color: var(--slate); margin-top: 4px; }
.steppers { display: flex; justify-content: space-between; margin: -46px 4px 0; position: relative; }
.step {
  width: 54px; height: 54px; border-radius: 50%; background: var(--bg); font-size: 28px; font-weight: 400;
  display: grid; place-items: center; line-height: 1;
}
.step:active { background: var(--hair); }

.group { margin-top: 26px; }
.group-title { font-size: 15px; font-weight: 700; margin: 0 0 10px 2px; }
.modes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0 10px;
  border-radius: 18px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--slate);
  transition: background .2s, color .2s;
}
.mode-btn svg { width: 24px; height: 24px; }
.mode-btn.active { background: var(--mode); color: #fff; }

.segmented {
  display: flex; background: var(--bg); border-radius: 14px; padding: 3px; gap: 2px;
}
.segmented button {
  flex: 1; padding: 9px 0; border-radius: 11px; font-size: 15px; font-weight: 600; color: var(--slate);
  transition: background .15s, color .15s;
}
.segmented button.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(27, 36, 48, .12); }
.row {
  display: flex; align-items: center; justify-content: space-between; margin-top: 12px;
  padding: 12px 14px; background: var(--bg); border-radius: 14px; font-weight: 600;
}
.row .switch { background: #d6dde5; }
.row .switch[aria-checked="true"] { background: var(--mode); }
.updated { text-align: center; color: var(--slate); font-size: 13px; margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 16px; font-size: 15px; z-index: 20;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ================= Категории ================= */
.cats {
  max-width: 980px; margin: 0 auto 4px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 4px 0 10px; position: sticky; top: 0; z-index: 5; background: var(--bg);
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 10px 15px 10px 12px; border-radius: 999px;
  background: var(--paper); font-weight: 600; font-size: 15px; color: var(--ink);
  box-shadow: 0 1px 2px rgba(27, 36, 48, .05); transition: background .15s, color .15s;
}
.cat svg { width: 18px; height: 18px; }
.cat.active { background: var(--ink); color: #fff; }
.cat-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 12px; display: grid; place-items: center;
  background: var(--bg); color: var(--ink); margin-left: 1px;
}
.cat.active .cat-count { background: rgba(255, 255, 255, .2); color: #fff; }

/* ================= Секции ================= */
#main { max-width: 980px; margin: 0 auto; }
.section { margin-top: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 10px; }
.section-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.section-actions { display: flex; gap: 6px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 999px;
  background: var(--paper); font-size: 14px; font-weight: 600; color: var(--ink);
}
.pill-btn svg { width: 16px; height: 16px; }
.pill-btn:active { background: var(--hair); }
.section-note {
  margin: 0 0 10px; padding: 12px 14px; border-radius: 16px; background: var(--paper); color: var(--slate); font-size: 14px;
}

/* ================= Плочка: светло ================= */
.tile-light { --glow: #ffb347; }
.tile-light.on { background: color-mix(in srgb, var(--glow) 16%, #fff); }
.tile-light.on .tile-power { background: var(--glow); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--glow) 55%, transparent); }
.tile-light.on .tile-state { color: var(--ink); font-weight: 600; }
.tile-light .tile-name { margin-top: 26px; }

/* ================= Плочка: ролетна ================= */
.tile-cover { min-height: 164px; }
.tile-cover .tile-icon { background: #e6edf7; color: #4a6a93; }
.tile-cover .tile-name { margin-top: 10px; }
.tile-cover.needs-learn .tile-state { color: #b26b00; }
.cover-mini { display: flex; gap: 6px; margin-top: 12px; }
.cover-mini button {
  flex: 1; height: 36px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; color: var(--ink);
}
.cover-mini button svg { width: 18px; height: 18px; }
.cover-mini button:active { background: var(--hair); }
.cover-mini button:disabled { opacity: .3; }
.tile-add {
  align-items: center; justify-content: center; gap: 8px; background: transparent; border: 2px dashed #cdd5df;
  box-shadow: none; color: var(--slate); font-weight: 600;
}
.tile-add svg { width: 26px; height: 26px; }

/* ================= Панел: име ================= */
.edit-btn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--slate); flex: none; }
.edit-btn svg { width: 17px; height: 17px; }
.name-input {
  font: inherit; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); width: 100%; min-width: 0;
  border: 0; border-bottom: 2px solid var(--cool); background: transparent; padding: 0 0 2px; outline: none;
}

/* ================= Панел: светло ================= */
.sheet[data-kind="light"] { --mode: var(--glow, #ffb347); }
.bright-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
.bright {
  position: relative; width: 132px; height: 300px; border-radius: 36px; background: var(--track); overflow: hidden;
  touch-action: none; cursor: ns-resize;
}
.bright-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--glow, #ffb347); transition: height .12s; }
.bright-icon { position: absolute; left: 50%; bottom: 22px; width: 30px; height: 30px; transform: translateX(-50%); color: #fff; opacity: .9; }
.bright-val { font-size: 26px; font-weight: 700; }
.kelvin {
  position: relative; height: 44px; border-radius: 22px; touch-action: none; cursor: ew-resize;
  background: linear-gradient(90deg, #ffa640, #ffd9a6 35%, #fff4e6 55%, #e3eeff 80%, #c6dcff);
  box-shadow: inset 0 0 0 1px rgba(27, 36, 48, .06);
}
.kelvin-knob {
  position: absolute; top: 50%; width: 30px; height: 30px; border-radius: 50%; background: #fff;
  border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); transform: translate(-50%, -50%);
}
.kelvin-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--slate); margin: 6px 4px 0; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.swatch { aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.swatch:active { transform: scale(.92); }

/* ================= Панел: ролетна ================= */
.cover-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.cover-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 0 16px; border-radius: 22px;
  background: var(--bg); font-weight: 700; font-size: 15px;
}
.cover-btn svg { width: 30px; height: 30px; }
.cover-btn:active { background: var(--ink); color: #fff; }
.hint { color: var(--slate); font-size: 14px; margin: -4px 2px 12px; }
.segmented.small button { padding: 7px 0; font-size: 14px; }
.learn-list { margin-top: 12px; border-radius: 16px; background: var(--bg); overflow: hidden; }
.learn-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.learn-row + .learn-row { border-top: 1px solid var(--hair); }
.lr-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--paper); display: grid; place-items: center; }
.lr-icon svg { width: 17px; height: 17px; }
.lr-name { font-weight: 700; flex: 1; }
.lr-state { font-size: 13px; color: var(--slate); display: inline-flex; align-items: center; gap: 3px; }
.lr-state.ok { color: var(--auto); font-weight: 600; }
.lr-state svg { width: 15px; height: 15px; }
.text-btn { color: var(--cool); font-weight: 700; font-size: 15px; padding: 4px 2px 4px 8px; }
.text-btn:disabled { color: var(--slate); opacity: .5; }
.learn-status {
  display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px; border-radius: 16px;
  background: #eaf2ff;
}
.learn-status[data-status="done"] { background: #e3f7ee; }
.learn-status[data-status="error"] { background: #fdecec; }
.ls-title { font-weight: 700; }
.ls-msg { font-size: 14px; color: var(--slate); }
.learn-status > div { flex: 1; }
.pulse-ring {
  width: 16px; height: 16px; border-radius: 50%; background: var(--cool); flex: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--cool) 60%, transparent); animation: ring 1.2s infinite;
}
.learn-status[data-status="done"] .pulse-ring { background: var(--auto); animation: none; }
.learn-status[data-status="error"] .pulse-ring { background: var(--danger); animation: none; }
@keyframes ring { to { box-shadow: 0 0 0 14px transparent; } }
.danger-btn {
  width: 100%; margin-top: 26px; padding: 14px; border-radius: 14px; background: #fdecec; color: var(--danger); font-weight: 700;
}

.cover-btn:disabled { opacity: .35; }

/* ================= RF, сокриени ================= */
.row-sub { font-size: 13px; font-weight: 400; color: var(--slate); margin-top: 2px; }
#c-stop-row { gap: 12px; }
.hide-btn { display: block; margin: 22px auto 0; color: var(--slate); font-size: 14px; font-weight: 600; padding: 6px 10px; }
.rf-light { display: flex; flex-direction: column; align-items: center; margin-top: 18px; }
.big-toggle {
  width: 150px; height: 150px; border-radius: 50%; background: var(--bg); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 16px; transition: background .2s, color .2s;
}
.big-toggle svg { width: 40px; height: 40px; }
.big-toggle.on { background: #ffb347; color: #fff; box-shadow: 0 10px 30px rgba(255, 179, 71, .45); }
.big-toggle:active { transform: scale(.97); }
.big-toggle:disabled { opacity: .4; }
.hint.center { text-align: center; max-width: 300px; margin-top: 14px; }
.hidden-box { margin: 22px 4px 0; color: var(--slate); }
.hidden-box summary { cursor: pointer; font-weight: 600; font-size: 15px; padding: 6px 0; }
.hidden-list { background: var(--paper); border-radius: 16px; margin-top: 8px; overflow: hidden; }
.hidden-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: var(--ink); }
.hidden-row + .hidden-row { border-top: 1px solid var(--hair); }
.sheet[data-kind="cover"] { --mode: var(--cool); }

.dim-row { display: flex; gap: 10px; margin-top: 16px; width: 100%; max-width: 320px; }
.dim-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 16px; background: var(--bg); font-weight: 700; }
.dim-btn svg { width: 20px; height: 20px; }
.dim-btn:active { background: var(--hair); }
.dim-btn:disabled { opacity: .35; }

/* ================= Дизајн A: соби и сцени ================= */
html { background: var(--bg); }
body { padding-bottom: calc(110px + env(safe-area-inset-bottom)); background: transparent; position: relative; }
.sky {
  position: absolute; left: 0; right: 0; top: 0; height: 440px; z-index: -1;
  background: linear-gradient(180deg, #cfe4ff 0, #e2eefc 230px, var(--bg) 440px);
}
.top { padding: 26px 4px 4px; align-items: flex-start; }
.top h1 { font-size: 34px; }
.hello { font-size: 15px; font-weight: 600; color: #3d5878; margin-bottom: 2px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--cool); font-weight: 800; font-size: 17px;
  box-shadow: 0 4px 14px rgba(20, 32, 46, .08); flex: none; margin-top: 4px;
}
.view { max-width: 980px; margin: 0 auto; }
.chips { display: flex; gap: 8px; margin: 12px 0 0; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; white-space: nowrap; }
.chip {
  background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 14px; padding: 8px 12px; font-size: 13.5px; font-weight: 600; color: #33475e;
}
.chip b { font-size: 16px; color: var(--ink); }
.actions { display: flex; gap: 12px; margin: 20px 0 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.actions::-webkit-scrollbar { display: none; }
.action { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 74px; flex: none; font-size: 12.5px; font-weight: 600; color: #33475e; text-align: center; line-height: 1.2; }
.action i {
  width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(20, 32, 46, .08); transition: transform .12s;
}
.action i svg { width: 26px; height: 26px; }
.action.pressed i, .action:active i { transform: scale(.92); }

.room { margin-top: 26px; }
.room-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 4px 10px; }
.room-h h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.room-h span { font-size: 13px; color: var(--slate); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.note { margin: 0 0 10px; padding: 12px 14px; border-radius: 16px; background: var(--paper); color: var(--slate); font-size: 14px; }

.dev {
  --c: #3b8cff;
  position: relative; background: var(--paper); border-radius: 24px; padding: 12px 14px 14px; text-align: left;
  box-shadow: 0 1px 2px rgba(20, 32, 46, .04); transition: transform .12s, box-shadow .2s; cursor: pointer; min-height: 168px;
  display: flex; flex-direction: column;
}
.dev:active { transform: scale(.98); }
.dev.on { box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 18%, transparent); }
.dev.offline { opacity: .5; }
.dev .ill { height: 84px; display: flex; align-items: center; justify-content: center; margin: 4px 0 8px; }
.dev .ill svg { max-width: 100%; height: auto; max-height: 84px; }
.dev .n { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev .s { font-size: 13px; color: var(--slate); margin-top: 1px; }
.dev.on .s { color: color-mix(in srgb, var(--c) 78%, #000); font-weight: 600; }
.dev .big { position: absolute; top: 12px; left: 14px; font-size: 22px; font-weight: 300; letter-spacing: -.03em; color: var(--ink); }
.dev .tog {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 26px; border-radius: 13px; background: #dde4ec; z-index: 1;
  transition: background .2s;
}
.dev .tog::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s;
}
.dev.on .tog { background: var(--c); }
.dev.on .tog::after { transform: translateX(18px); }
.dev .dot { position: absolute; bottom: 14px; right: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: 0; }
.dev.busy .dot { opacity: 1; animation: pulse 1s ease-in-out infinite; }
.dev .mini { display: flex; gap: 6px; margin-top: 10px; }
.dev .mini[hidden] { display: none; }
.dev .mini button { flex: 1; height: 34px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; }
.dev .mini button svg { width: 17px; height: 17px; }
.dev .mini button:disabled { opacity: .3; }
.dev-add {
  align-items: center; justify-content: center; gap: 8px; background: transparent; border: 2px dashed #c9d3de;
  box-shadow: none; color: var(--slate); font-weight: 600; text-align: center;
}
.dev-add svg { width: 26px; height: 26px; }
.empty { text-align: center; color: var(--slate); padding: 48px 16px; }

/* мени долу */
.tabbar {
  position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); height: 64px; z-index: 8;
  max-width: 520px; margin: 0 auto; border-radius: 24px; display: flex; justify-content: space-around; align-items: center;
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(20, 32, 46, .12);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--slate); padding: 6px 16px; }
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button.active { color: var(--cool); }

/* уреди: категории */
#view-devices .cats { background: transparent; position: static; margin-top: 14px; }

/* поставки */
.set-card { background: var(--paper); border-radius: 24px; padding: 16px; margin-top: 16px; }
.set-title { font-size: 15px; font-weight: 800; margin: 14px 2px 6px; }
.set-card > .set-title:first-child { margin-top: 0; }
.set-list { border-radius: 16px; overflow: hidden; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; }
.set-row + .set-row { border-top: 1px solid var(--hair); }
.set-row .t { font-weight: 700; font-size: 15px; }
.set-row .s, .set-card .s { font-size: 13px; color: var(--slate); }
.set-dev { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-ill { width: 48px; height: 40px; display: grid; place-items: center; flex: none; }
.mini-ill svg { max-width: 48px; max-height: 40px; }
.pad { padding: 8px 2px; }
.hk-head { display: flex; gap: 12px; align-items: center; }
.hk-head .t { font-weight: 800; font-size: 17px; }
.hk-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: linear-gradient(180deg, #ffb340, #ff9500); color: #fff; }
.hk-icon svg { width: 24px; height: 24px; }
.hk-pin-box { margin-top: 14px; padding: 14px; border-radius: 16px; background: #fff7e8; }
.hk-pin-box .pin { margin-top: 10px; display: inline-block; font-size: 26px; background: #fff; }
.sheet-settings { margin-top: 22px; }
.sheet-settings .row { margin-top: 8px; }
.room-select {
  font: inherit; font-weight: 600; border: 0; background: var(--paper); border-radius: 10px; padding: 6px 10px; color: var(--ink);
  max-width: 55%;
}
.dev-ac .ill { margin-top: 18px; height: 72px; }

.stop-title { margin-top: 20px; }
#c-stop-row .hint { margin-top: 8px; }

/* Сите клими */
.sheet[data-kind="allac"] { --mode: var(--cool); }
.sheet[data-kind="allac"][data-mode="heat"] { --mode: var(--heat); }
.sheet[data-kind="allac"][data-mode="auto"] { --mode: var(--auto); }
.all-hint { margin: 10px auto 0; }
.all-temp { display: flex; align-items: center; justify-content: space-between; margin: 18px 6px 4px; }
.all-val { font-size: 84px; font-weight: 300; letter-spacing: -.05em; color: var(--mode); line-height: 1; }
.all-val sup { font-size: 30px; vertical-align: 44px; color: var(--slate); }
#a-mode button.active { background: var(--mode); color: #fff; box-shadow: none; }
.mode-hint { margin-top: 8px; }
.all-apply { margin-top: 22px; background: var(--mode); }

.identify-btn { display: flex; margin: 16px auto 0; background: var(--bg); }
#wiz-card .s#wiz-result { margin-top: 6px; }
#wiz-result:empty { display: none; }

/* ================= Камери ================= */
.cams { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; }
.cams::-webkit-scrollbar { display: none; }
.cam {
  position: relative; flex: none; width: 82%; max-width: 360px; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden;
  background: linear-gradient(135deg, #dfe7f0, #c9d5e2); scroll-snap-align: start; cursor: pointer;
  box-shadow: 0 6px 18px rgba(20, 32, 46, .10);
}
.cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.cam.ready img { opacity: 1; }
.cam-shade { position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .55)); }
.cam-name { position: absolute; left: 14px; bottom: 12px; color: #fff; font-weight: 700; font-size: 16px; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.cam-live { position: absolute; top: 12px; left: 12px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: #fff; background: rgba(229, 72, 77, .9); padding: 3px 7px; border-radius: 6px; }
.cam.err::after { content: "Нема слика"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--slate); font-weight: 600; }
.cam-open {
  position: absolute; right: 12px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  border-radius: 12px; background: rgba(255, 255, 255, .92); color: var(--ink); font-weight: 700; font-size: 14px;
}
.cam-open svg { width: 17px; height: 17px; }
.cam.door { outline: 3px solid rgba(31, 181, 122, .0); }

/* преглед на цел екран */
body.no-scroll { overflow: hidden; position: fixed; left: 0; right: 0; width: 100%; }
html { overscroll-behavior-y: none; } html, body { -webkit-tap-highlight-color: transparent; }
button, .dev, .tab, .act { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
input, select, textarea { font-size: 16px; }

/* Назад во панелот — на телефон панелот е цел екран */
.back-btn { display: none; width: 44px; height: 44px; margin-left: -10px; border-radius: 50%; place-items: center; color: var(--ink); flex: none; }
.back-btn svg { width: 24px; height: 24px; }
.back-btn:active { background: var(--bg); }
@media (max-width: 719px) {
  .sheet {
    top: 0; bottom: 0; max-width: none; max-height: none; height: 100%; border-radius: 0;
    padding: calc(8px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
    transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch; box-shadow: none;
  }
  .sheet.open { transform: translateX(0); }
  .sheet .grabber { display: none; }
  .sheet .back-btn { display: grid; }
  .sheet #s-close { display: none; }
  .sheet-head { position: sticky; top: calc(-8px - env(safe-area-inset-top)); z-index: 2; background: var(--paper);
    margin: 0 -20px; padding: calc(8px + env(safe-area-inset-top)) 20px 10px; }
}
.viewer {
  position: fixed; inset: 0; z-index: 30; background: #0d1117; color: #fff; display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
}
.viewer[hidden] { display: none !important; }
.v-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.v-top h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.v-sub { color: #9aa6b4; font-size: 14px; }
.v-ring { display: inline-block; background: #1fb57a; color: #fff; font-weight: 800; font-size: 13px; padding: 5px 10px; border-radius: 99px; margin-bottom: 6px; animation: pulse 1s ease-in-out infinite; }
.v-close { background: rgba(255, 255, 255, .12); color: #fff; width: 40px; height: 40px; }
.v-stage { flex: 1; position: relative; margin: 14px -16px; display: grid; place-items: center; min-height: 0; }
.v-stage video, .v-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.v-stage video[hidden], .v-stage img[hidden] { display: none; }
.v-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa6b4; font-weight: 600; pointer-events: none; }
.v-loading[hidden] { display: none; }
.v-bar { display: flex; gap: 10px; justify-content: center; }
.v-btn {
  flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px;
  border-radius: 18px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 12.5px; font-weight: 600;
}
.v-btn svg { width: 24px; height: 24px; }
.v-btn.on { background: rgba(255, 255, 255, .25); }
.v-btn.on .mute-x { display: none; }
.hd-badge { font-size: 15px; font-weight: 800; border: 2px solid currentColor; border-radius: 6px; padding: 1px 5px; opacity: .6; }
.v-btn.on .hd-badge { opacity: 1; }
.v-open { background: #1fb57a; max-width: 180px; flex: 1.4; }
.v-open:active { background: #17935f; }
.cam-form { margin-top: 12px; }
.cam-devs:empty { display: none; }

/* ===== Сцени, распоред, корисници, PIN ===== */
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; }
.form-row > span { font-size: 15px; font-weight: 600; }
.form-row input, .form-row select {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--bg); border: 1.5px solid transparent;
  border-radius: 12px; padding: 9px 12px; min-width: 0; max-width: 62%; flex: 0 1 auto; text-align: right;
}
.form-row input:focus, .form-row select:focus { outline: none; border-color: var(--cool); background: var(--paper); }
.form-row input[type="number"] { width: 90px; }
.form-btns { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 10px; }
.form-btns .grow, .grow { flex: 1; min-width: 0; }
.pill-btn.primary { background: var(--cool); color: #fff; }
.pill-btn.primary:active { background: #2565cf; }
.pill-btn.danger, .text-btn.danger { color: var(--danger); }
.add-btn { margin-top: 10px; width: 100%; justify-content: center; }
.set-list:empty { display: none; }
.sched-form, .user-form { border-top: 1px solid var(--hair); margin-top: 8px; padding-top: 6px; }
.sc-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.sc-ico svg { width: 20px; height: 20px; }
.sched-row { justify-content: flex-start; }
.sched-time { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 58px; }
.sched-row .t { font-size: 14.5px; }
.icon-x { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--slate); flex: none; }
.icon-x svg { width: 16px; height: 16px; }
.icon-x:active { background: var(--hair); }
.days { display: flex; gap: 6px; padding: 8px 2px; }
.day { flex: 1; height: 38px; border-radius: 12px; background: var(--bg); font-weight: 700; color: var(--slate); }
.day[aria-pressed="true"] { background: var(--cool); color: #fff; }
.pick-list { display: grid; gap: 2px; padding: 4px 2px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 15px; cursor: pointer; }
.pick input { width: 20px; height: 20px; accent-color: var(--cool); margin: 0; }

/* модален прозорец */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(27, 36, 48, .35); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.modal-card { background: var(--paper); border-radius: 26px; padding: 20px 18px 16px; width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; box-shadow: 0 20px 50px rgba(27, 36, 48, .25); }
.modal-card h2 { margin: 0 0 8px; font-size: 20px; }
@media (min-width: 600px) { .modal { align-items: center; } }

/* PIN */
.pinpad .modal-card { text-align: center; max-width: 340px; }
.pp-dots { display: flex; justify-content: center; gap: 12px; margin: 18px 0 20px; }
.pp-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--slate); }
.pp-dots i.on { background: var(--ink); border-color: var(--ink); }
.pp-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.pp-key { height: 62px; border-radius: 20px; background: var(--bg); font-size: 24px; font-weight: 700; display: grid; place-items: center; }
.pp-key:active { background: var(--hair); }
.pp-key.fn { font-size: 17px; background: transparent; }
.pp-key svg { width: 26px; height: 26px; }

/* движење на камера */
.cam.motion::before { content: "Движење"; position: absolute; top: 12px; right: 12px; z-index: 2; font-size: 11px; font-weight: 800; color: #fff; background: rgba(242, 112, 58, .95); padding: 3px 8px; border-radius: 8px; }
.set-card .pill-btn:not(.primary), .modal-card .pill-btn:not(.primary) { background: var(--bg); }
.set-card .switch[aria-checked="true"] { background: var(--cool); }

/* ===== Фонт Nunito + заглавие со времето (варијанта В) ===== */
@font-face {
  font-family: "Nunito"; src: url("/fonts/Nunito.ttf") format("truetype");
  font-weight: 200 1000; font-style: normal; font-display: swap;
}
:root { --font: "Nunito", ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body, button, input, select, textarea { font-family: var(--font); }

body.at-home .top h1 { display: none; }
body.at-home .hello { font-size: 18px; font-weight: 800; color: #34465c; margin: 6px 0 0; }
.wx { display: flex; align-items: center; gap: 14px; margin: 8px 0 0; }
.wx[hidden] { display: none; }
.wx-ico { width: 60px; height: 60px; color: #3f6fb5; flex: none; display: grid; place-items: center; }
.wx-ico svg { width: 60px; height: 60px; }
.wx-ico:empty { display: none; }
.wx-temp { font-size: 54px; font-weight: 800; letter-spacing: -0.03em; line-height: .95; color: var(--ink); }
.wx-cond { font-size: 15px; font-weight: 700; color: #3c4b5e; margin-top: 2px; }
.wx-in { margin-left: auto; text-align: right; padding: 10px 14px; border-radius: 18px; background: rgba(255, 255, 255, .78); }
.wx-in span { display: block; font-size: 13px; font-weight: 700; color: #3c4b5e; }
.wx-in b { font-size: 24px; font-weight: 800; color: var(--ink); }
.wx-note { margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .6); font-size: 14.5px; font-weight: 700; color: #2f3d4f; }
.scene-pills { display: flex; gap: 10px; margin-top: 16px; }
.scene-pills:empty { display: none; }
.scene-pill { flex: 1; min-width: 0; height: 52px; border-radius: 26px; background: var(--paper); font-size: 15px; font-weight: 800; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; box-shadow: 0 4px 14px rgba(60, 90, 130, .08); transition: transform .12s; }
.scene-pill:active, .scene-pill.pressed { transform: scale(.96); background: #e6eefb; }
.name-field { font: inherit; font-size: 16px; text-align: right; border: 0; background: var(--bg); border-radius: 12px; padding: 9px 12px; width: 52%; color: var(--ink); }
.name-field:focus { outline: 2px solid var(--cool); background: var(--paper); }
.set-row .s.r { text-align: right; max-width: 60%; }

/* ===== Компјутер: странична лента, пошироко, камери и поставки во мрежа ===== */
.tabbar .brand { display: none; }
@media (min-width: 1024px) {
  body { padding: 0 32px 48px 272px; }
  .sky { left: 0; }
  .tabbar {
    left: 16px; top: 16px; bottom: 16px; right: auto; width: 224px; height: auto; max-width: none; margin: 0;
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; padding: 18px 12px; border-radius: 26px;
  }
  .tabbar .brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: var(--ink); padding: 4px 10px 22px; letter-spacing: -.01em; }
  .tabbar .brand i { width: 36px; height: 36px; border-radius: 12px; background: var(--cool); color: #fff; display: grid; place-items: center; }
  .tabbar .brand svg { width: 20px; height: 20px; }
  .tabbar button { flex-direction: row; gap: 12px; font-size: 15px; font-weight: 700; padding: 12px 14px; border-radius: 14px; justify-content: flex-start; }
  .tabbar button:hover { background: var(--bg); }
  .tabbar button.active { background: #e6effd; }
  .top, .view, #main, .banner { max-width: 1240px; }
  .top { padding-top: 32px; }

  /* Дома: времето лево, сцените и акциите десно */
  #view-home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  #view-home > .wx { grid-column: 1; grid-row: 1; margin-top: 0; }
  #view-home > .wx-note { grid-column: 1; grid-row: 2; }
  #view-home > .scene-pills { grid-column: 2; grid-row: 1; margin-top: 4px; align-self: center; }
  #view-home > .actions { grid-column: 2; grid-row: 2; margin-top: 14px; }
  #view-home > .cams-sec, #view-home > #rooms { grid-column: 1 / -1; }

  /* камери во мрежа наместо лизгање */
  .cams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; gap: 16px; }
  .cam { width: auto; max-width: none; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

  /* Поставки во две колони */
  #view-settings { column-count: 2; column-gap: 18px; }
  #view-settings .set-card:not([hidden]) { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 18px; box-sizing: border-box; }
}
@media (min-width: 1440px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cams { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 720px) { .sheet .grabber { display: none; } }

/* Јазик */
.seg-mini { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg); }
.seg-mini button { padding: 7px 12px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--slate); }
.seg-mini button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(20, 32, 46, .1); }
.lang-switch { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; font-size: 14px; color: var(--slate); }
.lang-switch button { font-weight: 700; color: var(--slate); padding: 6px 4px; }
.lang-switch button.on { color: var(--cool); }

/* Камера на компјутер: прозорец на средина, сликата во вистински размер (16:9), не преку цел екран */
@media (min-width: 1024px) {
  .viewer { inset: 0; padding: 32px; background: rgba(13, 17, 23, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); display: grid; place-items: center; align-content: center; }
  .viewer > * { width: min(1180px, calc((100vh - 220px) * 16 / 9)); }
  .viewer .v-stage { flex: none; aspect-ratio: 16 / 9; margin: 14px 0; border-radius: 18px; overflow: hidden; background: #000; }
  .viewer .v-top, .viewer .v-bar { padding: 0 4px; }
}

/* Hikvision слабиот поток е 704x576 (развлечена слика од 16:9 камера) — врати ја во 16:9 */
.v-stage img.anamorphic { object-fit: fill; inset: auto 0; top: 50%; transform: translateY(-50%); width: 100%; height: auto; max-height: 100%; aspect-ratio: 16 / 9; margin: 0 auto; }
@media (min-width: 1024px) { .v-stage img.anamorphic { top: 0; transform: none; height: 100%; } }
/* плочките се 16:9 — „fill“ ја враќа и збиената слика од слабиот поток во вистински размер */
.cam img { object-fit: fill; }

/* видеото е под сликите додека не тргне */
/* видеото е секогаш видливо (iPhone не црта видео што почнало провидно); сликата е над него додека видеото не тргне */
.v-stage img { z-index: 1; }
.v-badge { position: absolute; left: 12px; bottom: 12px; z-index: 2; font-size: 12.5px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); padding: 5px 10px; border-radius: 10px; }
.v-badge[hidden] { display: none; }

.log-box { margin: 10px 0 0; max-height: 360px; overflow: auto; background: #0f1720; color: #d5dde6; border-radius: 14px; padding: 12px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.v-badge.live { background: rgba(31, 181, 122, .9); }

/* Телефон: камерите во мрежа (2 во ред, вратата преку цела ширина), без лизгање настрана */
html { overflow-x: hidden; } body { overflow-x: clip; }
@media (max-width: 1023px) {
  .cams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow: visible; margin: 0; padding: 0; scroll-snap-type: none; }
  .cam { width: auto; max-width: none; border-radius: 18px; }
  .cam.door { grid-column: 1 / -1; }
  .cam .cam-name { font-size: 14px; }
}

.v-play { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 84px; height: 84px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #0d1117; display: grid; place-items: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
.v-play[hidden] { display: none; }
.v-play svg { width: 38px; height: 38px; margin-left: 5px; }

/* официјален плеер на go2rtc */
.v-player { position: absolute; inset: 0; display: block; background: #000; }
.v-player video { width: 100% !important; height: 100% !important; object-fit: contain; background: #000; }

#v-mjpeg { z-index: 1; }
#v-mjpeg.anamorphic { object-fit: fill; }

#v-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 1; }
#v-canvas[hidden] { display: none; }
#log-sample { text-decoration: none; display: inline-flex; align-items: center; }

.enc-in { display: flex; gap: 8px; align-items: center; flex: none; }
.enc-in input { font: inherit; font-size: 16px; width: 150px; border: 0; background: var(--bg); border-radius: 12px; padding: 9px 12px; color: var(--ink); }
#enc-form { flex-wrap: wrap; gap: 10px; }
#log-sample-hd { text-decoration: none; display: inline-flex; align-items: center; }

.ic-form { margin-top: 6px; }
.ic-form select { font: inherit; font-size: 16px; border: 0; background: var(--bg); border-radius: 12px; padding: 10px 12px; color: var(--ink); width: 100%; }
.ic-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#ic-result { white-space: pre-line; }

/* Држи за отклучување */
.hold { overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.hold::before { content: ""; position: absolute; inset: 0; background: rgba(31, 181, 122, .35); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.v-open.hold::before { background: rgba(255, 255, 255, .3); }
.hold.holding::before { transform: scaleX(1); transition: transform .6s linear; }
.hold.done::before { transform: scaleX(1); background: rgba(31, 181, 122, .55); }
.v-open.hold { position: relative; }
.hold > * { position: relative; }
@media (prefers-reduced-motion: reduce) { .hold.holding::before { transition: none; opacity: .6; } }

/* Apple Home QR */
.hk-pair { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hk-pair-t { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.hk-pair-t .pin { margin-top: 2px; align-self: flex-start; }
.hk-qr { width: 156px; height: 156px; flex: none; background: #fff; border-radius: 14px; padding: 6px; box-sizing: border-box; box-shadow: 0 2px 10px rgba(60, 80, 120, .1); }
.hk-qr svg { width: 100%; height: 100%; display: block; }

/* =====================================================================
   Ivory тема (GlassHome): валкано-бело, матно стакло, топол беж акцент.
   Се вклучува со <html class="skin-ivory"> (Поставки → Изглед).
   ===================================================================== */
.iv-only { display: none; }

/* стаклени површини */

/* мени */

/* сцени: големи стаклени копчиња */

/* херој со куќата */

/* бројки */

/* соби со фотки */

/* камери */

/* ===== Ivory: ефекти (позадина што дише, стакло со сјај, лебдење, влез) ===== */

@keyframes iv-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vmax, 4vmax) scale(1.12); } }

/* стакло: посилен blur + светол раб горе + мек сјај */

/* лебдење и притискање */

/* каскаден влез */

@keyframes iv-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* херој: часовник и времето */

 /* времето е во картичката десно */

/* бројки: икони во боја */

/* плочки по категорија */

/* истакната соба + брзи сцени */

/* соби: стрелка */

/* мени долу на телефон: стакло */

@media (min-width: 720px) {
   /* на компјутер има странично мени */
  
  
  
  
}

/* ===== Варијанти на стаклената тема (иста структура, друга палета) ===== */
/* Нордиски мраз: ладно бело и мраз-сино */

/* Жалфија (јапанди): зелено-сиво и лен */

/* Праска и лаванда: топол пастел */

/* Песок и море: беж со тиркизен акцент */

/* Избор на изглед во Поставки */
.skin-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.skin-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 16px; font-size: 12.5px; font-weight: 700; color: var(--slate); border: 2px solid transparent; }
.skin-pick button[aria-pressed="true"] { border-color: var(--iv-acc, var(--cool)); color: var(--ink); background: var(--paper); }
.skin-pick i { width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 3px 8px rgba(0, 0, 0, .08); }
.skin-pick [data-skin="light"] i { background: linear-gradient(135deg, #cfe4ff 0 50%, #2f7bf6 50%); }
.skin-pick [data-skin="ivory"] i { background: linear-gradient(135deg, #f3ece4 0 50%, #b5875a 50%); }
.skin-pick [data-skin="frost"] i { background: linear-gradient(135deg, #e6eef8 0 50%, #3a7fc2 50%); }
.skin-pick [data-skin="sage"] i { background: linear-gradient(135deg, #e7ebe0 0 50%, #5e7d58 50%); }
.skin-pick [data-skin="peach"] i { background: linear-gradient(135deg, #fde3d8 0 30%, #e9dcff 30% 50%, #c0627b 50%); }
.skin-pick [data-skin="sea"] i { background: linear-gradient(135deg, #f1ebe0 0 50%, #1f8a85 50%); }

/* варијантите: појасна разлика — обоено стакло, посилни светла во позадина, обоена слика горе */

/* =====================================================================
   Неуморфизам: меко „испакнато“ 3D на светло сиво (skin-ivory + skin-neu)
   ===================================================================== */

/* сите површини: испакнати, без стакло и без рабови */

/* притиснато = вдлабнато */

/* полиња и прекинувачи: вдлабнати */

/* херој: без фотка, чисто и меко */

/* сцени и плочки: икони во акцент */

/* ГОЛЕМ РЕГУЛАТОР за климата */

  
 

/* камери и видео: меко врамени */

.skin-pick [data-skin="neu"] i { background: #e9edf2; box-shadow: 4px 4px 8px #c5ccd6, -4px -4px 8px #fff; }

/* =====================================================================
   Контролна табла (skin-panel): чисти бели картички со реалистични икони
   ===================================================================== */
.pn-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.pn-only { display: none; }
.skin-panel {
  --bg: #f1f3f7; --paper: #ffffff; --ink: #141b2b; --slate: #6b7487; --hair: #e7eaf0;
  --pn-card: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  --pn-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(16, 24, 40, .04), 0 6px 14px rgba(16, 24, 40, .05), 0 22px 44px -16px rgba(16, 24, 40, .14);
  --pn-shadow-hi: inset 0 1px 0 #fff, 0 2px 4px rgba(16, 24, 40, .05), 0 12px 24px rgba(16, 24, 40, .08), 0 32px 60px -18px rgba(16, 24, 40, .22);
}
.skin-panel, .skin-panel body { background: var(--bg); }
.skin-panel body { background: radial-gradient(900px 420px at 50% -120px, #e3ecfb 0, rgba(227, 236, 251, 0) 70%), var(--bg); background-attachment: fixed; }
.skin-panel .sky { display: none; }
.skin-panel #pn { display: block; }
.skin-panel #view-home > :not(#pn):not(.cams-sec) { display: none !important; }
.skin-panel body.at-home .top .hello, .skin-panel body.at-home .top h1 { visibility: hidden; height: 0; margin: 0; }
.skin-panel body.at-home .top { padding-top: 10px; padding-bottom: 0; min-height: 0; }
.skin-panel .avatar { background: #fff; box-shadow: var(--pn-shadow); }

/* насловна лента */
.pn-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 6px 4px 18px; }
.pn-head h2 { margin: 0; font-size: 34px; font-weight: 900; letter-spacing: -.03em; line-height: 1.05; }
.pn-date { font-size: 15px; font-weight: 600; color: var(--slate); margin-top: 2px; }
.pn-wx { display: flex; align-items: center; gap: 8px; text-align: right; }
.pn-wx i svg { width: 46px; height: 46px; display: block; filter: drop-shadow(0 4px 8px rgba(70, 110, 180, .2)); }
.pn-wx b { display: block; font-size: 30px; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.pn-wx span { font-size: 13px; font-weight: 700; color: var(--slate); }

/* сцени: плочки со 3D икони */
.pn-scenes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pn-scenes:empty { display: none; }
.pn-scene { background: var(--pn-card); border-radius: 22px; box-shadow: var(--pn-shadow); padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 800; color: var(--ink); transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s; min-width: 0; }
.pn-scene span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.pn-scene i svg { width: 38px; height: 38px; display: block; filter: drop-shadow(0 4px 6px rgba(20, 30, 60, .18)); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.pn-scene:active { transform: scale(.95); }
.pn-scene.done { box-shadow: var(--pn-shadow), 0 0 0 2px #2f7bf6; }
.pn-scene.done i svg { transform: scale(1.15) rotate(-6deg); }

/* картички */
.pn-card { background: var(--pn-card); border-radius: 28px; box-shadow: var(--pn-shadow); padding: 16px; margin-top: 14px; }
.pn-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 2px 4px 12px; }
.pn-h h3 { margin: 0; font-size: 19px; font-weight: 900; letter-spacing: -.02em; }
.pn-h span { font-size: 13.5px; font-weight: 700; color: var(--slate); display: flex; gap: 8px; align-items: baseline; }
.pn-h em { font-style: normal; }
.pn-link { color: #2f7bf6; font-weight: 800; font-size: 13.5px; }

/* клими: прстени */
.pn-ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.pn-acc { --c: #3b8cff; position: relative; display: flex; flex-direction: column; align-items: center; padding: 12px 6px 12px; border-radius: 22px;
  background: linear-gradient(180deg, #f7f9fc, #eef2f7); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(16, 24, 40, .04); transition: transform .2s, box-shadow .2s; }
.pn-acc.on { background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--c) 9%, #fff)); box-shadow: inset 0 1px 0 #fff, 0 10px 22px color-mix(in srgb, var(--c) 22%, transparent); }
.pn-acc:active { transform: scale(.96); }
.pn-ring { position: relative; width: 84px; height: 84px; }
.pn-ring svg { width: 100%; height: 100%; display: block; }
.pn-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 21px; font-weight: 900; letter-spacing: -.02em; }
.pn-acc strong { font-size: 14.5px; font-weight: 800; margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-acc small { font-size: 12.5px; font-weight: 700; color: var(--slate); }
.pn-acc.on small { color: color-mix(in srgb, var(--c) 80%, #000); }

/* светла: реалистични сијалици */
.pn-bulbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px 4px; }
.pn-bulb { --c: #ffd36b; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 18px; transition: transform .2s, background .2s; -webkit-touch-callout: none; user-select: none; }
.pn-bulb i svg { width: 54px; height: 62px; display: block; overflow: visible; transition: filter .3s; }
.pn-bulb.on i svg { filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--c) 55%, transparent)); }
.pn-bulb span { font-size: 12.5px; font-weight: 700; color: var(--slate); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-bulb.on span { color: var(--ink); }
.pn-bulb:active { transform: scale(.92); }
@media (hover: hover) { .pn-bulb:hover { background: #f4f6fa; } }

/* ролетни и пергола */
.pn-covers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pn-covers .pn-card { margin-top: 14px; display: flex; flex-direction: column; }
.pn-cover .pn-h h3 { font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-ill { display: grid; place-items: center; padding: 4px 0 10px; cursor: pointer; flex: 1; }
.pn-ill svg { width: 100%; max-width: 132px; height: auto; display: block; filter: drop-shadow(0 8px 14px rgba(16, 24, 40, .12)); }
.pn-cbtns { display: flex; gap: 8px; }
.pn-cb { flex: 1; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(180deg, #f6f8fb, #e9edf3); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(16, 24, 40, .08); color: var(--ink); transition: transform .12s; }
.pn-cb svg { width: 20px; height: 20px; }
.pn-cb.pn-down { background: linear-gradient(180deg, #2a3346, #141b2b); color: #fff; box-shadow: 0 6px 14px rgba(20, 27, 43, .3), inset 0 1px 0 rgba(255, 255, 255, .15); }
.pn-cb:active { transform: scale(.94); }
.pn-cb:disabled { opacity: .35; }

/* лебдење на компјутер */
@media (hover: hover) {
  .pn-scene:hover, .pn-card:hover { box-shadow: var(--pn-shadow-hi); }
  .pn-scene:hover { transform: translateY(-2px); }
  .pn-scene:hover i svg { transform: scale(1.08); }
  .pn-acc:hover { transform: translateY(-2px); }
}

/* остатокот од апликацијата во истиот стил */
.skin-panel .dev, .skin-panel .set-card { background: var(--pn-card); box-shadow: var(--pn-shadow); }
.skin-panel .cam { box-shadow: 0 14px 30px rgba(16, 24, 40, .16); }
.skin-panel .tabbar { background: rgba(255, 255, 255, .9); box-shadow: 0 12px 32px rgba(16, 24, 40, .12), inset 0 1px 0 #fff; }
.skin-pick [data-skin="panel"] i { background: linear-gradient(135deg, #ffffff 0 50%, #ffd23f 50% 70%, #3b8cff 70%); }

@media (min-width: 1024px) {
  .skin-panel #view-home { display: block; }
  .pn-wrap-2 { display: grid; }
  .skin-panel #pn { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; align-items: start; }
  .skin-panel .pn-head, .skin-panel .pn-scenes { grid-column: 1 / -1; }
  .skin-panel .pn-scenes { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .skin-panel .pn-covers { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .pn-head h2 { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) { .pn-scene, .pn-acc, .pn-bulb, .pn-cb, .pn-scene i svg { transition: none; } }
.skin-panel body.at-home .top { display: none; }
.skin-panel body.at-home #pn { padding-top: 18px; }
.pn-scene span { white-space: normal; text-align: center; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12.5px; min-height: 2.3em; }
.pn-covers { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pn-ill svg { max-width: 168px; }
@media (min-width: 1024px) { .skin-panel .pn-covers { grid-template-columns: repeat(auto-fill, minmax(260px, 340px)); } }
@media (max-width: 420px) { .pn-scene span { font-size: 11.5px; letter-spacing: -.01em; padding: 0 2px; } .pn-scenes { gap: 8px; } }

/* Контролна табла: фонт Inter (Inter Display за големите бројки и наслови) */
@font-face { font-family: "PnText"; src: url("/fonts/Inter-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PnText"; src: url("/fonts/Inter-SemiBold.woff") format("woff"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "PnText"; src: url("/fonts/Inter-Bold.woff") format("woff"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "PnDisplay"; src: url("/fonts/InterDisplay-Light.woff") format("woff"); font-weight: 100 400; font-display: swap; }
@font-face { font-family: "PnDisplay"; src: url("/fonts/InterDisplay-Bold.woff") format("woff"); font-weight: 500 900; font-display: swap; }
.skin-panel { --font: "PnText", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.skin-panel body { font-family: var(--font); font-feature-settings: "cv11", "ss01"; letter-spacing: -.005em; }
.skin-panel button, .skin-panel input, .skin-panel select { font-family: inherit; }
.skin-panel h1, .skin-panel h2, .skin-panel h3, .skin-panel .pn-ring b, .skin-panel .room-h h2, .skin-panel .set-title { font-family: "PnDisplay", var(--font); }
.skin-panel .pn-scene, .skin-panel .pn-acc strong, .skin-panel .pn-h h3 { font-weight: 700; }
.skin-panel .pn-h h3 { letter-spacing: -.02em; }

/* заглавие: поздрав лево, голема температура десно */
.pn-head { align-items: center; margin: 8px 4px 22px; gap: 12px; }
.pn-hl { min-width: 0; }
.pn-head h2 { font-family: "PnDisplay", var(--font); font-weight: 700; font-size: 30px; letter-spacing: -.035em; line-height: 1.05; }
.pn-date { font-size: 14.5px; font-weight: 500; color: var(--slate); margin-top: 6px; letter-spacing: 0; }
.pn-wx { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; flex: none; }
.pn-wx-t { display: flex; align-items: center; gap: 4px; }
.pn-wx i svg { width: 52px; height: 52px; }
.pn-wx b { font-family: "PnDisplay", var(--font); font-weight: 300; font-size: 64px; letter-spacing: -.06em; line-height: .9; font-feature-settings: "tnum"; }
.pn-wx span { font-size: 13.5px; font-weight: 500; color: var(--slate); letter-spacing: 0; }
@media (min-width: 720px) {
  .pn-head h2 { font-size: 44px; }
  .pn-date { font-size: 16px; }
  .pn-wx i svg { width: 72px; height: 72px; }
  .pn-wx b { font-size: 92px; }
  .pn-wx span { font-size: 15px; }
}
.skin-panel .pn-ring b { font-weight: 700; letter-spacing: -.03em; }

/* Видеофон без камери: картичка со копче за отклучување (во сите изгледи) */
.door-card { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 14px 14px 16px; border-radius: 26px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe); box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(16, 24, 40, .04), 0 6px 14px rgba(16, 24, 40, .05), 0 22px 44px -16px rgba(16, 24, 40, .14); }
.door-ic svg { width: 46px; height: 46px; display: block; filter: drop-shadow(0 4px 6px rgba(80, 40, 10, .2)); }
.door-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.door-t b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.door-t span { font-size: 13px; font-weight: 600; color: var(--slate); }
.door-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px; border-radius: 18px; font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(180deg, #23c483, #14935f); box-shadow: 0 10px 22px rgba(20, 147, 95, .35), inset 0 1px 0 rgba(255, 255, 255, .25); position: relative; }
.door-btn svg { width: 20px; height: 20px; }
.door-btn.hold::before { background: rgba(255, 255, 255, .35); }
.door-btn.done { background: linear-gradient(180deg, #2fd38f, #17a36b); }
.skin-panel #view-home > #door-card:not([hidden]) { display: flex !important; }
.skin-panel #door-card { margin: 14px 0 0; }

@media (min-width: 1024px) { #view-home > .door-card { grid-column: 1 / -1; max-width: 560px; } }
/* ѕвонење без камери */
.ring-bar { position: fixed; z-index: 30; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 24px; color: #fff;
  background: rgba(20, 24, 34, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 18px 44px rgba(0, 0, 0, .3); animation: ring-in .35s cubic-bezier(.2, .8, .2, 1); }
.ring-ic { font-size: 26px; animation: ring-shake 1s ease-in-out infinite; transform-origin: 50% 10%; }
.ring-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ring-t b { font-size: 15.5px; font-weight: 800; }
.ring-t span { font-size: 12.5px; opacity: .7; font-weight: 600; }
.ring-bar .door-btn { height: 46px; padding: 0 16px; font-size: 15px; }
.ring-x { width: 32px; height: 32px; border-radius: 50%; color: #fff; opacity: .6; font-size: 14px; }
.door-card.ringing { box-shadow: 0 0 0 3px #23c483, 0 18px 40px rgba(20, 147, 95, .3); animation: ring-pulse 1.2s ease-in-out infinite; }
@keyframes ring-in { from { transform: translateY(-120%); } to { transform: none; } }
@keyframes ring-shake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-16deg); } 20%, 40% { transform: rotate(16deg); } }
@keyframes ring-pulse { 50% { box-shadow: 0 0 0 7px rgba(35, 196, 131, .35), 0 18px 40px rgba(20, 147, 95, .3); } }
@media (prefers-reduced-motion: reduce) { .ring-bar, .ring-ic, .door-card.ringing { animation: none; } }
/* таблата: видеофонот до климите, сцените ја полнат ширината */
.skin-panel #pn > #door-card:not([hidden]) { display: flex !important; margin-top: 14px; }
@media (min-width: 1024px) {
  .skin-panel #pn { grid-auto-flow: row dense; }
  .skin-panel #pn > #door-card { align-self: start; }
  .skin-panel .pn-scenes { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .skin-panel .pn-scene i svg { width: 44px; height: 44px; }
  .pn-acc .pn-ring { width: 96px; height: 96px; }
}
@media (min-width: 1024px) {
  .skin-panel #pn > .pn-ac { grid-column: 1; grid-row: span 2; }
  .skin-panel #pn > #door-card, .skin-panel #pn > .pn-lights { grid-column: 2; }
  .skin-panel #pn > .pn-ac[hidden] + #door-card { grid-column: 1; }
}

/* ===== Контролна табла: исти стил во сите табови ===== */
.skin-panel .top { max-width: 1240px; }
.skin-panel .top h1 { font-family: "PnDisplay", var(--font); font-weight: 700; font-size: 34px; letter-spacing: -.035em; }
@media (min-width: 720px) { .skin-panel .top h1 { font-size: 44px; } }
.skin-panel .cats { max-width: none; margin: 0 0 6px; background: transparent; padding: 6px 2px 12px; }
.skin-panel .cat { background: var(--pn-card); box-shadow: var(--pn-shadow); font-weight: 700; border-radius: 16px; padding: 10px 16px 10px 13px; }
.skin-panel .cat.active { background: linear-gradient(180deg, #2a3346, #141b2b); color: #fff; box-shadow: 0 8px 18px rgba(20, 27, 43, .25); }
.skin-panel .room-h h2 { font-family: "PnDisplay", var(--font); font-weight: 700; letter-spacing: -.025em; }

/* картички за уреди */
.skin-panel .dev { border-radius: 26px; padding: 14px 14px 14px; min-height: 176px; transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s; }
.skin-panel .dev .ill { height: 92px; margin: 6px 0 8px; }
.skin-panel .dev .ill svg { max-height: 92px; overflow: visible; }
.skin-panel .dev.dev-light.on .ill svg { filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--c) 50%, transparent)); }
.skin-panel .dev .n { font-weight: 800; font-size: 15.5px; }
.skin-panel .dev .s { font-weight: 600; }
.skin-panel .dev.on { box-shadow: var(--pn-shadow), 0 14px 30px -10px color-mix(in srgb, var(--c) 35%, transparent); }
.skin-panel .dev .tog { background: #e3e8ef; box-shadow: inset 0 1px 2px rgba(16, 24, 40, .1); }
.skin-panel .dev.on .tog { background: var(--c); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15), 0 4px 10px color-mix(in srgb, var(--c) 40%, transparent); }
.skin-panel .dev .mini button { background: linear-gradient(180deg, #f6f8fb, #e9edf3); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(16, 24, 40, .08); border-radius: 12px; height: 36px; }
.skin-panel .dev .mini button[data-act="down"] { background: linear-gradient(180deg, #2a3346, #141b2b); color: #fff; }
.skin-panel .dev-add { background: transparent; box-shadow: none; border: 2px dashed #cfd6e0; color: var(--slate); }
.skin-panel .dev-add:hover { border-color: #2f7bf6; color: #2f7bf6; }
@media (hover: hover) { .skin-panel .dev:hover { transform: translateY(-3px); box-shadow: var(--pn-shadow-hi); } }

/* поставки */
.skin-panel .set-card { border-radius: 26px; }
.skin-panel .set-title, .skin-panel .hk-head .t { font-family: "PnDisplay", var(--font); font-weight: 700; letter-spacing: -.02em; }
.skin-panel .set-card > .set-title:first-child { font-size: 18px; }
.skin-panel .pill-btn:not(.primary) { background: linear-gradient(180deg, #f6f8fb, #e9edf3); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(16, 24, 40, .08); font-weight: 700; }
.skin-panel .pill-btn.primary, .skin-panel .btn-primary { background: linear-gradient(180deg, #2a3346, #141b2b); color: #fff; box-shadow: 0 8px 18px rgba(20, 27, 43, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.skin-panel .text-btn:not(.danger) { color: #2f7bf6; font-weight: 800; }
.skin-panel .switch[aria-checked="true"] { background: #2f7bf6; }
.skin-panel .field input, .skin-panel .name-field, .skin-panel .enc-in input, .skin-panel .ic-form select { background: #f1f4f8; box-shadow: inset 0 1px 2px rgba(16, 24, 40, .06); }
.skin-panel .field input:focus { border-color: #2f7bf6; background: #fff; }
.skin-panel .seg-mini { background: #eef1f6; }
.skin-panel .hk-pin-box { background: linear-gradient(180deg, #fff8ea, #fff2d8); }

/* панел за уред и прозорци */
.skin-panel .sheet, .skin-panel .modal-card { background: linear-gradient(180deg, #ffffff, #f9fafc); }
.skin-panel .sheet-head h2 { font-family: "PnDisplay", var(--font); font-weight: 700; letter-spacing: -.03em; }
.skin-panel .mode-btn { border-radius: 18px; background: linear-gradient(180deg, #f6f8fb, #e9edf3); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(16, 24, 40, .06); font-weight: 700; }
.skin-panel .mode-btn.active { background: var(--mode); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--mode) 35%, transparent); }
.skin-panel .dial-wrap .num, .skin-panel #d-temp { font-family: "PnDisplay", var(--font); }

/* најава: без страничната лента */
@media (min-width: 1024px) { body:has(.login-wrap) { padding-left: 32px; } }
.skin-panel .login { box-shadow: var(--pn-shadow-hi); border-radius: 30px; }
.skin-panel .login h1 { font-family: "PnDisplay", var(--font); font-weight: 700; letter-spacing: -.03em; }
.skin-panel #view-devices .cats { background: rgba(241, 243, 247, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); margin: 0 -16px 6px; padding: 8px 16px 12px; }
@media (min-width: 1024px) { .skin-panel #view-devices .cats { margin: 0 -8px 6px; padding: 8px 8px 12px; } }
/* сијалица: клик = поставки, копче горе = вклучи/исклучи */
.pn-bulb { position: relative; cursor: pointer; padding-top: 10px; }
.pn-pw { position: absolute; top: 2px; right: 6px; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #f6f8fb, #e6eaf0); color: #8a93a3; box-shadow: inset 0 1px 0 #fff, 0 2px 5px rgba(16, 24, 40, .12); transition: transform .12s; }
.pn-pw svg { width: 15px; height: 15px; }
.pn-bulb.on .pn-pw { background: var(--c); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35); }
.pn-pw:active { transform: scale(.88); }
.pn-bulbs { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.pn-bulb { padding-top: 26px; }
.pn-pw { top: 0; right: 2px; width: 28px; height: 28px; }
/* келвини како во WiZ */
.kelvin-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.kelvin-val { font-size: 14px; font-weight: 800; color: var(--ink); }
.kelvin { height: 48px; border-radius: 24px; }
.kelvin-knob { width: 34px; height: 34px; box-shadow: 0 3px 10px rgba(0, 0, 0, .28), inset 0 0 0 2px rgba(0, 0, 0, .04); }
.kelvin-labels { position: relative; height: 18px; display: block; margin: 8px 4px 0; font-size: 12px; font-weight: 700; color: var(--slate); }
.kelvin-labels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.kelvin-labels span:first-child { transform: none; }
.kelvin-labels span:last-child { transform: translateX(-100%); }
.k-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.k-preset { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 9px; border-radius: 16px; background: var(--bg); font-size: 13px; font-weight: 700; color: var(--ink); transition: transform .12s, box-shadow .15s; }
.k-preset i { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .08), 0 2px 8px rgba(0, 0, 0, .12); }
.k-preset small { font-size: 11.5px; font-weight: 700; color: var(--slate); }
.k-preset.active { box-shadow: 0 0 0 2px var(--ink) inset; background: var(--paper); }
.k-preset:active { transform: scale(.96); }
.skin-panel .k-preset { background: linear-gradient(180deg, #f6f8fb, #ecf0f5); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(16, 24, 40, .06); }
.skin-panel .k-preset.active { background: #fff; box-shadow: 0 0 0 2px #2f7bf6, 0 6px 14px rgba(47, 123, 246, .18); }

/* ===== Светло: Бело / Боја / Сцени (како WiZ) ===== */
.l-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); margin: 22px 0 -6px; padding: 4px; border-radius: 14px; }
.l-tabs button { padding: 10px 8px; border-radius: 11px; font-size: 14.5px; }
.l-tabs button[hidden] { display: none; }
.hue, .sat { position: relative; height: 44px; border-radius: 22px; touch-action: none; cursor: ew-resize; box-shadow: inset 0 0 0 1px rgba(27, 36, 48, .06); }
.hue { background: linear-gradient(90deg, #ff0000, #ffaa00 10%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0066ff 66%, #aa00ff 80%, #ff00aa 92%, #ff0000); }
.sat { margin-top: 12px; background: linear-gradient(90deg, #fff, #ff8a00); }
.sat-labels { margin-bottom: 14px; }
.c-prev { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7), 0 2px 8px rgba(0, 0, 0, .18); }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.fx { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 9px; border-radius: 16px; background: var(--bg); font-size: 12.5px; font-weight: 700; color: var(--ink); text-align: center; line-height: 1.15; transition: transform .12s, box-shadow .15s; }
.fx i { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .12), inset 0 2px 3px rgba(255, 255, 255, .5), 0 3px 8px rgba(0, 0, 0, .15); }
.fx.active { background: var(--paper); box-shadow: 0 0 0 2px #2f7bf6, 0 6px 14px rgba(47, 123, 246, .18); }
.fx.active i { animation: fx-glow 2.4s ease-in-out infinite; }
.fx:active { transform: scale(.95); }
@keyframes fx-glow { 50% { filter: saturate(1.4) brightness(1.1); transform: scale(1.08); } }
.fx-speed { margin-top: 18px; }
.fx-speed input[type=range] { width: 100%; accent-color: #2f7bf6; height: 28px; }
.skin-panel .fx { background: linear-gradient(180deg, #f6f8fb, #ecf0f5); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(16, 24, 40, .06); }
.skin-panel .fx.active { background: #fff; box-shadow: 0 0 0 2px #2f7bf6, 0 6px 14px rgba(47, 123, 246, .18); }
@media (prefers-reduced-motion: reduce) { .fx.active i { animation: none; } }
.kelvin-labels.sat-labels { display: flex; justify-content: space-between; height: auto; } .kelvin-labels.sat-labels span { position: static; transform: none; }

/* ---- WiZ соби и Apple Home помош ---- */
.wiz-room { padding: 12px 2px; border-top: 1px solid var(--hair); }
.wr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wr-form { display: flex; gap: 8px; margin-top: 8px; }
.wr-in { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--hair); background: var(--paper); color: var(--ink); }
.wr-in:focus { outline: none; border-color: var(--cool); }
.skin-panel .wr-in { background: #f1f4f8; box-shadow: inset 0 1px 2px rgba(16, 24, 40, .06); border-color: transparent; }
.skin-panel .wr-in:focus { border-color: #2f7bf6; background: #fff; }
#wiz-rooms { margin-top: 6px; }
#wiz-rooms > .s { margin: 4px 2px 6px; }
.hk-help { display: grid; gap: 8px; margin: 10px 0 4px; }
.hk-help .pill-btn { justify-self: start; }

/* ---- Сцени со икони, како во WiZ ---- */
.fx i { position: relative; width: 50px; height: 50px; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), transparent 55%), linear-gradient(140deg, var(--c1, #c3ccd6), var(--c2, #eef1f6));
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .14), inset 0 2px 3px rgba(255, 255, 255, .6), 0 4px 12px color-mix(in srgb, var(--c1, #999) 40%, transparent); }
.fx i::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c2, #ccc) 55%, transparent), transparent 70%); z-index: -1; opacity: 0; transition: opacity .2s; }
.fx.active i::before { opacity: 1; }
.fx i svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .3)); }
.fx i.lt { color: #364152; }
.fx i.lt svg { filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .7)); }
.fx { isolation: isolate; padding: 12px 4px 10px; gap: 8px; }
.fx-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.fx-sec { margin-top: 18px; }
.fx-sec .group-title { margin-bottom: 10px; }

/* ---- Заглавие: дома и надвор, две еднакво големи температури ---- */
.skin-panel .pn-head { display: block; margin: 8px 4px 20px; }
.pn-temps { display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px; position: relative; }
.pn-temps[hidden] { display: none; }
.pn-temps:has(> .pn-tb[hidden]) { grid-template-columns: 1fr; }
.pn-temps::before { content: ""; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(transparent, #d9e0e9 20%, #d9e0e9 80%, transparent); }
.pn-temps:has(> .pn-tb[hidden])::before { display: none; }
.skin-panel .pn-tb { display: flex; align-items: center; gap: 10px; min-width: 0; flex-direction: row; text-align: left; }
.skin-panel .pn-tb[hidden] { display: none; }
.skin-panel .pn-wx { padding-left: 16px; }
.skin-panel .pn-tb > i { flex: none; display: block; }
.skin-panel .pn-tb > i svg { width: 50px; height: 50px; display: block; }
.skin-panel .pn-tb > div { min-width: 0; }
.skin-panel .pn-tb b { display: block; font-family: "PnDisplay", var(--font); font-weight: 300; font-size: 56px; letter-spacing: -.06em; line-height: .95; font-feature-settings: "tnum"; color: var(--ink); }
.skin-panel .pn-tb span { display: block; margin-top: 4px; }
.skin-panel .pn-tb em { display: block; font-style: normal; font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.skin-panel .pn-tb small { display: block; font-size: 12.5px; font-weight: 500; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 370px) {
  .skin-panel .pn-tb b { font-size: 46px; }
  .skin-panel .pn-tb > i svg { width: 40px; height: 40px; }
}
@media (min-width: 720px) {
  .skin-panel .pn-tb b { font-size: 84px; }
  .skin-panel .pn-tb > i svg { width: 68px; height: 68px; }
  .skin-panel .pn-tb em { font-size: 16px; }
  .skin-panel .pn-tb small { font-size: 14px; }
}

/* ---- Светла по соби (како WiZ) ---- */
.pn-rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pn-room { --c: #ffd36b; position: relative; display: flex; flex-direction: column; min-height: 132px; padding: 12px 12px 0; border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, #f6f8fb, #edf1f6); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(16, 24, 40, .06); cursor: pointer; user-select: none; -webkit-touch-callout: none; transition: transform .15s, background .25s, box-shadow .25s; }
.pn-room.on { background: linear-gradient(180deg, #fffdf7, color-mix(in srgb, var(--c) 16%, #fff)); box-shadow: inset 0 1px 0 #fff, 0 8px 22px color-mix(in srgb, var(--c) 26%, transparent); }
.pn-room:active { transform: scale(.97); }
.pn-room:focus-visible { outline: 3px solid #2f7bf6; outline-offset: 2px; }
.pr-top { display: flex; justify-content: space-between; align-items: flex-start; }
.pr-top i svg { width: 34px; height: 40px; display: block; overflow: visible; }
.pn-room.on .pr-top i svg { filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--c) 60%, transparent)); }
.pn-room b { margin-top: 8px; font-size: 16px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-room small { font-size: 12.5px; font-weight: 500; color: var(--slate); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-room.unnamed b { color: var(--slate); }
.pn-room.unnamed small { color: #2f7bf6; font-weight: 600; }
.pr-bar { margin: auto -12px 0; margin-top: 12px; height: 14px; background: rgba(16, 24, 40, .07); position: relative; touch-action: none; }
.pr-bar[hidden] { display: none; }
.pr-bar span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); border-radius: 0 7px 7px 0; transition: width .2s; }
.pr-bar:focus-visible { outline: 3px solid #2f7bf6; outline-offset: -3px; }
.pn-room .switch { flex: none; }
.pn-back { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 6px -4px; padding: 4px 6px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #2f7bf6; }
.pn-back svg { width: 18px; height: 18px; }
.pn-name-room { margin-top: 12px; }
.rn-card { display: grid; gap: 12px; }
.rn-card .s { margin: 0; }
.rn-card #rn-blink { justify-self: start; }
.rn-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
@media (prefers-reduced-motion: reduce) { .pn-room, .pr-bar span { transition: none; } }

/* ---- Сијалица без струја (исклучена на прекинувач) ---- */
.pn-bulb.dead i svg { filter: grayscale(1); opacity: .45; }
.pn-bulb.dead span { color: #9aa4b1; }
.pn-dead { font-size: 11px; font-weight: 600; color: #9aa4b1; margin-top: -1px; }
.pn-bulb.dead .pn-pw { opacity: .35; pointer-events: none; }
.pn-room.dead { background: repeating-linear-gradient(135deg, #f1f3f6 0 10px, #eceff3 10px 20px); }
.pn-room.dead .pr-top i svg { filter: grayscale(1); opacity: .45; }
.pn-room.dead b, .pn-room.dead small { color: #9aa4b1; }
.pn-room .switch:disabled { opacity: .4; }
.l-dead { display: grid; gap: 4px; padding: 14px 16px; margin-bottom: 14px; border-radius: 16px; background: #f1f3f6; color: var(--slate); font-size: 14px; line-height: 1.35; }
.l-dead b { color: var(--ink); font-size: 15px; }
.sheet.dead [data-body="light"] > :not(.l-dead) { opacity: .4; pointer-events: none; }

/* ---- Цела соба: јачина и сцени ---- */
.pn-rctl { margin-top: 18px; display: grid; gap: 18px; }
.pn-rbright { --c: #ffd36b; }
.pn-rbright .group-title { display: flex; justify-content: space-between; margin-bottom: 8px; }
.pn-rbright .group-title .num { color: var(--slate); font-weight: 600; }
.pr-bar.big { margin: 0; height: 40px; border-radius: 14px; overflow: hidden; background: #edf0f4; box-shadow: inset 0 1px 3px rgba(16, 24, 40, .08); cursor: pointer; }
.pr-bar.big span { border-radius: 0; }
.pn-rfx-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pn-rfx-h .group-title { margin: 0; }
.pn-rfx .seg-mini[hidden] { display: none; }
.pn-lights .pn-h span, .pn-lights .pn-h em, .pn-lights .pn-link { white-space: nowrap; }
.pn-lights .pn-h { flex-wrap: wrap; row-gap: 4px; }
.pn-name-room { margin-top: 18px; }

/* ---- Мои сцени ---- */
.pn-my-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pn-mys { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: 18px; background: linear-gradient(180deg, #f6f8fb, #ecf0f5); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(16, 24, 40, .06); font-size: 12.5px; font-weight: 700; color: var(--ink); text-align: center; line-height: 1.15; cursor: pointer; transition: transform .12s; }
.pn-mys:active, .pn-mys.pressed { transform: scale(.95); }
.pn-mys i svg { width: 48px; height: 48px; display: block; filter: drop-shadow(0 4px 8px rgba(16, 24, 40, .15)); }
.pn-mys span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pn-mys.add { color: #2f7bf6; background: transparent; box-shadow: inset 0 0 0 1.5px #c9d6ea; }
.pn-mys.add i { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: #eaf1fd; }
.pn-mys.add i svg { width: 22px; height: 22px; filter: none; }
.pn-mys-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: #e5484d; color: #fff; font-size: 18px; font-weight: 700; line-height: 1; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(229, 72, 77, .35); }
.pn-mys-x[hidden] { display: none; }
.pn-scene i svg { overflow: visible; }

/* ---- Слика од вратата во лентата за ѕвонење ---- */
.ring-snap { width: 88px; height: 66px; object-fit: cover; border-radius: 12px; flex: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.ring-bar.has-snap .ring-ic { display: none; }
@media (min-width: 560px) { .ring-snap { width: 120px; height: 90px; } }

/* ---- Паметна куќа ---- */
.smart-sec { padding: 14px 0 6px; border-top: 1px solid var(--hair); margin-top: 12px; }
.smart-sec:first-child { border-top: 0; margin-top: 4px; }
.smart-h { font-size: 16px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 2px; }
.smart-sec > .s { margin-bottom: 6px; }
.smart-sec .warn { color: #b45309; background: #fff7e6; border-radius: 12px; padding: 10px 12px; margin: 6px 0; }
.smart-sec .pill-btn { margin-top: 8px; }
.smart-sec .form-row input[type="number"] { width: 90px; }

/* ---- Историја на клима ---- */
.ac-hist { position: relative; }
.hist-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--slate); font-weight: 600; margin: -2px 0 6px; }
.hist-legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.lg-room::before { background: #2f7bf6; }
.lg-set::before { background: repeating-linear-gradient(90deg, #e2553a 0 4px, transparent 4px 7px); }
.lg-run::before { height: 10px !important; background: rgba(226, 85, 58, .14); }
.hist-chart { position: relative; }
.hist-chart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.h-grid { stroke: #e6eaf0; stroke-width: 1; }
.h-ax { font-size: 9.5px; fill: #8a94a3; font-family: inherit; }
.h-room { fill: none; stroke: #2f7bf6; stroke-width: 2; stroke-linejoin: round; }
.h-set { fill: none; stroke: #e2553a; stroke-width: 1.6; stroke-dasharray: 4 3; }
.h-run { fill: rgba(47, 123, 246, .10); }
.h-run.heat { fill: rgba(226, 85, 58, .12); }
.h-cross { stroke: #8a94a3; stroke-width: 1; }
.h-tip { position: absolute; top: -6px; width: 150px; padding: 6px 8px; border-radius: 10px; background: rgba(20, 24, 34, .92); color: #fff; font-size: 11.5px; font-weight: 600; text-align: center; pointer-events: none; }
.hist-t2 { margin-top: 18px; }
.hist-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 120px; }
.hb { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.hb i { flex: 1; width: 100%; max-width: 26px; display: flex; align-items: flex-end; background: #f0f3f7; border-radius: 6px; overflow: hidden; }
.hb b { width: 100%; background: linear-gradient(180deg, #5b9dff, #2f7bf6); border-radius: 4px 4px 0 0; }
.hb-v { font-size: 10.5px; font-weight: 700; color: var(--slate); min-height: 13px; white-space: nowrap; }
.hb-d { font-size: 11px; font-weight: 600; color: var(--slate); }

/* ---- Таблет на ѕид ---- */
.pn-clock { display: none; }
html.tablet.skin-panel .pn-clock { display: block; }
html.tablet .pn-head { position: relative; }
html.tablet .pn-clock { position: absolute; right: 4px; top: 0; font-family: "PnDisplay", var(--font); font-weight: 300; font-size: 64px; letter-spacing: -.05em; line-height: 1; color: var(--ink); }
@media (min-width: 1024px) {
  html.tablet body { padding-left: 124px; padding-right: 24px; }
  html.tablet .tabbar { width: 84px; padding: 18px 10px; align-items: center; }
  html.tablet .tabbar .brand { padding: 4px 0 22px; }
  html.tablet .tabbar .brand span { display: none; }
  html.tablet .tabbar button { justify-content: center; padding: 14px; font-size: 0; gap: 0; }
  html.tablet .tabbar button svg { width: 26px; height: 26px; }
  html.tablet .top, html.tablet .view, html.tablet #main { max-width: none; }
  html.tablet .pn-clock { font-size: 96px; }
}
html.tablet .pn-scene, html.tablet .pn-room, html.tablet .pn-acc { min-height: 0; }
html.tablet .pn-scene span { font-size: 15px; }
.tb-dim { position: fixed; inset: 0; z-index: 60; background: #05070b; color: #c9d1db; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.tb-dim[hidden] { display: none; }
.tb-dim-time { font-family: "PnDisplay", var(--font); font-weight: 300; font-size: clamp(80px, 18vw, 220px); letter-spacing: -.05em; line-height: 1; color: #8f9aa8; }
.tb-dim-sub { font-size: 22px; font-weight: 600; color: #5d6773; }

/* ---- Пристап однадвор: чекори ---- */
.remote-steps { margin-top: 10px; border-radius: 16px; background: #f3f6fa; padding: 10px 14px; }
.remote-steps summary { cursor: pointer; font-weight: 700; color: #2f7bf6; font-size: 14.5px; padding: 4px 0; }
.remote-steps ol { margin: 10px 0 8px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; color: var(--ink); }
.remote-steps i { font-style: normal; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #fff; padding: 0 4px; border-radius: 5px; }
.smart-sec .form-row select { min-width: 160px; }
.smart-sec .form-row > span { flex: 1; min-width: 0; }
/* децимален број во кругот (24.5°) — помал, да не влегува во лакот */
.pn-ring b.dec { font-size: 16px; letter-spacing: -.04em; }
.pn-acc .pn-ring b.dec { font-size: 17px; }

/* ---- Струја ---- */
.pn-energy { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px 20px; cursor: pointer; font: inherit; color: inherit; border: 0; }
.pn-energy[hidden] { display: none; }
.pn-energy > i svg { width: 46px; height: 46px; display: block; }
.pn-energy > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pn-energy b { font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-family: "PnDisplay", var(--font); }
.pn-energy small { font-size: 13px; color: var(--slate); font-weight: 500; }
.pn-energy strong { font-family: "PnDisplay", var(--font); font-weight: 300; font-size: 30px; letter-spacing: -.04em; white-space: nowrap; }
.s-energy { display: block; margin: 14px auto 0; padding: 8px 14px; border-radius: 14px; background: #fff8e1; color: #8a5a00; font: inherit; font-size: 13.5px; font-weight: 600; border: 0; cursor: pointer; }
.s-energy[hidden] { display: none; }
.en-modal { align-items: flex-end; }
.en-card { width: min(560px, 100%); max-height: 92vh; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.en-head { display: flex; align-items: center; gap: 10px; }
.en-head h2 { flex: 1; margin: 0; font-size: 20px; }
.en-x { color: var(--slate); opacity: 1; background: #eef1f5; }
.en-seg { justify-self: start; }
.en-hero { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.en-hero #en-total { font-family: "PnDisplay", var(--font); font-weight: 300; font-size: 56px; letter-spacing: -.05em; line-height: 1; }
.en-unit { font-size: 18px; font-weight: 700; color: var(--slate); }
.en-cost { margin-left: auto; font-size: 18px; font-weight: 700; color: #2f9e5f; background: #e9f8ef; border-radius: 12px; padding: 4px 10px; }
.en-settings { background: #f5f7fa; border-radius: 16px; padding: 6px 12px 10px; }
.en-settings select, .en-settings input { max-width: 190px; }
.en-list { display: grid; gap: 4px; margin-top: 6px; }
.en-list.loading { opacity: .5; }
.en-row { padding: 10px 2px; border-top: 1px solid var(--hair); }
.en-top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.en-top b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.en-v { font-weight: 700; white-space: nowrap; }
.en-bar { height: 8px; border-radius: 4px; background: #eef1f5; margin: 6px 0 4px; overflow: hidden; }
.en-bar i { display: block; height: 100%; border-radius: 4px; }
.en-bar i.ac { background: #2f7bf6; }
.en-bar i.light { background: #f59f00; }
.en-meta { font-size: 12.5px; color: var(--slate); }
.en-w { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--slate); }
.en-w input { width: 90px; font: inherit; font-size: 15px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--hair); background: #fff; }
.en-note { margin: 6px 0 0; }
.pn-energy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-energy strong em { font-style: normal; font-family: var(--font); font-size: 14px; font-weight: 700; color: var(--slate); margin-left: 4px; letter-spacing: 0; }

/* ===== Наши контроли (наместо стандардните од прелистувачот) ===== */
.ui-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; clip-path: inset(50%); }
/* копчиња еден до друг */
.ui-seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 14px; background: #eef1f5; max-width: 100%; }
.ui-seg button { flex: 1 1 auto; min-height: 36px; padding: 0 14px; border: 0; border-radius: 11px; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--slate); white-space: nowrap; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.ui-seg button[aria-checked="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.ui-seg button:focus-visible { outline: 2px solid #2f7bf6; outline-offset: 1px; }
.ui-seg.disabled { opacity: .5; pointer-events: none; }
.smart-in > .ui-seg { display: flex; margin: 4px 0 2px; }
/* копче со список */
.ui-pick { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 40px; max-width: 62%; padding: 0 10px 0 14px; border: 0; border-radius: 12px; background: #f1f4f8; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .04); }
.ui-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-pick svg { width: 18px; height: 18px; flex: none; color: var(--slate); }
.ui-pick:hover { background: #e9edf3; }
.ui-pick:focus-visible { outline: 2px solid #2f7bf6; outline-offset: 2px; }
.ui-pick[aria-expanded="true"] { background: #e8f0fe; color: #1d5fd1; }
.ui-pick:disabled { opacity: .5; cursor: default; }
.ui-room-select { background: #fff; }
.ui-pop { position: fixed; inset: 0; z-index: 90; }
.ui-pop[hidden] { display: none; }
.ui-pop-back { position: absolute; inset: 0; }
.ui-pop-card { position: absolute; max-height: 360px; overflow-y: auto; background: #fff; border-radius: 16px; padding: 6px; box-shadow: 0 18px 50px rgba(16, 24, 40, .22), 0 0 0 1px rgba(16, 24, 40, .06); }
.ui-pop-title { padding: 10px 12px 6px; font-size: 13px; font-weight: 700; color: var(--slate); }
.ui-pop:not(.ui-bottom) .ui-pop-title { display: none; }
.ui-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 11px; background: transparent; font: inherit; font-size: 15.5px; color: var(--ink); text-align: left; cursor: pointer; }
.ui-opt:hover, .ui-opt:focus-visible { background: #f1f4f8; outline: none; }
.ui-opt[aria-selected="true"] { color: #1d5fd1; font-weight: 700; }
.ui-opt i { width: 20px; height: 20px; flex: none; color: #2f7bf6; }
.ui-opt i svg { width: 20px; height: 20px; display: block; }
.ui-pop.ui-bottom .ui-pop-back { background: rgba(16, 24, 40, .35); animation: uiFade .18s ease-out; }
.ui-pop.ui-bottom .ui-pop-card { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); max-height: 70vh; border-radius: 22px; padding: 8px; animation: uiUp .22s cubic-bezier(.2, .8, .2, 1); }
.ui-pop.ui-bottom .ui-opt { min-height: 50px; font-size: 16.5px; }
@keyframes uiUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes uiFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ui-pop.ui-bottom .ui-pop-card, .ui-pop.ui-bottom .ui-pop-back { animation: none; } }
/* − вредност + */
.ui-step { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 14px; background: #f1f4f8; flex: none; }
.ui-step button { width: 36px; height: 36px; border: 0; border-radius: 11px; background: #fff; color: var(--ink); font: inherit; font-size: 20px; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); touch-action: manipulation; user-select: none; }
.ui-step button:active { background: #e8f0fe; }
.ui-step button:disabled { opacity: .35; cursor: default; }
.ui-step .ui-step-in, .form-row .ui-step input.ui-step-in { width: 58px !important; max-width: none; padding: 0 4px; border: 0; background: transparent; text-align: center; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
.ui-step .ui-step-in::-webkit-outer-spin-button, .ui-step .ui-step-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ui-step .ui-step-in:focus { outline: none; }
.ui-step:focus-within { box-shadow: 0 0 0 2px #2f7bf6; }
.ui-time { font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); background: #f1f4f8; border: 0; border-radius: 12px; padding: 8px 12px; min-height: 40px; }

/* ===== Паметна куќа: категории ===== */
.smart-card #smart-body { display: grid; gap: 10px; margin-top: 12px; }
.smart-cat { border-radius: 18px; background: #f6f8fb; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .05); overflow: hidden; }
.smart-cat[open] { background: #fff; box-shadow: 0 6px 20px rgba(16, 24, 40, .07), inset 0 0 0 1px rgba(16, 24, 40, .05); }
.smart-cat summary { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 14px 14px; cursor: pointer; list-style: none; }
.smart-cat summary::-webkit-details-marker { display: none; }
.smart-cat summary:focus-visible { outline: 2px solid #2f7bf6; outline-offset: -2px; border-radius: 18px; }
.smart-ic { width: 42px; height: 42px; border-radius: 13px; background: #fff; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
.smart-ic svg { width: 26px; height: 26px; }
.smart-tt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.smart-tt b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.smart-tt small { font-size: 13px; line-height: 1.35; color: var(--slate); }
.smart-st { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--slate); background: #eef1f5; border-radius: 999px; padding: 4px 10px; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.smart-st.on { color: #157347; background: #e3f6ea; }
.smart-chev svg { width: 18px; height: 18px; color: #9aa4b1; transition: transform .2s; display: block; }
.smart-cat[open] .smart-chev svg { transform: rotate(90deg); }
.smart-in { padding: 0 14px 14px; display: grid; gap: 2px; border-top: 1px solid var(--hair); }
.smart-in > .set-row:first-child { margin-top: 6px; }
.smart-sub { margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--slate); letter-spacing: .01em; }
.smart-hint { margin: 4px 2px 6px; }
.smart-in .warn { color: #8a5a00; background: #fff7e6; border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.smart-in .pill-btn { justify-self: start; margin-top: 10px; }
.smart-f { padding: 6px 2px; }
@media (max-width: 420px) {
  .smart-cat summary { grid-template-columns: auto 1fr auto; }
  .smart-st { grid-column: 2; justify-self: start; }
  .smart-chev { grid-row: 1; grid-column: 3; }
  .smart-ic { grid-row: 1 / span 2; }
}
.smart-cat summary { align-items: start; }
.smart-chev { align-self: center; }
@media (max-width: 420px) { .smart-ic { grid-row: 1; align-self: start; } .smart-st { margin-top: 2px; } }

/* =====================================================================
   УСОГЛАСЕНО со почетната: едно акцентно сина, исти копчиња, наслови,
   полиња, картички и прозорци насекаде (тема „Контролна табла“)
   ===================================================================== */
.skin-panel {
  --pn-blue: #2f7bf6; --pn-blue-2: #1f62d6; --pn-blue-soft: #e8f0fe;
  --pn-field: #f1f4f8; --pn-r-card: 28px; --pn-r-ctl: 14px;
}
/* наслови */
.skin-panel .set-card > .set-title:first-child, .skin-panel .en-head h2, .skin-panel .modal-card h2, .skin-panel .sheet h2 {
  font-family: "PnDisplay", var(--font); font-size: 19px; font-weight: 900; letter-spacing: -.02em; color: var(--ink);
}
.skin-panel .set-title { font-size: 15px; font-weight: 800; }
.skin-panel .set-card { border-radius: var(--pn-r-card); padding: 18px; }
/* групи во поставки */
.set-group { margin: 30px 4px 2px; }
.set-group:first-child { margin-top: 6px; }
.set-group h2 { margin: 0; font-family: "PnDisplay", var(--font); font-size: 24px; font-weight: 900; letter-spacing: -.03em; color: var(--ink); }
.set-group p { margin: 2px 0 0; font-size: 14px; color: var(--slate); }
.set-group[hidden] { display: none; }
@media (min-width: 720px) { .set-group { column-span: all; break-after: avoid; margin-bottom: 12px; } }
/* главни копчиња: сино како прекинувачите и врските */
.skin-panel .pill-btn.primary, .skin-panel .btn-primary {
  background: linear-gradient(180deg, #4a90ff, var(--pn-blue-2)); color: #fff; border: 0;
  box-shadow: 0 8px 18px rgba(47, 123, 246, .28), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.skin-panel .pill-btn.primary:active, .skin-panel .btn-primary:active { filter: brightness(.95); transform: scale(.98); }
.skin-panel .btn-primary { border-radius: var(--pn-r-ctl); font-weight: 700; }
/* споредни копчиња */
.skin-panel .pill-btn { white-space: nowrap; border-radius: 999px; font-weight: 700; background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .12), inset 0 0 0 1px rgba(16, 24, 40, .06); }
.skin-panel .pill-btn:not(.primary):active { background: var(--pn-blue-soft); }
.skin-panel .text-btn { color: var(--pn-blue); font-weight: 700; }
/* активни избори (филтри по категории, ролетна долу) — сино наместо црно */
.skin-panel .cat.active { background: linear-gradient(180deg, #4a90ff, var(--pn-blue-2)); color: #fff; box-shadow: 0 8px 18px rgba(47, 123, 246, .25); }
.skin-panel .pn-cb.pn-down, .skin-panel .dev .mini button[data-act="down"] { background: linear-gradient(180deg, #4a90ff, var(--pn-blue-2)); color: #fff; box-shadow: 0 6px 14px rgba(47, 123, 246, .3), inset 0 1px 0 rgba(255, 255, 255, .2); }
/* полиња за пишување */
.skin-panel .field input, .skin-panel .form-row input:not(.ui-step-in):not([type="checkbox"]), .skin-panel .name-field, .skin-panel .wr-in, .skin-panel .en-w input, .skin-panel textarea {
  background: var(--pn-field); border: 1.5px solid transparent; border-radius: var(--pn-r-ctl); box-shadow: none; color: var(--ink); font-weight: 600;
}
.skin-panel .field input:focus, .skin-panel .form-row input:focus, .skin-panel .wr-in:focus, .skin-panel .en-w input:focus {
  outline: none; border-color: var(--pn-blue); background: #fff; box-shadow: 0 0 0 4px rgba(47, 123, 246, .12);
}
.skin-panel .field > span, .skin-panel .form-row > span { color: var(--ink); font-weight: 700; }
/* нашите контроли да ја следат истата мера */
.skin-panel .ui-pick, .skin-panel .ui-step, .skin-panel .ui-seg { border-radius: var(--pn-r-ctl); }
.skin-panel .ui-seg button { border-radius: 11px; }
/* лизгачи */
.skin-panel input[type="range"] { accent-color: var(--pn-blue); }
/* прекинувачи — исто сино */
.skin-panel #view-settings .switch[aria-checked="true"], .skin-panel .modal .switch[aria-checked="true"] { background: var(--pn-blue); }
/* прозорци */
.skin-panel .modal-card { border-radius: var(--pn-r-card); box-shadow: 0 30px 80px rgba(16, 24, 40, .25); }
.skin-panel .toast { border-radius: 999px; font-weight: 600; }
/* редови во листи */
.skin-panel .set-row .t { font-weight: 700; }
.skin-panel .set-row .s, .skin-panel .set-card > .s { color: var(--slate); }

/* ---- Струја: подредено како картички на почетната ---- */
.en-hero { display: flex; align-items: center; gap: 14px; margin-top: 8px; padding: 16px; border-radius: 22px; background: linear-gradient(135deg, #fff9e6, #fff); box-shadow: inset 0 0 0 1px rgba(245, 159, 0, .15); }
.en-hero > div { flex: 1; min-width: 0; }
.en-bolt svg { width: 52px; height: 52px; display: block; }
.en-hl { display: flex; align-items: baseline; gap: 6px; }
.en-hero #en-total { font-size: 48px; }
.en-hero .s { margin-top: 2px; }
.en-cost { margin-left: 0; align-self: flex-start; }
.en-list { gap: 8px; margin-top: 10px; }
.en-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 18px; background: #f6f8fb; flex-wrap: wrap; }
.en-ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
.en-ic svg { width: 34px; height: 34px; display: block; }
.en-main { flex: 1; min-width: 0; }
.en-top b { font-size: 15px; }
.en-v { font-size: 15px; }
.en-bar { height: 6px; margin: 7px 0 6px; background: #e9edf2; }
.en-bar i.light { background: linear-gradient(90deg, #ffd25c, #f59f00); }
.en-bar i.ac { background: linear-gradient(90deg, #6aa8ff, #2f7bf6); }
.en-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.en-tag { flex: none; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef1f5; color: var(--slate); }
.en-tag.measured { background: #e3f6ea; color: #157347; }
.en-tag.estimated { background: #fff3d6; color: #8a5a00; }
.en-m { font-size: 12.5px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.en-w { flex-basis: 100%; padding-left: 56px; }
.en-note { font-size: 13px; color: var(--slate); }
.en-card { background: #fff; }
.en-hero .en-cost { display: inline-block; margin-top: 8px; font-size: 15px; }
.smart-st { max-width: 190px; }

/* ---- Поставки на широк екран: една колона, без празнини, мени на групите лево ---- */
@media (min-width: 720px) {
  #view-settings { column-count: auto !important; columns: auto !important; max-width: 760px; margin-left: max(0px, calc((100% - 1240px) / 2)); margin-right: auto; }
  #view-settings .set-card:not([hidden]) { display: block !important; width: auto !important; margin: 14px 0 0 !important; }
  .set-group { column-span: none; margin: 34px 4px 0; }
}
.set-sec[hidden] { display: none; }
.set-colm:empty { display: none; }
@media (min-width: 1180px) {
  #view-settings { max-width: 1240px !important; }
  .set-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .set-colm > .set-sec:first-child > .set-group { margin-top: 10px; }
}
/* почетна: две независни колони (климите и струјата лево; вратата и светлата десно) */
.pn-cols { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; align-items: start; }
.pn-col { display: flex; flex-direction: column; min-width: 0; }
.pn-col > *:first-child { margin-top: 14px; }
.skin-panel .pn-col > #door-card:not([hidden]) { display: flex !important; }
.pn-col > [hidden] { display: none !important; }

/* распоред: денови и светла по соби */
#sched-days { display: block; padding: 6px 0 4px; }
.day-pres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.day-pre { border: 0; background: var(--pn-field, #f1f4f9); color: var(--slate); font: inherit; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.day-pre[aria-pressed="true"] { background: #e6efff; color: var(--pn-blue, #2f7bf6); box-shadow: inset 0 0 0 1.5px var(--pn-blue, #2f7bf6); }
.days-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
#sched-days .day { height: 40px; border-radius: 12px; border: 1.5px solid #dfe5ee; background: #fff; color: #98a2b3; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; padding: 0; }
#sched-days .day[aria-pressed="true"] { background: var(--pn-blue, #2f7bf6); border-color: var(--pn-blue, #2f7bf6); color: #fff; }
.day-sum { margin-top: 8px; font-size: 13px; color: var(--slate); }
.day-sum.warn { color: #b42318; font-weight: 700; }
.sp-room { border-bottom: 1px solid #eef1f5; }
.sp-room:last-child { border-bottom: 0; }
.sp-head { display: flex; align-items: center; gap: 8px; }
.sp-head .pick { flex: 1; font-weight: 700; min-width: 0; }
.sp-head small { color: var(--slate); font-size: 12.5px; white-space: nowrap; }
.sp-more { border: 0; background: var(--pn-field, #f1f4f9); width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--slate); cursor: pointer; padding: 0; }
.sp-more svg { width: 18px; height: 18px; transition: transform .15s; }
.sp-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.sp-list { padding: 0 0 6px 30px; }
.sp-list .pick { font-size: 14px; }

/* ===== Струја: посебна страница ===== */
#view-energy { max-width: 1240px; }
#view-energy.loading .en-grid { opacity: .6; transition: opacity .2s; }
.en-bar-top { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; flex-wrap: wrap; }
.en-back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: #fff; color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; padding: 8px 14px 8px 8px; border-radius: 999px; box-shadow: 0 1px 3px rgba(16, 24, 40, .08); cursor: pointer; }
.en-back svg { width: 20px; height: 20px; }
.en-bar-top .en-seg { margin: 0; }
.en-bar-top #en-edit { margin-left: auto; }
.en-grid { display: grid; gap: 14px; align-items: start; }
.en-colL, .en-colR { display: grid; gap: 14px; min-width: 0; }
@media (min-width: 1024px) {
  .en-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; }
  .en-colL { position: sticky; top: 18px; }
}
#view-energy .en-hero { margin: 0; padding: 20px; border-radius: 24px; background: linear-gradient(135deg, #fff8e1, #fff 70%); box-shadow: 0 1px 3px rgba(16, 24, 40, .06), inset 0 0 0 1px rgba(245, 159, 0, .14); }
#view-energy .en-bolt svg { width: 60px; height: 60px; }
#view-energy #en-total { font-size: 60px; }
.en-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.en-chips .en-cost { margin: 0; font-size: 14px; padding: 5px 10px; }
.en-cmp { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 12px; background: #eef1f5; color: var(--slate); }
.en-cmp.down { background: #e3f6ea; color: #157347; }
.en-cmp.up { background: #fff1e0; color: #a14d00; }
.en-chart-card, .en-gcard, #view-energy .en-settings { background: #fff; border-radius: 24px; padding: 18px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .04); }
.en-chart-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.en-chart-h b { font-size: 16px; }
.en-plot { position: relative; height: 200px; touch-action: pan-y; }
.en-plot svg { width: 100%; height: 100%; display: block; }
.en-b { fill: url(#en-g); opacity: .55; transition: opacity .12s; }
.en-b.cur { opacity: 1; }
.en-b.hl { opacity: 1; fill: #e08a00; }
.en-maxl { position: absolute; top: 0; left: 0; font-size: 11px; color: #98a2b3; background: rgba(255, 255, 255, .85); padding: 0 4px 0 0; }
.en-tip { position: absolute; top: -6px; transform: translateX(-50%); background: #1d2939; color: #fff; border-radius: 10px; padding: 5px 9px; display: grid; text-align: center; pointer-events: none; white-space: nowrap; box-shadow: 0 6px 16px rgba(16, 24, 40, .2); }
.en-tip small { font-size: 11px; opacity: .75; }
.en-tip b { font-size: 13.5px; }
.en-axis { position: relative; height: 18px; margin-top: 4px; font-size: 11.5px; color: #98a2b3; }
.en-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.en-groups { display: grid; gap: 14px; }
.en-gh { display: flex; align-items: center; gap: 12px; }
.en-gi { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 15px; background: #f6f8fb; }
.en-gi svg { width: 36px; height: 36px; display: block; }
.en-gh > div { flex: 1; min-width: 0; display: grid; }
.en-gh b { font-size: 17px; }
.en-gh small { font-size: 12.5px; color: var(--slate); }
.en-gv { font-size: 20px; font-weight: 700; white-space: nowrap; }
.en-gbar { height: 6px; border-radius: 3px; background: #eef1f5; margin: 12px 0 6px; overflow: hidden; }
.en-gbar i { display: block; height: 100%; border-radius: 3px; }
.en-gbar i.ac, .en-item .en-bar i.ac { background: linear-gradient(90deg, #6aa8ff, #2f7bf6); }
.en-gbar i.light, .en-item .en-bar i.light { background: linear-gradient(90deg, #ffd25c, #f59f00); }
.en-gbar i.plug, .en-item .en-bar i.plug { background: linear-gradient(90deg, #8ee0b5, #1fb57a); }
.en-gl { display: grid; }
.en-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-top: 1px solid #eef1f5; flex-wrap: wrap; }
.en-gl > .en-item:first-child, .en-gl > .en-room:first-child > .en-item { border-top: 0; }
.en-item .en-ic { width: 40px; height: 40px; border-radius: 13px; background: #f6f8fb; box-shadow: none; }
.en-item .en-ic svg { width: 30px; height: 30px; }
.en-item .en-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12.5px; color: var(--slate); }
.en-item .en-meta > span:not(.en-tag) + span:not(.en-tag)::before { content: "·"; margin-right: 8px; color: #c0c8d3; }
.en-rhead { cursor: pointer; border-radius: 14px; }
.en-rhead:hover { background: #f8fafc; }
.en-chev { width: 28px; height: 28px; display: grid; place-items: center; color: var(--slate); flex: none; }
.en-chev svg { width: 18px; height: 18px; transition: transform .15s; }
.en-rhead[aria-expanded="true"] .en-chev svg { transform: rotate(180deg); }
.en-sub { margin: 0 0 6px 52px; padding-left: 10px; border-left: 2px solid #f1e2bd; }
.en-item.small { padding: 8px 2px; border-top: 0; }
.en-item.small .en-ic { width: 30px; height: 30px; border-radius: 10px; }
.en-item.small .en-ic svg { width: 22px; height: 22px; }
.en-item.small .en-top b { font-weight: 600; font-size: 14px; }
.en-item.small .en-v { font-size: 13.5px; }
.en-item .en-w { flex-basis: 100%; padding-left: 52px; }
@media (max-width: 600px) {
  .en-bar-top .en-seg { order: 3; flex-basis: 100%; }
  #view-energy #en-total { font-size: 50px; }
  .en-plot { height: 170px; }
  .en-sub { margin-left: 20px; }
}
.en-gbar i.rest { background: linear-gradient(90deg, #c3cbd6, #8a96a6); }
.en-gnote { margin: 4px 0 0; font-size: 13px; color: var(--slate); }
@media (max-width: 1023px) { #view-energy { padding-bottom: 110px; } }

/* имиња на сијалиците */
.bn-card { width: min(520px, 100%); max-height: 88vh; overflow-y: auto; }
.bn-list { display: grid; gap: 8px; margin: 12px 0 4px; }
.bn-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: #f6f8fb; transition: box-shadow .2s, background .2s; }
.bn-row.blinking { background: #fff6dd; box-shadow: inset 0 0 0 2px #f5b800; }
.bn-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #fff; }
.bn-ic svg { width: 28px; height: 28px; }
.bn-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.bn-in { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; font-weight: 600; padding: 8px 10px; border-radius: 10px; border: 1px solid #dfe5ee; background: #fff; }
.bn-in::placeholder { color: #98a2b3; font-weight: 500; }
.bn-main small { font-size: 11.5px; color: #98a2b3; padding-left: 2px; }
.bn-blink { flex: none; }
.wr-head .wr-bulbs { margin-left: auto; }
.set-group.folded { margin-top: 26px; }
.set-fold-btn { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: #fff; border-radius: 20px; padding: 14px 18px; font: inherit; color: inherit; cursor: pointer; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
.set-fold-btn .set-fold-t { flex: 1; display: grid; gap: 2px; }
.set-fold-btn h2 { margin: 0; font-size: 17px; }
.set-fold-btn p { margin: 0; font-size: 13px; color: var(--slate); }
.set-fold-btn svg { width: 20px; height: 20px; color: var(--slate); transition: transform .15s; flex: none; }
.set-fold-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.set-fold { margin-top: 0; }

/* клими: на телефон како досега, на компјутер пошироки плочки со повеќе податоци */
.pn-acm { display: contents; }
.pn-acx { display: none; }
@media (min-width: 1024px) {
  .pn-col .pn-ac-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
  .pn-col .pn-acc { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; text-align: left; }
  .pn-col .pn-acc .pn-ring { flex: none; width: 84px; height: 84px; }
  .pn-col .pn-acm { display: grid; gap: 2px; min-width: 0; justify-items: start; }
  .pn-col .pn-acc strong { margin-top: 0; font-size: 16px; }
  .pn-col .pn-acx { display: block; font-size: 12.5px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
@media (min-width: 1024px) { .pn-col .pn-acx { white-space: normal; } .pn-col .pn-acx span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

/* ===== Активност ===== */
.act-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid #eef1f5; }
.act-row:first-child { border-top: 0; }
.act-ic { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--c); background: var(--bg); }
.act-ic svg { width: 20px; height: 20px; }
.act-main { flex: 1; min-width: 0; }
.act-t { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.act-s { font-size: 12.5px; color: var(--slate); margin-top: 1px; }
.act-img { width: 64px; height: 48px; object-fit: cover; border-radius: 10px; flex: none; cursor: zoom-in; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.pn-act .pn-act-list { margin-top: 4px; }
.pn-act .act-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-filters { display: flex; gap: 6px; flex-wrap: wrap; }
#view-activity { max-width: 760px; margin-left: max(0px, calc((100% - 1240px) / 2)); }
@media (max-width: 1023px) { #view-activity { padding-bottom: 110px; } }
.act-day { margin-top: 18px; }
.act-day h3 { font-size: 15px; font-weight: 700; color: var(--slate); margin: 0 4px 8px; }
.act-card { background: #fff; border-radius: 22px; padding: 6px 16px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .04); }
.act-card .act-row { padding: 12px 2px; }
.act-empty { margin-top: 24px; padding: 28px; text-align: center; color: var(--slate); background: #fff; border-radius: 22px; }
.act-more { display: block; margin: 16px auto 0; }
.va-rooms { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 8px; }
.v-btn.v-talk.on { background: #e5484d; color: #fff; }
.v-btn.v-talk.on svg { animation: talk-pulse 1.4s ease-in-out infinite; }
@keyframes talk-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .v-btn.v-talk.on svg { animation: none; } }
.talk-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 14px; background: #eef1f5; color: var(--ink); flex: none; }
.talk-btn svg { width: 18px; height: 18px; }
.talk-btn[hidden] { display: none; }
.talk-btn.on { background: #e5484d; color: #fff; }
.talk-btn.on svg { animation: talk-pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .talk-btn.on svg { animation: none; } }
.door-card .talk-btn { margin-left: auto; margin-right: 8px; }
@media (max-width: 480px) { .door-card .talk-btn span { display: none; } .door-card .talk-btn { padding: 10px; } }
.door-card .door-t { flex: 1; min-width: 0; }
.door-card .door-t b, .door-card .door-t span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  .door-card:has(#door-talk:not([hidden])) .door-ic { display: none; }
  .door-card:has(#door-talk:not([hidden])) .door-t span { display: none; }
}
.dial-room { white-space: nowrap; }
.hk-sub { font-size: 13px; font-weight: 700; color: var(--slate); margin: 14px 2px 2px; }
.hk-more { margin-top: 12px; }
.hk-more > summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--pn-blue, #2f7bf6); padding: 8px 2px; list-style: none; }
.hk-more > summary::-webkit-details-marker { display: none; }
/* на телефон: собната температура под плочката на климата */
@media (max-width: 1023px) {
  .pn-acc .pn-acx { display: block; font-size: 12px; color: var(--slate); margin-top: 1px; }
  .pn-acc .pn-acx span + span { display: none; }
}

/* Посети на вратата: видео во Активност */
.act-tag { display: inline-block; vertical-align: 1px; margin-left: 4px; font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 7px; white-space: nowrap; }
.act-tag.miss { color: #b54708; background: #fff3d6; }
.act-tag.ok { color: #067647; background: #e3f6ea; }
.act-tag.wait { color: #475467; background: #eef1f5; }
.act-vid { position: relative; flex: none; width: 92px; height: 58px; border: 0; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: linear-gradient(180deg, #8d9aa8, #4b535c); box-shadow: 0 1px 3px rgba(16, 24, 40, .14); }
.act-vid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.act-play { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: rgba(255, 255, 255, .92); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.act-play svg { width: 13px; height: 13px; fill: #101828; margin-left: 2px; }
.act-dur { position: absolute; right: 5px; bottom: 4px; font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .5); border-radius: 5px; padding: 1px 4px; }
.act-vid:focus-visible { outline: 3px solid var(--accent, #2f7bf6); outline-offset: 2px; }
.visit-card { max-width: 640px; padding: 12px 12px 14px; }
.visit-card video { width: 100%; aspect-ratio: 16 / 9; background: #101828; border-radius: 16px; display: block; margin-bottom: 12px; }
.visit-card h2, .visit-card .s { padding: 0 6px; }
.visit-card .rn-actions { padding: 0 6px; }
#visit-modal { align-items: center; }
@media (max-width: 520px) { .act-vid { width: 78px; height: 50px; } }
/* поставки на правилата: содржината никогаш не е пошироко од картичката (сегментите се собираат) */
.smart-in { grid-template-columns: minmax(0, 1fr); }
.smart-in > .ui-seg button { min-width: 0; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }

/* ================= Најава (во стилот на апликацијата) ================= */
.lg-body { margin: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(900px 460px at 50% -140px, #e3ecfb 0, rgba(227, 236, 251, 0) 70%), #f1f3f7; color: #141b2b; font-family: "PnText", var(--font); -webkit-font-smoothing: antialiased; }
.lg { min-height: 100vh; min-height: 100dvh; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 22px; padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); max-width: 440px; margin: 0 auto; }
.lg-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.lg-brand i { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(180deg, #3b8cff, #1f62d6); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 14px rgba(31, 98, 214, .28), inset 0 1px 0 rgba(255, 255, 255, .25); }
.lg-brand svg { width: 20px; height: 20px; }
.lg-hello { display: none; }
.lg-greet { font-family: "PnDisplay", "PnText", var(--font); font-weight: 700; font-size: clamp(40px, 4.4vw, 56px); line-height: 1.02; letter-spacing: -.035em; margin: 42px 0 8px; }
.lg-date { margin: 0; color: #6b7487; font-weight: 600; font-size: 17px; }
.lg-tiles { display: grid; grid-template-columns: repeat(3, 132px); gap: 14px; margin-top: 44px; }
.lg-tile { background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%); border-radius: 22px; padding: 16px 10px 14px; display: grid; justify-items: center; align-content: start; gap: 8px; font-weight: 700; font-size: 14px; text-align: center; line-height: 1.2; box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(16, 24, 40, .04), 0 6px 14px rgba(16, 24, 40, .05), 0 22px 44px -16px rgba(16, 24, 40, .14); }
.lg-tile svg { width: 52px; height: 52px; filter: drop-shadow(0 6px 8px rgba(16, 24, 40, .14)); }

.lg-card { background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%); border-radius: 30px; padding: 28px 24px 18px; box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(16, 24, 40, .05), 0 12px 24px rgba(16, 24, 40, .08), 0 32px 60px -18px rgba(16, 24, 40, .22); }
.lg-brand-sm { margin-bottom: 26px; }
.lg-form h2 { font-family: "PnDisplay", "PnText", var(--font); font-weight: 700; font-size: 30px; letter-spacing: -.03em; margin: 0 0 6px; }
.lg-sub { white-space: pre-line; margin: 0 0 22px; color: #6b7487; font-size: 15px; line-height: 1.45; }
.lg-field { display: block; margin-bottom: 14px; }
.lg-field > span:first-child { display: block; font-size: 13.5px; font-weight: 600; color: #475467; margin: 0 0 7px 2px; }
.lg-field input { width: 100%; box-sizing: border-box; height: 52px; border: 1.5px solid transparent; border-radius: 14px; background: #f1f4f8; box-shadow: inset 0 1px 2px rgba(16, 24, 40, .06); padding: 0 16px; font: inherit; font-size: 17px; color: #141b2b; transition: border-color .15s, background .15s; }
.lg-field input:focus { outline: none; border-color: #2f7bf6; background: #fff; box-shadow: 0 0 0 4px rgba(47, 123, 246, .12); }
.lg-pass { position: relative; display: block; }
.lg-pass input { padding-right: 52px; }
.lg-eye { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 10px; color: #6b7487; display: grid; place-items: center; cursor: pointer; }
.lg-eye svg { width: 21px; height: 21px; }
.lg-eye[aria-pressed="true"] { color: #2f7bf6; }
.lg-eye:focus-visible, .lg-link:focus-visible, .lg-lang button:focus-visible { outline: 3px solid rgba(47, 123, 246, .45); outline-offset: 2px; }
.lg-btn { width: 100%; height: 54px; margin-top: 8px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #3b8cff, #1f62d6); color: #fff; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 22px rgba(31, 98, 214, .28), inset 0 1px 0 rgba(255, 255, 255, .22); transition: transform .1s, filter .15s; }
.lg-btn:active { transform: scale(.985); filter: brightness(.96); }
.lg-btn:disabled { opacity: .6; cursor: default; }
.lg-btn:focus-visible { outline: 3px solid rgba(47, 123, 246, .45); outline-offset: 3px; }
.lg-shield { width: 52px; height: 52px; border-radius: 16px; background: #e8f0fe; color: #1f62d6; display: grid; place-items: center; margin-bottom: 16px; }
.lg-shield svg { width: 28px; height: 28px; }
.lg-code { text-align: center; font-size: 28px !important; font-weight: 700; letter-spacing: .32em; padding-left: calc(16px + .32em) !important; font-variant-numeric: tabular-nums; }
.lg-check { display: flex; align-items: center; gap: 10px; margin: 4px 2px 6px; font-size: 15px; color: #344054; cursor: pointer; }
.lg-check input { width: 20px; height: 20px; accent-color: #2f7bf6; }
.lg-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.lg-link { border: 0; background: none; padding: 6px 2px; font: inherit; font-size: 14.5px; font-weight: 600; color: #1f62d6; cursor: pointer; border-radius: 8px; }
.lg-link#back { color: #6b7487; }
.lg-error { min-height: 20px; margin-top: 14px; color: #d92d20; font-size: 14.5px; font-weight: 600; text-align: center; }
.lg-error:empty { margin-top: 0; }
.lg-lang { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 10px; color: #98a2b3; font-size: 14px; }
.lg-lang button { border: 0; background: none; font: inherit; font-weight: 600; color: #6b7487; padding: 6px 4px; cursor: pointer; border-radius: 6px; }
.lg-lang button.on { color: #1f62d6; }

@media (min-width: 960px) {
  /* компјутер: една картичка, лево поздрав (на нежна сина позадина), десно формата */
  .lg-body { display: grid; place-items: center; padding: 32px; box-sizing: border-box; }
  .lg { width: 100%; max-width: 980px; min-height: 0; margin: 0; padding: 0; gap: 0; grid-template-columns: minmax(0, 1fr) 440px; align-items: stretch;
    background: #fff; border-radius: 32px; overflow: hidden;
    box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(16, 24, 40, .05), 0 12px 24px rgba(16, 24, 40, .08), 0 40px 80px -24px rgba(16, 24, 40, .25); }
  .lg-hello { display: flex; flex-direction: column; padding: 44px 48px; background: radial-gradient(520px 320px at 0% 0%, #dbe8ff 0, rgba(219, 232, 255, 0) 70%), linear-gradient(160deg, #eef4ff 0%, #f6f8fc 60%, #f2f5fa 100%); border-right: 1px solid #edf0f5; }
  .lg-greet { margin: auto 0 8px; padding-top: 36px; }
  .lg-tiles { margin-top: 30px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .lg-tile { border-radius: 18px; padding: 12px 6px 10px; gap: 6px; font-size: 12.5px; }
  .lg-tile svg { width: 40px; height: 40px; }
  .lg-card { display: flex; flex-direction: column; justify-content: center; padding: 44px 44px 24px; border-radius: 0; box-shadow: none; background: #fff; }
  .lg-brand-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { .lg-btn, .lg-field input { transition: none; } }

/* Двофакторска најава: прозорец за поставување */
.tfa-card { max-width: 440px; }
.tfa-qr { width: 200px; height: 200px; margin: 6px auto 4px; background: #fff; border-radius: 16px; padding: 8px; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
.tfa-qr svg { width: 100%; height: 100%; display: block; }
.tfa-secret { display: block; text-align: center; font-size: 15px; letter-spacing: .06em; background: #f1f4f8; border-radius: 10px; padding: 10px; margin: 4px 0 12px; overflow-wrap: anywhere; user-select: all; }
.tfa-secret-l { text-align: center; margin-bottom: 0; }
.tfa-code { text-align: center; font-size: 24px !important; letter-spacing: .3em; font-weight: 700; font-variant-numeric: tabular-nums; }
.tfa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 14px; }
.tfa-codes code { background: #f1f4f8; border-radius: 10px; padding: 10px; text-align: center; font-size: 15px; letter-spacing: .04em; user-select: all; }
#tfa-modal .lg-error { margin-top: 10px; }

/* Кој е најавен + одјава */
.me-av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 16px; color: #1f62d6; background: linear-gradient(180deg, #e8f0fe, #d6e4fd); box-shadow: inset 0 1px 0 #fff; }
.me-bar { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: 24px; padding: 12px 12px 12px 14px; margin: 16px 0 22px; }
.me-who { flex: 1; min-width: 0; }
.me-who .t { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-who .s { font-size: 13px; color: var(--slate); }
.skin-panel .me-bar { background: var(--pn-card); box-shadow: var(--pn-shadow); }
.side-user { display: none; }
@media (min-width: 1024px) {
  .me-bar { display: none; }
  .side-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 6px 4px 8px; border-top: 1px solid var(--hair); }
  .side-user .me-av { width: 36px; height: 36px; font-size: 15px; }
  .side-who { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
  .side-who b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-who span { font-size: 12.5px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .side-out { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 12px; color: var(--slate); flex: none; }
  .tabbar .side-out:hover { background: #fdecec; color: #d92d20; }
  .tabbar .side-out svg { width: 20px; height: 20px; }
  html.tablet .side-who { display: none; }
  html.tablet .side-user { flex-direction: column; padding: 12px 0 4px; }
}

/* ===== Лево мени (компјутер): исто како најавата — бренд со градиент, бои по дел ===== */
.tabbar .side-only { display: none; }
.nav-ic { display: contents; font-style: normal; }
@media (min-width: 1024px) {
  .skin-panel .tabbar { padding: 20px 14px 14px; gap: 2px; background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%); box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(16, 24, 40, .04), 0 6px 14px rgba(16, 24, 40, .05), 0 22px 44px -16px rgba(16, 24, 40, .14); }
  .skin-panel .tabbar .brand { padding: 2px 8px 22px; gap: 12px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: #141b2b; }
  .skin-panel .tabbar .brand i { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(180deg, #3b8cff, #1f62d6); box-shadow: 0 6px 14px rgba(31, 98, 214, .28), inset 0 1px 0 rgba(255, 255, 255, .25); }
  .tabbar .side-only { display: flex; }
  .skin-panel .tabbar button[data-view] { gap: 12px; padding: 8px 10px; border-radius: 14px; font-size: 15px; font-weight: 600; color: #344054; letter-spacing: -.005em; }
  .skin-panel .tabbar button[data-view]:hover { background: #f3f6fa; }
  .skin-panel .tabbar button[data-view].active { background: #eef3fe; color: #1f62d6; font-weight: 700; }
  .nav-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff; flex: none; box-shadow: 0 3px 8px rgba(16, 24, 40, .14), inset 0 1px 0 rgba(255, 255, 255, .25); }
  .nav-ic svg { width: 18px !important; height: 18px !important; }
  .c-home { background: linear-gradient(180deg, #4c9bff, #1f62d6); }
  .c-dev { background: linear-gradient(180deg, #8b7bff, #5b46e8); }
  .c-en { background: linear-gradient(180deg, #ffc23d, #f08c00); }
  .c-act { background: linear-gradient(180deg, #2fd0b5, #0e9384); }
  .c-set { background: linear-gradient(180deg, #8a96a8, #5b6576); }
  html.tablet .nav-ic { width: 40px; height: 40px; border-radius: 12px; }
  html.tablet .tabbar .side-only { display: flex; }
}

/* 2FA: поставување во два чекора */
.tfa-card { max-width: 460px; transition: max-width .2s; }
.tfa-card.wide { max-width: 560px; }
.tfa-card h2 { margin-bottom: 14px; }
.tfa-steps { list-style: none; counter-reset: st; margin: 0 0 6px; padding: 0; display: grid; gap: 14px; }
.tfa-steps > li { counter-increment: st; position: relative; padding: 14px 14px 14px 52px; border-radius: 18px; background: #f6f8fb; }
.tfa-steps > li::before { content: counter(st); position: absolute; left: 14px; top: 13px; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(180deg, #3b8cff, #1f62d6); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.tfa-step-h { font-weight: 700; font-size: 15.5px; margin: 3px 0 10px; }
.tfa-open { display: none; }
.tfa-qr-wrap { display: flex; gap: 16px; align-items: center; }
.tfa-qr { width: 148px; height: 148px; flex: none; margin: 0; padding: 8px; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
.tfa-qr-txt { min-width: 0; display: grid; gap: 8px; }
.tfa-qr-txt .s { font-size: 13.5px; line-height: 1.45; }
.tfa-key-l { font-size: 12.5px; font-weight: 700; color: #475467; }
.tfa-key { display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 10px; padding: 6px 4px 6px 10px; box-shadow: inset 0 0 0 1px #e4e9f0; }
.tfa-key .tfa-secret { flex: 1; min-width: 0; margin: 0; padding: 0; background: none; text-align: left; font-size: 13px; letter-spacing: .04em; overflow-wrap: anywhere; }
.tfa-key .text-btn { flex: none; font-size: 13px; }
.tfa-code { width: 100%; box-sizing: border-box; height: 56px; border: 1.5px solid transparent; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px #e4e9f0; text-align: center; font: inherit; font-size: 26px !important; font-weight: 700; letter-spacing: .4em; padding-left: .4em; font-variant-numeric: tabular-nums; color: #141b2b; }
.tfa-code::placeholder { color: #cdd4de; }
.tfa-code:focus { outline: none; border-color: #2f7bf6; box-shadow: 0 0 0 4px rgba(47, 123, 246, .12); }
/* на телефон: копче што директно ја отвора Passwords (не мора да скенираш свој екран) */
@media (max-width: 700px), (pointer: coarse) {
  .tfa-open { display: inline-flex; justify-content: center; width: 100%; box-sizing: border-box; margin-bottom: 12px; text-decoration: none; }
  .tfa-qr-wrap { flex-direction: column; align-items: stretch; }
  .tfa-qr { display: none; }
  #tfa-qr-hint { display: none; }
}

/* Најава: копче за Face ID */
.lg-pk { width: 100%; height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 14px; background: #141b2b; color: #fff; font: inherit; font-size: 16.5px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 22px rgba(20, 27, 43, .22), inset 0 1px 0 rgba(255, 255, 255, .12); }
.lg-pk svg { width: 24px; height: 24px; }
.lg-pk:active { transform: scale(.985); }
.lg-pk:focus-visible { outline: 3px solid rgba(47, 123, 246, .45); outline-offset: 3px; }
.lg-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: #98a2b3; font-size: 13px; font-weight: 600; }
.lg-or::before, .lg-or::after { content: ""; flex: 1; height: 1px; background: #e4e9f0; }

.pk-hero { width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(180deg, #2a3346, #141b2b); color: #fff; display: grid; place-items: center; margin-bottom: 14px; box-shadow: 0 10px 22px rgba(20, 27, 43, .22); }
.pk-hero svg { width: 34px; height: 34px; }
/* QR: рамка како кај скенер */
.tfa-qr { position: relative; }
.tfa-qr::before { content: ""; position: absolute; inset: -6px; border-radius: 18px; pointer-events: none;
  background:
    linear-gradient(#2f7bf6, #2f7bf6) top left / 22px 3px no-repeat, linear-gradient(#2f7bf6, #2f7bf6) top left / 3px 22px no-repeat,
    linear-gradient(#2f7bf6, #2f7bf6) top right / 22px 3px no-repeat, linear-gradient(#2f7bf6, #2f7bf6) top right / 3px 22px no-repeat,
    linear-gradient(#2f7bf6, #2f7bf6) bottom left / 22px 3px no-repeat, linear-gradient(#2f7bf6, #2f7bf6) bottom left / 3px 22px no-repeat,
    linear-gradient(#2f7bf6, #2f7bf6) bottom right / 22px 3px no-repeat, linear-gradient(#2f7bf6, #2f7bf6) bottom right / 3px 22px no-repeat; }
/* потврда на телефон */
.lg-number { font-family: "PnDisplay", "PnText", var(--font); font-size: 64px; font-weight: 700; letter-spacing: .06em; text-align: center; color: #1d2433; background: #f3f6fb; border: 1px solid #e3e8f0; border-radius: 18px; padding: 14px 0 10px; margin: 0 0 16px; font-variant-numeric: tabular-nums; }
.lg-wait { display: flex; align-items: center; justify-content: center; gap: 9px; color: #6b7487; font-size: 14.5px; margin: 0 0 18px; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; background: #2f7bf6; animation: lgPulse 1.2s ease-in-out infinite; }
@keyframes lgPulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .lg-dot { animation: none; } }
#pw-link { margin-top: 14px; justify-content: center; }
:root[data-theme="dark"] .lg-number { background: #1b2230; border-color: #2a3344; color: #eef2f8; }
.set-select { flex: none; max-width: 46%; font: inherit; font-size: 14px; padding: 8px 30px 8px 12px; border-radius: 10px; border: 1px solid var(--line, #dde3ec); background: var(--card, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a94a6' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center / 11px; color: inherit; appearance: none; text-overflow: ellipsis; }
.set-input { display: block; width: 100%; max-width: 260px; margin-top: 8px; font: inherit; font-size: 15px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line, #dde3ec); background: var(--card, #fff); color: inherit; }
.row-btns { display: flex; gap: 8px; align-items: center; flex: none; }
/* лого (куќа со светнат прозорец) */
.lg-brand i.logo-i, .tabbar .brand i.logo-i, .skin-panel .tabbar .brand i.logo-i { background: none; padding: 0; border-radius: 11px; box-shadow: 0 6px 14px rgba(29, 95, 216, .28); overflow: hidden; }
i.logo-i svg.logo { width: 100%; height: 100%; display: block; }
.allow-box { margin-top: 10px; border-top: 1px solid var(--line, #e6eaf0); padding-top: 6px; }
.allow-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 8px 0 4px; }
.allow-add .set-input { margin: 0; flex: 1 1 150px; max-width: none; min-width: 0; }
.lg-sub .lg-key { display: block; font-size: 19px; font-weight: 600; color: #1d2433; letter-spacing: -.01em; margin-bottom: 4px; }
.lg-sub .lg-how { display: block; }
.card-intro { padding: 2px 0 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line, #e6eaf0); }
.card-intro .s { margin-top: 4px; }
.allow-mine { display: flex; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line, #dde3ec); background: #f3f7ff; border-radius: 14px; padding: 12px 14px; margin: 4px 0 14px; cursor: pointer; font: inherit; color: inherit; }
.allow-mine span { display: grid; gap: 2px; }
.allow-mine b { color: #2f7bf6; font-size: 15px; }
.allow-mine small { color: #6b7487; font-size: 13.5px; }
/* копче „Зборувај“ во парот со „Отклучи“ */
.talk-btn { height: 52px; padding: 0 18px 0 8px; gap: 10px; border-radius: 18px; font-weight: 800; font-size: 16px; color: #1d2433;
  background: linear-gradient(180deg, #ffffff, #f2f5fa); box-shadow: 0 8px 20px rgba(30, 50, 90, .10), inset 0 0 0 1px #e3e8f0; position: relative; transition: background .2s, color .2s, box-shadow .2s; }
.talk-btn svg { width: 36px; height: 36px; padding: 8px; box-sizing: border-box; border-radius: 50%; color: #fff;
  background: linear-gradient(180deg, #5aa2ff, #2f6fe6); box-shadow: 0 4px 10px rgba(47, 111, 230, .35); flex: none; }
.talk-btn:hover { box-shadow: 0 10px 24px rgba(30, 50, 90, .14), inset 0 0 0 1px #d5dce8; }
.talk-btn:active { transform: translateY(1px); }
.talk-btn.on { color: #fff; background: linear-gradient(180deg, #ff6a6f, #e0393f); box-shadow: 0 10px 22px rgba(224, 57, 63, .35), inset 0 1px 0 rgba(255, 255, 255, .25); }
.talk-btn.on svg { background: rgba(255, 255, 255, .22); box-shadow: none; animation: talk-ring 1.6s ease-out infinite; }
@keyframes talk-ring { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); } 100% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .talk-btn.on svg { animation: none; } }
.ring-bar .talk-btn { height: 46px; font-size: 15px; padding: 0 14px 0 6px; }
.ring-bar .talk-btn svg { width: 34px; height: 34px; }
:root[data-theme="dark"] .talk-btn:not(.on) { color: #eef2f8; background: linear-gradient(180deg, #252d3b, #1c2330); box-shadow: inset 0 0 0 1px #2e3748; }
@media (max-width: 480px) { .door-card .talk-btn { padding: 0 8px; } }
.talk-btn { padding: 0 16px 0 7px; gap: 8px; }
.talk-btn svg { width: 34px; height: 34px; padding: 7.5px; }
.door-card .door-t span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
/* ===== Клима: јазичиња на телефон ===== */
.ac-tabs { display: flex; gap: 4px; background: var(--bg, #eef1f5); border-radius: 14px; padding: 4px; margin: 12px 0 6px; position: sticky; top: 0; z-index: 2; }
.ac-tabs button { flex: 1; border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; padding: 9px 0; border-radius: 11px; color: var(--slate); cursor: pointer; }
.ac-tabs button[aria-pressed="true"] { background: var(--paper, #fff); color: var(--ink); box-shadow: 0 2px 8px rgba(20, 30, 60, .08); }
.ac-wait { color: var(--slate); font-size: 14.5px; text-align: center; padding: 40px 0; }
#sheet.ac-tabbed[data-actab="ctl"] :is(#ac-hist, .sheet-settings, #s-hide, #s-energy, #s-updated) { display: none !important; }
#sheet.ac-tabbed[data-actab="hist"] :is([data-body="ac"] > :not(#ac-hist), .sheet-settings, #s-hide) { display: none !important; }
#sheet.ac-tabbed[data-actab="hist"] #ac-hist { margin-top: 8px; }
#sheet.ac-tabbed[data-actab="set"] :is([data-body="ac"], #s-energy) { display: none !important; }
#sheet.ac-tabbed[data-actab="set"] .sheet-settings { margin-top: 12px; }

/* ===== Клима: цела страница на компјутер (како Струја) ===== */
@media (min-width: 1024px) {
  body.ac-page-open #scrim { opacity: 0 !important; pointer-events: none; }
  #sheet.ac-page { left: 256px; right: 0; top: 0; bottom: 0; max-width: none; max-height: none; margin: 0; border-radius: 0; box-shadow: none;
    background: var(--bg); padding: 34px 32px 48px; display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 600px); justify-content: center;
    column-gap: 18px; row-gap: 14px; align-content: start; transform: none; opacity: 0; transition: opacity .2s; }
  #sheet.ac-page.open { transform: none; opacity: 1; }
  #sheet.ac-page[hidden] { display: none; }
  #sheet.ac-page > .grabber, #sheet.ac-page #s-close { display: none; }
  #sheet.ac-page > .sheet-head { grid-column: 1 / -1; margin-bottom: 6px; gap: 14px; }
  #sheet.ac-page .back-btn { display: grid; width: 40px; height: 40px; border-radius: 50%; background: var(--paper, #fff); box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
  #sheet.ac-page .sheet-head h2 { font-family: "PnDisplay", var(--font); font-size: 34px; font-weight: 700; letter-spacing: -.035em; }
  #sheet.ac-page > [data-body="ac"], #sheet.ac-page .ac-side > #ac-hist, #sheet.ac-page .ac-side > .sheet-settings {
    background: var(--paper, #fff); border-radius: 24px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
  #sheet.ac-page > [data-body="ac"] { grid-column: 1; grid-row: 2; align-self: start; }
  #sheet.ac-page > .ac-side { grid-column: 2; grid-row: 2; display: grid; gap: 14px; align-content: start; background: none; padding: 0; }
  #sheet.ac-page .ac-side > .sheet-settings { padding: 8px 14px; margin: 0; }
  #sheet.ac-page .ac-side > #ac-hist { margin: 0; }
  #sheet.ac-page .ac-side .hb i { background: #f0f3f7; }
  #sheet.ac-page .dial-wrap { max-width: 300px; margin-left: auto; margin-right: auto; }
  #sheet.ac-page .ac-side .hide-btn { margin: 0; }
}
/* заглавие на страницата за клима: тенок наслов + бројки десно */
.ac-stats { display: none; }
@media (min-width: 1024px) {
  #sheet.ac-page .sheet-head h2 { font-family: var(--font); font-weight: 300; font-size: 34px; letter-spacing: -.025em; }
  #sheet.ac-page .ac-stats:not([hidden]) { display: flex; gap: 28px; margin-right: 16px; }
  .ac-stats > div { text-align: right; }
  .ac-stats > div[hidden] { display: none; }
  .ac-stats b { display: block; font-size: 30px; font-weight: 300; letter-spacing: -.02em; color: var(--ink); line-height: 1.05; font-variant-numeric: tabular-nums; }
  .ac-stats span { font-size: 12.5px; font-weight: 600; color: var(--slate); }
  .ac-stats .set b { color: var(--mode, var(--cool)); }
  #sheet.ac-page.off .ac-stats .set b { color: var(--slate); }
}
@media (min-width: 1024px) {
  #sheet.ac-page .ac-stats:not([hidden]) { gap: 6px; }
  .ac-stats > div { text-align: center; min-width: 84px; }
  .ac-stats span { display: block; margin-top: 2px; }
}
/* ===== Исти јазичиња насекаде (Уреди, Струја, Активност) ===== */
.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; background: none; padding: 0; }
.cat { border: 0; cursor: pointer; font-family: inherit; }
.cat[aria-pressed="true"] { background: var(--ink); color: #fff; }
.skin-panel .cat[aria-pressed="true"] { background: linear-gradient(180deg, #4a90ff, var(--pn-blue-2)); color: #fff; box-shadow: 0 8px 18px rgba(47, 123, 246, .25); }
.cat.en-back { gap: 4px; padding: 10px 15px 10px 10px; }
.cat.en-back svg { width: 18px; height: 18px; }
/* на компјутер менито лево веќе води назад */
@media (min-width: 1024px) { .cat.en-back { display: none; } }
/* ===== Поставки: исти наслови во сите картички ===== */
.skin-panel .card-intro > .set-title, .skin-panel .hk-head .t {
  font-family: "PnDisplay", var(--font); font-size: 19px; font-weight: 900; letter-spacing: -.02em; color: var(--ink);
}
.card-intro { padding-top: 0; }
.text-btn { white-space: nowrap; }
#cam-card .pill-btn.primary { margin-top: 10px; }
/* ===== Поставки: едно правило за полиња, копчиња и ознаки ===== */
#view-settings .set-card input:not([type="checkbox"]):not([type="radio"]):not(.ui-step-in):not([type="range"]) {
  height: 44px; min-height: 44px; font-size: 15px; font-weight: 600; border-radius: 14px; box-sizing: border-box;
}
#view-settings .pill-btn { min-height: 36px; font-size: 14px; font-weight: 700; }
#view-settings .wr-save { min-height: 44px; }
#view-settings .text-btn { font-size: 15px; font-weight: 700; }
#view-settings .text-btn.danger { color: var(--danger); }
#view-settings .set-row > .smart-st { flex: none; max-width: none; }
.card-intro > .set-title { margin-top: 0; }
#view-settings .form-btns { flex-wrap: wrap; justify-content: flex-end; }
#view-settings label > span:first-child, #view-settings .field > span { font-size: 13.5px; font-weight: 600; color: var(--slate); }
#user-form .form-row { min-width: 0; }
#user-form .form-row > :last-child { min-width: 0; max-width: 100%; }
@media (max-width: 480px) { #user-form .form-row button { padding-left: 10px; padding-right: 10px; font-size: 13.5px; } }
#cam-card form > .pill-btn.primary, #cam-card .ic-btns { margin-left: auto; }
#cam-card form > .pill-btn.primary { display: flex; }
#cam-card .ic-btns { justify-content: flex-end; margin-top: 10px; }
/* почетна на компјутер: ролетните и перголата во левата колона, под климите */
@media (min-width: 1024px) {
  .skin-panel .pn-col > .pn-covers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
  .pn-col > .pn-covers:empty { display: none; }
  .pn-col > .pn-covers .pn-card { margin-top: 0; }
}
/* LED на перголата во картичката */
.pn-led { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 10px 10px 12px; border-radius: 16px; background: var(--pn-field, #f1f4f8); }
.pn-led.on { background: linear-gradient(135deg, #fff6df, #fff); box-shadow: inset 0 0 0 1px rgba(245, 159, 0, .18); }
.pn-led-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: #9aa4b1; flex: none; }
.pn-led.on .pn-led-ic { color: #f59f00; }
.pn-led-ic svg { width: 18px; height: 18px; }
.pn-led-t { flex: 1; min-width: 0; display: grid; cursor: pointer; }
.pn-led-t b { font-size: 14.5px; }
.pn-led-t small { font-size: 12.5px; font-weight: 600; color: var(--slate); }
.pn-led-dim { width: 36px; height: 36px; border-radius: 12px; border: 0; background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.pn-led-dim svg { width: 18px; height: 18px; }
.pn-led-dim:disabled { opacity: .4; }
.pn-led .switch { flex: none; }
.pn-led { flex-wrap: wrap; }
.pn-led-dims { flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pn-led-dim { width: auto; height: 36px; display: flex; gap: 6px; justify-content: center; font: inherit; font-size: 13.5px; font-weight: 700; }
/* ===== Уреди со далечински (ролетни, пергола, копчиња): јазичиња ===== */
#sheet.rf-tabbed[data-actab="ctl"] :is(#rf-block, .sheet-settings, #s-hide) { display: none !important; }
#sheet.rf-tabbed[data-actab="hist"] :is(.body, .sheet-settings, #s-hide, #s-energy, #c-delete) { display: none !important; }
#sheet.rf-tabbed[data-actab="set"] :is(.body, #s-energy) { display: none !important; }
#sheet.rf-tabbed[data-actab="set"] #rf-block > :not(#c-delete) { display: none !important; }
#sheet.rf-tabbed[data-actab="set"] #rf-block { display: block !important; }
#sheet.rf-tabbed[data-actab="set"] #c-delete { margin-top: 14px; }
#sheet.rf-tabbed .ac-wait { display: none !important; }
#cv-type { min-width: 0; }
#sheet.rf-tabbed:not([hidden]) { display: flex; flex-direction: column; }
#sheet.rf-tabbed > * { flex-shrink: 0; }
#sheet.rf-tabbed[data-actab="set"] #rf-block { order: 10; }
#sheet.rf-tabbed[data-actab="set"] #s-hide { order: 11; }
#cv-type { flex: none; }
#cv-type button { padding: 7px 14px; white-space: nowrap; }
/* ролетни на почетната: една компактна картичка, по соби */
.pn-covers > .pn-shutters { grid-column: 1 / -1; }
.pn-sh-all { display: flex; gap: 6px; }
.pn-sh-allbtn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--pn-field, #f1f4f8); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 10px 6px 7px; border-radius: 999px; cursor: pointer; }
.pn-sh-allbtn svg { width: 15px; height: 15px; }
.pn-sh-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-top: 4px; }
.pn-sh-room { grid-column: 1 / -1; font-size: 12.5px; font-weight: 700; color: var(--slate); margin: 6px 2px 0; }
.pn-sh { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 8px; border-radius: 16px; background: var(--pn-field, #f1f4f8); cursor: pointer; min-width: 0; }
.pn-sh-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; }
.pn-sh-ic svg { width: 40px; height: 40px; }
.pn-sh-t { flex: 1; min-width: 0; display: grid; }
.pn-sh-t b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-sh-t small { font-size: 12.5px; font-weight: 600; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-sh-btns { display: flex; gap: 4px; flex: none; }
.pn-sh-b { width: 34px; height: 34px; border: 0; border-radius: 11px; background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.pn-sh-b svg { width: 16px; height: 16px; }
.pn-sh-b:disabled { opacity: .35; cursor: default; }
@media (min-width: 1024px) { .skin-panel .pn-col > .pn-covers .pn-shutters { grid-column: 1 / -1; } }
@media (max-width: 480px) { .pn-sh-list { grid-template-columns: 1fr; } .pn-sh-allbtn span { display: none; } .pn-sh-allbtn { padding: 7px; } }
.pn-sh-list { grid-template-columns: 1fr; gap: 6px; }
.pn-sh { padding: 6px 8px; }
.pn-sh-ic, .pn-sh-ic svg { width: 36px; height: 36px; }
/* ролетни по соби: ред за цела соба, се отвора */
.pn-sh-room-row { background: var(--pn-field, #f1f4f8); }
.pn-sh-chev { flex: none; width: 18px; color: #9aa4b1; display: grid; place-items: center; transition: transform .2s; }
.pn-sh-chev svg { width: 16px; height: 16px; }
.pn-sh-group.open .pn-sh-chev { transform: rotate(90deg); }
.pn-sh-sub { display: none; margin: 6px 0 0 22px; gap: 6px; }
.pn-sh-group.open .pn-sh-sub { display: grid; }
.pn-sh-sub .pn-sh { background: #fff; box-shadow: inset 0 0 0 1px #e7ebf1; }
.pn-sh-group.open > .pn-sh-room-row { background: #e8f0fe; }
/* перголата: поголема, преку цела ширина */
.pn-covers > .pn-cover { grid-column: 1 / -1; }
@media (min-width: 600px) {
  .pn-covers > .pn-cover { display: grid !important; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 18px; align-items: start; }
  .pn-covers > .pn-cover > .pn-h { grid-column: 1 / -1; }
  .pn-covers > .pn-cover > .pn-ill { grid-column: 1; grid-row: 2 / span 2; }
  .pn-covers > .pn-cover > .pn-cbtns { grid-column: 2; grid-row: 2; align-self: end; margin-top: 0; }
  .pn-covers > .pn-cover > .pn-led { grid-column: 2; grid-row: 3; }
}
.pn-covers > .pn-cover .pn-ill svg { width: 100%; height: auto; max-height: 230px; }
.pn-sh-chev { color: var(--pn-blue, #2f7bf6); }
/* пергола: голем цртеж преку цела ширина, копчињата и LED под него во две колони */
@media (min-width: 600px) {
  .pn-covers > .pn-cover { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .pn-covers > .pn-cover > .pn-ill { grid-column: 1 / -1; grid-row: 2; }
  .pn-covers > .pn-cover > .pn-cbtns { grid-column: 1; grid-row: 3; align-self: stretch; margin-top: 12px; }
  .pn-covers > .pn-cover > .pn-led { grid-column: 2; grid-row: 3; }
}
.pn-covers > .pn-cover .pn-ill { display: flex; justify-content: center; }
.pn-covers > .pn-cover .pn-ill svg { width: 100%; max-width: 420px; max-height: 260px; }
/* ===== Влезна врата на компјутер: поголема, со слика од камерата ===== */
.door-snap { display: none; }
@media (min-width: 1024px) {
  .skin-panel #door-card:not([hidden]) { padding: 18px; gap: 18px; align-items: stretch; flex-wrap: wrap; border-radius: 28px; }
  .skin-panel #door-card .door-ic svg { width: 58px; height: 58px; }
  .skin-panel #door-card .door-ic { align-self: center; }
  .skin-panel #door-card .door-t { align-self: center; flex: 1 1 180px; }
  .skin-panel #door-card .door-t b { font-size: 21px; letter-spacing: -.02em; }
  .skin-panel #door-card .door-t span { font-size: 14px; white-space: normal; margin-top: 2px; }
  .skin-panel #door-card .talk-btn, .skin-panel #door-card .door-btn { align-self: center; height: 56px; }
  .skin-panel #door-card .door-btn { padding: 0 26px; font-size: 17px; border-radius: 18px; }
  .skin-panel #door-card .talk-btn { margin-right: 0; }
  /* со слика: сликата лево, текстот и копчињата десно */
  .skin-panel #door-card.with-snap { display: grid !important; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 18px; row-gap: 12px; }
  .skin-panel #door-card.with-snap .door-snap { display: block; grid-row: 1 / span 2; position: relative; border: 0; padding: 0; border-radius: 20px; overflow: hidden; background: #1c222b; aspect-ratio: 16 / 9; cursor: pointer; }
  .skin-panel #door-card.with-snap .door-snap img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
  .skin-panel #door-card.with-snap .door-snap.ready img { opacity: 1; }
  .door-live { position: absolute; left: 10px; top: 10px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .45); padding: 3px 9px; border-radius: 999px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .skin-panel #door-card.with-snap .door-ic { display: none; }
  .skin-panel #door-card.with-snap .door-t { grid-column: 2; align-self: end; }
  .skin-panel #door-card.with-snap > .talk-btn, .skin-panel #door-card.with-snap > .door-btn { grid-column: 2; }
  .skin-panel #door-card.with-snap { grid-template-rows: auto auto auto; }
  .skin-panel #door-card.with-snap .door-t { grid-row: 1; }
  .skin-panel #door-card.with-snap > .talk-btn { grid-row: 2; justify-content: center; width: 100%; }
  .skin-panel #door-card.with-snap > .door-btn { grid-row: 3; justify-content: center; width: 100%; }
  .skin-panel #door-card.with-snap .door-snap { grid-row: 1 / span 3; }
}
@media (min-width: 1024px) { .skin-panel .pn-col > #door-card.with-snap:not([hidden]), .skin-panel #pn > #door-card.with-snap:not([hidden]) { display: grid !important; } }
@media (min-width: 1024px) {
  .skin-panel #door-card.with-snap { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 14px; align-items: center; }
  .skin-panel #door-card.with-snap .door-snap { grid-column: 1 / -1; grid-row: 1; aspect-ratio: 16 / 7.5; width: 100%; }
  .skin-panel #door-card.with-snap .door-t { grid-column: 1; grid-row: 2; align-self: center; }
  .skin-panel #door-card.with-snap > .talk-btn { grid-column: 2; grid-row: 2; width: auto; }
  .skin-panel #door-card.with-snap > .door-btn { grid-column: 3; grid-row: 2; width: auto; }
  .skin-panel #door-card.with-snap .door-t b { font-size: 20px; }
}
@media (min-width: 1024px) {
  .skin-panel #door-card.with-snap .door-snap { aspect-ratio: var(--ar, 16 / 9); }
  .skin-panel #door-card.with-snap .door-snap img { object-fit: contain; }
}
.door-snap.live .door-live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff4d4f; margin-right: 6px; vertical-align: 1px; }
@media (min-width: 1024px) {
  .skin-panel #door-card.with-snap .door-snap.anamorphic img { object-fit: fill; }
  .skin-panel #door-card.with-snap .door-snap { max-height: 360px; }
}
.door-src { position: fixed; left: -10000px; top: 0; width: 4px; height: 4px; opacity: 0; pointer-events: none; }
@media (min-width: 1024px) {
  .skin-panel #door-card.with-snap .door-snap canvas { width: 100%; height: 100%; display: block; object-fit: contain; opacity: 0; transition: opacity .3s; }
  .skin-panel #door-card.with-snap .door-snap.ready canvas { opacity: 1; }
  .skin-panel #door-card.with-snap .door-snap.anamorphic canvas, .skin-panel #door-card.with-snap .door-snap canvas { object-fit: fill; }
}
.door-src { left: -10000px; }
.door-src.on { position: absolute; opacity: 1; z-index: 3; border-radius: 20px; object-fit: fill; pointer-events: none; }
.door-src.on { background: #1c222b; }
/* тарифи на ЕВН */
.en-tariff { margin-top: 8px; font-size: 13px; font-weight: 700; color: #c2410c; }
.en-tariff.low { color: #15803d; }
.en-tar { display: grid; gap: 10px; padding: 4px 0 6px; }
.en-tar-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.en-tar-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.en-tar-g label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--slate); }
.en-tar-g input { height: 40px; border-radius: 12px; border: 1px solid var(--line, #dde3ec); background: var(--paper, #fff); padding: 0 10px; font: inherit; font-size: 15px; color: var(--ink); }
/* други уреди */
.en-app { width: 40px; height: 40px; border-radius: 12px; background: #f1f4f8; display: grid; place-items: center; color: #5d6678; }
.en-app svg { width: 22px; height: 22px; }
.en-app.big { width: 44px; height: 44px; }
.en-appedit { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.en-appedit label { display: grid; gap: 2px; font-size: 12px; font-weight: 600; color: var(--slate); }
.en-appedit input { width: 90px; height: 36px; border-radius: 10px; border: 1px solid var(--line, #dde3ec); padding: 0 8px; font: inherit; }
.en-appadd { display: grid; gap: 10px; padding: 10px 2px 4px; }
.en-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.en-presets .cat { padding: 7px 12px 7px 9px; font-size: 13.5px; }
.en-presets .cat svg { width: 16px; height: 16px; }
.en-appform { display: flex; gap: 8px; flex-wrap: wrap; }
.en-appform input { height: 40px; border-radius: 12px; border: 1px solid var(--line, #dde3ec); padding: 0 10px; font: inherit; min-width: 0; flex: 1 1 90px; }
.en-appform input.n { flex: 2 1 140px; }
.ac-en-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ac-en-c { background: var(--pn-field, #f1f4f8); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; }
.ac-en-c span { font-size: 12.5px; font-weight: 600; color: var(--slate); }
.ac-en-c b { font-size: 17px; font-weight: 700; color: var(--ink); }
.ac-en-c small { font-size: 12.5px; font-weight: 700; color: #2f9e5f; min-height: 15px; }
.ac-en-n { margin-top: 6px; }
.en-tar-g input { width: 100%; min-width: 0; box-sizing: border-box; }
.en-tar-g label { min-width: 0; }
.wg-steps { margin: 6px 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.45; }
.smart-st.bad { color: #b42318; background: #fde8e7; }
.wg-qr-row { display: flex; gap: 16px; align-items: center; margin: 4px 0 10px; padding: 12px; border-radius: 16px; background: var(--pn-field, #f1f4f8); }
.wg-qr { width: 150px; height: 150px; flex: none; background: #fff; border-radius: 12px; padding: 8px; box-sizing: border-box; }
.wg-qr svg { width: 100%; height: 100%; display: block; }

/* Телефон: живата слика од вратата горе, под неа име + Talk + Unlock */
@media (max-width: 1023.98px) {
  .skin-panel #pn > #door-card.with-snap:not([hidden]), .skin-panel .pn-col > #door-card.with-snap:not([hidden]) { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 12px; align-items: center; padding: 12px 12px 14px; }
  .skin-panel #door-card.with-snap .door-snap { display: block; grid-column: 1 / -1; grid-row: 1; position: relative; border: 0; padding: 0; border-radius: 18px; overflow: hidden; background: #1c222b; aspect-ratio: var(--ar, 16 / 9); width: 100%; max-height: 300px; cursor: pointer; }
  .skin-panel #door-card.with-snap .door-snap img, .skin-panel #door-card.with-snap .door-snap canvas { width: 100%; height: 100%; display: block; object-fit: fill; opacity: 0; transition: opacity .3s; }
  .skin-panel #door-card.with-snap .door-snap.ready img, .skin-panel #door-card.with-snap .door-snap.ready canvas { opacity: 1; }
  .skin-panel #door-card.with-snap .door-ic { display: none; }
  .skin-panel #door-card.with-snap .door-t { grid-column: 1; grid-row: 2; align-self: center; padding-left: 6px; min-width: 0; }
  .skin-panel #door-card.with-snap > .talk-btn { grid-column: 2; grid-row: 2; margin: 0; }
  .skin-panel #door-card.with-snap > .door-btn { grid-column: 3; grid-row: 2; }
  .door-src.on, .door-vid.on { border-radius: 18px; }
  .skin-panel #door-card.with-snap .door-live { position: absolute; left: 10px; top: 10px; z-index: 4; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .45); padding: 3px 9px; border-radius: 999px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
}

/* Поставки на телефон: список на групи → една група на екран */
.set-index, .set-back { display: none; }
@media (max-width: 1023.98px) {
  #view-settings:not(.sg-open) .set-cols { display: none; }
  #view-settings:not(.sg-open) .set-index { display: grid; }
  #view-settings.sg-open .set-sec:not(.cur), #view-settings.sg-open .me-bar { display: none; }
  #view-settings.sg-open .set-sec.cur .set-group { margin-top: 4px; }
  #view-settings.sg-open .set-sec.cur .set-group.folded .set-fold-btn svg { display: none; }
  .set-index { gap: 0; margin: 14px 0 8px; background: var(--card, #fff); border-radius: 24px; padding: 6px 0; box-shadow: var(--shadow-sm, 0 1px 2px rgba(20, 27, 43, .06)); overflow: hidden; }
  .set-idx-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
  .set-idx-row[hidden] { display: none; }
  .set-idx-row + .set-idx-row { border-top: 1px solid var(--line, #e6ebf2); }
  .set-idx-row > i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; }
  .set-idx-row > i svg { width: 21px; height: 21px; }
  .set-idx-row > span { flex: 1; min-width: 0; display: grid; gap: 1px; }
  .set-idx-row b { font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; }
  .set-idx-row small { font-size: 13px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .set-idx-row > svg { width: 18px; height: 18px; color: var(--slate); flex: none; opacity: .7; }
  .set-idx-row:active { background: rgba(127, 140, 160, .12); }
  #view-settings.sg-open .set-sec.cur > .set-back { display: inline-flex; align-items: center; gap: 4px; margin: 10px 0 0 -4px; padding: 6px 10px 6px 4px; border: 0; background: none; font: inherit; font-size: 16px; font-weight: 600; color: var(--blue, #2f7bf6); cursor: pointer; }
  .set-back svg { width: 20px; height: 20px; }
}

/* RF светло: рачно израмнување на состојбата */
.rf-assume { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--slate); }
#l-assume button[aria-pressed="true"] { background: #2f7bf6; color: #fff; box-shadow: 0 4px 12px rgba(47, 123, 246, .35); }
/* ===== Телефон: збиена почетна (помалку скролање) ===== */
@media (max-width: 599.98px) {
  /* светла: пониски плочки */
  .pn-rooms { gap: 8px; }
  .pn-room { min-height: 0; padding: 10px 10px 0; border-radius: 18px; }
  .pr-top { align-items: center; }
  .pr-top i svg { width: 24px; height: 28px; }
  .pn-room b { margin-top: 4px; font-size: 15px; }
  .pn-room small { font-size: 12px; }
  .pr-bar { margin-top: 8px; height: 10px; }
  .pn-room:not(:has(.pr-bar:not([hidden]))) { padding-bottom: 10px; }
  /* пергола: мал цртеж лево, копчињата десно, LED под нив */
  .pn-covers > .pn-cover { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; row-gap: 10px; align-items: center; }
  .pn-covers > .pn-cover > .pn-h { grid-column: 1 / -1; margin-bottom: 0; }
  .pn-covers > .pn-cover > .pn-ill { grid-column: 1; grid-row: 2; }
  .pn-covers > .pn-cover .pn-ill svg { max-height: 120px; }
  .pn-covers > .pn-cover > .pn-cbtns { grid-column: 2; grid-row: 2; flex-direction: column; margin-top: 0; align-self: stretch; justify-content: center; }
  .pn-covers > .pn-cover > .pn-cbtns > * { flex: 1 1 0; min-height: 46px; }
  .pn-covers > .pn-cover > .pn-led { grid-column: 1 / -1; grid-row: 3; margin-top: 0; }
  /* активност: само 2 најнови, остатокот на „Види сè“ */
  .pn-act .pn-act-list > :nth-child(n+3) { display: none; }
  /* врата: сликата малку пониска */
  .skin-panel #door-card.with-snap .door-snap { max-height: 210px; }
}

/* Јачина на соба (Дома): јасен лизгач со бројка; пергола — нормални копчиња */
@media (max-width: 599.98px) {
  .pn-room .pr-bar { margin: 10px 0 10px; height: 26px; border-radius: 13px; background: rgba(127, 140, 160, .18); overflow: hidden; }
  .pn-room .pr-bar span { border-radius: 13px; transition: width .08s linear; }
  .pn-room .pr-bar::after { content: ''; position: absolute; inset: 0; border-radius: 13px; box-shadow: inset 0 0 0 1px rgba(127, 140, 160, .25); pointer-events: none; }
  .pn-room.dragging .pr-bar { height: 30px; margin-top: 8px; margin-bottom: 8px; }
  .pn-room.dragging small { color: var(--ink); font-weight: 700; }
  .pn-covers > .pn-cover > .pn-cbtns { align-self: center; gap: 8px; }
  .pn-covers > .pn-cover > .pn-cbtns > * { flex: 0 0 auto; min-height: 0; height: 46px; }
}

/* Броило на ЕВН */
.en-meter-g { grid-template-columns: 1fr 1fr auto; align-items: end; }
.en-meter-g .pill-btn { height: 44px; padding: 0 18px; }
@media (max-width: 520px) { .en-meter-g { grid-template-columns: 1fr 1fr; } .en-meter-g .pill-btn { grid-column: 1 / -1; } }
.en-meter-res:not(:empty) { margin-top: 10px; font-size: 13.5px; color: var(--slate); }
.en-meter-box { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: rgba(21, 128, 61, .08); border: 1px solid rgba(21, 128, 61, .22); }
.en-meter-box b { font-size: 15.5px; color: var(--ink); }
.en-meter-box span { font-size: 13px; color: var(--ink); }
.en-meter-box small { font-size: 12.5px; color: var(--slate); line-height: 1.4; }
.en-meter-list { margin-top: 8px; display: grid; }
.en-meter-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 2px; font-size: 13px; color: var(--slate); border-top: 1px solid var(--line, #e6ebf2); }
/* Ролетни и пергола на компјутер: поголеми, во рамнотежа со другите картички */
@media (min-width: 1024px) {
  .skin-panel .pn-sh-list { gap: 8px; }
  .skin-panel .pn-sh { padding: 12px 14px 12px 12px; gap: 14px; border-radius: 18px; }
  .skin-panel .pn-sh-ic, .skin-panel .pn-sh-ic svg { width: 52px; height: 52px; }
  .skin-panel .pn-sh-t b { font-size: 16px; }
  .skin-panel .pn-sh-t small { font-size: 13.5px; }
  .skin-panel .pn-sh-btns { gap: 6px; }
  .skin-panel .pn-sh-b { width: 44px; height: 44px; border-radius: 13px; }
  .skin-panel .pn-sh-b svg { width: 19px; height: 19px; }
  .skin-panel .pn-sh-allbtn { font-size: 14px; padding: 8px 13px 8px 10px; }
  .skin-panel .pn-covers > .pn-cover > .pn-cbtns { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
  .skin-panel .pn-covers > .pn-cover > .pn-cbtns > * { height: 50px; width: auto; }
}

/* Изглед на виџетот */
.wg-look { display: grid; gap: 10px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line, #e6ebf2); }
.wg-look > .t { font-weight: 650; font-size: 15px; }
.wg-parts { display: flex; flex-wrap: wrap; gap: 8px; }
.wg-part { border: 1px solid rgba(127, 140, 160, .35); background: none; color: var(--slate); font: inherit; font-size: 13.5px; font-weight: 600; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.wg-part[aria-pressed="true"] { background: #2f7bf6; border-color: #2f7bf6; color: #fff; }

.wg-fonts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.wg-font { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(127, 140, 160, .35); background: none; color: var(--ink); cursor: pointer; font: inherit; }
.wg-font b { font-size: 18px; }
.wg-font small { font-size: 12px; color: var(--slate); }
.wg-font.f-round b { font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; }
.wg-font.f-avenir b { font-family: "Avenir Next", Avenir, "Century Gothic", sans-serif; font-weight: 600; }
.wg-font[aria-pressed="true"] { border-color: #2f7bf6; background: rgba(47, 123, 246, .08); }


/* тарифа на картичката Струја (Дома) */
.pn-energy .pn-tar { display: block; width: max-content; max-width: 100%; justify-self: start; align-self: flex-start; margin: 3px 0 2px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #c2410c; background: rgba(255, 138, 61, .14); white-space: nowrap; }
.pn-energy .pn-tar::before { content: '● '; font-size: 9px; vertical-align: 1px; }
.pn-energy .pn-tar.low { color: #15803d; background: rgba(22, 163, 74, .13); }
html.dark .pn-energy .pn-tar { color: #ffb47e; background: rgba(255, 138, 61, .18); }
html.dark .pn-energy .pn-tar.low { color: #6ee7a0; background: rgba(34, 197, 94, .16); }

/* мал графикон за собната температура на картичките на климите */
.pn-acc .pn-spark { display: grid; gap: 2px; margin-top: 6px; width: 100%; max-width: 120px; color: var(--c, #ff7a3d); opacity: .9; justify-items: center; }
.pn-acc .pn-spark svg { width: 100%; height: 20px; overflow: visible; }
.pn-acc .pn-spark em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--slate); }
.pn-acc:not(.on) .pn-spark { color: var(--slate); opacity: .6; }

/* последни ѕвонења на картичката за вратата */
#door-card:not([hidden]) { flex-wrap: wrap; }
.door-visits { flex: 1 0 100%; width: 100%; grid-column: 1 / -1; order: 20; display: grid; gap: 8px; padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line, #e6ebf2); }
.door-visits[hidden] { display: none; }
.door-visits .dv-h { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.door-visits .dv-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.door-visits .dv-item { position: relative; display: grid; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: var(--slate); font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.door-visits .dv-item img, .door-visits .dv-item i { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; background: #1c222b; display: grid; place-items: center; font-style: normal; font-size: 20px; }
.door-visits .dv-item.has-vid::after { content: '▶'; position: absolute; left: 6px; top: 6px; font-size: 10px; color: #fff; background: rgba(0, 0, 0, .5); border-radius: 6px; padding: 2px 5px; }
.door-visits .dv-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Пергола: модерна сегментирана контрола (Отвори / Стоп / Затвори) — на сите големини */
.pn-cover .pn-cbtns.pn-seg { display: flex !important; flex-direction: row !important; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(127, 140, 160, .12); align-self: stretch !important; margin-top: 10px; }
.pn-cover .pn-seg .pn-cb { flex: 1 1 0; min-width: 0; height: 46px !important; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 650; box-shadow: none; cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.pn-cover .pn-seg .pn-cb svg { width: 18px; height: 18px; }
.pn-cover .pn-seg .pn-cb:hover:not(:disabled) { background: rgba(127, 140, 160, .14); }
.pn-cover .pn-seg .pn-cb:active:not(:disabled) { transform: scale(.97); }
.pn-cover .pn-seg .pn-cb.active { background: var(--card, #fff); color: #2f7bf6; box-shadow: 0 1px 2px rgba(20, 27, 43, .08), 0 4px 12px rgba(20, 27, 43, .08); }
.pn-cover .pn-seg .pn-cb:disabled { opacity: .35; cursor: default; }
html.dark .pn-cover .pn-cbtns.pn-seg { background: rgba(255, 255, 255, .06); }
html.dark .pn-cover .pn-seg .pn-cb.active { background: rgba(255, 255, 255, .12); color: #7fb0ff; box-shadow: none; }
@media (max-width: 599.98px) {
  .pn-covers > .pn-cover > .pn-cbtns.pn-seg { grid-column: 1 / -1; grid-row: 3; flex-direction: row !important; margin-top: 0; }
  .pn-covers > .pn-cover > .pn-ill { grid-column: 1 / -1; }
  .pn-covers > .pn-cover .pn-ill svg { max-height: 150px; }
  .pn-covers > .pn-cover > .pn-led { grid-row: 4; }
  .pn-cover .pn-seg .pn-cb span { font-size: 13.5px; }
}
/* Пергола: сегментот преку цела ширина, LED под него (сите големини над телефон) */
@media (min-width: 600px) {
  .pn-covers > .pn-cover > .pn-cbtns.pn-seg { grid-column: 1 / -1 !important; grid-row: 3 !important; align-self: start !important; margin-top: 12px; height: auto; }
  .pn-covers > .pn-cover > .pn-led { grid-column: 1 / -1 !important; grid-row: 4 !important; margin-top: 10px; }
  .pn-covers > .pn-cover > .pn-ill { grid-column: 1 / -1 !important; grid-row: 2 !important; }
  .pn-cover .pn-seg .pn-cb { height: 48px !important; }
}
/* Пергола: проценти и LED со лента за јачина */
.pn-cover .pn-h .pn-pct { font-size: 13px; font-weight: 700; color: var(--slate); background: rgba(127, 140, 160, .12); padding: 3px 10px; border-radius: 10px; }
.pn-led-bar { display: block; height: 5px; border-radius: 3px; background: rgba(127, 140, 160, .2); margin-top: 5px; overflow: hidden; max-width: 220px; }
.pn-led-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #ffc94d, #f59f00); }
.pn-led.on .pn-led-t small { color: #b86e00; }
html.dark .pn-led.on .pn-led-t small { color: #ffc94d; }
.pn-cover .pn-h .pn-pct:empty { display: none; }
.pn-led-pick select { flex: none; max-width: 46%; height: 38px; border-radius: 12px; border: 1px solid rgba(127, 140, 160, .3); background: var(--card, #fff); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; padding: 0 10px; cursor: pointer; }
.pn-led-pick .pn-led-t small { white-space: normal; }
.pn-led-learn { flex: none; height: 36px; padding: 0 16px; border-radius: 12px; border: 0; background: #2f7bf6; color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
/* Клими: тренд за 6 часа (значка) */
.pn-acc .pn-trend { align-self: stretch; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 0 6px; font-size: 12.5px; font-weight: 600; color: var(--slate); }
.pn-trend em { font-style: normal; font-weight: 700; font-size: 12.5px; padding: 3px 9px; border-radius: 9px; white-space: nowrap; }
.pn-trend em.cold { background: #e8f1ff; color: #2f6fd6; }
.pn-trend em.warm { background: #fff0e6; color: #d4561c; }
.pn-trend em.same { background: rgba(127, 140, 160, .14); color: var(--slate); }
html.dark .pn-trend em.cold { background: rgba(80, 140, 255, .18); color: #8fb8ff; }
html.dark .pn-trend em.warm { background: rgba(255, 122, 61, .18); color: #ffad7d; }
.pn-acc .pn-acm .pn-trend { justify-content: flex-start; padding: 0; margin-top: 8px; flex-wrap: wrap; row-gap: 4px; }
@media (max-width: 599.98px) {
  .pn-acc .pn-acm .pn-trend { flex-direction: column; justify-content: center; gap: 3px; font-size: 11.5px; }
}
@media (min-width: 600px) {
  .pn-acc .pn-acm .pn-trend { flex-wrap: nowrap; white-space: nowrap; gap: 8px; margin-top: 8px; }
}
/* Струја на почетна: три бројки + часови + тарифи (A+B) */
.pn-energy.pn-en2 { display: grid; gap: 0; align-items: stretch; padding: 16px 20px 14px; }
.pn-en2 .en2-h { display: flex; align-items: center; gap: 8px; }
.pn-en2 .en2-h > i svg { width: 26px; height: 26px; display: block; }
.pn-en2 .en2-h b { flex: 1; font-size: 17px; }
.pn-en2 .en2-h .pn-tar { margin: 0; }
.pn-en2 .en2-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.pn-en2 .en2-stats > div { padding: 0 12px; border-left: 1px solid rgba(127, 140, 160, .18); min-width: 0; }
.pn-en2 .en2-stats > div:first-child { padding-left: 0; border-left: 0; }
.pn-en2 .en2-stats > div > span { display: block; font-size: 12px; font-weight: 600; color: var(--slate); }
.pn-en2 .en2-stats strong { font-size: 26px; font-weight: 400; letter-spacing: -.03em; white-space: nowrap; line-height: 1.15; }
.pn-en2 .en2-stats strong em { font-size: 12.5px; }
.pn-en2 .en2-bars { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin-top: 14px; }
.pn-en2 .en2-bars i { flex: 1; border-radius: 3px 3px 0 0; background: #ffb27a; }
.pn-en2 .en2-bars i.lo { background: #5fd18e; }
.pn-en2 .en2-bars i.f { opacity: .28; }
.pn-en2 .en2-bars i.n { box-shadow: 0 0 0 1.5px var(--ink); }
.pn-en2 .en2-band { position: relative; display: flex; height: 5px; border-radius: 3px; overflow: visible; margin-top: 4px; }
.pn-en2 .en2-band i { flex: 1; background: #ffb27a; opacity: .55; }
.pn-en2 .en2-band i.lo { background: #5fd18e; }
.pn-en2 .en2-band i:first-child { border-radius: 3px 0 0 3px; } .pn-en2 .en2-band i:nth-last-child(2) { border-radius: 0 3px 3px 0; }
.pn-en2 .en2-band b { position: absolute; top: -4px; width: 3px; height: 13px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); }
.pn-en2 .en2-ax { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10.5px; font-weight: 600; color: var(--slate); opacity: .8; }
.pn-en2 [hidden] { display: none !important; }
@media (max-width: 599.98px) {
  .pn-en2 .en2-stats strong { font-size: 22px; }
  .pn-en2 .en2-stats > div { padding: 0 8px; }
  .pn-en2 .en2-h b { font-size: 16px; }
}

.pn-energy.pn-en2 > div { flex: none; flex-direction: row; min-width: 0; }
.pn-energy.pn-en2 > .en2-h { align-items: center; text-align: left; }
.pn-energy.pn-en2 > .en2-stats { display: grid; }
.pn-en2 .en2-stats strong span { display: inline; }

/* ===== Почетна: една типографска скала за сите картички ===== */
#pn { --t-title: 19px; --t-meta: 13px; --t-name: 15.5px; --t-sub: 12.5px; --t-btn: 14px; --t-ax: 11px; --t-stat: 26px; --t-ring: 21px; }
@media (max-width: 599.98px) { #pn { --t-title: 18px; --t-name: 15px; --t-btn: 13.5px; --t-stat: 22px; } }
/* наслови на картичките */
#pn .pn-card > .pn-h h3, #pn .pn-en2 .en2-h b { font-family: "PnDisplay", var(--font); font-size: var(--t-title); font-weight: 700; letter-spacing: -.02em; }
/* десно во насловот */
#pn .pn-card > .pn-h > span, #pn .pn-card > .pn-h > span em, #pn .pn-h .pn-link, #pn .pn-h .pn-pct, #pn .pn-en2 .pn-tar { font-size: var(--t-meta); font-weight: 700; }
/* имиња на ставки */
#pn .pn-acm strong, #pn .pn-room > b, #pn .pn-led-t b, #pn .pn-sh-t b, #pn #door-card .door-t b { font-family: var(--font); font-size: var(--t-name); font-weight: 700; letter-spacing: -.01em; }
/* поднаслови */
#pn .pn-acm small, #pn .pn-acx span, #pn .pn-room > small, #pn .pn-led-t small, #pn .pn-sh-t small, #pn #door-card .door-t span, #pn .pn-trend, #pn .pn-trend em, #pn .en2-stats > div > span { font-size: var(--t-sub); }
#pn .pn-acm small, #pn .pn-led-t small, #pn .pn-sh-t small, #pn #door-card .door-t span, #pn .pn-room > small, #pn .en2-stats > div > span { font-weight: 600; }
#pn .pn-acx span { font-weight: 500; }
/* копчиња */
#pn .pn-seg .pn-cb, #pn .pn-led-dim, #pn .pn-sh-allbtn, #pn .pn-led-learn { font-size: var(--t-btn); font-weight: 700; }
#pn #door-card .talk-btn, #pn #door-card .door-btn { font-size: 15px; font-weight: 700; }
/* бројки */
#pn .pn-acc .pn-ring b { font-size: var(--t-ring); }
#pn .pn-acc .pn-ring b.dec { font-size: calc(var(--t-ring) - 3px); }
#pn .pn-en2 .en2-stats strong { font-size: var(--t-stat); }
#pn .pn-en2 .en2-stats strong em, #pn .pn-en2 .en2-ax { font-size: var(--t-ax); }
#pn .pn-en2 .en2-stats strong em { font-size: 12.5px; }
/* насловот на струјата: иконата да не го турка текстот подолу */
#pn .pn-en2 .en2-h > i svg { width: 22px; height: 22px; }
