/* Стили для HTML, который сохраняется из TinyMCE.
   Должны совпадать с content_style в settings.TINYMCE_DEFAULT_CONFIG,
   чтобы то же самое было видно и в редакторе, и на сайте. */

/* --- Изображения --------------------------------------------------------- */

img.img-float-left {
    float: left;
    margin: 0 1em 1em 0;
    max-width: 50%;
    height: auto;
}

img.img-float-right {
    float: right;
    margin: 0 0 1em 1em;
    max-width: 50%;
    height: auto;
}

img.img-center {
    display: block;
    margin: 1em auto;
    max-width: 100%;
    height: auto;
}

/* --- Таблицы со скроллом -------------------------------------------------- */

table.table-scroll {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

table.table-scroll th,
table.table-scroll td {
    white-space: nowrap;
}

/* --- Clearfix для контейнеров с плавающими картинками -------------------- */
/* Без этого блок, в который вставлена `img.img-float-*`, не охватит её
   высоту, и следующий за ним блок «налипнет» на картинку. */

.rich-content::after,
.tab-content::after,
.single__news-description::after,
.info__body::after,
.foreigners__main-description-text::after {
    content: "";
    display: table;
    clear: both;
}

/* --- Брендовые ссылки ----------------------------------------------------- */
/* Покрываем ссылки внутри любого rich-text/контейнера, в который вставляется
   HTML из TinyMCE (description|safe). Descendant-комбинатор (пробел) ловит
   ссылки на ЛЮБОЙ глубине вложенности — TinyMCE может оборачивать <a> в <strong>,
   <span>, вложенные <ul> и т. д. Также покрыты ссылки в кастомных компонентах
   (карточки заявок, таблицы списков, аккордеон, спойлеры с документами).

   Этот блок ЖИВЁТ ИМЕННО ЗДЕСЬ (rich-content.css), а не в style.css —
   потому что подключается отдельным <link> ПОСЛЕ style.css и тем самым
   остаётся unlayered. Внутри @layer его перебивал бы глобальный
   `a { color: inherit }` в @layer base. */

.application a,
.archive__main a,
.fl-table a,
.foreigners__main-description-text a,
.info__body a,
.list__link,
.news-card a,
.rich-content a,
.single__news-description a,
.tab-content a,
.admission__panel a,
.docs__main details a,
.link-brand,
.link-brand a {
    color: var(--c-brand);
    text-decoration: underline var(--c-brand);
    text-underline-offset: 4px;
}

/* --- Типографика для богатого контента --------------------------------- */
/* Освежает вывод TinyMCE-описаний: иерархия заголовков, списки,
   цитаты, разделители. Применяется ко всем контейнерам, помеченным
   .rich-content (admission__panel, news-card, foreigners, info, archive). */

.rich-content {
    color: var(--c-text);
    font-size: 16px;
    line-height: 1.65;
}

.rich-content > *:first-child { margin-top: 0; }
.rich-content > *:last-child  { margin-bottom: 0; }

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
    color: var(--c-brand);
    font-weight: 600;
    letter-spacing: -0.005em;
    margin: 1.6em 0 0.6em;
    line-height: 1.3;
}

.rich-content h1 { font-size: 26px; }
.rich-content h2 { font-size: 22px; }
.rich-content h3 { font-size: 19px; }
.rich-content h4 { font-size: 17px; }

.rich-content h2::after,
.rich-content h3::after {
    content: '';
    display: block;
    width: 36px;
    height: 2px;
    background: var(--c-brand-21);
    border-radius: 2px;
    margin-top: 8px;
}

.rich-content p { margin: 0 0 1em; }

.rich-content strong { font-weight: 700; color: var(--c-text); }
.rich-content em     { font-style: italic; }

.rich-content ul,
.rich-content ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

.rich-content ul li,
.rich-content ol li {
    margin: 0.3em 0;
    list-style-type: disc;
}

.rich-content ol li { list-style-type: decimal; }

