body {
    margin: 0;
    padding: 0;
    font-family: "Geologica", sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;

    /* высота карты и отступ попапа поиска от её верхнего края; от этих же
       величин считается максимальная высота меню, чтобы оно не вылезало
       за подложку карты */
    --map-height: 550px;
    --map-popup-offset: 30px;
}

.main-content {
    flex: 1;
    padding: 20px;
}

.dropdown {
  position: relative;
  display: inline-block;
  width: 280px;
}

.dropbtn {
    font-family: "Geologica", sans-serif;
    font-size: 100%;
    color: #000000;
    background-color: #e6ebf0;
    transition: .2s linear;
    border: none;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  width: 87%;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  z-index: 10001;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}

.dropdown-content .index_button {
  width: calc(100% - 20px);
  margin: 5px 10px;
  padding: 8px;
  background-color: #e0e0e0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
}

.dropdown-content .index_button:hover {
  background-color: #87b8dd;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content.active {
  display: block;
}

.arrow-down {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 10px;
  vertical-align: middle;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 10px solid black;
}

.navbar-no-shadow {
    z-index: 5;
    background-color: #0000;
    width: 100%;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
    box-sizing: border-box;
}

.container-regular {
    width: 100%;
    max-width: 1260px;
    min-height: 30px;
    margin-left: auto;
    margin-right: auto;
}

.navbar-wrapper {
    justify-content: space-between;
    align-items: center;
    display: flex;
}

.nav-menu {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: #1a1b1fbf;
    letter-spacing: .25px;
    margin: 0 5px;
    padding: 10px 20px;
    font-size: 18px;
    line-height: 24px;
    text-decoration: none;
    text-align: center;
    flex-grow: 1;
}

.nav-link:hover {
    color: #1a1b1fbf;
}

.navbar-brand img {
    flex-shrink: 0;

}

.footer {
    background-color: #f5f7fa;
    border-bottom: 1px solid #e4ebf3;
    padding: 3%;
    position: relative;
    width: 94%;
}

.footer-wrapper {
    max-width: 1260px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.footer-content {
    grid-column-gap: 70px;
    grid-row-gap: 40px;
    grid-template-rows: auto;
    grid-template-columns: auto auto 1fr;
    display: grid;
    margin-left: 20px;
}

.footer-brand {
    flex-shrink: 0;
}

.footer-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    flex-basis: 30%;
}

.title-small {
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    line-height: 16px;
}

.footer-link {
    color: #1a1b1fbf;
    margin-top: 12px;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 16px;
    text-decoration: none;
}

.footer-link:hover {
    color: #1a1b1fbf;
}

ul {
    list-style-type: none;
}

.list_index {
    list-style-type: disc;
}

img {
    height: auto;
    max-width: 150px;
}

.app {
    display: grid;
    grid-gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.item {
    position: relative;
    overflow: hidden;
}

.item:nth-of-type(1n),
.item:nth-of-type(3n),
.item:nth-of-type(4n) {
    grid-column: span 2;
}

.item img {
    max-width: 100%;
    height: auto;
}

.index_popup {
    display: none;
    width: 280px;
    height: auto;
    position: fixed;
    top: 250px;
}
.index_popup .index_popup_content {
    color: #000000;
    font-size: 160%;
    width: 260px;
    height: auto;
    padding: 10px;
    background-color: #d0d8df;
    border-radius: 5px;
    line-height: 1.5;
}

.index_button {
    font-family: "Geologica", sans-serif;
    font-size: 100%;
    color: #000000;
    background-color: #e6ebf0;
    transition: .2s linear;
    border: none;
}

.index_button:hover {
    background: #87b8dd;
}

.close_button {
    font-size: 100%;
    color: #000000;
    background: transparent;
    border: none;
    cursor: pointer;
    float: right;
}

.close_button:hover {
    color: #87b8dd;
}

.pagination-block {
    text-align: center;
    font-family: "Geologica", sans-serif;
    font-size: 24px;
    color: #1a1b1fbf;
}

#pagination-block:hover {
    color: #e6ebf0;
}

#map {
    width: 100%;
    text-align: center;
    height: var(--map-height);
}

.text-container {
    width: 0 auto;
    margin: 0 auto;
    padding: 0 20px;
    text-indent: 20px;
}

.text-container li, .text-container ul {
    list-style: disc;
}

.map-text-container {
    width: 0 auto;
    margin: 0 auto;
    margin-bottom: 5px;
    padding: 0;
    line-height: 1;
}

#central_container {
    width: 20%;
    text-align: center;
    margin: 0;
    padding: 0;
    text-indent: 0;
    position: absolute;
    top: 35%;
    left: 40%;
}

