/* ══════════════════════════════════════════════════════════════════════════
   StatsCard — karta „Statystyki pomiaru" (G4). Klasy `sc-*`, bez kolizji w viewer/.
   Wyglad jak arkusze `.fu-sheet` / `.pr-sheet` (FieldUI.js:839, makieta `mockup_teren.html:99`):
   tlo #f2f4f7, bialy naglowek, `Zamknij` szary; kolory stanu z paska jakosci `teren.html:50–54`.

   Pod telefon (360–412 px, jedna reka, slonce):
   • arkusz od dolu, kolumna jedna; wiersz sekcji ≥ 58 px, caly jest przyciskiem,
   • zwiniety wiersz niesie wartosc kluczowa (18 px, 800) i pasek stanu — lista zwinietych
     sekcji jest tablica rozdzielcza na jeden ekran,
   • zadnego tekstu z informacja jasniejszego niz #5b6672 na bialym (kontrast ≥ 5,5:1);
     kolory ostrzezen przyciemnione pod slonce (#8a5a00 zamiast #a8730a jako tekst).
   ══════════════════════════════════════════════════════════════════════════ */

.sc-sheet{position:fixed;inset:0;z-index:1200;background:rgba(10,12,15,.72);display:none;
          align-items:flex-end;justify-content:center}
