/* Mealquo – system projektowy (15.8)
   Tokeny: kolory (jasny/ciemny), promienie, cienie, odstępy, typografia, ruch.
   Nazwy klas są te same co w app.js; wygląd zmienia się tylko tutaj. */

:root {
  color-scheme: light;
  --bg: #f4f1ec;
  --bg-glow: #fff9f1;
  --surface: #ffffff;
  --surface-2: #f6f3ee;
  --surface-3: #ede9e2;
  --ink: #141a17;
  --ink-2: #3b4541;
  --muted: #76807b;
  --line: rgba(20, 26, 23, 0.08);
  --line-strong: rgba(20, 26, 23, 0.14);
  --brand: #1f4d3f;
  --brand-2: #2e6b58;
  --brand-ink: #f3f7f4;
  --brand-soft: #e4efe8;
  --brand-text: #1f4d3f;
  --accent: #d8603d;
  --accent-soft: #fbe9e2;
  --gold: #d9a520;
  --protein: #d8603d;
  --carbs: #d9a520;
  --fat: #2f8f88;
  --good: #2e7d5b;
  --good-soft: #e3f1e9;
  --danger: #b3261e;
  --nav-bg: rgba(20, 38, 33, 0.94);
  --nav-ink: #c6d3cd;
  --shadow-sm: 0 1px 2px rgba(20, 26, 23, 0.04), 0 6px 18px -8px rgba(20, 26, 23, 0.12);
  --shadow-md: 0 2px 4px rgba(20, 26, 23, 0.04), 0 16px 40px -16px rgba(20, 26, 23, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(20, 26, 23, 0.32);
  --shadow-brand: 0 14px 30px -12px rgba(31, 77, 63, 0.55);
  --r-s: 12px;
  --r-m: 18px;
  --r-l: 24px;
  --r-xl: 30px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --fast: 160ms;
  --slow: 420ms;
  --font: -apple-system, "SF Pro Text", "SF Pro Display", "Segoe UI Variable", "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1412;
    --bg-glow: #15201b;
    --surface: #182019;
    --surface-2: #1f2924;
    --surface-3: #27332d;
    --ink: #eef0ec;
    --ink-2: #cbd3ce;
    --muted: #8f9a94;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --brand: #2a6a56;
    --brand-2: #3d8a71;
    --brand-ink: #f0f6f2;
    --brand-soft: #1d3a31;
    --brand-text: #8fd1b3;
    --accent: #f08562;
    --accent-soft: #3a2620;
    --gold: #e6b640;
    --protein: #f08562;
    --carbs: #e6b640;
    --fat: #4fb3ab;
    --good: #6cc49a;
    --good-soft: #1d3a31;
    --danger: #ff8a80;
    --nav-bg: rgba(24, 32, 27, 0.96);
    --nav-ink: #9fb0a7;
    --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -12px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
    --shadow-brand: 0 14px 30px -12px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1412;
  --bg-glow: #15201b;
  --surface: #182019;
  --surface-2: #1f2924;
  --surface-3: #27332d;
  --ink: #eef0ec;
  --ink-2: #cbd3ce;
  --muted: #8f9a94;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --brand: #2a6a56;
  --brand-2: #3d8a71;
  --brand-ink: #f0f6f2;
  --brand-soft: #1d3a31;
  --brand-text: #8fd1b3;
  --accent: #f08562;
  --accent-soft: #3a2620;
  --gold: #e6b640;
  --protein: #f08562;
  --carbs: #e6b640;
  --fat: #4fb3ab;
  --good: #6cc49a;
  --good-soft: #1d3a31;
  --danger: #ff8a80;
  --nav-bg: rgba(24, 32, 27, 0.96);
  --nav-ink: #9fb0a7;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-brand: 0 14px 30px -12px rgba(0, 0, 0, 0.6);
}

/* --- podstawa --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
#phone {
  max-width: 430px;
  min-height: 100%;
  margin: 0 auto;
  background: radial-gradient(120% 50% at 50% -8%, var(--bg-glow) 0%, transparent 60%), var(--bg);
  position: relative;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
#app { padding: 0 0 120px; min-height: 100dvh; }
.status-bar { display: none; }
h1 { font-size: 28px; line-height: 1.12; letter-spacing: -0.035em; font-weight: 760; }
h2 { font-size: 18px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 720; }
p { line-height: 1.45; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
small { font-weight: 600; }
a { color: var(--brand-text); text-decoration: underline; text-underline-offset: 2px; }
button { font-family: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, .chip:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.ic { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
.with-ic { display: inline-flex; align-items: center; gap: 8px; }
.danger { color: var(--danger) !important; }

.screen {
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px calc(128px + env(safe-area-inset-bottom, 0px));
  animation: rise var(--slow) var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.screen > .card, .screen > .sec, .screen > .missions, .screen > .ideas, .screen > .tip, .screen > .date-ask, .screen > .hero { animation: rise 480ms var(--ease) both; }
.screen > *:nth-child(2) { animation-delay: 40ms; }
.screen > *:nth-child(3) { animation-delay: 80ms; }
.screen > *:nth-child(4) { animation-delay: 120ms; }
.screen > *:nth-child(5) { animation-delay: 160ms; }
.screen > *:nth-child(6) { animation-delay: 200ms; }
.screen > *:nth-child(n+7) { animation-delay: 240ms; }

/* --- nagłówki ekranów --- */
.brand-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 760; letter-spacing: -0.03em; font-size: 20px; }
.logo-img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; box-shadow: var(--shadow-sm); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sec { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 22px 2px 10px; }
.sec h2 { font-size: 17px; }
.sec .muted { font-size: 13px; font-weight: 600; }
.section-title { font-size: 17px; font-weight: 720; letter-spacing: -0.02em; margin: 22px 2px 10px; }
.link {
  display: inline-flex; align-items: center; gap: 2px;
  border: 0; background: transparent; padding: 6px 0 6px 8px; min-height: 36px;
  color: var(--brand-text); font-weight: 700; font-size: 13px; letter-spacing: -0.01em;
}
.link .ic { width: 16px; height: 16px; }
.streak {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 11px 7px 8px; font-size: 14px; font-weight: 720;
  box-shadow: var(--shadow-sm); color: var(--ink); min-height: 36px;
}
.streak .ic { width: 18px; height: 18px; color: var(--accent); }

