/* Emma - system wyglądu wg handoffu z Claude Design.
   Font: Plus Jakarta Sans. Tryb ciemny (Pulpit/Sen, onboarding) + jasny (Karmienie/Przewijanie).
   Ten plik to fundament; ekrany dochodzą po kolei. */

:root {
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* tryb ciemny (domyślny dla powłoki) */
  --bg: #141b2e;
  --surface: #1e2740;
  --surface-2: #1f283c;
  --inset: #141b2e;
  --border: #2a3654;
  --border-2: #2c3a5c;
  --text: #f4f1ea;
  --muted: #97a1b8;
  --muted-2: #7d889f;

  --accent: #7aa5ff;
  --accent-2: #9cc2ff;
  --on-accent: #0f1626;
  --gold: #e8b95f;
  --green: #8fc7a0;
  --cyan: #79c4d6;

  /* kolory trackerów (kropki na listach) */
  --siusiu: var(--gold);
  --kupka: #c08552;
  --oba: var(--green);
  --drzemka: var(--gold);
  --noc: #3a5a9e;
  --piers: #e08aa8;
  --butelka: var(--accent-2);
  --odciaganie: #b79ce0;

  --r-card: 24px;
  --r-btn: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ===================== EKRAN POWITALNY / LOGOWANIE ===================== */
.welcome {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 26px calc(40px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #1a2236 0%, #243049 100%);
  max-width: 460px;
  margin: 0 auto;
}
.welcome__brand { text-align: center; margin-bottom: 38px; }
.welcome__icon {
  width: 96px; height: 96px; border-radius: 30px;
  background: linear-gradient(150deg, #7aa5ff, #9d7aff);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 28px;
  box-shadow: 0 16px 40px rgba(122, 165, 255, .4);
}
.welcome__title { font-size: 32px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; margin: 0; }
.welcome__tagline { font-size: 16px; color: #aab4cc; margin: 16px auto 0; line-height: 1.55; max-width: 300px; }

.welcome__form { display: flex; flex-direction: column; gap: 12px; }
.welcome__form label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 700; color: #aab4cc; }
.welcome__form input {
  background: #222d44; border: 1px solid var(--border-2); border-radius: var(--r-btn);
  padding: 16px; color: var(--text); font-size: 16px; font-weight: 600;
}
.welcome__form input:focus { outline: none; border-color: var(--accent); }

/* ===================== PRZYCISKI ===================== */
.btn-primary, .przycisk-glowny {
  border: none; border-radius: 18px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 800; font-size: 17px; padding: 17px; margin-top: 6px;
}
.btn-primary:active, .przycisk-glowny:active { transform: scale(.99); }
.blad { color: #d88a8a; font-size: 14px; margin: 6px 0 0; text-align: center; }

/* ===================== POWŁOKA APLIKACJI ===================== */
.app { min-height: 100dvh; display: flex; flex-direction: column; max-width: 460px; margin: 0 auto; position: relative; }
.naglowek {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 22px 12px;
  position: sticky; top: 0; z-index: 5; background: var(--bg);
}
.naglowek-tytul { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.link-maly { background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 600; }

.widok { flex: 1; width: 100%; padding: 4px 20px 120px; }

/* dolna nawigacja (ciemna, szklana) */
.nawigacja {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 460px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(20, 26, 42, .86); backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); z-index: 6;
}
.taba {
  background: none; border: none; color: var(--muted);
  padding: 6px 0; font-size: 10.5px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.taba .ikona { width: 23px; height: 23px; display: flex; }
.taba .ikona svg { width: 23px; height: 23px; }
.taba.aktywna { color: var(--accent); }
.taba.aktywna .ikona svg { stroke: var(--accent); }

/* ===================== ELEMENTY TREŚCI ===================== */
.sekcja-tytul { font-size: 17px; font-weight: 700; color: var(--text); margin: 18px 2px 12px; }

.szybkie { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.szybkie-2 { grid-template-columns: repeat(2, 1fr); }
.szybkie-3 { grid-template-columns: repeat(3, 1fr); }
.szybki-btn {
  border: none; border-radius: 20px; padding: 20px 8px;
  color: var(--on-accent); font-weight: 800; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.szybki-btn .emo { font-size: 24px; }
.szybki-btn:active { transform: scale(.98); }
.szybki-btn.siusiu { background: var(--gold); }
.szybki-btn.kupka { background: var(--kupka); color: #fff; }
.szybki-btn.oba { background: var(--green); }
.szybki-btn.drzemka { background: var(--gold); }
.szybki-btn.noc { background: var(--noc); color: #fff; }
.szybki-btn.piers-l, .szybki-btn.piers-p, .szybki-btn.piers-o { background: var(--piers); color: #2a1620; }

.hint-ostatnia { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }
.hint-ostatnia b { color: var(--text); }
.dwa-przyciski { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.wtorny-btn {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 15px; font-size: 15px; font-weight: 700;
}
.wtorny-btn:active { transform: scale(.99); }

.recznie-przelacz {
  background: none; border: 1px dashed var(--border-2); color: var(--accent);
  border-radius: 14px; padding: 13px; width: 100%; margin-top: 10px; font-size: 14px; font-weight: 700;
}
.recznie-form {
  background: var(--surface); border-radius: var(--r-card); padding: 18px; margin-top: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.recznie-form input, .recznie-form select {
  background: var(--inset); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px; color: var(--text); font-size: 16px; font-weight: 600;
}
.recznie-form .rzad { display: flex; gap: 10px; }
.recznie-form .rzad > * { flex: 1; }
.recznie-form .mini { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.recznie-form .form-tytul { font-weight: 800; color: var(--text); font-size: 18px; }

.lista { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 9px; }
.wpis {
  background: var(--surface); border-radius: 16px; padding: 15px 16px;
  display: flex; align-items: center; gap: 13px;
}
.wpis .kropka { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.kropka.siusiu { background: var(--siusiu); }
.kropka.kupka { background: var(--kupka); }
.kropka.oba { background: var(--oba); }
.kropka.drzemka { background: var(--drzemka); }
.kropka.noc { background: var(--noc); }
.kropka.piers { background: var(--piers); }
.kropka.butelka { background: var(--butelka); }
.kropka.odciaganie { background: var(--odciaganie); }
.wpis .tresc { flex: 1; }
.wpis .godzina { font-weight: 800; }
.wpis .opis { color: var(--muted); font-size: 14px; }
.wpis .usun, .wpis .edytuj { background: none; border: none; color: var(--muted-2); font-size: 17px; padding: 6px; }

.pusto { color: var(--muted); text-align: center; padding: 30px 10px; }
.placeholder { color: var(--muted); text-align: center; padding: 70px 20px; }
.placeholder .duzy { font-size: 40px; display: block; margin-bottom: 12px; }

/* aktywny stoper (sen / karmienie) */
.aktywny-karta {
  background: linear-gradient(165deg, #1f2c4c, #1a2440);
  border: 1px solid var(--border-2); border-radius: 28px;
  padding: 24px 18px; display: flex; flex-direction: column; gap: 16px;
  align-items: center; margin-top: 6px;
}
.aktywny-info { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.aktywny-typ { color: var(--accent); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.aktywny-czas { font-size: 50px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.aktywny-od { color: var(--muted); font-size: 13px; }
.przycisk-stop {
  width: 100%; border: none; border-radius: var(--r-btn);
  padding: 15px; font-size: 16px; font-weight: 800;
  background: var(--accent); color: var(--on-accent);
}
.przycisk-stop:active { transform: scale(.99); }

.podsumowanie { color: var(--muted); font-size: 14px; padding: 0 2px 4px; }
.podsumowanie b { color: var(--text); }

/* ===================== PULPIT (Dashboard) ===================== */
.naglowek { display: none; } /* ekrany mają własne nagłówki wg designu */
.widok { padding: calc(10px + env(safe-area-inset-top)) 20px 120px; }

.dash-top { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 22px; }
.dash-greeting { font-size: 14px; color: var(--muted); font-weight: 500; }
.dash-age { font-size: 13px; color: var(--muted-2); margin-top: 5px; font-weight: 500; }
.dash-top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 46px; height: 46px; border: none; border-radius: 15px; background: #1f283c;
  display: flex; align-items: center; justify-content: center; position: relative; color: #c3cbdc;
}
.icon-btn .dot-badge { position: absolute; top: 11px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); border: 2px solid #1f283c; }
.avatar { width: 46px; height: 46px; border: none; border-radius: 50%; background: linear-gradient(140deg, #7aa5ff, #9d7aff); color: #fff; font-weight: 800; font-size: 17px; }

/* status card */
.status-card { background: linear-gradient(165deg, #1f2840, #1a2236); border: 1px solid var(--border); border-radius: 28px; padding: 24px; margin-bottom: 16px; position: relative; overflow: hidden; }
.status-card .glow { position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(232,185,95,.13), transparent 70%); }
.status-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.status-big { font-size: 26px; font-weight: 800; line-height: 1.2; }
.status-sub { font-size: 15px; color: #c3cbdc; margin-top: 4px; }
.status-minis { display: flex; gap: 8px; margin-top: 18px; }
.status-mini { flex: 1; background: var(--inset); border-radius: 15px; padding: 13px; }
.status-mini .k { font-size: 12px; color: var(--muted-2); }
.status-mini .v { font-size: 16px; font-weight: 700; margin-top: 3px; }

/* active sleep on dashboard */
.status-sleep { background: linear-gradient(165deg, #1e2a46, #1a2238); border: 1px solid var(--border-2); }
.status-sleep .row { display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring .base { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(122,165,255,.18); }
.ring .arc { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent); transform: rotate(120deg); }
.ring .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: emPulse 1.6s ease-in-out infinite; }
@keyframes emPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .85; } }

/* prediction big card */
.pred-card { background: var(--surface-2); border-radius: 28px; padding: 22px; margin-bottom: 16px; }
.pred-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pred-head .left { display: flex; align-items: center; gap: 9px; }
.pred-ic { width: 34px; height: 34px; border-radius: 11px; background: rgba(122,165,255,.16); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.pred-title { font-size: 16px; font-weight: 700; }
.pred-badge { font-size: 12px; font-weight: 600; color: var(--gold); background: rgba(232,185,95,.12); padding: 5px 10px; border-radius: 9px; }
.pred-text { font-size: 20px; font-weight: 700; line-height: 1.35; }
.pred-stats { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.pred-stat { background: var(--inset); border-radius: 14px; padding: 11px 15px; }
.pred-stat.bare { background: none; padding: 11px 0; }
.pred-stat .k { font-size: 11px; color: var(--muted-2); }
.pred-stat .v { font-size: 18px; font-weight: 800; }
.conf { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.conf-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--inset); overflow: hidden; }
.conf-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #7aa5ff, #9cc2ff); }
.conf-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pred-basis { font-size: 12.5px; color: var(--muted-2); margin-top: 12px; line-height: 1.5; }
.rate-btns { display: flex; gap: 8px; margin-top: 14px; }
.rate-btn { flex: 1; border: 1px solid var(--border-2); background: transparent; color: #c3cbdc; border-radius: 12px; padding: 10px; font-size: 13px; font-weight: 600; }
.cta-dob { width: 100%; margin-top: 14px; border: none; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 15px; padding: 13px; }

/* feeding prediction */
.feed-card { background: var(--surface-2); border-radius: 24px; padding: 18px 20px; margin-bottom: 16px; }
.feed-card .head { display: flex; align-items: center; justify-content: space-between; }
.feed-card .head .left { display: flex; align-items: center; gap: 9px; }
.feed-ic { width: 30px; height: 30px; border-radius: 10px; background: rgba(143,199,160,.18); display: flex; align-items: center; justify-content: center; color: var(--green); }
.feed-stats { display: flex; gap: 10px; margin-top: 14px; }
.feed-stats .box { background: var(--inset); border-radius: 14px; padding: 12px; }
.feed-stats .box .k { font-size: 11px; color: var(--muted-2); }
.feed-stats .box .v { font-size: 18px; font-weight: 800; color: var(--green); }
.feed-stats .box .v2 { font-size: 14px; font-weight: 700; margin-top: 2px; }

/* quick actions */
.quick-actions { display: flex; gap: 10px; margin-bottom: 22px; }
.quick-btn { flex: 1; border: none; border-radius: 20px; padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.quick-btn.qa-sleep { background: linear-gradient(160deg, #27406e, #1d3056); color: #eaf0ff; }
.quick-btn.qa-feed { background: linear-gradient(160deg, #2f4a3a, #26402f); color: #e6f4ea; }
.quick-btn.qa-change { background: linear-gradient(160deg, #274a55, #214049); color: #e3f3f7; }
.quick-btn:active { transform: scale(.98); }

/* day in a pill */
.pill-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.pill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.pill { background: var(--surface-2); border-radius: 18px; padding: 15px; }
.pill .k { font-size: 12px; color: var(--muted-2); }
.pill .v { font-size: 23px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.pill .v.blue { color: var(--accent-2); }
.pill .v.gold { color: var(--gold); }
.pill .v.green { color: var(--green); }
.pill .v.cyan { color: var(--cyan); }

/* timeline */
.tl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tl-head .t { font-size: 17px; font-weight: 700; }
.tl-link { border: none; background: transparent; color: var(--accent); font-size: 13px; font-weight: 700; }
.tl-card { background: var(--surface-2); border-radius: 24px; padding: 8px 18px; }
.tl-row { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid #28324a; }
.tl-row:last-child { border-bottom: none; }
.tl-clock { font-size: 13px; font-weight: 700; color: var(--muted); width: 42px; flex: none; font-variant-numeric: tabular-nums; padding-top: 1px; }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 3px; flex: none; }
.tl-info { flex: 1; }
.tl-info .t { font-size: 14.5px; font-weight: 700; }
.tl-info .d { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.tl-empty { text-align: center; color: var(--muted); padding: 24px 8px; }

/* offline banner */
.offline-banner { display: flex; align-items: center; gap: 10px; background: #23304a; border: 1px solid #33436a; border-radius: 16px; padding: 12px 14px; margin-bottom: 16px; }
.offline-banner .t { font-size: 13.5px; font-weight: 700; }
.offline-banner .s { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* ===================== SEN ===================== */
.sen-hero { position: relative; height: 300px; overflow: hidden; margin: calc(-10px - env(safe-area-inset-top)) -20px 18px; }
.sen-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 38%; }
.sen-hero .ov { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,27,46,.15) 0%, rgba(20,27,46,.1) 45%, rgba(20,27,46,.92) 100%); }
.sen-hero .cap { position: absolute; left: 20px; right: 20px; bottom: 18px; }
.sen-hero .cap h2 { font-size: 32px; font-weight: 800; letter-spacing: -.5px; margin: 0; }
.sen-hero .cap p { font-size: 15px; color: #cdd6ea; margin: 2px 0 0; }

.pred-strip { background: var(--surface); border-radius: 22px; padding: 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; }
.pred-strip .ic { width: 44px; height: 44px; border-radius: 14px; background: rgba(232,185,95,.16); display: flex; align-items: center; justify-content: center; flex: none; color: var(--gold); }
.pred-strip .t { font-size: 14.5px; font-weight: 700; }
.pred-strip .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.timer-card { background: linear-gradient(165deg, #1f2c4c, #1a2440); border: 1px solid var(--border-2); border-radius: 28px; padding: 26px; margin-bottom: 16px; text-align: center; position: relative; overflow: hidden; }
.timer-card .ring2 { position: absolute; left: 50%; top: 60px; width: 160px; height: 160px; margin-left: -80px; border-radius: 50%; border: 2px solid rgba(122,165,255,.25); animation: emRing 2.4s ease-out infinite; }
.timer-card .lab { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; position: relative; }
.timer-card .lab .tx { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .4px; }
.timer-card .big { font-size: 52px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; position: relative; }
.timer-card .sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.timer-card .acts { display: flex; gap: 10px; margin-top: 22px; position: relative; }
.btn-outline { border: 1px solid var(--border-2); background: transparent; color: #c3cbdc; border-radius: 15px; padding: 14px; font-weight: 700; font-size: 14px; }
.btn-fill { border: none; background: var(--accent); color: var(--on-accent); border-radius: 15px; padding: 14px; font-weight: 800; font-size: 15px; }
@keyframes emRing { 0% { transform: scale(.8); opacity: .6; } 100% { transform: scale(1.5); opacity: 0; } }

.start-card { background: var(--surface); border-radius: 28px; padding: 22px; margin-bottom: 16px; }
.segmented { display: flex; gap: 8px; background: var(--inset); border-radius: 16px; padding: 5px; margin-bottom: 16px; }
.segmented .seg { flex: 1; text-align: center; padding: 11px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--muted); border: none; background: transparent; }
.segmented .seg.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn-start { width: 100%; border: none; border-radius: 18px; background: linear-gradient(160deg, #7aa5ff, #6b8fe8); color: var(--on-accent); font-weight: 800; font-size: 17px; padding: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-link { width: 100%; border: none; background: transparent; color: var(--accent); font-weight: 700; font-size: 14px; padding: 14px 0 2px; }

.sum-title { font-size: 17px; font-weight: 700; margin: 6px 0 12px; }
.sum-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.sum-cell { background: var(--surface); border-radius: 18px; padding: 14px; }
.sum-cell .k { font-size: 11.5px; color: var(--muted-2); }
.sum-cell .v { font-size: 18px; font-weight: 800; margin-top: 4px; }
.sum-cell.span2 { grid-column: span 2; }

.card-box { background: var(--surface); border-radius: 24px; padding: 20px; margin-bottom: 16px; }
.card-box .h { font-size: 15px; font-weight: 700; }
.card-box .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.age-bar { position: relative; height: 14px; border-radius: 7px; background: var(--inset); margin-top: 16px; }
.age-bar .band { position: absolute; top: 0; bottom: 0; border-radius: 7px; background: rgba(143,199,160,.22); }
.age-bar .mark { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--green); border: 3px solid var(--surface); }
.age-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2); margin-top: 8px; }
.age-note { font-size: 13px; color: #a9dcb8; font-weight: 600; margin-top: 12px; }

.rhythm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rhythm-toggle { display: flex; gap: 4px; background: var(--inset); border-radius: 11px; padding: 3px; }
.rhythm-toggle span { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 8px; }
.rhythm-toggle span.on { color: var(--on-accent); background: var(--accent); font-weight: 700; }
.rhythm-bar { position: relative; height: 34px; border-radius: 10px; overflow: hidden; background: var(--inset); }
.rhythm-bar .seg { position: absolute; top: 0; bottom: 0; }
.rhythm-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2); margin-top: 8px; }
.rhythm-legend { display: flex; gap: 16px; margin-top: 14px; }
.rhythm-legend span { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.rhythm-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.row-link { width: 100%; border: none; background: var(--surface); border-radius: 20px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.row-link .t { font-size: 15px; font-weight: 700; color: var(--text); }
.row-link .chev { color: var(--accent); display: flex; }

.empty-card { background: var(--surface); border-radius: 26px; padding: 36px 24px; text-align: center; margin-bottom: 16px; }
.empty-card .ic { width: 64px; height: 64px; border-radius: 50%; background: rgba(122,165,255,.14); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; color: var(--accent); }
.empty-card .t { font-size: 18px; font-weight: 700; }
.empty-card .s { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* nagłówek ekranu (historia itd.) */
.scr-head { display: flex; align-items: center; gap: 14px; margin: 2px 0 22px; }
.scr-back { width: 42px; height: 42px; border: none; border-radius: 13px; background: var(--surface); display: flex; align-items: center; justify-content: center; color: #c3cbdc; }
.scr-title { font-size: 24px; font-weight: 800; }
.day-label { font-size: 13px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }
.hist-card { background: var(--surface); border-radius: 24px; overflow: hidden; margin-bottom: 18px; }
.hist-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid #28324a; }
.hist-row:last-child { border-bottom: none; }
.hist-ic { width: 40px; height: 40px; border-radius: 13px; background: rgba(122,165,255,.16); display: flex; align-items: center; justify-content: center; flex: none; color: var(--accent); }
.hist-ic.noc { background: rgba(58,90,158,.3); color: var(--accent-2); }
.hist-row .info { flex: 1; }
.hist-row .info .t { font-size: 15px; font-weight: 700; }
.hist-row .info .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.hist-row .dur { font-size: 16px; font-weight: 800; color: var(--accent-2); }
.hist-edit { width: 36px; height: 36px; border: none; border-radius: 11px; background: var(--inset); display: flex; align-items: center; justify-content: center; color: var(--muted-2); flex: none; }

/* bottom sheet */
.sheet-overlay { position: fixed; inset: 0; z-index: 85; background: rgba(8,11,20,.6); backdrop-filter: blur(3px); display: flex; align-items: flex-end; animation: emFade .2s ease; }
.sheet { width: 100%; max-width: 460px; margin: 0 auto; background: var(--surface); border-radius: 30px 30px 0 0; padding: 10px 22px calc(30px + env(safe-area-inset-bottom)); animation: emSheet .3s cubic-bezier(.22,1,.36,1); }
.sheet .grip { width: 42px; height: 5px; border-radius: 3px; background: #3a4664; margin: 6px auto 18px; }
.sheet h3 { font-size: 20px; font-weight: 800; margin: 0 0 16px; }
.sheet .pair { display: flex; gap: 10px; margin-bottom: 16px; }
.sheet .pair > div { flex: 1; }
.sheet .pair .k { font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.sheet input { width: 100%; background: var(--inset); border: 1px solid var(--border); border-radius: 14px; padding: 14px; font-size: 16px; font-weight: 600; color: var(--text); font-family: inherit; }
.sheet .save { width: 100%; border: none; border-radius: 16px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 16px; padding: 16px; }
@keyframes emFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes emSheet { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* toast */
.toast { position: fixed; left: 16px; right: 16px; bottom: 96px; max-width: 430px; margin: 0 auto; z-index: 80; background: #0f1626; border: 1px solid var(--border-2); border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.4); animation: emToast .28s ease; }
.toast .chk { width: 26px; height: 26px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; flex: none; color: #0f1626; }
.toast .msg { flex: 1; font-size: 14px; font-weight: 600; }
@keyframes emToast { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===================== TRYB JASNY (Karmienie) ===================== */
body.t-feed {
  --bg: #f6f3ea; --surface: #ffffff; --surface-2: #ffffff; --inset: #f1ece1;
  --border: #eee7d8; --border-2: #e6e0d2;
  --text: #33433a; --muted: #8a9b8e; --muted-2: #9aa79b;
  --accent: #6f9277; --accent-2: #4f6f57; --on-accent: #ffffff;
}
body.t-feed .nawigacja { background: rgba(255,255,255,.9); border-top: 1px solid rgba(0,0,0,.05); }
body.t-feed .sheet .grip { background: #dcd6c8; }
body.t-feed .hist-row { border-bottom-color: #eee7d8; }
body.t-feed .hist-ic { background: #e8f0e8; color: #4f6f57; }
body.t-feed .hist-row .dur { color: #4f6f57; }
body.t-feed .hist-card, body.t-feed .row-link, body.t-feed .sheet { box-shadow: 0 4px 16px rgba(79,111,87,.07); }
body.t-feed .scr-back { box-shadow: 0 3px 10px rgba(79,111,87,.08); }

/* ===================== KARMIENIE (jasny) ===================== */
.fd-hero { position: relative; height: 248px; overflow: hidden; margin: calc(-10px - env(safe-area-inset-top)) -20px 6px; }
.fd-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.fd-hero .ov { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(246,243,234,0) 40%, rgba(246,243,234,.55) 72%, #f6f3ea 100%); }
.fd-hero .cap { position: absolute; left: 20px; right: 20px; bottom: 14px; }
.fd-hero .cap h2 { font-size: 32px; font-weight: 800; letter-spacing: -.5px; margin: 0; color: #33433a; }

.fd-last { background: #fff; border-radius: 22px; padding: 18px; margin-bottom: 16px; box-shadow: 0 4px 18px rgba(79,111,87,.07); }
.fd-last .t { font-size: 15px; font-weight: 700; color: #33433a; }
.fd-last .s { font-size: 13.5px; color: #6f9277; margin-top: 4px; display: flex; align-items: center; gap: 7px; }
.fd-last .s .dot { width: 8px; height: 8px; border-radius: 50%; background: #6f9277; flex: none; }

.fd-active { background: linear-gradient(165deg, #4f6f57, #3f5d49); border-radius: 28px; padding: 26px; margin-bottom: 16px; text-align: center; color: #fff; }
.fd-active .lab { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.fd-active .lab .tx { font-size: 13px; font-weight: 700; color: #cfe8d4; text-transform: uppercase; letter-spacing: .4px; }
.fd-active .side { font-size: 13px; color: #cfe8d4; }
.fd-active .big { font-size: 52px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; margin-top: 2px; }
.fd-active .acts { display: flex; gap: 10px; margin-top: 22px; }
.fd-switch { flex: 1; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12); color: #fff; border-radius: 15px; padding: 14px; font-weight: 700; font-size: 14px; }
.fd-end { flex: 1.3; border: none; background: #fff; color: #3f5d49; border-radius: 15px; padding: 14px; font-weight: 800; font-size: 15px; }

.fd-choose-title, .fd-sec-title { font-size: 17px; font-weight: 700; color: #33433a; margin: 6px 0 12px; }
.fd-choose { display: flex; gap: 10px; margin-bottom: 18px; }
.fd-choose-btn { flex: 1; border: none; border-radius: 22px; background: #fff; padding: 18px 8px; box-shadow: 0 4px 16px rgba(79,111,87,.08); display: flex; flex-direction: column; align-items: center; gap: 9px; }
.fd-choose-btn .ic { width: 48px; height: 48px; border-radius: 15px; background: #e8f0e8; display: flex; align-items: center; justify-content: center; color: #4f6f57; }
.fd-choose-btn span { font-size: 13.5px; font-weight: 700; color: #33433a; }
.fd-start { width: 100%; border: none; border-radius: 18px; background: linear-gradient(160deg, #6f9277, #5a7d62); color: #fff; font-weight: 800; font-size: 16px; padding: 17px; margin-bottom: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; }

.fd-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.fd-cell { background: #fff; border-radius: 18px; padding: 15px; box-shadow: 0 3px 12px rgba(79,111,87,.06); }
.fd-cell .k { font-size: 12px; color: #8a9b8e; }
.fd-cell .v { font-size: 22px; font-weight: 800; color: #33433a; margin-top: 3px; }
.fd-note { background: #fff; border-radius: 16px; padding: 13px 16px; font-size: 14px; color: #6f7a6e; margin-bottom: 16px; box-shadow: 0 3px 12px rgba(79,111,87,.06); }
.fd-note b { color: #33433a; }

/* stepper w szufladach */
.stepper-lbl { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; text-align: center; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 20px; }
.st-minus, .st-plus { width: 54px; height: 54px; border-radius: 50%; font-size: 26px; font-weight: 700; }
.st-minus { background: #fff; border: 1px solid var(--border-2); color: var(--accent); }
.st-plus { background: var(--accent); border: none; color: #fff; }
.st-val { text-align: center; min-width: 120px; }
.st-val .num { font-size: 46px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.st-val .unit { font-size: 18px; font-weight: 700; color: var(--muted); }
.segmented.seg-3 .seg { padding: 12px 4px; }

/* ===================== TRYB JASNY (Przewijanie, błękit) ===================== */
body.t-change {
  --bg: #f2f8fb; --surface: #ffffff; --surface-2: #ffffff; --inset: #eaf3f6;
  --border: #e0edf1; --border-2: #dbe7ec;
  --text: #3c5460; --muted: #6f8a96; --muted-2: #7d97a2;
  --accent: #5aa9bb; --accent-2: #4a93a3; --on-accent: #ffffff;
}
body.t-change .nawigacja { background: rgba(255,255,255,.9); border-top: 1px solid rgba(0,0,0,.05); }
body.t-change .sheet .grip { background: #dbe7ec; }
body.t-change .hist-row { border-bottom-color: #eaf1f4; }
body.t-change .hist-card, body.t-change .row-link, body.t-change .sheet { box-shadow: 0 4px 16px rgba(60,84,96,.06); }
body.t-change .scr-back { box-shadow: 0 3px 10px rgba(60,84,96,.08); }

/* ===================== PRZEWIJANIE (jasny błękit) ===================== */
.cd-hero { position: relative; height: 240px; overflow: hidden; margin: calc(-10px - env(safe-area-inset-top)) -20px 6px; }
.cd-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.cd-hero .ov { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(242,248,251,0) 45%, rgba(242,248,251,.6) 74%, #f2f8fb 100%); }
.cd-hero .cap { position: absolute; left: 20px; right: 20px; bottom: 14px; }
.cd-hero .cap h2 { font-size: 32px; font-weight: 800; letter-spacing: -.5px; margin: 0; color: #3c5460; }

.cd-top { background: #fff; border-radius: 22px; padding: 18px; margin-bottom: 18px; box-shadow: 0 4px 18px rgba(60,84,96,.07); display: flex; align-items: center; justify-content: space-between; }
.cd-top .t { font-size: 14.5px; font-weight: 700; color: #3c5460; }
.cd-top .s { font-size: 13px; color: #6f8a96; margin-top: 3px; }
.cd-top .ic { width: 46px; height: 46px; border-radius: 14px; background: #e4f2f6; display: flex; align-items: center; justify-content: center; color: #4a93a3; flex: none; }

.cd-sec-title { font-size: 17px; font-weight: 700; color: #3c5460; margin-bottom: 13px; }
.cd-adds { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.cd-add { border: none; border-radius: 22px; background: #fff; padding: 20px; box-shadow: 0 4px 16px rgba(60,84,96,.07); display: flex; align-items: center; gap: 16px; text-align: left; }
.cd-add .ic { width: 54px; height: 54px; border-radius: 17px; display: flex; align-items: center; justify-content: center; flex: none; }
.cd-add .info { flex: 1; }
.cd-add .info .n { font-size: 18px; font-weight: 800; color: #3c5460; }
.cd-add .info .d { font-size: 13px; color: #6f8a96; margin-top: 2px; }
.cd-add .plus { color: #a9c4ce; flex: none; display: flex; }
.cd-add.wet .ic { background: #dff0f5; color: #5aa9bb; }
.cd-add.dirty .ic { background: #f3ecdf; color: #c39a5a; }
.cd-add.both .ic { background: #ece4f0; color: #9a7ab5; }

.cd-details { width: 100%; border: 1px solid #d3e6ec; background: transparent; color: #4a93a3; font-weight: 700; font-size: 14px; padding: 13px; border-radius: 15px; margin-bottom: 22px; }

.cd-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.cd-cell { background: #fff; border-radius: 18px; padding: 15px; box-shadow: 0 3px 12px rgba(60,84,96,.06); }
.cd-cell .k { font-size: 12px; color: #7d97a2; }
.cd-cell .v { font-size: 22px; font-weight: 800; color: #3c5460; margin-top: 3px; }

.cd-monitor { background: #eaf4f7; border-radius: 20px; padding: 16px 18px; margin-bottom: 16px; display: flex; gap: 12px; }
.cd-monitor .ic { width: 30px; height: 30px; border-radius: 10px; background: #d5ebf0; display: flex; align-items: center; justify-content: center; flex: none; color: #4a93a3; }
.cd-monitor .tx { font-size: 13.5px; color: #3c5460; line-height: 1.5; }

.cd-hist-ic { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.cd-hist-ic .dot { width: 12px; height: 12px; border-radius: 50%; }

/* ===================== WSPÓLNE: profil/ustawienia (ciepły jasny) ===================== */
body.t-prof { --bg: #f5f4ef; --surface: #fff; --surface-2: #fff; --inset: #f5f4ef; --border: #f0ede5; --border-2: #ece8de; --text: #33312c; --muted: #8a857c; --muted-2: #a39e93; --accent: #6f9277; --accent-2: #5a7d62; --on-accent: #fff; }
body.t-prof .nawigacja { display: none; }
body.t-prof .scr-back { box-shadow: 0 3px 10px rgba(0,0,0,.05); }
.scr-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }

.prof-hero { display: flex; flex-direction: column; align-items: center; margin-bottom: 26px; }
.prof-av { width: 88px; height: 88px; border-radius: 50%; background: linear-gradient(140deg, #7aa5ff, #9d7aff); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 34px; font-weight: 800; box-shadow: 0 8px 22px rgba(122,165,255,.35); }
.prof-name { font-size: 24px; font-weight: 800; margin-top: 14px; }
.prof-age { font-size: 14px; color: var(--muted); margin-top: 2px; }
.list-card { background: var(--surface); border-radius: 22px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(0,0,0,.04); }
.list-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); width: 100%; background: none; text-align: left; border-left: none; border-right: none; border-top: none; }
.list-row:last-child { border-bottom: none; }
.list-row .lk { font-size: 14.5px; color: var(--muted); }
.list-row .lv { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.list-row .lv .chev { color: var(--accent); display: flex; }
.set-group-title { font-size: 12.5px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.mini-toggle { display: flex; gap: 4px; background: var(--inset); border-radius: 11px; padding: 3px; }
.mini-toggle span { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 8px; }
.mini-toggle span.on { color: #fff; background: var(--accent); font-weight: 700; }
.switch { width: 46px; height: 27px; border-radius: 14px; background: var(--accent); position: relative; flex: none; }
.switch .knob { position: absolute; top: 3px; right: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; }
.disc-card { background: #eef3ee; border-radius: 18px; padding: 16px; font-size: 12.5px; color: #5d6b60; line-height: 1.6; margin-bottom: 16px; }
.logout-btn { width: 100%; border: none; background: var(--surface); border-radius: 18px; padding: 16px; font-size: 15px; font-weight: 700; color: #c0392b; box-shadow: 0 4px 16px rgba(0,0,0,.04); }

/* pełna oś czasu (ciemna) */
.tl-legend { display: flex; gap: 14px; margin: 16px 0 6px; }
.tl-legend span { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tl-legend i { width: 9px; height: 9px; border-radius: 50%; }
.tl-full { position: relative; padding: 18px 0 0 4px; }
.tl-full .line { position: absolute; left: 62px; top: 24px; bottom: 14px; width: 2px; background: #28324a; }
.tl-ev { display: flex; gap: 18px; padding-bottom: 18px; position: relative; }
.tl-ev .clock { width: 42px; flex: none; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 14px; font-variant-numeric: tabular-nums; }
.tl-ev .node { flex: none; display: flex; flex-direction: column; align-items: center; padding-top: 16px; z-index: 1; }
.tl-ev .node span { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--bg); }
.tl-ev .card { flex: 1; background: var(--surface); border-radius: 18px; padding: 14px 16px; }
.tl-ev .card .t { font-size: 14.5px; font-weight: 700; }
.tl-ev .card .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* modal usuwania */
.confirm-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(8,11,20,.6); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 30px; animation: emFade .2s ease; }
.confirm { background: #1f283c; border-radius: 26px; padding: 26px 22px; width: 100%; max-width: 300px; text-align: center; }
.confirm-ic { width: 54px; height: 54px; border-radius: 50%; background: rgba(214,123,123,.16); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.confirm-t { font-size: 18px; font-weight: 800; color: #f4f1ea; }
.confirm-s { font-size: 13.5px; color: #97a1b8; margin-top: 6px; line-height: 1.5; }
.confirm-acts { display: flex; gap: 10px; margin-top: 22px; }
.confirm-cancel { flex: 1; border: 1px solid #2c3a5c; background: transparent; color: #c3cbdc; border-radius: 14px; padding: 13px; font-weight: 700; font-size: 14px; }
.confirm-del { flex: 1; border: none; background: #d88a8a; color: #2a1414; border-radius: 14px; padding: 13px; font-weight: 700; font-size: 14px; }
