* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100svh;
    min-height: 100dvh;
    background-color: #f4f4f4;
    font-family: Arial, sans-serif;
    color: #111;
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

input,
textarea,
select {
    font: inherit;
}

.auth-screen {
    position: relative;
    z-index: 1;

    width: 100%;
    min-height: 100svh;
    min-height: 100dvh;

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

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    padding: 20px;
}

.auth-screen_hidden {
    display: none;
}

.auth-card {
    position: relative;
    z-index: 2;

    width: min(100%, 420px);

    padding: 28px;

    background-color: #ffffff;
    border-radius: 28px;

    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
}

.auth-title {
    margin-bottom: 8px;

    font-size: 42px;
    font-weight: 900;
}

.auth-subtitle {
    margin-bottom: 24px;

    font-size: 17px;
    color: #666;
    line-height: 1.35;
}

.auth-label {
    display: block;

    margin-bottom: 8px;

    font-size: 16px;
    font-weight: 700;
}

.auth-input {
    width: 100%;
    height: 54px;

    margin-bottom: 16px;
    padding: 0 16px;

    border: 1px solid #ddd;
    border-radius: 16px;

    background-color: #f4f4f4;
    color: #111;
    caret-color: #111;

    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    touch-action: auto;

    font-size: 18px;
    line-height: normal;
}

.auth-button {
    width: 100%;
    height: 56px;

    margin-top: 8px;

    border: none;
    border-radius: 18px;

    background-color: #20dce2;

    font-size: 19px;
    font-weight: 800;
}

.auth-button_secondary {
    background-color: rgb(195, 226, 109);
}

.auth-forgot-button {
    width: 100%;

    margin-top: 14px;

    border: none;
    background: none;

    font-size: 16px;
    font-weight: 700;
    color: #666;
}

.auth-message {
    margin-top: 16px;

    font-size: 15px;
    color: #555;
    line-height: 1.3;
}

.main-app {
    width: 100%;
    height: 100dvh;
}

.main-app_hidden {
    display: none;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;

    background-color: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.menu-overlay_show {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 25;

    width: min(320px, 86vw);
    height: 100dvh;

    padding: calc(84px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));

    background-color: #ffffff;
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.18);

    transform: translateX(-105%);
    transition: transform 0.28s ease;

    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.sidebar_open {
    transform: translateX(0);
}

.sidebar__close {
    position: absolute;
    top: calc(24px + env(safe-area-inset-top));
    right: 16px;

    width: 46px;
    height: 46px;

    display: flex;
    justify-content: center;
    align-items: center;

    background-color: #f1f1f1;
    border: none;
    border-radius: 14px;

    font-size: 34px;
    line-height: 1;
}

.sidebar__title {
    margin-bottom: 24px;

    font-size: 28px;
    font-weight: 700;
}

.sidebar__section {
    margin-bottom: 22px;
}

.sidebar__subtitle {
    margin-bottom: 12px;

    font-size: 18px;
    font-weight: 700;
    color: #555;
}

.sidebar__item {
    width: 100%;
    margin-bottom: 10px;
    padding: 16px 18px;

    background-color: #f4f4f4;
    border: none;
    border-radius: 16px;

    text-align: left;
    font-size: 20px;

    transition: 0.2s;
}

.sidebar__item_active {
    background-color: rgb(195, 226, 109);
    font-weight: 700;
}

.setting {
    display: flex;
    flex-direction: column;
    gap: 8px;

    margin-bottom: 14px;
}

.setting span {
    font-size: 16px;
    font-weight: 700;
}

.setting input {
    width: 100%;
    height: 48px;

    padding: 0 14px;

    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 14px;

    font-size: 20px;
}

.settings_hidden {
    display: none;
}

.sidebar__save {
    width: 100%;
    height: 54px;

    margin-top: 8px;
    margin-bottom: 14px;

    background-color: #20dce2;
    border: none;
    border-radius: 16px;

    font-size: 18px;
    font-weight: 700;
}

.sidebar__save_hidden {
    display: none;
}

