.ai-llm-scope .mf-formula {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 2;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}
.ai-llm-scope .mf-table-scroll {
  width: 100%;
  overflow-x: auto;
  margin: 22px 0;
}
.ai-llm-scope .mf-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper-card);
}
.ai-llm-scope .mf-table caption {
  text-align: left;
  padding-bottom: 10px;
  font-weight: 700;
  color: var(--ink-soft);
}
.ai-llm-scope .mf-table th,
.ai-llm-scope .mf-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  min-width: 58px;
}
.ai-llm-scope .mf-table th { background: var(--paper-deep); font-weight: 600; }
.ai-llm-scope .mf-table .mf-focus { background: var(--accent-wash); color: var(--accent-deep); }
.ai-llm-scope .mf-lab {
  margin: 26px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--paper-card);
  min-width: 0;
}
.ai-llm-scope .mf-lab-title {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 18px;
  line-height: 1.6;
}
.ai-llm-scope .mf-controls,
.ai-llm-scope .mf-weights {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
}
.ai-llm-scope .mf-controls label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 190px;
  min-width: 0;
}
.ai-llm-scope .mf-controls label:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  align-self: center;
}
.ai-llm-scope .mf-controls select,
.ai-llm-scope .mf-controls input[type="number"],
.ai-llm-scope .mf-weights input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.ai-llm-scope .mf-controls input[type="range"] { width: 100%; height: 38px; accent-color: var(--accent); }
.ai-llm-scope .mf-controls button {
  height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-deep);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.ai-llm-scope .mf-controls button:hover { border-color: var(--accent); color: var(--accent-deep); }
.ai-llm-scope .mf-controls button:disabled {
  color: var(--ink-faint);
  border-color: var(--line);
  cursor: not-allowed;
}
.ai-llm-scope .mf-lab :is(button,select,input):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.ai-llm-scope .mf-matrices { min-width: 0; }
.ai-llm-scope .mf-matrices .mf-table { font-family: var(--mono); }
.ai-llm-scope .mf-result,
.ai-llm-scope .mf-equation,
.ai-llm-scope .mf-sampling {
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  margin-top: 14px;
}
.ai-llm-scope .mf-result.mf-error { color: var(--accent-deep); font-weight: 600; }
.ai-llm-scope .mf-chart-wrap { width: 100%; height: 300px; margin-top: 22px; }
.ai-llm-scope .mf-function-chart { display: block; width: 100%; height: 100%; }
.ai-llm-scope .mf-weights { margin-top: 18px; }
.ai-llm-scope .mf-weights label { flex: 1 1 65px; min-width: 0; display: grid; gap: 6px; }
.ai-llm-scope .mf-bar-track { width: 100%; min-width: 84px; height: 12px; background: var(--paper-deep); }
.ai-llm-scope .mf-bar { height: 12px; background: var(--accent); }
.ai-llm-scope .mf-table .mf-prob-cell { min-width: 95px; font-family: var(--mono); }
.ai-llm-scope .lesson-content { min-width: 0; }
@media (max-width: 640px) {
  .ai-llm-scope .mf-lab { padding: 16px 12px; }
  .ai-llm-scope .mf-controls label { flex-basis: 100%; }
  .ai-llm-scope .mf-table th,
  .ai-llm-scope .mf-table td { padding: 8px; }
  .ai-llm-scope .mf-chart-wrap { height: 260px; }
  .ai-llm-scope .lesson-nav-footer { flex-wrap: wrap; gap: 12px; }
  .ai-llm-scope .lesson-nav-footer a { max-width: 100%; overflow-wrap: anywhere; }
}
