* {
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #111216;
    color: #fff;
    font-family: 'SF Pro Display', system-ui, Arial, sans-serif;
    min-height: 100vh;
    overflow-x: clip;
}

html {
    -webkit-text-size-adjust: 100%;
}

.app-container {
    display: none;
    min-height: calc(100vh - 70px);
    padding-bottom: 70px;
    overflow: visible;
}

.app-container.active {
    display: block;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: rgba(22, 22, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
    flex: 1;
    background: none;
    border: none;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn.active {
    color: #30a7f7;
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-ic {
    font-size: 24px;
    margin-bottom: 4px;
}

.main-container {
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: #111216;
    box-sizing: border-box;
    padding: 0 12px 32px 12px;
    position: relative;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    margin: 32px 0 20px 0;
    letter-spacing: -0.02em;
}

.block {
    margin-bottom: 28px;
}

.label {
    color: #babfc7;
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 7px;
}

.btn-group {
    display: flex;
    gap: 10px;
    max-width: 100%;
    flex-wrap: wrap;
}

.option-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55em;
    background: #191a1f;
    color: #fff;
    font-weight: 600;
    font-size: clamp(12px, 3.2vw, 16px);
    line-height: 1.28;
    padding: .9em 1.1em;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: .16s;
    white-space: nowrap;
    box-sizing: border-box;
    flex: 1 1 33%;
    min-width: max(10.5rem, 30%);
}

.option-btn:active {
    background: #186c8c;
}

.option-btn.active,
.option-btn.selected {
    background: #36a3d1;
    color: #fff;
    transform: none;
    box-shadow: 0 2px 14px #36a3d133;
}

.main-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.main-btn {
    width: 100%;
    background: #36a3d1;
    color: #fff;
    font-size: 1.13rem;
    font-weight: 700;
    padding: 18px 0 16px 0;
    border: none;
    border-radius: 20px;
    margin-top: 26px;
    margin-bottom: 6px;
    cursor: pointer;
    box-shadow: 0 2px 18px #36a3d122;
    opacity: 1;
    transition: opacity 0.14s;
}

.cancel-btn {
    margin-top: 12px;
    background: #23242a;
    color: #babfc7;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    padding: 10px 0;
    width: 100%;
    cursor: pointer;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.loader {
    margin: 120px auto 28px auto;
    width: 44px;
    height: 44px;
    border: 5px solid #36a3d1;
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    text-align: center;
    color: #fff;
    font-size: 1.11rem;
    margin-top: 4px;
}

.program-card {
    display: flex;
    gap: 18px;
    background: #191a1f;
    border-radius: 18px;
    box-shadow: 0 2px 14px #36a3d133;
    padding: 17px 12px;
    align-items: center;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s;
}

.program-card:active {
    background: #23242a;
    transform: scale(0.98);
}

.program-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 1px 7px #0002;
}

.program-title {
    font-size: 1.16rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.program-desc-short {
    color: #babfc7;
    font-size: 1rem;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(10, 12, 15, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.27s;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: #18191e;
    border-radius: 22px;
    padding: 34px 19px 24px 19px;
    width: 98vw;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 40px #34aadd22;
    position: relative;
}

.modal-img {
    width: 100%;
    height: 100%;
    max-width: 270px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 18px;
    box-shadow: 0 2px 20px #23242a15;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 9px;
}

.modal-desc {
    color: #e0e0e2;
    font-size: 1.08rem;
    margin-bottom: 24px;
    text-align: left;
}

.paywall-content {
    background: #18191e;
    border-radius: 22px;
    padding: 32px 15px 24px 15px;
    width: 95vw;
    max-width: 395px;
    text-align: center;
    box-shadow: 0 8px 40px #34aadd22;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.paywall-content::-webkit-scrollbar {
    width: 4px;
}

.paywall-content::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
}

.paywall-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 17px;
}

.brand {
    color: #36a3d1;
}

.paywall-features {
    list-style: none;
    padding: 0 0 0 0;
    margin: 0 0 22px 0;
    text-align: left;
    color: #fff;
    font-size: 1.2rem;
}

.paywall-features li {
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.paywall-plans {
    margin-bottom: 19px;
}

.paywall-plan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #191a1f;
    color: #fff;
    font-size: 1.11rem;
    font-weight: 500;
    border-radius: 13px;
    padding: 12px 15px;
    margin-bottom: 7px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.14s, background 0.13s;
}

.paywall-plan input[type="radio"] {
    accent-color: #36a3d1;
    width: 18px;
    height: 18px;
    margin-right: 7px;
}

.paywall-plan.selected,
.paywall-plan input[type="radio"]:checked~span {
    background: #23242a;
    border-color: #36a3d1;
}

.price {
    color: #36a3d1;
    font-weight: 700;
}

.paywall-small {
    margin: 8px 0 0 0;
    color: #babfc7;
    font-size: 0.96rem;
    line-height: 1.3;
}

.price-line {
    font-weight: 700;
    font-size: 1.1rem;
    color: #36a3d1;
    margin: 10px 0 6px 0;
}

.modal-content {
    max-height: 92vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.rich-text {
    color: #e0e0e2;
    font-size: 1.08rem;
    line-height: 1.5;
}

.rich-text p {
    margin: 0 0 0.8em 0;
}

.rich-text ul,
.rich-text ol {
    margin: 0.6em 0 0.8em 1.2em;
}

.rich-text li {
    margin: 0.25em 0;
}

.rich-text a {
    color: #36a3d1;
    text-decoration: underline;
}

.program-list {
    display: grid;
    gap: 12px;
}

.program-card+.program-card {
    margin-top: 12px;
}

.skeleton {
    width: 80px;
    height: 80px;
    border-radius: 13px;
    background: linear-gradient(90deg, #1b1c22 25%, #22232a 37%, #1b1c22 63%);
    background-size: 400% 100%;
    animation: shimmer 1.2s infinite;
    box-shadow: 0 1px 7px #0002;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0
    }

    100% {
        background-position: -200% 0
    }
}

.promo-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #2a2b31;
    background: #191a1f;
    color: #fff;
    font-size: 1rem;
    box-sizing: border-box;
}

.promo-ok {
    color: #8ddf76;
}

.promo-bad {
    color: #ff8484;
}

.modal-ex-strip {
    margin: 10px 0 22px 0;
}

.modal-ex-strip-title {
    font-size: 0.9rem;
    color: #babfc7;
    margin-bottom: 6px;
}

.modal-ex-strip-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin: 0 -4px 0 -4px;
    padding-left: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-ex-strip-scroll::-webkit-scrollbar {
    display: none;
}

.modal-ex-thumb {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #1b1c22;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.modal-ex-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.promo-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #36a3d1;
    color: #36a3d1;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 0;
    border-radius: 16px;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 8px;
}

.promo-btn:active {
    background: rgba(54, 163, 209, 0.1);
    transform: scale(0.98);
}

#app2 .program-card {
    display: flex;
    gap: 18px;
    background: #191a1f;
    border-radius: 18px;
    box-shadow: 0 2px 14px #36a3d133;
    padding: 17px 12px;
    align-items: center;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s;
    margin-bottom: 18px;
}

#app2 .program-card:hover {
    background: #23242a;
    transform: translateY(-2px) scale(1.01);
}

#app2 .program-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 1px 7px #0002;
}

#app2 .program-title {
    font-size: 1.16rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

#app2 body {
    background: #111216;
    color: #fff;
}

#app2 .exercise-list-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: none;
    border-radius: 13px;
    box-shadow: none;
    margin-bottom: 11px;
    padding: 0 0 0 0;
    min-height: 74px;
    cursor: pointer;
    transition: background 0.18s;
}

#app2 .exercise-list-row:hover {
    background: #16171c;
}

#app2 .exercise-list-img {
    width: 60px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    flex-shrink: 0;
    border: 1.5px solid #23242a;
    margin-left: 2px;
}

#app2 .exercise-list-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 46px;
}

#app2 .exercise-list-name {
    font-size: 1.11rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    line-height: 1.11;
}

#app2 .exercise-list-sets {
    color: #bcbcbc;
    font-size: 1.01rem;
    margin-top: 2px;
}

#app2 .back-btn {
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid #2a2d36;
    background: linear-gradient(180deg, #191a1f 0%, #15161b 100%);
    color: #e6e6e6;
    font-size: 0.98rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    margin-bottom: 12px;
    margin-left: 16px;
    margin-right: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform .12s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

/* Icon removed as we use text "Назад" now */

#app2 .back-btn:hover {
    background: linear-gradient(180deg, #20222a 0%, #181a1f 100%);
    border-color: #3a3d46;
    transform: translateY(-1px);
}

#app2 .back-btn:active {
    transform: translateY(0);
    background: linear-gradient(180deg, #17181d 0%, #131419 100%);
}

#app2 .workout-title {
    font-size: 1.16em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

#app2 .program-title-big {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 32px 0 22px 0;
    letter-spacing: -0.02em;
    color: #fff;
    text-align: center;
    line-height: 1.18;
}

#app2 .exercise-list-row:last-child {
    margin-bottom: 0;
}

#app2 #pageHeader {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 24px;
    margin-bottom: 18px;
    min-height: 36px;
}

#app2 .workout-card {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 12px;
    margin-bottom: 10px;
    background: #191a1f;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

#app2 .workout-card:active {
    transform: scale(0.98);
    background: #1f2026;
}

#app2 .workout-img {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background: #25262d;
}

#app2 .workout-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

#app2 .workout-main .program-title {
    font-size: 0.98rem;
    font-weight: 600;
}

#app2 .workout-main .sub {
    font-size: 0.85rem;
    color: #babfc7;
}

#app2 .program-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #111318;
    position: relative;
}

#app2 .program-img {
    width: 82px;
    height: 82px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
}

#app2 .program-card-main {
    flex: 1;
    min-width: 0;
}

#app2 .program-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#app2 .program-access {
    font-size: 0.75rem;
    opacity: 0.7;
    color: #65e0b6;
}

#app2 .program-active-btn {
    appearance: none;
    border-radius: 999px;
    border: 1px solid #2a2d36;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #181920;
    color: #e6e6e6;
    cursor: pointer;
    white-space: nowrap;
    margin-left: auto;
    transition: background .15s, border-color .15s, transform .1s;
}

#app2 .program-active-btn:hover {
    background: #1f222b;
    border-color: #34aadd;
    transform: translateY(-1px);
}

#app2 .program-active-btn.is-active {
    background: linear-gradient(135deg, #34aadd, #65e0b6);
    color: #0a1014;
    border-color: transparent;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
    cursor: default;
}

#app3 .main-workout {
    width: 100vw;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: #111216;
    box-sizing: border-box;
}

#app3 .hidden {
    display: none !important;
}

#app3 header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 8px 8px;
    position: sticky;
    top: 0;
    background: #111216;
    z-index: 10;
    flex-wrap: wrap;
}

#app3 .close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    padding: 0 6px;
    cursor: pointer;
    font-weight: 500;
}

#app3 .finish-btn {
    background: #186c8c;
    border-radius: 16px;
    border: none;
    color: #fff;
    font-size: 15.5px;
    padding: 8px 16px;
    font-weight: 700;
    white-space: nowrap;
    opacity: .9;
    cursor: pointer;
    transition: background .18s, opacity .18s;
}

#app3 .finish-btn:disabled {
    opacity: 0.36;
    cursor: not-allowed;
}

#app3 .workout-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

#app3 .workout-info .label {
    color: #babfc7;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
}

#app3 .workout-info .value {
    color: #36a3d1;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    margin-top: 2px;
}

#app3 .exercises-list,
#constructor-editor .exercises-list {
    margin: 10px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 8px 40px 8px;
}

#app3 .exercise,
#constructor-editor .exercise {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    border-radius: 18px;
    cursor: pointer;
    transition: background 0.18s, border 0.18s;
    position: relative;
    border: 2.5px solid transparent;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

#app3 .exercise.expanded,
#constructor-editor .exercise.expanded {
    z-index: 2;
}