.sidebar__logout {
    width: 100%;
    height: 50px;

    margin-bottom: 14px;

    background-color: #ff6c6c;
    border: none;
    border-radius: 16px;

    font-size: 17px;
    font-weight: 800;
}

.sidebar__hint {
    font-size: 14px;
    color: #777;
    line-height: 1.35;
}

.app {
    width: min(100%, 620px);
    height: 100dvh;

    margin: 0 auto;
}

.workouts-screen,
.reports-screen {
    width: 100%;
    height: 100%;

    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;

    padding: calc(16px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
}

.workouts-screen_hidden,
.reports-screen_hidden {
    display: none;
}

.menu-toggle {
    width: 54px;
    height: 54px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;

    margin-bottom: 18px;
    padding: 0 14px;

    background-color: #ffffff;
    border: 1px solid #d8d8d8;
    border-radius: 16px;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    border-radius: 2px;
}

.workouts-header,
.reports-header {
    margin-bottom: 18px;
}

.workouts-title,
.reports-title {
    font-size: 34px;
    line-height: 1.1;
    font-weight: 800;
}

.workouts-subtitle,
.reports-subtitle {
    margin-top: 8px;

    font-size: 18px;
    line-height: 1.3;
    color: #666;
}

.workout-tabs-wrapper {
    margin-bottom: 18px;
}

.workout-tabs {
    display: flex;
    gap: 10px;

    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    padding-bottom: 10px;
}

.workout-tab {
    min-width: 130px;
    height: 52px;

    border: none;
    border-radius: 18px;

    background-color: #ffffff;
    color: #111;

    font-size: 18px;
    font-weight: 700;

    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.workout-tab_active {
    background-color: rgb(195, 226, 109);
}

.add-workout-button {
    width: 100%;
    height: 50px;

    margin-top: 4px;

    border: none;
    border-radius: 18px;

    background-color: #20dce2;

    font-size: 18px;
    font-weight: 800;
}

.empty-state {
    padding: 28px;

    background-color: #ffffff;
    border-radius: 28px;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);

    text-align: center;
}

.empty-state_hidden {
    display: none;
}

.empty-state__title {
    margin-bottom: 8px;

    font-size: 25px;
    font-weight: 900;
}

.empty-state__text {
    font-size: 17px;
    color: #666;
    line-height: 1.35;
}

.active-workout-panel {
    padding-bottom: 20px;
}

.active-workout-panel_hidden {
    display: none;
}

.active-workout-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;

    margin-bottom: 16px;
}

.active-workout-title-wrap {
    flex: 1;
    min-width: 0;
}

.active-workout-title {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.15;
}

.active-workout-subtitle {
    margin-top: 4px;

    font-size: 16px;
    color: #666;
}

.active-workout-actions,
.exercise-card__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.small-action-button {
    width: 42px;
    height: 42px;

    border: none;
    border-radius: 14px;

    background-color: #e9e9e9;

    font-size: 22px;
    font-weight: 900;
}

.small-action-button_delete {
    background-color: #ff6c6c;
}

.gym-session-panel {
    margin-bottom: 16px;
}

.gym-start-button {
    width: 100%;
    height: 64px;

    border: none;
    border-radius: 22px;

    background-color: #20dce2;

    font-size: 22px;
    font-weight: 900;
}

.gym-start-button_hidden {
    display: none;
}

.gym-live-timer {
    width: 100%;

    padding: 18px;

    background-color: rgb(195, 226, 109);
    border-radius: 24px;

    text-align: center;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.gym-live-timer_hidden {
    display: none;
}

.gym-live-timer__label {
    margin-bottom: 4px;

    font-size: 16px;
    font-weight: 800;
    color: #555;
}

.gym-live-timer__time {
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
}

.finish-workout-button {
    width: 100%;
    height: 64px;

    margin-top: 16px;

    border: none;
    border-radius: 22px;

    background-color: #ff6c6c;

    font-size: 22px;
    font-weight: 900;
}

.finish-workout-button_hidden {
    display: none;
}

.workout-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.exercise-card {
    padding: 18px;

    background-color: #ffffff;
    border-radius: 28px;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);

    transition: background-color 0.2s ease;
}

