/* ==========================================================================================================
   mm-audio.css — audio laboratory (/lab/audio). Loaded after site.css and labs.css; uses their tokens only.
   ========================================================================================================== */
.mm-synth { margin: 0 0 16px; max-width: 110ch; }
.mm-synth p { margin: 0; font-size: 0.9375rem; line-height: 1.5; }

/* controls rail */
.mm-eps-row { display: grid; grid-template-columns: minmax(0, 1fr) 5.4rem; gap: 8px; align-items: center; }
.mm-eps-row input[type="number"] { text-align: center; font-variant-numeric: tabular-nums; font-weight: 650; min-height: 34px; }
.eps-preset[data-stored="1"]::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--mod-ui); display: inline-block; }
.eps-preset[aria-pressed="true"][data-stored="1"]::after { background: currentColor; }
.wb-controls .seg label { padding: 0 4px; }

/* waveform, perturbation and spectrograms */
.mm-canvas { display: block; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); touch-action: pan-y; cursor: crosshair; }
.mm-canvas.wave { height: 172px; }
.mm-canvas.delta { height: 84px; margin-top: 6px; }
.mm-canvas.spec { height: 150px; image-rendering: pixelated; background: #000; }
.mm-wavefig, .mm-specfig { gap: 8px; }
.mm-spec3 { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .mm-spec3 { grid-template-columns: minmax(0, 1fr); } .mm-canvas.spec { height: 120px; } }
.mm-spec { min-width: 0; }
.mm-spec-h { margin: 0 0 4px; font-size: 0.8125rem; font-weight: 650; color: var(--ink-2); }
.mm-inline-l { font-size: var(--t-meta); color: var(--muted); font-weight: 600; margin-right: 6px; }
.fig-tools select { width: auto; min-height: 32px; font-size: 0.8125rem; }
.mm-key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--muted); vertical-align: middle; margin: 0 5px 0 2px; }
.mm-key.k-adv { border-top-color: var(--mod-vivid); }
.mm-key.k-delta { border-top-color: var(--coral-vivid); }

/* playback */
.mm-play { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 8px; background: var(--surface); }
.mm-play-h { margin: 0; font-size: 0.875rem; color: var(--ink-2); }
.mm-play-h .aside { color: var(--faint); font-size: var(--t-meta); margin-left: 6px; }
.mm-play .btn[aria-pressed="true"] { background: var(--mod-soft); border-color: var(--mod-ui); color: var(--mod); }
.mm-play-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.mm-play-opts input[type="range"] { width: 160px; height: 28px; }

/* predictions with per-class scores */
.mm-probs-wrap { margin-top: 8px; border-radius: 8px; }
table.mm-probs { font-size: 0.8125rem; }
table.mm-probs th, table.mm-probs td { padding: 0.28rem 0.5rem; }
table.mm-probs caption { padding: 0.35rem 0.5rem; font-size: 0.75rem; }
table.mm-probs tbody th { background: transparent; font-weight: 500; color: var(--ink-2); position: static; }
table.mm-probs tr.is-true th { color: var(--ink); font-weight: 650; }
.mm-control-line { margin: 0; font-size: 0.875rem; color: var(--ink-2); line-height: 1.5; max-width: none; }
.mm-ctl-tag { display: inline-block; font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 5px; padding: 0 5px; margin-right: 4px; }
.mm-block-h { margin: 0 0 8px; font-size: 0.9375rem; }
.mm-alt { margin: 0; font-size: 0.875rem; line-height: 1.6; max-width: 100ch; }
.mm-exports { padding-top: 4px; border-top: 1px solid var(--line); }

/* population */
.mm-pop-grid { display: grid; gap: 24px 36px; grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: 26px; }
@media (min-width: 1180px) { .mm-pop-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); } }
.mm-pop-side { display: grid; gap: 14px; min-width: 0; }
.mm-pop-side .stat-row.c5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .mm-pop-side .stat-row.c5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mm-pop-side .stat-row.c5 > .stat { padding-left: 14px; border-left: 1px solid var(--line); }
.mm-pop-side .stat-row.c5 > .stat:nth-child(2n+1) { padding-left: 0; border-left: 0; }
@media (min-width: 640px) { .mm-pop-side .stat-row.c5 > .stat:nth-child(2n+1) { padding-left: 14px; border-left: 1px solid var(--line); } .mm-pop-side .stat-row.c5 > .stat:nth-child(3n+1) { padding-left: 0; border-left: 0; } }
.mm-live { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.mm-live .btn { justify-self: start; }
.mm-concl h3 { margin-top: 0; font-size: 1.0625rem; }
.mm-refs { padding-left: 1.1rem; }
.mm-refs li { margin-bottom: 8px; font-size: 0.9375rem; }

/* grid figures: a wide data table or chart must scroll inside its own wrapper, never widen the page */
.mm-curvefig > *, .mm-wavefig > *, .mm-specfig > *, .pred-card > *, .mm-pop-side > *, .mm-play > * { min-width: 0; }
