/* ==========================================================================
   4otaku — мобильный слой оформления (<= 767px)
   Подключается последним из кастом-слоёв (settings/config/assets.php, перед
   youtube.css): перекрывает скин 4otaku, bootstrap-сетку и jPlayer.
   Ничего не удаляет и не двигает в разметке — только оформление.

   18.11.2026: порт концепта из F:\Downloads\neuroeditor\4otaku-mobile
   (4otaku-mobile.css + README + скриншоты до/после; автор тестировал на
   главной, топике 3618, тексте 3593, блоге games). Адаптации при переносе:
   - .navbar-content .navbar-user -> .navbar-content .navbar-right
     (кнопка «Создать» в ряду разделов лежит в ul.navbar-right, класса
     .navbar-user там нет);
   - фон шапки #2f6ea2 (концепт) -> #3d6ea2 — фактический цвет .navbar-main
     в theme.dark.css, чтобы мобильная шапка не отличалась от десктопной;
   - удалены мёртвые правила: .user-rating-container/.user-rating,
     ul.footer-column, .similartopics-avatar (в разметке отсутствуют);
   - удалён дубль body.alto-user-role-guest .role-guest-hide
     (уже есть в assets/css/custom.css).
   ========================================================================== */

@media (max-width: 767.98px) {

  /* ---------- 0. Токены и база ---------- */
  :root {
    --m-bg: #e9eef2;
    --m-surface: #ffffff;
    --m-surface-2: #f5f8fa;
    --m-line: #e3e9ee;
    --m-text: #222e3a;
    --m-muted: #6f7c8a;
    --m-accent: #2c4d76;
    --m-accent-2: #3d6ea2;
    --m-radius: 10px;
    --m-radius-sm: 8px;
    --m-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 28px -20px rgba(16, 24, 40, .45);
    --m-gap: 10px;
    --m-cover: 240px; /* размер обложки в карточке на телефоне */
    --m-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    background: var(--m-bg) !important;
    color: var(--m-text);
    font-family: var(--m-font);
  }

  /* длинные ссылки и слова не рвут карточку */
  a, p, li, span, div, td, th, h1, h2, h3, h4 {
    overflow-wrap: break-word;
  }

  /* компактнее вертикальный ритм контента */
  .content {
    margin: 12px 0 28px !important;
    padding: 0 10px !important;
    overflow: visible !important;
  }

  #content-container,
  #sidebar-container {
    width: 100% !important;
    padding: 0 !important;
  }

  /* ---------- 1. Шапка ---------- */
  /* панель НЕ прилипает — листается со страницей; на виду всегда только
     кнопка меню (fixed, контрастная) */
  .navbar.navbar-main {
    min-height: 56px;
    background: #3d6ea2;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .10), 0 10px 24px -18px rgba(16, 24, 40, .8);
  }

  .navbar-main > .container {
    min-height: 56px;
    padding: 0 10px !important;
  }

  .navbar-main .navbar-header {
    min-height: 56px;
  }

  .navbar-main .site-info a.logo,
  .navbar-main .site-info a.logo.navbar-brand {
    height: 56px;
    max-height: 56px;
    overflow: hidden;
  }

  .navbar-toggle {
    position: fixed;
    top: 6px;
    right: 8px;
    z-index: 1040;
    width: 44px;
    height: 44px;
    margin: 6px 0 !important;
    padding: 11px !important;
    border: 0 !important;
    border-radius: var(--m-radius-sm);
    background: #2c4d76 !important;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .35);
  }

  .navbar-toggle:active,
  .navbar-toggle:focus {
    background: #365e90 !important;
  }

  .navbar-toggle .icon-bar {
    height: 2px;
    border-radius: 2px;
    /* перебить bootstrap: .navbar-default .navbar-toggle .icon-bar { #888 } */
    background: #fff !important;
  }

  /* выпадающее меню бургера: белая панель под кнопкой. position:fixed (а не
     absolute от шапки) — открывается под плавающей кнопкой на любой прокрутке */
  .navbar-main .navbar-collapse {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    margin: 0 !important;
    padding: 8px 12px 12px !important;
    border: 0;
    border-radius: 0 0 10px 10px;
    background: #fff;
    box-shadow: 0 28px 48px -28px rgba(16, 24, 40, .55);
    max-height: calc(100vh - 62px);
    overflow-y: auto;
  }

  .navbar-main .navbar-collapse .main.nav,
  .navbar-main .navbar-collapse .navbar-user {
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .navbar-main .navbar-collapse .main.nav > li,
  .navbar-main .navbar-collapse .navbar-user > li {
    display: block !important;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .navbar-main .navbar-collapse .main.nav > li > a,
  .navbar-main .navbar-collapse .navbar-user > li > a {
    display: block;
    padding: 12px 4px !important;
    border-top: 1px solid var(--m-line);
    font-size: 15px;
    line-height: 24px;
    color: #1f3552;
    text-decoration: none;
  }

  .navbar-main .navbar-collapse .main.nav > li > a:hover,
  .navbar-main .navbar-collapse .main.nav > li > a:focus {
    background: var(--m-surface-2);
  }

  /* активный пункт: белый текст на синем (моё правило пунктов темнее
     темы перебивало её актив-цвета — получался тёмный текст на тёмном) */
  .navbar-main .navbar-collapse .main.nav > li.active > a,
  .navbar-main .navbar-collapse .main.nav > li.active > a:hover,
  .navbar-main .navbar-collapse .main.nav > li.active > a:focus {
    background: var(--m-accent);
    color: #fff;
  }

  .navbar-main .navbar-collapse .main.nav > li:first-child > a,
  .navbar-main .navbar-collapse .main.nav > li.search + li > a {
    border-top: 0;
  }

  /* скрытые пункты меню не должны занимать строку */
  .navbar-main .navbar-collapse li.hidden,
  .navbar-main .navbar-collapse li.menu-hidden-container:not(:has(.menu-hidden li)),
  .navbar-content li.hidden,
  .navbar-content li.menu-hidden-container:not(:has(.menu-hidden li)) {
    display: none !important;
  }

  .navbar-main .navbar-collapse .main.nav li.search {
    padding: 4px 0 10px;
  }

  .navbar-main .navbar-collapse .main.nav li.search .form-control {
    height: 44px;
    border: 1px solid var(--m-line);
    border-radius: 8px;
    background: var(--m-surface-2);
  }

  /* ---------- 2. Лента разделов (Интересные / Новые / TOP) ---------- */
  .navbar.navbar-content {
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--m-line);
    margin-bottom: 10px !important;
    min-height: 0;
  }

  .navbar-content > .container {
    width: 100% !important;
    padding: 0 10px !important;
    display: flex !important;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* мягкий край подсказывает, что ряд можно листать */
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%);
  }

  .navbar-content > .container > div,
  .navbar-content > .container > ul {
    flex: 0 0 auto;
  }

  .navbar-content > .container::-webkit-scrollbar {
    display: none;
  }

  .navbar-content .main.nav.navbar-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: max-content;
    min-width: 100%;
    margin: 0 !important;
    padding: 8px 0 !important;
    float: none;
  }

  .navbar-content .main.nav.navbar-nav > li {
    float: none !important;
    display: block;
    width: auto !important;
    margin: 0 !important;
  }

  /* активный раздел всегда первым в ряду — видно, где находишься */
  .navbar-content .main.nav.navbar-nav > li.active {
    order: -1;
  }

  .navbar-content .main.nav.navbar-nav > li > a {
    display: block;
    padding: 7px 14px !important;
    border: 1px solid var(--m-line);
    border-radius: 999px;
    background: #fff;
    color: var(--m-accent);
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
    opacity: 1;
    text-decoration: none;
  }

  .navbar-content .main.nav.navbar-nav > li.active > a,
  .navbar-content .main.nav.navbar-nav > li.open > a {
    background: var(--m-accent);
    border-color: var(--m-accent);
    color: #fff;
  }

  /* «Создать» — компактная кнопка в том же ряду (ul.navbar-right) */
  .navbar-content .navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    float: none;
    margin: 0 !important;
    padding: 0 !important;
  }

  .navbar-content .navbar-right > li {
    float: none;
  }

  .navbar-content .navbar-right .btn {
    width: auto !important;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 20px;
    background: #fff;
    color: var(--m-accent);
    border: 1px solid var(--m-line);
    box-shadow: none;
    white-space: nowrap;
  }

  /* ---------- 3. Карточка публикации ---------- */
  .panel,
  .panel.topic {
    border: 0 !important;
    border-radius: var(--m-radius);
    background: var(--m-surface);
    box-shadow: var(--m-shadow);
    margin-bottom: var(--m-gap) !important;
    overflow: visible;
  }

  /* нижние углы карточки скругляем у подвала — иначе он вылезает за радиус */
  .content .topic .topic-footer,
  .topic-footer {
    border-radius: 0 0 var(--m-radius) var(--m-radius);
  }

  .panel > .panel-body,
  .content .topic > .panel-body {
    padding: 14px 14px 4px !important;
  }

  /* ---------- 4. Заголовок и мета ---------- */
  .topic-title,
  .content .topic .topic-title {
    margin: 0 0 8px !important;
    font-size: clamp(17px, 5vw, 21px);
    line-height: 1.28;
    font-weight: 600;
    letter-spacing: -.01em;
    color: #1d3550;
    text-wrap: balance;
  }
  .topic-title a {
    color: inherit;
    text-decoration: none;
  }

  .topic-info,
  .content .topic .topic-info {
    margin: 0 0 12px !important;
  }

  .topic-info ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    height: auto !important;
    margin: 0;
    padding: 0;
  }

  .topic-info ul li,
  .topic-info ul li.topic-user,
  .topic-info ul li.topic-blog,
  .topic-info ul li.topic-date-block {
    float: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 13px;
    line-height: 20px;
  }

  .topic-info ul li:before,
  .topic-info ul li + li:before {
    content: none !important;
  }

  .topic-info ul li.topic-user img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin: 0 !important;
  }

  .topic-info ul li.topic-user a,
  .topic-info ul li.topic-blog a {
    font-size: 13px !important;
    font-weight: 600;
    color: var(--m-accent-2);
    text-decoration: none;
  }

  .topic-info ul li.topic-date-block {
    font-size: 12px;
    color: var(--m-muted);
    margin-right: auto !important;
  }

  .topic-info ul li.topic-date-block .topic-date,
  .topic-info ul li.topic-date-block .topic-time {
    font-size: 12px !important;
    color: var(--m-muted) !important;
    white-space: nowrap;
  }

  .topic-info .label,
  .topic-info .badge {
    /* легаси темы: .topic-info ul li * получает height:32px (theme.dark.css) —
       у пилюли-лейбла фон растягивается на всю высоту строки */
    height: auto !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    font-weight: 700;
    line-height: 1.5 !important;
    letter-spacing: .03em;
    text-transform: uppercase;
    vertical-align: middle;
    box-shadow: none;
  }

  /* ---------- 5. Обложка ---------- */
  /* на десктопе это правая плашка 300px, на телефоне — аккуратная картинка по центру.
     a.unfoldable обложки — прямой ребёнок .panel-body (field.custom.single-image-uploader-show.tpl) */
  .topic > .panel-body > a.unfoldable {
    display: block !important;
    float: none !important;
    width: auto !important;
    margin: 2px auto 14px !important;
    text-align: center;
  }

  .topic > .panel-body > a.unfoldable img,
  .topic .unfoldable img[align="right"],
  .topic .unfoldable img[align="left"] {
    float: none !important;
    display: block !important;
    width: auto !important;
    max-width: min(100%, var(--m-cover, 240px)) !important;
    height: auto !important;
    margin: 0 auto !important;
    border-radius: 10px;
    box-shadow: 0 15px 35px -25px rgba(16, 24, 40, .7);
    cursor: zoom-in;
  }

  /* ---------- 6. Поля, плеер, спойлеры, скачивание ---------- */
  .topic > .panel-body > p {
    margin: 0 0 3px !important;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--m-text);
  }

  .topic > .panel-body > p strong {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--m-muted);
  }

  .topic > .panel-body > p a {
    overflow-wrap: anywhere;
  }

  /* аудиоплеер: интерфейс — флекс (легаси-флоаты скина на узком экране
     сплющивают прогресс до 13px, а плейлист — до 89px) */
  .jp-audio {
    margin: 8px 0 10px !important;
  }

  /* плеер не скругляем */
  .jp-audio .jp-interface {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 28px !important;
    padding: 0 6px;
    border-radius: 0;
  }

  /* из транспортных кнопок оставляем только «плей» */
  .jp-audio .jp-previous,
  .jp-audio .jp-next,
  .jp-audio .jp-stop,
  .jp-audio .jp-repeat,
  .jp-audio .jp-shuffle {
    display: none !important;
  }

  .jp-audio .jp-controls,
  .jp-audio .jp-progress,
  .jp-audio .jp-time-holder,
  .jp-audio .jp-volume-controls {
    float: none !important;
  }

  .jp-audio .jp-progress {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 60px;
  }

  .jp-audio .jp-time-holder {
    flex: 0 0 auto;
    width: auto !important;
  }

  /* плейлист — во всю ширину под контролами */
  .jp-playlist {
    clear: both !important;
    float: none !important;
    width: auto !important;
    max-height: 172px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    margin: 4px 0 0 !important;
  }

  .jp-playlist ul {
    margin: 0;
    padding: 0 8px !important;
  }

  /* строка трека: маркер текущего трека + название в ОДНОЙ линии.
     Внимание: скин (jplayer.4otaku.css, грузится позже) делает div
     инлайном — если делать div блоком, блок-якорь рвёт строку и маркер
     улетает на свою строку; поэтому всё инлайн, а имя трека —
     inline-block с эллипсисом */
  .jp-playlist li {
    padding: 6px 8px !important;
    /* маркер «▪» с list-style-position:inside съедает начало строки —
       inline-block имени трека не влезает рядом и переносится; текущий
       трек и так выделен цветом скина, здесь ещё и жирным */
    list-style: none !important;
  }

  .jp-playlist li.jp-playlist-current .jp-playlist-item {
    font-weight: 700;
  }

  .jp-playlist li div {
    display: inline !important;
    padding: 0 !important;
    /* против .topic-text :where(...) { font-size: inherit !important } */
    font-size: 12.5px !important;
    line-height: 1.35;
  }

  .jp-playlist li .jp-playlist-item {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    font-size: 12.5px !important;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: bottom;
  }

  /* «(mp3)» в строках плеера дублирует поле «Формат» — на телефоне убираем
     (класс генерирует jplayer.playlist.js, freeGroupClass) */
  .jp-playlist .jp-free-media {
    display: none !important;
  }

  /* спойлер «Трек-лист» / «XFD»
     (betterspoilers.css грузится после mobile.css — ключевые свойства с !important) */
  .betterspoiler {
    margin: 8px 0 !important;
    border: 1px solid var(--m-line) !important;
    border-radius: var(--m-radius-sm);
    background: var(--m-surface-2);
    padding: 0 !important;
    overflow: hidden;
  }

  .betterspoiler > .btrsplr-box {
    padding: 0 !important;
  }

  /* тоггл спойлера = невидимый чекбокс-оверлей плагина (20px поверх триггера);
     триггер стал 44px — растягиваем оверлей на всю строку, иначе тап по её
     нижней части не переключает спойлер */
  .betterspoiler > input[type="checkbox"] {
    height: 44px !important;
    margin: 0 0 -44px !important;
  }

  .btrsplr-trigger {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 12px !important;
    font-size: 14px;
    font-weight: 600;
    color: var(--m-accent);
    background-image: none !important;
  }

  .btrsplr-trigger:after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .18s ease;
    flex: 0 0 auto;
  }

  .betterspoiler > input:checked + .btrsplr-box .btrsplr-trigger:after {
    transform: rotate(-135deg);
  }

  .btrsplr-text {
    padding: 0 12px 12px !important;
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  /* «Скачать» */
  .multiple-file-upload-block {
    margin: 10px 0 !important;
    padding: 12px !important;
    border: 1px solid var(--m-line);
    border-radius: var(--m-radius-sm);
    background: var(--m-surface-2);
  }

  .multiple-file-upload-block > strong {
    display: inline;
    margin-right: 2px;
    /* !important против собственных правил .topic-text strong (секция 7) */
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--m-muted) !important;
  }

  .multiple-file-upload-block ul {
    /* легаси темы даёт ul 25px слева — прибиваем к краю карточки */
    margin: 4px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .multiple-file-upload-block li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 0 !important;
    border-top: 1px solid var(--m-line);
    font-size: 13px;
    line-height: 1.4;
  }

  .multiple-file-upload-block li:first-child {
    border-top: 0;
  }

  .multiple-file-upload-block li a {
    color: var(--m-accent-2);
    font-weight: 500;
    overflow-wrap: anywhere;
  }

  .multiple-file-upload-block li .pull-right {
    float: none !important;
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--m-muted);
    white-space: nowrap;
  }

  /* ---------- 7. Текст публикации ---------- */
  .topic-text,
  .content .topic .topic-text,
  .comment-text {
    margin: 4px 0 10px !important;
    font-family: var(--m-font) !important;
    font-size: 15px !important;
    line-height: 1.62 !important;
    color: var(--m-text);
    text-wrap: pretty;
    hyphens: auto;
    -webkit-hyphens: auto;
  }

  /* скин ставит 13px всем потомкам — возвращаем наследование */
  .topic-text :where(p, li, span, b, strong, em, i, a, div, blockquote),
  .comment-text :where(p, li, span, b, strong, em, i, a, div, blockquote) {
    font-size: inherit !important;
    line-height: inherit;
  }

  .topic-text p,
  .comment-text p {
    margin: 0 0 .75em;
  }

  .topic-text b,
  .topic-text strong,
  .comment-text b,
  .comment-text strong {
    font-weight: 600;
    color: var(--m-text);
  }

  .topic-text a,
  .comment-text a {
    color: var(--m-accent-2);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
  }

  .topic-text ul,
  .topic-text ol {
    margin: 0 0 .9em;
    padding-left: 1.15em;
  }

  .topic-text li,
  .content .topic .topic-text li:where(:not(.jp-audio li)) {
    margin: .2em 0;
    line-height: 1.55 !important;
  }

  .topic-text img,
  .topic-text canvas,
  .topic-text iframe,
  .topic-text video {
    max-width: 100% !important;
    height: auto;
    border-radius: var(--m-radius-sm);
  }

  .topic-text img {
    max-height: 70vh;
    object-fit: contain;
    margin: 10px auto;
  }

  .topic-text iframe {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
  }

  .topic-text blockquote {
    margin: 1em 0;
    padding: 10px 14px;
    border-left: 3px solid var(--m-line);
    border-radius: 0 var(--m-radius-sm) var(--m-radius-sm) 0;
    background: var(--m-surface-2);
    color: #3b4753;
  }

  .topic-text pre,
  .topic-text code {
    font-size: 13px;
    border-radius: 6px;
  }

  .topic-text pre {
    padding: 12px;
    overflow-x: auto;
  }

  /* таблицы из старых постов — горизонтальный скролл вместо разъезда */
  .topic-text table,
  .comment-text table {
    display: block;
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
  }

  .topic-text table td,
  .topic-text table th {
    padding: 6px 8px;
    font-size: 13px;
  }

  /* ---------- 8. Теги и подвал карточки ---------- */
  .tags_and_share {
    margin: 0 -14px !important;
    padding: 0 14px !important;
  }

  .topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 12px !important;
    padding: 0 !important;
    font-size: 0 !important;
  }

  .topic-tags li {
    display: block;
    margin: 0 !important;
    line-height: 1 !important;
  }

  .topic-tags li a,
  .tags_and_share .topic-tags a {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2f6;
    color: #45566a;
    font-size: 12px !important;
    line-height: 16px !important;
    text-decoration: none !important;
  }

  .content .topic .topic-footer,
  .topic-footer {
    background: #fff !important;
    border-top: 1px solid var(--m-line);
    padding: 0 !important;
    /* тема держит футер 40px (line-height:40px) — при переносе на 2 строки
       вторая строка обрезалась */
    height: auto !important;
  }

  .content .topic .topic-footer ul {
    display: flex;
    align-items: center;
    height: auto !important;
    padding: 4px 10px !important;
  }

  /* если пункты не влезают в строку — переносим на следующую, а не сплющиваем
     li (flex-shrink сжимает их до переноса иконок внутри, футер «съезжает») */
  .content .topic .topic-footer ul,
  .content .panel .panel-footer ul {
    flex-wrap: wrap;
  }

  .content .topic .topic-footer ul li,
  .content .panel .panel-footer ul li {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .content .topic .topic-footer ul li,
  .content .panel .panel-footer ul li {
    padding: 8px 4px !important;
    margin-right: 4px !important;
    line-height: 20px !important;
  }

  .content .topic .topic-footer ul li a,
  .content .topic .topic-footer ul li span {
    font-size: 13px !important;
    color: #4c5b6b;
  }

  .content .topic .topic-footer ul li.topic-controls {
    margin-left: auto !important;
    padding-right: 0 !important;
  }

  /* ---------- 8b. Контролы футера под кнопкой «⋯» (тогглит theme.js) ---------- */
  .topic-footer .topic-controls {
    position: relative;
  }

  .topic-footer .topic-controls .m-controls-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
    margin: 0 -2px;
    padding: 0 8px;
    color: #4c5b6b;
    font-size: 15px;
    text-decoration: none;
  }

  .topic-footer .topic-controls .m-controls-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 30;
    display: none;
    min-width: 170px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--m-line);
    border-radius: var(--m-radius-sm);
    background: var(--m-surface);
    box-shadow: var(--m-shadow);
  }

  .topic-footer .topic-controls.m-open .m-controls-popover {
    display: block;
  }

  /* пункты поповера: ссылки и форма одобрения — одинаковые строки;
     перебиваем легаси-разделители .topic-controls a:not(:last-child) */
  .topic-footer .topic-controls .m-controls-popover a,
  .topic-footer .topic-controls .m-controls-popover form {
    display: flex !important;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0 !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 6px;
    font-size: 14px !important;
    line-height: 20px !important;
    color: var(--m-accent-2) !important;
    text-decoration: none;
    white-space: nowrap;
  }

  .topic-footer .topic-controls .m-controls-popover a:active,
  .topic-footer .topic-controls .m-controls-popover form:active {
    background: var(--m-surface-2);
  }

  /* ---------- 9. Комментарии ---------- */
  /* гостю вместо пустого блока показываем аккуратную плашку */
  #comments {
    color: var(--m-muted);
    font-size: 13px;
    line-height: 1.5;
  }

  #comments .comment-wrapper:empty {
    display: none;
  }

  #comments:not(:has(.comment)) {
    padding: 14px;
    border-radius: var(--m-radius);
    background: var(--m-surface);
    box-shadow: var(--m-shadow);
  }

  .panel.comment {
    border-radius: var(--m-radius);
  }

  .panel.comment > .panel-body {
    padding: 14px !important;
  }

  .panel.comment .comment-content .comment-text {
    font-size: 14.5px !important;
    line-height: 1.55 !important;
  }

  .panel.comment .comment-content .comment-tools ul li,
  .panel.comment .comment-content .comment-tools ul li a {
    font-size: 12.5px;
  }

  .panel.comment .comment-content .comment-tools ul li.comment-user a {
    font-size: 14px;
    margin-left: 0;
  }

  .panel.comment .comment-content .comment-tools ul li.comment-user img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
  }

  /* на телефоне глубокие уровни не должны сужать текст до полоски */
  .comment-level-2, .wrapper-level-2 .comment-reply { margin-left: 12px !important; }
  .comment-level-3, .wrapper-level-3 .comment-reply { margin-left: 12px !important; }
  .comment-level-4, .wrapper-level-4 .comment-reply { margin-left: 12px !important; }
  .comment-level-5, .comment-level-6, .comment-level-7,
  .wrapper-level-5 .comment-reply, .wrapper-level-6 .comment-reply, .wrapper-level-7 .comment-reply {
    margin-left: 0 !important;
  }

  /* ---------- 10. Сайдбар ---------- */
  .sidebar h4 {
    padding-bottom: 10px;
    font-size: 16px;
  }

  .sidebar > .panel > .panel-body,
  .sidebar .panel-body {
    padding: 14px 14px 16px !important;
  }

  /* аватар блога раньше растягивался на пол-экрана */
  .widget-blog-about .panel-content > img,
  .widget-blog-about img {
    width: 88px !important;
    height: 88px !important;
    max-width: 88px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 10px;
    display: block;
  }

  .widget-blog-about .panel-content {
    text-align: center;
    min-height: 0 !important;
  }

  /* поиск в сайдбаре — отдельной карточкой, а не голой строкой на фоне */
  #sidebar-container > form.form {
    margin: 0 0 var(--m-gap) !important;
    padding: 8px !important;
    border-radius: var(--m-radius);
    background: var(--m-surface);
    box-shadow: var(--m-shadow);
  }

  #sidebar-container > form.form .form-control {
    height: 44px;
    border: 1px solid var(--m-line) !important;
    border-radius: 8px 0 0 8px !important;
  }

  #sidebar-container > form.form .input-group-btn .btn,
  #sidebar-container > form.form .btn {
    height: 44px;
    border-radius: 0 8px 8px 0 !important;
  }

  /* похожие статьи: одна колонка, миниатюра 64px, две строки заголовка */
  .simtopics-content ul {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .simtopics-content li {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 10px;
    align-items: start;
    float: none !important;
    width: 100% !important;
    padding: 10px 0 !important;
    border-top: 1px solid var(--m-line);
  }

  .simtopics-content li:first-child {
    border-top: 0;
    padding-top: 0 !important;
  }

  .simtopics-topic-preview {
    grid-row: 1 / span 2;
    display: block !important;
  }

  .simtopics-topic-preview img {
    width: 64px !important;
    height: 64px !important;
    object-fit: cover;
    border-radius: 8px;
    display: block;
  }

  .simtopics-topic-title {
    grid-column: 2;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    color: var(--m-accent-2);
    text-decoration: none;
  }

  /* если у похожей статьи нет миниатюры — заголовок на всю ширину */
  .simtopics-content li:not(:has(.simtopics-topic-preview img)) {
    grid-template-columns: 1fr;
  }

  .simtopics-content li:not(:has(.simtopics-topic-preview img)) .simtopics-topic-title {
    grid-column: 1;
  }

  /* intro-блок: класс с опечаткой «simitopics-» — так он реально называется
     в шаблоне и CSS плагина similartopics */
  .simitopics-topic-intro {
    display: none !important;
  }

  /* плавающий правый тулбар перекрывает карточки (на ≤767px он и так пуст —
     theme.dark.css прячет всех детей) */
  .toolbar,
  .toolbar-container {
    display: none !important;
  }

  /* лента «Прямой эфир» */
  .feed-comment,
  .feed-topic {
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .feed-comment .feed-comment-text,
  .feed-topic .feed-topic-text {
    font-size: 13px;
    line-height: 1.45;
  }

  /* облако тегов — пилюли */
  .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
  }

  .tag-cloud li {
    display: block !important;
    line-height: 1 !important;
  }

  .tag-cloud li a {
    display: inline-block;
    padding: 6px 9px;
    border-radius: 999px;
    background: #eef2f6;
    text-decoration: none;
  }

  .tag-cloud li a span[class^="tag-size-"] {
    font-size: 12.5px !important;
    color: #45566a !important;
  }

  /* ---------- 10b. Страница блога ---------- */
  .panel.user-info .user-logo {
    width: 64px !important;
    height: 64px !important;
    border-radius: 10px !important;
    object-fit: cover;
  }

  .panel.user-info .user-name {
    margin-left: 80px !important;
  }

  .panel.user-info .user-name .user-login-block {
    border-bottom: 0;
    margin-bottom: 2px;
    line-height: 26px;
  }

  .panel.user-info .user-login {
    font-size: 20px !important;
    line-height: 26px !important;
    font-weight: 600;
  }

  .panel.user-info .user-full-name {
    font-size: 13px !important;
    line-height: 18px !important;
  }

  .panel.user-info .panel-footer {
    border-radius: 0 0 var(--m-radius) var(--m-radius);
  }

  .panel.user-info .panel-footer ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .panel.user-info .panel-footer li {
    margin: 0 !important;
    line-height: 24px !important;
  }

  .panel.user-info .panel-footer li.pull-right {
    margin-left: auto !important;
  }

  /* фильтры внутри блога — тот же ряд пилюль, что и в шапке */
  .blog-submenu {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 0 10px !important;
    padding: 0 0 2px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .blog-submenu::-webkit-scrollbar {
    display: none;
  }

  .blog-submenu > * {
    flex: 0 0 auto;
    float: none !important;
    margin: 0 !important;
  }

  .blog-submenu .btn {
    padding: 7px 12px !important;
    border: 1px solid var(--m-line) !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--m-accent) !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 20px !important;
    box-shadow: none !important;
    white-space: nowrap;
  }

  /* ---------- 11. Подвал ---------- */
  /* подвал виджета абсолютный — оставляем ему место, иначе он режет список */
  .sidebar .panel:has(> .panel-footer) > .panel-body {
    padding-bottom: 52px !important;
  }

  .sidebar .panel-footer {
    border-radius: 0 0 var(--m-radius) var(--m-radius);
  }

  .footer-container {
    padding: 20px 0 !important;
  }

  .footer-container,
  .footer-container .footer,
  .footer-container .footer a {
    color: #e8f0f7;
  }

  .footer-container .footer h4 {
    color: #fff;
    font-size: 14px;
    margin-bottom: 8px;
  }

  .footer-container .footer {
    font-size: 13px;
    line-height: 1.9;
  }

  .footer-container .footer .mascot,
  .footer-container .footer .mascot img {
    max-width: 120px;
    opacity: .9;
  }

  /* ---------- 11b. Постраничная навигация ---------- */
  /* легаси: li inline-block с маргинами — на узком экране ряды ломаются
     как попало, стрелки остаются сиротами */
  .paginator ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
  }

  .paginator ul li {
    display: block !important;
    float: none !important;
    margin: 0 !important;
  }

  .paginator ul li a,
  .paginator ul li span {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0 !important;
    padding: 0 8px !important;
    border: 1px solid var(--m-line);
    border-radius: var(--m-radius-sm);
    background: var(--m-surface);
    font-size: 14px !important;
    color: var(--m-accent) !important;
    text-decoration: none;
  }

  .paginator ul li.active span {
    background: var(--m-accent);
    border-color: var(--m-accent);
    color: #fff !important;
    font-weight: 600;
  }

  .paginator ul li.disabled span {
    opacity: .45;
  }

  /* ---------- 12. Формы и модальные окна ---------- */
  /* iOS не зумит страницу, если в поле 16px */
  .form-control,
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="email"],
  textarea,
  select {
    font-size: 16px !important;
    min-height: 42px;
    border-radius: 8px;
  }

  .btn {
    min-height: 40px;
    border-radius: 8px;
  }

  .modal .modal-dialog,
  .modal.modal-write .modal-dialog {
    width: auto !important;
    margin: 12px;
  }

  /* ---------- 13. Узкие телефоны ---------- */
  @media (max-width: 380px) {
    .topic > .panel-body > a.unfoldable img {
      max-width: 100% !important;
    }

    .topic-text {
      font-size: 14.5px !important;
    }

    .simtopics-content ul {
      grid-template-columns: 1fr;
    }
  }

  /* ---------- 14. Доступность ---------- */
  @media (prefers-reduced-motion: reduce) {
    .btrsplr-trigger:after {
      transition: none;
    }
  }
}
/* Тамбы webm-видео со старого сайта (norma/topic.css): пунктирная рамка, бейдж «webm», рука.
   Курсор вешается на обёртку — картинки контента получают cursor: inherit из темы,
   и рука от обёртки доходит до тамба без конфликта специфичности */