.exercise-card_done {
    background-color: #dff6a3;
}

.exercise-card__header {
    display: flex;
    gap: 14px;
    align-items: flex-start;

    margin-bottom: 18px;
}

.exercise-card__image {
    width: 82px;
    height: 82px;

    flex-shrink: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background-color: #f2f2f2;
    border: none;
    border-radius: 20px;

    font-size: 24px;
    font-weight: 900;
    color: #111;
}

.exercise-card__image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.exercise-card__image small {
    margin-top: 3px;

    font-size: 11px;
    color: #777;
}

.exercise-card__file {
    display: none;
}

.exercise-card__info {
    flex: 1;
    min-width: 0;
}

.exercise-card__name {
    font-size: 25px;
    line-height: 1.15;
    font-weight: 800;
}

.exercise-card__sets {
    margin-top: 6px;

    font-size: 19px;
    color: #555;
}

.complete-pill {
    margin-top: 10px;
    padding: 9px 12px;

    border: none;
    border-radius: 999px;

    background-color: #eeeeee;

    font-size: 14px;
    font-weight: 900;
    color: #333;
}

.complete-pill_done {
    background-color: #20dce2;
    color: #111;
}

.complete-pill:disabled {
    opacity: 0.45;
}

.inline-title-input {
    width: 100%;

    padding: 12px 14px;

    border: 2px solid rgb(195, 226, 109);
    border-radius: 16px;

    background-color: #ffffff;

    font-size: 26px;
    font-weight: 900;
    line-height: 1.15;
    outline: none;
}

.inline-exercise-input {
    width: 100%;
    min-height: 76px;

    padding: 10px 12px;

    border: 2px solid rgb(195, 226, 109);
    border-radius: 16px;

    background-color: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;

    resize: vertical;
    outline: none;
}

.inline-edit-controls {
    display: flex;
    gap: 8px;

    margin-top: 8px;
}

.inline-edit-button {
    width: 46px;
    height: 42px;

    border: none;
    border-radius: 14px;

    background-color: rgb(195, 226, 109);

    font-size: 24px;
    font-weight: 900;
}

.inline-edit-button_cancel {
    background-color: #ff6c6c;
}

.sets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.set-row {
    min-height: 62px;

    display: grid;
    grid-template-columns: 34px 28px 1fr 34px 1fr 58px 34px;
    gap: 8px;
    align-items: center;

    padding: 8px 10px;

    background-color: #f3f3f3;
    border-radius: 20px;

    transition: background-color 0.2s ease;
}

.set-row_done {
    background-color: #dff6a3;
}

.set-complete-button {
    width: 30px;
    height: 30px;

    border: none;
    border-radius: 50%;

    background-color: #dedfe1;

    font-size: 16px;
    font-weight: 900;
    color: #777;
}

.set-complete-button_done {
    background-color: #20dce2;
    color: #111;
}

.set-complete-button:disabled {
    opacity: 0.4;
}

.set-row__number {
    text-align: center;

    font-size: 22px;
    font-weight: 800;
}

.set-row__input {
    width: 100%;
    height: 46px;

    border: none;
    outline: none;
    border-radius: 16px;

    background-color: #dedfe1;

    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: #111;
}

.set-row__label {
    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
}

.set-row__delete {
    width: 34px;
    height: 34px;

    border: none;
    border-radius: 50%;

    background-color: #ff6c6c;
    color: #111;

    font-size: 24px;
    line-height: 1;
    font-weight: 800;
}

.add-set-button,
.add-exercise-button {
    width: 100%;
    height: 58px;

    margin-top: 12px;

    border: none;
    border-radius: 20px;

    background-color: #f3f3f3;

    font-size: 22px;
    font-weight: 800;
    color: #111;
}

.add-exercise-button {
    background-color: rgb(195, 226, 109);
}