.rich-content ul li::marker { color: var(--c-brand); }
.rich-content ol li::marker { color: var(--c-brand); font-weight: 700; }

.rich-content blockquote {
    margin: 1.2em 0;
    padding: 14px 20px;
    background: rgba(21, 75, 136, 0.04);
    border-left: 3px solid var(--c-brand);
    border-radius: 6px;
    font-style: italic;
    color: var(--c-text);
}

.rich-content blockquote p:last-child { margin-bottom: 0; }

.rich-content hr {
    border: none;
    height: 1px;
    background: var(--c-brand-21);
    margin: 2em 0;
}

.rich-content code {
    background: var(--c-bg-soft);
    border: 1px solid var(--c-brand-21);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'PT Mono', 'Consolas', monospace;
    font-size: 0.92em;
    color: var(--c-brand);
}

/* --- Нормализация инлайн-форматирования из TinyMCE -----------------------
   TinyMCE сохраняет выбор шрифта/размера/цвета как inline-style на <span>
   и <font>. Чтобы единообразие сайта не ломалось произвольным выбором
   администратора, перебиваем эти inline-стили !important: font-family
   всегда наследуется от страницы, а цвет/декорация ссылок и базовое
   оформление bold/italic/underline остаются одинаковыми везде. */

.rich-content,
.rich-content *,
.archive__main .rich-content *,
.foreigners__main-description-text *,
.info__body *,
.news-card *,
.single__news-description *,
.tab-content *,
.admission__panel *,
.application *,
.docs__main details * {
    font-family: inherit !important;
}

/* Ссылки: одинаковый бренд-цвет и подчёркивание независимо от того,
   что админ выбрал в TinyMCE (forecolor/backcolor/font-size).
   Background-color из inline тоже подавляем — иначе ссылка может
   получить случайную заливку. */
.application a,
.archive__main a,
.foreigners__main-description-text a,
.info__body a,
.news-card a,
.rich-content a,
.single__news-description a,
.tab-content a,
.admission__panel a,
.docs__main details a {
    color: var(--c-brand) !important;
    background-color: transparent !important;
    text-decoration: underline var(--c-brand) !important;
    text-underline-offset: 4px;
}

/* Bold/italic/underline: единый внешний вид. Цвет не трогаем у обычного
   текста (админ может выделять цветом абзацы), но у выделений нормализуем
   и снимаем шрифт. */
.rich-content b,
.rich-content strong {
    font-weight: 700 !important;
    font-style: normal;
}

.rich-content i,
.rich-content em {
    font-style: italic !important;
    font-weight: inherit;
}

