﻿/* Chord Studio â€” producer switches and the chord piano roll */

.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 12px;
  background: #1e1e2e;
  border: 1px solid #313244;
  border-radius: 12px;
}
.view-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  background: #11111b;
  border: 1px solid #313244;
  border-radius: 999px;
}
.view-tab {
  border: 0;
  background: transparent;
  color: #a6adc8;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.view-tab:hover {
  color: #fff;
}
.view-tab.active {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: #fff;
}

.producer-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 12px;
  background: #181825;
  border: 1px solid #313244;
  border-radius: 10px;
}
.producer-switch[hidden] {
  display: none;
}
.inst-dropdown {
  position: relative;
}
.inst-dropdown[hidden] {
  display: none;
}
.inst-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #45475a;
  border-radius: 999px;
  background: #11111b;
  color: #cdd6f4;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
}
.inst-trigger:hover,
.inst-trigger[aria-expanded="true"] {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}
.producer-btn {
  border: 1px solid #45475a;
  border-radius: 999px;
  background: #11111b;
  color: #cdd6f4;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.producer-btn:hover {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}
.producer-btn:active {
  transform: translateY(1px);
}
.inst-trigger.loading .inst-caret {
  animation: inst-spin 0.8s linear infinite;
}
@keyframes inst-spin {
  to { transform: rotate(360deg); }
}
.inst-caret {
  color: #7f849c;
  font-size: 0.7rem;
}
.inst-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: 240px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  background: #181825;
  border: 1px solid #45475a;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  scrollbar-width: thin;
}
.inst-menu[hidden] {
  display: none;
}
.inst-group {
  padding: 8px 8px 4px;
  color: #7f849c;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.inst-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #cdd6f4;
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  padding: 7px 8px;
  cursor: pointer;
}
.inst-option:hover {
  background: #313244;
}
.inst-option[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(34, 211, 238, 0.22));
  color: #fff;
}
.inst-icon {
  width: 1.2em;
  text-align: center;
}
.inst-meta {
  margin-left: auto;
  color: #7f849c;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.inst-star {
  margin-left: auto;
  color: #f9e2af;
  font-size: 0.72rem;
}
.timeline-wrapper .producer-bar {
  margin: 10px 0 12px;
}
.producer-bpm-btn {
  margin-left: 6px;
  border: 1px solid #45475a;
  background: #11111b;
  color: #f9e2af;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
}
.export-btns {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}
.export-btn {
  border: 1px solid #45475a;
  background: #11111b;
  color: #cdd6f4;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.export-btn:hover:not(:disabled) {
  border-color: #a6e3a1;
  color: #a6e3a1;
}
.export-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.piano-key-white.extra-key,
.piano-key-black.extra-key {
  box-shadow: inset 0 -6px 0 rgba(249, 226, 175, 0.85);
}
.producer-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #cdd6f4;
  cursor: pointer;
  user-select: none;
}
.producer-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ps-track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #45475a;
  transition: background 0.2s;
  flex: none;
}
.ps-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cdd6f4;
  transition: transform 0.2s;
}
.producer-switch input:checked + .ps-track {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
}
.producer-switch input:checked + .ps-track::after {
  transform: translateX(16px);
  background: #fff;
}
.producer-switch input:focus-visible + .ps-track {
  outline: 2px solid #89b4fa;
  outline-offset: 2px;
}
.producer-hint {
  flex: 1 1 200px;
  font-size: 0.74rem;
  color: #7f849c;
}

.chord-roll-card {
  background: #1e1e2e;
  border: 1px solid #313244;
  border-radius: 12px;
  padding: 12px;
}
.chord-roll-card[hidden] {
  display: none;
}

