*{box-sizing:border-box}html{color-scheme:light;scroll-behavior:smooth}html[data-theme=dark]{color-scheme:dark} :root{--bg:#f7f7f4;--panel:#fff;--ink:#222321;--muted:#686b64;--line:#dcded6;--soft:#edeee8;--positive:#257148;--negative:#b03e32;--shadow:0 10px 50px #0000000a}html[data-theme=dark]{--bg:#181a18;--panel:#202320;--ink:#f0f1ea;--muted:#a5aa9f;--line:#3c4239;--soft:#2a2e28;--positive:#8dd8a8;--negative:#ff9990;--shadow:0 10px 50px #0003}body{margin:0;background:var(--bg);color:var(--ink);font-family:Arial,Helvetica,sans-serif;font-size:15.4px;line-height:1.5;-webkit-font-smoothing:antialiased}button,input,select,textarea{font:inherit;color:inherit;border-radius:0}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;background:transparent;border:0}button:disabled{opacity:.45;cursor:not-allowed}a{color:inherit;text-decoration:none}button,input,select,textarea,a{touch-action:manipulation}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid var(--ink);outline-offset:4px}button{transition:background .18s ease,color .18s ease,transform .18s ease}button:active:not(:disabled){transform:translateY(1px)}svg{width:20px;height:20px;flex-shrink:0;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:square;stroke-linejoin:miter}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.skip-link{position:fixed;top:-80px;left:16px;z-index:99;background:var(--ink);color:var(--bg);padding:14px}.skip-link:focus{top:12px}.topbar{position:sticky;top:0;z-index:10;background:var(--bg);border-bottom:1px solid var(--line);padding-top:env(safe-area-inset-top)}.top-inner{max-width:1240px;margin:auto;min-height:94px;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;padding:0 48px;gap:20px}.brand{display:flex;align-items:center;gap:13px;font-size:18.7px;font-weight:800;line-height:1.05;letter-spacing:-.6px}.brand-dot{color:#cd641a}.top-caption{font-size:11px;letter-spacing:1.6px;color:var(--muted)}.profile{display:flex;align-items:center;gap:18px}.profile-caption{font-size:9.9px;letter-spacing:1.7px;color:var(--muted)}.person-control{display:flex;gap:10px;align-items:center}.avatar{width:34px;height:34px;display:grid;place-items:center;background:var(--soft);font-weight:700;font-size:13.2px}main{max-width:1144px;margin:auto;padding:44px 0 150px;outline:none}.page{animation:enter .3s ease both}@keyframes enter{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:translateY(0)}}.eyebrow{display:flex;align-items:center;gap:10px;font-size:11px;letter-spacing:1.9px;text-transform:uppercase;font-weight:600;color:var(--muted);margin:0 0 15px}.eyebrow .line{height:1px;width:25px;background:var(--muted)}h1{font-size:57.2px;line-height:1.08;letter-spacing:-2.4px;font-weight:500;margin:0 0 16px}h2{font-size:24.2px;letter-spacing:-.65px;font-weight:500;margin:0}h3{font-size:18.7px;letter-spacing:-.3px;margin:0;font-weight:600}p{margin:0}.subtitle{color:var(--muted);font-size:15.4px}.page-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:25px;margin-bottom:36px}.btn{min-height:46px;padding:11px 18px;border:1px solid var(--line);display:inline-flex;align-items:center;justify-content:center;gap:10px;font-weight:600;font-size:13.2px;background:var(--panel)}.btn:hover{background:var(--soft)}.btn.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}.btn.primary:hover{opacity:.85}.btn.small{min-height:38px;padding:8px 12px}.btn.text{border:0;background:transparent;padding-left:0;color:var(--muted);font-weight:400}.btn.danger{color:var(--negative)}.icon-btn{width:44px;height:44px;display:inline-grid;place-items:center;border:1px solid transparent}.icon-btn:hover{background:var(--soft)}.stats{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:25px 0;margin-bottom:42px}.stat{padding:0 30px;border-left:1px solid var(--line)}.stat:first-child{padding-left:0;border:0}.stat-label{font-size:11px;letter-spacing:1.5px;text-transform:uppercase;color:var(--muted);margin-bottom:6px}.stat-value{font-size:35.2px;line-height:1.2;letter-spacing:-1px;font-variant-numeric:tabular-nums}.stat-unit{font-size:14.3px;letter-spacing:0;color:var(--muted);margin-left:7px}.stat-note{font-size:12.1px;color:var(--muted);margin-top:7px}.home-grid{display:grid;grid-template-columns:minmax(0,1fr) 255px;gap:46px}.section-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;gap:15px}.subtle{font-size:12.1px;color:var(--muted)}.date-label{font-size:13.2px;color:var(--muted);display:flex;align-items:center;gap:8px}.exercise-list{border-top:1px solid var(--line)}.exercise{border-bottom:1px solid var(--line);animation:enter .28s ease both}.exercise-head{display:grid;grid-template-columns:38px minmax(0,1fr) auto 25px;align-items:center;gap:14px;min-height:100px;list-style:none;cursor:pointer;padding:15px 0}.exercise-head::-webkit-details-marker{display:none}.exercise-num{font-size:12.1px;color:var(--muted);font-variant-numeric:tabular-nums;align-self:start;padding-top:7px}.exercise-name{font-size:17.6px;font-weight:600;letter-spacing:-.3px;margin-bottom:5px}.exercise-meta{font-size:12.1px;color:var(--muted)}.exercise-weight{font-size:27.5px;letter-spacing:-.9px;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.exercise-weight small{font-size:13.2px;letter-spacing:0;color:var(--muted)}.weight-caption{font-size:11px;color:var(--muted);text-align:right;margin-top:2px}.chevron{width:16px;height:16px;color:var(--muted);transition:transform .2s}details[open] .chevron{transform:rotate(180deg)}.exercise-detail{padding:0 0 24px 52px;animation:enter .2s ease}.set-table{width:100%;border-collapse:collapse;font-size:13.2px;font-variant-numeric:tabular-nums}.set-table th{font-size:9.9px;letter-spacing:1px;color:var(--muted);font-weight:400;text-transform:uppercase;text-align:left;padding:10px 8px;border-bottom:1px solid var(--line)}.set-table td{padding:11px 8px;border-bottom:1px solid var(--line)}.set-table td:first-child{color:var(--muted);width:60px}.delta{font-size:11px;display:inline-block;margin-left:8px;color:var(--muted);white-space:nowrap}.delta.up{color:var(--positive)}.delta.down{color:var(--negative)}.comparison-note{font-size:12.1px;color:var(--muted);margin-top:13px}.detail-actions{display:flex;gap:16px;margin-top:12px;flex-wrap:wrap}.side-panel{border-top:1px solid var(--line);padding-top:23px}.side-label{font-size:9.9px;color:var(--muted);letter-spacing:1.6px;text-transform:uppercase;margin-bottom:20px}.session-date{font-size:22px;letter-spacing:-.7px;margin-bottom:4px}.week-strip{display:flex;gap:5px;margin:22px 0 25px;justify-content:space-between}.day{display:flex;flex-direction:column;align-items:center;gap:9px;font-size:9.9px;color:var(--muted)}.day span{display:grid;place-items:center;width:29px;height:32px;font-size:12.1px}.day.active span{background:var(--ink);color:var(--bg)}.side-note{padding:22px 0;border-top:1px solid var(--line);font-size:13.2px;line-height:1.7;color:var(--muted)}.side-note strong{display:block;font-size:14.3px;margin-bottom:7px;color:var(--ink);font-weight:500}.side-bottom{margin-top:20px;display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted)}.mini-dot{width:5px;height:5px;background:var(--muted);display:inline-block}.page-foot{display:flex;justify-content:space-between;gap:20px;margin-top:30px;padding-top:18px;color:var(--muted);font-size:11px;letter-spacing:.3px}.filter-tags{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:-12px 0 28px}.tag{display:flex;align-items:center;gap:8px;font-size:12.1px;border:1px solid var(--line);padding:8px 12px}.empty{padding:50px 25px;border-top:1px solid var(--line);text-align:center}.empty svg{width:30px;height:30px;color:var(--muted);margin-bottom:15px}.empty p{color:var(--muted);margin:10px auto 22px;max-width:360px}.filter-layout,.settings-layout{display:grid;grid-template-columns:minmax(0,650px) 1fr;gap:70px}.form-section{border-top:1px solid var(--line);padding:25px 0}.form-section h3{margin-bottom:18px}.field{display:flex;flex-direction:column;gap:8px;margin-bottom:20px;min-width:0}.field>span,.field>label{font-size:12.1px;color:var(--muted)}input,select,textarea{min-height:46px;background:var(--panel);border:1px solid var(--line);padding:11px 12px;min-width:0;max-width:100%}textarea{resize:vertical;min-height:80px}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.segmented{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 18px}.segmented button{min-height:42px;border:1px solid var(--line);padding:9px 15px;font-size:13.2px}.segmented button.selected{background:var(--ink);color:var(--bg);border-color:var(--ink)}.filter-help{border-top:1px solid var(--line);padding-top:26px;color:var(--muted);font-size:13.2px;line-height:1.8}.filter-help strong{color:var(--ink);display:block;margin-bottom:12px;font-weight:500;font-size:18.7px}.setting-row{display:flex;justify-content:space-between;gap:22px;align-items:center;padding:25px 0;border-top:1px solid var(--line)}.setting-row p{font-size:13.2px;color:var(--muted);margin-top:7px;max-width:370px}.setting-row h3{font-size:16.5px}.setting-stack{padding:25px 0;border-top:1px solid var(--line)}.setting-stack p{color:var(--muted);font-size:13.2px;margin-top:10px}.chart-controls{display:flex;gap:16px;justify-content:space-between;align-items:flex-end;flex-wrap:wrap;padding:24px 0;border-top:1px solid var(--line)}.chart-controls .field{min-width:200px;margin:0}.chart-metrics{display:flex;gap:6px}.chart-metrics button{min-height:42px;padding:10px 15px;font-size:12.1px;border:1px solid var(--line)}.chart-metrics button.selected{background:var(--ink);color:var(--bg)}.chart{width:100%;height:auto;overflow:visible;stroke:none}.chart text{fill:var(--muted);font-family:Arial,sans-serif;font-size:12.1px;stroke:none}.chart .grid{stroke:var(--line);stroke-width:1}.chart .plot{stroke:var(--ink);stroke-width:2;fill:none}.chart .point{fill:var(--ink);stroke:var(--bg);stroke-width:3}.chart-wrap{padding:15px 0 0}.chart-values{border-top:1px solid var(--line);margin-top:20px}.chart-values summary{cursor:pointer;padding:16px 0;font-size:13.2px;color:var(--muted)}.chart-values table{width:100%;max-width:600px;border-collapse:collapse;font-size:13.2px;margin-bottom:20px}.chart-values th,.chart-values td{text-align:left;padding:12px 8px;border-bottom:1px solid var(--line)}.chart-note{font-size:13.2px;color:var(--muted);margin:18px 0}.history-day{margin-top:28px}.history-day:first-child{margin-top:0}dialog{padding:0;border:1px solid var(--line);background:var(--bg);color:var(--ink);max-width:calc(100% - 32px);width:620px;max-height:calc(100dvh - 50px);box-shadow:0 24px 100px #0002}dialog[open]{animation:enter .22s ease}dialog::backdrop{background:#13181365;backdrop-filter:blur(3px)}body:has(dialog[open]){overflow:hidden}.dialog-header{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:24px 28px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--bg);z-index:3}.dialog-header h2{font-size:26.4px}.dialog-body{padding:24px 28px}.dialog-header .eyebrow{font-size:9.9px;margin:0 0 8px}.dialog-footer{border-top:1px solid var(--line);padding:18px 28px;position:sticky;bottom:0;background:var(--bg);display:flex;justify-content:space-between;align-items:center;gap:10px;z-index:2}.dialog-footer .btn{min-width:130px}.series-header,.series-row{display:grid;grid-template-columns:28px 1fr 1fr 38px;gap:10px;align-items:center}.series-header{color:var(--muted);font-size:9.9px;letter-spacing:.9px;margin:14px 0 8px}.series-row{margin-bottom:10px}.series-row input{width:100%}.series-row .icon-btn{width:38px}.series-index{color:var(--muted);font-size:12.1px}.form-note{font-size:12.1px;color:var(--muted);padding:13px 0;line-height:1.7}.form-error{color:var(--negative);font-size:13.2px;margin-bottom:15px}.exercise-results{max-height:205px;overflow:auto;border:1px solid var(--line);margin-top:-13px;margin-bottom:18px;background:var(--panel)}.exercise-option{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:left;padding:12px;font-size:13.2px;min-height:45px;border-bottom:1px solid var(--line)}.exercise-option:hover{background:var(--soft)}.exercise-option small{font-size:11px;color:var(--muted)}.selected-exercise{display:flex;justify-content:space-between;align-items:center;padding:13px 0;margin-bottom:15px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);gap:15px}.selected-exercise strong{display:block;font-size:15.4px}.selected-exercise span{font-size:12.1px;color:var(--muted)}#toast{position:fixed;left:50%;bottom:115px;transform:translate(-50%,8px);background:var(--ink);color:var(--bg);padding:13px 22px;font-size:13.2px;z-index:50;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;max-width:calc(100% - 32px);text-align:center}#toast.visible{opacity:1;transform:translate(-50%,0)}#confirm{width:440px}.loading{color:var(--muted);padding:80px 0;text-align:center}.warning-line{font-size:12.1px;color:var(--muted);margin-top:12px}.range-info{font-size:11px;color:var(--muted);margin:12px 0}.form-section .field:last-child{margin-bottom:0}.choice-info{font-size:12.1px;color:var(--muted)}
@media(min-width:1500px){main{padding-top:60px}.top-inner{max-width:1240px}.page-heading{margin-bottom:42px}}
@media(max-width:1240px){main{margin:0 48px}.top-inner{padding:0 48px}}
@media(max-width:850px){.top-caption{display:none}.home-grid{grid-template-columns:minmax(0,1fr) 205px;gap:28px}.profile-caption{display:none}h1{font-size:47.3px}.filter-layout,.settings-layout{grid-template-columns:1fr;gap:30px}.filter-help{max-width:550px}}
@media(max-width:650px){.top-inner{min-height:78px;padding:0 22px}.brand{font-size:16.5px;gap:10px}.brand img{width:34px;height:34px}.person-control{gap:6px}.avatar{width:29px;height:29px}main{margin:0 22px;padding-top:31px;padding-bottom:135px}h1{font-size:42.9px;letter-spacing:-1.8px}.eyebrow{font-size:9.9px;margin-bottom:12px}.page-heading{align-items:flex-start;margin-bottom:27px;gap:12px}.page-heading>.btn{padding:10px;min-width:44px}.page-heading>.btn .desktop{display:none}.subtitle{font-size:13.2px;max-width:250px;line-height:1.7}.stats{padding:21px 0;margin-bottom:28px}.stat{padding:0 17px}.stat-value{font-size:28.6px}.stat-unit{font-size:11px;display:block;margin:4px 0 0;line-height:1}.stat-label{font-size:8.8px;letter-spacing:.8px;margin-bottom:10px}.stat-note{font-size:9.9px;margin-top:8px}.home-grid{grid-template-columns:1fr;gap:30px}.side-panel{display:grid;grid-template-columns:1fr 1fr;gap:0 25px}.side-label{grid-column:1/-1}.side-note{border:0;padding:0;font-size:12.1px}.side-bottom{grid-column:1/-1}.week-strip{margin:16px 0}.section-top{margin-bottom:18px}h2{font-size:23.1px}.date-label{font-size:11px}.exercise-head{grid-template-columns:23px minmax(0,1fr) auto 14px;gap:10px;min-height:93px}.exercise-num{font-size:11px}.exercise-name{font-size:15.4px;line-height:1.4;letter-spacing:-.15px}.exercise-meta{font-size:11px;line-height:1.6}.exercise-weight{font-size:25.3px}.exercise-weight small{font-size:11px}.weight-caption{font-size:9.9px}.exercise-detail{padding-left:0}.set-table td,.set-table th{padding-left:5px;padding-right:5px}.set-table td:first-child{width:45px}.delta{display:block;margin:3px 0 0}.page-foot{font-size:9.9px;line-height:1.8}.page-foot span:last-child{display:none}.dialog-header{padding:20px}.dialog-body{padding:20px}.dialog-footer{padding:15px 20px}.dialog-header h2{font-size:24.2px}dialog{max-width:100%;width:100%;max-height:calc(100dvh - 20px);margin:auto auto 0;border-bottom:0}.field-grid{gap:12px}.series-header,.series-row{grid-template-columns:22px 1fr 1fr 32px;gap:8px}.setting-row{gap:15px}.setting-row .btn{max-width:130px;font-size:12.1px}.setting-row p{font-size:12.1px}.chart-controls{gap:20px}.chart-controls .field{min-width:0;width:100%}.chart-metrics{width:100%}.chart-metrics button{flex:1}.chart{min-height:230px}.stat-label{white-space:nowrap}#toast{bottom:calc(90px + env(safe-area-inset-bottom))}.chart text{font-size:14.3px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.chart-metrics button,.segmented button{display:inline-flex;align-items:center;justify-content:center;gap:8px}

@media(max-width:650px){.btn.small,.segmented button,.chart-metrics button{min-height:44px}.series-header,.series-row{grid-template-columns:22px 1fr 1fr 44px}.series-row .icon-btn{width:44px}}
.home-grid>section,.home-grid>aside{min-width:0}
@media(max-width:650px){.home-grid,.side-panel{grid-template-columns:minmax(0,1fr)}.week-strip{max-width:320px}.side-note{border-top:1px solid var(--line);padding-top:18px}.exercise-head{grid-template-columns:23px minmax(0,1fr) auto 16px}.set-table{table-layout:fixed}.set-table th:first-child{width:45px}.set-table td,.set-table th{overflow-wrap:anywhere}.set-table .delta{white-space:normal}}
.stats{grid-template-columns:repeat(3,minmax(0,1fr))}.stat{min-width:0}
@media(max-width:650px){.stat{padding:0 12px}.stat-label{white-space:normal}}
@media(max-width:360px){.stat-label{min-height:24px}.stat-note{overflow-wrap:anywhere}}

/* Floating SCM navigation; approved exception to the square interface. */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 15;
  display: grid;
  grid-template-columns: 44px 44px 54px 44px 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: var(--ink);
}
.nav-item:hover, .nav-item.active { background: var(--soft); }
.nav-item svg { width: 22px; height: 22px; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item > span:not(.nav-badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-add {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 5px;
  background: #050505;
  color: #fff;
  box-shadow: 0 7px 15px rgba(0, 0, 0, .13);
}
.nav-add svg { width: 28px; height: 28px; stroke-width: 2; stroke-linecap: round; }
.nav-add:hover { background: #292929; }
.nav-badge { position: absolute; top: 0; right: -1px; min-width: 15px; padding: 1px 3px; border-radius: 20px; background: var(--ink); color: var(--bg); font-size: 9.9px; text-align: center; }
html[data-theme=dark] .bottom-nav { background: rgba(32, 35, 32, .94); border-color: var(--line); box-shadow: 0 10px 28px rgba(0, 0, 0, .4); }
html[data-theme=dark] .nav-add { border: 1px solid #53594f; }
#toast { bottom: calc(108px + env(safe-area-inset-bottom)); }
main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }

/* Centered profile capsule, matching the floating navigation. */
.top-inner .brand { grid-column: 1; grid-row: 1; justify-self: start; }
.top-caption { grid-column: 3; grid-row: 1; justify-self: end; text-align: right; max-width: 240px; }
.profile { grid-column: 2; grid-row: 1; justify-self: center; }
.profile-caption { display: none; }
.person-control {
  padding: 5px 12px 5px 7px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .08);
  transition: box-shadow .18s ease;
}
.person-control:focus-within { box-shadow: 0 0 0 2px var(--ink), 0 5px 18px rgba(0, 0, 0, .08); }


.person-control .avatar { border-radius: 50%; }
html[data-theme=dark] .person-control { background: rgba(32, 35, 32, .94); border-color: var(--line); }
@media(max-width:650px) {
  .top-inner { gap: 10px; }
  .brand > span { display: none; }
}

/* The menu emerges from behind the capsule, with shared width and radius. */
.profile { position: relative; isolation: isolate; width: min(240px, calc(100vw - 132px)); --profile-radius: 28px; }
.person-control {
  position: relative; z-index: 2; width: 100%; height: 56px;
  border-radius: var(--profile-radius); background: var(--panel);
  gap: 10px; font-size: 15.4px; font-weight: 700; text-align: left;
}
.person-control:active:not(:disabled) { transform: none; }
.person-control:focus-within { box-shadow: 0 5px 18px rgba(0,0,0,.08); }
.person-control:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.person-menu {
  position: absolute; z-index: 1; top: 28px; left: 0; width: 100%;
  padding: 35px 7px 12px; background: var(--panel);
  border: 1px solid rgba(0,0,0,.08); border-top: 0;
  border-radius: 0 0 var(--profile-radius) var(--profile-radius);
  box-shadow: 0 12px 24px rgba(0,0,0,.12);
  animation: profile-open .2s ease both;
}
.person-menu[hidden] { display: none; }
.person-menu button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 44px; padding: 10px 14px;
  border-radius: 21px; text-align: left; font-size: 15.4px;
}
.person-menu button:hover, .person-menu button:focus-visible { background: var(--soft); }
.person-menu button:focus-visible { outline-offset: -2px; }
.person-menu button[aria-checked=true] { font-weight: 700; }
.person-menu button svg { width: 15px; height: 15px; visibility: hidden; }
.person-menu button[aria-checked=true] svg { visibility: visible; }
html[data-theme=dark] .person-control, html[data-theme=dark] .person-menu { background: var(--panel); border-color: var(--line); }
@keyframes profile-open { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* Brand primary and profile actions. */
:root { --primary: #38224f; --primary-hover: #493064; --on-primary: #fff; }
.btn.primary, .nav-add { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover, .nav-add:hover { background: var(--primary-hover); opacity: 1; }
.person-control { padding-left: 7px; padding-right: 12px; }
#person-name { min-width:0; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.person-menu { padding: 35px 0 0; border: 0; }
.person-options { padding: 0 7px 8px; max-height: min(320px, calc(100dvh - 200px)); overflow-y: auto; overscroll-behavior: contain; }
.person-options button span { min-width: 0; overflow-wrap: anywhere; }
.person-menu .person-add {
  width: 100%; min-height: 56px; margin: 0; padding: 14px 20px;
  border-radius: var(--profile-radius); justify-content: center; gap: 9px;
  background: var(--primary); color: var(--on-primary); font-weight: 600;
}
.person-menu .person-add:hover, .person-menu .person-add:focus-visible { background: var(--primary-hover); }
.person-menu .person-add:focus-visible { outline-color: var(--on-primary); outline-offset: -5px; }
.person-menu .person-add:active { transform: none; }
.person-menu .person-add svg { visibility: visible; width: 18px; height: 18px; stroke-linecap: round; }
#person-editor { width: 420px; }

/* Shared dropdowns: the same capsule, floating sheet and radii as the profile. */
.select-field { width: 100%; min-width: 0; }
.select-control, .select-cap {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 56px; padding: 0 40px; border: 1px solid rgba(0,0,0,.08);
  border-radius: 28px; background: var(--panel); color: var(--ink);
  box-shadow: 0 5px 18px rgba(0,0,0,.08); font-size: 15.4px; font-weight: 600;
}
.select-control:active:not(:disabled) { transform: none; }
.select-value { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.select-control > svg, .select-cap > svg { position: absolute; right: 17px; width: 15px; height: 15px; transition: transform .2s; }
.select-control[aria-expanded=true] > svg, .select-cap > svg { transform: rotate(180deg); }
.select-popover { position: fixed; z-index: 60; border-radius: 28px; background: var(--panel); color: var(--ink); box-shadow: 0 12px 24px rgba(0,0,0,.12); }
.select-cap { z-index: 2; cursor: pointer; }
.select-options { padding: 7px 7px 12px; overflow-y: auto; overscroll-behavior: contain; border-radius: 0 0 28px 28px; animation: profile-open .2s ease both; }
.select-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; min-height: 44px; border-radius: 21px; font-size: 15.4px; cursor: pointer; text-align: left; }
.select-option > span { min-width: 0; overflow-wrap: anywhere; }
.select-option > svg { visibility: hidden; width: 15px; height: 15px; }
.select-option[aria-selected=true] { font-weight: 700; }
.select-option[aria-selected=true] > svg { visibility: visible; }
.select-option:hover, .select-option.is-focused { background: var(--soft); }
.select-empty { padding: 15px; color: var(--muted); font-size: 13.2px; }
.select-popover.opens-up { display: flex; flex-direction: column-reverse; }
.select-popover.opens-up .select-options { border-radius: 28px 28px 0 0; padding-top: 12px; padding-bottom: 7px; }
html[data-theme=dark] .select-control, html[data-theme=dark] .select-cap { border-color: var(--line); }

/* Selected workout, monthly calendar and more readable exercise rows. */
:root { --primary-text: #38224f; }
html[data-theme=dark] { --primary-text: #d9bdf1; }
.top-inner { grid-template-columns: 1fr auto 1fr; }
.profile { width: min(240px, calc(100vw - 44px)); }
.workout-highlights { margin-bottom: 12px; }
main[data-page=home] .exercise-list { border-top: 0; }
.workout-highlights .stat-value { font-size: clamp(27.5px,3.3vw,37.4px); color: var(--primary-text); white-space: nowrap; }
.workout-highlights .stat-unit { display: block; margin: 5px 0 0; font-size: 13.2px; }
.workout-highlights .stat-label { min-height: 30px; }
.workout-highlights .stat-note { font-size: 13.2px; line-height: 1.5; }
.session-heading { align-items: center; flex-wrap: wrap; gap: 16px; }
.training-date-field { display: block; width: 270px; max-width: 100%; }
.training-date-field .select-control, .training-date-field .select-cap { font-size: 18.7px; }
.home-grid { grid-template-columns: minmax(0,1fr) 300px; gap: 36px; }
.training-calendar { min-width: 0; }
.calendar-heading { display: grid; grid-template-columns: 32px minmax(0,1fr) 32px; gap: 2px; align-items: center; }
.calendar-heading .icon-btn { width: 32px; height: 44px; border-radius: 16px; }
.calendar-prev svg { transform: rotate(90deg); }
.calendar-next svg { transform: rotate(-90deg); }
.calendar-month-field { display: block; min-width: 0; }
.calendar-month-field .select-control { padding: 0 26px 0 10px; font-size: 15.4px; }
.calendar-month-field .select-control > svg { right: 10px; }
.calendar-count { color: var(--muted); font-size: 13.2px; margin: 14px 0 18px; }
.month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px 3px; }
.weekday { text-align: center; padding: 5px 0 10px; font-size: 12.1px; color: var(--muted); }
.calendar-day { position: relative; display: grid; place-items: center; min-height: 37px; padding: 0; font-size: 14.3px; border-radius: 50%; font-variant-numeric: tabular-nums; }
.calendar-day:disabled { color: var(--muted); opacity: .65; }
.calendar-day.has-training { color: var(--primary-text); background: var(--soft); font-weight: 700; }
.calendar-day.has-training::after { content: ''; position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.calendar-day.selected { background: var(--primary); color: #fff; }
.calendar-day[aria-current=date] { box-shadow: inset 0 0 0 1px var(--line); }
.calendar-legend { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12.1px; margin-top: 16px; }
.calendar-legend span { width: 5px; height: 5px; background: var(--primary-text); border-radius: 50%; }
.exercise-name { font-size: 19.8px; color: var(--primary-text); line-height: 1.45; }
.exercise-weight { font-size: 31.9px; color: var(--primary-text); }
.exercise-weight small { color: inherit; font-size: 15.4px; }
.exercise-meta { font-size: 14.3px; line-height: 1.65; }
.exercise-num, .weight-caption { font-size: 13.2px; }
.set-table { font-size: 15.4px; }
.set-table th { font-size: 12.1px; }
main[data-page=home] .set-table { table-layout: auto; }
main[data-page=home] .set-table td:not(:first-child) { white-space: nowrap; }
main[data-page=home] .set-table .delta[aria-label] { display: inline-block; margin: 0 0 0 8px; white-space: nowrap; }
.comparison-note, .exercise-detail .form-note, .exercise-detail .range-info { font-size: 13.2px; }
.exercise-detail .btn { font-size: 14.3px; }
.nav-item[data-page=settings] svg { stroke-width: 1.7; }
@media(max-width:950px) { .home-grid { grid-template-columns: minmax(0,1fr); } .side-panel { display: block; } .training-calendar { max-width: 360px; } .side-note { margin-top: 24px; } }
@media(max-width:650px) {
  .workout-highlights .stat-value { font-size: clamp(19.8px,4.73vw,29.7px); letter-spacing: -.6px; }
  .workout-highlights .stat-note { font-size: 12.1px; }
  .workout-highlights .stat-label { font-size: 9.9px; min-height: 30px; }
  .workout-highlights .stat { padding: 0 9px; }
  .workout-highlights .stat:first-child { padding-left: 0; }
  .workout-highlights .stat:last-child { padding-right: 0; }
  .session-heading h2 { font-size: 24.2px; }
  .training-date-field { width: 250px; }
  .training-date-field .select-control { font-size: 17.6px; }
  .exercise-head { grid-template-columns: 23px minmax(0,1fr) auto 16px; gap: 10px; min-height: 102px; }
  .exercise-name { font-size: 17.6px; }
  .exercise-meta { font-size: 13.2px; }
  .exercise-weight { font-size: 28.6px; }
  .exercise-weight small { font-size: 14.3px; }
  .weight-caption, .exercise-num { font-size: 12.1px; }
}
@media(max-width:400px) { .training-date-field { width: 100%; } .exercise-head { grid-template-columns: 18px minmax(0,1fr) auto 12px; gap: 7px; } .exercise-weight { font-size: 26.4px; } }

/* Floating profile with a protected top edge, without a full-width bar. */
.topbar {
  --header-gap: max(18px, env(safe-area-inset-top));
  background: transparent; border: 0; padding: 0;
  isolation: isolate; pointer-events: none;
}
.topbar::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: calc(var(--header-gap) + 10px);
  background: linear-gradient(to bottom, var(--bg) 0, var(--bg) var(--header-gap), transparent 100%);
  pointer-events: none;
}
.top-inner {
  position: relative; display: flex; justify-content: center;
  min-height: calc(var(--header-gap) + 74px);
  padding: var(--header-gap) 22px 18px;
}
.profile { pointer-events: auto; }
.person-control { box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.person-control:focus-within { box-shadow: 0 10px 28px rgba(0,0,0,.12); }
html[data-theme=dark] .person-control { box-shadow: 0 10px 28px rgba(0,0,0,.35); }

/* Compact diary layout and a full-width calendar with circular day buttons. */
main[data-page=home] { padding-top: 0; }
main[data-page=home] .filter-tags { margin-top: 0; }
.session-heading { justify-content: center; }
.training-calendar { width: 100%; max-width: none; }
.calendar-day {
  width: min(44px,100%); height: auto; min-height: 0; aspect-ratio: 1;
  justify-self: center; align-self: center; border-radius: 50%;
}
main[data-page=home], main[data-page=chart] { touch-action: pan-y; }
main.is-swiping, main.is-swiping * { user-select: none; -webkit-user-select: none; }

/* Direct manipulation: the current diary and adjacent diary follow one finger. */
body { overflow-x: clip; }
main { position: relative; }
.swipe-current, .swipe-preview { animation: none !important; will-change: transform; }
.swipe-preview { position: absolute; left: 0; width: 100%; pointer-events: none; background: var(--bg); }
main.is-swiping { cursor: grabbing; }

/* Keep mobile forms at the app scale when the keyboard opens. */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, textarea, select, [contenteditable="true"] { font-size: 17.6px; }
@media (max-width: 650px) {
  dialog input, dialog textarea, dialog select, main input, main textarea, main select { font-size: 17.6px; }
}

/* Rounded entry form, consistent with the floating capsule controls. */
#editor { border-radius: 28px; }
#editor .dialog-header { border-radius: 28px 28px 0 0; }
#editor .dialog-header h2 { font-size: 27.5px; overflow-wrap: anywhere; }
#editor .dialog-header .icon-btn, #editor .series-row .icon-btn { border-radius: 50%; flex-shrink: 0; }
#editor input { border-radius: 999px; padding-inline: 18px; min-height: 50px; }
#editor textarea { border-radius: 22px; padding: 15px 18px; }
#editor .btn { border-radius: 999px; }
#editor .selected-exercise { border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px; }
#editor .exercise-results { border-radius: 22px; max-height: 285px; }
.exercise-group h3 { position: sticky; top: 0; z-index: 1; background: var(--soft); color: var(--primary-text); padding: 10px 16px; margin: 0; font-size: 13.2px; }
#editor .exercise-option { padding: 13px 16px; gap: 14px; text-align: left; }
#editor .exercise-option small { text-align: right; }
#editor .exercise-create { justify-content: flex-start; color: var(--primary-text); font-weight: 600; }
.previous-workout { margin: 0 0 24px; padding: 14px 0; border-block: 1px solid var(--line); color: var(--muted); overflow-wrap: anywhere; }
.previous-workout strong { color: var(--primary-text); font-weight: 700; }
.previous-workout-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.previous-workout-heading time { color: var(--ink); font-weight: 700; text-align: right; }
.previous-workout-results { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.previous-workout-results td { padding: 2px 8px; text-align: center; white-space: nowrap; border-left: 1px solid var(--line); }
.previous-workout-results td:first-child { border-left: 0; padding-left: 0; text-align: left; }
.previous-workout-results td:last-child { padding-right: 0; text-align: right; }
.series-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin: 18px 0 24px; }
#editor .series-actions .btn { min-height: 52px; min-width: 0; justify-content: center; padding: 12px 10px; white-space: normal; line-height: 1.3; }
#editor .dialog-footer { border-radius: 0 0 28px 28px; }
@media (max-width:650px) { #editor { border-radius: 28px 28px 0 0; } #editor .dialog-footer { border-radius: 0; } }

/* One shared width for all three floating controls. */
:root { --capsule-width: min(300px, calc(100vw - 44px)); }
.profile, .training-date-field, .bottom-nav { width: var(--capsule-width); }
.bottom-nav { grid-template-columns: repeat(2,42px) 50px repeat(2,42px); justify-content: space-evenly; gap: 3px; padding-inline: 9px; }
.bottom-nav .nav-item { width: 42px; }
.bottom-nav .nav-add { width: 50px; }
.workout-highlights .stat-value { font-weight: 700; color: var(--primary-text); }
.workout-highlights .stat-unit { display: inline; margin: 0 0 0 5px; font-weight: 400; color: var(--muted); vertical-align: baseline; }
@media(max-width:650px) { .workout-highlights .stat-value { font-size: clamp(14.3px,4.07vw,29.7px); } }
@media(max-width:360px) { .workout-highlights .stat { padding-inline: 5px; } .workout-highlights .stat-unit { margin-left: 3px; } }

/* Official Lucide geometry, consistent navigation stroke; bold load numbers. */
.nav-item[data-page=settings] svg { stroke-width: 2; }
.exercise-weight { font-weight: 700; }
.exercise-weight small { font-weight: 400; }

/* Exercise library management */
.exercise-choice-row{display:flex;align-items:center;border-bottom:1px solid var(--line)}
#editor .exercise-choice-row .exercise-option{flex:1;min-width:0;border-bottom:0}
.exercise-trash{color:var(--negative);flex:0 0 44px;margin-right:8px;border-radius:50%}
.exercise-list-actions{display:flex;align-items:center;gap:8px;padding-right:12px}
#editor .exercise-list-actions .exercise-create{flex:1;min-width:0;border:0}
.exercise-delete-toggle{display:flex;align-items:center;font-size:13.2px;min-height:44px;flex-shrink:0}
.exercise-delete-toggle[aria-checked=true]{color:var(--negative)}
.exercise-restore-list{padding:12px;display:flex;flex-wrap:wrap;gap:8px;color:var(--muted)}
.exercise-restore-list p{width:100%;font-size:13.2px}

/* Profile and session date above the workout summary. */
#person{background:var(--primary);color:var(--on-primary);border-color:var(--primary)}
#person:hover{background:var(--primary-hover)}
#person .avatar{background:rgba(255,255,255,.16);color:var(--on-primary)}
main[data-page=home] .page>.session-heading{margin:0 0 22px;padding:0;justify-content:center}

/* Profile typography and alignment with the date capsule. */
#person-name{font-size:130%}
#person { justify-content:center; padding-inline:44px; gap:10px; }
#person #avatar { flex-shrink:0; }

/* Month picker shares the profile/date/navigation width. */
.training-calendar{container-type:inline-size}
.calendar-heading{grid-template-columns:32px var(--capsule-width) 32px;justify-content:center}
.calendar-month-field{width:var(--capsule-width)}
@container (max-width:368px){
 .calendar-heading{grid-template-columns:1fr 1fr;gap:4px}
 .calendar-month-field{grid-column:1/-1;grid-row:1;justify-self:center;max-width:100%}
 .calendar-prev{grid-column:1;grid-row:2;justify-self:end}
 .calendar-next{grid-column:2;grid-row:2;justify-self:start}
}

/* Progressive directional blur, with twice the horizontal radius. */
.swipe-preview{--blur-direction:to right;--swipe-release:260ms;isolation:isolate}
.swipe-preview[data-direction=previous]{--blur-direction:to left}
.swipe-blur-layer{position:absolute;inset:0;z-index:5;pointer-events:none;
 -webkit-mask-image:linear-gradient(var(--blur-direction),transparent var(--blur-start),#000 var(--blur-end));
 mask-image:linear-gradient(var(--blur-direction),transparent var(--blur-start),#000 var(--blur-end))}
.swipe-blur-sample{width:50%;transform:scaleX(2);transform-origin:left top;
 filter:blur(var(--blur-radius));transition:filter var(--swipe-release) ease-out}
.swipe-blur-content{width:200%;transform:scaleX(.5);transform-origin:left top;background:var(--bg);animation:none!important}
.swipe-preview.is-settling .swipe-blur-sample{filter:blur(0px)}
@media(prefers-reduced-motion:reduce){.swipe-blur-layer{display:none}}

/* Shared exercise library and batch entry. */
.library-heading{align-items:center}
.library-heading h1{font-size:35.2px;letter-spacing:-1px}
.library-heading .subtitle{max-width:580px}
.library-heading .btn{flex-shrink:0}
.library-tools{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:20px;margin-bottom:22px;align-items:end}
.library-tools .field{margin:0}
.library-tools input,#library-editor input{border-radius:999px;min-height:56px;padding-inline:18px}
.library-tabs{display:flex;gap:10px;margin-bottom:28px}
.library-heading .btn,.library-tabs .btn,#library-editor .btn{border-radius:999px}
.library-group{margin-bottom:30px}
.library-group>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:48px;padding-block:8px 12px;border-bottom:1px solid var(--line);cursor:pointer;list-style:none}
.library-group>summary::-webkit-details-marker{display:none}
.library-group>summary h2{font-size:22px;color:var(--primary-text)}
.library-group>summary h2 span{font-size:13.2px;color:var(--muted);margin-left:8px}
.library-group>summary .chevron{flex-shrink:0}
.library-row{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);padding:20px 0}
.library-row>div:first-child{min-width:0}
.library-row h3{color:var(--primary-text);font-size:18.7px;overflow-wrap:anywhere}
.library-row p{color:var(--muted);margin-top:5px;font-size:14.3px;overflow-wrap:anywhere}
.library-row small{display:block;color:var(--muted);margin-top:6px}
.library-row-actions{display:flex;flex-shrink:0;gap:4px}
.library-row-actions .icon-btn{border-radius:50%;margin:0}
#library-editor{width:760px;border-radius:28px}
#library-editor .dialog-header{border-radius:28px 28px 0 0;gap:12px}
#library-editor .dialog-header .icon-btn{border-radius:50%;flex-shrink:0}
#library-editor .dialog-header h2{font-size:27.5px}
#library-editor textarea{border-radius:20px;min-height:110px;padding:14px 18px}
#library-editor .dialog-footer{border-radius:0 0 28px 28px}
.library-entry{position:relative;min-width:0;border:1px solid var(--line);border-radius:22px;padding:20px;margin:20px 0}
.library-entry legend{padding:0 10px;color:var(--primary-text);font-weight:700;font-size:15.4px}
.library-remove-row{position:absolute;right:12px;top:-28px;border-radius:50%;background:var(--bg);width:40px;height:40px}
.library-paste{margin-top:22px;border:1px solid var(--line);border-radius:22px;padding:16px 18px}
.library-paste summary{cursor:pointer;color:var(--primary-text);font-weight:600}
.library-paste .field{margin-top:16px}
.library-add-row{width:100%;min-height:50px}
@media(max-width:650px){
 .library-heading{align-items:stretch;flex-direction:column;gap:18px}
 .library-heading h1{font-size:30.8px}
 .library-heading .subtitle{max-width:none}
 .library-tools{grid-template-columns:minmax(0,1fr);gap:16px}
 .library-row{gap:10px}
 .library-row-actions{flex-direction:column}
 #library-editor .field-grid{grid-template-columns:minmax(0,1fr)}
 .library-entry{padding:16px 12px}
 #library-editor{border-radius:28px 28px 0 0}
}

/* Align the main controls with the diary edges at every viewport size. */
:root { --page-gutter:48px; --capsule-width:min(1144px, calc(100vw - 2 * var(--page-gutter))); }
@media(max-width:650px) { :root { --page-gutter:22px; } }
main { width:var(--capsule-width); margin-inline:auto; }
.top-inner { max-width:none; padding-inline:var(--page-gutter); }
main[data-page=home] .home-grid { grid-template-columns:minmax(0,1fr); gap:0; }
.training-date-field { min-width:0; }
.training-date-calendar { margin-top:12px; padding:20px; border:1px solid var(--line); border-radius:28px; background:var(--panel); }
.training-date-calendar[hidden] { display:none; }
.training-date-calendar .calendar-heading { grid-template-columns:32px minmax(0,1fr) 32px; gap:8px; }
.training-date-calendar .calendar-month-field { width:100%; grid-column:2; grid-row:1; }
.training-date-calendar .calendar-prev { grid-column:1; grid-row:1; }
.training-date-calendar .calendar-next { grid-column:3; grid-row:1; }
.training-date-calendar .calendar-count { margin-top:16px; }
.training-date-calendar .calendar-legend { margin-bottom:0; }
@media(max-width:400px) {
 .training-date-calendar { padding:12px; }
 .training-date-calendar .calendar-month-field .select-control { padding-inline:24px; font-size:14.3px; }
}

/* Shared library and settings do not need a person selector. */
.topbar[hidden] { display:none; }
.topbar[hidden] + main { padding-top:max(31px, env(safe-area-inset-top)); }

/* Independent side buttons switch people without opening the name menu. */
.person-step { position:absolute; z-index:3; top:6px; width:44px; height:44px; display:grid; place-items:center; border-radius:50%; color:var(--on-primary); }
.person-prev { left:6px; }
.person-next { right:6px; }
.person-step:hover { background:rgba(255,255,255,.12); }
.person-step svg { width:20px; height:20px; }
.person-prev svg { transform:rotate(90deg); }
.person-next svg { transform:rotate(-90deg); }
#person { padding-inline:56px; }

/* Each person has a separate edit action, without nesting buttons. */
.person-option-row { display:flex; align-items:center; }
.person-option-row > [data-person] { flex:1; min-width:0; }
.person-menu .person-edit { flex:0 0 44px; width:44px; height:44px; padding:10px; justify-content:center; }
.person-menu .person-edit svg { visibility:visible; width:20px; height:20px; }
#person-editor { border-radius:28px; }
#person-editor input, #person-editor .btn { border-radius:999px; }
#person-editor .dialog-header .icon-btn { border-radius:50%; flex-shrink:0; }
#person-editor .dialog-header h2 { font-size:27.5px; }
#person-editor-note[hidden] { display:none; }

/* Body readings share the diary's forms and typography. */
.chart-view-tabs{margin-bottom:28px}.chart-view-tabs button{border-radius:999px}
.measurement-metric{max-width:480px;margin:28px 0}.measurement-record{padding:22px 0;border-top:1px solid var(--line)}
.measurement-record h3{margin:0}.measurement-record dl{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:18px;margin:18px 0 0}
.measurement-record dt{font-size:.85em;color:var(--muted);margin-bottom:8px}.measurement-record dd{margin:0;white-space:nowrap}.measurement-record dd strong{font-size:1.35em;color:var(--primary-text,var(--primary))}.measurement-record dd span{color:var(--muted);font-size:.85em}
#measurement-editor{width:560px;max-width:100%;border-radius:28px}#measurement-editor .dialog-header h2{margin:0}#measurement-editor .btn,#measurement-editor input{border-radius:999px}#measurement-editor .icon-btn{border-radius:50%}
.measurement-fields{display:grid;grid-template-columns:1fr 1fr;gap:4px 18px}.measurement-fields .field{min-width:0}
@media(max-width:650px){.measurement-record dl{grid-template-columns:repeat(3,minmax(0,1fr))}.measurement-record .section-top{gap:8px}.measurement-record h3{font-size:1em}}
@media(max-width:380px){.measurement-fields{grid-template-columns:1fr}.measurement-record dl{grid-template-columns:repeat(2,minmax(0,1fr))}}

.measurement-heading .btn{border-radius:999px;white-space:nowrap}
@media(max-width:650px){.measurement-heading{flex-direction:column;align-items:stretch;gap:18px}.measurement-heading .btn{width:100%;justify-content:center}}

/* Paint the viewport/overscroll area as well as the page on iOS. */
html{background-color:var(--bg);min-height:100%}
body{min-height:100vh;min-height:100dvh}
/* Update is explicit; hide its control while any data-entry dialog is open. */
.app-update{position:fixed;z-index:40;bottom:calc(106px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(500px,calc(100vw - 44px));display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border:1px solid var(--line);border-radius:24px;background:var(--panel);box-shadow:var(--shadow);font-size:13.2px}
.app-update .btn{border-radius:999px;white-space:nowrap}body:has(dialog[open]) .app-update{display:none}

/* Server sync remains unavailable until an authenticated backend is connected. */
.sync-setting .btn:disabled{opacity:.55;cursor:not-allowed;background:var(--panel);flex-shrink:0}
@media(max-width:650px){.sync-setting{align-items:flex-start;flex-wrap:wrap}.sync-setting>div{flex:1 1 220px}.sync-setting .btn{max-width:none}}

/* Repeating a session creates local exercise slots, never zero-valued results. */
.repeat-workout { margin-top: 28px; display: grid; }
.repeat-workout .btn { border-radius: 999px; width: 100%; }
.workout-plan-note { margin: 0 0 24px; color: var(--muted); }
.planned-label { color: var(--muted); font-size: .85em; text-align: right; }

/* Workout actions share the purple capsule design used throughout the app. */
.exercise-detail .detail-actions { gap: 10px; }
.exercise-detail .detail-actions .btn { border-radius: 999px; padding-inline: 18px; }

/* Reserve the 72px menu, its bottom inset and a 16px gap after the last action. */
main[data-page=home] { padding-bottom: calc(88px + max(18px, env(safe-area-inset-bottom))); }

/* Step one uses the dialog's scroll area instead of a nested list frame. */
#editor .editor-step { margin:0 0 5px; font-size:12.1px; color:var(--muted); }
#editor-title:focus { outline:none; }
#editor[data-step=choose] .exercise-results { max-height:none; overflow:visible; border:0; border-radius:0; margin:0; background:transparent; }
#editor[data-step=choose] .exercise-group { margin-bottom:26px; }
#editor[data-step=choose] .exercise-group h3 { position:static; padding:0 0 10px; background:transparent; font-size:15.4px; }
#editor[data-step=choose] .exercise-choice-row { border:0; gap:8px; margin-bottom:9px; }
#editor[data-step=choose] .exercise-choice-row .exercise-option { min-height:72px; padding:14px 16px; border:1px solid var(--line); border-radius:18px; background:var(--panel); }
#editor[data-step=choose] .exercise-option.is-selected { border-color:var(--primary-text); background:var(--soft); }
#editor[data-step=choose] .exercise-choice-content { min-width:0; }
#editor[data-step=choose] .exercise-choice-content strong { display:block; font-size:15.4px; line-height:1.35; overflow-wrap:anywhere; }
#editor[data-step=choose] .exercise-choice-content small { display:block; margin-top:5px; text-align:left; color:var(--muted); }
#editor[data-step=choose] .exercise-choice-mark { width:26px; height:26px; flex:0 0 26px; border:1px solid var(--line); border-radius:50%; display:grid; place-items:center; color:var(--on-primary); }
#editor[data-step=choose] .is-selected .exercise-choice-mark { background:var(--primary); border-color:var(--primary); }
#editor[data-step=choose] .exercise-choice-mark svg { width:16px; height:16px; }
#editor[data-step=choose] .exercise-list-actions { flex-wrap:wrap; justify-content:space-between; padding:12px 0 0; border-top:1px solid var(--line); }
#editor[data-step=choose] .exercise-list-actions .exercise-create { flex:1 1 200px; min-height:48px; padding-inline:0; justify-content:flex-start; }
#editor[data-step=choose] #new-exercise-fields .form-section { margin-bottom:24px; padding-top:0; border-top:0; }
#editor .dialog-footer #editor-next { min-width:130px; }

.exercise-detail .detail-actions { align-items:center; }
.exercise-detail .exercise-delete-action { margin-left:auto; border:1px solid var(--negative); border-radius:50%; background:transparent; color:var(--negative); }
.exercise-detail .exercise-delete-action:hover { background:transparent; opacity:.8; }

/* Confirmation follows the same purple capsules, with room for rounded phone edges. */
#confirm { width:min(440px, calc(100vw - 32px)); max-width:calc(100vw - 32px); border:1px solid var(--line); border-radius:28px; }
#confirm .dialog-header { padding:24px 24px 20px; border-radius:28px 28px 0 0; }
#confirm .dialog-header h2 { color:var(--primary-text); }
#confirm .dialog-body { padding:20px 24px; }
#confirm .dialog-footer { padding:20px 24px 24px; border-radius:0 0 28px 28px; }
#confirm .dialog-footer .btn { border-radius:999px; min-width:0; flex:1; }
#confirm [data-action=cancel-delete] { background:transparent; color:var(--primary-text); border-color:var(--primary-text); }
@media(max-width:650px) {
 #confirm { margin:auto auto calc(24px + env(safe-area-inset-bottom)); max-height:calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
 #confirm .dialog-footer { padding-inline:20px; gap:10px; }
 #confirm .dialog-footer .btn { padding-inline:10px; }
}

/* Statistics: the exercise trend comes before optional history and context. */
.statistics-heading{margin-bottom:16px}.statistics-heading h2{font-size:22px;font-weight:600;letter-spacing:-.5px}
.chart-view-tabs{margin:0 0 24px;gap:10px}.chart-view-tabs button.selected,.progress-periods button.selected,.chart-metrics button.selected{background:var(--primary);color:#fff;border-color:var(--primary)}
.progress-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:0 18px;align-items:end}.progress-controls .field{margin-bottom:12px}.progress-load{font-size:12.1px;color:var(--muted);margin:0 0 14px}
.chart-metrics{display:flex;width:100%;gap:8px}.chart-metrics button{flex:1;border-radius:999px;min-height:44px}
.progress-periods{margin:12px 0 22px;gap:8px;align-items:center}.progress-periods button{border-radius:999px;font-size:12.1px;padding:7px 13px;min-height:40px}
.progress-plot{border-top:1px solid var(--line);padding-top:18px}.progress-plot h3{font-size:14.3px;color:var(--muted);font-weight:400}.progress-plot .chart-wrap{padding-top:8px}.progress-plot .empty{border:0;padding:26px 12px}
.progress-sessions{display:grid;grid-template-columns:1fr 1fr;gap:18px;border-top:1px solid var(--line);padding-top:20px;margin-top:16px}.progress-sessions article+article{border-left:1px solid var(--line);padding-left:18px}.progress-sessions h3{font-size:13.2px;font-weight:600;margin-bottom:4px}.progress-sessions time{font-size:12.1px;color:var(--muted)}.session-weight{font-size:28.6px;font-weight:700;color:var(--primary-text);font-variant-numeric:tabular-nums;margin:8px 0 3px}.session-weight small{font-size:12.1px;font-weight:400;color:var(--muted)}.progress-sessions p{font-size:12.1px;color:var(--muted)}.progress-sessions .progress-change{grid-column:1/-1;padding-top:12px;border-top:1px solid var(--line)}.progress-change strong{color:var(--ink);white-space:nowrap}
.progress-history{margin-top:22px}.progress-history>summary{font-weight:600;color:var(--ink)}.progress-table{overflow-x:auto}.progress-history table{max-width:none}.progress-history th{font-weight:400;color:var(--muted);font-size:12.1px}.progress-history td{vertical-align:top}.progress-history td details summary{padding:0;color:var(--ink)}.progress-history td details div{padding-top:4px;white-space:nowrap;color:var(--muted)}
@media(max-width:650px){.progress-controls{grid-template-columns:1fr}.chart-view-tabs{margin-bottom:20px}.statistics-heading h2{font-size:20.9px}.progress-periods{justify-content:space-between;gap:5px}.progress-periods button{padding:7px 10px;flex:1}.progress-sessions{gap:12px}.progress-sessions article+article{padding-left:12px}.session-weight{font-size:25.3px}.progress-history th,.progress-history td{padding:10px 4px;font-size:12.1px}.progress-history td:first-child{min-width:85px}.progress-history td details summary{font-size:12.1px}.progress-plot .chart{min-height:0}}

/* Two-column legend: each exercise keeps its own colored edge. */
.chart-series,.series-legend-item{--series-color:hsl(var(--series-hue) 70% 38%)}html[data-theme=dark] .chart-series,html[data-theme=dark] .series-legend-item{--series-color:hsl(var(--series-hue) 75% 72%)}
.chart-series .plot{stroke:var(--series-color);stroke-width:2.5;stroke-dasharray:none}.chart-series .point{fill:var(--series-color)}
.chart-exercise-picker{width:100%;min-width:0;border:1px solid var(--line);border-radius:28px;background:var(--panel);overflow:visible}.chart-exercise-picker>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;list-style:none;cursor:pointer;min-height:54px;padding:12px 20px;font-weight:600}.chart-exercise-picker>summary::-webkit-details-marker{display:none}.chart-exercise-picker>summary span{min-width:0;overflow-wrap:anywhere}.chart-exercise-picker[open]{border-radius:28px}.chart-exercise-picker fieldset{margin:0;padding:4px 12px 12px;border:0;max-height:420px;overflow:auto;border-top:1px solid var(--line)}
.chart-exercise-choice+ .chart-exercise-choice{border-top:1px solid var(--line)}.chart-exercise-choice>label{display:flex;align-items:center;gap:12px;cursor:pointer;min-height:54px;padding:12px 8px}.chart-exercise-choice input[type=checkbox]{width:20px;height:20px;min-height:20px;flex:0 0 20px;accent-color:var(--primary-text);margin:0;padding:0;border-radius:4px}.chart-exercise-choice input:disabled{opacity:1;cursor:default}.chart-exercise-choice strong{font-size:13.2px;display:block;font-weight:600}.chart-exercise-choice small{font-size:12.1px;color:var(--muted);display:block}.chart-exercise-choice .chart-choice-load{display:flex;align-items:stretch;min-height:0;gap:6px;padding:0 8px 12px 40px;margin:0}.chart-choice-load .select-control{min-height:44px;font-size:12.1px}
.series-legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;margin:0 0 20px;border:1px solid var(--line);border-radius:24px;overflow:hidden;background:var(--panel)}.series-legend-item:only-child{grid-column:1/-1}.series-legend-item:nth-child(n+3){border-top:1px solid var(--line)}.series-legend-item{display:flex;align-items:center;min-width:0;width:100%;min-height:72px;text-align:left;padding:12px 16px;border:0;border-left:8px solid var(--series-color);border-radius:0;background:var(--panel)}.series-legend-item[aria-pressed=true]{background:var(--soft)}.series-legend-item strong{display:block;font-size:13.2px;font-weight:600}.series-legend-item small{display:block;margin-top:4px;font-size:11px;color:var(--muted)}.series-legend-name{min-width:0;overflow-wrap:anywhere}.chart-choice-hint{font-size:12.1px;color:var(--muted);padding:10px 8px 4px}.chart-exercise-choice label:has(input:disabled:not(:checked)){opacity:.5;cursor:default}
.chart-detail-title{margin-top:22px;font-size:14.3px;font-weight:600}.chart-detail-title span{font-weight:400;font-size:12.1px;color:var(--muted);display:block;margin-top:4px}
@media(max-width:650px){.chart-exercise-picker fieldset{max-height:50dvh}.series-legend-item{padding:12px;min-height:76px}.series-legend-item strong{font-size:12.1px}.chart-exercise-picker>summary{padding:12px 16px}.chart-exercise-choice .chart-choice-load{padding-left:8px}}

/* Metric and date range share one segmented card. */
.chart-display-options{margin:0 0 20px;border:1px solid var(--line);border-radius:24px;overflow:hidden;background:var(--panel)}
.chart-display-options .chart-metrics,.chart-display-options .progress-periods{display:grid;gap:0;margin:0;width:100%;align-items:stretch}
.chart-display-options .chart-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
.chart-display-options .progress-periods{grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid var(--line)}
.chart-display-options button{min-width:0;min-height:48px;padding:10px 8px;border:0;border-radius:0;line-height:1.35;overflow-wrap:anywhere;background:transparent}
.chart-display-options button+button{border-left:1px solid var(--line)}
.chart-display-options button.selected{background:var(--primary);color:#fff}
.chart-display-options .subtle{grid-column:1/-1;padding:10px 12px;border-top:1px solid var(--line)}
.chart-display-options button:focus-visible{outline:2px solid var(--primary-text);outline-offset:-4px}

/* Session arrows mirror the person selector; the date still opens the calendar. */
.training-date-navigation{position:relative}
#training-day{padding-inline:56px}
.training-step{position:absolute;z-index:3;top:6px;width:44px;height:44px;display:grid;place-items:center;border-radius:50%;color:var(--ink)}
.training-prev{left:6px}.training-next{right:6px}
.training-step:hover:not(:disabled){background:var(--soft)}
.training-step svg{width:20px;height:20px}
.training-prev svg{transform:rotate(90deg)}.training-next svg{transform:rotate(-90deg)}

/* Native button hit targets keep option taps reliable on mobile Safari. */
.select-option{width:100%}

/* Body composition: selected mobile design, shared light/dark tokens. */
.body-page{max-width:720px;margin:0 auto;padding-bottom:38px}.body-date{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:center;min-height:56px;background:var(--panel);border:1px solid var(--line);border-radius:32px;text-align:center}.body-date strong{font-size:17px}.body-date .icon-btn{border:0;background:none;width:44px;height:48px;padding:12px;justify-self:center}.body-date .icon-btn:disabled{opacity:.25}.body-arrow-left{transform:rotate(90deg)}.body-arrow-right{transform:rotate(-90deg)}.body-source{font-size:13px;color:var(--muted);margin:12px 0 28px}.body-heading{margin:26px 0 18px;gap:10px}.body-heading h2{font-size:25px;font-weight:650;letter-spacing:-.6px}.body-heading .btn{font-size:15px;white-space:nowrap;min-height:44px;color:var(--primary-text);padding:6px 0;gap:6px}.body-heading .btn svg{width:21px}.body-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:28px}.body-summary>div{min-height:100px;padding:16px 16px 18px 0;display:flex;flex-direction:column;gap:6px}.body-summary>div:nth-child(even){border-left:1px solid var(--line);padding-left:22px;padding-right:0}.body-summary>div:nth-child(n+3){border-top:1px solid var(--line)}.body-label{font-size:15px;color:var(--muted)}.body-reading{line-height:1.15;white-space:nowrap;color:var(--primary-text)}.body-reading strong{font-size:31px;font-weight:700;letter-spacing:-1px;font-variant-numeric:tabular-nums}.body-unit{font-size:15px;color:var(--muted);font-weight:400;letter-spacing:0}.body-summary small{font-size:13px;color:var(--muted)}.body-summary .body-delta{font-size:11px;line-height:1.4}.body-distribution{padding-top:22px;border-top:1px solid var(--line)}.body-distribution h3{font-size:23px;margin:0 0 16px;letter-spacing:-.4px}.body-mode{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);border:1px solid var(--line);border-radius:28px;overflow:hidden;padding:3px;background:var(--panel);margin-bottom:18px}.body-mode button{min-width:0;border:0!important;border-radius:24px!important;padding:10px 8px!important;font-size:12px!important;line-height:1.3;white-space:normal}.body-mode button.selected{background:var(--primary)!important;color:white!important}.body-silhouette{position:relative;height:350px;max-width:400px;margin:0 auto}.body-silhouette>img,.body-silhouette>.body-regions{display:block;position:absolute;left:50%;top:0;transform:translateX(-50%);height:350px;width:180px;object-fit:contain;opacity:.87}.body-callout{position:absolute;width:100px;z-index:1;font-size:12px;line-height:1.4;color:var(--muted)}.body-callout strong{display:block;font-size:19px;font-weight:700;color:var(--primary-text);white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:-.4px}.body-callout strong span{font-size:12px;font-weight:400;letter-spacing:0}.body-callout small{display:block;font-size:11px}.body-rightArm{left:0;top:50px}.body-leftArm{right:0;top:50px;text-align:right}.body-trunk{right:0;top:142px;text-align:right}.body-rightLeg{left:0;top:240px}.body-leftLeg{right:0;top:240px;text-align:right}.body-table-switch{display:flex;margin:6px 0 20px auto;gap:8px;font-size:13px;color:var(--primary-text)!important;min-height:44px}.body-table-switch svg{width:18px}.body-footnote{font-size:12px;color:var(--muted);line-height:1.65;margin:10px 0 16px}.body-disclosures{border-top:1px solid var(--line)}.body-disclosure{border-bottom:1px solid var(--line)}.body-disclosure>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;list-style:none;cursor:pointer;padding:20px 0;font-size:16px;min-height:68px;box-sizing:border-box}.body-disclosure>summary::-webkit-details-marker{display:none}.body-disclosure>summary>span{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.body-disclosure>summary>span>span{display:block}.body-disclosure>summary svg{width:21px;height:21px;flex-shrink:0}.body-disclosure>summary>svg{width:17px}.body-disclosure[open]>summary>svg{transform:rotate(180deg)}.body-disclosure>summary small{display:block;font-size:12px;color:var(--muted);font-weight:400;margin-top:3px}.body-disclosure-content{padding:0 0 24px}.body-disclosure-content h3{font-size:20px;margin:18px 0}.body-disclosure-content h4{font-size:16px;margin:16px 0}.body-results{margin:0 0 20px}.body-results>div{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:14px;padding:14px 0;border-bottom:1px solid var(--line);font-size:14px;line-height:1.5}.body-results dt{color:var(--muted)}.body-results dd{margin:0;text-align:right}.body-results dd strong{font-weight:650}.body-results dd small{display:block;font-size:11px;color:var(--muted);margin-top:4px}.body-results .body-unit{font-size:12px}.body-segment-table{border-collapse:collapse;width:100%;font-size:14px;margin-bottom:12px}.body-segment-table th,.body-segment-table td{border-bottom:1px solid var(--line);padding:14px 4px;text-align:left}.body-segment-table td{text-align:right}.body-segment-table td small{display:block;color:var(--muted);font-size:12px}.body-segment-table td strong{color:var(--primary-text)}.body-segment-table td strong span{font-weight:400}.body-impedance-wrap{max-width:100%;overflow-x:auto}.body-impedance{width:100%;border-collapse:collapse;font-size:10px;font-variant-numeric:tabular-nums}.body-impedance th,.body-impedance td{padding:10px 3px;border-bottom:1px solid var(--line);text-align:right}.body-impedance th:first-child{text-align:left}.body-original{display:block;color:var(--primary-text);font-size:14px;line-height:1.6}.body-original img{display:block;width:100%;height:auto;border-radius:12px;margin-bottom:12px}.body-original span{display:flex;align-items:center;gap:8px}.body-original svg{width:18px}.body-chart{width:100%;height:auto;max-height:none}.body-page .measurement-history{margin:0}.body-page .measurement-record{padding:16px 0}.body-page .measurement-record .btn.text{font-size:14px}.body-page .measurement-record dl{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.body-empty-segments{font-size:14px;color:var(--muted);padding:20px 0;border-top:1px solid var(--line);line-height:1.6}.body-editor-details{border-top:1px solid var(--line);padding:4px 0;margin-top:20px}.body-editor-details>summary{padding:16px 0;cursor:pointer;font-size:16px;font-weight:600}.body-editor-details fieldset{border:0;border-top:1px solid var(--line);padding:20px 0 0;margin:20px 0}.body-editor-details legend{font-size:14px;font-weight:600;padding:0 8px 0 0}.body-editor-details .measurement-fields{margin-top:12px}.body-range-fields .field>span{font-size:12px}.body-page :focus-visible{outline:2px solid var(--primary-text);outline-offset:4px}
@media(min-width:700px){.body-silhouette{height:450px;max-width:500px}.body-silhouette>img,.body-silhouette>.body-regions{height:450px;width:231px}.body-callout{font-size:15px;width:135px}.body-callout strong{font-size:25px}.body-callout small{font-size:13px}.body-rightArm,.body-leftArm{top:66px}.body-trunk{top:185px}.body-rightLeg,.body-leftLeg{top:315px}.body-heading h2{font-size:30px}.body-mode button{font-size:15px!important}.body-impedance{font-size:13px}}
@media(max-width:360px){.body-silhouette{height:320px}.body-silhouette>img,.body-silhouette>.body-regions{height:320px;width:165px}.body-callout{width:88px;font-size:11px}.body-callout strong{font-size:17px}.body-leftLeg,.body-rightLeg{top:220px}.body-reading strong{font-size:28px}.body-unit{font-size:13px}.body-mode button{font-size:11px!important}}
main[data-page=chart]{padding-top:18px}main[data-page=chart] .page>.chart-view-tabs{display:grid;grid-template-columns:1fr 1fr;gap:0;border:1px solid var(--line);border-radius:30px;overflow:hidden;padding:2px;background:var(--panel);margin-bottom:20px}main[data-page=chart] .page>.chart-view-tabs button{border:0;border-radius:26px;font-size:14px;min-height:44px;padding:8px}.body-summary>div{min-height:65px;padding-top:12px;padding-bottom:14px}.body-source{margin-bottom:18px}.body-heading{margin-top:18px}.body-summary{margin-bottom:20px}

/* Explicit in-place ordering: scroll from rows, drag only from their 44px handles. */
.workout-list-toolbar{display:flex;justify-content:flex-end;padding:12px 0 4px}.workout-list-toolbar .btn{color:var(--primary-text);font-size:13px;min-height:44px;gap:8px}.workout-list-toolbar svg{width:18px;height:18px}.workout-order-editor{padding:10px 0 28px}.workout-order-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.workout-order-heading h2{font-size:21px;letter-spacing:-.4px;margin:0}.workout-order-heading .btn{min-height:44px}.order-hint{font-size:13px;color:var(--muted);line-height:1.6;margin:0 0 20px}.workout-order-list{list-style:none;padding:0;margin:0}.workout-order-row{display:grid;grid-template-columns:28px minmax(0,1fr) 44px;align-items:center;column-gap:10px;min-height:88px;padding:14px 0;border-top:1px solid var(--line);background:var(--bg);box-sizing:border-box;touch-action:pan-y}.order-number{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}.order-name{min-width:0}.order-name strong{display:block;font-size:17px;line-height:1.4;color:var(--primary-text);overflow-wrap:anywhere}.order-name small{display:block;color:var(--muted);font-size:12px;line-height:1.5;margin-top:4px}.order-handle{border:0;width:44px;height:44px;min-width:44px;border-radius:50%;background:transparent;color:var(--muted);touch-action:none;cursor:grab;padding:10px}.order-handle svg{width:24px;height:24px;pointer-events:none}.order-handle:hover,.order-handle[aria-expanded=true]{background:var(--soft);color:var(--primary-text)}.order-handle:focus-visible{outline:2px solid var(--primary-text);outline-offset:2px}.order-row-actions{grid-column:2/-1;display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 2px}.order-row-actions[hidden]{display:none}.order-row-actions .btn{font-size:12px;min-height:44px;border-radius:24px;padding:10px 14px}.order-row-actions svg{width:15px;height:15px}.order-row-actions .btn:disabled{opacity:.35}.order-up{transform:rotate(180deg)}.workout-order-footer{position:sticky;bottom:calc(98px + env(safe-area-inset-bottom));padding:14px 0 4px;background:var(--bg);z-index:4;margin-top:20px}.workout-order-footer>.btn{width:100%;min-height:50px;border-radius:28px;justify-content:center}.order-placeholder{opacity:.2}.order-drag-preview{border:1px solid var(--primary-text);border-radius:18px;box-shadow:0 12px 28px #0003;padding:14px 10px;cursor:grabbing;opacity:.97;list-style:none}.order-drag-preview .order-row-actions{display:none}.is-order-dragging,.is-order-dragging *{user-select:none!important;-webkit-user-select:none!important}.is-order-dragging .order-handle{cursor:grabbing}.workout-order-list .order-handle,.workout-order-list .order-name{-webkit-touch-callout:none}.workout-order-editor .form-error{margin-top:12px}.workout-order-editor #workout-order-title:focus{outline:none}
@media(prefers-reduced-motion:reduce){.workout-order-row,.order-drag-preview{transition:none!important;scroll-behavior:auto}}

/* Leaders connect live text bounds to anatomical points without covering labels. */
.body-leaders{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:1;color:var(--primary-text);fill:none;stroke:currentColor;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round}.body-leaders circle{fill:currentColor;stroke:none}.body-silhouette .body-callout{z-index:2}

/* Status colours tint only the anatomical regions of the original raster. */
.body-silhouette>.body-regions{pointer-events:none;z-index:0;overflow:visible}.body-regions defs path{fill:white;stroke:none}.body-color-legend{display:flex;justify-content:center;flex-wrap:wrap;gap:10px 18px;font-size:12px;color:var(--muted);margin:12px 0 0}.body-color-legend>span{display:inline-flex;align-items:center;gap:6px}.body-color-legend>span::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--region-color)}.body-color-worse{--region-color:#df5c59}.body-color-normal{--region-color:#40ab78}.body-color-better{--region-color:#4b91e0}

/* Keep the set number heading intact beside the counterweight column. */
main[data-page=home] .set-table th:first-child{white-space:nowrap;overflow-wrap:normal}
#assistance-context .form-note{margin-top:10px;margin-bottom:20px}
.assisted-summary-note{margin-top:-10px;margin-bottom:22px}

/* Direction of body-measurement changes, distinct from the latest recorded value. */
.body-summary .body-delta-positive{color:var(--positive)}
.body-summary .body-delta-negative{color:var(--negative)}

/* Shared controls and the November diary layout. */
:root{--primary:#4c226d;--primary-hover:#623184;--primary-text:#582680}
html[data-theme=dark]{--primary-text:#ffffff}
.btn,.icon-btn{border-radius:999px}.select-popover,.sync-conflict,#toast{border-radius:22px}
.pill-switch{position:relative!important;display:grid!important;grid-template-columns:repeat(var(--pill-count),minmax(0,1fr))!important;gap:0!important;padding:3px!important;border:1px solid var(--line)!important;border-radius:999px!important;overflow:hidden;background:var(--panel)!important;isolation:isolate}
.pill-switch .pill-selection{position:absolute;top:3px;bottom:3px;left:3px;width:calc((100% - 6px)/var(--pill-count));border-radius:999px;background:var(--primary);transform:translateX(calc(var(--pill-to)*100%));z-index:-1}
.pill-switch button,.body-mode.pill-switch button{position:relative;min-width:0;min-height:44px;margin:0;border:0!important;border-radius:999px!important;background:transparent!important;padding:10px 8px!important;color:var(--ink)!important;font-size:14px!important;line-height:1.25}
.pill-switch button.selected,.body-mode.pill-switch button.selected{background:transparent!important;color:var(--on-primary)!important}
.pill-moving .pill-selection{animation:pill-travel .34s cubic-bezier(.22,.8,.25,1) both}
@keyframes pill-travel{0%{transform:translateX(calc(var(--pill-from)*100%)) scale(1)}45%{transform:translateX(calc((var(--pill-from) + var(--pill-to))*50%)) scale(1.08,.86)}100%{transform:translateX(calc(var(--pill-to)*100%)) scale(1)}}
.library-view-tabs{margin-bottom:32px}.library-heading h1{font-size:clamp(28px,5vw,48px)}
.exercise {
  --exercise-index: 38px;
  --exercise-arrow: 25px;
  --exercise-gap: 14px;
}
.exercise .exercise-head {
  grid-template-columns: var(--exercise-index) minmax(0,1fr) auto var(--exercise-arrow);
  align-items: start;
  gap: var(--exercise-gap);
}
.exercise-head > div {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.exercise-head .exercise-num { padding-top: 0; line-height: 1.2; }
.exercise-head .exercise-name { margin-bottom: 0; line-height: 1.2; overflow-wrap: anywhere; }
.exercise-head .exercise-weight { line-height: 1.15; }
.exercise-head .chevron { justify-self: end; margin-top: 2px; }
.exercise-badges { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.exercise-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}
.exercise-load-summary { align-items: flex-end; gap: 5px; }
.exercise-load-badge { white-space: nowrap; text-align: center; }
.exercise .exercise-detail { padding-inline-start: calc(var(--exercise-index) + var(--exercise-gap)); }
.exercise-detail .set-table { width: calc(100% - var(--exercise-arrow) - var(--exercise-gap)); }
.exercise-detail .set-table th, .exercise-detail .set-table td { padding-inline: 0 8px; }
.exercise-detail .set-table :is(th,td):last-child { text-align: right; padding-inline-end: 0; }
.set-load { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 2px 8px; }
.set-load > span { white-space: nowrap; }
main[data-page=home] .set-load .delta[aria-label] { margin: 0; }
.exercise-hints{padding:13px 16px;margin:12px 0 18px;border-radius:18px;background:var(--soft);font-size:13px}.exercise-hints strong{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.7px}.exercise-hints p{white-space:pre-line;margin-top:5px}
.workout-list-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:12px 0 18px}.session-name.btn {
  flex: 1 1 0;
  display: inline-grid;
  grid-template-columns: minmax(0,1fr) 44px;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  padding: 0;
  border-radius: 26px;
  color: var(--primary-text);
  font-size: clamp(23px, 5.6vw, 28px);
  line-height: 1.15;
  text-align: left;
}
.session-name strong { align-self: center; min-width: 0; padding: 9px 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-name-edit { display: grid; place-items: center; border-inline-start: 1px solid var(--line); }
.repeat-workout{display:flex;gap:12px;flex-wrap:wrap}.repeat-workout>.btn{flex:1 1 200px}
.workout-highlights .stat-value{font-size:clamp(36px,8.5vw,74px);line-height:1.2;white-space:nowrap;letter-spacing:-1px;margin-top:14px}
.workout-highlights .stat-unit{font-size:13px;letter-spacing:0;font-weight:400}.workout-highlights .stat{min-width:0}.workout-highlights .stat-label{letter-spacing:.6px;line-height:1.4}
.series-row{grid-template-columns:28px minmax(0,1fr) 44px;gap:10px}
.series-pair{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line);border-radius:999px;background:var(--panel);overflow:hidden}
.series-pair input{border:0!important;box-shadow:none!important;border-radius:0!important;background:transparent!important;min-width:0;padding-inline:18px}.series-pair input+input{border-left:1px solid var(--line)!important}.series-pair:focus-within{outline:2px solid var(--primary-text);outline-offset:2px}.series-pair input:focus{outline:none}
.template-list{display:grid;gap:20px}.template-card{padding:24px;border:1px solid var(--line);border-radius:26px;background:var(--panel)}.template-card h2{font-size:23px}.template-card ol{padding-left:24px;margin:20px 0}.template-card li{padding:7px 0}.template-card li small{display:block;color:var(--muted);font-size:12px}.template-card .detail-actions{justify-content:space-between}.template-archive{color:var(--negative)}
.template-edit-row{min-width:0;border:1px solid var(--line);border-radius:22px;padding:18px;margin:20px 0}.template-edit-row legend{font-size:12px;color:var(--muted);padding:0 8px}.template-order-actions{display:flex;gap:8px}.template-order-actions .exercise-trash{margin-left:auto;border:1px solid var(--negative);color:var(--negative);border-radius:50%}
#template-editor,#session-editor{border-radius:28px}
#session-editor.session-name-dialog {
  position: fixed;
  inset: max(12px, env(safe-area-inset-top)) 0 auto;
  margin: 0 auto;
  max-width: calc(100% - 24px);
  max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - 12px);
  border-bottom: 1px solid var(--line);
  overflow: auto;
}
#template-editor .dialog-footer,#session-editor .dialog-footer{padding-bottom:max(22px,env(safe-area-inset-bottom))}
.progress-plot .chart-wrap{margin-inline:0}.progress-plot h3{font-size:15px;margin-bottom:12px}.progress-plot+.chart-legend{margin-top:18px}
@media(max-width:650px){.exercise{--exercise-index:22px;--exercise-arrow:16px;--exercise-gap:10px}}
@media(max-width:400px){.exercise{--exercise-index:18px;--exercise-arrow:12px;--exercise-gap:7px}}
@media(max-width:600px){.series-row{grid-template-columns:22px minmax(0,1fr) 40px;gap:8px}.series-pair input{padding-inline:14px}.workout-list-toolbar>.btn.small{flex:0 0 auto;font-size:11px;max-width:100px}.template-card{padding:18px}.pill-switch button,.body-mode.pill-switch button{font-size:12px!important}.workout-highlights .stat{padding-inline:8px}.workout-highlights .stat:first-child{padding-left:0}.workout-highlights .stat:last-child{padding-right:0}}
@media(prefers-reduced-motion:reduce){.pill-moving .pill-selection{animation:none!important}}

.template-up{display:inline-flex;transform:rotate(180deg)}
@media(max-width:360px){#training-day .select-value{font-size:15px}}

/* Glass finish for navigation and the person selector. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-nav-glass] .bottom-nav,
  html[data-nav-glass] #person {
    --glass-tint: rgb(250 250 255 / 65%);
    --glass-sheen: rgb(255 255 255 / 68%);
    --glass-edge: rgb(255 255 255 / 85%);
    --glass-active: rgb(86 39 124 / 13%);
    --glass-shadow: rgb(29 21 36 / 23%);
    --glass-fill:
      radial-gradient(70% 110% at 9% -42%, var(--glass-sheen), transparent 75%),
      radial-gradient(36% 100% at 95% 115%, var(--glass-sheen), transparent 76%),
      linear-gradient(168deg, var(--glass-gradient, transparent), transparent 57%),
      var(--glass-tint);
    background: var(--glass-fill);
    border-color: var(--glass-edge);
    box-shadow:
      inset 0 1px 2px var(--glass-sheen),
      inset 0 -1px 1px var(--glass-edge),
      0 8px 24px var(--glass-shadow);
    -webkit-backdrop-filter: blur(6px) saturate(150%);
    backdrop-filter: blur(6px) saturate(150%);
  }

  html[data-nav-glass] #person {
    --person-glass-color: var(--primary);
    --glass-tint: color-mix(in srgb, var(--person-glass-color) var(--person-glass-opacity, 70%), transparent);
    --glass-sheen: rgb(240 220 255 / 22%);
    --glass-edge: rgb(240 220 255 / 34%);
    --glass-shadow: rgb(24 13 34 / 25%);
  }

  html[data-nav-glass] #person:hover {
    --person-glass-color: var(--primary-hover);
  }

  html[data-nav-glass][data-theme=dark] #person {
    --glass-shadow: rgb(0 0 0 / 42%);
  }

  html[data-nav-glass][data-theme=dark] .bottom-nav {
    --glass-tint: rgb(32 29 38 / 75%);
    --glass-sheen: rgb(240 220 255 / 22%);
    --glass-edge: rgb(246 232 255 / 28%);
    --glass-active: rgb(214 172 255 / 20%);
    --glass-shadow: rgb(0 0 0 / 42%);
  }

  /* Give WebKit an inset surface for the backdrop, behind the real controls. */
  html[data-nav-glass="refraction"]:not([data-glass-displacement]) :is(.bottom-nav, #person) {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-nav-glass="refraction"]:not([data-glass-displacement]) .bottom-nav {
    --glass-tint: rgb(250 250 255 / 55%);
  }

  html[data-nav-glass="refraction"][data-theme=dark]:not([data-glass-displacement]) .bottom-nav {
    --glass-tint: rgb(32 29 38 / 58%);
  }

  html[data-nav-glass="refraction"]:not([data-glass-displacement]) #person {
    --person-glass-opacity: 60%;
  }

  html[data-nav-glass="refraction"]:not([data-glass-displacement]) :is(.bottom-nav, #person)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    background: var(--glass-fill);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    backdrop-filter: blur(8px) saturate(150%);
  }

  html[data-nav-glass] .bottom-nav .nav-item:is(:hover, .active) {
    background: var(--glass-active);
    box-shadow: inset 0 1px 1px var(--glass-sheen);
  }

  html[data-nav-glass] .bottom-nav .nav-add {
    background: linear-gradient(155deg, var(--primary-hover), var(--primary) 72%);
    border: 1px solid var(--glass-edge);
    box-shadow: inset 0 1px 2px var(--glass-sheen), 0 4px 10px var(--glass-shadow);
  }

  html[data-nav-glass] .bottom-nav .nav-add:hover {
    background: var(--primary-hover);
  }
}

/* Apply the displacement maps only after the app enables them. */
html[data-nav-glass][data-glass-displacement] .bottom-nav,
html[data-nav-glass][data-glass-displacement] #person {
  --glass-gradient: var(--glass-tint);
}

html[data-nav-glass][data-glass-displacement] .bottom-nav {
  backdrop-filter: url("#nav-refraction") blur(3px) saturate(125%);
}

html[data-nav-glass][data-glass-displacement] #person {
  --person-glass-opacity: 80%;
  backdrop-filter: url("#person-refraction") blur(3px) saturate(125%);
}

html[data-nav-glass][data-glass-displacement][data-theme=dark] #person {
  --person-glass-opacity: 84%;
}
