/* Ciemny motyw w stylu Mi Fitness: prawie czarne tło, zaokrąglone karty, duże liczby. */
:root {
  --bg: #0b0b0c; --card: #161719; --card-2: #1e1f22; --line: #2a2b2f;
  --ink: #f2f2f3; --muted: #9a9ca3; --dim: #6b6d74;
  --ok: #4ade80; --ok-bg: #0f2a1a; --ok-line: #2e8b57;
  --warn: #f5bd3a; --warn-bg: #2e2510; --warn-line: #b8922a;
  --bad: #f87171; --bad-bg: #331516; --bad-line: #b84040;
  --accent: #5ac8fa; --accent-bg: #0f2633;
  --radius: 18px; --tabs-h: 64px;
  color-scheme: dark;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.app { max-width: 560px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); }
.hdr { font-size: 13px; color: var(--muted); letter-spacing: .01em; padding: 4px 0 12px; font-variant-numeric: tabular-nums; }
.offline { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); border-radius: 12px; padding: 8px 12px; font-size: 14px; margin-bottom: 12px; }
.view > * + * { margin-top: 12px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

.title { font-size: 26px; font-weight: 750; line-height: 1.2; letter-spacing: -.01em; }
.title .muted { font-weight: 500; font-size: 18px; }
.section { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-top: 14px; }
.kicker { display: block; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.when { margin-top: 4px !important; }

.card { display: block; background: var(--card); border-radius: var(--radius); padding: 16px; }
.card h3 { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.card p + p { margin-top: 6px; }
.empty p { line-height: 1.5; }

/* Werdykt */
.verdict { border-radius: var(--radius); padding: 18px 16px; border: 1px solid; }
.v-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.v-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.v-bad { background: var(--bad-bg); border-color: var(--bad-line); }
.v-head { display: flex; align-items: flex-start; gap: 12px; }
.v-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #0b0b0c; }
.v-ok .v-icon { background: var(--ok); } .v-warn .v-icon { background: var(--warn); } .v-bad .v-icon { background: var(--bad); }
.v-head h2 { font-size: 24px; font-weight: 750; line-height: 1.2; padding-top: 5px; }
.v-ok h2 { color: var(--ok); } .v-warn h2 { color: var(--warn); } .v-bad h2 { color: var(--bad); }
.v-why { margin-top: 10px; font-size: 16px; }
.verdict .tag { margin-top: 10px; }
.verdict.small { padding: 14px; }
.verdict.small .v-icon { width: 32px; height: 32px; font-size: 18px; }
.verdict.small h2 { font-size: 19px; padding-top: 3px; }

/* Tabela plan vs wykonanie */
.table-card { padding: 6px 16px 14px; }
.table-card h3 { padding-top: 10px; }
.pva { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pva th, .pva td { padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.pva tbody tr:last-child > * { border-bottom: 0; }
.pva thead th { font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; padding: 10px 0 8px; }
.pva tbody th { font-weight: 500; color: var(--muted); font-size: 15px; padding-right: 8px; width: 38%; }
.pva td { font-size: 16px; color: var(--muted); padding-right: 10px; white-space: nowrap; }
.pva td.num { font-size: 19px; font-weight: 700; color: var(--ink); padding-right: 0; white-space: normal; }
.pva .tag { vertical-align: 2px; }
.pva td.num .muted { font-size: 15px; font-weight: 500; }
.splits-head { display: flex; align-items: center; gap: 8px; padding-top: 12px; }
.splits-head h3 { margin: 0; padding: 0; }
.splits { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.splits li { background: var(--card-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.splits span { font-size: 12px; color: var(--muted); }
.splits b { font-size: 17px; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-now { background: var(--accent-bg); color: var(--accent); }
.tag-test { background: var(--accent-bg); color: var(--accent); display: table; margin-top: 4px; }

/* Następny trening */
.hero { padding: 20px 16px; border: 1px solid var(--line); }
.hero .kicker { color: var(--accent); }
.hero-title { font-size: 30px; font-weight: 800; line-height: 1.15; margin: 8px 0 4px; letter-spacing: -.01em; }
.hero.done .hero-title { color: var(--ok); }
.steps { margin: 14px 0 0; padding-left: 20px; }
.steps li + li { margin-top: 6px; }
.steps.numbered { margin-top: 4px; }
.steps.numbered li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { background: var(--card-2); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px;
  background: var(--accent); color: #04131b; font: inherit; font-weight: 700; cursor: pointer; }
.btn:active { opacity: .85; }
.btn-wide { width: 100%; margin-top: 16px; }
.next-short { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; min-height: 64px; }
.next-short .kicker { grid-column: 1; }
.next-title { grid-column: 1; font-size: 18px; font-weight: 700; margin-top: 2px; }
.next-short .chev { grid-column: 2; grid-row: 1 / 3; }
.chev { color: var(--dim); font-size: 26px; line-height: 1; }
.link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; font-size: 17px; margin-bottom: 4px; }

/* Ściąga opaski */
.band { border: 1px solid var(--line); }
.kv { margin: 0; }
.kv div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.big-num { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.kv .big-num { font-size: 22px; }
.tips { list-style: none; margin: 12px 0 0; padding: 0; color: var(--muted); font-size: 14px; }
.tips li { position: relative; padding-left: 18px; }
.tips li + li { margin-top: 6px; }
.tips li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Plan */
.note { border: 1px solid var(--accent-bg); }
.week { background: var(--card); border-radius: var(--radius); padding: 12px 16px 6px; scroll-margin-top: 12px; }
.week h2 { font-size: 15px; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.week.current { outline: 2px solid var(--accent); background: #12191d; }
.week.current h2 { color: var(--ink); }
.w-list { list-style: none; margin: 4px 0 0; padding: 0; }
.w-list li + li .w-row { border-top: 1px solid var(--line); }
.w-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; min-height: 56px; padding: 8px 0; }
.w-day { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.25; }
.w-day b { font-size: 15px; color: var(--ink); }
.w-title { font-size: 15px; line-height: 1.3; }
.w-row.past .w-title, .w-row.past .w-day b { color: var(--dim); }
.w-row.today .w-day b { color: var(--accent); }
.v-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #0b0b0c; }
.v-dot.v-ok { background: var(--ok); } .v-dot.v-warn { background: var(--warn); } .v-dot.v-bad { background: var(--bad); }

/* Postęp */
.forecast .big-num { font-size: 52px; line-height: 1.05; font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.forecast .big-num.dim { color: var(--dim); }
.goal-line { color: var(--muted); margin-top: 8px !important; }
.goal-line b { color: var(--ok); }
.chart { display: block; width: 100%; height: auto; margin-top: 4px; }
.chart .axis { stroke: var(--line); }
.chart .limit { stroke: var(--warn); stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart .lbl { fill: var(--dim); font-size: 11px; }
.chart .limit-lbl { fill: var(--warn); }
.chart .val { fill: var(--ink); font-size: 13px; font-weight: 700; }
.legend { display: flex; align-items: center; gap: 6px; margin-top: 6px !important; }
.dash { display: inline-block; width: 18px; border-top: 2px dashed var(--warn); }

/* Dolny pasek zakładek */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(17, 17, 19, .96); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabs-h); color: var(--dim); font-size: 12px; font-weight: 600; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current='page'] { color: var(--ink); }
.tabs a[aria-current='page'] svg { stroke: var(--accent); }

/* Ekran braku dostępu / sieci */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate-box { max-width: 340px; text-align: center; }
.gate-mark { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 20px; background: var(--card); display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: var(--ok); }
.gate h1 { font-size: 22px; line-height: 1.25; }
.gate p { color: var(--muted); margin-top: 10px; }
.gate .btn { margin-top: 20px; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: no-preference) { .w-row, .card, .btn { transition: background-color .15s, opacity .15s; } }
