/* ===== Дача — общий стиль ===== */
:root {
  --yellow: #FFE000;
  --yellow-dark: #F2CF00;
  --ink: #111111;
  --muted: #8A8A8A;
  --line: #E9E9E9;
  --bg: #FFFFFF;
  --soft: #F5F5F5;
  --soft2: #EDEDED;
  --blue-soft: #E6F0F7;
  --ok: #1FA34A;
  --radius: 28px;
  --shadow: 0 2px 14px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.4;
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 40px; font-weight: 700; margin: 0 0 24px; letter-spacing: -.5px; }
h2 { font-size: 20px; font-weight: 600; margin: 32px 0 14px; }
.muted { color: var(--muted); margin: -6px 0 16px; }
.ico { flex: none; display: block; }

.wrap { max-width: 1380px; margin: 0 auto; padding: 12px 24px 24px; }

/* ----- Верхняя панель ----- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 20px;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--yellow); display: grid; place-items: center;
}
.brand-text { font-weight: 800; font-size: 18px; line-height: 1.05; letter-spacing: .5px; }
.brand-text small { font-weight: 600; font-size: 12px; letter-spacing: 0; color: var(--muted); }
.topbar-status {
  margin: 0 auto; display: flex; align-items: center; gap: 10px;
  background: var(--soft); border-radius: 999px; padding: 10px 20px;
  font-size: 14px; font-weight: 600;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #C8C8C8; }
.dot.ok { background: var(--ok); }
.topbar-actions { display: flex; gap: 12px; }
.round-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--soft); display: grid; place-items: center;
  transition: background .15s;
}
a.round-btn:hover { background: var(--yellow); }

.crumbs { display: flex; gap: 10px; font-size: 15px; padding: 16px 4px 20px; }
.crumb-current { color: var(--muted); }

/* ----- Основная сетка ----- */
.layout { display: grid; grid-template-columns: 330px 1fr; gap: 32px; align-items: start; }

.sidebar { display: flex; flex-direction: column; gap: 14px; }
.side-item {
  position: relative; display: flex; align-items: center; gap: 16px;
  min-height: 92px; padding: 18px 76px 18px 26px;
  background: var(--soft2); border-radius: var(--radius);
  font-size: 18px; font-weight: 600;
  transition: background .15s;
}
.side-item:hover { background: #E3E3E3; }
.side-item.active { background: var(--yellow); }
.side-arrow {
  position: absolute; right: 14px; bottom: 14px;
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; display: grid; place-items: center;
  transform: rotate(-90deg); transition: transform .2s;
}
.side-item.active .side-arrow { transform: rotate(0deg); }
.side-exit { min-height: 72px; background: var(--soft); color: #555; }

.panel { background: var(--soft); border-radius: 36px; padding: 36px 36px 40px; min-height: 520px; }

/* ----- Главная: верхние карточки ----- */
.top-cards { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 16px; }
.card-yellow {
  background: var(--yellow); border-radius: var(--radius);
  padding: 22px 26px; display: flex; flex-direction: column; gap: 12px;
}
.cy-row { display: flex; flex-direction: column; }
.cy-k { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6B5E00; }
.cy-v { font-weight: 700; font-size: 17px; }
.obj-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 8px;
  border: 2px solid transparent; transition: border-color .15s;
}
.obj-card:hover { border-color: var(--yellow); }
.obj-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; }
.obj-name { font-size: 20px; font-weight: 600; }
.obj-sub { font-size: 13px; color: var(--muted); }

