/* Online metronome */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt label { font-weight: 600; margin-bottom: .25rem; }
.mt-display { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .5rem 0 1rem; }
.mt-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; padding: .5rem; border-radius: 1rem; transition: background-color 60ms; }
.mt-dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); }
.mt-dot-accent { border-color: var(--accent); }
.mt-dot.mt-on { background: var(--ink); border-color: var(--ink); }
.mt-dot-accent.mt-on { background: var(--accent); border-color: var(--accent); }
.mt-dots.mt-sub-flash { background: #2f2c48; }
.mt-beat { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; min-height: 1.6em; }

.mt-tempo { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem 1.5rem; align-items: end; }
.mt-stepper { display: flex; gap: .4rem; align-items: stretch; }
.mt-stepper button { min-width: 48px; font-size: 1.4rem; line-height: 1; margin: 0; }
#mt-bpm { width: 6.5ch; min-width: 5.5rem; font-size: 1.8rem; text-align: center; margin: 0; font-variant-numeric: tabular-nums; }
.mt-slider input { width: 100%; margin: 0; }
input[type="range"] { min-height: 44px; padding: 0; }

.mt-actions { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: 1.25rem 0; }
.mt-actions button { margin: 0; min-width: 8.5rem; font-size: 1.15rem; min-height: 52px; }
.mt-start.mt-running { background: var(--ink); }
.mt-tap { background: transparent; color: var(--ink); border: 2px solid var(--accent); }
.mt-tap-count { color: var(--muted); }

.mt-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: .75rem 1rem; align-items: end; }
.mt-options select, .mt-options input[type="range"] { width: 100%; margin: 0; }
.mt-check { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
.mt-check label { margin: 0; padding: .6rem 0; cursor: pointer; }
.mt-check input[type="checkbox"] { min-height: 0; width: 1.5rem; height: 1.5rem; margin: 0; flex: none; }
.mt-status { margin: 1rem 0 0; color: var(--ink); }
input[aria-invalid="true"] { border-color: #ff8a8a; }
.mt-limit { font-size: .92rem; }

@media (max-width: 650px) {
  .mt-tempo { grid-template-columns: minmax(0, 1fr); }
  #mt-bpm { flex: 1; width: auto; min-width: 0; }
  .mt-actions button { flex: 1 1 8rem; }
}

/* Visible track and thumb for the range inputs (the base styles remove the native look). */
.mt input[type="range"] { background: transparent; border: 0; cursor: pointer; }
.mt input[type="range"]::-webkit-slider-runnable-track { height: .45rem; border-radius: 1rem; background: var(--line); }
.mt input[type="range"]::-moz-range-track { height: .45rem; border-radius: 1rem; background: var(--line); }
.mt input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1.5rem; height: 1.5rem; margin-top: -.53rem; border-radius: 50%; background: var(--accent); border: 2px solid var(--paper); }
.mt input[type="range"]::-moz-range-thumb { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent); border: 2px solid var(--paper); }
.mt input[type="range"]:focus-visible { outline: 3px solid white; outline-offset: 3px; }
