@media (max-width: 767px) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }

    .add-news-col-wrap,
    .add-news-col-wrap.with-news-list,
    .wrap,
    .wrap.full-width {
        width: 100%;
        max-width: 100%;
        float: none;
        overflow-x: hidden;
    }

    .events-main-page-wrap,
    .calendar-main-page-wrap,
    .trips-main-page-wrap,
    .main-page-wrap,
    .wrap.inner-page {
        overflow-y: hidden;
    }

    .news-col-wrapper,
    .showNewsColButton {
        display: none !important;
    }

    /* --- шапка: ниже, фото и заголовок остаются --- */
    .regata-page-header {
        height: 88px;
        background-size: cover;
        background-position: center;
    }

    .inner-page .regata-page-header {
        height: 56px;
        background-position: center right;
    }

    .main-title {
        display: block !important;
        left: 0;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        text-align: center;
        font-size: 20px;
        color: #0782bf;
        pointer-events: none;
        padding: 0 72px;
        z-index: 2;
    }

    .inner-page .main-title {
        left: 0;
        top: 50%;
        font-size: 18px;
        text-align: center;
    }

    .btn-back,
    .events-main-page-wrap .btn-back,
    .calendar-main-page-wrap .btn-back,
    .trips-main-page-wrap .btn-back,
    .inner-page .btn-back,
    .myevents-page-wrap .btn-back {
        position: absolute;
        top: 8px;
        left: 8px;
        bottom: auto;
        z-index: 4;
        min-height: 32px;
        padding: 4px 8px;
        font-size: 13px;
    }

    .main-page-wrap .btn-back {
        display: none;
    }

    /* --- контент под шапкой и над подвалом --- */
    .content-section {
        padding-bottom: 0;
        border-left: none;
        border-right: none;
    }

    .events-main-page-wrap .content-section,
    .calendar-main-page-wrap .content-section,
    .trips-main-page-wrap .content-section {
        height: calc(100% - 88px - 52px - env(safe-area-inset-bottom, 0px)) !important;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    /* главная: подвал внутри страницы, наружного нет */
    .main-page-wrap .content-section {
        height: calc(100% - 88px) !important;
    }

    .inner-page .content-section {
        display: block;
        height: calc(100% - 56px - 52px - env(safe-area-inset-bottom, 0px)) !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }

    .content-section-inner {
        padding: 0 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .inner-page .inventory-section {
        height: calc(100% - 56px - 44px - env(safe-area-inset-bottom, 0px));
    }

    /* --- подвал: скролл на .footer, ряд слева от 0, кнопки не сжимаются --- */
    .footer {
        position: absolute;
        height: 52px !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: 100% !important;
        text-align: left !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: content-box;
        touch-action: pan-x;
    }

    .footer-main-buttons,
    .mainpage-container .footer-main-buttons {
        display: block !important;
        height: 52px !important;
        min-height: 52px !important;
        width: max-content !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 4px 8px 4px 8px !important;
        overflow: visible !important;
        justify-content: flex-start !important;
        line-height: normal !important;
        box-sizing: border-box;
        text-align: left !important;
        float: none !important;
    }

    .footer-main-buttons ul,
    .mainpage-container .footer-main-buttons ul {
        display: flex !important;
        flex-direction: row;
        flex-wrap: nowrap !important;
        align-items: center;
        width: max-content !important;
        min-width: 0 !important;
        max-width: none !important;
        justify-content: flex-start !important;
        margin: 0 !important;
        padding: 0 16px 0 0 !important;
        font-size: 0;
        gap: 4px;
    }

    .footer-main-buttons .footer-main-buttons-item,
    .mainpage-container .footer-main-buttons .footer-main-buttons-item {
        display: flex !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        align-items: center;
        justify-content: center;
        min-width: 88px !important;
        max-width: none !important;
        width: auto !important;
        height: 44px !important;
        padding: 2px 10px !important;
        box-sizing: border-box;
        line-height: 1.15 !important;
        white-space: nowrap;
    }

    .footer-main-buttons .footer-main-buttons-item span,
    .mainpage-container .footer-main-buttons .footer-main-buttons-item span {
        padding: 0 2px !important;
        font-size: 11px !important;
        line-height: 1.15 !important;
        text-align: center;
        white-space: nowrap;
        overflow: visible;
    }

    ul.footer-menu {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        table-layout: auto;
        height: 44px;
        border-spacing: 4px 0;
        justify-content: flex-start !important;
        touch-action: pan-x;
    }

    ul.footer-menu > li {
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        min-width: 72px !important;
        height: 44px;
        box-sizing: border-box;
        padding: 0 8px;
    }

    /* --- главная: логотип в шапке, описание без фикс. 500px --- */
    .mainpage-container {
        padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
        height: 100%;
        overflow: hidden;
    }

    .mainpage-container .footer {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 52px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        text-align: left !important;
        z-index: 100;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
    }

    .mainpage-logo {
        display: none;
    }

    .mainpage-description {
        width: auto;
        max-width: none;
        min-width: 0;
        height: auto;
        max-height: none;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 15px;
        margin: 0 12px 12px;
        padding: 8px 4px 0;
    }

    /* --- гонки / календарь / поездки: только списки, не страница события --- */
    .events-main-page-wrap .main-page,
    .calendar-main-page-wrap .main-page,
    .trips-main-page-wrap .main-page {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
    }

    .events-main-page-wrap .main-page .content-section-inner,
    .calendar-main-page-wrap .main-page .content-section-inner,
    .trips-main-page-wrap .main-page .content-section-inner {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
        overflow: hidden !important;
        padding: 0 !important;
    }

    .events-main-page-wrap .mainpage-filter-list-wrap,
    .calendar-main-page-wrap .mainpage-filter-list-wrap,
    .trips-main-page-wrap .mainpage-filter-list-wrap {
        flex-shrink: 0;
        padding-top: 8px;
    }

    .events-main-page-wrap .main-page ul.filter-list:not(.sub-filter-list),
    .calendar-main-page-wrap .main-page ul.filter-list:not(.sub-filter-list),
    .trips-main-page-wrap .main-page ul.filter-list:not(.sub-filter-list) {
        height: auto;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        margin: 0 0 8px;
        padding: 0 8px;
    }

    .events-main-page-wrap .main-page .filter-item-wrap,
    .calendar-main-page-wrap .main-page .filter-item-wrap,
    .trips-main-page-wrap .main-page .filter-item-wrap {
        display: none !important;
    }

    .events-main-page-wrap .main-page .filter-item-wrap.active-filter,
    .calendar-main-page-wrap .main-page .filter-item-wrap.active-filter,
    .trips-main-page-wrap .main-page .filter-item-wrap.active-filter {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        justify-self: start !important;
        touch-action: pan-x pan-y;
    }

    .events-main-page-wrap .main-page .fixed-thead,
    .calendar-main-page-wrap .main-page .fixed-thead,
    .trips-main-page-wrap .main-page .fixed-thead {
        position: relative;
        z-index: 2;
        flex-shrink: 0;
        background: #fff;
        width: max-content;
        min-width: max-content;
    }

    .events-main-page-wrap .main-page .events-list-wrap,
    .calendar-main-page-wrap .main-page .events-list-wrap,
    .trips-main-page-wrap .main-page .events-list-wrap {
        flex: 1 1 auto;
        min-height: 0 !important;
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: scroll !important;
        width: max-content;
        min-width: max-content;
        scrollbar-width: none;
        -ms-overflow-style: none;
        background: #fff;
    }

    .events-main-page-wrap .main-page .events-list-wrap::-webkit-scrollbar,
    .calendar-main-page-wrap .main-page .events-list-wrap::-webkit-scrollbar,
    .trips-main-page-wrap .main-page .events-list-wrap::-webkit-scrollbar {
        width: 0 !important;
    }

    .events-main-page-wrap .main-page .fixed-thead .table,
    .events-main-page-wrap .main-page .events-list-wrap .table,
    .calendar-main-page-wrap .main-page .fixed-thead .table,
    .calendar-main-page-wrap .main-page .events-list-wrap .table,
    .trips-main-page-wrap .main-page .fixed-thead .table,
    .trips-main-page-wrap .main-page .events-list-wrap .table {
        width: max-content !important;
        min-width: max-content !important;
        max-width: none !important;
        table-layout: auto !important;
        border-collapse: separate !important;
    }

    .events-main-page-wrap .main-page .table td,
    .events-main-page-wrap .main-page .table th,
    .calendar-main-page-wrap .main-page .table td,
    .calendar-main-page-wrap .main-page .table th,
    .trips-main-page-wrap .main-page .table td,
    .trips-main-page-wrap .main-page .table th {
        box-sizing: border-box;
        vertical-align: middle;
    }

    .events-main-page-wrap .main-page thead td,
    .calendar-main-page-wrap .main-page thead td,
    .trips-main-page-wrap .main-page thead td {
        white-space: nowrap;
        overflow: hidden;
    }

    .events-main-page-wrap td.year-cell,
    .calendar-main-page-wrap td.year-cell,
    .trips-main-page-wrap td.year-cell {
        min-width: 60px !important;
        width: 60px !important;
    }

    .events-main-page-wrap td.date-cell,
    .calendar-main-page-wrap td.date-cell,
    .trips-main-page-wrap td.date-cell {
        min-width: 68px !important;
        width: 68px !important;
    }

    .events-main-page-wrap td.days-cell,
    .calendar-main-page-wrap td.days-cell,
    .trips-main-page-wrap td.days-cell {
        min-width: 46px !important;
        width: 46px !important;
    }

    .events-main-page-wrap td.title-cell,
    .calendar-main-page-wrap td.title-cell,
    .trips-main-page-wrap td.title-cell {
        min-width: 272px !important;
        width: 272px !important;
    }

    .events-main-page-wrap td.title_trips-cell,
    .calendar-main-page-wrap td.title_trips-cell,
    .trips-main-page-wrap td.title_trips-cell {
        min-width: 272px !important;
        width: 272px !important;
    }

    .events-main-page-wrap td.country-cell,
    .calendar-main-page-wrap td.country-cell,
    .trips-main-page-wrap td.country-cell {
        min-width: 100px !important;
        width: 100px !important;
    }

    .events-main-page-wrap td.city-cell,
    .calendar-main-page-wrap td.city-cell,
    .trips-main-page-wrap td.city-cell {
        min-width: 126px !important;
        width: 126px !important;
    }

    .events-main-page-wrap td.boats-cell,
    .calendar-main-page-wrap td.boats-cell,
    .trips-main-page-wrap td.boats-cell {
        min-width: 100px !important;
        width: 100px !important;
    }

    .events-main-page-wrap td.description-cell,
    .calendar-main-page-wrap td.description-cell,
    .trips-main-page-wrap td.description-cell {
        min-width: 276px !important;
        width: 276px !important;
        max-width: 276px !important;
    }

    .events-main-page-wrap td.result-cell,
    .calendar-main-page-wrap td.result-cell,
    .trips-main-page-wrap td.result-cell {
        min-width: 35px !important;
    }

    .events-main-page-wrap td.trainer-cell,
    .calendar-main-page-wrap td.trainer-cell,
    .trips-main-page-wrap td.trainer-cell {
        min-width: 46px !important;
        width: 46px !important;
    }

    .events-main-page-wrap td.place-cell,
    .calendar-main-page-wrap td.place-cell,
    .trips-main-page-wrap td.place-cell {
        min-width: 60px !important;
        width: 60px !important;
    }

    .events-main-page-wrap td.adm-cell,
    .calendar-main-page-wrap td.adm-cell,
    .trips-main-page-wrap td.adm-cell {
        min-width: 79px !important;
        width: 79px !important;
    }

    .events-main-page-wrap td.year-cell,
    .events-main-page-wrap td.date-cell,
    .events-main-page-wrap td.days-cell,
    .calendar-main-page-wrap td.year-cell,
    .calendar-main-page-wrap td.date-cell,
    .calendar-main-page-wrap td.days-cell,
    .trips-main-page-wrap td.year-cell,
    .trips-main-page-wrap td.date-cell,
    .trips-main-page-wrap td.days-cell {
        white-space: nowrap;
        position: static;
        left: auto;
        box-shadow: none;
    }

    .events-main-page-wrap .text-excerpt,
    .calendar-main-page-wrap .text-excerpt,
    .trips-main-page-wrap .text-excerpt {
        max-width: 100%;
    }

    /* --- страница события --- */
    .event-page {
        height: auto !important;
        min-height: 100%;
        padding: 0 8px 12px;
        overflow: visible;
    }

    .event-title.title-lg,
    .title-lg {
        font-size: 18px;
        margin: 8px 0 4px;
        padding: 0 8px;
        display: block;
    }

    .title-big {
        font-size: 16px;
        margin: 8px 0;
    }

    .nextPrevEventTitleBox {
        position: static;
        display: block;
        margin: 4px 0 0;
    }

    .online-button-wrap,
    .download-button-wrap {
        position: static;
        margin: 8px auto 0;
        text-align: center;
    }

    .online-button {
        display: inline-block;
        font-size: 14px;
        padding: 8px 12px;
    }

    .translate-btn {
        position: static;
        margin: 8px 0;
        text-align: right;
    }

    .popup-menu-list-wrap ul.filter-list,
    .event-page ul.filter-list,
    ul.popup-menu-list {
        display: block;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
        margin: 8px 0;
    }

    .event-page li.filter-list-item,
    .popup-menu-list-wrap li.filter-list-item {
        margin: 0 4px;
    }

    .event-page li.filter-list-item > div,
    .popup-menu-list-wrap li.filter-list-item > div {
        padding: 8px 10px;
    }

    .event-page-popup-content-item-body {
        padding: 0 4px;
    }

    .event-page-content {
        margin-left: 0 !important;
        max-width: 100%;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    .event-page .results-table .filter-item-wrap {
        text-align: left;
        overflow: visible;
    }

    .event-page .form-group.text-center {
        text-align: left;
        overflow: visible;
        margin-bottom: 8px;
    }

    .event-page .buttonsShowTableWithGk {
        position: static !important;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 6px 12px;
        width: auto !important;
        max-width: 100%;
        margin: 0 0 8px;
        text-align: left;
        white-space: normal;
    }

    .event-page .buttonsShowTableWithGk label {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin: 0;
        white-space: nowrap;
        font-size: 13px;
    }

    .event-page .eventFixedTableWrapper,
    .event-page .filter-item-wrap .eventFixedTableWrapper,
    .event-page .resultTablesWrap {
        max-width: 100%;
        width: 100%;
        overflow-x: auto !important;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x pan-y;
    }

    .event-page .eventFixedTableWrapper .table-event,
    .event-page .resultTablesWrap .table-event,
    .event-page .eventFixedTableWrapper table.table-event[data-withgk="true"],
    .event-page .eventFixedTableWrapper table.table-event[data-withGk="true"] {
        width: max-content !important;
        max-width: none !important;
        min-width: 0 !important;
        table-layout: auto !important;
        margin: 8px 0;
    }

    .event-page [data-cell="country"] {
        width: 72px !important;
        min-width: 64px !important;
        max-width: 88px !important;
        overflow: hidden;
    }

    .event-page [data-cell="namesails"],
    .event-page .cell-namesails,
    .event-page .cell-sailsnum {
        width: 72px !important;
        min-width: 52px !important;
        max-width: 88px !important;
        overflow: hidden;
    }

    .event-page [data-cell="boat_name"] {
        width: 96px !important;
        min-width: 72px !important;
        max-width: 110px !important;
        overflow: hidden;
    }

    .event-page [data-cell="skipper"],
    .event-page [data-cell="team"],
    .event-page .cell-skipper,
    .event-page .cell-team {
        width: 160px !important;
        min-width: 140px !important;
        max-width: 180px !important;
        overflow: hidden;
        box-sizing: border-box;
    }

    .event-page [data-cell="skipper"] > div,
    .event-page [data-cell="skipper"] .txt-skipper,
    .event-page [data-cell="skipper"] .skipper-team,
    .event-page [data-cell="boat_name"] .txt-boat_name,
    .event-page [data-cell="namesails"] .txt-namesails,
    .event-page [data-cell="team"] .txt-team {
        width: auto !important;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .event-page .eventFixedTableWrapper td.stickyLeftCol:not([data-cell="final_place"]):not([data-cell="color"]),
    .event-page .eventFixedTableWrapper thead td.stickyСorner:not([data-cell="final_place"]):not([data-cell="color"]) {
        position: static !important;
        left: auto !important;
        z-index: 1 !important;
    }

    .event-page .eventFixedTableWrapper td,
    .event-page .eventFixedTableWrapper th {
        overflow: hidden;
    }

    .eventFixedTableWrapper .stickyLeftCol,
    .eventFixedTableWrapper .stickyСorner {
        background: #fff;
    }

    .eventFixedTableWrapper thead td.stickyСorner {
        background: #f2faff;
    }
}