#app3 .exercise img,
#constructor-editor .exercise img {
    width: 60px;
    height: 80px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    margin-top: 4px;
    margin-right: 3px;
    box-shadow: 0 1px 7px #0002;
}

#app3 .exercise-right,
#constructor-editor .exercise-right {
    flex: 1;
}

#app3 .exercise-title,
#constructor-editor .exercise-title {
    font-size: 18.2px;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: -0.02em;
}

#app3 .sets-info,
#constructor-editor .sets-info {
    font-size: 13.5px;
    color: #babfc7;
    margin-top: 4px;
    margin-bottom: 2px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

#app3 .set-row-short,
#constructor-editor .set-row-short {
    padding: 2px 0;
    font-size: 13.6px;
    border-radius: 6px;
    transition: background 0.18s;
}

#app3 .set-row-short.done,
#constructor-editor .set-row-short.done,
#constructor-editor .set-row-short.done {
    background: #1e3422;
    color: #92eea2;
    border-radius: 0;
}

#app3 .sets-accordion,
#constructor-editor .sets-accordion {
    overflow: hidden;
    max-height: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    transition: max-height 0.36s cubic-bezier(.4, .2, 0, 1);
    will-change: max-height;
}

#app3 .sets-table,
#constructor-editor .sets-table {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    margin: 10px 0 0 0;
    border-radius: 14px;
    background: #191a1f;
    padding-bottom: 3px;
}

#app3 .set-row,
#constructor-editor .set-row {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    background: #18191e;
    margin: 8px 6px 10px 6px;
    border-radius: 12px;
    padding: 7px 8px;
    transition: transform 0.22s;
    box-shadow: 0 1px 6px #0002;
    z-index: 1;
    width: 100%;
    min-width: 0;
}

#app3 .set-row.done,
#constructor-editor .set-row.done {
    background: #1e3422;
    color: #92eea2;
}

#app3 .set-num,
#constructor-editor .set-num {
    font-weight: 700;
    width: 18px;
    text-align: center;
    font-size: 15.8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#app3 .set-row input,
#constructor-editor .set-row input {
    flex: 1 1 0;
    min-width: 0;
    background: #15161a;
    border: 1.2px solid #252632;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    padding: 5px 8px;
    outline: none;
    font-family: inherit;
    transition: border 0.18s, background 0.16s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    margin-right: 3%;
    margin-left: 3%
}

/* Избегаем зума на айфонах: font-size должен быть >= 16px */
@media screen and (-webkit-min-device-pixel-ratio: 0) {

    #app3 .set-row input,
    #constructor-editor .set-row input {
        font-size: 16px !important;
    }
}

#app3 .set-row input:focus,
#constructor-editor .set-row input:focus {
    border: 1.3px solid #34aadd;
    background: #191e21;
}

#app3 .input-reps,
#constructor-editor .input-reps {
    width: auto !important;
}

#app3 .set-ok,
#constructor-editor .set-ok {
    margin-left: auto;
    font-size: 19px;
    background: #197a23;
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 4px 11px;
    cursor: pointer;
    transition: background 0.17s;
    font-weight: 700;
    box-shadow: 0 1px 5px #0002;
    flex: 0 0 auto;
}

#app3 .set-ok:active,
#constructor-editor .set-ok:active,
#constructor-editor .set-ok:active {
    background: #176a23;
}

#app3 .set-ok:disabled,
#constructor-editor .set-ok:disabled,
#constructor-editor .set-ok:disabled {
    opacity: 0.40;
    cursor: not-allowed;
    background: #454f50;
}

#app3 .add-set-btn,
#constructor-editor .add-set-btn {
    display: block;
    width: 93%;
    margin: 13px auto 4px auto;
    background: #252632;
    border: none;
    color: #36a3d1;
    font-size: 16px;
    font-weight: 600;
    border-radius: 11px;
    padding: 11px 0;
    cursor: pointer;
    transition: background 0.16s;
}

#app3 .add-set-btn:active,
#constructor-editor .add-set-btn:active,
#constructor-editor .add-set-btn:active {
    background: #181a1f;
}

#app3 input[type=number]::-webkit-outer-spin-button,
#app3 input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#app3 input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

#app3 .finish-screen {
    position: fixed;
    inset: 0;
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111216;
    animation: fadeIn 0.4s;
}

#app3 .finish-content {
    background: #18191e;
    border-radius: 22px;
    padding: 38px 19px 26px 19px;
    text-align: center;
    max-width: 95vw;
    box-shadow: 0 8px 40px #34aadd28;
}

#app3 .finish-content h2 {
    font-size: 23px;
    margin-bottom: 13px;
    color: #34aadd;
    font-weight: 800;
    letter-spacing: -0.015em;
}

#app3 .finish-content p {
    color: #babfc7;
    margin-bottom: 22px;
    font-size: 16px;
}

#app3 .finish-content .close-btn {
    font-size: 19px;
    background: #197a23;
    color: #fff;
    border-radius: 13px;
    border: none;
    padding: 10px 27px;
    cursor: pointer;
    margin-top: 6px;
    font-weight: 700;
    transition: background 0.2s;
}

#app3 .finish-content .close-btn:active {
    background: #176a23;
}

#app3 .modal-ex-desc {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(10, 12, 15, 0.97);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    animation: fadeIn 0.25s;
}

#app3 .modal-ex-desc.hidden {
    display: none !important;
}

#app3 .modal-content {
    margin: 42px auto 18px auto;
    background: #18191e;
    border-radius: 20px;
    padding: 34px 17px 26px 17px;
    max-width: 420px;
    width: 96vw;
    min-width: 0;
    box-sizing: border-box;
    box-shadow: 0 6px 32px #0007;
    text-align: left;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.26s;
}

.modal-back-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    color: #34aadd;
    border-radius: 10px;
    flex-shrink: 0;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.modal-back-btn:active {
    background: rgba(52, 170, 221, 0.12);
}

.modal-back-btn.fake {
    visibility: hidden;
    pointer-events: none;
}

.modal-back {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 8px #0002;
}

.modal-back:active {
    background: #23242A;
}

.modal-title {
    flex: 1;
    width: 100%;
    min-width: 0;

    text-align: center;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;

    margin: 0 10px;

    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;

    display: block;
}

.modal-gif {
    display: block;
    width: 95%;
    max-width: 320px;
    margin: 0 auto 23px auto;
    border-radius: 13px;
    background: #101214;
    box-shadow: 0 2px 18px #0004;
    object-fit: cover;
}

.modal-desc {
    font-size: 15.5px;
    color: #e0e0e2;
    line-height: 1.55;
    margin-top: 10px;
    display: flow-root;
}

.modal-desc p,
.modal-desc ul,
.modal-desc ol {
    margin: 0 0 10px 0 !important;
}

.modal-desc ul,
.modal-desc ol {
    padding-left: 1.2em !important;
}

.modal-desc li {
    margin: 4px 0 !important;
}

.modal-desc,
.modal-desc * {
    white-space: normal !important;
}

.modal-video-pause {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(30, 32, 40, 0.75);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 21px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: background 0.15s;
    padding: 0
}

.modal-video-pause:active {
    background: rgba(22, 26, 28, 0.92);
}

.modal-video-pause,
.modal-audio-btn {
    z-index: 10;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 18px;
    min-height: 40px;
    height: auto;
    padding: 0 6px;
    box-sizing: border-box;
    flex-shrink: 0;
}

#app3 .set-row.swipe-delete,
#constructor-editor .set-row.swipe-delete,
#constructor-editor .set-row.swipe-delete {
    transform: translateX(-68px);
    transition: transform 0.28s cubic-bezier(.6, .2, 0, 1);
}

.delete-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    height: auto;
    background: #d23b2c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 19px;
    font-weight: 700;
    box-shadow: 0 1px 5px #0003;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 11px;
    min-height: 38px;
    min-width: 38px;
}

.delete-btn:active {
    background: #b02114;
}

#ex-header {
    display: flex
}

.set-row.invalid {
    background: #31171a !important;
    color: #ff939e;
    border: 1.2px solid #ff4466;
}

.set-row input:last-of-type {
    margin-left: 0;
    margin-right: 5%
}

.set-row.swipe-delete+.delete-btn {
    opacity: 1;
    pointer-events: all;
}

.set-row-wrap {
    position: relative;
    display: flex;
    align-items: stretch
}

.modal-audio-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(30, 32, 40, 0.75);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 21px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: background 0.15s;
    padding: 0;
}

.modal-audio-btn:active {
    background: rgba(22, 26, 28, 0.92);
}

.modal-fullscreen-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(30, 32, 40, 0.75);
    color: #fff;
    border: none;
    border-radius: 9px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: background 0.15s;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.modal-fullscreen-btn:active {
    background: rgba(22, 26, 28, 0.92);
}

.help-btn {
    background: #23242a;
    color: #eaf6ff;
    border: none;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    cursor: pointer;
    box-shadow: 0 1px 6px #0004;
    transition: background .15s, transform .05s;
}

.help-btn:active {
    background: #2b2d34;
    transform: scale(.98);
}

.help-modal {
    padding-top: 24px;
}

.help-body {
    width: 100%;
    max-width: 420px;
}

.help-tip {
    background: #1b2227;
    border: 1px solid #27333b;
    color: #cfefff;
    padding: 12px 12px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 14.8px;
    line-height: 1.5;
}

.help-list {
    margin: 0;
    padding-left: 20px;
    color: #e6e7ea;
    line-height: 1.62;
    font-size: 15.5px;
}

.help-list li {
    margin: 8px 0;
}

.help-list b {
    color: #ffffff;
}

.help-list u {
    text-underline-offset: 2px;
}

.help-ok-btn {
    width: 100%;
    padding: 12px 0;
    background: linear-gradient(90deg, #30a7f7 0%, #0072ff 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(48, 167, 247, .18);
    cursor: pointer;
    transition: transform .04s ease, filter .15s ease;
    margin-top: 14px;
}

.help-ok-btn:active {
    transform: translateY(1px);
    filter: brightness(.95);
}

.close-btn,
.help-btn {
    flex: 0 0 auto;
}

#app3 .workout-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

#app3 .workout-info::-webkit-scrollbar {
    display: none;
}

#app3 .workout-info .label {
    font-size: 10.5px;
}

#app3 .workout-info .value {
    font-size: 14.5px;
}

#app3 .header-top {
    position: sticky;
    top: env(safe-area-inset-top, 0);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 8px;
    padding: calc(8px + env(safe-area-inset-top, 0)) 10px 8px 10px;
    background: #111216;
}

#app3 .spacer {
    flex: 1 1 auto;
}

#app3 .stats-wrap {
    padding: 5px 12px 8px;
}

#app3 .stats-card {
    display: grid;
    grid-template-columns: 1fr 1px 1fr 1px 1fr;
    gap: 0 12px;
    align-items: stretch;
    background: #14161b;
    border: 1px solid #2a2b33;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 2px 12px #0003;
}

#app3 .v-divider {
    width: 1px;
    background: #2a2b33;
    border-radius: 1px;
}

#app3 .stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

#app3 .stat-label {
    color: #a6acb6;
    font-size: 13px;
    letter-spacing: .02em;
}

#app3 .stat-value {
    margin-top: 6px;
    font-weight: 600;
    font-size: 18px;
    color: #e9ecf1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#app3 .stat-value.time {
    color: #30a7f7;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: #18191e;
    border-radius: 16px;
    padding: 20px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 4px 20px #0007;
}

#app3 .modal-btn {
    flex: auto;
    min-width: 110px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, transform 0.08s;
    text-align: center;
    white-space: normal;
    line-height: 1.3;
}

#app3 .modal-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

#app3 .modal-btn:active {
    transform: scale(0.98);
}

#app3 .cancel-btn {
    background: #33363f;
    color: #fff;
}

#app3 .cancel-btn:active {
    background: #2b2e35;
}

#app3 .danger-btn {
    background: #d23b2c;
    color: #fff;
}

#app3 .danger-btn:active {
    background: #b02114;
}

