body {
  margin: 0;
  background: var(--text-white);
  font-family: 'Roboto', sans-serif;
  color: var(--anthracite);
}

.ebook-container {
  max-width: 37.5rem;
  margin: 2rem auto;
  box-shadow: 0 0.375rem 2.25rem var(--shadow);
  background: var(--text-white);
  border-radius: 1.5rem;
  overflow: hidden;
  position: relative;
}

.cover {
  background: linear-gradient(120deg, var(--soft-purple), var(--warm-yellow) 95%);
  color: var(--anthracite);
  text-align: center;
  padding: 3rem 1.5rem 2rem 1.5rem;
}

.cover h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.125rem;
  font-family: 'Poppins', sans-serif;
}

.cover img {
  width: 5.625rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.75rem var(--shadow);
}

.cover p {
  font-size: 1.1rem;
  opacity: 0.88;
}

.start-btn {
  background: var(--anthracite);
  color: var(--warm-yellow);
  font-weight: bold;
  border: none;
  border-radius: 2rem;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  margin-top: 1.5rem;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 0.125rem 0.5rem var(--shadow);
}

.start-btn:hover,
.start-btn:active {
  background: var(--soft-purple);
  color: var(--anthracite);
}

.progress-bar {
  width: 100%;
  height: 0.625rem;
  background: var(--soft-purple);
  border-radius: 0 0 1rem 1rem;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 10;
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--warm-yellow), var(--soft-purple) 95%);
  width: 0%;
  transition: width 0.4s cubic-bezier(.8,0,.2,1);
}

.timeline {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 2rem 0 1.125rem 0;
  flex-wrap: wrap;
  justify-content: center;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0.5rem;
}

.timeline-dot {
  width: 1.25rem; height: 1.25rem;
  border-radius: 50%;
  background: var(--text-light);
  border: 0.1875rem solid var(--warm-yellow);
  margin-bottom: 0.25rem;
  transition: 0.25s;
}

.timeline-dot.active {
  background: var(--soft-purple);
  border-color: var(--soft-purple);
  box-shadow: 0 0 0 0.1875rem var(--soft-purple);
}

.timeline-label {
  font-size: 0.88rem;
  text-align: center;
  min-width: 3.375rem;
  opacity: 0.7;
}

.chapter, .quiz, .summary {
  padding: 1.75rem 1.5rem 2.25rem 1.5rem;
  animation: fadein 0.45s;
}

.chapter p,
.quiz p,
.summary p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

@keyframes fadein { from { opacity: 0; transform: translateY(1.25rem);} to {opacity: 1; transform: none;} }

.chapter-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.875rem;
  font-family: 'Poppins', sans-serif;
}

.subchapter-title {
  font-size: 1.15rem;
  margin: 1.375rem 0 0.5rem 0;
  color: var(--trust-blue);
  font-weight: 600;
}

.nav-btns {
  display: flex;
  justify-content: space-between;
  margin-top: 2.125rem;
  gap: 1.25rem;
}

.nav-btn {
  flex: 1;
  background: var(--warm-yellow);
  color: var(--anthracite);
  font-weight: 700;
  border: none;
  border-radius: 1.75rem;
  padding: 0.875rem 0;
  font-size: 1.07rem;
  cursor: pointer;
  margin: 0 0.1875rem;
  transition: 0.2s;
  box-shadow: 0 0.125rem 0.4375rem var(--shadow);
}

.nav-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.nav-btn:hover,
.nav-btn:active {
  background: var(--soft-purple);
  color: var(--anthracite);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.375rem 0;
}

.toc-list li {
  padding: 0.6875rem 0;
  border-bottom: 0.0625rem solid var(--text-light);
  cursor: pointer;
  font-size: 1.13rem;
  color: var(--anthracite);
  transition: 0.2s;
}

.toc-list li.active,
.toc-list li:hover {
  color: var(--trust-blue);
  font-weight: bold;
  background: var(--text-white);
  border-radius: 0.375rem;
}

.quiz-q {
  font-weight: bold;
  margin: 1.25rem 0 0.5rem 0;
}

.quiz-answers label {
  display: block;
  margin-bottom: 0.5625rem;
  cursor: pointer;
  padding: 0.375rem 0.875rem;
  border-radius: 0.75rem;
  transition: 0.15s;
}

.quiz-answers label:hover,
.quiz-answers label:active {
  background: color-mix(in srgb, var(--warm-yellow), transparent 40%);
}

.quiz-answers input[type="radio"] {
  margin-right: 0.5rem;
}

.quiz-answers label.selected {
  background: color-mix(in srgb, var(--warm-yellow), transparent 30%);
  color: var(--anthracite);
}

.quiz-answers label.correct {
  background: var(--calm-teal);
  color: var(--anthracite);
  font-weight: bold;
}

.quiz-answers label.incorrect {
  background: var(--creative-orange);
  color: var(--anthracite);
  font-weight: bold;
}

.quiz-score {
  margin: 1.75rem 0 0 0;
  font-size: 1.2rem;
  text-align: center;
  font-weight: bold;
  color: var(--trust-blue);
}

@media (max-width: 700px) {
  .ebook-container { max-width: 98vw; margin: 0; border-radius: 0; }
  .chapter, .quiz, .summary { padding: 1.25rem 0.5rem 2.375rem 0.5rem; }
  .cover { padding: 2.125rem 0.5625rem 1.5625rem 0.5625rem; }
}

@media (max-width: 480px) {
  .ebook-container { max-width: 100vw; margin: 0; border-radius: 0; }
  .chapter, .quiz, .summary { padding: 1rem 0.5rem 1.5rem 0.5rem; }
  .cover { padding: 1.5rem 0.5rem 1rem 0.5rem; }
  .cover h1 { font-size: 1.75rem; }
  .nav-btn { font-size: 1rem; }
  .chapter-title { font-size: 1.3rem; }
}

@media (min-width: 1024px) {
  .ebook-container { max-width: 48rem; }
  .cover h1 { font-size: 3rem; }
  .nav-btn { font-size: 1.2rem; }
  .chapter-title { font-size: 1.75rem; }
}