.main--chapter { margin-top: 24px; margin-bottom: 32px; }
#chapter-view { font-size: 16px; line-height: 1.55; }
#chapter-view .back-link { margin-bottom: 12px; }
#chapter-view .chapter-page-title { margin-bottom: 12px; font-size: 32px; line-height: 1.4; }
.lesson-number { display: block; margin-bottom: 2px; font-size: 17px; }
.chapter-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.toc-button { flex: 1 0 auto; min-height: 40px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px; background: white; color: var(--navy); font-weight: 700; font-size: 14px; cursor: pointer; }
.toc-button:first-child { background: var(--navy); color: white; }
.toc-button:hover { border-color: #608bac; box-shadow: 0 2px 6px rgb(33 62 89 / 9%); }
.lesson-section { margin-bottom: 12px; padding: 14px 20px; border: 1px solid var(--border); border-radius: 8px; scroll-margin-top: 92px; }
.lesson-section h2 { margin: 0 0 8px; font-size: 23px; line-height: 1.4; }
.lesson-section h3 { margin: 8px 0 4px; font-size: 17px; }
.lesson-section p { margin: 6px 0; }
.lesson-section ul { margin: 0; padding-left: 24px; }
.lesson-section--objectives { background: #fffefd; }
.lesson-section--grammar { background: #edf7ff; border-color: #bddcf3; }
.lesson-section--vocabulary { background: #eefaf1; border-color: #c4e4ce; }
.lesson-section--examples { background: #fff0f6; border-color: #edcddc; }
.lesson-section--points { background: #fff9e4; border-color: #eddda5; }
.lesson-section--vocabulary h2 { color: #245c3c; }
.lesson-section--examples h2 { color: #993957; }
.lesson-section--points h2 { color: #805817; }
.lesson-table { width: 100%; border-spacing: 0; table-layout: fixed; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; background: rgb(255 255 255 / 58%); }
.lesson-table th, .lesson-table td { padding: 3px 16px; text-align: left; overflow-wrap: anywhere; }
.lesson-table th { background: #e4eff7; font-weight: 700; }
.lesson-table tr + tr td, .lesson-table tbody tr:first-child td { border-top: 1px solid #dce8f2; }
.lesson-table th + th, .lesson-table td + td { border-left: 1px solid #dce8f2; }
.lesson-table tbody tr:nth-child(even) { background: rgb(237 247 255 / 45%); }
.vocabulary-table th:nth-child(1) { width: 28%; }
.vocabulary-table th:nth-child(2) { width: 32%; }
.vocabulary-table th:nth-child(3) { width: 22%; }
.vocabulary-table th:last-child, .vocabulary-table td:last-child { padding: 0; text-align: center; }
.pronunciation { display: inline-grid; place-items: center; width: 44px; height: 32px; vertical-align: middle; border-radius: 5px; }
.pronunciation svg { width: 20px; height: 20px; }
.pronunciation:hover, .pronunciation:focus-visible { background: #dceaf4; }
.pronunciation:focus-visible { outline-offset: -3px; }
.sentence-pattern { padding: 9px 16px; border: 1px solid var(--border); border-radius: 5px; background: rgb(255 255 255 / 55%); font-weight: 700; }
.example-pair { display: grid; gap: 1px; }
.lesson-section .lesson-examples--audio { padding: 0; list-style: none; border: 1px solid #eedfe6; border-radius: 5px; background: rgb(255 255 255 / 40%); }
.lesson-examples--audio li { display: grid; grid-template-columns: 1fr 60px; align-items: center; padding: 3px 12px; }
.lesson-examples--audio li + li { border-top: 1px solid #eedfe6; }
.lesson-examples--audio .example-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; }
.lesson-section--quiz { padding: 0; border: 0; text-align: center; }
.mini-test { display: inline-block; min-width: 330px; max-width: 100%; padding: 13px 24px; border: 1px solid var(--navy); border-radius: 7px; background: var(--navy); color: white; font-weight: 700; text-decoration: none; }
.mini-test:disabled,
.mini-test:disabled:hover { background: #e2e7ec; color: #788593; border-color: #d2dae2; box-shadow: none; cursor: not-allowed; }
.back-to-top { position: fixed; right: 24px; bottom: 24px; width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 50%; background: #e3eff8; color: var(--navy); font-size: 26px; cursor: pointer; }
.back-to-top:hover { background: #d5e5f2; }
@media (max-width: 600px) {
  #chapter-view { font-size: 14px; }
  #chapter-view .chapter-page-title { font-size: 24px; }
  .lesson-number { font-size: 15px; }
  .chapter-toc { gap: 6px; }
  .toc-button { flex-grow: 1; min-height: 44px; padding: 6px 10px; font-size: 13px; }
  .lesson-section { padding: 12px; scroll-margin-top: 80px; }
  .lesson-section h2 { font-size: 20px; }
  .lesson-table th, .lesson-table td { padding: 5px 6px; }
  .vocabulary-table th, .vocabulary-table td { padding-right: 4px; padding-left: 4px; }
  .vocabulary-table th:nth-child(1) { width: 34%; }
  .vocabulary-table th:nth-child(2) { width: 30%; }
  .vocabulary-table th:nth-child(3) { width: 20%; }
  .vocabulary-table th:last-child { width: 16%; }
  .vocabulary-table { font-size: 13px; }
  .pronunciation { width: 44px; max-width: 100%; height: 44px; }
  .lesson-examples--audio li { grid-template-columns: minmax(0, 1fr) 44px; padding: 6px; }
  .lesson-examples--audio .example-pair { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .mini-test { min-width: 0; width: 100%; }
  .lesson-section--quiz { padding: 0; }
  .back-to-top { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
}
