<!-- rational functions part -->
/* Unified Math Documentation Styles */

/* Common section styling */
.math-section {
  background: #f8f9fa;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: 0.25rem;
}

/* Method-specific colors */
.math-section.standard {
  border-left: 4px solid #0d6efd;
}

.math-section.eigenvalue {
  border-left: 4px solid #198754;
}

.math-section.barycentric {
  border-left: 4px solid #6f42c1;
}

/* Step styling */
.math-step {
  background: white;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Step labels with method-specific colors */
.step-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.standard .step-label {
  color: #0d6efd;
}

.eigenvalue .step-label {
  color: #198754;
}

.barycentric .step-label {
  color: #6f42c1;
}

/* Definition boxes with method-specific backgrounds */
.definition-box {
  padding: 1rem;
  border-radius: 0.25rem;
  margin-top: 0.5rem;
}

.standard .definition-box {
  background: #e7f3ff;
}

.eigenvalue .definition-box {
  background: #d1e7dd;
}

.barycentric .definition-box {
  background: #e0cffc;
}

/* Where clauses */
.where-clause {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Highlight boxes */
.highlight-box {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0.25rem;
}

.highlight-box h5 {
  color: #856404;
  margin-bottom: 0.5rem;
}

/* Info highlight (blue) */
.highlight-box.info {
  background: #cfe2ff;
  border-left-color: #0d6efd;
}

.highlight-box.info h5 {
  color: #084298;
}

/* Advantage boxes */
.advantage-box {
  background: #d1e7dd;
  border-left: 4px solid #198754;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0.25rem;
}

.advantage-box h5 {
  color: #0f5132;
  margin-bottom: 0.5rem;
}

.advantage-box ul {
  margin-bottom: 0;
}

/* Matrix overflow handling */
.math-step > div[style*="overflow-x"] {
  overflow-x: auto;
  padding: 0.5rem 0;
}

/* List styling within steps */
.math-step ol,
.math-step ul {
  margin-bottom: 0;
}

.math-step ol li,
.math-step ul li {
  margin-bottom: 0.25rem;
}

/* Bootstrap alert customization for math content */
.alert h5 {
  margin-bottom: 0.5rem;
}

/* Two-column layout for definitions */
.definition-box .row {
  margin-top: 0.5rem;
}

.definition-box ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.definition-box li {
  margin-bottom: 0.3rem;
}


/* Ensure MathJax displays properly */
.MathJax {
  font-size: 1em !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .math-section {
    padding: 1rem;
  }
  
  .math-step {
    padding: 0.75rem;
  }
  
  .definition-box .col-md-6 {
    margin-bottom: 0.5rem;
  }
}

/* Print styles */
@media print {
  .math-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .math-step {
    box-shadow: none;
    border: 1px solid #dee2e6;
  }
}
<!-- AJAX loading spinner -->
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
}
<!-- table copied from Wikipedia. -->
.container {
	max-width: 1200px;
	margin: 0 auto;
	background: white;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h4 {
	text-align: center;
	color: #333;
	margin-bottom: 30px;
}
table {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
}
th, td {
	padding: 12px;
	text-align: left;
	border: 1px solid #ddd;
}
th {
	background-color: #f8f9fa;
	font-weight: bold;
	color: #333;
}
tr:nth-child(even) {
	background-color: #f9f9f9;
}
.degree {
	text-align: center;
	font-weight: bold;
}
.polynomial {
	font-family: 'Courier New', monospace;
	font-size: 0.9em;
}
.extrema {
	font-family: 'Courier New', monospace;
	font-size: 0.9em;
}
.error {
	text-align: right;
	font-family: 'Courier New', monospace;
}
.fraction {
	display: inline-block;
	text-align: center;
	vertical-align: middle;
}
.fraction .num {
	display: block;
	border-bottom: 1px solid black;
	padding-bottom: 2px;
}
.fraction .den {
	display: block;
	padding-top: 2px;
}

.math-box {
    background: #f8f9fa;
    padding: 18px;
    border-left: 4px solid #007bff;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
    font-size: 1.1em;
}

.important-theorem {
    background: #e7f3ff;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #b8daff;
    margin: 20px 0;
    font-size: 1.05em;
}

.algorithm-steps ol {
    background: #f4f4f9;
    padding: 20px 40px;
    border-radius: 8px;
    margin: 20px 0;
}

.algorithm-steps li {
    margin-bottom: 16px;
}

.note {
    color: #5a5a5a;
    font-style: italic;
    margin-top: 20px;
}