@layer components {
  /* Дерево разделов (A_Tree): слева на глубоких страницах и в выдвижном меню.
     Разделы — <details>, открыт раздел текущей страницы. */
  .tree {
    padding: 10px;
    background: var(--surface);
    border-radius: var(--r-box);
    box-shadow: var(--shadow);
  }
  .tree__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-3);
  }
  .tree__group + .tree__group { border-top: 1px solid var(--line); }
  .tree__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px;
    border-radius: 12px;
    list-style: none;
    font-weight: 600;
    font-size: 16px;
    color: var(--ink);
  }
  .tree__summary::-webkit-details-marker { display: none; }
  .tree__summary:hover { background: var(--soft-2); }
  .tree__count { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--ink-3); }
  .tree__summary .icon { width: 18px; height: 18px; color: var(--ink-3); transition: transform 0.2s; }
  .tree__group[open] > .tree__summary .icon { transform: rotate(180deg); }

  .tree__list { margin: 0 0 8px; }
  .tree__link {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: 16px;
    line-height: 1.35;
    text-decoration: none;
  }
  .tree__link:hover { background: var(--soft-2); color: var(--ink); }
  .tree__item--current > .tree__link { background: var(--accent); color: #fff; font-weight: 600; }

  /* Подстраницы текущего пункта */
  .tree__children {
    margin: 6px 0 6px 14px;
    padding-left: 10px;
    border-left: 2px solid var(--soft);
  }
  .tree__children .tree__link { padding: 6px 10px; font-size: 15px; border-radius: 8px; }
  .tree__children .tree__link[aria-current] { color: var(--accent-ink); font-weight: 600; background: var(--soft); }
}
