/* Hallmark · checked: see artifacts/workbench-redesign/VERIFICATION.md · loop waveform: envelopes drawn from Strudel events, not recorded audio. Lane height 74px and bar width 132px match pattern-visualizer.js. */
.pv-root { min-width: 0; color: var(--color-ink); font-family: var(--font-body); }
.pv-heading { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4); }
.pv-heading > div:first-child { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; min-width: 0; }
.pv-heading strong { font-size: var(--text-s); }
.pv-subtitle { font-size: var(--text-xs); color: var(--color-muted); }
.pv-head-meta { display: flex; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-xs); color: var(--color-muted); font-variant-numeric: tabular-nums; }
.pv-position { color: var(--color-playing); font-weight: 700; }
.pv-loop-map { display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-4) var(--space-3); font-size: var(--text-xs); color: var(--color-muted); direction: ltr; }
.pv-loop-cells { display: flex; gap: var(--space-1); flex: 1; min-width: 0; }
.pv-loop-cell { flex: 1; display: flex; justify-content: space-between; gap: var(--space-1); padding: var(--space-1) var(--space-2); border-radius: var(--radius-s); background: var(--color-paper); min-width: 0; }
.pv-loop-cell b { color: var(--color-ink); }
.pv-loop-cell.is-current { background: var(--color-playing-soft); box-shadow: inset 0 -3px 0 var(--color-playing); }
.pv-loop-return { white-space: nowrap; }

.pv-score { display: flex; width: 100%; min-width: 0; border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); direction: ltr; }
.pv-label-column { width: 168px; flex: none; border-inline-end: 1px solid var(--color-rule); background: var(--color-surface); position: relative; z-index: 2; }
[dir="rtl"] .pv-label-column { direction: rtl; }
.pv-label-ruler { height: 31px; display: flex; align-items: center; padding: 0 var(--space-3); border-bottom: 1px solid var(--color-rule); font-size: var(--text-xs); color: var(--color-muted); }
.pv-track-button { position: relative; height: 74px; width: 100%; display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-2) 0 var(--space-3); border: 0; border-bottom: 1px solid var(--color-rule); background: transparent; text-align: start; color: var(--color-ink); }
.pv-track-button:last-child { border-bottom: 0; }
.pv-track-button.is-selected { background: var(--color-paper-2); box-shadow: inset 4px 0 0 var(--pv-voice); }
.pv-track-button.is-slot-target:not(.is-selected) { box-shadow: inset 2px 0 0 var(--color-rule-strong); }
@media (hover: hover) { button.pv-track-button:hover { background: var(--color-paper); } }
button.pv-track-button:active { transform: translateY(1px); }
.pv-track-symbol { width: 26px; height: 26px; display: grid; place-items: center; flex: none; border: 1.5px solid var(--pv-voice); border-radius: var(--radius-s); color: var(--pv-voice); font-size: var(--text-s); }
.pv-track-names { min-width: 0; flex: 1; display: grid; line-height: 1.25; }
.pv-track-names b { font-size: var(--text-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-track-names small { font-size: var(--text-xs); color: var(--color-muted); }
.pv-track-light { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--color-rule-strong); flex: none; }
.pv-track-button.is-playing .pv-track-light { background: var(--pv-voice); border-color: var(--pv-voice); }
.pv-track-button.is-hit .pv-track-light { box-shadow: 0 0 0 4px color-mix(in oklch, var(--pv-voice) 30%, transparent); }
.pv-track-placeholder { color: var(--color-muted); }

.pv-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; position: relative; cursor: crosshair; scrollbar-width: thin; overscroll-behavior-x: contain; }
.pv-scroll:focus-visible { outline-offset: -3px; }
.pv-timeline { position: relative; min-height: 327px; }
.pv-ruler { height: 31px; display: flex; border-bottom: 1px solid var(--color-rule); background: var(--color-surface); color: var(--color-muted); }
.pv-ruler-bar { height: 100%; width: 132px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-2); border-inline-end: 1px solid var(--color-rule); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.pv-ruler-bar b { font-weight: 400; }
.pv-ruler-bar.is-current { color: var(--color-ink); background: var(--color-playing-soft); }
.pv-ruler-bar.is-current b { font-weight: 700; }
.pv-lane { position: relative; height: 74px; border-bottom: 1px solid var(--color-rule); background-image: linear-gradient(to right, var(--color-rule) 1px, transparent 1px); background-size: 132px 100%; transition: opacity var(--dur-micro) var(--ease-out); }
.pv-lane:last-child { border-bottom: 0; }
.pv-lane.is-dimmed { opacity: .35; }
.pv-lane.is-playing { background-color: color-mix(in oklch, var(--color-playing-soft) 50%, transparent); }
.pv-wave-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.pv-zero-line { stroke: var(--color-rule-strong); stroke-width: 1; stroke-dasharray: 2 5; }
.pv-envelope { fill: var(--pv-voice); fill-opacity: .32; stroke: var(--pv-voice); stroke-opacity: .85; stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.pv-event line { stroke: var(--pv-voice); stroke-width: 1.2; stroke-opacity: .75; vector-effect: non-scaling-stroke; }
.pv-event circle, .pv-event rect { fill: var(--pv-voice); fill-opacity: .75; }
.pv-event text { fill: var(--color-on-fill); font: 600 11px var(--font-body); pointer-events: none; }
.pv-event.is-sounding line { stroke-width: 2; stroke-opacity: 1; }
.pv-event.is-sounding circle, .pv-event.is-sounding rect { fill-opacity: 1; stroke: var(--color-ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pv-event.is-triggered line { stroke: var(--color-ink); stroke-width: 2.8; }
.pv-event.is-triggered circle, .pv-event.is-triggered rect { fill: var(--color-ink); stroke: var(--pv-voice); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pv-empty-message { position: absolute; inset: 31px 0 0; display: grid; place-content: center; justify-items: center; gap: var(--space-2); color: var(--color-muted); font-size: var(--text-s); }
.pv-empty-message button { min-height: var(--control); padding: 0 var(--space-3); border: 1px solid var(--color-rule-strong); border-radius: var(--radius-m); background: var(--color-surface); }
.pv-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--color-playing); z-index: 3; pointer-events: none; }
.pv-playhead::before { content: ""; position: absolute; top: 0; left: -5px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--color-playing); }
.pv-playhead span { display: none; }

.pv-other { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-rule); display: grid; gap: var(--space-2); }
.pv-other-head { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: baseline; font-size: var(--text-xs); color: var(--color-muted); }
.pv-other-head span { color: var(--color-ink); font-weight: 700; font-size: var(--text-s); }
.pv-other-wave { position: relative; height: 34px; border-radius: var(--radius-s); background: var(--color-paper); overflow: hidden; direction: ltr; }
.pv-other-wave svg { width: 100%; height: 100%; display: block; }
.pv-other-envelope { fill: var(--color-ink-2); fill-opacity: .25; stroke: var(--color-ink-2); stroke-opacity: .5; vector-effect: non-scaling-stroke; }
.pv-other-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--color-playing); }
.pv-other-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pv-other-chip { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control); padding: 0 var(--space-3); border: 1px solid var(--color-rule-strong); border-radius: var(--radius-pill); background: var(--color-surface); font-size: var(--text-xs); }
.pv-other-chip b { font-weight: 600; max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-other-signal { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--pv-voice); }
.pv-other-chip.is-playing .pv-other-signal { background: var(--pv-voice); }
.pv-other-chip.is-hit .pv-other-signal { box-shadow: 0 0 0 4px color-mix(in oklch, var(--pv-voice) 30%, transparent); }
.pv-other-section-dots { display: inline-flex; gap: 2px; }
.pv-other-section-dots i { width: 6px; height: 6px; border-radius: 1px; background: var(--color-rule); }
.pv-other-section-dots i.is-active { background: var(--pv-voice); }
.pv-other-swap { color: var(--color-accent-text); }
.pv-other-chip:active { transform: translateY(1px); }
@media (hover: hover) { .pv-other-chip:hover { background: var(--color-paper-2); } }