.rich-content u {
    text-decoration: underline !important;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* TinyMCE может вкладывать форматирование (<strong><em><u>) в произвольном
   порядке — гарантируем, что все три модификатора срабатывают совместно. */
.rich-content strong em,
.rich-content em strong {
    font-weight: 700 !important;
    font-style: italic !important;
}

/* --- Таблицы из TinyMCE: стиль .lists__table со страницы --------------- */
/* "/hod-priema/spiski-postupayushih/". Применяется ко всем контейнерам,
   куда выводится HTML из TinyMCE через {{ ...|safe }}: новости, новостные
   карточки, info, archive, контакты, иностранцы, обращение ректора и т. д.

   TinyMCE по умолчанию вставляет <table border="1" style="border-collapse:
   collapse; width: ...%"> и инлайн-ширины на ячейках — перебиваем через
   !important. Шапка стилизуется и для <th>, и для <td> в первой строке,
   потому что TinyMCE не помечает первую строку <th> автоматически. */

.application table:not(.table-scroll),
.archive__main table:not(.table-scroll),
.contacts__description table:not(.table-scroll),
.foreigners__main-description-text table:not(.table-scroll),
.foreigners__text table:not(.table-scroll),
.info__body table:not(.table-scroll),
.news-card table:not(.table-scroll),
.rector-quote__text table:not(.table-scroll),
.rich-content table:not(.table-scroll),
.single__news-description table:not(.table-scroll),
.tab-content table:not(.table-scroll),
.admission__panel table:not(.table-scroll),
.admission__panel-body table:not(.table-scroll),
.docs__main details table:not(.table-scroll),
.univer-post__text table:not(.table-scroll) {
    width: 100% !important;
    max-width: 100%;
    margin: 1.2em 0;
    background: var(--c-white) !important;
    border: 1px solid rgba(21, 75, 136, 0.14) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 12px -6px rgba(21, 75, 136, 0.1);
    font-size: 14px;
    color: var(--c-text);
}

.application table:not(.table-scroll) :is(th, td),
.archive__main table:not(.table-scroll) :is(th, td),
.contacts__description table:not(.table-scroll) :is(th, td),
.foreigners__main-description-text table:not(.table-scroll) :is(th, td),
.foreigners__text table:not(.table-scroll) :is(th, td),
.info__body table:not(.table-scroll) :is(th, td),
.news-card table:not(.table-scroll) :is(th, td),
.rector-quote__text table:not(.table-scroll) :is(th, td),
.rich-content table:not(.table-scroll) :is(th, td),
.single__news-description table:not(.table-scroll) :is(th, td),
.tab-content table:not(.table-scroll) :is(th, td),
.admission__panel table:not(.table-scroll) :is(th, td),
.admission__panel-body table:not(.table-scroll) :is(th, td),
.docs__main details table:not(.table-scroll) :is(th, td),
.univer-post__text table:not(.table-scroll) :is(th, td) {
    padding: 11px 14px !important;
    border: none !important;
    border-right: 1px solid rgba(21, 75, 136, 0.06) !important;
    border-bottom: 1px solid rgba(21, 75, 136, 0.06) !important;
    text-align: center !important;
    vertical-align: middle !important;
    line-height: 1.4;
    background-color: transparent;
}

/* TinyMCE оборачивает содержимое ячейки в <p>. Дефолтные вертикальные
   отступы <p> ломают визуальное центрирование — обнуляем их. */
.application table:not(.table-scroll) :is(th, td) > p,
.archive__main table:not(.table-scroll) :is(th, td) > p,
.contacts__description table:not(.table-scroll) :is(th, td) > p,
.foreigners__main-description-text table:not(.table-scroll) :is(th, td) > p,
.foreigners__text table:not(.table-scroll) :is(th, td) > p,
.info__body table:not(.table-scroll) :is(th, td) > p,
.news-card table:not(.table-scroll) :is(th, td) > p,
.rector-quote__text table:not(.table-scroll) :is(th, td) > p,
.rich-content table:not(.table-scroll) :is(th, td) > p,
.single__news-description table:not(.table-scroll) :is(th, td) > p,
.tab-content table:not(.table-scroll) :is(th, td) > p,
.admission__panel table:not(.table-scroll) :is(th, td) > p,
.admission__panel-body table:not(.table-scroll) :is(th, td) > p,
.docs__main details table:not(.table-scroll) :is(th, td) > p,
.univer-post__text table:not(.table-scroll) :is(th, td) > p {
    margin: 0 !important;
}

/* Последняя колонка — без правой границы (контейнер уже даёт рамку). */
.application table:not(.table-scroll) :is(th, td):last-child,
.archive__main table:not(.table-scroll) :is(th, td):last-child,
.contacts__description table:not(.table-scroll) :is(th, td):last-child,
.foreigners__main-description-text table:not(.table-scroll) :is(th, td):last-child,
.foreigners__text table:not(.table-scroll) :is(th, td):last-child,
.info__body table:not(.table-scroll) :is(th, td):last-child,
.news-card table:not(.table-scroll) :is(th, td):last-child,
.rector-quote__text table:not(.table-scroll) :is(th, td):last-child,
.rich-content table:not(.table-scroll) :is(th, td):last-child,
.single__news-description table:not(.table-scroll) :is(th, td):last-child,
.tab-content table:not(.table-scroll) :is(th, td):last-child,
.admission__panel table:not(.table-scroll) :is(th, td):last-child,
.admission__panel-body table:not(.table-scroll) :is(th, td):last-child,
.docs__main details table:not(.table-scroll) :is(th, td):last-child,
.univer-post__text table:not(.table-scroll) :is(th, td):last-child {
    border-right: none !important;
}

/* Шапка — <thead> th/td ИЛИ первая строка таблицы (TinyMCE не оборачивает
   первую строку в <thead> и не делает её <th> автоматически). */
.application table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.application table:not(.table-scroll) > tr:first-child > :is(th, td),
.archive__main table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.archive__main table:not(.table-scroll) > tr:first-child > :is(th, td),
.contacts__description table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.contacts__description table:not(.table-scroll) > tr:first-child > :is(th, td),
.foreigners__main-description-text table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.foreigners__main-description-text table:not(.table-scroll) > tr:first-child > :is(th, td),
.foreigners__text table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.foreigners__text table:not(.table-scroll) > tr:first-child > :is(th, td),
.info__body table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.info__body table:not(.table-scroll) > tr:first-child > :is(th, td),
.news-card table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.news-card table:not(.table-scroll) > tr:first-child > :is(th, td),
.rector-quote__text table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.rector-quote__text table:not(.table-scroll) > tr:first-child > :is(th, td),
.rich-content table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.rich-content table:not(.table-scroll) > tr:first-child > :is(th, td),
.single__news-description table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.single__news-description table:not(.table-scroll) > tr:first-child > :is(th, td),
.tab-content table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.tab-content table:not(.table-scroll) > tr:first-child > :is(th, td),
.admission__panel table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.admission__panel table:not(.table-scroll) > tr:first-child > :is(th, td),
.admission__panel-body table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.admission__panel-body table:not(.table-scroll) > tr:first-child > :is(th, td),
.docs__main details table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.docs__main details table:not(.table-scroll) > tr:first-child > :is(th, td),
.univer-post__text table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td),
.univer-post__text table:not(.table-scroll) > tr:first-child > :is(th, td) {
    background: rgba(21, 75, 136, 0.05) !important;
    color: var(--c-brand) !important;
    font-size: 14px;
    font-weight: 600 !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 12px 14px !important;
    border: none !important;
    border-right: 1px solid rgba(21, 75, 136, 0.18) !important;
    border-bottom: 1px solid rgba(21, 75, 136, 0.18) !important;
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Последняя ячейка шапки — без правой границы. */
.application table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.application table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.archive__main table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.archive__main table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.contacts__description table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.contacts__description table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.foreigners__main-description-text table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.foreigners__main-description-text table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.foreigners__text table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.foreigners__text table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.info__body table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.info__body table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.news-card table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.news-card table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.rector-quote__text table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.rector-quote__text table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.rich-content table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.rich-content table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.single__news-description table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.single__news-description table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.tab-content table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.tab-content table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.admission__panel table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.admission__panel table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.admission__panel-body table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.admission__panel-body table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.docs__main details table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.docs__main details table:not(.table-scroll) > tr:first-child > :is(th, td):last-child,
.univer-post__text table:not(.table-scroll) :is(thead, tbody) tr:first-child > :is(th, td):last-child,
.univer-post__text table:not(.table-scroll) > tr:first-child > :is(th, td):last-child {
    border-right: none !important;
}

/* Hover на строках данных. */
.application table:not(.table-scroll) tbody tr:hover :is(th, td),
.archive__main table:not(.table-scroll) tbody tr:hover :is(th, td),
.contacts__description table:not(.table-scroll) tbody tr:hover :is(th, td),
.foreigners__main-description-text table:not(.table-scroll) tbody tr:hover :is(th, td),
.foreigners__text table:not(.table-scroll) tbody tr:hover :is(th, td),
.info__body table:not(.table-scroll) tbody tr:hover :is(th, td),
.news-card table:not(.table-scroll) tbody tr:hover :is(th, td),
.rector-quote__text table:not(.table-scroll) tbody tr:hover :is(th, td),
.rich-content table:not(.table-scroll) tbody tr:hover :is(th, td),
.single__news-description table:not(.table-scroll) tbody tr:hover :is(th, td),
.tab-content table:not(.table-scroll) tbody tr:hover :is(th, td),
.admission__panel table:not(.table-scroll) tbody tr:hover :is(th, td),
.admission__panel-body table:not(.table-scroll) tbody tr:hover :is(th, td),
.docs__main details table:not(.table-scroll) tbody tr:hover :is(th, td),
.univer-post__text table:not(.table-scroll) tbody tr:hover :is(th, td) {
    background: rgba(21, 75, 136, 0.025);
}

/* Hover у строк без обёртки <tbody>. tr:first-child — это шапка, её не
   подсвечиваем. */
.application table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.archive__main table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.contacts__description table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.foreigners__main-description-text table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.foreigners__text table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.info__body table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.news-card table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.rector-quote__text table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.rich-content table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.single__news-description table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.tab-content table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.admission__panel table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.admission__panel-body table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.docs__main details table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td),
.univer-post__text table:not(.table-scroll) > tr:not(:first-child):hover :is(th, td) {
    background: rgba(21, 75, 136, 0.025);
}

