/* --- Base ToC lists --- */
.toc-list {
  margin: 0;
  padding-left: 1rem;
}
.toc-list li {
  margin: 0.25rem 0;
}
.toc-list a {
  text-decoration: none;
}
.toc-container {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
}
.toc-sidebar {
  margin: 1rem 0;
}
.toc-sidebar h3 {
  margin-bottom: 0.5rem;
}

/* --- Floating TOC --- */
/* Positionnement à droite de .inner :
   - On ancre sur .inner si elle existe, sinon fallback fixed viewport */
.amtoc-float {
  --amtoc-offset-y: 50px;
  --amtoc-offset-x: 10px;
  position: fixed;
  top: var(--amtoc-offset-y);
  right: var(--amtoc-offset-x);
  z-index: 9999;
}

/* Bouton icône */
.amtoc-float-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.amtoc-float-panel {
  margin-top: 10px;
  width: min(320px, 85vw);
  max-height: min(70vh, 520px);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}

.amtoc-float-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  background: #fff;
}

.amtoc-float-title {
  font-weight: 600;
}

.amtoc-float-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.amtoc-float-panel-body {
  padding: 10px 12px 12px;
}

/* Mobile: on évite que ça gêne trop */
@media (max-width: 768px) {
  .amtoc-float {
    right: 8px;
    top: 20vh;
  }
}
