/* Neva Patent: narrow-screen overrides. The original desktop stylesheet is retained. */
.np-menu-toggle,
.np-submenu-toggle,
.np-sidebar-toggle,
.np-service-context {
    display: none;
}

/* The inner language items already draw their separators; hide the duplicate outer one. */
.topmenu > ul.menu_ul > li:last-child {
    border-right-color: transparent;
}

/* Footer badges keep their visible order and do not reserve obsolete slots. */
.footer .counters {
    width: auto;
    max-width: 100%;
}

.footer .counters > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0;
}

.footer .counters > ul > li {
    float: none !important;
    order: 0 !important;
    flex: 0 0 88px;
    width: 88px;
    height: 31px;
    margin: 2px 0;
}

.footer .counters > ul > li > a,
.footer .counters img {
    display: block;
    width: 88px;
    height: 31px;
    border: 0;
}

@media screen and (min-width: 980px) {
    /* The former four-counter strip supplied this minimum to the desktop footer. */
    .footer .fcontent {
        min-width: 368px;
    }
}

/* Content photos are unframed on desktop, tablet and phone alike. Keep float/margins. */
#page .content img,
#page .content .wp-caption,
#page .content .wp-block-image,
#page .content .np-photo-frame,
#page .mainprev img,
#page .mainprev .wp-caption,
#page .np-profile-card img,
#page .np-profile-card .wp-caption {
    border: 0 !important;
    outline: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Employee biography card: a single thin separator on the right, no outer frame. */
#page .mainprev,
#page .np-profile-card {
    border: 0 !important;
    border-right: 1px solid #ccc !important;
    outline: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#page .mainprev > tbody,
#page .mainprev > tbody > tr,
#page .mainprev > tbody > tr > td,
#page .mainprev > tr,
#page .mainprev > tr > td,
#page .np-profile-card > tbody,
#page .np-profile-card > tbody > tr,
#page .np-profile-card > tbody > tr > td,
#page .np-profile-card > tr,
#page .np-profile-card > tr > td {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

