@charset "UTF-8";
/* ==========================================================================
   Адаптивный каркас сайта (шапка, меню, три колонки, подвал, выезжающие панели).
   Только расположение и размеры — без цветов. Подключается для обеих тем:
   «Глубокий космос» (space.css) и старой светлой (stylek.css, des=2).
   Брейкпоинты: > 1180 — три колонки; 981–1180 — узкие колонки; ≤ 980 — телефон/планшет:
   левая и правая колонки превращаются в выезжающие панели (кнопки в шапке).
   ========================================================================== */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; min-width: 0; }
html, body { height: auto; min-height: 100%; }
body { overflow-x: hidden; }
html body.sp-classic, html body.sp-theme { min-width: 0; } /* stylek.css задаёт min-width:1000px — каркас теперь резиновый */

/* ---- Каркас ---- */
.main.sp-shell {
  width: auto;
  max-width: 1280px;
  height: auto;
  margin: 0 auto;
  padding: 0 18px;
  box-sizing: border-box;
  position: relative;
  z-index: auto; /* без своего контекста наложения: выезжающие панели (z 1001) должны быть выше затемнения */
}

#header.sp-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 18px;
  height: auto;
  min-height: 92px;
  padding: 14px 0 10px;
}
.sp-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; flex: 0 1 auto; }
.sp-logo__emblem { flex: 0 0 auto; display: block; }
/* Свой логотип из админки («Оформление сайта») */
.sp-logo__img { flex: 0 1 auto; display: block; max-height: 56px; max-width: 320px; width: auto; height: auto; object-fit: contain; }
.sp-logo__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.sp-logo__name { font-size: 30px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-logo__tag { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; margin-top: 5px; white-space: nowrap; }

.sp-header__ad { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }
#baner-serf { float: none; width: 468px; max-width: 100%; height: 60px; margin: 0; padding: 0; overflow: hidden; }
#baner-serf img { max-width: 100%; height: auto; }
.sp-header__adlinks { font-size: 12px; }

.sp-iconbtn { display: none; }

#top-menu.sp-topmenu { height: auto; position: relative; z-index: 20; }
.sp-topmenu .main-menu { position: relative; }
.sp-topmenu .main-navigation { display: flex; align-items: stretch; margin: 0; }
.sp-topmenu .main-navigation__list { flex: 1 1 auto; display: flex; flex-wrap: wrap; min-width: 0; }
.sp-topmenu .main-navigation__item { flex: 1 0 auto; }
.sp-topmenu .block_language { flex: 0 0 auto; position: relative; display: flex; align-items: center; }
.sp-topmenu .link_language { padding: 0 10px; height: 100%; }
.sp-topmenu .link_language_dropdown { top: 100%; right: 0; max-height: 70vh; overflow-y: auto; }

.sp-chain { text-align: center; padding: 14px 0 18px; }
.sp-chain .add-chain { vertical-align: top; }
.sp-marquee { margin-top: 12px; }

.sp-cols {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr) 212px;
  gap: 18px;
  align-items: start;
}
.sp-col { min-width: 0; padding-bottom: 40px; }
.sp-center#contentwrapper { min-width: 0; padding: 18px 18px 40px; box-sizing: border-box; }
.sp-drawer-close { display: none; }
.sp-shade { display: none; }

/* Старые фиксированные ширины блоков колонок — делаем резиновыми */
.sp-col .banners, .sp-col .banners2 { width: auto; margin-top: 0; }
.sp-col table[width="198px"], .sp-col table[width="198"] { width: 100%; }
#contentwrapper .titles { width: auto; margin-top: 0; }
#contentwrapper img, .sp-col img { max-width: 100%; }
#contentwrapper iframe, #contentwrapper video, #contentwrapper embed { max-width: 100%; }

/* Блоки баннеров колонок: старые фиксированные размеры и фон-заглушка */
.sp-col .left-banner { width: auto; height: auto; background: none; }
.sp-col .left-banner > br { display: none; }
#leftcolumn > br, #rightcolumn > br { display: none; }

/* Полоса Google-переводчика сверху не нужна: язык выбирается своим меню (globus в верхнем меню) */
body > .skiptranslate, iframe.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }

