/* =====================================================================
   ЭТОС · База знаний «Правовые вопросы» — кастомная тема для Help Scout Docs
   Куда загрузить: Manage → Docs → [ваш сайт] → Custom Code →
   «Custom Stylesheet» → Choose File → Save.

   Приём со специфичностью: префикс :is(html,#e) весит как id-селектор,
   поэтому наши правила стабильно перебивают стандартную тему Help Scout
   (Bootstrap 2) без россыпи !important. #e на странице не существует —
   он нужен только ради веса селектора.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700;800&display=swap');

/* ---------- 1. Токены: меняйте цвета только здесь ---------- */
:root {
  --e-ink: #191C3A;          /* «чернила»: заголовки, шапка-hero, активные элементы */
  --e-ink-soft: #2B3060;
  --e-text: #262942;         /* основной текст */
  --e-muted: #5D627F;        /* вторичный текст, даты, счётчики */
  --e-paper: #FFFFFF;
  --e-surface: #F3F4F9;      /* подложки, ховеры */
  --e-line: #E2E4EF;         /* линии-разделители */
  --e-link: #3442C4;         /* ссылки в тексте */
  --e-accent: #F5A65B;       /* абрикос: кнопка поиска, маркеры, фокус */
  --e-accent-deep: #D9822F;
  --e-accent-soft: #FFF1E3;

  --e-font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --e-max: 1160px;           /* ширина контента */
  --e-read: 720px;           /* ширина колонки статьи (~70 знаков) */
  --e-gutter: clamp(20px, 4vw, 40px);
  --e-radius: 14px;

  /* фото для первого экрана: Ереван и Арарат, Charlie Harland / Unsplash
     (Unsplash License — бесплатно, в т.ч. для некоммерческих сайтов) */
  --e-hero-photo: url("https://images.unsplash.com/photo-1745817238923-8b07c1e4b7f9?fm=jpg&q=70&w=2400&auto=format&fit=crop");
}

