.md-typeset {
  font-size: 0.65rem !important;
}

/* --- Ширина сайдбара для десктопов --- */
.md-sidebar,
.md-sidebar--primary {
  width: 500px;
  flex: 0 0 500px;
  left: 0;
  position: relative;
  z-index: 10;
  top: 0;             /* прикрепляем к верху родителя */
  margin-top: 0 !important;  /* убираем отступ сверху */
  padding-top: 0 !important; /* убираем внутренний отступ сверху */
}

/* Контейнер */
.md-container {
  margin-left: 0;
}

/* Контент */
.md-main__inner {
  margin-left: 0;
  max-width: 100%;
  display: flex;
}

.md-grid {
  max-width: none;
  width: 100%;
  padding: 0 2rem;
}

.md-content {
  padding-top: 2rem;
  flex: 1 1 auto;
  max-width: 100%;
}

.md-content__inner {
  max-width: 100%;
  width: 100%;
}

/* Обёртка вокруг sidebar для управления шириной */
.sidebar-resizable {
  display: flex;
  flex-direction: row;
  position: relative;
}


/* --- Точки в навигации --- */
.md-nav__item .md-nav__link::before {
  content: "•";
  color: #555;
  margin-right: 0.5em;
  display: inline-block;
}

/* Не показывать точки у групп */
.md-nav__item--nested > .md-nav__link::before {
  content: none;
}

.md-nav__link {
  white-space: normal !important;  /* Разрешаем перенос строк */
  overflow: visible !important;    /* Показываем весь текст */
  text-overflow: initial !important;
  max-width: 100% !important;
  word-break: break-word;          /* Переносим длинные слова */
}
/* --- Адаптация для мобильных устройств --- */
@media screen and (max-width: 768px) {

  .md-sidebar,
  .md-sidebar--primary {
    width: 100% !important;
    flex: none !important;
    position: relative;
  }

  .md-sidebar--primary .md-sidebar__scrollwrap,
  .md-sidebar--primary .md-nav {
    max-height: 70vh !important;  /* только 70% от высоты экрана */
    overflow-y: auto !important;  /* скролл если пунктов больше */
  }

  .md-nav--primary {
      max-height: 80vh !important;
      overflow-y: auto !important;
  }
    
  .md-nav--primary .md-nav__list {
        max-height: 80vh !important;
  }
    
  .md-nav {
      max-height: 80vh !important;
      overflow-y: auto !important;
  }

  .md-main__inner {
    flex-direction: column;
  }

  .md-content {
    padding: 0 1rem;
    max-width: 100%;
  }

  .md-content__inner {
    max-width: 100%;
  }

  .md-nav__item .md-nav__link::before {
    margin-right: 0.4em;
  }

  .md-typeset {
    font-size: 0.65rem !important;
  }
}


  .md-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.md-header {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.md-header {
  background-color: #59c7fb !important;  /* Новый фон */
  color: white !important;              /* Цвет текста */
}


/* Перемещаем стрелку слева от текста в боковом меню */
.md-nav__item--nested > input + label::after {
  order: -1;
  margin-left: 0;
  margin-right: 0.4rem;
}

/* Обеспечиваем флекс-расположение */
.md-nav__item--nested > label {
  display: flex;
  align-items: center;
}

a:hover {
  color: #27aae1 !important;
  text-decoration: underline;
}

.md-ellipsis::first-letter {
  text-decoration: none;
}

/* Admonition question (???) color */


/* Цвет рамки */
.md-typeset .admonition.question,
.md-typeset details.question {
  border-color: #59c7fb;
}

/* Цвет фона заголовка */
.md-typeset .question > .admonition-title,
.md-typeset .question > summary {
  background-color: rgba(89, 199, 251, 0.1); /* #59c7fb с прозрачностью */
}

/* Цвет иконки вопроса */
.md-typeset .question > .admonition-title::before,
.md-typeset .question > summary::before {
  background-color: #59c7fb;
  -webkit-mask-image: var(--md-admonition-icon--question);
          mask-image: var(--md-admonition-icon--question);
}


.md-nav__icon {
  display: none !important;
}

.md-nav__item .md-nav__link[href="/"] {
  display: none !important;
}

.md-nav__title {
  display: none !important;
}