.site-shell {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  padding-block: 0;
  border-block-start: 0;
  border-block-end: 1px solid var(--line);
}
.site-shell .lp-header__row {
  position: relative;
  box-sizing: border-box;
  block-size: 70px;
  padding-block: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "logo nav theme";
  align-items: center;
  gap: 12px;
}
.site-shell--home .lp-header__row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "logo nav phone theme";
}
.site-shell .lp-logo { grid-area: logo; white-space: nowrap; }
.site-shell :is(.lp-theme, .lp-header__tel, .lp-mobile-nav summary) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  block-size: 42px;
  min-block-size: 42px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
}
.site-shell :is(.lp-theme, .lp-header__tel, .lp-mobile-nav summary):hover {
  background: var(--wash);
  border-color: var(--ink);
}
.site-shell :is(.lp-theme, .lp-header__tel) {
  inline-size: 42px;
  padding: 0;
}
.site-shell .lp-theme { grid-area: theme; }
.site-shell .lp-header__tel { grid-area: phone; }
.site-shell .lp-theme img { inline-size: 22px; block-size: 22px; flex: none; }
/* The original moon SVG has more transparent padding than the sun. */
.site-shell .lp-theme img[src$="/moon.svg"] { transform: scale(1.55); }
.site-shell .lp-header__tel-text { display: none; }
.site-shell .lp-header__tel-ico { display: block; flex: none; }
.site-shell__nav {
  grid-area: nav;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(8px, 1.15vw, 18px);
}
.site-shell__nav > a, .site-shell summary, .site-shell__panel a {
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}
.site-shell__nav > a { white-space: nowrap; }
.site-shell summary { cursor: pointer; }
.site-shell :is(nav a:hover, .site-shell__panel a:hover, summary:hover),
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brand-red); text-underline-offset: .25em; }
.site-shell a[aria-current], .site-shell summary.is-current {
  text-decoration: underline;
  text-decoration-color: var(--brand-red);
  text-underline-offset: .25em;
}
.site-company { position: relative; }
.site-company summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-block: 9px;
}
.site-company summary::-webkit-details-marker { display: none; }
.site-company summary::after {
  content: "";
  width: .38em;
  height: .38em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.site-company[open] summary::after { transform: translateY(2px) rotate(225deg); }
.site-shell__panel, .site-shell .lp-mobile-nav .site-shell__mobile-panel {
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
}
.site-shell__panel {
  position: absolute;
  inset-block-start: 100%;
  inset-inline-end: 0;
  width: 244px;
  padding: 8px;
}
.site-shell__panel a { display: block; padding: 9px 12px; }
.site-shell .lp-mobile-nav { display: none; grid-area: menu; margin: 0; }
.site-shell .lp-mobile-nav .site-shell__mobile-panel {
  inset-inline: var(--editorial-gutter, 16px);
  width: auto;
  max-height: min(70dvh, calc(100dvh - 90px));
  padding: 14px 18px;
  overflow: auto;
  overscroll-behavior: contain;
}
.site-shell__mobile-panel a { display: block; padding: 8px 0; }
.site-shell__mobile-panel section { padding: 0 0 9px; }
.site-shell__mobile-panel section + section {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.site-shell__mobile-panel p {
  margin: 0 0 3px;
  color: var(--soft);
  font-size: .8125rem;
  font-weight: 700;
}
.site-shell :is(a, button, summary):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.site-footer .lp-footer__top {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1.15fr 1.2fr;
  gap: 24px clamp(16px, 3vw, 42px);
}
.site-footer .lp-footer__col { min-width: 0; }
.site-footer .lp-footer__col a { overflow-wrap: anywhere; }
.site-footer .lp-footer__h { color: var(--ink); }
.site-footer .lp-footer__row p { margin: 0; }
.site-footer .site-footer__book-links { margin-block-start: 8px; }
.site-footer .site-footer__book-links summary { cursor: pointer; color: var(--soft); font-weight: 600; }
.site-footer .site-footer__book-links a { display: block; margin-block-start: 8px; }
.site-footer .lp-footer__row .site-footer__book-note { flex-basis: 100%; }

@media (max-width: 1179px) {
  .site-shell .lp-header__row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "logo menu theme"; }
  .site-shell--home .lp-header__row { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "logo menu phone theme"; }
  .site-shell__nav { display: none; }
  .site-shell .lp-mobile-nav { display: block; }
}
@media (min-width: 641px) and (max-width: 840px) {
  .site-footer .lp-footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .site-shell .lp-header__row { block-size: 60px; gap: 8px; padding-block: 0; }
  main [id], main[id], #task, #contacts, #cases, #case-parts, .article-copy :is(h2, .grable) { scroll-margin-top: 138px; }
  .lp-footer.site-footer .lp-footer__top { grid-template-columns: minmax(0, 1fr); }
  .site-footer .lp-footer__col + .lp-footer__col { border-top: 1px solid var(--line); padding-top: 16px; }
}
@media (max-width: 360px) {
  .site-shell--home .lp-header__row { column-gap: 5px; }
  .site-shell--home .lp-logo { font-size: 17px; }
  .site-shell--home .lp-mobile-nav summary { padding-inline: 6px; }
}
