/* Workout screen: session map with thumbnails, compact exercise head, one-line target, set rows with last
   time's value, reps picker, rest bar states, and the finished-workout summary.
   Loaded right after views.css and refines the shared workout rules there. Logical properties only,
   colors only from the tokens in app.css. */

/* ---------- session map: a small picture per exercise, a number or tick badge, the current one named ---------- */
.wk-steps .wk-step{position:relative}
.wk-steps .wk-step .wk-ava{inline-size:36px;block-size:36px;border-radius:50%;overflow:hidden;display:grid;place-items:center;
  background:var(--photo-bg);color:var(--muted);box-shadow:0 0 0 1.5px var(--line)}
.wk-steps .wk-ava img{inline-size:100%;block-size:100%;object-fit:cover;transform:scale(1.3);display:block}
.wk-steps .wk-ava .mfig{block-size:86%;inline-size:auto;display:block}
.wk-steps .wk-ava>.ic{width:18px;height:18px}
.wk-steps .wk-badge{position:absolute;inset-block-end:1px;inset-inline-start:27px;min-inline-size:17px;block-size:17px;padding-inline:3px;border-radius:999px;
  display:grid;place-items:center;font:700 var(--t-xs)/var(--lh-tight) var(--font-display);font-style:normal;background:var(--surface);color:var(--ink);box-shadow:0 0 0 1.5px var(--bg)}
.wk-steps .wk-badge .ic{width:11px;height:11px;stroke-width:var(--ic-stroke-bold)}
.wk-steps .wk-step.part .wk-ava{box-shadow:0 0 0 2px var(--accent)}
.wk-steps .wk-step.part .wk-badge{background:var(--accent-soft);color:var(--accent)}
.wk-steps .wk-step.done .wk-ava{box-shadow:0 0 0 2px var(--done)}
.wk-steps .wk-step.done .wk-badge{background:var(--done);color:var(--done-ink)}
.wk-steps .wk-step.cur .wk-ava{box-shadow:0 0 0 2px var(--accent),0 0 0 4px var(--accent-soft)}
.wk-steps .wk-step.cur .wk-badge{background:var(--accent);color:var(--accent-ink)}
.wk-steps .wk-step.add .wk-ava{background:transparent;box-shadow:none;color:var(--accent)}
.wk-steps .warm-step .wk-ava{background:var(--surface-2);color:var(--ink);box-shadow:0 0 0 1.5px var(--line)}
.wk-steps .warm-step.done .wk-ava{background:var(--done);color:var(--done-ink)}
.wk-steps .warm-step.cur .wk-ava{box-shadow:0 0 0 2px var(--accent)}
html[lang="ar"] .wk-step.cur small{line-height:1.7}
/* a superset in the session map: its steps share one tinted pill with a link between them */
.wk-steps .wk-ssg{flex:none;display:flex;align-items:center;padding:2px;border-radius:999px;background:var(--accent-soft);box-shadow:inset 0 0 0 1.5px var(--accent-line)}
.wk-steps .wk-ssl{flex:none;display:grid;place-items:center;inline-size:16px;color:var(--accent)}
.wk-steps .wk-ssl .ic{inline-size:14px;block-size:14px}

/* ---------- a superset exercise: which superset, the round, and what comes after this one ---------- */
.wk-ss{display:grid;gap:var(--s-1);padding:var(--s-2) 14px;border-radius:var(--r-md);background:var(--surface-2)}
.wk-ss:empty{display:none}
.wk-ss p{margin:0;max-width:none}
.wk-ss-top{display:flex;align-items:center;flex-wrap:wrap;gap:var(--s-1) var(--s-2);color:var(--muted);font:var(--f-label);letter-spacing:var(--track-label);text-transform:uppercase}
.wk-ss-top .ic{flex:none;inline-size:var(--ic-sm);block-size:var(--ic-sm)}
.wk-ss-top>span{margin-inline-start:auto;color:var(--ink);font-weight:600;letter-spacing:0;text-transform:none}
.wk-ss-next{font-size:var(--t-sm);line-height:var(--lh-body);color:var(--ink)}
html[lang="ar"] .wk-ss-top{font-size:var(--t-sm);letter-spacing:0}
.ex-title .ss-tag{vertical-align:1px}

/* ---------- exercise head: a small looping photo (opens How to), the name, and an options menu ---------- */
.wk-card{gap:12px}
.ex-head{display:grid;grid-template-columns:64px minmax(0,1fr) auto;align-items:center;gap:12px}
.ex-thumb{position:relative;display:block;inline-size:64px;block-size:64px;padding:0;border:0;border-radius:var(--r-md);overflow:hidden;
  background:var(--photo-bg);cursor:pointer;box-shadow:var(--e1)}
.ex-thumb .thumb{inline-size:100%;block-size:100%;aspect-ratio:auto;border-radius:0}
.ex-thumb-img{position:absolute;inset:0}
.ex-thumb-img img{position:absolute;inset:0;inline-size:100%;block-size:100%;object-fit:cover;transform:scale(1.15)}
/* the two frames cross-fade three times when the card opens, then rest on the first (no endless motion, WCAG 2.2.2) */
.ex-thumb-img.loop img+img{opacity:0;animation:loopfade 2.6s ease-in-out 3}
.ex-thumb-badge{position:absolute;inset-block-end:4px;inset-inline-end:4px;inline-size:22px;block-size:22px;border-radius:50%;display:grid;place-items:center;
  background:var(--overlay);color:var(--overlay-ink)}
.ex-thumb-badge .ic{width:12px;height:12px}
.ex-title{display:grid;gap:4px;min-width:0}
.ex-head .h2{font-size:var(--d-md);line-height:var(--lh-tight);overflow-wrap:anywhere}
html[lang="ar"] .ex-head .h2{font-size:var(--d-sm);line-height:var(--lh-ui)}
.ex-more{background:var(--surface);border:1px solid var(--card-line)}
.wk-menu .btn{justify-content:flex-start}

/* ---------- the hero: the set to load now, big, its plates, one small line, Why? ---------- */
.target-card.wk-tgt{gap:var(--s-1);padding:var(--s-3) var(--s-5) var(--s-4);box-shadow:var(--e1)}
.wk-tgt-line{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;min-block-size:24px}
.wk-tgt-val{display:block;font:700 var(--d-xl)/var(--lh-tight) var(--font-display);letter-spacing:var(--track-d-lg);color:var(--hero-ink);overflow-wrap:anywhere}
.target-card .wk-tgt-why{font-size:var(--t-sm);line-height:var(--lh-body);margin:0}
.target-card .wk-tgt-only{font-size:var(--t-md);color:var(--hero-ink)}
.wk-tgt .plates{margin-block-start:4px}
html[lang="ar"] .wk-tgt-val{font-size:var(--d-lg);line-height:var(--lh-ui)}
/* "Why?": the engine's own words one tap away (a 44px target drawn as a small pill) */
.wk-why{position:relative;flex:none;display:inline-grid;place-items:center;min-inline-size:44px;block-size:44px;margin-block:-10px;margin-inline-end:-8px;padding-inline:10px;
  border:0;background:none;color:var(--hero-ink);font:600 var(--t-sm)/var(--lh-tight) var(--font-body);cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation}
.wk-why::before{content:"";position:absolute;z-index:-1;inset-block:10px;inset-inline:0;border-radius:999px;background:var(--hero-chip)}
.wk-why{isolation:isolate}
html[lang="ar"] .wk-why{font-size:var(--t-sm);line-height:var(--lh-body)}
.wk-whys p{margin:0;max-width:none;line-height:var(--lh-body)}
.wk-why-link{align-self:flex-start;gap:6px}
/* Find your 5: "I know my 5-rep weight", a quiet link that opens the field */
.target-card .wk-know{justify-self:start;margin-inline-start:-10px;color:var(--hero-ink);text-decoration:underline;text-underline-offset:3px;font-weight:600}
.target-card :focus-visible{outline-color:var(--hero-ink)}
/* microplates would make the next jump smaller: one quiet line with the way to add them */
.target-card .wk-tip{display:flex;align-items:flex-start;gap:7px;margin:4px 0 0;max-width:none;font-size:var(--t-sm);line-height:var(--lh-body);color:var(--hero-muted)}
.target-card .wk-tip .ic{flex:none;inline-size:15px;block-size:15px;margin-block-start:1px}
.target-card .wk-tip-a{display:inline-flex;align-items:center;min-block-size:44px;margin-block:-14px;color:var(--hero-ink);font-weight:700}
html[lang="ar"] .target-card .wk-tip{line-height:var(--lh-body)}
/* the 7th week of 5/3/1: test the training max or take a light week */
.target-card .wk-w7{display:grid;grid-template-columns:1fr 1fr;inline-size:100%;margin-block-end:6px;background:var(--hero-chip);border-color:transparent}
.target-card .wk-w7 button{min-block-size:44px;padding:6px 8px;border:0;border-radius:calc(var(--r-md) - 3px);background:transparent;color:var(--hero-muted);font:600 var(--t-sm)/var(--lh-ui) var(--font-body);white-space:normal;cursor:pointer}
.target-card .wk-w7 button[aria-pressed="true"]{background:var(--hero-ink);color:var(--hero)}
html[lang="ar"] .target-card .wk-w7 button{line-height:var(--lh-body)}