/* --- start --- */
.home-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0 14px; }
.home-hello h1 { margin-top: 2px; font-size: 24px; }
.home-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.lvl-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; position: relative; display: grid; place-items: center;
  background: conic-gradient(var(--gold) var(--p), var(--surface-3) 0);
  box-shadow: var(--shadow-sm);
}
.lvl-btn::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.lvl-btn b { position: relative; font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; }

.dates { display: flex; justify-content: space-between; gap: 2px; padding: 0 0 14px; }
.date-pill {
  flex: 1; min-width: 0; background: transparent; border: 0; min-height: 60px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.date-pill span.n {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: 0; text-transform: none;
  background: transparent; border: 1.5px solid transparent; transition: background var(--fast), color var(--fast), transform var(--fast);
}
.date-pill.logged span.n { border-color: var(--line-strong); }
.date-pill.on span.n { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); box-shadow: var(--shadow-brand); }
.date-pill.on { color: var(--ink); }

.card {
  background: var(--surface);
  border-radius: var(--r-l);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.card + .card { margin-top: 12px; }
.card .between + .between { padding-top: 8px; border-top: 1px solid var(--line); }
.card .between > span:first-child { color: var(--muted); font-size: 14px; }
.card.list { padding: 4px 18px; }

.hero { padding: 20px 20px 18px; border: 0; background: var(--surface); box-shadow: var(--shadow-md); }
.hero-top { display: grid; grid-template-columns: 1fr 112px; gap: 12px; align-items: center; }
.hero-left { min-width: 0; }
.hero-num { font-size: 56px; font-weight: 800; letter-spacing: -0.05em; line-height: 0.95; margin-top: 6px; display: flex; align-items: baseline; gap: 6px; }
.hero-num small { font-size: 15px; font-weight: 650; color: var(--muted); letter-spacing: 0; }
.hero.over .hero-num { color: var(--accent); }
.hero-sub { margin-top: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  padding: 6px 10px 6px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text);
  font-size: 12px; font-weight: 700;
}
.pill .ic { width: 15px; height: 15px; }
.ring-wrap { position: relative; width: 112px; height: 112px; }
.ring-svg { width: 112px; height: 112px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--brand-2); stroke-width: 10; stroke-linecap: round; animation: ringIn 1.1s var(--ease) both; transition: stroke-dashoffset 0.6s var(--ease); }
.hero.over .ring-fg { stroke: var(--accent); }
@keyframes ringIn { from { stroke-dashoffset: 326.7; } }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; }
.ring-center b { font-size: 22px; font-weight: 800; letter-spacing: -0.04em; }
.ring-center small { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 1px; }
.macro-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mbar { min-width: 0; }
.mbar-label { display: block; font-size: 12px; color: var(--muted); font-weight: 650; }
.mbar-val { display: block; margin-top: 2px; color: var(--ink); font-size: 16px; font-weight: 760; letter-spacing: -0.02em; white-space: nowrap; }
.mbar-val small { color: var(--muted); font-weight: 600; font-size: 11px; }
.mbar-track { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.mbar-track i { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: grow 0.9s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* stare klasy karty kalorii (ekrany szczegółów) */
.kcal-card { display: grid; grid-template-columns: 1fr 104px; gap: 8px; align-items: center; }
.kcal-num { font-size: 44px; font-weight: 800; letter-spacing: -0.05em; line-height: 0.95; }
.kcal-sub { margin-top: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ring { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) var(--p), var(--surface-3) 0); }
.ring span { width: 74px; height: 74px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 22px; }
.macros { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.macro { text-align: center; padding: 14px 6px 12px; border-radius: var(--r-m); }
.macro .val { font-weight: 720; font-size: 13px; margin-top: 2px; }
.mring { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; }
.mring i { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); display: block; }

/* --- misje --- */
.missions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mission {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; min-height: 96px;
  padding: 12px 12px 11px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface); color: var(--ink); text-align: left; box-shadow: var(--shadow-sm);
  transition: transform var(--fast) var(--ease), background var(--fast);
}
.mission b { font-size: 12.5px; line-height: 1.25; letter-spacing: -0.01em; max-width: 100%; }
.mission small { font-size: 11px; color: var(--muted); font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mission .m-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.mission .m-ico .ic { width: 18px; height: 18px; }
.mission.done { border-color: transparent; background: var(--good-soft); }
.mission.done .m-ico { background: var(--good); color: #fff; }
.mission.done small { color: var(--good); font-weight: 700; }
.mission.pending { border-style: dashed; border-color: var(--line-strong); padding: 12px 12px 11px; } /* .pending (lista „Po zjedzeniu”) zerowała boczne odstępy */

/* --- lista posiłków --- */
.meal {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: inherit; font: inherit; text-align: left;
}
.meal:last-child { border-bottom: 0; }
.thumb { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; background: var(--surface-3); }
.thumb-ph { display: grid; place-items: center; color: var(--muted); }
.thumb-ph .ic { width: 24px; height: 24px; }
.meal h3 { font-size: 15px; font-weight: 680; letter-spacing: -0.015em; line-height: 1.25; }
.meal p { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.35; font-weight: 600; }
.meal b { font-size: 15px; letter-spacing: -0.02em; }
.macros-line { font-weight: 600; }

/* --- puste stany, ładowanie --- */
.empty { text-align: center; padding: 28px 20px 22px; }
.empty-art { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.empty-art .ic { width: 30px; height: 30px; }
.empty b { display: block; font-size: 17px; letter-spacing: -0.02em; }
.empty p { color: var(--muted); margin: 8px auto 16px; max-width: 290px; }
.empty .primary { display: inline-flex; width: auto; padding: 0 20px; gap: 8px; }
.empty .primary .ic { width: 20px; height: 20px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--brand-2); animation: spin 0.9s linear infinite; flex: none; }
.spinner.big { width: 44px; height: 44px; border-width: 4px; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy-card { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.busy-card > div { flex: 1; min-width: 0; }
.wait-card { text-align: center; padding: 30px 20px 26px; margin-top: 14px; }
.wait-card h2 { margin-top: 14px; }
.wait-card .muted { margin-top: 6px; min-height: 22px; }
.skeleton { margin-top: 18px; display: grid; gap: 10px; }
.skeleton i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pulse { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); margin: 0 auto; animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { transform: scale(1.35); opacity: 0.55; } }
.near-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.near-bar span { display: block; height: 100%; width: 0; background: var(--brand-2); border-radius: 99px; transition: width 0.45s ease; }
.bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* --- trener, podpowiedzi --- */
.tip {
  margin-top: 14px; background: var(--brand); color: var(--brand-ink);
  border-radius: var(--r-l); padding: 16px 18px; font-size: 15px; line-height: 1.5;
  box-shadow: var(--shadow-brand);
}
.tip small { display: flex; align-items: center; gap: 6px; opacity: 0.75; margin-bottom: 6px; letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; font-weight: 700; }
.tip small .ic { width: 15px; height: 15px; }
.tip.coach { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); }
.ideas { display: flex; flex-direction: column; gap: 8px; }
.idea {
  text-align: left; width: 100%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  border-radius: var(--r-m); padding: 12px 14px; box-shadow: var(--shadow-sm);
  transition: transform var(--fast) var(--ease);
}
.idea > b { display: block; }
.idea > span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.idea.dish { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; overflow: hidden; }
.idea.dish > .thumb-slot { width: 60px; height: 60px; border-radius: 14px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; }
.idea.dish > .thumb-slot .thumb, .idea.dish > .thumb-slot img { width: 60px; height: 60px; max-width: 60px; object-fit: cover; border-radius: 14px; display: block; }
.idea.dish > .dish-copy { min-width: 0; margin: 0; color: inherit; display: block; }
.idea.dish .dish-copy b { display: block; font-size: 15px; line-height: 1.25; color: var(--ink); letter-spacing: -0.01em; }
.idea.dish .dish-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; font-weight: 600; }
.idea.dish > .dish-kcal { font-size: 17px; font-weight: 760; color: var(--ink); margin: 0; letter-spacing: -0.02em; }
.food-ph { width: 60px; height: 60px; background: var(--surface-3); }
.recipe-list { margin: 8px 0 0; padding-left: 18px; }
.recipe-list li { margin: 6px 0; line-height: 1.4; }
.why { margin: 10px 0 0; color: var(--ink-2); background: var(--surface-2); border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.pending { padding: 10px 0; border-top: 1px solid var(--line); }
.pending:first-child { border-top: 0; }
.pending .row { margin-top: 8px; }
.date-ask { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.date-ask p { font-weight: 720; font-size: 16px; line-height: 1.3; margin-bottom: 10px; letter-spacing: -0.015em; }
.date-ask .row { display: flex; flex-wrap: wrap; gap: 8px; }
.date-ask .chip { flex: 1 1 30%; min-height: 46px; }
.shot-stats { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; box-shadow: var(--shadow-sm); }
.shot-stats b { display: block; font-size: 22px; letter-spacing: -0.03em; }
.shot-stats span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.nutri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.nutri div { background: var(--surface-2); border-radius: 16px; padding: 12px 8px; text-align: center; }
.nutri b { display: block; font-size: 17px; letter-spacing: -0.02em; }
.nutri span { color: var(--muted); font-size: 12px; font-weight: 600; }
.side { margin-top: 10px; font-weight: 700; }
.side.plus { color: var(--good); }
.side.minus { color: var(--accent); }

/* --- nawigacja --- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom, 0px)); width: min(430px, calc(100% - 20px));
  background: var(--nav-bg); color: #fff;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-radius: 30px; display: flex; justify-content: space-around; align-items: center;
  height: 76px; padding: 0 6px; z-index: 20;
  box-shadow: var(--shadow-lg);
}
.nav button {
  background: none; border: 0; color: var(--nav-ink); font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 60px; height: 60px; justify-content: center; border-radius: 18px;
  transition: color var(--fast), transform var(--fast) var(--ease);
}
.nav button .ic { width: 24px; height: 24px; }
.nav button.on { color: #fff; }
.nav button.on .ic { stroke-width: 2.2; }
.nav .plus {
  width: 58px; height: 58px; min-width: 58px; border-radius: 50%;
  background: linear-gradient(145deg, #fff 0%, #ecf2ee 100%); color: var(--brand);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.5); margin-top: -18px;
  transition: transform 180ms var(--ease);
  position: relative;
}
.nav .plus .ic { width: 28px; height: 28px; stroke-width: 2.4; }
.nav .plus::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid rgba(216, 96, 61, 0.25); border-top-color: var(--accent); opacity: 0; pointer-events: none; }
.nav .plus.holding { transform: scale(0.92); }
.nav .plus.holding::after { opacity: 1; animation: holdspin 0.46s linear forwards; }
@keyframes holdspin { from { transform: rotate(0deg); } to { transform: rotate(300deg); border-color: var(--accent); } }

/* --- przyciski, chipy, pola --- */
button.primary, button.ghost, button.soft, .chip { font: inherit; cursor: pointer; border: 0; }
.primary {
  width: 100%; min-height: 54px; border-radius: var(--r-m);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); color: var(--brand-ink);
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em; box-shadow: var(--shadow-brand);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.primary:disabled { opacity: 0.6; box-shadow: none; }
.ghost { width: 100%; min-height: 50px; border-radius: var(--r-m); background: transparent; color: var(--ink); font-weight: 650; }
.soft {
  background: var(--surface-2); color: var(--ink); border-radius: var(--r-m);
  padding: 13px 16px; font-weight: 680; min-height: 48px; border: 1px solid var(--line);
}
.soft.wide { display: block; width: 100%; min-height: 54px; font-size: 16px; }
.chip {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px;
  font-size: 13px; font-weight: 650; min-height: 38px; color: var(--ink);
}
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
input, select, textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: var(--r-m); padding: 14px 16px; font: inherit; color: inherit; min-height: 50px;
  transition: border-color var(--fast), box-shadow var(--fast);
}
input:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--brand-soft); outline: none; }
input::placeholder { color: var(--muted); }
textarea { min-height: 76px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 2px 6px; font-weight: 650; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goal-set { margin-top: 12px; }
.goal-preview { margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.goal-preview b { display: block; font-size: 28px; letter-spacing: -0.04em; }
.goal-preview p { margin: 6px 0 0; color: var(--ink-2); line-height: 1.35; }

/* --- arkusz dodawania --- */
.sheet { position: fixed; inset: 0; background: rgba(10, 14, 12, 0.5); display: flex; align-items: flex-end; z-index: 30; animation: fade 200ms ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet .panel {
  width: min(430px, 100%); margin: 0 auto;
  background: var(--bg); border-radius: 30px 30px 0 0;
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom, 0px)); max-height: 88%; overflow: auto;
  animation: sheetIn 380ms var(--ease) both; box-shadow: var(--shadow-lg);
}
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0.6; } }
.grab { width: 40px; height: 4px; background: var(--line-strong); border-radius: 4px; margin: 6px auto 14px; }
.sheet h2 { font-size: 22px; margin-bottom: 12px; }
.act-list { display: grid; gap: 8px; margin-top: 4px; }
.act-row {
  display: grid; grid-template-columns: 44px 1fr 20px; gap: 12px; align-items: center; text-align: left;
  width: 100%; min-height: 70px; padding: 12px 12px 12px 14px; border-radius: var(--r-m);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.act-row > .ic:first-child { width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); }