/* Выпадающий список языков: в старом оформлении (stylek.css) своих стилей у него нет */
.sp-classic .dropdown-menu { display: none; position: absolute; top: 100%; right: 0; z-index: 1000; background: #fff; border: 1px solid #ddd; min-width: 160px; list-style: none; margin: 0; padding: 0; }
.sp-classic .dropdown-toggle:hover .dropdown-menu { display: block; }
.sp-classic .dropdown-menu li > a { display: block; padding: 6px 12px; white-space: nowrap; }

/* ---- Подвал ---- */
.footer.sp-footer { margin-top: 30px; height: auto; position: relative; z-index: 1; }
.sp-footer .footer__container {
  width: auto; max-width: 1280px; margin: 0 auto; padding: 18px 18px 24px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.sp-footer .foot-left { float: none; display: flex; align-items: center; gap: 10px; }
.sp-footer .foot-center { text-align: right; font-size: 12px; }
.sp-footlinks { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 16px; }
.sp-footstats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 18px; margin-top: 10px; }
.sp-copy { margin-top: 8px; }

/* Кнопки «наверх/вниз» */
.sp-scrollbtn { position: fixed; right: 12px; z-index: 990; display: none; width: 42px; height: 42px; line-height: 0; }
.sp-scrollbtn img { width: 100%; height: 100%; object-fit: contain; }
.sp-scrollbtn--up { bottom: 66px; }
.sp-scrollbtn--down { bottom: 16px; }

/* Всплывающее окно сайта (#popup создаёт site_main.js) — не шире экрана */
#popup { max-width: calc(100vw - 16px); box-sizing: border-box; }

/* Таблицы, обёрнутые space-fx.js на узких экранах, прокручиваются по горизонтали */
.sp-xscroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.sp-xscroll > table { margin: 0; }

/* ---- Средние экраны ---- */
@media (max-width: 1180px) {
  .sp-cols { grid-template-columns: 196px minmax(0, 1fr) 196px; gap: 14px; }
  .main.sp-shell { padding: 0 12px; }
  #baner-serf { width: 400px; }
  .sp-logo__name { font-size: 26px; }
}

/* ---- Телефон и планшет: колонки → выезжающие панели ---- */
@media (max-width: 980px) {
  .main.sp-shell { padding: 0 10px; }
  .sp-header {
    flex-wrap: wrap; gap: 10px; min-height: 0; padding: 10px 0 8px;
  }
  /* После прокрутки кнопки меню «всплывают» и висят в углах экрана (класс ставит space-fx.js) */
  .sp-scrolled .sp-burger, .sp-scrolled .sp-panelbtn { position: fixed; top: 10px; z-index: 995; }
  .sp-scrolled .sp-burger { left: 10px; }
  .sp-scrolled .sp-panelbtn { right: 10px; }
  .sp-iconbtn {
    display: inline-flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px;
    width: 46px; height: 46px; padding: 0; margin: 0; cursor: pointer; flex: 0 0 auto; border-radius: 14px;
  }
  .sp-burger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s, opacity .25s; }
  .sp-left-open .sp-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .sp-left-open .sp-burger span:nth-child(2) { opacity: 0; }
  .sp-left-open .sp-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .sp-logo { flex: 1 1 auto; justify-content: center; }
  .sp-logo__emblem { width: 40px; height: 40px; }
  .sp-logo__img { max-height: 40px; max-width: 170px; }
  .sp-logo__name { font-size: 21px; }
  .sp-logo__tag { font-size: 9px; letter-spacing: 2px; margin-top: 3px; }
  .sp-header__ad { order: 10; width: 100%; margin: 0; align-items: center; }
  #baner-serf { width: 468px; height: auto; max-height: 60px; }
  /* Баннеры 468×60 вставляет site_main.js с инлайн min-width:468px — на телефоне ужимаем пропорционально */
  #banner468x60_1, #banner468x60_2 { display: block; max-width: 100%; }
  #banner468x60_1 img, #banner468x60_2 img { min-width: 0 !important; min-height: 0 !important; width: 100%; max-width: 468px; height: auto; display: block; margin: 0 auto; }
  #baner { min-height: 0 !important; }
  .sp-header__adlinks { font-size: 11px; }

  /* Верхнее меню — лента с горизонтальной прокруткой */
  .sp-topmenu .main-navigation__list {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .sp-topmenu .main-navigation__list::-webkit-scrollbar { display: none; }
  .sp-topmenu .main-navigation__item { flex: 0 0 auto; scroll-snap-align: start; }
  .sp-topmenu .main-navigation__link { padding: 13px 14px; min-height: 44px; box-sizing: border-box; white-space: nowrap; }
  .sp-topmenu .link_language { min-width: 46px; justify-content: center; }

  .sp-chain { padding: 10px 0 12px; }
  .sp-chain .link-chain { width: calc(50% - 20px); min-width: 130px; box-sizing: border-box; height: auto; }

  .sp-cols { display: block; }
  .sp-center#contentwrapper { padding: 14px 12px 30px; }

  .sp-col {
    position: fixed; top: 0; bottom: 0; z-index: 1001;
    width: min(88vw, 340px); box-sizing: border-box;
    padding: 56px 14px 30px; margin: 0;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .32s;
    visibility: hidden;
  }
  .sp-col-left { left: 0; transform: translateX(-104%); }
  .sp-col-right { right: 0; transform: translateX(104%); }
  .sp-left-open .sp-col-left, .sp-right-open .sp-col-right { transform: none; visibility: visible; transition-delay: 0s; }
  .sp-drawer-close {
    display: flex; align-items: center; justify-content: center; position: absolute; top: 8px; right: 8px;
    width: 44px; height: 44px; font-size: 30px; line-height: 1; cursor: pointer; border-radius: 12px;
  }
  .sp-shade {
    display: block; position: fixed; inset: 0; z-index: 1000; opacity: 0; pointer-events: none;
    transition: opacity .3s;
  }
  .sp-left-open .sp-shade, .sp-right-open .sp-shade { opacity: 1; pointer-events: auto; }
  body.sp-left-open, body.sp-right-open { overflow: hidden; }
  .sp-col .banners, .sp-col .banners2 { width: auto; max-width: 320px; margin-left: auto; margin-right: auto; }
  .sp-col #leftcolumn, .sp-col #rightcolumn { max-width: 320px; margin: 0 auto; }

  /* Содержимое центра: ничего не шире экрана, удобные поля и кнопки */
  #contentwrapper div, #contentwrapper form, #contentwrapper table, #contentwrapper ul,
  #contentwrapper p, #contentwrapper fieldset, #contentwrapper textarea, #contentwrapper pre { max-width: 100%; }
  #contentwrapper pre, #contentwrapper code { white-space: pre-wrap; word-break: break-word; }
  #contentwrapper { overflow-wrap: break-word; }
  #contentwrapper .btn[style*="width"] { width: auto !important; min-width: 0; }
  #contentwrapper input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="image"]),
  #contentwrapper select, #contentwrapper textarea { min-height: 44px; font-size: 16px; box-sizing: border-box; max-width: 100%; }
  #contentwrapper textarea { min-height: 88px; }
  #contentwrapper input[type="checkbox"], #contentwrapper input[type="radio"] { width: 20px; height: 20px; }
  #contentwrapper .btn, #contentwrapper button, #contentwrapper input[type="submit"], #contentwrapper input[type="button"],
  #contentwrapper .btn_big_green, #contentwrapper .btn_big_red, #contentwrapper .btn_big_orange, #contentwrapper .btn_big_blue {
    min-height: 44px; box-sizing: border-box; line-height: 1.2; padding-top: 11px; padding-bottom: 11px;
  }
  #contentwrapper .btn_big_green, #contentwrapper .btn_big_red, #contentwrapper .btn_big_orange, #contentwrapper .btn_big_blue { width: 100%; }
  #contentwrapper .flex-container { flex-wrap: wrap; justify-content: center; }
  #contentwrapper [style*="width:6"], #contentwrapper [style*="width: 6"],
  #contentwrapper [style*="width:5"], #contentwrapper [style*="width: 5"],
  #contentwrapper [style*="width:4"], #contentwrapper [style*="width: 4"] { max-width: 100% !important; box-sizing: border-box; }
  .sp-col .user_menuline, .sp-col .usermnuline-act, .sp-col .usermnutitle-g { min-height: 44px; box-sizing: border-box; display: flex; align-items: center; }

  /* Таблицы-формы, помеченные space-fx.js классом sp-stack: подпись над полем */
  table.sp-stack, table.sp-stack > tbody, table.sp-stack > thead, table.sp-stack > tbody > tr, table.sp-stack > thead > tr,
  table.sp-stack > tbody > tr > td, table.sp-stack > tbody > tr > th, table.sp-stack > tr, table.sp-stack > tr > td {
    display: block; width: auto !important; max-width: 100%; box-sizing: border-box;
  }
  table.sp-stack > tbody > tr, table.sp-stack > tr { padding: 6px 0; }
  table.sp-stack > tbody > tr > td, table.sp-stack > tbody > tr > th, table.sp-stack > tr > td { text-align: left; padding: 4px 2px; border: 0; }
  table.sp-stack > tbody > tr > td[align="center"], table.sp-stack > tbody > tr > td[colspan], table.sp-stack > tbody > tr > th { text-align: center; }
  table.sp-stack input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]), table.sp-stack textarea { width: 100%; }
  table.sp-stack select { max-width: 100%; }
  /* Значок подсказки «?» из отдельной ячейки — в правый верхний угол строки, а не отдельной строкой */
  table.sp-stack > tbody > tr { position: relative; }
  table.sp-stack > tbody > tr > td:last-child:not(:first-child):has(> .hint-quest:only-child) { position: absolute; top: 8px; right: 0; padding: 0; width: auto !important; }
  table.sp-stack > tbody > tr:has(> td:last-child > .hint-quest:only-child) > td:first-child { padding-right: 30px; }

  #popup { min-width: 0 !important; width: calc(100vw - 16px) !important; }
  #popup .text-popup { max-height: 75vh; }

  /* Подвал */
  .sp-footer .footer__container { flex-direction: column; text-align: center; }
  .sp-footer .foot-center { text-align: center; }
  .sp-footlinks, .sp-footstats { justify-content: center; }
  .sp-footlinks a { padding: 8px 4px; }
}

@media (max-width: 420px) {
  .sp-logo__tag { display: none; }
  .sp-logo__name { font-size: 19px; }
  .sp-chain .link-chain { width: 100%; }
}
