.itoc{
  --itoc-border: rgba(255,255,255,.18);
  --itoc-border-hover: rgba(255,255,255,.92);
  --itoc-text: rgba(255,255,255,.96);
  --itoc-muted: rgba(255,255,255,.72);
  --itoc-line: rgba(255,255,255,.12);
  --itoc-accent-1: rgba(255,43,214,.35);
  --itoc-accent-2: rgba(124,58,237,.30);
  --itoc-offset: 96px;
  margin: 22px 0 28px;
}

/* Card: fondo transparente (hereda el fondo real de la web) */
.itoc__card{
  background: transparent;
  color: var(--itoc-text);
  border: 1px solid var(--itoc-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0,0,0,.14);
  transition: border-color .15s ease, box-shadow .15s ease;
  position: relative;
}
.itoc__card:before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: linear-gradient(135deg, var(--itoc-accent-1), var(--itoc-accent-2));
  opacity:.14;
}
.itoc__card:hover{
  border-color: var(--itoc-border-hover);
  box-shadow: 0 16px 44px rgba(0,0,0,.18);
}

.itoc__details{ position: relative; }

.itoc__summary{
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.itoc__summary::-webkit-details-marker{ display:none; }

.itoc__summaryLeft{
  display:flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  min-width: 0;
}
.itoc__title{
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .2px;
}
.itoc__subtitle{
  font-size: .82rem;
  color: var(--itoc-muted);
  font-weight: 700;
}

.itoc__summaryRight{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.04);
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.itoc__summary:hover .itoc__summaryRight{
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.06);
}
.itoc__chevIcon{
  width: 18px;
  height: 18px;
  display:block;
}
.itoc__details[open] .itoc__summaryRight{
  border-color: rgba(255,255,255,.48);
}
.itoc__details[open] .itoc__summaryRight .itoc__chevIcon{
  transform: rotate(180deg);
  transition: transform .15s ease;
}

.itoc__body{
  position: relative;
  z-index: 1;
  padding: 0 16px 14px;
  border-top: 1px solid rgba(255,255,255,.10);
}
.itoc__nav{ margin-top: 12px; }

/* LISTA: elegante (sin aspecto de botones) */
.itoc__tree,
.itoc__list{
  margin: 0;
  padding: 0;
  list-style: none;
}

.itoc__h2{ margin: 0; }

/* H2 row / summary */
.itoc__h2row,
.itoc__h2summary{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  text-align: left;
}
.itoc__h2summary{ cursor: pointer; list-style: none; }
.itoc__h2summary::-webkit-details-marker{ display:none; }

.itoc__chev{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
  flex: 0 0 auto;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.itoc__chev .itoc__chevIcon{ width: 16px; height: 16px; }
.itoc__section:hover .itoc__chev{
  border-color: rgba(255,255,255,.30);
  background: rgba(255,255,255,.05);
}
.itoc__section[open] .itoc__chev .itoc__chevIcon{
  transform: rotate(180deg);
}

/* Enlaces: texto + punto (sin “pill”) */
.itoc__link{
  color: var(--itoc-text);
  text-decoration: none;
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.32;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
}
.itoc__link:before{
  content:"";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  margin-top: .62em;
  background: rgba(255,255,255,.42);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
  flex: 0 0 auto;
}
.itoc__link:hover{
  border-bottom-color: rgba(255,255,255,.78);
}
.itoc__link.is-active{
  font-weight: 900;
  border-bottom-color: rgba(255,255,255,.92);
}
.itoc__link.is-active:before{
  background: rgba(255,255,255,.85);
  box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 0 16px rgba(255,43,214,.12);
}

/* H2 más prominente */
.itoc__link--h2{
  font-weight: 900;
  font-size: .98rem;
}
.itoc__link--h2:before{
  width: 8px;
  height: 8px;
  margin-top: .55em;
  background: linear-gradient(135deg, rgba(255,43,214,.85), rgba(124,58,237,.80));
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 0 18px rgba(255,43,214,.10);
}

/* Hijos con guía visual */
.itoc__children{
  margin: 6px 0 10px 14px;
  padding-left: 14px;
  border-left: 1px solid var(--itoc-line);
}
.itoc__list--h3{ display: grid; gap: 6px; }
.itoc__node--h3 .itoc__link{
  font-weight: 750;
  font-size: .92rem;
  color: rgba(255,255,255,.92);
}
.itoc__node--h3 .itoc__link:before{
  width: 6px; height: 6px;
  background: rgba(255,255,255,.55);
}
.itoc__list--h4{
  margin: 6px 0 0 14px;
  padding-left: 14px;
  border-left: 1px solid rgba(255,255,255,.10);
  display: grid;
  gap: 6px;
}
.itoc__node--h4 .itoc__link{
  font-weight: 700;
  font-size: .88rem;
  color: rgba(255,255,255,.86);
}
.itoc__node--h4 .itoc__link:before{
  width: 5px; height: 5px;
  background: rgba(255,255,255,.38);
}

/* Focus visible (accesibilidad) */
.itoc__link:focus-visible{
  outline: 2px solid rgba(255,255,255,.85);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Scroll margin para anchors */
h2[id],h3[id],h4[id]{ scroll-margin-top: calc(var(--itoc-offset) + 8px); }

@media (max-width: 767px){
  .itoc{ margin: 18px 0 22px; }
  .itoc__summary{ padding: 12px 14px; }
  .itoc__body{ padding: 0 14px 12px; }
  .itoc__h2row, .itoc__h2summary{ padding: 10px 0; }
  .itoc__children{ margin-left: 12px; padding-left: 12px; }
  .itoc__summaryRight{ width: 32px; height: 32px; }
  .itoc__chev{ width: 30px; height: 30px; }
}
