/* Model Lab (#/models) */
.ml-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ml-switch, .ml-segs { display: flex; gap: 4px; flex-wrap: wrap; }
.ml-switch, .ml-segs { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 2px; }
.ml-switch a, .ml-seg {
  padding: 7px 14px; border-radius: 999px; border: 0; background: none;
  color: var(--text-2); font: 600 13.5px/1.2 var(--font-text); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.ml-switch a:hover, .ml-seg:hover:not(:disabled) { color: var(--text); background: var(--surface-3); }
.ml-switch a[aria-current], .ml-seg[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.ml-seg:disabled { opacity: .45; cursor: default; }
.ml-note { margin: -6px 0 14px; }

.ml-scroll { margin: 0 -22px; padding: 0 22px; max-width: calc(100% + 44px); }
@media (max-width: 640px) { .ml-scroll { margin: 0 -16px; padding: 0 16px; max-width: calc(100% + 32px); } }
.ml-board td, .ml-dis td, .ml-board th, .ml-dis th { white-space: nowrap; }
.ml-board .ml-best { color: var(--good-text); }
.ml-best-key { color: var(--good-text); }
.ml-board tr.ml-elo td { background: var(--accent-soft); }
.ml-board tr.ml-baseline td { color: var(--muted); }
.ml-board tr.ml-baseline .ml-name { color: var(--text-2); }
.ml-name { color: var(--text); text-decoration: none; font-weight: 600; }
.ml-name:hover { text-decoration: underline; }

.ml-explain p { margin: 0 0 12px; color: var(--text-2); font-size: 14.5px; padding-left: 12px; border-left: 3px solid var(--border); }
.ml-explain b { color: var(--text); }

.ml-multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 20px; }
.ml-panel { margin: 0; min-width: 0; background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px 8px; }
.ml-panel figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; margin-bottom: 4px; }

.ml-game { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.ml-game .logo { width: 18px; height: 18px; }
.ml-dis td.ml-hi, .ml-dis td.ml-lo { box-shadow: inset 0 0 0 1.5px var(--border); border-radius: 6px; font-weight: 700; }
.ml-dis td.ml-hi { box-shadow: inset 0 0 0 1.5px var(--series-1); }
.ml-dis td.ml-lo { box-shadow: inset 0 0 0 1.5px var(--muted); }
.ml-dis td.ml-ens { background: var(--accent-soft); font-weight: 700; }
.ml-dis td.ml-away { color: var(--text-2); }

.ml-models .card-head { margin-bottom: 6px; }
.ml-models h3 { font-size: 18px; }
.ml-model { scroll-margin-top: 90px; }
.ml-model:target { border-color: var(--accent); box-shadow: var(--ring); }
.ml-model p { margin: 0 0 8px; color: var(--text-2); font-size: 14px; }
.ml-model .ml-why b { color: var(--text); }
.ml-chips { display: flex; flex-wrap: wrap; gap: 4px; }

@media (max-width: 640px) {
  .ml-bar { flex-direction: column; align-items: stretch; }
  .ml-switch, .ml-segs { border-radius: var(--radius); }
  .ml-multiples { grid-template-columns: 1fr; }
}