/* Последняя строка — без нижней границы (чтобы скруглённые углы выглядели
   аккуратно). */
.application table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.application table:not(.table-scroll) > tr:last-child > :is(th, td),
.archive__main table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.archive__main table:not(.table-scroll) > tr:last-child > :is(th, td),
.contacts__description table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.contacts__description table:not(.table-scroll) > tr:last-child > :is(th, td),
.foreigners__main-description-text table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.foreigners__main-description-text table:not(.table-scroll) > tr:last-child > :is(th, td),
.foreigners__text table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.foreigners__text table:not(.table-scroll) > tr:last-child > :is(th, td),
.info__body table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.info__body table:not(.table-scroll) > tr:last-child > :is(th, td),
.news-card table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.news-card table:not(.table-scroll) > tr:last-child > :is(th, td),
.rector-quote__text table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.rector-quote__text table:not(.table-scroll) > tr:last-child > :is(th, td),
.rich-content table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.rich-content table:not(.table-scroll) > tr:last-child > :is(th, td),
.single__news-description table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.single__news-description table:not(.table-scroll) > tr:last-child > :is(th, td),
.tab-content table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.tab-content table:not(.table-scroll) > tr:last-child > :is(th, td),
.admission__panel table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.admission__panel table:not(.table-scroll) > tr:last-child > :is(th, td),
.admission__panel-body table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.admission__panel-body table:not(.table-scroll) > tr:last-child > :is(th, td),
.docs__main details table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.docs__main details table:not(.table-scroll) > tr:last-child > :is(th, td),
.univer-post__text table:not(.table-scroll) tbody tr:last-child > :is(th, td),
.univer-post__text table:not(.table-scroll) > tr:last-child > :is(th, td) {
    border-bottom: none !important;
}

