.ltoc {
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 1.2rem;
}

.ltoc--dark {
  border-color: rgba(255,255,255,.18);
}

.ltoc__title,
.ltoc__summary {
  font-weight: 700;
  margin: 0 0 10px 0;
}

.ltoc__details {
  margin: 0;
}

.ltoc__details > .ltoc__list {
  opacity: 1;
  transition: opacity .18s ease;
}

.ltoc__details:not([open]) > .ltoc__list {
  opacity: 0;
}

.ltoc__summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ltoc__summary::-webkit-details-marker { display:none; }

/* Fallback para HTML antiguo cacheado (sin spans de toggle) */
.ltoc__summary:not(.ltoc__summary--enhanced)::after {
  content: "Mostrar \25BE";
  margin-left: auto;
  opacity: .8;
  font-size: .92em;
  font-weight: 500;
  white-space: nowrap;
}

.ltoc__details[open] .ltoc__summary:not(.ltoc__summary--enhanced)::after {
  content: "Ocultar \25B4";
}

.ltoc__summary-title {
  display: inline-block;
}

.ltoc__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .92em;
  font-weight: 500;
  opacity: .9;
  white-space: nowrap;
}

.ltoc__toggle-text--hide { display: none; }

.ltoc__details[open] .ltoc__toggle-text--show { display: none; }
.ltoc__details[open] .ltoc__toggle-text--hide { display: inline; }

.ltoc__toggle-arrow::before {
  content: "▾";
  display: inline-block;
  opacity: .8;
}

.ltoc__details[open] .ltoc__toggle-arrow::before {
  content: "▴";
}

.ltoc__list{
  margin: 0;
  padding-left: 18px;
}

.ltoc__list { padding-left: 18px; }

.ltoc__sublist {
  margin-top: 6px;
  padding-left: 40px;
}

.ltoc__item { margin: 6px 0; }

.ltoc__link {
  text-decoration: none;
}

.ltoc__link:hover { text-decoration: underline; }

.ltoc--numbered .ltoc__list { list-style: decimal; }
.ltoc:not(.ltoc--numbered) .ltoc__list { list-style: none; padding-left: 0; }
.ltoc:not(.ltoc--numbered) .ltoc__item { padding-left: 0; }

.ltoc__anchor {
  margin-left: .4rem;
  font-size: .9em;
  text-decoration: none;
  opacity: .6;
}
.ltoc__anchor:hover { opacity: 1; }

.ltoc--sticky {
  position: sticky;
  top: 16px;
}

