:root {
    color-scheme: dark;
    --bg: #111922;
    --panel: #1b2632;
    --line: #34424f;
    --muted: #a6b5c3;
    --green: #c6f272;
    --blue: #7ed9ed;
    --orange: #ffbb74;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: #f4f7f9;
    background: var(--bg);
    font-size: 16px;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
button,
input,
select {
    font: inherit;
}
button {
    cursor: pointer;
    border: 1px solid var(--line);
    background: #263340;
    color: inherit;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 600;
}
button:hover {
    filter: brightness(1.13);
}
button:disabled {
    opacity: 0.35;
    cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}
header {
    height: 92px;
    max-width: 1440px;
    margin: auto;
    padding: 0 44px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.13em;
    font-weight: 800;
    text-decoration: none;
    color: inherit;
}
.mark {
    display: grid;
    place-items: center;
    background: var(--green);
    color: var(--bg);
    border-radius: 8px;
    width: 35px;
    height: 35px;
    font-size: 24px;
}
.header-note {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
}
header button {
    margin-left: 20px;
}
.subtle {
    background: transparent;
}
.small {
    padding: 9px 13px;
    color: var(--green);
}
main {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 285px minmax(0, 1fr);
    gap: 56px;
    padding: 42px 36px;
}
aside {
    padding-top: 4px;
}
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
}
h1,
h3 {
    font-size: 1.1rem;
    margin: 0;
}
h2 {
    font-size: 1.8rem;
    margin: 0;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}
.workouts {
    display: grid;
    gap: 12px;
}
.workout {
    width: 100%;
    text-align: left;
    padding: 19px;
    background: transparent;
    border-radius: 12px;
}
.workout.selected {
    border-color: var(--green);
    background: #24332c;
    box-shadow: inset 3px 0 var(--green);
}
.workout strong {
    display: block;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}
.workout span {
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.7;
    display: block;
}
.muted {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.55;
}
.aside-note {
    margin-top: 38px;
    font-size: 0.9rem;
    line-height: 1.9;
}
.accent {
    color: var(--green);
    font-size: 0.7rem;
}
.workout-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.workout-heading .muted {
    margin: 8px 0 0;
}
.eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.17em;
    color: var(--green);
    margin: 0 0 10px;
    font-weight: 700;
}
.timer-card {
    --phase: var(--blue);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 26px 36px 18px;
    text-align: center;
}
.timer-card[data-phase="high"] {
    --phase: var(--orange);
}
.timer-card[data-phase="done"] {
    --phase: var(--green);
}
.timer-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--muted);
}
.phase {
    color: var(--phase);
    font-weight: 750;
    letter-spacing: 0.07em;
}
.dial {
    width: min(320px, 100%);
    aspect-ratio: 1;
    position: relative;
    margin: 18px auto;
}
.dial svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}
.dial circle {
    fill: none;
    stroke-width: 5;
}
.track {
    stroke: #33414d;
}
#ring {
    stroke: var(--phase);
    stroke-linecap: round;
    stroke-dasharray: 691.151;
    stroke-dashoffset: 0;
}
.clock {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
#time {
    font-size: clamp(3.5rem, 7vw, 5rem);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    color: var(--phase);
}
#next-label {
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.05em;
}
.stats {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 18px auto 26px;
}
.stats > div {
    padding: 0 32px;
}
.stats > div + div {
    border-left: 1px solid var(--line);
}
.stats span {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.09em;
    margin-bottom: 6px;
}
.stats strong {
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}
.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.primary {
    background: var(--green);
    color: #142115;
    border-color: var(--green);
}
.controls .primary {
    min-width: 210px;
    font-size: 1.05rem;
}
.transport {
    width: 54px;
}
.restart {
    border: 0;
    background: none;
    color: var(--muted);
    margin-top: 12px;
    font-size: 0.9rem;
}
.timer-note {
    font-size: 0.75rem;
    color: var(--muted);
    margin: 9px 0;
}
.sequence-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 26px 0 14px;
}
.sequence {
    display: flex;
    gap: 8px;
    overflow: auto;
    padding: 3px 3px 12px;
    max-height: 108px;
}
.segment {
    flex: 0 0 83px;
    padding: 9px 6px;
    font-size: 0.8rem;
    text-align: center;
    background: transparent;
}
.segment span {
    display: block;
    margin-top: 5px;
    font-variant-numeric: tabular-nums;
}
.segment.high {
    color: var(--orange);
}
.segment.low {
    color: var(--blue);
}
.segment.active {
    border-color: currentColor;
    background: var(--panel);
}
.footnote {
    color: var(--muted);
    font-size: 0.8rem;
    margin: 12px 0;
}
#message {
    color: var(--green);
    font-size: 0.875rem;
}
dialog {
    color: inherit;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    width: 540px;
    max-width: calc(100% - 24px);
    padding: 28px;
}
dialog::backdrop {
    background: #050b12bd;
    backdrop-filter: blur(4px);
}
dialog h2 {
    font-size: 1.5rem;
}
label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 18px;
}
label span {
    font-weight: 400;
    color: var(--muted);
}
input,
select {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    color: inherit;
    border: 1px solid #526170;
    border-radius: 8px;
    margin-top: 8px;
    min-height: 48px;
}
.fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 26px;
}
.danger {
    color: #ffaaaa;
    background: transparent;
}
#form-error {
    color: #ffaaaa;
}
.workspace {
    min-width: 0;
}
@media (min-width: 1400px) {
    main {
        padding-top: 58px;
    }
}
@media (max-width: 800px) {
    header {
        height: 74px;
        padding: 0 20px;
    }
    .header-note {
        display: none;
    }
    header button {
        margin-left: auto;
    }
    main {
        grid-template-columns: 1fr;
        padding: 24px 18px;
        gap: 24px;
    }
    aside {
        order: 2;
    }
    .aside-note {
        display: none;
    }
    .workout-heading {
        align-items: flex-start;
    }
    .workout-heading h2 {
        font-size: 1.5rem;
    }
    .workout-heading button {
        padding: 10px 12px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    .timer-card {
        padding: 22px 16px 16px;
    }
    .dial {
        width: 270px;
    }
    .sequence-heading {
        align-items: flex-start;
    }
    .sequence-heading .muted {
        max-width: 145px;
        text-align: right;
    }
    .controls .primary {
        min-width: 0;
        flex: 1;
        max-width: 240px;
    }
    .stats > div {
        padding: 0 22px;
    }
    .workouts {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}
@media (max-width: 380px) {
    .fields {
        grid-template-columns: 1fr;
    }
    .stats > div {
        padding: 0 15px;
    }
    dialog {
        padding: 20px;
    }
    .form-actions {
        gap: 8px;
    }
    .form-actions button {
        padding: 12px;
    }
}

/* Password screen and header logout button. */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: min(440px, 100%);
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
}
.login-card h1 {
    font-size: 1.6rem;
}
.login-card form {
    margin-top: 24px;
}
.login-card .primary {
    width: 100%;
}
.login-card pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.login-error {
    color: #ffaaaa;
}
.logout-form {
    margin: 0;
}
.logout-form button {
    margin-left: 0;
}
@media (max-width: 480px) {
    header {
        gap: 10px;
        padding: 0 12px;
    }
    header button {
        padding: 10px;
        font-size: 0.85rem;
    }
    .brand {
        gap: 8px;
        letter-spacing: 0.06em;
    }
}
