@charset "UTF-8";
@font-face {
  font-family: "Archivo";
  src: url("./fonts/archivo-variable-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  src: url("./fonts/archivo-variable-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light;
  --chalk: #E9EBE7;
  --rubber: #1D1F22;
  --iron: #5A5F67;
  --work-remaining: #F6C500;
  --work-spent: #D9A400;
  --rest-remaining: #1E44D6;
  --rest-spent: #142F9C;
  font-family: "Archivo";
  font-weight: 450;
  font-stretch: 100%;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--rubber); background: var(--chalk); }
button, input { font: inherit; color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; border: 0; }
button, a { min-height: 44px; }
button:disabled, input:disabled { opacity: .4; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon-button { width: 48px; min-width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: transparent; }
.icon-button:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.home-shell { max-width: 800px; min-height: 100vh; min-height: 100svh; margin: auto; padding: env(safe-area-inset-top) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left)); display: flex; flex-direction: column; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 92px; gap: 12px; }
.brand { margin: 0; font-size: 23px; font-weight: 760; letter-spacing: -.9px; white-space: nowrap; }
.brand a { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.section-tab { padding: 10px 6px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: transparent; font-size: 14px; font-weight: 550; }
#favorites-count { font-size: 11px; color: var(--iron); }
#train-tab { display: none; }
.home-shell:has(#favorites-section:not([hidden])) #train-tab { display: inline-flex; }
.home-shell:has(#favorites-section:not([hidden])) #favorites-tab { display: none; }
.home-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#setup-section { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mode-selector { display: flex; gap: 26px; min-height: 52px; width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; flex: 0 0 auto; }
.mode-selector::-webkit-scrollbar { display: none; }
.mode-button { position: relative; min-width: 44px; min-height: 52px; padding: 8px 0 14px; border-radius: 0; border-bottom: 3px solid transparent; background: transparent; white-space: nowrap; font-size: 15px; font-weight: 550; color: var(--iron); flex: 0 0 auto; }
.mode-button.selected { color: var(--rubber); border-bottom-color: var(--rubber); font-weight: 700; }
.mode-button:focus-visible { outline-offset: -4px; }
.session-intro { padding: 32px 0 28px; container-type: inline-size; }
.session-summary { display: flex; align-items: baseline; white-space: nowrap; margin: 0; gap: .1em; font-size: min(128px, calc((100cqi - 2px) / var(--session-units, 4.5))); font-stretch: 62%; font-weight: 900; line-height: 1; letter-spacing: -.025em; }
.session-prefix { font-size: .79em; letter-spacing: -.035em; }
.session-operator { color: var(--iron); font-size: .6em; font-weight: 500; font-stretch: 100%; letter-spacing: 0; }
.digits { display: inline-flex; align-items: baseline; flex: 0 0 auto; font-stretch: 62%; font-weight: 900; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: 0; }
.digit { display: inline-flex; justify-content: center; flex: 0 0 .44em; width: .44em; text-align: center; }
.digit-separator { display: inline-flex; justify-content: center; flex: 0 0 .16em; width: .16em; }
.session-description { color: var(--iron); font-size: 15px; line-height: 1.5; margin: 16px 0 0; max-width: 36em; }
.config-form { margin: 0; }
#config-fields { display: grid; gap: 22px; }
.duration-field, .round-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.duration-field legend, .round-label { display: block; padding: 0; font-size: 14px; font-weight: 550; margin: 0 0 10px; }
.adjuster { display: flex; align-items: center; justify-content: space-between; gap: 18px; max-width: 340px; }
.step-button { width: 48px; min-width: 48px; height: 48px; border: 1.5px solid var(--rubber); background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 27px; font-weight: 400; line-height: 1; }
.step-button:hover:not(:disabled) { color: var(--chalk); background: var(--rubber); }
.duration-inputs { display: flex; flex: 1; align-items: center; justify-content: center; gap: 1px; min-width: 0; }
.number-wrap { position: relative; min-width: 0; }
.time-input, .round-input { appearance: textfield; -moz-appearance: textfield; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; color: var(--rubber); font-stretch: 62%; font-weight: 900; font-variant-numeric: tabular-nums; text-align: center; font-size: 38px; letter-spacing: 0; padding: 4px 0; height: 48px; width: 52px; }
.time-input:hover:not(:disabled), .round-input:hover { border-bottom-color: var(--iron); }
.time-input:focus, .round-input:focus { border-bottom-color: var(--rubber); }
.time-input::-webkit-inner-spin-button, .time-input::-webkit-outer-spin-button, .round-input::-webkit-inner-spin-button, .round-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-unit { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.time-colon { font-size: 34px; font-stretch: 62%; font-weight: 900; }
.round-stepper { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: min(100%, 340px); }
.round-input { width: 90px; }
.split-fields { display: grid; gap: 22px; }
.toggle-field { display: flex; gap: 18px; align-items: center; justify-content: space-between; max-width: 340px; min-height: 44px; font-size: 14px; font-weight: 550; cursor: pointer; }
.toggle-field input { appearance: none; width: 48px; height: 30px; border: 1.5px solid var(--iron); border-radius: 20px; position: relative; margin: 0; cursor: pointer; flex: 0 0 auto; }
.toggle-field input::before { content: ''; position: absolute; top: 4px; left: 4px; width: 19px; height: 19px; border-radius: 50%; background: var(--iron); }
.toggle-field input:checked { border-color: var(--rubber); background: var(--rubber); }
.toggle-field input:checked::before { transform: translateX(19px); background: var(--chalk); }
.field-note { margin: 16px 0 0; font-size: 12px; line-height: 1.5; color: var(--iron); max-width: 34em; }
.field-note:empty { display: none; }
.preparation-note { display: flex; gap: 7px; align-items: center; color: var(--iron); font-size: 12px; margin: 22px 0 0; }
.preparation-note svg { width: 17px; height: 17px; }
.setup-actions { position: sticky; z-index: 2; bottom: 0; margin-top: auto; padding: 20px 0 max(18px, env(safe-area-inset-bottom)); background: var(--chalk); display: grid; gap: 8px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 22px; min-height: 56px; border-radius: 999px; font-size: 16px; font-weight: 650; }
.primary-button { color: var(--chalk); background: var(--rubber); }
.primary-button:hover { opacity: .85; }
.primary-button:focus-visible { outline-color: var(--rubber); }
.secondary-button { background: transparent; color: var(--rubber); border: 1px solid var(--rubber); }
.start-button { width: 100%; height: 68px; font-size: 21px; }
.save-favorite { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 44px; padding: 8px 0; background: transparent; font-size: 14px; font-weight: 550; }
.save-favorite svg { width: 19px; height: 19px; }
.text-button, .link-button { min-height: 44px; background: transparent; color: inherit; text-decoration: underline; text-underline-offset: 4px; padding: 10px 0; font-size: 14px; }
.sound-button { display: flex; align-items: center; gap: 9px; min-height: 48px; background: transparent; padding: 8px 0; color: var(--rubber); font-size: 13px; }
.sound-button svg { width: 19px; height: 19px; }
.favorites-heading { margin: 32px 0 18px; }
.favorites-heading h2 { font-size: 32px; font-weight: 750; letter-spacing: -1px; margin: 0; }
.favorites-heading p { color: var(--iron); font-size: 14px; line-height: 1.6; margin: 12px 0 0; }
.favorites-list { display: grid; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.favorite-card { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--iron); gap: 10px; min-width: 0; }
.favorite-load { display: flex; flex-direction: column; gap: 7px; padding: 10px 0; min-height: 100px; border: 0; background: transparent; text-align: left; flex: 1; min-width: 0; }
.favorite-mode { font-size: 12px; font-weight: 600; color: var(--iron); }
.favorite-name { font-size: 24px; font-weight: 750; letter-spacing: -.5px; overflow-wrap: anywhere; }
.favorite-detail { color: var(--iron); font-size: 12px; line-height: 1.5; }
.favorite-delete { color: var(--iron); }
.favorite-delete svg { width: 20px; height: 20px; }
.empty-state { text-align: left; padding: 30px 0; }
.empty-state h3 { font-size: 24px; font-weight: 650; margin: 20px 0 12px; letter-spacing: -.6px; }
.empty-state p { color: var(--iron); font-size: 14px; line-height: 1.6; margin: 0 0 24px; }
.empty-icon { display: inline-flex; }
.empty-icon svg { width: 32px; height: 32px; }
.form-error { color: var(--rubber); font-size: 13px; line-height: 1.5; border-left: 3px solid currentColor; padding-left: 10px; }
/* Background covers the viewport; safe-area padding applies only to content. */
body.is-training { overflow: hidden; overscroll-behavior: none; }
.workout-screen {
  --phase-ink: var(--rubber);
  --phase-spent: var(--chalk);
  --phase-remaining: var(--chalk);
  position: fixed;
  inset: 0;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--phase-ink);
  background: var(--phase-spent);
  padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}
.workout-screen[data-phase="work"] { --phase-spent: var(--work-spent); --phase-remaining: var(--work-remaining); }
.workout-screen[data-phase="rest"] { --phase-ink: var(--chalk); --phase-spent: var(--rest-spent); --phase-remaining: var(--rest-remaining); }
.workout-screen[data-phase="finished"] { --phase-ink: var(--chalk); --phase-spent: var(--rubber); --phase-remaining: var(--rubber); }
.phase-progress { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.phase-progress > span { display: block; position: absolute; inset: 0; width: 100%; height: 100%; background: var(--phase-remaining); transform-origin: center bottom; transform: scaleY(1); transition: transform 60ms linear; will-change: transform; }
.workout-screen[data-phase="prepare"] .phase-progress, .workout-screen[data-phase="finished"] .phase-progress { visibility: hidden; }
.workout-header, .workout-stage, .workout-bottom { position: relative; z-index: 1; }
.workout-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin: 0 auto; flex: 0 0 auto; font-size: 14px; font-weight: 600; }
.workout-heading, .workout-tools { display: flex; align-items: center; gap: 6px; }
.workout-header .icon-button { width: 44px; min-width: 44px; height: 44px; }
.workout-mode { font-size: 14px; font-weight: 700; }
.workout-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; container-type: inline-size; width: 100%; padding: 12px 0; }
.workout-state { font-weight: 650; font-size: clamp(22px, 5vw, 38px); line-height: 1.2; margin: 0 0 18px; letter-spacing: -.7px; }
.workout-time { display: flex; justify-content: center; font-size: min(36dvh, 400px, calc((100cqi - 2px) / var(--time-units, 1.92))); font-stretch: 62%; font-weight: 900; font-variant-numeric: tabular-nums; line-height: .95; margin: 0; width: 100%; }
.workout-screen[data-phase="prepare"] .workout-time { font-size: min(52dvh, calc((100cqi - 2px) / var(--time-units, .88))); }
.workout-screen[data-paused="true"] .workout-time { opacity: .4; }
.phase-hint { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.next-phase { display: flex; justify-content: center; align-items: baseline; gap: 5px; flex-wrap: wrap; margin: 26px 0 0; min-height: 24px; font-size: 14px; line-height: 1.5; text-align: center; }
.next-phase strong { font-weight: 600; }
.workout-bottom { flex: 0 0 auto; width: min(100%, 600px); align-self: center; }
.workout-actions { display: grid; grid-template-columns: minmax(0, 1fr) 68px; gap: 14px; }
.workout-actions .primary-button { min-height: 68px; font-size: 21px; color: var(--phase-spent); background: var(--phase-ink); }
.workout-actions .primary-button:focus-visible { outline-color: var(--phase-ink); }
.reset-button { display: inline-flex; align-items: center; justify-content: center; width: 68px; min-width: 68px; height: 68px; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; }
.reset-button svg { width: 26px; height: 26px; }
.finish-button { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 6px auto 0; min-height: 44px; font-size: 14px; }
.finish-button svg { width: 17px; height: 17px; }
.wake-status { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 16px; font-size: 10px; margin: 14px 0 0; opacity: .8; }
.wake-status svg { width: 13px; height: 13px; }
.completed-actions { display: grid; gap: 8px; }
.completed-actions .primary-button { min-height: 68px; color: var(--rubber); background: var(--chalk); font-size: 21px; }
.completed-actions .primary-button:focus-visible { outline-color: var(--chalk); }
.completed-actions .link-button { color: var(--chalk); }
.workout-screen[data-phase="finished"] .workout-header { visibility: hidden; }
.workout-screen[data-phase="finished"] .next-phase { display: none; }
.workout-screen[data-phase="finished"] .phase-hint { position: static; width: auto; height: auto; clip-path: none; white-space: normal; font-size: 14px; line-height: 1.5; margin: 22px 0 0; }
.workout-screen[data-phase="finished"] .wake-status { visibility: hidden; }

dialog { width: min(460px, calc(100% - 32px)); max-height: 85vh; max-height: 85dvh; padding: 28px; border: 1px solid var(--iron); border-radius: 20px; background: var(--chalk); color: var(--rubber); }
dialog::backdrop { background: #1D1F22B3; }
dialog h2 { font-size: 28px; letter-spacing: -.8px; font-weight: 750; margin: 18px 0 12px; }
dialog p { color: var(--iron); font-size: 14px; line-height: 1.65; }
.dialog-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--rubber); border-radius: 50%; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.dialog-actions button { padding: 14px 10px; font-size: 14px; }
.favorite-name-label { display: block; font-size: 14px; font-weight: 550; margin: 24px 0 10px; }
.name-input { width: 100%; min-height: 52px; border: 1px solid var(--iron); border-radius: 6px; padding: 12px; background: transparent; font-size: 16px; }
.name-input::placeholder { color: var(--iron); }
.help-dialog { width: min(560px, calc(100% - 32px)); padding-top: 18px; }
.help-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-heading h2 { margin: 0; }
.help-content h3 { font-size: 16px; font-weight: 650; margin: 24px 0 8px; }
.help-content p { font-size: 13px; margin: 8px 0 0; }
.help-content strong { color: var(--rubber); font-weight: 650; }
.offline-status { display: flex; align-items: center; gap: 9px; font-size: 13px; line-height: 1.5; padding: 12px 0; color: var(--iron); }
.status-dot { display: inline-flex; border: 1px solid currentColor; border-radius: 50%; width: 7px; height: 7px; flex: 0 0 auto; }
.offline-status.ready .status-dot { background: currentColor; }
.toast { position: fixed; z-index: 20; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 16px 20px; background: var(--rubber); color: var(--chalk); border: 1px solid var(--chalk); border-radius: 12px; font-size: 13px; line-height: 1.5; }
.noscript { position: fixed; inset: 0; z-index: 30; background: var(--chalk); color: var(--rubber); padding: 48px 24px; font-size: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 650px) {
  .home-shell { padding-left: max(40px, env(safe-area-inset-left)); padding-right: max(40px, env(safe-area-inset-right)); }
  .site-header { min-height: 112px; }
  .brand { font-size: 27px; }
  .mode-selector { gap: 38px; }
  .mode-button { font-size: 17px; }
  .session-intro { padding-top: 46px; padding-bottom: 40px; }
  .session-description { font-size: 17px; }
  #config-fields { gap: 28px; }
  .adjuster, .round-stepper, .toggle-field { max-width: 400px; }
  .split-fields { grid-template-columns: 1fr 1fr; gap: 40px; }
  .setup-actions { padding-top: 32px; padding-bottom: max(28px, env(safe-area-inset-bottom)); }
}
@media (max-width: 359px) {
  .home-shell { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .brand { font-size: 21px; }
  .header-actions { gap: 3px; }
  .section-tab { font-size: 12px; }
  .mode-selector { gap: 23px; }
  .session-description { font-size: 14px; }
  .workout-screen { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .workout-header { font-size: 12px; gap: 4px; }
  .workout-mode { font-size: 12px; }
  .workout-heading, .workout-tools { gap: 0; }
}
@media (max-height: 680px) and (orientation: portrait) {
  .site-header { min-height: 76px; }
  .session-intro { padding: 24px 0; }
  .session-description { margin-top: 12px; }
  #config-fields, .split-fields { gap: 18px; }
  .workout-state { margin-bottom: 12px; font-size: 23px; }
  .next-phase { margin-top: 18px; font-size: 13px; }
  .workout-time { font-size: min(32dvh, calc((100cqi - 2px) / var(--time-units, 1.92))); }
  .wake-status { margin-top: 10px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .workout-screen { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(220px, 1fr); grid-template-rows: 44px minmax(0, 1fr); gap: 8px 28px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .workout-header { grid-column: 1 / -1; }
  .workout-stage { grid-column: 1; grid-row: 2; padding: 0; height: 100%; }
  .workout-state { font-size: 23px; margin-bottom: 10px; }
  .workout-time { font-size: min(49dvh, calc((100cqi - 2px) / var(--time-units, 1.92))); }
  .next-phase { margin-top: 14px; font-size: 12px; min-height: 18px; }
  .workout-bottom { grid-column: 2; grid-row: 2; width: 100%; }
  .workout-actions { grid-template-columns: minmax(0, 1fr) 56px; gap: 10px; }
  .workout-actions .primary-button { min-height: 56px; font-size: 18px; padding: 12px 10px; }
  .reset-button { width: 56px; min-width: 56px; height: 56px; }
  .finish-button { margin-top: 4px; font-size: 12px; }
  .wake-status { margin-top: 10px; font-size: 9px; }
  .completed-actions .primary-button { min-height: 60px; font-size: 19px; }
  .completed-actions .link-button { font-size: 13px; }
  .workout-screen[data-phase="finished"] .phase-hint { margin-top: 14px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
