:root {
  --tlo: #f6f4f1; --karta: #fff; --tekst: #1d1b1a; --szary: #6b6560; --linia: #e3ded8;
  --akcent: #b3261e; --akcent-tekst: #fff; --ok: #2e7d32; --uwaga: #b26a00; --info: #1f5fa8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --tlo: #161413; --karta: #22201e; --tekst: #ece8e4; --szary: #a59e97; --linia: #3a3633; --akcent: #e5534b; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--tlo); color: var(--tekst); font-size: 16px; line-height: 1.4; }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px; background: var(--akcent); color: var(--akcent-tekst); }
header h1 { flex: 1; margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ikona { background: none; border: 0; color: inherit; font-size: 30px; line-height: 1; padding: 0 6px; cursor: pointer; }
.znaczek { background: rgba(255,255,255,.22); border-radius: 12px; padding: 2px 9px; font-size: 13px; font-weight: 600; }
main { padding: 14px 16px calc(env(safe-area-inset-bottom) + 90px); max-width: 760px; margin: 0 auto; }
.karta { background: var(--karta); border: 1px solid var(--linia); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
h2 { margin: 0 0 8px; font-size: 18px; }
label { display: block; margin: 10px 0; font-size: 14px; color: var(--szary); }
input, textarea, select { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; color: var(--tekst);
  background: var(--tlo); border: 1px solid var(--linia); border-radius: 8px; }
button { font: inherit; border-radius: 9px; border: 1px solid var(--linia); background: var(--karta); color: var(--tekst);
  padding: 11px 14px; cursor: pointer; }
button.glowny { background: var(--akcent); color: var(--akcent-tekst); border-color: var(--akcent); font-weight: 600; width: 100%; }
button:disabled { opacity: .5; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { background: var(--karta); border: 1px solid var(--linia); border-radius: 10px; margin-bottom: 8px; padding: 11px 12px; cursor: pointer; }
.lista li.zrobione { opacity: .55; }
.wiersz { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.id { font-weight: 700; font-variant-numeric: tabular-nums; }
.gw { color: var(--akcent); letter-spacing: -1px; }
.male { font-size: 13px; color: var(--szary); }
.tag { display: inline-block; font-size: 12px; border-radius: 10px; padding: 1px 8px; margin: 2px 4px 0 0; border: 1px solid currentColor; }
.tag.moje { color: var(--info); } .tag.cudze { color: var(--szary); } .tag.ok { color: var(--ok); } .tag.uw { color: var(--uwaga); }
.pasek { height: 6px; border-radius: 3px; background: var(--linia); overflow: hidden; margin-top: 8px; }
.pasek > i { display: block; height: 100%; background: var(--ok); }
.filtry { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filtry button { padding: 6px 11px; font-size: 14px; }
.filtry button.wl { background: var(--tekst); color: var(--tlo); border-color: var(--tekst); }
.przyciski { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.miniatury { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 10px; }
.miniatury figure { margin: 0; position: relative; }
.miniatury img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; display: block; }
.miniatury figcaption { position: absolute; left: 3px; bottom: 3px; font-size: 11px; background: rgba(0,0,0,.6); color: #fff; padding: 0 5px; border-radius: 4px; }
button.fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 6;
  width: min(420px, calc(100% - 32px)); padding: 16px; font-size: 18px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); transform: translateX(-50%); z-index: 9;
  background: var(--tekst); color: var(--tlo); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px); }
#toast.widoczny { opacity: 1; }
.szukaj { margin-bottom: 10px; }
