/*
  VOICE   confident, energetic, clean — a premium training app
  IDEA    a coach's clipboard: today's plan up front, every set one tap away
  PICTURE ember-gradient hero card carrying today's workout
  COLOUR  near-black ground, ember orange→red accent, mint for completed
  TYPE    native SF Pro (system), heavy tight headings, tabular numbers
*/
:root {
  --bg: #0B0D11; --s1: #14171D; --s2: #1C2027; --s3: #272C35;
  --line: rgba(255, 255, 255, .07);
  --tx: #F4F5F7; --mu: #8E96A4; --mu2: #5F6774;
  --ac: #FF6A3D; --ac2: #FF4D5E; --grad: linear-gradient(140deg, #FF7A3D 0%, #FF4D5E 100%);
  --ok: #34D399; --okbg: rgba(52, 211, 153, .12); --bad: #F87171; --yl: #FBBF24; --bl: #60A5FA;
  --r: 22px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--tx); background: var(--bg); min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--mu); }
.center { text-align: center; }

/* layout */
.screen { max-width: 560px; margin: 0 auto; padding: calc(var(--sat) + 22px) 20px calc(var(--sab) + 112px); }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 22px; }
.top.col { flex-direction: column; align-items: flex-start; gap: 4px; }
.top .icon-btn { margin-bottom: 12px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--mu); }
.h1 { font-size: 32px; line-height: 1.08; font-weight: 800; letter-spacing: -.025em; text-wrap: balance; }
.h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.sec { margin-top: 26px; }
.sec-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card .h2 + .rows, .card .h2 + .src { margin-top: 8px; }
.chip { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--s2); color: var(--mu); white-space: nowrap; }
.actions { display: grid; gap: 10px; margin-top: 22px; }
.fine { text-align: center; font-size: 13px; color: var(--mu2); margin-top: 18px; }
.note { font-size: 13.5px; color: var(--mu); margin-top: 12px; line-height: 1.55; }

/* buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px;
  border-radius: 18px; font-weight: 700; font-size: 17px; background: var(--ac); color: #fff;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn.sec2 { background: var(--s2); color: var(--tx); }
.btn.ghost { background: transparent; color: var(--mu); height: 48px; }
.btn.danger { background: rgba(248, 113, 113, .14); color: var(--bad); }
.btn.danger-txt { color: var(--bad); }
.btn.sm { width: auto; height: 38px; padding: 0 16px; font-size: 15px; border-radius: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--s2); display: grid; place-items: center; flex: none; color: var(--tx); }
.icon-btn:active { transform: scale(.94); }

/* icon tiles */
.ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ico .i { width: 19px; height: 19px; }
.ico.or { background: rgba(255, 106, 61, .15); color: var(--ac); }
.ico.gr { background: var(--okbg); color: var(--ok); }
.ico.bl { background: rgba(96, 165, 250, .14); color: var(--bl); }
.ico.yl { background: rgba(251, 191, 36, .14); color: var(--yl); }

