/* Progress view and a lift's page. Only what app.css and views.css do not already cover.
   Logical properties only, colors only from the tokens in app.css, sizes from its type scale (12 14 16 18 20 body,
   24 28 36 44 60 condensed), spacing 4 8 12 16 20 24, radii --r-sm / --r-md / --r-lg / pill. Charts are inline SVG inside
   a dir="ltr" box. Everything reflows down to 195 CSS px (a 390 px phone at 200% zoom) without sideways scrolling.
   Shared with other screens (this file loads everywhere): the goal rows (.str-goal*, Today's goal card), the stage chip
   (.str-stage, Plan), the max-test sheet (.str-safety, .str-att), the level chip and the microplate chips. */
.pg,.lp{font-variant-numeric:tabular-nums;min-width:0}
.pg-panel,.lp-panel{min-width:0}
.pg-sec-head{display:grid;gap:var(--s-1)}
.pg-sec-head>p{max-width:none}
.pg-card{display:flex;flex-direction:column;gap:var(--s-3)}
.pg-card>.h3{margin-block-start:var(--s-2)}
/* a heading with an info button at its end */
.pg-h-row{display:flex;align-items:center;gap:var(--s-2);min-width:0}
.pg-h-row>.h2,.pg-h-row>.h3,.pg-h-row>.pg-delta{flex:1 1 auto;min-width:0}
.pg-h-row>.chip{flex:none}

/* the "i" button that holds a screen's coaching text: a 44 px target, a quiet 20 px icon */
.info-btn{flex:none;display:inline-grid;place-items:center;inline-size:44px;block-size:44px;margin:-10px;margin-inline-start:0;padding:0;border:0;border-radius:50%;background:none;color:var(--muted);cursor:pointer}
.info-btn .ic{inline-size:var(--ic-md);block-size:var(--ic-md)}
.info-btn:hover{color:var(--ink)}
.info-body{display:grid;gap:var(--s-3)}
.info-body p{margin:0;max-width:none;line-height:var(--lh-body)}

/* card header: name on the start side, latest value on the end side (wraps under on a narrow screen) */
.pg-head{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:var(--s-1) var(--s-3);min-width:0}
.pg-now{flex:none;display:inline-flex;align-items:baseline;gap:var(--s-1);white-space:nowrap}
.pg-big{font:700 var(--d-lg)/var(--lh-tight) var(--font-display);font-variant-numeric:tabular-nums;color:var(--ink)}
.pg-unit{font:600 var(--t-sm)/var(--lh-tight) var(--font-body);color:var(--muted)}
/* "≥": a number that is only a floor. It sits inside the number's own box, small and quiet */
.pg-ge{display:inline-block;margin-inline-end:.08em;font-size:.6em;font-weight:600;color:var(--muted);vertical-align:.18em}
.pg-ge-note{max-width:none;margin:0;line-height:var(--lh-body)}
@media (min-width:900px) and (min-height:501px){.pg-ge-note{max-width:52ch}}
.pg-ge-note b{font-weight:700}
.pg-delta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s-2);max-width:none;margin:0}
.pg-dchip{gap:var(--s-1);font-variant-numeric:tabular-nums}
.pg-arrow{inline-size:11px;block-size:11px;flex:none;fill:none;stroke:currentColor;stroke-width:var(--ic-stroke);stroke-linecap:round;stroke-linejoin:round}
.pg-arrow *{vector-effect:non-scaling-stroke}
.pg-chev{inline-size:var(--ic-sm);block-size:var(--ic-sm);flex:none;color:var(--muted)}

/* ---------- segmented control: one section at a time; the sliding pill is the global .seg one (app.css) ---------- */
.pg-seg,.lp-seg{display:grid;grid-auto-flow:row;inline-size:100%}
.pg-seg{grid-template-columns:repeat(3,minmax(0,1fr))}
/* with a sport (views/sport.js) a fourth section, Sport */
.pg-seg.pg-seg4{grid-template-columns:repeat(4,minmax(0,1fr))}
.pg-seg.pg-seg2{grid-template-columns:repeat(2,minmax(0,1fr))}
.lp-seg{grid-template-columns:repeat(4,minmax(0,1fr))}
.pg-seg button,.lp-seg button{min-width:0;padding-inline:var(--s-2);white-space:normal;line-height:var(--lh-ui)}
.lp-seg button{padding-inline:var(--s-1);font-size:var(--t-sm)}
.pg-seg button[aria-selected="true"],.lp-seg button[aria-selected="true"]{color:var(--ink);font-weight:700}