.cr-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.cr-groove {
  font-size: 0.78rem;
  font-weight: 800;
  color: #cba6f7;
}
.cr-snap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #a6adc8;
}
.cr-snap select {
  background: #11111b;
  color: #cdd6f4;
  border: 1px solid #45475a;
  border-radius: 6px;
  padding: 3px 6px;
  font: inherit;
  font-size: 0.74rem;
}
.cr-btn {
  border: 1px solid #45475a;
  background: #11111b;
  color: #cdd6f4;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.cr-btn:hover {
  border-color: #cba6f7;
}
.cr-btn[hidden] {
  display: none;
}
.cr-btn.on {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  border-color: transparent;
  color: #fff;
}
.cr-drawing .cr-grid {
  cursor: crosshair;
}
.cr-painting .cr-grid,
.dr-painting .dr-grid,
.dr-painting .dr-lane-row {
  cursor: cell;
}
.cr-btn.cr-paint-on,
.cr-btn.dr-paint-btn.on {
  background: linear-gradient(135deg, #f9e2af, #fab387);
  border-color: transparent;
  color: #1e1e2e;
  box-shadow: 0 0 0 2px rgba(249, 226, 175, 0.35);
}
.cr-btn.cr-hold-arming {
  position: relative;
  overflow: hidden;
}
.cr-btn.cr-hold-arming::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  top: 0;
  width: 0;
  background: rgba(249, 226, 175, 0.45);
  animation: cr-hold-fill 2s linear forwards;
  pointer-events: none;
}
@keyframes cr-hold-fill {
  to { width: 100%; }
}
.cr-paint-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e1e2e;
  background: linear-gradient(135deg, #f9e2af, #fab387);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.cr-paint-banner[hidden] {
  display: none !important;
}
.dr-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}
.dr-tool-hint {
  font-size: 0.7rem;
  color: #6c7086;
  font-weight: 600;
}
.drum-roll.dr-compact .dr-toolbar .dr-tool-hint {
  display: none;
}
.cr-wkey,
.cr-bkey {
  cursor: pointer;
}
.cr-wkey.cr-key-hit {
  background: #a8c4f0;
}
.cr-bkey.cr-key-hit {
  background: #5b80bd;
}
.cr-seg {
  display: inline-flex;
  border: 1px solid #45475a;
  border-radius: 999px;
  overflow: hidden;
}
.cr-seg button {
  border: 0;
  background: #11111b;
  color: #a6adc8;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}
.cr-seg button.on {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: #fff;
}
.cr-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #cdd6f4;
  cursor: pointer;
}
.cr-check[hidden] {
  display: none;
}
.cr-check input {
  accent-color: #8b5cf6;
}
.cr-help {
  flex: 1 1 260px;
  font-size: 0.7rem;
  color: #6c7086;
}

