

.chapter-index {
  margin-top: clamp(42px, 7vw, 86px);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.chapter-choice {
  flex: 1 1 240px;
  min-height: 260px;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius-card);
  background: var(--secondary);
}

.chapter-choice:nth-child(3n+2) { background: var(--primary); }
.chapter-choice:nth-child(3n+3) { background: var(--soft-accent); }

.chapter-choice-roman {
  font-family: var(--font-display);
  font-size: clamp(4rem, 8vw, 7rem);
  font-weight: var(--weight-extrabold);
  line-height: .8;
}

.chapter-choice h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.reader-shell {
  width: min(980px, calc(100% - 32px));
  margin: 16px auto;
  padding: clamp(28px, 6vw, 84px);
  background: var(--panel-bg);
  border-radius: var(--radius-shell);
  box-shadow: var(--shadow-shell);
}

.reader-header {
  display: flex;
  align-items: flex-start;
  gap: clamp(24px, 5vw, 64px);
}

.reader-title { flex: 1 1 auto; }

.reader-title-line {
  display: flex;
  align-items: baseline;
  gap: var(--space-5);
}

.reader-roman {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 5rem);
  font-weight: var(--weight-extrabold);
}

.reader-title h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: .86;
}

.reader-status {
  margin: var(--space-4) 0 0;
  font-family: var(--font-display);
  font-size: var(--text-sm);
}

.chapter-body {
  max-width: 72ch;
  margin: clamp(48px, 8vw, 96px) auto 0;
  font-size: clamp(1.05rem, 1.5vw, 1.18rem);
  line-height: 1.85;
}

.chapter-body p {
  margin: 0 0 1.5em;
}

.chapter-body h2 {
  margin: 2.3em 0 .8em;
  font-size: 1.8em;
}

.chapter-divider {
  width: 56px;
  height: 1px;
  margin: 3em auto;
  background: currentColor;
  opacity: .3;
}

.reader-nav {
  margin-top: clamp(48px, 8vw, 96px);
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  border-top: 1px solid rgba(0,0,0,.12);
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
}

@media (max-width: 680px) {
  .reader-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 18px;
    border-radius: 0;
    box-shadow: none;
  }

  .reader-header {
    flex-direction: column;
    gap: var(--space-4);
  }

  .reader-title-line {
    flex-direction: column;
    gap: var(--space-2);
  }

  .chapter-index { flex-direction: column; }
  .chapter-choice { flex-basis: auto; }
}


.chapter-count {
  margin: var(--space-4) 0 0;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  opacity: .68;
}

.chapter-choice-top,
.chapter-choice-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chapter-choice-status {
  align-self: flex-start;
  max-width: 28ch;
  padding: 7px 10px;
  border: 1px solid rgba(0,0,0,.16);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: .62rem;
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.chapter-choice-meta {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  opacity: .72;
}


.reader-source {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xs);
  line-height: 1.5;
  opacity: .56;
}


.chapter-relations {
  margin-top: clamp(32px, 5vw, 56px);
  padding: var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--content-gap);
  background: var(--white);
  border-radius: var(--radius-card);
}

.relation-group {
  flex: 1 1 0;
  min-width: 0;
}

.relation-list {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.relation-chip,
.field-state {
  min-height: 34px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.relation-chip {
  background: var(--secondary);
}

.relation-chip[data-state="APERTO"] {
  background: transparent;
  border: 1px dashed rgba(0,0,0,.28);
  opacity: .65;
}

.field-state-open {
  background: var(--accent);
  color: var(--ink);
}

.relation-note {
  flex: 1 1 220px;
  font-size: var(--text-sm);
  line-height: 1.45;
  opacity: .68;
}

.reader-error {
  margin-top: var(--space-8);
}

@media (max-width: 680px) {
  .chapter-relations {
    flex-direction: column;
  }
}