.type-figure {
    text-align: center;
}

.buttom-primary {
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
    background-color: #1a1b1f;
    padding: 12px 25px;
    font-size: 12px;
    line-height: 20px;
    transition: all .2s;
}

.buttom-primary:hover {
    color: #fff;
    background-color: #3234a;
}

.buttom-primary:active {
    background-color: #43464d;
}

.hero-heading-left {
    background-color: #f5f7fa;
    border-bottom: 1px solid #e4ebf3;
    padding: 80px 30px;
    position: relative;
}

.container-for-content-main {
    width: 100%;
}

.hero-wrapper {
    justify-content: space-between;
    align-items: center;
    display: flex;
    position: relative;
}

.hero-split {
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    max-width: 46%;
    display: flex;
    margin-right: 24px;
}

.margin-bottom-24px {
    margin-bottom: 24px;
}

#search_img_open {
    display: none;
    position: absolute;
    top: 120px;
    left: 30px;
    font-size: 160%;
    color: #000000;
    background-color: #e6ebf0;
    transition: .2s linear;
    border: none;
    width: 30px;
    height: 30px;
}

#search_img_open:hover {
    background: #87b8dd;
}

#search_img_result {
    display: none;
}

.search_img_popup_body {
    display: flex;
    flex-direction: row;
    width: 292px;
}

.search_img_popup {
    display: block;
    width: 280px;
    height: auto;
    position: absolute;
    top: 120px;
    left: 30px;
}

.search_img_popup .search_img_popup_content {
    color: #000000;
    font-size: 160%;
    width: 270px;
    height: auto;
    /* попап начинается на --map-popup-offset ниже верха карты; вычитаем
       ещё собственные padding/margin и небольшой зазор до низа подложки.
       если содержимое всё же не влезает — колонка скроллится, а не
       вылезает за подложку */
    max-height: calc(var(--map-height) - var(--map-popup-offset) - 42px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #8c98a4 transparent;
    padding: 10px;
    background-color: #d0d8df;
    border-radius: 5px;
    line-height: 1.5;
    margin: 1px;

}

.source_labels {
    width: 0 auto;
    margin: 0 auto;
    font-size: 62.5%;
    font-weight: lighter;
}

#cloud_cover_range {
    font-size: 90%;
}

#cloud_cover_slider {
    width: 240px;
    margin: 3px 0 0 5px;
}

.cloud_cover_hint {
    font-size: 62.5%;
    font-weight: lighter;
    line-height: 1.2;
}

.search_button {
    font-family: "Geologica", sans-serif;
    width: 260px;
    font-size: 100%;
    color: #000000;
    background-color: #87b8dd;
    transition: .2s linear;
    border: none;
    margin-top: 10px;
    margin-left: 5px;
    margin-bottom: 5px;
}

.search_button:hover {
    background: SteelBlue;
}

#search_img_back_button {
    font-family: "Geologica", sans-serif;
    float: left;
}

#myposition {
    position: absolute;
    top: 630px;
    left: 30px;
    padding-left: 0px;
    background-color: #d0d8df;
}

.center_popup {
    display: none;
    height: auto;
    width: 160px;
    height: auto;
    position: fixed;
    top: 250px;
    left: 42%;
}

.center_popup .center_popup_content {
    color: #000000;
    font-size: 160%;
    width: 170px;
    height: auto;
    padding: 10px;
    background-color: #d0d8df;
    border-radius: 5px;
    line-height: 1.5;
}

#map_index_menu {
    position: absolute;
}

.filtered_image {
    margin: 2px;
    border: 2px solid black;
    width: 50%;
    max-width: 150px;
    max-height: 150px;
}
.selected {
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
    border: 2px solid #FFD700;
}

#filtered_images_container {
    overflow-y: scroll;
    max-height: 450px;
    width: 100%;
}

.description_block {
    font-size: 12px;
    text-align: center;
    padding: 5px
}

.images_block {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 3px;
}

.spinner {
    position: fixed;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
}
.spinner-content {
    font-size: 20px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 1%;
    border: 1px solid #888;
    width: 48%;
    text-align: center;
    position: relative;
    left: 25%;
    top: 75px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.image-title {
    text-align: center;
    font-size: 36px;
    margin-top: 20px;
    margin-bottom: 20px;
    font-family: "Geologica", sans-serif;
    color: black;
}

.image-index {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
}

.image-index img {
    max-width: 90%;
    height: auto;
    display: inline-block;
}

#img_download_button{
    background-color: #d0d8df;
    font-size:200%;
    text-decoration: none;
    padding: 5px;
}
#img_download_button:hover{
    background: #87b8dd;
}