#app3 .help-list {
    --indent: 20px;
}

#app3 .help-list img {
    display: block !important;
    border-radius: 12px !important;
    width: calc(100% + var(--indent)) !important;
    max-width: calc(100% + var(--indent)) !important;
    margin: 10px auto !important;
    margin-left: calc(-1 * var(--indent)) !important;
}

#app3 .help-btn.help-main {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #34aadd;
    border: 1px solid #2a88b3;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 0 0 0 rgba(52, 170, 221, .45);
    animation: helpPulse 1.8s infinite;
}

#app3 .help-btn.help-main:hover {
    transform: scale(1.06);
    background: #2797c8;
    border-color: #1f7ea7;
}

@keyframes helpPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 170, 221, .45);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(52, 170, 221, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 170, 221, 0);
    }
}

#app3 .help-btn.no-pulse {
    animation: none !important;
    box-shadow: none !important;
}

.warmup-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #1b2227;
    border: 1px solid #27333b;
    color: #cfefff;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border .15s, transform .04s;
}

.warmup-toggle:hover {
    background: #1d252b;
}

.warmup-toggle:active {
    transform: translateY(1px);
}

.warmup-toggle .chev {
    transition: transform .2s ease;
    opacity: .9;
}

.warmup-toggle[aria-expanded="true"] .chev {
    transform: rotate(180deg);
}

.warmup-content {
    overflow: hidden;
    transition: height .26s ease, opacity .2s ease;
}

.warmup-content[hidden] {
    display: block !important;
    height: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.warmup-content:not([hidden]) {
    height: auto;
    opacity: 1;
}

.modal-desc .desc-photo {
    display: block;
    width: 100%;
    max-width: 340px;
    margin: 12px auto 0;
    border-radius: 12px;
    background: #101214;
    box-shadow: 0 2px 18px #0004;
    object-fit: cover;
}

.skel-list {
    display: grid;
    gap: 14px;
    padding: 0 8px 40px;
}

.skel-card {
    border-radius: 18px;
    background: #191a1f;
    padding: 12px;
    box-shadow: 0 1px 6px #0002;
}

.skel-top {
    display: flex;
    gap: 12px;
}

.skel-thumb {
    width: 60px;
    height: 80px;
    border-radius: 10px;
    background: #23242a;
}

.skel-lines {
    flex: 1;
    display: grid;
    gap: 8px;
}

.skel-line {
    height: 14px;
    border-radius: 7px;
    background: #23242a;
}

.skel-line.lg {
    height: 18px;
}

#app3 .skel-shimmer {
    position: relative;
    overflow: hidden;
}

#app3 .skel-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, #ffffff15, transparent);
    animation: skel 1.2s infinite;
}

@keyframes skel {
    to {
        transform: translateX(100%);
    }
}

#app3 .sets-table-grid,
#constructor-editor .sets-table-grid {
    display: grid;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

#app3 .sets-head-row,
#constructor-editor .sets-head-row,
#app3 .set-row,
#constructor-editor .set-row {
    display: grid;
    grid-template-columns: 40px minmax(120px, 1fr) 80px 100px 50px;
    align-items: center;
    gap: 8px;
    padding: 8px;
    min-width: 0;
}

#app3 .c-set,
#constructor-editor .c-set,
#app3 .c-prev,
#constructor-editor .c-prev,
#app3 .c-kg,
#constructor-editor .c-kg,
#app3 .c-reps,
#constructor-editor .c-reps,
#app3 .c-ok,
#constructor-editor .c-ok {
    min-width: 0;
    overflow: hidden;
}

#app3 .c-set,
#constructor-editor .c-set {
    text-align: center;
    font-weight: 700;
}

#app3 .c-prev,
#constructor-editor .c-prev {
    color: #babfc7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

#app3 .c-kg input,
#constructor-editor .c-kg input,
#app3 .c-reps input,
#constructor-editor .c-reps input {
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    text-align: center;
    background: #15161a;
    border: 1.2px solid #252632;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    padding: 6px 8px;
    box-sizing: border-box;
}

#app3 .c-ok,
#constructor-editor .c-ok {
    display: flex;
    justify-content: center;
}

#app3 .set-ok.modern,
#constructor-editor .set-ok.modern {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #23252d;
    color: #e8eef3;
    border: 1px solid #323644;
    font-size: 16px;
    font-weight: 800;
    transition: all 0.18s;
}

#app3 .set-ok.modern.active,
#constructor-editor .set-ok.modern.active {
    background: #3ddc84;
    border-color: #35c776;
    color: #0d1e13;
}

#app3 .sets-table,
#constructor-editor .sets-table {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

#app3 .sets-accordion,
#constructor-editor .sets-accordion {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#app3 .sets-table,
#constructor-editor .sets-table {
    container-type: inline-size;
}

#app3 .sets-head-row,
#constructor-editor .sets-head-row {
    opacity: 0.75;
    color: #9aa1ab;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 6px 6px 0 6px;
    padding: 7px 8px;
    background: transparent;
    box-shadow: none;
    display: grid !important;
    grid-template-columns: 40px minmax(120px, 1fr) 80px 100px 50px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

#app3 .sets-accordion,
#constructor-editor .sets-accordion {
    overflow: hidden;
    max-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    transition: none;
}

#app3 .sets-accordion.animated,
#constructor-editor .sets-accordion.animated {
    transition: max-height 0.36s cubic-bezier(.4, .2, 0, 1);
}

#app3 .set-row-wrap *,
#constructor-editor .set-row-wrap *,
#constructor-editor .set-row-wrap * {
    pointer-events: auto;
}

#app3 .sets-table *,
#constructor-editor .sets-table * {
    pointer-events: auto;
}

#app3 .set-row input,
#constructor-editor .set-row input,
#app3 .set-ok,
#constructor-editor .set-ok,
.delete-btn {
    pointer-events: auto !important;
}

.exercise {
    contain: layout;
    overflow: hidden;
    border-radius: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Суперсет: цветная граница слева, плотно прилегает к карточке */
#app3 .exercise.has-superset,
#constructor-editor .exercise.has-superset {
    border-left: 4px solid var(--superset-color, transparent) !important;
}

.exercise-img {
    width: 66px;
    aspect-ratio: 3 / 4;
    object-fit: contain;
}

@media (max-width: 420px) {
    .option-btn {
        flex: 1 1 calc(50% - 10px);
        min-width: calc(50% - 10px);
        font-size: clamp(12px, 3.8vw, 16px);
        padding: .85em 1em;
    }
}

@media (max-width: 330px) {
    .option-btn {
        flex: 1 1 100%;
        min-width: 100%;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .modal-ex-thumb {
        width: 52px;
        height: 52px;
        border-radius: 10px;
    }

    #app2 .workout-img {
        width: 56px;
        height: 56px;
        border-radius: 11px;
    }

    #app2 .workout-card {
        padding: 10px 10px;
        gap: 10px;
    }

    #app3 .help-btn.help-main {
        width: 26px;
        height: 26px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    #app2 .program-card {
        padding: 8px;
        gap: 8px;
    }

    #app2 .program-img {
        width: 52px;
        height: 52px;
    }

    #app2 .program-title {
        font-size: 0.9rem;
    }

    #app2 .program-active-btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    #app3 .sets-head-row,
    #constructor-editor .sets-head-row,
    #app3 .set-row,
    #constructor-editor .set-row {
        grid-template-columns: 35px minmax(100px, 1fr) 70px 90px 45px;
        gap: 6px;
        padding: 6px;
    }

    #app3 .sets-head-row,
    #constructor-editor .sets-head-row {
        font-size: 11px;
    }

    #app3 .c-prev,
    #constructor-editor .c-prev {
        font-size: 13px;
    }

    #app3 .c-kg input,
    #constructor-editor .c-kg input,
    #app3 .c-reps input,
    #constructor-editor .c-reps input {
        font-size: 16px;
        padding: 5px 6px;
    }
}

@media (max-width: 380px) {
    #app2 .workout-img {
        width: 56px;
        height: 56px;
        border-radius: 11px;
    }

    #app2 .workout-card {
        padding: 10px 10px;
        gap: 10px;
    }

    #app3 .workout-info {
        order: 2;
        width: 100%;
    }

    #app3 .help-btn {
        order: 3;
    }

    #app3 .finish-btn {
        order: 4;
    }
}

@media (max-width: 370px) {
    #app3 .stats-card {
        padding: 12px 12px;
    }

    #app3 .stat-value {
        font-size: 16.5px;
    }

    #app3 .stat-label {
        font-size: 12px;
    }

    #app3 .help-btn {
        width: 34px;
        height: 34px;
    }

    #app3 .finish-btn {
        padding: 7px 14px;
        font-size: 15px;
    }
}

@media (max-width: 360px) {

    #app2 .sets-head-row,
    #app2 .set-row {
        grid-template-columns: 30px minmax(90px, 1fr) 65px 85px 44px;
        gap: 5px;
        padding: 5px;
        font-size: 14px;
    }

    #app2 .set-row input {
        font-size: 16px;
        padding: 4px 6px;
    }

    #app3 .sets-head-row,
    #constructor-editor .sets-head-row,
    #app3 .set-row,
    #constructor-editor .set-row {
        grid-template-columns: 30px minmax(90px, 1fr) 65px 85px 44px;
        gap: 5px;
        padding: 5px;
        font-size: 14px;
    }

    #app3 .set-row input,
    #constructor-editor .set-row input {
        font-size: 16px;
        padding: 4px 6px;
    }

    #app3 .workout-info .value {
        font-size: 13.5px;
    }
}

/* @media (max-width: 400px) {
    #app3 .set-row, #constructor-editor .set-row {
        grid-template-columns: 25px minmax(80px, 1fr) 55px 75px 35px !important;
        gap: 4px;
        padding: 4px;
    }
    
    #app3 .c-prev, #constructor-editor .c-prev {
        font-size: 13px;
    }
    
    #app3 .set-row input, #constructor-editor .set-row input {
        font-size: 13px;
        padding: 4px 5px;
    }
} */

@media (max-width: 320px) {

    #app3 .sets-head-row,
    #constructor-editor .sets-head-row,
    #app3 .set-row,
    #constructor-editor .set-row {
        grid-template-columns: 28px minmax(70px, 1fr) 55px 75px 38px;
        gap: 4px;
        padding: 4px;
        font-size: 13px;
    }

    #app3 .set-row input,
    #constructor-editor .set-row input {
        font-size: 13px;
        padding: 4px 5px;
    }

    #app3 .set-ok.modern,
    #constructor-editor .set-ok.modern {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    #app3 .delete-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
        right: 8px;
    }

    #app3 .set-row.swipe-delete,
    #constructor-editor .set-row.swipe-delete {
        transform: translateX(-50px);
    }
}

@media (prefers-reduced-motion: reduce) {
    #app3 .help-btn.help-main {
        animation: none;
    }
}

#app3 .sets-table,
#constructor-editor .sets-table {
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
    box-sizing: border-box;
    padding: 6px 2px 8px;
}

#app3 .sets-head-row,
#constructor-editor .sets-head-row {
    display: grid;
    grid-template-columns: 50px minmax(100px, 1fr) 80px 90px 50px;
    align-items: center;
    gap: 8px;
    padding: 8px;
    color: #9aa1ab;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

#app3 .set-row,
#constructor-editor .set-row {
    display: grid;
    grid-template-columns: 50px minmax(100px, 1fr) 80px 90px 50px;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #18191e;
    border-radius: 12px;
    margin-bottom: 6px;
    box-shadow: 0 1px 6px #0002;
}

#app3 .set-row.done,
#constructor-editor .set-row.done {
    background: #1e3422;
    color: #92eea2;
}

#app3 .c-set,
#constructor-editor .c-set {
    font-weight: 700;
    text-align: center;
}

#app3 .c-prev,
#constructor-editor .c-prev {
    color: #babfc7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    text-align: center;
}