/* ----- Карточки параметров ----- */
.params { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.param { background: #fff; border-radius: 24px; padding: 20px 22px; box-shadow: var(--shadow); }
.param-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; margin-bottom: 14px; }
.param-label { color: var(--muted); font-size: 14px; }
.param-value { font-size: 34px; font-weight: 700; }
.param-value small { font-size: 16px; font-weight: 600; color: var(--muted); margin-left: 4px; }

/* ----- Страницы объектов ----- */
.hero { display: grid; grid-template-columns: 240px 1fr; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); max-width: 640px; }
.hero-pic { background: #fff; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero-name { border-top: 1px dashed var(--line); width: 100%; text-align: center; padding-top: 10px; font-size: 20px; }
.hero-info { background: var(--yellow); padding: 24px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.hero-row { display: flex; flex-direction: column; }
.hero-k { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6B5E00; }
.hero-v { font-weight: 700; font-size: 17px; }

.chart-box { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 12px 22px; color: #777; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 5px; }
.seg span { padding: 8px 18px; border-radius: 999px; color: #555; }
.seg .on { background: var(--soft2); color: var(--ink); font-weight: 600; }
.chart-empty {
  height: 260px; border-radius: 20px; background: var(--blue-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: #6C8597;
}

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 0 8px; }

/* ----- Вход ----- */
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--soft); padding: 20px; overflow: hidden; }
.wire { position: fixed; left: 0; right: 0; bottom: 8vh; width: 100%; height: 300px; z-index: 0; }
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: #fff; border-radius: 36px; padding: 36px 32px; box-shadow: var(--shadow);
}
.brand-center { justify-content: center; margin-bottom: 26px; }
.login-card h1 { font-size: 30px; text-align: center; margin-bottom: 18px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 999px; padding: 0 20px; color: #999;
}
.field:focus-within { border-color: var(--ink); color: var(--ink); }
.field input { border: 0; outline: 0; flex: 1; font: inherit; padding: 15px 0; background: transparent; color: var(--ink); }
.btn-yellow {
  border: 0; border-radius: 999px; background: var(--yellow);
  font: inherit; font-weight: 700; padding: 16px; cursor: pointer; margin-top: 6px;
}
.btn-yellow:hover { background: var(--yellow-dark); }
.err { color: #C62828; font-size: 14px; text-align: center; }
.hash { width: 100%; height: 90px; border-radius: 16px; border: 1px solid var(--line); padding: 12px; font-family: Consolas, monospace; font-size: 13px; resize: none; }

/* ----- Адаптив ----- */
@media (max-width: 1100px) {
  .top-cards { grid-template-columns: 1fr 1fr 1fr; }
  .card-yellow { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .wrap { padding: 10px 12px 20px; }
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .sidebar { flex-direction: row; overflow-x: auto; gap: 10px; padding-bottom: 4px; }
  .side-item { min-height: 0; padding: 12px 18px; font-size: 15px; white-space: nowrap; border-radius: 999px; }
  .side-arrow { display: none; }
  .side-exit { min-height: 0; }
  .topbar-status { display: none; }
  .topbar { justify-content: space-between; }
  .round-btn { width: 44px; height: 44px; }
  .panel { padding: 22px 16px; border-radius: 28px; }
  h1 { font-size: 30px; }
  .top-cards { grid-template-columns: 1fr; }
  .obj-card { flex-direction: row; justify-content: flex-start; text-align: left; padding: 14px 18px; }
  .obj-icon { width: 52px; height: 52px; }
  .obj-sub { margin-left: auto; }
  .hero { grid-template-columns: 1fr; }
  .params { grid-template-columns: 1fr 1fr; }
  .param-value { font-size: 26px; }
}

/* ----- Схема топочной ----- */
.scheme-box { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); overflow-x: auto; }
.scheme { display: block; width: 100%; min-width: 640px; height: auto; }
.scheme .pipe { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.scheme .pipe.hot { stroke: #FF8A1F; }
.scheme .pipe.cold { stroke: #4A9BE0; }
.scheme .pipe.mid { stroke: #C9C9C9; }
.scheme .sch-node { fill: #fff; stroke: #111; stroke-width: 3; }
.scheme .sch-boiler rect { fill: #EDEDED; stroke: #111; stroke-width: 3; }
.scheme .sch-boiler .door { fill: #fff; }
.scheme .sch-boiler .flame { fill: var(--yellow); stroke: #111; stroke-width: 2; }
.scheme .sch-buffer rect { stroke: #111; stroke-width: 3; }
.scheme .sensor { fill: var(--yellow); stroke: #111; stroke-width: 2.5; }
.scheme .sch-pump circle { fill: #fff; stroke: #111; stroke-width: 3; }
.scheme .sch-pump polygon { fill: #111; }
.scheme .sch-badge rect { fill: #fff; stroke: var(--line); stroke-width: 2; }
.scheme .sch-label { font-size: 13px; fill: var(--muted); }
.scheme .sch-val { font-size: 20px; font-weight: 700; fill: var(--ink); }
.scheme .sch-title { font-size: 16px; font-weight: 600; text-anchor: middle; fill: var(--ink); }

/* ----- Схема энергомониторинга ----- */
.demo-note { display: inline-block; background: var(--soft); border-radius: 999px; padding: 8px 16px; font-size: 13px; color: #666; margin-bottom: 10px; }
.scheme .sch-grid path { fill: none; stroke: #111; stroke-width: 4; stroke-linecap: round; }
.scheme .sch-grid circle { fill: var(--yellow); stroke: #111; stroke-width: 2; }
.scheme .sch-grid { transition: opacity .3s; }
.scheme .sch-grid.off { opacity: .35; }
.scheme .sch-inverter rect { fill: #EDEDED; stroke: #111; stroke-width: 3; }
.scheme .sch-inverter .screen { fill: #fff; }
.scheme .sch-inverter .led { fill: var(--yellow); stroke: #111; stroke-width: 2; }
.scheme .sch-battery rect { fill: #EDEDED; stroke: #111; stroke-width: 3; }
.scheme .sch-battery .cap { fill: #111; }
.scheme .sch-battery path { stroke: #111; stroke-width: 3; }
.scheme .pipe.load { stroke: var(--yellow-dark); }
.scheme .flow-label { font-size: 15px; font-weight: 600; text-anchor: middle; fill: var(--ink); }

.scheme .flow line { stroke: #C9C9C9; stroke-width: 7; stroke-linecap: round; transition: stroke .3s; }
.scheme .flow polygon { fill: #C9C9C9; transition: fill .3s; }
.scheme .flow.on line { stroke-dasharray: 16 10; animation: flowdash .8s linear infinite; }
.scheme .flow.export.on line { stroke: var(--ok); }
.scheme .flow.export.on polygon { fill: var(--ok); }
.scheme .flow.import.on line { stroke: #4A9BE0; }
.scheme .flow.import.on polygon { fill: #4A9BE0; }
@keyframes flowdash { from { stroke-dashoffset: 26; } to { stroke-dashoffset: 0; } }

.scheme .grid-off-x { display: none; }
.scheme .grid-off-x.show { display: inline; }
.scheme .grid-off-x circle { fill: #fff; stroke: #E53935; stroke-width: 3; }
.scheme .grid-off-x path { stroke: #E53935; stroke-width: 4; stroke-linecap: round; }
.scheme .flow-label-left { text-anchor: start; }
.scheme .sch-val-sm { font-size: 17px; }
.scheme .sch-inverter .screen-label { font-size: 12px; text-anchor: middle; fill: var(--muted); }
.scheme .sch-inverter .screen-val { font-size: 30px; font-weight: 700; text-anchor: middle; fill: var(--ink); }

/* ----- План дома ----- */
.scheme.plan .floor { fill: #FBFBFB; }
.scheme.plan .walls rect, .scheme.plan .walls path { fill: none; stroke: #111; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.scheme.plan .stairs rect { fill: #EDEDED; stroke: #888; stroke-width: 2; }
.scheme.plan .stairs path { stroke: #888; stroke-width: 2; }
.scheme.plan .cellar rect { fill: #EDEDED; stroke: #111; stroke-width: 3; stroke-dasharray: 10 6; }
.scheme.plan .cellar path { stroke: #CFCFCF; stroke-width: 2; }
.scheme.plan .upstairs rect { fill: var(--yellow); stroke: #111; stroke-width: 3; }
.scheme.plan .upstairs .up-label { fill: #6B5E00; }
.scheme.plan .up-arrow { fill: none; stroke: #111; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.scheme.plan .room-name { font-size: 18px; font-weight: 600; text-anchor: middle; fill: #B5B5B5; }
.scheme.plan .room-big { font-size: 30px; }
.scheme.plan .fireplace rect { fill: #3A3A3A; stroke: #111; stroke-width: 3; }
.scheme.plan .fireplace .fp-flame { fill: var(--yellow); stroke: #111; stroke-width: 1.5; }
.scheme.plan .fp-label { font-size: 15px; font-weight: 600; text-anchor: end; fill: var(--ink); }

/* ----- Топочная: электрокотёл, ТЭН, тумблеры ----- */
.scheme .sch-small { font-size: 13px; }
.scheme .el-bolt { fill: #C9C9C9; stroke: #111; stroke-width: 1.5; stroke-linejoin: round; transition: fill .2s; }
.scheme #dev-el_boiler { transition: fill .2s; }
.scheme #dev-el_boiler.on { fill: var(--yellow); }
.scheme #dev-el_boiler.on + .el-bolt { fill: #111; }
.scheme .sch-dev-pump.on circle { fill: var(--yellow); }
.scheme .sch-ten .ten-flange { fill: #555; stroke: #111; stroke-width: 2; }
.scheme .sch-ten .ten-tube { fill: none; stroke: #555; stroke-width: 5; stroke-linecap: round; transition: stroke .2s; }
.scheme .sch-ten.on .ten-tube { stroke: #FF3D00; }
.scheme .sch-ten .ten-label { font-size: 13px; font-weight: 700; text-anchor: middle; fill: var(--ink); }

.scheme .wire { fill: none; stroke: #8A8A8A; stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 2 4; stroke-linecap: round; transition: stroke .2s; }
.scheme .wire.on { stroke: #111; stroke-dasharray: none; }

.scheme .sch-toggle { cursor: pointer; outline: none; }
.scheme .sch-toggle .tg-box { fill: #fff; stroke: var(--line); stroke-width: 2; transition: stroke .2s; }
.scheme .sch-toggle:hover .tg-box, .scheme .sch-toggle:focus .tg-box { stroke: #111; }
.scheme .sch-toggle .tg-label { font-size: 13px; font-weight: 600; text-anchor: middle; fill: var(--ink); }
.scheme .sch-toggle .tg-track { fill: #DADADA; transition: fill .2s; }
.scheme .sch-toggle .tg-knob { fill: #fff; stroke: #BDBDBD; stroke-width: 1; transition: transform .2s; }
.scheme .sch-toggle.on .tg-track { fill: var(--yellow); }
.scheme .sch-toggle.on .tg-knob { transform: translateX(28px); stroke: #111; }
.scheme .sch-toggle .tg-state { font-size: 12px; font-weight: 700; text-anchor: middle; fill: var(--muted); }
.scheme .sch-toggle.on .tg-state { fill: var(--ink); }
.scheme-box .demo-note { margin: 12px 0 0; }

/* ----- Живые данные и графики ----- */
.stale { opacity: .5; }
.pill-input { padding: 6px 16px; color: var(--ink); }
.pill-input input, .pill-input select { border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); padding: 6px 0; cursor: pointer; }
.seg button { border: 0; background: transparent; font: inherit; padding: 8px 18px; border-radius: 999px; color: #555; cursor: pointer; }
.seg button.on { background: var(--soft2); color: var(--ink); font-weight: 600; }
.chart-wrap { position: relative; height: 320px; }
.chart-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6C8597; background: var(--blue-soft); border-radius: 20px; }
@media (max-width: 860px) { .chart-wrap { height: 260px; } }

/* ----- Насос котла с крыльчаткой ----- */
.scheme .sch-impeller .ip-body { fill: #fff; stroke: #111; stroke-width: 3; }
.scheme .sch-impeller .ip-rotor { transform-box: fill-box; transform-origin: center; }
.scheme .sch-impeller .ip-rotor path { fill: #BDBDBD; stroke: #111; stroke-width: 1; transition: fill .3s; }
.scheme .sch-impeller .ip-hub { fill: #111; }
.scheme .sch-impeller .ip-label { font-size: 13px; font-weight: 600; text-anchor: middle; fill: var(--ink); }
.scheme .sch-impeller .ip-state { font-size: 12px; font-weight: 700; text-anchor: middle; fill: var(--muted); }
.scheme .sch-impeller.on .ip-rotor { animation: ip-spin 1s linear infinite; }
.scheme .sch-impeller.on .ip-rotor path { fill: var(--ok); }
.scheme .sch-impeller.on .ip-body { stroke: var(--ok); }
.scheme .sch-impeller.on .ip-state { fill: var(--ok); }
@keyframes ip-spin { to { transform: rotate(360deg); } }
.scheme .sch-impeller .ip-left { text-anchor: end; }
.scheme .sch-left { text-anchor: end; }

/* ----- Блокировки тумблеров и окно подтверждения ----- */
.scheme .sch-toggle.locked .tg-box { stroke-dasharray: 6 4; }
.scheme .sch-toggle.locked:not(.on) .tg-track { fill: #EDEDED; }
.scheme .sch-toggle .tg-state { font-size: 11px; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-back.show { display: flex; }
.modal { background: #fff; border-radius: 28px; padding: 28px; max-width: 420px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.modal-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.modal-text { color: #555; margin-bottom: 22px; }
.modal-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-btns button { flex: 1; min-width: 140px; border: 0; border-radius: 999px; padding: 14px 18px; font: inherit; font-weight: 700; cursor: pointer; }
.btn-danger { background: #E53935; color: #fff; }
.btn-danger:hover { background: #C62828; }
.btn-soft { background: var(--soft2); color: var(--ink); }
.btn-soft:hover { background: #E0E0E0; }

/* ----- Тёплый пол: теплообменник и коллектор ----- */
.scheme .sch-hx rect { fill: #EDEDED; stroke: #111; stroke-width: 3; }
.scheme .hx-coil { fill: none; stroke-width: 3; stroke-linejoin: round; }
.scheme .hx-coil.hot { stroke: #FF8A1F; }
.scheme .hx-coil.cold { stroke: #FFB366; }
.scheme .mf-bar { stroke: #111; stroke-width: 3; }
.scheme .mf-bar.hot { fill: #FFD2AE; }
.scheme .mf-bar.cold { fill: #CFE3F7; }
.scheme .mf-out { fill: #D9D9D9; stroke: #111; stroke-width: 2; }
.scheme .mf-cap { stroke: #111; stroke-width: 2; }
.scheme .mf-cap.hot { fill: #FF8A1F; }
.scheme .mf-cap.cold { fill: #4A9BE0; }
.scheme .mf-sub { text-anchor: middle; }
.scheme-box + h2 { margin-top: 28px; }

/* ----- Крупные значения в жёлтой плашке ----- */
.hero { grid-template-columns: 240px 1fr auto; max-width: 820px; }
.hero:not(:has(.hero-values)) { grid-template-columns: 240px 1fr; max-width: 640px; }
.hero-values { background: var(--yellow); padding: 24px 32px 24px 10px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 6px; text-align: right; }
.hv { display: flex; flex-direction: column; }
.hv-k { font-size: 13px; color: #6B5E00; }
.hv-v { font-weight: 700; font-size: 26px; line-height: 1.1; }
.hv-v small { font-size: 15px; font-weight: 600; margin-left: 3px; color: #6B5E00; }
.hv-main .hv-v { font-size: 46px; }
.hv-main .hv-v small { font-size: 20px; }
@media (max-width: 860px) {
  .hero, .hero:not(:has(.hero-values)) { grid-template-columns: 1fr 1fr; }
  .hero-pic { grid-column: 1 / -1; }
  .hero-values { padding: 20px; }
  .hv-main .hv-v { font-size: 36px; }
}
/* не даём широким схемам растягивать страницу на телефоне */
.layout > * { min-width: 0; }

/* ----- Солнечные поля ----- */
.scheme .pv-glass { fill: #1E3A8A; stroke: #111; stroke-width: 3; stroke-linejoin: round; }
.scheme .pv-grid path { stroke: #7FA6E8; stroke-width: 1.5; fill: none; }
.scheme .pv-label { font-size: 14px; font-weight: 700; text-anchor: middle; fill: var(--ink); }
.scheme .pv-vals { font-size: 13px; text-anchor: middle; fill: #555; }
.scheme .pv-line { fill: none; stroke: var(--yellow-dark); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.scheme .pv-total rect { fill: var(--yellow); stroke: #111; stroke-width: 2.5; }
.scheme .pv-total-k { font-size: 12px; text-anchor: middle; fill: #6B5E00; }
.scheme .pv-total-v { font-size: 26px; font-weight: 800; text-anchor: middle; fill: var(--ink); }
.scheme .pv-total-u { font-size: 15px; font-weight: 600; }

/* ----- Компактная схема (Энергомониторинг): помещается на телефоне ----- */
.scheme.compact { min-width: 0; max-width: 680px; margin: 0 auto; }
.scheme .load-total rect { fill: #fff; stroke: #111; stroke-width: 2.5; }
@media (max-width: 860px) {
  .scheme-box:has(.scheme.compact) { padding: 12px 8px; }
  .scheme.compact .sch-label, .scheme.compact .pv-vals, .scheme.compact .pv-total-k, .scheme.compact .screen-label { font-size: 14px; }
  .scheme.compact .sch-title.sch-small { font-size: 13px; }
  .scheme.compact .sch-title, .scheme.compact .flow-label, .scheme.compact .pv-label { font-size: 17px; }
  .scheme.compact .sch-val { font-size: 22px; }
}

/* ----- Заряд / разряд АКБ ----- */
.scheme .flow-small { font-size: 12px; text-anchor: middle; }
.scheme .flow.charge.on line { stroke: var(--ok); }
.scheme .flow.charge.on polygon { fill: var(--ok); }
.scheme .flow.discharge.on line { stroke: #E8590C; }
.scheme .flow.discharge.on polygon { fill: #E8590C; }

/* ----- Профиль мощности: панель значений ----- */
.ch-readout { margin: 0 4px 12px; }
.ro-time { color: #3B5BDB; font-size: 15px; margin-bottom: 8px; }
.ro-time b { color: var(--ink); }
.ro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 240px)); gap: 6px 24px; }
.ro-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ro-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ro-k { color: var(--muted); }
.ro-v { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 860px) { .ro-grid { grid-template-columns: 1fr 1fr; gap: 6px 12px; } .ro-item { font-size: 12px; gap: 5px; } .ro-k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

/* Главная: жёлтая сводка на всю ширину, ниже 4 раздела */
.top-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.top-cards .obj-name { font-size: 17px; overflow-wrap: anywhere; }
.top-cards .card-yellow { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 12px 40px; }
@media (max-width: 1100px) { .top-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .top-cards { grid-template-columns: 1fr; } }

/* ----- Настройки: ссылка-плитка ----- */
.param-link { display: block; border: 2px solid transparent; transition: border-color .15s; }
.param-link:hover { border-color: var(--yellow); }
.param-open { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 600; font-size: 14px; }
.param-open .ico { transform: rotate(-90deg); }

/* ----- Реестр датчиков ----- */
.back-link { color: var(--ink); font-weight: 600; }
.room-h { display: flex; align-items: center; gap: 10px; }
.room-ico { width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; }
.dev-empty { background: #fff; border-radius: 20px; padding: 18px 22px; color: var(--muted); border: 2px dashed var(--line); }
.dev-card { background: #fff; border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 14px; }
.dev-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dev-name { font-size: 20px; font-weight: 700; }
.dev-code { font-size: 13px; font-weight: 700; background: var(--soft2); border-radius: 999px; padding: 3px 10px; margin-left: 6px; vertical-align: middle; }
.dev-where { color: var(--muted); font-size: 14px; margin-top: 2px; }
.dev-status { flex: none; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 6px 12px; background: var(--soft2); }
.dev-status.st-design { background: #FFF4BF; }
.dev-status.st-build { background: #FFE0C2; }
.dev-status.st-work { background: #D3F2DC; color: #1B6E36; }
.dev-about { color: #444; margin: 12px 0 6px; }
.dev-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.dev-sub { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 14px 0 6px; }
.dev-list { list-style: none; margin: 0; padding: 0; }
.dev-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #F2F2F2; font-size: 15px; }
.dev-list li:last-child { border-bottom: 0; }
.dev-meta { color: var(--muted); font-size: 13px; text-align: right; flex: none; max-width: 50%; }
.dev-safety li::before { content: "⚠"; margin-right: 8px; color: #E8590C; }
.dev-proposal li { color: #555; }
.dev-proposal li::before { content: "?"; font-weight: 700; color: #B08900; margin-right: 10px; }
@media (max-width: 860px) {
  .dev-cols { grid-template-columns: 1fr; }
  .dev-card { padding: 18px 16px; }
  .dev-head { flex-direction: column; }
}
.dev-safety li, .dev-proposal li { justify-content: flex-start; gap: 0; }
.dev-panel li { justify-content: flex-start; gap: 0; }
.dev-panel li::before { content: "●"; color: var(--yellow-dark); margin-right: 10px; }

/* ----- Сарай: план ----- */
.scheme.plan .room-coop { fill: #FFF8D6; }
.scheme.plan .batt-box { fill: #EEF5EC; stroke: #111; stroke-width: 2.5; stroke-dasharray: 8 5; }
.scheme.plan .sch-inv-small rect { fill: #EDEDED; stroke: #111; stroke-width: 3; }
.scheme.plan .sch-inv-small circle { fill: var(--yellow); stroke: #111; stroke-width: 1.5; }
.scheme .sch-status .st-box { fill: #fff; stroke: var(--line); stroke-width: 2; }
.scheme .sch-status .st-ico-bg { fill: var(--soft2); }
.scheme .sch-status .st-fill { fill: #BDBDBD; stroke: #111; stroke-width: 1; }
.scheme .sch-status .st-line { fill: none; stroke: #8A8A8A; stroke-width: 2; stroke-linecap: round; }
.scheme .sch-status .st-hub { fill: #111; }
.scheme .sch-status .st-label { font-size: 13px; font-weight: 600; fill: var(--ink); }
.scheme .sch-status .st-text { font-size: 12px; font-weight: 700; fill: var(--muted); }
.scheme .sch-status .st-rotor { transform-box: fill-box; transform-origin: center; }
.scheme .sch-status.on .st-box { stroke: var(--ok); }
.scheme .sch-status.on .st-text { fill: var(--ok); }
.scheme .sch-status.on .st-ico-bg { fill: #FFF4BF; }
.scheme .sch-status.st-bulb.on .st-fill { fill: var(--yellow); }
.scheme .sch-status.st-fan.on .st-fill { fill: var(--ok); }
.scheme .sch-status.st-fan.on .st-rotor { animation: ip-spin 1s linear infinite; }
.scheme .sch-status.st-floor.on .st-wave, .scheme .sch-status.st-heat.on .st-wave { stroke: #E8590C; }

/* ----- Настройки автоматики ----- */
.set-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.set-card { background: #fff; border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.set-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.set-block { padding: 14px 0; border-bottom: 1px solid #F2F2F2; }
.set-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 10px; }
.set-row { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 6px; }
.set-row label { display: flex; align-items: center; gap: 8px; color: #444; font-size: 15px; }
.set-row input { font: inherit; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; color: var(--ink); }
.set-row input[type=number] { width: 80px; }
.set-row input:focus { outline: none; border-color: var(--ink); }
.inp-u { display: inline-flex; align-items: center; gap: 6px; }
.set-note { color: var(--muted); font-size: 13px; margin-top: 8px; }
.set-foot { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.set-foot .btn-yellow { margin: 0; padding: 12px 26px; }
.set-msg { font-size: 14px; }
.set-msg.ok { color: var(--ok); }
.set-msg.err { color: #C62828; }
.mode-seg { padding: 4px; }
.mode-seg label { cursor: pointer; }
.mode-seg input { position: absolute; opacity: 0; pointer-events: none; }
.mode-seg span { display: inline-block; padding: 6px 14px; border-radius: 999px; color: #555; font-weight: 500; font-size: 14px; }
.mode-seg input:checked + span { background: var(--yellow); color: var(--ink); font-weight: 700; }
@media (max-width: 1100px) { .set-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .set-card { padding: 18px 16px; } .set-head { flex-wrap: wrap; } }
.scheme.plan.compact { max-width: 760px; }
@media (max-width: 860px) {
  .scheme.compact .st-label { font-size: 12.5px; }
  .scheme.compact .st-text { font-size: 13px; }
  .scheme.plan.compact .room-big { font-size: 26px; }
}

/* ----- Одна стрелка АКБ и поток от солнца ----- */
.scheme .flow.batt .head-r, .scheme .flow.batt .head-l { display: none; }
.scheme .flow.batt.charge line, .scheme .flow.batt.discharge line { stroke-dasharray: 16 10; animation: flowdash .8s linear infinite; }
.scheme .flow.batt.charge line { stroke: var(--ok); }
.scheme .flow.batt.charge .head-r { display: inline; fill: var(--ok); }
.scheme .flow.batt.discharge line { stroke: #E8590C; animation-direction: reverse; }
.scheme .flow.batt.discharge .head-l { display: inline; fill: #E8590C; }
.scheme .pv-flow .pv-line { stroke: #DADADA; transition: stroke .3s; }
.scheme .pv-flow .pv-head { fill: #DADADA; transition: fill .3s; }
.scheme .pv-flow.on .pv-line { stroke: #F5A400; stroke-dasharray: 16 10; animation: flowdash .8s linear infinite; }
.scheme .pv-flow.on .pv-head { fill: #F5A400; }

/* ----- Видеонаблюдение ----- */
.cam-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.cam-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.cam-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cam-tile { background: #fff; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); border: 2px solid transparent; transition: border-color .15s; cursor: pointer; }
.cam-tile:hover { border-color: var(--yellow); }
.cam-view { position: relative; aspect-ratio: 16 / 9; background: #1F2329; color: #6B7380; }
.cam-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.cam-badge { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,.45); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 4px 9px; text-transform: uppercase; letter-spacing: .4px; }
.cam-rec { width: 7px; height: 7px; border-radius: 50%; background: #8A8A8A; }
.cam-full { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }
.cam-info { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 14px 12px; }
.cam-name { font-weight: 700; font-size: 15px; }
.cam-place { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-note { margin-top: 18px; }
@media (max-width: 1100px) { .cam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cam-grid { gap: 10px; } .cam-tile { border-radius: 16px; } .cam-info { padding: 8px 10px 10px; } .cam-name { font-size: 13px; } .cam-place { font-size: 11px; } .cam-empty span { display: none; } }

/* ----- Дом: отдельная версия плана для телефона ----- */
.scheme.plan-mob { display: none; min-width: 0; }
.scheme.plan-mob .mob-tag text, .scheme.plan-mob .upstairs text { text-anchor: middle; }
.scheme.plan-mob .mt-label { font-size: 34px; font-weight: 600; fill: var(--muted); }
.scheme.plan-mob .up-label { fill: #6B5E00; }
.scheme.plan-mob .mt-val { font-size: 48px; font-weight: 700; fill: var(--ink); }
.scheme.plan-mob .fp-label { font-size: 30px; }
.scheme.plan-mob .walls rect, .scheme.plan-mob .walls path { stroke-width: 9; }
@media (max-width: 860px) {
  .scheme.plan-wide { display: none; }
  .scheme.plan-mob { display: block; }
  .scheme-box:has(.plan-mob) { padding: 12px 8px; }
}
.scheme.plan-mob .mt-sm .mt-label { font-size: 30px; }
.scheme.plan-mob .mt-sm .mt-val { font-size: 38px; }

/* ----- Режим «На даче / Уехал» в шапке ----- */
.presence {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  border: 0; background: var(--soft); border-radius: 999px; padding: 6px 16px 6px 6px;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer;
  transition: background .2s;
}
.presence:disabled { opacity: .6; cursor: wait; }
.pr-track { position: relative; width: 64px; height: 36px; border-radius: 999px; background: #D6D6D6; transition: background .25s; }
.pr-knob {
  position: absolute; top: 3px; left: 3px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); display: grid; place-items: center;
  transition: transform .25s;
}
.pr-i { display: none; line-height: 0; }
.pr-t-home, .pr-t-away { display: none; }
.presence.home .pr-track { background: var(--yellow); }
.presence.home .pr-knob { transform: translateX(28px); }
.presence.home .pr-home, .presence.home .pr-t-home { display: inline; }
.presence.away .pr-away, .presence.away .pr-t-away { display: inline; }
.presence.away .pr-t-away { color: #666; }
@media (max-width: 860px) {
  .presence { padding: 4px; margin-left: auto; }
  .presence .pr-text { display: none; }
  .topbar-actions .round-btn:not(a) { display: none; }   /* заглушка «Настройки» на телефоне не нужна — есть в меню */
  .pr-track { width: 58px; height: 34px; }
  .pr-knob { width: 28px; height: 28px; }
  .presence.home .pr-knob { transform: translateX(24px); }
}
.pr-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #111; color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14px;
  transition: opacity .25s, transform .25s; z-index: 100; pointer-events: none;
}
.pr-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ----- Журнал входов ----- */
.log-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 18px; margin-bottom: 26px; }
.log-row { display: grid; grid-template-columns: 170px 150px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log-row:last-child { border-bottom: 0; }
.log-box .log-row:only-child { border-bottom: 0; }
.log-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.log-ip { font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-all; }
.log-block .log-msg { color: #C62828; font-weight: 600; }
.log-row.no-time { grid-template-columns: 150px 1fr; }
.log-empty { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; color: var(--muted); margin-bottom: 26px; }
@media (max-width: 860px) {
  .log-box { padding: 4px 14px; }
  .log-row, .log-row.no-time { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .log-row .log-time { order: 2; text-align: right; font-size: 12px; }
  .log-row .log-ip { order: 1; }
  .log-row .log-msg { order: 3; grid-column: 1 / -1; font-size: 13px; }
}

/* ----- Смена пароля ----- */
.pw-card { max-width: 460px; }
.pw-btn { display: block; text-align: center; text-decoration: none; color: var(--ink); }

/* ----- Главная: параметры в карточках разделов ----- */
.obj-body { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.obj-vals { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 4px; }
.ov-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; background: var(--soft); border-radius: 12px; }
.ov-k { font-size: 12px; color: var(--muted); text-align: left; line-height: 1.2; }
.ov-v { font-size: 18px; font-weight: 700; white-space: nowrap; }
.ov-v.stale { color: var(--muted); }
@media (max-width: 860px) {
  .obj-card { align-items: flex-start; }
  .obj-body { align-items: flex-start; }
  .obj-card .obj-icon { flex-shrink: 0; }
  .obj-body .obj-sub { margin-left: 0; }
  .ov-row { flex-direction: row; justify-content: space-between; align-items: baseline; width: 100%; }
  .ov-k { font-size: 13px; }
}

/* Энергосхема: нет связи с инвертором — последние данные серым */
#energy-scheme.stale { filter: grayscale(1); opacity: .55; }
.demo-note.warn { background: #FDECEC; color: #B3261E; }

/* ----- Уведомления ----- */
.nt-rule { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #F2F2F2; }
.nt-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.nt-ico.info { background: var(--yellow); }
.nt-ico.alert { background: #E53935; color: #fff; }
@media (max-width: 860px) { .set-grid { grid-template-columns: 1fr; } }
[hidden] { display: none !important; }
.log-row .log-msg { overflow-wrap: anywhere; min-width: 0; }
.log-row > * { min-width: 0; }

/* ----- Правила уведомлений ----- */
.nt-saved { display: inline-block; background: #E6F6EA; color: #1E7B34; font-weight: 700; padding: 8px 16px; border-radius: 999px; margin-bottom: 12px; }
.nt-group { font-weight: 700; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 8px; }
.nt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.nt-param { background: #fff; border-radius: 22px; padding: 14px 18px; box-shadow: var(--shadow); }
.nt-pname { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.nt-pname b { font-size: 17px; }
.nt-pname .muted { font-size: 13px; }
.nt-row { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #F2F2F2; cursor: pointer; }
.nt-ico.sm { width: 22px; height: 22px; font-size: 12px; }
.nt-lbl { font-size: 15px; }
.nt-sw { position: relative; width: 48px; height: 28px; }
.nt-sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.nt-sw i { position: absolute; inset: 0; background: #DADADA; border-radius: 999px; transition: background .2s; }
.nt-sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.nt-sw input:checked + i { background: var(--yellow); }
.nt-sw input:checked + i::after { transform: translateX(20px); }
.nt-val { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; }
.nt-val input { width: 64px; font: inherit; font-weight: 700; color: var(--ink); text-align: right; border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; background: #fff; }
.nt-val input:focus { outline: none; border-color: var(--ink); }
.nt-val small { width: 22px; }
.nt-row:has(input[type=checkbox]:not(:checked)) .nt-val { opacity: .4; }
.nt-save { width: 100%; max-width: 420px; margin-top: 18px; }
@media (max-width: 860px) { .nt-list { grid-template-columns: 1fr; } }

/* Энергосхема: АКБ с сегментами заряда */
.scheme .sch-batt2 .bt-cap { fill: url(#bt-metal); stroke: #555; stroke-width: 1; }
.scheme .sch-batt2 .bt-shell { fill: url(#bt-metal); stroke: #4A4A4A; stroke-width: 1.5; }
.scheme .sch-batt2 .bt-inner { fill: url(#bt-body); }
.scheme .sch-batt2 .bt-seg { fill: transparent; transition: fill .3s; }
.scheme .sch-batt2 .bt-seg.on.green { fill: url(#bt-green); }
.scheme .sch-batt2 .bt-seg.on.yellow { fill: url(#bt-yellow); }
.scheme .sch-batt2 .bt-seg.on.red { fill: url(#bt-red); }

/* Индикаторы на корпусе инвертора (как на старых Deye) */
.scheme .inv-leds .iled circle { fill: #D2D2D2; stroke: #A8A8A8; stroke-width: 1; transition: fill .3s; }
.scheme .inv-leds .iled text { font-size: 9.5px; font-weight: 700; fill: #9E9E9E; }
.scheme .inv-leds .iled.on circle { fill: #2EAD4B; stroke: #1B7A31; filter: drop-shadow(0 0 2px rgba(46,173,75,.9)); }
.scheme .inv-leds .iled.on text { fill: #111; }
.scheme .inv-leds .iled.alarm.on circle { fill: #E53935; stroke: #9C1C1C; filter: drop-shadow(0 0 2px rgba(229,57,53,.9)); }
@media (max-width: 860px) { .scheme.compact .inv-leds .iled text { font-size: 10px; } }

/* ----- Отключения сети ----- */
.og-sum { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.og-tile { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 14px 20px; display: flex; flex-direction: column; min-width: 160px; }
.og-k { font-size: 13px; color: var(--muted); }
.og-tile b { font-size: 28px; line-height: 1.2; }
.og-s { font-size: 13px; color: var(--muted); }
.og-row { display: grid; grid-template-columns: 60px 1fr 110px 170px; gap: 10px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.og-row:last-child { border-bottom: 0; }
.og-date { color: var(--muted); }
.og-dur { font-weight: 700; }
.og-soc { color: var(--muted); text-align: right; }
.og-open .og-time b { color: #C62828; }
.og-open { background: #FDF3F3; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
@media (max-width: 860px) {
  .og-row { grid-template-columns: 50px 1fr auto; }
  .og-soc { grid-column: 2 / -1; text-align: left; font-size: 13px; }
  .og-open { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
  .og-tile { flex: 1; min-width: 0; }
}

/* ----- Графики: дата со стрелками, итоги энергии ----- */
.ch-datebox { gap: 6px; }
.ch-nav { border: 0; background: transparent; font: inherit; font-size: 22px; line-height: 1; padding: 0 4px; cursor: pointer; color: var(--ink); }
.ch-nav:hover { color: #000; }
.ch-dlabel { font-weight: 600; min-width: 74px; text-align: center; }
@media (max-width: 860px) {
  .ro-stack .ro-item { display: grid; grid-template-columns: 10px 1fr; column-gap: 6px; row-gap: 0; align-items: center; }
  .ro-stack .ro-v { grid-column: 2; margin-left: 0; font-size: 14px; }
  .ch-period button { padding: 8px 12px; }
  .chart-box .filters { flex-wrap: wrap; }
}

/* Видеонаблюдение: снимки и крупный просмотр */
.cam-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-rec.on { background: #43A047; }
.cam-legend .dot.ok { background: #43A047; }
.cam-modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cam-modal-box { width: min(1200px, 100%); background: #1F2329; border-radius: 18px; overflow: hidden; }
.cam-modal-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: #fff; }
.cam-modal-head .cam-place { color: #AEB4BD; flex: 1; }
.cam-x { background: rgba(255,255,255,.12); color: #fff; border: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.cam-modal-view { position: relative; aspect-ratio: 16 / 9; background: #111; color: #8A919C; }
.cam-modal-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ok-msg { color: #2E7D32; font-size: 14px; text-align: center; }
.btn-ghost { background: transparent; border: 2px solid var(--yellow); }
.btn-ghost:hover { background: var(--yellow); }
@media (max-width: 860px) { .cam-modal { padding: 0; } .cam-modal-box { border-radius: 0; } }
.param-sub { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.35; }
@media (min-width: 1101px) { .params:has(> .param:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Полоса суток «Сеть сегодня» */
.gt-card { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 14px 20px 10px; margin-bottom: 12px; }
.gt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.gt-head > span:first-child { font-weight: 700; color: var(--text, #1F2329); font-size: 14px; }
.gt-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: -1px; }
.gt-bar { position: relative; height: 18px; border-radius: 9px; background: #EEF0F3; overflow: hidden; }
.gt-seg { position: absolute; top: 0; bottom: 0; min-width: 2px; }
.gt-on, .gt-leg .gt-on { background: #43A047; }
.gt-off, .gt-leg .gt-off { background: #E53935; }
.gt-gap, .gt-leg .gt-gap { background: repeating-linear-gradient(135deg, #B8BEC8 0 3px, #DDE1E6 3px 6px); }
.gt-track { position: relative; }
.gt-now { position: absolute; top: -4px; bottom: -4px; width: 1px; margin-left: -.5px; background: #1F2329; border-radius: 1px; }
.gt-ticks { position: relative; height: 18px; margin-top: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gt-ticks span { position: absolute; transform: translateX(-50%); }
.gt-ticks span:first-child { transform: none; }
.gt-ticks span:last-child { transform: translateX(-100%); }
@media (max-width: 860px) { .gt-card { padding: 12px 14px 8px; } .gt-leg i { margin-left: 6px; } }

/* График: шире внутри белого бокса (сам бокс не меняется) */
.chart-wrap { margin: 0 -10px; }
@media (max-width: 860px) { .chart-wrap { height: 300px; margin: 0 -14px; } }
.scheme .sch-val.sch-val-batt, .scheme.compact .sch-val.sch-val-batt { font-size: 15px; text-anchor: middle; font-variant-numeric: tabular-nums; }
.scheme .sch-val.sch-val-cell, .scheme.compact .sch-val.sch-val-cell { font-size: 15px; font-variant-numeric: tabular-nums; }
.scheme .sch-val-cell .cell-sep { fill: var(--muted); font-weight: 400; }
