/* Мобильный интерфейс архивных шаблонов. Настольные стили не изменяются. */
@media screen and (max-width: 1000px) {
  body.lp-legacy {
    color: var(--lp-text, #243746);
    background: var(--lp-canvas, #f2f6f9);
    font: 400 16px/1.65 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    text-align: left;
  }

  /* Эти классы назначаются только распознанной старой шапке. */
  body.lp-legacy :is(.lp-header-shell, .lp-header-main, .lp-header-login, .lp-header-nav) {
    display: none !important;
  }

  body.lp-legacy :is(.lp-page-shell, .lp-layout, .lp-footer-shell) {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    border: 0;
    border-spacing: 0;
    background: transparent;
  }

  body.lp-legacy :is(.lp-page-shell, .lp-footer-shell),
  body.lp-legacy :is(.lp-page-shell, .lp-footer-shell) > tbody,
  body.lp-legacy :is(.lp-page-shell, .lp-footer-shell) > tbody > tr,
  body.lp-legacy :is(.lp-page-shell, .lp-footer-shell) > tbody > tr > td {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 0;
    border: 0;
    background: transparent;
  }

  /* Перестраиваются только аннотированные таблицы компоновки. */
  body.lp-legacy .lp-layout,
  body.lp-legacy .lp-layout > tbody {
    display: block;
    width: 100%;
  }

  body.lp-legacy .lp-layout > tbody > tr,
  body.lp-legacy .lp-layout > tr {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    height: auto;
  }

  body.lp-legacy .lp-layout > tbody > tr > td,
  body.lp-legacy .lp-layout > tr > td {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    float: none;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    white-space: normal !important;
  }

  body.lp-legacy .lp-layout > tbody > tr > .lp-main,
  body.lp-legacy .lp-layout > tr > .lp-main {
    order: 0;
    margin-block: 0 24px;
    padding-block: 18px;
    color: var(--lp-text, #243746);
    background: var(--lp-white, #fff);
    font: inherit;
  }

  body.lp-legacy .lp-layout > tbody > tr > .lp-sidebar,
  body.lp-legacy .lp-layout > tr > .lp-sidebar {
    order: 1;
    margin-block: 0 12px;
    font: inherit;
  }

  body.lp-legacy .lp-layout > tbody > tr > .lp-spacer,
  body.lp-legacy .lp-layout > tr > .lp-spacer {
    display: none !important;
  }

  body.lp-legacy :is(#content, #addon, #tree, #teamsF, #remind) {
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    max-width: 100%;
    margin-inline: 0;
    padding-inline: 0;
  }

  body.lp-legacy :is(.text, .txt, .untext, .untextforum, .paper, .doclist, .doclist1, .addlink, .blog, .container, .rubr, .news, .newst, .newstt, .newsb, .srinfo) {
    max-width: 100%;
    margin-inline: 0;
    padding-inline: 0;
    color: var(--lp-text, #243746);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.65;
    letter-spacing: normal;
    text-align: left;
    text-indent: 0;
    overflow-wrap: anywhere;
  }

  body.lp-legacy :is(.text, .txt, .paper, .doclist, .doclist1) :is(font, small) {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
  }

  body.lp-legacy .lp-main :is(p, blockquote) {
    box-sizing: border-box;
    max-width: 100%;
    margin-block: 0 1em;
    margin-inline: 0;
    color: inherit;
    font-size: 1rem;
    line-height: 1.65;
    text-align: left;
    text-indent: 0;
  }

  body.lp-legacy .lp-main blockquote {
    padding: 12px 16px;
    border-inline-start: 3px solid var(--lp-teal, #006c72);
    background: var(--lp-canvas, #f2f6f9);
  }

  body.lp-legacy :is(h1, h2, h3, h4, h5, h6) {
    max-width: 100%;
    margin: 24px 0 16px;
    color: var(--lp-navy, #12334d);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;
    text-align: left !important;
    text-indent: 0;
    overflow-wrap: anywhere;
  }

  body.lp-legacy h1 { font-size: 2rem; }
  body.lp-legacy :is(h5, h6) { font-size: 1.25rem; }
  body.lp-legacy .lp-main > :is(h1, h2, h3, h4):first-child { margin-top: 0; }
  body.lp-legacy :is(.text, .paper) b { color: inherit; }

  body.lp-legacy :is(.doch, .doct, .doca) {
    color: var(--lp-navy, #12334d);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  body.lp-legacy :is(.docha, .doctt, .docaa, .srname, .pname) {
    color: var(--lp-muted, #586b79);
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.55;
    letter-spacing: normal;
    overflow-wrap: anywhere;
  }

  body.lp-legacy a,
  body.lp-legacy a:visited {
    color: var(--lp-teal, #006c72);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.17em;
    overflow-wrap: anywhere;
  }

  body.lp-legacy a:hover { text-decoration: underline; }
  body.lp-legacy :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--lp-teal, #006c72) !important;
    outline-offset: 3px;
  }

  body.lp-legacy :is(.path, .location, .locationa, .actloc) {
    color: var(--lp-muted, #586b79);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.65;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.lp-legacy .path {
    margin: 0 0 8px;
    padding: 14px 0;
    border: 0;
    border-bottom: 1px solid #d7e1e8;
    background: transparent;
  }

  body.lp-legacy .path a {
    display: inline-block;
    padding-block: 8px;
    color: var(--lp-teal, #006c72);
  }

  /* Сворачиваемые рубрики сохраняют исходные ссылки и вложенность. */
  body.lp-legacy .lp-sidebar-panel {
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 1px solid #cbd9e3;
    border-radius: 8px;
    background: var(--lp-white, #fff);
    color: var(--lp-text, #243746);
  }

  body.lp-legacy .lp-sidebar-summary {
    min-height: 52px;
    box-sizing: border-box;
    padding: 14px 16px;
    color: var(--lp-navy, #12334d);
    font: 650 1rem/1.5 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    cursor: pointer;
    overflow-wrap: anywhere;
  }

  body.lp-legacy .lp-sidebar-summary::marker { color: var(--lp-teal, #006c72); }
  body.lp-legacy .lp-sidebar-panel[open] > .lp-sidebar-summary { border-bottom: 1px solid #d7e1e8; }
  body.lp-legacy .lp-sidebar-content { min-width: 0; padding: 8px 12px 12px; }

  body.lp-legacy :is(.rubric, #rubric, #themrubric, #georubric, #bigrubric, #mattype, #addon) {
    max-width: 100%;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--lp-text, #243746);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    white-space: normal;
  }

  body.lp-legacy :is(.rubric, #rubric, #mattype) > div,
  body.lp-legacy :is(.headache, .consultation) {
    margin: 12px 0 4px;
    padding: 10px 8px;
    border: 0;
    border-bottom: 1px solid #d7e1e8;
    background: transparent;
    color: var(--lp-navy, #12334d);
    font: 650 0.9375rem/1.5 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  }

  body.lp-legacy :is(.rubric, #rubric, #mattype) > div span,
  body.lp-legacy .headache span { color: var(--lp-teal, #006c72); }

  body.lp-legacy :is(.rubric, #rubric, #mattype) a,
  body.lp-legacy .lp-sidebar-content .speedbtn a {
    display: block;
    box-sizing: border-box;
    min-height: 44px;
    margin: 0;
    padding: 10px 8px;
    border: 0;
    border-bottom: 1px solid #e5edf2;
    border-radius: 0;
    background: transparent;
    color: var(--lp-teal, #006c72);
    font: inherit;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.lp-legacy :is(.rubric, #rubric, #mattype) a:hover { background: var(--lp-canvas, #f2f6f9); }
  body.lp-legacy :is(.rubric, #rubric, #mattype) ul { margin: 0; padding-inline-start: 14px; }
  body.lp-legacy :is(.rubric, #rubric, #mattype) li { margin: 0; padding: 0; }
  body.lp-legacy :is(.activerubric, #activelink) {
    border: 0;
    border-inline-start: 3px solid var(--lp-teal, #006c72) !important;
    background: #e4f1f1 !important;
    color: var(--lp-navy, #12334d) !important;
    font-weight: 650 !important;
  }

  body.lp-legacy :is(.info, .infoblock, .query, .hot) {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #d7e1e8;
    border-radius: 6px;
    background: var(--lp-canvas, #f2f6f9);
    color: var(--lp-text, #243746);
    font: inherit;
  }

  body.lp-legacy .info p:first-letter { float: none; color: inherit; font-size: inherit; }
  body.lp-legacy .info p { margin-block: 0 10px; }

  /* Списки материалов остаются списками, нумерация источника сохраняется. */
  body.lp-legacy :is(.doclist, .doclist1) {
    margin-block: 16px;
    border: 0;
    background: var(--lp-white, #fff);
  }

  body.lp-legacy .doclist :is(ol, ul),
  body.lp-legacy :is(ol.doclist, ul.doclist) {
    margin-block: 0;
    padding-inline-start: 1.6em;
    color: var(--lp-muted, #586b79);
    font: inherit;
  }

  body.lp-legacy .doclist li {
    margin: 0;
    padding: 14px 4px 14px 6px;
    border-bottom: 1px solid #dce5eb;
    color: var(--lp-muted, #586b79);
    font-size: 0.9375rem;
    line-height: 1.65;
  }

  body.lp-legacy .doclist li a {
    color: var(--lp-navy, #12334d);
    font-size: 1rem;
    font-weight: 550;
    line-height: 1.6;
    text-decoration: none;
  }

  body.lp-legacy .doclist li a:hover { text-decoration: underline; }
  body.lp-legacy .doclist li::marker { color: var(--lp-muted, #586b79); font-size: 0.8125rem; }
  body.lp-legacy .doclist li :is(ul, ol) { margin-block: 10px 0; padding-inline-start: 1.2em; }

  body.lp-legacy .navigator {
    max-width: 100%;
    margin: 12px 0;
    padding: 10px 0;
    border: 0;
    border-block: 1px solid #d7e1e8;
    background: transparent;
    color: var(--lp-muted, #586b79);
    font: 400 0.875rem/2.9 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.lp-legacy .navigator :is(a, .activepage, .activecell) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    margin: 2px;
    padding: 8px 10px;
    border: 1px solid #cbd9e3;
    border-radius: 6px;
    background: var(--lp-white, #fff);
    color: var(--lp-navy, #12334d);
    font: 500 0.9375rem/1.4 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    text-decoration: none;
  }

  body.lp-legacy .navigator :is(.activepage, .activecell),
  body.lp-legacy .navigator a:hover {
    border-color: var(--lp-teal, #006c72);
    background: var(--lp-teal, #006c72);
    color: var(--lp-white, #fff);
  }

  body.lp-legacy :is(.filter, .activefolder, .speedbtn, .quickpanel) {
    color: var(--lp-text, #243746);
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.65;
    text-align: left;
    white-space: normal !important;
  }

  body.lp-legacy .filter { padding: 12px 8px; border-color: #d7e1e8; background: var(--lp-canvas, #f2f6f9); }
  body.lp-legacy .filter a { display: inline-block; padding-block: 7px; color: var(--lp-teal, #006c72); }
  body.lp-legacy .activefolder { background: #e4f1f1; }
  body.lp-legacy .speedbtn a { padding: 12px 10px; border: 1px solid #cbd9e3; background: var(--lp-white, #fff); color: var(--lp-teal, #006c72); }
  body.lp-legacy .quickpanel { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 12px; padding: 0; background: transparent; }
  body.lp-legacy .quickpanel nobr { white-space: normal; }
  body.lp-legacy .quickpanel a {
    display: block;
    min-height: 44px;
    box-sizing: border-box;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #cbd9e3;
    border-radius: 6px;
    background: var(--lp-white, #fff);
    color: var(--lp-teal, #006c72);
    font: inherit;
    text-decoration: none;
  }
  body.lp-legacy .quickpanel #activequick { border-color: var(--lp-teal, #006c72); background: #e4f1f1; color: var(--lp-navy, #12334d); }

  body.lp-legacy .calendar { max-width: 100%; color: var(--lp-text, #243746); font: inherit; white-space: normal !important; }
  body.lp-legacy div.calendar { line-height: 3; }
  body.lp-legacy div.calendar > span { display: block; color: var(--lp-navy, #12334d); font-weight: 700; }
  body.lp-legacy .calendar a { display: inline-block; min-width: 44px; min-height: 44px; box-sizing: border-box; margin: 2px; padding: 8px; text-align: center; background: var(--lp-white, #fff); border: 1px solid #cbd9e3; border-radius: 5px; line-height: 1.5; }

  /* Настоящие таблицы данных не теряют строки и столбцы. */
  body.lp-legacy table.lp-data-scroll {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin-inline: 0 !important;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    color: var(--lp-text, #243746);
    background: var(--lp-white, #fff);
    font-size: 0.9375rem;
    line-height: 1.55;
  }

  body.lp-legacy table.lp-data-scroll > :is(thead, tbody, tfoot) > tr > :is(td, th) {
    padding: 10px;
    border-color: #d7e1e8;
    font-family: inherit;
    line-height: 1.55;
    vertical-align: top;
  }

  body.lp-legacy table.lp-data-scroll > :is(thead, tbody, tfoot) > tr > th {
    color: var(--lp-navy, #12334d);
    background: #e6eef4;
    text-align: left;
  }

  body.lp-legacy table.lp-data-scroll:focus-visible { outline: 3px solid var(--lp-teal, #006c72); outline-offset: 3px; }

  /* Явно размеченные формы укладываются по полям, а не как таблицы данных. */
  body.lp-legacy .formtable {
    width: 100%;
    max-width: 100%;
    margin: 12px 0;
    border: 1px solid #d7e1e8;
    border-radius: 8px;
    background: var(--lp-white, #fff);
    color: var(--lp-text, #243746);
    font: inherit;
  }

  body.lp-legacy .formtable:not(.lp-data-scroll),
  body.lp-legacy .formtable:not(.lp-data-scroll) > tbody {
    display: block;
    box-sizing: border-box;
    width: 100%;
  }

  body.lp-legacy .formtable:not(.lp-data-scroll) > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px;
    border-bottom: 1px solid #e5edf2;
  }

  body.lp-legacy .formtable:not(.lp-data-scroll) > tbody > tr > :is(td, th) {
    display: block;
    box-sizing: border-box;
    flex: 1 1 100%;
    width: 100% !important;
    min-width: 0;
    padding: 2px 0;
    border: 0;
    background: transparent;
    text-align: left;
    white-space: normal;
  }

  body.lp-legacy .formtable:not(.lp-data-scroll) > tbody > tr > :is(td, th):first-child { color: var(--lp-navy, #12334d); font-weight: 600; }
  body.lp-legacy .formtable:not(.lp-data-scroll) > tbody > tr > td.btn { flex: 0 0 auto; width: auto !important; }
  body.lp-legacy form { max-width: 100%; margin-inline: 0; }
  body.lp-legacy :is(input, select, textarea, button) { box-sizing: border-box; max-width: 100%; font-family: inherit; font-size: 16px !important; }
  body.lp-legacy :is(input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]):not([type="image"]), select, textarea, button) { min-height: 44px; }
  body.lp-legacy :is(input:not([type]):not([size="0"]), input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="search"], select, textarea) {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #aebfcd;
    border-radius: 6px;
    background: var(--lp-white, #fff);
    color: var(--lp-text, #243746);
    line-height: 1.4;
  }
  body.lp-legacy textarea { min-height: 144px; height: auto; resize: vertical; }
  body.lp-legacy select[multiple] { min-height: 144px; }
  body.lp-legacy :is(input[type="checkbox"], input[type="radio"]) { width: 20px; height: 20px; margin: 12px 8px 12px 0; vertical-align: middle; accent-color: var(--lp-teal, #006c72); }
  body.lp-legacy :is(input[type="submit"], input[type="button"], button) {
    max-width: 100%;
    width: auto;
    height: auto;
    padding: 10px 16px;
    border: 1px solid var(--lp-teal, #006c72);
    border-radius: 6px;
    background: var(--lp-teal, #006c72);
    color: var(--lp-white, #fff);
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    cursor: pointer;
  }
  body.lp-legacy input[type="reset"] { padding: 10px 16px; border: 1px solid #aebfcd; border-radius: 6px; background: var(--lp-white, #fff); color: var(--lp-navy, #12334d); }

  /* Архивное выпадающее меню становится обычной навигацией с крупными ссылками. */
  body.lp-legacy #navigation_panel,
  body.lp-legacy .lp-archive-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    position: static !important;
    inset: auto !important;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0;
    padding: 16px 0;
    background: transparent;
    color: var(--lp-text, #243746);
  }
  body.lp-legacy .lp-archive-nav #navigation_panel { padding: 0; }
  body.lp-legacy #navigation_panel .gor_menu {
    float: none;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--lp-text, #243746);
    font: 400 1rem/1.5 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  }
  body.lp-legacy #navigation_panel .gor_menu > p { margin: 0; padding: 0; }
  body.lp-legacy #navigation_panel .gor_menu span {
    display: block;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-bottom: 2px solid #cbd9e3;
    background: transparent;
    color: var(--lp-navy, #12334d);
    font-weight: 700;
    text-align: left;
  }
  body.lp-legacy #navigation_panel .gor_menu li { display: block !important; float: none; margin: 0; padding: 0; list-style: none; }
  body.lp-legacy #navigation_panel .gor_menu li a {
    display: block;
    position: static;
    box-sizing: border-box;
    min-height: 44px;
    margin: 0;
    padding: 11px 10px;
    border: 0;
    border-bottom: 1px solid #e5edf2;
    background: transparent;
    color: var(--lp-teal, #006c72);
    font: inherit;
    text-align: left;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.lp-legacy #navigation_panel .gor_menu li a:hover { background: var(--lp-canvas, #f2f6f9); }

  body.lp-legacy .lp-footer-shell {
    margin-top: 24px !important;
    padding-block: 20px;
    border-top: 1px solid #cbd9e3;
    color: var(--lp-muted, #586b79);
    font: 400 0.8125rem/1.7 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  }
  body.lp-legacy .lp-footer-shell :is(table.topmenu, table.topMenu, table.copy),
  body.lp-legacy > :is(table.topmenu, table.topMenu, table.copy) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    border: 0;
    border-collapse: collapse;
    background: transparent;
    color: var(--lp-muted, #586b79);
    font: inherit;
  }
  body.lp-legacy .lp-footer-shell :is(table.topmenu, table.topMenu, table.copy) > tbody > tr,
  body.lp-legacy > :is(table.topmenu, table.topMenu, table.copy) > tbody > tr { display: flex; flex-wrap: wrap; }
  body.lp-legacy .lp-footer-shell :is(table.topmenu, table.topMenu, table.copy) > tbody > tr > td,
  body.lp-legacy > :is(table.topmenu, table.topMenu, table.copy) > tbody > tr > td {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    overflow-wrap: anywhere;
  }
  body.lp-legacy .lp-footer-shell a { color: var(--lp-teal, #006c72); }
  body.lp-legacy .lp-footer-shell a[href="#top"] { display: inline-block; min-height: 44px; box-sizing: border-box; padding-block: 10px; }

  body.lp-legacy :is(img, video, iframe, embed, object) { max-width: 100%; }
  body.lp-legacy img { height: auto; }
  body.lp-legacy :is(pre, code) { max-width: 100%; font-size: 0.9375rem; }
  body.lp-legacy pre { overflow-x: auto; white-space: pre; }
  body.lp-legacy hr { height: 0; margin-block: 20px; border: 0; border-top: 1px solid #d7e1e8; }
  body.lp-legacy nobr,
  body.lp-legacy [nowrap] { white-space: normal !important; }
}

@media screen and (max-width: 1000px) {
  /* Фактические классы одноячеечных обёрток, назначаемые mobile.js. */
  body.lp-legacy :is(.lp-main-shell, .lp-flow-table),
  body.lp-legacy :is(.lp-main-shell, .lp-flow-table) > tbody,
  body.lp-legacy :is(.lp-main-shell, .lp-flow-table) > tbody > tr,
  body.lp-legacy :is(.lp-main-shell, .lp-flow-table) > tbody > tr > td {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0;
    border: 0;
    background: transparent;
    white-space: normal !important;
  }

  body.lp-legacy .lp-mobile-header a,
  body.lp-legacy .lp-mobile-header a:visited {
    color: var(--lp-white, #fff);
  }

  /* Исходное hover-меню остаётся только на настольной версии. */
  body.lp-legacy #navigation_panel.lp-desktop-archive-nav {
    display: none !important;
  }

  /* Клон меню содержит прямые ссылки и читается на тёмной шапке. */
  body.lp-legacy .lp-mobile-header .lp-archive-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 12px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
  }

  body.lp-legacy .lp-mobile-header .lp-archive-nav > a,
  body.lp-legacy .lp-mobile-header .lp-archive-nav > a:visited {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    color: var(--lp-white, #fff);
    background: rgba(255, 255, 255, 0.06);
    font: 500 0.9375rem/1.45 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    text-decoration: none;
    overflow-wrap: anywhere;
  }

  body.lp-legacy .lp-mobile-header .lp-archive-nav > a:hover {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.13);
  }

  /* Прокрутка принадлежит обёртке; табличная модель внутри не меняется. */
  body.lp-legacy .lp-table-scroll {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 12px 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.lp-legacy .lp-table-scroll > table.lp-data-scroll {
    display: table;
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    overflow: visible;
    table-layout: auto;
  }

  body.lp-legacy .lp-table-scroll > table.lp-data-scroll > :is(thead, tbody, tfoot) {
    display: table-row-group;
  }

  body.lp-legacy .lp-table-scroll > table.lp-data-scroll > thead { display: table-header-group; }
  body.lp-legacy .lp-table-scroll > table.lp-data-scroll > tfoot { display: table-footer-group; }
  body.lp-legacy .lp-table-scroll > table.lp-data-scroll > :is(thead, tbody, tfoot) > tr { display: table-row; }
  body.lp-legacy .lp-table-scroll > table.lp-data-scroll > :is(thead, tbody, tfoot) > tr > td { display: table-cell; }
  body.lp-legacy .lp-table-scroll > table.lp-data-scroll > :is(thead, tbody, tfoot) > tr > th { display: table-cell; }

  /* Таблицы с полями являются формами, а не данными для прокрутки. */
  body.lp-legacy table.lp-form-table,
  body.lp-legacy table.lp-form-table > tbody {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 12px 0;
    border: 1px solid #d7e1e8;
    border-radius: 8px;
    background: var(--lp-white, #fff);
  }

  body.lp-legacy table.lp-form-table > tbody { margin: 0; border: 0; }

  body.lp-legacy table.lp-form-table > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    padding: 12px;
    border-bottom: 1px solid #e5edf2;
  }

  body.lp-legacy table.lp-form-table > tbody > tr:last-child { border-bottom: 0; }

  body.lp-legacy table.lp-form-table > tbody > tr > :is(td, th) {
    display: block;
    box-sizing: border-box;
    flex: 1 1 100%;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: var(--lp-text, #243746);
    font: inherit;
    text-align: left !important;
    white-space: normal !important;
  }

  body.lp-legacy table.lp-form-table > tbody > tr > :is(td, th):first-child {
    color: var(--lp-navy, #12334d);
    font-weight: 650;
  }

  body.lp-legacy table.lp-form-table > tbody > tr > td.btn {
    flex: 0 0 auto;
    width: auto !important;
  }

  /* Заголовок документа v1 визуально является двумя мета-блоками, не таблицей данных. */
  body.lp-legacy.lp-v1 .lp-table-scroll:has(> table > tbody > tr > .doch) {
    overflow: visible;
  }

  body.lp-legacy.lp-v1 .lp-table-scroll > table.lp-data-scroll:has(> tbody > tr > .doch),
  body.lp-legacy.lp-v1 .lp-table-scroll > table.lp-data-scroll:has(> tbody > tr > .doch) > tbody,
  body.lp-legacy.lp-v1 .lp-table-scroll > table.lp-data-scroll:has(> tbody > tr > .doch) > tbody > tr {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.lp-legacy.lp-v1 .lp-table-scroll > table.lp-data-scroll:has(> tbody > tr > .doch) > tbody > tr > :is(.doch, .docha) {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 10px 0;
    white-space: normal !important;
  }

  body.lp-legacy.lp-v1 .lp-table-scroll > table.lp-data-scroll:has(> tbody > tr > .doch) > tbody > tr > .docha {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid #d7e1e8;
    text-align: left !important;
  }

  /* Внутренние таблицы компоновки становятся потоком; вложенные таблицы данных не затрагиваются. */
  body.lp-legacy table.lp-content-layout,
  body.lp-legacy table.lp-content-layout > tbody {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 10px 0 !important;
    border: 0;
    background: transparent;
  }

  body.lp-legacy table.lp-content-layout > tbody > tr {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.lp-legacy table.lp-content-layout > tbody > tr > td {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 8px 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  body.lp-legacy table.lp-content-layout > tbody > tr > td.lp-spacer,
  body.lp-legacy table.lp-content-layout > tbody > tr > td:empty {
    display: none !important;
  }

  body.lp-legacy table.lp-content-layout > tbody > tr > td.filter {
    padding: 12px;
    border-bottom: 1px solid #d7e1e8;
    background: var(--lp-canvas, #f2f6f9);
  }

  body.lp-legacy table.lp-content-layout > tbody > tr > :is(td.speedbtn, td.activefolder) {
    padding: 0;
  }

  body.lp-legacy table.lp-content-layout > tbody > tr > :is(td.speedbtn, td.activefolder) a {
    display: block;
    box-sizing: border-box;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid #cbd9e3;
    background: var(--lp-white, #fff);
    color: var(--lp-teal, #006c72);
    text-decoration: none;
  }

  /* Фиксированные архивные ширины не должны сжимать текст внутри известных блоков компоновки. */
  body.lp-legacy :is(.lp-layout, .lp-flow-table, .lp-main-shell) td {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media screen and (min-width: 640px) and (max-width: 1000px) {
  body.lp-legacy #navigation_panel:not(.lp-desktop-archive-nav) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
  body.lp-legacy .lp-mobile-header .lp-archive-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.lp-legacy .lp-main { padding-inline: 20px !important; }
  body.lp-legacy .lp-main :is(h1, h2, h3, h4) { max-width: 34ch; }
  body.lp-legacy .lp-main p { max-width: 75ch; }
}
