/* STUDIO EVOLUTION (C-139 … ) — styles of the elements this mission adds to Studio and Create in BOTH interface modes: the Listen
   bar, region previews, the part protection marks and the Build-by-layers surfaces. Own classes only, tokens from tokens.css;
   app.css / tokens.css stay byte-identical (the Classic baseline pin, C-106). */

/* ---- Listen bar: what you hear, stated; one way back to the whole song */
.listen-bar { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; padding: 6px var(--s-2); margin-bottom: var(--s-2); border: 1px solid var(--line); border-radius: var(--radius); background: var(--inset); min-height: var(--control); }
.listen-bar.partial { border-color: var(--amber); }
.listen-state { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; font-size: var(--t-s); }
.listen-state.whole { color: var(--text-2); }
.listen-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--amber); background: transparent; color: var(--amber); font: 600 var(--t-xs) var(--sans); cursor: pointer; white-space: nowrap; }
.listen-chip:hover, .listen-chip:focus-visible { background: rgba(240, 176, 78, .12); outline: none; box-shadow: var(--ring); }
.listen-whole { margin-left: auto; }

/* ---- Region previews in the section × part map: real notes / hits / voicings of the saved clips (never decoration) */
.srm-cell { position: relative; overflow: hidden; }
.srm-cell .rp { position: absolute; inset: 2px 2px; width: calc(100% - 4px); height: calc(100% - 4px); pointer-events: none; }
.rp .n { fill: var(--c); opacity: .9; }
.rp .n.ghost { opacity: .45; }
.rp .n.muted { opacity: .25; }
.rp .lane { stroke: var(--line-2); stroke-width: .5; }
.srm-cell.has-preview { background: color-mix(in srgb, var(--c) 7%, var(--inset)); }
.srm-cell.has-preview.sel { background: color-mix(in srgb, var(--c) 18%, var(--inset)); }

/* ---- direct instrument access + protection marks on the part labels */
.srm-role { position: relative; }
.srm-role .role-tools { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: inline-flex; gap: 2px; }
.role-tool { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid transparent; border-radius: var(--radius-s); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; }
.role-tool:hover, .role-tool:focus-visible { color: var(--text); border-color: var(--line-2); background: var(--panel-3); outline: none; }
.role-tool[aria-pressed="true"] { color: var(--amber); }
.srm-role.locked b::after, .sf-part.locked .sf-name b::after { content: " 🔒"; font-size: 10px; }
.srm-cell.locked { box-shadow: inset 0 0 0 1px rgba(240, 176, 78, .55); }

/* ---- Build by layers (Studio panel + Create mode) */
.build-panel { display: grid; gap: var(--s-3); }
.build-parts { display: grid; gap: 6px; }
.build-part { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: var(--s-2); padding: 6px var(--s-2); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.build-part .swatch { width: 10px; height: 28px; border-radius: 2px; background: var(--c); }
.build-part .who { min-width: 0; }
.build-part .who b { display: block; font-size: var(--t-m); }
.build-part .who small { color: var(--muted); font-size: var(--t-xs); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.build-part .acts { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.build-part.absent { border-style: dashed; background: transparent; }
.build-part.absent .swatch { opacity: .45; }
.build-variants { display: grid; gap: 6px; padding: var(--s-2); border: 1px solid var(--cyan-dim); border-radius: var(--radius); background: var(--cyan-wash); }
.build-variants .row { flex-wrap: wrap; }
.variant-btn[aria-pressed="true"] { border-color: var(--cyan); color: var(--cyan); }
.build-note { font-size: var(--t-xs); color: var(--muted); }
.build-conflict { font-size: var(--t-xs); color: var(--amber); }
.create-mode { display: inline-flex; margin-bottom: var(--s-3); }
.build-start { display: grid; gap: var(--s-3); }
.build-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.build-role { min-height: var(--control); padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 var(--t-s) var(--sans); cursor: pointer; }
.build-role[aria-pressed="true"] { border-color: var(--c, var(--cyan)); box-shadow: inset 0 -3px 0 var(--c, var(--cyan)); }
.build-role:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) {
  .listen-whole { margin-left: 0; }
  .build-part { grid-template-columns: 8px minmax(0, 1fr); }
  .build-part .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .role-tool { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) { .listen-chip, .role-tool { transition: none; } }