#rel_files_download_button{
    display:block;
    text-decoration: none;
    padding-left: 5px;
    padding-right: 5px;
    background-color: #87b8dd;
    margin-top: 5px;
    text-align: center;
}

#rel_files_download_button:hover {
    background: SteelBlue;
}

#index_header{
    display: none;
}

/* кнопки индексов идут одним столбцом и набираются мельче текста попапа:
   иначе список не умещается в высоту карты.
   display переключает map_utils.js на grid */
#index_buttons_list{
    display: none;
    grid-template-columns: 1fr;
    gap: 3px;
    font-size: 58%;
}

/* только кнопки самого списка: пункты выпадашки «Сегментация»
   раскладывает .dropdown-content .index_button */
#index_buttons_list > .index_button {
    width: 100%;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
}

#index_buttons_list .dropdown {
    width: 100%;
}

#index_buttons_list .dropbtn {
    width: 100%;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
}

/* колонка меню обрезает всё, что выходит за её max-height, поэтому
   список сегментации раскрывается вверх — он стоит в самом низу */
#index_buttons_list .dropdown-content {
    width: 100%;
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 5px;
}

#index_buttons_list .arrow-down {
    border-top: none;
    border-bottom: 10px solid black;
}

#index_buttons_list .reference_link {
    margin-top: 0;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 100%;
}


#clear_button {
    display: none;
    font-family: "Geologica", sans-serif;
    position: absolute;
    color: dimgrey;
    background-color: white;
    border: none;
    width: 120px;
    height: 22px;
    border-radius: 2px;
}

#clear_button:hover {
    border: 1px solid dimgrey;
}

/* Состояние панели поиска и координаты контролов карты.

   Раньше и то и другое проставлял map_utils.js инлайн-стилями — их нельзя было
   перекрыть медиа-запросом, и мобильная раскладка была невозможна. Теперь JS
   выставляет только data-атрибуты на <body> (см. showSearchResults,
   showSearhMenu, showSources и initMapPanelState), а значения лежат здесь;
   десктопные числа перенесены из map_utils.js без изменений.

   data-map-panel и data-map-results разведены намеренно: showSearhMenu()
   двигает контролы, но не трогает ширину панели и показ колонки результатов —
   разделение сохраняет это поведение. */

body[data-map-panel="collapsed"] #search_img_menu {
    display: none;
}

body[data-map-panel="collapsed"] #search_img_open {
    display: block;
}

body[data-map-results="open"] #search_img_result {
    display: block;
}

body[data-map-results="open"] .search_img_popup_body {
    width: 584px;
}

body[data-map-area="municipality"] #clear_button {
    display: block;
}

body[data-map-area="municipality"] #map .ol-search {
    display: none;
}

/* координаты контролов только для десктопа: на мобилке действует блок в конце
   файла, и закрытая медиа-запросом развилка избавляет от борьбы специфичностей */
@media (min-width: 701px) {
    /* меню открыто на источниках — состояние, с которым грузится страница */
    #map .ol-search {
        top: 10px;
        left: 340px;
    }

    .custom-zoom {
        top: 10px;
        left: 310px;
    }

    #clear_button {
        top: 120px;
        left: 362px;
    }

    body[data-map-panel="results"] #map .ol-search {
        top: 10px;
        left: 632px;
    }

    body[data-map-panel="results"] .custom-zoom {
        top: 10px;
        left: 602px;
    }

    body[data-map-panel="results"] #clear_button {
        top: 120px;
        left: 655px;
    }

    body[data-map-panel="collapsed"] #map .ol-search {
        top: 12.5px;
        left: 50px;
    }

    body[data-map-panel="collapsed"] .custom-zoom {
        top: 50px;
        left: 12.5px;
    }

    body[data-map-panel="collapsed"] #clear_button {
        top: 123px;
        left: 70px;
    }
}

#editor_open_button{
        display:block;
        text-decoration: none;
        padding-left: 5px;
        padding-right: 5px;
        background-color: #87b8dd;
        margin-top: 5px;
        text-align: center;
}

#editor_open_button:hover {
    background: SteelBlue;
}

/* Справочник по индексам (/reference) */

.reference-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    line-height: 1.6;
}

.reference-title {
    font-size: 28px;
    margin-bottom: 8px;
}

.reference-intro {
    margin-top: 0;
    color: #1a1b1fbf;
}

.reference-inline-link {
    color: #1a1b1f;
}

.reference-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 30px;
}

