/* Workout plan builder */
.workout-page {
    background: #050607;
    color: #f4f4f5;
    min-height: 100vh;
    padding: clamp(1.5rem, 5vw, 4rem);
}

.workout-header {
    align-items: flex-end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: 0 auto 2rem;
    max-width: 1280px;
}

.workout-header h1 {
    color: #f5f5f6;
    font-size: clamp(2.35rem, 6vw, 4.5rem);
    font-weight: 650;
    line-height: 1;
    margin: 0 0 1rem;
    max-width: 860px;
}

.workout-header p:last-child {
    color: #a0a0a8;
    line-height: 1.5;
    margin: 0;
    max-width: 760px;
}

.workout-layout {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    margin: 0 auto;
    max-width: 1280px;
}

.workout-sidebar,
.workout-builder {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.workout-sidebar {
    position: sticky;
    top: 1rem;
}

.workout-panel,
.workout-editor-panel,
.workout-empty-state {
    background: #08090b;
    border: 1px solid #1a1c21;
    border-radius: 8px;
    padding: 1rem;
}

.workout-panel {
    display: grid;
    gap: .9rem;
}

.workout-field {
    color: #a0a0a8;
    display: grid;
    gap: .4rem;
    font-size: .86rem;
}

.workout-input,
.workout-title-input,
.workout-search-input,
.set-row input {
    background: #050607;
    border: 1px solid #24262b;
    color: #f4f4f5;
    min-height: 44px;
    outline: 0;
    padding: .65rem .75rem;
    width: 100%;
}

.workout-input:focus,
.workout-title-input:focus,
.workout-search-input:focus,
.set-row input:focus {
    border-color: #f4f4f5;
}

.workout-title-input {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 650;
    line-height: 1.05;
}

.workout-search-input {
    font-size: 1.25rem;
    font-weight: 600;
}

.template-list {
    display: grid;
    gap: .55rem;
}

.template-button,
.exercise-picker-item,
.template-exercise-actions button,
.set-row button {
    background: #050607;
    border: 1px solid #24262b;
    color: #a0a0a8;
}

.template-button {
    display: grid;
    gap: .3rem;
    padding: .85rem;
    text-align: left;
}

.template-button strong {
    color: #f5f5f6;
}

.template-button span,
.exercise-picker-item span,
.exercise-picker-item small,
.template-exercise-head span {
    color: #777781;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.template-button:hover,
.template-button:focus-visible,
.template-button.is-active,
.exercise-picker-item:hover,
.exercise-picker-item:focus-visible,
.template-exercise-actions button:hover,
.template-exercise-actions button:focus-visible,
.set-row button:hover,
.set-row button:focus-visible {
    border-color: #f4f4f5;
    color: #f4f4f5;
    outline: 0;
}

.workout-empty-state {
    align-content: center;
    display: grid;
    min-height: 300px;
}

.workout-empty-state.compact {
    min-height: 180px;
}

.workout-empty-state h2,
.workout-editor-heading h2 {
    color: #f5f5f6;
    margin: 0 0 .6rem;
}

.workout-empty-state p:last-child {
    color: #a0a0a8;
    line-height: 1.5;
    margin: 0;
}

.workout-editor-panel {
    display: grid;
    gap: 1rem;
}

.workout-editor-topline,
.workout-editor-heading,
.template-exercise-head,
.template-exercise-footer {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.workout-editor-topline > div,
.workout-editor-heading > div,
.template-exercise-head > div,
.template-exercise-footer .workout-field {
    flex: 1;
    min-width: 0;
}

.exercise-picker-results {
    display: grid;
    gap: .65rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.exercise-picker-item {
    display: grid;
    gap: .45rem;
    min-height: 126px;
    padding: .9rem;
    text-align: left;
}

.exercise-picker-item strong {
    color: #f5f5f6;
    font-size: 1.05rem;
    line-height: 1.15;
}

.template-exercise-list {
    display: grid;
    gap: 1rem;
}

.template-exercise-card {
    background: #050607;
    border: 1px solid #1a1c21;
    border-radius: 8px;
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.template-exercise-head h3 {
    color: #f5f5f6;
    font-size: 1.45rem;
    margin: .25rem 0 0;
}

.template-exercise-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: flex-end;
}

.template-exercise-actions button,
.set-row button {
    min-height: 36px;
    padding: 0 .7rem;
}

.set-table {
    border: 1px solid #1a1c21;
    border-radius: 8px;
    overflow: hidden;
}

.set-row {
    align-items: center;
    border-top: 1px solid #1a1c21;
    display: grid;
    gap: .55rem;
    grid-template-columns: 52px minmax(86px, .75fr) minmax(90px, .75fr) minmax(86px, .75fr) minmax(88px, .65fr) minmax(120px, 1fr) auto;
    padding: .65rem;
}

.set-row:first-child {
    border-top: 0;
}

.set-row-head {
    background: #0d0f12;
    color: #777781;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.set-number {
    color: #f5f5f6;
    font-weight: 700;
}

.warmup-toggle {
    align-items: center;
    color: #a0a0a8;
    display: flex;
    gap: .4rem;
    min-height: 44px;
}

.warmup-toggle input {
    min-height: auto;
    width: auto;
}

@media (max-width: 1100px) {
    .workout-layout {
        grid-template-columns: 1fr;
    }

    .workout-sidebar {
        position: static;
    }

    .exercise-picker-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .workout-page {
        padding: 1.5rem;
    }

    .workout-header,
    .workout-editor-topline,
    .workout-editor-heading,
    .template-exercise-head,
    .template-exercise-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .exercise-picker-results {
        grid-template-columns: 1fr;
    }

    .set-table {
        border-radius: 0;
        overflow-x: auto;
    }

    .set-row {
        grid-template-columns: 52px 94px 94px 94px 96px 140px 86px;
        min-width: 720px;
    }
}

/* Tracking-specific workout set rows */
.set-row--weighted-reps {
    grid-template-columns: 52px minmax(86px, .75fr) minmax(90px, .75fr) minmax(88px, .65fr) minmax(120px, 1fr) auto;
}

.set-row--bodyweight-reps {
    grid-template-columns: 52px minmax(90px, .75fr) minmax(88px, .65fr) minmax(120px, 1fr) auto;
}

.set-row--timed {
    grid-template-columns: 52px minmax(86px, .75fr) minmax(88px, .65fr) minmax(120px, 1fr) auto;
}

.set-row--timed-weighted {
    grid-template-columns: 52px minmax(86px, .75fr) minmax(86px, .75fr) minmax(88px, .65fr) minmax(120px, 1fr) auto;
}

@media (max-width: 760px) {
    .set-row--weighted-reps {
        grid-template-columns: 52px 94px 94px 96px 140px 86px;
        min-width: 620px;
    }

    .set-row--bodyweight-reps,
    .set-row--timed {
        grid-template-columns: 52px 94px 96px 140px 86px;
        min-width: 520px;
    }

    .set-row--timed-weighted {
        grid-template-columns: 52px 94px 94px 96px 140px 86px;
        min-width: 620px;
    }
}

/* Bodyweight load controls */
.bodyweight-toggle,
.warmup-toggle {
    align-items: center;
    color: #a0a0a8;
    display: flex;
    gap: .4rem;
    min-height: 44px;
    white-space: nowrap;
}

.bodyweight-toggle input,
.warmup-toggle input {
    min-height: auto;
    width: auto;
}

.set-row--reps {
    grid-template-columns: 52px minmax(90px, .75fr) minmax(88px, .65fr) minmax(120px, 1fr) auto;
}

.set-row--bodyweight-load-reps,
.set-row--bodyweight-load-timed {
    grid-template-columns: 52px minmax(104px, .65fr) minmax(112px, .75fr) minmax(90px, .75fr) minmax(88px, .65fr) minmax(120px, 1fr) auto;
}

@media (max-width: 760px) {
    .set-row--reps {
        grid-template-columns: 52px 94px 96px 140px 86px;
        min-width: 520px;
    }

    .set-row--bodyweight-load-reps,
    .set-row--bodyweight-load-timed {
        grid-template-columns: 52px 106px 112px 94px 96px 140px 86px;
        min-width: 720px;
    }
}

/* Centered empty workout builder */
.workout-layout {
    grid-template-columns: minmax(280px, 340px) minmax(0, 760px);
    justify-content: center;
    max-width: 1120px;
}

.workout-layout.is-empty {
    grid-template-columns: minmax(300px, 420px);
    max-width: 480px;
}

.workout-layout.is-empty .workout-builder {
    display: none;
}

.workout-layout.is-empty .workout-sidebar {
    position: static;
}

.auth-submit.workout-create-submit {
    justify-self: start;
    min-width: 150px;
    padding: 0 1.25rem;
    width: auto;
}

@media (max-width: 1100px) {
    .workout-layout {
        max-width: 760px;
    }
}

@media (max-width: 760px) {
    .workout-layout,
    .workout-layout.is-empty {
        max-width: 100%;
    }

    .auth-submit.workout-create-submit {
        justify-self: stretch;
        width: 100%;
    }
}

/* Modern workout page refresh */
.workout-page {
    background:
        linear-gradient(180deg, rgba(13, 15, 18, .92) 0%, #050607 260px),
        #050607;
    padding: clamp(1.25rem, 4vw, 3rem);
}

.workout-header {
    align-items: center;
    border-bottom: 1px solid #1a1d22;
    margin-bottom: 1.5rem;
    max-width: 1160px;
    padding-bottom: 1.25rem;
}

.workout-header h1 {
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    letter-spacing: 0;
    max-width: 760px;
}

.workout-header p:last-child {
    color: #a7aab3;
    font-size: .98rem;
    max-width: 680px;
}

.workout-header .secondary-action {
    border-radius: 6px;
    min-height: 42px;
    padding: 0 1rem;
}

.workout-layout {
    gap: 1rem;
    grid-template-columns: minmax(280px, 320px) minmax(0, 820px);
    max-width: 1160px;
}

.workout-layout.is-empty {
    max-width: 430px;
}

.workout-sidebar {
    gap: .8rem;
}

.workout-panel,
.workout-editor-panel,
.workout-empty-state {
    background: #0a0c0f;
    border-color: #20242b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
    padding: 1.1rem;
}

.workout-panel:first-child {
    background: #0f1216;
}

.workout-field {
    color: #aeb2bc;
    font-size: .8rem;
    font-weight: 650;
}

.workout-input,
.workout-title-input,
.workout-search-input,
.set-row input {
    background: #06080a;
    border-color: #252a32;
    border-radius: 6px;
    color: #f6f7f8;
    min-height: 42px;
}

.workout-input::placeholder,
.workout-search-input::placeholder,
.set-row input::placeholder {
    color: #666b75;
}

.workout-input:focus,
.workout-title-input:focus,
.workout-search-input:focus,
.set-row input:focus {
    border-color: #d7ff63;
    box-shadow: 0 0 0 3px rgba(215, 255, 99, .12);
}

.workout-title-input {
    background: transparent;
    border-color: transparent;
    border-radius: 6px;
    font-size: clamp(1.65rem, 3.5vw, 2.6rem);
    padding-left: 0;
}

.workout-title-input:focus {
    background: #06080a;
    padding-left: .75rem;
}

.workout-page .auth-submit {
    border-radius: 6px;
    height: 44px;
}

.auth-submit.workout-create-submit {
    min-width: 0;
}

.template-list {
    gap: .45rem;
}

.template-button {
    border-color: #222730;
    border-radius: 6px;
    min-height: 68px;
    padding: .8rem .9rem;
}

.template-button.is-active {
    background: #f4f4f5;
    border-color: #f4f4f5;
    color: #07090b;
}

.template-button.is-active strong,
.template-button.is-active span {
    color: #07090b;
}

.template-button:hover:not(.is-active),
.template-button:focus-visible:not(.is-active) {
    background: #10141a;
}

.workout-editor-panel {
    gap: 1.1rem;
}

.workout-editor-heading {
    align-items: center;
    border-bottom: 1px solid #1a1d22;
    padding-bottom: .85rem;
}

.workout-editor-heading h2 {
    font-size: 1.35rem;
    margin: 0;
}

.workout-editor-heading > span {
    color: #d7ff63;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.workout-search-input {
    font-size: 1rem;
    font-weight: 600;
}

.workout-page .muscle-filter-row {
    gap: .45rem;
}

.workout-page .muscle-filter {
    border-radius: 999px;
    min-height: 36px;
    padding: 0 .78rem;
}

.workout-page .muscle-filter.is-active,
.workout-page .muscle-filter:hover,
.workout-page .muscle-filter:focus-visible {
    background: #d7ff63;
    border-color: #d7ff63;
    color: #07090b;
}

.exercise-picker-results {
    gap: .75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.exercise-picker-item {
    background: #07090c;
    border-color: #20242b;
    border-radius: 8px;
    min-height: 118px;
    padding: 1rem;
}

.exercise-picker-item:hover,
.exercise-picker-item:focus-visible {
    background: #10141a;
    border-color: #d7ff63;
}

.exercise-picker-item strong {
    font-size: 1.08rem;
}

.template-exercise-card {
    background: #07090c;
    border-color: #20242b;
    border-radius: 8px;
    padding: 1.05rem;
}

.template-exercise-head {
    align-items: center;
}

.template-exercise-head h3 {
    font-size: 1.35rem;
}

.template-exercise-actions button,
.set-row button,
.template-exercise-footer .secondary-action {
    border-radius: 6px;
}

.template-exercise-actions button {
    background: #0c1015;
    border-color: #252a32;
    color: #b5bac5;
}

.template-exercise-actions button:hover,
.template-exercise-actions button:focus-visible,
.set-row button:hover,
.set-row button:focus-visible {
    background: #f4f4f5;
    border-color: #f4f4f5;
    color: #07090b;
}

.set-table {
    background: #050607;
    border-color: #20242b;
    border-radius: 8px;
}

.set-row {
    border-top-color: #171b20;
    padding: .58rem .65rem;
}

.set-row-head {
    background: #10141a;
    color: #8b929e;
}

.set-number {
    align-items: center;
    background: #11161d;
    border: 1px solid #252a32;
    border-radius: 999px;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.bodyweight-toggle,
.warmup-toggle {
    color: #b5bac5;
    font-size: .82rem;
}

.bodyweight-toggle input,
.warmup-toggle input {
    accent-color: #d7ff63;
}

.workout-empty-state {
    border-style: dashed;
    min-height: 240px;
}

.workout-empty-state h2 {
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.form-status {
    background: #0b0f13;
    border-color: #26303a;
    border-radius: 6px;
}

@media (max-width: 1100px) {
    .workout-layout {
        grid-template-columns: 1fr;
        max-width: 820px;
    }

    .workout-header {
        max-width: 820px;
    }
}

@media (max-width: 760px) {
    .workout-page {
        padding: 1rem;
    }

    .workout-header {
        gap: 1rem;
    }

    .workout-header .secondary-action {
        align-self: flex-start;
    }

    .exercise-picker-results {
        grid-template-columns: 1fr;
    }
}

/* Phone-app workout widget treatment */
.workout-layout {
    grid-template-columns: minmax(260px, 300px) minmax(0, 640px);
    max-width: 980px;
}

.workout-builder {
    gap: .85rem;
}

.workout-editor-panel {
    border-radius: 8px;
}

.workout-plan-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.workout-plan-panel > .workout-editor-heading {
    background: #0a0c0f;
    border: 1px solid #20242b;
    border-radius: 8px;
    margin-bottom: .85rem;
    padding: 1rem;
}

.template-exercise-list {
    gap: .85rem;
}

.template-exercise-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0)),
        #0b0f14;
    border: 1px solid #232934;
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .24);
    gap: .85rem;
    overflow: visible;
    padding: 1rem;
    position: relative;
}

.template-exercise-group,
.active-exercise-group {
    background: linear-gradient(180deg, rgba(216, 255, 99, .055), rgba(255, 255, 255, .01));
    border: 1px solid rgba(216, 255, 99, .24);
    border-radius: 10px;
    display: grid;
    gap: .75rem;
    padding: .75rem;
}

.template-exercise-group-head,
.active-exercise-group-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    justify-content: space-between;
    padding: .2rem .2rem .35rem;
}

.template-exercise-group-head span,
.active-exercise-group-head span {
    color: #d7ff63;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.template-exercise-group-head h3,
.active-exercise-group-head h3 {
    color: #f5f5f6;
    font-size: 1.05rem;
    font-weight: 950;
    line-height: 1.15;
    margin: .25rem 0 0;
}

.template-exercise-group-head p,
.active-exercise-group-head p {
    color: #9fa8b4;
    font-size: .86rem;
    font-weight: 720;
    margin: .25rem 0 0;
}

.template-exercise-card.is-grouped,
.active-exercise-card.is-grouped {
    background: #080d12;
    border-color: #26313e;
}

.template-exercise-card.is-grouped::before,
.active-exercise-card.is-grouped::before {
    background: rgba(216, 255, 99, .55);
}

.template-exercise-card::before {
    background: #d7ff63;
    content: "";
    height: 3px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.template-exercise-head {
    align-items: flex-start;
    flex-wrap: wrap;
}

.template-exercise-head h3 {
    font-size: 1.25rem;
    line-height: 1.1;
    margin-top: .35rem;
}

.template-exercise-head span {
    color: #8e96a3;
}

.template-exercise-rest {
    align-items: end;
    background: #080c11;
    border: 1px solid #202733;
    border-radius: 8px;
    display: grid;
    gap: .85rem;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
    min-width: 0;
    padding: .8rem;
}

.template-exercise-rest > div {
    min-width: 0;
}

.template-exercise-rest p {
    color: #9aa3af;
    font-size: .9rem;
    line-height: 1.45;
    margin: .35rem 0 0;
}

.template-rest-field {
    margin: 0;
}

.template-rest-field input {
    min-height: 42px;
}

.template-exercise-actions {
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: flex-end;
    min-width: 0;
}

.template-exercise-head > .template-exercise-actions,
.template-exercise-group-head > .template-exercise-actions {
    flex: 0 1 auto;
    margin-left: auto;
    max-width: 100%;
}

.template-action-menu {
    flex: 0 0 auto;
    margin-left: auto;
    max-width: max-content;
    position: relative;
    z-index: 8;
}

.workout-editor-topline > .template-action-menu,
.template-exercise-head > .template-action-menu,
.template-exercise-group-head > .template-action-menu {
    flex: 0 0 auto;
    justify-self: end;
    margin-left: auto;
    max-width: max-content;
}

.plan-action-menu {
    align-self: flex-start;
}

.template-action-trigger {
    align-items: center;
    background: #151b23;
    border: 1px solid #2a313c;
    border-radius: 999px;
    color: #f5f5f6;
    cursor: pointer;
    display: inline-flex;
    font-size: .92rem;
    font-weight: 950;
    height: 34px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 38px;
}

.template-action-trigger:hover,
.template-action-trigger:focus-visible {
    background: #f4f4f5;
    border-color: #f4f4f5;
    color: #07090b;
    outline: 0;
}

.template-action-menu-panel {
    background: #080c11;
    border: 1px solid #2a313c;
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .42);
    display: grid;
    gap: .2rem;
    min-width: 178px;
    padding: .35rem;
    position: absolute;
    right: 0;
    text-align: left;
    top: calc(100% + .45rem);
    transform-origin: top right;
    z-index: 30;
}

.template-action-menu-panel button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #d9dee8;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 850;
    min-height: 34px;
    padding: .45rem .6rem;
    text-align: left;
    white-space: nowrap;
}

.template-action-menu-panel button:hover,
.template-action-menu-panel button:focus-visible {
    background: #151b23;
    color: #f5f5f6;
    outline: 0;
}

.template-action-menu-panel button:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.template-action-menu-panel button:disabled:hover {
    background: transparent;
    color: #d9dee8;
}

.template-action-menu-panel .danger-menu-item {
    color: #ff9b9b;
}

.template-exercise-actions button {
    background: #151b23;
    border-color: #2a313c;
    border-radius: 999px;
    flex: 0 0 auto;
    font-size: .76rem;
    line-height: 1.1;
    min-height: 32px;
    padding: 0 .7rem;
    white-space: nowrap;
}

.template-group-picker {
    align-items: end;
    background: #080c11;
    border: 1px solid rgba(216, 255, 99, .22);
    border-radius: 8px;
    display: grid;
    gap: .65rem;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: .8rem;
}

.template-group-picker .workout-field {
    margin: 0;
}

.template-group-picker .auth-submit,
.template-group-picker .secondary-action {
    min-height: 40px;
    white-space: nowrap;
}

.template-group-picker .secondary-action {
    align-items: center;
    display: inline-flex;
    justify-content: center;
}

.set-table {
    background: transparent;
    border: 0;
    display: grid;
    gap: .55rem;
    overflow: visible;
}

.set-row-head {
    display: none;
}

.set-row {
    background: #070a0e;
    border: 1px solid #202733;
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
    padding: .65rem;
}

.set-row:first-child {
    border-top: 1px solid #202733;
}

.set-number {
    background: #d7ff63;
    border-color: #d7ff63;
    color: #07090b;
    font-size: .78rem;
}

.set-row input {
    background: #10161d;
    border-color: #2a313c;
    border-radius: 7px;
    min-height: 38px;
    padding: .5rem .6rem;
}

.bodyweight-toggle,
.warmup-toggle {
    background: #10161d;
    border: 1px solid #2a313c;
    border-radius: 7px;
    justify-content: center;
    min-height: 38px;
    padding: 0 .55rem;
}

.set-row button {
    background: #151b23;
    border-color: #2a313c;
    border-radius: 7px;
    line-height: 1.1;
    min-height: 38px;
    min-width: 72px;
    padding: 0 .65rem;
    white-space: nowrap;
}

.template-exercise-footer {
    align-items: end;
    background: #080c11;
    border: 1px solid #1e2530;
    border-radius: 8px;
    padding: .8rem;
}

.template-exercise-footer .secondary-action {
    background: #f4f4f5;
    border-color: #f4f4f5;
    color: #07090b;
    min-height: 38px;
    white-space: nowrap;
}

.exercise-picker-results {
    grid-template-columns: 1fr;
}

.exercise-picker-item {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 78px;
}

.exercise-picker-item span,
.exercise-picker-item small {
    grid-column: 1;
}

.exercise-picker-item strong {
    grid-column: 1;
}

.exercise-picker-item::after {
    align-items: center;
    background: #d7ff63;
    border-radius: 999px;
    color: #07090b;
    content: "+";
    display: inline-flex;
    font-size: 1.15rem;
    font-weight: 800;
    grid-column: 2;
    grid-row: 1 / span 3;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.workout-sidebar .workout-panel {
    border-radius: 8px;
}

@media (max-width: 1100px) {
    .workout-layout {
        max-width: 680px;
    }
}

@media (max-width: 760px) {
    .workout-layout {
        max-width: 460px;
    }

    .template-exercise-card,
    .workout-panel,
    .workout-editor-panel,
    .workout-plan-panel > .workout-editor-heading {
        padding: .9rem;
    }

    .set-table {
        overflow-x: auto;
    }

    .set-row {
        min-width: 0;
    }

    .set-row--weighted-reps {
        grid-template-columns: 38px minmax(78px, 1fr) minmax(78px, 1fr);
    }

    .set-row--reps,
    .set-row--timed {
        grid-template-columns: 38px minmax(90px, 1fr) minmax(92px, 1fr);
    }

    .set-row--timed-weighted,
    .set-row--bodyweight-load-reps,
    .set-row--bodyweight-load-timed {
        grid-template-columns: 38px minmax(86px, 1fr) minmax(86px, 1fr);
    }

    .set-row input:nth-last-child(2),
    .set-row .warmup-toggle,
    .set-row button {
        grid-column: auto;
    }

    .template-exercise-rest {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .template-exercise-footer {
        align-items: stretch;
    }
}

/* Workout plan entry flow */
.workout-start-shell,
.workout-select-shell {
    display: grid;
    gap: 1rem;
    margin: 0 auto;
    max-width: 760px;
    width: 100%;
}

.workout-start-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workout-start-shell.is-single,
.workout-select-shell {
    grid-template-columns: 1fr;
    max-width: 680px;
}

.workout-start-card {
    background: #0a0c0f;
    border: 1px solid #20242b;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
    display: grid;
    gap: 1rem;
    min-height: 280px;
    padding: 1.2rem;
}

.workout-start-card h2 {
    color: #f5f5f6;
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.05;
    margin: 0;
}

.workout-start-card .system-label {
    margin-bottom: .2rem;
}

.workout-start-card .workout-field {
    align-self: end;
}

.workout-start-card .auth-submit.workout-create-submit,
.workout-start-card .secondary-action {
    justify-self: start;
    min-width: 158px;
    width: auto;
}

.workout-edit-plans:disabled,
.workout-page .secondary-action:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.workout-edit-plans:disabled:hover,
.workout-page .secondary-action:disabled:hover {
    border-color: #24262b;
    color: #a4a4ad;
}

.workout-plan-select-panel .template-list-large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-list-large .template-button {
    min-height: 92px;
}

.workout-layout.is-editor {
    grid-template-columns: minmax(0, 640px);
    justify-content: center;
    max-width: 680px;
}

.workout-layout.is-editor .workout-builder {
    width: 100%;
}

.workout-layout.is-editor .template-exercise-rest {
    align-items: stretch;
    grid-template-columns: 1fr;
}

.workout-layout.is-editor .template-rest-field {
    max-width: 260px;
    width: 100%;
}

.workout-layout.is-editor .set-table {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: .25rem;
    scrollbar-color: #343b47 #080c11;
}

.workout-layout.is-editor .set-row {
    gap: .4rem;
    min-width: 100%;
    padding: .5rem;
    width: max-content;
}

.workout-layout.is-editor .set-row--weighted-reps {
    grid-template-columns: 34px 78px 68px 74px minmax(118px, 140px) 70px;
}

.workout-layout.is-editor .set-row--reps,
.workout-layout.is-editor .set-row--timed {
    grid-template-columns: 34px 74px 74px minmax(118px, 140px) 70px;
}

.workout-layout.is-editor .set-row--timed-weighted {
    grid-template-columns: 34px 78px 74px 68px 74px minmax(118px, 140px) 70px;
}

.workout-layout.is-editor .set-row--bodyweight-load-reps,
.workout-layout.is-editor .set-row--bodyweight-load-timed {
    grid-template-columns: 34px 70px 78px 68px 74px minmax(118px, 140px) 70px;
}

.workout-layout.is-editor .set-row input {
    font-size: .92rem;
    min-height: 34px;
    padding: .42rem .5rem;
}

.workout-layout.is-editor .bodyweight-toggle,
.workout-layout.is-editor .warmup-toggle {
    font-size: .86rem;
    min-height: 34px;
    padding: 0 .45rem;
}

.workout-layout.is-editor .set-row button {
    font-size: .84rem;
    min-height: 34px;
    min-width: 64px;
    padding: 0 .5rem;
}

.workout-editor-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    justify-content: flex-end;
}

.workout-editor-actions .auth-submit,
.workout-editor-actions .secondary-action {
    height: 42px;
    margin-top: 0;
    min-width: 128px;
    padding: 0 1rem;
    width: auto;
}

@media (max-width: 760px) {
    .workout-start-shell,
    .workout-plan-select-panel .template-list-large {
        grid-template-columns: 1fr;
    }

    .workout-start-card {
        min-height: 0;
        padding: 1rem;
    }

    .workout-start-card .auth-submit.workout-create-submit,
    .workout-start-card .secondary-action,
    .workout-editor-actions .auth-submit,
    .workout-editor-actions .secondary-action {
        justify-self: stretch;
        width: 100%;
    }

    .workout-layout.is-editor {
        max-width: 460px;
    }
}

/* Workout plan search */
.workout-start-shell {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1040px;
}

.workout-start-shell.is-single {
    grid-template-columns: 1fr;
    max-width: 680px;
}

.workout-plan-search-panel {
    gap: 1rem;
}

.plan-search-input {
    min-height: 58px;
}

.plan-search-results {
    display: grid;
    gap: .7rem;
}

.plan-search-item {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0)),
        #07090c;
    border: 1px solid #20242b;
    border-radius: 8px;
    color: #aeb2bc;
    display: grid;
    gap: .35rem;
    min-height: 94px;
    padding: 1rem;
    text-align: left;
}

.plan-search-item:hover,
.plan-search-item:focus-visible {
    background: #10141a;
    border-color: #d7ff63;
    color: #f4f4f5;
    outline: 0;
}

.plan-search-item span,
.plan-search-item small {
    color: #8e96a3;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.plan-search-item strong {
    color: #f5f5f6;
    font-size: 1.18rem;
    line-height: 1.1;
}

.plan-search-item small {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    line-height: 1.35;
    text-transform: none;
}

@media (max-width: 980px) {
    .workout-start-shell {
        grid-template-columns: 1fr;
        max-width: 680px;
    }
}

/* Compact centered workout start hub */
.workout-start-shell {
    align-items: center;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    margin: 0 auto;
    max-width: 640px;
    width: 100%;
}

.workout-start-panel {
    background: rgba(10, 12, 15, .94);
    border: 1px solid #20242b;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
    display: grid;
    gap: 1rem;
    justify-items: center;
    padding: 1.15rem;
    width: min(100%, 520px);
}

.workout-start-panel .system-label {
    margin-bottom: .15rem;
}

.workout-start-panel h2 {
    color: #f5f5f6;
    font-size: clamp(1.35rem, 2.8vw, 1.85rem);
    line-height: 1.05;
    margin: 0;
    text-align: center;
}

.workout-start-actions {
    display: grid;
    gap: .7rem;
    justify-items: center;
    width: 100%;
}

.workout-action-button {
    align-items: center;
    background: #07090c;
    border: 1px solid #20242b;
    border-radius: 8px;
    color: #aeb2bc;
    column-gap: .85rem;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 72px;
    padding: .8rem .9rem;
    text-align: left;
    width: min(100%, 390px);
}

.workout-action-button:hover,
.workout-action-button:focus-visible {
    background: #10141a;
    border-color: #d7ff63;
    color: #f4f4f5;
    outline: 0;
}

.workout-action-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.workout-action-button:disabled:hover {
    background: #07090c;
    border-color: #20242b;
    color: #aeb2bc;
}

.workout-action-button > span {
    align-items: center;
    background: #121820;
    border: 1px solid #29313d;
    border-radius: 999px;
    color: #d7ff63;
    display: inline-flex;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .68rem;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    letter-spacing: .08em;
    width: 36px;
}

.workout-action-button strong,
.workout-action-button small {
    grid-column: 2;
}

.workout-action-button strong {
    color: #f5f5f6;
    font-size: 1rem;
    line-height: 1.1;
}

.workout-action-button small {
    color: #8e96a3;
    font-size: .82rem;
    line-height: 1.3;
}

.workout-create-plan-panel {
    margin: 0 auto;
    max-width: 520px;
    width: 100%;
}

.workout-create-plan-panel .workout-field {
    justify-self: center;
    max-width: 390px;
    width: 100%;
}

.workout-create-actions {
    display: flex;
    justify-content: center;
}

.workout-create-plan-panel .auth-submit.workout-create-submit {
    min-width: 168px;
    width: auto;
}

@media (max-width: 760px) {
    .workout-start-shell {
        max-width: 100%;
    }

    .workout-start-panel {
        width: 100%;
    }

    .workout-action-button {
        width: min(100%, 380px);
    }

    .workout-create-plan-panel .auth-submit.workout-create-submit {
        max-width: 220px;
        width: 100%;
    }
}