/* ---------- Lifts: the hero (a total or the lifts rising) and three door tiles ---------- */
.pg-hero{display:flex;flex-direction:column;gap:var(--s-3)}
.pg-hero-top{display:grid;justify-items:start;gap:var(--s-2);min-width:0}
.pg-hero .eyebrow{overflow-wrap:anywhere}
.pg-big.pg-xl{font-size:var(--d-2xl);letter-spacing:-.01em}
.pg-hero .pg-now .pg-unit{font-size:var(--t-lg)}
.pg-hero-sub{font-size:var(--t-sm);line-height:var(--lh-ui);color:var(--muted);overflow-wrap:anywhere}
.pg-spark-box{block-size:58px;min-width:0}
.pg-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--s-2)}
/* a tile is a door: a link or a button with the tile look and a small chevron in its corner */
.pg-tile{position:relative;display:grid;align-content:space-between;gap:var(--s-2);padding:var(--s-3);border:0;border-radius:var(--r-md);background:var(--surface-2);
  color:var(--ink);font:inherit;text-align:start;text-decoration:none;min-width:0;cursor:pointer}
.pg-tile .pg-big{font-size:var(--d-md)}
.pg-tile .pg-now{flex-wrap:nowrap;white-space:nowrap}
.pg-tile .pg-unit{font-size:var(--t-xs)}
/* "138k" / "138 ألف": compactHtml sets the word small (.bn-u), so it shares the line with the number */
.pg-tile .pg-big .bn-u{font-size:var(--t-md)}
/* a small chevron in the corner: the tile reads as a way in (the number keeps clear of it) */
.pg-tile>.pg-chev{position:absolute;inset-block-start:var(--s-3);inset-inline-end:var(--s-2);inline-size:14px;block-size:14px}
.pg-tile>.pg-now{padding-inline-end:14px}
.pg-cap{min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;font-size:var(--t-xs);line-height:var(--lh-ui);color:var(--muted);overflow-wrap:break-word;hyphens:auto}
html[lang="ar"] .pg-cap{line-height:1.7}
.pg-cap .gold-ic{inline-size:1em;block-size:1em;padding:2px;margin-inline-end:var(--s-1);vertical-align:-.15em}
/* no bodyweight yet: the tile is a way to log one */
.pg-tile-cta{align-content:center;justify-items:start;box-shadow:inset 0 0 0 1.5px var(--hero-line);background:transparent}
.pg-tile-cta .ic{inline-size:var(--ic-md);block-size:var(--ic-md);color:var(--accent)}
.pg-tile-cta .pg-cap{color:var(--ink);font-size:var(--t-sm);font-weight:600}

/* ---------- Lifts: one compact row per lift, opening its page ---------- */
.pg-lifts{margin-inline:calc(-1 * var(--s-2))}
.pg-lifts>li{border-block-start-color:var(--line-soft)}
.pg-lift{display:grid;grid-template-columns:minmax(0,1fr) auto var(--ic-sm);grid-template-areas:"name val chev" "meta spark chev";align-items:center;gap:var(--s-2) var(--s-3);
  inline-size:100%;min-block-size:56px;padding-block:var(--s-3);padding-inline:var(--s-2);border-radius:var(--r-md);color:var(--ink);text-decoration:none}
.pg-lift-name{grid-area:name;display:grid;justify-items:start;gap:var(--s-1);min-width:0}
.pg-lift-name b{font-weight:600;font-size:var(--t-md);line-height:var(--lh-ui);overflow-wrap:anywhere}
.pg-lift-meta{grid-area:meta;display:flex;flex-wrap:wrap;align-items:center;gap:var(--s-1) 6px;min-width:0}
.pg-lift-spark{grid-area:spark;display:block;justify-self:end;min-width:0}
.pg-lift-spark:empty{display:none}
.pg-lift-val{grid-area:val;display:grid;justify-items:end;gap:var(--s-1);text-align:end}
.pg-lift-val .pg-big{font-size:var(--d-md)}
.pg-lift>.pg-chev{grid-area:chev}
.pg-lifts-total{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:var(--s-1) var(--s-3);padding-block-start:var(--s-3);border-block-start:1px solid var(--line-soft)}
.pg-lifts-total .pg-big{font-size:var(--d-md)}
.pg-addgoal{justify-self:start;align-self:flex-start;margin-inline-start:calc(-1 * var(--s-3))}
/* the rows into the rest (All workouts, Records, Peak): the list group of app.css */
.pg-links .lg-row>.ic:first-child{color:var(--muted)}
.pg-links #pg-peak{scroll-margin-block-start:calc(var(--topbar-h) + env(safe-area-inset-top,0px) + 12px)}

