* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #333; }

body { min-height: 100vh; display: flex; flex-direction: column; }
.wrapper { display: flex; flex: 1; }

/* Верхняя панель: контакты и поиск справа */
.site-header { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; width: 100%; min-width: 0; padding: 16px 24px; border-bottom: 1px solid #e9ecef; background: #fff; }
.site-header .logo { margin: 0; flex-shrink: 0; max-width: 100%; }
.site-header .logo-mark { height: 40px; padding-left: 0; }
.header-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; flex: 1; min-width: 0; max-width: 100%; gap: 12px 16px; }
.header-links { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 8px; }
.header-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border: 1px solid #e9ecef; border-radius: 8px; color: #495057; font-size: 14px; line-height: 1.5; text-decoration: none; }
.header-link:hover { background: #E9F6EF; border-color: #1E9E56; color: #14875A; }
.header-link:focus-visible { outline: 2px solid #1E9E56; outline-offset: 2px; }
.header-link svg, .search-icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Сайдбар */
.sidebar {
  width: 340px;
  flex-shrink: 0;
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
  padding: 20px;
}
/*.logo { font-weight: bold; font-size: 18px; margin-bottom: 20px; color: #111; }*/
.logo { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; }
.logo-mark { height: 48px; width: auto; max-width: 100%; display: block; padding-left: 40px; }
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar ul ul {
  margin: 4px 0 8px 12px;
  padding-left: 12px;
  border-left: 1px solid #e9ecef;
}

.sidebar li {
  margin: 4px 0;
}
/* Кнопка для скачивания XML */
.content a.btn-download { display: inline-block; padding: 5px 15px; margin: 5px 0 5px; background: #1CB554; color: #FFFFFF; font-weight: 600; text-decoration: none; border-radius: 8px; }
.content a.btn-download:hover { background: #17A04A; color: #FFFFFF; }

/* Единый стиль ссылок и заголовков разделов */
.sidebar a,
.sidebar .folder-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 10px;
  border-left: 3px solid transparent;
  border-radius: 8px;

  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  text-decoration: none;

  overflow-wrap: anywhere;
}

.sidebar .folder-title {
  cursor: pointer;
  justify-content: space-between;
}

/*Смена цвета активного раздела*/
.sidebar a:hover,
.sidebar .folder-title:hover {
  background: #EEF0F2;
}
.sidebar a.active {
  background: #E9F6EF;
  color: #14875A;
  font-weight: 600;
  border-left: 3px solid #1E9E56;
}

/* Раскрытие разделов */
.sidebar .folder-title { cursor: pointer; justify-content: space-between; }
.folder-title.is-closed + ul { display: none; }

.folder-title::after {
  content: "";
  width: 20px; height: 20px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
  transition: transform .15s;
}
.folder-title.is-closed::after { transform: rotate(-90deg); }

/* Область контента */
/* .content { flex: 1; padding: 40px 60px; max-width: 1200px; } */
.content { flex: 1; padding: 40px 60px; }
#article-view { max-width: 1200px; margin: 0 auto; }
/* Поиск по всей базе знаний */
.content { min-width: 0; overflow-wrap: break-word; }
.knowledge-search { flex: 0 1 280px; width: 100%; min-width: 0; max-width: 100%; margin: 0; }
.search-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.search-input-row { position: relative; width: 100%; min-width: 0; }
#search-input { display: block; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; padding: 10px 68px 10px 12px; border: 1px solid #d6dce1; border-radius: 8px; background: #fff; color: #333; font: inherit; }
#search-input:focus { outline: 2px solid #1E9E56; outline-offset: 2px; }
#search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
#search-clear { position: absolute; top: 0; right: 0; height: 100%; width: 36px; border: 0; background: transparent; color: #495057; font-size: 24px; cursor: pointer; }
.search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #6B7280; pointer-events: none; }
#search-clear:not([hidden]) ~ .search-icon { right: 42px; }
#search-view { max-width: 1200px; margin: 0 auto; }
#search-status { color: #495057; }
.content #search-results { list-style: none; padding: 0; }
.content #search-results > li { margin: 0 0 16px; }
.search-result { display: block; padding: 18px 20px; border: 1px solid #e9ecef; border-radius: 8px; color: #333; text-decoration: none; overflow-wrap: anywhere; }
.search-result:hover { background: #F0F9F4; border-color: #1E9E56; color: #333; }
.search-result:focus-visible { outline: 2px solid #1E9E56; outline-offset: 2px; }
.search-result-title { display: block; margin-bottom: 6px; color: #14875A; font-size: 19px; font-weight: 600; }
.search-result-section { display: block; margin-bottom: 10px; color: #6B7280; font-size: 13px; }
.search-result-snippet { display: block; line-height: 1.6; }
#search-results mark { background: #E9F6EF; color: inherit; padding: 0 2px; }
#search-retry { padding: 8px 14px; margin-bottom: 16px; border: 1px solid #1E9E56; border-radius: 8px; background: #fff; color: #14875A; font: inherit; cursor: pointer; }
.content h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; margin: 0 0 20px; }
.content h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; margin: 40px 0 14px; }
.content h3 { font-size: 19px; font-weight: 600; line-height: 1.35; margin: 32px 0 12px; }
.content h4 { font-size: 17px; font-weight: 700; letter-spacing: -0.005em; line-height: 1.4; margin: 24px 0 10px; }
.content h5 { font-size: 14px; font-weight: 600; line-height: 1.4; margin: 20px 0 8px; }
.content h1:first-child,
.content h2:first-child,
.content h3:first-child { margin-top: 0; }
.content p { margin-bottom: 16px; line-height: 1.6; }
.content code { background: #f1f3f5; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.content strong, .content b { font-weight: 600; color: #1A1D23; }
.content img { max-width: 100%; height: auto; display: block; margin: 24px 0; border-radius: 8px; border: 1px solid #F0F1F3; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
/* Значки внутри текста: размер как у букв, без отступов скриншотов */
.content .bi { display: inline-block; margin: 0; padding: 0; font-size: 1.2em; line-height: 1; vertical-align: -0.125em; }
.content svg.bi { width: 1em; height: 1em; fill: currentColor; }
.content img.inline-icon { display: inline-block; width: 1em; height: 1em; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; vertical-align: -0.125em; }
.content .image-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin: 24px 0; }
.content .image-row img { justify-self: start; margin: 0; }
.content table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; border: 1px solid #E7E9EC; }
.article-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; margin: 24px 0; }
.content .article-table-scroll table { margin: 0; }
.article-table-scroll:focus-visible { outline: 2px solid #1E9E56; outline-offset: 2px; }
.content th, .content td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #E7E9EC; border-right: 1px solid #E7E9EC; }
.content th[align="center"], .content td[align="center"] { text-align: center; }
.content th[align="right"], .content td[align="right"] { text-align: right; }
.content tr:last-child td { border-bottom: none; }
.content blockquote.note { background: #F0F9F4; border-left: 3px solid #1E9E56; padding: 14px 18px; margin: 20px 0; border-radius: 0 6px 6px 0; }
.content blockquote.warning { background: #FDF0F0; border-left: 3px solid #E5484D; padding: 14px 18px; margin: 20px 0; border-radius: 0 6px 6px 0; }
.content blockquote.example { background: #EFF6FF; border-left: 3px solid #3B82F6; padding: 14px 18px; margin: 20px 0; border-radius: 0 6px 6px 0; }
.content blockquote p { margin-bottom: 0; }
.content blockquote p + p { margin-top: 10px; }
.content ul, .content ol { margin: 0 0 16px; padding-left: 24px; }
.content li { margin-bottom: 8px; line-height: 1.7; }
.content li:last-child { margin-bottom: 0; }
.content ul ul, .content ol ol, .content ul ol, .content ol ul { margin-top: 8px; margin-bottom: 0; }

@media (max-width: 768px) {
  .content .image-row { grid-template-columns: 1fr; }
  .site-header { padding: 16px 20px; }
  .header-controls { flex: 0 0 100%; flex-direction: column; align-items: stretch; width: 100%; }
  .header-links { width: 100%; justify-content: flex-start; }
  .knowledge-search { flex: 0 0 auto; width: 100%; }
  .wrapper { flex-direction: column; }
  .sidebar { width: 100%; min-height: auto; }
}
/* Шрифт */
@font-face {
  font-family: "Roboto";
  src: url("/assets/font/Roboto-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Roboto";
  src: url("/assets/font/Roboto-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
}
@font-face {
  font-family: "Roboto";
  src: url("/assets/font/Roboto-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "Roboto";
  src: url("/assets/font/Roboto-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
}

body {
  font-family: "Roboto", sans-serif;
}