/* hero */
.hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 22px; color: #fff;
  background: var(--grad); box-shadow: 0 22px 44px -20px rgba(255, 90, 70, .65);
}
.hero > *:not(.hero-bg) { position: relative; }
.hero-bg { position: absolute; right: -34px; top: -26px; width: 200px; height: 200px; opacity: .16; transform: rotate(-24deg); }
.hero-bg .i { width: 100%; height: 100%; stroke-width: 1.5; }
.hero .tag { display: inline-block; font-size: 12.5px; font-weight: 700; background: rgba(255, 255, 255, .22); padding: 5px 11px; border-radius: 99px; }
.hero h2 { font-size: 36px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 4px; }
.hero p { opacity: .92; font-weight: 500; }
.hero .hero-note { margin-top: 12px; font-size: 14.5px; background: rgba(0, 0, 0, .14); padding: 10px 12px; border-radius: 14px; }
.hero ul { list-style: none; margin: 18px 0 20px; display: grid; gap: 8px; font-size: 15px; }
.hero li { display: flex; justify-content: space-between; gap: 12px; }
.hero li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero li span:last-child { opacity: .8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero li.more { opacity: .75; font-size: 14px; }
.hero .btn { background: #fff; color: #16181D; margin-top: 18px; }
.hero ul + .btn { margin-top: 0; }
.hero.calm { background: var(--s1); border: 1px solid var(--line); box-shadow: none; color: var(--tx); }
.hero.calm .tag { background: var(--s3); }
.hero.calm p { color: var(--mu); opacity: 1; }
.hero.calm .btn.sec2 { background: var(--s3); color: var(--tx); }
.hero.win { background: linear-gradient(140deg, #10B981 0%, #34D399 100%); box-shadow: 0 22px 44px -20px rgba(52, 211, 153, .5); color: #04261A; }
.hero.win .tag { background: rgba(255, 255, 255, .35); }
.hero.win .hero-note { background: rgba(255, 255, 255, .25); }

/* week strip */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; border-radius: 16px; background: var(--s1); border: 1px solid var(--line); font-size: 12px; color: var(--mu); font-weight: 600; }
.day b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; color: var(--tx); font-variant-numeric: tabular-nums; }
.day.plan b { box-shadow: inset 0 0 0 2px var(--s3); }
.day.done b { background: var(--grad); color: #fff; }
.day.done .i { width: 16px; height: 16px; stroke-width: 3; }
.day.missed b { color: var(--mu2); text-decoration: line-through; }
.day.off b { color: var(--mu2); }
.day.today { border-color: rgba(255, 106, 61, .55); color: var(--ac); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--s1); border: 1px solid var(--line); border-radius: 20px; padding: 14px; }
.stat .ico { margin-bottom: 10px; }
.stat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat small { color: var(--mu); font-size: 13px; font-weight: 600; }

/* targets */
.kcal { display: flex; align-items: baseline; gap: 8px; }
.kcal b { font-size: 40px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.macro { background: var(--s2); border-radius: 16px; padding: 12px; }
.macro small { display: block; color: var(--mu); font-size: 13px; font-weight: 600; }
.macro b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.macro i { display: block; height: 4px; border-radius: 4px; margin-top: 10px; }
.m-p { background: var(--ac); } .m-c { background: var(--bl); } .m-f { background: var(--yl); }
.habits { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  padding: 6px 12px calc(var(--sab) + 6px); background: rgba(11, 13, 17, .8);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; max-width: 560px; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; min-height: 50px; font-size: 10.5px; font-weight: 600; color: var(--mu2); }
.tab .i { width: 24px; height: 24px; }
.tab.on { color: var(--ac); }

/* workout */
.screen.wk { padding-top: 0; padding-bottom: calc(var(--sab) + 130px); }
.wk-head {
  position: sticky; top: 0; z-index: 10; margin: 0 -20px; padding: calc(var(--sat) + 10px) 20px 12px;
  display: flex; align-items: center; gap: 12px; background: rgba(11, 13, 17, .86);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.wk-title { flex: 1; }
.wk-title h1 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.wk-title p { font-size: 13.5px; color: var(--mu); font-variant-numeric: tabular-nums; }
.bar { height: 5px; background: var(--s2); border-radius: 5px; overflow: hidden; margin: 6px 0 18px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 5px; transition: width .35s ease; }
.ex { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 14px; margin-bottom: 14px; transition: border-color .2s; }
.ex.complete { border-color: rgba(52, 211, 153, .4); }
.ex-top { display: flex; gap: 12px; align-items: flex-start; }
.ex-top > div { flex: 1; }
.ex-n { width: 32px; height: 32px; border-radius: 10px; background: var(--s3); display: grid; place-items: center; font-size: 14px; font-weight: 800; flex: none; }
.ex-n .i { width: 17px; height: 17px; stroke-width: 3; }
.ex.complete .ex-n { background: var(--ok); color: #04261A; }
.ex-name { font-size: 17px; font-weight: 700; line-height: 1.25; }
.ex-mus { font-size: 13px; color: var(--mu); margin-top: 2px; }
.ex-top .icon-btn { width: 36px; height: 36px; color: var(--mu); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 10px; }
.meta span { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: var(--s2); color: var(--mu); white-space: nowrap; }
.meta span.hl { color: var(--ac); background: rgba(255, 106, 61, .13); }
.set { display: grid; grid-template-columns: 30px minmax(0, 1fr) 72px 62px 46px; gap: 8px; align-items: center; padding: 5px 4px; border-radius: 13px; transition: background .2s; }
.set.head { font-size: 12px; font-weight: 700; color: var(--mu2); padding-bottom: 2px; }
.set.head span:nth-child(n+3) { text-align: center; }
.set.is-done { background: var(--okbg); }
.set-n { font-weight: 800; text-align: center; color: var(--mu); font-variant-numeric: tabular-nums; }
.prev { font-size: 14px; color: var(--mu); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in {
  width: 100%; height: 44px; border-radius: 12px; border: 0; background: var(--s2); text-align: center;
  font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; outline: none; -webkit-appearance: none; appearance: none;
}
.in:focus { box-shadow: 0 0 0 2px var(--ac); }
.in::placeholder { color: var(--mu2); }
.set.is-done .in { background: transparent; }
.na { text-align: center; color: var(--mu2); }
.chk { width: 46px; height: 44px; border-radius: 12px; background: var(--s2); display: grid; place-items: center; color: var(--mu2); transition: background .15s, transform .12s; }
.chk .i { width: 20px; height: 20px; stroke-width: 3; }
.chk:active { transform: scale(.92); }
.set.is-done .chk { background: var(--ok); color: #04261A; }
.set-tools { display: flex; gap: 8px; margin-top: 10px; }
.set-tools button { flex: 1; height: 42px; border-radius: 12px; background: var(--s2); font-size: 14px; font-weight: 700; color: var(--mu); display: flex; align-items: center; justify-content: center; gap: 6px; }
.set-tools .i { width: 16px; height: 16px; }

/* rest timer */
#rest-root { display: none; }
body[data-view="workout"] #rest-root { display: block; }
.rest {
  position: fixed; z-index: 30; left: 50%; bottom: calc(var(--sab) + 14px); transform: translateX(-50%);
  width: min(520px, calc(100% - 24px)); display: flex; align-items: center; gap: 8px; padding: 10px;
  border-radius: 24px; background: rgba(32, 36, 44, .94); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
  animation: rise .28s cubic-bezier(.2, .9, .3, 1);
}
.rest-ring { width: 44px; height: 44px; flex: none; }
.rest-ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.trk { fill: none; stroke: var(--s3); stroke-width: 4; }
.prg { fill: none; stroke: var(--ac); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 119.38; transition: stroke-dashoffset .25s linear; }
.rest-txt { flex: 1; padding-left: 2px; }
.rest-txt small { display: block; font-size: 12px; color: var(--mu); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest-txt b { font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rest-btn { height: 42px; min-width: 46px; padding: 0 10px; border-radius: 13px; background: var(--s3); font-weight: 700; font-size: 14px; }
.rest-btn.skip { background: var(--ac); color: #fff; }
.rest.ding { border-color: var(--ok); }
.rest.ding .prg { stroke: var(--ok); }
.rest.ding .rest-txt small { color: var(--ok); }

/* sheets */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); animation: fade .2s ease; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 88vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--s1); border-radius: 28px 28px 0 0;
  padding: 10px 22px calc(var(--sab) + 22px); animation: slide .3s cubic-bezier(.2, .9, .3, 1);
}
.grab { width: 40px; height: 5px; border-radius: 5px; background: var(--s3); margin: 0 auto 18px; }
.sheet h3 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.sheet > p { color: var(--mu); margin-top: 6px; }
.info-block { margin-top: 20px; }
.info-block h4 { font-size: 13px; color: var(--mu); font-weight: 700; margin-bottom: 8px; }
.how { padding-left: 20px; display: grid; gap: 7px; }
.how li::marker { color: var(--ac); font-weight: 800; }
.body { color: var(--tx); }
.callout { background: rgba(248, 113, 113, .1); color: #FCA5A5; padding: 12px 14px; border-radius: 14px; font-size: 15px; }
.link { display: inline-flex; align-items: center; gap: 4px; margin-top: 20px; color: var(--ac); font-weight: 700; text-decoration: none; min-height: 44px; }
.link .i { width: 18px; height: 18px; }
.done-ico { width: 76px; height: 76px; border-radius: 26px; margin: 4px auto 16px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 18px 40px -14px rgba(255, 90, 70, .7); }
.done-ico .i { width: 38px; height: 38px; }
.sum-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.sum-grid div { background: var(--s2); border-radius: 16px; padding: 14px 8px; text-align: center; }
.sum-grid b { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum-grid small { color: var(--mu); font-size: 13px; font-weight: 600; }
.pr { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(251, 191, 36, .11); color: #FCD34D; margin-top: 10px; font-weight: 600; font-size: 15px; }

/* toast */
.toast {
  position: fixed; z-index: 60; left: 50%; top: calc(var(--sat) + 12px); transform: translateX(-50%);
  background: #2B303A; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45); max-width: calc(100% - 32px); animation: drop .22s ease;
}

/* forms */
.field { margin-top: 20px; }
.field label, .lbl { display: block; font-size: 14px; font-weight: 600; color: var(--mu); margin-bottom: 8px; }
.inp {
  display: block; width: 100%; height: 54px; border-radius: 16px; border: 1px solid var(--line); background: var(--s1);
  padding: 0 16px; font-size: 17px; outline: none; -webkit-appearance: none; appearance: none;
}
.inp:focus { border-color: var(--ac); }
.inp::placeholder { color: var(--mu2); }
input[type="date"].inp { line-height: 52px; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.unit { position: relative; }
.unit .inp { padding-right: 48px; }
.unit span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--mu); font-weight: 600; pointer-events: none; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--s1); border: 1px solid var(--line); border-radius: 16px; padding: 4px; gap: 4px; }
.seg.mb { margin-bottom: 10px; }
.field .seg label, .field .days label { margin: 0; position: relative; }
.seg input, .days input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px; font-weight: 700; color: var(--mu); transition: background .15s, color .15s; cursor: pointer; }
.seg input:checked + span { background: var(--s3); color: var(--tx); }
.seg input:focus-visible + span, .days input:focus-visible + span { outline: 2px solid var(--ac); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.days span { display: grid; place-items: center; height: 48px; border-radius: 14px; background: var(--s1); border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--mu); cursor: pointer; transition: background .15s, color .15s; }
.days input:checked + span { background: var(--grad); border-color: transparent; color: #fff; }
.hint { font-size: 13.5px; color: var(--mu); margin-top: 10px; }
.err { color: var(--bad); font-weight: 600; margin: 18px 0 12px; min-height: 1px; }

/* welcome */
.welcome { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: calc(var(--sat) + 28px) 24px calc(var(--sab) + 24px); }
.logo-big { width: 92px; height: 92px; border-radius: 30px; background: var(--grad); display: grid; place-items: center; color: #fff; margin-top: 7vh; box-shadow: 0 26px 54px -16px rgba(255, 90, 70, .75); animation: float 4s ease-in-out infinite; }
.logo-big .i { width: 50px; height: 50px; stroke-width: 2.2; }
.welcome h1 { font-size: 52px; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: 30px; }
.welcome .lead { font-size: 18px; color: var(--mu); margin-top: 12px; max-width: 32ch; }
.feats { display: grid; gap: 16px; margin: 36px 0 32px; flex: 1; align-content: start; }
.feat { display: flex; gap: 14px; align-items: center; font-weight: 600; }
.feat .ico { width: 44px; height: 44px; border-radius: 14px; }

/* profile & history */
.prof { display: flex; align-items: center; gap: 16px; }
.avatar { width: 64px; height: 64px; border-radius: 22px; background: var(--grad); display: grid; place-items: center; font-size: 28px; font-weight: 800; color: #fff; flex: none; }
.install { display: flex; gap: 14px; align-items: flex-start; }
.install p { font-size: 14.5px; margin-top: 4px; }
.install p b { color: var(--tx); }
.rows { display: grid; }
.rowi { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.rowi:last-child { border-bottom: 0; }
.rowi span { color: var(--mu); }
.rowi b { font-variant-numeric: tabular-nums; text-align: right; }
.rowi.hl b { color: var(--ac); }
.src { list-style: none; display: grid; gap: 10px; margin-top: 12px; }
.src li { position: relative; padding-left: 18px; font-size: 14.5px; }
.src li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--ac); }
.src li span { color: var(--mu); }
.hist { background: var(--s1); border: 1px solid var(--line); border-radius: 20px; margin-bottom: 10px; overflow: hidden; }
.hist-btn { display: block; width: 100%; text-align: left; padding: 16px; }
.hist-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hist-top b { font-size: 17px; }
.hist .meta { margin: 10px 0 0; }
.hist-detail { border-top: 1px solid var(--line); margin: 0 16px; padding: 14px 0 6px; display: grid; gap: 12px; }
.hd b { font-size: 15px; }
.hd p { font-size: 14px; color: var(--mu); font-variant-numeric: tabular-nums; margin-top: 2px; }
.empty { text-align: center; padding: 44px 24px; }
.empty .ico { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 14px; }
.empty .ico .i { width: 26px; height: 26px; }
.empty p { margin-top: 6px; }

/* hero warning note */
.hero .hero-note { display: flex; gap: 8px; align-items: flex-start; }
.hero .hero-note .i { width: 18px; height: 18px; margin-top: 2px; }
.hero .hero-note.warn { background: rgba(0, 0, 0, .28); font-weight: 700; }

/* coach cards */
.coaches { display: grid; gap: 10px; }
.coach { display: flex; gap: 12px; align-items: flex-start; background: var(--s1); border: 1px solid var(--line); border-radius: 20px; padding: 14px; }
.coach > div { flex: 1; }
.coach b { display: block; font-size: 15.5px; }
.coach p { font-size: 14.5px; color: var(--mu); margin-top: 2px; }
.coach.or { border-color: rgba(255, 106, 61, .35); } .coach.or .ico { background: rgba(255, 106, 61, .15); color: var(--ac); }
.coach.bl { border-color: rgba(96, 165, 250, .3); } .coach.bl .ico { background: rgba(96, 165, 250, .14); color: var(--bl); }
.coach.gr .ico { background: var(--okbg); color: var(--ok); }
.screen.wk .coach { margin-bottom: 14px; }
.coach-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* daily checklist */
.score { font-size: 15px; font-weight: 800; padding: 5px 12px; border-radius: 99px; background: var(--s2); color: var(--mu); font-variant-numeric: tabular-nums; }
.score.good { background: var(--okbg); color: var(--ok); }
.checks { display: grid; gap: 4px; }
.ck { display: flex; align-items: center; gap: 8px; border-radius: 14px; }
.ck-main { flex: 1; display: flex; align-items: center; gap: 12px; padding: 8px 4px; min-height: 52px; text-align: left; width: 100%; }
.ck-box { width: 28px; height: 28px; border-radius: 9px; box-shadow: inset 0 0 0 2px var(--s3); display: grid; place-items: center; color: transparent; flex: none; transition: background .15s; }
.ck-box .i { width: 16px; height: 16px; stroke-width: 3; }
.ck.on .ck-box { background: var(--ok); box-shadow: none; color: #04261A; }
.ck-txt { flex: 1; display: block; }
.ck-txt b { display: block; font-size: 15.5px; font-weight: 650; }
.ck.on .ck-txt b { color: var(--mu); }
.ck-txt small { display: block; font-size: 13px; color: var(--mu); font-variant-numeric: tabular-nums; }
.ck-bar { display: block; height: 4px; border-radius: 4px; background: var(--s2); margin-top: 6px; overflow: hidden; max-width: 220px; }
.ck-bar i { display: block; height: 100%; background: var(--grad); border-radius: 4px; }
.ck-go { color: var(--mu2); }
.ck-step { display: flex; gap: 6px; }
.ck-step button { width: 40px; height: 40px; border-radius: 12px; background: var(--s2); display: grid; place-items: center; }
.ck-step .i { width: 18px; height: 18px; }

/* weight form */
.wform { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.wform .btn { width: auto; height: 54px; padding: 0 22px; }

/* food */
.datenav { display: flex; align-items: center; gap: 8px; }
.datenav b { min-width: 84px; text-align: center; font-size: 15px; }
.meters { display: grid; gap: 18px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meter-top span { font-weight: 700; }
.meter-top b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-top b small { font-size: 14px; color: var(--mu); font-weight: 600; }
.mbar { height: 10px; border-radius: 10px; background: var(--s2); overflow: hidden; margin: 8px 0 6px; }
.mbar i { display: block; height: 100%; border-radius: 10px; transition: width .35s ease; }
.meter.kc .mbar i { background: linear-gradient(90deg, var(--bl), #818CF8); }
.meter.pr .mbar i { background: var(--grad); }
.meter small { font-size: 13px; font-weight: 600; }
.meter small.ok, .ok { color: var(--ok); }
.warn { color: var(--yl); }
.foods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.food { text-align: left; background: var(--s1); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; gap: 2px; transition: transform .12s, border-color .12s; }
.food:active { transform: scale(.96); border-color: var(--ac); }
.food b { font-size: 15px; line-height: 1.25; }
.food small { font-size: 12.5px; color: var(--mu); }
.food span { font-size: 13px; font-weight: 700; color: var(--ac); margin-top: 4px; font-variant-numeric: tabular-nums; }
.food.mine { border-color: rgba(255, 106, 61, .3); }
.flist { display: grid; margin-top: 6px; }
.fl { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fl:last-child { border-bottom: 0; }
.fl > div:first-child { flex: 1; }
.fl b { display: block; font-size: 15px; }
.fl small { display: block; font-size: 13px; color: var(--mu); font-variant-numeric: tabular-nums; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty b { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.qty button { width: 36px; height: 36px; border-radius: 11px; background: var(--s2); display: grid; place-items: center; }
.qty .i { width: 16px; height: 16px; }
.empty-line { padding: 10px 0; font-size: 14.5px; }
.tick { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-weight: 600; cursor: pointer; }
.tick input { position: absolute; opacity: 0; pointer-events: none; }
.tick span { width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--s3); display: grid; place-items: center; color: transparent; }
.tick span .i { width: 16px; height: 16px; stroke-width: 3; }
.tick input:checked + span { background: var(--ac); box-shadow: none; color: #fff; }
.tick input:focus-visible + span { outline: 2px solid var(--ac); }
.ta { height: auto; padding: 14px 16px; line-height: 1.45; resize: vertical; font: inherit; font-size: 16px; }

/* workout suggestion */
.sug { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; font-weight: 600; padding: 10px 12px; border-radius: 12px; margin: 0 0 10px; background: var(--s2); color: var(--mu); }
.sug .i { width: 16px; height: 16px; margin-top: 2px; }
.sug.m-up { background: var(--okbg); color: var(--ok); }
.sug.m-down { background: rgba(251, 191, 36, .1); color: var(--yl); }
.sug.m-same { background: rgba(255, 106, 61, .1); color: #FFA07F; }
.sug.m-deload { background: rgba(96, 165, 250, .1); color: var(--bl); }

/* progress */
.segs { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.segs i { height: 10px; border-radius: 4px; background: var(--s2); }
.segs i.past { background: var(--ac); opacity: .55; }
.segs i.now { background: var(--grad); box-shadow: 0 0 0 2px rgba(255, 106, 61, .35); }
.segs i.dl { background: rgba(96, 165, 250, .35); }
.segs i.dl.past { background: var(--bl); opacity: .6; }
.segs i.dl.now { background: var(--bl); }
.chart { position: relative; height: 210px; margin-top: 4px; }
.chart svg { display: block; position: absolute; inset: 0; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .yl, .chart .xl { fill: var(--mu2); font-size: 11px; font-weight: 600; font-family: inherit; }
.chart .ln { fill: none; stroke: var(--ac); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { fill: var(--ac); }
.chart .dot-faint { fill: var(--mu); opacity: .55; }
.chart .dot-last { fill: var(--bg); stroke: var(--ac); stroke-width: 3; }
.chart .vl { fill: var(--tx); font-size: 13px; font-weight: 800; font-family: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip-btn { height: 36px; padding: 0 14px; border-radius: 99px; background: var(--s2); font-size: 14px; font-weight: 700; color: var(--mu); }
.chip-btn.on { background: var(--ac); color: #fff; }
.mtable { display: grid; margin-top: 4px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.mrow:last-child { border-bottom: 0; }
.mrow span:not(:first-child) { text-align: right; font-weight: 700; }
.mrow.head { font-size: 12px; font-weight: 700; color: var(--mu2); padding-top: 0; }
.mrow.head span { font-weight: 700; }
.wlist { display: grid; gap: 8px; }
.wrow { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 58px); gap: 6px; align-items: center; width: 100%; text-align: left; background: var(--s1); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.wrow b { display: block; font-size: 15px; }
.wrow small { display: block; font-size: 12px; color: var(--mu); font-weight: 600; }
.wstat { text-align: right; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.wstat.ok { color: var(--ok); }

/* learn */
.linkcard { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
.linkcard > span:nth-child(2) { flex: 1; }
.linkcard b { display: block; font-size: 17px; }
.linkcard small { display: block; color: var(--mu); font-size: 14px; }
.linkcard > .i { color: var(--mu2); }
.lsec .h2 { margin-bottom: 10px; }
.list { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.li:last-child { border-bottom: 0; }
.li > span { flex: 1; }
.li b { display: block; font-size: 15.5px; }
.li small { display: block; font-size: 13.5px; color: var(--mu); margin-top: 2px; line-height: 1.45; }
.li > .i { color: var(--mu2); width: 18px; height: 18px; }
#learn-q { margin-top: 4px; }

/* exercise demo: start/end photos cross-fading on a loop */
.demo { position: relative; overflow: hidden; background: #fff; border-radius: 18px; aspect-ratio: 3 / 2; }
.demo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.demo .d2 { opacity: 0; animation: demo 3.2s ease-in-out infinite; }
.demo.lg { margin: 0 -6px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.demo.sm { width: 84px; border-radius: 14px; flex: none; }
.dlab { position: absolute; left: 10px; bottom: 10px; }
.dlab b { display: inline-block; font-size: 12.5px; font-weight: 800; color: #fff; background: rgba(11, 13, 17, .78); padding: 4px 10px; border-radius: 99px; }
.dlab b.d2 { position: absolute; left: 0; top: 0; background: var(--ac); }
@keyframes demo { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
.thumb { position: relative; flex: none; border-radius: 14px; }
.thumb:active { transform: scale(.95); }
.thumb-i { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--ac); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--s1); }
.thumb-i .i { width: 15px; height: 15px; stroke-width: 2.5; }
.ex-top { align-items: center; }
.ex-name .ex-n { display: inline-grid; width: 24px; height: 24px; border-radius: 8px; font-size: 12px; margin-right: 8px; vertical-align: -4px; }
.ex-name .ex-n .i { width: 14px; height: 14px; }
.gear .find { color: var(--mu); font-size: 15px; margin-top: 4px; }
.how.setup { padding-left: 18px; }
.how.setup li::marker { color: var(--bl); }
.li-img { width: 56px; height: 40px; object-fit: cover; border-radius: 10px; background: #fff; flex: none; }

/* sync */
.chip.okc { background: var(--okbg); color: var(--ok); }
.chip.bad { background: rgba(248, 113, 113, .14); color: var(--bad); }
.err-note { color: var(--bad); }

/* small phones (iPhone SE 1st gen) */
@media (max-width: 359px) {
  .set { grid-template-columns: 26px 0 minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 6px; }
  .prev { visibility: hidden; }
  .stats { gap: 8px; } .stat { padding: 12px; }
}

@keyframes slide { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 24px); } }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -12px); } }
@keyframes float { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* the exercise demo is instructions, not decoration: keep it, but swap photos without fading */
  .demo .d2 { animation: demo-swap 3.2s step-end infinite !important; }
}
@keyframes demo-swap { 0% { opacity: 0; } 50% { opacity: 1; } }