/* Grid — DAW look: grey rows, piano keyboard down the side, green region strip and notes */
.cr-scroll {
  position: relative;
  overflow: auto;
  max-height: 500px;
  border: 1px solid #0d0d0d;
  border-radius: 6px;
  background: #262626;
  overscroll-behavior: contain;
}
.cr-canvas {
  display: grid;
  width: max-content;
}
.cr-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 6;
  background: #353535;
  border-right: 1px solid #111;
  border-bottom: 1px solid #111;
}
.cr-ruler {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(#3b3b3b, #333);
  border-bottom: 1px solid #111;
}
.cr-bar-num {
  position: absolute;
  top: 1px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #c8c8c8;
  padding-left: 3px;
  border-left: 1px solid #8a8a8a;
  height: 14px;
  line-height: 14px;
}
.cr-tick {
  position: absolute;
  top: 9px;
  width: 1px;
  height: 6px;
  background: #6a6a6a;
}
.cr-chord-tag {
  position: absolute;
  top: 17px;
  height: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #5fae55;
  background: #b6eda9;
  color: #234d1d;
  border-radius: 3px;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: left;
  padding: 0 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cr-tag-play {
  flex: none;
  font-size: 0.5rem;
  border: 1px solid #3d7a34;
  border-radius: 2px;
  padding: 0 2px;
  line-height: 10px;
  color: #2f6627;
}
.cr-chord-tag.active {
  background: #dcffd3;
  border-color: #fff;
  color: #173a12;
  box-shadow: 0 0 0 1px #5fae55 inset;
}
.export-btn.save-btn {
  border-color: rgba(34, 211, 238, 0.55);
  color: #a5f3fc;
}
.export-btn[hidden] {
  display: none;
}
.export-btn.saved {
  border-color: #4ade80;
  color: #bbf7d0;
}

/* MIDI export menu (track combinations) */
.export-midi-wrap {
  position: relative;
  display: inline-flex;
}
.midi-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 220px;
  max-width: min(280px, 90vw);
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #45475a;
  background: #181825;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.midi-export-menu[hidden] {
  display: none !important;
}
.midi-export-heading {
  margin: 6px 4px 4px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6c7086;
}
.midi-export-item,
.midi-export-download {
  border: 0;
  background: transparent;
  color: #cdd6f4;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.midi-export-item:hover,
.midi-export-download:hover {
  background: #313244;
}
.midi-export-download {
  margin-top: 6px;
  background: #1e1e2e;
  border: 1px solid #45475a;
  text-align: center;
  color: #a6e3a1;
}
.midi-export-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #bac2de;
  cursor: pointer;
  border-radius: 6px;
}
.midi-export-check:hover {
  background: #1e1e2e;
}
.midi-export-check input {
  accent-color: #a6e3a1;
}
.midi-export-meta {
  margin-left: auto;
  font-size: 0.65rem;
  color: #6c7086;
  font-weight: 700;
}
.midi-export-hint {
  margin: 6px 4px 2px;
  font-size: 0.65rem;
  line-height: 1.35;
  color: #585b70;
}
.chord-timeline.has-passing:not(.chord-timeline-sectioned) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.chord-timeline.has-passing:not(.chord-timeline-sectioned) > .chord-card {
  min-width: 0;
}
.section-chords .chord-card.passing-card {
  flex: 0 1 112px;
  min-width: 100px;
}
.chord-card.passing-card {
  padding: 12px 8px;
  border-style: dashed;
  border-color: #6d5bd0;
  background: linear-gradient(160deg, #241f3a, #1e1e2e);
}
.chord-card.passing-card .chord-name {
  font-size: 1rem;
}
.chord-card.passing-card .roman-numeral {
  color: #c4b5fd;
  font-size: 0.68rem;
}
.chord-card.passing-card .voicing-tag,
.chord-card.passing-card .chord-basic {
  display: none;
}
.passing-tag {
  margin-top: 6px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a78bfa;
}
.chord-card.passing-card.between-card {
  border-color: #2dd4bf;
  background: linear-gradient(160deg, #15302e, #1e1e2e);
}
.chord-card.between-card .roman-numeral,
.chord-card.between-card .passing-tag {
  color: #5eead4;
}
.chord-card.revoice-picked {
  outline: 2px solid #22d3ee;
  outline-offset: 2px;
}
.cr-chord-tag.cr-tag-pass {
  background: #3b2f5c;
  border-color: #a78bfa;
  color: #e9d5ff;
  font-style: italic;
}
.cr-chord-tag.cr-tag-sel {
  outline: 2px solid #22d3ee;
  outline-offset: 1px;
}
.cr-note.cr-pass {
  border-color: #c4b5fd;
  background: hsl(262, 45%, calc(26% + var(--vel, 0.8) * 14%));
}
.cr-note.cr-picked {
  box-shadow: 0 0 0 1px #22d3ee, 0 0 8px rgba(34, 211, 238, 0.45);
}
.cr-marquee {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(34, 211, 238, 0.12);
  border-left: 1px solid #22d3ee;
  border-right: 1px solid #22d3ee;
  pointer-events: none;
  z-index: 3;
}
.cr-keys {
  position: sticky;
  left: 0;
  z-index: 4;
  background: linear-gradient(90deg, #dcdcdc, #fbfbfb 70%, #e6e6e6);
  border-right: 1px solid #111;
  overflow: hidden;
}
.cr-wkey {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--cr-row, 14px);
}
.cr-wkey b {
  position: absolute;
  right: 4px;
  bottom: 0;
  font-size: 0.6rem;
  line-height: 1;
  font-weight: 800;
  color: #555;
}
.cr-wkey.cr-key-on {
  background: #6f95cf;
}
.cr-wkey.cr-key-on b {
  color: #fff;
}
.cr-wsep {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #9a9a9a;
}
.cr-bkey {
  position: absolute;
  left: 0;
  width: 62%;
  height: var(--cr-row, 14px);
  z-index: 1;
  background: linear-gradient(90deg, #111 0%, #2a2a2a 80%, #3a3a3a 100%);
  border-radius: 0 2px 2px 0;
  box-shadow: 1px 0 1px rgba(0, 0, 0, 0.5);
}
.cr-bkey.cr-key-on {
  background: linear-gradient(90deg, #2f4f86, #5b80bd);
}
.cr-grid {
  position: relative;
  overflow: hidden;
  touch-action: pan-x pan-y;
  background: #2e2e2e;
}
.cr-row-black {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--cr-row, 14px);
  background: #242424;
}
.cr-row-oct {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #4a4a4a;
}
.cr-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
}
.cr-line-step {
  background: rgba(0, 0, 0, 0.22);
}
.cr-line-beat {
  background: #3d3d3d;
}
.cr-line-bar {
  background: #6a6a6a;
}

.cr-note {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px 0 3px;
  border-radius: 2px;
  box-sizing: border-box;
  cursor: grab;
  touch-action: none;
  overflow: hidden;
  border: 1px solid #8fdc80;
  background: hsl(112, 46%, calc(22% + var(--vel, 0.8) * 14%));
  transition: filter 0.15s;
}
.cr-note.cr-hand-L {
  border-color: #6fc08a;
  background: hsl(140, 42%, calc(17% + var(--vel, 0.8) * 12%));
}
.cr-note span {
  flex: none;
  font-size: min(0.6rem, calc(var(--cr-row, 14px) - 3px));
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  white-space: nowrap;
}
.cr-vel {
  flex: 1;
  min-width: 4px;
  height: 2px;
  border-radius: 1px;
  background: rgba(235, 255, 230, 0.85);
  transform: scaleX(var(--vel, 0.8));
  transform-origin: left center;
  pointer-events: none;
}
.cr-note.cr-mel {
  border-color: #f3d27a;
  background: hsl(42, 62%, calc(26% + var(--vel, 0.8) * 14%));
}
.cr-note.cr-mel .cr-vel {
  background: rgba(255, 244, 214, 0.9);
}
.cr-note.cr-muted {
  opacity: 0.25;
}
.cr-note.cr-active {
  filter: brightness(1.25) drop-shadow(0 0 3px rgba(160, 255, 140, 0.55));
}
.cr-note.cr-selected {
  background: #d8f7cf;
  border-color: #fff;
}
.cr-note.cr-selected span {
  color: #1d4417;
  text-shadow: none;
}
.cr-note.cr-selected .cr-vel {
  background: #2f6627;
}
.cr-note.cr-dragging {
  cursor: grabbing;
  z-index: 2;
}
.cr-resize {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  background: linear-gradient(90deg, transparent 0 3px, rgba(255, 255, 255, 0.35) 3px 4px, transparent 4px 5px, rgba(255, 255, 255, 0.35) 5px 6px, transparent 6px);
  opacity: 0.6;
  transition: opacity 0.15s, background-color 0.15s;
}
.cr-note:hover .cr-resize,
.cr-note.cr-dragging .cr-resize {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.22);
}.cr-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  z-index: 3;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.7);
  pointer-events: none;
}
.cr-playhead[hidden] {
  display: none;
}

