@media (max-width: 849px) {
  #header {
    display: flex;
    flex-direction: column;
  }

  #header .header-bg-container {
    position: relative;
    inset: auto;
    aspect-ratio: 1200 / 178;
    height: auto;
  }

  #header .header-bg-image {
    background-size: contain;
    background-position: center;
  }

  #header #top-bar,
  #header #masthead {
    background-color: #e8edf4 !important;
  }

  #header #top-bar .mobile-nav a {
    display: grid;
    place-items: center;
    min-height: 44px;
  }

  #masthead .header-inner {
    justify-content: center;
  }

  #masthead #logo {
    width: auto;
    margin: 0;
  }

  #header #wide-nav.hide-for-medium,
  #wide-nav > .container > .flex-left.hide-for-medium {
    display: block !important;
  }

  #header #wide-nav {
    order: 1;
    top: auto;
    margin: 0;
    border-radius: 0;
    background: #2d3a71;
    box-shadow: none;
  }

  #wide-nav > .container,
  #wide-nav > .container > .flex-left {
    width: 100%;
  }

  #wide-nav .header-bottom-nav.nav-left {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 12px;
  }

  #wide-nav .nav-left > li {
    grid-column: span 2;
    margin: 0;
  }

  #wide-nav .nav-left > li:nth-child(n+4) {
    grid-column: span 3;
  }

  #header #wide-nav .nav-left > li > a {
    display: flex;
    justify-content: center;
    min-height: 48px;
    padding: 6px 4px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: .9rem;
    line-height: 1.2;
    text-align: center;
  }

  #header #wide-nav .nav-left > li > a:is(:hover, :focus-visible) {
    background: rgba(255, 255, 255, .23);
  }

  #main .page-wrapper {
    padding-block: 18px;
  }

  #main .page-left-sidebar > .row:has(> #content) {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  #main .page-left-sidebar > .row > :is(#content, .col-divided) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-basis: auto;
  }

  #main .page-left-sidebar > .row > .col-divided {
    order: 1;
    border: 0;
    padding-top: 12px;
  }

  #main .section-content > .row:has(> .derevocat) > .col {
    padding-bottom: 8px;
  }

  #main .section-content > .row:has(> .derevocat) .text-box {
    width: 100%;
  }

  #main .section-content > .row:has(> .derevocat) h4 {
    margin: 0;
  }

  #main .section-content > .row:has(> .derevocat) h4 a {
    display: grid;
    place-items: center;
    min-height: 50px;
    padding: 3px 6px;
    line-height: 1.2;
  }

  #content {
    overflow-wrap: anywhere;
  }

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

  #content table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
  }

  #content td,
  #content th {
    white-space: normal;
    overflow-wrap: anywhere;
    padding-inline: 6px;
  }

  #content :is(iframe, input, select, textarea) {
    max-width: 100%;
  }

  #popup_toggle {
    right: 10px !important;
    bottom: 10px !important;
    width: 48px;
    height: 48px;
    margin: 0;
  }

  #popup_toggle :is(.circlephone, .circle-fill) {
    display: none;
  }

  #popup_toggle :is(.img-circle, .img-circleblock) {
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    animation: none;
  }

  #popup_toggle .img-circleblock {
    background-size: 70% auto;
  }

  .modals .modal-dialog {
    width: min(480px, calc(100% - 24px));
    max-width: none;
    box-sizing: border-box;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .modals .modal-open:checked ~ .modal-wrap .modal-dialog {
    top: 12px;
  }
}

@media (min-width: 600px) and (max-width: 849px) {
  #wide-nav .header-bottom-nav.nav-left {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #wide-nav .nav-left > li:nth-child(n) {
    grid-column: auto;
  }
}

@media (max-width: 599px) {
  #main #content .section {
    padding-inline: 0;
  }

  /* Product specifications have a full-width model heading over two columns. */
  #content table:has(> tbody > tr:first-child > td[colspan="2"]:only-child) {
    table-layout: auto;
    border-collapse: collapse;
    margin-block: 12px 24px;
  }

  #content table:has(> tbody > tr:first-child > td[colspan="2"]:only-child) td {
    width: auto;
    height: auto;
    /* Override the legacy theme's compact table-cell rules. */
    padding: 9px clamp(6px, 2vw, 10px) !important;
    border-bottom: 1px solid #d5deeb !important;
    color: #25344a;
    font-size: .875rem;
    line-height: 1.5;
    text-align: left;
    vertical-align: top;
  }

  #content table:has(> tbody > tr:first-child > td[colspan="2"]:only-child) td:first-child:not([colspan]) {
    width: 48%;
    background: #eaf1fa;
    font-weight: 600;
  }

  #content table:has(> tbody > tr:first-child > td[colspan="2"]:only-child) > tbody > tr:first-child > td {
    padding-block: 11px !important;
    background: #2d3a71;
    color: #fff;
    font-size: .9375rem;
  }

  #content label[for="modal-1"]:has(> img) {
    display: flex;
    justify-content: flex-end;
    min-height: 48px;
    margin-bottom: 8px;
  }

  #content label[for="modal-1"] > img {
    float: none;
    align-self: center;
  }

  /* Legacy catalogue tables store photos and captions in separate rows. */
  #content table:has(> tbody > tr.subnav),
  #content table:has(> tbody > tr.subnav) > tbody > tr {
    display: contents;
  }

  #content table:has(> tbody > tr.subnav) > tbody {
    display: grid;
    margin-bottom: 18px;
  }

  #content table:has(> tbody > tr.subnav) td {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
  }

  #content table:has(> tbody > tr.subnav) tr:first-child td {
    padding: 14px;
    border: 1px solid #e5e4e0;
  }

  #content table:has(> tbody > tr.subnav) tr:first-child a {
    display: grid;
    place-items: center;
    min-height: 150px;
  }

  #content table:has(> tbody > tr.subnav) tr:first-child img {
    display: block;
    width: auto;
    max-height: 205px;
    object-fit: contain;
  }

  #content tr.subnav td {
    margin-bottom: 14px;
    background-color: #eff1f7;
    color: #2d3a71;
    font-size: 1rem;
  }

  #content table:has(> tbody > tr.subnav) td:nth-child(1) { order: 1; }
  #content table:has(> tbody > tr.subnav) td:nth-child(2) { order: 2; }
  #content table:has(> tbody > tr.subnav) td:nth-child(3) { order: 3; }
}
