:root {
  --bg: #ffffff;
  --text: #171b22;
  --muted: #69717e;
  --soft: #f6f7f9;
  --line: #dde1e7;
  --line-strong: #cfd5dd;
  --red: #ed0000;
  --red-dark: #c90000;
  --teal: #00a7ad;
  --header-h: 78px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-top: 7px solid #363941;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(21, 25, 31, 0.07);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(100%, 1780px);
  min-height: var(--header-h);
  margin: 0 auto;
  padding: 14px clamp(22px, 3vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  width: 185px;
  height: auto;
  display: block;
}

.contacts {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  font-style: normal;
  color: #20252e;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  white-space: nowrap;
  transition: color 160ms ease;
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--red);
}

.contact-link svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  fill: var(--red);
}

.contact-divider {
  width: 1px;
  height: 34px;
  background: var(--line-strong);
}

.layout {
  width: min(100%, 1780px);
  margin: 0 auto;
  padding: 38px clamp(22px, 3vw, 56px) 92px;
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: clamp(44px, 5vw, 96px);
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 34px);
  min-width: 0;
}

.toc-panel {
  border-right: 1px solid var(--line);
  padding: 52px 28px 42px 0;
}

.toc-head {
  display: block;
}

.toc h2 {
  margin: 0 0 34px;
  color: #10141a;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 800;
}

.toc-toggle {
  display: none;
}

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.toc-group {
  list-style: none;
}

.toc-link {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 42px;
  padding: 5px 0 5px 0;
  color: #3c434f;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  transition: color 160ms ease, transform 160ms ease;
}

.toc-number {
  color: var(--red);
  font-weight: 850;
}

.toc-link::after {
  content: "";
  position: absolute;
  left: -28px;
  top: 8px;
  width: 4px;
  height: 28px;
  background: transparent;
  border-radius: 999px;
  transition: background 160ms ease;
}

.toc-link:hover,
.toc-link:focus-visible,
.toc-link.is-active {
  color: #111720;
  transform: translateX(3px);
}

.toc-link:hover::after,
.toc-link:focus-visible::after,
.toc-link.is-active::after {
  background: var(--red);
}

.toc-sublist {
  display: none;
  margin: 2px 0 8px 42px;
  padding: 0;
  list-style: none;
  gap: 8px;
}

.toc-group.is-open .toc-sublist {
  display: grid;
}

.toc-sub {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  min-height: 34px;
  padding: 4px 0;
}

.toc-sub .toc-number {
  font-weight: 800;
}