.act-row > .ic:last-child { color: var(--muted); width: 20px; height: 20px; }
.act-row b { display: block; font-size: 16px; letter-spacing: -0.01em; }
.act-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.act-row.main { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-brand); }
.act-row.main > .ic:first-child { background: rgba(255, 255, 255, 0.14); color: #fff; }
.act-row.main small, .act-row.main > .ic:last-child { color: rgba(255, 255, 255, 0.7); }
.sheet .hint { margin: 14px 4px 0; font-size: 13px; }

/* --- propozycje i edycja porcji --- */
.item-row { display: grid; grid-template-columns: 1fr auto 36px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item-row input { padding: 8px 10px; width: 58px; text-align: center; min-height: 40px; }
.step { display: flex; align-items: center; gap: 4px; }
.step button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface-2); font-size: 20px; font-weight: 650; color: var(--ink); }
.shot { position: relative; }
.shot-mic {
  position: absolute; left: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 16px 0 8px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--ink); font-weight: 720; font-size: 15px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.shot-mic.solo { position: static; width: 100%; justify-content: center; margin-top: 14px; min-height: 54px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.mic-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); position: relative; animation: pulse 1.4s ease-in-out infinite; }
.mic-dot::before { content: ""; position: absolute; left: 13px; top: 8px; width: 8px; height: 12px; border: 2px solid #fff; border-radius: 8px; }
.mic-dot::after { content: ""; position: absolute; left: 11px; top: 18px; width: 12px; height: 7px; border: 2px solid #fff; border-top: 0; border-radius: 0 0 8px 8px; }
.preview { width: 100%; height: 210px; object-fit: cover; border-radius: var(--r-l); background: var(--surface-3); }
.preview.big { height: 42vh; min-height: 260px; border-radius: 28px; box-shadow: var(--shadow-md); }
.shot .preview.big { display: block; }
.note-row { display: flex; gap: 8px; margin-top: 10px; }
.note-row input { flex: 1; }
.note-row button { border: 0; border-radius: 14px; padding: 0 16px; min-height: 50px; background: var(--brand); color: var(--brand-ink); font-weight: 720; }
.shot-said { margin: 10px 2px 0; font-size: 15px; font-weight: 650; line-height: 1.35; }
.shot-said .why { margin: 6px 0 0; font-weight: 550; }
.prop { padding: 12px 0; border-bottom: 1px solid var(--line); }
.prop:last-of-type { border-bottom: 0; }
.prop .macros-line { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.prop .between b { font-size: 15px; letter-spacing: -0.01em; }
.unit { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.unit button { border: 0; background: transparent; border-radius: 9px; padding: 6px 12px; min-height: 34px; font-weight: 700; color: var(--ink); }
.unit button.on { background: var(--brand); color: var(--brand-ink); }
.amount { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.amount .step { margin-left: auto; }
.amount .step input { width: 64px; text-align: center; min-height: 40px; padding: 6px; }
.amount-line { margin: 6px 0 0; font-weight: 720; color: var(--ink); }
.more-wrap { text-align: center; }
.more-plus { width: 120px; height: 120px; border-radius: 50%; margin: 22px auto 0; background: var(--surface); color: var(--brand-text); font-size: 64px; line-height: 110px; box-shadow: var(--shadow-md); border: 1px solid var(--line); }

/* --- ruch --- */
.week-bars { display: flex; gap: 8px; align-items: flex-end; height: 132px; margin-top: 16px; }
.wbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.wbar .col { width: 100%; height: 100px; background: var(--surface-2); border-radius: 10px; display: flex; align-items: flex-end; overflow: hidden; }
.wbar .col i { display: block; width: 100%; background: var(--brand-2); border-radius: 10px 10px 0 0; animation: grow 0.8s var(--ease) both; transform-origin: bottom; }
.wbar.on { color: var(--ink); }
.wbar.on .col i { background: var(--accent); }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; align-items: stretch; }
.ex-tile {
  width: 100%; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: flex-start;
  text-align: left; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-m); padding: 14px 12px 13px; box-shadow: var(--shadow-sm);
}
.ex-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; margin-bottom: 8px; }
.ex-tile b { display: block; font-size: 15px; }
.ex-tile > span:last-child { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.ex-tile.on { border-color: var(--brand-2); background: var(--brand-soft); }
.type-list { display: flex; flex-direction: column; gap: 8px; }
.type-card { text-align: left; background: var(--surface-2); border-radius: 16px; padding: 12px 14px; border: 1px solid var(--line); }
.type-card b { display: block; font-size: 15px; }
.type-card span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.type-card.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.type-card.on span { color: rgba(255, 255, 255, 0.75); }
.ex-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow-sm); }
.ex-card b { display: block; font-size: 13px; }
.ex-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.ex-card.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.ex-card.on span { color: rgba(255, 255, 255, 0.75); }
.exsug { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.exsug button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 12px; min-height: 38px; font-weight: 650; font-size: 13px; }
.exsug button span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.ask { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.ask p { font-weight: 720; margin-bottom: 8px; }
.ask .exsug button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.fav-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.fav-row { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-sm); min-height: 54px; }
.fav-row b { display: block; }
.fav-row small { color: var(--muted); font-size: 12px; }
.fav-row.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.fav-row.on small { color: rgba(255, 255, 255, 0.75); }

/* --- ruch i dotyk --- */
button, .chip, .ex-card, .fav-row, .date-pill, .mission, .idea, .act-row, .meal {
  transition: transform 180ms var(--ease), background 200ms ease, color 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
button:active, .ex-card:active, .fav-row:active, .idea:active, .mission:active, .act-row:active, .meal:active { transform: scale(0.975); }
.fav-row.on { animation: settle 0.42s var(--ease); }
@keyframes settle { 0% { transform: scale(0.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
.saved-pop {
  position: fixed; left: 50%; bottom: 110px; z-index: 40; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); border-radius: 999px; padding: 12px 18px;
  font-weight: 700; letter-spacing: -0.01em; font-size: 14px; box-shadow: var(--shadow-lg);
  animation: floatBye 0.9s var(--ease) forwards; pointer-events: none; max-width: calc(100% - 40px); text-align: center;
}
@keyframes floatBye {
  0% { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.94); }
  22% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ring-fg { animation: none !important; }
}

/* --- profil i ustawienia --- */
.lang-card { margin-top: 12px; }
.lang-pick { display: grid; gap: 8px; margin-top: 12px; }
.lang-pick .flag {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 680; text-align: left; color: var(--ink);
}
.lang-pick .flag span { font-size: 20px; }
.lang-pick .flag.on { border-color: var(--brand-2); background: var(--brand-soft); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-row b { display: block; font-size: 15px; }
.set-row .muted { margin-top: 3px; font-size: 13px; line-height: 1.35; }
.set-end { display: flex; align-items: center; gap: 10px; flex: none; }
.set-time { border: 0; background: var(--surface-2); color: var(--ink); border-radius: 12px; padding: 8px 10px; min-height: 40px; width: auto; font: inherit; font-weight: 650; }
.switch { width: 52px; height: 32px; border: 0; border-radius: 99px; background: var(--surface-3); padding: 3px; flex: none; position: relative; transition: background 200ms ease; }
.switch i { display: block; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s var(--ease); }
.switch.on { background: var(--brand-2); }
.switch.on i { transform: translateX(20px); }
.version { margin: 28px 0 0; text-align: center; font-size: 12px; }
.journey-card { display: grid; grid-template-columns: 46px 1fr 24px; align-items: center; gap: 12px; width: 100%; margin-top: 12px; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.jc-lvl { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-size: 18px; font-weight: 800; }
.jc-copy b { font-size: 16px; letter-spacing: -0.01em; }
.jc-copy .muted { margin-top: 2px; font-size: 13px; }
.journey-card .chev { color: var(--muted); display: grid; place-items: center; }

/* --- słuchanie --- */
.ears { position: fixed; inset: 0; z-index: 40; background: rgba(10, 14, 12, 0.35); display: grid; place-items: end center; padding-bottom: 120px; animation: fade 200ms ease both; }
.ears-card { background: var(--surface); border-radius: 28px; padding: 22px 22px 16px; width: min(320px, calc(100% - 48px)); text-align: center; box-shadow: var(--shadow-lg); }
.ears-dot { width: 18px; height: 18px; margin: 0 auto 12px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.ears-card b { display: block; font-size: 18px; margin-bottom: 14px; }
.ears-card button { width: 100%; min-height: 46px; border: 0; border-radius: 16px; background: var(--surface-2); font-weight: 680; color: var(--ink); }

/* --- pierwsze uruchomienie --- */
.setup { padding: 28px 8px 12px; animation: setupIn 0.48s var(--ease); }
@keyframes setupIn { from { opacity: 0; transform: translateY(16px) scale(0.985); } to { opacity: 1; transform: none; } }
.setup h1 { font-size: 32px; }
.setup-sub { margin: 8px 0 22px; font-size: 16px; }
.setup-dots { display: flex; gap: 8px; margin-bottom: 22px; }
.setup-dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--surface-3); transition: width 0.3s ease, background 0.3s ease; }
.setup-dots i.on { width: 22px; background: var(--brand); }
.os-list { background: var(--surface); border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.os-row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); text-align: left; animation: rise 0.42s var(--ease) both; min-height: 64px; }
.os-row:last-child { border-bottom: 0; }
.os-row:nth-child(2) { animation-delay: 0.05s; }
.os-row:nth-child(3) { animation-delay: 0.1s; }
.os-row.on { background: var(--brand-soft); }
.os-flag { font-size: 28px; width: 36px; }
.os-copy { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.os-copy b { font-size: 18px; letter-spacing: -0.02em; }
.os-copy small { color: var(--muted); font-size: 13px; }
.os-tick { width: 22px; color: var(--good); font-size: 18px; font-weight: 720; }
.setup-go { margin-top: 28px; }
.setup-actions { display: grid; grid-template-columns: 110px 1fr; gap: 10px; margin-top: 22px; }
.wheels { position: relative; display: grid; grid-template-columns: 72px 1fr 92px; gap: 8px; margin-top: 8px; }
.wheels.two { grid-template-columns: 1fr 1fr; }
.wheel { position: relative; }
.wheel-label { text-align: center; color: var(--muted); font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.wheel-lens { pointer-events: none; position: absolute; left: 0; right: 0; top: 92px; height: 46px; border-radius: 12px; background: var(--brand-soft); z-index: 1; }
.wheels.two .wheel-lens { top: 92px; }
.wheel-col { height: 230px; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; position: relative; z-index: 2; }
.wheel-col::-webkit-scrollbar { display: none; }
.wheel-pad { height: 92px; }
.wheel-item { height: 46px; scroll-snap-align: center; display: grid; place-items: center; font-size: 20px; font-weight: 650; color: var(--muted); letter-spacing: -0.03em; }
.wheel-item.on { color: var(--ink); font-size: 26px; font-weight: 750; }
.age-msg { margin: 14px 2px 0; font-size: 15px; line-height: 1.4; color: var(--ink); background: var(--accent-soft); border-radius: 14px; padding: 10px 12px; }

/* --- rozmowa o celu --- */
#goaltalk.screen {
  position: fixed; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(430px, 100%); z-index: 30; margin: 0; min-height: 0;
  display: flex; flex-direction: column; justify-content: safe center;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 22px calc(28px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(90% 50% at 50% 42%, var(--bg-glow) 0%, transparent 70%), var(--bg);
  overflow-y: auto; animation: none;
}
#goaltalk.screen > * { animation: goalIn 0.52s var(--ease) both; }
#goaltalk.screen > *:nth-child(2) { animation-delay: 0.06s; }
#goaltalk.screen > *:nth-child(3) { animation-delay: 0.12s; }
#goaltalk.screen > *:nth-child(4) { animation-delay: 0.16s; }
#goaltalk h1 { text-align: center; font-size: 32px; margin-bottom: 6px; }
@keyframes goalIn { from { opacity: 0; transform: translateY(22px) scale(0.96); } to { opacity: 1; transform: none; } }
.coach-box { margin-top: 12px; text-align: left; }
.coach-box b { display: block; font-size: 14px; }
.coach-box p { margin-top: 6px; line-height: 1.4; }
.coach-box .muted { font-size: 13px; }

/* --- logowanie --- */
.hero-login { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
.login-hero {
  margin: 0 -18px 18px; padding: calc(28px + env(safe-area-inset-top, 0px)) 22px 26px;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-2) 100%); color: var(--brand-ink);
  border-radius: 0 0 36px 36px; box-shadow: var(--shadow-brand);
}
.login-hero .brand { color: #fff; }
.login-hero h1 { margin-top: 26px; font-size: 32px; color: #fff; }
.login-hero p { margin-top: 12px; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, 0.78); max-width: 320px; }
.sso {
  width: 100%; min-height: 54px; border-radius: var(--r-m);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 10px;
}
.sso.apple { background: #111; color: #fff; border: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sso.apple { background: #fff; color: #111; } }
:root[data-theme="dark"] .sso.apple { background: #fff; color: #111; }
.sso.google { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.sso svg { flex: 0 0 auto; }
.gsi { display: flex; justify-content: center; min-height: 44px; margin-bottom: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 10px 0 2px; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.apple-panel { text-align: center; }
.apple-mark { font-size: 34px; margin: 4px 0 8px; }

/* --- cele i gra --- */
.weigh-card { margin-top: 12px; }
.weigh-card b { font-size: 15px; }
.weigh-card .muted { margin-top: 3px; font-size: 13px; }
.weigh-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.weigh-row input { flex: 1; min-width: 0; text-align: center; font-weight: 700; font-size: 18px; padding: 10px 8px; }
.weigh-row .soft { flex: none; min-height: 50px; }
.weigh-row .ghost.small { width: auto; min-height: 50px; padding: 0 8px; flex: none; color: var(--muted); font-size: 13px; }
.level-card { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.lvl-num { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand), var(--brand-2)); color: #fff; font-size: 32px; font-weight: 800; letter-spacing: -0.04em; box-shadow: var(--shadow-brand); }
.lvl-copy b { display: block; font-size: 17px; letter-spacing: -0.02em; margin-bottom: 8px; }
.lvl-copy .muted { margin-top: 6px; font-size: 13px; line-height: 1.35; }
.pbar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 99px; transition: width 0.5s ease; animation: grow 0.9s var(--ease) both; transform-origin: left; }
.wnow { margin-top: 8px; font-size: 40px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.wnow small { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.wdelta { margin-left: 8px; font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.wdelta.good { color: var(--good); }
.wchart { display: block; width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.wchart .grid { stroke: var(--line-strong); stroke-width: 1; }
.wchart .target { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 4; }
.wchart .wline { fill: none; stroke: var(--brand-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wchart .wdot { fill: var(--brand-2); stroke: var(--surface); stroke-width: 2; }
.wchart .ax { font-size: 10px; fill: var(--muted); font-family: inherit; font-weight: 600; }
.wchart .ax.tg { fill: var(--accent); }
.wchart .ax.last { font-size: 11px; font-weight: 700; fill: var(--ink); }
.miles { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 6px; margin-top: 12px; }
.mile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; background: var(--surface-2); text-align: center; min-width: 0; }
.mile span { color: var(--muted); font-size: 13px; }
.mile b { font-size: 13px; }
.mile small { font-size: 10px; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mile.done { background: var(--good-soft); }
.mile.done span { color: var(--good); font-weight: 700; }
.coach-card p { margin-top: 8px; line-height: 1.5; }
.coach-card .focus { font-weight: 650; }
.coach-card .tips { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.coach-card .tips li { margin: 4px 0; }
.quest-list { padding: 6px 18px; }
.quest { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.quest:last-child { border-bottom: 0; }
.quest .m-ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.quest .m-ico .ic { width: 20px; height: 20px; }
.quest.done .m-ico { background: var(--good); color: #fff; }
.quest b { display: block; font-size: 15px; }
.quest .muted { margin-top: 2px; font-size: 12px; line-height: 1.35; }
.q-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.q-right b { font-size: 14px; color: var(--muted); }
.q-right small { font-size: 11px; color: var(--muted); }
.quest.done .q-right b { color: var(--good); font-size: 18px; }
.badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 16px; background: var(--surface-2); text-align: center; min-width: 0; filter: grayscale(1); opacity: 0.5; }
.badge span { font-size: 26px; line-height: 1; }
.badge small { font-size: 10px; line-height: 1.2; color: var(--ink); }
.badge.on { background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--line); filter: none; opacity: 1; }
.cheer { position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 12, 0.5); display: grid; place-items: center; padding: 24px; animation: fade 0.25s ease; }
.cheer-card { width: min(320px, 100%); background: var(--surface); border-radius: 28px; padding: 26px 22px 18px; text-align: center; box-shadow: var(--shadow-lg); animation: pop 0.5s var(--ease); }
.cheer-ico { font-size: 56px; line-height: 1; margin-bottom: 12px; }
.cheer-card b { display: block; font-size: 22px; letter-spacing: -0.03em; }
.cheer-card p { margin: 8px 0 16px; color: var(--muted); line-height: 1.4; }
@keyframes pop { 0% { transform: scale(0.85); opacity: 0; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1); } }
.teen-card { margin-top: 12px; }
.teen-card > b { font-size: 16px; }
.teen-card p { margin-top: 8px; line-height: 1.45; }
.consent-row input { text-align: left; font-weight: 500; font-size: 16px; }
.consent-ok { color: var(--good); font-weight: 700; }
.ghost.small { width: auto; min-height: 40px; padding: 0 12px; margin-top: 6px; color: var(--muted); font-size: 14px; }

/* iPhone: „Wróć” (brak systemowego wstecz) */
.top-back {
  display: inline-flex; align-items: center; gap: 2px;
  margin: 0 0 6px -6px; padding: 8px 12px 8px 6px; min-height: 40px;
  border: 0; border-radius: 12px; background: transparent;
  color: var(--brand-text); font-family: inherit; font-size: 16px; font-weight: 650; line-height: 1;
}
.top-back:active { background: var(--surface-2); }

/* ramka telefonu tylko w podglądzie na komputerze (mysz); rozłożony telefon i tablet: pełny ekran */
@media (min-width: 500px) and (hover: hover) and (pointer: fine) {
  body { padding: 24px 0; background: #0f1412; }
  #phone { min-height: 880px; border-radius: 40px; border: 8px solid #1a2420; }
}
@media (min-width: 500px) and (pointer: coarse) {
  #phone { max-width: 600px; }
}

/* --- 15.9: dziennik, wygląd, kroki, odznaki SVG, aktualizacje --- */
.dchart { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.dchart .dbar { fill: var(--brand-2); cursor: pointer; transition: opacity var(--fast); }
.dchart .dbar.over { fill: var(--accent); }
.dchart .dbar.none { fill: var(--surface-3); }
.dchart .dbar.on { stroke: var(--ink); stroke-width: 1.5; }
.dchart .plan { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: 0.7; }
.dchart .ax { font-size: 10px; fill: var(--muted); font-family: inherit; font-weight: 650; }
.dchart .ax.val { font-size: 9.5px; fill: var(--ink-2); }
.dchart .ax.today { fill: var(--ink); font-weight: 800; }
.legend { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--brand-2); }
.legend i.over { background: var(--accent); }
.diary-day { padding: 6px 18px; }
.diary-day.empty-day { opacity: 0.75; }
.diary-head { display: grid; grid-template-columns: 1fr auto 20px; gap: 10px; align-items: center; width: 100%; min-height: 60px; padding: 8px 0; border: 0; background: transparent; text-align: left; font: inherit; color: inherit; }
.dh-copy b { display: block; font-size: 16px; letter-spacing: -0.015em; }
.dh-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.dh-kcal { font-size: 18px; letter-spacing: -0.03em; }
.dh-kcal.over { color: var(--accent); }
.diary-head > .ic { color: var(--muted); width: 20px; height: 20px; transition: transform 0.25s var(--ease); }
.diary-day.open .diary-head > .ic { transform: rotate(90deg); }
.dthumbs { display: flex; gap: 6px; padding: 0 0 12px; overflow: hidden; }
.dthumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--surface-3); flex: none; display: grid; place-items: center; color: var(--muted); }
.dthumb .ic { width: 20px; height: 20px; }
.diary-day .list { border-top: 1px solid var(--line); }
.dwork { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 10px; }
.dwork span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.dwork .ic { width: 15px; height: 15px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.seg button { border: 0; border-radius: 11px; background: transparent; min-height: 40px; font-weight: 680; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pills .pill { margin-top: 0; }
.pill.steps { background: var(--surface-2); color: var(--ink-2); }
.pill.steps.hit { background: var(--good-soft); color: var(--good); }
.steps-goal { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.steps-goal .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--brand-text); }
.pill.ask { border: 1px dashed var(--line-strong); background: transparent; color: var(--brand-text); font: inherit; font-size: 12px; font-weight: 700; min-height: 32px; }
.lang-tag { display: inline-grid; place-items: center; min-width: 36px; height: 26px; padding: 0 7px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; }
.os-flag { width: 44px; display: grid; place-items: center; }
.os-tick { width: 24px; color: var(--good); display: grid; place-items: center; }
.os-tick .ic { width: 22px; height: 22px; stroke-width: 2.4; }
.lang-pick .flag .ic { width: 20px; height: 20px; color: var(--brand-text); }
.ex-ico .ic { width: 24px; height: 24px; color: var(--brand-text); }
.badge-art { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--brand)); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.14), 0 6px 14px -6px var(--c, var(--brand)); }
.badge-art .ic { width: 22px; height: 22px; stroke-width: 2; }
.badge-art.big { width: 84px; height: 84px; margin: 0 auto 14px; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.14), 0 14px 30px -10px var(--c, var(--brand)); }
.badge-art.big .ic { width: 40px; height: 40px; }
.badge small { margin-top: 2px; }
.cheer-ico { display: grid; place-items: center; }
.update-card { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; margin-bottom: 12px; border-color: transparent; background: var(--brand-soft); }
.upd-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--brand); color: #fff; }
.upd-copy b { display: block; font-size: 15px; letter-spacing: -0.01em; }
.upd-copy small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.35; }
.upd-copy .near-bar { margin-top: 8px; }
.upd-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.upd-actions .soft { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.upd-actions .ghost.small { margin-top: 0; }