/* Объединённые ячейки (rowspan/colspan): внутри слитой области HTML-таблица
   не рисует внутренних разделителей, из-за чего вертикальная/горизонтальная
   линия выглядит «оборванной». Обводим объединённую ячейку рамкой со всех
   четырёх сторон в том же стиле — линии визуально замыкаются. */
.application table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.application table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.archive__main table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.archive__main table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.contacts__description table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.contacts__description table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.foreigners__main-description-text table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.foreigners__main-description-text table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.foreigners__text table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.foreigners__text table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.info__body table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.info__body table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.news-card table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.news-card table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.rector-quote__text table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.rector-quote__text table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.rich-content table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.rich-content table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.single__news-description table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.single__news-description table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.tab-content table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.tab-content table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.admission__panel table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.admission__panel table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.admission__panel-body table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.admission__panel-body table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.docs__main details table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.docs__main details table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]),
.univer-post__text table:not(.table-scroll) :is(td, th)[rowspan]:not([rowspan="1"]),
.univer-post__text table:not(.table-scroll) :is(td, th)[colspan]:not([colspan="1"]) {
    border-top: 1px solid rgba(21, 75, 136, 0.06) !important;
    border-right: 1px solid rgba(21, 75, 136, 0.06) !important;
    border-bottom: 1px solid rgba(21, 75, 136, 0.06) !important;
    border-left: 1px solid rgba(21, 75, 136, 0.06) !important;
}

