/* Lift 2: one dark look for the gym floor. Near-black ground, one blue for actions,
   green for finished sets, gold for records. Barlow for text, its condensed cut for numbers and names. */
:root {
  --bg: #0D0E10;
  --card: #16181B;
  --card2: #1E2125;
  --line: #26292E;
  --line2: #1A1C20;
  --ink: #F3F3F1;
  --ink2: #9097A0;
  --ink3: #767C85;
  --accent: #7AA8FF;          /* blue as text and icons */
  --accent-bg: #2F6FE4;       /* blue as a fill, white text on it */
  --accent-soft: #132038;
  --up: #A9C6FF;
  --on-accent: #fff;
  --good: #2FA866;
  --good-soft: #12251A;
  --danger: #FF5A5F;
  --gold: #E8B04B;
  --warm: #E8B04B;
  --drop: #B48CFF;
  --scrim: rgba(0, 0, 0, .6);
  --radius: 16px;
  --tabs-h: 64px;
  --cond: 'Barlow Semi Condensed', Barlow, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 Barlow, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  padding-top: var(--safe-t);
  padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 16px);
  overscroll-behavior-y: none;
}
body.full { padding-bottom: calc(var(--safe-b) + 96px); }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
input, select { -webkit-appearance: none; appearance: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.dim { color: var(--ink3); width: 18px; height: 18px; }
.ic.up { transform: rotate(180deg); }
main { max-width: 640px; margin: 0 auto; outline: none; }
.pad { padding: 0 16px; }

/* ---------- headers ---------- */
.head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 12px; }
.head h1 { font-family: var(--cond); font-size: 32px; line-height: 1.1; margin: 0; font-weight: 700; }
.bar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 8px) 12px 8px;
  margin-top: calc(-1 * var(--safe-t));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.bar > :first-child { justify-self: start; }
