/* Plain lesson content. The World History and shared assets own the shell,
   typography, theme, sidebar and completion controls. */
#articleBody > .card {
  scroll-margin-top: calc(var(--shared-topbar-height) + 20px);
  padding: clamp(20px, 3vw, 34px);
}
#articleBody > .card > p { max-width: 78ch; margin: 12px 0 20px; color: var(--ink-soft); }
#articleBody > .card > h3 { max-width: 82ch; margin: 30px 0 10px; padding-inline-start: 0; }
#articleBody > .card > h3::before { display: none; }
#articleBody > .card > h3:not(:first-of-type) { padding-top: 22px; border-top: 1px solid var(--line-soft); }
#articleBody > .card > h2 {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}
#articleBody ul {
  list-style: disc;
  margin: 10px 0 24px;
  padding-inline-start: 22px;
}
#articleBody li {
  padding: 0;
  margin: 12px 0;
  border: 0;
  color: var(--ink-soft);
}
#articleBody .card li { max-width: 78ch; }
#articleBody li::before { content: none; }
#articleBody li::marker { color: var(--accent); }
#articleBody li > ul { margin-block: 8px 12px; }
#articleBody li strong { color: var(--ink); }
#articleBody .table-wrap { max-width: 100%; }
#articleBody .table-wrap { margin: 16px 0 28px; }
#articleBody .table-wrap table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}
#articleBody caption {
  padding: 12px 14px;
  text-align: left;
  color: var(--ink-soft);
  font-weight: 600;
}
#articleBody th,
#articleBody td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}
#articleBody th:first-child { width: 32%; }
#articleBody tbody th {
  position: static;
  background: transparent;
  color: var(--ink);
}
#articleBody .complete-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
#mainContent .chapter-navigation {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}
@media (max-width: 560px) {
  #articleBody ul { padding-inline-start: 20px; }
  #articleBody th, #articleBody td { padding: 10px 11px; }
  #articleBody th:first-child { width: 38%; }
}
@media print {
  #articleBody > .card { break-inside: auto; }
  #articleBody h2, #articleBody h3 { break-after: avoid; }
  #articleBody .complete-row, #mainContent .chapter-navigation { display: none; }
}

/* Chapter index: quiet numbered rows with a clear completion marker. */
#sidebar .toc-list {
  gap: 9px;
}
#sidebar .toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 3px 7px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  transition: background .15s ease, color .15s ease;
}
#sidebar .toc-link:hover,
#sidebar .toc-link:focus-visible,
#sidebar .toc-link.active {
  background: var(--card);
  color: var(--ink);
}
#sidebar .toc-link::before { display: none; }
#sidebar .toc-link .num {
  display: inline-flex;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
#sidebar .toc-link .title {
  min-width: 0;
  flex: 1;
}
#sidebar .toc-link.done::after {
  content: '✓';
  display: inline-flex;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  margin: 0 3px 0 auto;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--accent);
  color: var(--card);
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
}
@media (max-width: 560px) {
  #sidebar .toc-list { gap: 7px; }
  #sidebar .toc-link { font-size: 13px; }
  #sidebar .toc-link .num { flex-basis: 32px; width: 32px; height: 32px; font-size: 11px; }
}