#app3 .c-kg input,
#constructor-editor .c-kg input,
#app3 .c-reps input,
#constructor-editor .c-reps input {
    width: 100%;
    min-width: 0;
    text-align: center;
    background: #15161a;
    border: 1.2px solid #252632;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    padding: 6px 8px;
    box-sizing: border-box;
}

#app3 .c-kg input:focus,
#constructor-editor .c-kg input:focus,
#app3 .c-reps input:focus,
#constructor-editor .c-reps input:focus {
    border: 1.3px solid #34aadd;
    background: #191e21;
}

#app3 .c-ok,
#constructor-editor .c-ok {
    display: flex;
    justify-content: center;
}

#app3 .set-ok.modern,
#constructor-editor .set-ok.modern {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #23252d;
    color: #e8eef3;
    border: 1px solid #323644;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.18s;
}

#app3 .set-ok.modern.active,
#constructor-editor .set-ok.modern.active {
    background: #3ddc84;
    border-color: #35c776;
    color: #0d1e13;
}

#app3 .sets-accordion,
#constructor-editor .sets-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.36s cubic-bezier(.4, .2, 0, 1);
}

#app3 .sets-accordion.animated,
#constructor-editor .sets-accordion.animated {
    transition: max-height 0.36s cubic-bezier(.4, .2, 0, 1);
}

@media (max-width: 480px) {

    #app3 .sets-head-row,
    #constructor-editor .sets-head-row,
    #app3 .set-row,
    #constructor-editor .set-row {
        grid-template-columns: 40px minmax(80px, 1fr) 70px 80px 45px;
        gap: 6px;
        padding: 6px;
        font-size: 14px;
    }

    #app3 .c-kg input,
    #constructor-editor .c-kg input,
    #app3 .c-reps input,
    #constructor-editor .c-reps input {
        font-size: 14px;
        padding: 5px 6px;
    }
}

@media (max-width: 360px) {

    #app3 .sets-head-row,
    #constructor-editor .sets-head-row,
    #app3 .set-row,
    #constructor-editor .set-row {
        grid-template-columns: 35px minmax(70px, 1fr) 65px 75px 40px;
        gap: 5px;
        padding: 5px;
        font-size: 13px;
    }

    #app3 .c-kg input,
    #constructor-editor .c-kg input,
    #app3 .c-reps input,
    #constructor-editor .c-reps input {
        font-size: 13px;
        padding: 4px 5px;
    }
}

.sets-table {
    --col-set: 36px;
    --col-prev: 1fr;
    --col-kg: 85px;
    --col-reps: 85px;
    --col-ok: 48px;
}

.sets-head-row,
.set-row {
    display: grid !important;
    grid-template-columns: var(--col-set) var(--col-prev) var(--col-kg) var(--col-reps) var(--col-ok) !important;
    column-gap: 8px !important;
    align-items: center;
    padding: 8px;
    box-sizing: border-box;
}

.c-kg,
.c-reps {
    width: 100%;
    display: flex;
    justify-content: center;
}

.c-set,
.c-prev,
.c-ok {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.set-row-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.set-row {
    position: relative;
    z-index: 10;
    background: #18191e;
    transition: transform 0.2s ease-out;
    margin: 0 0 8px 0;
}

.set-row.swipe-delete {
    transform: translateX(-56px) !important;
}

.delete-btn {
    position: absolute;
    top: 0;
    bottom: 8px;
    right: 0;
    width: 56px;
    background: #d23b2c;
    color: #fff;
    border: none;
    border-radius: 0 12px 12px 0;
    font-size: 24px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    cursor: pointer;
    outline: none;
}

.modal-ex-desc {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #111216;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.modal-ex-desc.hidden {
    display: none !important;
}

.modal-content {
    background: transparent;
    box-shadow: none;
    padding: 0;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    min-height: 100%;
}

.modal-header {
    position: static;
    z-index: 100;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-video-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 20px auto;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 2px 18px #0004;
    overflow: hidden;
    flex-shrink: 0;
}

/* Landscape video: 16:9 aspect ratio, full width */
.modal-video-wrap.video-landscape {
    aspect-ratio: 16 / 9;
    max-width: 100%;
}

/* Portrait / square video: constrain width */
.modal-video-wrap.video-portrait {
    aspect-ratio: 1 / 1;
    max-width: min(80%, 300px);
}

.modal-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 13px;
    background: #fff;
    display: block;
    z-index: 1;
}

@media (max-width: 380px) {
    .sets-table {
        --col-set: 30px;
        --col-kg: 70px;
        --col-reps: 70px;
        --col-ok: 40px;
    }

    .sets-head-row,
    .set-row {
        font-size: 13px;
        gap: 4px !important;
    }
}

@media (max-width: 330px) {
    .sets-table {
        --col-set: 26px;
        --col-kg: 58px;
        --col-reps: 58px;
        --col-ok: 36px;
    }

    .sets-head-row,
    .set-row {
        font-size: 12px;
        gap: 3px !important;
        padding: 6px 5px !important;
    }
}

.modal-title {
    flex: 1;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin: 0 4px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.delete-btn {
    position: absolute;
    top: 0;
    bottom: 8px;
    right: 0;
    width: 60px;
    background: #d23b2c;
    color: #fff;
    border: none;
    border-radius: 0 !important;
    font-size: 28px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    cursor: pointer;
    outline: none;
}

.c-kg input,
.c-reps input {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    text-align: center;
    background: #15161a;
    border: 1.2px solid #252632;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    padding: 8px 0 !important;
    box-sizing: border-box;
    height: 38px;
}

.set-row-wrap {
    position: relative;
    width: 100%;
    isolation: isolate;
}

.set-row {
    position: relative;
    z-index: 10;
    background: #18191e;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.set-row-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.set-row {
    position: relative;
    z-index: 10;
    background: #18191e;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.delete-btn {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    aspect-ratio: 1.137 / 1;
    width: auto;

    background: #d23b2c;
    color: #fff;
    border: none;
    border-radius: 0 !important;
    font-size: 28px;
    font-weight: 300;

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 1;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
}

.set-row.swipe-delete {
    transform: translateX(-60px) !important;
}

.sets-table {
    --col-set: 36px;
    --col-prev: 1fr;
    --col-kg: 85px;
    --col-reps: 85px;
    --col-ok: 48px;
}

.sets-head-row,
.set-row {
    display: grid !important;
    grid-template-columns: var(--col-set) var(--col-prev) var(--col-kg) var(--col-reps) var(--col-ok) !important;
    column-gap: 8px !important;
    align-items: center;
    padding: 8px;
    box-sizing: border-box;
}

.sets-head-row>div,
.set-row>div {
    min-width: 0;
}

.sets-head-row>.c-set,
.sets-head-row>.c-prev,
.sets-head-row>.c-kg,
.sets-head-row>.c-reps,
.sets-head-row>.c-ok {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-kg input,
.c-reps input {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    text-align: center;
    background: #15161a;
    border: 1.2px solid #252632;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    padding: 6px 4px !important;
    box-sizing: border-box;
}

.c-kg input:focus,
.c-reps input:focus {
    border: 1.3px solid #34aadd;
    background: #191e21;
}

.c-set {
    font-weight: 700;
    text-align: center;
}

.c-prev {
    color: #babfc7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    justify-content: center;
}

.c-ok {
    display: flex;
    justify-content: center;
}

.set-ok.modern {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #23252d;
    color: #e8eef3;
    border: 1px solid #323644;
    font-size: 16px;
    font-weight: 800;
    transition: all 0.18s;
    cursor: pointer;
}

.set-ok.modern.active {
    background: #3ddc84;
    border-color: #35c776;
    color: #0d1e13;
    box-shadow: 0 0 0 2px #173d26 inset;
}

@media (max-width: 480px) {
    .sets-table {
        --col-set: 32px;
        --col-prev: 1fr;
        --col-kg: 68px;
        --col-reps: 92px;
        --col-ok: 44px;
    }

    .sets-head-row {
        font-size: 11px;
        letter-spacing: .05em;
    }
}

@media (max-width: 360px) {
    .sets-table {
        --col-set: 30px;
        --col-prev: 1fr;
        --col-kg: 62px;
        --col-reps: 86px;
        --col-ok: 42px;
    }

    .sets-head-row {
        font-size: 10px;
        letter-spacing: .04em;
    }
}

@media (max-width: 320px) {
    .sets-table {
        --col-set: 28px;
        --col-prev: 1fr;
        --col-kg: 58px;
        --col-reps: 80px;
        --col-ok: 40px;
    }
}

.set-row-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    isolation: isolate;
    margin-bottom: 8px;
}

.set-row {
    position: relative;
    z-index: 20 !important;
    background: #18191e;
    margin: 0 !important;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.set-row.swipe-delete {
    transform: translateX(-60px) !important;
}

.delete-btn {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60px !important;
    height: 100% !important;
    background: #d23b2c;
    color: #fff;
    border-radius: 0 !important;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    padding: 0;
    margin: 0;
    z-index: 1 !important;
    opacity: 1 !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

.set-row.swipe-delete+.delete-btn {
    pointer-events: auto !important;
    cursor: pointer;
}

.skel-list {
    display: grid;
    gap: 6px;
    padding: 0 8px 40px;
}

.skel-card {
    border-radius: 18px;
    background: #191a1f;
    padding: 12px;
    box-shadow: 0 1px 6px #0002;
}

.skel-top {
    display: flex;
    gap: 12px;
}

.skel-thumb {
    width: 60px;
    height: 80px;
    border-radius: 10px;
    background: #23242a;
}

.skel-lines {
    flex: 1;
    display: grid;
    gap: 8px;
}

.skel-line {
    height: 14px;
    border-radius: 7px;
    background: #23242a;
}

.skel-line.lg {
    height: 18px;
}

.skel-shimmer {
    position: relative;
    overflow: hidden;
}

.skel-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, #ffffff15, transparent);
    animation: skel 1.2s infinite;
}

@keyframes skel {
    to {
        transform: translateX(100%);
    }
}

.sets-table-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    min-width: 0;
    background: transparent;
    padding: 8px 0;
}

.sets-head-row {
    display: grid;
    grid-template-columns: 45px 1fr 90px 90px 50px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #9aa1ab;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: transparent;
    border-bottom: 1px solid #2a2b33;
    margin-bottom: 4px;
}

.set-row {
    display: grid;
    grid-template-columns: 45px 1fr 90px 90px 50px;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #18191e;
    border-radius: 12px;
    margin: 0 0 8px 0;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    z-index: 10;
}

.set-row.done {
    background: #1e3422;
    color: #92eea2;
}

.c-set {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #e9ecf1;
}

.set-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.c-prev {
    color: #babfc7;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.c-kg,
.c-reps {
    display: flex;
    justify-content: center;
}

.c-kg input,
.c-reps input {
    width: 100%;
    max-width: 80px;
    height: 40px;
    background: #15161a;
    border: 1.2px solid #252632;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    padding: 8px 4px;
    box-sizing: border-box;
    -moz-appearance: textfield;
    appearance: textfield;
}

.c-kg input:focus,
.c-reps input:focus {
    border-color: #34aadd;
    background: #191e21;
    outline: none;
}

.c-kg input::-webkit-outer-spin-button,
.c-kg input::-webkit-inner-spin-button,
.c-reps input::-webkit-outer-spin-button,
.c-reps input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.c-ok {
    display: flex;
    justify-content: center;
    align-items: center;
}

.set-ok.modern {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #23252d;
    border: 1px solid #323644;
    color: #e8eef3;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s;
}

.set-ok.modern.active {
    background: #3ddc84;
    border-color: #35c776;
    color: #0d1e13;
}

.set-row-wrap {
    position: relative;
    width: 100%;
}

.delete-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: #d23b2c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1;
}

.set-row.swipe-delete+.delete-btn {
    opacity: 1;
    pointer-events: all;
}

.set-row.swipe-delete {
    transform: translateX(-60px);
}

@media (max-width: 480px) {

    .sets-head-row,
    .set-row {
        grid-template-columns: 40px 1fr 80px 80px 45px;
        gap: 6px;
        padding: 8px 10px;
    }

    .c-kg input,
    .c-reps input {
        max-width: 70px;
        height: 36px;
        font-size: 15px;
        padding: 6px 3px;
    }

    .set-ok.modern {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 380px) {

    .sets-head-row,
    .set-row {
        grid-template-columns: 35px 1fr 70px 70px 40px;
        gap: 5px;
        padding: 6px 8px;
    }

    .sets-head-row {
        font-size: 11px;
    }

    .c-kg input,
    .c-reps input {
        max-width: 65px;
        height: 34px;
        font-size: 14px;
    }

    .c-prev {
        font-size: 13px;
    }

    .set-ok.modern {
        width: 34px;
        height: 34px;
    }
}

.set-row-wrap {
    position: relative;
    overflow: hidden;
}

.set-row-short {
    font-size: 13px;
    color: #babfc7;
    line-height: 1.4;
    padding: 2px 0;
}

.set-row-short.done {
    color: #92eea2;
}

.sets-accordion {
    overflow: hidden;
    max-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    transition: max-height 0.36s cubic-bezier(0.4, 0.2, 0, 1);
}

.exercise.expanded .sets-accordion {
    max-height: 1000px;
}

.add-set-btn {
    width: 100%;
    margin: 12px 0 4px 0;
    padding: 12px;
    background: #252632;
    border: none;
    border-radius: 10px;
    color: #36a3d1;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.add-set-btn:active {
    background: #1e1f29;
}

#app3 .sets-head-row>div,
#constructor-editor .sets-head-row>div,
#constructor-editor .sets-head-row>div {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    padding: 0 2px;
}

#app3 .sets-head-row .c-reps,
#constructor-editor .sets-head-row .c-reps {
    letter-spacing: -0.02em;
}

