/* GAPSik v3 (17.10.2026, decyzja [119]): skóra autorska, płaska. Bez gradientów, cieni, rozmyć i animacji na każdym wierszu.
   Fraunces (nagłówki, list) + Work Sans (tekst, UI). Własne ikony liniowe SVG zamiast emoji. Kontrast AA: pomarańcz marki tylko jako wypełnienie,
   pomarańczowy TEKST w odcieniu --org-text. Minimum 13 px tekstu pomocniczego, 44 px celu dotyku. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --org: #e8702a;        /* pomarańcz marki: wypełnienia, kropka drogi, aktywne elementy */
  --org-text: #b84a12;   /* pomarańcz jako tekst/linki (5,2:1 na bieli, 4,7:1 na kremie) */
  --org-soft: #fbe9dc;
  --cream: #f8f1e7;      /* jedyne tło */
  --ink: #2a221b;
  --green: #2f4f3a;      /* nagłówki serif */
  --mute: #6f6058;       /* opisy, etykiety (5,5:1 na kremie) */
  --card: #ffffff;
  --line: #e6dacb;
  --line-soft: #efe6da;
  --ok: #2e7d4f;  --ok-bg: #e5f1e9;
  --no: #b3362b;  --no-bg: #fbe8e5;
  --wait: #8f5f05; --wait-bg: #fbf0d6;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 12px;             /* karty */
  --r-s: 8px;            /* chipy, przyciski, pola */
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}
button, input, textarea, select { font-family: inherit; color: inherit; font-size: inherit; }
button { cursor: pointer; }
#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px calc(84px + env(safe-area-inset-bottom, 0px));
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; font-optical-sizing: auto; letter-spacing: 0; color: var(--green); }

/* Ikony liniowe SVG (sprite w index.html, helper icon() w app.js) */
.sprite { display: none; }
.ic { width: 24px; height: 24px; flex: none; display: inline-block; vertical-align: middle; color: inherit; }
.ic-20 { width: 20px; height: 20px; }
.ic-32 { width: 32px; height: 32px; }
.ic-48 { width: 48px; height: 48px; }

/* Onboarding */
.onb { text-align: center; padding-top: 40px; }
.onb-logo { display: flex; justify-content: center; color: var(--org); margin-bottom: 8px; }
.onb-logo .ic { width: 72px; height: 72px; }
.onb-title { font-family: var(--serif); font-size: 40px; font-weight: 600; color: var(--org-text); line-height: 1.1; }
.onb-sub { color: var(--mute); margin: 10px auto 28px; max-width: 34ch; font-size: 16px; }
.onb-step { font-size: 13px; color: var(--mute); margin-bottom: 4px; }
.q { font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--green); margin: 22px 0 12px; line-height: 1.25; text-wrap: balance; }
.choice {
  display: block; width: 100%; margin: 8px 0; padding: 14px 16px; min-height: 48px;
  font-size: 17px; text-align: left;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
}
.choice:active { background: var(--org-soft); }
.choice-sm { padding: 11px 14px; font-size: 15px; min-height: 44px; }

/* Nagłówki sekcji: serif, zieleń, bez ikon */
.hero { margin: 6px 0 14px; }
.hero-hi { font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--green); line-height: 1.2; text-wrap: balance; }
.sec { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--green); margin: 28px 0 10px; line-height: 1.25; }
.sec-mute { color: var(--mute); }
.cat { font-size: 13px; font-weight: 600; color: var(--mute); margin: 20px 0 6px; }
.hint { font-size: 14px; color: var(--mute); margin: 6px 0; line-height: 1.45; }
.sp { height: 16px; }

