/* Workout redesign: Today, the workout screen, sheets, exercise page, Train history.
   Colours come only from theme tokens (style.css) so light and dark both work; the
   fallbacks cover the tokens added with the theme switch. */

/* ── Shared bits ─────────────────────────────────────────────────────────── */
.w-chip {
  display: inline-flex; align-items: center; gap: .3rem; border-radius: 99px; padding: .28rem .7rem;
  font-size: .78rem; font-weight: 600; background: var(--bg3); color: var(--muted);
  border: 1px solid var(--border); cursor: pointer; white-space: nowrap; font-family: inherit;
}
.w-chip.acc { background: var(--accent-soft, rgba(255,140,66,.12)); color: var(--accent); border-color: var(--accent-line, rgba(255,140,66,.35)); }
.w-chip.gold { background: var(--accent2-soft, rgba(255,209,102,.12)); color: var(--accent2); border-color: var(--accent2-line, rgba(255,209,102,.3)); }
.w-link { display: inline-flex; align-items: center; gap: .25rem; color: var(--accent); font-weight: 600; font-size: .85rem; background: none; border: none; padding: 0; cursor: pointer; text-decoration: none; font-family: inherit; }
.w-lbl { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: .9rem 0 .5rem; }
.w-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: .85rem 1rem; margin-bottom: .75rem; }
.w-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .6rem; }
.w-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 14px; font-weight: 700;
  font-size: 1rem; min-height: 52px; border: none; width: 100%; cursor: pointer; font-family: inherit; padding: 0 1rem;
}
.w-btn.pri { background: var(--accent); color: var(--on-accent, #1a1a1f); box-shadow: var(--shadow-glow); }
.w-btn.pri:disabled { opacity: .45; box-shadow: none; }
.w-btn.sec { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.w-btn.sec.on { border-color: var(--accent); color: var(--accent); }
.w-btn.sq { width: 54px; flex: 0 0 54px; padding: 0; }
.w-btn.sq.has { color: var(--accent); border-color: var(--accent-line, rgba(255,140,66,.35)); }
.w-opt {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; text-align: left;
  background: var(--bg3); border: 1.5px solid var(--border); border-radius: 14px; padding: .75rem .9rem; margin-bottom: .5rem;
  color: var(--text); cursor: pointer; font-family: inherit; font-size: .95rem;
}
.w-opt > span:first-child { display: flex; flex-direction: column; gap: .1rem; }
.w-opt input { position: absolute; opacity: 0; pointer-events: none; }
.w-opt.on { border-color: var(--accent); background: var(--accent-soft, rgba(255,140,66,.08)); }
.w-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex: none; }
.w-opt.on .w-radio { border: 6px solid var(--accent); }
.wm-thumb {
  width: 44px; height: 44px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--bg3); color: var(--accent);
}
.muted { color: var(--muted); }
.wm-small, .es-small, .td-small, .tr-small { font-size: .8rem; }

/* toggle switch for checkboxes */
.wm-switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--bg3); border: 1px solid var(--border); position: relative; cursor: pointer; flex: none; margin-left: auto; transition: background .15s; }
.wm-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.wm-switch:checked { background: var(--accent); border-color: var(--accent); }
.wm-switch:checked::after { transform: translateX(18px); background: var(--on-accent, #1a1a1f); }

/* ── Bottom sheets ───────────────────────────────────────────────────────── */
.ws-backdrop {
  position: fixed; inset: 0; z-index: 400; background: var(--overlay, rgba(0,0,0,.6));
  display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s;
}
.ws-backdrop.open { opacity: 1; }
.ws-sheet {
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: var(--sheet-bg, var(--card));
  border-radius: 24px 24px 0 0; border-top: 1px solid var(--border); padding: .6rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom));
  transform: translateY(30px); transition: transform .2s; box-shadow: 0 -10px 40px rgba(0,0,0,.3);
}
.ws-backdrop.open .ws-sheet { transform: translateY(0); }
.ws-tall { min-height: 55vh; }
.ws-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto .9rem; touch-action: none; cursor: grab; padding: 6px 0; background-clip: content-box; box-sizing: content-box; }
.es-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -.2px; }
.es-head, .es-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.es-cue { color: var(--muted); font-size: .9rem; margin: .5rem 0 .4rem; }
.es-dose { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: var(--accent-hi); font-size: .9rem; margin: .35rem 0 .2rem; }
.es-guide { margin: .6rem 0 .5rem; }
.es-what { margin: .2rem 0 .5rem; font-size: .92rem; }
.es-steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; line-height: 1.4; }
.es-steps li::marker { color: var(--accent); font-weight: 800; }
.es-tip { display: flex; gap: .4rem; align-items: flex-start; margin: .65rem 0 0; font-size: .85rem; color: var(--muted); }
.es-tip svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.es-trend { margin-top: .8rem; }
.es-bars { height: 70px; display: flex; align-items: flex-end; gap: 6px; padding: .4rem 0 0; }
.es-bars i { flex: 1; background: linear-gradient(180deg, var(--accent), var(--accent-line, rgba(255,140,66,.3))); border-radius: 4px 4px 0 0; min-height: 4px; }
.es-hist { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.es-hist span:last-child { text-align: right; }
.es-custom { margin: .25rem 0 .75rem; }
.es-actions { margin-top: .25rem; }

/* ── Workout mode shell ──────────────────────────────────────────────────── */
body.in-workout { overflow: hidden; }
body.in-workout #app-header, body.in-workout #main-nav { visibility: hidden; }
body.in-workout #music-bar { display: none !important; }
.wm {
  position: fixed; inset: 0; z-index: 300; background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; padding-top: env(safe-area-inset-top);
}
.wm-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem 1rem .3rem; max-width: 640px; width: 100%; margin: 0 auto; }
.wm-top-mid { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.wm-top-txt { font-size: .85rem; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wm-iconbtn { width: 40px; height: 40px; border-radius: 12px; background: var(--bg3); border: none; color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.wm-restpill { display: inline-flex; align-items: center; gap: .3rem; background: var(--accent); color: var(--on-accent, #1a1a1f); border: none; border-radius: 99px; padding: .25rem .65rem; font-weight: 700; font-size: .8rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.wm-segs { display: flex; gap: 4px; padding: .3rem 1rem .5rem; max-width: 640px; width: 100%; margin: 0 auto; }
.wm-seg { flex: 1; height: 5px; border-radius: 3px; background: var(--bg3); border: none; padding: 0; cursor: pointer; }
.wm-seg.d { background: var(--accent); }
.wm-seg.c { background: linear-gradient(90deg, var(--accent) 45%, var(--bg3) 45%); box-shadow: 0 0 0 2px var(--accent-line, rgba(255,140,66,.35)); }
.wm-seg.d.c { background: var(--accent); }
.wm-scroll { flex: 1; overflow-y: auto; padding: .4rem 1rem 1rem; max-width: 640px; width: 100%; margin: 0 auto; -webkit-overflow-scrolling: touch; }
.wm-dock { display: flex; gap: .6rem; padding: .7rem 1rem calc(.8rem + env(safe-area-inset-bottom)); max-width: 640px; width: 100%; margin: 0 auto; }
.wm-dock .w-btn { min-height: 56px; }
.wm-music:empty { display: none; }
.wm-music { width: calc(100% - 2rem); max-width: 608px; margin: 0 auto; flex: none; }

.wm-h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.wm-h1-btn { background: none; border: none; color: var(--text); text-align: left; padding: 0; cursor: pointer; font-family: inherit; }
.wm-titlerow { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.wm-titlerow .w-chip { margin-top: .35rem; }
.wm-sub { color: var(--muted); font-size: .85rem; margin: .25rem 0 .6rem; }
.wm-hint { color: var(--muted); font-size: .85rem; font-style: italic; margin: .2rem 0 .6rem; }
.wm-meta { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .85rem; color: var(--muted); margin: .55rem 0 .8rem; }
.wm-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.wm-date { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .85rem; margin-bottom: .6rem; }
.wm-date .input-field { width: auto; }
.wm-sect { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: .9rem 0 .45rem; }
.wm-exrow {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; font-family: inherit;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: .55rem .75rem; margin-bottom: .45rem; color: var(--text); cursor: pointer;
}
.wm-exrow .wm-thumb { width: 38px; height: 38px; }
.wm-exrow.warm { border-style: dashed; border-color: var(--accent2-line, rgba(255,209,102,.35)); background: var(--accent2-soft, rgba(255,209,102,.06)); }
.wm-exrow.warm .wm-thumb { color: var(--accent2); }
.wm-exrow.done .wm-thumb { background: var(--accent); color: var(--on-accent, #1a1a1f); }
.wm-exrow-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wm-exrow-name { font-weight: 600; font-size: .95rem; }
.wm-exrow-sub { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-exrow-dose { text-align: right; font-size: .75rem; color: var(--muted); display: flex; flex-direction: column; flex: none; }
.wm-exrow-dose b { color: var(--text); font-size: .9rem; }

.wm-cue { display: flex; gap: .7rem; align-items: flex-start; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: .65rem .75rem; font-size: .85rem; margin: .4rem 0 .7rem; }
.wm-cue .wm-thumb { width: 48px; height: 48px; }
.wm-cue b { display: block; }
.wm-sugg { display: flex; align-items: flex-start; gap: .6rem; background: var(--accent2-soft, rgba(255,209,102,.08)); border: 1px solid var(--accent2-line, rgba(255,209,102,.3)); border-radius: 12px; padding: .6rem .75rem; font-size: .85rem; margin-bottom: .75rem; }
.wm-sugg svg { color: var(--accent2); margin-top: 1px; }
.wm-sugg b { color: var(--accent2); }

/* set rows */
.wm-sets-h { display: grid; grid-template-columns: 30px 1fr 1fr 50px; gap: .5rem; font-size: .68rem; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 0 .3rem .35rem; text-align: center; }
.wm-sets-h.nw, .wm-set.nw { grid-template-columns: 30px 1fr 50px; }
.wm-set { display: grid; grid-template-columns: 30px 1fr 1fr 50px; gap: .5rem; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: .45rem .4rem .45rem .5rem; margin-bottom: .45rem; position: relative; }
.wm-sn { font-weight: 700; color: var(--muted); text-align: center; }
.wm-val {
  width: 100%; min-width: 0; height: 48px; text-align: center; font-size: 1.2rem; font-weight: 700; font-family: inherit;
  background: var(--input-bg, var(--bg2)); border: 1px solid var(--border); border-radius: 10px; color: var(--text); -moz-appearance: textfield;
}
.wm-val::-webkit-outer-spin-button, .wm-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wm-val::placeholder { color: var(--muted); opacity: .55; font-weight: 600; }
.wm-val:focus { outline: none; border-color: var(--accent); }
.wm-tick { width: 46px; height: 46px; border-radius: 12px; border: 2px solid var(--border); background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.wm-set.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft, rgba(255,140,66,.15)); }
.wm-set.active .wm-tick { border-color: var(--accent); color: var(--accent); }
.wm-set.done { background: var(--accent-soft, rgba(255,140,66,.07)); border-color: var(--accent-line, rgba(255,140,66,.35)); }
.wm-set.done .wm-val { background: transparent; border-color: transparent; }
.wm-set.done .wm-tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #1a1a1f); }
.wm-prevline { grid-column: 2 / -2; font-size: .75rem; color: var(--muted); text-align: center; margin-top: -.15rem; }
.wm-set.nw .wm-prevline { grid-column: 2 / 3; }
.wm-remset { position: absolute; top: -8px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg3); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.wm-addset { width: 100%; border: 1.5px dashed var(--border); border-radius: 12px; text-align: center; padding: .6rem; font-size: .85rem; color: var(--muted); font-weight: 600; background: none; cursor: pointer; font-family: inherit; margin-bottom: .75rem; }

/* skill */
.wm-ladder { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; margin-bottom: .4rem; scrollbar-width: none; }
.wm-lvl { flex: none; border-radius: 10px; padding: .45rem .65rem; font-size: .8rem; font-weight: 600; background: var(--bg3); border: 1.5px solid var(--border); color: var(--muted); cursor: pointer; font-family: inherit; }
.wm-lvl.ok { color: var(--text); }
.wm-lvl.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft, rgba(255,140,66,.1)); }
.wm-stopwatch {
  --p: 0%; width: 168px; height: 168px; border-radius: 50%; margin: .9rem auto .8rem; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent) var(--p), var(--bg3) var(--p)); padding: 0;
}
.wm-stopwatch > span { width: 148px; height: 148px; border-radius: 50%; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text); }
.wm-stopwatch b { font-size: 2.5rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.wm-stopwatch small { color: var(--muted); font-size: .8rem; }
.wm-holds { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: .75rem; }
.wm-hold { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .5rem 0; text-align: center; font-weight: 700; display: flex; flex-direction: column; align-items: center; }
.wm-hold input { width: 100%; text-align: center; background: none; border: none; color: var(--text); font-weight: 700; font-size: 1.05rem; font-family: inherit; }
.wm-hold small { font-size: .68rem; color: var(--muted); font-weight: 600; }
.wm-hold.d { border-color: var(--accent-line, rgba(255,140,66,.4)); background: var(--accent-soft, rgba(255,140,66,.07)); }
.wm-hold.g { color: var(--muted); border-style: dashed; opacity: .7; }
.wm-skill-sum { display: flex; justify-content: space-between; gap: .5rem; font-size: .82rem; margin-bottom: .6rem; flex-wrap: wrap; }
.wm-skill-sum b { color: var(--text); }
.wm-sugg.gold { margin-top: .2rem; }

/* list-style steps */
.wm-list { display: flex; flex-direction: column; gap: .1rem; }
.wm-li { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px dashed var(--border); font-size: .95rem; }
.wm-li:last-child { border-bottom: none; }
.wm-li-btn { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; color: var(--text); text-align: left; font-family: inherit; cursor: pointer; align-items: center; }
.wm-li-btn > span { flex: 1; }
.wm-li-btn > svg:last-child { color: var(--muted); margin-top: 0; flex-shrink: 0; }
.wm-cxrow { display: flex; align-items: center; gap: .25rem; border-bottom: 1px dashed var(--border); }
.wm-cxrow:last-child { border-bottom: none; }
.wm-cxrow > .wm-cx { border-bottom: none; flex: 1; min-width: 0; }
.wm-info { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.wm-li svg { color: var(--accent2); margin-top: 3px; }
.wm-rounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: .5rem; margin: .6rem 0 .75rem; }
.wm-round { border-radius: 12px; padding: .65rem 0; text-align: center; font-weight: 700; font-size: .85rem; background: var(--bg3); border: 1.5px solid var(--border); color: var(--muted); cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: .3rem; }
.wm-round.d { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #1a1a1f); }
.wm-round.c { border-color: var(--accent); color: var(--accent); }
.wm-cx { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border: none; border-bottom: 1px dashed var(--border); font-size: .95rem; width: 100%; background: none; color: var(--text); text-align: left; cursor: pointer; font-family: inherit; }
.w-card .wm-cx:last-child { border-bottom: none; }
.wm-cx.now { color: var(--accent); font-weight: 700; }
.wm-cx-r { margin-left: auto; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.wm-cx.now .wm-cx-r { color: var(--accent); }
.wm-chk { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; flex: none; }
.wm-chk.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #1a1a1f); }
.wm-ivline { font-size: .82rem; display: flex; align-items: center; gap: .35rem; margin-bottom: .6rem; }

/* cardio */
.wm-fld { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .45rem .75rem; margin-bottom: .5rem; }
.wm-fld small { font-size: .72rem; color: var(--muted); font-weight: 600; }
.wm-fld input { background: none; border: none; color: var(--text); font-size: 1.2rem; font-weight: 700; font-family: inherit; width: 100%; padding: .1rem 0; }
.wm-fld input:focus { outline: none; }
.wm-fld.calc { background: var(--accent2-soft, rgba(255,209,102,.07)); border-color: var(--accent2-line, rgba(255,209,102,.3)); }
.wm-fld.calc b { color: var(--accent2); font-size: 1.2rem; padding: .1rem 0; }
.wm-zone { font-weight: 700; margin-left: .25rem; }
.wm-zone.ok { color: var(--ok, #5fd18b); }
.wm-zone.low, .wm-zone.high { color: var(--accent); }

/* rest sheet */
.wm-timer { --p: 100%; width: 172px; height: 172px; border-radius: 50%; margin: .7rem auto .7rem; background: conic-gradient(var(--accent) var(--p), var(--bg3) var(--p)); display: flex; align-items: center; justify-content: center; }
.wm-timer > div { width: 152px; height: 152px; border-radius: 50%; background: var(--sheet-bg, var(--card)); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wm-timer b { font-size: 2.8rem; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.wm-tctl { display: flex; justify-content: center; gap: .5rem; margin-bottom: .4rem; }
.wm-tctl .w-chip { padding: .45rem .9rem; font-size: .85rem; }
.wm-feel { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .75rem; }
.wm-feel button { background: var(--bg3); border: 1.5px solid var(--border); border-radius: 12px; padding: .6rem .2rem; text-align: center; font-size: .9rem; font-weight: 700; color: var(--text); cursor: pointer; font-family: inherit; }
.wm-feel small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }
.wm-feel button.on { border-color: var(--accent); background: var(--accent-soft, rgba(255,140,66,.1)); color: var(--accent); }
.wm-next { display: flex; align-items: center; gap: .7rem; background: var(--bg3); border-radius: 14px; padding: .65rem .8rem; margin-bottom: .5rem; }
.wm-next svg { color: var(--accent); }
.wm-next small { display: block; }
.wm-rest .music-slot:empty { display: none; }

/* menu sheet */
.wm-mrow { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .8rem .2rem; border: none; border-bottom: 1px solid var(--border); background: none; color: var(--text); font-size: .95rem; text-align: left; cursor: pointer; font-family: inherit; }
.wm-mrow svg { color: var(--muted); }
.wm-mrow.danger, .wm-mrow.danger svg { color: var(--danger); }
.wm-note-in { margin-bottom: .75rem; }

/* add exercise */
.wm-add-search { margin-bottom: .75rem; }
.wm-add-item { display: block; width: 100%; text-align: left; padding: .75rem .4rem; border: none; border-bottom: 1px solid var(--border); background: none; color: var(--text); font-size: .95rem; cursor: pointer; font-family: inherit; }
.wm-add-item.custom { color: var(--accent); font-weight: 700; }

/* finish */
.wm-finish { padding-top: 1.5rem; }
.wm-done-badge { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto .9rem; background: linear-gradient(140deg, var(--accent), var(--danger)); display: flex; align-items: center; justify-content: center; color: var(--on-accent, #1a1a1f); box-shadow: var(--shadow-glow); }
.wm-stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
.wm-stats3 div { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: .65rem; text-align: center; }
.wm-stats3 b { font-size: 1.2rem; display: block; font-variant-numeric: tabular-nums; }
.wm-stats3 span { font-size: .72rem; color: var(--muted); }
.wm-prrow { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.wm-prrow:last-child { border-bottom: none; }
.wm-prrow svg { color: var(--accent2); }
.wm-prrow b { margin-left: auto; color: var(--accent2); }
.wm-energy { display: flex; justify-content: space-between; gap: .4rem; margin: .6rem 0 .7rem; }
.wm-en { flex: 1; height: 48px; border-radius: 12px; background: var(--bg3); border: 1.5px solid var(--border); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.wm-en.on { border-color: var(--accent); background: var(--accent-soft, rgba(255,140,66,.12)); color: var(--accent); }

/* ── Today ───────────────────────────────────────────────────────────────── */
.td-resume { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; background: var(--accent-soft, rgba(255,140,66,.1)); border: 1px solid var(--accent-line, rgba(255,140,66,.35)); border-radius: 14px; padding: .6rem .8rem; margin-bottom: .9rem; font-size: .9rem; }
.td-resume svg { color: var(--accent); }
.td-resume-act { display: flex; gap: .4rem; }
.td-greet { font-size: .85rem; }
.td-hrow { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }
.td-h { font-size: 1.6rem; font-weight: 800; letter-spacing: -.5px; }
.td-goal { font-size: .85rem; margin-bottom: .6rem; }
.td-goal b { color: var(--text); }
.td-goal-top { margin-bottom: .4rem; }
.td-goal-note { color: var(--accent-hi); font-weight: 600; font-size: .8rem; margin-top: .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-goal-segs { display: flex; gap: 4px; }
.td-goal-segs i { flex: 1; height: 6px; border-radius: 99px; background: var(--bg3); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 60%, transparent); transform-origin: left; }
.td-goal-segs i.on { background: var(--accent); box-shadow: none; }
.td-goal-segs i.fill { animation: td-seg-fill .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 90ms); }
.td-goal.full .td-goal-segs i.on { box-shadow: 0 0 8px var(--accent-line, rgba(255,140,66,.35)); }
@keyframes td-seg-fill { from { transform: scaleX(0); opacity: .3; } to { transform: scaleX(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .td-goal-segs i.fill { animation: none; } }
.td-week { display: flex; justify-content: space-between; margin-bottom: .9rem; }
.td-wd { width: 44px; display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: .7rem; color: var(--muted); font-weight: 600; background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; }
.td-dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--border); font-size: .85rem; color: var(--text); font-weight: 600; }
.td-dot.done { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #1a1a1f); }
.td-dot.rest { border-style: dashed; color: var(--muted); }
.td-dot.today { border-color: var(--accent); color: var(--accent); }
.td-dot.today.done { color: var(--on-accent, #1a1a1f); }
.td-dot.sel { box-shadow: 0 0 0 3px var(--accent-line, rgba(255,140,66,.3)); }
.td-hero { background: var(--hero-grad, var(--card)); border: 1px solid var(--accent-line, rgba(255,140,66,.35)); border-radius: 20px; padding: 1rem 1.1rem 1.05rem; margin-bottom: .8rem; box-shadow: var(--shadow-card); }
.td-hero.rest { background: var(--card); border-color: var(--border); text-align: left; }
.td-hero-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.td-prog { display: inline-flex; align-items: center; gap: .2rem; background: none; border: none; color: var(--muted); font-size: .85rem; font-weight: 600; cursor: pointer; padding: .3rem 0; font-family: inherit; }
.td-preview { font-size: .8rem; margin-top: .4rem; }
.td-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.4px; margin: .45rem 0 .1rem; }
.td-hint { font-size: .82rem; color: var(--muted); font-style: italic; margin-top: .3rem; }
.td-exlist { font-size: .9rem; margin-bottom: .9rem; }
.td-exlist div { display: flex; justify-content: space-between; gap: .5rem; padding: .32rem 0; border-bottom: 1px dashed var(--border); }
.td-exlist div:last-child { border-bottom: none; }
.td-exlist b { font-weight: 600; }
.td-short { text-align: center; margin-top: .65rem; }
.td-done-btn { color: var(--accent); }
.td-rest-icon { color: var(--muted); margin: .6rem 0 .2rem; }
.td-mob { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: .6rem .8rem; margin: .7rem 0; }
.td-mob summary { cursor: pointer; display: flex; align-items: center; gap: .4rem; list-style: none; }
.td-mob ul { margin: .5rem 0 0 1.1rem; font-size: .9rem; }
.td-qa { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .6rem; }
.td-qa button { display: flex; align-items: center; gap: .5rem; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: .8rem .85rem; font-size: .9rem; font-weight: 600; color: var(--text); cursor: pointer; font-family: inherit; }
.td-qa svg { color: var(--accent); }
.td-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.td-tile { display: flex; align-items: center; gap: .65rem; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: .7rem; text-align: left; color: var(--text); cursor: pointer; font-family: inherit; }
.td-tile b { display: block; font-size: .92rem; }
.td-tile small { display: block; font-size: .78rem; }
.td-tile .wm-thumb { width: 42px; height: 42px; }
.td-ring { --p: 0%; width: 44px; height: 44px; border-radius: 50%; flex: none; background: conic-gradient(var(--accent2) var(--p), var(--bg3) var(--p)); display: flex; align-items: center; justify-content: center; }
.td-ring i { width: 34px; height: 34px; border-radius: 50%; background: var(--card); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: .7rem; font-weight: 700; }
.td-seg { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg3); border-radius: 12px; padding: 4px; gap: 4px; }
.td-seg button { text-align: center; padding: .5rem 0; border-radius: 9px; font-size: .85rem; font-weight: 700; color: var(--muted); background: none; border: none; cursor: pointer; font-family: inherit; }
.td-seg button small { display: block; font-size: .65rem; font-weight: 500; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 .2rem; }
.td-seg button.on { background: var(--accent); color: var(--on-accent, #1a1a1f); }
.td-auto { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--muted); margin: .8rem 0; }
.td-auto .wm-switch { margin-left: 0; order: -1; }

/* ── Train ───────────────────────────────────────────────────────────────── */
.tr-tabs { display: flex; gap: .4rem; margin: .2rem 0 .8rem; overflow-x: auto; scrollbar-width: none; }
.tr-tabs button { padding: .4rem .85rem; border-radius: 99px; font-size: .82rem; font-weight: 600; color: var(--muted); background: var(--bg3); border: none; cursor: pointer; font-family: inherit; white-space: nowrap; }
.tr-tabs button.on { background: var(--accent); color: var(--on-accent, #1a1a1f); }
.tr-card { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: .75rem .85rem; margin-bottom: .5rem; color: var(--text); font-family: inherit; font-size: inherit; cursor: default; }
button.tr-card { cursor: pointer; }
.tr-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.tr-t { font-weight: 700; font-size: .95rem; display: inline-flex; align-items: center; gap: .35rem; }
.tr-t svg { color: var(--accent); }
.tr-s { font-size: .8rem; color: var(--muted); margin-top: .15rem; display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; }
.tr-note { font-size: .82rem; color: var(--muted); font-style: italic; margin-top: .3rem; }
.tr-actions { display: flex; gap: .4rem; justify-content: flex-end; margin-top: .4rem; }
.tr-skills { margin-top: .9rem; }
.tr-prog .tr-row > svg { color: var(--muted); flex: none; }
.pv-day { margin-top: .6rem; }
.pv-block { margin-top: .55rem; }
.pv-bh { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.pv-list { margin: .25rem 0 0; padding-left: 1.1rem; font-size: .86rem; line-height: 1.45; }
.pv-note { font-size: .78rem; }
.wm-howto { margin: -.2rem 0 .7rem; }
.w-opt > span:not(.w-radio) { display: flex; flex-direction: column; gap: .1rem; }
.wm-dock .w-btn.sec:not(.sq) { flex: 0 0 auto; width: auto; }
.wm-fld input::-webkit-outer-spin-button, .wm-fld input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wm-fld input { -moz-appearance: textfield; }

/* programme editor: rest + cue fields wrap to a second line */
.blk-ex-row { flex-wrap: wrap; }
.blk-ex-row .blk-ex-note, .blk-ex-row .blk-ex-cue { order: 2; flex: 1 1 40% !important; }
.ex-open-page { margin-top: .6rem; }
.pr-open-page { background: none; border: none; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }

/* Stacking: workout screen 300, its sheets 400, the music player above both, toasts on top. */
.mp-backdrop { z-index: 450; }
.toast { z-index: 600; }
body.in-workout .toast { bottom: calc(110px + env(safe-area-inset-bottom)); }
.blk-ex-row:has(.blk-ex-cue) .blk-ex-name { flex: 1 1 100% !important; }
.blk-ex-row:has(.blk-ex-cue) .rem-blk-exercise { order: 1; }
.blk-ex-row .blk-ex-rest { flex: 0 0 4.6rem !important; }
.blk-ex-row:has(.blk-ex-cue) { padding-bottom: .4rem; border-bottom: 1px dashed var(--border); margin-bottom: .5rem; }
.wm-rpe { grid-column: 2 / -2; justify-self: center; margin-top: -.1rem; border: 1px dashed var(--border); background: none; color: var(--muted); border-radius: 99px; padding: .1rem .7rem; font-size: .72rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.wm-rpe.easy { color: var(--ok, #5fd18b); border-style: solid; border-color: currentColor; }
.wm-rpe.good { color: var(--accent2); border-style: solid; border-color: currentColor; }
.wm-rpe.hard { color: var(--danger); border-style: solid; border-color: currentColor; }
.wm-saving .wm-dock .w-btn { opacity: .6; pointer-events: none; }
.wm-jnote, .wm-note-in { font-family: inherit; }

/* Per-day programme chips (Today) */
.td-progs { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin: -.2rem 0 .8rem; padding: .2rem 0; max-width: 100%; }
.td-progs::-webkit-scrollbar { display: none; }
.td-pchip { flex: 0 0 auto; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1.5px solid var(--border); background: none; color: var(--muted); border-radius: 99px; padding: .4rem .8rem; font: 600 .8rem/1.2 inherit; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.td-pchip.main::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; flex: 0 0 auto; }
.td-pchip.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.td-pchip.add { border-style: dashed; }
.td-progs [data-swap] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.td-pchip.drag { border-color: var(--accent); transform: scale(1.08); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.td-swapnote { font-size: .8rem; margin: .15rem 0 .4rem; }
.td-rand { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: .6rem; }

/* Programme catalogue (Browse sheet) */
.td-blevel { margin-bottom: .8rem; }
.cat-search { margin-bottom: .7rem; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.plan-head .es-title { margin: 0; }
.plan-org { width: auto; padding: .4rem .75rem; font-size: .8rem; display: inline-flex; align-items: center; gap: .35rem; }
.plan-org.on { border-color: var(--accent); color: var(--accent-hi); }
.plan-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.plan-orow { display: flex; align-items: center; gap: .35rem; background: var(--bg3); border: 1.5px solid var(--border); border-radius: 12px; padding: .35rem .4rem .35rem .7rem; }
.plan-orow.on { border-color: var(--accent); }
.plan-onum { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--muted); min-width: 1.3rem; }
.plan-oname { flex: 1; min-width: 0; font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-orow .btn-icon { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.plan-orow .btn-icon[disabled] { opacity: .25; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-hi); font-weight: 700; text-decoration: underline; cursor: pointer; }
.cat-list { display: flex; flex-direction: column; gap: .7rem; }
.cat-card { border: 1px solid var(--border); border-radius: 14px; padding: .9rem; background: var(--bg2); }
.cat-card.have { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.cat-name { font-weight: 800; font-size: 1rem; letter-spacing: -.2px; }
.cat-meta { font-size: .75rem; margin: .2rem 0 .45rem; text-transform: none; }
.cat-sum { font-size: .85rem; margin: 0 0 .5rem; color: var(--text); opacity: .9; }
.cat-eq { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .65rem; }
.cat-eq span { font-size: .7rem; padding: .15rem .5rem; border-radius: 99px; background: var(--bg3); color: var(--muted); }
.cat-add { width: 100%; }
.cat-have { color: var(--accent-hi); font-weight: 700; font-size: .85rem; display: flex; align-items: center; gap: .35rem; }
.cat-cats { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; margin: -.2rem 0 .8rem; padding-bottom: .1rem; }
.cat-cats::-webkit-scrollbar { display: none; }
.cat-why { margin: 0 0 .65rem; font-size: .8rem; }
.cat-why summary { cursor: pointer; color: var(--accent-hi); font-weight: 700; list-style: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 32px; }
.cat-why summary::-webkit-details-marker { display: none; }
.cat-why summary::after { content: '+'; font-weight: 800; opacity: .8; }
.cat-why[open] summary::after { content: '−'; }
.cat-why p { margin: .3rem 0; line-height: 1.45; }
.cat-why ul { margin: .3rem 0; padding-left: 1.1rem; }
.cat-why li { margin: .2rem 0; overflow-wrap: anywhere; }
.cat-why a { color: var(--accent-hi); }
.cat-update { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .55rem; padding: .55rem .7rem; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); font-size: .8rem; font-weight: 600; }
.cat-update span { display: inline-flex; align-items: flex-start; gap: .35rem; flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.cat-update span svg { flex: 0 0 auto; margin-top: .1rem; }
.cat-update .w-btn { flex: 0 0 auto; width: auto; min-height: 36px; padding: .4rem 1rem; margin: 0; }

/* Add-exercise filters and meta */
.wm-add-filters { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; margin-bottom: .5rem; padding-bottom: .1rem; }
.wm-add-filters::-webkit-scrollbar { display: none; }
.wm-add-filters .w-chip { flex: 0 0 auto; }
.wm-add-item small { display: block; color: var(--muted); font-size: .72rem; margin-top: .1rem; font-weight: 500; }

/* Long programme names (catalogue) must shrink, not widen the page at 320px */
.td-hero-top { min-width: 0; gap: .5rem; }
.td-hero-top .w-chip { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-prog { min-width: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; text-align: right; }
.td-prog svg { vertical-align: -2px; }
.td-wk { display: flex; align-items: center; gap: .15rem; min-width: 0; flex: 0 1 auto; }
.td-wk-btn { flex: 0 0 auto; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--border); background: none; color: var(--accent2); cursor: pointer; padding: 0; }
.td-wk-btn:active { transform: scale(.94); }