.reference-toc-link {
    font-size: 14px;
    color: #000000;
    background-color: #e6ebf0;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: .2s linear;
}

.reference-toc-link:hover {
    background: #87b8dd;
}

.reference-common {
    background-color: #f2f5f8;
    border-radius: 6px;
    padding: 4px 20px 12px;
    margin-bottom: 30px;
}

.reference-common-title {
    font-size: 18px;
}

.reference-card {
    border-top: 1px solid #d0d8df;
    padding-top: 20px;
    margin-bottom: 34px;
    scroll-margin-top: 20px;
}

.reference-card-title {
    font-size: 22px;
    margin-bottom: 2px;
}

.reference-card-subtitle {
    margin: 0 0 14px;
    font-size: 14px;
    color: #1a1b1fbf;
}

.reference-formula {
    background-color: #f2f5f8;
    border-radius: 6px;
    padding: 4px 16px;
    margin-bottom: 18px;
    overflow-x: auto;
}

.reference-facts {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 10px 20px;
    margin: 0;
}

.reference-facts dt {
    font-weight: 600;
}

.reference-facts dd {
    margin: 0;
}

.reference-facts ul {
    margin: 0;
    padding-left: 20px;
}

.reference-back-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 14px;
    color: #1a1b1fbf;
    text-decoration: none;
}

.reference-back-link:hover {
    color: #87b8dd;
}

/* возврат к списку снимков — только для мобильной раскладки, где колонка
   панели одна; на десктопе обе колонки видны разом */
.mobile_back_to_list {
    display: none;
}

/* ссылка на справочник рядом с кнопками индексов; класса index_button
   намеренно нет — по нему map_utils.js включает и выключает кнопки */
.reference_link {
    display: block;
    font-family: "Geologica", sans-serif;
    font-size: 90%;
    color: #1a1b1f;
    background-color: #e6ebf0;
    text-decoration: none;
    padding: 4px 5px;
    margin-top: 8px;
    text-align: center;
    transition: .2s linear;
}

.reference_link:hover {
    background: #87b8dd;
}

/* Мобильная раскладка.

   Единственная точка переключения на весь проект. Десктопные координаты
   контролов карты закрыты @media (min-width: 701px) выше, поэтому здесь они
   просто задаются заново — борьбы специфичностей не возникает. */

