/* Workouts: the pieces of this redesigned screen only (docs/mockups/redesign/); shared ones are
   css/widgets.css. Colours come from the tokens in style.css only. One narrow column even where #app is wide, so
   the screen reads as on the phone; the cards stack as on the other redesigned screens. */
.trn{display:flex;flex-direction:column;gap:18px;max-width:560px;margin-inline:auto;padding-block-end:24px}
.trn .card{display:flex;flex-direction:column;gap:14px;margin:0}
.trn .card.flat{padding-block:14px}
.trn .state{display:flex;flex-direction:column}
.trn .orb .i{width:34px;height:34px}
.trn-sec{display:flex;flex-direction:column;gap:8px}
.trn-quiet{margin:0;color:var(--mut);font-size:.84rem}

/* rows that are not one tap target: their own buttons sit at the end */
.trn-row{cursor:default;color:var(--ink);font:inherit}
.trn-row .when{font-variant-numeric:tabular-nums}
.trn-acts{display:flex;align-items:center;gap:8px}
.trn-start{min-height:48px}
.trn-cur{background:var(--a-soft);border-radius:var(--rm);padding-inline:10px}
.trn-tick{min-width:24px;display:grid;place-items:center;color:var(--c);font-weight:800}

/* the live session: the rest countdown in the orb */
.trn-live .cardhead{align-items:flex-start}
.trn-name{flex:1;margin:0;font-size:1.25rem;font-weight:800;min-width:0;overflow-wrap:anywhere}
.trn-timer{display:flex;flex-direction:column;align-items:center;gap:8px;padding-block:6px}
.trn-orb{width:132px;height:132px}
.trn-orb b{font-size:2rem;font-weight:800}
.trn-ex{margin:0;font-size:1.5rem;font-weight:800;line-height:1.3}

/* breathing: the circle grows and shrinks (drawBreath sets its scale) */
.trn-breath .breath{display:flex;flex-direction:column;align-items:center;padding-block:12px}
.trn-breath .circle{width:180px;height:180px;border-radius:50%;background:radial-gradient(circle at 50% 45%,var(--a-soft),var(--surface2));border:2px solid var(--a);box-shadow:var(--glow);transform:scale(.55);transition:transform .2s linear}
.trn-breath .big{margin:14px 0 2px;font-size:1.4rem;font-weight:800;color:var(--ink)}

/* the form that adds a pair of shoes */
.trn-gearform{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:end}
.trn-wide{grid-column:1/-1}

/* the timed workouts: the one-tap starts, Tabata's blocks and the plain intervals' fields */
.trn-iv-blocks button{min-height:48px;min-width:48px;font-variant-numeric:tabular-nums}
.trn-iv-sheet .trn-iv-opt{display:flex;flex-direction:column;align-items:stretch;gap:8px}
.trn-iv-sheet .trn-iv-blocks button{flex:1;min-height:48px}

/* the player: a big countdown orb coloured by phase (work the primary magenta, rest teal, warm-up amber, the break
   between blocks violet) and a bar under it that fills through the phase (drawTick writes its inline size) */