#app3 .c-kg input,
#constructor-editor .c-kg input,
#app3 .c-reps input,
#constructor-editor .c-reps input {
    width: 100%;
    min-width: 0;
    height: 40px;
    background: #15161a;
    border: 1.2px solid #252632;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    padding: 0 8px;
    box-sizing: border-box;
    margin: 0;
    appearance: none;
    -moz-appearance: textfield;
}

@media (max-width: 480px) {

    #app3 .c-kg input,
    #constructor-editor .c-kg input,
    #app3 .c-reps input,
    #constructor-editor .c-reps input {
        height: 36px;
        font-size: 15px;
        padding: 0 6px;
    }
}

@media (max-width: 360px) {

    #app3 .c-kg input,
    #constructor-editor .c-kg input,
    #app3 .c-reps input,
    #constructor-editor .c-reps input {
        height: 34px;
        font-size: 14px;
        padding: 0 4px;
    }
}

#app3 .c-set,
#constructor-editor .c-set {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700;
    font-size: 16px;
}

#app3 .sets-head-row,
#constructor-editor .sets-head-row,
#app3 .set-row,
#constructor-editor .set-row {
    grid-template-columns: 50px minmax(100px, 1fr) 90px 90px 50px !important;
}

@media (max-width: 480px) {

    #app3 .sets-head-row,
    #constructor-editor .sets-head-row,
    #app3 .set-row,
    #constructor-editor .set-row {
        grid-template-columns: 40px minmax(80px, 1fr) 80px 80px 45px !important;
    }
}

@media (max-width: 360px) {

    #app3 .sets-head-row,
    #constructor-editor .sets-head-row,
    #app3 .set-row,
    #constructor-editor .set-row {
        grid-template-columns: 35px minmax(70px, 1fr) 70px 70px 40px !important;
    }
}

#app3 .c-kg input:-webkit-autofill,
#constructor-editor .c-kg input:-webkit-autofill,
#app3 .c-kg input:-webkit-autofill:hover,
#constructor-editor .c-kg input:-webkit-autofill:hover,
#app3 .c-kg input:-webkit-autofill:focus,
#constructor-editor .c-kg input:-webkit-autofill:focus,
#app3 .c-reps input:-webkit-autofill,
#constructor-editor .c-reps input:-webkit-autofill,
#app3 .c-reps input:-webkit-autofill:hover,
#constructor-editor .c-reps input:-webkit-autofill:hover,
#app3 .c-reps input:-webkit-autofill:focus,
#constructor-editor .c-reps input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0px 1000px #15161a inset;
    transition: background-color 5000s ease-in-out 0s;
}

#app3 .c-kg input:focus,
#constructor-editor .c-kg input:focus,
#app3 .c-reps input:focus,
#constructor-editor .c-reps input:focus {
    border-color: #34aadd;
    background: #191e21;
    outline: none;
}

.exercise-top {
    display: flex;
    gap: 10px;
}

.profile-btns-list {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 500px;
    margin: 0 auto;
}

.card-btn {
    width: 100%;
    padding: 18px 16px;
    border: none;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s, filter 0.2s;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    text-align: left;
}

.card-btn:active {
    transform: scale(0.97);
}

.card-blue {
    background: linear-gradient(135deg, #30a7f7, #0072ff);
}

.card-green {
    background: linear-gradient(135deg, #42e695, #3bb2b8);
}

.card-orange {
    background: linear-gradient(135deg, #ff8a30, #ff5e62);
}

.card-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

.btn-ic {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-ic svg {
    width: 26px;
    height: 26px;
}

.btn-txts {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.btn-title {
    font-size: 18px;
    font-weight: 700;
}

.btn-sub {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 3px;
    font-weight: 500;
}

.btn-arrow {
    opacity: 0.7;
}

.btn-arrow svg {
    width: 22px;
    height: 22px;
}

.back-btn {
    background: #23242a;
    border: none;
    color: #fff;
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    margin: 20px 16px;
    display: block;
    width: fit-content;
}

.app-container {
    display: none;
    opacity: 0;
    transform: translateY(8px);
}

.app-container.active {
    display: block;
    animation: fadeIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.home-container {
    padding-top: 30px;
}


/* ============================================================ */
/* : �������� ���� �������� (Advanced Filters) */
/* ============================================================ */
.filter-modal-fs {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, #111215 0%, #1a1c23 100%);
    z-index: 10000;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-modal-fs.active {
    display: flex;
    opacity: 1;
}

.filter-modal-fs .filter-fs-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.filter-modal-fs .filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px 16px 20px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-modal-fs .filter-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.filter-close-btn {
    background: none;
    border: none;
    color: #babfc7;
    padding: 12px;
    margin: -8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 50%;
}

.filter-close-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.filter-close-btn svg {
    width: 28px;
    height: 28px;
}

.filter-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
}

.filter-section {
    margin-bottom: 32px;
}

.filter-section-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-badge {
    font-size: 12px;
    color: #8e94a0;
    background: #1e1f24;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: normal;
}

/* ����� ���� (�������) */
.body-parts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    justify-content: center;
}

.muscle-svg-wrapper {
    position: relative;
    width: 100%;
    height: 110px;
    cursor: pointer;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-top: 15px;
    box-sizing: border-box;
    background: #1a1b20;
    transition: all 0.2s ease;
    flex-direction: column;
    color: #8e94a0;
    border: 1px solid transparent;
}

.muscle-svg-wrapper:active {
    background: #222328;
}

.muscle-svg-wrapper svg {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.muscle-svg-wrapper svg polygon {
    fill: #ffffff;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.muscle-svg-wrapper svg image {
    opacity: 0.8;
    transition: all 0.3s ease;
}

.muscle-svg-wrapper .muscle-label {
    font-size: 13px;
    color: currentColor;
    margin-top: 4px;
    text-align: center;
    line-height: 1.2;
    padding: 0 4px;
}

/*  SVG */




.muscle-svg-wrapper.selected {
    background: #1a1b20;
    color: #34aadd;
    border: 1px solid rgba(52, 170, 221, 0.6);
}

.muscle-svg-wrapper.selected svg polygon {
    fill: #34aadd;
    opacity: 1;
}

.muscle-svg-wrapper.selected svg image {
    opacity: 1;
}

.muscle-svg-wrapper.selected .muscle-label {
    color: #34aadd;
}

/* ����������� */
.equipment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.equipment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: #16171b;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.equipment-item:active {
    background: #1e1f24;
    transform: scale(0.98);
}

.equipment-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.equipment-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #888;
    transition: color 0.2s ease;
}

.equipment-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #2a2b30;
    -webkit-mask-image: url('images/bg.svg');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url('images/bg.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    transition: all 0.2s ease;
    z-index: 0;
}

.equipment-icon svg,
.equipment-icon img {
    width: 40px !important;
    height: 40px !important;
    position: relative;
    z-index: 1;
}

.equipment-item.selected .equipment-icon {
    color: #fff;
}

.equipment-item.selected .equipment-icon::before {
    background-color: #34aadd;
}

.equipment-name {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

/* �������� Checkbox ��� ����������� */
.equipment-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1.5px solid #4a4b50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.equipment-item.selected .equipment-checkbox {
    background: #34aadd;
    border-color: #34aadd;
}

.equipment-item.selected .equipment-checkbox::after {
    content: '';
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* Action Footer */
.filter-footer {
    display: flex;
    align-items: center;
    padding: 20px 20px 28px 20px;
    background: #16171b;
    border-top: 1px solid #2a2b30;
    gap: 16px;
}

.filter-reset-btn {
    background: transparent;
    border: none;
    color: #babfc7;
    font-size: 16px;
    font-weight: 500;
    padding: 16px 4px;
    cursor: pointer;
}

.filter-apply-btn {
    flex: 1;
    background: #e8e8e8;
    color: #000;
    border: none;
    border-radius: 28px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-apply-btn:active {
    background: #d0d0d0;
}

/* ============================================================ */
/* : �������� ���� �������� (Advanced Filters) */
/* ============================================================ */

/* Primary Action Button Overrides */
.add-exercises-btn {
    width: 100%;
    background: linear-gradient(135deg, #36a3d1 0%, #1e87b2 100%) !important;
    color: #fff !important;
    border: none !important;
    padding: 18px !important;
    border-radius: 18px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 24px rgba(54, 163, 209, 0.25) !important;
}

.add-exercises-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 32px rgba(54, 163, 209, 0.35) !important;
    background: linear-gradient(135deg, #3baee0 0%, #2095c4 100%) !important;
}

.add-exercises-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 16px rgba(54, 163, 209, 0.2) !important;
}

.filter-apply-btn {
    flex: 1;
    background: linear-gradient(135deg, #36a3d1 0%, #1e87b2 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 28px !important;
    padding: 16px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 24px rgba(54, 163, 209, 0.25) !important;
}

.filter-apply-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 24px rgba(54, 163, 209, 0.35) !important;
}

.filter-apply-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 12px rgba(54, 163, 209, 0.2) !important;
}

.c-set,
.set-num {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

body.trainer-mode #btnOpenSelection,
body.trainer-mode #btnMyPrograms {
    display: none !important;
}

html,
body {
    background: #0b0b10;
}

.home-container {
    padding-top: 0;
}

.home-header {
    padding: 44px 20px 24px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.home-title {
    font-size: 30px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
}

#homePage .profile-btns-list {
    padding: 0 16px 32px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

#homePage .card-btn {
    width: 100%;
    padding: 17px 16px 17px 20px;
    border: none;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.2s;
    text-align: left;

    background: rgba(18, 18, 26, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);

    box-shadow: none;
}

#homePage .card-btn::after {
    display: none;
}

#homePage .card-btn::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12%;
    bottom: 12%;
    width: 3px;
    border-radius: 0 3px 3px 0;
}

#homePage .card-btn:active {
    transform: scale(0.97);
}

#homePage .card-blue {
    box-shadow: 0 4px 24px rgba(0, 140, 255, 0.07), inset 0 0 0 1px rgba(0, 180, 255, 0.09);
}

#homePage .card-blue::before {
    background: linear-gradient(180deg, #00c2ff, #0066ff);
    box-shadow: 0 0 10px 2px rgba(0, 180, 255, 0.65);
}

#homePage .card-blue .btn-ic {
    background: rgba(0, 180, 255, 0.11);
    color: #30b8ff;
    box-shadow: 0 0 14px rgba(0, 180, 255, 0.22);
    border-radius: 14px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#homePage .card-green {
    box-shadow: 0 4px 24px rgba(56, 239, 125, 0.06), inset 0 0 0 1px rgba(56, 239, 125, 0.09);
}