/* ---------- charts: a readout strip above the plot (it never covers the data), the plot, a legend under it ---------- */
.pg-cw{display:grid;gap:var(--s-2);min-width:0}
.pg-read{display:grid;align-content:start;gap:var(--s-1);min-block-size:52px;font-size:var(--t-sm);line-height:var(--lh-body);color:var(--muted);min-width:0}
.pg-read.one{min-block-size:28px}
.pg-read.on{color:var(--ink)}
.pg-read-1,.pg-read-2{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.pg-read-1{display:flex;align-items:center;gap:var(--s-2)}
.pg-read-h{flex:none;font-weight:600}
.pg-read-r{display:inline-flex;align-items:center;gap:var(--s-1);min-width:0}
.pg-read-r b{font-weight:700;color:inherit}
.pg-read-2{font-size:var(--t-xs)}
/* idle, the strip says the change (and the legend); a touched point replaces it */
.pg-read>.pg-delta{flex-wrap:nowrap;gap:6px}
.pg-read-2.pg-legend{flex-wrap:nowrap;font-size:var(--t-xs)}
.lp-chart-top>.seg{flex:1 1 auto;min-width:0}
.pg-read .pg-key{flex:none}
/* a metric switch: [Estimated max | Top set] */
.pg-mseg{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));inline-size:100%}
/* legend: short keys that mirror the marks in the plot */
.pg-legend{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s-1) var(--s-4);font-size:var(--t-sm);color:var(--muted)}
.pg-legend>span{display:inline-flex;align-items:center;gap:var(--s-2)}
.pg-key{display:inline-block;flex:none;inline-size:18px;block-size:3px;border-radius:var(--r-pill);background:var(--chart-1)}
.pg-key.kt{background:var(--chart-3)}
.pg-key.dot,.pg-key.k1.dot{inline-size:8px;block-size:8px;border-radius:50%}
.pg-key.hollow{background:transparent;box-shadow:inset 0 0 0 1.75px var(--chart-1)}
.pg-chart{position:relative;min-width:0;touch-action:pan-y;border-radius:var(--r-sm);-webkit-user-select:none;user-select:none;cursor:crosshair}
.pg-chart svg{display:block;overflow:visible}
.pg-chart text,.pg-ghost text{font:600 var(--t-xs)/1 var(--font-body);fill:var(--muted);font-variant-numeric:tabular-nums}
.pg-chart text.pg-vl{fill:var(--ink);font-weight:700}
.pg-gl{stroke:var(--chart-grid);stroke-width:1}
.pg-ax{stroke:var(--line);stroke-width:1}
.pg-l1{fill:none;stroke:var(--chart-1);stroke-width:2.25;stroke-linejoin:round;stroke-linecap:round}
.pg-d1,.pg-h1{fill:var(--chart-1);stroke:var(--surface);stroke-width:2}
/* each session's estimated max: a dot, hollow when it is only "at least" (no reps-left rating) */
.pg-d1.hollow{fill:var(--surface);stroke:var(--chart-1);stroke-width:1.75}
/* the trend (median of 3 sessions; the smoothed bodyweight) and the band of typical day-to-day error around it */
.pg-lt{fill:none;stroke:var(--chart-3);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.pg-band{fill:var(--chart-3);fill-opacity:.2;stroke:none}
.pg-ht{fill:var(--chart-3);stroke:var(--surface);stroke-width:2}
.pg-a0{stop-color:var(--chart-1);stop-opacity:.2}
.pg-a1{stop-color:var(--chart-1);stop-opacity:0}
.pg-bar{fill:var(--chart-1)}
.pg-bar.dim{fill-opacity:.3}
.pg-cross{stroke:var(--muted);stroke-width:1}

/* sparklines: rows use the chart color, the hero re-points them to its own accent */
.pg-spark{display:block;overflow:visible}
.pg-sl{fill:none;stroke:var(--chart-1);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.pg-sd{fill:var(--chart-1);stroke:var(--surface);stroke-width:1.5}
.pg-sh{fill:none}
.pg-hero .pg-sl{stroke:var(--accent);stroke-width:2.5}
.pg-hero .pg-a0{stop-color:var(--accent);stop-opacity:.32}
.pg-hero .pg-a1{stop-color:var(--accent)}
.pg-hero .pg-sd{fill:var(--accent);stroke:var(--hero);stroke-width:2.5}
.pg-hero .pg-sh{fill:var(--accent);opacity:.2}


/* number tables (the chart twins and the rep records) */
.pg-more>summary{display:inline-flex;align-items:center;min-block-size:44px;cursor:pointer;color:var(--accent);font-size:var(--t-sm);font-weight:600}
.pg-more[open]>summary{margin-block-end:var(--s-1)}
.pg-tablebox{max-inline-size:100%;overflow-x:auto}
.pg-table{inline-size:100%;border-collapse:collapse;font-size:var(--t-sm)}
.pg-table th{padding-block:var(--s-1) 6px;font:var(--f-label);letter-spacing:var(--track-label);text-transform:uppercase;color:var(--muted);text-align:start}
.pg-table td{padding-block:var(--s-2);border-block-start:1px solid var(--line);vertical-align:top}
.pg-table .n{text-align:end;white-space:nowrap;padding-inline-start:var(--s-3)}

/* ---------- Records: every exercise's best set (#/progress/records) ---------- */
.pg-reclist .lg-row{min-block-size:60px}
.pg-rval{flex:none;display:grid;justify-items:end;gap:var(--s-1);text-align:end}
.pg-rval b{font-weight:700}

/* ---------- body: check-in ---------- */
.pg-ckf label{font-size:var(--t-sm);font-weight:600;color:var(--muted)}
.pg-hint{font-size:var(--t-xs);color:var(--muted)}
.pg-checkin>p{max-width:none;margin:0}
.pg-protein{align-items:center}
.pg-protein .info-btn,.pg-pace .info-btn{margin-block:-12px;margin-inline-end:-12px}
.pg-prot{font-size:var(--t-md)}
.pg-saved{min-block-size:1.2em;margin-block-start:calc(-1 * var(--s-2))}
.pg-saved:empty{display:none}
/* bodyweight and waist: two small charts, side by side when there is room */
.pg-body{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:var(--s-4) var(--s-5)}
.pg-mini{display:flex;flex-direction:column;gap:var(--s-2);min-width:0}
.pg-mini .pg-big{font-size:var(--d-md)}
.str-verdict{font-weight:600}
.str-verdict.good{color:var(--good)}

/* ---------- muscles: week switcher, the heat figures, one legend, sets per muscle ----------
   Status colors are the shared --st-* scale (app.css .hm and .st-legend), the same as Today and the Plan bars. */
.pg-muscles [data-muscles]{display:flex;flex-direction:column;gap:var(--s-3);min-width:0}
.pg-wk{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--s-2)}
.pg-wk .iconbtn:disabled{opacity:.35;cursor:default}
.pg-wk-l{display:grid;justify-items:center;text-align:center;gap:var(--s-1);min-width:0;overflow-wrap:anywhere}
.pg-wk-l b{font:700 var(--t-xl)/1.1 var(--font-display);letter-spacing:var(--track-d-sm);text-transform:uppercase}
.pg-center{text-align:center;max-width:none;margin:0}
/* the figures at the size they were drawn for (app.css .mmap reads --mmap-w, 68 px by default): a picture, no tapping */
.pg-heat{--mmap-w:min(118px,32vw)}
.pg-heat .mmap{flex-wrap:wrap;gap:clamp(8px,4vw,20px);padding-block:var(--s-3);padding-inline:var(--s-2)}
.pg-hlegend{justify-content:center;gap:var(--s-1) 14px}
/* each muscle row: the same columns as .vol-bars li, as tall as a finger */
.pg-mlist{gap:var(--s-1)}
/* a picture of the week, not a control: rows as tall as their text */
.pg-mlist>.pg-mrow{grid-template-columns:minmax(6.5em,8.5em) minmax(0,1fr) 2.4em;min-block-size:32px;padding-inline:var(--s-1);font-size:var(--t-sm)}
html[lang="ar"] .pg-mlist>.pg-mrow{grid-template-columns:minmax(7em,9.5em) minmax(0,1fr) 2.4em;font-size:var(--t-sm)}
.pg-muscles [data-muscles]>p.small{max-width:none;margin:0}
.pg-tall{margin-block-start:var(--s-1)}

/* Arabic: small text never under 12 px, and with room for the script */
html[lang="ar"] .pg-chart text,html[lang="ar"] .pg-ghost text{font-size:var(--t-xs)}
/* clipped lines keep room for Cairo's dots */
html[lang="ar"] .pg-read{line-height:1.7}
html[lang="ar"] .pg-wk-l b{font-family:var(--font-body);font-size:var(--t-lg);line-height:var(--lh-ui)}
html[lang="ar"] .pg-read:not(.one){min-block-size:56px}

/* ---------- a lift's page (#/library/<id>): summary, segments, chart, strength, records, history ---------- */
.lp-head{display:grid;gap:var(--s-2)}
.lp-stage{margin:0;max-width:none}
.lp-row{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:var(--s-2) var(--s-3);min-width:0}
.lp-val{display:grid;gap:var(--s-1);min-width:0}
.lp-big.pg-big{font-size:var(--d-xl)}
.lp-chips{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s-2)}
.lib-str .str-next{margin:0}
.lib-str-act{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s-2)}
.lib-eq{gap:var(--s-2)}
/* Exercises: with "Mine" the equipment switch goes, the layout switch keeps its place at the end */
.lib-ctl>.seg{margin-inline-start:auto}
.lp-records{gap:var(--s-4)}
.lp-rtiles{grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr))}
.lp-rv.tile-n{font:700 var(--t-lg)/var(--lh-ui) var(--font-body);white-space:normal;overflow-wrap:anywhere}
.lp-hlist>li{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3);min-block-size:44px;padding-block:6px}
.lp-hdate{flex:none;min-block-size:44px;display:inline-flex;align-items:center;font-size:var(--t-sm);font-weight:600;color:var(--accent);text-decoration:none}
.lp-hsets{min-width:0;text-align:end;font-size:var(--t-sm)}
/* a technique set's letter after its set (D, M, R: the workout screen's own letters) */
.lp-tech{margin-inline-start:var(--s-1);font-weight:700}
.lp-goal{padding-block-start:var(--s-3);border-block-start:1px solid var(--line-soft)}

