/* POLNALYUBVI. Ограничиваем масштаб первого экрана между мобильной и планшетной сетками. */
@media (min-width: 480px) and (max-width: 639.98px) {
  #allrecords :is(#rec6037008301, #rec6006724901, #rec6034911901) :is(.t396__artboard, .t396__carrier, .t396__filter) {
    height: min(1260px, calc(840px * var(--zoom, 1.5))) !important;
  }

  :is(#rec6037008301, #rec6006724901, #rec6034911901) .t396__artboard > :is(.t396__elem, .t396__group):not([data-field-container-value="window"]) {
    zoom: min(1.5, var(--zoom, 1.5)) !important;
    margin-inline-start: max(0px, calc((100% - 320px) / 2));
  }

  :is(#rec6037008301, #rec6006724901, #rec6034911901) .t396__artboard > :is([data-elem-id="1795099158750000001"], [data-elem-id="1795099158750000002"]) {
    left: 0 !important;
    width: 100% !important;
    margin-inline-start: 0 !important;
  }

  #allrecords[data-tilda-page-id="401670209"],
  #allrecords[data-tilda-page-id="403882109"] {
    background-position-y: min(1260px, calc(100vw * 2.625)) !important;
  }
}

/* Петербург. Заголовок остаётся внутри своей карточки в трёхколоночной сетке. */
@media (min-width: 960px) and (max-width: 1199.98px) {
  #rec6034912601 :is([data-elem-id="1795098771788000065"], [data-elem-id="1795098771788000071"], [data-elem-id="1795098771788000084"]) {
    left: 50% !important;
    width: 100% !important;
    translate: -50% 0;
  }
}

/* Концертное меню. На низком экране логотип, пункты и кнопка помещаются вместе. */
@media (max-height: 460px) {
  :is(#rec6006859101, #rec6034912001) .t-menu-popover__container {
    padding-top: 22px !important;
  }

  :is(#rec6006859101, #rec6034912001) .t3112__logowrapper {
    margin-bottom: 9px !important;
  }

  :is(#rec6006859101, #rec6034912001) .t-menu-popover__container .t-menu__link-wrapper {
    min-height: 32px;
    margin-bottom: 0 !important;
    align-items: center;
  }

  :is(#rec6006859101, #rec6034912001) .t3112__additional {
    padding-block: 10px !important;
  }
}

/* Москва. Резервируем место под длинную карточку VIP до расчёта высоты Тильдой. */
@media (max-width: 639.98px) {
  #allrecords #rec6006860501 .t396__artboard {
    min-height: calc(1684px * var(--zoom, 1));
  }
}

@media (min-width: 640px) and (max-width: 959.98px) {
  #allrecords #rec6006860501 .t396__artboard {
    min-height: 2544px;
  }
}

/* На этой ширине видеоблоки используют сетку 940 px. */
@media (min-width: 960px) and (max-width: 1199.98px) {
  #allrecords #polnalyubvi-msk-music-frame {
    width: min(100%, 940px);
  }
}

/* Концертные страницы. Приближаем портрет и полумесяц к дате на телефонах. */
@media (max-width: 639.98px) {
  :is(#rec6006724901, #rec6034911901) [data-elem-id="1795098771788000002"] {
    translate: 0 clamp(-24px, calc(60vw - 384px), 0px);
  }
}

/* Концертные афиши. Выравниваем плашку дня недели по видимой строке даты. */
:is(#rec6006724901, #rec6034911901) [data-elem-id="1795098771788000013"] > .tn-atom {
  translate: 0 -7px;
}

@media (max-width: 1199.98px) {
  :is(#rec6006724901, #rec6034911901) [data-elem-id="1795098771788000013"] > .tn-atom {
    translate: 0 -6px;
  }
}

@media (max-width: 639.98px) {
  :is(#rec6006724901, #rec6034911901) [data-elem-id="1795098771788000013"] > .tn-atom {
    translate: 0 -4px;
  }
}

/* Десктопные афиши. Сторона квадрата «СБ» равна высоте штриха «Я» в дате. */
@media (min-width: 960px) {
  #allrecords :is(#rec6006724901, #rec6034911901) .tn-elem[data-elem-id="1795098771788000013"] {
    width: var(--weekday-side, 33px) !important;
    height: var(--weekday-side, 33px) !important;
  }
}

@media (min-width: 1200px) {
  #allrecords :is(#rec6006724901, #rec6034911901) .tn-elem[data-elem-id="1795098771788000013"] {
    --weekday-side: 41px;
  }
}

/* Петербург. На десктопе отступ перед «СБ» отсчитывается от текста даты. */
@media (min-width: 960px) {
  #allrecords #rec6034911901 .tn-elem[data-elem-id="1795098771788000011"] {
    width: max-content !important;
  }

  #rec6034911901 [data-group-id="1795100149165000001"] > .tn-molecule {
    column-gap: 13px !important;
  }
}

@media (min-width: 1200px) {
  #rec6034911901 [data-group-id="1795100149165000001"] > .tn-molecule {
    column-gap: 6.5px !important;
  }
}

/* Десктопные афиши. Добавляем 2 px между датой и квадратом «СБ». */
@media (min-width: 960px) {
  #allrecords :is(#rec6006724901, #rec6034911901) .tn-elem[data-elem-id="1795098771788000013"] {
    margin-inline-start: 2px !important;
  }
}