.timer-screen {
    width: 100%;
    height: 100dvh;

    display: flex;
    flex-direction: column;

    padding: calc(16px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
}

.timer-screen_hidden {
    display: none;
}

.menu-toggle_timer {
    flex-shrink: 0;
}

.timer {
    flex: 1;
    min-height: 0;

    margin-bottom: 14px;
    padding: 24px;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 38px;
    transition: background-color 0.2s ease;
}

.timer_training {
    background-color: rgb(230, 70, 70);
}

.timer_paused {
    background-color: rgb(195, 226, 109);
}

.timer__container {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;
}

.timer__round {
    margin-bottom: 40px;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.15;
}

.timer__exercise {
    margin-bottom: 40px;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.timer__exercise_hidden {
    display: none;
}

.timer__time {
    font-size: 110px;
    font-weight: 700;
    line-height: 1;
}

.buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.button {
    flex: 1;
    height: 72px;

    display: flex;
    justify-content: center;
    align-items: center;

    border: none;
    border-radius: 28px;

    font-size: 28px;
    color: #111;
}

.button_start {
    background-color: #20dce2;
}

.button_pause {
    background-color: #f7b52a;
}

.button_stop {
    background-color: #ff6c6c;
}

.button:disabled {
    opacity: 0.5;
}

.reports-summary {
    margin-bottom: 16px;
}

.reports-summary-card {
    padding: 20px;

    background-color: #ffffff;
    border-radius: 24px;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.reports-summary-number {
    font-size: 28px;
    font-weight: 900;
}

.reports-summary-label {
    margin-bottom: 12px;

    font-size: 15px;
    color: #666;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.report-card {
    padding: 18px;

    background-color: #ffffff;
    border-radius: 24px;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.report-card__top {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 12px;
}

.report-card__title {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.15;
}

.report-card__date {
    margin-top: 4px;

    font-size: 14px;
    color: #666;
}

.report-card__right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.report-card__type {
    align-self: flex-start;

    padding: 8px 10px;

    background-color: rgb(195, 226, 109);
    border-radius: 12px;

    font-size: 13px;
    font-weight: 900;
}

.report-card__delete {
    width: 36px;
    height: 36px;

    border: none;
    border-radius: 50%;

    background-color: #ff6c6c;

    font-size: 23px;
    font-weight: 900;
    line-height: 1;
}

.report-card__duration {
    margin-bottom: 6px;

    font-size: 24px;
    font-weight: 900;
}

.report-card__details {
    font-size: 15px;
    line-height: 1.35;
    color: #555;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 18px;

    background-color: rgba(0, 0, 0, 0.38);
}

.modal-overlay_hidden {
    display: none;
}

.modal {
    width: min(100%, 430px);

    padding: 22px;

    background-color: #ffffff;
    border-radius: 28px;

    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
}

.modal__title {
    margin-bottom: 8px;

    font-size: 26px;
    font-weight: 900;
    line-height: 1.15;
}

.modal__text {
    margin-bottom: 16px;

    font-size: 17px;
    line-height: 1.35;
    color: #666;
}

.modal__input {
    width: 100%;
    height: 54px;

    margin-bottom: 18px;
    padding: 0 16px;

    border: 2px solid rgb(195, 226, 109);
    border-radius: 18px;

    background-color: #f4f4f4;

    font-size: 19px;
    font-weight: 700;
    outline: none;
}

.modal__input_hidden {
    display: none;
}

.modal__buttons {
    display: flex;
    gap: 10px;
}

.modal__button {
    flex: 1;
    height: 54px;

    border: none;
    border-radius: 18px;

    background-color: rgb(195, 226, 109);

    font-size: 18px;
    font-weight: 900;
}

.modal__button_secondary {
    background-color: #f1f1f1;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(22px + env(safe-area-inset-bottom));
    z-index: 120;

    max-width: min(90vw, 420px);

    padding: 14px 18px;

    transform: translateX(-50%);

    background-color: #111;
    color: #ffffff;
    border-radius: 18px;

    font-size: 16px;
    font-weight: 700;
    text-align: center;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.toast_hidden {
    display: none;
}

@media (max-width: 600px) {
    .workouts-screen,
    .reports-screen {
        padding: calc(14px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
    }

    .menu-toggle {
        width: 54px;
        height: 54px;

        margin-bottom: 18px;

        border-radius: 16px;
    }

    .sidebar {
        width: min(320px, 88vw);
        padding: calc(78px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
    }

    .sidebar__close {
        top: calc(20px + env(safe-area-inset-top));
        right: 14px;

        width: 44px;
        height: 44px;

        font-size: 30px;
    }

    .workouts-title,
    .reports-title {
        font-size: 30px;
    }

    .workouts-subtitle,
    .reports-subtitle {
        font-size: 16px;
    }

    .exercise-card {
        padding: 16px;

        border-radius: 24px;
    }

    .exercise-card__header {
        gap: 12px;
    }

    .exercise-card__image {
        width: 76px;
        height: 76px;

        border-radius: 18px;
    }

    .exercise-card__name {
        font-size: 22px;
    }

    .exercise-card__sets {
        font-size: 17px;
    }

    .inline-title-input {
        font-size: 24px;
    }

    .inline-exercise-input {
        font-size: 20px;
    }

    .set-row {
        grid-template-columns: 30px 26px 1fr 28px 1fr 48px 30px;
        gap: 6px;

        min-height: 58px;
        padding: 7px 8px;

        border-radius: 18px;
    }

    .set-complete-button {
        width: 28px;
        height: 28px;
    }

    .set-row__number {
        font-size: 20px;
    }

    .set-row__input {
        height: 42px;

        border-radius: 14px;

        font-size: 22px;
    }

    .set-row__label {
        font-size: 14px;
    }

    .set-row__delete {
        width: 30px;
        height: 30px;

        font-size: 22px;
    }

    .add-set-button,
    .add-exercise-button {
        height: 54px;

        border-radius: 18px;

        font-size: 20px;
    }

    .timer-screen {
        padding: calc(14px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
    }

    .timer {
        padding: 20px;
        border-radius: 32px;
    }

    .timer__round {
        margin-bottom: 34px;

        font-size: 34px;
    }

    .timer__exercise {
        margin-bottom: 34px;

        font-size: 30px;
    }

    .timer__time {
        font-size: 84px;
    }

    .buttons {
        gap: 10px;
    }

    .button {
        height: 66px;

        border-radius: 24px;

        font-size: 24px;
    }
}

@media (max-width: 390px) {
    .auth-card {
        padding: 22px;
    }

    .auth-title {
        font-size: 36px;
    }

    .workouts-title,
    .reports-title {
        font-size: 27px;
    }

    .exercise-card__header {
        gap: 10px;
    }

    .exercise-card__image {
        width: 70px;
        height: 70px;

        border-radius: 16px;
    }

    .exercise-card__name {
        font-size: 20px;
    }

    .small-action-button {
        width: 38px;
        height: 38px;
    }

    .set-row {
        grid-template-columns: 28px 24px 1fr 26px 1fr 42px 28px;
    }

    .set-complete-button {
        width: 26px;
        height: 26px;

        font-size: 14px;
    }

    .set-row__input {
        font-size: 20px;
    }

    .set-row__label {
        font-size: 12px;
    }

    .timer {
        padding: 16px;
        border-radius: 28px;
    }

    .timer__round {
        margin-bottom: 28px;

        font-size: 29px;
    }

    .timer__exercise {
        margin-bottom: 28px;

        font-size: 26px;
    }

    .timer__time {
        font-size: 72px;
    }

    .button {
        height: 60px;

        border-radius: 22px;

        font-size: 21px;
    }

    .modal {
        padding: 20px;
        border-radius: 24px;
    }

    .modal__title {
        font-size: 24px;
    }
}

@supports (-webkit-touch-callout: none) {
    .auth-screen {
        min-height: -webkit-fill-available;
        padding-top: max(20px, calc(28px + env(safe-area-inset-top)));
        padding-bottom: max(20px, calc(28px + env(safe-area-inset-bottom)));
    }

    .auth-input,
    .modal__input,
    .setting input,
    .set-row__input,
    .inline-title-input,
    .inline-exercise-input {
        touch-action: auto;
    }
}
