.exercise { display: block; padding: 0; overflow: hidden; }
.exercise-open { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) 24px; gap: 12px; align-items: center; border: 0; background: transparent; color: var(--ink); padding: 18px 9px; text-align: left; }
.exercise-open:hover { background: var(--accent-soft); }
.exercise-copy { min-width: 0; }
.exercise-copy strong, .exercise-copy small { display: block; }
.exercise-copy strong { font-size: 20px; line-height: 1.15; }
.exercise-copy small { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.3; }
.exercise-chevron { color: var(--accent); font-size: 32px; line-height: 1; text-align: right; }
.exercise.done { box-shadow: inset 4px 0 0 var(--accent); }
.exercise.done .exercise-open { background: var(--accent-soft); }
#entryWorkoutName { margin: 0; color: var(--accent); padding-right: 52px; }
.exercise-name-label { margin-top: -8px; }
.exercise-name-input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 4px 0 11px; color: var(--ink); font-size: clamp(27px, 7vw, 38px); font-weight: 900; line-height: 1.05; letter-spacing: -.025em; }
.clock-panel { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--accent-soft); padding: 12px; }
.clock-tabs, .clock-actions, .timer-adjust { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clock-tabs button, .clock-actions button, .timer-adjust button { border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); padding: 10px; font-weight: 800; }
.clock-tabs button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.clock-display { display: block; text-align: center; color: var(--ink); font-size: 48px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.clock-actions #clockStartButton { background: var(--ink); color: var(--paper); }
.timer-adjust[hidden] { display: none; }
.exercise-list { display: grid; gap: 10px; padding-top: 16px; }
.exercise { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 9px; align-items: center; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.exercise.done { border: 0; background: transparent; box-shadow: none; }
.exercise-open { min-height: 78px; grid-template-columns: minmax(0, 1fr) 24px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.exercise.done .exercise-open { border-color: var(--accent); background: transparent; }
.exercise-open:active { background: var(--accent-soft); }
.exercise .exercise-index { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-style: normal; font-weight: 900; }
.exercise.done .exercise-index { background: var(--accent); color: #fff; }
.delete-icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); padding: 0; font-size: 22px; }
.delete-icon-button:hover { border-color: #d94b58; color: #d94b58; background: rgba(217,75,88,.1); }
.home-screen { display: grid; align-content: center; min-height: min(620px, calc(100vh - 110px)); padding: 36px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.home-screen[hidden], .workout[hidden] { display: none; }
.home-screen h1 { margin: 0 0 28px; font-size: clamp(38px, 9vw, 58px); line-height: 1; letter-spacing: -.04em; }
.home-actions { display: grid; gap: 12px; }
.home-actions > button { width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) 24px; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--field); color: var(--ink); padding: 16px; text-align: left; }
.home-actions > button:hover { border-color: var(--accent); background: var(--accent-soft); }
.home-actions > button, #startWorkoutButton, #statisticsButton { border-color: var(--line); background: var(--field); color: var(--ink); }
.home-actions .menu-icon, #startWorkoutButton .menu-icon, #statisticsButton .menu-icon { background: var(--accent-soft); color: var(--accent); }
.home-actions .menu-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-actions strong, .home-actions small { display: block; }
.home-actions strong { font-size: 20px; }
.home-actions small { margin-top: 4px; color: var(--muted); }
.home-chevron { color: var(--accent); font-size: 30px; text-align: right; }
.topbar-title { border: 0; background: transparent; cursor: pointer; }
.history-programs { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--accent-soft); }
.history-records-heading { padding-top: 4px; }
.history-records-heading .dialog-note { margin-bottom: 0; }
.workout-choice { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--field); padding: 13px; }
.workout-choice .menu-icon { display: grid; }
.workout-choice-copy { display: grid !important; gap: 3px; min-width: 0; }
.workout-choice-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workout-choice-copy time { color: var(--muted); font-size: 13px; font-weight: 700; }
.workout-choice-state { color: var(--accent); font-weight: 900; white-space: nowrap; }
.program-library-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px 42px; gap: 8px; align-items: center; }
.library-action-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--field); color: var(--ink); padding: 0; font-size: 18px; }
.library-action-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.library-action-button.delete:hover { border-color: #d94b58; color: #d94b58; background: rgba(217,75,88,.1); }
.history-list { gap: 10px; }
.history-tab { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--field); color: var(--ink); padding: 14px; text-align: left; }
.history-tab:hover { border-color: var(--accent); background: var(--accent-soft); }
.history-tab time { color: var(--accent); font-weight: 800; white-space: nowrap; }
.history-detail-meta { margin: -8px 0 0; color: var(--muted); font-weight: 700; }
.history-detail-content { display: grid; gap: 16px; max-height: 64vh; overflow: auto; padding-right: 4px; }
.history-detail-content .history-exercises { padding-top: 0; }
.history-card { display: grid; padding: 0; overflow: hidden; background: var(--field); }
.history-entry-button { width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 20px; gap: 12px; align-items: center; border: 0; background: transparent; color: var(--ink); padding: 14px; text-align: left; }
.history-entry-button:hover { background: var(--accent-soft); }
.history-entry-copy { min-width: 0; }
.history-entry-copy strong, .history-entry-copy small { display: block; }
.history-entry-copy strong { font-size: 17px; }
.history-entry-copy small { margin-top: 3px; color: var(--muted); font-size: 13px; }
.history-entry-button time { color: var(--accent); font-weight: 800; white-space: nowrap; }
.history-entry-chevron { color: var(--accent); font-size: 20px; font-weight: 900; }
.history-entry-details { display: grid; gap: 14px; padding: 0 14px 16px; border-top: 1px solid var(--line); }
.history-entry-details[hidden] { display: none; }
.history-exercises { display: grid; gap: 10px; padding-top: 14px; }
.history-exercise { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--field) 90%, var(--accent) 10%); }
.history-exercise-title { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px; }
.history-exercise-title > span { color: var(--accent); font-style: italic; font-weight: 800; }
.history-exercise-title strong, .history-exercise-title small { display: block; }
.history-exercise-title small { margin-top: 3px; color: var(--muted); }
.history-exercise ol { list-style: none; display: grid; gap: 1px; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.history-exercise li { display: grid; grid-template-columns: 28px 1fr 1fr; gap: 10px; padding: 10px 12px; background: var(--field); }
.history-exercise li > span { color: var(--accent); font-weight: 800; }
.history-exercise li small { color: var(--muted); text-align: right; font-weight: 700; }
.history-missing { margin: 14px 0 0; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); line-height: 1.4; }
.history-missing p { margin: 0 0 12px; }
.history-exercise-actions { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 8px; align-items: center; padding: 8px; }
.history-exercise-open { display: grid; grid-template-columns: 30px minmax(0, 1fr) 18px; gap: 10px; align-items: center; width: 100%; border: 0; background: transparent; color: var(--ink); padding: 4px; text-align: left; }
.history-exercise-open > span, .history-exercise-open > b { color: var(--accent); font-weight: 900; }
.history-exercise-open strong, .history-exercise-open small { display: block; }
.history-exercise-open small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.history-record-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.history-add-program { grid-column: 1 / -1; width: 100%; }
.danger-text-button, .danger-button { border: 1px solid #d94b58; border-radius: 99px; background: transparent; color: #d94b58; padding: 12px 16px; font-weight: 800; }
.danger-button { background: #d94b58; color: #fff; }
.recovered-note { margin: 0; padding: 11px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--muted); font-size: 13px; line-height: 1.4; }
button { touch-action: manipulation; }
.primary-button:not(:disabled) { border: 1px solid color-mix(in srgb,var(--accent) 58%,var(--line)); background: var(--accent-soft); color: var(--ink); box-shadow: none; }
.workout-title-button span { max-width: 100%; overflow-wrap: anywhere; }
.workout-heading { width: 100%; }
.workout-add-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.workout-add-actions button { min-height: 48px; border-radius: 12px; padding: 11px 12px; }
.save-program-bottom { width: 100%; margin-top: 10px; }
.run-screen { position: relative; display: grid; gap: 18px; padding: 32px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.screen-close-button { z-index: 2; }
.run-title-button { display: grid; gap: 3px; width: min(100%, calc(100% - 52px)); border: 0; background: transparent; color: var(--ink); padding: 0; text-align: left; }
.run-title-button span { display: -webkit-box; overflow: hidden; font-size: clamp(30px,8vw,46px); line-height: 1.05; font-weight: 900; letter-spacing: -.035em; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.run-title-button small { color: var(--muted); font-size: 12px; font-weight: 700; }
.run-title-input { width: min(100%, calc(100% - 52px)); border: 1px solid color-mix(in srgb,var(--accent) 55%,var(--line)); border-radius: 10px; background: var(--accent-soft); padding: 8px 10px; color: var(--ink); font-size: 42px; font-weight: 900; line-height: 1; letter-spacing: -.035em; }
.run-title-input[hidden], .run-title-button[hidden] { display: none; }
.close-button { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.close-button:focus, .close-button:focus-visible { outline: none; box-shadow: none; }
.workout { position: relative; }
.workout .section-heading { padding-right: 50px; }
#startWorkoutButton:hover { border-color: var(--accent); background: var(--accent-soft); }
.menu-list .menu-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.exercise .exercise-index, .exercise.done .exercise-index { background: color-mix(in srgb,var(--field) 82%,var(--accent) 18%); color: color-mix(in srgb,var(--muted) 55%,var(--accent) 45%); }
.run-screen[hidden] { display: none; }
.run-screen h1 { margin: 0; font-size: 46px; }
.run-clock { text-align: center; font-size: clamp(48px, 12vw, 72px); line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.run-clock-actions { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 8px; }
.run-clock-actions button { padding: 13px 10px; }
.run-time-panel { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); padding: 14px; }
.run-time-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.run-time-switch button { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-weight: 800; }
.run-time-switch button[aria-pressed="true"] { border-color: color-mix(in srgb,var(--accent) 50%,var(--line)); background: var(--accent-soft); color: var(--ink); }
.run-time-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.run-stopwatch-panel, .run-timer-panel { display: grid; gap: 14px; }
.run-stopwatch-panel[hidden], .run-timer-panel[hidden] { display: none; }
.run-timer-fields { display: grid; grid-template-columns: minmax(86px,120px) 12px minmax(86px,120px); justify-content: center; gap: 4px; align-items: end; }
.run-timer-fields b { align-self: center; padding-top: 20px; color: var(--muted); text-align: center; font-size: 36px; }
.run-timer-fields label { gap: 5px; text-align: center; }
.run-timer-fields input { min-width: 0; border: 0; background: transparent; padding: 4px; color: var(--ink); text-align: center; font-size: clamp(44px,11vw,64px); line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.run-timer-fields input:focus { outline: 0; background: var(--accent-soft); }
.run-laps { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.run-laps:empty { display: none; }
.run-laps li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 9px 4px; }
.run-laps span { color: var(--muted); }
.run-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.run-fields label:last-child { grid-column: 1 / -1; }
.run-fields input, .run-fields select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); padding: 12px; font-size: 16px; }
.distance-field { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.distance-field legend { padding: 0 5px; color: var(--muted); font-size: 13px; font-weight: 800; }
.distance-field label { min-width: 0; }
.distance-field input { min-height: 62px; font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.run-summary { display: flex; justify-content: space-between; align-items: end; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.run-summary span { color: var(--muted); }
.run-summary strong { font-size: 24px; }
.run-save-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.run-save-actions button { width: 100%; }
.run-history-grid, .statistics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.run-history-grid article, .statistics-grid article { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); padding: 14px; }
.run-history-grid span, .statistics-grid span, .statistics-grid small { color: var(--muted); }
.run-history-grid strong, .statistics-grid strong { font-size: 20px; overflow-wrap: anywhere; }
.next-workout { display: grid; gap: 4px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); padding: 14px; }
.next-workout span { color: var(--muted); font-size: 13px; font-weight: 700; }
.next-workout strong { font-size: 20px; }
.swatch-lime { background: linear-gradient(135deg,#39ff14,#159b00); }
.swatch-orange { background: linear-gradient(135deg,#ff8a45,#ff5f1f); }
.swatch-purple { background: linear-gradient(135deg,#d84dff,#8500b8); }
.swatch-red { background: linear-gradient(135deg,#df4770,#8f1736); }
.workout-title-input { width: 100%; border: 1px solid color-mix(in srgb,var(--accent) 55%,var(--line)); border-radius: 10px; background: var(--accent-soft); padding: 8px 10px; color: var(--ink); font-size: clamp(30px,7vw,46px); font-weight: 900; line-height: 1; letter-spacing: -.035em; }
.workout-title-input[hidden] { display: none; }
.workout-title-button[hidden] { display: none; }
.run-timer { display: grid; grid-template-columns: minmax(0,1fr) 1.4fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--field); padding: 13px; }
.run-timer span, .run-timer output { display: block; }
.run-timer span { color: var(--muted); font-size: 13px; font-weight: 700; }
.run-timer output { margin-top: 3px; font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.run-timer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.run-timer-actions button { min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-weight: 800; }
.manual-time { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.manual-time legend { padding: 0 5px; color: var(--muted); font-size: 13px; font-weight: 700; }
#entryDialog { width: min(700px,calc(100% - 16px)); }
#entryDialog form { padding-inline: clamp(16px,4vw,34px); }
#entryDialog .set-row, #entryDialog .sets-header { grid-template-columns: 34px minmax(92px,1fr) minmax(108px,1.15fr) 42px; gap: 10px; }
#entryDialog .stepper { grid-template-columns: minmax(0,1fr) 43px; }
#entryDialog .stepper input { min-height: 68px; font-size: 28px; }
#entryDialog .step-controls button { min-height: 34px; font-size: 13px; background: var(--accent-soft); color: var(--accent); }
#entryDialog .set-row > .remove-button { width: 42px; height: 68px; }
#entryDialog .clock-panel { background: var(--field); }
#entryDialog .clock-tabs button[aria-pressed="true"] { border-color: color-mix(in srgb,var(--accent) 45%,var(--line)); background: color-mix(in srgb,var(--accent) 22%,var(--field)); color: var(--ink); }
#entryDialog .clock-actions #clockStartButton { background: color-mix(in srgb,var(--ink) 82%,var(--surface)); }
#entryDialog .primary-button[value="save"] { border-color: color-mix(in srgb,var(--accent) 58%,var(--line)); background: var(--accent-soft); color: var(--ink); }
.library-save-button { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); padding: 13px 16px; font-weight: 800; }
.library-save-button[data-saved="true"] { border-color: color-mix(in srgb,var(--accent) 50%,var(--line)); background: var(--accent-soft); color: var(--ink); }
.weight-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.weight-mode-switch button { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--muted); font-weight: 800; }
.weight-mode-switch button[aria-pressed="true"] { border-color: color-mix(in srgb,var(--accent) 50%,var(--line)); background: var(--accent-soft); color: var(--ink); }
.bodyweight-value { display: grid; place-items: center; min-height: 68px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); text-align: center; font-weight: 900; }
.library-manage-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: end; }
.library-manage-controls[hidden] { display: none; }
.library-manage-row { display: grid; grid-template-columns: 42px minmax(0,1fr) 38px; gap: 11px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--field); padding: 10px 12px; }
.library-manage-row strong { overflow-wrap: anywhere; }
dialog h2, .history-entry-copy strong, .workout-choice-copy strong { overflow-wrap: anywhere; }
dialog:focus, dialog:focus-visible { outline: none; }
.plan-dialog label[hidden] { display: none; }
.calendar-dialog { width: min(620px,calc(100% - 16px)); }
.calendar-toolbar { display: grid; grid-template-columns: 42px 1fr 42px; gap: 8px; align-items: center; }
.calendar-toolbar strong { text-align: center; font-size: 20px; text-transform: capitalize; }
.calendar-toolbar button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--field); color: var(--ink); font-size: 26px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; }
.calendar-weekdays span { color: var(--muted); text-align: center; font-size: 12px; font-weight: 800; }
.calendar-day, .calendar-blank { min-width: 0; aspect-ratio: 1; }
.calendar-day { display: grid; align-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); font-weight: 900; }
.calendar-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.calendar-day[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.calendar-marks { display: flex; justify-content: center; gap: 4px; min-height: 7px; }
.calendar-marks i, .calendar-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.calendar-marks .completed, .calendar-legend .completed { background: #53b96a; }
.calendar-marks .planned, .calendar-legend .planned { background: #e0b83f; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12px; font-weight: 800; }
.calendar-legend span { display: flex; align-items: center; gap: 6px; }
.calendar-day-panel { display: grid; gap: 13px; border-top: 1px solid var(--line); padding-top: 16px; }
.calendar-day-panel > p, .calendar-empty { margin: 0; color: var(--muted); }
.calendar-day-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.calendar-day-heading span, .calendar-day-heading strong { display: block; }
.calendar-day-heading span { color: var(--accent); font-size: 13px; font-weight: 800; }
.calendar-day-heading strong { margin-top: 2px; font-size: 19px; }
.calendar-day-list { display: grid; gap: 7px; }
.calendar-day-list h3 { margin: 0 0 2px; color: var(--muted); font-size: 13px; }
.calendar-event { display: grid; grid-template-columns: minmax(0,1fr) 18px; gap: 3px 8px; width: 100%; border: 1px solid var(--line); border-left-width: 4px; border-radius: 11px; background: var(--field); color: var(--ink); padding: 11px 12px; text-align: left; }
.calendar-event.completed { border-left-color: #53b96a; }
.calendar-event.planned { border-left-color: #e0b83f; }
.calendar-event span, .calendar-event small { overflow-wrap: anywhere; }
.calendar-event span { font-weight: 900; }
.calendar-event small { color: var(--muted); }
.calendar-event b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent); font-size: 20px; }
.calendar-plan-row { display: grid; grid-template-columns: minmax(0,1fr) 38px; gap: 7px; align-items: center; }
.plan-dialog select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); padding: 12px; }
.exercise-picker-list, .exercise-stat-list { display: grid; gap: 9px; max-height: 48vh; overflow: auto; }
.exercise-picker-list > button, .exercise-stat-list > button { display: grid; grid-template-columns: 42px minmax(0,1fr) 24px; gap: 11px; align-items: center; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); padding: 12px; text-align: left; }
.exercise-picker-list strong, .exercise-picker-list small, .exercise-stat-list strong, .exercise-stat-list small { display: block; }
.exercise-picker-list small, .exercise-stat-list small { margin-top: 3px; color: var(--muted); line-height: 1.3; }
.exercise-picker-list b, .exercise-stat-list b { color: var(--accent); font-size: 22px; }
.statistics-dialog { width: min(760px,calc(100% - 16px)); }
.statistics-section-heading { display: grid; gap: 4px; margin-top: 8px; }
.statistics-section-heading small { color: var(--muted); }
.attendance-section { display: grid; gap: 12px; }
.attendance-controls { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.attendance-controls button { min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--ink); font-weight: 800; }
.attendance-controls button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.attendance-legend { display: flex; gap: 16px; color: var(--muted); font-size: 13px; font-weight: 700; }
.attendance-legend span { display: flex; align-items: center; gap: 6px; }
.attendance-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--ink); }
.attendance-legend i.run { background: var(--accent); }
.attendance-chart-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--field); padding: 8px; }
.attendance-chart-wrap[hidden] { display: none; }
.attendance-chart-wrap svg { display: block; width: 100%; min-width: 520px; height: auto; }
#attendanceChart .chart-grid { stroke: var(--line); stroke-width: 1; }
#attendanceChart text { fill: var(--muted); font-family: inherit; font-size: 12px; }
#attendanceChart .attendance-strength { fill: var(--ink); opacity: .72; }
#attendanceChart .attendance-run { fill: var(--accent); }
.attendance-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
.attendance-summary span { display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); padding: 9px; color: var(--muted); font-size: 11px; }
.attendance-summary strong { color: var(--ink); font-size: 15px; }
#statisticsOverview, #exerciseStatistics { display: grid; gap: 18px; }
#statisticsOverview[hidden], #exerciseStatistics[hidden], .exercise-chart-wrap[hidden], .chart-empty[hidden] { display: none; }
.statistics-back { justify-self: start; border: 0; background: transparent; color: var(--accent); padding: 0; font-weight: 800; }
.chart-controls { display: grid; gap: 8px; }
.chart-controls > div { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.chart-controls button { min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--ink); padding: 8px; font-size: 13px; font-weight: 800; }
.chart-controls button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.exercise-chart-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--field); padding: 8px; }
.exercise-chart-wrap svg { display: block; width: 100%; min-width: 520px; height: auto; overflow: visible; }
#exerciseChart .chart-grid { stroke: var(--line); stroke-width: 1; }
#exerciseChart polyline { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
#exerciseChart circle { fill: var(--surface); stroke: var(--accent); stroke-width: 4; }
#exerciseChart text { fill: var(--muted); font-family: inherit; font-size: 12px; }
#exerciseChart .chart-value { fill: var(--ink); font-size: 13px; font-weight: 900; }
#exerciseChart .chart-unit { fill: var(--muted); font-weight: 800; }
.chart-empty { margin: 0; border: 1px dashed var(--line); border-radius: 12px; padding: 24px 16px; color: var(--muted); text-align: center; }
.chart-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.chart-summary span { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); padding: 10px; color: var(--muted); font-size: 12px; }
.chart-summary strong { color: var(--ink); font-size: 16px; }
@media (max-width: 430px) {
  .exercise { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 7px; }
  .exercise-open { grid-template-columns: minmax(0, 1fr) 20px; padding: 14px 12px; }
  .exercise-copy strong { font-size: 19px; }
  .exercise-copy small { font-size: 13px; }
  #entryDialog form { gap: 14px; }
  .clock-display { font-size: 44px; }
  .workout-choice { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .history-entry-button { grid-template-columns: 40px minmax(0, 1fr) 18px; }
  .history-entry-button time { grid-column: 2; font-size: 12px; }
  .history-entry-chevron { grid-column: 3; grid-row: 1 / span 2; }
  .history-tab { grid-template-columns: minmax(0, 1fr) 18px; padding: 12px; }
  .history-tab time { grid-column: 1; font-size: 12px; }
  .history-tab .history-entry-chevron { grid-column: 2; grid-row: 1 / span 2; }
  .home-screen { min-height: calc(100vh - 90px); padding: 24px 18px; }
  .home-actions > button { grid-template-columns: 44px minmax(0, 1fr) 20px; padding: 14px; }
  .program-library-row { grid-template-columns: minmax(0, 1fr) 38px 38px; gap: 6px; }
  .library-action-button { width: 38px; height: 38px; }
  .history-record-actions { grid-template-columns: 1fr; }
  .home-screen { align-content: start; min-height: auto; }
  .home-screen h1 { font-size: 38px; }
  .workout-title-button span { display: -webkit-box; max-width: 100%; overflow: hidden; white-space: normal; overflow-wrap: anywhere; font-size: 20px; line-height: 1.12; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .run-title-button span { font-size: 20px; }
  .workout-title-input, .run-title-input { font-size: 28px; }
  .workout-add-actions { grid-template-columns: 1fr; }
  .run-screen { padding: 24px 18px; }
  .run-clock-actions { grid-template-columns: 1fr 1fr; }
  .run-clock-actions #runStartButton { grid-column: 1 / -1; }
  .run-fields, .run-save-actions { grid-template-columns: 1fr; }
  .run-fields label:last-child { grid-column: auto; }
  .run-history-grid { grid-template-columns: 1fr; }
  .run-timer { grid-template-columns: 1fr; }
  #entryDialog .set-row, #entryDialog .sets-header { grid-template-columns: 28px minmax(86px,1fr) minmax(98px,1.1fr) 38px; gap: 7px; }
  #entryDialog .stepper { grid-template-columns: minmax(0,1fr) 40px; }
  #entryDialog .stepper input { font-size: 26px; }
  #entryDialog .set-row > .remove-button { width: 38px; }
  .chart-summary { grid-template-columns: 1fr; }
  .attendance-summary { grid-template-columns: 1fr 1fr; }
  .statistics-dialog form { padding-inline: 16px; }
  .calendar-dialog form { padding-inline: 16px; }
  .calendar-weekdays, .calendar-grid { gap: 3px; }
  .calendar-day { border-radius: 8px; padding: 2px; font-size: 13px; }
  .calendar-day-heading { align-items: end; }
  .calendar-day-heading .add-button { padding: 10px; }
  .library-manage-controls { grid-template-columns: 1fr; }
}