#homePage .card-green::before {
    background: linear-gradient(180deg, #38ef7d, #11998e);
    box-shadow: 0 0 10px 2px rgba(56, 239, 125, 0.6);
}

#homePage .card-green .btn-ic {
    background: rgba(56, 239, 125, 0.10);
    color: #38ef7d;
    box-shadow: 0 0 14px rgba(56, 239, 125, 0.18);
    border-radius: 14px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#homePage .card-orange {
    box-shadow: 0 4px 24px rgba(255, 130, 40, 0.07), inset 0 0 0 1px rgba(255, 160, 50, 0.09);
}

#homePage .card-orange::before {
    background: linear-gradient(180deg, #ffa020, #ff5c00);
    box-shadow: 0 0 10px 2px rgba(255, 150, 30, 0.6);
}

#homePage .card-orange .btn-ic {
    background: rgba(255, 140, 30, 0.10);
    color: #ff9f30;
    box-shadow: 0 0 14px rgba(255, 140, 30, 0.18);
    border-radius: 14px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#homePage .card-purple {
    box-shadow: 0 4px 24px rgba(130, 60, 255, 0.09), inset 0 0 0 1px rgba(160, 80, 255, 0.11);
}

#homePage .card-purple::before {
    background: linear-gradient(180deg, #b44fff, #6200ea);
    box-shadow: 0 0 10px 2px rgba(160, 60, 255, 0.6);
}

#homePage .card-purple .btn-ic {
    background: rgba(140, 60, 255, 0.11);
    color: #c060ff;
    box-shadow: 0 0 14px rgba(140, 60, 255, 0.22);
    border-radius: 14px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#homePage .btn-ic svg {
    width: 26px;
    height: 26px;
}

#homePage .btn-title {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
}

#homePage .btn-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.42);
    margin-top: 3px;
    font-weight: 400;
    opacity: 1;
}

#homePage .btn-arrow {
    opacity: 1;
    color: rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
}

#homePage .btn-arrow svg {
    width: 20px;
    height: 20px;
}

body.trainer-mode #btnOpenSelection,
body.trainer-mode #btnMyPrograms {
    display: none !important;
}

#app1 .main-container {
    background: #0b0b10;
}

#app1 .title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    margin: 36px 0 24px 0;
}

#app1 .label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.38);
    margin-bottom: 10px;
}

#app1 .option-btn {
    background: rgba(18, 18, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    padding: 13px 14px;
    transition: all 0.15s;
    box-shadow: none;
}

#app1 .option-btn:active {
    transform: scale(0.97);
    background: rgba(30, 30, 45, 0.95);
}

#app1 .option-btn.active,
#app1 .option-btn.selected {
    background: rgba(14, 60, 120, 0.55);
    border-color: rgba(0, 180, 255, 0.5);
    color: #fff;
    box-shadow:
        0 0 0 1px rgba(0, 180, 255, 0.3),
        inset 0 0 14px rgba(0, 140, 255, 0.08);
    transform: none;
}

#app1 .block {
    margin-bottom: 24px;
}

#app1 .main-btn {
    margin-top: 32px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #0099ff, #0055cc);
    box-shadow: 0 4px 20px rgba(0, 120, 255, 0.25);
    transition: opacity 0.15s, box-shadow 0.15s;
}

#app1 .main-btn:not(:disabled):active {
    opacity: 0.85;
    box-shadow: 0 2px 10px rgba(0, 120, 255, 0.18);
}

#app1 .main-btn:disabled {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

#app1 .loader {
    border-color: rgba(0, 180, 255, 0.25);
    border-top-color: #00c2ff;
    box-shadow: 0 0 16px rgba(0, 180, 255, 0.15);
}

#app1 .loader-text {
    color: rgba(255, 255, 255, 0.45);
    font-size: 15px;
    margin-top: 16px;
}

#app1 .program-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#app1 .program-card {
    background: rgba(18, 18, 26, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    padding: 14px;
    gap: 14px;
    transition: transform 0.15s;
}

#app1 .program-card:active {
    transform: scale(0.975);
    background: rgba(22, 22, 34, 0.95);
}

#app1 .program-img {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #1a1a24;
}

#app1 .program-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

#app1 .program-desc-short {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.45;
}

#programModal {
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

#programModalContent {
    background: #0f0f16 !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 24px 20px 40px 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5) !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

#programModalContent::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 0 auto 20px auto;
}

#programModalContent .modal-img {
    width: 100% !important;
    max-width: 100% !important;
    height: 250px !important;
    object-fit: cover !important;
    border-radius: 16px !important;
    margin-bottom: 16px !important;
}

#programModalContent .modal-title {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #fff !important;
    text-align: left !important;
    margin-bottom: 10px !important;
    line-height: 1.3 !important;
}

#programModalContent .modal-desc {
    font-size: 14px !important;
    color: #fff !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
    text-align: left !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}

#programModalContent .modal-desc p {
    margin: 0 0 8px 0 !important;
}

#programModalContent .modal-desc ul,
#programModalContent .modal-desc ol {
    padding-left: 18px !important;
    margin: 6px 0 10px 0 !important;
}

#programModalContent .main-btn {
    margin-top: 20px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #0099ff, #0055cc) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 20px rgba(0, 120, 255, 0.25) !important;
}

#programModalContent .cancel-btn {
    margin-top: 10px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 15px !important;
}

/* Exercise thumbnail strip */
#programModalContent .modal-ex-strip {
    margin: 4px 0 16px 0 !important;
}

#programModalContent .modal-ex-strip-title {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.35) !important;
    margin-bottom: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
}

#programModalContent .modal-ex-thumb {
    border-radius: 10px !important;
    background: #1a1a24 !important;
}

#paywallModal {
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

.paywall-content {
    background: #0f0f16 !important;
    border-radius: 24px 24px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5) !important;
    padding: 28px 20px 40px 20px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.paywall-content::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 0 auto 20px auto;
}

.paywall-title {
    font-size: 22px !important;
    font-weight: 800 !important;
    text-align: left !important;
    margin-bottom: 14px !important;
}

.paywall-features {
    font-size: 15px !important;
    margin-bottom: 18px !important;
}

.paywall-plan {
    background: rgba(18, 18, 26, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-radius: 14px !important;
    transition: border-color 0.15s !important;
}

.paywall-plan.selected {
    border-color: rgba(0, 180, 255, 0.5) !important;
    background: rgba(14, 60, 120, 0.35) !important;
    box-shadow: 0 0 0 1px rgba(0, 180, 255, 0.2) !important;
}

.paywall-content .main-btn {
    border-radius: 14px !important;
    background: linear-gradient(135deg, #0099ff, #0055cc) !important;
    box-shadow: 0 4px 20px rgba(0, 120, 255, 0.25) !important;
}

.paywall-content .cancel-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    border-radius: 12px !important;
}

.promo-input {
    background: rgba(18, 18, 26, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
}

.promo-btn {
    border-color: rgba(0, 180, 255, 0.4) !important;
    color: #30b8ff !important;
    border-radius: 12px !important;
}

#app1 .back-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    font-size: 14px;
    padding: 10px 16px;
    margin: 16px 16px 8px 16px;
}

.card-gold {
    box-shadow: 0 4px 24px rgba(255, 190, 40, 0.09), inset 0 0 0 1px rgba(255, 200, 60, 0.12);
}

.card-gold::before {
    background: linear-gradient(180deg, #ffd700, #ff9500);
    box-shadow: 0 0 10px 2px rgba(255, 190, 40, 0.6);
}

.card-gold .btn-ic {
    background: rgba(255, 190, 40, 0.12);
    color: #ffd700;
    box-shadow: 0 0 14px rgba(255, 190, 40, 0.25);
}

.card-gold:active {
    box-shadow: 0 4px 24px rgba(255, 190, 40, 0.2), inset 0 0 0 1px rgba(255, 200, 60, 0.2);
}

#programModalContent .modal-desc,
#programModalContent .modal-desc p,
#programModalContent .modal-desc li,
#programModalContent .modal-desc span {
    color: #fff !important;
}

#app2 .exercise-list-row:hover {
    background: #1c1d23;
    border-radius: 12px;
}

#app2 .play-workout-btn {
    transition: background 0.18s, transform 0.1s;
}

#app2 .play-workout-btn:active {
    background: #2b93c2 !important;
    transform: scale(0.94);
}


.modal-ex-desc .modal-content {
    padding: 34px 24px 26px 24px !important;
    max-width: 420px;
    width: calc(100% - 48px) !important;
    margin: 42px auto 18px auto !important;
}

.modal-ex-desc .modal-header {
    position: static;
    background: #18191e;
    z-index: 100;
    padding: 0 6px 18px 6px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.play-workout-btn,
.main-btn.workout-start {
    background: rgba(54, 163, 209, 0.15) !important;
    color: #36a3d1 !important;
    border: 1px solid rgba(54, 163, 209, 0.3) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 14px 20px !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.play-workout-btn:active,
.main-btn.workout-start:active {
    background: rgba(54, 163, 209, 0.25) !important;
    transform: scale(0.98) !important;
}

#app2 .program-active-btn {
    display: none !important;
}

#app2 .program-card {
    padding: 16px !important;
}

.main-btn {
    background: linear-gradient(135deg, #36a3d1 0%, #1e87b2 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 16px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 16px 24px !important;
    box-shadow: 0 4px 20px rgba(54, 163, 209, 0.25) !important;
    transition: all 0.2s ease !important;
}

.main-btn:active {
    transform: scale(0.98) !important;
    box-shadow: 0 2px 10px rgba(54, 163, 209, 0.15) !important;
}

.modal-desc {
    padding: 0 8px !important;
    line-height: 1.6 !important;
}

.modal-desc p,
.modal-desc ul,
.modal-desc ol {
    margin: 0 0 12px 0 !important;
    padding: 0 4px !important;
}

@media (max-width: 480px) {
    .modal-ex-desc .modal-content {
        padding: 28px 16px 20px 16px !important;
        width: calc(100% - 32px) !important;
    }

    .play-workout-btn,
    .main-btn.workout-start {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
}

.modal-ex-desc {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(10, 12, 15, 0.97);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.modal-ex-desc .modal-content {
    background: #18191e;
    border-radius: 20px;
    padding: 0;
    max-width: 420px;
    width: 96vw;
    margin: 42px auto 18px auto;
    box-shadow: 0 6px 32px #0007;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-ex-desc .modal-header {
    position: static;
    background: #18191e;
    z-index: 100;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.modal-ex-desc .modal-desc {
    padding: 24px 20px 26px 20px;
    font-size: 15.5px;
    color: #e0e0e2;
    line-height: 1.55;
    overflow-y: auto;
}

#programModal {
    align-items: flex-start !important;
    overflow-y: auto !important;
    padding-top: 0 !important;
}

#programModalContent {
    border-radius: 24px !important;
    margin: 24px auto !important;
    width: calc(100% - 32px) !important;
    max-width: 480px !important;
    max-height: none !important;
    overflow-y: visible !important;
}

#programModalContent::before {
    display: none !important;
}

#helpModal.modal-ex-desc {
    overflow-y: auto !important;
}

#helpModal .modal-content {
    text-align: left !important;
    align-items: flex-start !important;
    max-height: none !important;
    overflow: visible !important;
    margin-top: 0 !important;
    width: 100% !important;
    max-width: 600px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#helpModal .modal-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: #18191e !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
}

#helpModal .modal-title {
    text-align: center !important;
}

#helpModal .help-body {
    text-align: left !important;
    align-items: flex-start !important;
    width: 100% !important;
    padding: 16px 16px 48px !important;
    box-sizing: border-box !important;
}

#helpModal .help-tip,
#helpModal .help-list,
#helpModal .warmup-toggle,
#helpModal .warmup-content {
    text-align: left !important;
}