/* Karty: jeden kontener treści. Bez cienia, hairline */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; margin: 10px 0;
}
.card-tap { cursor: pointer; }
.card-tap:active { background: #fffaf5; }
.card-stage { border-color: #ecd3bf; }
.card-cta { background: #fff8f1; border: 2px dashed var(--org); cursor: pointer; }
.card-done { background: var(--ok-bg); border-color: #cfe3d6; }
.card-mute { opacity: 0.6; }
.card-kicker { font-size: 13px; font-weight: 500; color: var(--mute); margin-bottom: 4px; line-height: 1.3; }
.card-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.card-desc { font-size: 15px; color: var(--mute); margin-top: 5px; line-height: 1.45; }
.card-meta { font-size: 14px; color: var(--mute); margin-top: 4px; }

/* Formularze */
.inp {
  width: 100%; padding: 12px 14px; font-size: 16px; min-height: 46px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); margin: 8px 0;
}
.inp::placeholder { color: #9b8d84; }
.inp:focus { outline: none; border-color: var(--org); box-shadow: 0 0 0 3px rgba(232, 112, 42, 0.18); }
textarea.inp { min-height: 84px; resize: vertical; }
.num-field { display: block; margin: 8px 0; }
.num-lbl { display: block; font-size: 13px; font-weight: 500; color: var(--mute); margin-bottom: 2px; }
.num-field .inp { margin: 0; }
.primary {
  display: block; width: 100%; margin: 14px 0; padding: 14px; min-height: 48px;
  font-size: 17px; font-weight: 600;
  background: var(--org); color: var(--ink); border: none; border-radius: var(--r);
}
.primary:active { background: #d9661f; }
.primary:focus-visible, .chip:focus-visible, .choice:focus-visible, #nav button:focus-visible { outline: 3px solid var(--org); outline-offset: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 6px 4px 0; padding: 9px 14px; min-height: 44px;
  font-size: 15px; font-weight: 500; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-s);
}
.chip .ic { width: 18px; height: 18px; }
.chip:active { background: var(--org-soft); }
.chip-on { background: var(--org); color: var(--ink); border-color: var(--org); font-weight: 600; }
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: var(--org-text); font-size: 15px; font-weight: 600; padding: 10px 0; min-height: 44px; }

/* Ikona w wierszu (przepis, produkt): cienki okrąg, kolor semaforu nadaje klasa st-* */
.ico {
  width: 44px; height: 44px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line); color: var(--org-text); background: #fff;
}
.ico .ic { width: 22px; height: 22px; }
.rowhead { display: flex; gap: 12px; align-items: center; }
.rowhead-c { flex: 1; min-width: 0; }

/* Filtry kategorii: rząd przewijany, ikona w okręgu */
.catrow {
  display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.catrow::-webkit-scrollbar { display: none; }
.catbtn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none;
  background: none; border: none;
  font-size: 12px; font-weight: 500; color: var(--mute); padding: 0; min-width: 56px;
}
.catbtn-i {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--ink);
}
.catbtn-on { color: var(--org-text); font-weight: 600; }
.catbtn-on .catbtn-i { background: var(--org); border-color: var(--org); color: var(--ink); }