.webm {
	border: thin dashed #008000;
}
.webm-wrapper {
	position: relative;
	cursor: pointer;
}
.webm-wrapper:before {
	position: absolute;
	content: "webm";
	color: #4679BD;
	font-size: 10px;
	font-family: 'Courier New', Courier, monospace;
	background: rgba(255,255,255,0.6);
	padding: 0 4px;
	z-index: 1;
	font-smooth: never;
	-webkit-font-smoothing: none;
}
.webm-wrapper:hover:before {
	content: "";
}
@charset "UTF-8";
/*
 * jQuery File Upload Plugin CSS 1.3.0
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2013, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

.fileinput-button {
  position: relative;
  overflow: hidden;
  display: inline-block;
}
.fileinput-button input {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  opacity: 0;
  -ms-filter: 'alpha(opacity=0)';
  font-size: 200px;
  direction: ltr;
  cursor: pointer;
}

/* Fixes for IE < 8 */
@media screen\9 {
  .fileinput-button input {
    filter: alpha(opacity=0);
    font-size: 100%;
    height: 100%;
  }
}
@charset "UTF-8";
/*
 * jQuery File Upload UI Plugin CSS 9.0.0
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2010, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

.fileupload-buttonbar .btn,
.fileupload-buttonbar .toggle {
  margin-bottom: 5px;
}
.progress-animated .progress-bar,
.progress-animated .bar {
  background: url("/_run/assets/2239ea7d/progressbar.gif") !important;
  filter: none;
}
.fileupload-process {
  float: right;
  display: none;
}
.fileupload-processing .fileupload-process,
.files .processing .preview {
  display: block;
  width: 32px;
  height: 32px;
  background: url("/_run/assets/2239ea7d/loading.gif") center no-repeat;
  background-size: contain;
}
.files audio,
.files video {
  max-width: 300px;
}

@media (max-width: 767px) {
  .fileupload-buttonbar .toggle,
  .files .toggle,
  .files .btn span {
    display: none;
  }
  .files .name {
    width: 80px;
    word-wrap: break-word;
  }
  .files audio,
  .files video {
    max-width: 80px;
  }
  .files img,
  .files canvas {
    max-width: 100%;
  }
}
#multiple-file-upload .table > tbody > tr > td {
	vertical-align: middle;
}

#multiple-file-upload .size {
	color: #000;
	white-space: nowrap;
}

#multiple-file-upload .table {
	margin-bottom: 0;
}

.multiple-file-upload-block {
	margin: 10px 0;
}

ul.multiple-file-upload {
	counter-reset: mfu-item;
	margin: 5px 0 0;
}

ul.multiple-file-upload > li {
	counter-increment: mfu-item;
}

ul.multiple-file-upload > li::before {
	content: counter(mfu-item) ". ";
}

/* Ссылка «показать остальные» — без номера */
ul.multiple-file-upload > li.mfu-more {
	counter-increment: none;
}