#helpModal .help-ok-btn {
    width: calc(100% - 32px) !important;
    margin: 16px 16px 32px !important;
    display: block !important;
}

#programModal {
    align-items: flex-start !important;
    overflow-y: auto !important;
}

#programModal #programModalContent {
    border-radius: 20px !important;
    margin: 20px auto !important;
    width: calc(100% - 32px) !important;
    max-width: 480px !important;
    max-height: none !important;
    overflow-y: visible !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5) !important;
}

#programModal #programModalContent::before {
    display: none !important;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 30px;
}

.desc-card {
    overflow-y: visible !important;
    max-height: none !important;
    flex: none !important;
}

.desc-card__text {
    overflow-y: visible !important;
    max-height: none !important;
}

/* ============================================================ */
/* EXERCISE DESCRIPTION MODAL — MOBILE FIX                       */
/* ============================================================ */

/*
 * OVERLAY base: layout only — NO display here.
 * display is controlled by .hidden / :not(.hidden) below.
 */
#exerciseModal {
    position: fixed !important;
    inset: 0 !important;
    overflow: hidden !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    z-index: 9999 !important;
    background: rgba(10, 12, 15, 0.97) !important;
}

/* Only show (display:flex) when NOT hidden */
#exerciseModal.modal-ex-desc:not(.hidden) {
    display: flex !important;
}

/*
 * CARD: flex column.
 * max-height: 100% means "up to overlay height minus its padding".
 * overflow: hidden keeps the card from bulging; only body-scroll scrolls.
 */
#exerciseModal #modalContent {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    /* Explicit height so flex children (body-scroll) can size themselves */
    height: calc(100dvh - 32px) !important;
    max-height: calc(100dvh - 32px) !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 480px !important;
    border-radius: 20px !important;
    box-sizing: border-box !important;
    background: #18191e !important;
    box-shadow: 0 6px 32px #0007 !important;
}

/* HEADER: never scrolls, anchored to top of card */
#exerciseModal .modal-header {
    position: static !important;
    flex: 0 0 auto !important;
    z-index: 200 !important;
    background: #18191e !important;
    padding: 12px 16px !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

/*
 * SCROLLABLE BODY: takes all remaining card height.
 * min-height: 0 is CRITICAL — without it a flex child won't shrink
 * below its content size, breaking the scroll container.
 */
#exerciseModal .modal-body-scroll {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    padding: 14px 16px 40px 16px !important;
    box-sizing: border-box !important;
}

#exerciseModal #modalDesc {
    overflow-y: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* VIDEO — landscape: 16:9, max 75% wide so it doesn't dominate */
#exerciseModal .modal-video-wrap {
    max-width: 100% !important;
    margin: 0 auto 18px auto !important;
}

#exerciseModal .modal-video-wrap.video-landscape {
    aspect-ratio: 16 / 9 !important;
    max-width: 75% !important;
}

/* VIDEO — portrait/square: square ratio, constrained width */
#exerciseModal .modal-video-wrap.video-portrait {
    aspect-ratio: 1 / 1 !important;
    max-width: min(75%, 280px) !important;
}

/* ============================================================ */
/* Incomplete Sets Warning Modal                                 */
/* ============================================================ */

.incomplete-sets-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

.incomplete-sets-overlay.hidden {
    display: none !important;
}

.incomplete-sets-card {
    background: #1e1f25;
    border-radius: 20px;
    padding: 32px 24px 24px 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    animation: modalSlideUp 0.25s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.incomplete-sets-icon {
    font-size: 40px;
    margin-bottom: 16px;
    line-height: 1;
}

.incomplete-sets-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.incomplete-sets-text {
    font-size: 15px;
    color: #9a9ba3;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.incomplete-sets-btns {
    display: flex;
    gap: 10px;
}

.incomplete-sets-btn {
    flex: 1;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.15s ease;
}

.incomplete-sets-btn:active {
    transform: scale(0.97);
}

.incomplete-sets-cancel {
    background: #2a2b33;
    color: #e0e0e2;
}

.incomplete-sets-cancel:active {
    background: #333440;
}

.incomplete-sets-confirm {
    background: #ff453a;
    color: #fff;
    box-shadow: 0 4px 16px rgba(255, 69, 58, 0.25);
}

.incomplete-sets-confirm:active {
    background: #e03e34;
}

.floating-history-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    touch-action: none;
    
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    color: #fff;
    padding: 14px 20px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-history-btn:active {
    cursor: grabbing;
}

/* ============================================================
   WORKOUT MINIMIZE BUTTON (top-left in app3 header)
   ============================================================ */
.wk-minimize-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.18s, transform 0.15s;
}

.wk-minimize-btn:active {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(0.91);
}

.wk-minimize-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}

/* ============================================================
   WORKOUT MINI BAR (floating bottom bar when minimized)
   ============================================================ */
.workout-minibar {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    left: 12px;
    right: 12px;
    z-index: 9999;
    border-radius: 20px;
    background: linear-gradient(135deg, #1a1d25 0%, #1e2130 100%);
    border: 1px solid rgba(54, 163, 209, 0.28);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 4px 12px rgba(54, 163, 209, 0.12);
    transform: translateY(0);
    transition: transform 0.35s cubic-bezier(.22, .8, .36, 1),
                opacity  0.3s ease;
    will-change: transform;
}

.workout-minibar.hidden {
    display: none;
}

/* Slide-in animation when minibar appears */
@keyframes minibar-in {
    from { transform: translateY(120%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.workout-minibar:not(.hidden) {
    animation: minibar-in 0.38s cubic-bezier(.22, .8, .36, 1) both;
}

.minibar-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 13px 14px 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border-radius: 20px;
    transition: background 0.15s;
}

.minibar-body:active {
    background: rgba(255, 255, 255, 0.04);
}

/* Top row: dot + title + timer */
.minibar-top-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

/* Animated pulse dot */
.minibar-pulse {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #36a3d1;
    position: relative;
}

.minibar-pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid #36a3d1;
    opacity: 0;
    animation: pulse-ring 1.8s ease-out infinite;
}

@keyframes pulse-ring {
    0%   { transform: scale(0.8); opacity: 0.7; }
    70%  { transform: scale(1.6); opacity: 0;   }
    100% { transform: scale(1.6); opacity: 0;   }
}

.minibar-label {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #e0e6f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.minibar-timer {
    font-size: 13px;
    color: #36a3d1;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* Bottom row: action buttons side by side */
.minibar-actions {
    display: flex;
    gap: 8px;
}

.minibar-btn {
    flex: 1;
    padding: 9px 0;
    border-radius: 12px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.13s, opacity 0.13s;
}

.minibar-btn:active {
    transform: scale(0.93);
    opacity: 0.85;
}

.minibar-continue {
    background: #36a3d1;
    color: #fff;
}

.minibar-cancel {
    background: rgba(255, 68, 68, 0.13);
    color: #ff6b6b;
    border: 1px solid rgba(255, 68, 68, 0.22);
}

/* When minibar is visible, add bottom padding so page content is not hidden */
body.has-minibar .app-container {
    padding-bottom: 100px;
}

/* additionals */

#exerciseModal.modal-ex-desc:not(.hidden) {
    display: flex !important;
}

#exerciseModal.modal-ex-desc {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
}

#exerciseModal #modalContent {
    display: block !important;
    width: 100% !important;
    max-width: 480px !important;
    height: auto !important; 
    max-height: calc(100dvh - 32px) !important;
    overflow-y: auto !important; 
    padding: 0 !important;
    background: #18191e !important;
    border-radius: 20px !important;
}

#exerciseModal .modal-header {
    position: static !important;
    padding: 16px !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#exerciseModal .modal-body-scroll {
    overflow: visible !important;
    height: auto !important;
    padding: 16px 16px 40px 16px !important;
}


#exerciseModal .modal-video-wrap {
    aspect-ratio: 1 / 1; 
    width: 100%;
}

#exerciseModal .modal-video-wrap {
    transition: aspect-ratio 0.3s ease, max-width 0.3s ease, width 0.3s ease !important;
}

#exerciseModal .modal-video-wrap,
#exerciseModal .modal-video-wrap.video-landscape,
#exerciseModal .modal-video-wrap.video-portrait {
    width: 100% !important;
    max-width: 95% !important;   
    aspect-ratio: 16 / 9 !important; 
    margin: 0 auto 16px auto !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

#exerciseModal .modal-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; 
    background: transparent !important;
}
/* ============================================================
   ПОДБОР ТРЕНИРОВОК — новый дизайн (BazaFit style)
   ============================================================ */

.sel-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 24px 0 6px 0;
    letter-spacing: -0.02em;
    color: #fff;
}

.sel-subtitle {
    color: #8a8f9a;
    font-size: 0.97rem;
    margin: 0 0 22px 0;
    line-height: 1.4;
}

.sel-block {
    margin-bottom: 22px;
}

/* Section header row with optional note */
.sel-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: #8a8f9a;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.sel-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sel-label-row .sel-label {
    margin-bottom: 0;
}

.sel-label-note {
    font-size: 0.72rem;
    color: #8a8f9a;
    font-weight: 500;
}

/* Button grid container */
.sel-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sel-group-2col {
    grid-template-columns: repeat(2, 1fr);
}

.sel-group-3col {
    grid-template-columns: repeat(3, 1fr);
}

/* Base button */
.sel-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    background: #1c1d24;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    padding: 12px 10px 12px 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    min-height: 70px;
}

/* 2-column buttons are bigger */
.sel-group-2col .sel-btn {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    font-size: 0.92rem;
    padding: 14px 14px;
}

.sel-btn:active {
    transform: scale(0.97);
}

/* Emoji icon */
.sel-btn-emoji {
    font-size: 1.35rem;
    line-height: 1;
    display: block;
    flex-shrink: 0;
}

.sel-group-2col .sel-btn-emoji {
    font-size: 1.5rem;
}

/* Small badge label e.g. "АКЦЕНТ" */
.sel-btn-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #a259ff;
    background: rgba(162, 89, 255, 0.12);
    border-radius: 5px;
    padding: 2px 5px;
}

/* ── Active / selected state ── */
.sel-btn.active {
    border-color: #36a3d1;
    background: rgba(54, 163, 209, 0.18);
    box-shadow: 0 0 0 0px #36a3d140;
}

