.arrange-row{position:relative}
.arrange-drag-handle{position:relative;display:flex;align-items:center;justify-content:center;align-self:flex-start;flex:none;width:24px;height:36px;padding:0;margin:0 -2px 0 -5px;border-radius:3px;color:var(--muted);cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.arrange-drag-handle::before{content:"";position:absolute;inset:-4px -8px}
.arrange-drag-handle svg{width:12px;height:18px;pointer-events:none;fill:currentColor}
.arrange-drag-handle:hover,.arrange-drag-handle[aria-pressed=true]{color:var(--accent);background:var(--accent-soft)}
.arrange-drag-handle[aria-pressed=true],.arrange-is-dragging{cursor:grabbing}
.arrange-drag-handle:disabled{cursor:default;opacity:.35}
.arrange-drag-source{opacity:.3}
.arrange-keyboard-grabbed{outline:2px solid var(--focus);outline-offset:2px}
.arrange-drop-before::before,.arrange-drop-after::after{content:"";position:absolute;left:-4px;right:-4px;height:5px;background:var(--focus);border-radius:4px;box-shadow:0 0 0 2px var(--sheet),0 0 0 3px var(--focus);pointer-events:none;z-index:2}
.arrange-drop-before::before{top:-7px}
.arrange-drop-after::after{bottom:-7px}
.arrange-drag-ghost{position:fixed!important;z-index:2000;margin:0!important;padding:0!important;list-style:none;pointer-events:none;max-height:min(260px,55vh);overflow:hidden;opacity:.97;cursor:grabbing}
.arrange-drag-ghost>.arrange-row{margin:0;border:1px solid var(--accent);background:var(--sheet);box-shadow:0 8px 24px var(--shadow-color)}
.arrange-drag-ghost .arrange-drag-handle{color:var(--accent)}
.arrange-drag-ghost.arrange-outside-drop{opacity:.45}
@media(max-width:600px){
  .arrange-row,#practice-surface .arrange-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:4px 8px;padding:8px 10px 12px}
  .arrange-drag-handle{grid-column:1;grid-row:1;width:44px;height:44px;margin:0;align-self:center}
  .arrange-drag-handle::before{inset:0}
  .arrange-index,#practice-surface .arrange-index{grid-column:2;grid-row:1;min-width:0;font-size:calc(12px * var(--ui-scale))}
  .arrange-row .arrange-move,#practice-surface .arrange-move{grid-column:3;grid-row:1;flex-direction:row;gap:4px}
  .arrange-row .arrange-move button,#practice-surface .arrange-move button{width:44px;height:44px}
  .arrange-row .row-verse{grid-column:1/-1;grid-row:2;width:100%;font-size:calc(var(--poem-size) * .85)}
}

/* The whole line, not only the grip, is the drag target. */
#practice-surface .arrange-row{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#practice-surface .arrange-row .row-verse,#practice-surface .arrange-row .row-verse *{user-select:none;-webkit-user-select:none;pointer-events:none}
#practice-surface .arrange-row button{cursor:pointer;touch-action:manipulation}
#practice-surface .arrange-row:active{cursor:grabbing}
#practice-surface .arrange-index{display:none!important}
#practice-surface .arrange-row .arrange-drag-handle{width:20px;margin:0;opacity:.55}
@media(max-width:600px){
 #practice-surface .arrange-row{display:flex;align-items:center;gap:10px;padding:12px}
 #practice-surface .arrange-row .arrange-drag-handle{width:20px;height:40px;flex:none}
 #practice-surface .arrange-row .row-verse{flex:1;min-width:0;width:auto;font-size:calc(var(--poem-size) * .82)}
 #practice-surface .arrange-row .arrange-move{display:flex;flex-direction:column;flex:none;gap:4px}
 #practice-surface .arrange-row .arrange-move button{width:36px;height:36px}
}

#practice-surface .arrange-drop-before,#practice-surface .arrange-drop-after{background:var(--accent-soft)}