/* ---------- strength pieces: level, rep records, goals, the max-test sheet ---------- */
#pg-goals,#pg-reps,#pg-lifts,#pg-detail{scroll-margin-block-start:calc(var(--topbar-h) + env(safe-area-inset-top,0px) + 12px)}
/* a deep link moves focus to the card's heading (for screen readers); it needs no ring */
.pg h2[tabindex="-1"]:focus,.pg .lg-t[tabindex="-1"]:focus,.lp h2[tabindex="-1"]:focus{outline:none}
.chip.str-stage{white-space:normal;line-height:var(--lh-ui);background:var(--accent-soft);color:var(--accent);max-inline-size:100%}
.str-next{color:var(--ink);font-weight:600;max-width:none}
/* the level is the one chip a lift wears; Elite adds the small gold trophy disc */
.chip.str-lvl{gap:var(--s-1);background:var(--accent-soft);color:var(--accent);font-weight:700}
.chip.str-lvl .gold-ic{inline-size:1em;block-size:1em;padding:2px}
.str-approx{font-style:italic}
.str-level{display:grid;gap:var(--s-2)}
.str-lrow{display:flex;align-items:center;justify-content:space-between;gap:var(--s-1) var(--s-3);flex-wrap:wrap}
.str-lrow>.small{flex:1 1 auto}
.str-meter{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:var(--s-1);block-size:8px}
.str-meter i{position:relative;display:block;border-radius:var(--r-pill);background:var(--surface-3);overflow:hidden}
.str-meter i.on{background:var(--accent)}
.str-meter b{position:absolute;inset-block:0;inset-inline-start:0;border-radius:inherit;background:var(--accent)}
.str-mean{color:var(--ink);line-height:var(--lh-body);max-width:none}
.str-test .ic{inline-size:var(--ic-sm);block-size:var(--ic-sm);color:var(--accent)}
.str-test:disabled .ic{color:var(--muted)}
.str-why{max-width:none;margin:0}
.str-link{display:inline;min-block-size:24px;padding:0;border:0;background:none;color:var(--accent);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}
/* rep records: a table with the rep count as the row header */
.str-reps{display:grid;gap:var(--s-3);min-width:0}
.str-reps .str-pseg{inline-size:auto;justify-self:start}
.str-lseg button{min-width:0;padding-inline:var(--s-1);white-space:normal;line-height:var(--lh-ui)}
/* four lifts on a phone (the goal sheet): two rows of two full names, the pressed one filled in place of the pill */
@media (max-width:419px){
  .seg.str-lseg{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-flow:row;inline-size:100%}
  .seg.str-lseg::before{display:none}
  .seg.str-lseg button[aria-pressed="true"]{background:var(--seg-on);box-shadow:var(--e1),0 0 0 1px var(--card-line)}
}
.str-rtable tbody th{padding-block:var(--s-2);border-block-start:1px solid var(--line);font:700 var(--t-xl)/1 var(--font-display);letter-spacing:0;text-transform:none;color:var(--ink);vertical-align:middle;inline-size:3.2em}
.str-rtable td{vertical-align:middle}
.str-rtable tr.str-nr th{color:var(--muted)}
.str-date{display:block;inline-size:max-content;margin-inline-start:auto;min-block-size:24px;padding-block:var(--s-1) 0;color:var(--accent);font-weight:600;text-decoration:none}
.str-date:hover{text-decoration:underline}
/* goals: a bar from where the goal started to the target, then the status (also Today's goal card) */
.str-glist>li{padding-block:var(--s-3)}
.str-glist>li:first-child{padding-block-start:var(--s-1)}
.str-glist>li:last-child{padding-block-end:0}
.str-goal{display:grid;gap:var(--s-2);min-width:0}
.str-ghead{display:flex;align-items:center;justify-content:space-between;gap:var(--s-2);min-width:0}
.str-gtitle{min-width:0;font-weight:700;font-size:var(--t-md);line-height:var(--lh-ui);overflow-wrap:anywhere}
.str-ghead .btn-quiet{flex:none;margin-inline-end:calc(var(--s-2) * -1)}
.str-gbar{display:block;block-size:10px;border-radius:var(--r-pill);background:var(--surface-3);overflow:hidden}
.str-gbar>span{display:block;block-size:100%;border-radius:inherit;background:var(--accent)}
/* a reached goal: the done green, the gold stays on the trophy disc beside its title */
.str-goal.is-done .str-gbar>span{background:var(--good)}
.str-gstat{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s-1) var(--s-2);max-width:none}
.chip.gold{background:var(--gold-soft);color:var(--ink)}
.str-gmove{justify-self:start;white-space:normal;text-align:start;line-height:var(--lh-ui)}
.str-sug{gap:var(--s-2)}
.str-date-row{display:flex;align-items:center;gap:var(--s-2)}
.str-date-row .input{flex:1 1 auto;min-width:0}
.str-gprev{min-block-size:1.45em;max-width:none}
/* the max-test sheet: the safety rules first, then the plan */
.str-kseg{display:grid;grid-template-columns:1fr 1fr;inline-size:100%}
.str-aset{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--s-1) var(--s-3);margin:0;max-width:none}
.str-safety{list-style:none;margin:0;padding:0;display:grid;gap:var(--s-2)}
.str-safety li{display:grid;grid-template-columns:var(--ic-md) minmax(0,1fr);gap:var(--s-2);align-items:start;line-height:var(--lh-body);color:var(--ink)}
.str-safety .ic{inline-size:var(--ic-md);block-size:var(--ic-md);margin-block-start:1px;color:var(--warn)}
.str-plan{display:grid;gap:var(--s-2)}
.str-plan p{max-width:none}
.str-att{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--s-2)}
.str-att li{display:grid;gap:var(--s-1);padding:var(--s-3);border-radius:var(--r-md);background:var(--surface-2);min-width:0}
.str-att .pg-big{font-size:var(--d-md)}
/* the peak sheet */
.str-pkh{font-size:var(--t-sm);font-weight:600;color:var(--muted)}
.str-pkl{display:flex;flex-wrap:wrap;gap:var(--s-2)}
.str-pkwhy{display:grid;gap:var(--s-1);color:var(--warn);min-block-size:1.4em}
.str-pkwhy p{margin:0;max-width:none}

