/* Native menus keep their keyboard and touch behavior. */
select:not([multiple]){
  color-scheme:dark;
  appearance:none;
  background-color:#0b1410!important;
  color:#c0ffd9!important;
  border:1px solid #48795b!important;
  border-radius:8px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%236ff3aa' stroke-width='2'%3E%3Cpath d='m3 6 5 5 5-5'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;
  background-position:right .6rem center!important;
  padding-right:2rem!important;
  cursor:pointer;
}
select{accent-color:#00ff88;color-scheme:dark}
select option,select optgroup{background:#0b1410;color:#cef7dd}
select option:checked{background:#174e31;color:white}
select:focus-visible,.gr-load-field input:focus-visible{outline:2px solid #00ff88!important;outline-offset:2px}
.gr-load-field{display:grid;gap:6px;min-width:0;max-width:100%}
.gr-load-field input:not([hidden]),.gr-load-field select{width:100%;min-width:0;min-height:42px;padding:7px 9px;font:inherit;border-radius:8px}
.gr-load-field input:not([hidden]){background:#0b1410;border:1px solid #48795b;color:white}
.gr-load-field input[hidden]{display:none!important}
#wtBtns .gr-load-field{width:8rem}
#quickSetDialog .quick-weight{display:grid;align-content:start;gap:.55rem}

/* Shared modal sizing and typography across workout, account, nutrition and social flows. */
:is(.gr-dialog-shell,.gr-dialog-flow,.pro-modal,.gr-consent-modal,.gr-share-modal,.gr-clip-preview,.gr-wizard,.gr-levelup,.br-done,.coach-sheet,.queue-sheet,.done-overlay,#quickSetDialog){
  --gr-dialog-label:clamp(14px,1.05vw,17px);
  --gr-dialog-body:clamp(16px,1.25vw,20px);
  --gr-dialog-lead:clamp(19px,1.55vw,24px);
  --gr-dialog-title:clamp(24px,2vw,34px);
  --dim:#abbab5;
  font-size:var(--gr-dialog-body);
  line-height:1.45;
}
:is(.gr-dialog-shell,.pro-modal,.gr-consent-modal)>div:first-child{
  box-sizing:border-box;min-width:0;max-height:calc(100dvh - 40px);overflow:auto;overscroll-behavior:contain;
}
:is(.gr-dialog-shell,.gr-dialog-flow,.gr-consent-modal,.pro-modal,#quickSetDialog) :is(button,input:not([type=checkbox]):not([type=radio]),select,textarea){
  font-size:var(--gr-dialog-body)!important;min-height:44px;
}
:is(.gr-dialog-shell,.gr-dialog-flow,.gr-consent-modal,.pro-modal,.gr-share-modal,.gr-wizard,#grExPicker,#quickSetDialog) :is(button,input,a,textarea):focus-visible{outline:2px solid #79ffb3!important;outline-offset:2px}
:is(.gr-dialog-shell,.pro-modal) :is(.food-help,.food-label,.pm-sub,.gr-ach-desc,.gr-assess-dims),
:is(.gr-wizard-sub,.gr-wizard-choice p,.br-done-sub,.br-done-stat-lbl,.gr-levelup-prefix,.gr-levelup-next,.gr-consent-body,.coach-msg,.qsh-meta,.gr-share-modal p){
  font-size:var(--gr-dialog-body);line-height:1.5;
}
:is(.gr-share-btn-on-levelup,.gr-levelup-close,.gr-consent-buttons button,.br-done button,.gr-wizard-skip,.done-overlay .btn){font-size:var(--gr-dialog-body);min-height:44px}
#completeSetModal .set-complete-card{
  width:min(100%,40rem);padding:clamp(18px,3vw,38px);background:var(--surface);color:var(--text);border:1px solid #426653;border-radius:18px;box-shadow:0 18px 64px #0009;
}
#csHeading{margin:0 0 4px;color:var(--accent);font-size:clamp(26px,2.6vw,42px);letter-spacing:-.025em;line-height:1.12}
.cs-exercise{margin-bottom:1.2em;font-size:var(--gr-dialog-lead);font-weight:700}
.cs-fields{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:14px;margin:0 0 18px}
.cs-fields label{display:block;margin-bottom:5px;font-weight:650}
#csReps{width:100%;padding:7px 10px;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:8px;font:inherit}
.cs-target{font-size:var(--gr-dialog-label);color:var(--dim);margin-top:5px}
.cs-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end}
.cs-actions button:first-child{margin-right:auto}
#grExPicker{position:fixed;inset:0;z-index:9600;display:flex;flex-direction:column;background:var(--bg);color:var(--text);overflow:hidden;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}
#grExPicker [hidden]{display:none!important}
.pick-head,.pick-tools,.pick-scroll{padding-inline:max(clamp(14px,3vw,44px),calc((100vw - 1600px)/2));}
.pick-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-block:clamp(9px,1.5vh,22px);border-bottom:1px solid var(--border)}
.pick-head h2{margin:0;font-size:clamp(24px,2.8vw,46px);letter-spacing:-.03em;line-height:1.1}
#grPickDone,.pick-preview,.pick-minus,.pick-recent button{border:1px solid var(--border);border-radius:8px;background:transparent;color:var(--text);font:inherit;cursor:pointer}
#grPickDone{padding:9px 24px;min-height:44px;background:var(--accent);color:var(--bg);border:0;font-weight:750;font-size:clamp(16px,1.3vw,20px)}
.pick-tools{padding-block:clamp(7px,1.1vh,16px);display:grid;gap:8px;background:var(--surface)}
#grPickSearch{width:100%;min-width:0;border:1px solid #52695e;border-radius:10px;background:#09110d;color:#f4fff9;font:inherit;font-size:clamp(16px,1.45vw,22px);padding:10px 14px}
#grPickChips{display:flex;flex-wrap:wrap;gap:6px}
#grPickChips .bld-chip{min-height:38px;font-size:clamp(14px,1.05vw,18px);font-weight:650;letter-spacing:0;text-transform:none;color:#d4dfd9;padding:5px 14px}
#grPickChips .on{background:var(--accent);color:#082014}
.pick-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-block:14px 28px}
#grPickGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:clamp(9px,1vw,18px)}
.pick-card{min-width:0;display:flex;flex-direction:column;background:var(--surface);border:1px solid #35493d;border-radius:14px}
.pick-card:focus-within,.pick-card:hover{border-color:#75eaa6}
.pick-face{flex:1;min-height:82px;display:grid;gap:5px;align-content:center;padding:15px 16px;cursor:grab}
.pick-face:active,.plan-grip:active{cursor:grabbing}
.pick-qty{color:var(--accent);font-size:.85rem}
.pick-name{font-size:clamp(19px,1.55vw,28px);font-weight:750;line-height:1.15;overflow-wrap:anywhere}
.pick-meta{font-size:clamp(13px,1.05vw,17px);color:#b3c4b9}
.pick-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:6px;border-top:1px solid #304035}
#grPickGrid .pick-actions button{min-height:44px;display:flex;align-items:center;justify-content:center;gap:6px;border:1px solid #3d5146;border-radius:8px;color:#dbe5df;background:transparent;font:inherit;font-weight:650;cursor:pointer}
.pick-actions button.pick-add{color:#91f4b6;background:#122c20;border-color:#326647}
.pick-actions button:hover{border-color:var(--accent)}
.pick-actions svg{width:18px;height:18px}
.pick-recent{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:14px}
.pick-recent h3{font-size:16px;margin:0 6px 0 0}
.pick-recent button{padding:7px 12px;font-size:15px}
@media(min-width:769px){
  :is(.gr-dialog-shell,.pro-modal,.gr-consent-modal)>div:first-child{width:min(100%,46rem)!important;max-width:46rem!important;padding:clamp(24px,2.7vw,44px)!important;border-radius:18px!important}
  .gr-dialog-shell{align-items:center!important}
  #quickSetDialog,.coach-sheet-box{width:min(94vw,43rem);max-width:43rem}
  #quickSetDialog{padding:32px}
  .done-overlay :is(#doneQuests,#doneSignin div,#doneFormChips,.recap-metrics small){font-size:var(--gr-dialog-label)!important}
  .done-overlay>div:last-child{max-width:25rem!important}
  .gr-wizard-choices{max-width:min(90vw,42rem)}
}
@media(max-width:640px),(max-height:520px){
  #grPickChips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:3px}
  #grPickChips button{flex:none}
  .pick-head,.pick-tools{padding-block:7px}
}

.pick-layout{display:flex;flex:1;min-height:0}
.pick-plan{display:none}
.demo-card{width:min(100%,42rem);padding:18px;border:1px solid #50755d;border-radius:16px;background:var(--surface);color:var(--text)}
.demo-card header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.demo-card h2{margin:0;color:var(--accent);font-size:var(--gr-dialog-title);line-height:1.15}
.preview-close{background:var(--accent);color:var(--bg);border:0;border-radius:8px;padding:8px 18px;font:inherit;font-weight:700;cursor:pointer}
.demo-notes h3{font-size:1em;margin:1em 0 .25em}
.demo-notes p,.demo-notes ol{margin:.2em 0;color:#d0dfd6}
.demo-notes ol{padding-left:1.4em}
.demo-notes li+li{margin-top:.4em}
@media(min-width:900px){
  /* Both columns use the space below the toolbar as their one scrollport.
     A shorter column stays in view after its last row reaches the bottom. */
  .pick-layout{
    display:grid;grid-template-columns:minmax(0,1fr) clamp(335px,29vw,500px);grid-template-rows:max-content;align-items:end;
    container-type:size;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;color-scheme:dark;
    padding-inline:max(clamp(14px,3vw,44px),calc((100vw - 1600px)/2));gap:clamp(16px,2vw,32px);
  }
  .pick-scroll,.pick-plan{position:sticky;bottom:0;box-sizing:border-box;min-height:100cqh;min-width:0}
  .pick-scroll{padding-inline:1px 8px;overflow:visible}
  .pick-plan{display:flex;flex-direction:column;background:var(--surface);border-inline:1px solid var(--border);padding:clamp(16px,1.5vw,26px)}
  .pick-plan #grPickPlan{flex:none;overflow:visible}
  #grPickChips{flex-wrap:wrap;overflow:visible}
  .pick-plan h3{margin:0 0 12px;font-size:clamp(21px,1.7vw,29px)}
  .pick-plan p{color:#b6c5bc}
  #exDemoPreview>.demo-card{width:min(94vw,75rem)!important;max-width:75rem!important}
  .demo-layout{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);align-items:start;gap:clamp(20px,3vw,52px)}
  #exDemoPreviewContainer svg,#exInstrDemo svg{width:100%;height:clamp(245px,55dvh,610px)}
  #exInstrSheet>div:first-child{width:min(94vw,70rem)!important;max-width:70rem!important;display:flow-root}
  #exInstrDemo{float:left;width:47%;margin-right:4%!important}
  #exInstrSheet>div>button:last-child{clear:both}
  #builderBody .bldx-row{padding:15px 18px}
  #builderBody .bldx-row .bld-slbl2{font-size:13px}
  #builderBody .bldx-row .bld-drag~span[style*="flex:1"]{font-size:18px!important}
  #builderBody .btn{font-size:16px!important;min-height:44px}
}

#grPickView{display:none}
.plan-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;border-bottom:1px solid #35433c;padding-bottom:10px}
.plan-heading h3{margin:0}.plan-heading>span,.plan-label{color:#b6c8be;font-size:.88rem}
#grPickPlan{list-style:none;overflow:auto;overscroll-behavior:contain;flex:1;min-height:0;padding:2px;margin:0}
#grPickPlanEmpty{padding:22px 14px;border:1px dashed #4a6c59;border-radius:10px;text-align:center}
#grPickPlan li{background:var(--bg);border:1px solid #36463e;border-radius:11px;margin:9px 0;padding:12px;overflow-wrap:anywhere}
.plan-row-head,.plan-order,.plan-step,.plan-tools{display:flex;align-items:center;gap:4px}
.plan-row-head strong{font-size:clamp(15px,1.05vw,19px);flex:1;line-height:1.22}
.plan-grip{padding:6px 4px;color:#b1c2b8;cursor:grab;user-select:none;font-size:24px}
.plan-order button,.plan-step button,.plan-tools button,.log-edit-weight,#grPickView{color:#dbe5df;border:1px solid #42554b;background:#17201b;border-radius:7px;cursor:pointer;font:inherit}
.plan-order button,.plan-step button{width:36px;min-height:36px;font-size:18px}
.plan-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);align-items:start;gap:12px;margin-block:10px}
.plan-label{display:block;margin-bottom:4px;font-weight:600}
.plan-step{gap:2px}.plan-step b{min-width:1.6em;text-align:center}
.plan-fields select,.plan-fields input{min-height:37px;font-size:16px}
.plan-tools{justify-content:flex-end;flex-wrap:wrap;gap:6px}
.plan-tools button,.log-edit-weight{padding:6px 10px;min-height:34px;font-size:.86rem}
.plan-tools [data-action=remove]{color:#ffb6bd}
.pick-plan.drop-ready{outline:1px dashed #66c48c;outline-offset:-2px}
.pick-plan.drop-over{background:#112019}
#grPickPlan li.drop-before{box-shadow:0 -3px var(--accent)}
#grPickPlan li.drop-after{box-shadow:0 3px var(--accent)}
#barbellToggle{display:inline-flex;align-items:center;justify-content:center;flex-direction:row-reverse;gap:8px;min-height:48px;min-width:116px;padding:8px 12px;background:#14251b;border:1px solid #599770;color:#d5ffe3;line-height:1.15;border-radius:10px}
#barbellToggle svg{width:32px;height:22px}
#liveWeightLabel{font-family:inherit;font-size:clamp(14px,1.1vw,19px);font-weight:680}
.video-area .session-timer{right:clamp(162px,13vw,208px)}
#weightEntry{max-width:min(230px,50vw);padding:12px;background:#101a14;border:1px solid #446450;border-radius:10px}
#wtBtns .gr-load-field{width:min(11rem,100%)}
.rest-load{display:grid;align-content:center;gap:4px;min-width:110px;flex:1 1 9rem}
.rest-load label{font-size:.88rem;color:#c4d7c9}
.rest-load[hidden],#restPreviousLoad[hidden],#doneWeights[hidden]{display:none!important}
#grRecordedWeights{box-sizing:border-box;width:min(95vw,42rem);max-height:88dvh;padding:clamp(16px,2vw,30px);border:1px solid #52755e;border-radius:16px;background:var(--surface,#141820);color:var(--text,#f1f7f2)}
#grRecordedWeights::backdrop{background:#000b}
#grRecordedWeights form{display:grid;gap:12px;margin:0}
#grRecordedWeights header{display:flex;align-items:center;justify-content:space-between;gap:10px}
#grRecordedWeights h2,#grRecordedWeights p{margin:0}
#grRecordedWeights .recorded-list{max-height:58dvh;overflow:auto}
.recorded-list>div{display:grid;align-items:center;grid-template-columns:minmax(0,1.4fr) minmax(105px,1fr);padding:10px 0;gap:12px;border-bottom:1px solid #34433a}
.recorded-list small{display:block;color:#b6c8be}
@media(max-width:899px){
  #grPickView{display:block;margin-left:auto;padding:8px 12px;min-height:40px}
  .pick-layout.show-plan .pick-scroll{display:none}
  .pick-layout.show-plan .pick-plan{display:flex;flex-direction:column;flex:1;min-width:0;padding:12px 16px}
  #grExPicker:has(.show-plan) .pick-tools{display:none}
  .pick-head{gap:8px}
  #grPickDone{padding-inline:14px}
}
@media(max-width:550px){
  #barbellToggle{min-width:102px;min-height:44px;padding:6px 8px;gap:5px}
  #barbellToggle svg{width:25px}
  .video-area .session-timer{right:134px}
}

.queue-load{color:#bcf4cf;background:#15281e;border:1px solid #456a51;border-radius:7px;min-height:36px;padding:5px 9px;cursor:pointer;white-space:nowrap}
.gr-load-dialog{width:min(92vw,28rem);padding:22px;color:var(--text);background:var(--surface);border:1px solid #52755e;border-radius:14px}
.gr-load-dialog::backdrop{background:#000b}
.gr-load-dialog form{display:grid;gap:10px}
.gr-load-dialog h2{margin:0 0 6px}
.gr-load-dialog footer{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