.pv-legend { display: flex; align-items: center; gap: var(--space-2) var(--space-4); flex-wrap: wrap; padding: var(--space-2) var(--space-4); font-size: var(--text-xs); color: var(--color-muted); }
.pv-legend > span { display: inline-flex; align-items: center; gap: var(--space-1); }
.pv-legend i { width: 14px; height: 10px; display: inline-block; flex: none; }
.pv-legend-hit { border-inline-start: 2px solid var(--color-ink-2); }
.pv-legend-envelope { background: color-mix(in oklch, var(--color-ink-2) 30%, transparent); border-top: 1.5px solid var(--color-ink-2); border-radius: 50% 50% 0 0; }
.pv-current-event { margin-inline-start: auto; color: var(--color-ink-2); }

.pv-code-panel { border-top: 1px solid var(--color-rule); }
.pv-code-panel summary { display: flex; align-items: center; gap: var(--space-3); min-height: var(--target); padding: 0 var(--space-4); cursor: pointer; list-style: none; font-size: var(--text-xs); }
.pv-code-panel summary::-webkit-details-marker { display: none; }
.pv-code-label { font-weight: 700; color: var(--color-ink); white-space: nowrap; }
.pv-code-summary { font-family: var(--font-body); color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-code-expand { margin-inline-start: auto; color: var(--color-accent-text); white-space: nowrap; }
.pv-code-inner { background: var(--color-stage); color: var(--color-stage-muted); border-radius: 0 0 var(--radius-l) var(--radius-l); direction: ltr; }
.pv-code-toolbar { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--color-stage-rule); font-size: var(--text-xs); }
.pv-code-lines { max-height: 280px; overflow: auto; padding: var(--space-2) 0 var(--space-3); font: 12px/1.55 var(--font-code); scrollbar-width: thin; }
.pv-code-line { display: flex; min-width: max-content; padding-inline-end: var(--space-4); border-left: 2px solid transparent; white-space: pre; }
.pv-code-line code { white-space: pre; font: inherit; color: inherit; }
.pv-code-line.is-focused-track { color: var(--color-stage-ink); }
.pv-code-line.is-current-section.is-focused-track { color: var(--color-stage-ink); background: var(--color-stage-2); border-left-color: var(--color-stage-pending); }
.pv-code-line.is-triggered { background: var(--color-code-hit); color: var(--color-stage-ink); border-left-color: var(--color-stage-glow); }
.pv-line-number { width: 48px; flex: none; text-align: right; padding-inline-end: var(--space-3); color: var(--color-stage-rule); user-select: none; }

@media (max-width: 1023px) {
  .pv-label-column { width: 116px; }
  .pv-track-button { padding: 0 var(--space-1) 0 var(--space-2); gap: var(--space-1); }
  .pv-track-symbol { display: none; }
  .pv-track-light { display: none; }
  .pv-heading, .pv-other, .pv-legend { padding-inline: var(--space-3); }
  .pv-loop-map { padding-inline: var(--space-3); }
  .pv-loop-map-label, .pv-loop-return, .pv-loop-cell small { display: none; }
  .pv-current-event { margin-inline-start: 0; flex-basis: 100%; }
  .pv-code-summary { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pv-lane { transition: none; } }