/* microplates in the plate chips (0.5 and 0.25 kg) */
.p0_5,.p0_25{background:var(--plate-1);color:var(--plate-ink-dark);min-width:28px}

html[lang="ar"] .str-rtable tbody th{font-family:var(--font-body);font-size:var(--t-md)}

/* empty state */
.pg-empty{display:grid;justify-items:start;gap:var(--s-3);padding:var(--s-5)}
.pg-ghost-box{inline-size:100%;max-inline-size:340px}
.pg-ghost{display:block;inline-size:100%;block-size:auto}
.pg-gbar{fill:var(--chart-grid)}
.pg-gline{fill:none;stroke:var(--chart-1);stroke-width:2;stroke-linejoin:round;stroke-linecap:round;stroke-opacity:.55}

/* ---------- narrow screens and high zoom (320 px phones, 200% zoom) ---------- */
/* three tiles under 380 px: the numbers step down and the corner chevrons go, so "-0.3 kg" keeps its unit on its line */
@media (max-width:379px){
  .pg-tile .pg-big{font-size:var(--d-sm)}
  .pg-tile>.pg-chev{display:none}
  .pg-tile>.pg-now{padding-inline-end:0}
}
@media (max-width:359px){
  .pg-table .n{white-space:normal;padding-inline-start:var(--s-2)}
  .pg-lift-spark{display:none}
  .pg-tile{padding:var(--s-2)}
}
@media (max-width:300px){
  .pg .card,.lp .card{padding:var(--s-3)}
  .pg-hero{padding:14px}
  .pg-big.pg-xl{font-size:var(--d-xl)}
  .pg-big,.lp-big.pg-big{font-size:var(--d-md)}
  .pg-tiles{grid-template-columns:minmax(0,1fr)}
  .pg-lift{grid-template-columns:minmax(0,1fr) var(--ic-sm);grid-template-areas:"name chev" "val chev" "meta chev"}
  .pg-lift-val{justify-items:start;text-align:start}
  .pg-dchip{white-space:normal}
  .pg-ckf{grid-template-columns:minmax(0,1fr)}
  .pg-wk{grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"l l l" "p . n";gap:var(--s-2) var(--s-1)}
  .pg-wk-l{grid-area:l;overflow-wrap:normal}
  .pg-wk>[data-wk="1"]{grid-area:p}
  .pg-wk>[data-wk="-1"]{grid-area:n}
  .pg .pg-mlist>.pg-mrow{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"n v" "b b";gap:var(--s-1) var(--s-2);padding-block:6px}
  .pg-mlist .vb-name{grid-area:n}
  .pg-mlist .vb-track{grid-area:b}
  .pg-mlist .vb-v{grid-area:v}
  .lp-seg{grid-template-columns:repeat(2,minmax(0,1fr))}
  .lp-seg::before{display:none}
  .lp-seg button[aria-selected="true"]{background:var(--seg-on);box-shadow:var(--e1),0 0 0 1px var(--card-line)}
  .str-att{grid-template-columns:minmax(0,1fr)}
}
/* very narrow: the three section buttons stack and the pill slides down instead of across */
@media (max-width:260px){
  .pg-seg{grid-template-columns:minmax(0,1fr)}
  .pg-seg::before{inset-block:auto;inset-block-start:var(--seg-pad,3px);inline-size:calc(100% - 2 * var(--seg-pad,3px));
    block-size:calc((100% - 2 * var(--seg-pad,3px) - 4px) / 3);transform:translateY(calc(var(--i,0) * (100% + 2px)))}
  .pg-seg.pg-seg4,.pg-seg.pg-seg2{grid-template-columns:minmax(0,1fr)}
  .pg-seg.pg-seg2::before{block-size:calc((100% - 2 * var(--seg-pad,3px) - 2px) / 2)}
  .pg-seg.pg-seg4::before{block-size:calc((100% - 2 * var(--seg-pad,3px) - 6px) / 4)}
}

