/* Wygląd jak w Solaris (C:\Programy\Fotowoltaika). Poprzednia wersja: kopie\wyglad-2026-12-02 */
:root {
  --ink: #172e29; --tlo: #f5f7f2; --karta: #ffffff; --tekst: #172e29; --slaby: #60716b; --linia: #dce4dd;
  --green: #00694e; --lime: #c0e76a; --ciemny: #172e29; --lead: #275641; --akcent: #23543f;
  --pv: #83ad54; --pobor: #c0573f; --oddanie: #275641; --zuzycie: #436e9a; --gaz: #ca9539;
  --pilne: #b3261e; --uwaga: #ca9539; --info: #669478;
  color-scheme: light;
  color: var(--ink); font: 15px/1.5 "Inter", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--tlo); color: var(--tekst); font: 15px/1.5 "Inter", "Segoe UI", sans-serif; }
h1, h2, h3, p { margin: 0; }
a { color: var(--green); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- pasek boczny */
aside.boczny { position: fixed; inset: 0 auto 0 0; width: 218px; background: #172e29; color: #e0e9df;
  padding: 5px 17px 28px; display: flex; flex-direction: column; overflow-y: auto; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 30px; font-weight: 720; letter-spacing: -1.6px; padding: 0 10px; }
.brand:hover { text-decoration: none; }
.brand-sun { font: 42px/1 Arial, sans-serif; color: #c3e971; }
.brand-logo { padding: 0; justify-content: center; }
.brand-logo img { display: block; width: 100%; max-width: 184px; height: auto; }
.logowanie-logo { background: #172e29; border-radius: 12px; padding: 16px; }
.logowanie-logo img { max-width: 200px; }
.location { margin: 5px 4px 26px; padding: 10px 12px; border: 1px solid #416056; border-radius: 10px; color: #d4e4d7; font-size: 13px; }
.locdot, .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #c0e76a; margin-right: 8px; }
aside nav { display: grid; gap: 5px; }
aside nav button { display: flex; align-items: center; gap: 13px; padding: 12px 13px; color: #cedbd5; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.5;
  border-radius: 8px; background: none; border: 0; cursor: pointer; text-align: left; min-height: 0; width: 100%; }
aside nav button:hover, aside nav button.aktywna { background: #334f42; color: #d8f698; }
aside nav svg, .headingrow > svg { width: 20px; height: 20px; flex-shrink: 0; }
.aside-foot { margin-top: auto; border-top: 1px solid #3b5549; padding: 18px 10px 0; font-size: 13px; }
.aside-foot small { color: #aac0b2; margin-left: 16px; }
.aside-foot button { margin-top: 12px; background: none; border: 1px solid #416056; color: #d4e4d7; min-height: 34px; padding: 6px 12px; }
.aside-foot button:hover { background: #334f42; }

/* ---- treść */
main { margin-left: 218px; padding: 0 clamp(20px, 3vw, 54px) 60px; max-width: 1980px; }
.topline { padding: 18px 0; border-bottom: 1px solid var(--linia); display: flex; justify-content: space-between; color: var(--slaby); font-size: 12px; }
.topline i { margin: 0 8px; color: #93a299; font-style: normal; }
.topline b { color: var(--ink); }
.naglowek-strony { padding: 25px 0 22px; }
.naglowek-strony h1 { font-size: clamp(29px, 3vw, 43px); letter-spacing: -1.9px; line-height: 1.15; font-weight: 650; }
.naglowek-strony p { margin-top: 7px; color: var(--slaby); font-size: 14px; }

h2 { font-size: 20px; line-height: 1.25; letter-spacing: -.7px; margin: 0 0 14px; font-weight: 650; }
h3 { font-size: 16px; letter-spacing: -.3px; margin: 18px 0 8px; font-weight: 650; }
.pasek { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
label { font-weight: 550; font-size: 13px; }
.pasek label, .karta label { display: inline-flex; align-items: center; gap: 6px; }
input, select { border: 1px solid #bdcbc0; color: var(--ink); background: #fff; font: inherit; border-radius: 7px; padding: 8px 10px; max-width: 100%; min-width: 0; }
input[type=radio], input[type=checkbox] { accent-color: var(--akcent); }
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 16px;
  border: 1px solid #245640; border-radius: 8px; color: #fff; background: #23543f; font: 600 14px/1.35 inherit; cursor: pointer; }
.btn:hover { background: #173f2d; }
.btn.przel { background: #fff; color: #23543f; border-color: #bdcbc0; }
.btn.przel:hover { border-color: #23543f; background: #ecf3eb; }
.btn.przel.wybrany, .btn.wybrany { background: #23543f; color: #fff; border-color: #23543f; }
button:disabled { opacity: .55; }
:is(a, button, input, select):focus-visible { outline: 3px solid #ca9539; outline-offset: 2px; }

/* ---- kafle */
.kafle { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 18px; }
@media (min-width: 701px) { .kafle.kafle6 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }   /* Fotowoltaika: 6 kafli w jednym rzędzie */
.kafel { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--linia); border-radius: 15px; padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 132px; min-width: 0; }
.kafel .et { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); z-index: 1; }
.kafel .et i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.kafel .wart { font-weight: 650; line-height: 1.2; font-size: clamp(24px, 2.4vw, 36px); letter-spacing: -1.4px; font-variant-numeric: tabular-nums; z-index: 1; }
.kafel .wart small { font-size: 16px; letter-spacing: 0; font-weight: 500; margin-left: 5px; }
.kafel .pod { font-size: 12px; color: #62766b; font-weight: 450; z-index: 1; }
/* pierwszy kafel w rzędzie (poza kartami) jak „lead” w Solaris: ciemnozielony z kręgami słońca */
.zakladka .kafle:not(.karta .kafle) > .kafel:first-child { background: #275641; color: #fff; border-color: #275641; }
.zakladka .kafle:not(.karta .kafle) > .kafel:first-child .et { color: #fff; }
.zakladka .kafle:not(.karta .kafle) > .kafel:first-child .et i { background: #d8f59b !important; }
.zakladka .kafle:not(.karta .kafle) > .kafel:first-child .pod { color: #d0dfce; }
.zakladka .kafle:not(.karta .kafle) > .kafel:first-child::after { content: ""; position: absolute; right: -49px; top: 8px;
  border: 1px solid #6a996d; border-radius: 50%; width: 115px; height: 115px; opacity: .65; pointer-events: none;
  box-shadow: 0 0 0 11px #275641, 0 0 0 12px #538460, 0 0 0 24px #275641, 0 0 0 25px #51805e, 0 0 0 38px #275641, 0 0 0 39px #3a704f; }
.karta .kafle { margin: 12px 0; gap: 12px; }
.karta .kafel { min-height: 104px; padding: 14px 16px; border-radius: 12px; background: #fbfcf9; }
.karta .kafel .wart { font-size: clamp(22px, 2vw, 30px); }

/* ---- karty, wykresy, tabele */
.karta { background: #fff; border: 1px solid var(--linia); border-radius: 15px; padding: clamp(17px, 2vw, 29px); margin-bottom: 18px; min-width: 0; overflow-x: auto; }
.wykres { position: relative; height: 300px; margin-top: 8px; }
.wykres.wysoki { height: 380px; }
.siatka2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 8px; border-bottom: 1px solid #e6ece5; text-align: left; }
th { font-weight: 600; color: #5a6c61; background: #f4f7f1; font-size: 12px; }
td.l, th.l { text-align: right; }
tr.wybrany td { background: #ecf3eb; font-weight: 600; }
.ostrz { border: 1px solid var(--linia); border-left: 4px solid var(--info); padding: 12px 16px; background: #fff; border-radius: 10px; margin-bottom: 10px; font-size: 14px; }
.ostrz.pilne { border-left-color: var(--pilne); } .ostrz.ostrzezenie, .ostrz.uwaga { border-left-color: var(--uwaga); }
.ostrz b { display: block; font-size: 12px; color: var(--slaby); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 2px; }
.status { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--linia); white-space: nowrap; font-weight: 600; }
.status.dziala { color: #23543f; border-color: #83ad54; background: #ecf3eb; }
.status.czeka { color: #8a5f12; border-color: #ca9539; background: #fbf3e4; }
.slaby { color: var(--slaby); font-size: 14px; }
p.slaby { margin-top: 10px; }
.demo { background: #fbf3e4; border: 1px solid #ca9539; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.pusto { text-align: center; padding: 40px 10px; color: var(--slaby); }
code { background: #f4f7f1; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.logowanie { max-width: 340px; margin: 15vh auto; display: grid; gap: 12px; background: #fff; border: 1px solid var(--linia); border-radius: 15px; padding: 28px; }
.blad { color: var(--pilne); }
.ladowanie { padding: 40px; text-align: center; color: var(--slaby); }
.karta details { margin-top: 12px; }
.karta details summary { cursor: pointer; color: var(--slaby); font-size: 14px; padding: 4px 0; }
ul { padding-left: 20px; }

/* ---- przełącznik okresu ‹ etykieta › */
.okres { display: inline-flex; align-items: center; gap: 6px; }
.okres-strz { background: #fff; border: 1px solid #bdcbc0; padding: 5px; cursor: pointer; color: #23543f; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; min-height: 0; }
.okres-strz:hover:not(:disabled) { background: #23543f; border-color: #23543f; color: #fff; }
.okres-strz:disabled { opacity: .35; cursor: default; }
.okres-strz svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.okres-et { position: relative; font-weight: 650; color: var(--ink); text-align: center; cursor: pointer; padding: 4px 8px; white-space: nowrap; font-size: 15px; }
.okres-et input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.naglowek { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.naglowek h2, .naglowek h3 { margin: 0; }
.karta > .naglowek:not(:first-child) { margin-top: 18px; }

@media (min-width: 1500px) { main { max-width: 1540px; } }
@media (max-width: 1050px) { aside.boczny { width: 175px; padding: 5px 10px 22px; } main { margin-left: 175px; padding: 0 18px 40px; } .kafel { padding: 16px; } }
@media (max-width: 780px) {
  aside.boczny { position: static; width: auto; padding: 3px 15px 12px; display: block; }
  .brand { font-size: 23px; padding: 0; } .brand-sun { font-size: 29px; }
  .brand-logo img { max-width: 128px; }
  .location, .aside-foot { display: none; }
  /* wąski ekran: bez suwaka, 8 zakładek w 2 rzędach po 4 (ikona nad nazwą) */
  aside nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 10px; gap: 4px; }
  aside nav button { flex-direction: column; justify-content: center; text-align: center; padding: 7px 2px; font-size: 11.5px; font-weight: 400; font-family: Arial, "Segoe UI", sans-serif; letter-spacing: -0.1px;
    line-height: 1.2; gap: 4px; width: auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  aside nav svg { width: 18px; height: 18px; }
  main { margin: 0; padding: 0 14px 35px; }
  .kafle { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kafel { min-height: 110px; padding: 12px; } .kafel .wart { font-size: 23px; }
  .wykres { height: 240px; } .wykres.wysoki { height: 300px; }
  .naglowek-strony { padding: 16px 0; }
  .topline { padding: 11px 0; }
}

/* ---- bloki jak w Pulpicie Solaris */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.tile { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--linia); border-radius: 15px; padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: space-between; min-height: 144px; color: var(--ink); text-decoration: none !important; font-weight: 400; min-width: 0; }
a.tile:hover { border-color: #bdcbc0; }
.tile.lead { background: #275641; color: #fff; border-color: #275641; }
.sunart { position: absolute; right: -49px; top: 8px; border: 1px solid #6a996d; border-radius: 50%; width: 115px; height: 115px; opacity: .65;
  box-shadow: 0 0 0 11px #275641, 0 0 0 12px #538460, 0 0 0 24px #275641, 0 0 0 25px #51805e, 0 0 0 38px #275641, 0 0 0 39px #3a704f; }
.tile > *:not(i) { z-index: 1; }
.tilelabel { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.tilelabel svg { width: 20px; height: 20px; flex-shrink: 0; }
.lead svg { color: #d8f59b; }
.tile strong, .big { display: block; font-weight: 650; line-height: 1.2; font-size: clamp(26px, 3vw, 42px); letter-spacing: -1.6px; }
.tile strong small, .big small { font-size: 16px; letter-spacing: 0; font-weight: 500; }
.tile .balance-title { font-size: clamp(24px, 2.6vw, 36px); }
.tilefoot { font-size: 12px; color: #62766b; font-weight: 450; }
.lead .tilefoot { color: #d0dfce; }
.dashgrid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(245px, 1fr); gap: 16px; margin-bottom: 18px; align-items: start; }
.dashgrid > .karta { margin-bottom: 0; }
.dashgrid > .karta:only-child { grid-column: 1 / -1; }
.headingrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.headingrow h2 { margin: 0; }
.headingrow > svg { color: var(--ink); }
.okres-grupa { display: flex; align-items: center; gap: 8px; }
.okres-grupa .btn { min-height: 38px; padding: 6px 12px; }
.muted, .chartunit { color: var(--slaby); font-size: 14px; }
.headingrow + .muted { margin-top: 6px; }
.big { margin: 18px 0 10px; }
.progress { height: 7px; border-radius: 6px; background: #e8eee5; overflow: hidden; margin-bottom: 8px; }
.progress i { display: block; background: #669478; height: 100%; }
.device, .met { display: flex; align-items: center; gap: 9px; font-size: 13px; border-top: 1px solid var(--linia); padding: 11px 0; }
.device > strong, .met b { margin-left: auto; white-space: nowrap; }
.device small { display: block; color: var(--slaby); font-size: 12px; }
.device strong small { display: inline; font-weight: 500; }
.device-icon { display: inline-flex; padding: 7px; border-radius: 8px; background: #ecf3eb; }
.device-icon svg { width: 20px; height: 20px; }
.met span { display: inline-flex; align-items: center; gap: 8px; }
.kropka { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.met + .muted { margin-top: 10px; }
@media (max-width: 1050px) { .dashgrid { grid-template-columns: minmax(0, 1.45fr) minmax(225px, 1fr); } .tile { padding: 16px; } }
@media (max-width: 780px) { .dashgrid { grid-template-columns: 1fr; } .tiles { gap: 8px; } .tile { min-height: 125px; padding: 12px; } .tile strong { font-size: 25px; } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr 1fr; } .tile.lead { grid-column: 1 / -1; min-height: 112px; } }
.tytul-link { color: inherit; font-weight: inherit; }
.headingrow > a { color: var(--ink); display: inline-flex; }
.headingrow > a svg { width: 20px; height: 20px; }
.link-dalej { display: inline-block; margin-top: 12px; font-size: 13px; }
td.modul { min-width: 130px; vertical-align: top; }
td.modul b { display: block; font-weight: 600; margin-bottom: 5px; }
td.modul .slaby { display: block; margin-bottom: 5px; }
td.slaby { overflow-wrap: anywhere; }

/* Tuya: oś czasu czujników ruchu i mapa cieplna */
.os-czasu { margin: 6px 0 10px; }
.os-wiersz { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.os-nazwa { flex: 0 0 150px; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-tor { position: relative; flex: 1; height: 26px; background: #eef3ee; border-radius: 6px; }
.os-licz { flex: 0 0 34px; text-align: right; font-size: 13px; color: var(--slaby); font-variant-numeric: tabular-nums; }
.os-skala .os-tor { background: none; height: 16px; }
.os-skala .os-tor span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--slaby); }
.os-skala .os-tor span:first-child { transform: none; }
.os-skala .os-tor span:last-child { transform: translateX(-100%); }
.os-linia { position: absolute; top: 0; bottom: 0; width: 1px; background: #dce4dd; }
.os-blok { position: absolute; top: 4px; bottom: 4px; min-width: 2px; background: var(--zuzycie); border-radius: 2px; }
.os-blok.obecnosc { background: var(--pv); top: 7px; bottom: 7px; }
.os-teraz { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--pobor); }
.mapa-ciepla { overflow-x: auto; }
.mapa-ciepla table { border-collapse: separate; border-spacing: 2px; width: 100%; table-layout: fixed; }
.mapa-ciepla th { font-size: 11px; font-weight: 500; color: var(--slaby); padding: 2px 0; text-align: center; background: none; border: 0; }
.mapa-ciepla th.mapa-et { width: 62px; text-align: left; white-space: nowrap; }
.mapa-ciepla td { height: 24px; padding: 0; background: #eef3ee; border-radius: 3px; border: 0; }
@media (max-width: 700px) {
  .os-wiersz { flex-wrap: wrap; gap: 2px 8px; margin-bottom: 8px; }
  .os-nazwa { flex-basis: 100%; font-size: 12px; }
  .os-skala .os-nazwa { display: none; }
  .os-licz { flex-basis: 22px; }
  .mapa-ciepla th.ukryj { color: transparent; }
  .mapa-ciepla td { height: 20px; }
}
.rodzaj-wybor { display: block; margin: 3px 0 5px; padding: 2px 24px 2px 6px; min-width: 118px; font-size: 13px; color: var(--slaby); border-color: var(--linia); border-radius: 6px; }
.sekcja { font-size: 22px; letter-spacing: -0.5px; margin: 0 0 14px; }
@media (max-width: 700px) { .pom-dod { display: none; } }

/* Historia trafności prognoz: liczby w jednej linii */
@media (min-width: 701px) { table.traf td.l { white-space: nowrap; } }
table.traf td.l .slaby { font-size: 12px; }

/* ---- Monitoring: kamery Reolink */
.kamery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 12px; }
.kamera { margin: 0; background: #0f1a14; border-radius: 12px; overflow: hidden; cursor: zoom-in; position: relative; aspect-ratio: 16 / 9; }
.kamera img, .kamera-duza img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kamera-pusto { color: #c8d4cb; display: flex; align-items: center; justify-content: center; height: 100%; padding: 12px; text-align: center; font-size: 14px; }
.kamera figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; color: #fff; font-size: 13px; font-weight: 600;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); display: flex; align-items: center; gap: 6px; }
.kamera figcaption small, .kamera-duza figcaption small { margin-left: auto; font-weight: 400; opacity: .85; }
.kamera .dot { width: 8px; height: 8px; border-radius: 50%; background: #8fd16a; } .kamera .dot.wyl { background: #e06a52; }
.kamera-duza { position: fixed; inset: 0; z-index: 50; background: rgba(10,18,14,.88); display: flex; align-items: center; justify-content: center; padding: 16px; }
.kamera-duza figure { margin: 0; width: min(100%, 1600px); }
.kamera-duza figure > img, .kamera-duza .kamera-pusto { aspect-ratio: 16 / 9; background: #0f1a14; border-radius: 10px; }
.kamera-duza figcaption { color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 2px; font-weight: 600; }
@media (max-width: 700px) { .kamery { grid-template-columns: 1fr; gap: 10px; } }
.kamera video, .kamera-duza video { width: 100%; height: 100%; border: 0; display: block; background: #0f1a14; object-fit: contain; }
.kamera-duza figure > video { aspect-ratio: 16 / 9; height: auto; border-radius: 10px; }
.kamera figcaption.klik { cursor: zoom-in; }

/* Furtka (Thinmoo) */
.furtka-kod img { height: 40px; min-width: 100px; border: 1px solid var(--linia); border-radius: 6px; cursor: pointer; background: #fff; }
.furtka-kod input { width: 110px; font-size: 18px; letter-spacing: 3px; text-align: center; }
tr.klik { cursor: pointer; } tr.klik:hover td { background: rgba(39,86,65,.05); } tr.wybrany td { background: rgba(39,86,65,.10); }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 10px 0; }
.galeria figure { margin: 0; cursor: zoom-in; }
.galeria figure img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: #0f1a14; display: block; }
.galeria figcaption { font-size: 12px; color: var(--slaby); margin-top: 3px; }
.galeria.male { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.galeria.male img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .6; }
.galeria.male img.wybrany { opacity: 1; outline: 2px solid var(--lime); }
.furtka-duze figure { width: min(100%, 720px); }
.furtka-duze figure > img { max-height: 68vh; width: auto; height: auto; max-width: 100%; margin: 0 auto; aspect-ratio: auto; object-fit: contain; }
@media (max-width: 700px) { .galeria { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); } }
.miniatura { width: 42px; height: 56px; object-fit: cover; border-radius: 5px; cursor: zoom-in; background: #0f1a14; display: block; }
.pelny-ekran { position: fixed; inset: 0; z-index: 100; background: #000; }
.pelny-ekran iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Automatyzacje (Tuya) */
.automaty { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 16px; margin-bottom: 12px; }
.automaty .karta { margin: 0; display: flex; flex-direction: column; gap: 12px; overflow: visible; }
.automat header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.automat h3 { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; margin: 0; padding-top: 1px; }
.automat.wyl { background: #f9faf7; } .automat.wyl h3, .automat.wyl .regula { opacity: .6; }
.regula { display: grid; gap: 10px; font-size: 14px; }
.regula small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--slaby); }
.regula small.slaby { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; margin-top: 2px; }
.regula ul, .regula ol { margin: 3px 0 0; padding-left: 18px; }
.regula li { margin: 2px 0; } .regula li b { font-weight: 650; }
.automat footer { font-size: 12.5px; margin-top: auto; border-top: 1px solid var(--linia); padding-top: 9px; }
label.przelacznik { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--slaby); white-space: nowrap; position: relative; flex: none; }
label.przelacznik input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.przelacznik .suwak { width: 38px; height: 22px; border-radius: 99px; background: #c9d3cc; position: relative; transition: background .15s; flex: none; }
label.przelacznik .suwak::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
label.przelacznik input:checked + .suwak { background: var(--akcent); }
label.przelacznik input:checked + .suwak::after { left: 19px; }
label.przelacznik input:focus-visible + .suwak { outline: 2px solid var(--lime); outline-offset: 2px; }
label.przelacznik input:disabled + .suwak { opacity: .55; } label.przelacznik:has(input:disabled) { cursor: progress; }
.automat footer { display: flex; justify-content: space-between; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.akcje-karty { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.akcje-karty.potwierdz { color: var(--pilne); font-weight: 600; gap: 8px; }
.link-btn { background: none; border: 0; padding: 2px 0; color: var(--green); font: 600 13px/1.4 inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.btn.maly { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.automat-form { display: grid; gap: 10px; overflow: visible; }
.automat-form h3 { margin: 10px 0 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--slaby); }
.automat-form .pole-nazwa { display: grid; gap: 4px; font-size: 13px; color: var(--slaby); max-width: 480px; }
.automat-form .pasek { margin-bottom: 0; }
.wiersz-reg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--linia); border-radius: 10px; background: #fafbf8; }
.wiersz-reg .sz { min-width: 190px; }
.wiersz-reg .nr { font-weight: 700; color: var(--slaby); min-width: 18px; }
.wiersz-reg > .btn.maly:last-child { margin-left: auto; }
.liczba-pole { display: inline-flex; align-items: center; gap: 6px; }
.liczba-pole input { width: 92px; }
.dni-tyg { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.dni-tyg label { gap: 3px; }
.automat-form .przyciski { margin-top: 6px; }
@media (max-width: 700px) { .wiersz-reg select, .wiersz-reg .sz { flex: 1 1 100%; } .wiersz-reg > .btn.maly:last-child { margin-left: 0; } }

/* Nagrania z rejestratora */
.nagrania { overflow: visible; }
.os-nagran { position: relative; height: 34px; background: #eef2ec; border: 1px solid var(--linia); border-radius: 8px; cursor: pointer; margin: 18px 0 24px; }
.os-nagran .odc { position: absolute; top: 4px; bottom: 4px; background: #669478; border-radius: 3px; }
.os-nagran .zd { position: absolute; top: 4px; bottom: 4px; min-width: 2px; border-radius: 2px; text-decoration: none; }
.os-nagran .zd.odtwarzane { top: -3px; bottom: -3px; min-width: 5px; box-shadow: 0 0 0 2px var(--karta), 0 0 0 4px var(--zd); z-index: 1; }
.zd-osoba { --zd: #d6453d; } .zd-pojazd { --zd: #2f74c9; } .zd-zwierze { --zd: #8a55c4; } .zd-ruch { --zd: #e09a1f; }
.os-nagran .zd { background: var(--zd); }
.zdarzenia { margin: 0 0 12px; }
.zdarzenia .filtr { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 3px 8px; border-radius: 6px; cursor: pointer; background: var(--karta);
  border: 1px solid var(--linia); border-left: 4px solid var(--zd); border-right: 4px solid var(--zd); border-top: 2px solid var(--zd); border-bottom: 2px solid var(--zd); }
/* karty zdarzeń z miniaturą (jak w aplikacji Reolink), w poziomym pasku */
.karty-zd { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 8px; margin: 4px 0 6px; }
.karta-zd { flex: 0 0 152px; font: inherit; text-align: left; padding: 0; border-radius: 8px; cursor: pointer; background: var(--karta); color: inherit; overflow: hidden;
  border: 1px solid var(--linia); border-left: 4px solid var(--zd); border-right: 4px solid var(--zd); border-top: 2px solid var(--zd); border-bottom: 2px solid var(--zd); }
.karta-zd .mini { position: relative; display: block; aspect-ratio: 16 / 9; background: #23302c; overflow: hidden; }
/* miniatura = 3 klatki obok siebie, pokazywane na zmianę co 1 s */
img.klatki { display: block; width: 300%; height: 100%; max-width: none; animation: klatki3 3s step-end infinite; }   /* klatka co 1 s */
@keyframes klatki3 { 0% { transform: translateX(0); } 33.333% { transform: translateX(-33.333%); } 66.667% { transform: translateX(-66.667%); } }
@media (prefers-reduced-motion: reduce) { img.klatki { animation: none; } }
.karta-zd .mini .brak { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.5); font-size: 11px; }
.karta-zd .ikony-zd { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; }
.karta-zd .ikony-zd img { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.karta-zd .dl { position: absolute; left: 6px; bottom: 4px; color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.karta-zd .opis { display: block; padding: 4px 7px 5px; font-size: 13px; }
.karta-zd .opis small { display: block; color: var(--slaby); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.karta-zd.odtwarzane { background: var(--zd); color: #fff; box-shadow: 0 0 0 2px var(--zd); }
.karta-zd.odtwarzane .opis small { color: rgba(255,255,255,.85); }
.karta-zd.odtwarzane .opis b::before { content: '▶ '; }
.os-nagran .podglad-zd { position: absolute; top: calc(100% + 24px); transform: translateX(-50%); width: 184px; padding: 4px 4px 5px; border-radius: 8px; background: var(--karta);
  border: 1px solid var(--linia); border-top: 3px solid var(--zd); box-shadow: 0 6px 18px rgba(0,0,0,.2); pointer-events: none; z-index: 5; font-size: 12px; text-align: center; line-height: 1.35; }
.os-nagran .podglad-zd .ramka { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 5px; margin-bottom: 3px; }
.os-nagran .podglad-zd small { color: var(--slaby); }
.lista-zd { position: relative; display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; margin-top: 6px; }
.lista-zd .zd-el { font: inherit; font-size: 13px; padding: 3px 8px; border-radius: 6px; cursor: pointer; background: var(--karta);
  border: 1px solid var(--linia); border-left: 4px solid var(--zd); border-right: 4px solid var(--zd); border-top: 2px solid var(--zd); border-bottom: 2px solid var(--zd); color: inherit; }
.lista-zd .zd-el span { color: var(--slaby); }
.lista-zd .zd-el.odtwarzane { background: var(--zd); border-color: var(--zd); color: #fff; font-weight: 600; }
.lista-zd .zd-el.odtwarzane span { color: rgba(255,255,255,.85); }
.lista-zd .zd-el.odtwarzane::before { content: '▶ '; }
.os-nagran .wsk { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--pilne); border-radius: 2px; }
/* znacznik: z jakiej pory są miniatury widoczne w pasku kart (czerwona szpilka z kropką) */
.os-nagran .poz-kart { position: absolute; top: -6px; bottom: -2px; width: 3px; margin-left: -1.5px; background: #e5383b; border-radius: 2px; z-index: 2; transition: left .15s ease; }
.os-nagran .poz-kart::before { content: ''; position: absolute; left: 50%; top: -9px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #e5383b; box-shadow: 0 0 0 2px var(--karta); }
@media (prefers-reduced-motion: reduce) { .os-nagran .poz-kart { transition: none; } }
.os-nagran .et { position: absolute; top: 100%; margin-top: 3px; transform: translateX(-50%); font-size: 11px; color: var(--slaby); }
.odtwarzacz { position: relative; background: #0f1a14; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.odtwarzacz video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0f1a14; }
.odtwarzacz .nakladka { position: absolute; inset: auto 0 0 0; padding: 10px 14px; color: #fff; font-size: 14px; background: linear-gradient(transparent, rgba(0,0,0,.7)); }

/* sterowanie kamerą w powiększeniu (styl wg go2rtc/przyciski/sterowanie-kamera.html) */
.sterowanie { --akc: #88e4a6; --akc-ciemny: #234634; --linia: #2b4034; --klawisz: #16241c; --wl: #77ecb1;
  padding: 10px 0 2px; color: #f3f5f8; font-family: "Segoe UI", system-ui, sans-serif; }
.sterowanie .panel-ster { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 21px;
  width: fit-content; max-width: 100%; margin: 0 auto; padding: 15px 19px; background: transparent; border: 1px solid var(--linia); border-radius: 21px; }
.sterowanie .narzedzia { width: 390px; max-width: 100%; }
.sterowanie .panel-ster:not(:has(.pad)) { grid-template-columns: minmax(0, 1fr); }
.sterowanie .pad { display: grid; grid-template-columns: repeat(3, 46px); grid-auto-rows: 46px; gap: 8px; }
.sterowanie .narzedzia { min-width: 0; display: grid; gap: 8px; }
.sterowanie .wiersz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.sterowanie .wiersz:empty { display: none; }
.sterowanie button, .sterowanie select { font: inherit; color: inherit; border: 1px solid var(--linia); background: var(--klawisz);
  border-radius: 12px; min-width: 0; min-height: 44px; cursor: pointer; touch-action: none; user-select: none;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .1s ease; }
.sterowanie .pad button { display: grid; place-items: center; color: var(--akc); box-shadow: inset 0 1px #ffffff12; padding: 0; }
.sterowanie .pad .stop { background: var(--akc-ciemny); color: #fff; }
.sterowanie .pad .stop svg { width: 15px; height: 15px; }
.sterowanie svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.sterowanie svg.strzalka { transform: rotate(var(--kat)); }
.sterowanie .ster { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 5px 8px; font-weight: 650; font-size: 14px; white-space: normal; }
.sterowanie .ster svg { color: var(--akc); }
.sterowanie .ster.niebezp { background: #2d151b; color: #ffb1b8; border-color: #5a2c39; }
.sterowanie .ster.niebezp svg { color: currentColor; }
/* lista zapamiętanych pozycji: własna, w kolorach konsoli (systemowa lista Windows była biała) */
.sterowanie .lista-poz { position: relative; min-width: 0; }
.sterowanie .ster.wybor { width: 100%; height: 100%; padding: 5px 25px;
  background-image: linear-gradient(45deg, transparent 50%, var(--akc) 50%), linear-gradient(135deg, var(--akc) 50%, transparent 50%);
  background-position: right 15px center, right 10px center; background-size: 5px 5px; background-repeat: no-repeat; }
.sterowanie .ster.wybor[aria-expanded="true"] { border-color: var(--akc); box-shadow: 0 0 9px #88e4a654; }
.sterowanie .opcje { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 5; margin: 0; padding: 6px; list-style: none;
  background: #0c1510; border: 1px solid var(--akc); border-radius: 12px; box-shadow: 0 8px 24px #000a; max-height: 260px; overflow: auto; }
.sterowanie .opcje button { width: 100%; min-height: 36px; padding: 6px 12px; text-align: left; font-weight: 600; font-size: 14px;
  background: transparent; border-color: transparent; border-radius: 8px; color: #f3f5f8; touch-action: manipulation; }
.sterowanie .opcje button:hover, .sterowanie .opcje button:focus-visible { background: var(--klawisz); border-color: var(--linia); color: var(--akc); box-shadow: none; outline: none; }
.sterowanie .opcje button:active { background: var(--akc); color: #06140c; }
.sterowanie .pad button:hover, .sterowanie .ster:hover { border-color: var(--akc); box-shadow: 0 0 9px #88e4a654; }
.sterowanie .ster.niebezp:hover { border-color: #ffb1b8; box-shadow: 0 0 9px #ffb1b854; }
/* naciśnięcie myszą: wyraźna zmiana koloru */
.sterowanie .pad button:active, .sterowanie .ster:active { scale: .96; background: var(--akc); color: #06140c; border-color: var(--akc); }
.sterowanie .pad button:active svg, .sterowanie .ster:active svg { color: #06140c; }
.sterowanie .ster.niebezp:active { background: #ffb1b8; color: #2d151b; border-color: #ffb1b8; }
.sterowanie .ster.niebezp:active svg { color: #2d151b; }
.sterowanie button[aria-pressed="true"] { border-color: var(--wl); color: var(--wl); background: #133129; }
.sterowanie button:disabled { opacity: .6; cursor: progress; }
.sterowanie button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.sterowanie .slaby { color: rgba(255,255,255,.8); padding-top: 6px; text-align: center; }
@media (max-width: 520px) { .sterowanie .panel-ster { grid-template-columns: 1fr; justify-items: center; gap: 14px; padding: 14px; } .sterowanie .narzedzia { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .sterowanie button, .sterowanie select { transition: none; } .sterowanie .pad button:active, .sterowanie .ster:active { scale: 1; } }
/* powiększenie: obraz zmniejsza się na niskim ekranie, żeby sterowanie było widoczne */
.kamera-duza:has(.sterowanie .panel-ster) figure > video, .kamera-duza:has(.sterowanie .panel-ster) figure > img { max-height: calc(100vh - 330px); width: auto; max-width: 100%; margin: 0 auto; }
.kamera-duza { overflow: auto; }
/* Goście: miniaturki nagrań z kamer w wierszu wizyty (klik = nagranie od tej chwili) */
.nagranie-wiz { white-space: nowrap; }
.mini-wiz { display: inline-flex; flex-direction: column; align-items: stretch; gap: 2px; width: 112px; padding: 3px; margin: 0 4px 0 0; font: inherit;
  border: 1px solid var(--linia); border-radius: 8px; background: var(--karta); color: inherit; cursor: pointer; vertical-align: top; }
.mini-wiz:hover { border-color: var(--oddanie, #275641); box-shadow: 0 0 0 1px var(--oddanie, #275641); }
.mini-wiz:active { transform: scale(.97); }
.mini-wiz .ramka { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 5px; background: #23302c; }
.mini-wiz .brak { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.6); font-size: 10px; }
.mini-wiz small { font-size: 11px; color: var(--slaby); text-align: center; }
.mini-wiz .dl { position: absolute; left: 4px; bottom: 3px; color: #fff; font-size: 11px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.mini-wiz.zapisane { border-color: var(--oddanie, #275641); }
/* odtwarzacz zapisanego fragmentu wizyty */
.film-wiz figure { width: min(100%, 960px); }
.film-wiz figure > video { aspect-ratio: 16 / 9; height: auto; max-height: calc(100vh - 140px); border-radius: 10px; }
.film-wiz figcaption { flex-wrap: wrap; }
.film-wiz figcaption small { margin-left: 0; }
.film-wiz .przyciski { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.film-wiz .btn.przel:disabled { opacity: .45; cursor: default; }
.film-wiz .przyciski .btn { font-family: inherit; font-size: 14px; font-weight: 600; text-decoration: none; }

/* ---- Ogrzewanie: nadwyżka ze słońca */
.pokoje-nad { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; margin-bottom: 6px; }
.pokoj-nad { border: 1px solid var(--linia); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; background: #fbfcfa; }
.pokoj-nad.wyl { background: #f6f7f4; } .pokoj-nad.wyl .temp, .pokoj-nad.wyl header b { opacity: .6; }
.pokoj-nad header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pokoj-nad header b { font-size: 16px; }
.pokoj-nad .temp { display: flex; align-items: center; gap: 14px; }
.pokoj-nad .temp .wart { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; white-space: nowrap; }
.pokoj-nad .temp .wart small { font-size: 15px; font-weight: 500; color: var(--slaby); }
.pokoj-nad .temp .slaby { font-size: 12.5px; line-height: 1.45; }
.pokoj-nad .ust { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font-size: 14px; border-top: 1px solid var(--linia); padding-top: 10px; }
.hist-nad td.l { white-space: nowrap; }
@media (max-width: 700px) { .hist-nad { font-size: 13px; } .hist-nad th { font-size: 12px; } }

/* Pomieszczenia: model cieplny pokoju */
.model-lista { margin: 12px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }
.model-lista li { margin-bottom: 6px; }
tr.wybrany td { font-weight: 600; }

/* Pomieszczenia: dodawanie, zmiana i usuwanie pokoi */
.pom-naglowek { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 4px; }
.pom-naglowek h2 { margin-right: auto; }
.pom-form .pom-termometr { max-width: 560px; width: 100%; }
.pom-form .pom-gn { cursor: pointer; gap: 10px; max-width: 760px; }
.pom-form .pom-gn input { margin: 0; }
.pom-form .pom-gn .slaby { font-size: 13px; }
.pom-form .pom-gn.zajete, .pom-form .pom-gn:has(input:disabled) { opacity: .6; cursor: default; }
.pom-form .przyciski .link-btn { margin-left: 6px; }
.pom-przywroc .link-btn { font-size: 13px; }

/* Dane i moduły: lokalizacja pogody */
.lok-wyniki { display: grid; gap: 6px; margin-top: 10px; max-width: 760px; }
.lok-wyniki .wiersz-reg { justify-content: space-between; }
/* Sieć domowa i odkurzacz (04.12.2026) */
input.siec-nazwa { width: 100%; max-width: 240px; font-weight: 600; }
input.siec-osoba { width: 120px; }
.odk-kafle { display: flex; flex-wrap: wrap; gap: 12px; }
.odk-pole { display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 10px 14px; border: 1px solid var(--linia, #ddd); border-radius: 10px; }
