/* Shared active workout compact surface; existing inputs and save handlers remain canonical. */
.exercise-card,.superset-exercise-premium{overflow-anchor:none;min-width:0}
.set-panel .compact-fields{display:block!important;margin:0!important}
.set-panel{padding:10px!important}.set-panel .field-group.r4-row{display:flex;align-items:center;justify-content:space-between;position:relative;min-height:44px;gap:8px;margin:0;border-bottom:1px solid #ffffff12}
.r4-row>label{font-size:.82rem!important;margin:0!important;text-transform:none!important;flex:1}.r4-row>label small{display:none}
.r4-value{border:0;background:transparent;color:#00e88a;font:inherit;font-size:.88rem;min-height:44px;min-width:64px;text-align:right;padding:6px}
.r4-row:not(.r4-edit)>input:not([type=hidden]),.r4-row:not(.r4-edit)>.pill-group{display:none!important}
.r4-row.r4-edit>.r4-value{display:none}.r4-row.r4-edit>input:not([type=hidden]){width:116px!important;min-height:40px;padding:7px!important;font-size:.95rem!important}
.r4-row.r4-edit>.pill-group{display:flex;flex-wrap:wrap;justify-content:flex-end;max-width:190px;gap:4px}.r4-row .pill-btn{min-width:40px;min-height:40px;padding:5px}
.set-panel.is-logged .set-actions,.btn-exercise-done,.set-logged-overlay{display:none!important}
.r4-tools{display:flex;gap:6px;flex-wrap:wrap;position:relative;margin:6px 0}.r4-info-trigger{width:44px;height:44px;border:1px solid #ffffff20;border-radius:10px;background:#ffffff06;color:#b8c5bd;font-size:1rem}
.r4-secondary{display:none!important}.r4-secondary.r4-open{display:block!important;position:relative;margin:6px 0;padding:10px;border:1px solid #ffffff22;border-radius:10px;max-width:100%;overflow-wrap:anywhere}
.pv-free-replace-btn{width:44px!important;height:44px!important;padding:0!important;font-size:1rem!important}.pv-free-replace-btn>span:not(:first-child){display:none!important}.pv-free-replace-wrap{margin:4px 0!important}
.exercise-header{padding:10px!important;gap:6px!important}.exercise-header h4{font-size:1rem!important}.block-type-selector{margin:4px 0!important}.block-type-hint{display:none!important}.sets-progress{display:none!important}.set-tabs{gap:4px!important;margin:6px 0!important;flex-wrap:wrap}.set-tab{padding:8px!important;font-size:.8rem!important}
#global-rest-timer{max-width:100%;box-sizing:border-box}.r4-timer-off #global-rest-timer,.r4-timer-off .global-rest-timer{display:none!important}
.r4-tools [hidden],.r4-secondary[hidden]{display:none!important}.r4-display-row{display:flex;align-items:center;justify-content:space-between;min-height:44px;gap:10px;border-bottom:1px solid #ffffff14;font-size:.88rem}
@media(max-width:360px){.exercise-header .pv-drag-handle{display:none}.set-panel{padding:7px!important}}
.global-rest-timer{padding:8px 10px!important}.global-rest-timer .timer-main{display:flex;flex-wrap:wrap;gap:8px;min-width:0}.global-rest-timer .timer-display{font-size:1.7rem!important;line-height:1.1}.global-rest-timer .timer-controls{display:flex;flex-wrap:wrap;gap:4px;min-width:0}.global-rest-timer .timer-btn{min-height:40px;padding:7px!important;font-size:.8rem!important}.global-rest-timer .timer-header{margin-bottom:4px!important}.r4-timer-off .has-global-timer{padding-bottom:24px!important}

/* R5 exercise-only matrix: existing header and linked-set structure retained. */
.set-panel .compact-fields{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px!important}
.set-panel .field-group.r4-row{min-width:0;min-height:44px;gap:3px;padding:2px 4px;border:1px solid #ffffff16;border-radius:9px;box-sizing:border-box}
.r4-row>label{font-size:clamp(.65rem,2.5vw,.82rem)!important;min-width:0;line-height:1.2;flex:1;text-align:left!important}
.r4-value{flex:0 0 auto;min-width:42px;max-width:60px;font-size:.85rem;text-align:center;border:1px solid #ffffff18;border-radius:8px;padding:4px;min-height:40px}
.r4-row.r4-edit>input:not([type=hidden]){width:58px!important;max-width:45%;min-height:40px;padding:4px!important}
.r4-row.r4-edit>.pill-group{position:absolute;top:100%;right:0;z-index:30;background:#151c20;border:1px solid #ffffff30;border-radius:9px;width:170px;max-width:calc(100vw - 32px);padding:5px}
[data-pv-training-field=rir]{order:-1}.r5-note-row{display:none!important}.r5-note-row.r4-open{display:flex!important;grid-column:1/-1}
.r4-tools{grid-column:1/-1;display:flex;align-items:center;gap:8px;margin:5px 0 0;padding-top:7px;border-top:1px solid #ffffff18;flex-wrap:nowrap}
.r4-info-trigger,.pv-free-replace-btn{width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;padding:0!important;flex:0 0 40px;box-sizing:border-box}
.r4-secondary.r4-open:not(.r5-note-row){position:absolute;z-index:20;left:8px;right:8px;max-width:calc(100% - 16px);background:#111b19;box-sizing:border-box;box-shadow:0 8px 28px #0009}
.exercise-card,.superset-exercise-premium{position:relative}.set-panel{overflow:visible!important}
.r5-strip-frame{display:flex;align-items:center;gap:3px;min-width:0;margin:6px 0}.set-tabs{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;min-width:0;flex:1;gap:4px!important;margin:0!important}.set-tab-wrap{flex:0 0 auto}.set-tab,.set-tab-add{min-height:40px!important;white-space:nowrap;padding:7px!important;flex:0 0 auto;font-size:.78rem!important}.set-tab-remove{width:18px!important;min-width:18px!important;padding:0!important}.r5-strip-arrow{width:24px;min-width:24px;min-height:40px;background:transparent;color:#00e88a;border:0;font-size:1.2rem}.r5-strip-arrow[hidden]{display:none}.r5-set-short{display:none}.r5-short .r5-set-full{display:none}.r5-short .r5-set-short{display:inline}
.block-type-selector{display:inline-block;max-width:140px}.block-type-trigger{min-height:36px!important;padding:5px 8px!important;font-size:.75rem!important}

.pv-free-weight-advice,[id^="exercise-info-"],[id^="recovery-badge-"],[id^="recovery-"]{display:none!important}
/* Explicit hide wins over legacy important display rules. */
.set-panel .field-group[hidden],.r4-tools [hidden]{display:none!important}
.r4-row.r4-edit>.pill-group{transform:translateX(0)}
@media(max-width:430px){.compact-fields>.field-group:first-child .pill-group{right:auto;left:0}}

.r4-tools{gap:4px}.r4-info-trigger,.r4-tools .pv-free-replace-btn{width:32px!important;min-width:32px!important;height:40px!important;flex:0 0 32px}.r4-tools .pv-free-replace-wrap{flex:0 0 32px;margin:0!important}

.r4-tools .pv-free-replace-panel:not([hidden]){position:absolute;left:0;right:0;top:100%;min-width:0;width:auto;box-sizing:border-box;background:#111b19;z-index:25;max-height:60vh;overflow-y:auto}
/* Account RPE/RIR preferences use inline display:none; do not override them. */
.set-panel .field-group.r4-row[data-pv-training-field][style*="display: none"]{display:none!important}
.set-panel .compact-fields:has([data-pv-training-field="rpe"][style*="display: none"]):has([data-pv-training-field="rir"][style*="display: none"]){display:none!important}

/* R5 corrective pass: override the inherited column direction, not only display. */
.set-panel .compact-fields>.field-group.r4-row {
  flex-direction:row!important; flex-wrap:nowrap!important;
  align-items:center!important; justify-content:space-between!important;
  min-height:40px; padding:0 5px; border-radius:8px;
}
.set-panel .compact-fields {gap:4px!important;margin-bottom:4px!important}
.set-panel .field-group.r4-row>label {display:block;flex:1 1 auto;width:auto!important;letter-spacing:0!important;line-height:1.2;text-align:left!important}
.set-panel .field-group.r4-row>.r4-value {display:inline-flex;align-items:center;justify-content:center;gap:3px;flex:0 0 auto;min-width:42px;min-height:36px;max-width:62px;margin:0;padding:3px;font-size:.8rem;line-height:1}
.set-panel .field-group.r4-row>.r4-value::after {content:'▾';font-size:.65rem;color:#9baaa4}
.set-panel .field-group.r4-row.r4-edit>.r4-value {display:none!important}
.set-panel .field-group.r4-row.r4-edit>input:not([type=hidden]) {flex:0 0 58px;width:58px!important;min-height:36px;box-sizing:border-box}
.exercise-card [id^="ex-selector-"][hidden],.superset-exercise-premium [id^="ex-selector-"][hidden],.pv-free-replace-btn[hidden] {display:none!important}
.set-panel .set-actions {margin-top:8px!important}
.set-panel .btn-log-set {min-height:44px;padding:9px 12px!important;font-size:.9rem!important}
.set-panel .pv-bodyweight-notice {padding:4px!important;font-size:.7rem!important;line-height:1.2}
.set-panel .bodyweight-load-group {flex-direction:row;align-items:center;min-height:40px}

/* R6 visibility and dedicated exercise actions; accepted set matrix unchanged. */
.r4-tools[hidden],.r4-secondary[hidden],.r6-display-panel[hidden] {display:none!important}
.r6-exercise-actions {display:flex;align-items:center;gap:4px;position:relative}
.r6-exercise-actions .pv-free-replace-wrap {margin:0!important}
.r6-exercise-actions .pv-free-replace-btn {display:flex!important;width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;align-items:center;justify-content:center}
.r6-exercise-actions .pv-free-replace-btn[hidden] {display:none!important}
.r6-exercise-actions .pv-free-replace-panel:not([hidden]) {position:fixed;left:12px;right:12px;top:20vh;max-height:55vh;overflow:auto;background:#111b19;z-index:80;box-sizing:border-box}
.r6-exercise-actions .r4-info-trigger {width:32px!important;min-width:32px!important;height:36px!important;min-height:36px!important}
.r6-display-gear {width:36px;min-width:36px;min-height:40px;border:1px solid #ffffff20;border-radius:9px;background:#ffffff06;color:#b8c5bd;font-size:1rem}
.r6-display-panel {position:fixed;z-index:100;top:80px;right:12px;width:300px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 100px);overflow:auto;padding:12px;border:1px solid #ffffff25;border-radius:12px;background:#111b19;box-shadow:0 8px 28px #0009;box-sizing:border-box}
.r6-display-head {display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:.9rem}
.r6-display-head button {min-width:36px;min-height:36px;background:transparent;border:0;color:inherit;font-size:1.2rem}
/* A single enabled effort field fills the row; both off remove the row. */
.set-panel .compact-fields:has([data-pv-training-field="rir"][style*="display: none"])>[data-pv-training-field="rpe"],
.set-panel .compact-fields:has([data-pv-training-field="rpe"][style*="display: none"])>[data-pv-training-field="rir"] {grid-column:1/-1}

/* R7: existing selector, compact fixed search surface. Four 48px results. */
.pv-exercise-accordion .pv-exercise-summary-controls{grid-column:1/-1;display:flex;width:100%;box-sizing:border-box;justify-content:flex-start}
.pv-exercise-summary-controls .r6-exercise-actions{margin-left:auto}
.r6-exercise-actions .pv-free-replace-btn{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}
.r7-search-selector{position:fixed!important;inset:auto 12px auto 12px;top:12vh;z-index:100;background:#111b19;border:1px solid #ffffff30;border-radius:12px;padding:10px;box-sizing:border-box;max-height:76dvh;overflow:hidden;min-width:0}
.r7-search-selector[hidden]{display:none!important}
.r7-search-selector .exercise-search-input{box-sizing:border-box;width:100%;min-width:0;min-height:44px;font-size:16px!important}
.r7-search-selector .exercise-search-results{position:static!important;max-height:192px!important;max-height:min(192px,45dvh)!important;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y;margin-top:6px}
.r7-search-selector .exercise-result-item{box-sizing:border-box;height:48px!important;min-height:48px;display:flex;align-items:center;padding:8px!important;overflow:hidden}
.r7-search-selector .exercise-result-item>div{width:100%;min-width:0;gap:5px}
.r7-search-selector .exercise-result-item strong{font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.r7-search-selector .exercise-result-item span{flex-shrink:0}
.r7-search-selector .exercise-selected-display{display:none!important}
.r7-search-cancel{min-height:44px;width:100%;margin-top:6px;border:1px solid #ffffff24;border-radius:8px;color:#ddd;background:#ffffff08}
.r6-exercise-actions .pv-free-replace-panel:not([hidden]){position:static;padding:0;margin:0;border:0;max-height:none;overflow:visible}
#exercises-container{overflow-anchor:none}

/* R8-C1 micro polish: secondary workout info opens beside the set-type control. */
.r8-top-control-row{display:flex;align-items:flex-start;gap:8px;position:relative;min-width:0;margin:4px 0 6px}
.r8-top-control-row>.block-type-selector,.r8-top-control-row>.pv-block-type-selector{flex:0 0 auto;margin:0!important}
.r8-secondary-anchor{position:relative;flex:1 1 auto;min-width:0;align-self:stretch;pointer-events:none}
.r8-secondary-anchor>.r4-secondary.r4-open{display:block!important;position:absolute!important;z-index:40;top:auto;bottom:0;left:0;right:0;max-width:none!important;max-height:min(240px,45dvh);overflow:auto;overscroll-behavior:contain;margin:0!important;padding:10px;background:#111b19;box-sizing:border-box;box-shadow:0 8px 28px #0009;pointer-events:auto;border:1px solid #ffffff30;border-radius:10px}
.r8-secondary-anchor>.r5-note-row.r4-open{display:flex!important;min-height:44px}
.r8-secondary-anchor>.r5-note-row.r4-edit>input:not([type=hidden]){width:180px!important;max-width:70%;font-size:16px!important}
@media(max-width:340px){.r8-top-control-row{flex-wrap:wrap}.r8-secondary-anchor{flex:1 0 100%;width:100%;min-height:0}.r8-secondary-anchor>.r4-secondary.r4-open{position:relative!important;top:auto;left:auto;right:auto;width:100%;margin-top:2px!important}}

#r6-display-panel #pv-free-intelligence-settings{border-top:1px solid #ffffff20;margin-top:8px;padding-top:10px;font-size:.8rem}
#r6-display-panel .pv-v91-toggle-copy small{display:none}
#r6-display-panel .pv-v91-microloads{grid-template-columns:1fr}
#pv-free-intelligence-settings[hidden]{display:none!important}

/* R8-C3: compact rep-target popup */
.r8-secondary-anchor>[id^="pv-free-target-"].r4-open,.r8-secondary-anchor>[id^="pv-rep-target-"].r4-open{left:0!important;right:0!important;width:auto!important;max-width:100%!important;min-width:0!important;max-height:min(170px,32dvh)!important;padding:8px!important;overflow-x:hidden!important}
.r8-secondary-anchor>[id^="pv-free-target-"].r4-open .pv-v91-target-box,.r8-secondary-anchor>[id^="pv-rep-target-"].r4-open .pv-v91-target-box{margin:0!important;padding:8px!important}
.r8-secondary-anchor>[id^="pv-free-target-"].r4-open .pv-v91-target-head,.r8-secondary-anchor>[id^="pv-rep-target-"].r4-open .pv-v91-target-head{margin-bottom:6px!important}
.r8-secondary-anchor>[id^="pv-free-target-"].r4-open .pv-v91-target-inputs input,.r8-secondary-anchor>[id^="pv-rep-target-"].r4-open .pv-v91-target-inputs input{width:56px!important;min-height:36px!important;padding:6px 8px!important}
.r8-secondary-anchor>[id^="pv-free-target-"].r4-open .pv-v91-target-inputs>span:last-child,.r8-secondary-anchor>[id^="pv-rep-target-"].r4-open .pv-v91-target-inputs>span:last-child{display:none!important}

/* R8-C4: keep Rep-target copy fully inside the compact popup. */
.r8-secondary-anchor>[id^="pv-free-target-"].r4-open .pv-v91-target-box,.r8-secondary-anchor>[id^="pv-rep-target-"].r4-open .pv-v91-target-box{width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
.r8-secondary-anchor>[id^="pv-free-target-"].r4-open .pv-v91-target-head,.r8-secondary-anchor>[id^="pv-rep-target-"].r4-open .pv-v91-target-head{display:flex!important;flex-wrap:wrap!important;gap:5px 7px!important;min-width:0!important}
.r8-secondary-anchor>[id^="pv-free-target-"].r4-open .pv-v91-target-head strong,.r8-secondary-anchor>[id^="pv-rep-target-"].r4-open .pv-v91-target-head strong{flex:0 0 auto;white-space:nowrap!important}
.r8-secondary-anchor>[id^="pv-free-target-"].r4-open .pv-v91-target-head small,.r8-secondary-anchor>[id^="pv-rep-target-"].r4-open .pv-v91-target-head small{flex:1 1 92px;min-width:0;white-space:normal!important;text-align:right!important;line-height:1.15!important;overflow-wrap:anywhere!important}
.r8-secondary-anchor>[id^="pv-free-target-"].r4-open .pv-v91-target-inputs,.r8-secondary-anchor>[id^="pv-rep-target-"].r4-open .pv-v91-target-inputs{max-width:100%!important;min-width:0!important;flex-wrap:nowrap!important}