/* ---------- set rows: number with last time's set under it, fields, tick ---------- */
.set-list{container-type:inline-size}
.wk-card .set-row{grid-template-columns:48px minmax(0,1fr) 52px;gap:6px;padding:8px;padding-inline-start:2px}
.wk-card .set-no{display:grid;justify-items:center;align-content:center;gap:4px;inline-size:48px;min-block-size:54px;padding:0;color:var(--muted)}
.wk-card .set-no b{font:700 var(--d-sm)/var(--lh-tight) var(--font-display)}
.set-prev{display:block;max-inline-size:48px;font:600 var(--t-sm)/var(--lh-ui) var(--font-display);letter-spacing:0;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[lang="ar"] .set-prev{font-size:var(--t-sm);line-height:1.7}   /* the tail of م and the dots of ي stay inside the clip box */
/* a tick still to do keeps a clear outline (the plain line vanishes in sunlight); the next set's is accent (below) */
.wk-card .set-check:not([aria-pressed="true"]),.warm-row .set-check:not([aria-pressed="true"]){border-color:var(--line-strong)}
/* a thumb on the gym floor: no text selection or callout on a long press, no double-tap zoom wait */
.wk-card .set-check,.warm-row .set-check,.set-in.reps[data-reps],.wk-card .set-no,.wk-steps .wk-step,.rest-main,.rest-left,
.eff-chips .chip,.reps-chips .chip,.wk-nav .btn,.wk-gonext,.rest-nextex{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation}
.set-row.is-done .set-prev{color:var(--good)}
/* a set marked as warm-up: a W instead of its number, neutral and muted (amber is for real warnings), never counted */
.set-row.is-warm .set-no b{color:var(--muted)}
.set-row.is-warm.is-done{background:var(--surface-2)}
.set-row.is-warm.is-done::before{background:var(--line-strong)}
.set-row.is-warm .set-check[aria-pressed="true"]{background:var(--muted);border-color:var(--muted);color:var(--surface);box-shadow:none}
.set-fields{display:grid;align-items:center;gap:6px;min-width:0}
.set-fields.f-kg{grid-template-columns:minmax(0,1fr) auto 54px}
.set-fields.f-bw{grid-template-columns:minmax(0,1fr) 62px}
.set-fields.f-bw.no-kg{grid-template-columns:minmax(0,1fr)}
.set-fields.f-v{grid-template-columns:minmax(0,1fr)}
.set-fields>.stepper{grid-column:1;grid-row:1}
.set-fields.f-kg>.times{grid-column:2;grid-row:1;font-size:var(--t-lg)}
.set-fields.f-kg>.reps{grid-column:3;grid-row:1}
.set-fields.f-bw>.add-kg-box{grid-column:2;grid-row:1;position:relative}
.add-kg-box .add-kg{inline-size:100%;min-block-size:54px;text-align:center;padding:0 4px 13px;font:700 var(--d-sm)/var(--lh-tight) var(--font-display)}
.add-kg-box .unit{position:absolute;inset-block-end:5px;inset-inline:0;text-align:center;pointer-events:none;font-size:var(--t-sm);font-weight:700;letter-spacing:0;line-height:var(--lh-tight);color:var(--muted)}
html[lang="ar"] .add-kg-box .unit{font-size:var(--t-sm);letter-spacing:0}
/* steppers: 44px wide buttons, the unit printed small under the number, a ring while typing */
.wk-card .stepper{position:relative}
.wk-card .stp{inline-size:44px;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.wk-card .stepper:focus-within{box-shadow:0 0 0 2px var(--accent)}
.wk-card .stepper .input{padding-block-end:13px}
.wk-card .stepper .unit{position:absolute;inset-block-end:5px;inset-inline:44px;text-align:center;pointer-events:none;
  font-size:var(--t-sm);font-weight:700;letter-spacing:0;line-height:var(--lh-tight);color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* reps: a button that opens a row of likely values */
.set-in.reps[data-reps]{position:relative;display:grid;place-items:center;inline-size:54px;min-block-size:54px;padding:0 0 13px;border:1.5px solid transparent;
  border-radius:var(--r-md);background:var(--surface-2);color:var(--ink);cursor:pointer}
.set-in.reps[data-reps] b{font:700 var(--d-sm)/var(--lh-tight) var(--font-display)}
.set-in.reps[data-reps] .unit{position:absolute;inset-block-end:5px;inset-inline:0;text-align:center;font-size:var(--t-sm);font-weight:700;letter-spacing:0;line-height:var(--lh-tight);color:var(--muted)}
.set-row.is-done .set-in.reps[data-reps]{background:transparent}
.set-in.reps[aria-expanded="true"]{border-color:var(--accent);background:var(--accent-soft)}
html[lang="ar"] .wk-card .stepper .unit,html[lang="ar"] .set-in.reps[data-reps] .unit{font-size:var(--t-sm);letter-spacing:0}
/* the stepper unit clips (ellipsis): at line-height 1 the dot under ج is cut and "كجم" reads "كحم"; same glyph position */
html[lang="ar"] .wk-card .stepper .unit{line-height:var(--lh-body);inset-block-end:2px}
.list>li.reps-pick{border-block-start:0;padding:0 8px 10px}
.reps-chips{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:2px}
.reps-chips .chip{flex:none;justify-content:center;min-inline-size:48px;min-height:48px;padding-inline:8px;font:700 var(--t-xl)/var(--lh-tight) var(--font-display);background:var(--surface-2);color:var(--ink)}
.reps-chips .chip.accent{background:var(--accent);color:var(--accent-ink)}
.reps-other{flex:1 1 64px;min-inline-size:64px;max-inline-size:120px;min-height:48px;padding:6px 4px;font-size:var(--t-md);text-align:center}
/* warm-up ramp before a compound lift, inside the set list */
.list>li.set-cap{display:flex;justify-content:space-between;gap:8px;padding:9px 12px 3px;font:700 var(--t-xs)/var(--lh-ui) var(--font-body);letter-spacing:var(--track-label);text-transform:uppercase;color:var(--muted)}
html[lang="ar"] .list>li.set-cap{font-size:var(--t-xs)}
.wk-card .set-row.is-ramp{grid-template-columns:44px minmax(0,1fr) 44px;padding-block:5px}
.set-row.is-ramp .set-no{min-block-size:44px}
.set-row.is-ramp .set-no b{font-size:var(--t-lg);color:var(--muted)}
/* Arabic marks warm-up sets with the word "إحماء" instead of a letter: smaller, in the text face */
html[lang="ar"] .set-row.is-ramp .set-no b,html[lang="ar"] .set-row.is-warm .set-no b{font:700 var(--t-xs)/var(--lh-body) var(--font-body)}
.ramp-val{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;min-width:0}
.ramp-val>b{font:600 var(--t-md)/var(--lh-ui) var(--font-body);white-space:nowrap}
.set-row.is-ramp.is-done .ramp-val>b{color:var(--good);text-decoration:line-through;text-decoration-thickness:2px}
/* the compact ramp's line: "Warm-up  20 · 30 · 42.5 · 52.5 kg", done ones ticked off, the next one in ink; a tap
   shows every row */
.list>li.ramp-head{padding:0}
.ramp-line{display:flex;align-items:center;gap:10px;inline-size:100%;min-block-size:44px;padding:4px 12px;border:0;background:none;color:var(--muted);
  font:700 var(--t-xs)/var(--lh-ui) var(--font-body);letter-spacing:var(--track-label);text-transform:uppercase;text-align:start;cursor:pointer}
.ramp-line>span:first-child{flex:none}
.ramp-ws{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:end;font:600 var(--t-sm)/var(--lh-ui) var(--font-body);letter-spacing:0;text-transform:none}
.ramp-ws i{font-style:normal;padding-inline:4px;opacity:.6}
.ramp-ws .rw.is-done{text-decoration:line-through;opacity:.7}
.ramp-ws .rw.is-cur{color:var(--ink);font-weight:700}
.ramp-line>.ramp-sum-ic{flex:none;inline-size:16px;block-size:16px;transform:rotate(90deg)}
.ramp-line[aria-expanded="true"]>.ramp-sum-ic{transform:rotate(-90deg)}
html[lang="ar"] .ramp-line{font-size:var(--t-sm);letter-spacing:0;line-height:var(--lh-body)}
html[lang="ar"] .ramp-ws{line-height:var(--lh-body)}
/* the finished ramp, folded into one line: tap it to see the sets again */
.list>li.ramp-sum{padding:0}
.ramp-sum-btn{display:flex;align-items:center;gap:8px;inline-size:100%;min-block-size:44px;padding:8px 12px;border:0;background:var(--surface-2);color:var(--good);
  font:600 var(--t-sm)/var(--lh-ui) var(--font-body);text-align:start;cursor:pointer}
.ramp-sum-btn>span{flex:1;min-width:0;color:var(--ink)}
.ramp-sum-btn>.ic{flex:none;inline-size:18px;block-size:18px}
.ramp-sum-btn>.ramp-sum-ic{inline-size:16px;block-size:16px;color:var(--muted);transform:rotate(90deg)}
html[lang="ar"] .ramp-sum-btn{line-height:var(--lh-body)}
/* phones of 360 px and up: the row stays one line (narrower steppers and reps; last time's set under the number fits
   its 40 px, clear of the 4 px stripe at the row's start) */
@container (max-width: 349px) and (min-width: 300px){
  .wk-card .stp{inline-size:34px}
  .wk-card .stepper .unit{inset-inline:34px}
  .set-in.reps[data-reps]{inline-size:50px}
  .set-fields.f-kg{grid-template-columns:minmax(0,1fr) auto 50px}
  .wk-card .set-row{grid-template-columns:40px minmax(0,1fr) 50px;gap:5px;padding-inline-start:6px}
  .wk-card .set-no{inline-size:40px}
  .wk-card .set-prev{max-inline-size:40px}
  .wk-card .set-check{inline-size:50px}
}
/* narrower still: reps go under the weight so the weight never clips */
@container (max-width: 299px){
  .set-fields.f-kg,.set-fields.f-bw{grid-template-columns:minmax(0,1fr) auto;row-gap:6px}
  .set-fields.f-kg>.stepper,.set-fields.f-bw>.stepper{grid-column:1/-1}
  .set-fields.f-kg>.times{grid-column:1;grid-row:2;justify-self:end}
  .set-fields.f-kg>.reps{grid-column:2;grid-row:2}
  .set-fields.f-bw>.add-kg-box{grid-column:1/-1;grid-row:2}
}

/* a value a field cannot take: the field ringed in the bad color, the reason in words right under its row */
.wk-card .set-in[aria-invalid="true"]{box-shadow:0 0 0 2px var(--bad)}
.list>li.set-err-li{border-block-start:0;padding:0 10px 10px;padding-inline-start:56px}
.set-err{display:flex;align-items:flex-start;gap:6px;margin:0;max-width:none;font-size:var(--t-sm);line-height:var(--lh-body);font-weight:600;color:var(--bad)}
html[lang="ar"] .set-err{line-height:var(--lh-body)}
@container (max-width: 349px){.list>li.set-err-li{padding-inline-start:12px}}
/* the exercise menu: move up and down side by side; the superset partner list */
.wk-move .btn{justify-content:center}
.wk-pairs>li{padding:0;border:0}
.wk-pairs{display:grid;gap:8px;background:none;border:0;box-shadow:none}
.wk-pair{justify-content:flex-start;gap:8px;text-align:start}
.wk-pair>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wk-pair>small{flex:none}
.wk-gone{max-width:none;font-weight:600;color:var(--ink)}
/* Finish with sets left: ticking the filled sets first is a quiet choice under Finish, never the one in the thumb's way */
.wk-fill{justify-self:center;align-self:center;min-height:44px;margin-block-start:2px;white-space:normal;text-align:center;font-weight:600;color:var(--muted);text-decoration:underline;text-underline-offset:3px}

/* "Find your 5": a lifter who knows roughly what they lift starts the climb nearer it */
.wk-guess{display:grid;gap:6px;margin-block-start:8px}
.wk-guess-q{font-size:var(--t-sm);font-weight:600;color:var(--hero-ink)}
.wk-guess-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;color:var(--hero-muted);font-size:var(--t-sm);font-weight:600}
.wk-guess .input{inline-size:6em;min-block-size:44px;padding-block:6px;text-align:center;font:700 var(--t-lg)/var(--lh-tight) var(--font-display)}
.wk-guess .btn{min-height:44px;background:var(--hero-chip);color:var(--hero-ink);border-color:transparent}
.wk-guess .input[aria-invalid="true"]{box-shadow:0 0 0 2px var(--bad)}
html[lang="ar"] .wk-guess-q,html[lang="ar"] .wk-guess-row{line-height:var(--lh-body)}
/* after finishing: keep today's added exercises and supersets in the plan day? Then do it again */
.wk-planask-list{margin:0;padding-inline-start:1.2em;display:grid;gap:4px}
.wk-repeat{gap:8px}
.wk-repeat .ic{inline-size:18px;block-size:18px}

/* ---------- after the last set: the way on ---------- */
.wk-after:empty{display:none}
.wk-gonext{min-block-size:56px}
.wk-gonext>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[lang="ar"] .wk-gonext>span,html[lang="ar"] .rest-nextex>span{line-height:1.7}   /* keeps the dots under ي inside the clip box */
.wk-setbar{gap:8px}
/* room at the page's end for the rest bar and the docked "Reps left" chips (--keep-h, workout.js keepRoom: never
   shrinks while the screen is up, so a bar or a strip going away moves nothing under the thumb) */
.wk-spacer{flex:none;block-size:max(0px,calc(var(--keep-h,var(--rest-h,0px)) - 110px))}
/* every set done: Finish workout waits at the bottom of the screen, in the thumb's reach, where the rest bar was */
.wk-nav.is-dock{position:sticky;z-index:6;inset-block-end:calc(max(var(--rest-h,0px) + env(safe-area-inset-bottom,0px),var(--dock-now,0px)) + 12px);
  margin-block-start:-8px;padding-block-start:16px;background:linear-gradient(transparent,var(--bg) 14px)}
/* the Finish button stays quiet until a set is ticked */
.topbar .wk-finish.is-quiet{background:transparent;color:var(--muted);border-color:var(--line);box-shadow:none}

/* ---------- rest bar: label and what comes next on top, time and buttons below ---------- */
.rest-row{grid-template-areas:"lab lab lab lab" "left b1 b2 b3";row-gap:4px;column-gap:8px;padding-block:10px;min-block-size:0}
/* Skip (it has an Undo) keeps a clear gap from +15 s */
.rest-row .btn[data-rest="skip"]{margin-inline-start:8px}
.rest-label{display:flex;align-items:baseline;gap:6px;min-width:0;max-inline-size:none;margin:0;align-self:auto;
  font:600 var(--t-sm)/var(--lh-ui) var(--font-body);letter-spacing:0;text-transform:none;color:var(--timer-ink);white-space:nowrap;overflow:hidden}
.rest-label b{flex:none;font:700 var(--t-xs)/var(--lh-ui) var(--font-body);letter-spacing:var(--track-label);text-transform:uppercase}
.rest-next{min-width:0;overflow:hidden;text-overflow:ellipsis}
/* the time column is never narrower than the time (views.css minmax(min-content,1fr)): the label above it and the
   big line take only the room that is there */
.rest-bar:not(.is-full) :is(.rest-label,.rest-big){contain:inline-size}
.rest-bar:not(.is-full) .rest-big{flex:1 1 auto}
/* phones under 380 px: label, time and the three buttons on rows of their own, so a long time ("10:00", "+1:02:05")
   never runs into -15 s */
@media (max-width: 379px){
  /* (the same inset on both sides: the buttons span the row here, and Rest over's one button sits in its middle) */
  .rest-bar:not(.is-full) .rest-row{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-areas:"lab lab lab" "left left left" "b1 b2 b3";column-gap:10px;padding-inline:14px}
  .rest-bar:not(.is-full) .rest-row .btn{min-width:0}
  .rest-bar:not(.is-full) .rest-row .btn[data-rest="skip"]{margin-inline-start:0}   /* (the grid's gap spaces it here) */
  .rest-bar.is-over:not(.is-full) .rest-row{grid-template-areas:"lab lab lab" "left left left" "b3 b3 b3"}
}
.rest-label b:empty{display:none}
.rest-label:has(b:empty):has(.rest-next:empty){display:none}
.rest-label b:not(:empty)+.rest-next:not(:empty)::before{content:"· ";opacity:.7}
/* a rest counting down: one big line, the set to do next ("Set 2 · 77.5 kg × 5"), no "Rest" label */
.rest-bar:not(.is-over):not(.is-warm) .rest-next{font:700 var(--d-sm)/var(--lh-ui) var(--font-display);letter-spacing:var(--track-d-md)}
html[lang="ar"] .rest-bar:not(.is-over):not(.is-warm) .rest-next{font:700 var(--t-lg)/var(--lh-body) var(--font-body)}
/* a choice (or the "Reps left" chips) docked on the bar says what comes next: the bar keeps only its time and buttons */
html[data-wkdock] .rest-bar:not(.is-full):not(.is-over) .rest-label{display:none}
/* a toast with Undo sits above the dock, never on its buttons */
html[data-wkdock] .shell.focus~.toast:not(.pwa-update){inset-block-end:calc(var(--wk-dock-top,0px) + 8px)}
html[lang="ar"] .rest-label b{font-size:var(--t-sm)}
html[lang="ar"] .rest-label,html[lang="ar"] .rest-label b{line-height:1.7}   /* "التالي" lost the dots under ي at 1.25 */
.rest-left{align-self:center}
/* the rest time reads left to right, so "+0:51" (rest over) keeps its sign in front in Arabic instead of "0:51+";
   text-align keeps it on the start (right) side as before */
html[lang="ar"] .rest-left{direction:ltr;unicode-bidi:isolate;text-align:right}
.rest-bar :focus-visible{outline-color:var(--timer-ink)}
.rest-nextex{display:flex;align-items:center;justify-content:space-between;gap:10px;inline-size:calc(100% - 20px);margin:0 10px 10px;min-block-size:52px;padding:0 16px;
  border:0;border-radius:var(--r-md);background:var(--timer-ink);color:var(--timer-bg);font:700 var(--t-lg)/var(--lh-ui) var(--font-display);letter-spacing:var(--track-d-sm);text-transform:uppercase;cursor:pointer}
.rest-nextex>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rest-nextex .ic{width:20px;height:20px}
html[lang="ar"] .rest-nextex{font-family:var(--font-body);font-size:var(--t-md)}
/* rest over: the bar stays, turns green and counts up until the next set is ticked or it is hidden */
.rest-bar.is-over{background:var(--good);color:var(--good-ink)}
.rest-bar.is-over .rest-fill{opacity:0}
.rest-bar.is-over .rest-label{color:var(--good-ink)}
.rest-bar.is-over .btn[data-rest="-15"],.rest-bar.is-over .btn[data-rest="15"]{display:none}
.rest-bar.is-over .rest-row .btn[data-rest="skip"]{background:var(--good-ink);color:var(--good);margin-inline-start:0}   /* Hide alone: centred where it spans */
.rest-bar.is-over .rest-nextex{background:var(--good-ink);color:var(--good)}
.rest-bar.is-over :focus-visible{outline-color:var(--good-ink)}
/* the time is a button: tap it for the full-screen timer */
.rest-main{grid-area:left;display:flex;align-items:center;min-width:0;min-block-size:52px;padding:0;border:0;border-radius:var(--r-md);background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}
.rest-big{display:none;min-width:0;font:700 var(--d-md)/var(--lh-ui) var(--font-display);letter-spacing:var(--track-d-md);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[lang="ar"] .rest-big{font-family:var(--font-body);font-size:var(--d-md);line-height:var(--lh-body);white-space:normal;text-wrap:balance}
/* rest over with a set to do: that set is the big line, "Rest over +0:26" the small one above it */
.rest-bar.is-over .rest-next::before{content:none}
.rest-bar.is-over:not(.has-big) .rest-next{display:none}
.rest-bar.is-over.has-big .rest-left{display:none}
.rest-bar.is-over.has-big .rest-big{display:block}
/* round 22: the set on one line, its load on the next (the text carries a line break between them, never a lone "·") */
.rest-bar.is-over.has-big .rest-big,.rest-bar.is-full .rest-big{white-space:pre-line;text-overflow:clip}
.rest-close{display:none}
/* full screen: readable from the bench, tap anywhere (or the cross, or Escape) to make it small again */
.rest-bar.is-full{inset:0;max-inline-size:none;margin:0;border-radius:0;z-index:55;display:flex;flex-direction:column;justify-content:center;
  padding:calc(env(safe-area-inset-top,0px) + 72px) 20px calc(env(safe-area-inset-bottom,0px) + 24px);cursor:pointer}
.rest-bar.is-full .rest-row{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-areas:"lab lab lab" "left left left" "b1 b2 b3";
  row-gap:18px;column-gap:10px;padding:0;inline-size:100%;max-inline-size:560px;margin:0 auto;min-block-size:0}
.rest-bar.is-full .rest-label{justify-content:center;font-size:var(--t-lg);white-space:normal;flex-wrap:wrap;text-align:center}
.rest-bar.is-full .rest-label b{font-size:var(--t-md)}
/* full screen: the next set is not printed under the label, but a screen reader still reads it */
.rest-bar.is-full:not(.is-over) .rest-next{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.rest-bar.is-full .rest-main{flex-direction:column;justify-content:center;gap:12px;inline-size:100%;cursor:pointer}
.rest-bar.is-full .rest-left{font-size:clamp(96px,34vw,220px);line-height:var(--lh-tight);align-self:center;text-align:center}
.rest-bar.is-full .rest-big{display:block;max-inline-size:100%;font-size:clamp(var(--d-md),7.5vw,var(--d-xl));line-height:var(--lh-ui);white-space:normal;text-align:center;overflow-wrap:anywhere;text-wrap:balance}
.rest-bar.is-full.is-over.has-big .rest-big{font-size:clamp(var(--d-xl),12vw,84px);line-height:var(--lh-tight)}
html[lang="ar"] .rest-bar.is-full .rest-big{font-size:clamp(var(--d-md),7.5vw,var(--d-xl));line-height:var(--lh-body)}
html[lang="ar"] .rest-bar.is-full.is-over.has-big .rest-big{font-size:clamp(var(--d-xl),12vw,84px);line-height:var(--lh-body)}
.rest-bar.is-full .rest-row .btn{min-height:64px;font-size:var(--d-sm);border-radius:var(--r-md)}
.rest-bar.is-full.is-over .rest-row{grid-template-areas:"lab lab lab" "left left left" ". b3 ."}
.rest-bar.is-full .rest-nextex{inline-size:100%;max-inline-size:560px;margin:22px auto 0;min-block-size:60px}
.rest-bar.is-full .rest-close{display:grid;position:absolute;inset-block-start:calc(env(safe-area-inset-top,0px) + 14px);inset-inline-end:14px;
  background:var(--timer-btn);color:var(--timer-ink);border:0;box-shadow:none}
.rest-bar.is-full.is-over .rest-close{background:var(--good-ink);color:var(--good)}

/* ---------- the live workout pill on other screens: name, rest or clock, opens the workout ---------- */
.live-pill{position:fixed;z-index:35;inset-inline:16px;inset-block-end:calc(var(--tabbar-h) + env(safe-area-inset-bottom,0px) + 10px);max-inline-size:520px;margin-inline:auto;
  display:flex;align-items:center;gap:8px;min-block-size:48px;padding:6px 14px;padding-inline-start:14px;border-radius:999px;overflow:hidden;isolation:isolate;
  background:var(--timer-bg);color:var(--timer-ink);text-decoration:none;font:600 var(--t-md)/var(--lh-ui) var(--font-body);box-shadow:var(--e2)}
.live-pill.is-low{inset-block-end:calc(env(safe-area-inset-bottom,0px) + 12px)}
.lp-fill{position:absolute;inset:0;z-index:-1;background:var(--timer-fill);transform-origin:left center;transform:scaleX(0)}
/* the rest bar's and the pill's fill drain by themselves: rest.js starts this the length of the rest (two names, so
   a changed rest restarts it) */
@keyframes rest-drain{from{transform:scaleX(1)}to{transform:scaleX(0)}}
@keyframes rest-drain-b{from{transform:scaleX(1)}to{transform:scaleX(0)}}
/* full screen: the fill drains top to bottom, so the time left reads as a level (never a sliver at one edge) */
@keyframes rest-drain-v{from{transform:scaleY(1)}to{transform:scaleY(0)}}
@keyframes rest-drain-v-b{from{transform:scaleY(1)}to{transform:scaleY(0)}}
.rest-bar.is-full .rest-fill{transform-origin:center bottom}
[dir="rtl"] .lp-fill{transform-origin:right center}
.lp-dot{flex:none;inline-size:10px;block-size:10px;border-radius:50%;background:var(--done);box-shadow:0 0 0 3px color-mix(in srgb,var(--done) 30%,transparent)}
.lp-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.lp-sep{flex:none;opacity:.7}
.lp-stat{flex:none;white-space:nowrap}
.live-pill>.ic{flex:none;width:18px;height:18px;margin-inline-start:auto}
.live-pill.is-over{background:var(--good);color:var(--good-ink)}
.live-pill.is-over .lp-dot{background:var(--good-ink);box-shadow:none}
.live-pill:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
html[lang="ar"] .live-pill{line-height:1.7}
.shell.has-pill:not(.focus) .main{padding-block-end:calc(var(--tabbar-h) + env(safe-area-inset-bottom,0px) + 88px)}
.shell.has-pill:not(.focus)~.toast:not(.pwa-update){inset-block-end:calc(var(--tabbar-h) + env(safe-area-inset-bottom,0px) + 70px)}

/* ---------- set rows: the next set to do, a record (a medal by kind in the row's top line), a first-time guess ---------- */
.wk-card .set-row.is-next{background:var(--accent-soft)}
.set-row.is-next::after{content:"";position:absolute;inset-block:0;inset-inline-start:0;inline-size:4px;background:var(--accent);pointer-events:none}
/* the one filled control while sets remain: the next set's tick */
.set-row.is-next .set-check:not([aria-pressed="true"]){background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.set-row.is-next .set-no b{color:var(--accent)}
.set-row.is-next .stepper,.set-row.is-next .set-in.reps[data-reps]{background:var(--surface)}
/* a record stays a done row (green) with one gold thing on it, its medal; the tick's burst is gold for that moment */
.set-row.is-pr .set-no,.set-row.is-pr .set-prev{color:var(--ink)}
.wk-card .set-row.is-done .set-check[aria-pressed="true"]{box-shadow:none}
/* a done row is still: no - and + (the layout keeps their room, nothing moves), its numbers in ink; a tap on a
   number edits it, and the steppers come back while it is being typed in */
.wk-card:not(.is-edit) .set-row.is-done:not(.is-ramp) .stp{visibility:hidden}
.wk-card .set-row.is-done .stepper:focus-within .stp{visibility:visible}
.wk-card:not(.is-edit) .set-row.is-done .stepper{background:transparent}
/* medals: heaviest weight (gold), a rep record at a weight and a best estimated max (gold on soft gold, quieter) */
.set-medal{display:inline-flex;align-items:center;gap:5px;block-size:24px;padding-inline:3px 9px;border-radius:999px;font:700 var(--t-xs)/var(--lh-tight) var(--font-body);
  white-space:nowrap;background:var(--gold-soft);color:var(--ink);box-shadow:inset 0 0 0 1px var(--gold-line);pointer-events:none}
.set-medal .ic{box-sizing:content-box;inline-size:11px;block-size:11px;padding:3px;border-radius:50%;background:var(--gold);color:var(--gold-ink);stroke-width:var(--ic-stroke-bold)}
.set-medal.k-top{background:var(--gold);color:var(--gold-ink);box-shadow:none}
.set-medal.k-top .ic{background:var(--gold-ink);color:var(--gold)}
.set-medal.k-e1{background:var(--surface-2);box-shadow:inset 0 0 0 1px var(--line)}
html[lang="ar"] .set-medal{font-size:var(--t-xs);line-height:var(--lh-body)}
/* a first-time starting guess: the ghost of an empty field */
.wk-card .stepper .input::placeholder{color:var(--muted);font-weight:400;opacity:1}
/* bodyweight at the top of the range: a harder version is the way on */
.wk-tgt .wk-harder{justify-self:start;margin-block-start:6px;background:var(--hero-chip);color:var(--hero-ink);border-color:transparent}

/* ---------- finished workout: summary, headed by a navy hero ---------- */
.wk-hero{gap:16px}
.wk-hero-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.wk-hero-id{gap:6px;min-width:0}
.wk-hero-sub{color:var(--hero-muted);font-size:var(--t-md);max-inline-size:none}
.wk-medal{flex:none;display:grid;place-items:center;inline-size:58px;block-size:58px;border-radius:50%;background:var(--hero-chip);color:var(--done)}
.wk-medal .ic{width:28px;height:28px;stroke-width:var(--ic-stroke-bold)}
.wk-medal.is-gold{background:var(--gold);color:var(--gold-ink)}
/* stat tiles: never wider than their third of the row, the number shrinks first */
.wk-stats .hero-stat{min-width:0;justify-items:start}
.wk-stats .big-num{display:block;font-size:clamp(var(--d-sm),8.4vw,var(--d-lg));max-inline-size:100%;overflow:hidden;text-overflow:ellipsis}
/* Arabic "3 مليون": the word may go under the number rather than out of the tile */
.wk-u{font-size:.5em;font-weight:700}
html[lang="ar"] .wk-u{font-family:var(--font-body);font-size:.42em;line-height:var(--lh-tight)}
.wk-hero-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-block-start:14px;border-block-start:1px solid var(--hero-line)}
.wk-week{display:flex;align-items:center;gap:12px;min-width:0}
.wk-ring.fx-ring{inline-size:56px;block-size:56px}
.wk-week-txt{gap:2px;min-width:0}
.wk-week-txt .small{color:var(--hero-muted)}
.wk-mmap{flex:none}
.wk-mmap .mmap{background:transparent;border:0;padding:0;gap:2px;--sil:var(--hero-chip);--m0:var(--hero-chip)}
.wk-mmap .mmap figure{flex:0 0 40px}
.wk-mmap .mmap svg{width:40px}
.wk-mmap .mmap figcaption{display:none}
/* the streak: a pill with the round gold trophy Today's streak badge has */
.wk-streak{margin:0;align-self:flex-start;max-width:100%;padding-block:5px;padding-inline:5px 14px;border-radius:999px;background:var(--hero-chip);color:var(--hero-ink);white-space:normal}
.wk-streak>.ic{flex:none;inline-size:26px;block-size:26px;padding:5px;border-radius:50%;background:var(--gold);color:var(--gold-ink)}
.wk-share{align-self:flex-start;min-height:44px;padding-inline:16px}
.wk-share .ic{width:18px;height:18px}
/* the records card is a plain card: its one gold thing is the trophy in its title */
.wk-pr-row{display:flex;align-items:baseline;justify-content:space-between;gap:4px 12px;flex-wrap:wrap;padding-block:8px}
.wk-pr-name{font-weight:600;min-width:0}
.wk-gain{flex:none}
.wk-cmp{display:flex;align-items:center;gap:var(--s-2);margin:0;max-inline-size:none;padding:var(--s-3) 14px;border-radius:var(--r-md);font-size:var(--t-sm);font-weight:600;background:var(--surface-2);color:var(--ink)}
.wk-cmp.up>.ic{color:var(--good)}
.wk-cmp .muted{font-weight:400}
.wk-cmp.down>.ic{transform:scaleY(-1)}
.sum-list>li{padding:10px 12px}
.sum-row{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:var(--s-3);align-items:center}
.sum-thumb{display:block;inline-size:48px;border-radius:var(--r-sm);overflow:hidden;color:inherit}
.sum-thumb .thumb{inline-size:48px}
.sum-txt{gap:2px}
.pr-chip .ic{width:14px;height:14px}
.wk-prs .h3{display:flex;align-items:center;gap:10px}
.wk-note-text{white-space:pre-wrap;overflow-wrap:anywhere}
.topbar .wk-edit .ic{width:18px;height:18px}

@media (prefers-reduced-motion: no-preference){
  .wk-steps .wk-ava{transition:box-shadow .2s}
  .reps-pick{animation:fx-rise .22s cubic-bezier(.2,.8,.2,1)}
  .wk-gonext{animation:fx-rise .42s cubic-bezier(.2,.8,.2,1) backwards}
  .topbar .wk-finish.btn-good{animation:fx-popin .42s cubic-bezier(.3,1.6,.5,1)}
  .rest-bar.is-over{animation:wk-over .5s cubic-bezier(.3,1.5,.5,1)}
  .rest-bar.is-over .rest-left{animation:wk-breathe 2s ease-in-out 3;transform-origin:0 60%}
  [dir="rtl"] .rest-bar.is-over .rest-left{transform-origin:100% 60%}
  @keyframes wk-over{0%{transform:scale(.97)}60%{transform:scale(1.015)}100%{transform:none}}
  @keyframes wk-breathe{50%{transform:scale(1.05)}}
  .rest-bar.is-full{animation:wk-full .28s cubic-bezier(.2,.9,.3,1)}
  @keyframes wk-full{from{opacity:.5;transform:scale(.97)}}
  .rest-bar.is-full.is-over .rest-big{animation:wk-breathe 2s ease-in-out 3}
  .live-pill:not([hidden]){animation:fx-rise .3s cubic-bezier(.2,.9,.3,1)}
  .live-pill:not(.is-rest):not(.is-over) .lp-dot{animation:wk-live 1.8s ease-in-out 3}
  /* the target card's light drifts twice, then holds: nothing keeps the screen redrawing for a whole workout */
  .wk-card .target-card::before{animation-iteration-count:2;will-change:auto}
  @keyframes wk-live{50%{opacity:.35}}
  html[data-vt] .live-pill{view-transition-name:fx-pill}
  .set-row.is-next{transition:background-color .25s}
  .set-medal{animation:fx-trophy .6s cubic-bezier(.3,1.6,.5,1)}
  .eff-pick,.set-hint,.tst-rpe-pick{animation:fx-rise .22s cubic-bezier(.2,.8,.2,1)}
  .rir-b{animation:fx-popin .3s cubic-bezier(.3,1.6,.5,1)}
  .rest-note:not([hidden]){animation:fx-rise .3s cubic-bezier(.2,.8,.2,1)}
  .nt-card .nt-done{animation:fx-rise .3s cubic-bezier(.2,.8,.2,1)}
  .warm-cta{transition:inset-block-end .25s}
  .wk-hero.is-fresh .wk-medal{animation:fx-trophy .75s cubic-bezier(.3,1.6,.5,1) .1s backwards}
  .wk-hero.is-fresh .h1{animation:fx-rise .45s cubic-bezier(.2,.8,.2,1) .2s backwards}
}
@media (prefers-reduced-motion: reduce){
  .ex-thumb-img.loop img+img{animation:none;opacity:0}
  .reps-pick,.wk-gonext,.topbar .wk-finish,.rest-bar.is-over,.rest-bar.is-over .rest-left,.rest-bar.is-full,.rest-bar .rest-big,
  .live-pill,.lp-dot,.set-medal,.wk-medal,.wk-hero .h1,.eff-pick,.set-hint,.tst-rpe-pick,.rir-b,.rest-note,.nt-done{animation:none!important}
  .lp-fill{transition:none}
}

/* ===================== strength system on the workout screen ===================== */
/* the plan line under a big lift's name: "Week 2 of cycle 1 · TM 113 kg" */
.ex-title .wk-plan{font-weight:600;color:var(--accent);line-height:var(--lh-ui)}
html[lang="ar"] .ex-title .wk-plan{line-height:var(--lh-body)}
/* a calm line above the exercise in a light session or a deload week */
.wk-banner{margin-block:-4px 0}
/* a line of text with its Why? at the end (the banner note, the pain note) */
.wk-line{display:flex;align-items:center;gap:var(--s-2);margin:0;max-width:none}
.wk-line>span,.wk-line>b{flex:1;min-width:0}

/* a set's top line: its own target ("65 kg × 5 · 75%", "5+" pill for an all-out set), then the medal and "@2" */
.wk-card .set-meta{display:none}
.wk-card .set-row.has-meta{grid-template-rows:auto auto;row-gap:3px;padding-block-start:6px}
.wk-card .set-row.has-meta>.set-meta{display:flex;grid-column:2/4;grid-row:1;align-items:center;gap:6px;min-width:0;min-block-size:26px}
.wk-card .set-row.has-meta>.set-no{grid-row:1/3}
.wk-card .set-row.has-meta>.set-fields,.wk-card .set-row.has-meta>.set-check{grid-row:2}
.set-tgt{display:inline-flex;align-items:center;gap:6px;min-width:0;font:600 var(--t-sm)/var(--lh-ui) var(--font-body);color:var(--muted);white-space:nowrap;overflow:hidden}
.set-tgt>.ic{inline-size:14px;block-size:14px;flex:none;color:var(--accent)}
.tgt-v{min-width:0;overflow:hidden;text-overflow:ellipsis}
.tgt-pct{flex:none;padding:3px 6px;border-radius:999px;background:var(--surface-2);font-size:var(--t-xs);line-height:var(--lh-tight)}
.tgt-plus{flex:none;display:inline-grid;place-items:center;min-inline-size:32px;min-block-size:24px;padding-inline:7px;border-radius:999px;background:var(--accent);color:var(--accent-ink);font:700 var(--t-md)/var(--lh-tight) var(--font-display);direction:ltr;unicode-bidi:isolate}
/* under the set number: an all-out set's "5+" pill, a percentage set's share of the training max (the set number
   button around it is the 44px target) */
.wk-card .set-no .tgt-plus{min-inline-size:34px;font-size:var(--t-sm)}
.wk-card .set-no .tgt-pct{padding:3px 6px;font:700 var(--t-xs)/var(--lh-tight) var(--font-body);color:var(--muted)}
.set-row.is-done .set-no .tgt-plus{background:var(--surface-2);color:var(--muted)}
.set-row.is-next .set-no .tgt-pct{background:var(--surface)}
.hint-amrap .tgt-pct{display:inline-block;margin-inline-end:4px;padding:2px 6px;border-radius:999px;background:var(--surface);font:700 var(--t-xs)/var(--lh-ui) var(--font-body);color:var(--muted)}
html[lang="ar"] .set-tgt{line-height:var(--lh-body)}
.set-badges{display:inline-flex;align-items:center;gap:6px;flex:none;margin-inline-start:auto}
.set-row.is-done .set-tgt>.ic{color:var(--good)}
.set-row.is-next .tgt-pct{background:var(--surface)}
/* the reps left on a rated set: tap it to change (the hit area reaches 44px) */
/* the button is 44 px tall (its pill 26, drawn by ::before) and takes 26 px of the row */
.rir-b{position:relative;isolation:isolate;display:inline-grid;place-items:center;min-inline-size:44px;block-size:44px;margin-block:-9px;padding-inline:10px;border:0;border-radius:999px;
  background:none;color:var(--accent);font:700 var(--t-sm)/var(--lh-tight) var(--font-body);white-space:nowrap;cursor:pointer}
.rir-b::before{content:"";position:absolute;z-index:-1;inset-block:9px;inset-inline:0;border-radius:999px;background:var(--accent-soft)}
.rir-b::after{content:"";position:absolute;inset:0}
html[lang="ar"] .rir-b{font-size:var(--t-sm);line-height:var(--lh-body)}
.set-row.is-done .rir-b::before{background:var(--surface);box-shadow:inset 0 0 0 1px var(--good)}
/* an all-out set not yet done: its reps read "5+" */
.set-in.reps.is-plus b{direction:ltr;unicode-bidi:isolate}
.set-in.reps.is-plus b::after{content:"+";font-size:.8em}
.wk-card .set-row.is-amrap:not(.is-done){box-shadow:inset 0 1px 0 var(--accent-line)}

/* under an all-out set: the stop rule and what beats your record */
.list>li.set-hint{position:relative;display:grid;gap:4px;border-block-start:0;padding:0 10px 10px;padding-inline-start:56px}
.set-row.is-next+li.set-hint{background:var(--accent-soft)}
.set-row.is-next+li.set-hint::after{content:"";position:absolute;inset-block:0;inset-inline-start:0;inline-size:4px;background:var(--accent)}
.set-hint p{display:flex;align-items:flex-start;gap:7px;margin:0;max-width:none;font-size:var(--t-sm);line-height:var(--lh-body);color:var(--ink)}
.set-hint .ic{flex:none;inline-size:15px;block-size:15px;margin-block-start:1px}
.hint-amrap .ic{color:var(--accent)}
.hint-rec .ic{box-sizing:content-box;inline-size:10px;block-size:10px;padding:2.5px;border-radius:50%;background:var(--gold);color:var(--gold-ink);stroke-width:var(--ic-stroke-bold)}
html[lang="ar"] .set-hint p{line-height:var(--lh-body)}

/* effort: "Reps left 0 1 2 3 4 5+" after a ticked set, one tap and it folds into "@2" on the row. The strip follows
   its row in the page (reading and keyboard order) but is docked at the bottom of the screen, just above the rest
   bar where the thumb already is: nothing in the set list moves when it comes or goes (workout.js drawEff). */
.list>li.tst-rpe-pick{border-block-start:0;padding:2px 10px 10px;padding-inline-start:56px}
/* the dock: the "Reps left" chips, or one decision (workout.js drawDock), tucked into the top of the rest bar so the
   two read as one surface at the bottom of the screen, where the thumb is */
.wk-card .list>li.eff-pick,.wk-card .wk-dock{position:fixed;z-index:39;inset-inline:10px;inset-block-end:calc(env(safe-area-inset-bottom,0px) + max(10px,var(--rest-h,0px) - 22px));
  max-inline-size:740px;margin-inline:auto;padding:8px 12px calc(10px + min(22px,var(--rest-h,0px)));border:0;border-radius:var(--r-lg);background:var(--surface);
  box-shadow:var(--e2),inset 0 0 0 1px var(--line)}
.wk-dock{display:grid;gap:8px}
.wk-dock-t{display:flex;align-items:center;gap:8px;margin:0;max-width:none;font:600 var(--t-md)/var(--lh-ui) var(--font-body);color:var(--ink)}
.wk-dock-t .ic{flex:none;inline-size:18px;block-size:18px;color:var(--accent)}
.wk-dock-b .btn{min-height:48px;white-space:normal;line-height:var(--lh-ui)}
html[lang="ar"] .wk-dock-t{line-height:var(--lh-body)}
.eff-in{display:grid;gap:6px;min-width:0}
.eff-q{font:700 var(--t-xs)/var(--lh-ui) var(--font-body);letter-spacing:var(--track-label);text-transform:uppercase;color:var(--muted)}
html[lang="ar"] .eff-q{font-size:var(--t-sm);line-height:var(--lh-body);letter-spacing:0}
.eff-chips{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;min-width:0}
.eff-chips .chip{justify-content:center;min-inline-size:0;min-height:46px;padding-inline:4px;font:700 var(--t-xl)/var(--lh-tight) var(--font-display);background:var(--surface-2);color:var(--ink)}
html[lang="ar"] .eff-chips .chip{direction:ltr;unicode-bidi:isolate}   /* "5+" read "+5" in a right-to-left chip */
.eff-chips .chip.accent{background:var(--accent);color:var(--accent-ink)}
.eff-sub{margin:4px 0 0;max-width:none;font-size:var(--t-sm);line-height:var(--lh-body);color:var(--muted)}
html[lang="ar"] .eff-sub{line-height:var(--lh-body)}
/* an all-out set asks first and louder */
.wk-card .list>li.eff-pick.is-amrap{box-shadow:var(--e2),inset 0 0 0 2px var(--accent)}
.eff-pick.is-amrap .eff-q{font:700 var(--t-md)/var(--lh-ui) var(--font-body);letter-spacing:0;text-transform:none;color:var(--ink)}
html[lang="ar"] .eff-pick.is-amrap .eff-q{line-height:var(--lh-body)}
@media (max-width: 359px){
  .wk-card .list>li.eff-pick{padding-inline:8px}
  .eff-chips{gap:6px}
}
@container (max-width: 349px){
  .list>li.set-hint,.list>li.tst-rpe-pick{padding-inline-start:12px}
}

/* ---------- a max test ---------- */
.tst-intro{margin-block-start:-4px;max-width:none}
.tst-safe .btn{background:var(--surface);border-color:var(--line-strong)}
.tst-safe-ok{display:flex;align-items:center;gap:8px;margin:0;font-weight:600;color:var(--good)}
.tst-safe-ok .ic{inline-size:20px;block-size:20px}
.tst-h{margin-block-start:4px}
.tst-log{background:var(--surface);border:1px solid var(--card-line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--e1)}
.tst-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;min-block-size:60px;padding-block:8px;padding-inline:14px 10px}
.tst-row.is-made{background:var(--good-soft)}
.tst-n{flex:none;inline-size:28px;block-size:28px;border-radius:50%;display:grid;place-items:center;background:var(--surface);box-shadow:inset 0 0 0 1px var(--line);font:700 var(--t-md)/var(--lh-tight) var(--font-display)}
.tst-row-w{font:700 var(--d-sm)/var(--lh-tight) var(--font-display)}
html[lang="ar"] .tst-row-w{font-size:var(--t-xl);line-height:var(--lh-body)}
.tst-row .chip .ic{inline-size:14px;block-size:14px}
.tst-miss-chip{background:var(--bad-soft);color:var(--bad)}
.tst-rpe{font-weight:600;font-size:var(--t-sm);color:var(--muted)}
.tst-undo{margin-inline-start:auto}
.list>li.tst-rpe-pick{padding-inline-start:14px;background:var(--good-soft)}
.tst-card{gap:12px}
.tst-top{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin:0}
.target-card .tst-why{font-size:var(--t-sm);color:var(--hero-ink)}
.tst-w{display:flex;align-items:center;justify-content:space-between;gap:8px}
.tst-w .stp{inline-size:56px;min-height:56px;border-radius:var(--r-md);background:var(--hero-chip);color:var(--hero-ink)}
.tst-w .stp svg{inline-size:22px;block-size:22px}
.target-card .tst-kg{display:flex;align-items:baseline;justify-content:center;gap:6px;margin:0;min-width:0;color:var(--hero-ink)}
.tst-kg b{font:700 clamp(var(--d-xl),16vw,var(--d-2xl))/var(--lh-tight) var(--font-display);letter-spacing:var(--track-d-lg)}
.tst-kg span{font:700 var(--t-xl)/var(--lh-tight) var(--font-display);color:var(--hero-muted)}
html[lang="ar"] .tst-kg span{font-family:var(--font-body);font-size:var(--t-lg);line-height:var(--lh-body)}
.tst-btns .btn{min-height:58px;font-size:var(--t-lg);font-weight:700}
.target-card .tst-miss{background:var(--hero-chip);color:var(--hero-ink);border-color:transparent}
.tst-end{align-self:center}
.tst-stop{gap:var(--s-2)}
.tst-stop-t{display:flex;align-items:flex-start;gap:8px;margin:0;max-width:none}
.tst-stop-t .ic{flex:none;color:var(--ink);margin-block-start:2px}
.tst-best{display:flex;align-items:center;gap:var(--s-2);margin:0;font:700 var(--d-sm)/var(--lh-ui) var(--font-display)}
html[lang="ar"] .tst-best{font-family:var(--font-body);font-size:var(--t-lg)}
/* the test's summary */
.tst-tm{display:flex;align-items:center;gap:8px;margin:0;max-width:none;padding:10px 12px;border-radius:var(--r-md);background:var(--hero-chip);color:var(--hero-ink);font-weight:600}
.tst-sum{list-style:none;margin:0;padding:0;display:grid;gap:2px}

/* ---------- "Next time": what this workout changed, lift by lift ---------- */
.nt-card{gap:10px}
.nt-h{display:flex;align-items:center;gap:8px}
.nt-h>.ic{color:var(--accent)}
.nt-list>li{padding-block:10px}
.nt-list>li:first-child{padding-block-start:2px}
.nt-lift{display:grid;gap:8px}
.nt-name{font-weight:700}
.nt-lines{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.nt-line{display:flex;align-items:flex-start;gap:10px;font-size:var(--t-md);line-height:var(--lh-body)}
html[lang="ar"] .nt-line{line-height:var(--lh-body)}
.nt-ic{flex:none;display:grid;place-items:center;inline-size:28px;block-size:28px;border-radius:50%;background:var(--surface-2);color:var(--ink)}
.nt-ic .ic{inline-size:16px;block-size:16px}
.nt-line.tone-good .nt-ic{background:var(--good-soft);color:var(--good)}
.nt-line.tone-accent .nt-ic{background:var(--accent-soft);color:var(--accent)}
.nt-line.tone-gold .nt-ic{background:var(--gold);color:var(--gold-ink)}
.nt-txt{padding-block-start:4px;min-width:0;overflow-wrap:anywhere}
.nt-grad{display:grid;gap:var(--s-2);padding:var(--s-3) 14px;border-radius:var(--r-md);background:var(--accent-soft)}
.nt-grad-q{display:flex;align-items:flex-start;gap:8px;margin:0;max-width:none;color:var(--ink)}
.nt-grad-q .ic{flex:none;color:var(--accent);margin-block-start:2px}
.nt-grad-why{max-width:none;color:var(--ink)}
.nt-done{display:flex;align-items:flex-start;gap:8px;margin:0;max-width:none;font-weight:600;color:var(--good)}
.nt-done .ic{flex:none;margin-block-start:2px}
.nt-done.muted{color:var(--muted)}
.nt-done:focus{outline:none}

/* ---------- the rest bar: why this rest is long ---------- */
.rest-note{display:flex;align-items:center;gap:6px;max-inline-size:760px;margin:0 auto;padding:var(--s-2) 18px 0;font:600 var(--t-sm)/var(--lh-ui) var(--font-body);color:var(--timer-muted)}
.rest-note .ic{flex:none;inline-size:15px;block-size:15px}
.rest-note span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[lang="ar"] .rest-note{line-height:var(--lh-body)}
.rest-bar.is-full .rest-note{justify-content:center;padding:0 0 18px;font-size:var(--t-xl)}
.rest-bar.is-full .rest-note span{white-space:normal;text-align:center}


/* ===================== round 7: stage 3, jokers, pain, peaks, short sessions ===================== */
/* lifts left out today (a peak, pain): one line under the banner, the reasons behind Why? */
.wk-skip{display:flex;align-items:center;gap:8px;margin:6px 2px 0;max-width:none;font-size:var(--t-sm);line-height:var(--lh-body);color:var(--muted)}
.wk-skip .ic{flex:none;inline-size:16px;block-size:16px}
.wk-skip>span{flex:1;min-width:0}
.wk-skip .wk-why,.wk-banner-in .wk-why,.wk-pain-t .wk-why{color:var(--ink);margin-block:-12px}
.wk-skip .wk-why::before{background:var(--surface-2)}
.wk-banner-in .wk-why::before,.wk-pain-t .wk-why::before{background:var(--surface)}
html[lang="ar"] .wk-skip{line-height:var(--lh-body)}
/* test day of a peak: one card, one button */
.wk-testday-card{gap:8px}
.wk-testday-card .h1{color:var(--hero-ink);margin:0}
.wk-testday{margin-block-start:4px}
/* pain on the card: the last report, what to do, one tap to report again; tinted by the 0-10 band */
.wk-card>[data-painbox]:empty{display:none}
/* the pain note (ui noteHtml, tone by the 0-10 band): its line with Why?, the rule, the choices, Update pain */
.wk-pain .note-b{gap:var(--s-2)}
.wk-pain-t{font-size:var(--t-md)}
.wk-pain-acts .btn{white-space:normal;line-height:var(--lh-ui)}
.wk-pain-b{justify-self:start;margin-inline-start:calc(var(--s-2) * -1);color:var(--ink)}
/* the "Something hurts" sheet: 0-10 in three labelled bands, big chips in one grid, a Sharp switch, Save */
.pain-sheet{gap:14px}
.pain-pick{display:grid;gap:12px}
.pain-band{display:grid;gap:6px}
.pain-band-l{font-size:var(--t-sm);color:var(--muted)}
.pain-band-l b{color:var(--ink)}
.pain-chips{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
button.chip.pain-c{justify-content:center;min-inline-size:0;min-height:52px;padding-inline:4px;font:700 var(--d-sm)/var(--lh-tight) var(--font-display);
  background:var(--good-soft);color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--good);-webkit-user-select:none;user-select:none;touch-action:manipulation}
button.chip.pain-c.band-mid{background:var(--warn-soft);box-shadow:inset 0 0 0 1.5px var(--warn)}
button.chip.pain-c.band-high{background:var(--bad-soft);box-shadow:inset 0 0 0 1.5px var(--bad)}
button.chip.pain-c[aria-pressed="true"]{background:var(--good);color:var(--surface);box-shadow:none}
button.chip.pain-c.band-mid[aria-pressed="true"]{background:var(--warn)}
button.chip.pain-c.band-high[aria-pressed="true"]{background:var(--bad)}
.pain-sharp{min-height:56px;padding-block:4px;gap:12px;cursor:pointer}
.pain-sharp .stack{gap:2px}
.pain-help{align-self:center;gap:6px}
/* the summary: a rep record chip on its exercise, praise for coming back, calendar reminders */
.sum-txt .wk-rr{align-self:flex-start;max-inline-size:100%;white-space:normal;line-height:var(--lh-ui);background:var(--gold-soft);color:var(--ink)}
.wk-rr .ic{flex:none;inline-size:14px;block-size:14px;color:var(--gold)}
.wk-cal{gap:8px;white-space:normal}
.wk-cal .ic{flex:none;inline-size:18px;block-size:18px}
.wk-pain-acts:not(.grid-2){display:grid}

/* ===================== round 8: the summary in one screen ===================== */
/* the first workout ever: a bigger medal, and the next session with one calm ask in the hero */
.wk-medal.is-first{inline-size:72px;block-size:72px}
.wk-medal.is-first .ic{width:34px;height:34px}
.wk-habit{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;margin:0;max-width:none;color:var(--hero-ink);font-weight:600}
.wk-habit>.ic{flex:none;inline-size:18px;block-size:18px;color:var(--hero-muted)}
.wk-habit-a{display:inline-flex;align-items:center;min-block-size:44px;margin-block:-10px;color:var(--hero-ink);text-decoration:underline;text-underline-offset:3px}
html[lang="ar"] .wk-habit{line-height:var(--lh-body)}
/* the set list folds behind one line */
.sum-fold>summary{list-style:none}
.sum-fold>summary::-webkit-details-marker{display:none}
.sum-fold-s{display:flex;align-items:center;justify-content:space-between;gap:8px;min-block-size:48px;padding:0 4px;cursor:pointer;font:600 var(--t-md)/var(--lh-ui) var(--font-body);color:var(--ink)}
.sum-fold-s .ic{flex:none;inline-size:18px;block-size:18px;color:var(--muted);transform:rotate(90deg)}
.sum-fold[open] .sum-fold-s .ic{transform:rotate(-90deg)}
.sum-fold[open]>summary{margin-block-end:8px}
/* Done: always in reach at the bottom of the screen */
.wk-done-bar{position:sticky;z-index:6;inset-block-end:calc(env(safe-area-inset-bottom,0px) + 12px);padding-block-start:12px;background:linear-gradient(transparent,var(--bg) 12px)}
.wk-done-bar .btn{min-height:54px}

/* ===================== round 9: set timer, tags, notes, a correction's day ===================== */
/* the step strip's names sit on the type scale (a bare <small> rendered 13.33 px) */
.wk-step small{font-size:var(--t-sm)}
/* the hero's eyebrow line spans the card on a wide screen too (a paragraph stops at 65ch: Why? floated mid-card) */
.wk-tgt-line{max-width:none}
/* a finished exercise: what was logged, smaller than a set to load */
.wk-tgt.is-done .wk-tgt-val{font-size:var(--d-md);line-height:var(--lh-ui);letter-spacing:0}
html[lang="ar"] .wk-tgt.is-done .wk-tgt-val{font-size:var(--d-sm)}
/* the set timer: Start timer under the hero's number; running, the hero is the stopwatch and the button stops it */
.wk-tgt .wk-timer{justify-self:start;gap:6px;min-block-size:44px;margin-block-start:6px;background:var(--hero-chip);color:var(--hero-ink);border-color:transparent}
.wk-tgt .wk-timer .ic{inline-size:16px;block-size:16px}
.wk-tgt.wk-timing .wk-timer{min-block-size:48px;padding-inline:18px;background:var(--hero-ink);color:var(--hero)}
.wk-timing .wk-tgt-val{unicode-bidi:isolate}
.wk-tgt.wk-timing{align-content:space-between}
.wk-timing .wk-tgt-val.is-hit{text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:6px}
/* "Rate": a done set with no rating yet (dashed, so it reads as something to do) */
.rir-b.is-rate{color:var(--muted)}
.rir-b.is-rate::before,.set-row.is-done .rir-b.is-rate::before{background:transparent;box-shadow:inset 0 0 0 1px var(--line)}
/* a technique set: its letter (D, M, R) in place of the set number */
.wk-card .set-row.is-tech>.set-no b{color:var(--accent)}
/* a cardio set's distance and effort, on the row's top line */
.set-cx{min-width:0;font:600 var(--t-sm)/var(--lh-ui) var(--font-body);color:var(--muted);overflow-wrap:anywhere}
html[lang="ar"] .set-cx{line-height:var(--lh-body)}
/* the set menu: tags are toggles (one row of three, then "Missed the last rep"), cardio extras a small form */
.wk-tags{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.wk-menu .wk-tags .btn{justify-content:center;padding-inline:6px;white-space:normal;text-align:center;line-height:var(--lh-ui)}
.wk-menu .wk-tag[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:700}
.wk-cx{display:grid;gap:8px;padding:12px;border-radius:var(--r-md);background:var(--surface-2)}
.wk-cx .field{min-width:0}
.wk-cx p{margin:0;max-width:none}
.wk-cx .set-err[hidden]{display:none}
/* today's note under the exercise name: one line */
.wk-daynote{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);line-height:var(--lh-ui)}
html[lang="ar"] .wk-daynote{line-height:1.7}
.sum-note{overflow-wrap:anywhere;line-height:var(--lh-body)}
/* the pinned note: 2 lines, growing to the 3 it keeps */
.ex-note{align-items:flex-start}
.ex-note>.ic{margin-block-start:12px}
.ex-note textarea.input{flex:1;min-width:0;resize:none;overflow:hidden;max-block-size:120px;padding-block:9px;line-height:var(--lh-ui)}
html[lang="ar"] .ex-note textarea.input{line-height:var(--lh-body)}
/* a correction: the day it was done, and Delete this workout */
.wk-doneon{display:flex;align-items:center;justify-content:space-between;gap:12px;font:600 var(--t-md)/var(--lh-ui) var(--font-body)}
.wk-doneon .input{flex:none;inline-size:auto;min-inline-size:11em;min-block-size:44px}
.wk-doneon-err[hidden]{display:none}
.wk-doneon-err{margin:0;max-width:none}
.wk-foot .wk-delwk{gap:8px;color:var(--bad)}
.wk-foot .wk-delwk .ic{inline-size:18px;block-size:18px}

/* ===================== round 10: verification fixes ===================== */
/* the set timer's target beside its count ("0:12 of 0:40"): one line, the count's own height */
.wk-stline{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 10px;margin:0;max-width:none}
.target-card .wk-stof{font:600 var(--t-lg)/var(--lh-ui) var(--font-body);letter-spacing:0;color:var(--hero-muted);white-space:nowrap}
/* today's note in the summary keeps its line breaks */
.sum-note{white-space:pre-line}
/* Keyboard focus is never left under a bar fixed over the page (WCAG 2.4.11). In a workout the "Reps left" chips and a
   docked choice sit above the rest timer: focus scrolls stop clear of whichever reaches higher (--wk-dock-top,
   workout.js keepRoom; app.css pads by the rest timer alone). On the finished workout they stop clear of the sticky
   "Back to Today" bar (12 + 54 + 12 px). Not on a short screen, where the bars already take most of it. */
html:has(.shell.focus .wk-done-bar){scroll-padding-block-end:calc(env(safe-area-inset-bottom,0px) + 90px)}
@media (min-height:501px){
  html[data-wkdock]:has(.shell.focus){scroll-padding-block-end:calc(max(var(--rest-h,0px),var(--wk-dock-top,0px)) + 12px)}
}
/* A laptop (from 900 px, never a phone on its side): the set row's controls sit together by the set number and the
   tick right after them, in place of a minus and a plus half a screen apart. The warm-up rows keep their tick in the
   same column. */
@media (min-width:900px) and (min-height:501px){
  .wk-card .set-row{grid-template-columns:48px minmax(0,360px) 52px}
  .wk-card .set-row.is-ramp{grid-template-columns:44px minmax(0,368px) 44px}
}

/* ===================== round 11: conditioning ===================== */
/* a block of rounds in the set timer: the part it is in ("All out 0:12 · Round 3 of 10"), the all-out part louder */
.target-card .wk-cyc{margin:2px 0 0;max-width:none;font:600 var(--t-md)/var(--lh-ui) var(--font-body);color:var(--hero-muted)}
.target-card .wk-cyc.is-work{color:inherit}
