/* Workout-only layout refinements. Recorded values and plan targets stay unchanged. */
.workout-shell .workout-main,
.workout-shell .workout-aside,
.workout-shell .number-control,
.workout-shell .number-field{min-width:0}
.workout-shell .input-card{grid-template-columns:repeat(2,minmax(0,1fr))}
.workout-shell .number-field input{font-size:clamp(1.5rem,3.5vw,3.5rem)}
.workout-shell #weight-input::placeholder{font:400 clamp(.75rem,2vw,.875rem)/normal var(--body);letter-spacing:0;color:var(--text-muted);opacity:1}
.workout-shell .exercise-heading h2,
.workout-shell .exercise-item h3{overflow-wrap:anywhere}
.workout-shell .workout-bodyweight{grid-template-columns:minmax(0,1fr) auto}
.workout-shell .workout-bodyweight strong{overflow-wrap:anywhere}
.workout-shell .set-row{grid-template-columns:26px minmax(0,1fr) minmax(0,1.6fr) 24px}
.workout-shell .set-value{text-align:right;overflow-wrap:anywhere}
.workout-shell .workout-aside .card-header{flex-wrap:wrap}

@media(max-width:759px){
 /* Prefix and unit have their own corners, so precise weights use the full field. */
 .workout-shell .number-field{position:relative}
 .workout-shell .number-field input{width:100%;font-size:clamp(1.5rem,8vw,2.7rem)}
 .workout-shell .number-field .prefix{position:absolute;left:var(--s2);top:var(--s1);font-size:var(--text-xs);line-height:1.2;pointer-events:none}
 .workout-shell .number-field .unit{position:absolute;right:var(--s2);bottom:var(--s1);font-size:var(--text-xs);line-height:1.2;pointer-events:none}
 .workout-shell .number-control>label{min-height:1.5em}
 .workout-shell .workout-bodyweight{grid-template-columns:minmax(0,1fr)}
 .workout-shell .workout-secondary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
 .workout-shell .workout-secondary .text-btn{justify-content:center;gap:var(--s1);text-align:center;line-height:1.35}
 .workout-shell .set-list>.row{flex-wrap:wrap;gap:var(--s2)}
 /* Keep set submission above the keyboard; secondary actions return after editing. */
 .workout-shell.workout-keyboard .workout-actions{display:block;padding-block:var(--s2)}
 .workout-shell.workout-keyboard .workout-actions .primary{min-height:44px;font-size:var(--text-sm)}
 .workout-shell.workout-keyboard .workout-secondary{display:none}
 .workout-shell.workout-keyboard .workout-grid{scroll-padding-block:var(--s3)}
 .workout-shell .rest-actions{flex-wrap:wrap;max-width:100%}
 .workout-shell .rest-actions .btn{min-height:44px}
}

@media(max-width:359px){
 .workout-shell .workout-secondary .text-btn{font-size:.68rem}
 .workout-shell .workout-secondary .text-btn svg{width:12px;height:12px}
 .workout-shell .set-row{grid-template-columns:22px minmax(0,1fr) minmax(0,1.7fr) 18px;gap:var(--s2)}
}

@media(prefers-reduced-motion:reduce){
 .workout-shell .workout-grid{scroll-behavior:auto}
}

/* One compact exercise heading, with two entrances to the existing instruction dialog. */
.workout-shell .workout-exercise-heading-row{display:flex;align-items:flex-start;gap:var(--s3);min-width:0}.workout-shell .workout-exercise-heading-row h2{flex:1;min-width:0;letter-spacing:-.02em}.workout-shell .workout-exercise-title{appearance:none;display:block;width:100%;min-height:44px;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;text-transform:inherit;text-align:left;overflow-wrap:anywhere;hyphens:inherit}.workout-shell .exercise-heading-actions{display:flex;flex:0 0 auto;margin:0}.workout-shell .workout-exercise-guide{width:44px;min-width:44px;height:44px;min-height:44px;padding:0}
.workout-shell .workout-exercise-title:focus-visible,.workout-shell .workout-exercise-guide:focus-visible{outline-offset:-2px}

/* A mobile training has its own scrollable grid; its outer frame must not pan under iOS chrome. */
@media(max-width:759px){
 html:has(.workout-shell),body:has(.workout-shell){overflow:hidden}
 .workout-shell{--workout-safe-top:env(safe-area-inset-top,0px);position:fixed;inset:var(--app-visible-top,0px) 0 auto;box-sizing:border-box;width:100%;max-width:none;margin:0;height:100vh;height:var(--app-visible-height,100dvh);background:var(--background);padding-top:calc(var(--workout-safe-top) + var(--s2));padding-inline-start:max(var(--s4),env(safe-area-inset-left,0px));padding-inline-end:max(var(--s4),env(safe-area-inset-right,0px))}
 /* Keep the existing visual-viewport positioning while editing a set. */
 .workout-shell.workout-keyboard{top:var(--workout-visible-top,0px);height:var(--workout-visible-height,100dvh)}
}

/* Claim gate only: primary choices have their own row; overview remains a smaller action. */
.workout-claim-actions{display:grid;gap:var(--s2);max-width:42rem;margin-top:var(--s5)}
.workout-claim-primary-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s3)}
.workout-claim-primary-actions>.btn{width:100%;min-width:0;white-space:normal;text-align:center;line-height:1.35;padding-inline:var(--s3);overflow-wrap:anywhere}
.workout-claim-primary-actions>.btn:only-child{grid-column:1/-1}
.workout-claim-overview{justify-self:center;justify-content:center;font-size:var(--text-xs);padding-inline:var(--s3)}
@media(max-width:359px){.workout-claim-primary-actions{grid-template-columns:1fr}}

/* Read-only inspection of preserved workout conflicts; no horizontal table on phones. */
.conflict-snapshot{display:grid;gap:var(--s2);margin-bottom:var(--s4)}
.conflict-snapshot .btn{justify-self:start;white-space:normal;text-align:left}
.conflict-preview,.conflict-exercise{min-width:0;overflow-wrap:anywhere}
.conflict-preview .card{padding:var(--s4);margin-block:var(--s4)}
.conflict-preview .stack{display:grid;gap:var(--s3);margin-top:var(--s4)}
.conflict-preview .btn{white-space:normal;text-align:center}
.conflict-set-list{list-style:none;padding:0;margin:0;display:grid;gap:var(--s3)}
.conflict-set-list li{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--s1) var(--s3);border-top:1px solid var(--border);padding-top:var(--s3)}
.conflict-set-list li>span:nth-child(n+3){grid-column:1/-1}