@media screen and (max-width: 979px) {
    html,
    body {
        height: auto;
        min-width: 0;
    }

    body {
        font-size: 16px;
        line-height: 1.5;
        text-align: left;
    }

    #page {
        box-sizing: border-box;
        width: auto;
        min-width: 0;
        max-width: none;
        min-height: 0;
        height: auto !important;
        margin: 0;
        padding: 12px 16px;
        text-align: left;
        overflow-wrap: anywhere;
    }

    #page .push {
        display: none;
    }

    #page .header {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-top: 0;
        margin-bottom: 16px;
    }

    #page .logo,
    #page .topmenu {
        position: static;
        width: auto;
        max-width: 100%;
    }

    #page .logo {
        align-self: flex-start;
    }

    #page .logo img {
        display: block;
        width: 258px;
        max-width: 100%;
        height: auto;
    }

    #page .topmenu > ul.menu_ul {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 8px;
        margin: 0;
        padding: 0;
    }

    #page .topmenu > ul.menu_ul > li {
        float: none;
        line-height: 1.5;
    }

    /* qTranslate returns a nested list. Keep the two flags together on one line. */
    #page .topmenu > ul.menu_ul > li > ul {
        display: inline-flex;
        flex-flow: row nowrap;
        align-items: center;
        margin: 0;
        padding: 0;
        vertical-align: middle;
        white-space: nowrap;
    }

    #page .topmenu > ul.menu_ul > li > ul > li {
        display: block;
        float: none;
        flex: 0 0 auto;
        line-height: 1;
    }

    #page .topmenu > ul.menu_ul > li > .clear {
        display: none;
    }

    #page .topmenu ul.menu_ul > li:first-child {
        padding-left: 0;
    }

    #page #sitesearch {
        width: 100%;
        margin: 0;
    }

    #page .topsearch {
        position: relative;
        top: auto;
        right: auto;
        box-sizing: border-box;
        width: 100%;
        height: 42px;
    }

    #page .tsinput {
        position: static;
        height: 100%;
    }

    #page input#tsinput {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        height: 40px;
        padding: 8px 46px 8px 10px;
        font: inherit;
        line-height: normal;
        background: #fff;
    }

    #page .tsbutton {
        top: 0;
        right: 0;
    }

    #page input#tsbutton {
        width: 42px;
        height: 40px;
        background-position: center;
    }

    #page .np-menu-toggle,
    #page .np-sidebar-toggle {
        box-sizing: border-box;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-height: 44px;
        padding: 9px 12px;
        border: 1px solid #7584a5;
        border-radius: 2px;
        background: #dae7f1;
        color: #4f628c;
        font: inherit;
        line-height: 1.5;
        text-align: left;
        cursor: pointer;
    }

    html.np-responsive-js #page .np-menu-toggle.np-control-ready,
    html.np-responsive-js #page .np-sidebar-toggle {
        display: flex;
    }

    .np-menu-icon {
        flex: 0 0 18px;
        width: 18px;
        height: 12px;
        border-top: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
    }

    #page .np-primary-navigation,
    #page .menu-glavnoe-menyu-container {
        height: auto;
        max-width: 100%;
        margin: 0;
        padding: 0;
        overflow: visible;
        font-size: 16px;
    }

    html.np-responsive-js #page .np-primary-navigation:not(.np-is-open) {
        display: none;
    }

    #page .np-primary-navigation > ul,
    #page ul#menu-glavnoe-menyu {
        position: static;
        height: auto;
        margin: 0;
        padding: 0;
        border-bottom: 1px solid #66779b;
    }

    #page .np-primary-navigation li {
        position: relative;
        float: none;
        display: block;
        width: auto;
        margin: 0;
        list-style: none;
    }

    #page .np-primary-navigation li > a {
        display: block;
        padding: 11px 12px;
        font-size: 15px;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    #page .np-primary-navigation li.np-has-submenu > a {
        padding-right: 50px;
    }

    #page .np-primary-navigation ul.sub-menu {
        position: static;
        display: block;
        box-sizing: border-box;
        width: auto;
        margin: 0 0 8px 12px;
        padding: 0;
        border-left: 1px solid #c5ceda;
    }

    #page .np-primary-navigation ul.sub-menu li > a {
        font-size: 14px;
        text-transform: none;
    }

    html.np-responsive-js #page .np-primary-navigation li.np-has-submenu > ul {
        display: none;
    }

    html.np-responsive-js #page .np-primary-navigation li.np-submenu-open > ul {
        display: block;
    }

    html.np-responsive-js #page .np-primary-navigation .np-submenu-toggle {
        position: absolute;
        top: 4px;
        right: 2px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 36px;
        border: 1px solid #c5ceda;
        border-radius: 2px;
        background: #f5f8fa;
        color: #4f628c;
        cursor: pointer;
    }

    .np-chevron {
        display: inline-block;
        width: 8px;
        height: 8px;
        margin-top: -4px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
    }

    [aria-expanded="true"] > .np-chevron {
        margin-top: 4px;
        transform: rotate(225deg);
    }

    #page a:focus-visible,
    #page button:focus-visible,
    #page input:focus-visible,
    #page textarea:focus-visible,
    #page select:focus-visible,
    #page .np-table-scroll:focus-visible {
        outline: 2px solid #36648b;
        outline-offset: 3px;
    }

    #page .ibanner,
    #page .ibanner_banner,
    #page .ibanner .active {
        width: 100%;
        height: auto;
        aspect-ratio: 46 / 9;
    }

    #page .ibanner {
        box-sizing: content-box;
        padding-bottom: 22px;
        margin-bottom: 12px;
    }

    #page .ibanner_banner img {
        display: block;
        width: 100%;
        height: auto;
    }

    #page .bottom_tr {
        box-sizing: border-box;
        width: 100%;
        padding: 2px 6px;
        font-size: 11px;
    }

    #page .maincol,
    #page .r_sidebar,
    #page .stroke,
    #page h2.archive {
        float: none;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    #page .r_sidebar {
        margin: 20px 0;
    }

    #page .content,
    #page .main_text {
        min-width: 0;
        max-width: 100%;
        text-align: left;
        overflow-wrap: anywhere;
    }

    #page .main_text {
        padding-left: 0;
    }

    #page .content p,
    #page .main_text p,
    #page .r_sidebar p {
        font-size: 1rem;
        line-height: 1.5;
        text-align: left !important;
    }

    #page .content ul,
    #page .content ol {
        font-size: 1rem;
        line-height: 1.5;
    }

    #page img {
        max-width: 100%;
        height: auto;
    }

    #page .np-layout-table,
    #page .np-layout-table > tbody,
    #page .np-layout-table > thead,
    #page .np-layout-table > tfoot,
    #page .np-layout-table > tbody > tr,
    #page .np-layout-table > thead > tr,
    #page .np-layout-table > tfoot > tr,
    #page .np-layout-table > tr,
    #page .np-layout-table > tbody > tr > td,
    #page .np-layout-table > tbody > tr > th,
    #page .np-layout-table > tr > td {
        display: block !important;
        box-sizing: border-box;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100%;
        height: auto !important;
        min-height: 0 !important;
    }

    #page .np-layout-table {
        float: none !important;
        margin: 0 0 16px !important;
    }

    #page .np-layout-table > tbody > tr > td,
    #page .np-layout-table > tr > td {
        padding: 12px 0;
    }

    #page .np-grid-table > tbody > tr,
    #page .np-grid-table > tr {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    #page .np-grid-table > tbody > tr > td,
    #page .np-grid-table > tr > td,
    #page .np-grid-table td p {
        text-align: center !important;
    }

    #page .np-grid-table img {
        display: block;
        margin-right: auto;
        margin-left: auto;
    }

    #page .np-split-table-source {
        display: none !important;
    }

    #page .np-image-card-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 20px;
        width: 100%;
        min-width: 0;
        margin: 16px 0;
    }

    #page .np-image-card {
        min-width: 0;
        text-align: center;
    }

    #page .np-image-grid-section {
        grid-column: 1 / -1;
        min-width: 0;
        text-align: left;
    }

    #page .np-image-card-picture {
        margin-bottom: 12px;
    }

    #page .np-image-card-picture img {
        float: none !important;
        display: block;
        max-width: 100%;
        height: auto;
        margin-right: auto;
        margin-left: auto;
    }

    #page .content .np-image-card-grid p,
    #page .np-image-card-caption {
        text-align: center !important;
        overflow-wrap: anywhere;
    }

    #page .content .np-image-card-grid p {
        margin: 4px 0;
    }

    #page .np-table-scroll {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 12px 0;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    #page .np-table-scroll > table {
        width: 100% !important;
        min-width: 640px;
        height: auto !important;
        table-layout: auto !important;
        overflow-wrap: normal;
    }

    #page .np-table-scroll > table > tbody > tr,
    #page .np-table-scroll > table > thead > tr,
    #page .np-table-scroll > table > tfoot > tr,
    #page .np-table-scroll > table > tbody > tr > td,
    #page .np-table-scroll > table > tbody > tr > th,
    #page .np-table-scroll > table > thead > tr > th,
    #page .np-table-scroll > table > thead > tr > td {
        height: auto !important;
        min-height: 0 !important;
        padding: 8px;
        vertical-align: top;
    }

    #page .np-table-scroll > table > tbody > tr > td,
    #page .np-table-scroll > table > tbody > tr > th,
    #page .np-table-scroll > table > thead > tr > th,
    #page .np-table-scroll > table > thead > tr > td {
        min-width: 160px;
    }

    #page .np-table-scroll p {
        margin: 0 0 8px !important;
    }

    html:not(.np-responsive-js) #page .content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    html:not(.np-responsive-js) #page table.mainprev {
        float: none;
        width: 100%;
    }

    #page iframe,
    #page video,
    #page embed,
    #page object,
    #page .wp-caption {
        box-sizing: border-box;
        max-width: 100% !important;
    }

    #page .wp-caption img {
        width: auto;
        max-width: 100%;
    }

    #page .wp-block-columns {
        flex-wrap: wrap !important;
    }

    #page .wp-block-column {
        min-width: 0;
        flex-basis: 100% !important;
    }

    #page .services {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        padding: 12px 0;
    }

    #page .services > .clear {
        display: none;
    }

    #page .service {
        float: none;
        box-sizing: border-box;
        width: auto;
        min-width: 0;
        height: auto;
        min-height: 210px;
        margin: 0;
        padding: 16px 16px 48px;
        font-size: 16px;
    }

    #page .service h3 {
        font-size: 21px;
        line-height: 1.3;
    }

    #page .service ul {
        font-size: 16px;
    }

    #page .service .moar {
        right: 16px;
        bottom: 12px;
    }

    #page .news {
        padding: 10px 0;
        font-size: 16px;
        line-height: 1.5;
    }

    #page .news-img {
        max-width: 25%;
        margin-right: 12px;
    }

    #page .news-title {
        font-size: 18px;
        line-height: 1.35;
    }

    #page .news-text a {
        font-size: inherit;
    }

    #page .news-all {
        float: none;
        display: block;
        margin: 6px 0;
    }

    #page .date_news {
        float: none;
        display: inline-block;
        margin: 4px 0 12px;
    }

    #page .nav-loop {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 16px;
        margin: 20px 0;
    }

    #page .nav-loop > div {
        float: none !important;
        margin: 0 !important;
    }

    /* Higher specificity also overrides the styles printed by Blank Template. */
    #page .container {
        display: flex;
        flex-direction: column;
    }

    #page .container > .sidebar,
    #page .container > .content {
        flex: none;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 12px 0 0;
        padding: 0;
        border: 0;
    }

    #page .sidebar .nav-menu {
        margin: 0;
        padding: 8px 0;
        list-style: none;
        font-size: 16px;
    }

    #page .sidebar .nav-menu li {
        margin-bottom: 0;
        list-style: none;
    }

    #page .sidebar .nav-menu li ul {
        margin-top: 0;
        padding-left: 16px;
    }

    #page .sidebar .nav-menu a,
    #page .sidebar .nav-menu li > strong {
        display: inline-block;
        padding: 8px 0;
    }

    #page .sidebar .nav-menu strong > a {
        padding: 0;
    }

    #page .np-menu-title,
    #page .np-sidebar-title {
        flex: 1;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    #page .np-sidebar-toggle > .np-chevron {
        flex-shrink: 0;
    }

    html.np-responsive-js #page .sidebar > .np-service-context {
        display: block;
        margin: 0;
        padding: 4px 0 8px;
        border-bottom: 1px solid #d5deea;
    }

    #page .sidebar .np-service-children {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    #page .sidebar .np-service-children > li {
        margin: 0;
        list-style: none;
    }

    #page .sidebar .np-service-context a {
        display: block;
        box-sizing: border-box;
        min-height: 44px;
        padding: 10px 0;
        color: #52658f;
        line-height: 1.5;
        text-decoration: none;
    }

    #page .sidebar .np-service-context a:hover,
    #page .sidebar .np-service-context a:focus-visible {
        text-decoration: underline;
    }

    #page .sidebar .np-service-parent {
        font-size: 14px;
    }

    html.np-responsive-js #page .sidebar.np-sidebar-open > .np-service-context {
        display: none;
    }

    html.np-responsive-js #page .sidebar > .nav-menu {
        display: none;
    }

    html.np-responsive-js #page .sidebar.np-sidebar-open > .nav-menu {
        display: block;
    }

    #page input.vvod,
    #page textarea.vvod,
    #page .content input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]),
    #page .content textarea,
    #page .content select {
        box-sizing: border-box;
        max-width: 100%;
        font-size: 16px;
    }

    .footer {
        box-sizing: border-box;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: auto;
        min-width: 0;
        max-width: 100%;
        margin: 12px 0 0;
        padding: 8px 16px;
        font-size: 0.875rem;
        line-height: normal;
        text-align: left;
        overflow-wrap: anywhere;
    }

    .footer > div,
    .footer .fcontent,
    .footer .counters,
    .footer ul.contact {
        float: none;
        flex-basis: auto;
        width: 100%;
        max-width: 100%;
        margin: 0;
        text-align: left;
    }

    .footer ul.contact li {
        margin: 4px 0;
        font-size: inherit;
        line-height: normal;
    }

    .footer .fcontent > ul.menu_ul {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 0;
    }

    /* Desktop right floats reverse the HTML order. Preserve that order before wrapping. */
    .footer .fcontent > ul.menu_ul > li:nth-of-type(1) { order: 4; }
    .footer .fcontent > ul.menu_ul > li:nth-of-type(2) { order: 3; }
    .footer .fcontent > ul.menu_ul > li:nth-of-type(3) { order: 2; }
    .footer .fcontent > ul.menu_ul > li:nth-of-type(4) { order: 1; }

    .footer .fcontent > ul.menu_ul > .clear {
        display: none;
    }

    .footer .fcontent ul.menu_ul li {
        float: none !important;
        line-height: normal;
    }

    .footer .fcontent > ul.menu_ul > li:last-of-type {
        padding-left: 0;
    }

    .footer .credits {
        margin: 8px 0;
    }
}

@media screen and (max-width: 599px) {
    /* Only the homepage news feed is compact on phones. Article pages stay complete. */
    #page .maincol .news-tags {
        display: none;
    }

    #page .maincol .news-date {
        display: block;
        margin: 3px 0;
    }

    #page .maincol .news-text {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        max-height: 4.5em;
        overflow: hidden;
    }

    #page .services,
    #page .np-image-card-grid,
    #page .np-grid-table > tbody > tr,
    #page .np-grid-table > tr {
        grid-template-columns: minmax(0, 1fr);
    }

    #page .service {
        min-height: 0;
    }

    #page .content .alignleft,
    #page .content .alignright,
    #page .r_sidebar .alignleft,
    #page .r_sidebar .alignright {
        float: none !important;
        box-sizing: border-box;
        max-width: 100%;
        margin: 12px auto;
    }

    #page img.alignleft,
    #page img.alignright,
    #page .wp-caption {
        display: block;
    }

    #page .main_objects_unhover {
        float: none;
        width: 100%;
        height: auto;
        margin: 8px 0;
    }

    #page .main_objects_block {
        box-sizing: border-box;
        width: 100%;
        height: auto;
        min-height: 96px;
        padding: 12px 12px 12px 72px;
        font-size: 14px;
    }
}
