:root {
  --help-sidebar-surface: #fafafa;
  --help-sidebar-border: #eff0f1;
  --help-sidebar-text: #1f2737;
  --help-sidebar-muted: #646973;
  --help-sidebar-group: #70747e;
  --help-sidebar-divider: #e3e4e8;
  --help-sidebar-hover: #f4f4f5;
  --help-sidebar-active: #e0f2fe;
  --help-sidebar-active-text: #026aa2;
  --help-sidebar-focus: #0086c9;
}

.g-root_theme_dark {
  --help-sidebar-surface: var(--help-header-background);
  --help-sidebar-border: #4c525e;
  --help-sidebar-text: #ecedee;
  --help-sidebar-muted: #b7babf;
  --help-sidebar-group: #b7babf;
  --help-sidebar-divider: #4c525e;
  --help-sidebar-hover: #404653;
  --help-sidebar-active: rgb(11 165 236 / 20%);
  --help-sidebar-active-text: #7cd4fd;
  --help-sidebar-focus: #48c1fa;
}

.g-root .dc-toc {
  box-sizing: border-box;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--help-sidebar-border);
  border-radius: 12px;
  background: var(--help-sidebar-surface);
  color: var(--help-sidebar-text);
  font-family: var(--help-font-family);
}

.g-root .dc-toc .dc-toc__top {
  margin: 0;
  padding: 0 12px 10px;
}

.g-root .dc-toc .dc-toc__top-header {
  margin: 0;
  padding: 0;
  color: var(--docs-primary);
  font: 600 1.125rem/1.444444 var(--help-font-family);
  text-decoration: none;
}

.g-root .dc-toc .dc-toc__content {
  margin: 0;
  padding: 0;
}

.g-root .dc-toc .dc-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-root .dc-toc .dc-toc__list .dc-toc__list .dc-toc__list {
  padding-inline-start: 16px;
}

.g-root .dc-toc .dc-toc__list-item {
  margin: 0 0 2px;
  padding: 0;
  border: 0;
  background: transparent;
}

.g-root .dc-toc .dc-toc-item__link {
  display: block;
  border-radius: 6px;
  color: var(--help-sidebar-text);
  text-decoration: none;
}

.g-root .dc-toc .dc-toc-item__text {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  margin: 0;
  padding: 4px 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--help-sidebar-text);
  font: 400 var(--help-nav-size)/var(--help-nav-line) var(--help-font-family);
  text-align: start;
}

.g-root .dc-toc .dc-toc-item__text > span {
  min-width: 0;
  overflow-wrap: break-word;
}

.g-root .dc-toc .dc-toc-item__link:hover .dc-toc-item__text,
.g-root .dc-toc button.dc-toc-item__text_clicable:hover {
  background: var(--help-sidebar-hover);
}

.g-root .dc-toc .dc-toc-item__text_active,
.g-root .dc-toc .dc-toc-item__link:hover .dc-toc-item__text_active {
  background: var(--help-sidebar-active);
  color: var(--help-sidebar-active-text);
  font-weight: 600;
}

.g-root .dc-toc .dc-toc-item__link:focus-visible,
.g-root .dc-toc button.dc-toc-item__text_clicable:focus-visible,
.g-root .dc-toc .dc-toc__top-header:focus-visible {
  outline: 2px solid var(--help-sidebar-focus);
  outline-offset: 1px;
}

.g-root .dc-toc button.dc-toc-item__text:not(.dc-toc-item__text_clicable):not(.dc-toc-item__text_labeled) {
  color: var(--help-sidebar-muted);
  cursor: default;
}

/* Labeled TOC groups stay open, like the reference's section headings. */
.g-root .dc-toc .dc-toc__content > .dc-toc__list > .dc-toc__list-item_labeled {
  margin-block-start: 8px;
  padding-block-start: 8px;
  border-block-start: 1px solid var(--help-sidebar-divider);
}

.g-root .dc-toc .dc-toc__content > .dc-toc__list > .dc-toc__list-item_labeled:first-child {
  margin-block-start: 0;
  padding-block-start: 0;
  border-block-start: 0;
}

.g-root .dc-toc .dc-toc-item__text_labeled {
  min-height: 0;
  margin-block-end: 8px;
  padding-block: 0;
  color: var(--help-sidebar-group);
  font-size: var(--help-nav-size, .875rem);
  line-height: var(--help-nav-line);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}

.g-root .dc-toc:not(:has(.dc-toc__list-item)) {
  background: transparent;
  border-color: transparent;
}

.g-root .dc-toc .dc-toc-item__text_labeled::before {
  content: "";
  display: block;
  flex: 0 0 1rem;
  width: 1rem;
  height: 1rem;
  background: currentColor;
  mask: var(--help-section-icon, url("/brand/sidebar-reports.svg")) center / contain no-repeat;
}

/* Release families share the history icon from the home tile. */
.g-root[data-wiki-section="release-notes"] .dc-toc .dc-toc__list-item_labeled {
  --help-section-icon: url("/brand/home-history.svg");
}

.g-root .dc-toc .dc-toc__list-item_labeled:has(a[href="docs/03-technological-protocols.html"]) {
  --help-section-icon: url("/brand/sidebar-settings.svg");
}

.g-root .dc-toc .dc-toc__list-item_labeled:has(a[href="docs/25-user-roles.html"]) {
  --help-section-icon: url("/brand/sidebar-quick-start.svg");
}

.g-root .dc-toc .dc-toc__list-item_labeled:has(a[href="docs/02-animal-search-and-card.html"]) {
  --help-section-icon: url("/brand/sidebar-farm.svg");
}

.g-root .dc-toc .dc-toc__list-item_labeled:has(a[href="docs/01-authorization.html"]) {
  --help-section-icon: url("/brand/sidebar-authorization.svg");
}

.g-root .dc-toc .dc-toc__list-item_labeled:has(a[href="docs/07-home-screen.html"]) {
  --help-section-icon: url("/brand/home.svg");
}

.g-root .dc-toc .dc-toc__list-item_labeled:has(a[href="docs/05-tasks.html"]) {
  --help-section-icon: url("/brand/sidebar-tasks.svg");
}

@media (min-width: 769px) {
  .g-root .dc-doc-page:not(.dc-doc-page_full-screen) .dc-doc-layout__toc:not(.dc-doc-layout__toc_toc-collapsed) {
    box-sizing: border-box;
    width: 276px;
    height: calc(100vh - var(--dc-header-height, var(--header-height)));
    padding: 10px 12px 10px 20px;
    border-inline-end: 0;
    background: transparent;
  }

  .g-root .dc-doc-layout__toc .dc-toc {
    height: 100%;
  }
}

@media (min-width: 1280px) {
  .g-root .dc-doc-page:not(.dc-doc-page_full-screen) .dc-doc-layout__left:not(.dc-doc-layout__left_toc-collapsed) {
    width: 320px;
  }

  .g-root .dc-doc-page:not(.dc-doc-page_full-screen) .dc-doc-layout__toc:not(.dc-doc-layout__toc_toc-collapsed) {
    width: 320px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .g-root .dc-toc .dc-toc-item__text {
    transition: background-color 120ms ease, color 120ms ease;
  }
}
