.timer-page { min-height: 100svh; background: var(--ink); }
.timer-page button { touch-action: manipulation; }
.timer-shell { width: 100%; min-height: calc(100svh - 70px); padding: clamp(24px, 5vw, 62px) max(16px, calc((100vw - 1120px) / 2)) calc(100px + env(safe-area-inset-bottom)); background: linear-gradient(145deg, #0b0d10 0%, #141922 68%, #0a3c8b 160%); color: var(--white); }
.timer-landing { display: grid; gap: clamp(28px, 5vw, 46px); }
.timer-landing__intro { display: grid; gap: 10px; max-width: 760px; }
.timer-landing .eyebrow { color: var(--yellow); }
.timer-landing h1 { color: var(--white); font-size: clamp(4rem, 13vw, 8.5rem); line-height: .82; letter-spacing: -.045em; }
.timer-landing__intro > p:last-child { max-width: 620px; color: #d5d9df; font-size: clamp(1.05rem, 2.4vw, 1.35rem); font-weight: 650; }
.timer-contexts { display: grid; gap: 12px; }
.timer-context { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; width: 100%; min-height: 104px; padding: 17px 18px; border: 1px solid #3b424d; border-left: 6px solid var(--blue); border-radius: 16px; background: #171b21; color: var(--white); text-align: left; cursor: pointer; }
.timer-context--bag { border-left-color: var(--yellow); }
.timer-context--sparring { border-left-color: var(--coral); }
.timer-context--conditioning { border-left-color: var(--blue); }
.timer-context--custom { border-left-color: #8d93a0; }
.timer-context__mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #4e5662; border-radius: 50%; color: #b9c0ca; font: 900 13px/1 var(--display); }
.timer-context > span:nth-child(2) { display: grid; gap: 3px; }
.timer-context strong { font: 900 clamp(1.55rem, 6vw, 2.15rem)/.95 var(--display); letter-spacing: -.02em; text-transform: uppercase; }
.timer-context small { color: #aeb5bf; font-size: 13px; font-weight: 700; }
.timer-context > span:last-child { color: var(--yellow); font-size: 1.8rem; }
.timer-context:hover, .timer-context:focus-visible { border-color: var(--yellow); outline: none; background: #20252d; transform: translateY(-1px); }
.timer-landing__assurance { display: flex; align-items: center; gap: 10px; color: #d5d9df; font-size: 14px; }
.timer-landing__assurance > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-weight: 950; }
.timer-landing__top, .timer-setup__bar, .active-timer__utility { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.timer-visual-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.timer-sound, .timer-test-sound, .timer-back { min-height: 46px; padding: 0 14px; border: 1px solid #4e5662; border-radius: 999px; background: #171b21; color: var(--white); font-weight: 850; cursor: pointer; white-space: nowrap; }
.timer-sound span, .timer-test-sound span { margin-right: 5px; color: var(--yellow); }
.timer-sound:focus-visible, .timer-test-sound:focus-visible, .timer-back:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.timer-landing__tools { display: flex; align-items: center; gap: 14px; color: #abb2bc; font-size: 13px; font-weight: 700; }
.timer-test-sound { min-width: 142px; border-color: #66707d; }
.saved-timers { display: grid; gap: 13px; padding-top: 4px; }
.saved-timers h2 { color: #d8dde4; font-size: 1rem; letter-spacing: .03em; text-transform: uppercase; }
.saved-timers > div { display: grid; gap: 8px; }
.saved-timers button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; min-height: 68px; padding: 12px 15px; border: 1px solid #414853; border-radius: 12px; background: #15191f; color: var(--white); text-align: left; cursor: pointer; }
.saved-timers button strong { font-size: 15px; }
.saved-timers button span { color: #adb4be; font-size: 12px; }
.saved-timers button span:last-child { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--yellow); font-weight: 900; }
.timer-setup, .timer-builder { display: grid; gap: clamp(24px, 4vw, 38px); width: 100%; max-width: 980px; margin-inline: auto; }
.timer-setup__bar { align-items: center; }
.timer-back { border: 0; background: transparent; padding-inline: 4px 12px; }
.timer-setup__heading { display: grid; gap: 9px; max-width: 760px; }
.timer-setup__heading .eyebrow { color: var(--yellow); }
.timer-setup__heading h1 { color: var(--white); font-size: clamp(3.4rem, 11vw, 7rem); line-height: .84; }
.timer-setup__heading > p:last-child { color: #c7cdd5; font-size: clamp(1rem, 2vw, 1.2rem); }
.timer-presets { display: grid; gap: 11px; }
.timer-preset { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 16px; min-height: 105px; padding: 18px; border: 1px solid #404853; border-left: 6px solid var(--blue); border-radius: 15px; background: #171b21; color: var(--white); text-align: left; cursor: pointer; }
.timer-preset strong { font: 900 clamp(1.7rem, 5vw, 2.3rem)/1 var(--display); text-transform: uppercase; }
.timer-preset > span:not(.timer-preset__badge) { color: #b9c0c9; font-size: 14px; font-weight: 700; }
.timer-preset small { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--yellow); font-size: 13px; font-weight: 900; }
.timer-preset__badge { position: absolute; top: 9px; right: 12px; padding: 4px 7px; border-radius: 999px; background: #fff2b8; color: #5f4700; font-size: 9px; font-weight: 950; letter-spacing: .07em; text-transform: uppercase; }
.timer-preset:hover, .timer-preset:focus-visible { border-color: var(--yellow); outline: none; background: #20252d; }
.timer-custom-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; width: 100%; min-height: 80px; padding: 15px 18px; border: 2px dashed #5d6673; border-radius: 15px; background: transparent; color: var(--white); text-align: left; cursor: pointer; font: 900 1.45rem/1 var(--display); text-transform: uppercase; }
.timer-custom-link > span:first-of-type { color: #b6bdc7; font: 700 12px/1.3 var(--body); text-transform: none; }
.timer-custom-link > span:last-child { grid-column: 2; grid-row: 1 / 3; color: var(--yellow); font-size: 1.5rem; }
.timer-builder__options { display: grid; gap: 9px; }
.timer-builder__options button { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 60px; padding: 10px 14px; border: 1px solid #414955; border-radius: 12px; background: #171b21; color: var(--white); cursor: pointer; text-align: left; font-weight: 800; }
.timer-builder__options button strong { min-width: 46px; padding: 5px 8px; border-radius: 999px; background: #303640; color: #d9dee5; font-size: 11px; text-align: center; text-transform: uppercase; }
.timer-builder__options button[aria-pressed="true"] { border-color: var(--yellow); }
.timer-builder__options button[aria-pressed="true"] strong { background: var(--yellow); color: var(--ink); }
.timer-builder__options button:disabled { opacity: .45; cursor: not-allowed; }
.timer-blocks { display: grid; gap: 14px; }
.timer-block { display: grid; gap: 18px; padding: clamp(16px, 4vw, 24px); border: 1px solid #414955; border-radius: 17px; background: #15191f; }
.timer-block__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.timer-block__heading span { color: var(--yellow); font-size: 11px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.timer-block__heading h2 { margin-top: 4px; color: var(--white); font-size: clamp(1.35rem, 4vw, 1.8rem); }
.timer-block__heading > button { min-height: 44px; padding: 0 10px; border: 1px solid #636b77; border-radius: 9px; background: transparent; color: #d5dae1; font-size: 12px; font-weight: 850; cursor: pointer; }
.timer-step-grid { display: grid; gap: 12px; }
.timer-stepper { display: grid; gap: 7px; }
.timer-stepper > span { color: #bdc3cc; font-size: 12px; font-weight: 850; }
.timer-stepper > div { display: grid; grid-template-columns: 58px minmax(78px, 1fr) 58px; min-height: 58px; overflow: hidden; border: 1px solid #535c68; border-radius: 13px; background: #0e1115; }
.timer-stepper button { border: 0; background: #262c34; color: var(--white); font-size: 1.6rem; font-weight: 750; cursor: pointer; }
.timer-stepper button:focus-visible { outline: 3px solid var(--yellow); outline-offset: -3px; }
.timer-stepper output { display: grid; place-items: center; color: var(--white); font: 900 1.5rem/1 var(--display); }
.timer-builder__actions { display: grid; gap: 10px; }
.timer-builder__actions .button { min-height: 62px; border-radius: 13px; font-size: 16px; }
.timer-start-custom { font-weight: 950; }
.timer-local-note { color: #aeb5bf; font-size: 13px; text-align: center; }
.timer-active .site-header, .timer-active .bottom-nav { display: none !important; }
.timer-active .timer-shell { min-height: 100dvh; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: #101419; transition: background-color 160ms ease; }
.timer-active[data-timer-phase="rest"] .timer-shell { background: #112c27; }
.timer-active[data-timer-phase="paused"] .timer-shell { background: #24272c; }
.timer-active[data-timer-phase="change"] .timer-shell { background: #483c00; }
.active-timer { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; width: 100%; min-height: calc(100dvh - max(26px, env(safe-area-inset-top) + env(safe-area-inset-bottom))); }
.active-timer__utility { justify-content: flex-end; align-items: center; min-height: 46px; color: #bfc6cf; font-size: 11px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.active-timer__utility .timer-sound { min-height: 42px; padding-inline: 11px; font-size: 11px; text-transform: none; }
.active-timer__main { display: grid; align-content: center; justify-items: center; min-width: 0; text-align: center; }
.active-timer__round { color: #cad0d8; font-size: clamp(.75rem, 2.8vw, 1rem); font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.active-timer__state { margin-top: 5px; color: var(--yellow); font: 950 clamp(2.7rem, 11vw, 6.5rem)/.86 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.active-timer__time { max-width: 100%; color: var(--white); font: 950 clamp(7.2rem, 32vw, 18rem)/.78 var(--display); letter-spacing: -.065em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.active-timer__outer { margin-top: 12px; color: #e1e5ea; font-weight: 850; }
.active-timer__next { margin-top: 10px; color: #b7bec8; font-size: clamp(.78rem, 2.5vw, .95rem); font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.active-timer__controls { display: grid; gap: 9px; width: min(720px, 100%); margin-inline: auto; }
.active-timer__pause { min-height: 72px; border: 0; border-radius: 14px; background: var(--yellow); color: var(--ink); font-size: 1.3rem; font-weight: 950; cursor: pointer; }
.active-timer__controls > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.active-timer__controls > div button { min-height: 54px; border: 1px solid #555e69; border-radius: 12px; background: #20252c; color: var(--white); font-size: 13px; font-weight: 850; cursor: pointer; }
.active-timer__restored { justify-self: center; padding: 6px 10px; border-radius: 999px; background: #25303b; color: #dce2e9; font-size: 11px; font-weight: 800; }
.timer-end-dialog { width: min(460px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 17px; background: transparent; color: var(--ink); box-shadow: var(--shadow); }
.timer-end-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.timer-end-dialog form { display: grid; gap: 12px; padding: 24px; border-radius: 17px; background: var(--white); }
.timer-end-dialog h2 { font-size: 2rem; }
.timer-end-dialog p:not(.eyebrow) { color: var(--muted); }
.timer-end-dialog form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 8px; }
.timer-end-dialog .button { min-height: 52px; }
.timer-complete { display: grid; align-content: center; justify-items: start; gap: 14px; width: min(820px, 100%); min-height: calc(100svh - 190px); margin-inline: auto; }
.timer-complete .eyebrow { color: var(--yellow); }
.timer-complete h1 { color: var(--white); font-size: clamp(3.5rem, 20vw, 10rem); line-height: .9; }
.timer-complete > p:not(.eyebrow) { color: #c5cbd3; font-size: 1.1rem; font-weight: 750; }
.timer-complete__actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.timer-complete__actions .button { min-height: 54px; }
.timer-complete__links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 12px 0; }
.timer-complete__links a { color: var(--yellow); font-weight: 900; text-underline-offset: 4px; }
.timer-toast { position: fixed; z-index: 100; right: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); left: 14px; max-width: 520px; margin-inline: auto; padding: 12px 15px; border: 1px solid #56606c; border-radius: 12px; background: #15191f; color: var(--white); font-size: 13px; font-weight: 800; text-align: center; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity 150ms ease, transform 150ms ease; }
.timer-toast.is-visible { opacity: 1; transform: none; }

@media (min-width: 720px) { .timer-contexts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .timer-context { min-height: 142px; } }
@media (min-width: 680px) { .timer-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } .timer-builder__options { grid-template-columns: repeat(2, minmax(0, 1fr)); } .timer-builder__options button { display: grid; align-content: space-between; min-height: 100px; } .timer-builder__options button strong { justify-self: start; } .timer-step-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .timer-builder__actions { grid-template-columns: 1fr 1.25fr; } .saved-timers > div { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .timer-landing__top { display: grid; } .timer-landing__top .timer-visual-controls { justify-content: flex-start; } .timer-landing__tools { align-items: flex-start; flex-direction: column; } .timer-setup__bar { align-items: flex-start; } .timer-setup__bar .timer-visual-controls { max-width: 190px; } .timer-setup__bar .timer-sound { min-height: 42px; padding-inline: 10px; font-size: 11px; } .timer-preset small { align-self: end; } .active-timer__utility .timer-visual-controls { gap: 5px; } .active-timer__utility .timer-sound { padding-inline: 8px; } }
@media (max-width: 360px) { .timer-shell { padding-inline: 12px; } .timer-context { min-height: 94px; padding: 14px 13px; } .timer-context__mark { width: 36px; height: 36px; } .timer-context small { font-size: 12px; } .timer-setup__bar .timer-visual-controls { max-width: 170px; } .timer-preset { padding: 16px 13px; } .timer-preset small { font-size: 11px; } .active-timer__time { font-size: clamp(6.4rem, 31vw, 9rem); } .active-timer__controls > div button { min-height: 50px; } }
@media (orientation: landscape) and (max-height: 600px) { .timer-active .timer-shell { padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); } .active-timer { grid-template-columns: minmax(0, 1fr) minmax(240px, .38fr); grid-template-rows: auto minmax(0, 1fr) auto; min-height: calc(100dvh - 16px); column-gap: 18px; } .active-timer__utility { grid-column: 1 / -1; min-height: 38px; } .active-timer__main { grid-column: 1; grid-row: 2 / 4; } .active-timer__state { font-size: clamp(2.2rem, 10vh, 5rem); } .active-timer__time { font-size: clamp(7rem, 34vh, 15rem); } .active-timer__controls { grid-column: 2; grid-row: 2; align-self: center; } .active-timer__pause { min-height: 68px; } .active-timer__controls > div { grid-template-columns: 1fr; } .active-timer__restored { grid-column: 2; grid-row: 3; } }
@media (prefers-reduced-motion: no-preference) { .timer-context { transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease; } }

/* Use the whole active surface as a phase signal, throughout the timer. */
html .timer-active[data-timer-phase="work"] .timer-shell { background: #d71920; }
html .timer-active[data-timer-phase="rest"] .timer-shell { background: #36e879; }
html .timer-active[data-timer-phase="paused"] .timer-shell { background: #24272c; }
html .timer-active[data-timer-phase="change"] .timer-shell { background: #ffe04b; }
html .timer-active .active-timer__main { color: #fff; gap: clamp(12px, 2.5vh, 24px); padding-block: 18px; }
html .timer-active .active-timer__main > *, html .timer-active .active-timer__utility { color: #fff; }
html .timer-active:is([data-timer-phase="rest"], [data-timer-phase="change"]) .active-timer__main > *,
html .timer-active:is([data-timer-phase="rest"], [data-timer-phase="change"]) .active-timer__utility { color: #071b10; }
.active-timer__round { font-size: clamp(1.4rem, 5.8vw, 2.6rem); letter-spacing: .025em; line-height: 1.15; }
.active-timer__state { margin: 0; max-width: 100%; overflow-wrap: anywhere; font-size: clamp(3.8rem, 18vw, 9rem); line-height: .95; }
.active-timer__progress { font-size: clamp(1.3rem, 5.5vw, 2.3rem); font-weight: 950; line-height: 1.2; }
.active-timer__next { margin-top: 0; letter-spacing: .04em; }
@media (orientation: landscape) and (max-height: 600px) {
  html .timer-active .active-timer__main { gap: 10px; padding-block: 4px; }
  .active-timer__round, .active-timer__progress { font-size: clamp(1.1rem, 5vh, 1.8rem); }
  .active-timer__state { font-size: clamp(2.5rem, 13vh, 4.5rem); }
}
