/* Pogoda u Szafy — styl spójny z MocnyVlog (zielony szklany motyw) */
* , *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 50% 0%, #00422b 0%, #131313 100%);
  background-attachment: fixed; min-height: 100vh;
  font-family: "Montserrat", system-ui, sans-serif;
  color: #e8e8f0;
}
a { color: #4edea3; text-decoration: none; }

.glass-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(8,18,12,0.82);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(78,222,163,0.12);
  padding: .6rem 1.1rem;
}
.hdr-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; }
.hdr-logo { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 2px solid rgba(78,222,163,.35); }
.hdr-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hdr-titles h1 { color: #fff; font-size: 1.05rem; font-weight: 700; margin: 0; line-height: 1.2; }
.hdr-titles p { color: #4edea3; font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.hdr-back { margin-left: auto; font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.hdr-back:hover { text-decoration: underline; }

main { max-width: 1200px; margin: 0 auto; padding: 72px 1rem 90px; }
.updated { text-align: center; color: rgba(255,255,255,.4); font-size: .8rem; font-style: italic; margin: .8rem 0 1.2rem; }

/* Kafelki */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; margin-bottom: 1.6rem; }
.tile {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(78,222,163,0.12); border-radius: 16px;
  padding: .9rem 1rem;
}
.tile__label { color: rgba(255,255,255,.42); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .35rem; }
.tile__val { color: #fff; font-size: 1.7rem; font-weight: 700; line-height: 1; }
.tile__val .unit { font-size: .9rem; font-weight: 500; color: rgba(255,255,255,.5); margin-left: .15rem; }
.tile__sub { color: rgba(255,255,255,.5); font-size: .78rem; margin-top: .35rem; }
.tile__sub strong { color: rgba(255,255,255,.8); }

.tile--hero { grid-column: span 2; border-color: rgba(78,222,163,0.28); background: rgba(78,222,163,0.06); }
.hero-temp { color: #fff; font-size: 3.2rem; font-weight: 700; line-height: 1; }
.hero-temp .unit { font-size: 1.3rem; color: rgba(255,255,255,.55); }
.hero-feels { color: rgba(255,255,255,.6); font-size: .9rem; margin-top: .3rem; }
.hero-feels strong { color: #4edea3; }
.hero-minmax { display: flex; gap: 1.2rem; margin-top: .6rem; font-size: .85rem; }
.hero-minmax .lo { color: #7ec8ff; }
.hero-minmax .hi { color: #ff9f6b; }
.hero-minmax small { color: rgba(255,255,255,.35); margin-left: .25rem; }

/* Wiatr: dwie równorzędne duże wartości (średnia + poryw 10 min) */
.hero-dual { display: flex; gap: 1.6rem; flex-wrap: wrap; align-items: flex-start; }
.hero-dual .hero-temp { font-size: 2.6rem; }
.hero-temp--gust { color: #ff9f43; }
.hero-sub { color: rgba(255,255,255,.5); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-top: .15rem; }

.compass .arrow { display: inline-block; color: #4edea3; font-size: 1.05rem; transition: transform .3s; }

/* Linia min/max w kafelkach */
.tile-minmax { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin-top: .4rem; font-size: .74rem; }
.tile-minmax .lo { color: #7ec8ff; }
.tile-minmax .hi { color: #ff9f6b; }
.tile-minmax strong { font-weight: 700; }
.tile-minmax small { color: rgba(255,255,255,.32); margin-left: .15rem; }

/* Pasek zakresu */
.range-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1.2rem; }
.range-bar__label { color: rgba(255,255,255,.45); font-size: .8rem; font-weight: 600; margin-right: .3rem; }
.range-bar button {
  background: rgba(255,255,255,0.04); color: rgba(255,255,255,.7);
  border: 1px solid rgba(78,222,163,0.18); border-radius: 50px;
  padding: .35rem .9rem; font-size: .82rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.range-bar button:hover { border-color: rgba(78,222,163,0.45); color: #fff; }
.range-bar button.active { background: #4edea3; color: #07351f; border-color: #4edea3; }

/* Wykresy */
.charts { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.chart-card {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(78,222,163,0.1); border-radius: 16px;
  padding: .85rem 1rem 1rem;
}
.chart-card h2 { color: #fff; font-size: .95rem; font-weight: 700; margin: 0 0 .6rem; }
.chart-card h2 small { color: rgba(255,255,255,.4); font-weight: 500; }
.chart { width: 100%; }

footer { text-align: center; padding: 1.5rem 1rem 2rem; color: rgba(255,255,255,.28); font-size: .73rem; border-top: 1px solid rgba(78,222,163,0.07); }
footer a { color: rgba(255,255,255,.45); }

:root { color-scheme: dark; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a1710; }
::-webkit-scrollbar-thumb { background: #1e5c36; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2d7a4a; }
* { scrollbar-color: #1e5c36 #0a1710; scrollbar-width: thin; }

/* uPlot — dopasowanie do ciemnego motywu */
.uplot, .uplot *, .u-legend { font-family: "Montserrat", sans-serif !important; }
.u-legend { color: rgba(255,255,255,.7); font-size: .78rem; }
.u-axis { color: rgba(255,255,255,.45); }

@media (max-width: 560px) {
  .tile--hero { grid-column: span 1; }
  .charts { grid-template-columns: 1fr; }
}

/* ── Energia: stany i wskaźniki ─────────────────────────────────────────────── */
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:.4rem; vertical-align:middle; }
.dot--on  { background:#4edea3; box-shadow:0 0 6px #4edea3aa; }
.dot--off { background:#ff6b6b; box-shadow:0 0 6px #ff6b6baa; }

.hero-feels.st-dis  { color:#ff9f43; }   /* rozładowanie */
.hero-feels.st-dis strong  { color:#ff9f43; }
.hero-feels.st-chg  { color:#4edea3; }   /* ładowanie */
.hero-feels.st-chg strong  { color:#4edea3; }
.hero-feels.st-idle { color:rgba(255,255,255,.45); }

.hero-temp.soc-low  span:first-child { color:#ff6b6b; }
.hero-temp.soc-high span:first-child { color:#4edea3; }

#unit-tiles .tile--hero .hero-temp { font-size:2.8rem; }

/* ── Pobór z sieci: duży kafelek na całą szerokość ──────────────────────────── */
.tile--grid {
  grid-column: 1 / -1;
  border-color: rgba(255,159,67,0.32);
  background: rgba(255,159,67,0.06);
  text-align: center;
}
.tile--grid .tile__label { font-size: .8rem; }
.grid-big { color:#ffb86b; font-size: 4rem; font-weight: 700; line-height: 1.05; }
.grid-big .unit { font-size: 1.5rem; color: rgba(255,255,255,.5); margin-left: .25rem; }
.grid-phases { display:flex; justify-content:center; flex-wrap:wrap; gap: .6rem 2rem; margin-top: .5rem; }
.grid-phases .ph { color: rgba(255,255,255,.7); font-size: 1rem; }
.grid-phases .ph__l { color: rgba(255,255,255,.4); font-weight:700; font-size:.75rem; letter-spacing:.06em; }
.grid-phases strong { color:#fff; font-weight:700; }

@media (max-width: 560px) {
  .grid-big { font-size: 3rem; }
}

/* ── Kafelki banków: wypełniają całą szerokość niezależnie od liczby jednostek ── */
#unit-tiles { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
#unit-tiles .tile--hero { grid-column: auto; }   /* nie rozpychaj na 2 kolumny — równy podział */

/* ── Belka naładowania w kafelku banku ──────────────────────────────────────── */
.soc-bar { height: 11px; border-radius: 6px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1); overflow: hidden; margin: .55rem 0 .15rem; }
.soc-bar__fill { height: 100%; border-radius: 6px; min-width: 2px; transition: width .4s ease, background .4s ease; }

/* ── Sekcja kafelków zbiorczych: rozciągnij na całą szerokość ────────────────── */
.tiles--fill { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
