:root {
  --bg: #f6f5f1; --card: #ffffff; --line: #e2e0d8; --text: #1b1b19; --muted: #6d6c66;
  --accent: #c2410c; --on-accent: #ffffff; --soft: #fbe9df; --ok: #15803d; --ok-soft: #e3f3e6;
  --warn: #92400e; --warn-soft: #fdf0d5; --muscle: #d85a30; --muscle2: #f5c4b3; --body: #c9c7be;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614; --card: #21211e; --line: #383833; --text: #f1f0ea; --muted: #a3a29a;
    --accent: #f97316; --on-accent: #1b1b19; --soft: #3a2415; --ok: #4ade80; --ok-soft: #173221;
    --warn: #fbbf24; --warn-soft: #3a2c0c; --muscle: #f0997b; --muscle2: #71301a; --body: #55544e;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 520px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom));
}
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 4px; font-weight: 700; }
h2 { font-size: 17px; margin: 20px 0 8px; font-weight: 600; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; overflow: hidden; }
.item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; font: inherit; text-align: left; }
.item:first-child { border-top: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.btn { display: block; width: 100%; min-height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; padding: 10px 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.small { width: auto; min-height: 40px; padding: 6px 14px; font-weight: 500; }
.btn:active { opacity: .7; }
.link { background: none; border: 0; color: var(--accent); padding: 8px 0; font-weight: 500; }
.icon { background: none; border: 0; font-size: 22px; padding: 6px 8px; line-height: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-width: 40px; min-height: 36px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); text-align: center; font-size: 14px; }
.chip.on { background: var(--soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.pill { font-size: 13px; padding: 2px 8px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
input, select { width: 100%; min-height: 48px; font: inherit; font-size: 17px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.err { color: #dc2626; font-size: 14px; min-height: 20px; margin: 6px 0; }
.big { font-size: 44px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.stepper { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 8px 0 14px; }
.round { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 26px; }
.set { display: grid; grid-template-columns: 28px 1fr 1fr 44px; gap: 8px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); }
.set:first-child { border-top: 0; }
.set.cur { background: var(--soft); }
.set input { min-height: 44px; text-align: center; padding: 6px; }
.set .val { text-align: center; font-variant-numeric: tabular-nums; }
.timer { text-align: center; padding: 6px 0 2px; }
.timer b { font-size: 34px; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 22px; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; background: var(--accent); }
.fig { display: flex; justify-content: center; gap: 18px; }
.fig svg { width: 92px; height: auto; }
.fig.small svg { width: 46px; }
.fig .b { fill: var(--body); }
.fig .m { fill: var(--body); }
.fig .m.on { fill: var(--muscle); }
.fig .m.sec { fill: var(--muscle2); }
.fig.pick .m { cursor: pointer; }
.chart { width: 100%; height: auto; display: block; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--muted); }
.chart .ax { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; }
ol.steps { padding-left: 22px; margin: 8px 0; }
ol.steps li { margin: 6px 0; }
#nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
#nav[hidden] { display: none; }
#nav button { background: none; border: 0; padding: 8px 12px; min-width: 84px; font-size: 13px; color: var(--muted); }
#nav button.on { color: var(--accent); font-weight: 600; }
#nav span { display: block; font-size: 22px; line-height: 1.1; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(100px + env(safe-area-inset-bottom)); background: var(--text); color: var(--bg); padding: 12px 14px; border-radius: 12px; text-align: center; font-size: 15px; z-index: 5; }
#toast[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .btn, .chip { transition: opacity .1s; } }
.cur { padding: 12px 14px; background: var(--soft); border-top: 1px solid var(--line); }
.cur:first-child { border-top: 0; }
.stp { display: grid; grid-template-columns: 56px 1fr 44px 56px; gap: 8px; align-items: center; margin: 8px 0 0; }
.stp input { text-align: center; font-size: 24px; font-weight: 700; min-height: 56px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: center 20%; border-radius: 12px; background: var(--line); display: block; }
.photos figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 4px; }