.trn-iv-timer{display:flex;flex-direction:column;align-items:center;gap:10px;padding-block:8px}
.trn-iv-orb{width:min(232px,64vw);aspect-ratio:1;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:8px solid var(--b);background:var(--b-soft);color:var(--b);box-shadow:var(--glow)}
.trn-iv-orb[data-kind=rest]{border-color:var(--c);background:var(--c-soft);color:var(--c)}
.trn-iv-orb[data-kind=warmup]{border-color:var(--d);background:var(--d-soft);color:var(--d)}
.trn-iv-orb[data-kind=break]{border-color:var(--a);background:var(--a-soft);color:var(--a)}
.trn-iv-orb b{font-size:3.4rem;font-weight:800;line-height:1}
.trn-iv-ph{font-size:1rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.trn-iv[data-state=paused] .trn-iv-orb{opacity:.6}
.trn-iv-orb.pulsing{animation:orbpulse 1s ease-in-out infinite}
.trn-iv-bar{inline-size:min(232px,64vw);block-size:8px;border-radius:var(--pill);background:var(--surface2);overflow:hidden}
.trn-iv-bar i{display:block;block-size:100%;inline-size:0;background:var(--b);transition:inline-size .25s linear}
.trn-iv-bar[data-kind=rest] i{background:var(--c)}
.trn-iv-bar[data-kind=warmup] i{background:var(--d)}
.trn-iv-bar[data-kind=break] i{background:var(--a)}
.trn-iv-btns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.trn-iv-btns:has(> :nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
.trn-iv-btns .btn{min-height:48px}
/* a run's Save and Discard (challenge, Cooper, a stale interval run): Discard above, Save last full width as in every form (the :has outranks the two-column rule above) */
.trn-iv-btns.trn-iv-end:has(>.btn.pri){grid-template-columns:minmax(0,1fr)}.trn-iv-end .btn.pri{min-height:56px}
/* a phone on its side (section 5.2): the clock on the inline-start half, the name, next up and the controls on the
   other, so nothing scrolls; the breathing circle beside its words the same way */
@media (max-height:499px) and (min-width:560px){
  .trn-iv:is([data-state=running],[data-state=paused]){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:var(--s-5);align-items:center}
  .trn-iv .trn-iv-timer{display:contents}
  .trn-iv:is([data-state=running],[data-state=paused])>*,.trn-iv .trn-iv-timer>*{grid-column:2}
  .trn-iv .trn-iv-orb{grid-column:1;grid-row:1/span 4;justify-self:center;width:min(200px,52vh)}
  .trn-iv .trn-iv-bar{grid-column:1;grid-row:5;justify-self:center;inline-size:min(200px,52vh)}
  .trn-iv .trn-iv-orb b{font-size:2.6rem}
  .trn-breath:is([data-state=running],[data-state=away]){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:var(--s-5);align-items:center}
  .trn-breath:is([data-state=running],[data-state=away])>*{grid-column:2}
  .trn-breath:is([data-state=running],[data-state=away])>.breath{grid-column:1;grid-row:1/span 3}
  .trn-breath .circle{width:min(180px,44vh);height:min(180px,44vh)}
}
@media (prefers-reduced-motion:reduce){.trn-iv-orb.pulsing{animation:none}}

/* Train's root (views/train-cards.js): the week's three bars against their targets, in the place's colour */
.trn-week .cardhead{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.trn-week-min{color:var(--ink2);font-weight:700;font-variant-numeric:tabular-nums}
.trn-bars{display:flex;flex-direction:column;gap:10px}
.trn-bar{display:grid;grid-template-columns:minmax(0,5.5em) minmax(0,1fr) auto;align-items:center;gap:10px}
.trn-bar-k{font-weight:700;font-size:.9rem}
.trn-bar-track{block-size:10px;border-radius:5px;background:var(--surface2);overflow:hidden}
.trn-bar-track i{display:block;block-size:100%;border-radius:inherit;background:var(--place)}
.trn-bar-v{color:var(--mut);font-variant-numeric:tabular-nums;white-space:nowrap}
.trn-week-line{margin:0;color:var(--ink2);font-size:.9rem}
.trn-go{min-height:52px}
/* six tiles two across in fixed places; the tile's form is css/widgets.css */
.trn-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.trn-recent .link{align-self:flex-start}
.chl-done{font-weight:700}
/* the Challenges screen's own lines (the done count, the intro) sit on the card's ground, not on the traces */
#train-challenges > .trn-quiet{padding:10px 14px;border-radius:var(--rm);background:var(--card-bg)}
.trn-line{grid-template-columns:auto minmax(0,1fr) auto auto;color:var(--ink);font:inherit;min-height:56px}
.trn-line:not(:has(.badge,.bio-pill)){grid-template-columns:auto minmax(0,1fr) auto}
.trn-line .chev{color:var(--mut)}
/* the way back to Workouts: the chevron points back in either direction */

/* a test's own sheet: the last result with its spark line, the last results, its buttons */
.trn-ts-last{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border-radius:var(--rm);background:var(--surface2)}
.trn-ts-last .what{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;min-width:0}
.trn-ts-last .what b{font-size:1.2rem;font-weight:800;font-variant-numeric:tabular-nums}
.trn-ts-last small{flex-basis:100%;color:var(--mut);font-size:.82rem}
.trn-ts-past .lrow{min-height:48px;padding-block:8px;cursor:default}
.trn-ts-past .res-row{cursor:pointer;color:var(--ink)}
.res-row .chev{inline-size:16px;block-size:16px;opacity:.4}
.res-more>summary{padding-block:10px;color:var(--mut);font-size:.86rem;cursor:pointer}
.res-head{margin-block:14px 0}
.trn-ts-acts{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end}
.trn-ts-acts .btn{min-height:48px}
.trn-ts-acts .trn-quiet{display:inline-flex;align-items:center;gap:4px}
.trn-ft-warm{min-height:48px;display:flex;align-items:center;gap:8px}
.trn-ft-gps{margin:0;display:flex;align-items:center;justify-content:center;gap:8px;color:var(--mut)}
.trn-ft-gps b{font-size:1.6rem;font-weight:800;color:var(--ink)}
.trn-ft-est{margin:0;font-size:1.15rem;font-weight:800;color:var(--ink)}
.trn-ft-laps summary{min-height:48px;display:flex;align-items:center;cursor:pointer;color:var(--a);font-weight:700}
.trn-ft-plank{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border-radius:var(--rm);background:var(--surface2)}
.trn-ft-plank b{font-size:2.4rem;font-weight:800}
.trn-ft-plank[data-state=holding] b{color:var(--b)}
.trn-ft-plank .btn{min-height:48px;min-width:96px}
/* the strength entry's hint: small and quiet; the 1RM it estimates once kg and reps are typed reads in ink */
.st-hint[data-est]{color:var(--ink);font-weight:700}
/* the "?" beside a level pill (views/grade-help.js) and its sheet: the levels, the person's highlighted */
.gh-chip{position:relative;gap:2px;padding-inline:10px 6px;font:inherit;font-size:.76rem;font-weight:800;cursor:pointer}
.gh-chip::after{content:'';position:absolute;inset:-10px -4px}
.gh-chip:focus-visible{outline:2px solid var(--a);outline-offset:2px}
.gh-chev{inline-size:14px;block-size:14px;opacity:.6}
.gh-line{margin:0;font-size:1.05rem;font-weight:700;color:var(--ink)}
.gh-rows{list-style:none;margin:0;padding:0;display:grid;gap:4px}
.gh-row{display:flex;flex-wrap:wrap;justify-content:space-between;gap:2px 12px;padding:10px 12px;border-radius:var(--rm);background:var(--surface2)}
.gh-row b{font-weight:700}
.gh-row small{flex-basis:100%;color:var(--mut);font-size:.82rem}
.gh-row.here{outline:2px solid var(--a);background:var(--surface)}
.gh-row.here small{color:var(--a);font-weight:700}
.gh-last small{flex-basis:auto}
/* A test's explainer (views/test-explain.js) and its floating napkins (views/test-explain-art.js): the background's
   napkin, grid and neon tokens, so the drawing follows the theme; the float, the drawing-on, the runner's lap (6 s)
   the stopwatch's sweep and the challenge figures' gentle rep (2.6 s) stop under reduced motion and leave the drawing whole. */
.tx-link,.tx-back{align-self:flex-start;padding-inline:2px}
.tx-sec h3{margin:0 0 4px;font-size:1rem}
.tx-sec p{margin:0}
.tx-steps{margin:6px 0 0;padding-inline-start:22px;display:grid;gap:6px}
.tx-formula{margin-top:8px!important;padding:8px 12px;border-radius:var(--rm);background:var(--surface2);font-weight:700;text-align:center;display:grid;gap:2px}
.tx-formula small{font-weight:500;color:var(--ink2);font-size:.85rem}
.tx-art{display:block;width:100%;max-width:400px;height:auto;max-height:170px;margin:0 auto;overflow:visible}
.tx-nap{transform-box:fill-box;transform-origin:center;transform:rotate(var(--r));animation:tx-float 7s ease-in-out infinite alternate}
.tx-nap .sheet{fill:var(--napkin);stroke:var(--napkin-edge);filter:drop-shadow(0 5px 7px var(--napkin-shadow))}
.tx-nap .grid{fill:url(#tx-grid);stroke:none}
#tx-grid .g1{stroke:var(--paper-grid);fill:none;stroke-width:.6}#tx-grid .g5{stroke:var(--paper-grid5);fill:none;stroke-width:.8}
.tx-ink path{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:2.2;stroke-dasharray:1;stroke-dashoffset:0;opacity:var(--paper-ink-alpha);animation:tx-draw 1.6s ease-out both;animation-delay:inherit}
.tx-ink path.glow{stroke-width:7;opacity:calc(.22 * var(--paper-glow))}
.tx-ink.c1 path{stroke:var(--paper-curve-1)}.tx-ink.c2 path{stroke:var(--paper-curve-2)}.tx-ink.c3 path{stroke:var(--paper-curve-3)}
.tx-dot{fill:var(--paper-curve-2);offset-rotate:0deg;animation:tx-lap 6s linear infinite}
.tx-hand{stroke:var(--paper-curve-3);stroke-width:2;stroke-linecap:round;animation:tx-sweep 6s linear infinite}
.tx-lab,.tx-time{text-anchor:middle;font-weight:700;fill:var(--paper-curve-1);opacity:var(--paper-ink-alpha)}
.tx-lab{font-size:12px;unicode-bidi:plaintext}.tx-time{font-size:15px;fill:var(--paper-curve-3)}
@keyframes tx-float{to{transform:translateY(-4px) rotate(calc(var(--r) + 1.2deg))}}
@keyframes tx-draw{from{stroke-dashoffset:1}}
@keyframes tx-lap{from{offset-distance:0%}to{offset-distance:100%}}
@keyframes tx-sweep{to{transform:rotate(360deg)}}
.tx-bob{animation:tx-bob 2.6s ease-in-out infinite alternate}
@keyframes tx-bob{to{transform:translateY(2.5px)}}
/* the resting heart rate's heart: a double beat, about 55 a minute */
.tx-beat{transform-box:fill-box;transform-origin:center;animation:tx-beat 1.1s ease-in-out infinite}
@keyframes tx-beat{0%,40%,100%{transform:scale(1)}12%{transform:scale(1.08)}26%{transform:scale(1.04)}}
@media (prefers-reduced-motion:reduce){.tx-nap,.tx-ink path,.tx-dot,.tx-hand,.tx-bob,.tx-beat{animation:none}}
/* the usual workout's row stands on the card's ground, never on the traces (P9) */
.trn-usual{padding-inline:var(--s-4);border:1px solid var(--card-edge);border-radius:var(--r);background:var(--card-bg);box-shadow:var(--shadow-sm)}

/* Log a workout (views/fit-log.js): a kind chip carries its usual length, quieter than the name; the line under the
   most used says what a tap does and holds the switch to the length and day. */
/* The workout sheet's search keeps a gap above Most used, which otherwise sits on the field's edge. */
#wk-body > .search{margin-bottom:14px}
.fit-kind small{color:var(--mut);font-weight:600}
.fit-how{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px;margin:8px 0 0;font-size:.86rem}