ul.multiple-file-upload > li.mfu-more::before {
	content: none;
}

#multiple-file-upload .fileinput-button input {
	bottom: 0;
}

#multiple-file-upload .progress {
	margin-bottom: 0;
}
.nsfw-pictures canvas {
	image-rendering: optimizeSpeed;
	image-rendering: -moz-crisp-edges;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: -o-crisp-edges;
	image-rendering: crisp-edges;

	vertical-align: top;
}

.nsfw-pictures canvas[align="right"] {
	float: right;
	margin: 0 0 12px 12px;
}

.nsfw-pictures canvas[align="left"] {
	float: left;
	margin: 0 12px 12px 0;
}

.nsfw-pictures canvas.image-center {
	display: block;
	margin: 0 auto;
}

.no-js .nsfw-pictures .topic-text img,
.no-js .nsfw-pictures .topic-photoset img {
	filter: blur(3px);
}

.no-js .nsfw-pictures .topic-text img:hover,
.no-js .nsfw-pictures .topic-photoset img:hover {
	filter: none;
}

.nsfw-pictures.topic {
	overflow: visible;
}

.content {
	overflow: hidden;
}

/* в теме experience simple недостаточно точные селекторы, так что переопределяем тут */
.content .topic .topic-footer ul ul {
	height: auto;
	padding: 0;
}

