:root {
  --zielony: #14803c;
  --ciemny: #0f3d34;
  --turkus: #0e6b73;
  --granat: #14302b;
  --tlo: #f3f7f4;
  --karta: #ffffff;
  --linia: #c5d6cc;
  --szary: #e3ece6;
  --zolty: #ffd166;
  --czerwony: #b3261e;
  --pomarancz: #b45309;
  --h-bottom: 88px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--tlo); color: var(--granat);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 20px; line-height: 1.3; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Góra */
.top { position: sticky; top: 0; z-index: 5; background: var(--ciemny); padding: 10px 12px 12px; box-shadow: 0 3px 10px rgba(15,61,52,.35); }
.counter { font-size: 26px; font-weight: 800; text-align: center; padding: 2px 0 8px; color: #fff; }
.counter b { font-size: 36px; color: var(--zolty); }
#search { width: 100%; min-height: 56px; font-size: 22px; padding: 10px 14px; border: 3px solid #fff; border-radius: 14px; background: #fff; color: var(--granat); }
#search::placeholder { color: #5a6f68; }
.banner { background: #fff3e0; border: 3px solid var(--pomarancz); color: #5b2c00; border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.small-btn { min-height: 48px; padding: 6px 12px; border: 3px solid var(--pomarancz); background: #fff; border-radius: 10px; font-weight: 700; }

/* Lista osób */
.list { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 10px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 68px;
  padding: 10px 12px 10px 16px; text-align: left; background: var(--karta); color: var(--granat); border: 2px solid var(--linia); border-radius: 18px; box-shadow: 0 2px 6px rgba(15,61,52,.12); }
.person .name { font-size: 24px; font-weight: 700; word-break: break-word; }
.person .mark { flex: 0 0 auto; min-width: 56px; height: 56px; border-radius: 28px; background: var(--turkus); color: #fff;
  font-size: 36px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 10px; }
.person:active { transform: scale(0.98); }
.person.done { background: var(--zielony); border-color: var(--zielony); color: #fff; box-shadow: 0 2px 6px rgba(20,128,60,.35); }
.person.done .mark { background: #fff; color: var(--zielony); font-size: 30px; }
.empty { padding: 24px 8px; text-align: center; font-size: 22px; color: #3e564e; }

/* Stopka */
.foot { padding: 18px 12px calc(var(--h-bottom) + 90px); text-align: center; }
.foot-links { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.link-btn { background: none; border: none; min-height: 52px; padding: 8px 14px; font-size: 20px; color: var(--turkus); font-weight: 700; text-decoration: underline; }
.foot-info { margin-top: 10px; font-size: 16px; color: #4a5f58; }

/* Dolny pasek */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--karta); border-top: 2px solid var(--linia); box-shadow: 0 -3px 10px rgba(15,61,52,.12); }
.big { flex: 1; min-height: 64px; font-size: 24px; font-weight: 800; border-radius: 16px; border: 3px solid var(--turkus); }
.big.primary { background: var(--zielony); border-color: var(--zielony); color: #fff; }
.big.secondary { background: #fff; color: var(--turkus); }
.big.danger { background: var(--czerwony); border-color: var(--czerwony); color: #fff; }

/* Pasek cofania */
.undo { position: fixed; left: 10px; right: 10px; bottom: calc(var(--h-bottom) + 10px + env(safe-area-inset-bottom)); z-index: 7;
  background: var(--ciemny); color: #fff; border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 20px; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.undo button { min-height: 56px; padding: 0 20px; font-size: 22px; font-weight: 800; background: var(--zolty); color: #0f3d34; border: none; border-radius: 12px; }

/* Ekran „Dziś wpisani” */
.screen { position: fixed; inset: 0; z-index: 20; background: var(--tlo); overflow-y: auto; padding: 12px; }
.screen-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.screen-title { font-size: 30px; font-weight: 800; text-align: center; color: var(--ciemny); }
.screen-sub { text-align: center; color: #3e564e; font-size: 18px; }
.today-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 40px; }
.t-row { display: flex; align-items: center; gap: 10px; background: var(--karta); border: 2px solid var(--linia); border-radius: 14px; padding: 8px 10px; min-height: 64px; }
.t-num { flex: 0 0 34px; font-weight: 700; color: #4a5f58; }
.t-time { flex: 0 0 64px; font-weight: 800; font-size: 22px; color: var(--turkus); }
.t-name { flex: 1; font-size: 22px; font-weight: 600; word-break: break-word; }
.t-del { min-height: 56px; padding: 0 14px; font-size: 18px; font-weight: 700; background: #fff; color: var(--czerwony); border: 3px solid var(--czerwony); border-radius: 12px; }

/* Okienka */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(10, 20, 35, .65); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.modal-box { width: 100%; max-width: 480px; background: #fff; border-radius: 20px; padding: 18px 16px 16px; max-height: 92vh; overflow-y: auto; }
.modal-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.modal-body { font-size: 21px; margin-bottom: 14px; white-space: pre-line; }
.modal-buttons { display: flex; flex-direction: column; gap: 10px; }
.modal-buttons .big { flex: none; width: 100%; }
.field { display: block; margin-bottom: 12px; font-size: 20px; font-weight: 700; }
.field input { display: block; width: 100%; margin-top: 4px; min-height: 60px; font-size: 24px; padding: 8px 12px; border: 3px solid var(--turkus); border-radius: 12px; }
.err { color: var(--czerwony); font-weight: 700; margin-bottom: 10px; }

@media (min-width: 700px) {
  #app { max-width: 560px; margin: 0 auto; }
  .bottom, .undo { max-width: 560px; margin: 0 auto; }
}