/* ---------- motion (everything here is skipped when the user asks for less motion) ---------- */
@media (prefers-reduced-motion: no-preference){
  .pg-lift,.pg-tile{transition:background-color .15s,transform .14s}
  .pg-lift:active,.pg-tile:active{transform:scale(.985)}
  .pg-lift:active{background:var(--surface-2)}
  /* sparklines draw from the first workout to the newest, then the newest point pops in */
  .fx-show .pg-sl{stroke-dasharray:1;animation:pg-draw 1s cubic-bezier(.2,.8,.2,1) backwards}
  .fx-show .pg-sa,.pg-chart.fx-show .pg-area{animation:pg-fade .9s ease-out .25s backwards}
  .fx-show .pg-sd{animation:fx-popin .42s cubic-bezier(.3,1.6,.5,1) .8s backwards;transform-box:fill-box;transform-origin:center}
  /* the hero's newest point breathes once, then rests (no ambient motion on an idle screen) */
  .pg-hero .pg-sh{animation:pg-pulse 2.8s ease-in-out 1.4s 1 both;transform-box:fill-box;transform-origin:center}
  /* muscle bars grow from the start edge each time they come into view */
  .pg-mlist.fx-show .vb-fill{animation:fx-grow-x .8s cubic-bezier(.2,.8,.2,1) backwards;transform-origin:left center}
  [dir="rtl"] .pg-mlist.fx-show .vb-fill{transform-origin:right center}
  /* goal bars fill from the start edge when they come into view */
  .str-glist.fx-show .str-gbar>span{animation:fx-grow-x .8s cubic-bezier(.2,.8,.2,1) .15s backwards;transform-origin:left center}
  [dir="rtl"] .str-glist.fx-show .str-gbar>span{transform-origin:right center}
  @keyframes pg-draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
  @keyframes pg-fade{from{opacity:0}}
  @keyframes pg-pulse{0%,100%{transform:scale(.7);opacity:.3}50%{transform:scale(1.35);opacity:0}}
}
@media (prefers-reduced-motion: reduce){
  .pg-lift,.pg-tile{transition:none!important}
  .pg-spark *,.pg-chart *{animation:none!important}
  .str-meter b,.str-gbar>span{animation:none!important}
}