.content .topic .topic-footer ul li li {
	display: block;
	float: none;
	padding: 0;
}
/*
 * Иконка кнопки «Ромадзи» в тулбаре MarkItUp!
 * (свои картинки вместо скинового спрайта editor_icons.png)
 */
.markItUp .editor-romaji a {
	background: url(/_run/assets/12a2c6ac/romaji.png) no-repeat;
}
.markItUp .editor-romaji a:hover,
.markItUp .editor-romaji a:active {
	background: url(/_run/assets/12a2c6ac/romaji-active.png) no-repeat;
}

/*
 * Стиль контента: ромадзи хранится как <span class="romaji" title="..."> —
 * пунктирное подчёркивание + курсор «помощь»; подсказка — тултип сайта
 * (Bootstrap), init в romaji.js. Правило глобальное: класс romaji порождается
 * только колбэком плагина, других источников нет — покрывает контент топиков
 * (.topic-text), комментариев (.comment-text), кастом-полей (panel-body p)
 * и прочие контексты (лента, дайджест) без дублирования скоупов скина.
 */
.romaji {
	border-bottom: 1px dotted #999;
	cursor: help;
}
.user-rating-container .vote-total {
    padding: 12px;
    margin: 0;
    border-radius: 24px;
    color: white;
}

.user-rating-container span.vote-count-positive, .user-rating-container span.vote-total {
    background-color: rgb(87, 168, 57) !important;
}

