:root {
  color-scheme: dark;
  --bg:#0d1220; --panel:#151e30; --panel-2:#1b2840; --panel-3:#25324a;
  --edge:#2b3b53; --text:#eff5fb; --muted:#9daec4; --green:#53e3b8;
  --green-dim:rgba(83,227,184,.12); --red:#ff8c96; --blue:#86b5ff;
  --shadow:0 12px 38px rgba(0,0,0,.15);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  font-synthesis:none;
}
*,*::before,*::after{box-sizing:border-box}
html{min-height:100%;-webkit-tap-highlight-color:transparent}
body{margin:0;background:var(--bg);color:var(--text);min-width:320px;line-height:1.46}
button,input,select,textarea{font:inherit}button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.38}
:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.app-shell{min-height:100svh}
.site-header{position:sticky;top:0;z-index:20;background:rgba(13,18,32,.93);backdrop-filter:blur(12px);border-bottom:1px solid var(--edge)}
.header-inner{max-width:900px;margin:0 auto;padding:13px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:10px;background:none;border:0;color:var(--text);text-align:left;padding:0}
.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:var(--green);color:#0d2424;font-weight:900;font-size:24px}
.brand strong{font-size:18px;letter-spacing:-.045em;line-height:1.1;display:block}.brand small{font-size:9px;letter-spacing:.14em;color:var(--muted);font-weight:800}
.status-stack{text-align:right;display:flex;flex-direction:column;gap:2px;align-items:flex-end}
.status-badge{font-size:11px;font-weight:800;color:var(--green)}.status-badge.off{color:#f9c477}.save-status{font-size:10px;color:var(--muted)}
.main{max-width:900px;margin:auto;padding:24px 18px 110px;min-height:80svh}
.bottom-nav{position:fixed;bottom:0;left:0;right:0;z-index:20;display:flex;justify-content:space-around;gap:4px;padding:8px max(10px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:rgba(15,23,38,.97);border-top:1px solid var(--edge);backdrop-filter:blur(12px)}
.nav-button{flex:1;max-width:155px;border:0;border-radius:11px;padding:6px 3px;background:transparent;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:3px;font-size:10px;font-weight:700}
.nav-button.active{color:var(--green);background:var(--green-dim)}.nav-ico{font-size:23px;line-height:1}
.hero{background:linear-gradient(135deg,#182a3e 0%,#172234 57%,#14232b 100%);border:1px solid #2b4352;border-radius:22px;padding:23px;box-shadow:var(--shadow);margin-bottom:25px;overflow:hidden;position:relative}
.hero::after{content:'↗';position:absolute;right:-15px;top:-36px;font-size:160px;color:rgba(83,227,184,.06);font-weight:900;pointer-events:none}
.eyebrow{font-size:11px;font-weight:900;letter-spacing:.14em;text-transform:uppercase;color:var(--green);margin:0 0 8px}
h1{font-size:clamp(27px,6vw,38px);line-height:1.11;letter-spacing:-.06em;margin:0 0 10px;font-weight:850}h2{font-size:21px;letter-spacing:-.035em;margin:0}h3{font-size:16px;letter-spacing:-.02em;margin:0}
p{margin:0}.muted{color:var(--muted)}.small{font-size:12px}.micro{font-size:10px}.spaced{margin-top:8px}.mt16{margin-top:16px}.mt22{margin-top:22px}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:22px 0 13px}.section-head .muted{font-size:12px}
.cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.panel{background:var(--panel);border:1px solid var(--edge);border-radius:17px;padding:16px}
.workout-tile{min-height:151px;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:10px;transition:background .2s}
.workout-tile:hover{background:#1c293c}
.tile-icon{width:39px;height:39px;border-radius:12px;display:grid;place-items:center;font-size:18px;font-weight:900;background:var(--green-dim);color:var(--green)}
.tile-icon.pull{background:rgba(134,181,255,.12);color:var(--blue)}.tile-icon.legs{background:rgba(249,196,119,.12);color:#f9c477}
.tile-meta{font-size:12px;color:var(--muted);margin-top:3px}
.tile-footer{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%}
button{border:none;border-radius:12px;min-height:42px;transition:background .16s,filter .16s}
.primary{background:var(--green);color:#082923;font-weight:850;padding:11px 16px}
.primary:hover{filter:brightness(1.06)}
.secondary{background:var(--panel-2);border:1px solid var(--edge);color:var(--text);font-weight:750;padding:10px 13px}
.tertiary{background:transparent;color:var(--muted);padding:8px 10px;border:1px solid transparent}
.danger{background:rgba(255,140,150,.1);color:#ffabb3;border:1px solid rgba(255,140,150,.25);padding:10px 14px;font-weight:750}
.small-btn{min-height:34px;font-size:12px;padding:7px 10px;border-radius:9px}
.square-btn{width:36px;height:36px;min-height:36px;display:grid;place-items:center;padding:0;font-size:18px}
.button-row{display:flex;flex-wrap:wrap;align-items:center;gap:9px}.button-row>*{flex:0 0 auto}
.full{width:100%}.topline{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.row{display:flex;align-items:center;gap:10px}
.tag{display:inline-block;padding:4px 9px;background:var(--panel-2);border:1px solid var(--edge);border-radius:99px;color:var(--muted);font-size:11px;font-weight:700}
.tag.green{background:var(--green-dim);color:var(--green);border-color:rgba(83,227,184,.21)}
.notice{border:1px solid var(--edge);border-radius:14px;padding:14px;background:#132337;color:var(--muted);font-size:13px;margin:14px 0}
.notice strong{color:var(--text)}
.resume-card{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:17px;border:1px solid rgba(83,227,184,.34);background:var(--green-dim);border-radius:16px;margin-bottom:20px}
.stepbar{background:#2b3a49;height:8px;border-radius:99px;overflow:hidden;margin-top:12px}.stepbar i{background:var(--green);height:100%;display:block;border-radius:99px;transition:width .2s}
.workout-header{padding:18px;background:linear-gradient(110deg,#182638,#152235);border:1px solid var(--edge);border-radius:19px;margin-bottom:14px}
.workout-header h1{margin-bottom:3px}
.exercise-card{background:var(--panel);border:1px solid var(--edge);border-radius:18px;margin:13px 0;overflow:hidden}
.exercise-card.completed{border-color:rgba(83,227,184,.38)}
.exercise-head{display:flex;align-items:flex-start;gap:8px;padding:16px 15px 9px}
.exercise-index{min-width:26px;height:26px;display:grid;place-items:center;background:var(--panel-2);border-radius:8px;color:var(--muted);font-size:12px;font-weight:800}
.exercise-title{flex:1;min-width:0}.exercise-title h3{line-height:1.3;margin-bottom:4px}
.prev-row{font-size:12px;color:var(--muted);margin:4px 15px 14px 50px}.prev-row strong{color:#bcdad3}
.exercise-actions{display:flex;gap:3px;align-items:center}
.exercise-actions .square-btn{width:31px;height:31px;min-height:31px;font-size:16px}
.set-table{padding:0 12px 12px}
.set-grid{display:grid;grid-template-columns:31px minmax(0,1fr) minmax(0,1fr) 44px 28px;gap:7px;align-items:center;margin:6px 0}
.set-label{font-size:10px;letter-spacing:.06em;font-weight:850;color:var(--muted);text-align:center}.set-num{font-size:13px;color:var(--muted);font-weight:900;text-align:center}
.num-input,.text-input,.select-input,.notes-input{min-width:0;width:100%;border:1px solid #3a4b62;background:#101a2b;color:var(--text);border-radius:10px;padding:10px 9px;outline:0}
.num-input{height:44px;text-align:center;font-weight:800;font-size:16px;font-variant-numeric:tabular-nums}
.num-input:focus,.text-input:focus,.select-input:focus,.notes-input:focus{border-color:var(--green);box-shadow:0 0 0 2px rgba(83,227,184,.12)}
.num-input:disabled{opacity:.7}.completed-set .num-input{color:#b4cabc;background:#132921;border-color:#2b5d4e}
.check-set{min-width:0;width:44px;height:44px;min-height:44px;background:var(--panel-2);border:1px solid #45556a;border-radius:11px;color:var(--muted);font-size:23px;font-weight:800}
.check-set.on{background:var(--green);color:#072821;border-color:var(--green)}
.delete-set{border:0;color:#8595aa;background:transparent;min-height:40px;width:28px;padding:0;font-size:18px}
.exercise-bottom{padding:0 15px 15px;display:flex;flex-direction:column;gap:12px}
.notes-input{resize:vertical;min-height:41px;font-size:13px;padding:10px}
.stack{display:flex;flex-direction:column;gap:10px}
.list-item{display:flex;align-items:center;gap:10px;padding:12px 13px;background:var(--panel);border:1px solid var(--edge);border-radius:12px}
.list-item .text{flex:1;min-width:0;font-size:13px;font-weight:700}.list-item .sub{display:block;font-size:11px;font-weight:400;color:var(--muted);margin-top:3px}
.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:13px 0 22px}.stat{background:var(--panel);border:1px solid var(--edge);padding:12px;border-radius:14px}.stat strong{font-size:22px;font-weight:850;line-height:1.2;display:block}.stat span{color:var(--muted);font-size:11px}
.record-row{border:1px solid var(--edge);border-radius:13px;background:var(--panel);padding:14px;margin:9px 0;display:flex;justify-content:space-between;align-items:center;gap:10px}.record-row strong{display:block}.record-row .muted{font-size:12px;margin-top:4px}
.trend{display:flex;align-items:end;gap:7px;height:95px;margin:17px 0 6px;padding:0 4px;border-bottom:1px solid var(--edge)}.trend-col{flex:1;display:flex;align-items:center;justify-content:end;flex-direction:column;gap:5px;min-width:0}.trend-bar{background:var(--green);width:75%;border-radius:6px 6px 0 0;min-height:3px}.trend-value{font-size:10px;color:var(--muted)}
.modal-backdrop{position:fixed;inset:0;z-index:40;background:rgba(3,7,14,.72);display:flex;align-items:flex-end;justify-content:center}
.modal-card{width:100%;max-width:590px;max-height:90dvh;overflow:hidden;background:#192337;border:1px solid #354860;border-radius:20px 20px 0 0;display:flex;flex-direction:column;box-shadow:0 -12px 40px rgba(0,0,0,.35)}
.modal-top{display:flex;justify-content:space-between;align-items:center;padding:16px 18px;border-bottom:1px solid var(--edge)}.modal-body{padding:16px 18px;overflow:auto;overscroll-behavior:contain}.modal-body .stack{gap:8px}
.field-label{display:block;font-weight:750;font-size:12px;margin:12px 0 5px}
.floating{position:sticky;bottom:calc(74px + env(safe-area-inset-bottom));background:var(--bg);border-top:1px solid var(--edge);padding:12px 15px calc(12px + env(safe-area-inset-bottom));margin:22px -18px 0;z-index:10;display:flex;gap:10px}.floating>*{flex:1}
.toast{position:fixed;z-index:70;left:50%;bottom:calc(84px + env(safe-area-inset-bottom));transform:translate(-50%,15px);padding:11px 17px;border-radius:14px;background:#294c45;color:#e7fff4;font-size:13px;font-weight:750;pointer-events:none;opacity:0;transition:all .16s;max-width:calc(100vw - 35px);text-align:center}.toast.show{opacity:1;transform:translate(-50%,0)}
.empty{text-align:center;padding:35px 18px;background:var(--panel);border:1px dashed var(--edge);border-radius:17px;color:var(--muted)}.empty .symbol{font-size:37px;color:var(--green);display:block;margin-bottom:8px}
.loading{display:grid;place-items:center;gap:13px;min-height:35vh;color:var(--muted)}.spinner{height:29px;width:29px;border:3px solid var(--edge);border-top-color:var(--green);border-radius:50%;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
hr{border:0;border-top:1px solid var(--edge);margin:19px 0}
@media(min-width:740px){.main{padding-top:32px}.cards{grid-template-columns:repeat(3,minmax(0,1fr))}.bottom-nav{max-width:590px;left:50%;transform:translateX(-50%);bottom:13px;border:1px solid var(--edge);border-radius:18px;padding:7px;background:#101b2e}.modal-backdrop{align-items:center}.modal-card{border-radius:21px;max-height:85vh}.set-grid{grid-template-columns:40px 1fr 1fr 48px 35px}.exercise-card{margin:15px 0}.floating{margin:22px -18px 0}}
@media(max-width:380px){.header-inner{padding:11px 12px}.brand strong{font-size:17px}.main{padding:18px 12px 110px}.exercise-head{padding:13px 11px 6px}.set-table{padding:0 8px 10px}.set-grid{gap:4px;grid-template-columns:24px minmax(0,1fr) minmax(0,1fr) 39px 24px}.check-set{width:39px;height:41px;min-height:41px}.num-input{height:41px;padding:8px 3px}.exercise-bottom{padding:0 11px 12px}.prev-row{margin:4px 10px 12px 43px}}

[hidden]{display:none!important}

/* v1.1: rest countdown sits under the header without covering workout controls. */
#rest-timer-host{position:sticky;top:68px;z-index:19;}
.rest-timer-wrap{max-width:900px;margin:0 auto;padding:7px 18px 0}
.rest-timer{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#1c3041;border:1px solid rgba(83,227,184,.45);border-radius:15px;padding:10px 12px;box-shadow:0 6px 24px rgba(0,0,0,.25)}
.rest-summary{display:flex;align-items:center;gap:13px;min-width:0}
.rest-kicker{display:block;max-width:72px;color:var(--green);font-size:10px;font-weight:850;letter-spacing:.07em;line-height:1.25}
.rest-time{font-weight:900;line-height:1;font-size:27px;letter-spacing:-.05em;font-variant-numeric:tabular-nums;color:var(--text)}
.rest-buttons{display:flex;align-items:center;gap:5px;flex-shrink:0}
.rest-buttons .small-btn{padding:7px 9px;min-height:33px}
.rest-finished{background:#173c35;border-color:var(--green)}
.rest-minutes-input{max-width:180px;font-size:17px;font-weight:800}
.rest-checkbox{display:flex;align-items:center;gap:11px;font-size:13px;font-weight:700;margin-top:18px;cursor:pointer}
.rest-checkbox input{accent-color:var(--green);width:20px;height:20px;flex:none}
@media(max-width:400px){#rest-timer-host{top:65px}.rest-timer-wrap{padding:5px 10px 0}.rest-timer{gap:7px;padding:9px}.rest-summary{gap:6px}.rest-time{font-size:24px}.rest-kicker{font-size:9px;max-width:58px}.rest-buttons{gap:3px}.rest-buttons .small-btn{padding:6px 7px;font-size:11px}}

/* v1.2: searchable exercise catalog category filters */
.filter-row{display:flex;gap:7px;overflow-x:auto;padding:10px 0 7px;scrollbar-width:thin;scrollbar-color:var(--edge) transparent;-webkit-overflow-scrolling:touch}
.filter-chip{flex:0 0 auto;min-height:36px;background:var(--panel-2);border:1px solid var(--edge);padding:7px 12px;color:var(--muted);font-weight:750;font-size:12px;border-radius:99px;white-space:nowrap}
.filter-chip.selected{background:var(--green-dim);border-color:rgba(83,227,184,.42);color:var(--green)}
.filter-chip:focus-visible{outline:2px solid var(--green);outline-offset:2px}
#picker-count{margin:2px 0 8px}
#picker-list .list-item{gap:8px}
#picker-list .list-item .text{overflow-wrap:anywhere}
/* v1.4 Google Drive backup controls */
.drive-backup-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 0;border-top:1px solid var(--edge);font-size:12px}
.drive-backup-row>div{min-width:0;overflow-wrap:anywhere}
.drive-backup-row strong{display:block;font-size:12px}
.drive-backup-row .sub{display:block;margin-top:4px;color:var(--muted);font-size:11px}
.drive-backup-row button{flex:none}
.drive-origin{overflow-wrap:anywhere;font-family:ui-monospace,SFMono-Regular,monospace}
#drive-settings-panel .button-row{gap:7px}
#drive-settings-panel button{font-size:12px}

/* v1.5 favorites: accessible, touch-friendly star buttons in library and picker */
.favorite-btn{flex:none;width:42px;min-width:42px;min-height:42px;padding:0;border:1px solid var(--edge);background:var(--panel-2);border-radius:11px;color:#9daec4;font-size:24px;line-height:1}
.favorite-btn.is-favorite{color:#ffd06b;border-color:rgba(255,208,107,.45);background:rgba(255,208,107,.1)}
.favorite-btn:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.filter-chip[data-category="favorites"].selected{color:#ffd06b;border-color:rgba(255,208,107,.45);background:rgba(255,208,107,.1)}
@media(max-width:380px){.library-row,.picker-row{padding:9px 8px;gap:6px}.favorite-btn{width:40px;min-width:40px;min-height:40px}}

/* v1.6: mobile-first warm-up tagging, big complete buttons, rep progression */
.set-grid{grid-template-columns:58px minmax(0,1fr) minmax(0,1fr) 76px 22px;gap:6px}
.set-type-cell{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0}
.set-type-button{border:1px solid rgba(83,227,184,.36);background:#1a3833;color:#a9f1da;border-radius:7px;min-height:23px;width:100%;padding:2px 1px;font-size:10px;font-weight:800;line-height:1.1}
.set-type-button.is-warmup{background:#2c303f;border-color:#586078;color:#c5cae1}
.warmup-set .num-input{border-color:#444a60}
.check-set{width:100%;min-width:0;height:46px;min-height:46px;font-size:11px;padding:4px 3px;letter-spacing:-.01em}
.delete-set{width:22px}
.progression-meta{margin:0 14px 12px 50px;font-size:12px;color:var(--muted)}
.progression-meta strong{color:#e9f8fa}
.progression-settings{margin-top:6px}
.progression-settings summary{color:var(--green);cursor:pointer;font-size:12px;font-weight:750;display:inline-block;list-style:revert}
.progression-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:10px 0}
.progression-fields label{font-size:11px;font-weight:700;color:var(--muted)}
.progression-fields input{display:block;width:100%;min-width:0;margin-top:5px;padding:9px 5px;border:1px solid var(--edge);background:#101a2b;color:var(--text);border-radius:8px;font-size:15px}
.progression-callout{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 12px 12px;padding:11px;border:1px solid rgba(83,227,184,.35);border-radius:12px;background:#16332e}
.progression-callout>div{min-width:0}
.progression-callout strong{display:block;color:#a9f1da;font-size:12px}
.progression-callout span{display:block;margin-top:4px;color:#cde9de;font-size:11px}
.progression-callout button{white-space:nowrap;flex:none;font-size:11px;padding:8px;min-height:38px}
.progression-earned{color:#a9f1da;font-size:12px;margin:6px 14px 14px}
@media(max-width:380px){.set-grid{grid-template-columns:52px minmax(0,1fr) minmax(0,1fr) 70px 20px;gap:4px}.check-set{font-size:10px}.set-type-button{font-size:9px}.progression-meta{margin-left:12px}.progression-callout{flex-wrap:wrap}}
