/* Tap the painted BPM label; existing numeric BPM entry remains independent. */
#machine .bpm-tap-hotspot {
  position: absolute;
  z-index: 165;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}
#machine .bpm-tap-hotspot:hover,
#machine .bpm-tap-hotspot:focus-visible {
  outline: 2px dashed #ff7373;
  background: rgba(255,55,55,.08);
}
#machine .tap-tempo-overlay {
  position: absolute;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2%;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
}
#machine .tap-tempo-overlay[hidden] { display: none !important; }
#machine .tap-tempo-panel {
  box-sizing: border-box;
  width: min(60%, 580px);
  max-height: 84%;
  overflow-y: auto;
  padding: clamp(13px,2.2%,30px);
  border: 1px solid #71ec89;
  border-radius: 14px;
  background: #06170a;
  color: #a3ffb1;
  box-shadow: 0 0 30px rgba(0,255,70,.18);
  font: 700 clamp(12px,.86vw,17px) "Courier New",monospace;
}
#machine .tap-tempo-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(16px,1.5vw,24px);
  letter-spacing: .12em;
}
#machine .tap-tempo-heading button,
#machine .tap-tempo-actions button {
  border: 1px solid #5ecf78;
  border-radius: 7px;
  background: #10381d;
  color: #b9ffbf;
  font: inherit;
  padding: .65em 1em;
  cursor: pointer;
}
#machine .tap-tempo-heading button { font-size: 1.4em; padding: .1em .45em; }
#machine .tap-tempo-panel p { line-height: 1.45; }
#machine .tap-tempo-readouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 15px 0;
}
#machine .tap-tempo-readouts div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 11px;
  border: 1px solid #315b38;
  border-radius: 8px;
  background: #041007;
}
#machine .tap-tempo-readouts span { opacity: .7; font-size: .85em; }
#machine .tap-tempo-readouts strong {
  color: #fb5959;
  font-size: clamp(20px,2.5vw,42px);
  text-shadow: 0 0 10px rgba(255,20,20,.32);
}
#machine .tap-tempo-pad {
  width: 100%;
  min-height: clamp(70px,12vh,120px);
  border: 2px solid #78ff91;
  border-radius: 14px;
  background: #164a27;
  color: white;
  font: 900 clamp(24px,3vw,48px) "Courier New",monospace;
  cursor: pointer;
  touch-action: manipulation;
}
#machine .tap-tempo-pad:active { background: #24763d; }
#machine .tap-tempo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#machine .tap-tempo-actions button { flex: 1; white-space: nowrap; }
#machine .tap-tempo-actions button:disabled { opacity: .4; cursor: not-allowed; }
#machine .tap-tempo-panel button:focus-visible { outline: 3px solid white; outline-offset: 3px; }
#machine .tap-tempo-feedback { min-height: 2.8em; }
@media (max-width: 600px) {
  #machine .tap-tempo-panel { width: 94%; padding: 12px; }
  #machine .tap-tempo-actions button { min-width: 30%; }
}