.user-rating-container span.vote-count-negative, .user-rating-container span.vote-total {
    background-color: rgb(196, 58, 58);
}

.user-rating-container .user-rating-header {
    margin-bottom: 24px;
    margin-top: 6px;
    padding-top: 6px;
    border-radius: 0;
}

.user-info .user-power-container > div {
    background-color: transparent;
    margin-top: 0;
    padding: 0;
    padding-top: 12px;
}

.user-power-header, .user-rating-header {
    line-height: 20px;
    color: #1c374c;
    font-size: 18px;
    margin-bottom: 10.5px;
}

.user-power-container .user-power {
    padding: 12px;
    margin: 0;
    border-radius: 24px;
    background-color: #dae2e5;
}

.vote-popover + .popover {
    border-radius: 0 !important;
    padding: 0 !important;
    max-height: 126px !important;
    height: 126px !important;
    max-width: 72px !important;
    width: 72px !important;
    margin-left: -3px !important;
    border: 1px solid rgb(188, 188, 188) !important;
}

.vote-popover + .popover .arrow::after {
    border-top-color: rgb(245, 246, 248) !important;
}

.vote-popover + .popover .popover-content {
    padding: 0 !important;
    background: rgb(245, 246, 248) !important;
    height: 100% !important;

}

.vote-popover + .popover ul {
    display: block !important;
    width: 100%;
    position: absolute;
    bottom: 12px;
}

