/* ============ Arranger (playlist) ============ */
/* A track list pinned to the left, a bar-ruled grid behind it, and clips drawn
   in their track's colour. The whole thing is one grid: the header cells stick
   to the left edge and the ruler sticks to the top, so scrolling in either
   direction keeps the labels in view. */

/* The view's own surface is the page: the toolbar row and any gutter around the
   grid then read as part of the window instead of as a lighter band, and the
   grid inside is what carries the tones. */
.arr-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--sh-bg);
}

/* ---------- Toolbar ---------- */

.arr-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.arr-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px 0 8px;
  background: #333333;
  border: none;
  border-radius: 999px;
  color: #e6e6e6;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s;
}

.arr-pill:hover {
  background: #3d3d3d;
}

.arr-pill .material-symbols-outlined {
  font-size: 15px;
  color: #cfcfcf;
}

.arr-pos-val {
  font-variant-numeric: tabular-nums;
}

.arr-caret {
  font-size: 15px !important;
  color: #8f8f8f !important;
}

.arr-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: #a8a8a8;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s, color 0.1s;
}

.arr-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.arr-icon .material-symbols-outlined {
  font-size: 16px;
}

.arr-spacer {
  flex: 1;
}

.arr-add {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 11px 0 8px;
  background: #333333;
  border: none;
  border-radius: 999px;
  color: #dedede;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.arr-add .material-symbols-outlined {
  font-size: 16px;
}

.arr-add:hover {
  background: #3d3d3d;
  color: #ffffff;
}

/* ---------- Scrolling canvas ---------- */

.arr-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
}

.arr-canvas {
  position: relative;
  display: grid;
  grid-template-columns: var(--arr-head-w) var(--arr-grid-w);
  grid-template-rows: var(--arr-ruler-h);
  grid-auto-rows: var(--arr-row-h);
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  background: #161616;
}

/* ---------- Ruler and its corner ---------- */

.arr-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 6;
  background: var(--sh-inset);
  border-right: 1px solid #000000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.arr-ruler {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--sh-inset);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.arr-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.arr-tick.is-major {
  border-left-color: rgba(255, 255, 255, 0.15);
}

.arr-tick i {
  position: absolute;
  top: 5px;
  left: 5px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: #8a8a8a;
}

/* ---------- Track header ---------- */

/* The sticky cell keeps its own opaque page tone, so the lanes sliding under it
   stay out of sight; the tinted box inside is the track's own surface. */
.arr-head {
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: stretch;
  gap: 5px;
  padding: 4px 6px 4px 0;
  background: var(--sh-inset);
  border-bottom: 1px solid #000000;
}

.arr-head-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 5px 9px;
  margin-left: 6px;
  background: linear-gradient(160deg,
    rgba(var(--c-rgb), 0.32) 0%,
    rgba(var(--c-rgb), 0.16) 55%,
    rgba(var(--c-rgb), 0.10) 100%);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.arr-head-box:hover {
  background: linear-gradient(160deg,
    rgba(var(--c-rgb), 0.42) 0%,
    rgba(var(--c-rgb), 0.24) 55%,
    rgba(var(--c-rgb), 0.16) 100%);
}

/* The open track: the Rack is showing its editor, so the row it came from says
   so rather than leaving the two panes unconnected. */
.arr-head-box.is-selected {
  box-shadow: 0 0 0 1.5px rgba(var(--c-rgb), 0.9);
}

.arr-head-name {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 500;
  color: #ebebeb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arr-head-caret {
  font-size: 12px;
  color: #d6d6d6;
  flex-shrink: 0;
}

.arr-head-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}

.arr-knobpair {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.arr-knob,
.arr-mini {
  position: relative;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #7c7c7c, #464646 74%);
  flex-shrink: 0;
}

.arr-knob::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  width: 2px;
  height: 6px;
  border-radius: 1px;
  background: #f1f1f1;
  transform: translateX(-50%);
}

.arr-mini::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 2px;
  border-radius: 1px;
  background: #f1f1f1;
  transform: translate(-50%, -50%);
}

.arr-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c4c4c4;
  flex-shrink: 0;
}

.arr-phones {
  font-size: 15px;
  color: #c9c9c9;
  flex-shrink: 0;
}

.arr-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2fbf5f;
  box-shadow: 0 0 6px rgba(47, 191, 95, 0.55);
  flex-shrink: 0;
}

/* The track's colour, run down the edge of the list, and the grip lines that
   sit between the list and the grid. */
.arr-stripe {
  width: 5px;
  margin: 4px 0;
  border-radius: 3px;
  background: var(--c);
  flex-shrink: 0;
}

.arr-grip {
  width: 9px;
  flex-shrink: 0;
  opacity: 0.6;
  background-image: repeating-linear-gradient(to right, #000000 0 1px, transparent 1px 3px);
}

/* ---------- Lanes ---------- */

.arr-lane {
  position: relative;
  border-bottom: 1px solid #000000;
  background-color: #111111;
  /* 4-bar lines first so they paint over the per-bar ones. */
  background-image:
    repeating-linear-gradient(to right,
      rgba(255, 255, 255, 0.075) 0 1px,
      transparent 1px calc(var(--arr-bar) * 4)),
    repeating-linear-gradient(to right,
      rgba(255, 255, 255, 0.028) 0 1px,
      transparent 1px var(--arr-bar));
}

.arr-lane.is-alt {
  background-color: #1d1d1d;
}

/* ---------- Slack row and the pinned master strip ---------- */

/* The row between the last track and the master strip. It is the only flexible
   row in the grid, so it is what puts the master strip on the bottom edge when
   the panel is tall enough to show every track at once. Its two halves line up
   with the track list and the lanes above. */
.arr-fill {
  grid-column: 1 / -1;
  display: flex;
  min-height: 0;
}

.arr-fill-head {
  position: sticky;
  left: 0;
  z-index: 4;
  width: var(--arr-head-w);
  flex-shrink: 0;
  background: var(--sh-inset);
  border-right: 1px solid #000000;
}

.arr-fill-lane {
  flex: 1;
  background: #161616;
}

/* The master strip holds itself against the bottom of the viewport while the
   tracks above scroll, so it reads as a floating row rather than one in the
   list. */
.arr-lane.is-pinned {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background-color: #191919;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 -10px 16px rgba(0, 0, 0, 0.5);
}

.arr-head.is-pinned {
  bottom: 0;
  box-shadow: 0 -10px 16px rgba(0, 0, 0, 0.5);
}

