/* =========================================
   2. TRACK HEADERS & MIXER (UPDATED)
   ========================================= */
.track-headers-container {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: var(--bg-surface-2);
    border-right: 2px solid var(--border-dark);
    z-index: 10;
    display: flex;
    flex-direction: column;
    min-height: 0; /* allow flex child to shrink + scroll */
    overflow: hidden; /* outer does NOT scroll */
    position: relative;
}

.track-headers-spacer {
    height: 24px;
    min-height: 24px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
    z-index: 20;
}
.track-headers-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    /* hide scrollbar if you want a cleaner look; still scrollable via wheel/sync */
    scrollbar-gutter: stable;
	scrollbar-width: none;
}

.track-header {
    height: 120px;
    min-height: 120px;
    max-height: 120px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 4px;
    padding: 4px 4px 4px 2px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-main, #444);
    overflow: hidden;
}

/* left rail (only multi-channel) */
.track-header-rail {
    flex: 0 0 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2px;
    border-right: 1px solid rgba(255,255,255,0.06);
}
/* Rail always available for expand ▸ / explode */
.track-header-rail {
    flex: 0 0 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-top: 2px;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.track-header-main {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    padding-bottom: 2px;
}

.track-header-top {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}


.track-title {
    flex: 1 1 0;           /* take ALL leftover width in the top row */
    min-width: 0;          /* REQUIRED */
    margin-left: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
}

.track-header-controls {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: row;
    align-items: center;          /* vertical center as a group */
    justify-content: space-between;
    gap: 8px;
    padding: 0 2px 2px 0;
}

.track-pan-ctrl {
    flex: 0 0 auto;
    width: 48px !important;
    max-width: 48px !important;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.track-header-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;          /* fader + meter share same center line */
    gap: 4px;
    height: 100%;
    max-height: 92px;
}

.track-fader-ctrl {
    width: 44px !important;
    max-width: 44px !important;
    min-width: 0 !important;
    height: 100%;
    max-height: 92px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ui-component-container.track-fader-ctrl {
    width: 44px !important;
    max-width: 44px !important;
}
.ui-component-container.track-pan-ctrl {
    width: 48px !important;
    max-width: 48px !important;
}

.track-fader-ctrl .ui-svg {
    width: 44px !important;
    max-width: 44px !important;
    height: auto !important;
}
.track-fader-ctrl .ctrl-value-wrap {
    max-width: 42px;
    font-size: 9px;
    padding: 1px 3px;
    margin-top: 2px;
}

/* Meter fills the side column height */
.volume-meter-canvas {
    width: 10px !important;
    height: 88px !important;
    max-height: 88px;
    align-self: center;
    border-radius: 2px;
}

.expand-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 14px;
    height: 14px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    border-radius: 2px;
    flex-shrink: 0;
}
.expand-toggle:hover {
    background: var(--bg-hover);
    color: var(--accent);
}
.track-mute-btn,
.track-solo-btn,
.track-fx-btn,
.track-arm-btn  {
    flex: 0 0 auto;
    width: 20px;
    height: 16px;
    padding: 0;
    font-size: 9px;
    font-weight: 800;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1;
    border: 1px solid var(--border-light, #555);
    background: var(--bg-surface, #1e1e1e);
    color: var(--text-muted, #888);
    box-shadow: none;
}
.track-mute-btn:hover,
.track-solo-btn:hover,
.track-fx-btn:hover,
.track-arm-btn :hover {
    border-color: var(--border-focus, #777);
    color: var(--text-main, #eee);
}
.track-mute-btn.active {
    background: #ff4444;
    border-color: #ff4444;
    color: #111;
}

/* SOLO on — yellow */
.track-solo-btn.active {
    background: #e6b800;
    border-color: #e6b800;
    color: #111;
}

/* FX: has inserts and not bypassed — blue */
.track-fx-btn.active {
    background: #44aaff;
    border-color: #44aaff;
    color: #111;
}

/* FX: user bypassed the chain */
.track-fx-btn.bypassed {
    background: var(--bg-surface, #1e1e1e);
    border-color: #555;
    color: #666;
    opacity: 0.7;
    text-decoration: line-through;
}

/* FX: no inserts at all — same as off (no .active / .bypassed) */
.track-fx-btn:not(.active):not(.bypassed) {
    background: var(--bg-surface, #1e1e1e);
    border-color: var(--border-light, #555);
    color: var(--text-muted, #888);
    opacity: 1;
    text-decoration: none;
}


/* --- Green LED Digital Readout (ControlValueField) --- */
.ctrl-value-wrap, .ui-input {
    background: #0a0b0d;
    border: 1px solid #1e2128;
    border-radius: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
    color: #00ff66;
    font-family: "Courier New", Courier, monospace, monospace;
    font-size: 10px;
    font-weight: 800;
    text-shadow: 0 0 4px rgba(0, 255, 102, 0.4);
    text-align: center;
    padding: 2px 4px;
    box-sizing: border-box;
}
.fx-list { flex: 1; overflow-y: auto; min-height: 120px; }
.fx-row:active { cursor: grabbing; }
.fx-add-btn { width: 100%; padding: 10px; }

.track-fader-ctrl .ctrl-value-wrap {
    max-width: 40px;
    font-size: 9px;
    padding: 1px 2px;
}
.track-fader-ctrl .ui-component-container {
    width: 42px !important;
}
.track-pan-ctrl .ui-component-container {
    width: 30px !important;
}

.track-header.solo-dim {
    opacity: 0.55;
}
.track-header.muted {
    opacity: 0.45;
}
.track-header.muted.solo-dim {
    opacity: 0.35;
}

.track-header--child {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    opacity: 0.95;
    background: rgba(120, 80, 180, 0.12);
}
.track-header--child .track-header-main {
    justify-content: center;
}
.track-header--control .track-title {
    color: #c9a0ff;
}
.track-title-input {
    font-size: 12px;
	width: 100%;
	min-width: 0;
	font: inherit;
	color: inherit;
	background: var(--bg-darker, #111);
	border: 1px solid var(--accent, #00ff88);
	border-radius: 3px;
	padding: 2px 4px;
}

.ctx-menu-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: auto;
}
.ctx-menu {
  position: fixed;
  min-width: 180px;
  max-width: 280px;
  background: var(--bg-elevated, #2a2a2a);
  border: 1px solid var(--border-main, #444);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-main, #eee);
}
.ctx-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.ctx-menu-item:hover,
.ctx-menu-item:focus {
  background: var(--bg-hover, #3a3a3a);
  outline: none;
}
.ctx-menu-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.ctx-menu-sep {
  height: 1px;
  margin: 4px 8px;
  background: var(--border-main, #444);
}
.ctx-menu-sub {
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 2px;
  display: none;
}
.ctx-menu-item.has-sub:hover > .ctx-menu-sub,
.ctx-menu-item.has-sub:focus-within > .ctx-menu-sub {
  display: block;
}
.ctx-menu-caret { opacity: 0.5; font-size: 10px; }
.automatable-hotspot {
  touch-action: none; /* help pointer capture on mobile */
}
.track-arm-btn.active {
    background: #ff2244; /* or your record red */
    color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 34, 68, 0.5);
}
.timeline-item.is-colliding {
  box-shadow: inset 0 0 0 3px red, 0 0 10px rgba(255, 0, 0, 0.8);
  opacity: 0.7;
  z-index: 999 !important;
}
.track-headers-container.is-session-headers .track-headers-spacer {
    background: var(--bg-elevated, #333);
    border-bottom: 1px solid var(--border-main, #333);
    box-sizing: border-box;
    flex-shrink: 0;
}
.primary-headers-slot .track-headers-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.primary-view-body {
    align-items: stretch;
}