.vote-popover + .popover ul li.positive { color: rgb(87, 168, 57); }
.vote-popover + .popover ul li.abstain { color: rgb(147, 166, 173)}
.vote-popover + .popover ul li.negative {  color: rgb(196, 58, 58); }
.vote-popover + .popover ul li {
    display: block !important;
    padding: 2px 0 !important;
    text-align: center;
}


.graph-container {
    height: 100px;
}
.graph-background {
    background-color: rgb(147, 166, 173);
    position: absolute;
    width: 48px;
    height: 48px;
    margin: 11px;
    border-radius: 48px;

}
.graph {
    position: absolute;
    width: 48px;
    height: 48px;
    margin: 11px;
    border-radius: 48px;
    clip: rect(0px, 48px, 48px, 24px);
}
.graph-holder {
    position: absolute;
    padding: 15px 0;
    margin: 15px;
    z-index: 2;
    text-align: center;
    font-size: 13px;
    color: #1c374c;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 20px;
}
.graph > div {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50px;
    clip: rect(0px, 24px, 48px, 0px);
}

.graph-negative > div {
    background-color: rgb(196, 58, 58);
    /*-webkit-transform:rotate(120deg);*/
    /*-moz-transform:rotate(120deg);*/
    /*-o-transform:rotate(120deg);*/
    /*transform:rotate(120deg);*/
}

.graph-positive > div {
    background-color: rgb(87, 168, 57);
    /*-webkit-transform:rotate(120deg);*/
    /*-moz-transform:rotate(120deg);*/
    /*-o-transform:rotate(120deg);*/
    /*transform:rotate(120deg);*/
}
