/* ===== TOC New — fully isolated, no inheritance from .jump-to ===== */
.toc-new {
  all: unset;
  display: block;
  box-sizing: border-box;
  margin: 30px auto 0;
  padding: 0;
  max-width: 1400px;
  position: relative;
  z-index: 100;
}
.toc-new *,
.toc-new *::before,
.toc-new *::after {
  box-sizing: border-box;
}
.toc-new__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8F9FA;
  border: 1px solid #E5E5E5;
  border-radius: 10px;
  padding: 16px 24px;
  cursor: pointer;
  user-select: none;
  transition: box-shadow .2s ease, border-color .2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.toc-new__header:hover {
  border-color: #B38E5D;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.toc-new__label {
  font-family: 'Sofia Pro Regular', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #002244;
  line-height: 1.4;
  margin: 0;
  padding: 0;
}
.toc-new__arrow {
  color: #002244;
  transition: transform .3s ease;
  flex-shrink: 0;
  margin-left: 12px;
}
.toc-new.is-open .toc-new__arrow {
  transform: rotate(180deg);
}
.toc-new__list {
  all: unset;
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .35s ease, opacity .3s ease;
  background: #F8F9FA;
  border: 1px solid #E5E5E5;
  border-top: none;
  border-radius: 0 0 10px 10px;
}
.toc-new.is-open .toc-new__list {
  /* max-height is set by JS based on actual content height */
  max-height: 2400px;
  opacity: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: column;
  /* grid-template-rows is set via CSS custom property computed per page */
  grid-template-rows: repeat(var(--toc-row-count, 4), auto);
}
.toc-new.is-open .toc-new__header {
  border-radius: 10px 10px 0 0;
}
.toc-new__list li {
  all: unset;
  display: block;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #ECECEC;
}
.toc-new__list li:nth-last-child(-n+2) {
  border-bottom: none;
}
.toc-new__list a {
  all: unset;
  display: block;
  padding: 12px 24px;
  color: #333;
  font-family: 'Sofia Pro Regular', sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.toc-new__list a:hover,
.toc-new__list a:focus {
  background: #f1f1f1;
  color: #B38E5D;
}
.toc-new__list a.active {
  background: #002244;
  color: #fff;
  font-weight: 700;
}

/* Sticky/fixed state — top set dynamically via JS */
.toc-new.is-fixed {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 4998;
  margin: 0 auto;
  padding: 12px 50px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-width: 100%;
}
.toc-new.is-fixed .toc-new__header {
  max-width: 1400px;
  margin: 0 auto;
}
.toc-new.is-fixed .toc-new__list {
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .toc-new {
    margin-top: 20px;
    padding: 0 15px;
  }
  .toc-new.is-fixed {
    padding: 10px 15px;
  }
}
@media (max-width: 768px) {
  .toc-new.is-open .toc-new__list {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-auto-flow: row;
  }
  .toc-new__list li:nth-last-child(-n+2) {
    border-bottom: 1px solid #ECECEC;
  }
  .toc-new__list li:last-child {
    border-bottom: none;
  }
}
