.clinic-history__wrapper {
    width: 100%;
}

.clinic-history__title {
    display: flex;
    justify-content: space-between;
}

.clinic-history__icon {
    display: none;
    animation: icon 2s ease infinite;
    margin-top: 30px;
}

.clinic-history__timeline {
    display: flex;
    position: relative;
    align-items: stretch;
    width: 100%;
}

/* Линия на десктопе */
.clinic-history__timeline::before {
    content: "";
    position: absolute;
    top: 39px;
    left: 4px;
    right: 4px;
    height: 3px;
    background: #edf3f5;
    z-index: 0;
}

.clinic-history__item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    padding: 0 18px 0 4px;
    box-sizing: border-box;
}

.clinic-history__year {
    margin: 0 0 10px;
    color: #0196BB;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.2;
}

/* Точка на десктопе */
.clinic-history__item::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 36px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0196BB;
}

.clinic-history__text {
    margin: 17px 0 0;
    color: #577B84;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.25;
}

@media (max-width: 968px) {
    .clinic-history,
    .clinic-history__wrapper {
        overflow: visible;
    }

    .clinic-history__icon {
        display: block;
    }

    .clinic-history__title {
        margin-bottom: 28px;
    }

    .clinic-history__timeline {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 180px;
        grid-template-columns: none;
        gap: 0;

        position: relative;
        isolation: isolate;

        width: calc(100% + (100vw - 100%) / 2);
        box-sizing: border-box;

        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 24px 12px 0;

        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .clinic-history__timeline::-webkit-scrollbar {
        display: none;
    }

    /* Непрерывная линия до последней точки */
    .clinic-history__timeline::before {
        content: "";
        position: absolute;
        top: 34px;
        left: 8px;
        right: auto;
        width: var(--clinic-history-line-width, 100%);
        height: 3px;
        background: #edf3f5;
        z-index: 0;
        pointer-events: none;
    }

    .clinic-history__item {
        position: relative;
        min-width: 0;
        padding: 0 16px 0 4px;
        scroll-snap-align: start;
    }

    .clinic-history__year {
        margin: 0 0 8px;
        line-height: 1.2;
    }

    /* Точка */
    .clinic-history__item::before {
        content: "";
        position: absolute;
        top: 31px;
        left: 4px;
        width: 8px;
        height: 8px;
        margin: 0;
        border-radius: 50%;
        background: #0196BB;
        z-index: 2;
    }

    /* Отдельные линии не нужны */
    .clinic-history__item::after {
        content: none !important;
    }

    .clinic-history__text {
        margin: 10px 0 0;
        font-size: 14px;
        line-height: 1.35;
    }

    @keyframes icon {
    0%, 20%, 100% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(-4px);
    }
    60% {
        transform: translateX(4px);
    }
}
}