/* Accent-coloured active highlights */
.sel-btn.sel-accent-red.active    { border-color: #ff453a; background: rgba(255, 69, 58, 0.16); }
.sel-btn.sel-accent-orange.active { border-color: #f5a623; background: rgba(245, 166, 35, 0.16); }
.sel-btn.sel-accent-green.active  { border-color: #4cd964; background: rgba(76, 217, 100, 0.16); }
.sel-btn.sel-accent-blue.active   { border-color: #36a3d1; background: rgba(54, 163, 209, 0.18); }
.sel-btn.sel-accent-yellow.active { border-color: #f5c518; background: rgba(245, 197, 24, 0.15); }
.sel-btn.sel-accent-purple.active { border-color: #a259ff; background: rgba(162, 89, 255, 0.16); }
.sel-btn.sel-accent-cyan.active   { border-color: #00c4b5; background: rgba(0, 196, 181, 0.16); }

/* Colour accent bar on left edge when active */
.sel-btn.sel-accent-red.active::before    { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #ff453a; border-radius: 14px 0 0 14px; }
.sel-btn.sel-accent-orange.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #f5a623; border-radius: 14px 0 0 14px; }
.sel-btn.sel-accent-green.active::before  { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #4cd964; border-radius: 14px 0 0 14px; }
.sel-btn.sel-accent-blue.active::before   { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #36a3d1; border-radius: 14px 0 0 14px; }
.sel-btn.sel-accent-yellow.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #f5c518; border-radius: 14px 0 0 14px; }
.sel-btn.sel-accent-purple.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #a259ff; border-radius: 14px 0 0 14px; }
.sel-btn.sel-accent-cyan.active::before   { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #00c4b5; border-radius: 14px 0 0 14px; }

/* Hint text under groups */
.sel-hint {
    margin-top: 8px;
    color: #8a8f9a;
    font-size: 0.78rem;
    line-height: 1.4;
}

/* Info tip box */
.sel-tip-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #1c1d24;
    border: 1.5px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 14px 16px;
    margin: 18px 0 20px 0;
    color: #c0c5d0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.sel-tip-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Main gradient CTA button */
.sel-main-btn {
    width: 100%;
    background: linear-gradient(90deg, #7b5cf0 0%, #36a3d1 100%);
    color: #fff;
    font-size: 1.08rem;
    font-weight: 700;
    padding: 18px 0;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(123, 92, 240, 0.35);
    transition: opacity 0.15s, transform 0.1s;
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
    margin-bottom: 10px;
}

.sel-main-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.sel-main-btn:not(:disabled):active {
    transform: scale(0.98);
}

.sel-secondary-btn {
    width: 100%;
    background: #1c1d24;
    color: #c0c5d0;
    font-size: 1rem;
    font-weight: 600;
    padding: 16px 0;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
    margin-bottom: 28px;
}

.sel-secondary-btn:active {
    background: #26272f;
}

#goalGroup {
    grid-template-columns: repeat(6, 1fr);
}

#goalGroup .sel-btn {
    grid-column: span 2;   
}

#goalGroup .sel-btn:nth-child(4),
#goalGroup .sel-btn:nth-child(5) {
    grid-column: span 3;  
}

.sel-btn span:not(.sel-btn-emoji):not(.sel-btn-badge) {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
}

.sel-group-2col .sel-btn {
    flex-direction: row;
    align-items: center;
}

.workout-exercise-notes {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: #babfc7;
    font-family: inherit;
    font-size: 1.05rem;
    line-height: 1.5;
    min-height: 36px;
    padding: 0 16px 12px;
    margin: 0;
}

.workout-exercise-notes::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

@keyframes playerSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fake-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    z-index: 999999 !important;
    background: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    aspect-ratio: auto !important;
    animation: playerSlideUp 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.fake-fullscreen .modal-video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
}

.fake-fullscreen ~ .modal-header {
    display: none !important;
}

.fake-fullscreen .modal-fullscreen-btn {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    background: rgba(30, 32, 40, 0.75) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 9px !important;
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 1000000 !important;
}

.fake-fullscreen .modal-fullscreen-btn svg {
    width: 20px !important;
    height: 20px !important;
}

/* Rest Timer Styles */
.workout-rest-timer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    color: #34aadd;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 12px;
    background: rgba(52,170,221,0.05);
    border-radius: 8px;
}

.tabata-view {
    width: 100%;
    max-width: min(560px, calc(100vw - 12px));
    height: calc(100dvh - 150px);
    max-height: calc(100dvh - 150px);
    box-sizing: border-box;
    padding: 0 clamp(6px, 2dvh, 16px) 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    color: #fff;
    overflow-y: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tabata-view::-webkit-scrollbar {
    display: none;
}

.tabata-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.tabata-kicker {
    color: #34aadd;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.tabata-title {
    margin-top: 4px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
}

.tabata-summary {
    flex: 0 0 auto;
    color: #babfc7;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    padding-top: 3px;
}

.tabata-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tabata-setting-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #181920;
    border: 1px solid #252632;
}

.tabata-setting-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34aadd;
    background: rgba(52, 170, 221, 0.06);
}

.tabata-setting-icon svg {
    width: 21px;
    height: 21px;
}

.tabata-setting-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 12px;
}

.tabata-setting-label {
    min-width: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.tabata-stepper {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 34px 48px 34px;
    align-items: center;
    gap: 7px;
}

.tabata-step-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #252632;
    color: #34aadd;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.tabata-step-btn:active {
    transform: scale(0.94);
}

.tabata-setting-value {
    background: transparent;
    border: none;
    outline: none;
    text-align: center;
    width: 100%;
    height: 34px;
    padding: 0;
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}

.tabata-setting-value::-webkit-outer-spin-button,
.tabata-setting-value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tabata-active {
    flex-direction: column;
    flex: 1;
    gap: clamp(14px, 2dvh, 22px);
    min-height: 0;
}

.tabata-active-card {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: clamp(16px, 2.8dvh, 28px) clamp(6px, 1.4dvh, 12px) clamp(16px, 2.6dvh, 26px);
    border-radius: 14px;
    background: #181920;
    border: 1px solid #252632;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.tabata-view[data-phase="prep"] .tabata-active-card {
    border-color: rgba(245, 166, 35, 0.48);
    box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.1), 0 10px 28px rgba(245, 166, 35, 0.1);
}

.tabata-view[data-phase="work"] .tabata-active-card {
    border-color: rgba(52, 170, 221, 0.5);
    box-shadow: inset 0 0 0 1px rgba(52, 170, 221, 0.12), 0 10px 28px rgba(52, 170, 221, 0.12);
}

.tabata-view[data-phase="rest"] .tabata-active-card {
    border-color: rgba(66, 230, 149, 0.46);
    box-shadow: inset 0 0 0 1px rgba(66, 230, 149, 0.1), 0 10px 28px rgba(66, 230, 149, 0.1);
}

.tabata-active-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #babfc7;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

#tabataPhaseName {
    color: #fff;
    font-size: clamp(46px, 6.2dvh, 78px);
    font-weight: 800;
    line-height: 1;
}

.tabata-view[data-phase="prep"] #tabataPhaseName,
.tabata-view[data-phase="prep"] .tabata-time {
    color: #f5a623;
}

.tabata-view[data-phase="work"] #tabataPhaseName,
.tabata-view[data-phase="work"] .tabata-time {
    color: #34aadd;
}

.tabata-view[data-phase="rest"] #tabataPhaseName,
.tabata-view[data-phase="rest"] .tabata-time {
    color: #42e695;
}

#tabataActiveMeta {
    text-align: center;
}

.tabata-time {
    max-width: 100%;
    margin: clamp(20px, 3.2dvh, 34px) 0 clamp(18px, 2.8dvh, 30px);
    padding-bottom: clamp(6px, 1dvh, 12px);
    color: #fff;
    font-size: clamp(180px, min(32dvh, 54vw), 330px);
    font-weight: 800;
    line-height: 0.9;
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: visible;
}

.tabata-time[data-digits="3"] {
    font-size: clamp(142px, min(29dvh, 42vw), 250px);
}

.tabata-progress-track {
    height: clamp(6px, 1dvh, 10px);
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.tabata-progress-fill {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    transition: width 1s linear, background 0.2s;
}

.tabata-upcoming-list {
    flex: 0 0 clamp(178px, 24dvh, 250px);
    min-height: clamp(178px, 24dvh, 250px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #252632;
    background: #181920;
}

.tabata-upcoming-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 54px;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    color: #babfc7;
    border-top: 1px solid #252632;
    font-size: 14px;
    font-weight: 600;
}

.tabata-upcoming-item:first-child {
    border-top: none;
}

.tabata-upcoming-item.active {
    color: #fff;
    background: rgba(52, 170, 221, 0.08);
}

.tabata-upcoming-item[data-phase="prep"].active {
    background: rgba(245, 166, 35, 0.08);
}

.tabata-upcoming-item[data-phase="work"].active {
    background: rgba(52, 170, 221, 0.08);
}

.tabata-upcoming-item[data-phase="rest"].active {
    background: rgba(66, 230, 149, 0.08);
}

.tabata-upcoming-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tabata-upcoming-time {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.tabata-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 14px;
}

.tabata-primary-btn,
.tabata-secondary-btn,
.tabata-icon-btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 24px;
    padding: 0 28px;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.tabata-primary-btn {
    min-width: 112px;
    flex: 1 1 132px;
    background: #36a3d1;
}

.tabata-primary-btn.is-paused {
    background: #252632;
    color: #34aadd;
}

.tabata-secondary-btn {
    min-width: 84px;
    flex: 0 1 96px;
    background: #252632;
    color: #d7dbe2;
    padding: 0 14px;
}

.tabata-icon-btn {
    flex: 0 0 46px;
    width: 46px;
    padding: 0;
    background: #252632;
    color: #34aadd;
}

.tabata-icon-btn svg {
    width: 23px;
    height: 23px;
}

.tabata-lock-closed {
    display: none;
}

.tabata-icon-btn.is-locked {
    background: #36a3d1;
    color: #fff;
}

.tabata-icon-btn.is-locked .tabata-lock-open {
    display: none;
}

.tabata-icon-btn.is-locked .tabata-lock-closed {
    display: block;
}

#fullScreenTimerModal.tabata-locked {
    touch-action: none;
}

#fullScreenTimerModal.tabata-locked button:not(#btnFsTabataLock) {
    pointer-events: none;
    opacity: 0.45;
}

.tabata-view.is-locked {
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
}

.tabata-view.is-locked .tabata-upcoming-list {
    pointer-events: none;
    opacity: 0.72;
}

.tabata-view.is-locked .tabata-active-card {
    cursor: default;
}

@media (max-width: 390px) {
    .tabata-view {
        padding-inline: 12px;
    }

    .tabata-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .tabata-summary {
        text-align: left;
    }

    .tabata-setting-body {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .tabata-stepper {
        width: 100%;
        grid-template-columns: 34px minmax(48px, 1fr) 34px;
    }

    #tabataPhaseName {
        font-size: clamp(40px, 5.4dvh, 58px);
    }

    .tabata-time {
        font-size: clamp(168px, min(28dvh, 54vw), 230px);
    }

    .tabata-time[data-digits="3"] {
        font-size: clamp(124px, min(25dvh, 40vw), 176px);
    }

    .tabata-actions {
        gap: 6px;
    }

    .tabata-primary-btn,
    .tabata-secondary-btn,
    .tabata-icon-btn {
        min-height: 42px;
        padding: 0 16px;
        font-size: 14px;
    }

    .tabata-primary-btn {
        min-width: 96px;
        flex: 2 1 auto;
    }

    .tabata-secondary-btn {
        min-width: 76px;
        flex: 1 1 auto;
        padding: 0 10px;
    }

    .tabata-icon-btn {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
    }
}

@media (max-width: 340px) {
    #tabataPhaseName {
        font-size: clamp(34px, 5dvh, 48px);
    }

    .tabata-time {
        font-size: clamp(142px, min(25dvh, 54vw), 186px);
    }

    .tabata-time[data-digits="3"] {
        font-size: clamp(108px, min(22dvh, 39vw), 136px);
    }

    .tabata-actions {
        gap: 4px;
    }

    .tabata-primary-btn,
    .tabata-secondary-btn,
    .tabata-icon-btn {
        min-height: 38px;
        padding: 0 10px;
        font-size: 13px;
    }

    .tabata-primary-btn {
        min-width: 80px;
        flex: 2 1 auto;
    }

    .tabata-secondary-btn {
        min-width: 64px;
        flex: 1 1 auto;
        padding: 0 6px;
    }

    .tabata-icon-btn {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0;
    }

    .tabata-icon-btn svg {
        width: 19px;
        height: 19px;
    }
}
.ios-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
    flex-shrink: 0;
}
.ios-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.ios-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333;
    transition: .3s;
    border-radius: 30px;
}
.ios-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
.ios-toggle input:checked + .ios-slider {
    background-color: #34aadd;
}
.ios-toggle input:checked + .ios-slider:before {
    transform: translateX(20px);
}
.wheel-picker-item {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #888;
    scroll-snap-align: center;
    transition: .2s;
    cursor: pointer;
    user-select: none;
}
.wheel-picker-item.selected {
    color: #fff;
    font-weight: 500;
    font-size: 22px;
}

.finish-btn.ready-to-finish {
    background: #4cd964 !important; 
    color: #000 !important;
    box-shadow: 0 4px 15px rgba(76, 217, 100, 0.4);
    transition: all 0.3s ease;
}

.help-btn.no-pulse {
    animation: none !important;
    box-shadow: none !important; 
    
    background: #1c1c1e !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important; 
}
