.mf-page { --mf-board-bg: #a7a7a7; --mf-cell-bg: #fff; --mf-cell-filled: #dedede; --mf-cell-green: #40a84b; --mf-cell-wrong: #555; max-width: 62rem; margin: 0 auto; }
.mf-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--gap); }
.mf-heading h1 { margin: 0; font: 500 calc(var(--size-body) * 1.35)/1.2 var(--font-display); }
.mf-instruction { margin: 3px 0 var(--stack); color: var(--fg-muted); }
.mf-message { margin: 6px 0; color: var(--fg-muted); }
.mf-message[data-error="true"] { color: var(--fg); }
.mf-account { margin: 0 0 var(--stack); font: var(--size-ui)/1.5 var(--font-ui); }
.mf-account summary { cursor: pointer; }
.mf-account-status { color: var(--fg-muted); margin-left: 8px; }
.mf-auth { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; margin: 8px 0 0; }
.mf-auth label, .mf-controls label { display: grid; gap: 2px; }
.mf-play { display: grid; gap: 10px; }
.mf-controls { display: flex; align-items: end; justify-content: center; flex-wrap: wrap; gap: 8px 12px; font: var(--size-ui)/1.35 var(--font-ui); }
.mf-controls > span { padding-bottom: 4px; }
.mf-controls strong { font-family: var(--font-mono); font-size: calc(var(--size-ui) * 1.15); }
.mf-board-scroller { width: max-content; max-width: 100%; box-sizing: border-box; margin: 0 auto; overflow-x: auto; background: var(--mf-board-bg); padding: 8px; }
.mf-board { --mf-cols: 16; --mf-cell: 36px; display: grid; grid-template-columns: repeat(var(--mf-cols), minmax(0, 1fr)); gap: 8px; width: calc(var(--mf-cols) * var(--mf-cell) + (var(--mf-cols) - 1) * 8px); margin: 0 auto; }
.mf-board[data-layout="square"] { --mf-cols: 10; width: min(100%, calc(10 * var(--mf-cell) + 9 * 8px)); }
.mf-board[data-layout="tall"] { --mf-cols: 5; width: min(100%, calc(5 * var(--mf-cell) + 4 * 8px)); }
.mf-board[data-size="compact"] { --mf-cell: 29px; }
.mf-board[data-size="standard"] { --mf-cell: 36px; }
.mf-board[data-size="large"] { --mf-cell: 44px; }
.mf-cell { aspect-ratio: 1; min-width: 0; padding: 0; border: var(--hair); border-radius: var(--radius); background: var(--mf-cell-bg); color: var(--fg); font: 600 var(--size-ui)/1 var(--font-ui); cursor: pointer; }
.mf-board[data-layout="classic"] .mf-cell:nth-child(97) { grid-column: 7; }
.mf-cell:disabled { cursor: default; }
.mf-cell.is-correct { background: var(--mf-cell-filled); }
.mf-cell.is-correct.is-green_hidden { background: var(--mf-cell-green); border-color: var(--mf-cell-green); }
.mf-cell.is-correct.is-numbers_visible { background: var(--mf-cell-filled); color: var(--fg); }
.mf-cell.is-wrong { background: var(--mf-cell-wrong); color: var(--bg); }
.mf-cell:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.mf-result { border-top: var(--hair); padding-top: 8px; text-align: center; }
.mf-result h2 { margin: 0 0 5px; font: 500 calc(var(--size-body) * 1.15)/1.2 var(--font-display); }
.mf-metrics { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin: 0; }
.mf-metrics div { display: flex; gap: 5px; }
.mf-metrics dt { color: var(--fg-muted); }
.mf-metrics dd { margin: 0; font-variant-numeric: tabular-nums; }
.mf-stats-page section { margin: var(--stack) 0; }
.mf-stats-page h2 { font: 500 calc(var(--size-body) * 1.15)/1.3 var(--font-display); border-bottom: var(--hair); }
.ps-filters { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; font: var(--size-ui)/1.4 var(--font-ui); }
.ps-chart { min-width: 0; margin: 14px 0 22px; }
.ps-chart h3 { margin: 0 0 4px; font: 500 var(--size-body)/1.3 var(--font-display); }
.ps-chart svg { display: block; width: 100%; max-height: 280px; overflow: visible; }
.ps-axis { stroke: var(--fg-muted); stroke-width: 1; }
.ps-tick, .ps-label { fill: var(--fg-muted); font: 11px var(--font-ui); }
.ps-bar { fill: currentColor; opacity: .72; }
.ps-line { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; }
.ps-dot { fill: currentColor; }
.ps-empty { fill: var(--fg-muted); font: var(--size-ui) var(--font-ui); }
.ps-chart-data { margin-top: 4px; font: var(--size-ui)/1.4 var(--font-ui); }
.ps-chart-data summary { cursor: pointer; color: var(--fg-muted); }
.mf-stats-link { margin: 4px 0 8px; }
.mf-table-wrap { max-width: 100%; overflow-x: auto; }
.mf-table { width: 100%; border-collapse: collapse; font: var(--size-ui)/1.4 var(--font-ui); }
.mf-table th, .mf-table td { padding: 4px 7px; text-align: left; border-bottom: var(--hair); white-space: nowrap; }
.mf-run-link { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mf-run-link:hover { color: var(--fg-muted); }
.mf-events { max-height: 22rem; overflow: auto; }
.mf-timing-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; font: var(--size-ui)/1.4 var(--font-ui); }
.mf-timing-controls label { display: grid; gap: 3px; }
.mf-timing-controls input[type="number"] { width: 5rem; box-sizing: border-box; }
.mf-timing-controls .mf-timing-check { display: flex; align-items: center; gap: 6px; flex-basis: 100%; }
.mf-timing-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.mf-timing-metrics { justify-content: flex-start; }
.mf-timing-history { margin: 14px 0; }
.mf-timing-history > summary { cursor: pointer; }
.mf-timing-detail h3, #mfs-timing h3 { font: 500 var(--size-body)/1.3 var(--font-display); margin: 18px 0 6px; }
.mf-timing-history .mf-table-wrap { max-height: 30rem; overflow: auto; }
@media (max-width: 600px) {
  .mf-board-scroller:has(.mf-board[data-layout="classic"]) { width: 100%; }
  .mf-board[data-layout="classic"] { width: calc(16 * var(--mf-cell) + 15 * 8px); margin: 0; }
  .mf-board[data-layout="classic"] .mf-cell { width: var(--mf-cell); }
  .mf-board-scroller:has(.mf-board[data-layout="classic"]) { overflow-x: auto; }
  .mf-board-scroller:has(.mf-board[data-layout="square"]) { width: 100%; }
  .mf-board[data-layout="square"] { width: 100%; }
  .mf-controls { justify-content: flex-start; }
}
