/* Mini-plugin « MIDI » (vues MIDI et PRESETS de la Bibliothèque) du questionnaire, 30/11 : copie de LibraryView.cpp
   (couleurs de Theme.h), tailles du plugin × 860/1092. Tout est sous .pl-midi. */
.pl-win.pl-midi { background: #131313; }
.pl-win.pl-midi:focus { outline: none; }
.pl-midi .lb-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Barre : SONS | MIDI | PRESETS, recherche, Kits et packs */
.pl-midi .lb-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px 0; }
.pl-midi .lb-seg { flex: none; display: flex; padding: 2px; border-radius: 13px; background: #0c0c0c; }
.pl-midi .lb-segb { height: 22px; min-width: 48px; padding: 0 11px; border: 0; border-radius: 11px; background: transparent; color: #bdbdbd; cursor: pointer; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.pl-midi .lb-segb.is-on { background: #ededed; color: #141414; }
.pl-midi .lb-sbox { position: relative; display: block; flex: 1; min-width: 0; height: 26px; border-radius: 13px; border: 1px solid #262626; background: #0c0c0c; overflow: hidden; cursor: text; }
.pl-midi .lb-sbox:focus-within { border-color: var(--pl-peach); }
.pl-midi .lb-sic { position: absolute; z-index: 1; left: 10px; top: 50%; width: 12px; height: 12px; margin-top: -6px; color: #8a8a8a; pointer-events: none; }
.pl-midi .lb-sic svg { display: block; width: 12px; height: 12px; }
/* Champ en 16 px réduit à 11 px : pas de zoom automatique d'iOS quand on touche la recherche */
.pl-midi .lb-q { position: absolute; left: 0; top: 0; width: 145.4545%; height: 145.4545%; margin: 0; padding: 0 16px 0 42px; border: 0; border-radius: 0; background: transparent; color: #ededed; font: 400 16px "IBM Plex Sans", system-ui, sans-serif; outline: none; transform: scale(.6875); transform-origin: 0 0; -webkit-appearance: none; appearance: none; }
.pl-midi .lb-q::placeholder { color: #8a8a8a; opacity: 1; }
.pl-midi .lb-dd { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 126px; height: 26px; padding: 0 10px 0 12px; border-radius: 13px; border: 1px solid #2e2e2e; background: transparent; color: #dadada; cursor: pointer; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.pl-midi .lb-ddl { overflow: hidden; text-overflow: ellipsis; }
.pl-midi .lb-ddc { display: grid; place-items: center; flex: none; width: 10px; height: 10px; }
.pl-midi .lb-ddc svg { width: 10px; height: 10px; }
.pl-midi .lb-dd.is-open { border-color: #4a4a4a; background: #1e1e1e; }

/* Puces de catégorie */
.pl-midi .lb-chips { flex: none; display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 12px 0; }
.pl-midi .lb-chip { height: 19px; padding: 0 8px; border-color: #2e2e2e; background: transparent; color: #c8c8c8; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; letter-spacing: .03em; }
.pl-midi .lb-chip.is-on { background: var(--pl-peach); border-color: var(--pl-peach); color: var(--pl-on); }

/* Ligne d'info */
.pl-midi .lb-info { flex: none; display: flex; align-items: center; gap: 12px; height: 30px; margin-top: 2px; padding: 0 12px; border-bottom: 1px solid #232323; }
.pl-midi .lb-hint { flex: 1; min-width: 0; color: #9e9e9e; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-midi .lb-count { flex: none; color: #9e9e9e; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; }

/* Liste */
.pl-midi .lb-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #333 transparent; }
.pl-midi .lb-row { position: relative; height: 47px; border-bottom: 1px solid #1e1e1e; cursor: pointer; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .pl-midi .lb-row:hover { background: #1e1e1e; } }
.pl-midi .lb-row.is-sel { background: #2a2420; box-shadow: inset 0 0 0 1px #6a5240; }
/* Écoute : la ligne s'allume à chaque coup (--lv), un trait pêche avance en bas (--p) */
.pl-midi .lb-row.is-play::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(255, 178, 124, calc(.05 + .22 * var(--lv, 0))), rgba(255, 178, 124, calc(.01 + .044 * var(--lv, 0)))); box-shadow: inset 3px 0 0 rgba(255, 178, 124, calc(.5 + .5 * var(--lv, 0))); }
.pl-midi .lb-row.is-play::after { content: ""; position: absolute; left: 0; bottom: -1px; width: var(--p, 0%); height: 1px; background: var(--pl-peach); pointer-events: none; }

.pl-midi .lb-play { position: absolute; z-index: 1; left: 5px; top: 0; bottom: 0; width: 22px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: #9e9e9e; cursor: pointer; }
.pl-midi .lb-play svg { width: 11px; height: 11px; }
.pl-midi .lb-row.is-play .lb-play { color: var(--pl-peach); }
@media (hover: hover) { .pl-midi .lb-row .lb-play:hover { color: #ededed; } .pl-midi .lb-row.is-play .lb-play:hover { color: var(--pl-peach); } }

.pl-midi .lb-txt { position: absolute; z-index: 1; left: 28px; right: 232px; top: 0; bottom: 0; pointer-events: none; }
.pl-midi .lb-name { position: absolute; left: 0; right: 0; top: 7px; height: 17px; display: flex; align-items: center; gap: 6px; color: #ededed; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pl-midi .lb-nm { overflow: hidden; text-overflow: ellipsis; }
.pl-midi .lb-sub { position: absolute; left: 0; right: 0; top: 27px; height: 13px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.pl-midi .lb-cat { color: #9e9e9e; font-size: 8.75px; letter-spacing: .03em; }

.pl-midi .lb-right { position: absolute; z-index: 1; right: 11px; top: 0; bottom: 0; display: flex; align-items: center; gap: 6px; }
.pl-midi .lb-grip { width: 13px; height: 13px; color: #bdbdbd; opacity: 0; transition: opacity .12s; }
.pl-midi .lb-grip svg { display: block; width: 13px; height: 13px; }
@media (hover: hover) { .pl-midi .lb-row:hover .lb-grip { opacity: .75; } }
.pl-midi .lb-rb { display: grid; place-items: center; width: 22px; height: 19px; padding: 0; border-radius: 5px; border: 1px solid #2e2e2e; background: transparent; color: #bdbdbd; cursor: pointer; }
.pl-midi .lb-rb svg { width: 11px; height: 11px; }
@media (hover: hover) { .pl-midi .lb-rb:hover { background: #262626; border-color: #4a4a4a; color: #ededed; } }
.pl-midi .lb-rb.is-open { background: #262626; border-color: #4a4a4a; color: #ededed; }

/* Piano roll de la ligne : temps et mesures, notes ; à l'écoute, les notes s'allument au passage de la tête */
.pl-midi .lb-roll { flex: none; width: 134px; height: 24px; margin-right: 3px; border-radius: 3px; background: #0c0c0c; box-shadow: inset 0 0 0 1px #262626; }
.pl-midi .lb-roll svg { display: block; width: 134px; height: 24px; }
@media (hover: hover) { .pl-midi .lb-roll:hover { background: #1e1e1e; box-shadow: inset 0 0 0 1px #6a6a6a; } }
.pl-midi .lb-rg { fill: #1e1e1e; }
.pl-midi .lb-rg4 { fill: #2e2e2e; }
.pl-midi .lb-n { fill: #8a8a8a; }
.pl-midi .lb-ph { display: none; fill: #fff; }
.pl-midi .lb-row.is-play .lb-roll { box-shadow: inset 0 0 0 1px var(--pl-peach); }
.pl-midi .lb-row.is-play .lb-n { fill: rgba(255, 178, 124, .3); }
.pl-midi .lb-row.is-play .lb-n.is-p { fill: var(--pl-peach); }
.pl-midi .lb-row.is-play .lb-n.is-c { fill: #fff; stroke: rgba(255, 178, 124, .4); stroke-width: 3px; paint-order: stroke; }
.pl-midi .lb-row.is-play .lb-ph { display: inline; }

/* Presets : effets sous le nom ; la ligne choisie montre sa chaîne de mixage */
.pl-midi .lb-prow { height: auto; }
.pl-midi .lb-top { position: relative; height: 47px; }
.pl-midi .lb-prow .lb-txt { left: 12px; right: 90px; }
.pl-midi .lb-fx { flex: none; height: 13px; padding: 0 6px; border-radius: 7px; background: #2b211a; color: #ffcdaa; font-size: 7.5px; font-weight: 600; line-height: 13px; letter-spacing: .04em; text-transform: uppercase; }
.pl-midi .lb-chain { display: none; padding: 0 12px 12px; cursor: default; }
.pl-midi .lb-prow.is-sel .lb-chain { display: block; }
.pl-midi .lb-chh { display: flex; justify-content: space-between; margin-bottom: 6px; color: #9e9e9e; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 7.5px; letter-spacing: .1em; text-transform: uppercase; }
.pl-midi .lb-slots { display: flex; align-items: stretch; gap: 5px; }
.pl-midi .lb-slot { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 7px 8px; border-radius: 6px; border: 1px solid #2e2e2e; background: #0c0c0c; }
.pl-midi .lb-slh { display: flex; align-items: center; gap: 6px; color: #ededed; font-size: 9.5px; white-space: nowrap; }
.pl-midi .lb-slh b { font-weight: 600; }
.pl-midi .lb-sln { display: grid; place-items: center; flex: none; width: 14px; height: 14px; border-radius: 4px; background: #2b211a; color: var(--pl-peach); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 8px; }
.pl-midi .lb-viz { height: 26px; }
.pl-midi .lb-viz svg { display: block; width: 100%; height: 26px; overflow: visible; }
.pl-midi .lb-v0 { fill: none; stroke: #3a3a3a; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.pl-midi .lb-v1 { fill: none; stroke: var(--pl-peach); stroke-width: 1.4px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pl-midi .lb-vf { fill: rgba(255, 178, 124, .12); }
.pl-midi .lb-vc { fill: none; stroke: rgba(255, 178, 124, .5); stroke-width: 1px; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.pl-midi .lb-vb { fill: rgba(255, 178, 124, .75); }
.pl-midi .lb-slp { display: flex; flex-direction: column; gap: 1px; min-width: 0; color: #9e9e9e; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 8px; }
.pl-midi .lb-slp span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-midi .lb-arr { flex: none; align-self: center; display: grid; place-items: center; width: 12px; height: 12px; color: #5c5c5c; }
.pl-midi .lb-arr svg { width: 12px; height: 12px; }

.pl-midi .lb-empty { padding: 64px 40px; color: #9e9e9e; font-size: 11px; line-height: 1.6; text-align: center; white-space: pre-line; }

/* Menus */
.pl-midi .lb-menu { position: absolute; z-index: 7; max-height: 300px; overflow-y: auto; padding: 5px; border-radius: 8px; border: 1px solid #2e2e2e; background: #1c1c1c; box-shadow: 0 10px 28px rgba(0, 0, 0, .55); }
.pl-midi .lb-mh { padding: 6px 8px 4px 22px; color: #9e9e9e; font-size: 9.5px; }
.pl-midi .lb-mi { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 24px; padding: 0 8px 0 4px; border: 0; border-radius: 5px; background: none; color: #ededed; cursor: pointer; font-size: 10.5px; text-align: left; }
@media (hover: hover) { .pl-midi .lb-mi:not([disabled]):hover { background: #2a2a2a; } }
.pl-midi .lb-mck { display: grid; place-items: center; flex: none; width: 14px; height: 14px; color: var(--pl-peach); }
.pl-midi .lb-mck svg { width: 10px; height: 10px; }
.pl-midi .lb-mt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bas de fenêtre et bande « Ta prod » */
.pl-midi .lb-foot { position: relative; flex: none; display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-top: 1px solid #232323; color: #bdbdbd; font-size: 9.5px; }
.pl-midi .lb-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--pl-peach); }
.pl-midi .lb-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 480px; }
.pl-midi .lb-drop { position: absolute; z-index: 4; right: 10px; bottom: 4px; width: 300px; height: 22px; display: flex; align-items: stretch; border: 1px solid #2e2e2e; border-radius: 6px; background: #0c0c0c; overflow: hidden; transition: height .18s ease, border-color .15s, background-color .15s, box-shadow .15s; }
.pl-midi .lb-dropl { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 9px; border-right: 1px solid #262626; color: #9e9e9e; font-family: "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; }
.pl-midi .lb-dropl b { font-size: 8px; font-weight: 500; }
.pl-midi .lb-dropl small { display: none; font-size: 7px; color: #8a8a8a; }
.pl-midi .lb-lane { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 3px; padding: 3px; background-image: repeating-linear-gradient(90deg, #1e1e1e 0 1px, transparent 1px 24px); }
.pl-midi .lb-clip { flex: none; display: flex; align-items: center; max-width: 66px; padding: 0 5px; border-radius: 3px; background: #4a3424; box-shadow: inset 2px 0 0 var(--pl-peach); color: #ffd3b3; font-size: 7.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: lbMidiClip .25s ease-out; }
.pl-midi .lb-clip.is-mix { background: #2b211a; color: #ffcdaa; }
@keyframes lbMidiClip { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pl-midi .lb-drop.is-armed { height: 64px; border: 1px dashed var(--pl-peach); background-color: #17120e; }
.pl-midi .lb-drop.is-armed .lb-dropl { color: var(--pl-peach); }
.pl-midi .lb-drop.is-armed .lb-dropl small { display: block; }
.pl-midi .lb-drop.is-over { border-style: solid; background-color: #2b211a; box-shadow: 0 0 0 3px rgba(255, 178, 124, .18); }
.pl-midi.lb-dragging, .pl-midi.lb-dragging * { cursor: grabbing; }

/* Carte qui suit le pointeur pendant le glisser */
.pl-midi .lb-ghost { position: absolute; z-index: 8; left: 0; top: 0; width: 189px; height: 47px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255, 178, 124, .85); background: linear-gradient(135deg, #2a211b, #1a1715); box-shadow: 0 6px 18px rgba(0, 0, 0, .6); pointer-events: none; }
.pl-midi .lb-gb { flex: none; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 7px; background: rgba(255, 178, 124, .16); color: var(--pl-peach); }
.pl-midi .lb-gb svg { width: 15px; height: 15px; }
.pl-midi .lb-gt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pl-midi .lb-gt b { color: #ededed; font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-midi .lb-gt small { color: #9e9e9e; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 7px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.pl-midi .lb-gw { display: block; height: 9px; margin-top: 2px; }
.pl-midi .lb-gw svg { display: block; width: 100%; height: 100%; fill: rgba(255, 178, 124, .9); }
@media (prefers-reduced-motion: reduce) {
  .pl-midi .lb-drop, .pl-midi .lb-grip { transition: none; }
  .pl-midi .lb-clip { animation: none; }
}
