.widget_copriciel_toc_widget {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1rem 1.2rem;
  background: #fafafa;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  max-height: 70vh;
  overflow-y: auto;
  max-width: 100%;
  scroll-padding-top: 80px;
}

.copriciel-toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.4rem;
  flex-wrap: wrap;
}

.copriciel-toc-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: #333;
  white-space: nowrap;
}

.copriciel-toc-top-link {
  font-size: 0.85rem;
  color: #0073aa;
  text-decoration: none;
  margin-left: 1rem;
}
.copriciel-toc-top-link:hover {
  text-decoration: underline;
}

.copriciel-toc-items-root {
  list-style: none;
  margin: 0.4rem 0 0 0;
  padding-left: 0;
}

.copriciel-toc-item {
  margin: 0.3rem 0;
}
.copriciel-toc-item a {
  color: #444;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s ease;
}
.copriciel-toc-item a:hover {
  color: #0073aa;
  text-decoration: underline;
}

.copriciel-toc-sub {
  list-style: none;
  margin: 0.2rem 0 0.2rem 1rem;
  padding-left: 0.8rem;
  border-left: 2px solid #eee;
}
.copriciel-toc-sub .copriciel-toc-item a {
  font-size: 0.9rem;
  color: #555;
  transition: color 0.2s ease;
}

.copriciel-toc-item a.active-toc-item {
  color: #0073aa;
  font-weight: 600;
}

@media (max-width: 480px) {
  .copriciel-toc-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .copriciel-toc-top-link {
    margin-left: 0;
    margin-top: 0.4rem;
  }
}