@media (max-width: 700px) {
  .cr-help {
    display: none;
  }
  .cr-scroll {
    max-height: 340px;
  }
}


/* AI prompt dock: compact bar at the top of the studio */
.studio-workspace > .ai-dock {
  min-height: 0;
  padding: 8px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1b1b26, #18181f);
  border-color: #2e2e3e;
}
.studio-workspace > .ai-dock .dock-row {
  gap: 8px;
}
.studio-workspace > .ai-dock input {
  padding: 10px 14px;
  border-radius: 9px;
}
.studio-workspace > .ai-dock .ai-upload-btn,
.studio-workspace > .ai-dock .send-prompt-btn {
  width: 42px;
  border-radius: 9px;
}
.studio-workspace > .ai-dock .ai-status-msg {
  min-height: 0;
  margin: 0;
  padding: 0 4px;
}
.studio-workspace > .ai-dock .ai-status-msg:not(:empty) {
  margin-top: 6px;
}
.studio-workspace > .ai-dock .ai-image-preview {
  margin-top: 8px;
}
.studio-workspace > .ai-dock.premium-locked {
  overflow: hidden;
}
.studio-workspace > .ai-dock.premium-locked .ai-blur-overlay {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.studio-workspace > .ai-dock .lock-centerpiece {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 10px;
  width: 100%;
  box-sizing: border-box;
}
.studio-workspace > .ai-dock .lock-centerpiece h3 {
  margin: 0;
  font-size: 13px;
  white-space: nowrap;
}
.studio-workspace > .ai-dock .lock-icon {
  font-size: 14px;
}
.studio-workspace > .ai-dock .lock-centerpiece p,
.studio-workspace > .ai-dock .price-tag,
.studio-workspace > .ai-dock .price-sub {
  display: none;
}
.studio-workspace > .ai-dock .upsell-cta {
  width: auto;
  max-width: none;
  padding: 6px 14px;
  font-size: 12px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .studio-workspace > .ai-dock .lock-centerpiece h3 { display: none; }
}

.studio-paywall-msg {
  margin: 12px 0 0;
  font-size: 13px;
  color: #94e2d5;
}
.studio-paywall-msg.error {
  color: #f87171;
}
#studio-trial-btn[hidden] {
  display: none;
}
#studio-trial-btn.is-busy {
  opacity: 0.75;
  pointer-events: none;
}