.toc-link span:last-child {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.toc-sub span:last-child {
  -webkit-line-clamp: 3;
}

.document {
  min-width: 0;
  padding-top: 32px;
}

.document-hero {
  padding: 0 0 34px;
  margin: 0 0 40px;
  border-bottom: 1px solid var(--line);
}

.document .document-hero p {
  text-align: left;
  text-indent: 0;
}

.document-hero h1 {
  max-width: 1000px;
  margin: 0 0 18px;
  color: #10141a;
  font-size: clamp(28px, 2.5vw, 35px);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-line {
  max-width: 1000px;
  margin: 7px 0 0;
  color: #222832;
  font-size: clamp(20px, 2vw, 31px);
  font-weight: 800;
  line-height: 1.2;
}

.hero-line-muted {
  color: var(--muted);
  font-size: clamp(18px, 1.5vw, 25px);
  text-transform: none;
}

.document p {
  max-width: 1120px;
  margin: 0 0 18px;
  color: #303844;
  font-size: 18px;
  line-height: 1.72;
  font-weight: 450;
  text-align: justify;
  text-indent: 34px;
}

.section-heading,
.subsection-heading {
  max-width: 1120px;
  scroll-margin-top: 120px;
  display: flex;
  align-items: baseline;
  gap: 28px;
  color: #12171f;
  font-weight: 850;
  letter-spacing: 0;
}

.section-heading {
  margin: 44px 0 22px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
}

.section-heading:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.subsection-heading {
  margin: 36px 0 18px;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.25;
}

.section-heading span,
.subsection-heading span,
.numbered-paragraph > span:first-child {
  position: relative;
  flex: 0 0 auto;
  color: var(--red);
  font-weight: 900;
}

.section-heading span::after,
.subsection-heading span::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -12px;
  width: 32px;
  height: 4px;
  border-radius: 999px;
  background: var(--red);
}

.document .numbered-paragraph {
  display: block;
  text-indent: 0;
  text-align: left;
}

.document .numbered-paragraph > span:first-child {
  display: inline;
  margin-right: 14px;
  font-size: 18px;
  line-height: 1.72;
}

.document .numbered-paragraph .paragraph-body {
  display: inline;
  min-width: 0;
}

.document .bullet-paragraph {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 14px;
  text-indent: 0;
  text-align: left;
  align-items: start;
}

.document .bullet-paragraph > span:first-child {
  width: 7px;
  height: 7px;
  margin-top: 13px;
  border-radius: 50%;
  background: var(--red);
}

.definition-paragraph {
  padding-left: 0;
  border-left: 0;
}

.document .dash-paragraph {
  text-indent: 0;
  text-align: left;
}

.paragraph-body {
  color: #303844;
  width: auto;
  height: auto;
  min-width: 0;
}

.document strong {
  color: #10141a;
  font-weight: 800;
}

.document a {
  color: var(--red-dark);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

::selection {
  color: #ffffff;
  background: var(--red);
}

@media (max-width: 1120px) {
  :root {
    --header-h: 86px;
  }

  .header-inner {
    min-height: var(--header-h);
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 26px;
  }

  .toc {
    position: static;
  }

  .toc-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 20px 0 24px;
  }

  .toc h2 {
    margin-bottom: 18px;
    font-size: 22px;
  }

  .toc-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .toc-list > .toc-group {
    flex: 0 0 min(330px, 84vw);
    scroll-snap-align: start;
  }

  .toc-link {
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
  }

  .toc-link::after {
    display: none;
  }

  .toc-sublist {
    margin: 8px 0 0;
    padding: 0;
  }

  .toc-sub {
    min-height: 50px;
    padding: 10px 14px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: auto;
  }

  .site-header {
    position: static;
  }

  .header-inner {
    padding: 14px 18px 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .brand img {
    width: 156px;
  }

  .contacts {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 15px;
  }

  .contact-divider {
    display: none;
  }

  .contact-link {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .layout {
    padding: 20px 18px 58px;
  }

  .toc-panel {
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
  }

  .toc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
  }

  .toc h2 {
    margin: 0;
    font-size: 18px;
  }

  .toc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
  }

  .toc-toggle span,
  .toc-toggle span::before,
  .toc-toggle span::after {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--red);
  }

  .toc-toggle span {
    position: relative;
  }

  .toc-toggle span::before,
  .toc-toggle span::after {
    content: "";
    position: absolute;
    top: 0;
  }

  .toc-toggle span::before {
    left: -10px;
  }

  .toc-toggle span::after {
    left: 10px;
  }

  .toc.is-expanded .toc-toggle {
    border-color: rgba(237, 0, 0, 0.24);
    background: rgba(237, 0, 0, 0.06);
  }

  .toc-list {
    display: none;
    gap: 6px;
    max-height: min(62vh, 520px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px 10px 12px;
    border-top: 1px solid var(--line);
    scroll-snap-type: none;
  }

  .toc.is-expanded .toc-list {
    display: grid;
  }

  .toc-list > .toc-group {
    flex: initial;
    scroll-snap-align: initial;
  }

  .toc-link {
    min-height: 0;
    padding: 9px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
  }

  .toc-link:hover,
  .toc-link:focus-visible,
  .toc-link.is-active {
    background: rgba(237, 0, 0, 0.055);
    transform: none;
  }

  .toc-sublist {
    margin: 2px 0 8px 34px;
  }

  .toc-sub {
    min-height: 0;
    padding: 7px 8px;
  }

  .document {
    padding-top: 10px;
  }

  .document-hero {
    margin-bottom: 28px;
    padding-bottom: 26px;
  }

  .document-hero h1 {
    font-size: 34px;
    line-height: 1.08;
  }

  .hero-line {
    font-size: 19px;
  }

  .hero-line-muted {
    font-size: 17px;
  }

  .document p {
    font-size: 16px;
    line-height: 1.68;
  }

  .section-heading,
  .subsection-heading {
    gap: 16px;
  }

  .section-heading {
    font-size: 25px;
    margin-top: 34px;
    padding-top: 24px;
  }

  .subsection-heading {
    font-size: 21px;
  }

  .numbered-paragraph {
    display: block;
  }

  .document p {
    text-indent: 24px;
  }
}

@media (max-width: 440px) {
  .document-hero h1 {
    font-size: 29px;
  }

  .section-heading,
  .subsection-heading {
    display: grid;
    gap: 10px;
  }

  .section-heading span::after,
  .subsection-heading span::after {
    bottom: -7px;
    width: 40px;
    height: 3px;
  }
}
