.rhythm-tap-dialog { width:min(720px,calc(100vw - 28px)); }
.rhythm-tap { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; gap:12px; }
.rhythm-tap p { margin:0; }
.rhythm-tap-controls { display:grid; gap:8px; }
.rhythm-tap-scope { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.rhythm-tap-method { display:grid; grid-template-columns:minmax(0,1fr) 74px; gap:12px; }
.rhythm-tap-range { display:flex; gap:14px; align-items:center; }
.rhythm-tap-range label { flex:1; }
#dialog.rhythm-tap-dialog .dialog-body .rhythm-tap-range input { width:100%; min-width:0; min-height:44px; }
.rhythm-tap-controls .rhythm-tap-listen-first { min-height:44px; }
.rhythm-tap-controls .rhythm-tap-method label { flex-direction:column; align-items:stretch; gap:4px; }
.rhythm-tap-method select { width:100%; }
.rhythm-tap-controls label { display:flex; align-items:center; gap:8px; font-size:12px; min-width:0; }
.rhythm-tap-controls select { min-width:0; max-width:100%; min-height:44px; }
#dialog.rhythm-tap-dialog .rhythm-tap-controls select { min-height:44px; }
.rhythm-tap-count { color:var(--muted); font:12px var(--mono); font-variant-numeric:tabular-nums; white-space:nowrap; }
.rhythm-tap-reference-area { display:grid; gap:7px; }
.rhythm-tap-anchor { color:var(--muted); font-size:12px; }
.rhythm-tap-timeline { display:grid; grid-template-columns:54px minmax(0,1fr); gap:8px; height:49px; }
.rhythm-tap-timeline-labels { display:grid; align-items:center; color:var(--muted); font-size:10px; }
.rhythm-tap-timeline-tracks { position:relative; margin:2px 5px; border-inline:1px solid var(--border); }
.rhythm-tap-rail { position:absolute; left:0; right:0; height:1px; background:var(--border); }
.rhythm-tap-reference { top:25%; color:var(--muted); }
.rhythm-tap-tapped { top:75%; color:var(--selection); }
.rhythm-tap-marker { position:absolute; top:50%; width:7px; height:11px; transform:translate(-50%,-50%); border-radius:2px; background:currentColor; }
.rhythm-tap-tapped .rhythm-tap-marker { width:8px; height:12px; }
.rhythm-tap-ruler > span { position:absolute; top:0; bottom:0; border-left:1px dashed var(--border); }
.rhythm-tap-playhead { position:absolute; top:0; bottom:0; width:2px; background:var(--play); transform:translateX(-50%); pointer-events:none; }
.rhythm-tap-playhead::before { content:''; position:absolute; width:6px; height:6px; left:-2px; top:-2px; border-radius:50%; background:var(--play); }
.rhythm-tap-capture { display:grid; gap:7px; }
.rhythm-tap-instructions { font-size:12px; }
.rhythm-tap-pad { display:flex; flex-direction:column; gap:5px; width:100%; min-height:96px; border:2px solid var(--selection); background:var(--selection-bg); color:var(--ink); border-radius:12px; touch-action:manipulation; user-select:none; -webkit-user-select:none; }
.rhythm-tap-pad:hover { background:var(--selection-bg); }
.rhythm-tap-pad:active { transform:none; box-shadow:inset 0 0 0 2px var(--selection); }
.rhythm-tap-pad > .icon { width:24px; height:24px; color:var(--selection); }
.rhythm-tap-pad strong { font-size:20px; font-weight:650; }
.rhythm-tap-pad > span { font-size:12px; color:var(--muted); }
.rhythm-tap-pad[aria-disabled=true] { border-style:dashed; }
.rhythm-tap-pad[data-phase=listen] { border-color:var(--play); background:color-mix(in srgb,var(--play) 10%,var(--panel)); }
.rhythm-tap-progress { text-align:center; font-size:12px; color:var(--muted); min-height:18px; font-variant-numeric:tabular-nums; }
.rhythm-tap-error { padding:9px 11px; border:1px solid var(--danger); background:color-mix(in srgb,var(--danger) 8%,var(--canvas)); border-radius:8px; font-size:12px; }
.rhythm-tap-restart,.rhythm-tap-listen { display:flex; flex-wrap:wrap; gap:8px; }
#dialog.rhythm-tap-dialog .rhythm-tap-restart button,#dialog.rhythm-tap-dialog .rhythm-tap-listen button { min-height:44px; }
.rhythm-tap-listen { border-top:1px solid var(--border); padding-top:10px; }
.rhythm-tap-preview { color:var(--play); }
#dialog.rhythm-tap-dialog .dialog-footer .rhythm-tap-listen { margin-right:auto; border:0; padding:0; }
.rhythm-tap-notes,.rhythm-tap-options { border-top:1px solid var(--border); padding-top:5px; min-width:0; }
.rhythm-tap-notes > summary,.rhythm-tap-options > summary { cursor:pointer; font-size:12px; min-height:44px; align-content:center; }
.rhythm-tap-options > label { display:flex; align-items:flex-start; gap:9px; margin:9px 0 4px; font-size:12px; min-height:44px; }
.rhythm-tap-options input { flex-shrink:0; width:17px; height:17px; margin:2px 0 0; }
.rhythm-tap-options small { display:block; margin-top:3px; color:var(--muted); font-size:11px; max-width:62ch; }
.rhythm-tap-fine { color:var(--muted); font-size:11px; }
.rhythm-tap-strip { display:flex; gap:8px; list-style:none; padding:7px 2px 12px; margin:0; overflow-x:auto; scrollbar-width:thin; }
.rhythm-tap-attack { display:flex; flex-direction:column; align-items:center; gap:4px; flex:0 0 72px; padding:6px 7px; border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.rhythm-tap-number { font:600 11px var(--mono); color:var(--muted); }
.rhythm-tap-attack > small { color:var(--muted); font-size:10px; }
.rhythm-tap-attack[data-state=next] { border-color:var(--selection); box-shadow:0 0 0 1px var(--selection); background:var(--selection-bg); }
.rhythm-tap-attack[data-state=done] .rhythm-tap-number { color:var(--selection); }
.rhythm-tap-attack[data-state=done] .rhythm-tap-number::after { content:' ✓'; }
.rhythm-tap-tab { display:grid; grid-template-rows:repeat(var(--tap-strings),11px); width:48px; padding:3px 0; }
.rhythm-tap-tab > span { display:grid; place-items:center; position:relative; font:11px var(--mono); }
.rhythm-tap-tab > span::before { content:''; position:absolute; left:0; right:0; top:50%; border-top:1px solid var(--line,var(--border)); }
.rhythm-tap-tab b { position:relative; z-index:1; background:var(--surface); padding:0 3px; font-weight:600; color:var(--ink); }
.rhythm-tap-attack[data-state=next] .rhythm-tap-tab b { background:var(--selection-bg); }
.rhythm-tap-piano { min-height:80px; display:flex; flex-direction:column; align-items:center; justify-content:center; font:11px/1.7 var(--mono); }
.rhythm-tap [hidden] { display:none !important; }
@media(max-width:600px) {
  .rhythm-tap-scope label { flex-wrap:wrap; gap:4px 8px; }
  .rhythm-tap-scope select { flex:1 1 160px; }
  .rhythm-tap-method { gap:8px; }
  .rhythm-tap-method label:first-child { flex:1; }
  .rhythm-tap-method label:first-child select { flex:1; }
  .rhythm-tap-listen button { flex:1 1 auto; }
  #dialog.rhythm-tap-dialog .dialog-footer .rhythm-tap-listen { flex:1 0 100%; }
  .rhythm-tap-attack { flex-basis:66px; }
  #dialog.rhythm-tap-dialog .dialog-footer button { min-height:44px; }
  .rhythm-tap-notes > summary,.rhythm-tap-options > summary { min-height:44px; }
}
@media(max-height:500px) and (min-width:560px) {
  #dialog.rhythm-tap-dialog { width:min(780px,calc(100vw - 16px)); max-height:calc(100dvh - 12px); }
  #dialog.rhythm-tap-dialog .dialog-header { padding:9px 16px; }
  #dialog.rhythm-tap-dialog .dialog-header h2 { font-size:18px; }
  #dialog.rhythm-tap-dialog .dialog-body { padding:10px 16px; }
  #dialog.rhythm-tap-dialog .dialog-footer { padding:8px 16px; }
  #dialog.rhythm-tap-dialog .dialog-footer button { min-height:44px; }
  .rhythm-tap { grid-template-columns:minmax(0,1fr) minmax(0,1.05fr); gap:8px 16px; align-items:start; }
  .rhythm-tap-controls { grid-column:1; grid-row:1; }
  .rhythm-tap-reference-area { grid-column:1; grid-row:2; }
  .rhythm-tap-capture { grid-column:2; grid-row:1 / span 2; position:sticky; top:0; background:var(--panel); }
  .rhythm-tap-listen { grid-column:2; grid-row:3; padding-top:5px; }
  .rhythm-tap-notes { grid-column:1; grid-row:3; }
  .rhythm-tap-options { grid-column:1; grid-row:4; }
  .rhythm-tap-overlay-note { grid-column:1 / -1; }
  .rhythm-tap-controls label { flex-wrap:wrap; gap:3px 6px; font-size:11px; }
  .rhythm-tap-controls select { flex:1; }
  .rhythm-tap-method { gap:7px; }
  .rhythm-tap-method label:first-child { flex:1; }
  .rhythm-tap-timeline { height:38px; }
  .rhythm-tap-pad { min-height:88px; }
  .rhythm-tap-pad > .icon { width:20px; height:20px; }
  .rhythm-tap-pad strong { font-size:18px; }
  .rhythm-tap-restart,.rhythm-tap-listen { gap:6px; }
  .rhythm-tap-restart button,.rhythm-tap-listen button { padding:7px 9px; font-size:11px; }
}
