.toc-container,
.toc-container * {
  box-sizing: border-box;
}

.toc-container {
  margin: 36px 0;
  border: 1px solid #eceff2;
  border-radius: 4px;
  background: #f5f8fa;
  color: #556270;
  font-size: 0.95rem;
  overflow: hidden;
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 20px);
  margin: 10px 10px 4px;
  padding: 0;
  border: 0 !important;
  border-bottom: 0 !important;
  background: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
  text-decoration: none !important;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  appearance: none;
}

.toc-header:hover,
.toc-list a:hover {
  color: #111827 !important;
}

.toc-header:focus-visible,
.toc-more-btn:focus-visible {
  outline: 2px solid rgba(47, 111, 188, 0.25);
  outline-offset: 3px;
}

.toc-toggle {
  width: 16px;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.toc-container.is-closed .toc-toggle {
  transform: rotate(-90deg);
}

.toc-container.is-closed .toc-list,
.toc-container.is-closed .toc-more-btn {
  display: none;
}

.toc-title {
  font-size: 0.93rem;
  font-weight: 600;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0 12px 2px;
}

.toc-list a {
  display: block;
  padding: 7px 4px 7px 0;
  text-decoration: none !important;
  color: #556270 !important;
  font-weight: 400;
  line-height: 1.2;
  font-size: 0.92rem;
  border-bottom: 1px solid #d7dde3;
}

.toc-list li:last-child a {
  border-bottom: 0;
}

.toc-list a:visited,
.toc-list a:focus,
.toc-list a:active {
  text-decoration: none !important;
}

.toc-list .is-h3 a {
  padding-left: 14px;
}

.toc-list .is-h4 a {
  padding-left: 26px;
}

.toc-list .is-h5 a {
  padding-left: 38px;
}

.toc-list li.is-hidden {
  display: none;
}

.toc-more-btn {
  display: inline-block;
  margin: 4px 0 10px 12px;
  padding: 6px 11px;
  border: 1px solid #d8dde3 !important;
  border-radius: 10px;
  background: #fff !important;
  color: #111827 !important;
  cursor: pointer;
  min-width: 108px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.1;
}

.toc-more-btn[hidden] {
  display: none !important;
}

.toc-more-btn:hover {
  background: #fdfdfd !important;
  border-color: #c9d1d9 !important;
}