/* Profil */
.avatar {
  width: 56px; height: 56px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--org-soft); color: var(--org-text); border: 1px solid #ecd3bf;
}
.avatar .ic { width: 28px; height: 28px; }
.prof-name { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--green); line-height: 1.2; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.tile { background: var(--cream); border: 1px solid var(--line-soft); border-radius: var(--r-s); padding: 10px 6px; text-align: center; min-width: 0; }
.tile-lbl { font-size: 12px; font-weight: 500; color: var(--mute); }
.tile-num { font-family: var(--serif); font-size: 22px; font-weight: 600; margin-top: 2px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.t-green, .t-org, .t-blue, .t-purple { color: var(--ink); }

/* Wiersze produktów / list */
.prow {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; margin: 8px 0;
}
.prow-tap { cursor: pointer; }
.prow-tap:active { background: #fffaf5; }
.prow-done { opacity: 0.55; }
.prow-l { flex: 1; min-width: 0; }
.prow-name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.prow-note { font-size: 13px; color: var(--mute); margin-top: 2px; line-height: 1.4; }
.badge {
  font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: var(--r-s);
  white-space: nowrap; text-align: center; line-height: 1.25; flex: none;
}
.badge-l1 { font-size: 13px; font-weight: 700; }
.badge-l2 { font-size: 11px; font-weight: 500; opacity: 0.9; margin-top: 1px; }

/* Miniatury dokumentów: jeden kolor, ikona w kremowym kwadracie */
.thumb {
  width: 52px; height: 52px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-s); background: var(--cream); border: 1px solid var(--line-soft); color: var(--org-text);
}
.thumb .ic { width: 26px; height: 26px; }
.thumb-org, .thumb-green, .thumb-blue, .thumb-purple { background: var(--cream); }
.chev { font-size: 24px; color: #b9a99c; flex: none; padding-left: 2px; line-height: 1; }
.st-ok { background: var(--ok-bg); color: var(--ok); }
.st-no { background: var(--no-bg); color: var(--no); }
.st-wait { background: var(--wait-bg); color: var(--wait); }
.st-al { background: var(--no-bg); color: var(--no); border: 1px solid var(--no); }
.ico.st-ok { border-color: #bfdcc8; }
.ico.st-no { border-color: #e9c0ba; }
.ico.st-wait { border-color: #e6d3a3; }

/* Gwiazdki: 44 px celu dotyku, glif SVG */
.pstar, .star {
  background: none; border: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; color: #c9b9ab;
}
.pstar-on, .star-on { color: var(--org); }
.inp-kcal { max-width: 90px; }

/* Dziennik: skale mieszczą się w jednym rzędzie na 360 px (7 × 40 + 6 × 4 = 304) */
.scale { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.scale-btn {
  flex: 1 1 0; min-width: 40px; height: 44px; font-size: 16px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--ink);
}
.scale-btn .ic { width: 26px; height: 26px; }
.scale-on { background: var(--org); border-color: var(--org); color: var(--ink); font-weight: 600; }

/* Ocena smaku: etykieta nad rzędem, pięć gwiazdek w jednej linii */
.stars { margin-top: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.stars-lbl { flex: 0 0 100%; font-size: 14px; color: var(--mute); margin-bottom: 2px; }
.stars .star { width: 40px; height: 40px; }
.stars-avg { font-size: 13px; color: var(--mute); margin-left: 6px; }
.badge-inline { display: inline-block; margin-top: 4px; padding: 3px 8px; font-size: 12px; white-space: normal; }
.prow-note-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; margin: 2px 0 0; }

/* Wiersz dodawania */
.addrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.addrow .inp { flex: 1 1 160px; margin: 4px 0; }
.addrow .chip { white-space: nowrap; }

.list { padding-left: 20px; font-size: 15px; }
.list li { margin: 6px 0; }
.list li::marker { color: var(--org-text); font-weight: 600; }

/* Szybkie akcje (kafle wejść): ikona + etykieta */
.qa { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.qa button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; min-height: 72px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 4px; font-size: 12px; font-weight: 500; color: var(--ink); line-height: 1.2; text-align: center;
}
.qa button .ic { width: 26px; height: 26px; color: var(--org-text); }
.qa button:active { background: var(--org-soft); }
.qa-3 { grid-template-columns: repeat(3, 1fr); }

/* Pasek aktywnego profilu */
.personbar {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 8px 12px; margin: 0 0 12px; font-size: 14px; font-weight: 500; min-height: 44px;
}
.personbar .ic { color: var(--org-text); }

/* Czat */
.chat { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.chat-msg { max-width: 88%; padding: 10px 14px; border-radius: var(--r); font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.chat-b { background: var(--card); color: var(--ink); align-self: flex-start; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-u { background: var(--org-soft); color: var(--ink); align-self: flex-end; border: 1px solid #ecd3bf; border-bottom-right-radius: 4px; }
.chat-send { font-weight: 600; }

/* Wykresy, seria, raport, maskotka */
.spark { width: 100%; height: 64px; display: block; }
.pet-big { display: flex; justify-content: center; margin: 8px 0 4px; }
.pet-big svg { width: 140px; height: 140px; }
.pet-row { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.pet-row svg { width: 36px; height: 36px; }
.streak { font-size: 14px; color: var(--org-text); margin-top: 4px; font-weight: 600; }
/* tabela raportu: na telefonie przewija się w poziomie wewnątrz karty, nie rozpycha ekranu */
.rtable { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 6px; -webkit-overflow-scrolling: touch; }
.rtable th, .rtable td { white-space: nowrap; }
.rtable th, .rtable td { border: 1px solid var(--line); padding: 5px 7px; text-align: left; vertical-align: top; }
.rtable th { background: var(--cream); color: var(--ink); font-weight: 600; }
.rtable tr:nth-child(even) td { background: #fcf8f3; }

.disc { font-size: 13px; color: var(--mute); text-align: center; margin: 28px 0 10px; line-height: 1.45; }

/* Nawigacja dolna: zakotwiczona, pełna szerokość, hairline u góry; aktywna = kolor + kreska */
#nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
#nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  flex: 1 1 0; min-width: 0; min-height: 52px;
  background: none; border: none; border-top: 2px solid transparent;
  color: var(--mute); font-size: 12px; font-weight: 500; padding: 4px 0 2px;
}
.nav-ico { display: flex; align-items: center; justify-content: center; width: 28px; height: 26px; }
.nav-ico .ic { width: 24px; height: 24px; }
.nav-lbl { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
#nav button.active { color: var(--org-text); font-weight: 600; border-top-color: var(--org); }
@media (max-width: 374px) { #nav button { font-size: 11px; } }

/* List od GAPSika: kartka */
.letter { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 20px 20px; }
.letter-date { font-size: 13px; font-weight: 600; color: var(--mute); margin-bottom: 10px; }
.letter-hi { font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--green); margin-bottom: 12px; line-height: 1.25; }
.letter-p { font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--ink); margin: 0 0 14px; }
.letter-sign { font-family: var(--serif); font-style: italic; color: var(--org-text); margin-top: 4px; margin-bottom: 0; }

/* Dobre słowo na dziś: płaski krem, karta, bez ruchu */
.aff-ov {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--cream);
  transition: opacity 0.25s ease;
}
.aff-ov.aff-out { opacity: 0; pointer-events: none; }
.aff-card { max-width: 420px; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 22px 22px; text-align: center; }
.aff-sun { display: flex; justify-content: center; color: var(--org); margin-bottom: 6px; }
.aff-sun .ic { width: 44px; height: 44px; }
.aff-hi { font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--green); margin: 8px 0 14px; line-height: 1.25; }
.aff-text { font-family: var(--serif); font-size: 21px; font-weight: 500; font-style: italic; color: var(--ink); line-height: 1.45; margin: 0 0 14px; text-wrap: balance; }
.aff-streak { font-size: 14px; color: var(--ink); background: var(--org-soft); border-radius: var(--r-s); padding: 8px 12px; margin: 0 0 14px; display: inline-block; }
.aff-btn { display: block; width: 100%; margin-top: 6px; padding: 14px 18px; min-height: 48px; font-size: 17px; font-weight: 600; color: var(--ink); background: var(--org); border: none; border-radius: var(--r); }
.aff-sig { font-size: 13px; color: var(--mute); margin-top: 14px; }
.aff-conf, .aff-conf-p { display: none; }
.aff-arch-txt { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink); line-height: 1.5; }

/* Karta instalacji na ekran telefonu */
.install-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.install-step { background: var(--cream); border: 1px solid var(--line-soft); border-radius: var(--r-s); padding: 10px 6px; text-align: center; font-size: 13px; line-height: 1.3; min-width: 0; }
.install-step .ic { display: block; margin: 0 auto 6px; color: var(--org-text); width: 26px; height: 26px; }
.install-step b { display: block; font-weight: 600; margin-bottom: 2px; }

/* Szybki wpis nastroju na Dziś */
.quick-mood { display: flex; gap: 6px; margin-top: 10px; }
.quick-mood .scale-btn { height: 48px; }

@media print {
  #nav, .no-print, .aff-ov { display: none !important; }
  body { background: #fff; }
  #app { max-width: none; padding: 0; }
  .card, .prow { border: 1px solid #ddd; break-inside: avoid; }
  .rtable { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