/* ---------- 2. База ---------- */
:is(html,#e) body {
  background: var(--e-paper);
  color: var(--e-text);
  font-family: var(--e-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
:is(html,#e) body::after { background: var(--e-paper); }

:is(html,#e) :is(h1, h2, h3, h4, h5, h6, input, button, select, textarea, .btn) {
  font-family: var(--e-font);
}
:is(html,#e) a { color: var(--e-link); }
:is(html,#e) a:hover { color: var(--e-ink); }

@media (max-width: 767px) {
  :is(html,#e) body { padding-left: 0; padding-right: 0; }
}

::selection { background: var(--e-accent-soft); color: var(--e-ink); }

:is(html,#e) :is(a, button, select, .btn, summary):focus-visible {
  outline: 3px solid var(--e-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- 3. Шапка ---------- */
:is(html,#e) #mainNav,
:is(html,#e) #mainNav .navbar-inner {
  background: var(--e-paper);
  background-image: none;
  filter: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}
:is(html,#e) #mainNav {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--e-line);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}
:is(html,#e) #mainNav .navbar-inner { background: transparent; min-height: 0; padding: 0; }

/* Шапка — одна строка на flex: логотип слева, кнопки справа.
   Так раскладка не зависит от float'ов Bootstrap и от того, куда скрипт вставил кнопку. */
:is(html,#e) #mainNav .container-fluid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: var(--e-max);
  min-height: 80px;
  margin: 0 auto;
  padding: 16px var(--e-gutter);
  box-sizing: border-box;
}
:is(html,#e) #mainNav .container-fluid::before,
:is(html,#e) #mainNav .container-fluid::after { display: none; content: none; }

:is(html,#e) #mainNav .brand {
  order: 0;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 14px;
  row-gap: 1px;
  float: none;
  margin: 0 auto 0 0;
  padding: 0;
  color: var(--e-ink);
  text-shadow: none;
  text-decoration: none;
}
:is(html,#e) #mainNav .brand img {
  grid-row: 1 / span 2;
  grid-column: 1;
  display: block;
  width: auto;
  height: 42px;
  max-width: 220px;
}
/* подпись к логотипу в две строки; тексты меняются здесь */
:is(html,#e) #mainNav .brand::before {
  content: "Правовые вопросы";
  grid-row: 1;
  grid-column: 2;
  align-self: end;
  color: var(--e-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
:is(html,#e) #mainNav .brand::after {
  content: "Фонд «ЭТОС»";
  grid-row: 2;
  grid-column: 2;
  align-self: start;
  color: var(--e-muted);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}
@media (max-width: 600px) {
  :is(html,#e) #mainNav .brand::before,
  :is(html,#e) #mainNav .brand::after { content: none; }
}

/* в меню только «Контакт», поэтому «бургер» не нужен: меню всегда видно */
:is(html,#e) #mainNav .btn-navbar { display: none !important; }
:is(html,#e) #mainNav .nav-collapse,
:is(html,#e) #mainNav .nav-collapse.collapse {
  order: 1;
  position: static !important;
  inset: auto;
  transform: none;
  float: none;
  clear: none;
  width: auto;
  height: auto !important;
  overflow: visible !important;
  margin: 0;
}
:is(html,#e) #mainNav :is(.nav-collapse nav, .nav, .nav > li, .nav > li > a) {
  position: static !important;
  inset: auto;
  transform: none;
}
:is(html,#e) #mainNav .nav {
  display: flex;
  align-items: center;
  gap: 8px;
  float: none;
  margin: 0;
  padding: 0;
}
:is(html,#e) #mainNav .nav > li { float: none; margin: 0; }

/* «Контакт» — второстепенная кнопка-контур; display у ссылок не трогаем,
   чтобы Help Scout сам переключал десктопную и мобильную версии */
:is(html,#e) #mainNav .nav > li > a {
  height: auto;
  margin: 0;
  padding: 9px 18px;
  border: 1.5px solid var(--e-line);
  border-radius: 999px;
  background: transparent;
  color: var(--e-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-shadow: none;
  white-space: nowrap;
  transition: border-color .15s ease;
}
:is(html,#e) #mainNav .nav > li > a:hover,
:is(html,#e) #mainNav .nav > li > a:focus { border-color: var(--e-ink); background: transparent; color: var(--e-ink); }

/* «Помочь людям» — главная кнопка шапки (вставляется скриптом из head-кода) */
:is(html,#e) #mainNav .ethoslink {
  order: 2;
  float: none;
  margin: 0;
  padding: 10.5px 20px;
  border-radius: 999px;
  background: var(--e-accent);
  color: var(--e-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s ease;
}
:is(html,#e) #mainNav .ethoslink:hover,
:is(html,#e) #mainNav .ethoslink:focus { background: var(--e-accent-deep); color: var(--e-ink); }

@media (max-width: 480px) {
  :is(html,#e) #mainNav .container-fluid { min-height: 68px; padding-top: 12px; padding-bottom: 12px; gap: 6px; }
  :is(html,#e) #mainNav .brand img { height: 36px; }
  :is(html,#e) #mainNav .nav > li > a { padding: 8px 13px; font-size: 14px; }
  :is(html,#e) #mainNav .ethoslink { padding: 9.5px 14px; font-size: 14px; }
}

/* на главной шапка тёмная и сливается с hero; на остальных страницах — белая */
:is(html,#e) body:has(#docsSearch) #mainNav {
  background: var(--e-ink);
  border-bottom-color: rgba(255, 255, 255, .07);
}
:is(html,#e) body:has(#docsSearch) #mainNav .brand::before { color: #fff; }
:is(html,#e) body:has(#docsSearch) #mainNav .brand::after { color: rgba(255, 255, 255, .6); }
:is(html,#e) body:has(#docsSearch) #mainNav .nav > li > a { border-color: rgba(255, 255, 255, .28); color: #fff; }
:is(html,#e) body:has(#docsSearch) #mainNav .nav > li > a:hover,
:is(html,#e) body:has(#docsSearch) #mainNav .nav > li > a:focus { border-color: #fff; color: #fff; }

/* ---------- 4. Hero с поиском (главная) ---------- */
:is(html,#e) #docsSearch {
  height: auto;
  margin: 0;
  border: 0;
  /* фото переводится в тон «чернил» (luminosity) и затемняется слева, под текстом */
  background-color: var(--e-ink);
  background-image:
    linear-gradient(90deg, var(--e-ink) 0%, rgba(25, 28, 58, .94) 34%, rgba(25, 28, 58, .66) 64%, rgba(25, 28, 58, .48) 100%),
    linear-gradient(0deg, var(--e-ink) 0%, rgba(25, 28, 58, 0) 32%),
    linear-gradient(180deg, var(--e-ink) 0%, rgba(25, 28, 58, 0) 18%),
    var(--e-hero-photo);
  background-size: cover;
  background-position: center, center, center, 70% 45%;
  background-repeat: no-repeat;
  background-blend-mode: normal, normal, normal, luminosity;
  color: #fff;
  text-align: left;
  padding:
    clamp(56px, 9vw, 120px)
    max(var(--e-gutter), calc((100% - var(--e-max)) / 2 + var(--e-gutter)))
    clamp(56px, 8vw, 104px);
}
:is(html,#e) #docsSearch h1 {
  margin: 0;
  padding: 0;
  max-width: none; /* две строки: «Вы не спрашивали, / но мы ответили» — делит text-wrap: balance */
  color: #fff;
  font-size: clamp(40px, 7vw, 84px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  text-align: left;
  text-wrap: balance;
}
/* подзаголовок под hero; удалите блок, если не нужен */
:is(html,#e) #docsSearch h1::after {
  content: "Юридические вопросы о жизни в Армении — простым языком";
  display: block;
  max-width: 40ch;
  margin-top: 22px;
  color: rgba(255, 255, 255, .7);
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
}

/* ---------- 5. Поиск (общие стили для hero и сайдбара) ---------- */
:is(html,#e) #searchBar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  float: none;
}
:is(html,#e) #searchBar::before,
:is(html,#e) #searchBar::after { display: none; content: none; }
/* поле занимает всю строку, кнопка лежит поверх его правого края */
:is(html,#e) #searchBar .search-query { grid-row: 1; grid-column: 1 / -1; }
:is(html,#e) #searchBar button { grid-row: 1; grid-column: 2; }
:is(html,#e) #searchBar .search-query {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 56px 0 18px;
  box-sizing: border-box;
  background: var(--e-surface);
  color: var(--e-ink);
  border: 2px solid transparent;
  border-radius: 12px;
  box-shadow: none;
  font-size: 16px;
  line-height: normal;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
:is(html,#e) #searchBar .search-query::placeholder { color: var(--e-muted); opacity: 1; }
:is(html,#e) #searchBar .search-query:focus {
  outline: none;
  background: #fff;
  border-color: var(--e-accent);
  box-shadow: 0 0 0 4px rgba(245, 166, 91, .3);
}
:is(html,#e) #searchBar button {
  position: relative;
  top: auto;
  right: auto;
  z-index: 1;
  justify-self: end;
  height: 40px;
  min-width: 40px;
  margin: 0 6px 0 0;
  padding: 0 12px;
  background: transparent;
  background-image: none;
  color: var(--e-muted);
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  text-shadow: none;
  filter: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
:is(html,#e) #searchBar button:hover { color: var(--e-ink); background: rgba(25, 28, 58, .06); }

/* большой поиск в hero */
:is(html,#e) #docsSearch #searchBar { max-width: 680px; margin-top: 40px; }
:is(html,#e) #docsSearch #searchBar .search-query {
  height: 66px;
  padding: 0 136px 0 24px;
  background: #fff;
  border-radius: 18px;
  font-size: 18px;
}
/* Help Scout сам ставит курсор в поиск при загрузке, поэтому фокус в hero
   спокойный: только рамка, без свечения */
:is(html,#e) #docsSearch #searchBar .search-query:focus {
  border-color: var(--e-accent);
  box-shadow: none;
}
:is(html,#e) #docsSearch #searchBar button {
  margin-right: 9px;
  height: 48px;
  padding: 0 24px;
  background: var(--e-accent);
  color: var(--e-ink);
  border-radius: 12px;
  font-size: 16px;
  transition: background-color .15s ease;
}
:is(html,#e) #docsSearch #searchBar button:hover { background: var(--e-accent-deep); color: var(--e-ink); }
:is(html,#e) #searchBar button i { margin-right: 6px; opacity: .85; }

/* плашка о фонде под поиском (вставляется скриптом из head-кода) */
:is(html,#e) #docsSearch .ethos-promo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  max-width: 680px;
  margin: 28px 0 0;
  padding: 18px 22px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  color: rgba(255, 255, 255, .78);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}
:is(html,#e) #docsSearch .ethos-promo-banner span { flex: 1 1 300px; }
:is(html,#e) #docsSearch .ethos-promo-banner a {
  flex: none;
  padding: 9px 18px;
  border: 1.5px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
:is(html,#e) #docsSearch .ethos-promo-banner a:hover,
:is(html,#e) #docsSearch .ethos-promo-banner a:focus { background: #fff; border-color: #fff; color: var(--e-ink); }

/* выпадающие подсказки поиска */
:is(html,#e) #serp-dd {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  width: auto;
  margin: 0;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--e-line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(25, 28, 58, .18);
  z-index: 50;
  text-align: left;
  overflow: hidden;
}
:is(html,#e) #serp-dd .result { margin: 0; padding: 0; list-style: none; }
:is(html,#e) #serp-dd .result li { margin: 0; border: 0; }
:is(html,#e) #serp-dd .result a {
  display: block;
  padding: 11px 14px;
  border-radius: 9px;
  color: var(--e-text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
:is(html,#e) #serp-dd .result a:hover,
:is(html,#e) #serp-dd .result > li.active,
:is(html,#e) #serp-dd .result > li.active a { background: var(--e-surface); color: var(--e-ink); }

/* ---------- 6. Контейнер и колонки ---------- */
:is(html,#e) #contentArea {
  max-width: var(--e-max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--e-gutter) clamp(56px, 8vw, 96px);
  box-sizing: border-box;
  background: transparent;
}
:is(html,#e) #main-content,
:is(html,#e) .contentWrapper {
  background: none;
  border: 0;
  box-shadow: none;
  min-height: 0;
}
:is(html,#e) .contentWrapper { padding: 0; margin: 0; }
:is(html,#e) #main-content { padding: 0; }

@media (min-width: 768px) {
  :is(html,#e) #main-content { width: 68%; margin-left: 0; float: left; }
  :is(html,#e) #sidebar {
    width: 26%;
    margin-left: 0;
    float: right;
    position: sticky;
    top: 96px;
  }
}

/* ---------- 7. Главная: разделы ---------- */
:is(html,#e) .collection-category { margin: 0 0 56px; text-align: left; }
:is(html,#e) .collection-category h2,
:is(html,#e) .most-pop-articles h2,
:is(html,#e) .most-pop-articles h3 {
  margin: 0 0 20px;
  color: var(--e-ink);
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.015em;
  text-align: left;
}
:is(html,#e) .collection-category h2 a { color: inherit; text-decoration: none; }

:is(html,#e) .category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--e-line);
  text-align: left;
}
:is(html,#e) .category-list::before,
:is(html,#e) .category-list::after { display: none; content: none; }

:is(html,#e) .category-list .category {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 16px;
  float: none;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 26px 12px 26px 22px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--e-line);
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition: background-color .15s ease;
}
:is(html,#e) .category-list .category::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 4px;
  border-radius: 4px;
  background: var(--e-accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform .2s ease;
}
:is(html,#e) .category-list .category:hover { background: var(--e-surface); }
:is(html,#e) .category-list .category:hover::before,
:is(html,#e) .category-list .category:focus-visible::before { transform: scaleY(1); }

:is(html,#e) .category-list .category h3 {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  padding: 0;
  color: var(--e-ink);
  font-size: clamp(19px, 1.9vw, 23px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
:is(html,#e) .category-list .category p {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 6px 0 0;
  color: var(--e-muted);
  font-size: 15px;
  line-height: 1.5;
}
:is(html,#e) .category-list .category p:empty { display: none; }
:is(html,#e) .category-list .category .article-count {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--e-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
:is(html,#e) .category-list .category:hover .article-count { color: var(--e-ink); }

/* популярные статьи (если включены в настройках) */
:is(html,#e) .most-pop-articles { margin-top: 56px; text-align: left; }
:is(html,#e) .most-pop-articles .popArticles { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--e-line); }
:is(html,#e) .most-pop-articles .popArticles li { margin: 0; border-bottom: 1px solid var(--e-line); }
:is(html,#e) .most-pop-articles .popArticles a { display: block; padding: 16px 8px; color: var(--e-ink); font-weight: 500; text-decoration: none; }
:is(html,#e) .most-pop-articles .popArticles a:hover { background: var(--e-surface); }
:is(html,#e) .most-pop-articles .popArticles a span { color: inherit; }
:is(html,#e) .most-pop-articles .popArticles i { display: none; }

/* ---------- 8. Страница категории и результаты поиска ---------- */
:is(html,#e) #categoryHead { margin: 0 0 32px; padding: 0; border: 0; }
:is(html,#e) #categoryHead h1,
:is(html,#e) .contentWrapper > h1,
:is(html,#e) #serp h1 {
  margin: 0 0 10px;
  color: var(--e-ink);
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
:is(html,#e) #categoryHead .descrip { margin: 0 0 8px; color: var(--e-muted); font-size: 18px; }
:is(html,#e) #categoryHead .sort { margin: 12px 0 0; float: none; }
:is(html,#e) #categoryHead .sort select {
  width: auto;
  height: 40px;
  margin: 0;
  padding: 0 36px 0 14px;
  background-color: var(--e-surface);
  color: var(--e-text);
  border: 1px solid var(--e-line);
  border-radius: 10px;
  box-shadow: none;
  font-size: 14px;
}

:is(html,#e) .articleList { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--e-line); }
:is(html,#e) .articleList li { margin: 0; padding: 0; border-bottom: 1px solid var(--e-line); }
:is(html,#e) .articleList li a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 10px;
  color: var(--e-ink);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
:is(html,#e) .articleList li a i { display: none; }
:is(html,#e) .articleList li a::after {
  content: "";
  flex: none;
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .3;
  transition: opacity .15s ease, transform .15s ease;
}
:is(html,#e) .articleList li a:hover { background: var(--e-surface); color: var(--e-link); }
:is(html,#e) .articleList li a:hover::after { opacity: .9; transform: translateX(3px) rotate(45deg); }
:is(html,#e) .articleList li p { margin: -8px 10px 16px; color: var(--e-muted); font-size: 15px; }

/* пагинация */
:is(html,#e) .pagination ul { box-shadow: none; }
:is(html,#e) .pagination ul > li > a,
:is(html,#e) .pagination ul > li > span {
  margin: 0 4px 0 0;
  padding: 6px 13px;
  border: 1px solid var(--e-line);
  border-radius: 9px;
  color: var(--e-text);
}
:is(html,#e) .pagination ul > .active > a,
:is(html,#e) .pagination ul > .active > span { background: var(--e-ink); border-color: var(--e-ink); color: #fff; }

/* ---------- 9. Сайдбар ---------- */
:is(html,#e) #sidebar { padding: 0; background: none; border: 0; }
:is(html,#e) #sidebar #searchBar { margin: 0 0 28px; }
:is(html,#e) #sidebar #searchBar button span {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
:is(html,#e) #sidebar h3 {
  margin: 0 0 10px;
  padding: 0 14px;
  color: var(--e-muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
:is(html,#e) #sidebar .nav-list { margin: 0; padding: 0; }
:is(html,#e) #sidebar .nav-list > li { line-height: inherit; }
:is(html,#e) #sidebar .nav-list > li > a {
  margin: 0 0 2px;
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--e-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  text-shadow: none;
  text-decoration: none;
  transition: background-color .15s ease;
}
:is(html,#e) #sidebar .nav-list > li > a:hover { background: var(--e-surface); color: var(--e-ink); }
:is(html,#e) #sidebar .nav-list > .active > a,
:is(html,#e) #sidebar .nav-list > .active > a:hover,
:is(html,#e) #sidebar .nav-list > .active > a:focus { background: var(--e-ink); color: #fff; font-weight: 600; }
:is(html,#e) #sidebar .nav-list i { display: none; }
:is(html,#e) #sidebar :is(#sbContact, .contactUs) { color: var(--e-link); font-weight: 600; }

@media (max-width: 767px) {
  :is(html,#e) #sidebar { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--e-line); }
}

/* ---------- 10. Статья ---------- */
:is(html,#e) #fullArticle {
  position: relative;
  max-width: var(--e-read);
  margin: 0;
  padding: 0;
  color: var(--e-text);
  font-size: 17.5px;
  line-height: 1.72;
  overflow-wrap: break-word;
}
:is(html,#e) #fullArticle h1.title {
  margin: 0 0 32px;
  padding: 0 48px 0 0;
  color: var(--e-ink);
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
/* заголовки разделов внутри текста (в редакторе это часто H1) */
:is(html,#e) #fullArticle :is(h1:not(.title), h2) {
  margin: 2.2em 0 .6em;
  padding: 0;
  color: var(--e-ink);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
:is(html,#e) #fullArticle h3 { margin: 1.9em 0 .5em; color: var(--e-ink); font-size: 21px; font-weight: 700; line-height: 1.3; }
:is(html,#e) #fullArticle h4 { margin: 1.6em 0 .4em; color: var(--e-ink); font-size: 18px; font-weight: 700; }
:is(html,#e) #fullArticle p { margin: 0 0 1.1em; }
:is(html,#e) #fullArticle strong,
:is(html,#e) #fullArticle b { color: var(--e-ink); font-weight: 650; }

:is(html,#e) #fullArticle a {
  color: var(--e-link);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .2em;
  text-decoration-color: rgba(52, 66, 196, .3);
  transition: text-decoration-color .15s ease;
}
:is(html,#e) #fullArticle a:hover { text-decoration-color: currentColor; }
:is(html,#e) #fullArticle a :is(strong, b),
:is(html,#e) #fullArticle :is(strong, b) a { color: var(--e-link); font-weight: 600; }

:is(html,#e) #fullArticle :is(ul, ol) { margin: 0 0 1.2em; padding-left: 1.35em; }
:is(html,#e) #fullArticle li { margin: .4em 0; padding-left: .25em; line-height: inherit; }
:is(html,#e) #fullArticle li > :is(ul, ol) { margin: .4em 0 .2em; }
:is(html,#e) #fullArticle ul > li::marker { color: var(--e-accent-deep); }
:is(html,#e) #fullArticle ul ul > li::marker { color: var(--e-muted); }
:is(html,#e) #fullArticle ol > li::marker { color: var(--e-muted); font-weight: 600; }

:is(html,#e) #fullArticle blockquote {
  margin: 1.6em 0;
  padding: 20px 24px;
  background: var(--e-surface);
  border: 0;
  border-radius: var(--e-radius);
  color: var(--e-text);
  font-size: inherit;
  font-style: normal;
}
:is(html,#e) #fullArticle blockquote p { font-size: inherit; line-height: inherit; }
:is(html,#e) #fullArticle blockquote > :last-child { margin-bottom: 0; }

/* Callout-блоки редактора Help Scout. Удобно для «Пример:» и «Важно:» */
:is(html,#e) #fullArticle :is(.callout, .callout-yellow, .callout-blue, .callout-red, .callout-green) {
  margin: 1.8em 0;
  padding: 20px 24px;
  border: 0;
  border-radius: var(--e-radius);
  background: var(--e-surface);
  color: var(--e-text);
  font-size: 16.5px;
}
:is(html,#e) #fullArticle .callout-yellow { background: var(--e-accent-soft); }
:is(html,#e) #fullArticle .callout-blue   { background: #EEF0FD; }
:is(html,#e) #fullArticle .callout-red    { background: #FDEEEE; }
:is(html,#e) #fullArticle .callout-green  { background: #EAF6EF; }
:is(html,#e) #fullArticle :is(.callout, .callout-yellow, .callout-blue, .callout-red, .callout-green).dashed { border: 1.5px dashed rgba(25, 28, 58, .2); }
:is(html,#e) #fullArticle :is(.callout, .callout-yellow, .callout-blue, .callout-red, .callout-green) > :last-child { margin-bottom: 0; }

/* пошаговые инструкции (description list в редакторе) */
:is(html,#e) #fullArticle dl { margin: 1.6em 0; }
:is(html,#e) #fullArticle dt {
  width: 34px;
  height: 34px;
  margin: 0;
  background: var(--e-ink);
  color: #fff;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  line-height: 34px;
  text-align: center;
}
:is(html,#e) #fullArticle dd { margin: -34px 0 1.4em 52px; padding-top: 4px; }

/* таблицы: на телефоне прокручиваются, а не ломают вёрстку */
:is(html,#e) #fullArticle table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.6em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.5;
}
:is(html,#e) #fullArticle :is(th, td) {
  padding: 11px 14px;
  border: 1px solid var(--e-line);
  text-align: left;
  vertical-align: top;
}
:is(html,#e) #fullArticle th,
:is(html,#e) #fullArticle thead td { background: var(--e-surface); color: var(--e-ink); font-weight: 600; }
:is(html,#e) #fullArticle .table-striped tbody tr:nth-child(even) td { background: #FAFAFD; }

:is(html,#e) #fullArticle img { max-width: 100%; height: auto; border: 0; border-radius: 12px; box-shadow: none; }
:is(html,#e) #fullArticle img.noBdr { border-radius: 0; }
:is(html,#e) #fullArticle hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--e-line); }
:is(html,#e) #fullArticle :is(code, kbd) {
  padding: .12em .4em;
  background: var(--e-surface);
  border: 0;
  border-radius: 6px;
  color: var(--e-ink);
  font-size: .88em;
}
:is(html,#e) #fullArticle pre {
  padding: 16px 18px;
  background: var(--e-surface);
  border: 0;
  border-radius: 12px;
  font-size: 14.5px;
  overflow-x: auto;
}

:is(html,#e) #fullArticle .printArticle {
  position: absolute;
  top: 12px;
  right: 0;
  color: var(--e-muted);
  opacity: .6;
  text-decoration: none;
}
:is(html,#e) #fullArticle .printArticle:hover { opacity: 1; color: var(--e-ink); }
@media (max-width: 767px) {
  :is(html,#e) #fullArticle .printArticle { display: none; }
  :is(html,#e) #fullArticle h1.title { padding-right: 0; }
  :is(html,#e) #fullArticle { font-size: 17px; }
}

/* блок под статьёй: «Остались вопросы?» + дата обновления */
:is(html,#e) .articleFoot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: var(--e-read);
  margin: 56px 0 0;
  padding: 22px 26px;
  box-sizing: border-box;
  background: var(--e-surface);
  border: 0;
  border-radius: 18px;
}
:is(html,#e) .articleFoot p { margin: 0; color: var(--e-ink); font-size: 17px; font-weight: 600; float: none; }
:is(html,#e) .articleFoot p a {
  margin-left: 10px;
  padding: 8px 18px;
  background: var(--e-ink);
  color: #fff;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s ease;
}
:is(html,#e) .articleFoot p a:hover { background: var(--e-ink-soft); color: #fff; }
:is(html,#e) .articleFoot time.lu,
:is(html,#e) .articleFoot .lu { color: var(--e-muted); font-size: 14px; font-style: normal; float: none; }

/* «Была ли статья полезной?» (если включено) */
:is(html,#e) .articleRatings { margin: 24px 0 0; color: var(--e-muted); border: 0; background: none; }
:is(html,#e) .articleRatings .rateAction {
  margin-left: 6px;
  padding: 6px 14px;
  border: 1px solid var(--e-line);
  border-radius: 999px;
  color: var(--e-text);
  background: #fff;
  text-decoration: none;
}
:is(html,#e) .articleRatings .rateAction:hover { border-color: var(--e-ink); color: var(--e-ink); }

/* похожие статьи */
:is(html,#e) #related {
  max-width: var(--e-read);
  margin: 48px 0 0;
  padding: 0;
  background: none;
  border: 0;
}
:is(html,#e) #related h3 { margin: 0 0 12px; color: var(--e-ink); font-size: 20px; font-weight: 700; }
:is(html,#e) #related ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--e-line); }
:is(html,#e) #related li { margin: 0; padding: 0; border-bottom: 1px solid var(--e-line); }
:is(html,#e) #related li a { display: block; padding: 14px 8px; color: var(--e-ink); font-weight: 500; text-decoration: none; }
:is(html,#e) #related li a:hover { background: var(--e-surface); color: var(--e-link); }
:is(html,#e) #related li i { display: none; }

/* ---------- 11. Подвал ---------- */
:is(html,#e) footer {
  width: min(calc(100% - 2 * var(--e-gutter)), calc(var(--e-max) - 2 * var(--e-gutter)));
  max-width: none;
  margin: 0 auto;
  padding: 28px 0 40px;
  box-sizing: border-box;
  background: none;
  border-top: 1px solid var(--e-line);
  color: var(--e-muted);
  font-size: 14px;
  text-align: left;
}
:is(html,#e) footer p { margin: 0; color: inherit; }
/* «Powered by Help Scout» прячется и стилями, и скриптом из head-кода */
:is(html,#e) footer span:has(> a[href*="helpscout.com"]),
:is(html,#e) footer a[href*="helpscout.com"] { display: none; }
:is(html,#e) footer a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }
:is(html,#e) footer a:hover { color: var(--e-ink); }

/* ---------- 12. Окно «Контакт» ---------- */
:is(html,#e) .modal-backdrop,
:is(html,#e) .modal-backdrop.fade.in { background: var(--e-ink); opacity: .55; }
:is(html,#e) .modal {
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(25, 28, 58, .3);
  overflow: hidden;
}
:is(html,#e) .modal-header { padding: 20px 26px; border-bottom: 1px solid var(--e-line); }
:is(html,#e) .modal-header h3 { color: var(--e-ink); font-size: 22px; font-weight: 700; }
:is(html,#e) .modal-body { padding: 22px 26px; }
:is(html,#e) .modal-footer { padding: 16px 26px; background: var(--e-surface); border-top: 0; box-shadow: none; }
:is(html,#e) .modal label { color: var(--e-ink); font-size: 14px; font-weight: 600; }
:is(html,#e) .modal :is(input[type="text"], input[type="email"], textarea, select) {
  width: 100%;
  height: auto;
  margin-bottom: 14px;
  padding: 11px 14px;
  box-sizing: border-box;
  background: #fff;
  color: var(--e-ink);
  border: 1.5px solid var(--e-line);
  border-radius: 10px;
  box-shadow: none;
  font-size: 16px;
}
:is(html,#e) .modal :is(input, textarea, select):focus {
  outline: none;
  border-color: var(--e-accent);
  box-shadow: 0 0 0 4px rgba(245, 166, 91, .3);
}
:is(html,#e) .btn {
  padding: 9px 20px;
  background: #fff;
  background-image: none;
  color: var(--e-ink);
  border: 1px solid var(--e-line);
  border-radius: 999px;
  box-shadow: none;
  text-shadow: none;
  filter: none;
  font-size: 15px;
  font-weight: 600;
}
:is(html,#e) .btn-primary,
:is(html,#e) .modal button[type="submit"] { background: var(--e-ink); border-color: var(--e-ink); color: #fff; }
:is(html,#e) .btn-primary:hover,
:is(html,#e) .modal button[type="submit"]:hover { background: var(--e-ink-soft); color: #fff; }

/* ---------- 13. Мобильная версия ---------- */
@media (max-width: 767px) {
  /* на телефоне чуть мельче, чтобы «Вы не спрашивали,» помещалось в строку */
  :is(html,#e) #docsSearch h1 { font-size: clamp(30px, 8.6vw, 40px); }
  :is(html,#e) #docsSearch {
    background-image:
      linear-gradient(0deg, var(--e-ink) 28%, rgba(25, 28, 58, .82) 62%, rgba(25, 28, 58, .6) 100%),
      var(--e-hero-photo);
    background-position: center, 65% 30%;
    background-blend-mode: normal, luminosity;
  }
  :is(html,#e) .category-list { grid-template-columns: 1fr; }
  :is(html,#e) .category-list .category { padding: 22px 8px 22px 18px; }
  :is(html,#e) #docsSearch #searchBar .search-query { height: 58px; padding-right: 112px; font-size: 17px; border-radius: 16px; }
  :is(html,#e) #docsSearch #searchBar button { margin-right: 7px; height: 44px; padding: 0 16px; }
  :is(html,#e) .articleFoot { padding: 20px; }
  :is(html,#e) .articleFoot p { line-height: 2.6; }
  :is(html,#e) .articleList li a { font-size: 17px; padding: 16px 6px; }
}

/* ---------- 14. Печать и доступность ---------- */
@media (prefers-reduced-motion: reduce) {
  :is(html,#e) *,
  :is(html,#e) *::before,
  :is(html,#e) *::after { transition: none !important; animation: none !important; }
}
@media print {
  :is(html,#e) #mainNav,
  :is(html,#e) #docsSearch,
  :is(html,#e) #sidebar,
  :is(html,#e) .articleFoot,
  :is(html,#e) #related,
  :is(html,#e) footer { display: none !important; }
  :is(html,#e) #main-content { width: 100%; float: none; }
  :is(html,#e) #fullArticle { max-width: none; font-size: 12pt; }
}