.bar > :last-child { justify-self: end; }
.bar-mid { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.bar-mid b { font-weight: 600; }
.title { font-family: var(--cond); font-size: 30px; line-height: 1.1; font-weight: 700; margin: 8px 0 2px; }
.sub { color: var(--ink2); margin: 0 0 16px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 600;
  transition: transform .12s var(--ease), background-color .15s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.block { display: flex; width: 100%; margin: 12px 0; }
.btn.big { min-height: 52px; font-size: 16px; }
.btn.sm { min-height: 36px; padding: 0 16px; border-radius: 10px; font-size: 15px; }
.btn.primary { background: var(--accent-bg); color: var(--on-accent); }
.btn.primary:disabled { opacity: .45; }
.btn.soft { background: var(--card2); }
.btn.ghost { color: var(--ink2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { color: var(--danger); margin-top: 4px; }
.link { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; }
.link .ic { width: 18px; height: 18px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--ink2); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn:active { background: var(--card2); }
.icon-btn:disabled { opacity: .3; }
.pill { min-height: 36px; padding: 0 14px; border-radius: 18px; background: var(--card2); font-weight: 600; }
.pill.accent { background: var(--accent-bg); color: var(--on-accent); }

/* ---------- cards ---------- */
.card { display: block; width: 100%; text-align: left; background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
button.card:active { background: var(--card2); }
.empty-card { background: var(--card); border-radius: var(--radius); padding: 20px 18px; text-align: center; color: var(--ink2); margin: 12px 0; }
.empty-card p { margin: 0 0 6px; }
.empty-card b { color: var(--ink); font-size: 16px; }
.empty-card .btn { margin-top: 10px; }
.empty { color: var(--ink2); text-align: center; padding: 24px 8px; margin: 0; }
.hint { color: var(--ink3); font-size: 13px; margin: 4px 2px 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 8px; }
.sec-head h2, .month { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); font-weight: 600; margin: 0; }
.month { margin: 24px 2px 10px; }

.now { display: flex; align-items: center; gap: 12px; border: 1px solid var(--good-soft); }
.now > span:nth-child(2) { flex: 1; display: grid; }
.now small, .routine-ex, .wk small, .row small, .r-name small { color: var(--ink2); font-size: 13px; }

.routine-top { display: flex; align-items: center; gap: 10px; margin: -6px -8px 0 0; }
.routine-top b { flex: 1; font-family: var(--cond); font-size: 22px; font-weight: 700; }
.routine-ex { margin: 2px 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.routine .btn.block { margin: 0; min-height: 42px; }

/* ---------- stats ---------- */
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 16px; }
.stats3 > div { background: var(--card); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.stats3 small, .recs small { display: block; color: var(--ink2); font-size: 12px; }
.stats3 b { font-family: var(--cond); font-size: 20px; font-weight: 600; white-space: nowrap; }
.recs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.recs .card { margin: 0; padding: 12px 14px; }
.recs b { font-family: var(--cond); font-size: 24px; font-weight: 700; }

/* ---------- active workout ---------- */
.wk-name {
  width: 100%; border: 0; background: none; font-family: var(--cond); font-size: 28px; font-weight: 700;
  padding: 6px 0; margin: 4px 0 8px; border-radius: 8px;
}
.wk-name::placeholder { color: var(--ink3); }
.wk-name:focus { outline: none; box-shadow: 0 2px 0 var(--accent); border-radius: 0; }

.ex { padding: 16px 0 10px; border-bottom: 1px solid var(--line2); }
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ex-name { display: inline-flex; align-items: center; gap: 12px; color: var(--accent); font-weight: 600; font-size: 17px; text-align: left; padding: 2px 0; min-height: 44px; }
.ex-head .icon-btn { margin-right: -6px; }
.ex-note { width: 100%; border: 0; background: none; color: var(--ink2); font-size: 14px; padding: 2px 4px 6px; }
.ex-note:focus { outline: none; color: var(--ink); }
.ex-note::placeholder { color: var(--ink3); }
.rest-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 14px; font-weight: 600; min-height: 32px; }
.rest-chip .ic { width: 16px; height: 16px; }

.sets { --cols: 40px minmax(0, 1fr) 64px 56px 44px; }
.sets.k-r, .sets.k-t { --cols: 40px minmax(0, 1fr) 80px 44px; }
.sets-head, .set-row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 6px; }
.sets-head { font-size: 12px; font-weight: 600; color: var(--ink3); text-transform: uppercase; letter-spacing: .04em; padding: 0 4px 4px; }
.sets-head span { text-align: center; }
.sets-head span:nth-child(2) { text-align: left; }
.sets-head .ic { width: 16px; height: 16px; vertical-align: -3px; }
.set-swipe { position: relative; margin-bottom: 2px; border-radius: 10px; }
.set-del { position: absolute; inset: 0; border-radius: 10px; background: var(--danger); color: #fff; display: flex; align-items: center; justify-content: flex-end; padding-right: 18px; font-weight: 600; font-size: 14px; opacity: 0; }
.set-swipe.dragging .set-del { opacity: 1; }
.set-row { position: relative; padding: 4px; border-radius: 10px; background-color: var(--bg); touch-action: pan-y; transition: background-color .2s, transform .2s var(--ease); }
.set-row.done { background: linear-gradient(var(--good-soft), var(--good-soft)) var(--bg); }
.set-no {
  height: 34px; border-radius: 8px; font-weight: 600; background: var(--card2); display: grid; place-items: center; font-size: 14px;
}
.set-no.t-w { color: var(--warm); }
.set-no.t-d { color: var(--drop); }
.set-no.t-f { color: var(--danger); }
.prev { display: flex; align-items: center; gap: 6px; text-align: left; color: var(--ink2); font-size: 14px; white-space: nowrap; overflow: hidden; height: 34px; padding: 0 2px; }
.prev span { overflow: hidden; text-overflow: ellipsis; }
.in {
  width: 100%; height: 36px; border: 0; border-radius: 8px; background: var(--card2); text-align: center; font-family: var(--cond); font-weight: 600; font-size: 18px; padding: 0 4px;
}
.in::placeholder { color: var(--ink3); font-weight: 500; }
.in:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent); }
.set-row.done .in, .set-row.done .set-no { background: transparent; }
.tick { height: 34px; border-radius: 8px; background: var(--card2); display: grid; place-items: center; color: var(--ink3); }
.tick .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.set-row.done .tick { background: var(--good); color: #fff; }
.set-row.pop .tick { animation: pop .28s var(--ease); }
@keyframes pop { 40% { transform: scale(1.15); } }
.set-row.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.add-set { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; margin-top: 4px; border-radius: 10px; color: var(--ink2); font-weight: 600; font-size: 14px; }
.add-set:active { background: var(--card2); }
.add-set .ic { width: 16px; height: 16px; }

/* ---------- rest timer ---------- */
.rest {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 0 16px calc(var(--safe-b) + 10px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .25);
}
.rest-bar { height: 3px; margin: 0 -16px 10px; background: var(--line); }
.rest-bar i { display: block; height: 100%; background: var(--accent-bg); transform-origin: left; transition: transform .5s linear; }
.rest-row { display: flex; align-items: center; gap: 8px; max-width: 608px; margin: 0 auto; }
.rest-mid { flex: 1; display: grid; justify-items: center; line-height: 1.15; }
.rest-label { font-size: 12px; color: var(--ink2); }
.rest-mid b { font-family: var(--cond); font-size: 30px; font-weight: 700; }
.rest.over .rest-mid b, .rest.over .rest-label { color: var(--good); }

/* ---------- resume bar + tabs ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabs[hidden] { display: none; }
.tabs button { display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--ink3); font-size: 11px; font-weight: 600; }
.tabs .ic { width: 24px; height: 24px; }
.tabs button.on { color: var(--ink); }
.resume {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + var(--safe-b) + 8px); z-index: 11;
  display: flex; align-items: center; gap: 12px; max-width: 616px; margin: 0 auto;
  padding: 10px 14px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); text-align: left;
}
.resume[hidden] { display: none; }
.resume-text { flex: 1; display: grid; line-height: 1.25; }
.resume-text span { color: var(--ink2); font-size: 13px; }
.resume-go { color: var(--accent); font-weight: 600; }
.resume-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
body:has(.resume:not([hidden])) { padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 84px); }

/* ---------- lists ---------- */
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 0 12px; height: 44px; color: var(--ink3); }
.search input { flex: 1; border: 0; background: none; height: 100%; font-size: 16px; color: var(--ink); min-width: 0; }
.search input:focus { outline: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--card); color: var(--ink2); font-size: 13px; font-weight: 600; }
.chip.on { background: var(--ink); color: var(--bg); }
.list { padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 12px 11px 16px; min-height: 56px; position: relative; }
.row + .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
.row > span { flex: 1; display: grid; min-width: 0; }
.row b { font-weight: 500; }
.row em { font-style: normal; color: var(--ink3); font-size: 13px; }
.row:active { background: var(--card2); }

.wk { display: grid; gap: 8px; }
.wk-top { display: grid; }
.wk-top b { font-size: 17px; }
.wk-stats { display: flex; flex-wrap: wrap; gap: 14px; color: var(--ink2); font-size: 13px; }
.wk-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.wk-stats .ic { width: 15px; height: 15px; }
.gold { color: var(--gold); }
.wk-ex { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 3px; font-size: 14px; }
.wk-ex span { color: var(--ink3); display: inline-block; min-width: 28px; }
.wk-ex .more { color: var(--ink3); }

.d-ex { display: grid; gap: 4px; }
.d-ex .ex-name { padding: 0 0 4px; }
.d-note { margin: 0 0 4px; color: var(--ink2); font-size: 14px; }
.d-set { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; font-size: 15px; }
.d-set .set-no { height: 26px; font-size: 13px; }
.d-set small { color: var(--ink3); font-size: 12px; }
.d-pr { display: flex; align-items: center; gap: 6px; color: var(--gold); font-size: 13px; margin: 6px 0 0; }
.d-pr .ic { width: 16px; height: 16px; }
.hist-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.hist-top small { color: var(--ink2); }

/* ---------- routine editor ---------- */
.r-item { padding: 12px 0; border-bottom: 1px solid var(--line2); }
.r-name { flex: 1; display: grid; min-width: 0; }
.r-name b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper { display: inline-flex; align-items: center; background: var(--card2); border-radius: 10px; }
.stepper button { width: 32px; height: 34px; font-size: 18px; color: var(--ink2); }
.stepper b { min-width: 20px; text-align: center; }
.r-tools { display: inline-flex; }

/* ---------- summary ---------- */
.summary { text-align: center; padding-top: 48px; }
.summary h1 { font-family: var(--cond); font-size: 40px; line-height: 1; margin: 16px 0 6px; }
.summary .stats3 { text-align: left; margin-top: 20px; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; margin: 0 auto; animation: pop .4s var(--ease); }
.done-mark .ic { width: 32px; height: 32px; stroke-width: 2.4; }
.prs { text-align: left; }
.prs-title { display: flex; align-items: center; gap: 8px; color: var(--gold); font-weight: 600; margin: 0 0 8px; }
.pr-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.pr-row span { display: grid; }
.pr-row small { color: var(--ink2); font-size: 12px; }

/* ---------- charts ---------- */
.chart-card { padding: 14px 12px 12px; }
.chart-title { margin: 0 4px 8px; font-size: 13px; color: var(--ink2); font-weight: 500; }
.chart-foot { margin: 8px 4px 0; font-size: 13px; color: var(--ink2); }
.chart { position: relative; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.faint { stroke-dasharray: 2 4; }
.chart .axis { fill: var(--ink3); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .dot:not(.last) { r: 3; }
.chart .bar { fill: color-mix(in srgb, var(--accent) 55%, var(--card)); }
.chart .bar.now { fill: var(--accent); }
.chart .hit { fill: transparent; }
.chart .cross-line { stroke: var(--ink3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .cross-dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart-empty { color: var(--ink3); font-size: 14px; text-align: center; padding: 36px 8px; margin: 0; }
.tip { position: absolute; top: -6px; background: var(--ink); color: var(--bg); border-radius: 8px; padding: 5px 9px; font-size: 13px; line-height: 1.25; pointer-events: none; display: grid; white-space: nowrap; }
.tip[hidden] { display: none; }
.tip small { opacity: .75; font-size: 11px; }

/* ---------- profile ---------- */
.settings { padding: 4px 16px; }
.set-line { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 12px; }
.set-line + .set-line { border-top: 1px solid var(--line); }
.set-line select { background: var(--card2); border: 0; border-radius: 8px; padding: 6px 12px; font-weight: 600; }
.set-note { color: var(--ink2); font-size: 14px; margin: 10px 0; }
.set-note.dim { color: var(--ink3); font-size: 13px; }
.set-note.warn { color: var(--gold); font-size: 13px; }
.settings .row2 { margin: 0; }
.foot { text-align: center; color: var(--ink3); font-size: 12px; margin: 24px 0 8px; }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .22s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto;
  background: var(--card); border-radius: 18px 18px 0 0;
  padding: 8px 16px calc(var(--safe-b) + 16px);
  max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(100%); transition: transform .26s var(--ease);
}
.sheet.tall { height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.sheet-wrap.open .scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; flex: none; }
.sheet-title { font-weight: 700; font-size: 17px; margin: 4px 0 12px; }
.sheet-text { color: var(--ink2); margin: -4px 0 16px; }
.menu { display: grid; background: var(--card2); border-radius: 12px; overflow: hidden; }
.menu button { min-height: 50px; text-align: left; padding: 0 16px; font-weight: 500; }
.menu button + button { border-top: 1px solid var(--line); }
.menu button:active { background: var(--line); }
.menu .danger { color: var(--danger); }
.menu + .btn { margin-bottom: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.pick-head { display: flex; justify-content: space-between; align-items: center; }
.pick-head .sheet-title { margin: 0; }
.sheet .search { background: var(--card2); flex: none; margin-top: 8px; }
.sheet .chip { background: var(--card2); }
.sheet .chip.on { background: var(--ink); }
.sheet .chips, .sheet .chipbox { flex: none; }
.chips.sub { padding-top: 0; }
.chips.sub .chip { height: 28px; font-size: 12px; }
.pick-list { flex: 1; overflow-y: auto; margin: 0 -16px; padding: 0 8px; overscroll-behavior: contain; }
.pick-row { display: flex; align-items: center; border-radius: 10px; min-height: 56px; }
.pick-row:has(.pick-main:active) { background: var(--card2); }
.pick-peek { position: relative; flex: none; padding: 8px 6px 8px 8px; border-radius: 10px; }
.pick-peek:active .thumb { opacity: .7; }
.peek-dot { position: absolute; right: 0; bottom: 4px; width: 17px; height: 17px; border-radius: 50%; background: var(--card2); border: 1.5px solid var(--card); color: var(--ink2); font: 700 11px/14px var(--cond); text-align: center; }
.pick-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 8px 10px 6px; min-height: 56px; }
.peek-body { flex: 1; overflow-y: auto; margin: 0 -16px; padding: 0 16px 12px; overscroll-behavior: contain; }
.peek-title { margin-bottom: 4px; }
.peek-body .flip { margin: 4px 0 16px; border-radius: 12px; }
.peek-go { flex: none; margin-top: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.pick-row.on { background: var(--accent-soft); }
.pick-txt { flex: 1; display: grid; min-width: 0; }
.pick-txt b { font-weight: 500; }
.pick-txt small { color: var(--ink2); font-size: 13px; }
.pick-mark { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.pick-row.on .pick-mark { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--on-accent); }
.pick-go { flex: none; margin-bottom: 0; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--ink2); font-weight: 500; }
.field input, .field select { height: 46px; border: 0; border-radius: 10px; background: var(--card2); padding: 0 12px; font-size: 16px; width: 100%; }
.field input:focus, .field select:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent); }
.field .row2 { margin: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { min-height: 38px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink2); padding: 0 12px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.seg button:disabled:not(.on) { opacity: .4; }
.seg.sm button { min-height: 32px; min-width: 48px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); z-index: 60;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: opacity .2s, transform .2s var(--ease); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.act.show { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 4px 4px 4px 16px; }
.toast-undo { color: var(--accent-bg); font-weight: 700; min-height: 36px; padding: 0 12px; border-radius: 8px; }

/* ---------- reorder ---------- */
.ro-list { display: grid; gap: 6px; margin-bottom: 14px; }
.ro-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; min-height: 56px; border-radius: 12px; background: var(--card2); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.ro-row img { pointer-events: none; -webkit-user-drag: none; }
.ro-list.sorting .ro-row { transition: transform .16s var(--ease); }
.ro-list .ro-row.lifted { transition: none; position: relative; z-index: 1; background: var(--line); box-shadow: 0 10px 24px rgba(0, 0, 0, .45); cursor: grabbing; }
.ro-txt { flex: 1; min-width: 0; display: grid; }
.ro-txt b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ro-txt small { color: var(--ink2); font-size: 13px; }
.ic.grip { color: var(--ink3); flex: none; }

/* ---------- Lift 2 ---------- */
a.btn { text-decoration: none; color: inherit; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.accent { color: var(--accent); }
.label { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.brand { font-family: var(--cond); font-size: 24px; font-weight: 700; letter-spacing: .02em; }
.head-date { color: var(--ink2); font-size: 14px; }
.thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; background: var(--card2); }
.thumb.round { border-radius: 50%; }
.glyph { display: grid; place-items: center; color: var(--ink3); }
.glyph .ic { width: 20px; height: 20px; }
.ic.upc { width: 14px; height: 14px; color: var(--accent); stroke-width: 2.6; }
.ic.sep { width: 12px; height: 12px; color: var(--ink3); }

/* today */
.next { margin: 4px 0 14px; }
.next-top { display: flex; align-items: center; justify-content: space-between; }
.next-name { font-family: var(--cond); font-size: 52px; line-height: .95; font-weight: 700; letter-spacing: -.01em; margin: 4px 0 8px; overflow-wrap: anywhere; }
.next-sub { margin: 0; color: var(--ink2); }
.t-list { padding: 2px 14px; }
.t-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; text-align: left; }
.t-row + .t-row { border-top: 1px solid var(--line2); }
.t-txt { flex: 1; display: grid; min-width: 0; }
.t-txt b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-txt small, .t-wt small { color: var(--ink2); font-size: 13px; }
.t-wt { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.t-wt b { font-family: var(--cond); font-size: 19px; font-weight: 600; }
.btn .ic { width: 18px; height: 18px; }
.row2.quiet { margin: -4px 0 4px; }
.row2.quiet .btn { min-height: 44px; font-size: 15px; }
.sec-head small { color: var(--ink2); font-size: 14px; }
.chain { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.link-chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--card); color: var(--ink2); font-size: 15px; }
.link-chip.next { background: none; box-shadow: inset 0 0 0 1.5px var(--accent-bg); color: var(--ink); font-weight: 600; }
.link-chip .ic { width: 14px; height: 14px; color: var(--good); stroke-width: 3; }
.days { display: flex; justify-content: space-between; gap: 4px; }
.day { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink2); font-weight: 600; font-size: 15px; position: relative; transition: background-color .15s, color .15s; }
.day.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.day.today::after { content: ''; position: absolute; bottom: -9px; left: 50%; width: 4px; height: 4px; border-radius: 2px; background: var(--accent); transform: translateX(-50%); }
.days + .hint { margin: 16px 2px 0; font-size: 14px; color: var(--ink2); }
.hint.top { margin: 0 2px 12px; font-size: 14px; }
.empty-card.big { padding: 24px 18px 18px; }
.empty-card .btn.block { margin: 10px 0 0; }
.empty-card .btn.soft { color: var(--ink); }

/* routines */
.r-no { width: 26px; height: 26px; border-radius: 13px; background: var(--card2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink2); flex: none; }
.badge { font-size: 12px; font-weight: 700; color: var(--up); background: var(--accent-soft); border-radius: 6px; padding: 3px 8px; }
.r-thumbs { display: flex; gap: 6px; margin: 12px 0 8px; }
.r-thumbs .thumb { width: 34px; height: 34px; border-radius: 8px; }
.routine .btn.block { margin: 4px 0 0; }

/* routine editor */
.r-top { display: flex; align-items: center; gap: 12px; }
.r-ctl { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0 52px; }
.stepper small { color: var(--ink2); font-size: 13px; margin: 0 2px 0 4px; }
.range select { height: 34px; border: 0; border-radius: 10px; padding: 0 34px 0 14px; font-weight: 600; font-size: 15px;
  background: var(--card2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239097A0' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px; }
.range select:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent); }

/* active workout */
.ex-head .ex-name span { overflow-wrap: anywhere; }
.ex-meta { display: flex; align-items: center; gap: 14px; color: var(--ink2); font-size: 14px; }
.sug { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.35; border-radius: 10px; padding: 8px 10px; margin: 6px 0 2px; }
.sug .ic { width: 15px; height: 15px; stroke-width: 2.6; margin-top: 1px; }
.sug.up { background: var(--accent-soft); color: var(--up); }
.sug.hold { background: var(--card); color: var(--ink2); }
.in.up::placeholder { color: var(--up); font-weight: 600; }
.set-row.done .tick { background: var(--good); }
.pr { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #1A1405; background: var(--gold); border-radius: 4px; padding: 1px 5px; flex: none; }

/* summary */
.nt, .upnext { text-align: left; }
.nt-title { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); margin: 0 0 4px; }
.nt-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.nt-row > span:last-child { color: var(--ink2); white-space: nowrap; }
.nt-row b { font-family: var(--cond); font-size: 17px; white-space: nowrap; }
.upnext { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.upnext > span:first-child { display: grid; }
.upnext small { color: var(--ink2); font-size: 13px; }
.upnext b { font-family: var(--cond); font-size: 24px; }
.upnext-when { color: var(--ink2); }

/* exercise: photos, tabs, steps */
.flip { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; max-height: 320px; overflow: hidden; background: var(--card); margin: 8px 0 16px; padding: 0; }
@media (min-width: 640px) { .flip { max-width: 608px; margin: 8px auto 16px; border-radius: 14px; } }
.flip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flip img.b { animation: flipfade 3s ease-in-out infinite; }
.flip.paused img.b { animation-play-state: paused; }
@keyframes flipfade { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }
.flip-tag { position: absolute; left: 12px; top: 12px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(13, 14, 16, .72); border-radius: 6px; padding: 4px 8px; }
.seg-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.seg-tabs button { min-height: 44px; font-weight: 600; color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg-tabs button.on { color: var(--ink); border-bottom-color: var(--accent-bg); }
.muscles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.muscles .chip { display: inline-flex; align-items: center; }
.chip.main { background: var(--accent-soft); color: var(--up); }
.steps { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; gap: 12px; line-height: 1.45; color: #DCDEE1; }
.steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: 13px; background: var(--card2); display: grid; place-items: center; font-family: var(--cond); font-weight: 700; font-size: 15px; color: var(--ink2); }
.credit { color: var(--ink3); font-size: 12px; text-align: center; margin: 4px 0 0; }

/* lists */
.pick-sec { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); margin: 18px 8px 6px; }
.pick-hint { color: var(--ink2); font-size: 14px; text-align: center; padding: 14px 8px; margin: 0; }
.search.top { margin-top: 4px; }
.row .thumb { margin: -4px 0; }
.list .row > .ic:first-child { color: var(--ink2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  /* No looping photo: tap it to see the finish position. */
  .flip img.b { animation: none !important; opacity: 0; }
  .flip.paused img.b { opacity: 1; }
}

/* Find exercises */
.ask { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.ask .search { flex: 1; }
.ask .btn { min-height: 44px; }
.ask-answer { color: var(--ink2); font-size: 15px; line-height: 1.45; margin: 12px 2px; }
.hint.warn { color: var(--danger); }
.f-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 12px; position: relative; }
.f-row + .f-row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
.f-main { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; min-height: 48px; }
.f-main > span:last-child { display: grid; min-width: 0; }
.f-main b { font-weight: 500; }
.f-main small { color: var(--ink2); font-size: 13px; }
.f-in { color: var(--ink3); font-size: 13px; flex: none; }
.f-row .btn.sm { flex: none; }
.mbars { display: grid; gap: 8px; padding: 14px 16px; }
.mbar { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 10px; font-size: 14px; }
.mbar i { height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.mbar i b { display: block; height: 100%; background: var(--accent-bg); border-radius: 4px; }
.mbar em { font-style: normal; text-align: right; color: var(--ink2); font-variant-numeric: tabular-nums; }
.mbar.low span, .mbar.low em { color: var(--ink3); }
.mbar.low i b { background: var(--ink3); }
.to-routine { margin-top: 10px; }
