.timetable-page {
    max-width: 1520px;
    padding-top: 72px;
    padding-bottom: 120px;
}

.timetable-page__heading {
    width: 100%;
    margin-bottom: 36px;
    text-align: center;
}

.timetable-page__eyebrow {
    margin-bottom: 10px;
    color: #79bbcb;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.timetable-page__title {
    margin-bottom: 12px;
}

.timetable-page__lead {
    color: #777;
}

.schedule {
    width: 100%;
    overflow: hidden;
    border: 1px solid #dce5e7;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(45, 76, 82, 0.08);
}

.schedule__toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 82px;
    padding: 16px 24px;
    border-bottom: 1px solid #dce5e7;
    background: #f7fbfc;
}

.schedule__period {
    display: flex;
    min-width: 250px;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.schedule__period-label {
    color: #8b999c;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.schedule__period-value {
    color: #3e3e3e;
    font-size: 18px;
    font-weight: 600;
}

.schedule-nav__button {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid #79bbcb;
    border-radius: 50%;
    background: #fff;
    color: #79bbcb;
    cursor: pointer;
    transition: background 180ms, color 180ms, border-color 180ms, transform 180ms;
}

.schedule-nav__button:hover:not(:disabled) {
    background: #79bbcb;
    color: #fff;
    transform: translateY(-1px);
}

.schedule-nav__button:disabled {
    border-color: #d8e0e1;
    color: #b8c1c3;
    cursor: default;
}

.schedule-week__head {
    display: grid;
    grid-template-columns: 74px repeat(7, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    border-bottom: 1px solid #dce5e7;
    background: #4f9fb2;
    color: #fff;
}

.schedule-week__corner,
.schedule-day-head {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.schedule-week__corner {
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.schedule-day-head {
    flex-direction: column;
    gap: 3px;
}

.schedule-day-head:last-child {
    border-right: 0;
}

.schedule-day-head__weekday {
    font-size: 16px;
    font-weight: 600;
}

.schedule-day-head__date {
    color: rgba(255, 255, 255, 0.76);
    font-size: 12px;
}

.schedule-week__desktop {
    width: 100%;
    overflow: visible;
}

.schedule-week__body {
    position: relative;
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    background: #fff;
}

.schedule-time-axis {
    position: relative;
    z-index: 2;
    border-right: 1px solid #dce5e7;
    background: #fff;
}

.schedule-time-axis__label {
    position: absolute;
    right: 14px;
    color: #778184;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    transform: translateY(-50%);
}

.schedule-day-columns {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.schedule-day-column {
    position: relative;
    min-width: 0;
    border-right: 1px solid #e3eaeb;
    background: repeating-linear-gradient(to bottom, #fff 0, #fff 90px, #f4f7f7 90px, #f4f7f7 180px);
}

.schedule-day-column:last-child {
    border-right: 0;
}

.schedule-day-column::after {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 89px, rgba(147, 168, 172, 0.22) 89px, rgba(147, 168, 172, 0.22) 90px);
    content: "";
    pointer-events: none;
}

.schedule-color-0 {
    --schedule-card-bg: #dff4f7;
    --schedule-card-bg-hover: #cdebf1;
    --schedule-card-border: #9ed3dd;
    --schedule-card-color: #315158;
    --schedule-card-shadow: rgba(51, 110, 123, 0.2);
}

.schedule-color-1 {
    --schedule-card-bg: #e2f3e8;
    --schedule-card-bg-hover: #d1ebda;
    --schedule-card-border: #acd8bb;
    --schedule-card-color: #365b43;
    --schedule-card-shadow: rgba(64, 122, 84, 0.18);
}

.schedule-color-2 {
    --schedule-card-bg: #f8e5e5;
    --schedule-card-bg-hover: #f2d4d4;
    --schedule-card-border: #e7b6b6;
    --schedule-card-color: #6b3d3d;
    --schedule-card-shadow: rgba(139, 75, 75, 0.17);
}

.schedule-color-3 {
    --schedule-card-bg: #eee8f8;
    --schedule-card-bg-hover: #e2d8f3;
    --schedule-card-border: #cbbbe4;
    --schedule-card-color: #56456e;
    --schedule-card-shadow: rgba(92, 70, 124, 0.17);
}

.schedule-color-4 {
    --schedule-card-bg: #f8efdc;
    --schedule-card-bg-hover: #f2e3c5;
    --schedule-card-border: #e4c894;
    --schedule-card-color: #675536;
    --schedule-card-shadow: rgba(129, 100, 48, 0.16);
}

.schedule-color-5 {
    --schedule-card-bg: #def2ef;
    --schedule-card-bg-hover: #cce9e4;
    --schedule-card-border: #a8d6cf;
    --schedule-card-color: #315e58;
    --schedule-card-shadow: rgba(49, 112, 102, 0.17);
}

.schedule-event.cd {
    position: absolute;
    z-index: 1;
    display: flex;
    min-height: 56px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    padding: 6px 9px;
    border: 1px solid var(--schedule-card-border, #9ed3dd);
    border-radius: 12px;
    background: var(--schedule-card-bg, #dff4f7);
    color: var(--schedule-card-color, #315158);
    cursor: pointer;
    outline: none;
    transition: z-index 0s, height 180ms ease, box-shadow 180ms, transform 180ms, background 180ms;
}

.schedule-event.cd.is-long {
    justify-content: flex-start;
    gap: 3px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.schedule-event.cd.is-long:hover,
.schedule-event.cd.is-long:focus-visible {
    z-index: 4;
    height: var(--schedule-expanded-height) !important;
    border-bottom-style: solid;
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 12px;
    transform: none;
}

.schedule-event.cd.is-long:not(:hover):not(:focus-visible) {
    border-bottom-style: dashed;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 4px;
}

.schedule-event.cd.is-long::after {
    position: absolute;
    bottom: 1px;
    left: 50%;
    content: "⌄";
    font-size: 10px;
    font-weight: 700;
    line-height: 8px;
    opacity: 0.48;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 100ms;
}

.schedule-event.cd.is-long:hover::after,
.schedule-event.cd.is-long:focus-visible::after {
    opacity: 0;
}

.schedule-event.is-obscured,
.schedule-overflow.is-obscured {
    opacity: 0.34;
    filter: blur(1.5px);
    pointer-events: none;
    transition: opacity 120ms, filter 120ms;
}

.schedule-event.cd:hover,
.schedule-event.cd:focus-visible {
    z-index: 3;
    border-color: var(--schedule-card-border, #9ed3dd);
    background: var(--schedule-card-bg-hover, #cdebf1);
    box-shadow: 0 10px 24px var(--schedule-card-shadow, rgba(51, 110, 123, 0.2));
    transform: translateY(-2px);
}

.schedule-event.cd.is-past {
    border-color: #d5dddd;
    background: #edf1f1;
    color: #747d7f;
}

.schedule-event.cd.is-past:hover,
.schedule-event.cd.is-past:focus-visible {
    border-color: #d5dddd;
    background: #edf1f1;
    box-shadow: 0 10px 24px rgba(83, 96, 98, 0.13);
}

.schedule-event__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
}

.schedule-event__meta {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.schedule-event__time {
    font-size: 12px;
}

.schedule-event__duration {
    flex: 0 0 auto;
    opacity: 0.66;
}

.schedule-event__capacity {
    overflow: hidden;
    padding: 1px 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    font-size: 9px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-event.is-overlapping {
    justify-content: flex-start;
    gap: 3px;
    padding-right: 6px;
    padding-left: 6px;
}

.schedule-event.is-overlapping .schedule-event__topline {
    order: 1;
    width: 100%;
}

.schedule-event.is-overlapping .schedule-event__name {
    order: 2;
    display: block;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-event.is-overlapping .schedule-event__meta {
    display: none;
}

.schedule-event.is-overlapping .schedule-event__trainer {
    order: 3;
    width: 100%;
}

.schedule-event.is-overflow {
    display: none;
}

.schedule-overflow {
    position: absolute;
    right: 3px;
    z-index: 5;
    width: 28px;
    min-height: 56px;
}

.schedule-overflow__toggle {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 56px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 2px;
    border: 1px solid #cbd4d6;
    border-radius: 10px;
    background: #dfe4e5;
    color: #667174;
    cursor: pointer;
    transition: background 180ms, border-color 180ms, transform 180ms;
}

.schedule-overflow__toggle:hover,
.schedule-overflow__toggle:focus-visible,
.schedule-overflow__toggle[aria-expanded="true"] {
    background: #d1d8d9;
    border-color: #b7c3c5;
    outline: none;
    transform: translateY(-1px);
}

.schedule-overflow__label {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.schedule-overflow__count {
    display: flex;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: #596568;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.schedule-overflow__menu {
    position: absolute;
    top: 0;
    right: 34px;
    z-index: 8;
    width: min(260px, calc(100vw - 40px));
    padding: 10px;
    border: 1px solid #d6dfe0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(51, 70, 74, 0.2);
}

.schedule-overflow.opens-right .schedule-overflow__menu {
    right: auto;
    left: 34px;
}

.schedule-overflow__menu[hidden] {
    display: none;
}

.schedule-overflow__heading {
    padding: 4px 5px 10px;
    color: #748184;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.schedule-overflow__item {
    display: grid;
    width: 100%;
    min-height: 66px;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--schedule-card-border, #d6dfe0);
    border-radius: 11px;
    background: var(--schedule-card-bg, #eef3f4);
    color: var(--schedule-card-color, #465154);
    cursor: pointer;
    text-align: left;
}

.schedule-overflow__item + .schedule-overflow__item {
    margin-top: 7px;
}

.schedule-overflow__item:hover,
.schedule-overflow__item:focus-visible {
    background: var(--schedule-card-bg-hover, #e5ebec);
    outline: none;
}

.schedule-overflow__item.is-past {
    --schedule-card-bg: #edf1f1;
    --schedule-card-bg-hover: #e3e8e8;
    --schedule-card-border: #d5dddd;
    --schedule-card-color: #747d7f;
}

.schedule-overflow__item-time,
.schedule-overflow__item-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.schedule-overflow__item-time {
    align-self: stretch;
    justify-content: center;
    gap: 3px;
    padding-right: 8px;
    border-right: 1px solid rgba(75, 95, 99, 0.18);
}

.schedule-overflow__item-time strong {
    font-size: 12px;
}

.schedule-overflow__item-time small {
    font-size: 9px;
    opacity: 0.7;
}

.schedule-overflow__item-content {
    gap: 3px;
}

.schedule-overflow__item-name,
.schedule-overflow__item-trainer {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-overflow__item-name {
    font-size: 12px;
    font-weight: 600;
}

.schedule-overflow__item-trainer {
    font-size: 10px;
    opacity: 0.72;
}

.schedule-event__name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.schedule-event.is-long:hover .schedule-event__name,
.schedule-event.is-long:focus-visible .schedule-event__name {
    -webkit-line-clamp: 3;
}

.schedule-event__trainer {
    overflow: hidden;
    color: #718084;
    font-size: 10px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-event__booking {
    display: none !important;
}

.schedule-week__mobile {
    display: none;
}

.schedule-details[hidden] {
    display: none;
}

body.schedule-details-open {
    overflow: hidden;
}

.schedule-details {
    position: fixed;
    z-index: 10020;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.schedule-details__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(42, 57, 60, 0.46);
    cursor: default;
    backdrop-filter: blur(3px);
}

.schedule-details__dialog {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    padding: 34px;
    border: 1px solid rgba(121, 187, 203, 0.32);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(33, 54, 59, 0.28);
}

.schedule-details__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f1f6f7;
    color: #6e7c7f;
    cursor: pointer;
}

.schedule-details__meta {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-right: 34px;
    color: #5f9dab;
    font-size: 13px;
    font-weight: 600;
}

.schedule-details__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #79bbcb;
}

.schedule-details__title {
    margin: 13px 0 8px;
    color: #3e3e3e;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.25;
}

.schedule-details__trainer,
.schedule-details__description {
    color: #697477;
    font-size: 14px;
    line-height: 1.55;
}

.schedule-details__trainer::before {
    content: "Тренер: ";
    color: #9aa3a5;
}

.schedule-details__description {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e4eaeb;
}

.schedule-details__availability {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    color: #4e656a;
    font-size: 13px;
    font-weight: 500;
}

.schedule-details__availability-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #62bd8c;
}

.schedule-details.is-unavailable .schedule-details__availability-dot {
    background: #aeb7b9;
}

.schedule-details__spots {
    margin-left: auto;
    color: #8a9496;
    font-size: 12px;
}

.schedule-details__book {
    width: 100%;
    height: 52px;
    margin-top: 24px;
    border: 0;
    font: inherit;
    font-weight: 600;
}

.schedule-details__book[hidden] {
    display: none;
}

.visit_form_error {
    margin-bottom: 12px;
    color: #a34f4f;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

@media screen and (max-width: 980px) {
    .timetable-page {
        padding-top: 48px;
        padding-bottom: 90px;
    }

    .schedule-week__desktop {
        display: none;
    }

    .schedule-week__mobile {
        display: block;
        padding: 8px 22px 24px;
    }

    .schedule-mobile-day {
        padding: 20px 0;
        border-bottom: 1px solid #e4eaeb;
    }

    .schedule-mobile-day:last-child {
        border-bottom: 0;
    }

    .schedule-mobile-day__head {
        display: flex;
        align-items: baseline;
        gap: 8px;
        margin-bottom: 12px;
        color: #3e3e3e;
        font-size: 16px;
        font-weight: 600;
    }

    .schedule-mobile-day__head span:last-child {
        color: #8b9698;
        font-size: 13px;
        font-weight: 500;
    }

    .schedule-mobile-day__list {
        display: grid;
        gap: 8px;
    }

    .schedule-mobile-card.cd {
        display: grid;
        grid-template-columns: 78px minmax(0, 1fr) 12px;
        align-items: center;
        gap: 14px;
        min-height: 76px;
        padding: 13px 16px;
        border: 1px solid var(--schedule-card-border, #9ed3dd);
        border-radius: 16px;
        background: var(--schedule-card-bg, #dff4f7);
        color: var(--schedule-card-color, #315158);
        cursor: pointer;
        outline: none;
        transition: background 180ms, transform 180ms;
    }

    .schedule-mobile-card.cd:hover,
    .schedule-mobile-card.cd:focus-visible {
        background: var(--schedule-card-bg-hover, #cdebf1);
        transform: translateY(-1px);
    }

    .schedule-mobile-card.cd.is-past {
        border-color: #dce2e3;
        background: #f0f3f3;
        color: #737d7f;
    }

    .schedule-mobile-card.cd.is-past:hover,
    .schedule-mobile-card.cd.is-past:focus-visible {
        background: #f0f3f3;
    }

    .schedule-mobile-card__time {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding-right: 13px;
        border-right: 1px solid rgba(92, 139, 149, 0.23);
    }

    .schedule-mobile-card__time strong {
        font-size: 16px;
    }

    .schedule-mobile-card__time span {
        color: #7a898c;
        font-size: 11px;
    }

    .schedule-mobile-card__time .schedule-mobile-card__capacity {
        width: max-content;
        margin-top: 3px;
        padding: 2px 6px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.62);
        color: inherit;
        font-size: 10px;
        line-height: 1.25;
    }

    .schedule-mobile-card__name {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.3;
    }

    .schedule-mobile-card .schedule-event__trainer {
        margin-top: 4px;
        font-size: 11px;
    }

    .schedule-mobile-card__arrow {
        color: #79aeba;
    }

    .schedule-mobile-day__empty {
        color: #a0aaac;
        font-size: 13px;
    }
}

@media screen and (max-width: 600px) {
    .timetable-page {
        padding-top: 34px;
        padding-bottom: 70px;
    }

    .timetable-page__heading {
        margin-bottom: 24px;
        text-align: left;
    }

    .timetable-page__eyebrow {
        font-size: 11px;
    }

    .timetable-page__lead {
        font-size: 14px;
        line-height: 1.5;
    }

    .schedule {
        border-radius: 20px;
    }

    .schedule__toolbar {
        min-height: 72px;
        gap: 12px;
        padding: 12px 14px;
    }

    .schedule__period {
        min-width: 0;
        flex: 1;
    }

    .schedule__period-value {
        font-size: 15px;
    }

    .schedule-nav__button {
        width: 38px;
        height: 38px;
    }

    .schedule-week__mobile {
        padding: 4px 14px 14px;
    }

    .schedule-mobile-day {
        padding: 17px 0;
    }

    .schedule-mobile-card.cd {
        grid-template-columns: 64px minmax(0, 1fr) 8px;
        gap: 10px;
        padding: 12px;
    }

    .schedule-mobile-card__time {
        padding-right: 8px;
    }

    .schedule-details {
        align-items: flex-end;
        padding: 0;
    }

    .schedule-details__dialog {
        width: 100%;
        padding: 30px 22px 22px;
        border-radius: 24px 24px 0 0;
    }

    .schedule-details__title {
        font-size: 22px;
    }

    .schedule-details__availability {
        flex-wrap: wrap;
    }

    .schedule-details__spots {
        width: 100%;
        margin-left: 17px;
    }
}
