
    :root {
      /* Rosé Pine Dawn notebook tokens. */
      --bg: #faf4ed;
      --surface: #fffaf3;
      --surface-2: #f2e9e1;
      --surface-raised: #fffdf8;
      --ink: #575279;
      --ink-strong: #3f3b59;
      --muted: #797593;
      --subtle: #9893a5;
      --line: #dfdad9;
      --line-strong: #cecacd;
      --accent: #286983;
      --accent-hover: #1f5266;
      --accent-soft: #dce9e8;
      --accent-ink: #1f5266;
      --pine: #286983;
      --pine-soft: #dce9e8;
      --rose: #d7827e;
      --rose-soft: #f5dfdc;
      --gold: #ea9d34;
      --gold-soft: #fae9cc;
      --foam: #56949f;
      --iris: #907aa9;
      --danger: #b4637a;
      --danger-soft: #f4dce4;
      --on-accent: #fffaf3;
      --warning: #b86b20;
      --focus-ring: rgba(40,105,131,.20);
      --shadow-color: rgba(87,82,121,.10);
      --backdrop: rgba(63,59,89,.34);
      --shadow-soft-color: rgba(87,82,121,.07);
      --theme-color: #faf4ed;
      --heat-0: #e7e3e1;
      --heat-1: #dce9e8;
      --heat-2: #b9d6d8;
      --heat-3: #81b5bd;
      --heat-4: #56949f;
      --heat-5: #286983;
      --shadow: 0 14px 34px var(--shadow-color);
      --shadow-soft: 0 6px 18px var(--shadow-soft-color);
      --radius-sm: 14px;
      --radius-md: 20px;
      --radius-lg: 28px;
      --font-sans: "Aptos", "Segoe UI", system-ui, sans-serif;
      --font-display: Georgia, "Iowan Old Style", Charter, serif;
    }
    [data-theme="dark"] {
      color-scheme: dark;
      --bg: #191724;
      --surface: #1f1d2e;
      --surface-2: #26233a;
      --surface-raised: #26233a;
      --ink: #e0def4;
      --ink-strong: #f4f0ff;
      --muted: #6e6a86;
      --subtle: #908caa;
      --line: #393552;
      --line-strong: #524f67;
      --accent: #31748f;
      --accent-hover: #56949f;
      --accent-soft: #263c4a;
      --accent-ink: #9ccfd8;
      --pine: #31748f;
      --pine-soft: #263c4a;
      --rose: #ebbcba;
      --rose-soft: #49323e;
      --gold: #f6c177;
      --gold-soft: #463b32;
      --foam: #9ccfd8;
      --iris: #c4a7e7;
      --danger: #eb6f92;
      --danger-soft: #4d2e3c;
      --on-accent: #e0def4;
      --warning: #f6c177;
      --focus-ring: rgba(156,207,216,.24);
      --shadow-color: rgba(0,0,0,.34);
      --shadow-soft-color: rgba(0,0,0,.20);
      --backdrop: rgba(10,8,18,.72);
      --theme-color: #191724;
      --heat-0: #302d46;
      --heat-1: #334858;
      --heat-2: #3e6b79;
      --heat-3: #56949f;
      --heat-4: #82bcc5;
      --heat-5: #9ccfd8;
    }
    * { box-sizing: border-box; }
    html { --bottom-nav-clearance: calc(118px + env(safe-area-inset-bottom)); background: var(--bg); color: var(--ink); scroll-padding-bottom: var(--bottom-nav-clearance); }
    body { margin: 0; min-height: 100vh; font-family: var(--font-sans); background: var(--bg); scroll-padding-bottom: var(--bottom-nav-clearance); }
    button, input, textarea, select { font: inherit; }
    button { color: inherit; }
    a { color: inherit; }
    .app { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
    /* Opaque backdrop behind the iOS status bar / Dynamic Island so scrolled content
       slides underneath it instead of colliding with the clock. Zero-height elsewhere. */
    .status-scrim { position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--bg); z-index: 40; pointer-events: none; }
    .shell { width: min(1120px, 100%); margin: 0 auto; padding: 28px 24px 112px; }
    .topline { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
    .top-actions { display: flex; align-items: center; gap: 12px; }
    .add-exercise { min-height: 42px; padding: 0 14px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--surface-raised); font-weight: 750; cursor: pointer; white-space: nowrap; }
    .add-exercise:hover { background: var(--accent-hover); }
    h1, h2, h3, p { margin-top: 0; }
    h1 { margin-bottom: 5px; font: 400 clamp(34px, 5vw, 56px)/1 var(--font-display); letter-spacing: -.04em; }
    .lede { margin: 0; color: var(--muted); font-size: 15px; }
    .source-link { flex: 0 0 auto; font-size: 13px; color: var(--muted); text-underline-offset: 3px; }
    .controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-bottom: 16px; }
    .search-wrap { position: relative; }
    .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
    .search { width: 100%; height: 52px; padding: 0 44px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); outline: none; transition: border-color .16s, box-shadow .16s; }
    .search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
    .clear-search { position: absolute; right: 9px; top: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; display: none; }
    .clear-search.visible { display: grid; place-items: center; }
    .filter-button { min-width: 116px; height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
    .filter-button[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
    .filter-panel { display: none; grid-template-columns: minmax(0, 1.6fr) minmax(220px, .7fr); gap: 18px; margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
    .filter-panel.open { display: grid; }
    .filter-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
    .filter-group label, .filter-label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
    .filter-clear { padding: 2px 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; cursor: pointer; }
    .filter-clear[hidden] { display: none; }
    .muscle-options { display: flex; flex-wrap: wrap; gap: 7px; }
    .muscle-option { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 12px; text-transform: capitalize; }
    .muscle-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
    select { width: 100%; min-height: 42px; margin-top: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; }
    .summary-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 2px 12px; }
    .library-section + .library-section { margin-top: 28px; }
    .library-heading { margin: 0 2px 10px; font-size: 15px; letter-spacing: -.01em; }
    .result-count { margin: 0; font-size: 13px; color: var(--muted); }
    .active-query { font-weight: 700; color: var(--ink); }
    .exercise-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .exercise-card { min-width: 0; min-height: 164px; padding: 18px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: transform .14s, box-shadow .14s, border-color .14s; }
    .exercise-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
    .exercise-card:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
    .exercise-card h2 { margin: 0 0 20px; font-size: 18px; line-height: 1.18; letter-spacing: -.02em; }
    .tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
    .tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 11px; text-transform: capitalize; }
    .tag.primary { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
    .tag.custom { background: var(--gold-soft); color: var(--warning); font-weight: 700; }
    .empty { padding: 60px 20px; text-align: center; color: var(--muted); grid-column: 1 / -1; }

    .custom-dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: 0 24px 70px var(--focus-ring); overflow: auto; scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
    .custom-dialog::backdrop { background: var(--backdrop); }
    .custom-form { padding: 24px; }
    .custom-form-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
    .custom-form-head h2 { margin: 0 0 5px; font: 400 30px/1.05 var(--font-display); letter-spacing: -.03em; }
    .custom-form-head p { margin: 0; color: var(--muted); font-size: 13px; }
    .dialog-close { flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1; }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
    .field { display: grid; gap: 7px; }
    .field.wide { grid-column: 1 / -1; }
    .field label { color: var(--muted); font-size: 12px; font-weight: 700; }
    .field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink); outline: none; }
    .field input { min-height: 44px; padding: 0 12px; }
    .field textarea { min-height: 96px; padding: 11px 12px; resize: vertical; }
    .field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
    .field-help { color: var(--muted); font-size: 11px; line-height: 1.35; }
    fieldset.field { min-width: 0; margin: 0; padding: 0; border: 0; }
    fieldset.field legend { padding: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
    .form-pill-options { display: flex; flex-wrap: wrap; gap: 7px; }
    .form-pill { min-height: 36px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 12px; text-transform: capitalize; }
    .form-pill[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
    .form-pill:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
    .form-error { min-height: 18px; margin: 12px 0 0; color: var(--danger); font-size: 12px; }
    .form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 5px; }
    .form-action { min-height: 42px; padding: 0 15px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 700; }
    .form-action.secondary { border: 1px solid var(--line); background: var(--surface); }
    .form-action.primary { border: 0; background: var(--accent); color: var(--surface-raised); }
    .custom-tools { display: flex; gap: 8px; margin-top: 18px; }
    .custom-tool { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 700; }
    .custom-tool.danger { color: var(--danger); border-color: var(--rose); }
    .empty strong { display: block; color: var(--ink); font: 400 26px/1.2 var(--font-display); margin-bottom: 8px; }

    .detail { display: none; }
    .detail.active { display: block; }
    .library.hidden { display: none; }
    .back { margin: 0 0 26px; padding: 9px 12px 9px 9px; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
    .back:hover { background: var(--surface-2); color: var(--ink); }
    .detail-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; margin-bottom: 26px; }
    .detail-title { font: 400 clamp(36px, 6vw, 64px)/.98 var(--font-display); letter-spacing: -.045em; margin-bottom: 16px; }
    .detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }
    .source-id { color: var(--muted); font-size: 12px; text-align: right; max-width: 240px; }
    .source-id a { text-underline-offset: 3px; }
    .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
    .stat { padding: 18px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-md); }
    .stat-label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
    .stat-value { display: block; font-size: clamp(24px, 4vw, 34px); line-height: 1; font-weight: 750; letter-spacing: -.04em; }
    .stat-sub { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
    .detail-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr); gap: 22px; align-items: start; }
    .section { margin-bottom: 28px; }
    .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
    .section h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
    .section-note { margin: 0; color: var(--muted); font-size: 12px; }
    .history-list { border-top: 1px solid var(--line); }
    .history-session { padding: 15px 0; border-bottom: 1px solid var(--line); }
    .session-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
    .session-date { font-size: 14px; font-weight: 750; }
    .session-est { font-size: 12px; color: var(--muted); }
    .sets { display: grid; gap: 7px; }
    .set-row { display: grid; grid-template-columns: 48px 1fr 1fr 1fr; gap: 10px; align-items: center; min-height: 36px; padding: 0 10px; border-radius: var(--radius-sm); background: var(--surface); font-variant-numeric: tabular-nums; }
    .set-num { color: var(--muted); font-size: 11px; font-weight: 700; }
    .set-cell { font-size: 13px; }
    .set-cell strong { font-size: 14px; }
    .history-empty { padding: 30px 16px; color: var(--muted); background: var(--surface); border-radius: var(--radius-md); }
    .note-card { padding: 18px; background: var(--surface); border-radius: var(--radius-md); color: var(--ink-strong); line-height: 1.55; font-size: 14px; }
    .note-meta { display: block; margin-top: 12px; color: var(--muted); font-size: 11px; }
    .movement-card { padding: 18px; background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--line); }
    .movement-card dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; margin: 0; font-size: 13px; }
    .movement-card dt { color: var(--muted); }
    .movement-card dd { margin: 0; text-align: right; text-transform: capitalize; font-weight: 700; }
    .instructions { padding-left: 20px; margin: 0; color: var(--ink); font-size: 13px; line-height: 1.55; }
    .instructions li + li { margin-top: 9px; }
    .similar-grid { display: block; }
    .similar-chevron { color: var(--muted); font-size: 18px; line-height: 1; }
    .score { color: var(--muted); font-size: 11px; }
    .formula { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
    .workout-view, .program-view { display: none; }
    .workout-view.active, .program-view.active { display: block; }
    .workout-start { max-width: 680px; padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
    .workout-start h2 { margin-bottom: 8px; font: 400 clamp(28px, 5vw, 42px)/1.05 var(--font-display); letter-spacing: -.035em; }
    .workout-start p { max-width: 520px; margin-bottom: 24px; color: var(--muted); line-height: 1.5; }
    .start-actions, .workout-actions { display: flex; flex-wrap: wrap; gap: 9px; }
    .primary-button, .secondary-button { min-height: 44px; padding: 0 15px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 750; }
    .primary-button { border: 0; background: var(--accent); color: var(--surface-raised); }
    .secondary-button { border: 1px solid var(--line); background: var(--surface); }
    .primary-button:hover { background: var(--accent-hover); }
    .workout-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .35fr); gap: 12px; margin-bottom: 22px; }
    .workout-meta .field input { background: var(--surface); }
    .workout-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
    .workout-toolbar h2 { margin: 0; font-size: 18px; }
    .draft-status { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
    .draft-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
    .workout-exercises { display: grid; gap: 14px; }
    .swipe-item { position: relative; overflow: hidden; border-radius: var(--radius-md); background: transparent; }
    .swipe-content { position: relative; z-index: 1; transform: translateX(0); transition: transform .18s ease; touch-action: pan-y; }
    .swipe-item.is-open .swipe-content { transform: translateX(-82px); }
    .swipe-delete-action { position: absolute; inset: 0 0 0 auto; width: 82px; border: 0; background: var(--danger); color: var(--surface-raised); cursor: pointer; font-size: 12px; font-weight: 800; }
    .workout-exercise { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
    .workout-exercise.swipe-content { border: 0; }
    .workout-exercise-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
    .workout-exercise-head h3 { margin: 0 0 5px; font-size: 18px; letter-spacing: -.02em; }
    .workout-exercise-head p { margin: 0; color: var(--muted); font-size: 12px; text-transform: capitalize; }
    /* Collapsible exercise cards in the live workout */
    .workout-exercise.exercise-accordion { padding: 0; }
    .exercise-accordion-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; cursor: pointer; list-style: none; }
    .exercise-accordion-head::-webkit-details-marker { display: none; }
    .exercise-accordion-title { display: grid; gap: 3px; min-width: 0; }
    .exercise-accordion-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; letter-spacing: -.01em; }
    .exercise-accordion-title small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
    .exercise-accordion-chevron { flex: none; color: var(--muted); font-size: 20px; line-height: 1; transition: transform .18s ease; }
    .exercise-accordion-actions { flex: none; display: flex; align-items: center; gap: 10px; }
    .exercise-info-button { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; font-style: italic; font-family: Georgia, serif; line-height: 1; cursor: pointer; }
    .exercise-info-button:active { transform: scale(.94); }
    .exercise-accordion[open] .exercise-accordion-chevron { transform: rotate(90deg); }
    .exercise-accordion-body { padding: 2px 18px 18px; }
    /* Pretty date display over a native date input */
    .date-field { position: relative; }
    .date-display { width: 100%; min-height: 44px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; font-weight: 600; text-align: left; }
    .date-display:hover { border-color: var(--line-strong); }
    .date-display::after { content: '▾'; color: var(--muted); font-size: 12px; }
    .date-input-hidden { position: absolute; bottom: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
    .swipe-hint { color: var(--muted); font-size: 11px; white-space: nowrap; }
    .log-labels, .log-set { display: grid; grid-template-columns: 42px minmax(82px, .75fr) minmax(74px, .65fr) minmax(74px, .65fr) 42px; gap: 8px; align-items: start; }
    .log-labels { margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 750; }
    .set-swipe + .set-swipe { margin-top: 12px; }
    .log-set { padding: 7px 0; }
    .log-set-number { width: 34px; min-height: 42px; padding: 0; display: grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 800; }
    .log-set-number:hover, .log-set-number:focus-visible { border-color: var(--line); background: var(--surface-2); color: var(--ink); outline: none; }
    .log-set-number.has-tags { border-color: var(--foam); background: var(--accent-soft); color: var(--accent); }
    .weight-entry { min-width: 0; display: grid; gap: 3px; }
    .weight-total-hint { justify-self: end; margin-right: 2px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; line-height: 1; text-transform: uppercase; }
    .log-input { width: 100%; min-width: 0; height: 42px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink); outline: none; font-variant-numeric: tabular-nums; }
    .log-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
    .selected-set-tags { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 5px; min-height: 0; }
    .selected-set-tags:empty { display: none; }
    .set-tag-chip { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 10px; font-weight: 700; }
    .complete-set { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 18px; font-weight: 900; }
    .complete-set[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--surface-raised); }
    .log-set.is-complete .log-input { background: var(--pine-soft); border-color: var(--foam); }
    .set-swipe { border-radius: var(--radius-sm); }
    .set-swipe .swipe-delete-action { width: 76px; }
    .set-swipe.is-open .swipe-content { transform: translateX(-76px); }
    .add-set { margin: 12px 0 0 42px; padding: 7px 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 750; }
    .workout-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
    .workout-error { margin: 0; color: var(--danger); font-size: 12px; }
    .picker-search { width: 100%; height: 44px; margin-bottom: 12px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; }
    .picker-list { display: grid; gap: 7px; max-height: 48vh; overflow-y: auto; overscroll-behavior: contain; scroll-padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
    #exercisePickerList { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .picker-section-label { margin: 8px 2px 2px; color: var(--muted); font-size: 11px; font-weight: 800; }
    .picker-item { min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; text-align: left; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; }
    .picker-item strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 14px; }
    .picker-item > span:first-child > span { color: var(--muted); font-size: 11px; text-transform: capitalize; }
    .picker-item .picker-state { color: var(--accent); font-size: 20px; font-weight: 800; }
    .picker-item[aria-pressed="true"] { border-color: var(--foam); background: var(--pine-soft); }
    .picker-footer { position: sticky; bottom: -24px; margin: 14px -24px -24px; padding: 12px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); display: flex; justify-content: flex-end; }
    .dialog-empty { padding: 28px 8px; text-align: center; color: var(--muted); }
    .tag-dialog { width: min(430px, calc(100% - 28px)); }
    .tag-picker-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
    .tag-picker-options .form-pill { min-height: 40px; }
    .tag-list-editor { padding-top: 12px; border-top: 1px solid var(--line); }
    .tag-list-editor summary { color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
    .tag-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 12px 0 14px; }
    .tag-editor input { min-width: 0; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; }
    .tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
    .tag-list-item { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px 4px 9px; border-radius: 999px; background: var(--surface-2); font-size: 11px; }
    .tag-list-item button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--line); color: var(--muted); cursor: pointer; }
    .completed-card { max-width: 760px; padding: clamp(22px, 5vw, 38px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); scroll-margin-bottom: var(--bottom-nav-clearance); }
    .completed-mark { width: 38px; height: 38px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 900; }
    .completed-card h2 { margin-bottom: 6px; font: 400 clamp(28px, 5vw, 40px)/1.05 var(--font-display); letter-spacing: -.035em; }
    .completed-meta { color: var(--muted); font-size: 13px; }
    .completed-exercises { margin: 22px 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
    .completed-exercises li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
    .completed-exercises span { color: var(--muted); }
    .program-setup { max-width: 700px; padding: clamp(22px, 5vw, 42px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
    .program-setup h2, .program-cover-head h2 { margin-bottom: 8px; font: 400 clamp(28px, 5vw, 44px)/1.04 var(--font-display); letter-spacing: -.035em; }
    .program-setup > p { color: var(--muted); line-height: 1.5; }
    .program-form { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 14px; margin-top: 22px; }
    .program-form .wide { grid-column: 1 / -1; }
    .program-cover { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
    .program-cover-head { padding: clamp(24px, 5vw, 46px); background: var(--pine); color: var(--surface-raised); }
    .program-cover-kicker { margin-bottom: 10px; color: var(--gold-soft); font-size: 12px; font-weight: 800; }
    .program-cover-meta { margin: 0; color: var(--pine-soft); line-height: 1.5; }
    .program-body { padding: clamp(20px, 4vw, 34px); }
    .program-progress { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
    .program-workouts { display: grid; gap: 8px; margin: 12px 0 18px; }
    .program-workout { min-height: 62px; padding: 12px 14px; background: var(--surface); display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; align-items: center; }
    .program-workout-index { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 800; }
    .program-workout strong { display: block; font-size: 14px; }
    .program-workout span { color: var(--muted); font-size: 11px; }
    .program-add { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
    .program-add input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; }
    .program-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
    .session-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
    .bottom-nav { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20; width: min(580px, calc(100% - 24px)); margin: 0; transform: translateX(-50%); display: grid; grid-template-columns: repeat(6, 1fr); padding: 6px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface-raised); box-shadow: 0 10px 30px var(--shadow-color); }
    .nav-item { min-height: 50px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); display: grid; place-items: center; gap: 2px; cursor: pointer; font-size: 11px; }
    .nav-item.active { background: var(--accent); color: var(--surface-raised); }
    .nav-item.has-live-draft { position: relative; }
    .nav-item.has-live-draft:not(.active) { background: var(--rose-soft); color: var(--ink); }
    .nav-item.has-live-draft::after { content: ''; position: absolute; top: 6px; left: 50%; margin-left: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 2px var(--surface-raised); pointer-events: none; }
    .nav-item[disabled] { opacity: .42; cursor: default; }
    .small-button[disabled] { opacity: .45; cursor: default; }
    .nav-item svg { width: 19px; height: 19px; }
    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

    @media (max-width: 820px) {
      .exercise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .detail-layout { grid-template-columns: 1fr; }
      .detail-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
      .detail-aside .section { margin-bottom: 0; }
    }
    @media (max-width: 580px) {
      .shell { padding: 20px 16px 112px; }
      .topline { align-items: start; }
      .top-actions { flex-direction: column-reverse; align-items: flex-end; gap: 8px; }
      .source-link { margin-top: 0; font-size: 11px; }
      .add-exercise { min-height: 40px; padding: 0 11px; font-size: 13px; }
      .custom-form { padding: 20px 16px; }
      .form-grid { grid-template-columns: 1fr; }
      .field.wide { grid-column: auto; }
      .controls { grid-template-columns: 1fr auto; gap: 8px; }
      .filter-button { min-width: 52px; width: 52px; padding: 0; }
      .filter-button span { display: none; }
      .filter-panel { grid-template-columns: 1fr; }
      .muscle-options { gap: 6px; }
      .muscle-option { min-height: 36px; }
      .exercise-grid { grid-template-columns: 1fr; gap: 8px; }
      .exercise-card { min-height: 128px; padding: 16px; }
      .exercise-card h2 { margin-bottom: 15px; }
      .detail-header { grid-template-columns: 1fr; gap: 12px; }
      .source-id { text-align: left; max-width: none; }
      .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .stat:first-child { grid-column: 1 / -1; }
      .stat { padding: 16px; }
      .detail-aside { grid-template-columns: 1fr; }
      .set-row { grid-template-columns: 36px repeat(3, 1fr); gap: 5px; padding: 0 8px; }
      .workout-meta { grid-template-columns: 1fr; }
      .workout-toolbar { align-items: flex-end; }
      .workout-exercise { padding: 15px 12px; }
      .log-labels { display: none; }
      .log-set { grid-template-columns: 34px repeat(3, minmax(0, 1fr)) 42px; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); background: var(--surface); }
      .log-set-number { grid-row: 1; grid-column: 1; }
      .log-set .weight-entry { grid-row: 1; grid-column: 2; }
      .log-set .reps-input { grid-row: 1; grid-column: 3; }
      .log-set .rpe-input { grid-row: 1; grid-column: 4; }
      .log-set .complete-set { grid-row: 1; grid-column: 5; }
      .selected-set-tags { grid-row: 2; grid-column: 2 / 6; }
      .log-input { padding: 0 6px; text-align: center; }
      .log-input::placeholder { font-size: 10px; }
      .add-set { margin-left: 34px; }
      .workout-footer { align-items: flex-start; flex-direction: column; }
      .workout-footer .workout-actions { width: 100%; }
      .workout-footer .workout-actions button { flex: 1; }
      .swipe-hint { display: none; }
      .program-form { grid-template-columns: 1fr; }
      .program-form .wide { grid-column: auto; }
      .program-add { grid-template-columns: 1fr; }
      .program-add button { width: 100%; }
      .picker-footer { bottom: -20px; margin: 14px -16px -20px; padding-left: 16px; padding-right: 16px; }
      .picker-footer button { width: 100%; }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
    }

    /* Mobile-first training workspace refinements */
    input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
    input[type="number"]::-webkit-inner-spin-button,
    input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
    .dashboard-view, .stats-view { display: none; }
    .dashboard-view.active, .stats-view.active { display: block; }
    .week-strip { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 7px; margin: 0 0 22px; }
    .day-chip { min-width: 0; padding: 8px 2px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-align: center; }
    .day-chip span, .day-chip strong { display: block; }
    .day-chip span { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
    .day-chip strong { margin-top: 4px; font-size: 14px; }
    .day-chip.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
    .day-chip.has-workout strong::after { content: ''; display: block; width: 4px; height: 4px; margin: 4px auto -2px; border-radius: 50%; background: var(--accent); }
    .dashboard-grid { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(260px,.7fr); gap: 14px; }
    .dashboard-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
    .dashboard-card.wide { grid-column: 1 / -1; }
    .dashboard-card h2 { margin: 0 0 12px; font-size: 17px; }
    .dashboard-card p { margin-bottom: 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
    .mini-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
    .mini-stat { padding: 12px 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
    .mini-stat strong, .mini-stat span { display: block; }
    .mini-stat strong { font-size: 20px; letter-spacing: -.03em; }
    .mini-stat span { margin-top: 3px; color: var(--muted); font-size: 10px; }
    .recent-workouts { display: grid; gap: 8px; }
    .recent-workout { width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
    .recent-workout:last-child { border-bottom: 0; }
    .recent-workout span { color: var(--muted); font-size: 12px; }
    .stats-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
    .stats-panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
    .stats-panel strong { display:block; font-size: 30px; letter-spacing: -.04em; }
    .stats-panel span { color: var(--muted); font-size: 12px; }
    .swipe-item { background: transparent; }
    .swipe-item.is-open { background: var(--danger); }
    .swipe-delete-action { width: 72px; background: var(--danger); font-size: 11px; letter-spacing: .01em; }
    .swipe-item.is-open .swipe-content { transform: translateX(-72px); }
    .exercise-swipe { border-radius: var(--radius-md); }
    .set-swipe { background: transparent; }
    .set-swipe.is-open { background: var(--danger); }
    .set-swipe .swipe-delete-action { width: 64px; }
    .set-swipe.is-open .swipe-content { transform: translateX(-64px); }
    .set-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
    .complete-set, .delete-set-inline { width: 34px; height: 34px; padding: 0; align-self: center; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
    .complete-set svg, .delete-set-inline svg { width: 17px; height: 17px; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
    .complete-set svg { stroke: var(--subtle); }
    .complete-set[aria-pressed="true"] svg { stroke: var(--surface-raised); }
    .delete-set-inline { border: 1px solid var(--rose); background: var(--surface-raised); color: var(--danger); }
    .delete-set-inline svg { stroke: currentColor; }
    .delete-set-inline:hover, .delete-set-inline:focus-visible { border-color: var(--danger); background: var(--rose-soft); outline: none; }
    .log-labels, .log-set { grid-template-columns: 34px minmax(82px,.8fr) minmax(72px,.65fr) minmax(72px,.65fr) 73px; }
    .exercise-tools { display: flex; align-items: center; gap: 6px; }
    .drag-handle, .superset-button { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); cursor: grab; font-size: 11px; font-weight: 750; touch-action: none; }
    .drag-handle { font-size: 18px; letter-spacing: -3px; }
    .superset-button { cursor: pointer; }
    .superset-button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
    .superset-band { margin: -5px 0 8px; color: var(--accent); font-size: 10px; font-weight: 800; text-transform: uppercase; }
    .exercise-note { margin-top: 14px; }
    .add-note-toggle { padding: 6px 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 750; }
    .exercise-note textarea { width: 100%; min-height: 62px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); resize: vertical; outline: none; }
    .exercise-note textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
    .small-button { min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 750; }
    .status-note { min-height: 18px; margin: 8px 0 0; color: var(--accent); font-size: 12px; }
    .bottom-nav { width: min(680px, calc(100% - 20px)); grid-template-columns: repeat(6, 1fr); }
    @media (max-width: 700px) {
      .dashboard-grid { grid-template-columns: 1fr; }
      .dashboard-card.wide { grid-column: auto; }
      .stats-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 580px) {
      .shell { padding-left: 12px; padding-right: 12px; }
      .week-strip { gap: 4px; }
      .day-chip { border-radius: 16px; }
      .dashboard-card { padding: 16px; }
      .log-set { grid-template-columns: 28px repeat(3,minmax(0,1fr)) 73px; }
      .log-set .set-actions { grid-column: 5; }
      .exercise-tools { flex-wrap: wrap; justify-content: flex-end; }
      .bottom-nav { bottom: max(7px, env(safe-area-inset-bottom)); padding: 4px; border-radius: 16px; }
      .nav-item { min-height: 48px; font-size: 9px; }
      .nav-item svg { width: 17px; height: 17px; }
    }

    /* Interaction polish: stable tap states, native-feeling delete rails, and dashboard controls */
    [hidden] { display: none !important; }
    button { -webkit-tap-highlight-color: transparent; }
    button:active { transform: none; }
    .swipe-item { background: var(--danger) !important; isolation: isolate; }
    .swipe-item:not(.is-open) { background: transparent !important; }
    .swipe-delete-action {
      inset: 0 0 0 auto; width: 72px !important; border-radius: 0;
      background: var(--danger); box-shadow: none; display: flex; flex-direction: column;
      align-items: center; justify-content: center; gap: 4px; color: var(--surface-raised);
      overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .14s ease;
      font-size: 10px; font-weight: 800;
    }
    .swipe-item.is-open > .swipe-delete-action { opacity: 1; pointer-events: auto; }
    .swipe-delete-action::before {
      content: ''; width: 17px; height: 17px; background: currentColor;
      -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 6h18M8 6V4h8v2m-9 0 1 14h8l1-14M10 10v6m4-6v6'/%3E%3C/svg%3E") center/contain no-repeat;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 6h18M8 6V4h8v2m-9 0 1 14h8l1-14M10 10v6m4-6v6'/%3E%3C/svg%3E") center/contain no-repeat;
    }
    .swipe-item.is-open .swipe-content { transform: translateX(-72px); }
    .set-swipe.is-open .swipe-content { transform: translateX(-72px); }
    .swipe-content { will-change: transform; touch-action: pan-y; }
    .day-chip { width: 100%; color: inherit; cursor: pointer; appearance: none; }
    .day-chip.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
    .day-chip:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
    .dashboard-card-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
    .dashboard-card-head h2 { margin: 0; }
    .period-wrap { position: relative; }
    .period-trigger { min-height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
    .period-trigger:hover, .period-trigger[aria-expanded="true"] { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
    .period-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 8; width: 126px; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
    .period-option { width: 100%; min-height: 36px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; font-size: 12px; }
    .period-option:hover, .period-option[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); }
    .muscle-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
    .calendar-summary { min-height: 19px; margin: -12px 2px 18px; color: var(--muted); font-size: 12px; }
    .chart-card { margin-top: 12px; }
    .chart-wrap { width: 100%; min-height: 180px; overflow: hidden; }
    .chart-wrap svg { display: block; width: 100%; height: 190px; }
    .chart-axis { stroke: var(--line); stroke-width: 1; }
    .chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
    .chart-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
    .chart-label { fill: var(--muted); font: 10px var(--font-sans); }
    .chart-empty { min-height: 160px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }
    .exercise-visual { display: none; margin: -8px 0 26px; border-radius: var(--radius-md); background: var(--surface); overflow: hidden; border: 1px solid var(--line); }
    .exercise-visual.visible { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .exercise-visual img { width: 100%; height: 230px; object-fit: contain; background: var(--surface-2); }
    .exercise-visual-copy { padding: 20px; align-self: center; }
    .exercise-visual-copy strong { display: block; margin-bottom: 7px; font-size: 15px; }
    .exercise-visual-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
    .program-workout { grid-template-columns: 34px minmax(0,1fr) auto; }
    .start-program-row { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent); cursor: pointer; font-size: 11px; font-weight: 750; }
    .week-progress { display: grid; grid-template-columns: repeat(var(--program-weeks, 8), minmax(0,1fr)); gap: 4px; margin: 12px 0 20px; }
    .week-segment { height: 6px; border-radius: 999px; background: var(--surface-2); }
    .week-segment.past, .week-segment.current { background: var(--accent); }
    .week-segment.current { box-shadow: 0 0 0 2px var(--accent-soft); }
    .archived-programs { margin-top: 18px; }
    .archive-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
    .archive-row span { color: var(--muted); font-size: 11px; }
    @media (max-width: 580px) {
      .exercise-visual.visible { grid-template-columns: 1fr; }
      .exercise-visual img { height: 190px; }
      .exercise-visual-copy { padding: 14px 16px; }
      .program-workout { grid-template-columns: 30px minmax(0,1fr) auto; padding: 10px; }
      .start-program-row { padding: 0 8px; }
      .calendar-summary { margin-top: -14px; }
    }

    /* Extended calendar and muscle-volume maps */
    .week-strip { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px; padding: 4px 0 12px; }
    .day-chip { min-width: 0; min-height: 72px; padding: 10px 4px; border-radius: 16px; }
    .day-chip span { font-size: 11px; }
    .day-chip strong { margin-top: 5px; font-size: 18px; }
    .day-chip em { display: block; min-height: 11px; margin-top: 4px; color: var(--warning); font-size: 8px; font-style: normal; font-weight: 850; text-transform: uppercase; }
    .day-chip.has-real-workout em { color: var(--accent); }
    .period-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
    .period-tab { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
    .period-tab[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
    .heatmap-shell { display: grid; grid-template-columns: minmax(180px,.78fr) minmax(220px,1.22fr); gap: 20px; align-items: center; margin-top: 14px; }
    .heatmap-figure { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; min-width: 0; }
    .heatmap-body { min-width: 0; text-align: center; }
    .heatmap-body svg { display: block; width: 100%; height: 300px; }
    .heatmap-body span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
    .heatmap-region { stroke: var(--shadow-color); stroke-width: 1.2; transition: fill .16s ease; }
    .heatmap-outline { fill: var(--line); stroke: var(--line-strong); stroke-width: 1.3; }
    .heatmap-list { display: grid; gap: 7px; }
    .heatmap-row { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 8px; align-items: center; font-size: 12px; }
    .heatmap-swatch { width: 10px; height: 10px; border-radius: 3px; }
    .heatmap-row span { color: var(--muted); }
    .heatmap-row strong { font-variant-numeric: tabular-nums; }
    .heatmap-legend { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--muted); font-size: 10px; }
    .heatmap-gradient { width: 110px; height: 7px; border-radius: 999px; background: linear-gradient(90deg,var(--pine-soft),var(--foam),var(--accent)); }
    .compact-heatmap { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
    .compact-heatmap .heatmap-shell { grid-template-columns: 150px minmax(0,1fr); gap: 14px; margin-top: 0; }
    .compact-heatmap .heatmap-body svg { height: 150px; }
    .compact-heatmap .heatmap-list { gap: 5px; }
    .compact-heatmap .heatmap-row { font-size: 10px; }
    @media (max-width: 700px) {
      .week-strip { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
      .heatmap-shell { grid-template-columns: 1fr; }
      .heatmap-figure { max-width: 340px; margin: 0 auto; }
      .heatmap-body svg { height: 250px; }
      .compact-heatmap .heatmap-shell { grid-template-columns: 140px minmax(0,1fr); }
      .compact-heatmap .heatmap-figure { max-width: none; }
      .compact-heatmap .heatmap-body:nth-child(2) { display: none; }
      .compact-heatmap .heatmap-figure { grid-template-columns: 1fr; }
    }
    @media (max-width: 420px) {
      .compact-heatmap .heatmap-shell { grid-template-columns: 120px minmax(0,1fr); gap: 10px; }
      .compact-heatmap .heatmap-row { grid-template-columns: 8px minmax(0,1fr); }
      .compact-heatmap .heatmap-row strong { display: none; }
    }


    /* Progression engine comparison and per-program controls */

    .exercise-rule-row { padding: 14px 0; border-top: 1px solid var(--line); }
    /* Per-exercise collapsible cards in the exercise picker */
    .exercise-rules-list { display: grid; gap: 10px; margin: 0 0 16px; }
    .exercise-rule-accordion { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
    .exercise-rule-accordion-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
    .exercise-rule-accordion-head::-webkit-details-marker { display: none; }
    .exercise-rule-accordion-title { display: grid; gap: 2px; min-width: 0; }
    .exercise-rule-accordion-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
    .exercise-rule-accordion-title small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
    .exercise-rule-accordion[open] .exercise-accordion-chevron { transform: rotate(90deg); }
    .exercise-rule-accordion-body { padding: 0 14px 14px; }
    .exercise-rule-accordion-body .exercise-rule-row { padding: 2px 0 0; border-top: 0; }
    .exercise-rule-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
    .exercise-rule-head > strong { min-width: 0; font-size: 13px; line-height: 1.25; }
    .set-count-field { width: 72px; flex: 0 0 72px; }
    .exercise-rule-controls { display: grid; grid-template-columns: 96px 72px 72px minmax(190px,1fr); gap: 8px; align-items: end; }
    .rule-field { display: grid; gap: 4px; }
    .rule-field span, .load-control-title { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
    .rule-field input, .rule-field select { width: 100%; min-height: 38px; height: 38px; margin: 0; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 12px; }
    .load-progression { display: grid; gap: 5px; }
    .load-progression-row { display: grid; grid-template-columns: minmax(0,1fr) 76px auto; gap: 6px; align-items: center; }
    .load-progression select, .load-progression input { width: 100%; min-width: 0; height: 38px; margin: 0; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 12px; }
    .reps-only-toggle { min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
    .reps-only-toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
    .load-progression.is-disabled select, .load-progression.is-disabled input { opacity: .45; pointer-events: none; }
    @media (max-width: 700px) {
      .exercise-rule-controls { grid-template-columns: 1fr 1fr 1fr; }
      .load-progression { grid-column: 1 / -1; }
    }
    @media (max-width: 430px) {
      .exercise-rule-controls { grid-template-columns: 1fr 1fr; }
      .exercise-rule-controls .rule-field:first-child { grid-column: 1 / -1; }
      .load-progression { grid-column: 1 / -1; }
      .load-progression-row { grid-template-columns: minmax(0,1fr) 72px; }
      .reps-only-toggle { grid-column: 1 / -1; }
    }

    .progression-setup { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
    .progression-setup h3 { margin: 0 0 5px; font-size: 16px; }
    .progression-setup > p { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.45; }
    .progression-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
    .progression-choice { grid-column: 1 / -1; }
    .choice-pills { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 8px; }
    .choice-pill { min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; }
    .choice-pill strong, .choice-pill span { display: block; }
    .choice-pill strong { font-size: 12px; }
    .choice-pill span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
    .choice-pill[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
    .switch-row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 4px; }
    .switch-copy strong, .switch-copy span { display: block; }
    .switch-copy strong { font-size: 12px; }
    .switch-copy span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
    .switch { position: relative; flex: 0 0 auto; width: 46px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; }
    .switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-raised); box-shadow: 0 1px 3px var(--backdrop); transition: transform .16s ease; }
    .switch[aria-pressed="true"] { background: var(--accent); }
    .switch[aria-pressed="true"]::after { transform: translateX(18px); }
    .progression-preview { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
    .progression-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
    .progression-preview-head h2 { margin: 0 0 5px; font-size: 18px; }
    .progression-preview-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
    .comparison-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    .treatment-panel { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
    .treatment-label { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
    .treatment-letter { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--surface-raised); font-size: 11px; font-weight: 850; }
    .treatment-panel h3 { margin: 0; font-size: 15px; }
    .treatment-intro { min-height: 34px; margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.45; }
    .suggestion-list { display: grid; gap: 10px; }
    .suggestion-card { width: 100%; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
    button.suggestion-card { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
    button.suggestion-card:hover { border-color: var(--accent); box-shadow: 0 3px 10px rgba(0,0,0,.06); }
    button.suggestion-card.applied { border-color: var(--accent); background: var(--accent-soft); }
    .suggestion-name { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
    .suggestion-name span { flex: none; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: none; white-space: nowrap; }
    .suggestion-change { display: flex; align-items: baseline; gap: 10px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
    .suggestion-change strong { color: var(--ink); font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
    .suggestion-reason { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
    .autofill-row { display: grid; grid-template-columns: minmax(0,1fr) 62px 56px; gap: 6px; align-items: center; }
    .autofill-row + .autofill-row { margin-top: 8px; }
    .autofill-row label { min-width: 0; font-size: 11px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .autofill-row input { min-width: 0; width: 100%; height: 36px; padding: 0 7px; border: 1px solid var(--foam); border-radius: 7px; background: var(--pine-soft); text-align: center; }
    .progression-footnote { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
    .progression-banner { margin: 0 0 16px; padding: 14px; border: 1px solid var(--foam); border-radius: var(--radius-md); background: var(--pine-soft); }
    .progression-banner-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
    .progression-banner h3 { margin: 0 0 3px; font-size: 14px; }
    .progression-banner p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
    .real-data-label { color: var(--accent); font-size: 9px; font-weight: 850; text-transform: uppercase; }
    .workout-context { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 6px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 750; }
    .stall-card { margin-top: 10px; padding: 10px; border-radius: 9px; background: var(--gold-soft); color: var(--warning); font-size: 10px; line-height: 1.45; }
    .program-progression-summary { margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
    .program-progression-summary h3 { margin: 0 0 8px; font-size: 14px; }
    .program-progression-meta { display: flex; flex-wrap: wrap; gap: 6px; }
    @media (max-width: 700px) {
      .comparison-grid { grid-template-columns: 1fr; }
      .progression-fields { grid-template-columns: 1fr 1fr; }
      .progression-choice, .switch-row { grid-column: 1 / -1; }
    }
    @media (max-width: 420px) {
      .progression-fields { grid-template-columns: 1fr; }
      .progression-choice, .switch-row { grid-column: auto; }
      .choice-pills { grid-template-columns: 1fr; }
      .progression-preview { padding: 16px 12px; }
      .progression-preview-head { flex-direction: column; }
    }

    /* One-week calendar, richer workout history, and anatomical body map */
    .calendar-toolbar { display: grid; grid-template-columns: 40px minmax(0,1fr) 40px; gap: 10px; align-items: center; margin: 0 0 8px; }
    .calendar-toolbar > div { min-width: 0; text-align: center; }
    .calendar-toolbar strong, .calendar-toolbar span { display: block; }
    .calendar-toolbar strong { font-size: 13px; }
    .calendar-toolbar span { margin-top: 2px; color: var(--muted); font-size: 10px; }
    .calendar-page { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 25px; line-height: 1; }
    .calendar-page:hover, .calendar-page:focus-visible { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); outline: none; }
    .week-strip { grid-template-columns: repeat(7,minmax(0,1fr)); touch-action: pan-y; user-select: none; }
    .completed-card { max-width: 900px; }
    .workout-detail-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 20px 0; }
    .workout-detail-metric { min-width: 0; padding: 13px; border-radius: var(--radius-sm); background: var(--surface-2); }
    .workout-detail-metric strong, .workout-detail-metric span { display: block; }
    .workout-detail-metric strong { font-size: 20px; letter-spacing: -.03em; }
    .workout-detail-metric span { margin-top: 3px; color: var(--muted); font-size: 10px; }
    .workout-muscles, .workout-prs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 20px; }
    .workout-pr { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--warning); font-size: 10px; font-weight: 800; }
    .completed-exercise-details { display: grid; gap: 12px; margin: 22px 0; }
    .completed-exercise-detail { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
    .completed-exercise-detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
    .completed-exercise-detail-head button { padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left; font-weight: 800; }
    .completed-exercise-detail-head span { color: var(--muted); font-size: 11px; white-space: nowrap; }
    .completed-set-head, .completed-set-row { display: grid; grid-template-columns: 42px repeat(4,minmax(0,1fr)); gap: 8px; align-items: center; }
    .completed-set-head { padding: 0 8px 6px; color: var(--muted); font-size: 9px; font-weight: 800; }
    .completed-set-row { min-height: 42px; padding: 8px; border-top: 1px solid var(--line); font-size: 12px; font-variant-numeric: tabular-nums; }
    .completed-set-row strong { font-size: 13px; }
    .completed-set-tags { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
    .completed-note { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.45; }
    .picker-template-options { margin: 0 0 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
    .picker-template-options strong { display: block; margin-bottom: 8px; font-size: 11px; }
    .picker-template-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
    .picker-template-button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 11px; font-weight: 750; }
    .program-row-actions { display: flex; align-items: center; gap: 6px; }
    .setup-program-row { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
    .program-notice { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 750; }
    .anatomy-map-shell { min-width: 0; }
    .anatomy-map { width: 100%; min-height: 280px; }
    .anatomy-map svg { display: block; width: 100%; height: auto; max-height: 360px; }
    .anatomy-map [data-muscle] { stroke: var(--shadow-color); stroke-width: .55; transition: fill .16s ease; }
    .anatomy-labels { display: grid; grid-template-columns: 1fr 1fr; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 750; text-align: center; text-transform: uppercase; }
    .body-map-credit { margin: 8px 0 0; color: var(--muted); font-size: 9px; text-align: center; }
    .body-map-credit a { text-underline-offset: 2px; }
    .compact-heatmap .anatomy-map { min-height: 120px; }
    .compact-heatmap .anatomy-map svg { max-height: 160px; }
    @media (max-width: 700px) {
      .week-strip { grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
      .day-chip { min-height: 68px; padding: 8px 2px; border-radius: 13px; }
      .day-chip span { font-size: 9px; }
      .day-chip strong { font-size: 16px; }
      .heatmap-shell, .compact-heatmap .heatmap-shell { grid-template-columns: 1fr; }
      .heatmap-figure, .compact-heatmap .heatmap-figure { max-width: none; grid-template-columns: 1fr; }
      .workout-detail-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
      .program-workout { grid-template-columns: 30px minmax(0,1fr); }
      .program-row-actions { grid-column: 2; justify-content: flex-start; }
    }
    .add-set { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; margin: 12px 0 0 42px; padding: 0 13px; border: 1px solid var(--foam); border-radius: var(--radius-sm); background: var(--pine-soft); color: var(--accent); }
    .set-count-badge { display: inline-flex; align-items: center; min-height: 22px; margin-top: 7px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 750; }
    .suggestion-basis { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
    .muscle-analysis-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(250px,.85fr); gap: 12px; margin-top: 12px; }
    .analysis-panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
    .analysis-panel h2 { margin: 0 0 4px; font-size: 17px; }
    .analysis-panel > p { margin: 0 0 16px; color: var(--muted); font-size: 11px; line-height: 1.45; }
    .muscle-volume-list, .balance-list, .muscle-trend-list { display: grid; gap: 11px; }
    .muscle-volume-row { display: grid; grid-template-columns: minmax(82px,.65fr) minmax(100px,1fr) auto; gap: 9px; align-items: center; font-size: 11px; }
    .analysis-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
    .analysis-track { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
    .analysis-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
    .analysis-value { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .balance-row { display: grid; grid-template-columns: 60px minmax(0,1fr) 38px; gap: 8px; align-items: center; font-size: 11px; }
    .balance-row strong { font-size: 11px; }
    .trend-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
    .trend-row:first-child { padding-top: 0; border-top: 0; }
    .trend-row strong, .trend-row span { display: block; }
    .trend-row strong { font-size: 12px; text-transform: capitalize; }
    .trend-row span { margin-top: 2px; color: var(--muted); font-size: 10px; }
    .trend-change { padding: 4px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 800; }
    .trend-change.up { background: var(--accent-soft); color: var(--accent); }
    .trend-change.down { background: var(--rose-soft); color: var(--warning); }
    @media (max-width: 700px) { .muscle-analysis-grid { grid-template-columns: 1fr; } }
    .tracking-toggle { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
    .tracking-toggle.time { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
    .suggestion-card.applied .suggestion-change strong::after { content: ' · applied'; color: var(--accent); font-size: 9px; font-weight: 800; text-transform: uppercase; }
    .time-range-fields { display: contents; }

    /* Exercise tags and reusable program templates */
    .exercise-tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; }
    .exercise-tag-chip { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 10px; font-weight: 750; }
    .exercise-tag-chip.preset { background: var(--accent-soft); color: var(--accent); }
    .exercise-tag-button { min-height: 28px; padding: 0 8px; border: 1px dashed var(--line-strong); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 750; }
    .exercise-tag-button:hover, .exercise-tag-button:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
    .exercise-tags-builder { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
    .exercise-tags-builder .exercise-tag-row { margin-top: 0; }
    .built-in-programs { margin: 0 0 18px; }
    .built-in-programs > .section-head { margin-bottom: 10px; }
    .program-template-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 18px; border: 1px solid var(--foam); border-radius: var(--radius-md); background: var(--surface-raised); }
    .program-template-card h3 { margin: 0 0 5px; font-size: 17px; }
    .program-template-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
    .program-template-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
    .program-template-workouts { display: grid; gap: 6px; margin-top: 12px; }
    .program-template-workout { padding: 9px 10px; border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font-size: 11px; line-height: 1.45; }
    .program-template-workout strong { color: var(--ink); }
    .archive-row-wrap { border-top: 1px solid var(--line); }
    .archive-row-wrap .archive-row { border-top: 0; }
    .archive-history { padding: 0 0 14px; }
    .archive-history summary { color: var(--accent); cursor: pointer; font-size: 11px; font-weight: 800; }
    .archive-history-list { display: grid; gap: 6px; margin-top: 9px; }
    .archive-workout { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
    .archive-workout strong { font-size: 12px; }
    .archive-workout span { color: var(--muted); font-size: 10px; }
    @media (max-width: 580px) {
      .program-template-card { grid-template-columns: 1fr; }
      .program-template-card .primary-button { width: 100%; }
    }
    @media (max-width: 520px) {
      .completed-set-head { display: none; }
      .completed-set-row { grid-template-columns: 34px repeat(2,minmax(0,1fr)); gap: 6px; }
      .completed-set-row .completed-rpe { grid-column: 2; }
      .completed-set-row .completed-est { grid-column: 3; }
      .completed-set-tags { grid-column: 2 / -1; }
      .workout-detail-metric { padding: 10px 8px; }
      .workout-detail-metric strong { font-size: 17px; }
      .calendar-toolbar span { display: none; }
    }
    /* Unified builder, lighter program editing, and compact logging controls */
    .workout-start-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 18px; }
    .start-option { min-height: 82px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); text-align: left; cursor: pointer; }
    .start-option strong { display: block; margin-bottom: 4px; font-size: 14px; }
    .start-option span { color: var(--muted); font-size: 11px; line-height: 1.4; }
    .start-option.primary { border-color: var(--accent); background: var(--accent-soft); }
    .template-disclosure { margin: 0; }
    .template-disclosure > summary { list-style: none; display: block; }
    .template-disclosure > summary::-webkit-details-marker { display: none; }
    .template-disclosure[open] { grid-column: 1 / -1; }
    .template-disclosure-list { margin-top: 10px; }
    .built-in-label { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
    .sample-label { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
    .advanced-options summary::-webkit-details-marker, .program-rules summary::-webkit-details-marker { display: none; }
    .advanced-options summary::after, .program-rules summary::after { content: '+'; color: var(--accent); font-size: 18px; font-weight: 500; }
    .advanced-options[open] > summary::after, .program-rules[open] > summary::after { content: '−'; }
    .advanced-options { margin-top: 10px; border-top: 1px solid var(--line); }
    .advanced-options summary { display: flex; align-items: center; justify-content: space-between; min-height: 40px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 800; }
    .advanced-options-body { display: grid; gap: 10px; padding: 2px 0 8px; }
    .set-utility-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .copy-first-set { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
    .copy-first-set:disabled { opacity: .45; cursor: default; }
    .rep-preset-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0 12px; }
    .rep-preset { min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
    .rep-preset[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
    .range-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
    .program-rules { margin: 20px 0; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
    .program-rules > summary { display: flex; align-items: center; justify-content: space-between; min-height: 54px; cursor: pointer; font-size: 15px; font-weight: 800; }
    .program-rules .progression-setup { margin: 0; padding: 0 0 18px; border: 0; background: transparent; }
    .undulating-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
    .week-range-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
    .week-range-row { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 8px; align-items: center; }
    .week-range-row strong { font-size: 11px; }
    .week-range-row select { min-height: 38px; margin: 0; font-size: 11px; }
    .program-cover-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
    .program-muscles { margin-top: 18px; }
    .program-muscles h3 { margin: 0 0 8px; font-size: 13px; }
    .program-muscle-bars { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
    .program-muscle-bar { display: grid; grid-template-columns: minmax(70px,.7fr) minmax(80px,1fr); gap: 8px; align-items: center; font-size: 10px; }
    .program-muscle-bar i { height: 6px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
    .program-muscle-bar i::after { content:''; display:block; width:var(--fill); height:100%; background:var(--accent); border-radius:inherit; }
    .inline-feedback { color: var(--accent); font-size: 10px; font-weight: 750; }
    .search-suggestion-note { padding: 8px 2px; color: var(--muted); font-size: 11px; }
    @media (max-width: 640px) {
      .workout-start-options, .program-muscle-bars { grid-template-columns: 1fr; }
      .week-range-list { grid-template-columns: 1fr; }
      .range-fields { grid-template-columns: 1fr 1fr; }
    }

    /* ===== refined notebook theme ===== */
    html, body { background: var(--bg); color: var(--ink); }
    h1, h2, h3,
    .stat-value, .mini-stat strong, .workout-detail-metric strong,
    .completed-card h2, .program-cover-head h2, .start-option strong {
      font-family: var(--font-display);
      color: var(--ink-strong);
    }
    h1 { letter-spacing: -.045em; }
    h2, h3 { letter-spacing: -.025em; }
    .filter-group label, .filter-label, .field > label, fieldset.field > legend,
    .stat-label, .log-labels, .picker-section-label, .program-cover-kicker,
    .treatment-label, .load-control-title, .rule-field > span {
      color: var(--muted);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .11em;
      text-transform: uppercase;
      font-variant-caps: all-small-caps;
    }
    button, input, textarea, select { color: var(--ink); }
    button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
    .exercise-card:focus-visible, .form-pill:focus-visible, .day-chip:focus-visible {
      outline: 3px solid var(--focus-ring);
      outline-offset: 2px;
    }
    .dashboard-card, .stats-panel, .section, .workout-start, .workout-exercise,
    .program-setup, .program-cover, .completed-card, .program-template-card,
    .progression-preview, .treatment-panel, .analysis-panel, .movement-card,
    .history-session, .note-card, .exercise-card, .chart-card {
      border-color: var(--line);
      border-radius: var(--radius-lg);
      background: var(--surface);
      box-shadow: var(--shadow-soft);
    }
    .dashboard-card, .stats-panel, .workout-exercise, .completed-card,
    .program-template-card, .analysis-panel { padding: 20px; }
    .exercise-card { border-radius: var(--radius-md); }
    .exercise-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
    .primary-button, .form-action.primary, .add-exercise, .start-program-row {
      border: 1px solid var(--accent);
      border-radius: 999px;
      background: var(--accent);
      color: var(--on-accent);
      box-shadow: 0 4px 12px var(--shadow-color);
    }
    .primary-button:hover, .form-action.primary:hover, .add-exercise:hover, .start-program-row:hover { background: var(--accent-hover); }
    .secondary-button, .form-action.secondary, .small-button, .filter-button,
    .calendar-page, .back, .setup-program-row, .copy-first-set, .add-set {
      border-color: var(--line-strong);
      border-radius: 999px;
      background: var(--surface-raised);
      color: var(--ink-strong);
    }
    .secondary-button:hover, .small-button:hover, .filter-button:hover,
    .calendar-page:hover, .back:hover, .setup-program-row:hover, .copy-first-set:hover, .add-set:hover {
      border-color: var(--rose);
      background: var(--rose-soft);
    }
    .search, select, .field input, .field textarea, .program-add input,
    .picker-search, .tag-editor input, .log-input, .exercise-note textarea,
    .rule-field input, .rule-field select, .load-progression input, .load-progression select,
    .autofill-row input, .week-range-row select {
      border-color: var(--line);
      border-radius: var(--radius-sm);
      background: var(--surface-raised);
      color: var(--ink);
    }
    .search:focus, .field input:focus, .field textarea:focus, .log-input:focus,
    .exercise-note textarea:focus, .picker-search:focus, select:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--focus-ring);
      outline: none;
    }
    .tag, .exercise-tag-chip, .set-tag-chip, .real-data-label,
    .workout-pr, .period-tab, .choice-pill, .rep-preset, .picker-template-button {
      border-radius: 999px;
      background: var(--surface-2);
      color: var(--muted);
    }
    .tag.primary, .exercise-tag-chip.preset, .set-tag-chip,
    .choice-pill[aria-pressed="true"], .rep-preset[aria-pressed="true"],
    .period-tab[aria-pressed="true"], .real-data-label {
      border-color: var(--pine);
      background: var(--pine-soft);
      color: var(--accent-ink);
    }
    .form-pill, .muscle-option, .tracking-toggle, .reps-only-toggle,
    .exercise-tag-button, .superset-button, .period-trigger, .switch {
      border-color: var(--line-strong);
      background: var(--surface-raised);
      color: var(--muted);
    }
    .form-pill[aria-pressed="true"], .muscle-option[aria-pressed="true"],
    .tracking-toggle.time, .reps-only-toggle[aria-pressed="true"], .superset-button.active,
    .period-trigger[aria-expanded="true"] {
      border-color: var(--accent);
      background: var(--accent-soft);
      color: var(--accent-ink);
    }
    .switch[aria-pressed="true"] { background: var(--accent); }
    .switch::after { background: var(--surface-raised); box-shadow: 0 1px 4px var(--shadow-color); }
    .workout-start-options { gap: 12px; }
    .start-option { border-color: var(--line); border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-soft); }
    .start-option.primary { border-color: var(--rose); background: var(--rose-soft); }
    .start-option:hover { border-color: var(--rose); }
    .swipe-item { border-radius: var(--radius-md); }
    .swipe-delete-action { background: var(--danger); color: var(--on-accent); }
    .set-swipe { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
    .log-set { padding: 8px; }
    .log-set-number { border-radius: 999px; background: var(--surface-raised); color: var(--muted); }
    .log-set-number.has-tags { border-color: var(--rose); background: var(--rose-soft); color: var(--danger); }
    .log-set.is-complete { background: var(--pine-soft); }
    .log-set.is-complete .log-input { border-color: var(--foam); background: var(--surface-raised); }
    .complete-set { border-color: var(--line-strong); background: var(--surface-raised); }
    .complete-set[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
    .delete-set-inline { color: var(--danger); }
    .selected-set-tags { padding-inline: 8px; }
    .advanced-options { border-color: var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
    .advanced-options summary, .program-rules > summary { color: var(--ink-strong); }
    .suggestion-card, button.suggestion-card {
      min-height: 62px;
      border-color: var(--line);
      border-radius: var(--radius-md);
      background: var(--surface-raised);
      box-shadow: var(--shadow-soft);
    }
    button.suggestion-card:hover, button.suggestion-card.applied { border-color: var(--rose); background: var(--rose-soft); }
    .suggestion-card.applied .suggestion-change strong::after { color: var(--danger); }
    .progression-banner, .progression-setup, .program-rules,
    .stall-card, .picker-template-options { border-color: var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
    .program-cover { border-color: var(--line-strong); }
    .program-cover-head { background: var(--pine); color: var(--on-accent); }
    .program-cover-head h2 { color: var(--on-accent); }
    .program-cover-kicker, .program-cover-meta { color: var(--gold-soft); }
    .program-body { background: var(--surface); }
    .week-segment { background: var(--surface-2); }
    .week-segment.past { background: var(--foam); }
    .week-segment.current { background: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
    .program-workout, .archive-row, .archive-workout { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
    .program-workout-index { background: var(--rose-soft); color: var(--danger); }
    .program-muscle-bar i { background: var(--surface-2); }
    .program-muscle-bar i::after, .analysis-fill { background: var(--foam); }
    .completed-mark { background: var(--gold-soft); color: var(--warning); }
    .workout-detail-metric, .completed-exercise-detail { border-color: var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
    .completed-set-row { border-color: var(--line); background: var(--surface-raised); }
    .custom-dialog { border-color: var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
    .custom-dialog::backdrop { background: var(--backdrop); }
    .dialog-close { border-color: var(--line); background: var(--surface-2); color: var(--muted); }
    .picker-item { border-color: var(--line); border-radius: var(--radius-sm); background: var(--surface-raised); }
    .picker-item:hover, .picker-item[aria-pressed="true"] { border-color: var(--rose); background: var(--rose-soft); }
    .picker-footer { border-color: var(--line); background: var(--surface); }
    .bottom-nav {
      border-color: var(--line-strong);
      border-radius: 24px;
      background: var(--surface-raised);
      box-shadow: var(--shadow);
    }
    .nav-item { border-radius: 18px; color: var(--muted); }
    .nav-item.active { background: var(--accent); color: var(--on-accent); }
    .day-chip { border-color: var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
    .day-chip.today, .day-chip.selected { border-color: var(--rose); background: var(--rose-soft); }
    .day-chip.has-workout strong::after { background: var(--accent); }
    .mini-stat, .workout-detail-metric { border-radius: var(--radius-md); background: var(--surface-2); }
    .period-menu { border-color: var(--line); border-radius: var(--radius-sm); background: var(--surface-raised); box-shadow: var(--shadow); }
    .period-option:hover, .period-option[aria-checked="true"] { background: var(--rose-soft); color: var(--ink-strong); }
    @media (max-width: 640px) {
      .dashboard-card, .stats-panel, .workout-exercise, .completed-card,
      .program-template-card, .analysis-panel { padding: 16px; }
      .set-swipe + .set-swipe { margin-top: 9px; }
      .log-set { padding: 8px 6px; }
      .bottom-nav { border-radius: 22px; }
    }

    /* Training home, theme, accessible set detail, and lightweight tools */
    .shell { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
    .topline { padding-right: 88px; }
    .training-topline { padding-right: 88px; }
    .training-home { display: grid; gap: 28px; }
    .training-hero { position: relative; overflow: hidden; padding: clamp(22px,5vw,42px); border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); }
    .training-hero h2 { margin: 5px 0 8px; font-size: clamp(28px,5vw,44px); }
    .training-hero p { max-width: 560px; color: var(--muted); }
    .training-kicker { color: var(--danger); font-size: 11px; font-weight: 850; }
    .program-next-wrap { position: relative; z-index: 1; margin: -10px -10px 24px; padding: 10px; border-radius: var(--radius-lg); background: var(--pine-soft); }
    .program-next-main { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--foam); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; box-shadow: var(--shadow-soft); }
    .program-next-main:hover { border-color: var(--pine); }
    .program-next-kicker { display: block; margin-bottom: 5px; color: var(--pine); font-size: 10px; font-weight: 900; letter-spacing: .02em; }
    .program-next-main strong { display: block; font-size: 18px; line-height: 1.25; }
    .program-next-main small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.35; }
    .program-next-arrow { color: var(--pine); font-size: 22px; font-weight: 800; }
    .program-next-flexibility { margin: 8px 8px 0; }
    .program-next-flexibility summary { color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
    .program-next-alternatives { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
    .program-next-alternatives button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 750; }
    .training-recent { padding: 0 2px; }
    .resume-draft-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--rose); border-radius: var(--radius-md); background: var(--rose-soft); }
    .resume-draft-banner strong, .resume-draft-banner span { display: block; }
    .resume-draft-banner span { margin-top: 3px; color: var(--muted); font-size: 12px; }
    .workout-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
    .last-session-line { margin: 10px 0 8px; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 12px; }
    .last-session-line strong { color: var(--ink-strong); }
    .app-toast { position: fixed; z-index: 80; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom)); width: min(420px, calc(100% - 28px)); padding: 13px 16px; transform: translateX(-50%); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--ink-strong); color: var(--bg); box-shadow: var(--shadow); font-size: 13px; font-weight: 750; }
    .app-toast.pr-toast { border-color: var(--gold); background: var(--gold-soft); color: var(--ink-strong); }
    .compact-dialog { width: min(460px, calc(100% - 28px)); }
    .completed-set-head { grid-template-columns: 42px minmax(140px,1.4fr) minmax(68px,.7fr) minmax(88px,.8fr); }
    .completed-set-row { grid-template-columns: 42px minmax(140px,1.4fr) minmax(68px,.7fr) minmax(88px,.8fr); }
    .completed-set-cell { min-width: 0; }
    .completed-set-cell::before { content: attr(data-label); display: none; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
    .completed-set-tags { grid-column: 2 / -1; }
    /* Anatomical front/back muscle heat map (named regions). */
    .body-map-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    .body-figure { margin: 0; text-align: center; }
    .body-figure svg { display: block; width: 100%; max-height: 330px; }
    .body-figure figcaption { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 800; }
    .body-silhouette { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 2; }
    .body-region { stroke: var(--surface); stroke-width: 1.4; transition: fill .16s; }
    .heat-0 { fill: var(--heat-0); } .heat-1 { fill: var(--heat-1); } .heat-2 { fill: var(--heat-2); } .heat-3 { fill: var(--heat-3); } .heat-4 { fill: var(--heat-4); } .heat-5 { fill: var(--heat-5); }
    .heatmap-gradient { background: linear-gradient(90deg,var(--heat-0),var(--heat-2),var(--heat-5)); }
    /* Settings */
    .settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 8px; }
    .settings-actions { display: flex; flex-wrap: wrap; gap: 10px; }
    .small-button.danger { border-color: var(--rose); color: var(--rose); }
    .small-button.armed { border-color: var(--rose); background: var(--rose-soft); color: var(--ink-strong); }
    .attribution-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
    @media (max-width: 520px) { .settings-grid { grid-template-columns: 1fr; } }
    /* Settings polish — airy stacked headers, generous rhythm */
    #settingsView .dashboard-card { margin-bottom: 18px; padding: 22px; }
    #settingsView .dashboard-card:last-of-type { margin-bottom: 8px; }
    .settings-head { display: block; margin-bottom: 20px; }
    .settings-head h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.02em; }
    .settings-head .section-note { font-size: 13px; line-height: 1.55; max-width: 46ch; }
    .settings-grid { gap: 16px; margin-bottom: 6px; }
    #settingsView .rule-field { gap: 8px; }
    #settingsView .rule-field > span { font-size: 10px; letter-spacing: .06em; }
    #settingsView .rule-field input, #settingsView .rule-field select { min-height: 48px; height: 48px; padding: 0 14px; border-radius: 12px; font-size: 15px; }
    #settingsView .switch-row { margin-top: 12px; padding: 18px 0 2px; border-top: 1px solid var(--line); }
    #settingsView .switch-copy strong { font-size: 14px; }
    #settingsView .switch-copy span { font-size: 12px; line-height: 1.5; }
    .settings-actions { gap: 12px; }
    #settingsView .attribution-list { gap: 10px; }
    .action-list { display: grid; gap: 8px; }
    .action-row { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 52px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink); text-align: left; cursor: pointer; }
    .action-row span { color: var(--muted); font-size: 11px; }
    .action-row strong { display: block; }
    .action-row-value { color: var(--accent-ink); font-size: 13px; font-weight: 850; }
    .focus-key { display: grid; grid-template-columns: 90px minmax(0,1fr) 42px; align-items: center; gap: 9px; min-height: 38px; }
    .focus-key strong { font-size: 12px; }
    .focus-key .analysis-track { width: 100%; }
    .program-template-card { align-items: start; }
    .shell { padding-top: max(28px, calc(env(safe-area-inset-top) + 14px)); }
    .calendar-toolbar { grid-template-columns: 46px minmax(0,1fr) 46px; gap: 16px; margin-bottom: 14px; }
    .calendar-toolbar strong { font-size: 14px; letter-spacing: -.01em; }
    .calendar-page { width: 44px; height: 44px; }
    .week-strip { gap: 7px; padding-bottom: 16px; }
    .day-chip { min-height: 64px; padding: 10px 2px 8px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 16px; }
    .day-chip span, .day-chip strong { margin-top: 0; }
    .day-chip.has-workout strong::after { display: none; }
    .day-chip em { display: block; min-height: 6px; margin: 0; }
    .day-chip em i { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
    .dashboard-card-head { align-items: flex-start; margin-bottom: 22px; }
    .period-trigger { min-height: 36px; padding-inline: 11px; white-space: nowrap; }
    .mini-stats { margin-top: 2px; }
    .exercise-title-copy { min-width: 0; }
    .exercise-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 8px; }
    .advanced-options { margin-top: 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
    .advanced-options summary { min-height: 44px; padding: 0 3px; color: var(--muted); }
    .real-data-label { min-height: 25px; padding: 4px 8px; display: inline-flex; align-items: center; flex: 0 0 auto; white-space: nowrap; line-height: 1; }
    .completed-primary-action { margin-top: 22px; }
    .completed-primary-action .primary-button { width: 100%; min-height: 50px; }
    .detail-secondary-actions { display: flex; justify-content: center; margin-top: 10px; }
    .edit-detail-action { min-height: 42px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 750; }
    .completed-detail-back { margin-bottom: 12px; }
    .program-cover-head { position: relative; padding-right: 150px; }
    .program-cover-edit { position: absolute; right: 20px; top: 20px; min-height: 40px; padding: 0 14px; border: 1px solid var(--gold-soft); border-radius: 999px; background: var(--surface-raised); color: var(--ink-strong); cursor: pointer; font-weight: 800; }
    @media (max-width: 520px) {
      .shell { padding: 22px 14px calc(205px + env(safe-area-inset-bottom)); }
      .workout-start-options { grid-template-columns: 1fr; }
      .workout-toolbar { align-items: flex-start; }
      .workout-toolbar-actions { width: 100%; justify-content: stretch; }
      .workout-toolbar-actions button { flex: 1 1 140px; }
      .log-labels { display: none; }
      .log-set { grid-template-columns: 34px minmax(0,1fr) minmax(0,1fr); gap: 8px; align-items: start; padding: 10px 8px; }
      .log-set-number { grid-column: 1; grid-row: 1 / span 2; }
      .weight-entry { grid-column: 2; grid-row: 1; }
      .reps-input { grid-column: 3; grid-row: 1; }
      .rpe-input { grid-column: 2; grid-row: 2; }
      .set-actions { grid-column: 3; grid-row: 2; justify-content: flex-end; }
      .selected-set-tags { grid-column: 2 / -1; }
      .progression-banner-head { flex-wrap: wrap; }
      .real-data-label { font-size: 8px; }
      .calendar-toolbar { gap: 12px; }
      .calendar-toolbar span { display: none; }
      .completed-set-head { display: none; }
      .completed-set-row { grid-template-columns: 34px 1fr 1fr; gap: 8px; padding: 10px; }
      .completed-set-row .set-num { align-self: center; }
      .completed-set-cell { display: grid; gap: 2px; }
      .completed-set-cell::before { display: block; }
      .completed-set-row .completed-rpe { grid-column: 2; }
      .completed-set-row .completed-est { grid-column: 3; }
      .completed-set-tags { grid-column: 2 / -1; }
      .plate-fields { grid-template-columns: 1fr; }
      .body-map-grid { gap: 4px; }
      .resume-draft-banner { align-items: flex-start; }
      .focus-key { grid-template-columns: 78px minmax(0,1fr) 38px; }
      .program-cover-head { padding-right: 20px; padding-top: 76px; }
      .program-cover-edit { top: 20px; left: 20px; right: auto; }
    }
  