/* fit · dark, phone first (375), two accents in Apple's Activity ring colours: Train = Move red #FA114F, Walk = Exercise green #92E82A (Nitin, 11 Oct 2026). System type, SF on the iPhone. */
:root {
  --bg: #0a0c10;
  --card: #141821;
  --card2: #1b2028;
  --body: #222833;
  --line: rgba(255, 255, 255, 0.07);
  --text: #f3f5f8;
  --text2: #9aa4b2;
  --text3: #6b7280;
  --train: #fa114f;
  --train-rgb: 250, 17, 79;
  --walk: #92e82a;
  --walk-rgb: 146, 232, 42;
  --heavy: #ff9f43;
  --moderate: #4da3ff;
  --easy: #3edc97;
  --warn: #ffd166;
  --radius: 20px;
  --tab-h: 78px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.view {
  max-width: 430px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 20px);
}

/* type */
.eyebrow { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text3); font-weight: 600; }
.eyebrow.warn { color: var(--warn); }
.h1 { font-size: 32px; line-height: 1.08; letter-spacing: -0.02em; font-weight: 700; margin: 4px 0 2px; }
.sub { color: var(--text2); font-size: 15px; }
.title2 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.muted { color: var(--text2); }
.small { font-size: 13px; }
.top { margin: 4px 0 18px; }
.top .eyebrow { margin-bottom: 2px; }
.dayprog { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); margin-top: 12px; overflow: hidden; }
.dayprog span { display: block; height: 100%; border-radius: 2px; background: var(--train); }

/* cards */
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 12px;
}
.card .eyebrow { margin-bottom: 6px; }
.card.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card.link:active { transform: scale(0.985); transition: transform 90ms ease-out; }
.chev { color: var(--text3); font-size: 26px; line-height: 1; }
.note { padding: 6px 0; border-top: 1px solid var(--line); color: var(--text); font-size: 15px; }
.note:first-of-type { border-top: 0; }
.banner {
  display: block; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px;
  background: rgba(255, 209, 102, 0.12); color: var(--warn); font-size: 14px; font-weight: 600;
}

