:root {
  --ink: #17231f;
  --muted: #535f58;
  --green: #173c34;
  --green-2: #285a4d;
  --lime: #cde878;
  --paper: #f4f5f1;
  --card: #ffffff;
  --line: #dce3dc;
  --warm: #ece7d8;
  --danger:#a63138;
  --surface-muted:#edf1eb;
  --control-height:48px;
  --control-radius:14px;
  --space-2:8px;
  --space-3:12px;
  --space-4:16px;
  --space-5:20px;
  --motion-fast:160ms;
  --shadow: 0 16px 50px rgba(23, 60, 52, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100dvh; max-width: 620px; margin: 0 auto; background: var(--paper); padding-bottom: 96px; }
.topbar { position: sticky; top: 0; z-index: 10; display:grid; grid-template-columns:72px minmax(0,1fr) 72px; align-items:center; gap:8px; padding: max(18px, env(safe-area-inset-top)) 16px 14px; background: var(--paper); }
.topbar h1 { margin:0; min-width:0; text-align:center; font-size:clamp(19px,4.5vw,24px); letter-spacing:-.04em; }
.brand-wordmark { justify-self:start; font-size:21px; font-weight:850; letter-spacing:-.065em; color:var(--green); line-height:1; }
.brand-wordmark > span { color:var(--green-2); }
.topbar > .icon-button { justify-self:end; }
.eyebrow, .metric-label, .block-label { font-size: 10px; letter-spacing: .14em; font-weight: 800; color: var(--muted); }
.icon-button { width: 44px; height: 44px; border-radius: 50%; border: 0; color: white; background: var(--green); font-weight: 750; }
main { padding: 8px 16px 20px; }
.view { display:none; animation: fade .22s ease; }
.view.active { display:block; }
@keyframes fade { from { opacity:.35; transform:translateY(4px); } }
.hero-card { display:grid; gap:var(--space-4); padding:var(--space-5); background:var(--surface-muted); border:1px solid var(--line); border-radius:20px; }
.hero-card h2 { margin:0 0 5px; font-size:clamp(31px,8vw,42px); line-height:1.03; letter-spacing:-.05em; overflow-wrap:anywhere; }
.hero-card p { margin:0; color:var(--muted); font-size:14px; line-height:1.45; }
.hero-card .primary { width:100%; }
.hero-card .text-button { margin-top:calc(-1 * var(--space-2)); text-align:left; min-height:44px; }
.today-meta { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-2); font-size:13px; font-weight:650; color:var(--muted); }
#hero-workout-status { color:var(--green); }
.block-label { color:#afc2ba; max-width:110px; line-height:1.5; }
.pill { display:inline-flex; padding:7px 11px; border-radius:999px; font-size:12px; font-weight:700; }
.pill-light { background:rgba(255,255,255,.12); color:white; }
.primary { border:0; border-radius:14px; padding:14px 18px; background:var(--green); color:#fff; font-weight:750; }
.primary.inverse { background:var(--lime); color:var(--green); }
.primary.wide { width:100%; margin-top:10px; }
.secondary { border:1px solid var(--line); border-radius:14px; padding:14px 18px; background:white; color:var(--ink); font-weight:700; }
.section-heading { display:flex; justify-content:space-between; align-items:center; margin:26px 2px 12px; }
.section-heading h2 { margin:0; font-size:22px; letter-spacing:-.02em; }
.section-heading > span { font-size:12px; color:var(--muted); }
.text-button { background:none; border:0; color:var(--green-2); font-size:13px; font-weight:750; padding:4px; }
.metric-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.metric-card { background:var(--card); border:1px solid rgba(23,60,52,.06); border-radius:20px; padding:17px; min-height:150px; display:flex; flex-direction:column; box-shadow:0 7px 24px rgba(23,60,52,.035); }
.metric-card strong { font-size:25px; letter-spacing:-.04em; margin-top:14px; }
.metric-card small { color:var(--muted); font-size:11px; margin-top:auto; }
.progress { height:5px; background:#e9ebe6; border-radius:20px; margin:13px 0 8px; overflow:hidden; }
.progress i { display:block; width:0; height:100%; border-radius:20px; background:var(--green-2); transition:width .35s ease; }
.trend { font-size:11px; font-weight:700; margin:13px 0 8px; }
.trend.neutral { color:var(--muted); }
.week-plan { display:flex; gap:9px; overflow:auto; padding-bottom:4px; scrollbar-width:none; }
.day-card { min-width:104px; border-radius:18px; background:white; border:1px solid var(--line); padding:15px 13px; }
.day-card.active { background:var(--warm); border-color:#ddd3b9; }
.day-card.done { background:var(--green); color:white; border-color:var(--green); }
.day-card span { display:block; font-size:11px; color:var(--muted); margin-bottom:20px; }
.day-card.done span { color:#bcd0c8; }
.day-card strong { font-size:13px; line-height:1.3; display:block; }
.day-card small { display:block; margin-top:8px; font-size:10px; opacity:.7; }
.coach-card { margin-top:24px; border:1px solid #d9ddcf; background:#eef1e6; border-radius:22px; padding:18px; display:flex; gap:14px; }
.coach-mark { width:42px; height:42px; flex:0 0 42px; border-radius:13px; display:grid; place-items:center; background:var(--green); color:white; font-size:12px; font-weight:800; }
.coach-card h3 { margin:5px 0 5px; font-size:16px; }
.coach-card p { margin:0; color:#56615b; font-size:13px; line-height:1.5; }
.bottom-nav { position:fixed; z-index:20; bottom:0; left:50%; transform:translateX(-50%); width:min(620px,100%); padding:9px 13px max(9px,env(safe-area-inset-bottom)); display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid rgba(23,60,52,.08); background:#fafaf6; }
.nav-button { border:0; background:none; display:flex; flex-direction:column; align-items:center; gap:4px; color:#89908b; font-size:10px; font-weight:700; padding:6px; }
.nav-button svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.nav-button:first-child svg { fill:currentColor; stroke:none; }
.nav-button.active { color:var(--green); }
.subnav { display:flex; padding:4px; border-radius:14px; background:#e8e8e1; margin-bottom:18px; }
.subnav-button { flex:1; border:0; background:none; border-radius:11px; padding:10px; color:var(--muted); font-weight:700; font-size:13px; }
.subnav-button.active { background:white; color:var(--ink); box-shadow:0 2px 7px rgba(0,0,0,.06); }
.block-summary { background:var(--green); color:white; border-radius:24px; padding:22px; display:flex; justify-content:space-between; align-items:center; }
.block-summary h2 { margin:7px 0; font-size:24px; letter-spacing:-.035em; }
.block-summary p { margin:0; color:#bdcec8; font-size:12px; line-height:1.5; max-width:270px; }
.block-summary .eyebrow { color:#b4c9c0; }
.week-ring { width:66px; height:66px; flex:0 0 66px; border-radius:50%; border:5px solid rgba(205,232,120,.25); border-top-color:var(--lime); display:flex; flex-direction:column; align-items:center; justify-content:center; }
.week-ring strong { font-size:20px; }
.week-ring span { font-size:9px; color:#c3d3cc; }
.program-list { display:flex; flex-direction:column; gap:10px; margin-top:16px; }
.program-card { border:1px solid var(--line); border-radius:20px; background:white; padding:17px; display:grid; grid-template-columns:44px 1fr auto; gap:13px; align-items:center; }
.program-card.done { opacity:.65; }
.program-index { width:44px; height:44px; border-radius:14px; background:#eef0e8; display:grid; place-items:center; font-size:12px; font-weight:800; color:var(--green); }
.program-title { display:block; margin:0 0 3px; font-size:15px; }
.optional-tag { display:inline-flex; vertical-align:2px; margin-left:5px; padding:3px 6px; border-radius:999px; background:#eef1e6; color:var(--green-2); font-size:8px; letter-spacing:.08em; }
.program-description { display:block; margin:0; color:var(--muted); font-size:11px; }
.program-arrow { color:var(--green); font-size:23px; padding:5px; }
.empty-state { padding:70px 24px; text-align:center; }
.empty-icon { width:60px; height:60px; border-radius:50%; background:var(--warm); display:grid; place-items:center; margin:0 auto 18px; font-size:25px; color:var(--green); }
.empty-state h2 { font-size:22px; }
.empty-state p { color:var(--muted); line-height:1.6; font-size:14px; }
.history-card { background:white; border:1px solid var(--line); border-radius:20px; padding:17px; margin-bottom:10px; }
.history-card header { display:flex; justify-content:space-between; }
.history-card h3 { margin:0; }
.history-card span, .history-card p { color:var(--muted); font-size:12px; }
.detail-button { border:1px solid var(--line); border-radius:10px; background:#f7f7f3; color:var(--green-2); padding:7px 10px; font-size:11px; font-weight:750; }
.exercise-history-list { display:flex; flex-direction:column; gap:8px; }
.exercise-history-card { display:flex; justify-content:space-between; align-items:center; gap:15px; padding:14px 16px; background:white; border:1px solid var(--line); border-radius:16px; }
.exercise-history-card h3 { margin:0 0 4px; font-size:13px; }
.exercise-history-card p,.history-hint { margin:0; color:var(--muted); font-size:11px; }
.exercise-history-card strong { font-size:13px; white-space:nowrap; }
.nutrition-hero { background:var(--warm); border-radius:24px; padding:22px; display:flex; justify-content:space-between; align-items:center; }
.nutrition-hero h2 { font-size:32px; margin:8px 0 0; letter-spacing:-.04em; }
.nutrition-hero h2 small { font-size:13px; color:var(--muted); font-weight:600; letter-spacing:0; }
.macro-ring { width:78px; height:78px; border-radius:50%; display:grid; place-items:center; background:conic-gradient(var(--green) 0deg, #dcdacb 0deg); position:relative; }
.macro-ring::after { content:""; position:absolute; inset:7px; background:var(--warm); border-radius:50%; }
.macro-ring span { z-index:1; font-weight:800; font-size:14px; }
.macro-row { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:11px 0 18px; }
.macro-row > div { padding:14px 10px; border:1px solid var(--line); border-radius:17px; background:white; }
.macro-row span,.macro-row small { display:block; font-size:10px; color:var(--muted); }
.macro-row strong { display:block; font-size:16px; margin:7px 0 4px; }
.add-meal-card { width:100%; border:0; background:var(--green); color:white; border-radius:20px; padding:18px; display:grid; grid-template-columns:42px 1fr auto; gap:13px; align-items:center; text-align:left; }
.add-meal-card .plus { width:42px; height:42px; display:grid; place-items:center; border-radius:13px; background:var(--lime); color:var(--green); font-size:26px; }
.add-meal-card strong,.add-meal-card small { display:block; }
.add-meal-card small { color:#b9ccc4; margin-top:3px; font-size:11px; }
.add-meal-card b { font-size:26px; font-weight:400; }
.meal-list { display:flex; flex-direction:column; gap:9px; }
.meal-card { display:grid; grid-template-columns:1fr auto; align-items:center; background:white; border:1px solid var(--line); padding:15px; border-radius:17px; }
.meal-card h3 { margin:0 0 4px; font-size:14px; }
.meal-card p { margin:0; color:var(--muted); font-size:11px; }
.meal-card strong { font-size:14px; }
.meal-actions { display:flex; align-items:center; gap:9px; }
.meal-actions button { width:27px; height:27px; border:0; border-radius:50%; background:#f3e9e6; color:#933e32; font-size:17px; }
.empty-meals { border:1px dashed #cfd4ca; border-radius:18px; padding:30px 18px; text-align:center; color:var(--muted); font-size:13px; }
.progress-hero { padding:26px 22px; background:var(--green); color:white; border-radius:24px; }
.progress-hero .eyebrow { color:#b7cac2; }
.progress-hero h2 { font-size:27px; max-width:360px; letter-spacing:-.04em; margin:9px 0; }
.progress-hero p { color:#bdcec8; line-height:1.5; font-size:13px; margin:0; }
.measurement-card { display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--line); border:1px solid var(--line); border-radius:20px; overflow:hidden; }
.measurement-card > div { background:white; padding:18px; }
.measurement-card span,.measurement-card small { display:block; font-size:11px; color:var(--muted); }
.measurement-card strong { display:block; margin:9px 0 5px; font-size:23px; }
.chart-card { height:190px; background:white; border:1px solid var(--line); border-radius:20px; padding:18px; }
.chart-placeholder { height:100%; position:relative; display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:12px; text-align:center; }
.chart-placeholder i { position:absolute; left:0; right:0; height:1px; background:#ebebe7; }
.chart-placeholder i:nth-of-type(1){top:15%}.chart-placeholder i:nth-of-type(2){top:40%}.chart-placeholder i:nth-of-type(3){top:65%}.chart-placeholder i:nth-of-type(4){top:90%}
.adherence-card { background:var(--warm); border-radius:20px; padding:18px; display:grid; grid-template-columns:110px 1fr; gap:18px; }
.adherence-score { display:flex; flex-direction:column; justify-content:center; border-right:1px solid #d9d4c3; }
.adherence-score strong { margin-right:var(--space-3); font-size:31px; letter-spacing:-.05em; }
.adherence-score span { color:var(--muted); font-size:10px; }
.adherence-list p { display:flex; justify-content:space-between; margin:8px 0; font-size:12px; }
.adherence-list span { color:var(--muted); }
.hidden { display:none !important; }
dialog { border:0; padding:0; color:var(--ink); }
dialog::backdrop { background:rgba(12,25,21,.48); backdrop-filter:blur(4px); }
.sheet { width:min(620px,100%); max-width:none; margin:auto auto 0; border-radius:24px 24px 0 0; background:var(--paper); }
.full-sheet { height:100dvh; border-radius:0; }
.sheet-header { display:grid; grid-template-columns:50px 1fr 60px; align-items:center; gap:8px; min-height:76px; padding:13px 16px; border-bottom:1px solid var(--line); background:rgba(243,242,236,.96); }
.sheet-header h2 { margin:3px 0 0; font-size:19px; }
.close-button { border:0; background:white; width:38px; height:38px; border-radius:50%; font-size:23px; color:var(--ink); }
.form-body { padding:20px 18px max(30px,env(safe-area-inset-bottom)); }
label { display:block; font-size:12px; font-weight:700; margin-bottom:15px; }
input { width:100%; margin-top:7px; border:1px solid var(--line); border-radius:14px; background:white; padding:14px; outline:none; }
input:focus { border-color:var(--green-2); box-shadow:0 0 0 3px rgba(40,90,77,.1); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 12px; }
.profile-row { display:flex; justify-content:space-between; gap:16px; padding:16px 0; border-bottom:1px solid var(--line); font-size:13px; }
.profile-row span { color:var(--muted); }
.profile-row strong { text-align:right; }
.profile-switcher { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.profile-switcher button { border:1px solid var(--line); border-radius:17px; padding:13px; background:white; color:var(--ink); display:flex; align-items:center; gap:10px; }
.profile-switcher button > span { width:34px; height:34px; flex:0 0 34px; display:grid; place-items:center; border-radius:50%; background:#e8ebe4; color:var(--green); font-size:11px; font-weight:800; }
.profile-switcher button.active { border-color:var(--green); background:#eef2e7; box-shadow:0 0 0 2px rgba(23,60,52,.06); }
.profile-switcher button.active > span { background:var(--green); color:white; }
.local-note { margin:11px 2px 6px; color:var(--muted); font-size:11px; line-height:1.45; }
.danger-button { width:100%; margin-top:26px; border:1px solid #d9b8b0; color:#933e32; background:#fff7f5; border-radius:14px; padding:14px; font-weight:700; }
.profile-gate { width:min(520px,calc(100% - 28px)); border-radius:26px; background:var(--paper); margin:auto; }
.profile-gate::backdrop { background:rgba(12,25,21,.78); backdrop-filter:blur(10px); }
.profile-gate-content { padding:30px 22px 24px; }
.profile-gate-content h2 { margin:8px 0 8px; font-size:30px; letter-spacing:-.04em; }
.profile-gate-content > p { margin:0 0 22px; color:var(--muted); font-size:13px; line-height:1.5; }
.profile-gate-options { display:flex; flex-direction:column; gap:10px; }
.profile-gate-options button { width:100%; border:1px solid var(--line); border-radius:19px; padding:15px; background:white; color:var(--ink); display:grid; grid-template-columns:44px 1fr auto; align-items:center; gap:13px; text-align:left; }
.profile-gate-options button > span { width:44px; height:44px; display:grid; place-items:center; border-radius:14px; background:var(--green); color:white; font-weight:800; font-size:12px; }
.profile-gate-options strong,.profile-gate-options small { display:block; }
.profile-gate-options small { margin-top:4px; color:var(--muted); font-size:11px; }
.profile-gate-options b { color:var(--green); font-size:24px; font-weight:400; }
.privacy-copy { display:block; margin-top:18px; color:var(--muted); line-height:1.4; text-align:center; }
.workout-status { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1px; background:var(--line); }
.workout-status > div { background:white; text-align:center; padding:8px 4px; }
.workout-status span { display:block; color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.1em; }
.workout-status strong span { display:inline; color:inherit; font:inherit; text-transform:none; letter-spacing:0; }
.workout-status strong { display:block; font-size:14px; margin-top:4px; }
.workout-status button { border:0; background:none; color:var(--muted); font-size:14px; font-weight:800; margin-top:3px; padding:0; }
.workout-status button.active { color:var(--green); }
.discard-link { display:block; margin:8px auto -4px; border:0; background:none; color:#8f5d54; font-size:10px; text-decoration:underline; }
.exercise-head { display:flex; justify-content:space-between; align-items:start; }
.exercise-head h2 { font-size:26px; margin:5px 0; letter-spacing:-.04em; }
.exercise-head p { color:var(--muted); font-size:12px; margin:0; }
.exercise-tip { margin:18px 0; background:var(--warm); border-radius:16px; padding:14px; font-size:12px; line-height:1.5; color:#525a55; }
.set-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.set-table :is(th,td) { padding:2px; text-align:center; border-bottom:1px solid var(--line); }
.set-table th[scope="row"] { color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; }
.set-input { width:70px; margin:0; padding:10px 5px; border-radius:10px; text-align:center; }
.completed-set :is(th,td) { background:#f0f4ea; }
.set-input.input-error { border-color:#b84c3f; box-shadow:0 0 0 3px rgba(184,76,63,.14); }
.recommendation { margin-top:18px; border-left:3px solid var(--lime); background:#eef2e7; border-radius:0 14px 14px 0; padding:13px; font-size:12px; line-height:1.5; }
.swap-control,.session-note { margin:16px 0; padding:13px; border-radius:14px; background:white; border:1px solid var(--line); }
.swap-control select { display:block; width:100%; margin-top:8px; border:0; background:#f3f4ef; color:var(--ink); border-radius:10px; padding:11px; font:inherit; }
.session-note input { margin-bottom:0; font-weight:400; }
.delete-text-button { border:0; background:none; color:#933e32; font-size:12px; font-weight:750; }
.history-dialog-intro { padding:14px 18px; background:#eef2e7; color:#56615b; font-size:11px; line-height:1.5; }
.history-dialog-body { padding:8px 16px 50px; }
.history-exercise { padding:15px 0; border-bottom:1px solid var(--line); }
.history-exercise h3 { margin:0 0 10px; font-size:16px; }
.history-set-grid { display:flex; flex-direction:column; gap:7px; }
.history-set-grid > div { display:grid; grid-template-columns:55px repeat(2,1fr); gap:7px; align-items:center; }
.history-set-grid span { color:var(--muted); font-size:10px; }
.history-set-grid input { margin:0; min-width:0; padding:10px 6px; text-align:center; }

@media (min-width:700px){
  body { padding:25px 0; }
  .app-shell { min-height:calc(100dvh - 50px); border-radius:30px; overflow:hidden; box-shadow:0 24px 80px rgba(23,60,52,.14); position:relative; }
  .bottom-nav { position:sticky; transform:none; left:auto; margin-top:20px; }
  .topbar { position:sticky; }
  .full-sheet { height:min(820px,95dvh); border-radius:24px; margin:auto; }
  .sheet:not(.full-sheet) { border-radius:24px; margin:auto; max-width:500px; }
}

/* Schedule swaps */
.schedule-hint { color:var(--muted); font-size:12px; line-height:1.5; margin:0 0 10px; }
#schedule-status:empty { display:none; }
#schedule-status { margin-top:10px; color:var(--green); }
.schedule-change { display:block; width:100%; min-height:44px; margin-top:12px; padding:8px; border:1px solid var(--line); border-radius:10px; background:var(--paper); color:var(--green); font-size:12px; font-weight:700; }
.schedule-change:focus-visible,.schedule-option:focus-visible { outline:3px solid var(--green-2); outline-offset:3px; }
.schedule-description { margin:0 0 18px; color:var(--muted); font-size:14px; line-height:1.5; }
.schedule-options { display:grid; gap:10px; }
.schedule-option { display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%; padding:15px; border:1px solid var(--line); border-radius:16px; background:white; color:var(--green); text-align:left; }
.schedule-option strong,.schedule-option small { display:block; }
.schedule-option small { margin-top:5px; font-size:12px; color:var(--muted); }
.schedule-option b { font-size:24px; }

@media (prefers-reduced-motion:reduce) { .view { animation:none; } .progress i { transition:none; } }

.day-preview { display:block; width:100%; padding:0; border:0; background:none; color:inherit; text-align:left; cursor:pointer; min-height:68px; }
.day-preview:focus-visible { outline:3px solid var(--green-2); outline-offset:4px; border-radius:5px; }
.preview-body { padding:18px 18px 100px; }
#preview-description { color:var(--muted); line-height:1.5; }
.preview-recommendation { margin-bottom:var(--space-4); padding:var(--space-4); border-radius:var(--control-radius); background:var(--surface-muted); color:var(--green); }
.preview-recommendation h3 { margin:4px 0; font-size:18px; letter-spacing:-.02em; }
.preview-recommendation p { margin:0; font-size:13px; color:var(--muted); }
#preview-exercises { padding-inline:var(--space-3); background:var(--card); border:1px solid var(--line); border-radius:var(--control-radius); }
.preview-exercise { padding-top:var(--space-3); border-bottom:1px solid var(--line); }
.preview-exercise:last-child { border-bottom:0; }
.preview-row { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:4px var(--space-2); }
.preview-row h3 { flex:1 1 9rem; min-width:0; margin:0; font-size:16px; overflow-wrap:anywhere; }
.preview-row > span { color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; }
.preview-exercise summary { width:fit-content; min-height:44px; padding-block:12px; color:var(--green); font-size:13px; font-weight:650; cursor:pointer; }
.preview-exercise details p { margin:0 0 var(--space-3); color:var(--muted); font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
#plan-this-week { min-height:44px; text-align:left; margin-bottom:4px; }
.recent-exercises { margin-bottom:var(--space-4); }
.recent-exercises h3 { margin:0 0 var(--space-2); font-size:16px; }
#recent-exercise-list { overflow:hidden; background:var(--card); border:1px solid var(--line); border-radius:var(--control-radius); }
.recent-exercise { display:grid; grid-template-columns:minmax(0,1fr) auto 16px; align-items:center; gap:var(--space-2); min-height:48px; width:100%; padding:var(--space-2) var(--space-3); border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--green); text-align:left; font-weight:700; }
.recent-exercise span:first-child { overflow-wrap:anywhere; }
.recent-exercise:last-child { border-bottom:0; }
.recent-exercise:active { background:var(--surface-muted); }
.recent-exercise:focus-visible { outline-offset:-3px; }
.recent-exercise small { color:var(--muted); font-weight:600; }
#add-workout-exercise-form :is(input,select) { font-size:16px; }
.preview-footer { position:sticky; bottom:0; background:var(--paper); padding:14px 18px max(14px,env(safe-area-inset-bottom)); border-top:1px solid var(--line); }
.preview-footer button { width:100%; }
select.set-input { width:100%; min-width:0; min-height:44px; padding:8px 2px; background:white; color:var(--ink); font:inherit; font-size:12px; border:1px solid var(--line); border-radius:10px; }
.set-table input.set-input { width:100%; min-width:0; margin-top:5px; }

.set-input[aria-invalid="true"] { border-color:#b84c3f; outline:2px solid rgba(184,76,63,.2); }

.week-toolbar { position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:4px; margin:20px 0 8px; }
.week-heading h2 { margin:0 0 3px; font-size:22px; letter-spacing:-.02em; }
#plan-week-label { margin:0; color:var(--muted); font-size:12px; line-height:1.35; }
.week-controls { display:flex; }
.week-controls button,.week-menu summary { width:44px; min-height:44px; display:grid; place-items:center; padding:0; font-size:24px; color:var(--green); }
.week-menu summary { cursor:pointer; list-style:none; border-radius:var(--control-radius); }
.week-menu summary::-webkit-details-marker { display:none; }
.week-menu[open] summary { background:var(--surface-muted); }
.week-actions { position:absolute; inset-inline-end:0; top:100%; z-index:5; display:grid; width:min(100%,240px); padding:6px 12px; border:1px solid var(--line); border-radius:var(--control-radius); background:var(--card); box-shadow:var(--shadow); }
.week-actions button { min-height:44px; text-align:left; }
.week-actions button:disabled { opacity:.4; cursor:default; }
.week-actions .schedule-hint { margin:4px 0; }
.rest-day { background:#eeeee7; min-width:125px; }
.last-result { margin:14px 0; padding:13px; border:1px solid var(--line); border-radius:14px; background:white; font-size:12px; line-height:1.6; }
.last-result p { margin:5px 0 10px; overflow-wrap:anywhere; }
.last-result p:last-child { margin-bottom:0; }
.strength-select-label { margin:0 0 7px; }
.strength-select { width:100%; min-height:44px; padding:10px; border:1px solid var(--line); border-radius:12px; background:white; color:var(--ink); margin-bottom:12px; font:inherit; }
.metric-chart { border-bottom:1px solid var(--line); padding:8px 0 16px; margin-bottom:14px; }
.metric-chart h3 { font-size:14px; margin:4px 0 12px; }
.metric-chart svg { display:block; width:100%; height:auto; max-height:230px; color:var(--ink); }
.metric-chart text { font-size:10px; fill:currentColor; }
.metric-chart p,.chart-note,.chart-empty { font-size:11px; color:var(--muted); line-height:1.6; overflow-wrap:anywhere; }
.metric-chart p { margin:0; }

.rest-day-content { min-height:68px; display:flex; flex-direction:column; justify-content:center; }
/* Training-first overview and compact workout logging. */
.week-summary { margin:14px 2px 0; font-size:13px; color:var(--muted); }
#week-plan .day-card > span { margin:0; font-size:11px; }
#week-plan .day-preview,#week-plan .rest-day-content { min-height:44px; }
#week-plan .day-card small { margin-top:3px; }
#week-plan .schedule-change { margin:0; font-size:11px; padding:6px 2px; }
.exercise-navigation { display:flex; overflow:auto; gap:6px; padding:10px 12px; border-bottom:1px solid var(--line); }
.exercise-navigation button { flex-shrink:0; border:1px solid var(--line); border-radius:10px; min-height:44px; padding:8px 12px; background:white; color:var(--green); font-size:12px; }
.exercise-navigation button.active { background:var(--green); color:white; }
.exercise-head { gap:10px; align-items:center; }
.exercise-head h2 { font-size:22px; }
.remove-exercise { border:0; background:none; color:#933e32; font-size:11px; min-height:44px; padding:5px; }
.remove-set { border:0; background:none; color:#933e32; min-width:30px; min-height:32px; font-size:19px; }
.weight-input { min-height:44px; font-size:16px; }
.add-set-button { width:100%; min-height:44px; border:1px dashed #9eafa4; border-radius:12px; color:var(--green); background:none; margin-top:8px; }
.last-result-inline { font-size:12px; color:var(--muted); line-height:1.6; }
.exercise-extras { font-size:12px; color:var(--muted); line-height:1.6; }
.exercise-extras summary { min-height:44px; padding:12px 0; color:var(--green); cursor:pointer; }
.session-empty { padding:30px 12px; line-height:1.6; }

.session-options { padding:0 12px; font-size:11px; color:var(--muted); }
.session-options summary { min-height:32px; padding-top:8px; cursor:pointer; }

button.program-card { width:100%; text-align:left; color:var(--ink); font:inherit; }
button.program-card:focus-visible { outline:3px solid var(--green-2); outline-offset:3px; }

.next-set td { border-top-color:#b5c985; border-bottom-color:#b5c985; background:#f7faef; }
.undo-banner { display:flex; gap:12px; justify-content:space-between; align-items:center; padding:10px 14px; background:#e9efd9; font-size:12px; }
.undo-banner button { min-height:44px; border:0; background:none; font-weight:700; color:var(--green); }
.set-suggestion-hint { margin:8px 14px; color:var(--muted); font-size:11px; line-height:1.4; }
.day-card.today { outline:2px solid var(--green-2); outline-offset:1px; }
.backup-controls { margin-top:22px; padding-top:14px; border-top:1px solid var(--line); }
.backup-controls p { font-size:12px; line-height:1.6; color:var(--muted); }
.backup-controls button { min-height:44px; margin-bottom:12px; }
#finish-save-error { color:#933e32; }

.rep-wheel-trigger { min-height:48px; width:100%; border:1px solid var(--line); border-radius:12px; background:white; color:var(--ink); font-size:18px; padding:8px; }
.rep-wheel-body { padding:12px 24px max(24px,env(safe-area-inset-bottom)); }
.rep-wheel-body > p { text-align:center; color:var(--muted); font-size:13px; }
.rep-wheel-frame { position:relative; max-width:230px; margin:12px auto; }
.rep-wheel { height:220px; overflow-y:auto; overscroll-behavior:contain; scroll-snap-type:y mandatory; padding:88px 0; scrollbar-width:none; touch-action:pan-y; -webkit-overflow-scrolling:touch; }
.rep-wheel::-webkit-scrollbar { display:none; }
.rep-wheel button { display:block; width:100%; height:44px; border:0; background:none; color:var(--muted); font-size:24px; scroll-snap-align:center; scroll-snap-stop:normal; }
.rep-wheel button[aria-selected="true"] { color:var(--green); font-size:29px; font-weight:750; }
.rep-wheel-highlight { position:absolute; top:88px; height:44px; left:0; right:0; pointer-events:none; border-top:1px solid #bac6b6; border-bottom:1px solid #bac6b6; border-radius:10px; background:rgba(23,60,52,.04); }
.rep-wheel-direct { display:flex; align-items:center; justify-content:center; gap:12px; font-weight:400; color:var(--muted); margin:14px 0; }
.rep-wheel-direct input { width:90px; margin:0; padding:8px; text-align:center; }
.rep-wheel:focus-visible { outline:2px solid var(--green-2); border-radius:12px; }

.schedule-drag-handle { touch-action:none; user-select:none; -webkit-user-select:none; cursor:grab; min-height:48px; width:44px; padding:0; border:0; border-radius:10px; background:transparent; color:var(--green); font-size:30px; line-height:1; }
.schedule-drag-handle:active { cursor:grabbing; }
.day-card.done .schedule-drag-handle { color:white; }
.schedule-drag-handle:focus-visible { outline:3px solid var(--green-2); outline-offset:2px; }
#week-plan .drag-source { opacity:.35; }
.week-drag-ghost { position:fixed; z-index:1000; pointer-events:none; background:var(--card); border:2px solid var(--green); box-shadow:0 12px 28px rgba(0,0,0,.18); border-radius:12px; color:var(--ink); }
.week-drag-ghost > span { margin:0; }
.week-drag-ghost .day-preview,.week-drag-ghost .rest-day-content { min-height:44px; }

.day-card .schedule-drag-handle > span { font-size:28px; margin:0; color:inherit; line-height:1; }


/* Shared controls, surfaces and safe-area spacing. */
:where(button, input, select, summary):focus-visible {
  outline: 2px solid var(--green-2);
  outline-offset: 3px;
}
.primary,.secondary { min-height:var(--control-height); border-radius:var(--control-radius); padding:10px var(--space-4); line-height:1.2; }
.primary:active,.secondary:active,.rep-wheel-trigger:active { filter:brightness(.92); }
.primary:disabled,.secondary:disabled { opacity:.5; cursor:default; }
.text-button,.nav-button,.subnav-button,.delete-text-button { min-height:44px; }
.icon-button,.close-button { width:44px; height:44px; }
input,select { font-size:16px; }
input[type="number"] { appearance:textfield; -moz-appearance:textfield; font-variant-numeric:tabular-nums; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { appearance:none; -webkit-appearance:none; margin:0; }
.sheet { max-height:100dvh; overscroll-behavior:contain; background:var(--paper); }
.sheet-header { position:sticky; top:0; z-index:2; grid-template-columns:44px minmax(0,1fr) 44px; background:var(--paper); }
.sheet-header > :nth-child(2) { text-align:center; }
.sheet-header h2 { overflow-wrap:anywhere; }
#workout-dialog > .sheet-header { padding-top:max(12px,env(safe-area-inset-top)); }
#workout-dialog[open] { display:flex; flex-direction:column; overflow:hidden; }
.workout-scroll { flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; scroll-padding-block:16px; }
.workout-footer { flex:none; }
.sheet-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-2); padding:var(--space-3) max(var(--space-4),env(safe-area-inset-right)) max(var(--space-3),env(safe-area-inset-bottom)) max(var(--space-4),env(safe-area-inset-left)); border-top:1px solid var(--line); background:var(--card); }
.sheet-actions button { width:100%; margin:0; min-height:52px; }
#finish-summary-dialog .receipt-header { display:block; min-height:0; padding:var(--space-4) var(--space-5); }
.receipt-header h2 { font-size:clamp(26px,7vw,34px); line-height:1.08; letter-spacing:-.04em; }
#finish-summary-dialog .form-body { padding:var(--space-3) var(--space-5); }
#finish-summary-dialog .sheet-actions { position:sticky; bottom:0; }
#finish-summary-dialog .receipt-saved-actions { grid-template-columns:1fr; }
.receipt-status { margin:0 0 var(--space-3); font-size:14px; font-weight:700; }
.receipt-status.is-complete { color:var(--green); }
.receipt-status span { display:inline-grid; place-items:center; width:21px; height:21px; margin-right:4px; border-radius:50%; background:var(--green); color:white; }
.receipt-stats { display:grid; grid-template-columns:1.2fr 1fr; gap:var(--space-2); margin:0 0 var(--space-3); }
.receipt-stats > div,.receipt-outcome { padding:var(--space-3); border-radius:var(--control-radius); }
.receipt-stats > div { background:var(--card); border:1px solid var(--line); }
.receipt-stats dt,.receipt-outcome p { margin:0; color:var(--muted); font-size:13px; }
.receipt-stats dd { margin:4px 0 0; font-size:clamp(19px,5.5vw,26px); font-weight:750; font-variant-numeric:tabular-nums; }
.receipt-outcome { display:grid; gap:3px; background:var(--surface-muted); overflow-wrap:anywhere; }
.receipt-outcome strong { color:var(--green); }
.receipt-exercises h3 { margin:var(--space-5) 0 4px; font-size:16px; }
.receipt-exercises details,.receipt-exercises > .receipt-exercise { border-bottom:1px solid var(--line); }
.receipt-exercise { display:grid; grid-template-columns:minmax(0,1fr) auto 10px; align-items:center; gap:var(--space-2); min-height:48px; padding-block:4px; list-style:none; font-size:14px; }
.receipt-exercise span { font-weight:650; overflow-wrap:anywhere; }
.receipt-exercise small { color:var(--muted); font-size:12px; }
.receipt-exercise::-webkit-details-marker { display:none; }
summary.receipt-exercise::after { content:""; width:6px; height:6px; border:solid var(--muted); border-width:0 1.5px 1.5px 0; transform:rotate(-45deg); }
details[open] > summary.receipt-exercise::after { transform:rotate(45deg); }
.receipt-exercises ul { margin:0 0 var(--space-2); padding-left:var(--space-5); color:var(--muted); font-size:13px; line-height:1.7; }
#finish-save-error:empty { display:none; }
#active-exercise { padding:8px var(--space-4) var(--space-5); }
.last-result-inline { margin:var(--space-2) 0; }
.set-number-col { width:34px; }
.set-actions-col { width:96px; }
.set-table td:last-child { white-space:nowrap; padding-inline:2px; }
.set-check,.remove-set { width:44px; min-width:44px; height:44px; min-height:44px; padding:0; vertical-align:middle; }
.set-check { display:inline-grid; place-items:center; border:0; border-radius:var(--control-radius); background:transparent; }
.set-check span { display:grid; place-items:center; width:23px; height:23px; border:1px solid #788880; border-radius:50%; color:transparent; font-size:14px; line-height:1; font-weight:800; }
.set-check[aria-pressed="true"] span { border-color:var(--green); background:var(--green); color:white; }
.set-check:active span { transform:scale(.9); }
.just-completed .set-check span { animation:set-checked var(--motion-fast) ease-out both; }
@keyframes set-checked { from { transform:scale(.8); } to { transform:scale(1); } }
.rep-wheel-trigger,.rep-wheel-direct input,.history-set-grid input[type="number"] {
  height:var(--control-height); min-height:var(--control-height); text-align:center;
  font-size:16px; font-weight:650; line-height:normal; font-variant-numeric:tabular-nums;
  padding:0 var(--space-2); border-radius:var(--control-radius);
}
.rep-wheel-trigger { position:relative; display:grid; place-items:center; }
.rep-wheel-sheet { margin-bottom:var(--keyboard-inset,0px); max-height:min(100dvh,var(--visible-height,100dvh)); }
.rep-wheel-direct input { scroll-margin-block:12px; }
.rep-wheel-sheet.keyboard-open .rep-wheel-frame { display:none; }
.set-value-group { display:inline-flex; align-items:baseline; justify-content:center; flex-wrap:wrap; column-gap:.24em; min-width:0; max-width:100%; }
.set-value { overflow-wrap:anywhere; }
.set-unit { font-size:.64em; font-weight:650; color:var(--muted); }
.rep-wheel-trigger[data-value=""] .set-unit { display:none; }
.rep-wheel-trigger[data-value=""] .set-value { color:var(--muted); font-size:13px; }
.exercise-swipe { --swipe-width:108px; position:relative; overflow:hidden; border-radius:var(--control-radius); isolation:isolate; }
.exercise-swipe .exercise-head { position:relative; min-height:70px; padding:var(--space-3); background:var(--card); touch-action:pan-y; transition:transform var(--motion-fast) ease-out; }
.exercise-swipe.revealed .exercise-head { transform:translateX(calc(-1 * var(--swipe-width))); }
.exercise-swipe.swiping .exercise-head { transition:none; user-select:none; }
.swipe-remove { position:absolute; inset:0 0 0 auto; width:var(--swipe-width); border:0; background:var(--danger); color:white; font-size:13px; font-weight:700; }
.swipe-remove:focus-visible { outline-offset:-5px; outline-color:white; }
.delete-text-button,.remove-set { color:var(--danger); }
.nav-button[aria-current="page"] { background:var(--surface-muted); border-radius:var(--control-radius); }
.subnav { background:var(--surface-muted); }
.program-card,.meal-card,.history-card,.chart-card,.day-card { border-radius:var(--control-radius); box-shadow:none; }
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:0s!important; transition-duration:0s!important; scroll-behavior:auto!important; }
}

/* Set controls and rest actions in the workout. */
#show-exercise-list { min-height:52px; margin:0; padding:6px; background:var(--card); color:var(--green); }
#show-exercise-list strong { margin-top:4px; }
.next-set-heading { display:flex; justify-content:space-between; align-items:center; gap:var(--space-2); }
.next-set-heading h3 { margin:0; color:var(--green); font-size:14px; }
.next-set-values { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-2); }
.set-table .rep-wheel-trigger { height:44px; min-height:44px; }
.rest-controls button { min-height:44px; padding-inline:8px; font-size:13px; }
.workout-announcement { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.exercise-navigation { display:grid; gap:var(--space-2); padding:var(--space-4); padding-bottom:max(var(--space-4),env(safe-area-inset-bottom)); }
.exercise-navigation button { display:grid; gap:4px; text-align:left; justify-items:start; white-space:normal; min-height:52px; }
.exercise-navigation button strong { font-size:15px; }
.exercise-navigation button[aria-current="step"] { border-color:var(--green-2); background:var(--surface-muted); }
.exercise-navigation button span { color:var(--muted); }

.return-set { display:block; width:100%; font-size:17px; }
.set-validation { padding:10px 12px; border-radius:var(--control-radius); background:#faecec; color:var(--danger); font-size:14px; }
.move-day-help { margin:12px 16px 0; color:var(--muted); font-size:14px; }

/* A continuous exercise surface and a permanent action area. */
.exercise-swipe { border-radius:0; }
.exercise-swipe .exercise-head { background:var(--paper); padding:12px 0 14px; min-height:88px; }
.exercise-head h2 { font-size:clamp(26px,6vw,34px); line-height:1.08; margin:0 0 6px; }
.exercise-head .exercise-last-weight { display:inline-block; margin-top:var(--space-2); padding:4px 8px; border-radius:var(--control-radius); background:var(--surface-muted); line-height:1.4; }
.exercise-last-weight strong { color:var(--ink); font-variant-numeric:tabular-nums; }
.next-set-card { margin-bottom:var(--space-2); padding:0 var(--space-2) 4px; border:1px solid var(--line); border-radius:var(--control-radius); background:var(--surface-muted); }
.next-set-heading h3 { padding-inline-start:4px; }
.next-set-values .rep-wheel-trigger { height:auto; min-height:58px; padding-block:4px; font-size:clamp(22px,7vw,30px); font-weight:750; }
#skip-next-set { width:auto; text-align:left; margin-top:0; }
.set-table .rep-wheel-trigger { height:auto; border:0; padding-inline:2px; background:transparent; }
.workout-footer { grid-template-columns:minmax(0,1fr) minmax(0,1.65fr); }

/* Calendar rows share one surface, with the drag handle kept separate. */
#week-plan { display:grid; grid-template-columns:1fr; overflow:visible; gap:0; background:var(--card); border:1px solid var(--line); border-radius:var(--control-radius); }
#week-plan .day-card,.week-drag-ghost { display:grid; grid-template-columns:78px minmax(0,1fr) 44px; align-items:center; gap:8px; min-height:58px; padding:3px 8px 3px 12px; }
#week-plan .day-card { min-width:0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; outline:none; }
#week-plan .day-card:last-child { border-bottom:0; }
#week-plan .day-card.today { background:var(--surface-muted); }
#week-plan .day-card.today:first-child { border-radius:var(--control-radius) var(--control-radius) 0 0; }
#week-plan .day-card.today:last-child { border-radius:0 0 var(--control-radius) var(--control-radius); }
.day-card time,.week-drag-ghost time { display:grid; gap:2px; font-size:12px; }
.day-card time span,.week-drag-ghost time span { margin:0; font-size:11px; color:var(--muted); }
.day-card.today time { color:var(--green); }
#week-plan .day-preview,.week-drag-ghost .day-preview { display:flex; align-items:center; justify-content:space-between; min-width:0; gap:6px; }
.day-card .day-preview strong,.week-drag-ghost .day-preview strong { overflow-wrap:anywhere; }
#week-plan .rest-day-content,.week-drag-ghost .rest-day-content { justify-content:center; color:var(--muted); margin:0; font-size:13px; }
.day-card .week-check,.day-card .week-chevron { margin:0; color:var(--green); font-size:16px; }
#week-plan .day-card.drop-target { background:#e1ebd7; outline:2px solid var(--green-2); outline-offset:-2px; color:var(--ink); }

/* Shared list surfaces and page hierarchy. */
#week-plan .day-card.today { box-shadow:inset 3px 0 var(--green-2); }
.day-card .week-check { display:inline-grid; place-items:center; flex:none; width:20px; height:20px; border-radius:50%; background:var(--green); color:var(--card); font-size:12px; }
.latest-receipt { display:flex; align-items:center; justify-content:space-between; gap:var(--space-2); width:100%; min-height:52px; margin-top:var(--space-3); padding:var(--space-2) 2px; background:transparent; border:0; border-top:1px solid var(--line); text-align:left; color:var(--green); }
.latest-receipt strong,.latest-receipt small { display:block; }
.latest-receipt small { margin-top:3px; color:var(--muted); }
.latest-receipt > span:last-child { font-size:22px; }
.strength-section > .section-heading { margin-top:4px; }
.strength-section .strength-select { min-height:48px; font-size:16px; }
#strength-overview { height:auto; padding:var(--space-3); }
.strength-lead { padding:4px 4px 0; }
.strength-lead span { display:block; font-size:13px; color:var(--muted); }
.strength-lead strong { display:block; margin-top:3px; color:var(--green); font-size:clamp(29px,8vw,38px); letter-spacing:-.04em; font-variant-numeric:tabular-nums; }
.strength-lead small { font-size:.5em; font-weight:650; letter-spacing:0; }
.strength-plot { height:128px; position:relative; }
.strength-plot svg { display:block; width:100%; height:100%; pointer-events:none; }
.strength-gridlines,.strength-line { fill:none; vector-effect:non-scaling-stroke; }
.strength-gridlines { stroke:var(--line); }
.strength-line { stroke:var(--green-2); stroke-width:2.25; stroke-linecap:round; stroke-linejoin:round; }
.strength-point { position:absolute; top:var(--y); left:var(--x); transform:translate(-50%,-50%); width:44px; height:44px; display:grid; place-items:center; border:0; border-radius:50%; background:transparent; }
.strength-point::before { content:attr(data-strength-value); position:absolute; inset:auto 0 33px; color:var(--green); font-size:11px; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; text-align:center; }
.strength-point span { width:14px; height:14px; border-radius:50%; border:2px solid var(--card); background:var(--green); box-shadow:0 0 0 1px var(--green); }
.strength-point:active span { transform:scale(.82); }
.strength-dates { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); color:var(--muted); font-size:11px; text-align:center; font-variant-numeric:tabular-nums; }
.strength-caption { color:var(--muted); margin:12px 4px 0; font-size:13px; line-height:1.5; }
.strength-caption strong { color:var(--green); }
.strength-more { margin-top:var(--space-3); border-top:1px solid var(--line); }
.strength-more summary { min-height:44px; padding-block:12px; color:var(--green); font-size:13px; font-weight:650; }
.measurement-card,.adherence-card { border-radius:var(--control-radius); }
.measurement-card strong span { display:inline; color:inherit; font:inherit; }
.adherence-card { background:var(--surface-muted); grid-template-columns:auto minmax(0,1fr); }
.history-card,.exercise-history-card,.meal-card,.profile-row { padding:12px 14px; margin:0; background:transparent; border:0; border-bottom:1px solid var(--line); border-radius:0; }
.history-card:last-child,.exercise-history-card:last-child,.meal-card:last-child,.profile-row:last-child { border-bottom:0; }
.history-card header { align-items:center; gap:var(--space-2); }
.history-card p { margin:5px 0 0; }
.history-card .detail-button { flex:none; min-height:44px; }
.exercise-history-list,.meal-list { gap:0; }
.meal-card { grid-template-columns:minmax(0,1fr) auto; min-height:62px; }
.meal-card h3 { overflow-wrap:anywhere; }
.profile-facts { margin-top:var(--space-4); }
.profile-row strong { overflow-wrap:anywhere; }

#view-overview .week-summary { margin:4px 0 0; }
.block-summary { color:var(--ink); background:transparent; padding:8px 0 0; gap:12px; }
.block-summary .eyebrow,.block-summary p { color:var(--muted); }
.block-summary h2 { font-size:clamp(22px,5vw,28px); }
.block-week { white-space:nowrap; align-self:flex-start; background:var(--surface-muted); color:var(--green); border-radius:10px; padding:8px; font-size:12px; }
.program-list,.nutrition-summary,#history-list:not(:empty),.exercise-history-list:not(:empty),.meal-list:has(.meal-card),.profile-facts { gap:0; background:var(--card); border:1px solid var(--line); border-radius:var(--control-radius); }
button.program-card { border:0; border-radius:0; border-bottom:1px solid var(--line); grid-template-columns:minmax(0,1fr) 28px; gap:8px; min-height:66px; padding:12px 14px; background:transparent; }
button.program-card:last-child { border-bottom:0; }
button.program-card:focus-visible { outline-offset:-3px; }
.program-copy { min-width:0; }
.program-description { line-height:1.35; }
.program-arrow { text-align:center; padding:0; }
.nutrition-hero { background:transparent; padding:16px; border-radius:0; gap:12px; }
.nutrition-hero h2 small { white-space:nowrap; }
.nutrition-hero .macro-ring { flex:none; }
.macro-row { gap:0; margin:0; border-top:1px solid var(--line); }
.macro-row > div { background:transparent; border:0; border-right:1px solid var(--line); border-radius:0; padding:12px 10px; overflow-wrap:anywhere; }
.macro-row > div:last-child { border-right:0; }
.add-meal-card { margin-top:12px; min-height:54px; padding:8px 12px; border-radius:var(--control-radius); }
.add-meal-card .plus { background:transparent; color:inherit; }
#workout-preview-dialog[open] { display:flex; flex-direction:column; overflow:hidden; }
#workout-preview-dialog .preview-body { flex:1; min-height:0; overflow:auto; padding-bottom:16px; }
#workout-preview-dialog .preview-footer { position:static; flex:none; padding-top:12px; padding-bottom:max(12px,env(safe-area-inset-bottom)); }
#profile-dialog .profile-body { padding-inline:var(--space-4); }

#workout-feedback { grid-column:1/-1; margin:0; color:var(--green); font-size:.875rem; }
#workout-feedback:empty { display:none; }

/* Program edits and the compact rest strip. */
.preview-custom-heading:has(#preview-reset-all.hidden):has(#preview-custom-status:empty) { display:none; }
.preview-custom-heading { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:4px var(--space-2); margin-bottom:var(--space-2); }
.preview-custom-heading p { margin:0; color:var(--green); font-size:13px; }
.preview-custom-heading p:empty { display:none; }
.preview-custom-heading button,.preview-custom-row button { min-height:44px; }
.preview-custom-row { display:flex; align-items:center; justify-content:space-between; gap:var(--space-2); color:var(--green); }
.preview-custom-row small { overflow-wrap:anywhere; }
#future-exercise-actions:empty,#future-exercise-status:empty { display:none; }
#future-exercise-actions fieldset { display:flex; flex-wrap:wrap; gap:var(--space-2); padding:var(--space-2); border:1px solid var(--line); border-radius:var(--control-radius); }
#future-exercise-actions legend { padding-inline:4px; color:var(--green); font-weight:700; }
#future-exercise-actions button { min-height:44px; padding:8px 12px; }
#future-exercise-status,.backup-controls .last-backup-export { color:var(--green); font-weight:650; }
.rest-controls { grid-column:1/-1; display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:4px; align-items:center; padding:0 4px 0 var(--space-2); border-radius:var(--control-radius); background:var(--surface-muted); }
.rest-readout { display:flex; flex-wrap:wrap; align-items:baseline; column-gap:6px; line-height:1.1; color:var(--muted); font-size:12px; }
.rest-readout strong { color:var(--green); font-size:17px; font-variant-numeric:tabular-nums; }
.rest-readout small { font-size:11px; }
.rest-readout small:empty { display:none; }
