:root {
      --asclin-heading: #091321;
      --asclin-heading-soft: #3a434f;
      --asclin-navy: #11172d;
      --asclin-dark: #091321;
      --asclin-footer: #0a1320;
      --asclin-blue: #2f76a8;
      --asclin-orange: #e07c26;
      --asclin-page-bg: #f6f8fb;
      --asclin-card-bg: #f5f8fc;
      --asclin-badge-blue: #e6f1fa;
      --asclin-badge-grey: #eef3f7;
      --asclin-badge-grey-text: #526175;
      --asclin-muted: #93a2b4;
      --asclin-field-border: #c8d4e0;
      --asclin-hero-circle: #16222f;
      --asclin-hero-dot: #8296ab;
      --asclin-hero-line: #33465c;
      --asclin-border: #e3eaf2;
      /* Фон секций — на весь экран, контент — не шире 1248px по центру */
      --asclin-gutter: max(96px, calc((100% - 1248px) / 2));
    }

    body {
      margin: 0;
      background: var(--asclin-page-bg);
    }

    /* Стили усилены против CSS темы сайта: селекторы со scope .asclin-docs
       и !important на цветах, которые темы чаще всего перебивают. */

    .asclin-docs,
    .asclin-docs * {
      box-sizing: border-box;
      font-family: "Montserrat", Arial, sans-serif;
    }

    .asclin-docs {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      width: 100%;
      background: #ffffff;
      color: var(--asclin-navy);
    }

    .asclin-docs .page-main {
      flex: 1 0 auto;
    }

    /* ===================== ШАПКА + ПЕРВЫЙ ЭКРАН ===================== */

    .asclin-docs .hero {
      position: relative;
      background: var(--asclin-dark);
      color: #ffffff;
      padding: 28px var(--asclin-gutter) 58px;
      overflow: hidden;
    }

    .asclin-docs .hero__decor {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }

    .asclin-docs .hero__circle {
      position: absolute;
      border-radius: 50%;
      background: var(--asclin-hero-circle);
    }

    .asclin-docs .hero__circle--left {
      width: 360px;
      height: 360px;
      left: -160px;
      top: 260px;
    }

    .asclin-docs .hero__circle--right {
      width: 480px;
      height: 480px;
      right: -70px;
      top: -250px;
    }

    .asclin-docs .hero__dot {
      position: absolute;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: var(--asclin-hero-dot);
      opacity: .85;
    }

    .asclin-docs .hero__dot--small {
      width: 8px;
      height: 8px;
    }

    .asclin-docs .hero__line {
      position: absolute;
      height: 1px;
      background: var(--asclin-hero-line);
    }

    .asclin-docs .hero__content {
      position: relative;
      max-width: 1248px;
      margin: 82px auto 0;
      z-index: 1;
    }

    .asclin-docs .hero__breadcrumbs {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      margin: 0;
      color: #aeb9c6;
      font-size: 14px;
      line-height: 1.2;
      font-weight: 400;
    }

    .asclin-docs .hero__breadcrumbs a {
      color: #dfe6ee !important;
      text-decoration: none;
    }

    .asclin-docs .hero__breadcrumbs a:hover {
      text-decoration: underline;
    }

    .asclin-docs .hero__title {
      margin: 26px 0 0;
      color: #ffffff !important;
      font-size: clamp(36px, 4.5vw, 64px);
      line-height: 1.1;
      font-weight: 700;
      letter-spacing: .01em;
      text-transform: uppercase;
    }

    .asclin-docs .hero__subtitle {
      margin: 20px 0 0;
      max-width: 720px;
      color: #dfe6ee;
      font-size: 16px;
      line-height: 24px;
      font-weight: 400;
    }

    /* ===================== ПАНЕЛЬ: ПОИСК, ФИЛЬТРЫ И КАТЕГОРИИ ===================== */

    .asclin-docs .toolbar {
      background: var(--asclin-card-bg);
      padding: 40px var(--asclin-gutter) 36px;
      border-bottom: 1px solid var(--asclin-border);
    }

    .asclin-docs .toolbar__inner {
      max-width: 1248px;
      margin: 0 auto;
    }

    .asclin-docs .filters {
      display: grid;
      grid-template-columns: minmax(0, 650px) minmax(0, 1fr) 230px 171px;
      gap: 28px;
      align-items: center;
    }

    .asclin-docs .search {
      position: relative;
      display: block;
      margin: 0;
    }

    .asclin-docs .search svg {
      position: absolute;
      left: 20px;
      top: 50%;
      margin-top: -9px;
      color: var(--asclin-muted);
      pointer-events: none;
    }

    .asclin-docs .search input,
    .asclin-docs .select {
      display: block;
      width: 100%;
      height: 48px;
      margin: 0;
      border: 1px solid var(--asclin-field-border);
      border-radius: 8px;
      background: #ffffff;
      padding: 0 18px;
      color: var(--asclin-navy);
      font-family: "Montserrat", Arial, sans-serif;
      font-size: 14px;
      font-weight: 400;
      -webkit-appearance: none;
      appearance: none;
    }

    .asclin-docs .search input {
      padding-left: 50px;
    }

    .asclin-docs .search input::placeholder {
      color: var(--asclin-muted);
      opacity: 1;
    }

    .asclin-docs .search input:focus,
    .asclin-docs .select:focus {
      outline: none;
      border-color: var(--asclin-blue);
    }

    .asclin-docs .select {
      grid-column: auto;
      padding-right: 44px;
      font-size: 13px;
      font-weight: 600;
      background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='m1 1 6 6 6-6' stroke='%23526175' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 20px center;
      background-size: 14px 9px;
      cursor: pointer;
    }

    .asclin-docs .filters__gap {
      display: block;
    }

    .asclin-docs .cats {
      display: flex;
      flex-wrap: wrap;
      gap: 14px 12px;
      margin: 22px 0 0;
      padding: 0;
      list-style: none;
    }

    .asclin-docs .cat {
      display: inline-flex;
      align-items: center;
      height: 30px;
      border: 1px solid var(--asclin-field-border);
      border-radius: 15px;
      background: #ffffff;
      padding: 0 15px;
      color: var(--asclin-badge-grey-text) !important;
      font-family: "Montserrat", Arial, sans-serif;
      font-size: 13px;
      line-height: 1;
      font-weight: 600;
      white-space: nowrap;
      cursor: pointer;
      transition: border-color .15s ease, color .15s ease, background .15s ease;
    }

    .asclin-docs .cat:hover {
      border-color: var(--asclin-blue);
      color: var(--asclin-blue) !important;
    }

    .asclin-docs .cat.is-active,
    .asclin-docs .cat.is-active:hover {
      border-color: var(--asclin-navy);
      background: var(--asclin-navy);
      color: #ffffff !important;
    }

    /* ===================== КАТАЛОГ ===================== */

    .asclin-docs .catalog {
      padding: 50px var(--asclin-gutter) 72px;
      background: #ffffff;
    }

    .asclin-docs .catalog__inner {
      max-width: 1248px;
      margin: 0 auto;
    }

    .asclin-docs .catalog__head {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px 24px;
    }

    .asclin-docs .catalog__title {
      margin: 0;
      color: var(--asclin-heading) !important;
      font-size: 28px;
      line-height: 1.2;
      font-weight: 700;
      text-transform: none;
    }

    .asclin-docs .catalog__count {
      margin: 0;
      color: var(--asclin-badge-grey-text);
      font-size: 13px;
    }

    .asclin-docs .group {
      margin: 30px 0 0;
      scroll-margin-top: 110px;
    }

    .asclin-docs .group + .group {
      margin-top: 44px;
    }

    .asclin-docs .group__head {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px 24px;
      margin: 0 0 14px;
    }

    .asclin-docs .group__title {
      margin: 0;
      color: var(--asclin-heading) !important;
      font-size: 22px;
      line-height: 1.25;
      font-weight: 700;
      text-transform: none;
    }

    .asclin-docs a.group__link {
      color: var(--asclin-blue) !important;
      font-size: 14px;
      font-weight: 600;
      text-decoration: none;
      white-space: nowrap;
    }

    .asclin-docs a.group__link:hover {
      text-decoration: underline;
    }

    .asclin-docs .list {
      margin: 0;
      border-radius: 8px;
      background: var(--asclin-card-bg);
      padding: 0 24px;
      list-style: none;
    }

    .asclin-docs .doc {
      display: flex;
      align-items: center;
      gap: 20px;
      min-height: 92px;
      padding: 16px 0;
    }

    .asclin-docs .doc + .doc {
      border-top: 1px solid var(--asclin-border);
    }

    .asclin-docs .doc__icon {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 44px;
      height: 44px;
      border-radius: 8px;
      background: var(--asclin-badge-blue);
      color: var(--asclin-blue) !important;
      font-size: 11px;
      font-weight: 700;
    }

    .asclin-docs .doc__icon--long {
      font-size: 9.5px;
    }

    .asclin-docs .doc__icon--locked {
      background: var(--asclin-navy);
      color: #ffffff !important;
    }

    .asclin-docs .doc__body {
      flex: 1;
      min-width: 0;
    }

    .asclin-docs .doc__title {
      margin: 0;
      color: var(--asclin-navy) !important;
      font-size: 15px;
      line-height: 1.3;
      font-weight: 700;
      text-transform: none;
    }

    .asclin-docs .doc__desc {
      margin: 4px 0 0;
      color: var(--asclin-heading-soft);
      font-size: 13px;
      line-height: 1.45;
    }

    .asclin-docs .doc__meta {
      margin: 4px 0 0;
      color: var(--asclin-muted);
      font-size: 12px;
      line-height: 1.3;
      font-weight: 500;
    }

    .asclin-docs .doc__side {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-end;
      gap: 10px 14px;
      flex-shrink: 0;
    }

    .asclin-docs a.doc__btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      min-width: 140px;
      height: 44px;
      border: 1px solid var(--asclin-field-border);
      border-radius: 8px;
      background: #ffffff !important;
      padding: 0 22px;
      color: var(--asclin-navy) !important;
      font-size: 14px;
      line-height: 1;
      font-weight: 600;
      text-decoration: none !important;
      white-space: nowrap;
      transition: border-color .2s ease, color .2s ease;
    }

    .asclin-docs a.doc__btn:hover {
      border-color: var(--asclin-blue);
      color: var(--asclin-blue) !important;
    }

    .asclin-docs a.doc__btn--dark {
      border-color: var(--asclin-navy);
      background: var(--asclin-navy) !important;
      color: #ffffff !important;
      gap: 8px;
      transition: opacity .2s ease;
    }

    .asclin-docs a.doc__btn--dark:hover {
      border-color: var(--asclin-navy);
      color: #ffffff !important;
      opacity: .85;
    }

    .asclin-docs .chip {
      display: inline-flex;
      align-items: center;
      height: 22px;
      border-radius: 11px;
      background: var(--asclin-badge-grey);
      padding: 0 12px;
      color: var(--asclin-badge-grey-text) !important;
      font-size: 11px;
      line-height: 1;
      font-weight: 600;
      white-space: nowrap;
    }

    /* Раздел без материалов */
    .asclin-docs .list--empty {
      padding: 20px 24px;
    }

    .asclin-docs .empty {
      margin: 0;
      border: 1px dashed var(--asclin-field-border);
      border-radius: 8px;
      background: #ffffff;
      padding: 16px 20px;
      color: var(--asclin-badge-grey-text);
      font-size: 14px;
      line-height: 20px;
      text-align: center;
    }

    /* Ничего не найдено по фильтрам (показывается скриптом) */
    .asclin-docs .nothing {
      display: none;
      margin: 30px 0 0;
    }

    .asclin-docs .nothing.is-visible {
      display: block;
    }

    .asclin-docs .nothing button {
      border: 0;
      background: none;
      padding: 0;
      color: var(--asclin-blue);
      font-family: "Montserrat", Arial, sans-serif;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
    }

    .asclin-docs [hidden] {
      display: none !important;
    }

    /* ===================== АДАПТИВ ===================== */

    @media (max-width: 1200px) {
      :root {
        --asclin-gutter: 40px;
      }

      .asclin-docs .filters {
        grid-template-columns: minmax(0, 1fr) 200px 180px;
        gap: 16px;
      }

      .asclin-docs .filters__gap {
        display: none;
      }
    }

    @media (max-width: 960px) {
      .asclin-docs .filters {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      }

      .asclin-docs .search {
        grid-column: 1 / -1;
      }

      .asclin-docs .doc {
        flex-wrap: wrap;
      }

      .asclin-docs .doc__body {
        flex-basis: calc(100% - 64px);
      }

      .asclin-docs .doc__side {
        justify-content: flex-start;
        margin-left: 64px;
      }
    }

    @media (max-width: 640px) {
      :root {
        --asclin-gutter: 20px;
      }

      .asclin-docs .hero__content {
        margin-top: 40px;
      }

      .asclin-docs .hero__dot,
      .asclin-docs .hero__line {
        display: none;
      }

      .asclin-docs .toolbar {
        padding-top: 28px;
        padding-bottom: 24px;
      }

      .asclin-docs .filters {
        grid-template-columns: minmax(0, 1fr);
      }

      /* Категории на телефоне — горизонтальная прокрутка одной строкой */
      .asclin-docs .cats {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-right: calc(-1 * var(--asclin-gutter));
        padding-right: var(--asclin-gutter);
        padding-bottom: 4px;
        scrollbar-width: none;
      }

      .asclin-docs .cats::-webkit-scrollbar {
        display: none;
      }

      .asclin-docs .catalog {
        padding-top: 36px;
        padding-bottom: 48px;
      }

      .asclin-docs .catalog__title {
        font-size: 24px;
      }

      .asclin-docs .group__title {
        font-size: 19px;
      }

      .asclin-docs .list {
        padding: 0 16px;
      }

      .asclin-docs .doc {
        gap: 14px;
      }

      .asclin-docs .doc__icon {
        width: 40px;
        height: 40px;
      }

      .asclin-docs .doc__body {
        flex-basis: calc(100% - 54px);
      }

      .asclin-docs .doc__side {
        margin-left: 54px;
        /* 375 px: «Для членов АСКЛИН» + «Войти для доступа» переносятся внутри строки, а не выходят за экран */
        flex-shrink: 1;
        min-width: 0;
        max-width: calc(100% - 54px);
      }
    }

/* Кнопка «Фильтры» (сворачиваемые фильтры, правки 03.10): поиск растягивается, кнопка и списки — вплотную справа с одинаковым шагом */
.asclin-docs .asclin-fc .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.asclin-docs .asclin-fc .filters__gap { display: none; }
.asclin-docs .asclin-fc .filters .search { flex: 1 1 320px; min-width: 0; }
.asclin-docs .asclin-fc .filters .asclin-fc-toggle { flex: 0 0 auto; height: 48px; }
.asclin-docs .asclin-fc .filters .select { flex: 0 0 210px; width: 210px; }
.asclin-docs .asclin-fc .cats { margin-top: 16px; }
@media (max-width: 640px) {
  .asclin-docs .asclin-fc .filters .search { flex-basis: calc(100% - 140px); }
  .asclin-docs .asclin-fc .filters .select { flex: 1 1 100%; width: 100%; }
}
