/* Final presentation layer: shared tokens, quiet surfaces, full screens and sheets. */
:root {
 --background:var(--paper);--surfaceElevated:var(--field);--textPrimary:var(--ink);--textSecondary:var(--muted);--textMuted:color-mix(in srgb,var(--ink) 55%,var(--paper));
 --border:color-mix(in srgb,var(--ink) 13%,transparent);--accentSoft:color-mix(in srgb,var(--accent) 9%,var(--surface));--danger:#c34d61;--warning:#b58a32;--success:#568666;
 --radius-sm:8px;--radius-md:12px;--radius-lg:16px;--radius-xl:22px;--radius-2xl:28px;
 --screen-title:32px;--section-title:23px;--card-title:19px;--body-size:16px;--caption:13px;--large-number:44px;
 --ease:cubic-bezier(.2,.8,.2,1);
 font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
body {background:var(--background)!important;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;font-size:var(--body-size);font-weight:400}
button,input,textarea,select {font-family:inherit;letter-spacing:normal!important}
button {font-weight:550!important;transition:background-color 140ms var(--ease),transform 100ms var(--ease)}
button:active:not(:disabled) {transform:scale(.98)}
button:focus-visible,input:focus-visible,textarea:focus-visible {outline:2px solid color-mix(in srgb,var(--accent) 50%,var(--ink));outline-offset:2px;box-shadow:none!important}
.shell {max-width:640px;padding:calc(16px + env(safe-area-inset-top)) 18px calc(32px + env(safe-area-inset-bottom))!important}
.topbar {border:0!important;margin-bottom:8px!important;padding-bottom:4px!important}
#menuButton{order:2!important}#homeButton{order:1!important;text-align:left!important}.topbar{flex-direction:row!important}
.topbar-title {font-size:16px!important;font-style:normal!important;transform:none!important;font-weight:700!important;letter-spacing:0!important;text-transform:none!important}
.topbar-date {font-size:12px!important;font-weight:500!important;font-style:normal!important;color:var(--textSecondary)}
.workout,.home-screen,.run-screen {border:0!important;box-shadow:none!important;background:transparent!important;border-radius:0!important;padding:0!important}
.home-status {border:0!important;box-shadow:none!important;background:none!important;padding:0 0 12px!important}
.home-status>strong {font-size:28px!important;line-height:1.25!important;font-weight:700!important}
.home-status small {font-weight:500!important;color:var(--textSecondary)!important}
.home-status small[hidden]{display:none!important}
.home-screen .home-section-label {font-size:var(--caption)!important;line-height:20px!important;color:var(--textSecondary);font-weight:500!important;margin:16px 0 0}
.home-screen {gap:10px!important}
.continue-card,.week-widget,.home-actions>button,.home-menu>button {border:1px solid var(--border)!important;background:var(--surface)!important;box-shadow:none!important;border-radius:var(--radius-md)!important}
.week-widget {padding:16px!important}
.menu-icon,.exercise-index,.set-number {background:var(--surfaceElevated)!important;color:var(--textSecondary)!important;box-shadow:none!important;font-style:normal!important}
.menu-icon svg {color:var(--textSecondary)}
h1,h2,h3,.workout-title-button span,#runTitle,#programDetailTitle {font-style:normal!important;transform:none!important;text-transform:none!important;letter-spacing:-.02em!important}
h2,#runTitle {font-size:var(--screen-title)!important;line-height:38px!important;font-weight:700!important}
h3,.subheading {font-size:var(--section-title)!important;font-weight:650!important;line-height:1.3!important}
.exercise-copy strong,.workout-choice strong,.program-profile-open strong,.stats-exercise strong {font-size:var(--card-title)!important;line-height:1.35!important;font-weight:650!important}
.workout-title-button span {font-size:28px!important;line-height:1.3!important;font-weight:700!important}
label,small,.eyebrow {font-weight:500!important}
input,textarea {font-size:16px!important;border-color:var(--border)!important;border-radius:var(--radius-sm)!important;box-shadow:none!important}
.primary-button,.session-actions .session-start {background:var(--accentSoft)!important;color:var(--textPrimary)!important;border:1px solid color-mix(in srgb,var(--accent) 30%,transparent)!important;border-radius:var(--radius-md)!important;min-height:46px}
.outline-button,.add-button,.clock-reset,.session-actions button:not(.session-start) {background:var(--surface)!important;color:var(--textPrimary)!important;border:1px solid var(--border)!important;border-radius:var(--radius-md)!important;box-shadow:none!important}
.danger,.delete,.danger-text-button {color:var(--danger)!important;background:transparent!important}
.close-button,.more-button,.screen-back {background:transparent!important;color:var(--textSecondary)!important;border:0!important;box-shadow:none!important}
.close-button:hover,.more-button:hover {background:var(--surfaceElevated)!important}
.exercise,.exercise.done,.history-card,.history-exercise,.program-library-row,.program-profile-card,.workout-choice,.exercise-open,.stats-exercise {background:var(--surface)!important;border-color:var(--border)!important;box-shadow:none!important}
.program-detail-meta{margin:0;color:var(--textSecondary);font-size:14px}
.previous-exercise-result{display:block;margin-top:6px;color:var(--textSecondary);font-size:13px;line-height:1.4;white-space:normal;overflow-wrap:anywhere}
#reorderWorkoutDialog select{width:100%;min-width:0;font-size:16px}
#historyDialog.app-screen>form>h2,#calendarDialog.app-screen>form>h2{display:none}
.exercise.done .exercise-index {color:var(--success)!important}
#programProfilesList .program-profile-card.active {background:var(--accentSoft)!important;border-color:color-mix(in srgb,var(--accent) 35%,var(--border))!important}
.clock-panel,.run-time-panel,.stats-totals,.stats-run-summary {background:transparent!important;border:0!important;box-shadow:none!important}
.session-tabs button,.view-options button,.theme-grid button,.weight-mode-switch button {background:var(--surface)!important;border:1px solid var(--border)!important;box-shadow:none!important}
.session-tabs button[aria-pressed=true],.view-options button[aria-pressed=true],.theme-grid button[aria-pressed=true],.weight-mode-switch button[aria-pressed=true] {background:var(--accentSoft)!important;border-color:color-mix(in srgb,var(--accent) 35%,transparent)!important}
.session-time>output,.session-clock .timer-value {font-size:var(--large-number)!important;font-weight:700!important}
.stats-chart {filter:none!important}.stats-line{stroke-width:1.6}.stats-grid{opacity:.5}
.stats-totals strong {font-size:28px!important;font-weight:650}
.app-screen[open] {position:fixed!important;inset:0!important;margin:0!important;width:100%!important;max-width:none!important;height:100dvh!important;max-height:none!important;border:0!important;border-radius:0!important;background:var(--background)!important;box-shadow:none!important;overflow-y:auto!important;animation:screen-enter 240ms var(--ease)}
.app-screen>form,.app-screen>.app-screen-header {width:min(100%,640px);margin:auto}
.app-screen>form {padding:20px 18px calc(32px + env(safe-area-inset-bottom))!important;overflow:visible!important}
.app-screen-header {position:sticky;top:0;z-index:2;display:flex;gap:14px;align-items:center;min-height:64px;padding:calc(12px + env(safe-area-inset-top)) 18px 12px;background:var(--background)}
.app-screen-header>button {width:38px;height:38px;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--textPrimary);font-size:21px;line-height:1}.app-screen-header>button:focus-visible{border-radius:50%;outline-offset:2px}.app-screen-header>span{font-size:20px;font-weight:650}
.app-screen>form>.close-button {display:none!important}
.app-screen>form>.eyebrow {display:none!important}
#exercisePickerDialog.app-screen form>h2 {display:none!important}
.app-screen .history-list,.app-screen .program-list,.app-screen .exercise-picker-list {max-height:none!important;overflow:visible!important}
.app-screen .app-screen-header~form>h2 {font-size:24px!important}
.has-app-screen {overflow:hidden}.has-app-screen>.shell {visibility:hidden}
#statisticsDialog.app-screen>form {padding-top:calc(20px + env(safe-area-inset-top))!important}
#statsNew h2 {font-size:24px!important;line-height:1.3!important}
.bottom-sheet[open] {position:fixed;inset:auto 0 0;margin:0 auto;width:min(640px,100%);max-height:92dvh;border:0!important;border-radius:var(--radius-xl) var(--radius-xl) 0 0!important;background:var(--surface)!important;box-shadow:0 -8px 32px #0002!important;animation:sheet-enter 250ms var(--ease)}
#menuDialog.bottom-sheet[open]{bottom:max(48px,env(safe-area-inset-bottom));width:min(460px,calc(100% - 24px));max-height:calc(100dvh - 96px);border-radius:var(--radius-xl)!important}
.bottom-sheet::backdrop {background:#0006;animation:overlay-enter 160ms var(--ease)}
.bottom-sheet form {padding:26px 18px calc(24px + env(safe-area-inset-bottom))!important}
.action-sheet {padding:12px 18px calc(18px + env(safe-area-inset-bottom))}
.sheet-handle {height:4px;width:36px;border-radius:4px;background:var(--border);margin:0 auto 16px}
.sheet-actions {display:grid;gap:4px}.sheet-actions button,.sheet-cancel{width:100%;min-height:48px;text-align:left;padding:12px;border:0;border-radius:8px;background:transparent;color:var(--textPrimary);font-size:16px}
.sheet-actions button:hover{background:var(--surfaceElevated)}.sheet-cancel{text-align:center;color:var(--textSecondary);margin-top:10px;border-top:1px solid var(--border)}
.bottom-sheet:not(.app-screen) .app-screen-header {display:none}
.screen-back {position:static!important;width:40px!important;height:40px!important;font-size:24px!important;margin-bottom:12px;display:block}
#statsNew .stats-header>[data-stats-back]{min-height:38px;padding:7px 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);line-height:1.2}
#statsNew .stats-header>[data-stats-back]:focus-visible{border-radius:999px}
@keyframes screen-enter{from{opacity:.4;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes sheet-enter{from{opacity:.5;transform:translateY(24px)}to{opacity:1;transform:none}}
@keyframes overlay-enter{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}button:active:not(:disabled){transform:none!important}}