/* ---- Beat track tabs (Overall / Chords / Melody / Drums / +) ---- */
.roll-track-bar {
  margin: -4px 0 10px;
}
.roll-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid #313244;
}
.roll-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #45475a;
  background: #181825;
  color: #bac2de;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.roll-tab:hover {
  border-color: var(--tab-color, #cba6f7);
  color: #cdd6f4;
}
.roll-tab.active {
  background: color-mix(in srgb, var(--tab-color, #cba6f7) 18%, #181825);
  border-color: var(--tab-color, #cba6f7);
  color: #cdd6f4;
}
.roll-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tab-color, #cdd6f4);
  flex-shrink: 0;
}
.roll-tab-x {
  font-weight: 800;
  opacity: 0.55;
  margin-left: 2px;
  font-style: normal;
}
.roll-tab-x:hover {
  opacity: 1;
  color: #f38ba8;
}
.roll-tab-add {
  border-style: dashed;
  color: #a6adc8;
}
.roll-tab-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding-top: 8px;
}
.roll-tool-hint {
  font-size: 0.7rem;
  color: #6c7086;
}
.roll-tool-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #a6adc8;
  cursor: pointer;
}
.roll-tool-inst {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #a6adc8;
}
.roll-tool-inst select {
  background: #11111b;
  color: #cdd6f4;
  border: 1px solid #45475a;
  border-radius: 6px;
  padding: 3px 6px;
  font: inherit;
  font-size: 0.74rem;
}

/* Per-track volume */
.roll-vol {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #a6adc8;
  user-select: none;
}
.roll-vol-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tab-color, #cdd6f4);
  flex-shrink: 0;
}
.roll-vol-ico {
  font-size: 0.7rem;
  line-height: 1;
}
.roll-vol-name {
  font-weight: 700;
  color: #bac2de;
  min-width: 3.2em;
}
.roll-vol input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 88px;
  height: 4px;
  border-radius: 999px;
  background: #313244;
  outline: none;
  cursor: pointer;
}
.roll-vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tab-color, #cba6f7);
  border: 1px solid #11111b;
  cursor: pointer;
}
.roll-vol input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tab-color, #cba6f7);
  border: 1px solid #11111b;
  cursor: pointer;
}
.roll-vol-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #6c7086;
  min-width: 2.6em;
}
.roll-vol-mixer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.roll-vol-compact input[type="range"] {
  width: 72px;
}

/* Overall / track note colors (chords green, melody gold — foundation preserved) */
.cr-note.cr-track-chords {
  /* keep existing green hand colors */
}
.cr-note.cr-track-melody,
.cr-note.cr-mel {
  border-color: #f9e2af;
  background: hsl(48, 70%, calc(28% + var(--vel, 0.8) * 16%));
}
.chord-roll.cr-view-chords .cr-note.cr-mel {
  opacity: 0.18;
  pointer-events: none;
}
.chord-roll.cr-view-melody .cr-note:not(.cr-mel) {
  opacity: 0.2;
  pointer-events: none;
}
.chord-roll.cr-view-overall .cr-note.cr-mel {
  box-shadow: inset 0 0 0 1px rgba(249, 226, 175, 0.35);
}

/* Drum roll */
.drum-roll {
  margin-top: 4px;
}
.drum-roll[hidden] {
  display: none !important;
}
.drum-roll.dr-compact .dr-scroll {
  max-height: 220px;
}
.drum-roll.dr-compact {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #313244;
}
.dr-scroll {
  overflow: auto;
  max-height: 360px;
  border: 1px solid #313244;
  border-radius: 8px;
  background: #11111b;
}
.dr-canvas {
  position: relative;
}
.dr-corner {
  position: absolute;
  left: 0;
  top: 0;
  background: #181825;
  border-right: 1px solid #313244;
  border-bottom: 1px solid #313244;
  z-index: 3;
}
.dr-ruler {
  position: absolute;
  top: 0;
  background: #181825;
  border-bottom: 1px solid #313244;
  z-index: 2;
}
.dr-bar-num {
  position: absolute;
  top: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #6c7086;
  padding-left: 4px;
}
.dr-labels {
  position: absolute;
  left: 0;
  background: #181825;
  border-right: 1px solid #313244;
  z-index: 3;
}
.dr-lane-label {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #a6adc8;
  border-bottom: 1px solid #1e1e2e;
  box-sizing: border-box;
}
.dr-lane-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dr-grid {
  position: absolute;
  overflow: hidden;
}
.dr-lane-row {
  position: absolute;
  left: 0;
  right: 0;
  border-bottom: 1px solid #1e1e2e;
  cursor: crosshair;
}
.dr-lane-row:hover {
  background: rgba(137, 180, 250, 0.06);
}
.dr-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
}
.dr-line-step { background: #1e1e2e; }
.dr-line-beat { background: #313244; }
.dr-line-bar { background: #585b70; }
.dr-hit {
  position: absolute;
  border-radius: 3px;
  cursor: pointer;
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.dr-hit:hover {
  filter: brightness(1.15);
}
.dr-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f38ba8;
  z-index: 5;
  pointer-events: none;
}