/* ---------- round 7: trends ---------- */
/* a lift's trend chip (engine liftTrend): rising and dropping only past its own noise; holding is plain */
.pg-trend{gap:var(--s-1)}
.pg-trend.rising{background:var(--good-soft);color:var(--good)}
.pg-trend.dropping{background:var(--warn-soft);color:var(--warn)}

/* ---------- round 9: tape measures, the stage line, notes in a lift's history, small muscles, the laptop pane ---------- */
/* More measurements: five fields, two to a row (three from 480 px), then one small chart per measure with 2+ readings */
.pg-meas>summary{justify-content:flex-start}
.pg-meas-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s-3)}
@media (min-width:480px){.pg-meas-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.pg-meas-err{margin:var(--s-2) 0 0;max-width:none;color:var(--bad);font-weight:600}
.pg-meas-err:empty{display:none}
.pg-meas-charts{display:grid;gap:var(--s-4);margin-block-start:var(--s-4)}
.pg-meas-charts:empty{display:none}
.pg-meas-cap{font-size:var(--t-sm);color:var(--muted)}
/* a lift's summary: its stage with "Change" at the end of the line (a 44 px target that does not add height), and the
   quiet Calculator link beside the chips */
.lp-stage-row{display:flex;align-items:center;justify-content:space-between;gap:var(--s-2);min-width:0}
.lp-stage-row>.lp-stage{flex:1 1 auto;min-width:0}
.lp-change,.lp-calc{flex:none;display:inline-flex;align-items:center;min-block-size:44px;margin-block:-14px;padding:0 var(--s-2);margin-inline-end:calc(var(--s-2) * -1);
  border:0;background:none;color:var(--accent);font:600 var(--t-sm)/var(--lh-ui) var(--font-body);text-decoration:none;cursor:pointer}
.lp-calc{margin-block:-10px}
/* the stage sheet: the training max field with its button on one line */
.stg-list:empty{display:none}
.stg-tm-row{display:flex;align-items:center;gap:var(--s-2)}
.stg-tm-row>.input{flex:1 1 auto;min-width:0}
.stg-tm-row>.btn{flex:none}
/* a session's note under its sets: three lines until "Show more" */
.lp-hlist>li.lp-hrow{flex-wrap:wrap}
.lp-hnote-box{flex:1 1 100%;display:grid;gap:0;justify-items:start;min-width:0;padding-block-end:var(--s-1)}
.lp-hnote{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;white-space:pre-line;overflow-wrap:anywhere;line-height:1.7;text-align:start}
.lp-hnote.is-open{display:block;overflow:visible}
.lp-hmore{min-block-size:44px;margin-block:-6px;padding:0;border:0;background:none;color:var(--accent);font:600 var(--t-sm)/var(--lh-ui) var(--font-body);cursor:pointer}
/* muscles the week is not counted on: a plain bar and number, no target zone and no status colour */
.pg-small-h{margin:var(--s-2) 0 0;max-width:none}
.vb-fill.plain{background:var(--line-strong);box-shadow:none;background-image:none}
/* the laptop */
.pg-pane-h{margin:0}
.pg-pane-links{display:flex;flex-wrap:wrap;gap:var(--s-1)}
@media (min-width:1200px) and (min-height:501px){
  /* Progress, Lifts: the chosen lift beside the list; the pane scrolls by itself when it is taller than the window,
     so its end is always reachable while the list scrolls under the sticky column */
  .main.wide .pg-pane{max-block-size:calc(100dvh - var(--top-h,var(--topbar-h)) - var(--s-6));overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;
    padding:var(--s-1);margin:calc(var(--s-1) * -1)}
  .main.wide .pg-lift[aria-current="true"]{background:var(--accent-soft);border-radius:var(--r-md)}
  .main.wide .pg-seg{max-inline-size:560px}
  /* Body: the check-in beside the charts. Muscles: the week on top, then the bars beside the figure and its legend */
  .main.wide .pg-panel[data-panel="body"]:not([hidden]){display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:var(--s-4) var(--s-6);align-items:start}
  .main.wide .pg-panel[data-panel="body"]>.pg-checkin{grid-column:1;grid-row:1}
  .main.wide .pg-panel[data-panel="body"]>[data-drop]{grid-column:1;grid-row:2}
  .main.wide .pg-panel[data-panel="body"]>[data-drop]:empty{display:none}
  .main.wide .pg-panel[data-panel="body"]>[data-bodycharts]{grid-column:2;grid-row:1 / span 2}
  /* rows: the week switcher, the summary, then the figure (row 3) with its legend right under it (row 4, the flexible
     one, so the taller list of bars beside them never pushes the two apart); whatever follows the bars stays in
     their column */
  .main.wide .pg-muscles [data-muscles]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);grid-template-rows:auto auto auto 1fr;gap:var(--s-3) var(--s-6);align-items:start}
  .main.wide .pg-muscles [data-muscles]>*{grid-column:1}
  .main.wide .pg-muscles [data-muscles]>:is(.pg-wk,.pg-center){grid-column:1 / -1;justify-self:center}
  .main.wide .pg-muscles [data-muscles]>.pg-wk{inline-size:min(100%,420px)}
  .main.wide .pg-muscles [data-muscles]>.pg-heat{grid-column:2;grid-row:3}
  .main.wide .pg-muscles [data-muscles]>.pg-hlegend{grid-column:2;grid-row:4}
  .main.wide .pg-muscles [data-muscles]>.pg-mlist:not(.pg-mlist-x){grid-row:3 / span 2}
}
/* round 21: the rep board's range under each prediction, and the plan's reps highlighted */
.str-span{display:block;margin-block-start:2px}
.str-rtable tr.is-work th,.str-rtable tr.is-work td{background:var(--accent-soft)}
/* round 21: the strength journey (fan chart and the 20 chances) and the growth curve */
.jr-box,.ds-box{min-width:0}
.jr-svg,.ds-svg{display:block;inline-size:100%;block-size:auto}
.jr-grid{stroke:var(--chart-grid);stroke-width:1}
.jr-ax{fill:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}
.jr-f80{fill:var(--chart-1);opacity:.13}
.jr-f50{fill:var(--chart-1);opacity:.26}
.jr-line{fill:none;stroke:var(--chart-1);stroke-width:2.2;stroke-linejoin:round}
.jr-dash{stroke-dasharray:5 4}
.jr-now{stroke:var(--line-strong);stroke-dasharray:2 3}
.jr-dot{fill:var(--surface);stroke:var(--chart-1);stroke-width:2}
.jr-dot.is-floor{stroke-dasharray:2 1.5}
.jr-target{stroke:var(--gold);stroke-width:1.5}
.jr-chance{fill:var(--gold)}
.jr-h{font-size:var(--t-md)}
.jr-say{margin:0;max-width:none}
:root[data-theme="dark"] .jr-f80{opacity:.18} :root[data-theme="dark"] .jr-f50{opacity:.32}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .jr-f80{opacity:.18} :root:not([data-theme="light"]) .jr-f50{opacity:.32}}
.ds-z{opacity:.35}
.ds-z.low{fill:var(--surface-3)} .ds-z.most{fill:var(--st-ok);opacity:.18} .ds-z.extra{fill:var(--st-high);opacity:.14}
.ds-band{fill:var(--ink);opacity:.07}
.ds-curve{fill:none;stroke:var(--ink);stroke-width:2.2}
.ds-me{fill:var(--good);stroke:var(--surface);stroke-width:2}
.ds-axis{text-align:center}
.ds-list{list-style:none;margin:0;padding:0;display:grid;gap:4px}
.ds-row{display:grid;grid-template-columns:1fr auto auto;gap:var(--s-3);align-items:center;inline-size:100%;min-block-size:44px;padding:6px var(--s-2);
  border:0;border-radius:var(--r-sm);background:none;color:var(--ink);font:inherit;text-align:start;cursor:pointer}
.ds-row.is-on{background:var(--surface-2)}
.ds-chip{font-size:var(--t-xs);padding:2px 8px;border-radius:var(--r-pill);background:var(--surface-2);color:var(--muted)}
.ds-chip.low{background:var(--warn-soft);color:var(--ink)} .ds-chip.most{background:var(--good-soft);color:var(--ink)} .ds-chip.extra{background:var(--surface-3);color:var(--ink)}
