/* Большое UX-обновление: лёгкие поверхности и смысловой акцент. */
:root { --success: var(--accent); --warning: #e0b83f; --neutral-action: color-mix(in srgb,var(--ink) 7%,var(--surface)); }
.eyebrow { color:var(--muted)!important; }
.topbar { flex-direction:row-reverse; align-items:flex-start; }
.topbar-title { text-align:left; font-style:normal; font-size:20px; letter-spacing:-.02em; }
.topbar-date { display:block; color:var(--muted); font-size:12px; font-weight:600; margin-top:3px; }
.close-button,.screen-close-button { width:32px!important; height:32px!important; right:14px!important; top:13px!important; border-color:var(--line)!important; color:var(--muted)!important; background:var(--neutral-action)!important; box-shadow:none!important; outline:none!important; font-size:20px!important; }
.close-button:hover,.screen-close-button:hover { color:var(--ink)!important; border-color:color-mix(in srgb,var(--ink) 22%,var(--line))!important; background:color-mix(in srgb,var(--ink) 10%,var(--surface))!important; }
.home-screen { display:grid; gap:16px; }
.home-status { padding:4px 2px 6px; }
.home-status small,.continue-card small,.week-widget small { display:block; color:var(--muted); font-weight:700; }
.home-status strong { display:block; margin-top:4px; font-size:clamp(27px,7vw,38px); line-height:1.05; letter-spacing:-.035em; }
.continue-card,.week-widget { position:relative; width:100%; text-align:left; padding:17px 18px; border:0; border-radius:15px; background:color-mix(in srgb,var(--surface) 82%,var(--ink) 3%); color:var(--ink); }
.continue-card { display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; }
.continue-card strong { display:block; margin:4px 0; font-size:17px; }
.continue-card .home-chevron { color:var(--muted); }
.week-widget { display:grid; gap:13px; }
.widget-heading { display:flex; justify-content:space-between; align-items:center; }
.widget-heading h3 { margin:0; font-size:17px; }
.more-button { width:38px; height:38px; border:0; border-radius:50%; background:transparent; color:var(--muted); font-size:24px; letter-spacing:2px; }
.more-button:hover,.more-button[aria-expanded="true"] { background:var(--neutral-action); color:var(--ink); }
.week-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(82px,1fr)); gap:8px; padding:5px; margin:-5px; border-radius:10px; cursor:pointer; }
.week-stats:hover,.week-stats:focus-visible { background:var(--neutral-action); outline:0; }
.week-stats span { min-width:0; color:var(--muted); font-size:12px; }
.week-stats strong { display:block; max-width:100%; color:var(--ink); font-size:clamp(16px,5vw,21px); line-height:1.12; margin-top:3px; overflow-wrap:anywhere; }
.action-menu { position:absolute; z-index:10; right:10px; top:48px; min-width:190px; padding:6px; display:grid; gap:2px; border:1px solid var(--line); border-radius:12px; background:var(--surface); box-shadow:var(--shadow); }
.action-menu[hidden] { display:none; }
.action-menu button { border:0; border-radius:8px; background:transparent; color:var(--ink); padding:11px 12px; text-align:left; }
.action-menu button:hover { background:var(--neutral-action); }
.action-menu button:disabled { opacity:.5; cursor:default; }
.action-menu button[aria-pressed="true"] { color:var(--accent); background:var(--accent-soft); }
.action-menu .danger { color:#e26f75; }
.home-actions>button { border-color:transparent!important; background:color-mix(in srgb,var(--surface) 82%,var(--ink) 3%)!important; }
.home-actions>button:hover { border-color:color-mix(in srgb,var(--accent) 45%,var(--line))!important; background:var(--accent-soft)!important; }
.home-actions .menu-icon { background:var(--neutral-action)!important; color:var(--muted)!important; box-shadow:none!important; }
.menu-icon-svg { stroke:currentColor; fill:none; stroke-width:1.8; }
.run-icon-svg { width:24px; height:24px; stroke-width:1.9; }
.run-icon-svg .run-speed-lines { opacity:.75; }
.empty-state { padding:30px 18px; border:0; }
.empty-state h3 { margin:0 0 7px; }
.empty-state p { color:var(--muted); margin:0 0 18px; }
.workout-add-actions { grid-template-columns:1fr!important; }
#addSavedExerciseButton { display:none!important; }
#finishButton:disabled { opacity:.45; }
.empty-finish-tip { color:var(--muted); text-align:center; font-size:12px; margin:-10px 0 0; }
.exercise { position:relative; grid-template-columns:30px 1fr 38px!important; border:0!important; margin:7px 0; background:color-mix(in srgb,var(--surface) 84%,var(--ink) 3%)!important; }
.exercise.done { box-shadow:inset 3px 0 0 var(--accent)!important; }
.exercise.done .exercise-index::before { content:'✓'; font-style:normal; }
.exercise.done .exercise-index { font-size:0; color:var(--accent); }
.exercise.done .exercise-index::before { font-size:15px; }
.exercise .delete-icon-button { display:none; }
.card-more { align-self:center; }
.primary-button,.add-button { background:var(--accent-soft); border:1px solid color-mix(in srgb,var(--accent) 55%,var(--line)); color:var(--ink); }
.outline-button,.clock-reset,.run-clock-actions .outline-button { background:var(--neutral-action); border-color:transparent; color:var(--ink); }
.stepper { display:grid!important; grid-template-columns:44px minmax(54px,1fr) 44px!important; align-items:stretch!important; gap:5px!important; }
.step-controls { display:contents!important; }
.step-controls button { min-width:44px!important; height:48px!important; font-size:0!important; border-radius:10px!important; background:var(--neutral-action)!important; color:var(--ink)!important; }
.step-controls button:first-child { grid-column:3; grid-row:1; }
.step-controls button:last-child { grid-column:1; grid-row:1; }
.step-controls button:first-child::after { content:'+'; font-size:24px; }
.step-controls button:last-child::after { content:'−'; font-size:24px; }
.stepper input { grid-column:2!important; grid-row:1!important; display:block!important; min-width:0!important; width:100%!important; height:48px!important; min-height:48px!important; padding:5px!important; opacity:1!important; color:var(--ink)!important; background:var(--field)!important; text-align:center!important; font-size:22px!important; line-height:1!important; -webkit-text-fill-color:var(--ink)!important; }
.stepper input::-webkit-inner-spin-button,.stepper input::-webkit-outer-spin-button { appearance:none; margin:0; }
.stepper input[type="number"] { appearance:textfield; }
.clock-start,#clockStartButton { background:color-mix(in srgb,var(--accent) 22%,var(--field))!important; border-color:color-mix(in srgb,var(--accent) 45%,var(--line))!important; color:var(--ink)!important; }
.library-save-button[data-saved="true"] { width:auto!important; justify-self:start; border:0!important; background:transparent!important; color:var(--muted)!important; padding:5px 2px!important; font-size:12px; cursor:default; }
.clock-panel { border:0!important; background:color-mix(in srgb,var(--surface) 84%,var(--ink) 3%)!important; }
.workout-toolbar { display:flex; justify-content:flex-end; margin:-10px 46px 4px 0; }
.run-mode-tabs,.history-filters,.distance-format,.settings-segment { display:grid; grid-template-columns:1fr 1fr; gap:4px; padding:4px; border-radius:12px; background:var(--neutral-action); }
.history-filters { grid-template-columns:repeat(3,1fr); }
.run-mode-tabs button,.history-filters button,.distance-format button,.settings-segment button { border:0; border-radius:9px; background:transparent; color:var(--muted); padding:10px 8px; font-weight:800; }
.run-mode-tabs button[aria-pressed="true"],.history-filters button[aria-pressed="true"],.distance-format button[aria-pressed="true"],.settings-segment button[aria-pressed="true"] { background:var(--surface); color:var(--accent); box-shadow:0 1px 5px rgba(0,0,0,.12); }
.manual-run-heading { margin:4px 0 -3px; font-size:22px; }
.run-screen[data-run-mode="live"] .run-fields,.run-screen[data-run-mode="live"] .run-save-actions { display:none!important; }
.run-screen[data-run-mode="manual"] .run-time-panel,.run-screen[data-run-mode="manual"] .run-summary,#runManualTitle { display:none; }
.run-screen[data-run-mode="manual"] #runManualTitle { display:block; }
.run-screen[data-run-mode="manual"] .run-fields { display:grid!important; }
.run-screen[data-run-mode="manual"] .run-save-actions #saveRunProgramButton { display:none; }
.run-screen[data-run-mode="manual"] .run-save-actions { grid-template-columns:1fr!important; }
.distance-decimal-field[hidden],.legacy-distance-fields[hidden] { display:none!important; }
.distance-format,.settings-segment { position:relative; overflow:hidden; grid-template-columns:1fr 1fr; }
.distance-format::before,.settings-segment::before { content:''; position:absolute; inset:4px auto 4px 4px; width:calc(50% - 4px); border-radius:9px; background:var(--accent); opacity:.2; transition:transform .2s ease; pointer-events:none; }
.distance-format[data-selected="decimal"]::before,.settings-segment[data-selected="decimal"]::before { transform:translateX(100%); }
.distance-format button,.settings-segment button { position:relative; z-index:1; }
.history-entry-row { position:relative; display:grid; grid-template-columns:1fr 40px; gap:6px; align-items:center; }
.history-tab { width:100%; grid-template-columns:1fr!important; position:relative; }
.history-tab time { grid-column:1; color:var(--muted)!important; font-weight:600!important; }
.history-tab .history-entry-chevron { display:none; }
.history-card-more { grid-column:2; grid-row:1; }
.library-main { border:0; background:transparent; color:var(--ink); text-align:left; padding:8px 0; }
.program-library-row { position:relative; grid-template-columns:1fr 40px!important; }
.program-library-row>.library-action-button { display:none; }
.workout-choice time { color:var(--muted)!important; }
.next-workout { cursor:pointer; }
.next-workout:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.library-manage-row { position:relative; grid-template-columns:42px 1fr 40px!important; }
.library-manage-row>.delete-icon-button { display:none; }
.library-stat { display:block; color:var(--muted); font-size:12px; margin-top:3px; }
.library-search-create { width:100%; border:1px dashed color-mix(in srgb,var(--accent) 60%,var(--line)); border-radius:12px; background:var(--accent-soft); color:var(--ink); padding:13px; text-align:left; }
.calendar-event.completed { border-left-color:var(--accent)!important; }
.calendar-legend i.completed,.calendar-marks i.completed { background:var(--accent)!important; }
.calendar-day.has-completed .calendar-marks i.completed { background:var(--accent)!important; }
.settings-section { display:grid; gap:12px; padding-top:16px; border-top:1px solid var(--line); }
.settings-section h3 { margin:0; }
.setting-row { display:flex; justify-content:space-between; align-items:center; gap:18px; }
.setting-copy { display:grid; gap:4px; min-width:0; }
.setting-copy strong,.setting-copy small { display:block; }
.setting-copy small { color:var(--muted); font-weight:500; line-height:1.35; }
.setting-row button { flex:0 0 auto; }
.tip-toggle { min-width:58px; }
.statistics-grid article { border:0!important; background:var(--neutral-action)!important; }
.statistics-grid article small { display:block; color:var(--muted); }
.statistics-grid { grid-template-columns:1fr!important; gap:7px!important; }
.statistics-grid .statistics-row { min-height:44px; padding:8px 12px!important; display:grid!important; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:10px!important; }
.statistics-grid .statistics-row span { color:var(--ink); font-weight:800; }
.statistics-grid .statistics-row strong { color:var(--accent); font-size:19px; white-space:nowrap; }
.statistics-grid .statistics-row strong small { display:inline; font-size:12px; font-weight:700; }
.statistics-grid .statistics-row b { color:var(--muted); font-size:14px; white-space:nowrap; }
#statisticsOverview>.eyebrow { margin-bottom:2px; }
.set-row .stepper,.bodyweight-value { box-sizing:border-box; width:100%; height:56px; min-height:56px!important; }
.bodyweight-value { padding:0 6px; }
.program-profiles { display:grid; gap:8px; }
.program-profile-card { position:relative; display:grid; grid-template-columns:92px minmax(0,1fr) 34px; gap:8px; align-items:center; border:1px solid var(--line); border-radius:12px; background:var(--field); padding:8px; }
.program-profile-card.active { border-color:color-mix(in srgb,var(--accent) 55%,var(--line)); background:var(--accent-soft); }
.program-profile-open { display:grid; gap:2px; min-height:48px; border:0; border-radius:9px; background:transparent; color:var(--ink); text-align:left; padding:5px 7px; }
.program-profile-open span { color:var(--accent); font-size:11px; font-weight:900; text-transform:uppercase; }
.program-profile-open span { line-height:1.15; overflow-wrap:normal; }
.program-profile-open small { color:var(--muted); font-size:11px; }
.program-profile-name { display:flex; align-items:center; width:100%; height:56px; min-width:0; border:1px solid var(--line); border-radius:10px; background:var(--neutral-action); color:var(--ink); padding:0 14px; text-align:left; }
.program-profile-name strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:18px; font-weight:850; }
.program-profile-more { width:34px!important; height:34px!important; }
.program-profile-delete { width:34px; height:34px; border:1px solid var(--line); border-radius:50%; background:transparent; color:var(--muted); font-size:20px; line-height:1; padding:0; }
.program-profile-delete:hover { border-color:var(--danger,#d65b6a); color:var(--danger,#d65b6a); }
.program-profiles-empty { margin:0; padding:18px 10px; color:var(--muted); text-align:center; }
#myProgramsButton strong { white-space:nowrap; font-size:clamp(14px,4.15vw,17px); letter-spacing:-.02em; }
.active-program-details { display:grid; gap:10px; padding-top:4px; }
#programLibraryDialog form { gap:12px; }
@media(max-width:430px){.program-profile-card{grid-template-columns:78px minmax(0,1fr) 32px;gap:6px}.program-profile-name{height:54px;padding-inline:12px}.program-profile-name strong{font-size:17px}.program-profile-open span{font-size:9px}.program-profile-more{width:32px!important;height:32px!important}.statistics-grid .statistics-row{min-height:42px;padding:7px 10px!important}}
.exercise-stat-row { border-color:transparent!important; background:var(--neutral-action)!important; }
dialog { border-color:color-mix(in srgb,var(--line) 60%,transparent)!important; box-shadow:0 18px 55px rgba(0,0,0,.28)!important; }
dialog form { padding-bottom:calc(30px + env(safe-area-inset-bottom,0px))!important; }
.history-detail-content { padding-bottom:calc(20px + env(safe-area-inset-bottom,0px)); }
.history-exercise { background:var(--field)!important; border-color:color-mix(in srgb,var(--line) 60%,transparent)!important; }
.history-exercise li { background:color-mix(in srgb,var(--field) 94%,var(--surface) 6%)!important; }
#exerciseStatistics { padding-top:10px; }
#exerciseStatisticsTitle { margin:2px 42px 4px 0; padding-top:2px; font-size:clamp(26px,7vw,36px); line-height:1.12; overflow-wrap:anywhere; }
.widget-picker { position:relative; }
.widget-picker-button { width:100%; display:flex; align-items:center; justify-content:space-between; border:0; border-radius:11px; background:var(--neutral-action); color:var(--ink); padding:13px 14px; text-align:left; font-weight:800; }
.widget-picker-button span { color:var(--muted); }
.widget-picker-button strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.widget-exercise-settings[hidden] { display:none!important; }
.widget-options-empty { display:block; padding:12px 14px; color:var(--muted); font-size:13px; }
.widget-option-menu { top:calc(100% + 6px); left:0; right:0; min-width:0; }
.widget-option-menu:not([hidden]) { position:absolute; top:auto; bottom:calc(100% + 6px); left:0; right:0; max-height:42vh; overflow-y:auto; z-index:30; }
#colorDialog { height:min(620px,calc(100dvh - 12px)); max-height:calc(100dvh - 12px); }
#colorDialog>form { height:100%; max-height:calc(100dvh - 14px); overflow-y:auto; align-content:start; gap:14px; }
#colorDialog .theme-grid { margin-top:7px; }
#colorDialog .theme-grid button { min-height:40px; padding:8px 12px; }
#colorDialog .swatch { min-height:44px!important; height:44px!important; aspect-ratio:auto!important; border-radius:10px!important; }
.menu-count { min-width:0!important; width:auto!important; padding:0!important; border:0!important; background:transparent!important; color:var(--muted)!important; font-size:11px!important; white-space:nowrap; }
.color-grid { grid-template-columns:repeat(4,1fr)!important; gap:9px!important; }
.swatch { min-height:66px!important; aspect-ratio:1; padding:0!important; border-radius:12px!important; }
.swatch span,.swatch small { position:absolute!important; width:1px!important; height:1px!important; overflow:hidden!important; clip:rect(0 0 0 0)!important; }
.picker-new-exercise { width:100%; border-style:dashed; }
.workout-title-input { font-size:clamp(22px,6vw,30px)!important; line-height:1.1!important; }
#entryDialog .exercise-name-input { font-size:clamp(22px,6vw,30px)!important; }
.exercise-index { align-content:center!important; height:32px!important; border-radius:50%!important; font-size:14px!important; align-self:start; }
.exercise-library-star { position:absolute; left:8px; top:35px; bottom:auto; display:grid; place-items:start center; width:34px; height:20px; padding:0; border:0; background:transparent; font-size:16px; line-height:1; color:var(--muted); }
.exercise-library-star.saved { color:var(--accent); }
.exercise.done .exercise-index { font-size:0!important; }
.exercise.done .exercise-library-star { font-size:11px!important; }
#saveRunProgramButton[hidden] { display:none!important; }
.mixed-run-result { margin-top:10px; }
#entryWorkoutName,#saveExerciseLibraryButton { display:none!important; }
#entryDialog form { gap:14px; }
.run-screen[data-run-mode="unified"] .run-time-panel,.run-screen[data-run-mode="unified"] .run-fields,.run-screen[data-run-mode="unified"] .run-summary,.run-screen[data-run-mode="unified"] .run-save-actions { display:grid!important; }
.run-screen[data-run-mode="unified"] .run-save-actions { grid-template-columns:1fr!important; }
#saveRunProgramButton { display:none!important; }
.run-fields>label:last-child,#runLapDistanceLabel[hidden] { display:none!important; }
.distance-field { grid-template-columns:130px minmax(0,1fr) minmax(0,1fr)!important; align-items:end; }
.distance-field legend { grid-column:1/-1; }
.distance-format { grid-column:1; align-self:end; height:62px; }
.distance-format button { padding:8px 4px; }
.distance-decimal-field { grid-column:2/4; }
.lap-distance-field { grid-column:1/-1; display:grid; grid-template-columns:1fr; min-width:0; margin:0; border:0; padding:0; }
.lap-distance-field legend { grid-column:1/-1; color:var(--muted); font-size:13px; font-weight:800; }
.run-distance-mode { display:grid; grid-template-columns:1fr 1fr; gap:4px; height:48px; padding:4px; border-radius:12px; background:var(--neutral-action); }
.run-distance-mode button { border:0; border-radius:9px; background:transparent; color:var(--muted); padding:6px; font-weight:800; }
.run-distance-mode button[aria-pressed="true"] { background:var(--surface); color:var(--accent); }
.lap-distance-field label input { min-height:48px; font-size:22px; font-weight:900; }
#runStartButton,#runTimerStart { background:color-mix(in srgb,var(--accent) 22%,var(--field))!important; border:1px solid color-mix(in srgb,var(--accent) 45%,var(--line))!important; color:var(--ink)!important; }
@media(max-width:430px){
  .shell{padding-top:12px}.topbar{padding-bottom:10px;margin-bottom:12px}.home-screen{gap:9px}
  .home-status{padding-bottom:2px}.home-status strong{font-size:29px}.week-widget,.continue-card{padding:13px 15px}.week-stats strong{font-size:18px}
  .exercise{padding:12px 5px}.exercise-open small{font-size:12px}.sets-header{grid-template-columns:28px 1fr 1fr 36px!important}.set-row{grid-template-columns:28px 1fr 1fr 36px!important}
  .stepper{grid-template-columns:38px minmax(44px,1fr) 38px!important}.step-controls button{min-width:38px!important;height:46px!important}.stepper input{height:46px!important;min-height:46px!important;padding:5px 2px!important;font-size:20px!important}
  dialog form{padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))!important}.history-detail-content{padding-bottom:calc(72px + env(safe-area-inset-bottom,0px))}
  .history-filters button{font-size:12px;padding:9px 3px}.run-mode-tabs button{font-size:13px}
  .color-grid{grid-template-columns:repeat(4,1fr)!important}.swatch{min-height:42px!important;height:42px!important}
  .distance-field{grid-template-columns:112px minmax(0,1fr) minmax(0,1fr)!important;padding:9px!important;gap:7px!important}.distance-format{height:42px}.distance-field input{height:42px!important;min-height:42px!important;font-size:21px!important;padding:6px 8px!important}
  .lap-distance-field{grid-template-columns:1fr}.run-screen{gap:13px!important}
  .run-screen{padding:18px 14px!important}.run-title-button span{font-size:29px!important}.run-title-button small{margin-top:2px!important}
  .run-time-panel{padding:10px!important;gap:8px!important}.run-clock{font-size:48px!important}.run-clock-actions{gap:6px!important}.run-clock-actions button{min-height:42px!important;padding:8px!important}
  .run-fields{gap:8px!important}.distance-field{margin-top:0!important}.manual-time{padding:8px!important;gap:6px!important}.manual-time input{height:48px!important;min-height:48px!important;padding:9px!important}.run-summary{padding:9px 12px!important}.run-save-actions button{padding:12px!important}
}
@media(max-width:700px){
  input,textarea,select{font-size:16px!important}
  .workout-title-input,#entryDialog .exercise-name-input,.run-title-input{font-size:clamp(22px,6vw,30px)!important}
  .stepper input{font-size:20px!important}
  .run-timer-panel{gap:8px!important}
  .run-timer-fields{align-items:center!important}
  .run-timer-fields label{gap:0!important}
  .run-timer-fields label span{font-size:11px!important;line-height:12px!important}
  .run-timer-fields input{height:48px!important;min-height:48px!important;padding:0!important;font-size:46px!important}
  .run-timer-fields b{padding-top:10px!important;font-size:30px!important}
  .run-timer-actions button{min-height:42px!important;padding:8px!important}
  .distance-format{height:48px!important}
  .distance-field input{height:48px!important;min-height:48px!important;font-size:21px!important;padding:7px 9px!important}
}

/* One readable card: status, name and actual workout count. */
#programProfilesList { gap:12px; }
#programProfilesList .program-profile-card { display:block; padding:0; border-radius:16px; background:var(--field); }
#programProfilesList .program-profile-card.active { background:color-mix(in srgb,var(--accent) 6%,var(--field)); }
#programProfilesList .program-profile-open { position:relative; width:100%; min-height:108px; padding:24px 52px 24px 20px; gap:8px; border-radius:15px; }
#programProfilesList .program-profile-open:hover { background:var(--accent-soft); }
#programProfilesList .program-profile-status { font-size:11px; line-height:1.4; letter-spacing:.04em; margin-bottom:5px; }
#programProfilesList .program-profile-open strong { font-size:21px; line-height:1.3; font-weight:700; overflow-wrap:anywhere; }
#programProfilesList .program-profile-open small { font-size:14px; line-height:1.4; }
#programProfilesList .program-profile-arrow { position:absolute; right:18px; top:calc(50% - 10px); width:20px; height:20px; fill:none; stroke:var(--accent); stroke-width:1.7; }
#programProfilesList .program-profile-more { position:absolute; top:5px; right:7px; background:transparent; border-color:transparent; color:var(--muted); }
