:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;background:#10141b;color:#f3f6fa;color-scheme:dark;line-height:1.5;--bg:#10141b;--panel:#1a2230;--line:#354254;--muted:#aab8c8;--accent:#72ddd0}
*{box-sizing:border-box}body{margin:0}.shell{max-width:1170px;margin:auto;padding:26px 20px 70px}
.header,.panelhead,.buttonbar,.statrow,.inlineform,.sessionhead{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.header{justify-content:space-between;margin-bottom:24px}.header p{color:var(--muted)}
.brand{font-size:12px;letter-spacing:.19em;font-weight:800;color:var(--accent);text-decoration:none}.brand span{color:var(--muted)}
h1{font-size:clamp(30px,4vw,45px);margin:7px 0 5px;letter-spacing:-.035em}h2{font-size:24px;margin:0 0 3px}h3{font-size:18px;margin:0 0 10px}p{margin:0 0 12px;color:var(--muted)}a{color:var(--accent)}.quiet-link{font-size:14px}.tabs{display:flex;gap:8px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:23px}
button{border:1px solid #526279;background:#263347;color:#f3f6fa;border-radius:9px;padding:10px 15px;font:inherit;cursor:pointer;font-weight:650;min-height:43px}
button:hover{border-color:var(--accent)}button:disabled{opacity:.5;cursor:not-allowed}
button.primary,.tabs button.selected{border-color:#25877e;background:#17544e;color:#d4fff9}
button.danger{border-color:#804148;background:#412329;color:#fff0f0}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.pane[hidden],[hidden]{display:none!important}.intro{margin-bottom:18px}.surface{background:var(--panel);border:1px solid var(--line);border-radius:15px;padding:19px;margin-bottom:16px}
label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted);font-weight:650}input,select,textarea{background:#111923;border:1px solid #516078;border-radius:9px;padding:10px 12px;color:#f3f6fa;font:inherit;min-height:43px;max-width:100%}
input[type=checkbox]{width:19px;min-height:19px;height:19px;accent-color:#51baae;cursor:pointer}textarea{width:100%;min-height:78px;resize:vertical}
.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.formgrid label{min-width:0}.buttonbar{margin-top:14px}.inlineform{align-items:end}.inlineform .grow{flex:1;min-width:210px}
.editorform{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;border-top:1px solid var(--line);padding-top:20px;margin-top:18px}
.full{grid-column:1/-1}.editorform button{justify-self:start}.separator{margin-top:20px;border-top:1px solid var(--line);padding-top:20px}
.panelhead{justify-content:space-between}.subtle{color:var(--muted);font-size:13px}
.exercise-list{display:grid;gap:9px}.exercise-row{border:1px solid #384759;padding:13px;border-radius:11px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.exercise-row strong{display:block}.exercise-row small{color:var(--muted)}.exercise-row button{min-height:37px;font-size:13px}
.empty{text-align:center;padding:30px}.note{font-size:13px;color:var(--muted)}.notice{padding:13px 17px;margin-bottom:18px;border-radius:10px;background:#173d3b;border:1px solid #2f8d83;color:#d0fff8}.notice.error{background:#452427;border-color:#aa5557;color:#ffdfdf}
.sessionhead{justify-content:space-between;margin-bottom:13px}.metric{font-size:22px;font-weight:800}.muted{color:var(--muted);font-size:13px}.track{height:9px;overflow:hidden;border-radius:50px;background:#344355;margin-bottom:15px}.fill{height:100%;background:#61d0bf;transition:width .2s}
.session-exercise{margin-bottom:15px}.sethead,.setrow{display:grid;grid-template-columns:55px minmax(75px,1fr) minmax(70px,1fr) minmax(70px,1fr) 110px;gap:9px;align-items:center}
.sethead{color:var(--muted);font-size:12px;margin-bottom:6px}.setrow{margin:9px 0}.setrow label{font-size:12px;gap:2px}
.setrow input[type=number]{width:100%;min-width:0}.setrow.done{background:#173a35;border-radius:10px;padding:5px}
.setrow .complete{display:flex;align-items:center;flex-direction:row;gap:5px}
.timer{display:flex;gap:12px;align-items:center;flex-wrap:wrap;background:#172b33;border:1px solid #305d62;padding:13px;border-radius:10px;margin:13px 0}
.statrow{margin-bottom:18px}.stat{background:var(--panel);padding:14px 20px;border-radius:12px;border:1px solid var(--line);flex:1;min-width:140px}.stat strong{font-size:23px;display:block}.stat span{font-size:13px;color:var(--muted)}
.history-list{display:grid;gap:11px}.history-card{background:var(--panel);border:1px solid var(--line);border-radius:13px;padding:15px}
.history-card summary{cursor:pointer;font-weight:700}.history-card ul{margin:10px 0;padding-left:22px}.history-card li{margin:7px 0}
.stack>*+*{margin-top:10px}.stack button{justify-self:start}
footer{border-top:1px solid var(--line);color:var(--muted);font-size:13px;padding-top:18px;margin-top:40px}
@media(max-width:750px){.editorform{grid-template-columns:repeat(2,minmax(0,1fr))}.sethead,.setrow{grid-template-columns:44px repeat(3,minmax(56px,1fr)) 75px;gap:4px}.setrow input{padding:7px 4px}.shell{padding:20px 12px 45px}.setrow .complete{font-size:12px}.surface{padding:13px}.stat{min-width:100px}}
@media(max-width:460px){.formgrid{grid-template-columns:1fr}.tabs button{flex:1 1 40%}.sethead{font-size:10px}.setrow label{font-size:10px}.setrow .complete{flex-direction:column}.setrow input[type=checkbox]{height:21px;width:21px}}

/* Exercise quick reference and source-photo gallery (v0.3) */
.exercise-overview{display:grid;grid-template-columns:minmax(155px,220px) minmax(0,1fr);gap:16px;margin:13px 0 16px;align-items:start}
.exercise-photo{width:100%;min-height:136px;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);background:#111923;border-radius:10px;overflow:hidden}
.photo-trigger{padding:0;width:100%;min-height:135px;display:flex;flex-direction:column;align-items:stretch;background:transparent;border:none;border-radius:0;color:#b9f9ef;text-align:center}
.photo-trigger img{height:145px;width:100%;object-fit:contain;background:#10151b}
.photo-trigger:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}
.photo-caption{padding:6px;font-size:11px;color:#b2eae5}
.photo-fallback{padding:20px;font-size:13px;color:var(--muted)}
.exercise-guide h4{font-size:15px;margin:0 0 5px;color:#bdf5ea}
.exercise-guide p{font-size:14px;margin:0;color:#e5edf4}
.cue-list{padding-left:19px;font-size:13px;color:#b9c8d7;margin:8px 0}
.cue-list li{margin:5px 0}
.plan-technique{border-left:3px solid #3f9e96;padding:7px 0 5px 11px;margin-top:12px;background:#1c2e38}
.plan-technique strong{font-size:12px;color:#abece4}
.plan-technique p{font-size:13px;color:#e1edf5;margin:3px 0 0}
.photo-dialog{width:min(94vw,780px);max-height:92vh;padding:0;border:1px solid #43536c;border-radius:16px;background:#1a2230;color:#f3f6fa}
.photo-dialog::backdrop{background:rgba(1,5,10,.83)}
.photo-dialog-content{padding:18px;display:flex;flex-direction:column;gap:12px}
.photo-dialog-header,.photo-dialog-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px}
.photo-dialog-header h2{font-size:19px;margin:0}
.photo-dialog-bottom #photoCount{font-size:13px;color:var(--muted)}
.photo-large{max-height:min(65vh,650px);height:auto;width:100%;object-fit:contain;background:#10151b;border-radius:11px}
.photo-dialog p{margin:0;font-size:12px}
.photo-dialog a{font-size:13px;align-self:start}
@media(max-width:620px){.exercise-overview{grid-template-columns:1fr}.exercise-photo{max-width:100%}.photo-trigger img{height:185px}.photo-dialog-content{padding:12px}.photo-dialog-header h2{font-size:16px}}


/* 0.3.1: lightweight rest editor and optional RIR */
.rest-program{display:flex;flex-wrap:wrap;gap:12px;align-items:end;padding:12px;margin:16px 0;border:1px solid var(--line);border-radius:10px;background:#121d27}
.rest-program label{min-width:180px}.rest-program input{max-width:150px}
.rest-program .muted{flex:1 1 230px}
.rest-inline{min-width:110px}.rest-inline input{width:100px;min-height:38px}
.sethead,.setrow{grid-template-columns:55px minmax(75px,1fr) minmax(70px,1fr) 110px}
@media(max-width:750px){.sethead,.setrow{grid-template-columns:40px minmax(60px,1fr) minmax(60px,1fr) 80px;gap:6px}}
@media(max-width:460px){.sethead,.setrow{grid-template-columns:34px minmax(50px,1fr) minmax(50px,1fr) 70px;gap:4px}}

/* v0.3.2: non-modal rest overlay, hidden between breaks */
.quick-panel{margin-top:18px}
.quick-panel h3{margin-bottom:5px}
.quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.quick-card{border:1px solid var(--line);border-radius:12px;background:#121d29;padding:15px;display:flex;flex-direction:column;justify-content:space-between;gap:14px}
.quick-card h3{font-size:17px}.quick-card p{font-size:13px}
.quick-card .muted{color:var(--accent);font-weight:650}
.quick-card button{align-self:start}
.rest-overlay{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));width:min(350px,calc(100vw - 32px));border:1px solid #3b918b;background:linear-gradient(145deg,#1b3440 0%,#182732 75%);color:#e9fff8;z-index:90;border-radius:16px;padding:16px 18px;box-shadow:0 14px 42px #000a}
.rest-overlay[hidden]{display:none!important}
.rest-overlay-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.rest-overlay-top strong{font-size:16px}
.rest-eyebrow{text-transform:uppercase;letter-spacing:.13em;font-size:10px;font-weight:800;color:#77dcd2}
.rest-counter{font-size:48px;line-height:1.1;font-variant-numeric:tabular-nums;font-weight:800;margin:6px 0 12px}
.rest-progress-track{width:100%;height:6px;background:#324951;border-radius:20px;overflow:hidden}
.rest-progress-fill{height:100%;width:100%;background:#72ddd0;transition:width .4s linear}
.rest-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px}
.rest-actions span{font-size:12px;color:#b9d5d5}
.rest-actions button,.rest-overlay-top button{padding:7px 11px;min-height:36px;font-size:13px}
@media(max-width:720px){.quick-grid{grid-template-columns:1fr}.quick-card{flex-direction:row;align-items:center}.rest-overlay{right:12px;bottom:max(12px,env(safe-area-inset-bottom))}}
@media(prefers-reduced-motion:reduce){.rest-progress-fill{transition:none}}

/* v0.3.3 Apple Watch manual workout-type guidance */
.watch-hint{display:flex;align-items:flex-start;gap:12px;padding:12px 13px;border:1px solid #3a5964;background:#142a34;border-radius:11px;margin:14px 0}
.watch-icon{width:37px;height:37px;border-radius:9px;background:#243a46;display:grid;place-items:center;font-size:23px;flex:none}
.watch-hint>div{display:flex;flex-direction:column;gap:2px}
.watch-caption{letter-spacing:.09em;font-size:10px;font-weight:800;color:#78e1d4}
.watch-hint strong{font-size:16px;color:#ebfffb}
.watch-hint small{font-size:12px;color:#b5c8d5}
.watch-origin{margin-top:2px}
.watch-editor{padding:13px 15px;border:1px solid #3a5964;border-radius:11px;background:#142a34;margin:16px 0;display:flex;align-items:center;flex-wrap:wrap;gap:12px}
.watch-editor label{flex:1 1 230px}.watch-editor p{flex:2 1 290px;margin:0}
.watch-quick-type{color:#b8f6e9!important;font-size:12px!important;font-weight:650;margin-bottom:0!important}

/* v0.4.0 profiles: local-only workspaces */
.profile-header{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.profile-header label{min-width:185px}
.profile-header select{max-width:240px}
.profile-header .quiet-link{margin-left:8px}
.profile-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end;gap:12px;margin-top:14px}
.profile-form>button{justify-self:start}
.profile-form .full{grid-column:1/-1}
.profile-settings .panelhead{margin-bottom:7px}
@media(max-width:700px){
  .profile-header{width:100%;justify-content:flex-start}
  .profile-header label{flex:1;min-width:165px}
  .profile-header select{max-width:none}
  .profile-form{grid-template-columns:1fr}
  .profile-form .full{grid-column:auto}
}

/* v0.4.2: local-only training preferences, no medical profile fields */
.profile-preference-summary{margin:8px 0 14px}
.profile-option-group{grid-column:1/-1;min-width:0;margin:0;padding:14px 16px;border:1px solid var(--line);border-radius:12px}
.profile-option-group legend{font-weight:750;padding:0 6px;font-size:15px}
.profile-option-group p{margin:0 0 12px}
.preference-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.preference-chip{border:1px solid #43536b;background:#13202d;border-radius:9px;padding:10px 12px;display:flex;align-items:center;gap:9px;min-width:0;cursor:pointer;font-size:13px;line-height:1.3}
.preference-chip:has(input:checked){border-color:#5bcab9;background:#19433e;color:#e8fff9}
.preference-chip input{flex:none;accent-color:#69cfbf;width:17px;height:17px;margin:0}
.preference-chip:focus-within{outline:2px solid #78e1d4;outline-offset:2px}
.profile-routine{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.profile-routine legend{grid-column:1/-1}
.inline-check{display:flex!important;align-items:center;gap:10px}
.inline-check input{width:auto!important;min-width:18px;min-height:18px;accent-color:#67d3c3}
@media(max-width:850px){.preference-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-routine{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.preference-grid,.profile-routine{grid-template-columns:1fr}}

/* v0.5.0 recommendations: visual previews, profile-scoped and non-destructive */
.recommendation-controls{display:flex;align-items:end;gap:14px;flex-wrap:wrap;margin:20px 0 14px}
.recommendation-controls label{min-width:280px;max-width:420px;flex:1}
.recommendation-controls p{flex:2;min-width:240px;margin-bottom:7px}
.recommendation-explainer{margin-bottom:16px;line-height:1.6}
.recommendation-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.recommendation-card{border:1px solid var(--line);background:var(--panel);border-radius:13px;overflow:hidden;display:flex;flex-direction:column;min-width:0}
.recommendation-image{border:0;border-radius:0;padding:0;background:#111a24;width:100%;height:164px;overflow:hidden}
.recommendation-image img{width:100%;height:100%;object-fit:contain}
.recommendation-image .photo-fallback{padding:25px;display:block}
.recommendation-image .photo-fallback[hidden]{display:none}
.recommendation-body{padding:14px;display:flex;flex-direction:column;gap:10px;flex:1}
.recommendation-body h3{font-size:16px;line-height:1.35;margin:0}
.recommendation-body p{font-size:13px;line-height:1.5;margin:0}
.recommendation-equipment{font-size:12px!important;color:#b7f5e8!important;font-weight:700}
.recommendation-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto;padding-top:5px}
.recommendation-actions button{font-size:13px}
.empty-recommendation{padding:25px;border:1px solid var(--line);border-radius:12px;margin-bottom:15px}
.empty-recommendation p{margin-top:8px}
@media(max-width:950px){.recommendation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.recommendation-grid{grid-template-columns:1fr}.recommendation-controls label{min-width:0}}

/* v0.5.1 */
.recommendation-photo-warning{padding:18px 14px;background:#142a34;color:#b5f4eb;font-size:13px;min-height:95px;display:flex;align-items:center;line-height:1.5}
#exerciseTrackingHint{margin:0;line-height:1.5}

/* v0.6.0 local-only editable unsaved weekly plan preview */
.weekly-draft-shell{margin:18px 0}
.weekly-draft-shell .buttonbar{display:flex;flex-wrap:wrap;gap:9px;margin:14px 0}
.weekly-draft-shell h3{margin:0}
.draft-meta{margin:12px 0;line-height:1.5}
.draft-meta p{margin:5px 0}
.draft-name{display:block;margin:14px 0;max-width:560px}
.draft-name input{width:100%}
.draft-day-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
.draft-day{border:1px solid var(--line);border-radius:12px;background:#141e2d;padding:15px;min-width:0}
.draft-day h4{font-size:17px;margin:0 0 6px}
.draft-day>p{font-size:13px;line-height:1.45}
.draft-warning{padding:10px 12px;border-left:3px solid #63c7b9;background:#1d343e;color:#d2ebe9;margin:10px 0}
.draft-item{border-top:1px solid #3c4a60;padding:11px 0;display:flex;flex-direction:column;gap:8px}
.draft-item-main strong{font-size:14px;display:block}
.draft-item-main small{color:#b7c8d9;display:block;margin-top:3px}
.draft-item-controls{display:flex;align-items:end;flex-wrap:wrap;gap:7px}
.draft-number{font-size:11px;min-width:72px;max-width:110px;flex:1}
.draft-number input{width:100%;margin-top:4px;min-width:0}
.draft-item-controls button{font-size:12px;min-height:36px}
@media(max-width:820px){.draft-day-grid{grid-template-columns:1fr}}

/* v0.6.1 — movement-specific external load and read-only progress */
.exercise-row{grid-template-columns:minmax(0,1fr) minmax(120px,170px) minmax(170px,220px) auto}
.exercise-row .rest-inline select{max-width:100%;width:100%}
.session-exercise.no-weight .sethead,.session-exercise.no-weight .setrow{
  grid-template-columns:70px minmax(130px,1fr) minmax(80px,110px)
}
.exercise-weight-hint{margin:8px 0}
.draft-load{min-width:155px;max-width:240px;flex:2;font-size:11px}
.draft-load select{width:100%;margin-top:4px;min-width:0;font-size:12px}
.progress-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.progress-exercise-grid{margin-top:14px}
.progress-exercise-row{padding:12px 0;border-top:1px solid var(--line);display:flex;gap:12px;align-items:center;justify-content:space-between}
.progress-exercise-row span{text-align:right;font-size:13px}
@media(max-width:900px){.exercise-row{grid-template-columns:1fr 1fr}.progress-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.exercise-row{grid-template-columns:1fr}.progress-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.progress-exercise-row{display:block}.progress-exercise-row span{display:block;text-align:left;margin-top:4px}}

/* v0.6.6: keep dataset attribution available in Settings without occupying the main screens */
.source-credit{border-top:1px solid var(--line);padding:14px 6px;margin-top:18px;color:var(--muted);font-size:12px;line-height:1.6}
.source-credit summary{font-weight:650;cursor:pointer;color:var(--muted)}
.source-credit p{margin:8px 0 0;max-width:820px}
.source-credit a{color:var(--accent)}