/* Если объединённая ячейка — в шапке (первая строка), границы того же
   цвета, что у остальных шапочных ячеек. */
.application table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.application table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.archive__main table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.archive__main table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.contacts__description table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.contacts__description table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.foreigners__main-description-text table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.foreigners__main-description-text table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.foreigners__text table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.foreigners__text table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.info__body table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.info__body table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.news-card table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.news-card table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.rector-quote__text table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.rector-quote__text table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.rich-content table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.rich-content table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.single__news-description table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.single__news-description table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.tab-content table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.tab-content table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.admission__panel table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.admission__panel table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.admission__panel-body table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.admission__panel-body table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.docs__main details table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.docs__main details table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]),
.univer-post__text table:not(.table-scroll) tr:first-child > :is(td, th)[rowspan]:not([rowspan="1"]),
.univer-post__text table:not(.table-scroll) tr:first-child > :is(td, th)[colspan]:not([colspan="1"]) {
    border-color: rgba(21, 75, 136, 0.18) !important;
}

/* --- Горизонтальный скролл на мобильных --------------------------------- */
/* TinyMCE отдаёт чистый <table> без обёртки. Чтобы не оборачивать его
   вручную в шаблонах, применяем display: block + overflow-x: auto на самой
   таблице — это идиома для responsive-таблиц. Внутри <thead>/<tbody>/<tr>/
   <td> по-прежнему работают через анонимный table-обёрточный бокс, поэтому
   колонки выравниваются как обычно.

   Применяется на ширинах <= --bp-sm (768px). На десктопе таблица остаётся
   обычным display: table. */
@media (max-width: 768px) {
    .application table:not(.table-scroll),
    .archive__main table:not(.table-scroll),
    .contacts__description table:not(.table-scroll),
    .foreigners__main-description-text table:not(.table-scroll),
    .foreigners__text table:not(.table-scroll),
    .info__body table:not(.table-scroll),
    .news-card table:not(.table-scroll),
    .rector-quote__text table:not(.table-scroll),
    .rich-content table:not(.table-scroll),
    .single__news-description table:not(.table-scroll),
    .tab-content table:not(.table-scroll),
    .admission__panel table:not(.table-scroll),
    .admission__panel-body table:not(.table-scroll),
    .docs__main details table:not(.table-scroll),
    .univer-post__text table:not(.table-scroll) {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        /* Прячем полоску скролла: Firefox + старый IE/Edge. */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    /* WebKit / Blink (Chrome, Safari, мобильные браузеры). */
    .application table:not(.table-scroll)::-webkit-scrollbar,
    .archive__main table:not(.table-scroll)::-webkit-scrollbar,
    .contacts__description table:not(.table-scroll)::-webkit-scrollbar,
    .foreigners__main-description-text table:not(.table-scroll)::-webkit-scrollbar,
    .foreigners__text table:not(.table-scroll)::-webkit-scrollbar,
    .info__body table:not(.table-scroll)::-webkit-scrollbar,
    .news-card table:not(.table-scroll)::-webkit-scrollbar,
    .rector-quote__text table:not(.table-scroll)::-webkit-scrollbar,
    .rich-content table:not(.table-scroll)::-webkit-scrollbar,
    .single__news-description table:not(.table-scroll)::-webkit-scrollbar,
    .tab-content table:not(.table-scroll)::-webkit-scrollbar,
    .admission__panel table:not(.table-scroll)::-webkit-scrollbar,
    .admission__panel-body table:not(.table-scroll)::-webkit-scrollbar,
    .docs__main details table:not(.table-scroll)::-webkit-scrollbar,
    .univer-post__text table:not(.table-scroll)::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
}