.sc-sheet.on{display:flex}
.sc-sheet *{box-sizing:border-box}
.sc-in{background:#f2f4f7;width:100%;max-width:560px;max-height:92%;overflow-y:auto;overflow-x:hidden;
       border-radius:14px 14px 0 0;padding-bottom:env(safe-area-inset-bottom);
       overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
       font-family:system-ui,'Segoe UI',Arial,sans-serif;color:#12151a}

/* ── Naglowek: kto i jak swieze, przed liczbami ── */
.sc-hd{display:flex;align-items:center;gap:10px;padding:11px 12px 11px 14px;background:#fff;
       border-bottom:1px solid #dfe3e8;position:sticky;top:0;z-index:3}
.sc-hd-t{flex:1;min-width:0}
.sc-hd h2{font-size:17px;font-weight:800;margin:0;line-height:1.2}
.sc-age{font-size:13px;font-weight:600;color:#4a5461;margin-top:2px;line-height:1.3;
        white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sc-age.sc-age-bad{color:#b02525;font-weight:800}
.sc-close{flex:0 0 auto;background:#eceff3;border:0;border-radius:8px;padding:0 16px;min-height:44px;
          font-size:15px;font-weight:700;color:#12151a;font-family:inherit}
.sc-close:active{background:#dfe3e8}

.sc-alert{display:block;width:100%;border:0;background:#b02525;color:#fff;font-size:15px;font-weight:800;
          padding:12px 14px;text-align:left;min-height:48px;font-family:inherit}
.sc-alert[hidden]{display:none}

.sc-body{padding:8px 8px 4px;transition:opacity .2s}
/* Brak danych > 3 s: liczby zostaja (z wiekiem), ale caly arkusz gasnie — zamrozona liczba nie
   moze wygladac jak zywa (dashboard_rtk.py:723). */
.sc-in.sc-stale .sc-body{opacity:.55}

/* ── Sekcja: wiersz-przycisk ── */
.sc-sec{background:#fff;border:1px solid #dfe3e8;border-radius:10px;margin-bottom:7px;overflow:hidden}
.sc-sh{display:flex;align-items:stretch;width:100%;background:none;border:0;padding:0;margin:0;text-align:left;
       min-height:58px;color:#12151a;font-family:inherit;cursor:pointer}
.sc-sh:active{background:#eef1f5}
.sc-st{flex:0 0 7px;background:#aeb6c0}
.sc-sec[data-st=ok] .sc-st{background:#1e7a33}
.sc-sec[data-st=warn] .sc-st{background:#d08c00}
.sc-sec[data-st=bad] .sc-st{background:#b02525}
.sc-sec[data-st=wait] .sc-st{background:#1a5fb4}
.sc-sec[data-st=na] .sc-st{background:#aeb6c0}
.sc-tx{flex:1;min-width:0;padding:8px 2px 8px 11px;display:flex;flex-direction:column;justify-content:center}
.sc-l1{display:flex;align-items:baseline;gap:8px;min-width:0}
.sc-nm{flex:0 0 auto;font-size:15px;font-weight:700}
.sc-kv{margin-left:auto;min-width:0;font-size:18px;font-weight:800;font-variant-numeric:tabular-nums;
       white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:-.01em}
.sc-sec[data-st=bad] .sc-kv{color:#b02525}
.sc-sec[data-st=na] .sc-kv{color:#4a5461;font-size:16px}
.sc-sub{display:block;font-size:12.5px;color:#4a5461;margin-top:2px;line-height:1.3;
        white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sc-ch{flex:0 0 32px;display:flex;align-items:center;justify-content:center}
.sc-ch:before{content:'';width:9px;height:9px;border-right:2.5px solid #4a5461;border-bottom:2.5px solid #4a5461;
              transform:rotate(45deg);margin-top:-5px;transition:transform .15s}
.sc-sec.open .sc-ch:before{transform:rotate(-135deg);margin-top:4px}

/* ── Szczegoly: etykieta | wartosc + zrodlo ── */
.sc-sb{border-top:1px solid #e3e7ec;padding:2px 12px 6px}
.sc-sb[hidden]{display:none}
.sc-row{display:flex;gap:10px;padding:9px 0;border-bottom:1px solid #eef1f5;align-items:flex-start}
.sc-row:last-child{border-bottom:0}
.sc-k{flex:0 0 40%;min-width:0;font-size:13.5px;color:#4a5461;font-weight:600;line-height:1.3;padding-top:1px}
.sc-v{flex:1;min-width:0;text-align:right}
.sc-val{display:block;font-size:16px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.25;
        overflow-wrap:anywhere}
.sc-src{display:block;font-size:11.5px;color:#5b6672;line-height:1.3;margin-top:2px;overflow-wrap:anywhere}
.sc-na .sc-val{font-size:14px;font-weight:700;color:#4a5461}
.sc-wait .sc-val{font-size:14px;font-weight:700;color:#1a5fb4}
.sc-stale .sc-val{color:#6b7683}
.sc-warn .sc-val{color:#8a5a00}
.sc-bad .sc-val{color:#b02525}

/* ── Widnokrag ── */
.sc-sky{padding:8px 0 2px;border-bottom:1px solid #eef1f5}
.sc-svg{display:block;width:100%;max-width:320px;height:auto;margin:0 auto;touch-action:manipulation}
.sc-leg{margin:6px 0 2px;font-size:12.5px;color:#4a5461;line-height:1.35}
.sc-leg>div{display:flex;flex-wrap:wrap;justify-content:center;gap:3px 12px;margin-bottom:3px}
.sc-leg b{color:#12151a}
.sc-leg i{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:4px;vertical-align:-1px}
.sc-leg i.sc-fill{background:#4a5461}
.sc-leg i.sc-ring{background:#fff;border:2.5px solid #4a5461}
.sc-leg i.sc-half{background:#4a5461;opacity:.5}
.sc-lbl{display:block;margin:6px auto 4px;min-height:40px;padding:0 14px;border:0;border-radius:8px;
        background:#eceff3;color:#12151a;font-size:13.5px;font-weight:700;font-family:inherit}
.sc-tab{width:100%;border-collapse:collapse;font-size:14px;margin:6px 0 4px;font-variant-numeric:tabular-nums}
.sc-tab th{font-size:11.5px;color:#5b6672;font-weight:700;text-align:right;padding:4px 4px 3px}
.sc-tab td{text-align:right;padding:6px 4px;border-top:1px solid #eef1f5}
.sc-tab th:first-child,.sc-tab td:first-child{text-align:left}
.sc-tab td b{display:inline-block;width:14px}
.sc-tab .sc-tot td{font-weight:800;border-top:2px solid #dfe3e8}

.sc-foot{font-size:12px;color:#5b6672;text-align:center;margin:4px 8px 8px;line-height:1.4}
