/* Защита от горизонтального скролла */
html, body { 
  overflow-x: hidden; 
  max-width: 100vw; 
}

/* Адаптация к теме сайта */
.bg-light {
  background-color: var(--dark-card) !important;
  color: var(--text-primary) !important;
}

/* Типографика для юридического документа */
.terms-section {
  line-height: 1.8;
  color: var(--text-primary);
}

.terms-section h2 {
  color: var(--primary);
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: 1.75rem;
}

.terms-section h3 {
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.35rem;
}

.terms-section h4 {
  color: var(--text-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 1.15rem;
}

.terms-section p {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.terms-section ul,
.terms-section ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.terms-section li {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.terms-section strong {
  color: var(--primary);
  font-weight: 600;
}

.last-updated {
  background: var(--dark-lighter);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  margin-bottom: 2rem;
}

.important-notice {
  background: var(--dark-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin: 2rem 0;
}

/* Таблица для юридических документов */
.table-responsive {
  margin: 1.5rem 0;
}

.table {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.table thead {
  background: var(--dark-card);
  border-bottom: 2px solid var(--border-color);
}

.table tbody tr {
  border-bottom: 1px solid var(--border-color);
}

/* Якорные ссылки в оглавлении */
.toc-list {
  background: var(--dark-lighter);
  padding: 1.5rem 2rem;
  border-radius: 8px;
  margin-bottom: 2.5rem;
}

.toc-list a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.toc-list a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Разделители секций */
.section-divider {
  border-top: 1px solid var(--border-color);
  margin: 3rem 0;
}

/* Нумерация разделов */
.terms-section > h2::before {
  content: counter(section) ". ";
  counter-increment: section;
  color: var(--primary);
}

.terms-section {
  counter-reset: section;
}