﻿.toc-container {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.toc-container::-webkit-scrollbar { width: 6px; }
.toc-container::-webkit-scrollbar-track { background: #f1f5f9; }
.toc-container::-webkit-scrollbar-thumb { background-color: #94a3b8; border-radius: 3px; }

.toc-nav ul { list-style: none; padding: 0; margin: 0; }
.toc-nav > ul > li { margin-bottom: 0.25rem; }

.toc-link {
  display: block;
  padding: 0.25rem;
  color: #1e40af;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  position: relative;
  padding-left: 1.5rem;
  line-height: 1.3;
}

.toc-link:hover { background-color: #eff6ff; color: #1e3a8a; }
.toc-link.active { background-color: #dbeafe; color: #1e3a8a; font-weight: 600; }

.toc-nav ul ul { margin-left: 1rem; margin-top: 0.125rem; margin-bottom: 0.125rem; }
.toc-nav ul ul .toc-link { font-size: 0.95em; padding-top: 0.125rem; padding-bottom: 0.125rem; }

.content-section { scroll-margin-top: 2rem; }

/* Formula blocks */
.formula-card {
  background-color: #f8fafc; /* slate-50 */
  border: 1px solid #e2e8f0; /* slate-200 */
  border-radius: 0.5rem;
  padding: 1rem;
}
.formula-title {
  font-weight: 600;
  color: #0f172a; /* slate-900 */
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.math {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: clamp(0.95rem, 1.1vw + 0.7rem, 1.1rem);
  line-height: 1.5;
  text-align: center;
  color: #0f172a;
  background-color: #ffffff;
  border: 1px solid #e5e7eb; /* gray-200 */
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
}
.vars-list { margin-top: 0.5rem; margin-left: 1rem; }
.vars-list li { list-style: disc; color: #334155; }
.example { color: #64748b; font-size: 0.9rem; }

/* Mobile optimizations */
@media (max-width: 640px) {
  .formula-card { padding: 0.75rem; }
  .formula-title { font-size: 0.9rem; }
  .math { font-size: 0.95rem; padding: 0.5rem; }
  .vars-list { margin-left: 0.75rem; font-size: 0.95rem; }
  .toc-container { position: static; }
  .toc-link { padding: 0.2rem; font-size: 0.95rem; }
}

/* Desktop polish */
@media (min-width: 1024px) {
  .formula-card { padding: 1.25rem; }
  .math { font-size: 1.1rem; }
}

@media print { .toc-container { display: none; } }




