/* ML article only. Load after the unchanged style.css and byte-explains.css. */
.ml-page [hidden] { display: none !important; }
.ml-page .ml-anchor { display: block; height: 0; }
.ml-page .article-content h3 { margin: 32px 0 18px; color: var(--byte-navy); font-size: 23px; line-height: 1.3; }
.ml-page .ml-controls { margin: 24px 0; }
.ml-page .ml-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 20px; border: 2px solid var(--byte-blue); border-radius: 8px; background: var(--byte-blue); color: #fff; font: 600 16px/1.4 var(--body); cursor: pointer; }
.ml-page .ml-button:hover { background: var(--byte-navy); border-color: var(--byte-navy); }
.ml-page .ml-button-secondary { background: #fff; color: var(--byte-blue); }
.ml-page .ml-button-secondary:hover { background: var(--byte-light); color: var(--byte-navy); }
.ml-page .ml-button[aria-disabled="true"] { background: var(--byte-light); color: var(--byte-navy); cursor: default; }
.ml-page .ml-help { font-size: 14px; margin: 10px 0 0; }
.ml-page .ml-predictions { padding: 20px; margin: 28px 0; border: 1px solid var(--byte-blue); border-radius: 10px; background: var(--byte-light); }
.ml-page .ml-predictions fieldset { min-width: 0; margin: 20px 0; padding: 16px; border: 1px solid var(--byte-blue); border-radius: 8px; background: #fff; }
.ml-page .ml-predictions legend { padding: 0 6px; color: var(--byte-navy); font-weight: 600; line-height: 1.5; }
.ml-page .ml-options, .ml-page .ml-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ml-page .ml-options label { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 44px; border: 1px solid var(--byte-blue); border-radius: 6px; cursor: pointer; }
.ml-page .ml-options label:has(input:checked) { background: var(--byte-light); box-shadow: inset 0 0 0 1px var(--byte-blue); }
.ml-page .ml-options input { width: 20px; height: 20px; margin: 0; accent-color: var(--byte-blue); flex: 0 0 20px; }
.ml-page .ml-feedback { font-size: 15px; margin: 14px 0 0; }
.ml-page .ml-row-note { display: block; font-size: 13px; font-weight: 400; margin-top: 6px; }
.ml-page tr.ml-training-mistake > * { background: var(--byte-light); }
.ml-page tr.ml-selected-rule > * { background: var(--byte-light); font-weight: 700; }
.ml-page .ml-training-mistake > th { box-shadow: inset 4px 0 var(--byte-yellow); }
.ml-page .ml-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ml-page .ml-branch { display: grid; grid-template-rows: auto auto 28px auto auto; align-content: start; gap: 10px; min-width: 0; }
.ml-page .ml-context, .ml-page .ml-model-input, .ml-page .ml-rule, .ml-page .ml-output { padding: 14px; border: 1px solid var(--byte-blue); border-radius: 8px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ml-page .ml-context { border-style: dashed; min-height: 154px; }
.ml-page .ml-model-input { background: var(--byte-light); }
.ml-page .ml-branch strong, .ml-page .ml-branch span { display: block; }
.ml-page .ml-figure-label { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.ml-page .ml-context strong, .ml-page .ml-rule strong, .ml-page .ml-output strong { margin-bottom: 6px; }
.ml-page .ml-arrow { text-align: center; font-size: 24px; line-height: 28px; color: var(--byte-navy); }
.ml-page .ml-output { border-top: 4px solid var(--byte-cyan); }
.ml-page .ml-output-mistake { border-top-color: var(--byte-yellow); }
/* The inherited footer label colour falls short of text contrast; scoped correction. */
.ml-page .footer-col h4, .ml-page .footer-bottom { color: var(--text-lo); }
@media (max-width: 600px) {
  .ml-page .ml-comparison { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .ml-page .ml-context { min-height: 0; }
  .ml-page .ml-predictions { padding: 12px; }
  .ml-page .ml-predictions fieldset { padding: 12px; }
  .ml-page .article-content h3 { font-size: 21px; }
}
@media print {
  .ml-page #ml-training-outcome[hidden], .ml-page #ml-inference[hidden], .ml-page #ml-worked-answer[hidden], .ml-page #data[hidden] { display: block !important; }
  .ml-page .ml-controls, .ml-page #ml-predictions, .ml-page .ml-row-note { display: none !important; }
  .ml-page .ml-comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
