.chapter-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto 20px;
  padding: 0 20px;
}

.chapter-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
  min-height: 72px;
  position: relative;
}

a.chapter-nav-btn {
  cursor: pointer;
}

a.chapter-nav-btn:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.03);
}

.chapter-nav-prev { text-align: left; align-items: flex-start; }
.chapter-nav-next { text-align: right; align-items: flex-end; }

.chapter-nav-direction {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}

a.chapter-nav-btn:hover .chapter-nav-direction {
  color: rgba(255,255,255,0.7);
}

.chapter-nav-title {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
  line-height: 1.3;
}

a.chapter-nav-btn:hover .chapter-nav-title {
  color: #fff;
}

.chapter-nav-locked {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.chapter-nav-gated {
  border-style: dashed;
}

.chapter-nav-gated .chapter-nav-title {
  color: rgba(255,255,255,0.5);
}

.chapter-nav-gated:hover .chapter-nav-title {
  color: rgba(255,255,255,0.8);
}

.chapter-nav-lock {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  opacity: 0.5;
  vertical-align: middle;
}

.chapter-nav-lock svg {
  display: inline-block;
}

.chapter-nav-empty {
  border: none;
  pointer-events: none;
}

.chapter-nav-toc-btn {
  padding: 12px 20px;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  align-self: center;
}

.chapter-nav-toc-btn:hover {
  border-color: rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.8);
}

.chapter-toc-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chapter-toc-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.chapter-toc {
  background: rgba(10,10,10,0.98);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  width: min(480px, 90vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.chapter-toc-overlay.open .chapter-toc {
  transform: translateY(0);
}

.chapter-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chapter-toc-title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chapter-toc-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.3s;
}

.chapter-toc-close:hover {
  color: rgba(255,255,255,0.8);
}

.chapter-toc-list {
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.chapter-toc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  text-decoration: none;
  transition: background 0.2s;
  cursor: default;
}

a.chapter-toc-item {
  cursor: pointer;
}

a.chapter-toc-item:hover {
  background: rgba(255,255,255,0.04);
}

.chapter-toc-item .toc-label {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
}

a.chapter-toc-item:hover .toc-label {
  color: #fff;
}

.chapter-toc-item.current .toc-label {
  color: #fff;
  font-weight: 500;
}

.chapter-toc-item.locked .toc-label {
  color: rgba(255,255,255,0.35);
}

.toc-locked svg {
  vertical-align: middle;
}

.toc-badge {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  margin-left: 12px;
  flex-shrink: 0;
}

.toc-free {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.4);
}

.toc-reading {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
}

.toc-locked {
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.2);
}

@media (max-width: 600px) {
  .chapter-nav {
    flex-direction: column;
    gap: 8px;
  }

  .chapter-nav-prev,
  .chapter-nav-next {
    align-items: center;
    text-align: center;
  }

  .chapter-nav-toc-btn {
    order: -1;
  }
}