/* rings */
.rings { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.ring {
  position: relative; flex: 1; aspect-ratio: 1; max-width: 190px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: grid; place-items: center;
  transition: transform 90ms ease-out;
}
.ring:active:not([disabled]) { transform: scale(0.96); }
.ring[disabled] { cursor: default; }
.ring svg { width: 100%; height: auto; max-width: 150px; }
.ring .track { fill: none; stroke: rgba(255, 255, 255, 0.08); }
.ring.train .track { stroke: rgba(var(--train-rgb), 0.28); }
.ring.walk .track { stroke: rgba(var(--walk-rgb), 0.28); }
.ring.train .rlabel { color: var(--train); }
.ring.walk .rlabel { color: var(--walk); }
.ring.on .rlabel { color: var(--text); }
.ring .fill { fill: none; stroke-linecap: round; }
.ring.train .fill { stroke: var(--train); }
.ring.walk .fill { stroke: var(--walk); }
.ring .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.ring .rlabel { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.ring .rsub { font-size: 12px; color: var(--text2); margin-top: 2px; max-width: 90px; line-height: 1.2; }
.ring.on .rsub { color: var(--text); }
.ring.small { aspect-ratio: auto; padding: 0; background: none; border: 0; width: 64px; flex: none; }
.ring.small .rlabel { font-size: 11px; }
.ring.small .rsub { display: none; }

/* week strip */
.strip { padding: 12px 8px; }
.strip7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.sd { display: grid; justify-items: center; gap: 4px; padding: 6px 0; border-radius: 12px; }
.sd.cur { background: var(--card2); }
.sd.future { opacity: 0.45; }
.sdow { font-size: 12px; color: var(--text3); font-weight: 600; }
.sdate { font-size: 12px; color: var(--text2); }
.mini { width: 30px; height: 30px; }
.mini circle { fill: none; stroke-width: 3.2; }
.mini .t { stroke: rgba(var(--train-rgb), 0.28); }
.mini .w { stroke: rgba(var(--walk-rgb), 0.28); }
.mini .t.on { stroke: var(--train); }
.mini .w.on { stroke: var(--walk); }
.mini .tick { fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* badges, chips */
.badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; padding: 3px 9px; border-radius: 999px; background: var(--card2); color: var(--text2); white-space: nowrap; }
.badge.heavy { color: var(--heavy); background: rgba(255, 159, 67, 0.14); }
.badge.moderate { color: var(--moderate); background: rgba(77, 163, 255, 0.14); }
.badge.easy, .badge.stretch { color: var(--easy); background: rgba(62, 220, 151, 0.14); }
.badge.sets { color: var(--warn); background: rgba(255, 209, 102, 0.14); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; color: var(--text2); background: var(--card2); border-radius: 999px; padding: 3px 9px; }
.headbadges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* lifts */
.lift .lrow { display: flex; align-items: baseline; gap: 10px; }
.lift .num { font-size: 13px; font-weight: 700; color: var(--text3); min-width: 22px; }
.lift .lname { flex: 1; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.lnums { display: flex; gap: 22px; margin: 10px 0 6px; align-items: flex-end; }
.lnums > span { display: flex; flex-direction: column; }
.lnums b { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; color: var(--text2); }
.lnums b em { font-style: normal; color: var(--text3); font-weight: 500; margin: 0 2px; }
.lnums .load b { font-size: 44px; font-weight: 750; letter-spacing: -0.035em; line-height: 1; color: var(--text); }
.lnums small { font-size: 12px; color: var(--text3); margin-top: 3px; }
.ipill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--text2); background: var(--card2); border-radius: 999px; padding: 4px 10px 4px 8px; white-space: nowrap; text-transform: capitalize; }
.ibars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.ibars i { width: 3px; border-radius: 1px; background: rgba(255, 255, 255, 0.16); }
.ibars i:nth-child(1) { height: 5px; } .ibars i:nth-child(2) { height: 8px; } .ibars i:nth-child(3) { height: 11px; }
.ibars i.on { background: var(--train); }
.ipill.heavy { color: var(--text); }
.media { display: grid; grid-template-columns: 1fr 96px; gap: 10px; margin-top: 12px; align-items: stretch; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two figcaption { font-size: 11px; color: var(--text3); margin-top: 4px; text-align: center; }

/* photo flip: two frames, the body class swaps them every 1.2 s */
.flip { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #0f1217; }
.flip img, .flip > div { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 240ms ease; }
.flip .f1 { opacity: 0; }
body.frame2 .flip .f0 { opacity: 0; }
body.frame2 .flip .f1 { opacity: 1; }
.flip.alt .f0 { opacity: 0; }
.flip.alt .f1 { opacity: 1; }
.flip.drawn { background: var(--card2); }
.flip .fig { width: 100%; height: 100%; }
.fig { stroke: var(--text2); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.fig .head { fill: var(--text2); }
.fig .prop { stroke: var(--text3); stroke-width: 1.5; stroke-dasharray: 3 3; }
.fig .mover { stroke: var(--train); }
.fig .arm { stroke-width: 3.4; }
.flip.empty { background: var(--card2); }
.flip .glyph { display: grid; place-items: center; color: var(--text3); }
.flip .glyph svg { width: 40%; height: 40%; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* how (library steps) */
details.how, .meal details, .pending details { margin-top: 10px; }
summary { cursor: pointer; color: var(--text2); font-size: 14px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 6px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "›"; display: inline-block; transition: transform 160ms ease; color: var(--text3); font-size: 18px; line-height: 1; }
details[open] summary::before { transform: rotate(90deg); }
details ol, details ul { margin: 8px 0 0 4px; padding-left: 16px; color: var(--text2); font-size: 14px; }
details ol li, details ul li { list-style: decimal; margin: 4px 0; }
details ul li { list-style: disc; }

/* body map: a grey anatomical figure, the day's muscles in red, a glow that breathes, a 3D turn */
.bm svg { width: 100%; height: auto; display: block; }
.bodymap .sil { fill: url(#gbody); }
.bodymap .m { fill: url(#gm); transition: fill 240ms ease; }
.bodymap .d { fill: #2e343f; }
.bodymap .m.primary { fill: url(#glit); }
.bodymap .m.secondary { fill: url(#gm); }
.bodymap .shade { fill: url(#gshade); pointer-events: none; }
.turn { position: relative; width: min(100%, 210px); aspect-ratio: 244 / 614; margin: 0 auto; perspective: 1000px; cursor: pointer; }
.turn .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform 720ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.turn .face.back { transform: rotateY(180deg); }
.turn.flipped .face.front { transform: rotateY(-180deg); }
.turn.flipped .face.back { transform: rotateY(0deg); }
.card.map { padding: 16px; }
.mapgrid { display: grid; grid-template-columns: 148px 1fr; gap: 18px; align-items: center; }
.mapgrid .turn { width: 148px; }
.mapside { display: grid; gap: 14px; align-content: center; }
.mapside .eyebrow { margin: 0; }
.mlist { display: grid; gap: 6px; margin-top: -6px; }
.mlist li { font-size: 15px; font-weight: 600; text-transform: capitalize; display: flex; align-items: center; gap: 8px; }
.mlist i { width: 8px; height: 8px; border-radius: 50%; background: var(--train); flex: none; }
.kv { display: flex; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.kv span { display: flex; flex-direction: column; }
.kv b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kv small { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.mapside .turnbtn { width: auto; height: 36px; border-radius: 999px; padding: 0 14px 0 10px; display: inline-flex; gap: 6px; justify-self: start; font-size: 13px; font-weight: 600; color: var(--text2); }
.mapside .turnbtn svg { width: 18px; height: 18px; }
.b2 { width: 100%; height: auto; display: block; }
.b2 .sil { fill: #2e2f35; }
.b2 .p { fill: url(#g2p); stroke: #222328; stroke-width: 2; stroke-linejoin: round; transition: fill 240ms ease; }
.b2 .p.lit { fill: url(#g2l); }
.turnbtn { width: 44px; height: 44px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; transition: transform 90ms ease-out; }
.turnbtn:active { transform: scale(0.94); }
.turnbtn svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.media { grid-template-columns: 1fr 92px; }
.media .flip { aspect-ratio: auto; height: 100%; min-height: 150px; }
.media .two .flip { aspect-ratio: 1; }
.media .focus { background: var(--card2); border-radius: 14px; padding: 10px 4px 8px; display: grid; justify-items: center; align-content: center; gap: 4px; }
.media .focus .bm { width: 50px; }
.media .focus .bm svg { width: 100%; height: auto; }
.media .focus .fname { font-size: 12px; font-weight: 600; color: var(--text); text-align: center; line-height: 1.2; }
.media .focus .flabel { font-size: 10px; color: var(--text3); letter-spacing: 0.06em; text-transform: uppercase; }

/* routines */
.rhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; text-align: left; }
.rhead .muted { text-align: right; }
.rlist .ritem { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.rlist .ritem:first-child { border-top: 0; }
.rthumb .flip { aspect-ratio: 1; border-radius: 10px; }
.rname { font-size: 15px; font-weight: 600; }
.tbtn {
  background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px;
  font-size: 13px; font-weight: 700; color: var(--walk); min-width: 64px; transition: transform 90ms ease-out;
}
.tbtn:active { transform: scale(0.95); }
.tbtn.running { background: rgba(62, 220, 151, 0.16); border-color: rgba(62, 220, 151, 0.4); color: var(--text); }

/* run, class, walk, rest */
.bignums { display: flex; gap: 18px; align-items: baseline; margin: 6px 0; }
.bignums b { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.bignums small { font-size: 13px; color: var(--text3); margin-left: 6px; }
.closerow { display: grid; gap: 4px; margin-top: 4px; }
.closeitem { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 6px 0; }
.closeitem + .closeitem { border-top: 1px solid var(--line); }
.closeitem .ring.small { width: 56px; }
.todaylink .tfig { width: 30px; flex: none; }
.todaylink .grow { flex: 1; }
.card.rest .title2 { margin: 2px 0 6px; }

/* program */
.grid16 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.tile {
  display: grid; gap: 2px; padding: 10px 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line);
  font-size: 12px; color: var(--text2); transition: transform 90ms ease-out;
}
.tile:active { transform: scale(0.96); }
.tile b { font-size: 16px; color: var(--text); }
.tile em { font-style: normal; color: var(--warn); font-size: 11px; font-weight: 700; }
.dots { display: flex; gap: 3px; margin-top: 6px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.dots i.on { background: var(--walk); }
.tile.cur { border-color: rgba(var(--train-rgb), 0.7); background: rgba(var(--train-rgb), 0.08); }
.tile.now b { color: var(--train); }
.tile.deload, .tile.scan { background: rgba(255, 209, 102, 0.06); }
.wdays li { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.wdays li:first-child { border-top: 0; }
.wdays .wd { font-weight: 700; color: var(--text2); font-size: 13px; }
.wdays .wd small { display: block; font-weight: 500; color: var(--text3); }
.wdays .wt { font-size: 15px; font-weight: 600; }
.wdays .wt small { display: block; color: var(--text3); font-weight: 500; font-size: 12px; }
.scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
table.loads { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 390px; }
table.loads th, table.loads td { padding: 6px 4px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
table.loads th { color: var(--text3); font-weight: 600; font-size: 11px; letter-spacing: 0.04em; border-top: 0; }
table.loads td:first-child, table.loads th:first-child { text-align: left; position: sticky; left: 0; background: var(--card); padding-left: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
table.loads tr.dayrow td { color: var(--train); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 12px; }
table.loads td small { color: var(--text3); font-size: 10px; }
table.loads td.cur { color: var(--text); font-weight: 700; }
ol.rules { padding-left: 20px; color: var(--text2); font-size: 14px; }
ol.rules li { list-style: decimal; margin: 6px 0; }

/* diet */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.stat { background: var(--card2); border-radius: 14px; padding: 10px 12px; }
.stat .sv { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .sv small { font-size: 12px; color: var(--text3); margin-left: 3px; font-weight: 600; }
.stat .sl { font-size: 12px; color: var(--text2); margin-top: 2px; }
.stat .st { font-size: 11px; color: var(--text3); }
.sbar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); margin: 7px 0 5px; overflow: hidden; }
.sbar span { display: block; height: 100%; background: var(--walk); border-radius: 2px; }
.stat.over .sbar span { background: var(--warn); }
.dstats { grid-template-columns: 1fr 1fr; }
.dstats .stat:first-child { grid-column: 1 / -1; }
.dstats .stat:first-child .sv { font-size: 34px; }
.stat.over .sv { color: var(--warn); }
.mhead { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; }
.mtime { font-size: 15px; font-weight: 700; color: var(--walk); }
.mkcal b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.mkcal small { font-size: 11px; color: var(--text3); margin-left: 3px; }
.macros { color: var(--text2); font-size: 13px; margin-top: 8px; }
table.items { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.items td, table.items th { padding: 5px 4px; border-top: 1px solid var(--line); text-align: right; }
table.items td:first-child, table.items th:first-child { text-align: left; }
table.items th { color: var(--text3); font-weight: 600; font-size: 11px; border-top: 0; }
table.items td:first-child small { display: block; color: var(--text3); }
.how-p { color: var(--text2); font-size: 14px; margin: 10px 0 0; }
.pending { border-color: rgba(255, 209, 102, 0.35); }
.plain li { list-style: none; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text); }
.plain li:first-child { border-top: 0; }
.plain li b { color: var(--text2); font-weight: 600; margin-right: 6px; }

/* progress */
.bars { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; align-items: end; height: 72px; margin-top: 8px; }
.bars span { display: block; background: var(--card2); border-radius: 4px; min-height: 3px; }
.bars span.on { background: var(--train); }
.bars.walk span.on { background: var(--walk); }
.bars span.cur { outline: 1px solid var(--text2); }
.barlabels { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; font-size: 9px; color: var(--text3); margin-top: 4px; text-align: center; }
.up li { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.up li:first-child { border-top: 0; }
.up .ud { color: var(--text2); font-weight: 600; }

/* settings, forms, gate */
input[type="password"], input[type="date"], input[type="text"] {
  width: 100%; background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 12px;
  padding: 12px 14px; font: inherit; outline: none; min-height: 46px; -webkit-appearance: none; appearance: none;
}
input:focus { border-color: var(--train); }
.frow { display: grid; gap: 8px; margin-top: 8px; }
button.primary, .frow button, .quick button, .act {
  background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px 14px; font-weight: 600;
  transition: transform 90ms ease-out;
}
button.primary { background: var(--train); color: #1f0610; border-color: transparent; }
button:active { transform: scale(0.97); }
.quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
.quick button { padding: 8px 0; font-size: 13px; border-radius: 999px; }
.msg { font-size: 13px; color: var(--text2); min-height: 18px; margin-top: 6px; }
.msg.err { color: var(--heavy); }

/* tab bar: translucent, content scrolls under */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(6, 1fr);
  padding: 8px 6px calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--line);
}
.tabbar a { display: grid; justify-items: center; gap: 3px; color: var(--text3); font-size: 10px; font-weight: 600; letter-spacing: 0.01em; padding: 4px 0; border-radius: 10px; transition: transform 90ms ease-out; }
.tabbar a:active { transform: scale(0.94); }
.tabbar a.on { color: var(--train); }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 480px) {
  .tabbar { max-width: 430px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 18px 18px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .tabbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
