.mt { display: grid; gap: 26px; border-radius: var(--radius); transition: background-color 0.08s; }
.mt > * { min-width: 0; }
.mt-top { display: flex; justify-content: flex-end; }
.mt .kv-msg { margin: 0; }

/* Tempos do compasso */
.mt-stage { display: grid; gap: 14px; justify-items: center; text-align: center; }
.mt-beats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 640px; }
.mt-beat {
  --size: 56px;
  width: var(--size); height: var(--size); border-radius: 50%; border: 3px solid var(--ink); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: transform 0.06s, background-color 0.06s;
}
.mt-beats[data-count='9'] .mt-beat, .mt-beats[data-count='10'] .mt-beat, .mt-beats[data-count='11'] .mt-beat,
.mt-beats[data-count='12'] .mt-beat, .mt-beats[data-count='13'] .mt-beat, .mt-beats[data-count='14'] .mt-beat,
.mt-beats[data-count='15'] .mt-beat, .mt-beats[data-count='16'] .mt-beat { --size: 44px; font-size: 1rem; }
.mt-beat[data-state='accent'] { background: var(--kit-soft); box-shadow: inset 0 0 0 5px var(--kit); }
.mt-beat[data-state='mute'] { border-style: dashed; color: var(--muted); border-color: var(--line); }
.mt-beat.is-now { background: var(--ink); color: var(--surface); transform: scale(1.12); box-shadow: none; }
.mt-beat[data-state='accent'].is-now { background: var(--kit); color: #14213d; }
.mt-beat[data-state='mute'].is-now { background: var(--line); color: var(--ink); }
.mt-beats-hint { margin: 0; }

/* Andamento */
.mt-bpm-row { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.mt-step { width: 58px; height: 58px; padding: 0; font-size: 1.8rem; line-height: 1; border-radius: 50%; touch-action: manipulation; user-select: none; }
.mt-bpm-box { display: grid; justify-items: center; }
.mt-bpm {
  width: 3.3ch; padding: 0; border: 0; background: none; color: var(--ink); text-align: center;
  font: inherit; font-size: clamp(3.4rem, 2.2rem + 7vw, 5.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield;
}
.mt-bpm::-webkit-outer-spin-button, .mt-bpm::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mt-bpm:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 8px; }
.mt-bpm-unit { font-weight: 750; font-size: 0.95rem; letter-spacing: 0.08em; color: var(--muted); }
.mt-tempo-name { margin: 0; font-weight: 700; font-style: italic; color: var(--muted); min-height: 1.5em; }
.mt-slider { max-width: 520px; }

.mt-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 4px; }
.mt-buttons .kv-btn--big { min-width: 150px; touch-action: manipulation; }
.mt-tap.is-tapped { animation: mt-tap 0.18s; }
@keyframes mt-tap { from { transform: scale(0.94); } to { transform: none; } }
.mt-bar { margin: 0; min-height: 1.5em; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Piscar no tempo 1 */
.mt.is-flash { background-color: var(--kit-soft); }

/* Ajustes */
.mt-extra { display: grid; gap: 26px; border-top: 2px solid var(--line); padding-top: 22px; }
@media (min-width: 860px) { .mt-extra { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; } }
.mt-panel { display: grid; gap: 14px; align-content: start; }
.mt-panel h2 { font-size: 1.1rem; font-weight: 720; margin: 0; }
.mt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mt-mini { display: inline-flex; align-items: center; gap: 8px; }
.mt-mini-val { min-width: 2ch; text-align: center; font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.mt-seg { display: grid; grid-template-columns: 1fr 1fr; }
.mt-seg span { padding: 8px 11px; font-size: 0.95rem; text-align: center; border-left: 0; }
.mt-seg label:nth-child(even) span { border-left: 2px solid var(--ink); }
.mt-seg label:nth-child(n+3) span { border-top: 2px solid var(--ink); }
.mt-trainer-line { margin: 0; line-height: 2.7; color: var(--muted); }
.mt-num { width: 64px; min-height: 0; height: 38px; padding: 4px 8px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.mt-num--wide { width: 76px; }

/* Tela cheia */
.mt:fullscreen { background: var(--surface); padding: 24px 32px; overflow: auto; align-content: center; }
.mt:fullscreen.is-flash { background-color: var(--kit-soft); }
.mt:fullscreen .mt-extra, .mt:fullscreen .mt-beats-hint { display: none; }
.mt:fullscreen .mt-beat { --size: min(14vw, 13vh); font-size: min(5vw, 5vh); }
.mt:fullscreen .mt-bpm { font-size: min(20vw, 18vh); }
@media (max-width: 600px) {
  .mt-top { display: none; }
  .mt-bpm-row { gap: 8px; }
  .mt-step { width: 50px; height: 50px; }
}
