/* YouppyPlugins, studio e barre: colori e componenti come YouppyRec (fondo scuro, barra di icone in basso, icona colorata quando attiva). */
@media (prefers-color-scheme: dark) {
  :root { --fondo: #0f1115; --carta: #181b22; --carta2: #20242d; --linea: #2c313c; --testo: #eef0f4; --tenue: #9aa3b2; }
}

/* ---- barra in alto (marchio e profilo) e barra delle icone in basso */
#barra { justify-content: space-between; padding: 10px 16px; gap: 12px; border-bottom: 0; overflow: visible; }
#barra .marchio { display: flex; align-items: center; gap: 8px; font: 600 18px system-ui, 'Segoe UI', Roboto, sans-serif; margin: 0; }
#barra .marchio img { border-radius: 7px; }
#barra .chi { background: var(--carta2); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--testo); max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#schede { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--carta); padding-bottom: env(safe-area-inset-bottom); }
#schede a { display: grid; place-items: center; padding: 12px 4px; color: var(--tenue); }
#schede a svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#schede a.qui { color: var(--accento); }
#schede a:hover { color: var(--testo); }
#schede a.qui:hover { color: var(--accento); }
#vista { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
#avvisi { bottom: calc(78px + env(safe-area-inset-bottom)); }

/* ---- studio */
.st { position: relative; }
.st svg.si { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sb { width: 34px; height: 34px; display: inline-grid; place-items: center; color: var(--tenue); border-radius: 8px; flex: none; }
.sb:hover { color: var(--testo); }
.sb.on, .sb.acceso, .sb.acc { color: var(--accento); }
.sb.pic { width: 26px; height: 26px; }
.sb.pic svg.si { width: 16px; height: 16px; }
.st-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -6px 0 8px; }
.st-sx { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.st-dx { display: flex; align-items: center; gap: 0; margin-left: auto; min-width: 0; }
.st-synth { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 12px; background: var(--carta2); border-radius: 10px; color: var(--testo); font-weight: 600; font-size: 14px; max-width: 210px; min-width: 0; }
.st-synth span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-synth svg.si { width: 16px; height: 16px; color: var(--tenue); }
.play-gen.on { color: var(--accento); }

.st-canali { display: grid; gap: 8px; }
.canale { background: var(--carta); border-radius: 14px; padding: 8px; }
.canale.breve { cursor: pointer; padding: 6px 8px; }
.c-riga { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.c-princ { display: flex; gap: 8px; align-items: flex-start; flex: 1 1 640px; min-width: 0; }
.c-col { flex: 1 1 auto; min-width: 0; }
.c-graf { position: relative; height: 46px; background: #0f1115; border-radius: 10px; overflow: hidden; touch-action: none; user-select: none; }
.c-graf.grande { height: 220px; }
.c-tela { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.c-nome { position: absolute; left: 8px; top: 4px; font-size: 12px; color: #9aa3b2; pointer-events: none; }
.c-lato { display: flex; flex-direction: column; gap: 4px; align-items: center; flex: none; width: 40px; }
.c-play { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--testo); display: grid; place-items: center; flex: none; }
.c-play i { width: 0; height: 0; border-left: 11px solid var(--accento); border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 4px; }
.c-play.on i { width: 12px; height: 12px; border: 0; background: var(--accento); border-radius: 2px; margin: 0; }
.breve .c-play { width: 32px; height: 32px; }
.c-pan { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 1 auto; align-items: flex-start; min-width: 0; }
@media (max-width: 760px) {
  .c-princ { flex-basis: 100%; }
  .c-pan { flex-basis: 100%; }
  .c-graf.grande { height: 190px; }
}
.c-val, .c-limval { position: absolute; top: 6px; font: 600 12px/1 ui-monospace, Consolas, monospace; color: #dcdfe4; pointer-events: none; z-index: 4; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.c-val { left: 9px; }
.c-limval { right: 44px; }
.c-eqbox { position: absolute; right: 4px; top: 4px; z-index: 5; height: 26px; min-width: 32px; display: flex; align-items: center; justify-content: center; gap: 2px; padding: 0 5px; color: #eef0f4; background: rgba(15,17,21,.75); border-radius: 7px; font: 700 11px system-ui; }
.c-eqbox svg.si { width: 18px; height: 18px; }
.hb { position: absolute; width: 26px; height: 26px; display: grid; place-items: center; color: #eef0f4; background: rgba(15,17,21,.75); border-radius: 7px; cursor: ew-resize; z-index: 3; touch-action: none; }
.hb svg.si { width: 16px; height: 16px; }
.hb.alto { top: 34px; }
.hb.medio { top: calc(50% - 13px); color: #ffd84a; }
.hb.basso { bottom: 6px; color: #ff8a5c; }
.hb.spento, .hin.spento { opacity: .45; }
.hin { position: absolute; bottom: 12px; width: 14px; height: 14px; border-radius: 4px; background: #ff8a5c; z-index: 3; cursor: ew-resize; touch-action: none; }
.hbar { position: absolute; top: 0; bottom: 0; width: 14px; cursor: ew-resize; z-index: 2; touch-action: none; display: grid; place-items: center; }
.hbar i { width: 4px; height: 38%; border-radius: 2px; background: #eef0f4; opacity: .85; }
.eq-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.eq-linea { fill: none; stroke: #fff; stroke-width: 1.5; }
.eq-c { pointer-events: all; cursor: grab; touch-action: none; }
.eq-c circle { stroke-width: 2; }
.eq-c text { font: italic 600 12px system-ui, sans-serif; pointer-events: none; }
.sf-tela { position: absolute; right: 40px; top: 0; height: 100%; aspect-ratio: 1; z-index: 2; touch-action: none; cursor: grab; }

/* ---- manopole e cursori */
.mn { display: grid; justify-items: center; gap: 1px; width: 54px; user-select: none; }
.mn.pic { width: 38px; }
.mn-s { width: 36px; height: 36px; touch-action: none; cursor: ns-resize; }
.mn.pic .mn-s { width: 28px; height: 28px; }
.mn-f { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 4; stroke-linecap: round; }
.mn-a { fill: none; stroke: var(--accento); stroke-width: 4; stroke-linecap: round; }
.mn-g { stroke: var(--testo); stroke-width: 2.5; stroke-linecap: round; }
.mn-v { font: 600 11px/1.15 ui-monospace, Consolas, monospace; color: var(--testo); white-space: nowrap; }
.mn.pic .mn-v { font-size: 10px; }
.mn-e { font-size: 10px; color: var(--tenue); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.cv { position: relative; width: 22px; height: 130px; border-radius: 6px; background: #0f1115; touch-action: none; cursor: ns-resize; --cv: var(--accento); flex: none; }
.cv::before { content: ''; position: absolute; left: 50%; top: 6px; bottom: 6px; width: 2px; margin-left: -1px; background: rgba(255,255,255,.08); }
.cv-r { position: absolute; left: 50%; width: 4px; margin-left: -2px; background: var(--cv); opacity: .55; border-radius: 2px; }
.cv-p { position: absolute; left: 3px; right: 3px; height: 12px; border-radius: 4px; background: #e9edf2; box-shadow: inset 0 0 0 2px var(--cv); }
.cv.pic { width: 16px; height: 90px; }
.cv.pic .cv-p { left: 2px; right: 2px; height: 10px; }

/* ---- pannelli a destra del canale */
.pann { background: var(--carta2); border-radius: 12px; padding: 8px; }
.pr-box { display: flex; align-items: center; gap: 0; }
.pr-nome { min-width: 100px; max-width: 170px; height: 30px; padding: 0 10px; border-radius: 8px; background: #0f1115; color: var(--testo); font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq2 { display: grid; gap: 8px; justify-items: end; }
.eq-col { display: flex; gap: 4px; }
.eq-c1 { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 36px; }
.eq-tacca { width: 14px; height: 4px; border-radius: 2px; }
.lim { display: flex; gap: 8px; }
.lm-col.cv { width: 30px; height: 210px; --cv: #fff; overflow: hidden; }
.lm-gr { position: absolute; top: 0; left: 0; right: 0; height: 0; background: rgba(255,106,61,.45); }
.lm-mn { display: grid; gap: 6px; justify-items: center; align-content: start; }
.luce-t { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: #0f1115; color: var(--tenue); font-size: 12px; font-weight: 700; }
.luce-t i { width: 10px; height: 10px; border-radius: 50%; background: #3a3f4a; }
.luce-t.on { color: var(--testo); }
.luce-t.on i { background: #ff6a3d; box-shadow: 0 0 8px #ff6a3d; }
.eff { display: grid; gap: 8px; width: 300px; max-width: 100%; }
.ef-pad { position: relative; height: 170px; border-radius: 8px; background-color: #0f1115; touch-action: none; cursor: crosshair; overflow: hidden;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 12.5% 12.5%; }
.ef-l { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f5a623; }
.ef-q { position: absolute; width: 22px; height: 22px; margin: 0 0 -11px -11px; background: rgba(245,166,35,.35); border: 2px solid #f5a623; border-radius: 3px; }
.ef-tasti { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.ef-t { display: grid; justify-items: center; gap: 2px; padding: 5px 0; border-radius: 8px; color: var(--tenue); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.ef-t:hover { color: var(--testo); }
.ef-t.on { color: var(--accento); }
.comp { display: grid; gap: 6px; justify-items: start; }
.cp-mn { display: grid; grid-template-columns: repeat(4, 54px); gap: 6px 4px; }
.sc { display: flex; gap: 6px; align-items: flex-start; }
.sc-c { display: grid; justify-items: center; gap: 3px; }
.sc-n { font-size: 10px; color: var(--tenue); max-width: 34px; overflow: hidden; white-space: nowrap; }
.box-dg { display: grid; gap: 4px; }
.dg-tela { width: 250px; max-width: 100%; height: 130px; background: #0f1115; border-radius: 8px; touch-action: none; cursor: crosshair; display: block; }
.riga-ic { display: flex; justify-content: flex-end; gap: 2px; }
.box-rg { display: flex; align-items: center; gap: 12px; }
.rg-b { width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--testo); display: grid; place-items: center; flex: none; }
.rg-b span { width: 42px; height: 42px; border-radius: 50%; background: #ff3b5c; transition: .15s; }
.rg-b.on span { width: 20px; height: 20px; border-radius: 5px; }
.rg-info { display: grid; gap: 6px; }
.rg-t { font: 600 18px ui-monospace, Consolas, monospace; }
.rg-m { display: block; width: 90px; height: 6px; border-radius: 3px; background: #0f1115; overflow: hidden; }
.rg-l { display: block; height: 100%; width: 0; background: var(--accento); }

/* ---- reverb e delay a barre, sotto il grafico */
.rv { margin-top: 6px; }
.rv-testa { display: flex; align-items: center; gap: 0; }
.rv-ic { display: grid; place-items: center; width: 30px; color: #5c9dff; }
.rv-righe { display: grid; gap: 4px; }
.rv-riga { position: relative; height: 76px; background: #0f1115; border-radius: 8px; }
.rv-f { position: absolute; top: 8px; height: 22px; border-radius: 6px; background: linear-gradient(90deg, rgba(92,157,255,.6), rgba(92,157,255,.12)); }
.rv-h { position: absolute; top: 6px; width: 26px; height: 26px; display: grid; place-items: center; color: #5c9dff; background: #20242d; border-radius: 7px; cursor: ew-resize; touch-action: none; }
.rv-h svg.si { width: 16px; height: 16px; }
.rv-rip { position: absolute; top: 6px; height: 26px; min-width: 30px; padding: 0 4px; display: grid; place-items: center; font: 600 12px ui-monospace, Consolas, monospace; color: #eef0f4; cursor: ns-resize; user-select: none; }
.rv-riga .sb.pic { position: absolute; top: 6px; }
.rv-pan { position: absolute; top: 34px; }

/* ---- riquadro del suono */
.rq { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.rq-tela { flex: 1 1 260px; height: 92px; background: #0f1115; border-radius: 8px; min-width: 0; display: block; }
.rq-mn { display: flex; gap: 2px; flex-wrap: wrap; }

/* riquadri multipli (fino a 4, uno per angolo) */
.rqg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.rqg-p { background: rgba(255,255,255,.03); border-radius: 10px; padding: 6px; min-width: 0; }
.rqg-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rqg-t { background: #0f1115; color: inherit; border: 0; border-radius: 8px; padding: 4px 8px; font-size: 12px; max-width: 80%; }
.rqg-piu { grid-column: 1 / -1; justify-self: start; padding: 6px 12px; border-radius: 8px; color: var(--tenue); background: #0f1115; font-size: 12px; }
.rqg .rq { margin-top: 4px; }
@media (max-width: 640px) { .rqg { grid-template-columns: 1fr; } }

/* ---- elenchi a comparsa */
.st-pop { position: absolute; z-index: 60; background: var(--carta); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.6); padding: 8px; max-width: calc(100vw - 16px); }
.st-pop.cat { width: 340px; max-height: min(62vh, 560px); display: flex; flex-direction: column; }
.cat-tab { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 6px; background: #0f1115; border-radius: 10px; align-self: flex-start; }
.cat-tab button { padding: 6px 14px; border-radius: 7px; color: var(--tenue); font-size: 13px; }
.cat-tab button.on { background: var(--carta2); color: var(--testo); }
.cat-corpo { overflow: auto; overscroll-behavior: contain; }
.cat-g h4, .pr-lista h4 { margin: 10px 8px 4px; font: 700 11px system-ui, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--tenue); }
.cat-v { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 8px; color: var(--testo); font-size: 14px; }
.cat-v:hover { background: var(--carta2); }
.cat-v.qui { box-shadow: inset 0 0 0 2px var(--accento); }
.cat-v small { color: var(--tenue); }
.eq-lista { display: grid; gap: 2px; width: 230px; }
.eq-v { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--tenue); }
.eq-v:hover { background: var(--carta2); }
.eq-v span { flex: 1; text-align: left; color: var(--testo); }
.eq-v .luce { width: 8px; height: 8px; border-radius: 50%; background: #3a3f4a; }
.eq-v.on { color: var(--accento); }
.eq-v.on .luce { background: var(--accento); box-shadow: 0 0 6px var(--accento); }
.pr-lista { display: grid; gap: 1px; width: 230px; max-height: 52vh; overflow: auto; }
.pr-lista button { text-align: left; padding: 6px 10px; border-radius: 8px; color: var(--testo); font-size: 14px; width: 100%; }
.pr-lista button:hover { background: var(--carta2); }
.pr-lista .qui { box-shadow: inset 0 0 0 2px var(--accento); }
.pr-lista .nuovo { color: var(--accento); }
.st-pop.guida .testo { width: 300px; display: grid; gap: 8px; font-size: 13px; color: var(--tenue); }
.st-pop.guida b { color: var(--testo); }
.eqb-graf { position: relative; width: 320px; max-width: calc(100vw - 32px); height: 150px; background: #0f1115; border-radius: 8px; overflow: hidden; }

/* ---- finestre */
.fin { position: fixed; z-index: 30; width: min(560px, calc(100vw - 16px)); max-height: 72vh; display: flex; flex-direction: column; background: var(--carta); border-radius: 14px; box-shadow: 0 16px 50px rgba(0,0,0,.65); }
.fin-t { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; cursor: move; touch-action: none; color: var(--accento); user-select: none; }
.fin-t b { color: var(--testo); }
.fin-t .fin-x { flex: 1; }
.fin-c { overflow: auto; padding: 0 12px 12px; display: grid; gap: 10px; }
.fin[data-fin=mixer] { width: auto; max-width: calc(100vw - 16px); }
.fin[data-fin=strumento] { width: min(640px, calc(100vw - 16px)); }
@media (max-width: 760px) {
  .fin { left: 0 !important; right: 0; top: auto !important; bottom: calc(60px + env(safe-area-inset-bottom)); width: 100% !important; max-width: none; max-height: 56vh; border-radius: 16px 16px 0 0; }
}
.fin-riga { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chipb { height: 28px; padding: 0 11px; border-radius: 14px; background: var(--carta2); font-size: 12px; color: var(--testo); white-space: nowrap; }
.chipb:hover { color: var(--accento); }
.chipb.on { color: var(--accento); }
.bt-suoni { display: flex; flex-wrap: wrap; gap: 4px; }
.bt-griglia { display: grid; gap: 4px; }
.bt-riga { display: flex; align-items: center; gap: 6px; }
.bt-n { width: 80px; flex: none; text-align: left; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--tenue); }
.bt-riga.sel .bt-n { color: var(--testo); }
.bt-passi { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; flex: 1; min-width: 0; }
.bt-p { height: 26px; border-radius: 5px; background: #2c313c; min-width: 0; }
.bt-p.alt { background: #242833; }
.bt-p.on { background: var(--accento); }
.bt-p.passo-ora { box-shadow: inset 0 0 0 2px #fff; }
.pr-area { display: flex; max-height: 300px; overflow: auto; border-radius: 8px; }
.pr-tasti, .sr-piano { display: grid; width: 48px; flex: none; align-content: start; }
.pr-k { height: 16px; background: #e9edf2; color: #333; font-size: 9px; text-align: right; padding-right: 3px; border-bottom: 1px solid #b9bec7; }
.pr-k.nera { background: #1b1e25; color: #aaa; border-bottom-color: #0f1115; }
.pr-k.qui { background: var(--accento); color: #05211b; }
.pr-griglia { flex: 1; display: grid; align-content: start; background: #0f1115; min-width: 300px; }
.pr-r { display: grid; grid-template-columns: repeat(16, 1fr); height: 16px; }
.pr-r.nera { background: rgba(255,255,255,.025); }
.pr-c { border-right: 1px solid rgba(255,255,255,.05); border-bottom: 1px solid rgba(255,255,255,.04); }
.pr-c.b { border-left: 1px solid rgba(255,255,255,.12); }
.pr-c.on { background: var(--accento); border-radius: 3px; }
.cz-pat { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cz-pl { overflow: auto; display: grid; gap: 3px; }
.cz-r { display: flex; gap: 3px; align-items: center; }
.cz-nome, .cz-r.testa > span:first-child { width: 78px; flex: none; font-size: 12px; color: var(--tenue); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cz-num { width: 26px; flex: none; text-align: center; font-size: 10px; color: var(--tenue); }
.cz-num.passo-ora { color: var(--accento); }
.cz-c { width: 26px; height: 26px; flex: none; border-radius: 5px; background: #242833; }
.cz-c.on { background: var(--cz); }
.mx { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.mx-c { display: grid; justify-items: center; gap: 4px; width: 60px; flex: none; padding: 6px 2px; border-radius: 10px; background: var(--carta2); }
.mx-c.sel { background: #2a2f3a; }
.mx-c.master > .mn { height: 46px; }
.mx-f.cv { height: 150px; width: 24px; }
.mx-db { font: 600 10px ui-monospace, Consolas, monospace; color: var(--tenue); }
.mx-m { width: 26px; height: 22px; border-radius: 6px; background: #0f1115; font-size: 11px; font-weight: 700; color: var(--tenue); }
.mx-m.on { color: #ff6a3d; }
.mx-n { font-size: 11px; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--testo); }
.sr-testa { justify-content: space-between; }
.sr-corpo { display: flex; gap: 8px; }
.sr-piano { max-height: 330px; overflow: auto; border-radius: 6px; }
.sr-dx { flex: 1; display: grid; gap: 8px; min-width: 0; align-content: start; }
.fin-graf { height: 110px; }
.sr-imp { display: flex; flex-wrap: wrap; gap: 2px; }