@media (max-width: 700px) {
    .reference-facts {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    body {
        --map-height: 60vh;
    }

    #map {
        min-height: 320px;
    }

    /* панель — карточка по центру карты. Подложка .search_img_popup растянута
       ровно на область карты: .main-content становится опорной, отступы
       повторяют её padding, высота — высоту #map вместе с его min-height.
       Так положение не зависит от высоты навбара, который на мобилке
       переносится на две строки. Подложка кликов не ловит — карта под ней
       остаётся живой, — а карточку центрирует flex .search_img_popup_body */
    .main-content {
        position: relative;
    }

    .search_img_popup {
        position: absolute;
        top: 20px;
        left: 20px;
        right: 20px;
        bottom: auto;
        width: auto;
        height: max(var(--map-height), 320px);
        pointer-events: none;
        z-index: 1000;
    }

    .search_img_popup_body,
    body[data-map-results="open"] .search_img_popup_body {
        width: 100%;
        height: 100%;
        align-items: center;
        justify-content: center;
    }

    /* 96px запаса по высоте оставляют видимым поле поиска над карточкой и
       столько же карты под ней; кнопки зума справа карточка может закрывать,
       карта при этом масштабируется щипком */
    .search_img_popup .search_img_popup_content {
        width: min(100%, 360px);
        box-sizing: border-box;
        flex: 0 1 auto;
        max-height: calc(100% - 96px);
        margin: 0;
        font-size: 115%;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
        pointer-events: auto;
    }

    /* колонка ровно одна: список снимков, пока снимок не выбран, и кнопки
       индексов после выбора (showSources переключает data-map-column) */
    body[data-map-results="open"][data-map-column="sources"] #search_img_params {
        display: none;
    }

    body[data-map-results="open"][data-map-column="indexes"] #search_img_result {
        display: none;
    }

    body[data-map-results="open"][data-map-column="indexes"] .mobile_back_to_list {
        display: block;
        width: 100%;
        min-height: 40px;
        margin-bottom: 6px;
        font-family: "Geologica", sans-serif;
        font-size: 15px;
        color: #000000;
        background-color: #e6ebf0;
        border: none;
        border-radius: 3px;
    }

    /* внутренний скролл списка не нужен: скроллится сама карточка */
    #filtered_images_container {
        overflow-y: visible;
        max-height: none;
    }

    .filtered_image {
        max-width: 96px;
        max-height: 96px;
    }

    /* --- тач-цели. font-size у полей ввода не меньше 16px: Safari на iOS
       зумит страницу при фокусе на поле с более мелким шрифтом --- */

    #index_buttons_list {
        font-size: 100%;
        gap: 6px;
    }

    #index_buttons_list > .index_button,
    #index_buttons_list .dropbtn {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 15px;
    }

    .source_labels {
        font-size: 100%;
    }

    /* строка источника кликается целиком, а не по чекбоксу 13x13 */
    #sources_labels label {
        display: inline-block;
        min-height: 40px;
        line-height: 40px;
    }

    .source_check {
        width: 20px;
        height: 20px;
    }

    #date_1,
    #date_2 {
        min-height: 44px;
        font-size: 16px;
    }

    #cloud_cover_slider {
        width: 100%;
        height: 44px;
        margin-left: 0;
    }

    .search_button {
        width: 100%;
        min-height: 44px;
        margin-left: 0;
        font-size: 16px;
    }

    .close_button,
    #search_img_back_button {
        min-width: 44px;
        min-height: 44px;
    }

    .reference_link {
        min-height: 40px;
        line-height: 32px;
    }

    .footer-link {
        min-height: 40px;
        line-height: 40px;
        margin-top: 0;
        margin-bottom: 0;
    }

    .type-figure select {
        min-height: 44px;
        font-size: 16px;
    }

    /* --- контролы карты --- */

    /* оба контрола в верхней части карты: поле поиска остаётся над карточкой
       панели, а низ карты занят плавающими кнопками */
    #map .ol-search {
        top: 8px;
        left: 8px;
        right: 8px;
        max-width: none;
    }

    .custom-zoom {
        top: 44px;
        bottom: auto;
        left: auto;
        right: 8px;
    }

    /* ol сам укрупняет контролы до 33px по классу ol-touch — этого мало.
       префикс #map нужен, чтобы перебить .ol-touch .ol-control button */
    #map .custom-zoom button,
    #map .ol-search button {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    #map .ol-search input {
        height: 40px;
    }

    /* плавающая кнопка: не зависит ни от высоты навбара, ни от прокрутки */
    #search_img_open {
        position: fixed;
        top: auto;
        bottom: 16px;
        left: 16px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
        z-index: 1000;
    }

    #clear_button {
        position: fixed;
        top: auto;
        bottom: 76px;
        left: 16px;
        width: auto;
        height: 36px;
        padding: 0 12px;
        z-index: 1000;
    }

    /* при открытой панели кнопка лишняя: очистка нужна после закрытия */
    body[data-map-area="municipality"]:not([data-map-panel="collapsed"]) #clear_button {
        display: none;
    }

    /* координаты под курсором: pointermove на тач-экране не приходит */
    #myposition {
        display: none;
    }

    /* --- модалки. Правила #...ModalContent и .complex-table живут в <style>
       внутри map.html, то есть ниже main.css по документу; префикс body
       поднимает специфичность и снимает зависимость от порядка --- */

    /* модалка позиционируется от документа, а не от вьюпорта: на прокрученной
       странице она открывалась бы выше экрана */
    .modal {
        position: fixed;
    }

    .modal-content {
        width: auto;
        left: 0;
        top: 0;
        margin: 0 12px;
        max-height: 88vh;
        overflow-y: auto;
    }

    body #complexModalContent,
    body #croppedImageModalContent,
    body #editorModalContent {
        width: auto;
        left: 0;
        height: auto;
    }

    body .complex-table {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    /* окно обрезанного снимка на узком экране: кнопки под снимком, а не сбоку */
    body #croppedImageModalContent {
        flex-direction: column-reverse;
    }

    body #index_buttons_list_crop {
        flex-basis: auto;
        width: 100%;
        margin-top: 0;
    }

    /* кроп на тач-экране — отдельная задача, до неё вход закрыт.
       !important здесь осознанно: display этой кнопки ставится инлайном из
       changeIndexButtons() и showSources(), перекрыть его иначе нельзя */
    #editor_open_button {
        display: none !important;
    }

    /* --- навбар и футер: без них страница едет вбок вместе с картой --- */

    .navbar-wrapper {
        flex-direction: column;
        gap: 8px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        flex-grow: 0;
        padding: 10px 12px;
        font-size: 16px;
    }

    .footer-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        grid-column-gap: 0;
        grid-row-gap: 20px;
        margin-left: 0;
    }

    .footer-block {
        align-items: center;
        flex-basis: auto;
    }
}
