:root {
  --bg: #070913;
  --panel: rgba(9, 12, 24, 0.74);
  --text: #eceeff;
  --line: rgba(255, 255, 255, 0.16);
  --press: rgba(255, 255, 255, 0.85);
  --ui-border: rgba(121, 106, 255, 0.45);
  --ui-panel: rgba(9, 12, 24, 0.82);
  --ui-dark: rgba(10, 13, 24, 0.9);
  --accent: #7565ff;
  --accent-soft: #958bff;
  --scrollbar-track: rgba(8, 11, 22, 0.9);
  --scrollbar-thumb: rgba(128, 121, 255, 0.72);
  --scrollbar-thumb-hover: rgba(150, 221, 255, 0.88);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 0.68rem;
  height: 0.68rem;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid var(--scrollbar-track);
  background: linear-gradient(180deg, var(--accent-soft), var(--scrollbar-thumb));
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover), var(--accent));
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 50% -12%, rgba(165, 157, 255, 0.56), rgba(165, 157, 255, 0.1) 34%, transparent 58%),
    radial-gradient(circle at 22% -7%, rgba(124, 117, 255, 0.38), transparent 44%),
    linear-gradient(180deg, #090c1c 0%, #060812 44%, #060811 100%);
  color: var(--text);
}

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

.controls {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  padding: 0;
  background: linear-gradient(180deg, rgba(13, 16, 30, 0.95), rgba(9, 11, 22, 0.92));
  border: 2px solid var(--ui-border);
  border-bottom: 0;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(2, 3, 9, 0.55);
}

.controls-tabs-row {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.2rem 0.45rem 0.2rem;
  min-height: 2.35rem;
  background: linear-gradient(180deg, rgba(14, 18, 35, 0.96), rgba(10, 13, 27, 0.94));
  border-bottom: 1px solid rgba(148, 140, 255, 0.28);
}

.tabs-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.auth-controls {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
}

.auth-signin-btn {
  min-width: 5.2rem;
}

.auth-user-menu {
  position: relative;
}

.auth-user-btn {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 999px;
  border: 1px solid rgba(135, 219, 255, 0.55);
  background: radial-gradient(circle at 35% 30%, rgba(118, 255, 236, 0.28), rgba(23, 52, 88, 0.92));
  box-shadow: 0 0 0 1px rgba(9, 14, 35, 0.55), inset 0 -6px 12px rgba(2, 8, 26, 0.52);
  cursor: pointer;
}

.auth-user-btn:hover {
  border-color: rgba(156, 232, 255, 0.82);
}

.auth-user-icon {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.auth-user-icon::before,
.auth-user-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(225, 243, 255, 0.95);
}

.auth-user-icon::before {
  top: 0.37rem;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
}

.auth-user-icon::after {
  top: 1.02rem;
  width: 1rem;
  height: 0.7rem;
  border-radius: 0.52rem 0.52rem 0.35rem 0.35rem;
}

.auth-user-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 8.8rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(131, 162, 255, 0.42);
  background: rgba(14, 19, 39, 0.98);
  box-shadow: 0 16px 30px rgba(2, 3, 12, 0.62);
  padding: 0.25rem;
  z-index: 70;
}

.auth-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(234, 243, 255, 0.95);
  text-align: left;
  padding: 0.38rem 0.5rem;
  border-radius: 0.33rem;
  cursor: pointer;
  font-size: 0.78rem;
}

.auth-menu-item:hover {
  background: rgba(89, 131, 255, 0.22);
}

.controls-menu-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  padding: 0.35rem 0.6rem;
  background: linear-gradient(180deg, rgba(11, 14, 27, 0.95), rgba(8, 11, 22, 0.96));
  color: #e7eaff;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dubstep-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.16rem 0.4rem;
  border: 1px solid rgba(137, 184, 255, 0.42);
  border-radius: 0.36rem;
  background: rgba(8, 13, 27, 0.72);
}

.dubstep-controls label {
  display: inline-flex;
  align-items: center;
  gap: 0.26rem;
  font-size: 0.72rem;
  color: rgba(208, 225, 255, 0.92);
}

.dubstep-controls input[type="range"] {
  width: 84px;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin-left: auto;
  font-size: 0.78rem;
  color: rgba(225, 232, 255, 0.92);
}

#masterVolumeSlider {
  width: 9rem;
}

#masterVolumeValue {
  min-width: 2.6rem;
  text-align: right;
  font-size: 0.74rem;
  color: rgba(182, 214, 255, 0.95);
}

.daw-plugin-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.plugin-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  min-width: 19rem;
  max-height: 22rem;
  overflow: auto;
  z-index: 50;
  border: 1px solid rgba(158, 148, 255, 0.42);
  border-radius: 0.55rem;
  background: linear-gradient(180deg, rgba(12, 16, 31, 0.98), rgba(8, 11, 23, 0.99));
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(133, 196, 255, 0.18) inset;
  padding: 0.5rem;
}

.plugin-menu-group {
  padding: 0.35rem 0.2rem 0.5rem;
  border-bottom: 1px solid rgba(137, 130, 255, 0.2);
}

.plugin-menu-group:last-child {
  border-bottom: 0;
}

.plugin-menu-group-title {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(170, 219, 255, 0.95);
  margin-bottom: 0.35rem;
}

.plugin-menu-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(121, 158, 255, 0.25);
  border-radius: 0.42rem;
  background: rgba(14, 19, 37, 0.88);
  color: #ecf1ff;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
  margin-bottom: 0.28rem;
  cursor: pointer;
}

.plugin-menu-item:hover {
  border-color: rgba(142, 225, 255, 0.65);
  background: rgba(27, 37, 66, 0.95);
}

.plugin-menu-item.is-disabled {
  opacity: 0.48;
  cursor: default;
}

.track-pie-menu {
  position: fixed;
  width: 100px;
  height: 200px;
  --track-pie-shape-inset-x: 10px;
  --track-pie-shape-inset-y: 18px;
  --track-pie-shape-radius: 22px;
  --track-pie-shape-rotation: 0deg;
  border-radius: 24px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
  overflow: visible;
}

.track-pie-menu::before {
  content: "";
  position: absolute;
  left: var(--track-pie-shape-inset-x);
  right: var(--track-pie-shape-inset-x);
  top: var(--track-pie-shape-inset-y);
  bottom: var(--track-pie-shape-inset-y);
  border-radius: var(--track-pie-shape-radius);
  background:
    radial-gradient(120% 95% at 50% 32%, rgba(55, 152, 198, 0.95) 0%, rgba(35, 115, 155, 0.86) 56%, rgba(22, 84, 120, 0.76) 100%),
    linear-gradient(180deg, rgba(130, 207, 242, 0.16), rgba(36, 118, 158, 0.12));
  border: 1px solid rgba(24, 98, 140, 0.95);
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.3);
  opacity: 0.1;
  transform: rotate(var(--track-pie-shape-rotation));
  transform-origin: center;
  z-index: 121;
  pointer-events: none;
}

.track-pie-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 122;
}

.track-pie-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.2rem;
  height: 2.2rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(172, 196, 255, 0.35);
  background: radial-gradient(circle at 30% 25%, rgba(155, 219, 255, 0.38), rgba(44, 58, 92, 0.76));
  box-shadow: 0 0 0 1px rgba(133, 192, 255, 0.18) inset;
  color: transparent;
  cursor: default;
  pointer-events: auto;
  z-index: 124;
}

.track-pie-center::before,
.track-pie-center::after {
  content: "";
  position: absolute;
  opacity: 0;
  transition: opacity 120ms ease;
}

.track-pie-center.is-back {
  border-color: rgba(178, 218, 255, 0.74);
  background: radial-gradient(circle at 35% 26%, rgba(170, 228, 255, 0.58), rgba(43, 66, 103, 0.92));
  cursor: pointer;
}

.track-pie-center.is-back::before {
  left: 28%;
  top: 50%;
  width: 0.72rem;
  height: 0.72rem;
  border-left: 2px solid rgba(232, 246, 255, 0.95);
  border-bottom: 2px solid rgba(232, 246, 255, 0.95);
  transform: translateY(-50%) rotate(45deg);
}

.track-pie-center.is-back::after {
  left: 44%;
  top: 50%;
  width: 0.62rem;
  height: 2px;
  background: rgba(232, 246, 255, 0.95);
  transform: translateY(-50%);
}

.track-pie-center.is-back::before,
.track-pie-center.is-back::after {
  opacity: 1;
}

.track-pie-item {
  position: absolute;
  padding: 0.34rem 0.72rem;
  --track-pie-item-tx: -50%;
  --track-pie-item-ty: -50%;
  --track-pie-item-scale: 1;
  transform: translate(var(--track-pie-item-tx), var(--track-pie-item-ty)) scale(var(--track-pie-item-scale));
  border: 2px solid rgba(15, 95, 132, 0.98);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34, 175, 236, 0.96), rgba(25, 145, 203, 0.94));
  color: #e8f8ff;
  font-size: 0.76rem;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
  z-index: 123;
  opacity: 1;
  user-select: none;
  transition: left 180ms cubic-bezier(0.22, 0.9, 0.25, 1), top 180ms cubic-bezier(0.22, 0.9, 0.25, 1), transform 180ms cubic-bezier(0.22, 0.9, 0.25, 1), opacity 160ms ease;
}

.track-pie-item.is-dragging {
  opacity: 0.5;
}

.track-pie-item.is-drop-target {
  outline: 2px solid rgba(167, 233, 255, 0.95);
  outline-offset: 1px;
}

.track-pie-item.is-entering {
  opacity: 0;
  --track-pie-item-scale: 0.66;
}

.track-pie-item.is-settled {
  opacity: 1;
  --track-pie-item-scale: 1;
}

.track-pie-item:hover {
  border-color: rgba(12, 84, 120, 0.98);
  background: linear-gradient(180deg, rgba(52, 188, 245, 0.98), rgba(30, 156, 214, 0.96));
}

.plugin-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plugin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 14, 0.68);
  backdrop-filter: blur(3px);
}

.plugin-modal-panel {
  position: relative;
  width: min(1080px, calc(100vw - 2.4rem));
  height: min(720px, calc(100vh - 2.4rem));
  border: 1px solid rgba(145, 138, 255, 0.48);
  border-radius: 0.8rem;
  background: linear-gradient(180deg, rgba(10, 14, 28, 0.97), rgba(7, 9, 18, 0.98));
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.plugin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(139, 131, 255, 0.25);
}

.plugin-modal-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #eef2ff;
}

.plugin-modal-track {
  padding: 0.35rem 0.75rem 0.5rem;
  color: rgba(190, 229, 255, 0.95);
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(139, 131, 255, 0.2);
}

.plugin-modal-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 0;
}

.plugin-list {
  border-right: 1px solid rgba(137, 130, 255, 0.2);
  padding: 0.55rem;
  overflow: auto;
}

.plugin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.36rem 0.42rem;
  border: 1px solid rgba(126, 154, 255, 0.2);
  border-radius: 0.42rem;
  background: rgba(14, 18, 34, 0.88);
  margin-bottom: 0.35rem;
  position: relative;
}

.plugin-list-item.is-selected {
  border-color: rgba(140, 222, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(126, 211, 255, 0.2) inset;
}

.plugin-list-item.is-premium-locked {
  border-color: rgba(202, 171, 82, 0.42);
  background: linear-gradient(180deg, rgba(43, 37, 23, 0.88), rgba(20, 18, 14, 0.9));
}

.plugin-list-item.is-premium-locked .plugin-list-btn {
  color: rgba(225, 218, 194, 0.86);
  opacity: 0.78;
}

.plugin-list-item.is-premium-locked::after {
  content: "★";
  position: absolute;
  right: 0.34rem;
  top: 0.06rem;
  font-size: 0.62rem;
  color: #f0c44d;
  text-shadow: 0 0 8px rgba(255, 217, 126, 0.72);
  pointer-events: none;
}

.premium-offer-panel {
  width: min(520px, calc(100vw - 2.2rem));
  height: auto;
  min-height: 0;
  grid-template-rows: auto 1fr;
}

.premium-offer-body {
  padding: 0.95rem 1rem 1.1rem;
}

.premium-offer-feature {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff4d4;
  margin: 0 0 0.55rem;
}

.premium-offer-copy {
  margin: 0;
  color: rgba(231, 241, 255, 0.92);
  line-height: 1.4;
}

.premium-offer-actions {
  margin-top: 0.95rem;
  display: flex;
  justify-content: flex-end;
}

.plugin-list-btn {
  background: transparent;
  border: 0;
  color: #ebefff;
  text-align: left;
  flex: 1;
  cursor: pointer;
  padding: 0;
}

.plugin-list-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.plugin-editor {
  padding: 0.75rem;
  overflow: auto;
}

.plugin-editor-lock-panel {
  margin-top: 0.5rem;
  border: 1px solid rgba(202, 171, 82, 0.46);
  border-radius: 0.65rem;
  background: linear-gradient(180deg, rgba(43, 37, 23, 0.85), rgba(20, 18, 14, 0.92));
  padding: 0.72rem 0.78rem;
  display: grid;
  gap: 0.5rem;
}

.plugin-editor-lock-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: rgba(255, 236, 181, 0.96);
}

.plugin-editor-lock-copy {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.38;
  color: rgba(232, 223, 197, 0.92);
}

.plugin-editor-lock-cta {
  justify-self: start;
}

.plugin-premium-note {
  margin: 0.35rem 0 0.55rem;
  font-size: 0.78rem;
  color: rgba(205, 227, 255, 0.88);
}

.plugin-editor h4 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}

.plugin-preset-bar {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  margin: 0 0 0.65rem;
  flex-wrap: wrap;
}

.plugin-preset-select {
  min-width: 190px;
}

.plugin-preset-inline {
  display: flex;
  align-items: center;
  gap: 0.34rem;
}

.plugin-editor-row {
  display: grid;
  grid-template-columns: 118px 1fr 68px;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.42rem;
}

.plugin-editor-row label {
  font-size: 0.78rem;
  color: rgba(220, 233, 255, 0.92);
}

.plugin-editor-row input[type="range"] {
  width: 100%;
}

.plugin-editor-value {
  text-align: right;
  font-size: 0.76rem;
  color: rgba(192, 230, 255, 0.94);
}

.plugin-eq-canvas {
  width: 100%;
  height: 170px;
  border: 1px solid rgba(116, 178, 238, 0.34);
  border-radius: 0.78rem;
  background:
    radial-gradient(130% 100% at 18% 20%, rgba(70, 168, 233, 0.2) 0%, rgba(70, 168, 233, 0) 56%),
    radial-gradient(120% 120% at 72% 20%, rgba(233, 95, 167, 0.16) 0%, rgba(233, 95, 167, 0) 62%),
    linear-gradient(180deg, rgba(7, 12, 25, 0.98), rgba(4, 8, 18, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(220, 244, 255, 0.08),
    inset 0 -20px 44px rgba(0, 0, 0, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.7rem;
}

.plugin-smart-eq-canvas {
  height: 220px;
}

.plugin-eq-canvas:active {
  border-color: rgba(126, 202, 255, 0.52);
}

.plugin-smart-eq-hint {
  margin: -0.3rem 0 0.6rem;
  font-size: 0.72rem;
  color: rgba(177, 202, 240, 0.84);
}

.plugin-smart-eq-quick {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: -0.2rem 0 0.5rem;
}

.plugin-smart-eq-controls {
  border-top: 1px solid rgba(129, 162, 238, 0.24);
  padding-top: 0.5rem;
}

.plugin-smart-eq-controls .plugin-editor-row select {
  width: 100%;
}

.plugin-smart-eq-controls .plugin-editor-row input[type="checkbox"] {
  justify-self: start;
}

.plugin-graphic-eq {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.28rem;
  overflow-x: auto;
  margin: 0.18rem 0 0.62rem;
  padding: 0.42rem 0.4rem 0.3rem;
  border: 1px solid rgba(118, 150, 243, 0.26);
  border-radius: 0.5rem;
  background: linear-gradient(180deg, rgba(10, 14, 28, 0.94), rgba(7, 11, 22, 0.97));
}

.plugin-graphic-eq-band {
  display: grid;
  justify-items: center;
  gap: 0.18rem;
  flex: 0 0 1.72rem;
}

.plugin-graphic-eq-gain {
  font-size: 0.64rem;
  color: rgba(200, 230, 255, 0.92);
  min-height: 1.05em;
}

.plugin-graphic-eq-slider {
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  width: 1.05rem;
  height: 124px;
  accent-color: var(--band-color, rgba(123, 200, 255, 0.92));
}

.plugin-graphic-eq-freq {
  font-size: 0.62rem;
  color: rgba(186, 210, 242, 0.92);
}

.daw-loop-toggle-wrap {
  margin-left: 0.08rem;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.daw-loop-toggle-label {
  font-size: 0.76rem;
  color: rgba(201, 223, 255, 0.92);
}

.plugin-automation-wrap {
  margin-top: 0.7rem;
  border-top: 1px solid rgba(129, 162, 238, 0.24);
  padding-top: 0.55rem;
}

.plugin-automation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.32rem;
}

.plugin-automation-title {
  font-size: 0.78rem;
  color: rgba(204, 223, 255, 0.92);
}

.plugin-automation-canvas {
  width: 100%;
  height: 134px;
  border: 1px solid rgba(118, 150, 243, 0.3);
  border-radius: 0.45rem;
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.88), rgba(6, 9, 18, 0.92));
}

.plugin-automation-hint {
  margin-top: 0.24rem;
  font-size: 0.7rem;
  color: rgba(173, 197, 236, 0.84);
}

.parent-fx-override-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.38rem;
  padding: 0.24rem 0.32rem;
  border: 1px solid rgba(135, 161, 220, 0.3);
  border-radius: 0.42rem;
  background: rgba(11, 16, 30, 0.58);
}

.parent-fx-override-bar.is-empty {
  display: none;
}

.parent-fx-override-title {
  font-size: 0.73rem;
  color: rgba(210, 227, 255, 0.92);
  min-width: 5.2rem;
}

.parent-fx-override-chips {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.parent-fx-override-empty {
  font-size: 0.7rem;
  color: rgba(163, 186, 224, 0.8);
}

.parent-fx-override-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.36rem;
  border: 1px solid rgba(238, 112, 112, 0.62);
  border-radius: 999px;
  background: rgba(56, 17, 17, 0.6);
  color: rgba(255, 199, 199, 0.95);
  font-size: 0.69rem;
}

.parent-fx-panel {
  margin: 0 0 0.55rem;
  border: 1px solid rgba(135, 161, 220, 0.28);
  border-radius: 0.45rem;
  background: rgba(8, 12, 24, 0.58);
  overflow: hidden;
}

.parent-fx-panel > summary {
  cursor: pointer;
  padding: 0.35rem 0.45rem;
  font-size: 0.76rem;
  color: rgba(211, 230, 255, 0.9);
  user-select: none;
}

.parent-fx-panel-body {
  padding: 0.3rem 0.42rem 0.45rem;
  border-top: 1px solid rgba(129, 162, 238, 0.22);
}

.parent-fx-panel-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.38rem;
}

.parent-fx-list {
  display: grid;
  gap: 0.3rem;
}

.parent-fx-empty {
  font-size: 0.72rem;
  color: rgba(166, 188, 224, 0.8);
}

.parent-fx-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0.36rem;
  border: 1px solid rgba(120, 149, 213, 0.28);
  border-radius: 0.36rem;
  background: rgba(12, 17, 31, 0.72);
  overflow: hidden;
}

.parent-fx-item.is-overridden {
  background: rgba(42, 42, 46, 0.72);
  border-color: rgba(176, 109, 109, 0.55);
  color: rgba(190, 193, 201, 0.9);
}

.parent-fx-item.is-overridden::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    10deg,
    transparent 47%,
    rgba(255, 88, 88, 0.9) 49%,
    rgba(255, 88, 88, 0.9) 51%,
    transparent 53%
  );
  pointer-events: none;
}

.parent-fx-item-label {
  font-size: 0.73rem;
  color: rgba(223, 233, 255, 0.92);
}

.parent-fx-item-override {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.7rem;
}

.export-modal-panel {
  width: min(620px, calc(100vw - 2.2rem));
  height: auto;
  max-height: min(760px, calc(100vh - 2.2rem));
}

.export-modal-body {
  padding: 0.75rem;
  overflow: auto;
}

.export-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.52rem;
}

.export-row label {
  font-size: 0.82rem;
  color: rgba(224, 236, 255, 0.92);
}

.export-row input,
.export-row select {
  width: 100%;
  border: 1px solid rgba(124, 157, 241, 0.35);
  border-radius: 0.35rem;
  background: rgba(9, 14, 28, 0.92);
  color: #eef2ff;
  padding: 0.36rem 0.45rem;
}

.export-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: rgba(224, 236, 255, 0.9);
  margin: 0.35rem 0 0.6rem;
}

.export-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid rgba(140, 132, 255, 0.24);
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: auto;
}

.controls-menu-row label {
  color: rgba(228, 232, 255, 0.9);
}

.controls-menu-row select,
.controls-menu-row .btn {
  color: #eef1ff;
}

.sound-native-select {
  display: none;
}

.sound-drawer-toggle {
  display: inline-flex;
  align-items: center;
  min-width: min(16rem, 56vw);
  justify-content: space-between;
}

.sound-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 42;
}

.sound-drawer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(360px, 88vw);
  border-right: 1px solid rgba(145, 173, 255, 0.36);
  background: linear-gradient(180deg, rgba(9, 14, 27, 0.98), rgba(6, 10, 21, 0.96));
  box-shadow: 18px 0 34px rgba(0, 0, 0, 0.44);
  transform: translateX(-105%);
  transition: transform 220ms ease;
  z-index: 43;
  display: grid;
  grid-template-rows: auto 1fr;
}

.sound-drawer.is-open {
  transform: translateX(0);
}

.sound-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(142, 168, 245, 0.3);
}

.sound-drawer-head h3 {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(228, 238, 255, 0.95);
}

.sound-drawer-list {
  overflow: auto;
  padding: 0.45rem;
}

.sound-drawer-group {
  margin-bottom: 0.65rem;
}

.sound-drawer-group h4 {
  margin: 0 0 0.35rem;
  padding: 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(165, 196, 255, 0.82);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sound-drawer-items {
  display: grid;
  gap: 0.28rem;
}

.sound-drawer-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  align-items: center;
}

.sound-drawer-item-btn {
  display: inline-flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.sound-drawer-item-btn.is-active {
  border-color: rgba(150, 216, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(120, 201, 255, 0.35) inset;
}

.sound-delete-btn {
  padding-inline: 0.45rem;
  border-color: rgba(255, 136, 136, 0.5);
  color: rgba(255, 214, 214, 0.95);
}

.sound-delete-btn:hover {
  border-color: rgba(255, 152, 152, 0.82);
  background: rgba(55, 14, 22, 0.9);
}

label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

select,
.btn {
  border: 1px solid rgba(150, 145, 255, 0.34);
  border-radius: 0.35rem;
  background: rgba(8, 12, 26, 0.92);
  color: var(--text);
  padding: 0.3rem 0.45rem;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #f4f4ff;
  border: 1px solid #aaa5ff;
  font-weight: 600;
}

.instrument-wrap {
  flex: 1;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 2.3rem;
  overflow: hidden;
}

.timeline-panel {
  height: 12.8rem;
  border: 2px solid var(--ui-border);
  border-top: 0;
  background: #030716;
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  overflow: hidden;
}

.mode-tabs {
  display: flex;
  align-items: center;
  gap: 0;
}

.timeline-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  min-height: 0;
}

.timeline-body.daw-single-column {
  grid-template-columns: 1fr;
}

.timeline-main {
  min-width: 0;
  min-height: 0;
}

.timeline-tab {
  border: 1px solid var(--ui-border);
  border-radius: 0;
  background: rgba(16, 20, 38, 0.9);
  color: #e4e7ff;
  padding: 0.42rem 1.6rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.timeline-tab + .timeline-tab {
  border-left: 0;
}

.timeline-tab.is-active {
  background: linear-gradient(180deg, #8d83ff, #6d5ef0);
  border-color: rgba(196, 190, 255, 0.75);
  box-shadow: none;
  color: #f8f9ff;
}

.timeline-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-top: 1px solid rgba(150, 145, 255, 0.28);
  border-bottom: 1px solid rgba(150, 145, 255, 0.28);
  background: #030716;
}

.chord-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

#drumMachineControls {
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  max-height: min(30vh, 190px);
  overflow: auto;
}

#drumMachineControls label {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

#drumMachineControls input[type="range"] {
  width: 5.2rem;
}

#openDrumMachineBtn.is-active {
  border-color: rgba(144, 224, 178, 0.7);
  box-shadow: 0 0 0 1px rgba(94, 190, 136, 0.5) inset;
}

#openLoopMachineBtn.is-active {
  border-color: rgba(155, 206, 255, 0.78);
  box-shadow: 0 0 0 1px rgba(114, 181, 243, 0.5) inset;
}

#metronomeToggleBtn.is-active {
  border-color: rgba(246, 225, 146, 0.94);
  box-shadow: 0 0 0 1px rgba(224, 182, 68, 0.44) inset;
}

.drum-machine-drawer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(380px, 88vw);
  border-right: 1px solid rgba(145, 173, 255, 0.36);
  background: linear-gradient(180deg, rgba(9, 14, 27, 0.98), rgba(6, 10, 21, 0.96));
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 18px 0 34px rgba(0, 0, 0, 0.44);
  z-index: 44;
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 220ms ease;
}

.drum-machine-drawer.is-open {
  transform: translateX(0);
}

#dawToolsDrawer {
  left: 0;
  right: auto;
  top: 2.35rem;
  bottom: 0;
  width: min(250px, 78vw);
  border-right: 1px solid rgba(128, 190, 246, 0.38);
  border-left: 0;
  box-shadow: 16px 0 30px rgba(0, 0, 0, 0.42);
  background: linear-gradient(180deg, rgba(7, 12, 23, 0.98), rgba(5, 10, 20, 0.96));
  transform: translateX(-108%);
  z-index: 46;
}

#dawToolsDrawer.is-open {
  transform: translateX(0);
}

#dawToolsDrawerBackdrop {
  background: transparent;
  z-index: 45;
}

#openDawToolsBtn.is-active {
  border-color: rgba(124, 199, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(97, 172, 235, 0.52) inset;
}

#openFxBtn.is-premium-locked,
#openDawToolsBtn.is-premium-locked {
  position: relative;
  border-color: rgba(202, 171, 82, 0.42);
  background: linear-gradient(180deg, rgba(43, 37, 23, 0.88), rgba(20, 18, 14, 0.9));
  color: rgba(225, 218, 194, 0.9);
}

#openFxBtn.is-premium-locked::after,
#openDawToolsBtn.is-premium-locked::after {
  content: "★";
  position: absolute;
  top: -0.22rem;
  right: -0.15rem;
  font-size: 0.62rem;
  color: #f0c44d;
  text-shadow: 0 0 8px rgba(255, 217, 126, 0.72);
  pointer-events: none;
}

#openFxBtn.is-premium-locked:hover,
#openDawToolsBtn.is-premium-locked:hover {
  border-color: rgba(226, 194, 102, 0.72);
  background: linear-gradient(180deg, rgba(51, 42, 24, 0.92), rgba(26, 22, 14, 0.93));
}

#dawToolsDrawer .drum-machine-drawer-head {
  padding: 0.5rem 0.7rem;
  border-bottom-color: rgba(126, 194, 248, 0.24);
  background: rgba(10, 16, 30, 0.62);
}

#dawToolsDrawer .drum-machine-drawer-body {
  overflow: auto;
  padding: 0.45rem;
}

#dawToolsDrawer .daw-tools-list {
  border-right: 0;
  padding: 0.25rem;
}

#dawToolsDrawer .daw-tools-list .plugin-list-item {
  margin-bottom: 0.32rem;
}

#dawToolsDrawer .daw-tools-list .plugin-list-btn {
  font-size: 0.83rem;
}

#dawToolDetailDrawer {
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  min-height: 10rem;
  max-height: none;
  z-index: 47;
}

#dawToolDetailDrawer .drum-machine-drawer-body {
  overflow: auto;
  padding: 0.65rem;
}

#dawToolDetailDrawer .drum-machine-controls {
  display: grid;
  gap: 0.65rem;
}

#dawToolDetailDrawer .daw-tools-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.55rem;
  border: 1px solid rgba(113, 172, 230, 0.28);
  border-radius: 0.5rem;
  background: linear-gradient(180deg, rgba(15, 22, 40, 0.7), rgba(10, 17, 31, 0.62));
}

#dawToolDetailDrawer .daw-tools-card-title {
  font-size: 0.79rem;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: rgba(219, 236, 255, 0.94);
}

#dawToolDetailDrawer label {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.34rem;
  align-items: start;
}

#dawToolDetailDrawer input[type="range"] {
  width: 100%;
}

#dawToolDetailDrawer select {
  width: 100%;
}

#dawToolDetailDrawer .drum-value {
  font-size: 0.78rem;
  color: rgba(192, 218, 252, 0.9);
}

#dawToolDetailDrawer .btn {
  justify-self: start;
}

#dawToolDetailDrawer .daw-tools-inline-check {
  display: inline-flex;
  align-items: center;
  grid-template-columns: none;
  gap: 0.4rem;
}

#dawToolDetailDrawer .daw-tools-inline-check input[type="checkbox"] {
  width: auto;
  margin: 0;
}

#dawToolDetailDrawer .daw-tools-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

#dawToolDetailDrawer .daw-master-diff-report {
  margin: 0.1rem 0 0;
  min-height: 8.4rem;
  max-height: 14.5rem;
  overflow: auto;
  padding: 0.45rem 0.52rem;
  border-radius: 0.38rem;
  border: 1px solid rgba(116, 168, 230, 0.3);
  background: rgba(5, 10, 22, 0.74);
  font-size: 0.68rem;
  line-height: 1.32;
  color: rgba(189, 219, 250, 0.92);
  font-family: "Consolas", "Menlo", "Monaco", monospace;
  white-space: pre;
}

#dawToolDetailDrawer .daw-master-diff-chart {
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: block;
  border: 1px solid rgba(116, 168, 230, 0.3);
  border-radius: 0.42rem;
  background: rgba(8, 12, 22, 0.9);
}

#dawToolMasterDiffPanel .daw-master-diff-layout {
  --master-diff-pane-height: 420px;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1fr);
  gap: 0.65rem;
  align-items: stretch;
}

#dawToolMasterDiffPanel .daw-master-diff-selectors {
  grid-column: 1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 0.32rem 0.42rem;
  min-width: 0;
}

#dawToolMasterDiffPanel .daw-master-diff-selector-item {
  min-width: 0;
}

#dawToolMasterDiffPanel .daw-master-diff-analyze-row {
  grid-column: 1 / span 2;
  justify-content: stretch;
}

#dawToolMasterDiffPanel #analyzeDawMasterDiffBtn {
  width: 100%;
  justify-content: center;
  border-color: rgba(255, 211, 120, 0.9);
  background: linear-gradient(180deg, rgba(255, 166, 46, 0.92), rgba(223, 113, 24, 0.95));
  color: rgba(22, 10, 2, 0.98);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(255, 208, 132, 0.4) inset, 0 4px 14px rgba(206, 98, 19, 0.35);
}

#dawToolMasterDiffPanel #analyzeDawMasterDiffBtn:hover {
  border-color: rgba(255, 229, 165, 0.95);
  background: linear-gradient(180deg, rgba(255, 184, 66, 0.95), rgba(241, 125, 31, 0.98));
}

#dawToolMasterDiffPanel .daw-master-diff-profile-row,
#dawToolMasterDiffPanel .daw-master-diff-save-row {
  grid-column: 1 / span 2;
}

#dawToolMasterDiffPanel .daw-master-diff-chart-wrap {
  grid-column: 1 / span 2;
  display: grid;
  align-self: stretch;
  min-height: var(--master-diff-pane-height);
  max-height: var(--master-diff-pane-height);
  min-width: 0;
}

#dawToolMasterDiffPanel .daw-master-diff-console-wrap {
  grid-column: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-self: stretch;
  min-height: 0;
  min-width: 0;
}

#dawToolMasterDiffPanel .daw-master-diff-console-wrap .daw-master-diff-report {
  min-height: 420px;
  height: var(--master-diff-pane-height);
}

#dawToolMasterDiffPanel #analyzeDawMasterDiffBtn.is-busy {
  cursor: wait;
  opacity: 0.9;
}

#dawToolMasterDiffPanel #analyzeDawMasterDiffBtn.is-busy::before {
  content: "";
  width: 0.78rem;
  height: 0.78rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  border: 2px solid rgba(21, 11, 3, 0.36);
  border-top-color: rgba(21, 11, 3, 0.96);
  display: inline-block;
  animation: master-diff-spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes master-diff-spin {
  to {
    transform: rotate(360deg);
  }
}

#dawToolMasterDiffPanel .daw-master-diff-console-wrap .drum-machine-help {
  margin-top: 0.22rem;
}

#dawToolMasterDiffPanel .daw-tools-row {
  flex-wrap: nowrap;
  overflow-x: auto;
}

#dawToolMasterDiffPanel #dawToolMasterDiffProfileName {
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  flex: 0 0 170px;
}

@media (max-width: 1100px) {
  #dawToolMasterDiffPanel .daw-master-diff-layout {
    --master-diff-pane-height: 280px;
    grid-template-columns: 1fr;
  }
  #dawToolMasterDiffPanel .daw-master-diff-selectors,
  #dawToolMasterDiffPanel .daw-master-diff-chart-wrap,
  #dawToolMasterDiffPanel .daw-master-diff-console-wrap {
    grid-column: auto;
    grid-row: auto;
  }
  #dawToolMasterDiffPanel .daw-master-diff-selectors {
    grid-template-columns: 1fr;
  }
  #dawToolMasterDiffPanel .daw-master-diff-analyze-row {
    grid-column: auto;
  }
  #dawToolMasterDiffPanel .daw-master-diff-profile-row,
  #dawToolMasterDiffPanel .daw-master-diff-save-row {
    grid-column: auto;
  }
  #dawToolMasterDiffPanel .daw-master-diff-chart-wrap {
    min-height: 280px;
  }
}

#dawToolDetailDrawer #cancelDawVocalStripBtn:disabled {
  opacity: 0.55;
}

#dawToolVocalStripStatus {
  min-height: 2.1em;
}

#dawToolDetailDrawer .drum-machine-help {
  margin: -0.1rem 0 0.3rem;
  line-height: 1.35;
  font-size: 0.75rem;
  color: rgba(170, 198, 238, 0.84);
}

.drum-machine-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(139, 131, 255, 0.26);
  background: rgba(12, 16, 31, 0.42);
}

.drum-machine-drawer-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: rgba(221, 231, 255, 0.95);
}

#drumMachineControls {
  display: grid;
  align-content: start;
  gap: 0.42rem;
  padding: 0.65rem;
  max-height: none;
}

#drumMachineControls label {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  align-items: center;
  gap: 0.45rem;
}

#drumMachineControls .btn {
  justify-self: start;
}

.loop-machine-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 9.6rem;
  max-height: none;
  border-top: 1px solid rgba(126, 192, 250, 0.42);
  background: linear-gradient(180deg, rgba(10, 16, 30, 0.98), rgba(7, 12, 24, 0.97));
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.42);
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr;
  transform: translateY(102%);
  transition: transform 220ms ease;
  pointer-events: none;
}

.loop-machine-drawer.is-open {
  transform: translateY(0);
  pointer-events: auto;
}

.bottom-drawer-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  cursor: ns-resize;
  z-index: 3;
  background: linear-gradient(180deg, rgba(124, 191, 255, 0.34), rgba(95, 164, 238, 0));
}

.bottom-drawer-resize-handle:hover {
  background: linear-gradient(180deg, rgba(150, 212, 255, 0.45), rgba(95, 164, 238, 0.06));
}

.loop-machine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(126, 192, 250, 0.3);
}

.loop-machine-body {
  display: grid;
  grid-template-columns: var(--loop-machine-settings-width, 260px) 8px 1fr;
  min-height: 0;
}

.loop-machine-resize-handle {
  cursor: col-resize;
  background: linear-gradient(180deg, rgba(107, 164, 230, 0.18), rgba(90, 148, 220, 0.3));
  border-left: 1px solid rgba(126, 192, 250, 0.22);
  border-right: 1px solid rgba(126, 192, 250, 0.22);
}

.loop-machine-resize-handle:hover {
  background: linear-gradient(180deg, rgba(124, 191, 255, 0.34), rgba(95, 164, 238, 0.45));
}

.loop-machine-settings {
  display: grid;
  gap: 0.42rem;
  padding: 0.65rem;
  border-right: 1px solid rgba(126, 192, 250, 0.22);
  overflow: auto;
}

.loop-machine-settings label {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  align-items: center;
  gap: 0.45rem;
}

.loop-bars-control {
  display: inline-grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.22rem;
  align-items: center;
}

.loop-bars-control .btn {
  min-width: 1.9rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.loop-machine-settings .btn {
  justify-self: start;
}

.loop-machine-perf {
  display: grid;
  grid-template-rows: auto auto minmax(152px, 1fr);
  gap: 0.4rem;
  padding: 0.6rem;
  min-height: 0;
}

.loop-machine-top-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.loop-machine-tabs {
  display: inline-flex;
  gap: 0.24rem;
}

.loop-machine-tab {
  min-width: 4.8rem;
}

.loop-machine-tab.is-active {
  border-color: rgba(154, 218, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(126, 196, 255, 0.35) inset;
}

.loop-machine-status {
  font-size: 0.78rem;
  color: rgba(194, 224, 255, 0.9);
}

.loop-machine-frame-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.38rem;
  min-width: 0;
  align-items: center;
}

.loop-machine-frame-rail {
  display: flex;
  align-items: stretch;
  gap: 0.38rem;
  min-height: 2.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.1rem;
}

.loop-machine-frame-chip {
  min-width: 7.2rem;
  max-width: 9.2rem;
  border: 1px solid hsla(var(--frame-hue, 200), 64%, 68%, 0.55);
  border-radius: 0.3rem;
  background: linear-gradient(180deg, hsla(var(--frame-hue, 200), 54%, 38%, 0.55), hsla(var(--frame-hue, 200), 62%, 18%, 0.82));
  color: rgba(235, 248, 255, 0.95);
  padding: 0.2rem 0.3rem;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.2rem;
  cursor: pointer;
}

.loop-machine-frame-chip.is-active {
  border-color: hsla(var(--frame-hue, 200), 88%, 84%, 0.95);
  box-shadow: 0 0 0 1px hsla(var(--frame-hue, 200), 74%, 65%, 0.4) inset;
}

.loop-machine-frame-chip.is-drop-target {
  border-style: dashed;
}

.loop-machine-frame-chip-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.34rem;
  font-size: 0.63rem;
  font-weight: 700;
}

.loop-machine-frame-chip-bars {
  font-weight: 500;
  opacity: 0.86;
}

.loop-machine-frame-preview {
  width: 100%;
  height: 1.45rem;
  border-radius: 0.16rem;
  border: 1px solid rgba(205, 230, 255, 0.2);
  background: linear-gradient(180deg, rgba(4, 9, 18, 0.72), rgba(2, 5, 10, 0.8));
}

.loop-machine-next-frame {
  min-width: 2.2rem;
  min-height: 2.2rem;
  font-size: 1.2rem;
  line-height: 1;
}

.loop-machine-frame-color-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.loop-frame-menu {
  position: fixed;
  z-index: 65;
  min-width: 10rem;
  padding: 0.3rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(134, 196, 252, 0.5);
  background: rgba(8, 15, 28, 0.97);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  display: grid;
  gap: 0.2rem;
}

.loop-frame-menu.is-hidden {
  display: none;
}

.loop-frame-menu-item {
  width: 100%;
  text-align: left;
  font-size: 0.78rem;
  color: rgba(218, 238, 255, 0.96);
  background: rgba(40, 66, 102, 0.42);
  border: 1px solid rgba(130, 187, 239, 0.34);
  border-radius: 0.28rem;
  padding: 0.28rem 0.42rem;
  cursor: pointer;
}

.loop-frame-menu-item:hover {
  border-color: rgba(165, 216, 255, 0.68);
  background: rgba(62, 95, 138, 0.55);
}

#loopMachineProgramPadsBtn.is-active {
  border-color: rgba(242, 213, 139, 0.92);
  box-shadow: 0 0 0 1px rgba(226, 179, 74, 0.46) inset;
}

.loop-machine-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.loop-machine-keyboard {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 152px;
  border: 1px solid rgba(123, 192, 247, 0.38);
  border-radius: 0.36rem;
  background: linear-gradient(180deg, rgba(31, 50, 82, 0.5), rgba(15, 27, 47, 0.58));
  box-shadow: inset 0 1px 0 rgba(240, 248, 255, 0.22), inset 0 -1px 0 rgba(86, 124, 177, 0.42);
}

.loop-machine-keyboard-strip {
  position: relative;
  height: 100%;
}

.loop-machine-white-keys {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
}

.loop-machine-white-key {
  position: absolute;
  top: 0;
  bottom: 0;
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  cursor: pointer;
  border-right: 1px solid rgba(20, 40, 75, 0.62);
  background: linear-gradient(180deg, rgba(242, 247, 255, 0.98), rgba(219, 231, 248, 0.98) 62%, rgba(201, 218, 240, 0.96));
  box-shadow: inset 0 -8px 14px rgba(130, 159, 196, 0.24);
}

.loop-machine-white-key[data-visible-index="0"] {
  border-left: 1px solid rgba(28, 49, 84, 0.52);
}

.loop-machine-white-key::after {
  content: attr(data-note);
  position: absolute;
  left: 50%;
  bottom: 0.22rem;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(36, 62, 101, 0.84);
}

.loop-machine-black-keys {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 62%;
}

.loop-machine-black-key {
  position: absolute;
  top: 0;
  appearance: none;
  border: 1px solid rgba(111, 145, 194, 0.28);
  padding: 0;
  margin: 0;
  min-width: 0;
  cursor: pointer;
  width: calc(var(--loop-key-width, 64px) * 0.64);
  height: 100%;
  transform: translateX(-50%);
  border-radius: 0 0 0.2rem 0.2rem;
  background: linear-gradient(180deg, rgba(7, 12, 23, 0.98), rgba(2, 5, 12, 0.98));
  box-shadow: inset 0 -5px 10px rgba(66, 88, 130, 0.24), 0 2px 4px rgba(0, 0, 0, 0.35);
}

.loop-machine-black-key::after {
  content: attr(data-note);
  position: absolute;
  left: 50%;
  top: 0.18rem;
  transform: translateX(-50%);
  font-size: 0.52rem;
  font-weight: 600;
  color: rgba(204, 224, 255, 0.86);
}

.loop-machine-white-key.is-active {
  background: linear-gradient(180deg, rgba(254, 244, 171, 0.98), rgba(247, 230, 129, 0.95) 62%, rgba(225, 201, 85, 0.92));
}

.loop-machine-black-key.is-active {
  background: linear-gradient(180deg, rgba(51, 77, 122, 0.98), rgba(17, 31, 54, 0.98));
  box-shadow: inset 0 -4px 8px rgba(91, 132, 194, 0.38), 0 0 0 1px rgba(156, 212, 255, 0.42);
}

.loop-machine-pad-grid {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem;
}

.loop-machine-pad-btn {
  white-space: pre-line;
  min-height: 2.4rem;
  text-align: left;
  line-height: 1.2;
  border-color: hsla(var(--loop-pad-hue, 198), 82%, 78%, 0.58);
  background:
    radial-gradient(120% 100% at 12% 8%, hsla(var(--loop-pad-hue, 198), 88%, 72%, 0.34), transparent 58%),
    linear-gradient(180deg, hsla(var(--loop-pad-hue, 198), 60%, 42%, 0.66), hsla(var(--loop-pad-hue, 198), 66%, 20%, 0.86));
  box-shadow: inset 0 1px 0 rgba(245, 252, 255, 0.24), inset 0 -1px 0 rgba(0, 0, 0, 0.28);
}

.loop-machine-pad-btn.is-active {
  border-color: hsla(var(--loop-pad-hue, 198), 100%, 88%, 0.98);
  box-shadow: 0 0 0 1px hsla(var(--loop-pad-hue, 198), 90%, 72%, 0.45) inset;
  background:
    radial-gradient(120% 100% at 12% 8%, hsla(var(--loop-pad-hue, 198), 100%, 86%, 0.42), transparent 58%),
    linear-gradient(180deg, hsla(var(--loop-pad-hue, 198), 70%, 52%, 0.95), hsla(var(--loop-pad-hue, 198), 72%, 28%, 0.94));
}

.loop-machine-panel.is-program-mode .loop-machine-pad-btn {
  border-style: dashed;
}

.loop-machine-panel.is-program-mode .loop-machine-pad-btn::after {
  content: "Tap to edit";
  display: block;
  margin-top: 0.2rem;
  font-size: 0.62rem;
  opacity: 0.88;
}

.loop-machine-keyboard::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 28%, rgba(5, 11, 22, 0.12));
}

.chord-controls input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

.timeline-status {
  margin-left: 0.35rem;
  font-size: 0.78rem;
  color: rgba(222, 226, 255, 0.88);
}

.is-hidden {
  display: none !important;
}

.timeline-toolbar input {
  width: 4.2rem;
  border: 1px solid rgba(130, 167, 201, 0.45);
  border-radius: 0.3rem;
  background: rgba(11, 14, 25, 0.88);
  color: var(--text);
  padding: 0.2rem 0.28rem;
  font-size: 0.82rem;
}

.timeline-viewport {
  position: relative;
  overflow-x: scroll;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: linear-gradient(180deg, rgba(9, 12, 23, 0.94), rgba(9, 11, 21, 0.98));
  height: 100%;
}

.timeline-minimap-wrap {
  position: relative;
  height: 1.35rem;
  border-bottom: 1px solid rgba(120, 194, 255, 0.44);
  border-top: 1px solid rgba(126, 118, 255, 0.24);
  background: linear-gradient(180deg, rgba(12, 18, 36, 0.99), rgba(9, 14, 29, 0.97));
  box-shadow: inset 0 1px 0 rgba(170, 227, 255, 0.16), inset 0 -1px 0 rgba(76, 140, 255, 0.2);
  flex: 0 0 auto;
}

.timeline-minimap-wrap-resizable {
  min-height: 1.1rem;
}

.timeline-minimap-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  cursor: ns-resize;
  background: linear-gradient(180deg, rgba(168, 232, 255, 0.06), rgba(119, 195, 255, 0.2));
}

.timeline-minimap-resize-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 1px;
  width: 34px;
  height: 2px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(172, 232, 255, 0.82);
}

.timeline-minimap-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.daw-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 24px 1fr;
  height: 100%;
}

#dawViewport {
  position: relative;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#chordViewport {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#chordGridScroll {
  flex: 1;
  min-height: 0;
}

#dawViewport .daw-shell {
  flex: 1;
  min-height: 0;
}

.daw-bottom-dock {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: auto auto auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.24rem 0.42rem;
  border: 1px solid rgba(153, 175, 250, 0.5);
  border-radius: 0.55rem;
  background: linear-gradient(180deg, rgba(13, 17, 32, 0.9), rgba(8, 10, 20, 0.82));
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.44);
  z-index: 16;
}

.daw-dock-tempo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22rem;
  min-width: 4.5rem;
  font-variant-numeric: tabular-nums;
  padding-right: 0.18rem;
  border-right: 1px solid rgba(132, 159, 213, 0.36);
  font-size: 0.78rem;
  color: rgba(228, 239, 255, 0.94);
}

#dawDockBpmValue {
  display: inline-block;
  min-width: 3ch;
  text-align: right;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.daw-dock-tempo-unit {
  color: rgba(175, 194, 231, 0.86);
  font-size: 0.68rem;
}

.daw-dock-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding-right: 0.18rem;
  border-right: 1px solid rgba(132, 159, 213, 0.36);
}

.daw-dock-controls .btn {
  min-width: 1.72rem;
  text-align: center;
  padding: 0.12rem 0.32rem;
}

.daw-dock-meter {
  display: grid;
  gap: 0.2rem;
  min-width: 7rem;
  padding-right: 0.2rem;
  border-right: 1px solid rgba(132, 159, 213, 0.36);
}

.daw-dock-meter-row {
  display: grid;
  grid-template-columns: 0.58rem 1fr;
  align-items: center;
  gap: 0.22rem;
}

.daw-dock-meter-label {
  font-size: 0.62rem;
  line-height: 1;
  color: rgba(164, 194, 228, 0.92);
  font-family: "Consolas", "Menlo", "Monaco", monospace;
}

.daw-dock-meter-track {
  position: relative;
  height: 0.34rem;
  border: 1px solid rgba(108, 128, 170, 0.5);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(31, 55, 33, 0.62) 0%, rgba(78, 67, 22, 0.56) 72%, rgba(87, 29, 29, 0.56) 100%);
  overflow: hidden;
}

.daw-dock-meter-fill {
  display: block;
  width: 0%;
  height: 100%;
  --meter-fill-color: rgb(96, 243, 136);
  background-color: var(--meter-fill-color);
  transition: width 40ms linear, background-color 70ms linear;
}

.daw-dock-meter-fill.is-hot {
  box-shadow: 0 0 8px rgba(255, 82, 82, 0.65);
}

.daw-dock-loop-btn {
  min-width: 2.4rem;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: rgba(224, 236, 255, 0.9);
}

.daw-dock-loop-btn.is-active {
  border-color: rgba(147, 223, 255, 0.88);
  box-shadow: 0 0 0 1px rgba(147, 223, 255, 0.34) inset;
  color: rgba(236, 249, 255, 0.98);
}

.daw-dock-readout {
  display: grid;
  grid-auto-flow: column;
  align-items: baseline;
  gap: 1rem;
  font-family: "Consolas", "Menlo", "Monaco", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.daw-dock-timecode {
  display: inline-block;
  min-width: 9ch;
  text-align: right;
  font-size: 0.84rem;
  color: rgba(222, 244, 255, 0.96);
}

.daw-dock-bars {
  display: inline-block;
  min-width: 9ch;
  text-align: right;
  font-size: 0.78rem;
  color: rgba(178, 214, 244, 0.9);
}

.transport-btn {
  position: relative;
  width: 1.95rem;
  height: 1.55rem;
  min-width: 1.95rem;
  padding: 0;
  color: transparent;
  font-size: 0;
}

.transport-btn::before,
.transport-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.transport-play::before {
  left: 0.72rem;
  width: 0.48rem;
  height: 0.56rem;
  background: rgba(228, 240, 255, 0.96);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.transport-stop::before {
  left: 0.68rem;
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 0.08rem;
  background: rgba(228, 240, 255, 0.96);
}

.transport-home::before {
  left: 0.58rem;
  width: 0.12rem;
  height: 0.62rem;
  border-radius: 1px;
  background: rgba(228, 240, 255, 0.96);
}

.transport-home::after {
  left: 0.78rem;
  width: 0.46rem;
  height: 0.54rem;
  background: rgba(228, 240, 255, 0.96);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.transport-end::before {
  left: 0.64rem;
  width: 0.46rem;
  height: 0.54rem;
  background: rgba(228, 240, 255, 0.96);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.transport-end::after {
  left: 1.16rem;
  width: 0.12rem;
  height: 0.62rem;
  border-radius: 1px;
  background: rgba(228, 240, 255, 0.96);
}

.transport-btn:hover::before,
.transport-btn:hover::after {
  background: rgba(255, 255, 255, 1);
}

.transport-btn.is-active {
  border-color: rgba(145, 223, 255, 0.84);
  box-shadow: 0 0 0 1px rgba(145, 223, 255, 0.3) inset;
}

.fx-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(320px, 48%);
  min-height: 170px;
  border-top: 1px solid rgba(145, 138, 255, 0.42);
  background: linear-gradient(180deg, rgba(9, 13, 27, 0.28), rgba(6, 9, 18, 0.2));
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.42);
  z-index: 30;
  display: grid;
  grid-template-rows: auto 1fr;
}

.fx-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(139, 131, 255, 0.26);
  background: rgba(12, 16, 31, 0.1);
}

.fx-drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fx-drawer-dock-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.fx-drawer-dock-btn {
  font-size: 0.72rem;
  padding: 0.16rem 0.4rem;
}

.fx-drawer-dock-btn.is-active {
  border-color: rgba(162, 229, 255, 0.82);
  box-shadow: 0 0 0 1px rgba(148, 217, 255, 0.26) inset;
}

.fx-drawer-target {
  font-size: 0.78rem;
  color: rgba(203, 226, 255, 0.94);
}

.fx-drawer-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 0;
  background: rgba(7, 11, 22, 0.04);
}

.fx-drawer-left {
  position: relative;
  border-right: 1px solid rgba(137, 130, 255, 0.22);
  padding: 0.45rem;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(9, 14, 28, 0.06);
}

.fx-drawer .plugin-list-item {
  background: rgba(14, 18, 34, 0.42);
}

.fx-drawer .plugin-editor {
  background: rgba(9, 13, 25, 0.05);
}

.fx-drawer-left-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.fx-drawer-parent-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.fx-drawer-parent-toggle-label {
  font-size: 0.72rem;
  color: rgba(197, 219, 255, 0.92);
}

.ui-switch {
  position: relative;
  display: inline-flex;
  width: 32px;
  height: 18px;
  cursor: pointer;
}

.ui-switch input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.ui-switch-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(36, 53, 86, 0.7);
  border: 1px solid rgba(123, 154, 222, 0.42);
  box-shadow: inset 0 0 0 1px rgba(7, 14, 30, 0.6);
  transition: background 120ms ease, border-color 120ms ease;
}

.ui-switch-track::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e9f1ff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 120ms ease;
}

.ui-switch input:checked + .ui-switch-track {
  background: rgba(60, 151, 255, 0.76);
  border-color: rgba(128, 206, 255, 0.86);
}

.ui-switch input:checked + .ui-switch-track::after {
  transform: translateX(14px);
}

.ui-switch input:disabled + .ui-switch-track {
  opacity: 0.5;
  cursor: default;
}

.fx-drawer-left .plugin-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  right: auto;
  width: min(1120px, calc(100vw - 56px));
  max-height: min(46vh, 360px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.55rem;
  padding: 0.6rem;
  overflow: auto;
}

.plugin-menu-search-row {
  grid-column: 1 / -1;
}

.plugin-menu-search-input {
  width: 100%;
  border: 1px solid rgba(132, 174, 255, 0.48);
  border-radius: 0.4rem;
  background: rgba(10, 15, 30, 0.92);
  color: #eaf2ff;
  font-size: 0.8rem;
  padding: 0.34rem 0.5rem;
}

.plugin-menu-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(127, 167, 241, 0.36);
  border-radius: 0.42rem;
  padding: 0.8rem;
  color: rgba(184, 210, 255, 0.9);
  font-size: 0.78rem;
}

.fx-drawer-left .plugin-menu-group {
  border-bottom: 0;
  border: 1px solid rgba(120, 152, 224, 0.3);
  border-radius: 0.45rem;
  background: rgba(9, 14, 28, 0.78);
  padding: 0.38rem;
  min-height: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.fx-drawer-left .plugin-menu-group.is-favorites {
  border-color: rgba(236, 197, 97, 0.42);
  box-shadow: 0 0 0 1px rgba(236, 197, 97, 0.12) inset;
}

.plugin-menu-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.fx-drawer-left .plugin-menu-group:last-child {
  border-bottom: 1px solid rgba(120, 152, 224, 0.3);
}

.fx-drawer-left .plugin-menu-group-title {
  margin-bottom: 0;
  font-size: 0.74rem;
}

.plugin-menu-group-grabber {
  border: 1px solid rgba(122, 156, 228, 0.38);
  border-radius: 0.28rem;
  background: rgba(13, 21, 40, 0.92);
  color: rgba(181, 210, 255, 0.92);
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.02rem 0.18rem;
  cursor: grab;
}

.plugin-menu-group-grabber:active {
  cursor: grabbing;
}

.plugin-menu-group.is-drop-target {
  border-color: rgba(146, 218, 255, 0.78) !important;
  box-shadow: 0 0 0 1px rgba(146, 218, 255, 0.24) inset;
}

.plugin-menu-group.is-being-dragged {
  opacity: 0.25;
}

.plugin-menu-group-placeholder {
  border: 1px dashed rgba(146, 218, 255, 0.76) !important;
  background: rgba(70, 146, 255, 0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(146, 218, 255, 0.24);
}

.plugin-menu-drag-ghost {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  opacity: 0.92;
  transform: scale(1.01);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.plugin-menu.is-group-dragging {
  cursor: grabbing;
}

.plugin-menu.is-favorite-dragging {
  cursor: grabbing;
}

.plugin-menu-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.24rem;
  align-items: center;
  position: relative;
}

.plugin-menu-item-row.is-premium-locked::after {
  content: "★";
  position: absolute;
  right: 2.25rem;
  top: -0.12rem;
  font-size: 0.62rem;
  color: #f0c44d;
  text-shadow: 0 0 8px rgba(255, 217, 126, 0.72);
  pointer-events: none;
}

.plugin-menu-item.is-premium-locked {
  border-color: rgba(202, 171, 82, 0.42);
  background: linear-gradient(180deg, rgba(43, 37, 23, 0.88), rgba(20, 18, 14, 0.9));
  color: rgba(225, 218, 194, 0.88);
}

.plugin-menu-item.is-premium-locked:hover {
  border-color: rgba(226, 194, 102, 0.72);
  background: linear-gradient(180deg, rgba(51, 42, 24, 0.92), rgba(26, 22, 14, 0.93));
}

.plugin-menu-item-row.is-fav-being-dragged {
  opacity: 0.34;
}

.plugin-menu-item-row.is-fav-drop-target {
  position: relative;
}

.plugin-menu-item-row.is-fav-drop-target.is-drop-before::before,
.plugin-menu-item-row.is-fav-drop-target.is-drop-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: rgba(146, 218, 255, 0.94);
  box-shadow: 0 0 0 1px rgba(146, 218, 255, 0.24);
}

.plugin-menu-item-row.is-fav-drop-target.is-drop-before::before {
  top: -0.14rem;
}

.plugin-menu-item-row.is-fav-drop-target.is-drop-after::after {
  bottom: -0.14rem;
}

.plugin-menu-fav-grabber {
  border: 1px solid rgba(121, 158, 255, 0.26);
  border-radius: 0.36rem;
  background: rgba(14, 19, 37, 0.88);
  color: rgba(167, 191, 236, 0.9);
  width: 1.62rem;
  height: 1.68rem;
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  cursor: grab;
}

.plugin-menu-fav-grabber:hover {
  border-color: rgba(142, 225, 255, 0.65);
  color: rgba(214, 241, 255, 0.95);
}

.plugin-menu-fav-grabber:active {
  cursor: grabbing;
}

.fx-drawer-left .plugin-menu-item {
  margin-bottom: 0.22rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plugin-menu-favorite-btn {
  border: 1px solid rgba(121, 158, 255, 0.26);
  border-radius: 0.36rem;
  background: rgba(14, 19, 37, 0.88);
  color: rgba(167, 191, 236, 0.9);
  width: 1.85rem;
  height: 1.68rem;
  font-size: 0.92rem;
  cursor: pointer;
}

.plugin-menu-favorite-btn:hover {
  border-color: rgba(236, 197, 97, 0.72);
  color: rgba(255, 227, 140, 0.94);
}

.plugin-menu-favorite-btn.is-active {
  border-color: rgba(236, 197, 97, 0.82);
  color: rgba(255, 227, 130, 0.96);
  background: rgba(60, 44, 12, 0.88);
}

.plugin-menu-favorites-empty {
  font-size: 0.74rem;
  color: rgba(175, 194, 226, 0.86);
  padding: 0.3rem 0.12rem 0.24rem;
}

.parent-fx-drawer {
  border-top: 1px solid rgba(131, 160, 222, 0.26);
  margin-top: 0.35rem;
  padding-top: 0.35rem;
}

.parent-fx-drawer-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(124, 157, 241, 0.35);
  border-radius: 0.35rem;
  background: rgba(9, 14, 28, 0.92);
  color: #eef2ff;
  padding: 0.2rem 0.34rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.parent-fx-drawer-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border: 1px solid rgba(82, 177, 255, 0.8);
  border-radius: 0.2rem;
  color: rgba(112, 204, 255, 0.95);
  font-size: 0.78rem;
  line-height: 1;
}

.parent-fx-drawer-body {
  margin-top: 0.35rem;
  max-height: 220px;
  overflow: auto;
  padding-right: 0.1rem;
}

.fx-drawer-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  top: -2px;
  height: 8px;
  border-top: 1px solid rgba(164, 225, 255, 0.52);
  background: linear-gradient(180deg, rgba(120, 196, 255, 0.22), rgba(120, 196, 255, 0));
  opacity: 0.7;
  cursor: ns-resize;
  touch-action: none;
  z-index: 34;
}

.fx-drawer-resize-handle:hover {
  opacity: 1;
}

.fx-drawer.is-side {
  left: auto;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(430px, 72vw);
  height: auto;
  border-top: 0;
  border-left: 1px solid rgba(145, 138, 255, 0.42);
  box-shadow: -10px 0 24px rgba(0, 0, 0, 0.38);
}

.fx-drawer.is-side .fx-drawer-resize-handle {
  top: 0;
  bottom: 0;
  left: -2px;
  right: auto;
  width: 8px;
  height: auto;
  border-top: 0;
  border-left: 1px solid rgba(164, 225, 255, 0.52);
  background: linear-gradient(90deg, rgba(120, 196, 255, 0.22), rgba(120, 196, 255, 0));
  cursor: ew-resize;
}

.fx-drawer.is-popup {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border: 0;
  box-shadow: none;
  background: linear-gradient(180deg, rgba(9, 13, 27, 0.34), rgba(6, 9, 18, 0.26));
}

.fx-drawer.is-popup .fx-drawer-resize-handle {
  display: none;
}

.fx-popup-host {
  margin: 0;
  width: 100%;
  height: 100%;
  background: #060812;
}

#fxPopupMount {
  width: 100%;
  height: 100%;
}

.daw-track-header {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  padding: 0 0.45rem;
  font-size: 0.7rem;
  color: rgba(212, 220, 255, 0.82);
  border-right: 1px solid rgba(150, 145, 255, 0.26);
  border-bottom: 1px solid rgba(150, 145, 255, 0.26);
  background: linear-gradient(180deg, rgba(14, 16, 30, 0.96), rgba(10, 12, 24, 0.98));
}

.daw-track-header .btn {
  padding: 0.12rem 0.28rem;
  font-size: 0.62rem;
}

.daw-ruler {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(150, 145, 255, 0.28);
  background: linear-gradient(180deg, rgba(13, 16, 31, 0.97), rgba(9, 11, 22, 0.98));
  user-select: none;
}

.daw-ruler-mark {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: rgba(158, 193, 255, 0.46);
}

.daw-ruler-mark.is-major {
  height: 14px;
  background: rgba(188, 220, 255, 0.72);
}

.daw-ruler-mark.is-minor {
  height: 8px;
}

.daw-ruler-label {
  position: absolute;
  top: 2px;
  transform: translateX(4px);
  font-size: 0.62rem;
  color: rgba(213, 225, 255, 0.9);
  white-space: nowrap;
}

.daw-tracks {
  grid-column: 1;
  grid-row: 2;
  position: relative;
  border-right: 1px solid rgba(150, 145, 255, 0.26);
  background: linear-gradient(180deg, rgba(9, 12, 24, 0.95), rgba(7, 9, 18, 0.97));
  overflow: auto;
}

.daw-track-row {
  position: relative;
  height: 108px;
  padding: 0.25rem 0.35rem 0.72rem 0.95rem;
  border-bottom: 1px solid rgba(var(--track-color-rgb, 150, 145, 255), 0.34);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 0.35rem;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(var(--track-color-rgb, 120, 110, 255), 0.2), rgba(9, 12, 23, 0.88));
}

.daw-track-grabber {
  width: 1.3rem;
  height: 1.3rem;
  border: 1px solid rgba(138, 171, 243, 0.44);
  border-radius: 0.25rem;
  background: rgba(14, 18, 34, 0.82);
  color: rgba(210, 224, 255, 0.92);
  cursor: grab;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0;
  margin-top: 0.08rem;
}

.daw-track-grabber:active {
  cursor: grabbing;
}

.daw-track-resizer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  border-top: 1px solid rgba(124, 170, 255, 0.42);
  background: rgba(18, 24, 44, 0.98);
  cursor: ns-resize;
  z-index: 6;
}

.daw-track-row.is-active {
  box-shadow: inset 0 0 0 1px rgba(var(--track-color-rgb, 136, 210, 255), 0.78), inset 0 0 18px rgba(var(--track-color-rgb, 136, 210, 255), 0.2);
}

.daw-track-row.is-dragging {
  opacity: 0.62;
}

.daw-track-drop-indicator {
  position: absolute;
  left: 0.2rem;
  right: 0.2rem;
  height: 2px;
  background: rgba(131, 222, 255, 0.98);
  box-shadow: 0 0 8px rgba(131, 222, 255, 0.65);
  pointer-events: none;
  z-index: 20;
}

.daw-track-name {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.14rem;
}

.daw-track-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daw-track-fx-btn {
  min-width: 1.24rem;
  height: 0.96rem;
  padding: 0 0.2rem !important;
  font-size: 0.54rem !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 0.02rem;
  border-color: rgba(142, 216, 255, 0.82) !important;
  background: rgba(22, 36, 64, 0.94) !important;
  color: rgba(220, 242, 255, 0.98) !important;
}

.daw-track-fx-btn:hover {
  background: rgba(30, 49, 84, 0.98) !important;
  box-shadow: 0 0 0 1px rgba(147, 222, 255, 0.26) inset;
}

.daw-track-close {
  width: 1.3rem;
  height: 1.3rem;
  border: 1px solid rgba(255, 124, 124, 0.62);
  border-radius: 0.25rem;
  background: rgba(40, 10, 14, 0.82);
  color: rgba(255, 206, 206, 0.95);
  font-size: 0.76rem;
  line-height: 1;
  padding: 0;
  margin-top: 0.08rem;
  cursor: pointer;
}

.daw-track-close:hover {
  background: rgba(72, 18, 24, 0.92);
}

.daw-track-rename-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(132, 174, 255, 0.52);
  border-radius: 0.22rem;
  background: rgba(10, 14, 28, 0.95);
  color: #eff3ff;
  font-size: 0.76rem;
  padding: 0.08rem 0.2rem;
}

.daw-track-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  grid-column: 1 / 4;
  grid-row: 2;
  justify-self: start;
  width: calc(100% - 0.35rem);
  margin-top: 0.2rem;
}

.daw-track-mode-btn {
  padding: 0.1rem 0.26rem !important;
  font-size: 0.58rem !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.daw-track-mode-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.daw-track-actions .btn {
  padding: 0.12rem 0.24rem;
  font-size: 0.62rem;
  white-space: nowrap;
}

.daw-track-color-rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 8px;
  width: 0.7rem;
  background: linear-gradient(180deg, rgba(var(--track-color-rgb, 120, 110, 255), 0.95), rgba(var(--track-color-rgb, 120, 110, 255), 0.6));
  border-right: 1px solid rgba(210, 228, 255, 0.45);
  z-index: 7;
}

.daw-track-color-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.daw-track-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.daw-track-color-input::-webkit-color-swatch {
  border: 0;
  border-radius: 0.16rem;
}

.daw-track-color-input::-moz-color-swatch {
  border: 0;
  border-radius: 0.16rem;
}

.daw-empty-lane-close {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid rgba(255, 140, 140, 0.62);
  border-radius: 0.22rem;
  background: rgba(44, 10, 15, 0.88);
  color: rgba(255, 214, 214, 0.95);
  font-size: 0.72rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  z-index: 18;
}

.daw-empty-lane-close:hover {
  background: rgba(74, 18, 26, 0.95);
}

.daw-track-pan {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 0 0 100%;
  margin-left: 0;
  margin-top: 0.18rem;
  font-size: 0.56rem;
  color: rgba(206, 223, 255, 0.92);
}

.daw-track-pan-slider {
  width: 100%;
}

.daw-track-pan-center {
  opacity: 0.82;
}

.daw-track-pan-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
}

.daw-track-pan-labels span:first-child {
  justify-self: start;
}

.daw-track-pan-labels span:nth-child(2) {
  justify-self: center;
}

.daw-track-pan-labels span:last-child {
  justify-self: end;
}

.daw-track-pan input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  margin: 0;
  height: 12px;
  background: transparent;
}

.daw-track-pan input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(194, 204, 233, 0.45);
}

.daw-track-pan input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(213, 232, 255, 0.95);
  background: rgba(221, 235, 255, 0.98);
  margin-top: -5px;
  box-shadow: none;
}

.daw-track-pan input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  border: 0;
  background: rgba(194, 204, 233, 0.45);
}

.daw-track-pan input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(194, 204, 233, 0.45);
}

.daw-track-pan input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(213, 232, 255, 0.95);
  background: rgba(221, 235, 255, 0.98);
}

.daw-arrange-wrap {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  overflow-x: scroll;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.daw-arrange-wrap.is-panning,
.daw-arrange-wrap.is-panning .daw-clip {
  cursor: grabbing !important;
}

.daw-arrange {
  position: relative;
  min-width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      to right,
      rgba(130, 123, 255, 0.16) 0,
      rgba(130, 123, 255, 0.16) 1px,
      transparent 1px,
      transparent 30px
    ),
    linear-gradient(180deg, rgba(8, 10, 18, 0.97), rgba(7, 9, 17, 0.99));
}

.daw-lane-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(150, 145, 255, 0.18);
  pointer-events: none;
}

.daw-channel-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(144, 214, 255, 0.28);
  pointer-events: none;
}

.daw-clip {
  position: absolute;
  border: 1px solid rgba(var(--track-color-rgb, 175, 168, 255), 0.84);
  border-radius: 0.2rem;
  background: linear-gradient(180deg, rgba(var(--track-color-rgb, 128, 117, 255), 0.92), rgba(var(--track-color-rgb, 128, 117, 255), 0.58));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: default;
  overflow: hidden;
}

.daw-clip.has-fx {
  border-color: rgba(255, 199, 116, 0.84);
  box-shadow: 0 0 0 1px rgba(255, 203, 124, 0.22) inset, 0 2px 6px rgba(0, 0, 0, 0.35);
}

.daw-clip-drag-handle {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0.95rem;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.34), rgba(var(--track-color-rgb, 206, 219, 255), 0.14));
  border-bottom: 1px solid rgba(225, 236, 255, 0.32);
  cursor: grab;
  z-index: 2;
}

.daw-range-selection {
  position: absolute;
  border: 1px solid rgba(133, 220, 255, 0.8);
  background: rgba(106, 188, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(194, 238, 255, 0.35);
  pointer-events: none;
  z-index: 26;
}

.daw-range-selection-handle {
  position: absolute;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  background: rgba(184, 236, 255, 0.5);
  pointer-events: auto;
}

.daw-range-selection-handle.is-left {
  left: -4px;
}

.daw-range-selection-handle.is-right {
  right: -4px;
}

.daw-fx-region {
  position: absolute;
  border: 1px solid rgba(255, 182, 83, 0.88);
  background: linear-gradient(180deg, rgba(255, 171, 88, 0.22), rgba(255, 130, 44, 0.14));
  box-shadow: inset 0 0 0 1px rgba(255, 220, 154, 0.32);
  border-radius: 0.2rem;
  z-index: 4;
  cursor: default;
}

.daw-fx-region-label {
  position: absolute;
  left: 0.26rem;
  top: 0.14rem;
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  font-size: 0.62rem;
  color: rgba(255, 241, 216, 0.96);
  pointer-events: auto;
  z-index: 7;
}

.daw-fx-region-label-text {
  pointer-events: none;
}

.daw-fx-region-edit {
  position: static;
  height: 0.86rem;
  border: 1px solid rgba(255, 196, 114, 0.82);
  border-radius: 0.2rem;
  background: rgba(75, 36, 8, 0.78);
  color: rgba(255, 233, 202, 0.98);
  font-size: 0.54rem;
  line-height: 1;
  padding: 0 0.2rem;
  cursor: pointer;
  z-index: 8;
}

.daw-fx-region-edit:hover {
  background: rgba(103, 49, 10, 0.86);
}

.daw-fx-region-handle {
  position: absolute;
  top: 0;
  width: 8px;
  height: 100%;
  background: rgba(255, 202, 137, 0.62);
  cursor: ew-resize;
  z-index: 7;
}

.daw-fx-region-handle.is-left {
  left: -4px;
}

.daw-fx-region-handle.is-right {
  right: -4px;
}

.daw-clip-wave {
  position: absolute;
  left: 0;
  right: 0;
  top: 1.1rem;
  bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 1px;
  opacity: 0.76;
  pointer-events: none;
}

.daw-clip-wave-canvas {
  width: 100%;
  height: 100%;
}

.daw-clip.is-selected {
  box-shadow: 0 0 0 3px rgba(130, 210, 255, 0.45), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.daw-drag-ghost-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

.daw-drag-ghost {
  position: absolute;
  border: 1px dashed rgba(188, 235, 255, 0.95);
  border-radius: 0.2rem;
  background: rgba(128, 199, 255, 0.22);
  box-shadow: 0 0 8px rgba(116, 206, 255, 0.4);
}

.daw-align-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 228, 72, 0.96);
  box-shadow: 0 0 10px rgba(255, 228, 72, 0.58);
  pointer-events: none;
}

.daw-clip-label {
  position: absolute;
  left: 0.3rem;
  top: 0.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.65rem;
  color: #eef0ff;
  pointer-events: auto;
  z-index: 1;
}

.daw-clip-label-text {
  pointer-events: none;
}

.daw-clip-label-fx {
  height: 0.82rem;
  border: 1px solid rgba(255, 194, 103, 0.8);
  border-radius: 0.2rem;
  background: rgba(67, 34, 9, 0.78);
  color: rgba(255, 233, 200, 0.96);
  font-size: 0.54rem;
  line-height: 1;
  padding: 0 0.2rem;
  cursor: pointer;
}

.daw-clip-label-fx:hover {
  background: rgba(96, 47, 11, 0.84);
}

.daw-clip-fx-badge {
  position: absolute;
  right: 0.24rem;
  top: 0.14rem;
  height: 0.9rem;
  border: 1px solid rgba(255, 194, 103, 0.8);
  border-radius: 0.2rem;
  background: rgba(67, 34, 9, 0.78);
  color: rgba(255, 233, 200, 0.96);
  font-size: 0.56rem;
  line-height: 1;
  padding: 0 0.24rem;
  z-index: 3;
  cursor: pointer;
}

.daw-clip-fx-badge:hover {
  background: rgba(96, 47, 11, 0.84);
}

.daw-edit-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: rgba(125, 220, 255, 0.9);
  box-shadow: 0 0 6px rgba(125, 220, 255, 0.6);
  pointer-events: none;
  z-index: 8;
}

.app.chord-mode .instrument-wrap {
  display: none;
}

.app.chord-mode .timeline-panel {
  flex: 1;
  height: auto;
}

.timeline-grid {
  position: relative;
  min-width: 100%;
  height: 100%;
  background: rgba(8, 10, 18, 0.95);
  user-select: none;
}

.timeline-step-cell {
  position: absolute;
  top: 0;
  height: 100%;
  border-right: 1px solid rgba(155, 149, 255, 0.22);
  border-left: 1px solid rgba(255, 255, 255, 0.02);
  background: linear-gradient(180deg, rgba(122, 108, 255, 0.12), rgba(122, 108, 255, 0.03));
  pointer-events: none;
}

.chord-grid .timeline-step-cell {
  border-right-color: rgba(110, 140, 210, 0.2);
  border-left-color: rgba(255, 255, 255, 0.015);
  background: linear-gradient(180deg, rgba(80, 112, 190, 0.08), rgba(55, 76, 138, 0.03));
}

.chord-grid .timeline-step-cell.is-beat {
  border-right-color: rgba(126, 194, 255, 0.42);
  background: linear-gradient(180deg, rgba(88, 146, 228, 0.14), rgba(72, 112, 192, 0.06));
}

.chord-grid .timeline-step-cell.is-bar-start {
  border-right-color: rgba(126, 194, 255, 0.42);
  border-right-width: 1px;
  background: linear-gradient(180deg, rgba(88, 146, 228, 0.12), rgba(72, 112, 192, 0.05));
}

.chord-grid .timeline-step-cell.is-bar-alt {
  box-shadow: inset 0 0 0 999px rgba(40, 57, 97, 0.08);
}

.timeline-note {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 0.22rem;
  background: linear-gradient(
    180deg,
    hsla(var(--note-hue, 30), 92%, 70%, 0.96),
    hsla(var(--note-hue, 30), 86%, 54%, 0.9)
  );
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  cursor: grab;
  user-select: none;
  overflow: hidden;
}

.timeline-note.is-selected {
  border-color: #8de8ff;
  box-shadow: 0 0 0 8px rgba(141, 232, 255, 0.35), 0 6px 10px rgba(0, 0, 0, 0.45);
  z-index: 8;
}

.timeline-note.chord-note {
  background: linear-gradient(
    180deg,
    hsla(var(--note-hue, 140), 76%, 64%, 0.94),
    hsla(var(--note-hue, 140), 74%, 45%, 0.88)
  );
}

.chord-grid-scroll {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: scroll;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.layers-panel {
  border-left: 1px solid var(--ui-border);
  background: linear-gradient(180deg, rgba(10, 12, 23, 0.96), rgba(8, 10, 20, 0.96));
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--ui-border);
}

.sidebar-tab {
  border: 0;
  border-right: 1px solid var(--ui-border);
  background: rgba(8, 12, 24, 0.95);
  color: rgba(230, 234, 255, 0.92);
  padding: 0.38rem 0.35rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.sidebar-tab:last-child {
  border-right: 0;
}

.sidebar-tab.is-active {
  background: linear-gradient(180deg, #8e89ff, #6c61f1);
  color: #f8f8ff;
}

.sidebar-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.layers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid #314f71;
  font-size: 0.76rem;
  color: rgba(236, 239, 255, 0.92);
}

.layers-actions {
  display: flex;
  gap: 0.3rem;
}

.layers-actions .btn {
  min-width: 1.6rem;
  padding: 0.18rem 0.25rem;
}

.layer-ghost-toggle-btn {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  position: relative;
  width: 1.1rem;
  height: 1.1rem;
  min-width: 1.1rem;
  padding: 0;
  border: 1px solid rgba(119, 153, 214, 0.58);
  border-radius: 0.2rem;
  background: rgba(8, 12, 24, 0.95);
  overflow: hidden;
  color: transparent;
}

.layer-ghost-toggle-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.6rem;
  height: 0.35rem;
  border: 1px solid rgba(209, 231, 255, 0.92);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}

.layer-ghost-toggle-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.16rem;
  height: 0.16rem;
  border-radius: 50%;
  background: rgba(209, 231, 255, 0.94);
  transform: translate(-50%, -50%);
}

.layer-ghost-toggle-btn:not(.is-active) {
  opacity: 0.62;
}

.layer-ghost-toggle-btn.is-active {
  opacity: 1;
  border-color: rgba(137, 213, 255, 0.82);
  box-shadow: 0 0 0 1px rgba(124, 190, 235, 0.42) inset;
}

.layers-list {
  overflow: auto;
  padding: 0.2rem;
}

.projects-list {
  overflow: auto;
  padding: 0.25rem;
  min-height: 0;
  flex: 1;
}

.projects-actions {
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem;
  border-top: 1px solid var(--ui-border);
}

.projects-actions input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(156, 149, 255, 0.48);
  background: rgba(14, 17, 31, 0.9);
  color: #eff1ff;
  padding: 0.2rem 0.3rem;
}

.project-item {
  border: 1px solid #436082;
  padding: 0.26rem 0.3rem;
  margin-bottom: 0.22rem;
  background: rgba(15, 18, 31, 0.9);
  color: rgba(232, 236, 255, 0.92);
  cursor: pointer;
  font-size: 0.72rem;
}

.project-item.is-selected {
  background: rgba(120, 184, 211, 0.3);
}

.layer-item {
  display: grid;
  grid-template-columns: 1.4rem 1fr 1.4rem;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.26rem 0.3rem;
  border: 1px solid #45678c;
  border-radius: 0.25rem;
  margin-bottom: 0.24rem;
  background: rgba(15, 18, 31, 0.9);
  cursor: pointer;
  font-size: 0.73rem;
}

.layer-item.is-active {
  border-color: #78b8d3;
  box-shadow: 0 0 0 1px rgba(120, 184, 211, 0.35) inset;
}

.layer-eye {
  grid-column: 1;
  grid-row: 1;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid rgba(158, 151, 255, 0.52);
  border-radius: 0.2rem;
  background: rgba(10, 12, 24, 0.9);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.62rem;
}

.layer-name {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.layer-underlay-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.3rem;
  padding-left: 0.02rem;
}

.layer-underlay-label {
  font-size: 0.62rem;
  color: rgba(175, 214, 241, 0.88);
}

.layer-underlay-value {
  min-width: 2.4rem;
  text-align: right;
  font-size: 0.62rem;
  color: rgba(194, 236, 255, 0.9);
}

.layer-underlay-slider {
  width: 100%;
}

.layer-rename-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(132, 174, 255, 0.52);
  border-radius: 0.22rem;
  background: rgba(10, 14, 28, 0.95);
  color: #eff3ff;
  font-size: 0.72rem;
  padding: 0.08rem 0.2rem;
}

.layer-item.is-hidden-layer .layer-eye {
  opacity: 0.45;
}

.chord-keyboard {
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 3.9rem;
  background: linear-gradient(180deg, rgba(9, 12, 23, 0.98), rgba(7, 10, 20, 0.98));
  border-right: 1px solid #3f638a;
}

.chord-key-row {
  height: 18px;
  font-size: 0.52rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.34rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(231, 236, 255, 0.9);
}

.chord-key-row.is-sharp {
  background: linear-gradient(180deg, rgba(18, 24, 43, 0.96), rgba(11, 16, 31, 0.96));
  color: rgba(177, 198, 232, 0.95);
}

.chord-key-row.is-natural {
  background: linear-gradient(180deg, rgba(226, 236, 255, 0.9), rgba(205, 219, 245, 0.88));
  color: #0f1a33;
}

.chord-key-row.is-octave {
  box-shadow: inset 0 -1px 0 rgba(126, 208, 255, 0.42), inset 0 1px 0 rgba(126, 208, 255, 0.28);
  font-weight: 700;
}

.chord-grid-wrap {
  position: relative;
  min-width: 100%;
  height: 100%;
}

.chord-grid {
  --chord-step-width: 34px;
  --chord-row-height: 18px;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px,
      transparent var(--chord-row-height)
    ),
    repeating-linear-gradient(
      to right,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px,
      transparent var(--chord-step-width)
    ),
    linear-gradient(180deg, rgba(14, 20, 28, 0.96), rgba(18, 24, 34, 0.98));
}

.chord-row-guide {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(181, 191, 232, 0.14);
  pointer-events: none;
  z-index: 1;
}

.chord-row-guide.is-sharp {
  background: linear-gradient(180deg, rgba(28, 36, 66, 0.22), rgba(15, 20, 38, 0.2));
}

.chord-row-guide.is-natural {
  background: linear-gradient(180deg, rgba(59, 74, 115, 0.12), rgba(29, 40, 69, 0.1));
}

.chord-row-guide.is-octave {
  border-top-color: rgba(133, 218, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(133, 218, 255, 0.24);
}

.chord-stack-note {
  position: absolute;
  border: 1px solid rgba(255, 206, 214, 0.8);
  border-radius: 0.1rem;
  background: linear-gradient(180deg, rgba(166, 226, 116, 0.95), rgba(125, 185, 74, 0.92));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.chord-stack-note.is-underlay {
  pointer-events: none;
  border-style: dashed;
  border-color: hsla(var(--note-hue, 170), 88%, 78%, 0.58);
  background: linear-gradient(
    180deg,
    hsla(var(--note-hue, 170), 72%, 72%, 0.42),
    hsla(var(--note-hue, 170), 70%, 42%, 0.26)
  );
  box-shadow: none;
  filter: saturate(0.75);
}

.chord-stack-note .timeline-note-label {
  font-size: 0.52rem;
  top: 0.1rem;
}

.timeline-note-label {
  position: absolute;
  left: 0.25rem;
  top: 0.15rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(18, 18, 18, 0.96);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.timeline-note-resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 0.4rem;
  height: 100%;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.45);
}

.timeline-selection-box {
  position: absolute;
  border: 1px dashed rgba(141, 232, 255, 0.95);
  background: rgba(141, 232, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(141, 232, 255, 0.22) inset;
  pointer-events: none;
  z-index: 6;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: rgba(142, 255, 183, 0.95);
  box-shadow: 0 0 8px rgba(142, 255, 183, 0.78);
  pointer-events: none;
  opacity: 0;
  z-index: 9;
}

.timeline-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--playhead-tail-len, 22px) * -1);
  width: var(--playhead-tail-len, 22px);
  background: linear-gradient(90deg, rgba(84, 255, 130, 0), rgba(84, 255, 130, 0.22) 58%, rgba(84, 255, 130, 0.46) 100%);
  filter: blur(1.4px);
  opacity: 0.72;
  pointer-events: none;
}

.timeline-playhead::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  width: 6px;
  background: linear-gradient(180deg, rgba(209, 255, 221, 0.95), rgba(120, 255, 148, 0.64));
  filter: blur(1.6px);
  pointer-events: none;
}

.app.is-playing .timeline-playhead::before {
  opacity: 0.92;
  animation: playhead-tail-breathe 170ms ease-in-out infinite alternate;
}

.app.is-playing .timeline-playhead::after {
  animation: playhead-core-flicker 140ms steps(2, end) infinite;
}

@keyframes playhead-tail-breathe {
  from {
    opacity: 0.64;
    filter: blur(1.2px);
  }
  to {
    opacity: 0.96;
    filter: blur(1.9px);
  }
}

@keyframes playhead-core-flicker {
  from {
    opacity: 0.72;
    filter: blur(1.4px);
  }
  to {
    opacity: 1;
    filter: blur(2.2px);
  }
}

.timeline-start-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: rgba(255, 191, 92, 0.95);
  box-shadow: 0 0 6px rgba(255, 191, 92, 0.6);
  pointer-events: none;
  opacity: 0;
  z-index: 7;
}

.instrument {
  --rows: 8;
  --cols: 18;
  position: relative;
  display: grid;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background:
    linear-gradient(
      to bottom,
      #d61f1a 0%,
      #ea5f1d 12.5%,
      #e8d632 25%,
      #67d938 37.5%,
      #16d56e 50%,
      #25acde 62.5%,
      #2f65da 75%,
      #5a39d2 87.5%,
      #7f1ea5 100%
    );
  isolation: isolate;
}

.instrument::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc((100% / var(--cols)) - 1px),
      rgba(255, 255, 255, 0.24) calc((100% / var(--cols)) - 1px),
      rgba(255, 255, 255, 0.24) calc(100% / var(--cols))
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc((100% / var(--rows)) - 1px),
      rgba(255, 255, 255, 0.24) calc((100% / var(--rows)) - 1px),
      rgba(255, 255, 255, 0.24) calc(100% / var(--rows))
    );
}

.band {
  position: relative;
  border-top: 1px solid var(--line);
  z-index: 0;
}

.band:first-child {
  border-top: none;
}

.note-label {
  position: absolute;
  font-size: clamp(0.58rem, 1.3vw, 0.78rem);
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -50%);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

.row-label {
  position: absolute;
  left: 0.35rem;
  top: 0.25rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 2;
}

.note-cell-pop {
  position: absolute;
  inset: auto;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(
    180deg,
    hsla(var(--note-hue, 30), 92%, 72%, 0.5),
    hsla(var(--note-hue, 30), 86%, 50%, 0.2)
  );
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.25);
  transform-origin: center center;
  pointer-events: none;
  z-index: 3;
  animation: note-cell-pop 150ms ease-out;
}

.touch-marker {
  position: absolute;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.2rem;
  background: hsla(var(--note-hue, 30), 96%, 72%, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}

@keyframes note-cell-pop {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 7px rgba(0, 0, 0, 0.25);
  }
  45% {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 13px 18px rgba(0, 0, 0, 0.4);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 7px rgba(0, 0, 0, 0.25);
  }
}

.expression {
  position: relative;
  background: linear-gradient(180deg, #2d2d2d, #5d5d5d 50%, #1f1f1f);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  touch-action: none;
}

.expression::before {
  content: "";
  position: absolute;
  inset: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.45rem;
}

.expression-thumb {
  position: absolute;
  left: 50%;
  width: 1.5rem;
  height: 0.9rem;
  background: #d8d8d8;
  border-radius: 0.25rem;
  border: 1px solid rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  top: 65%;
  pointer-events: none;
}

#status {
  font-size: 0.8rem;
  color: rgba(223, 227, 255, 0.88);
  white-space: nowrap;
}

.mn-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(3, 6, 16, 0.68);
}

.mn-auth-panel {
  width: min(420px, 100%);
  border: 1px solid rgba(138, 166, 255, 0.42);
  border-radius: 0.7rem;
  background: linear-gradient(180deg, rgba(21, 28, 52, 0.97), rgba(13, 18, 36, 0.97));
  box-shadow: 0 20px 45px rgba(3, 6, 16, 0.7);
  padding: 0.85rem;
}

.mn-auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.mn-auth-head h3 {
  margin: 0;
  font-size: 1rem;
  color: rgba(236, 244, 255, 0.95);
}

.mn-auth-sub {
  margin: 0.25rem 0 0.65rem;
  font-size: 0.82rem;
  color: rgba(190, 210, 255, 0.84);
}

.mn-auth-form {
  display: grid;
  gap: 0.45rem;
}

.mn-auth-error {
  min-height: 1.05rem;
  margin-top: 0.42rem;
  color: #ff7e9c;
  font-size: 0.78rem;
}

.mn-auth-toggle {
  margin-top: 0.22rem;
  background: transparent;
  border: 0;
  color: rgba(147, 204, 255, 0.94);
  cursor: pointer;
  padding: 0;
  font-size: 0.78rem;
}

.mn-auth-toggle:hover {
  text-decoration: underline;
}

@media (max-width: 780px) {
  .controls {
    grid-template-rows: auto auto;
  }

  .controls-tabs-row,
  .controls-menu-row {
    padding: 0.35rem 0.45rem;
  }

  .controls-left {
    gap: 0.4rem;
  }

  label {
    font-size: 0.74rem;
  }

  select,
  .btn {
    font-size: 0.78rem;
    padding: 0.24rem 0.35rem;
  }

  .timeline-tab {
    padding: 0.4rem 0.8rem;
    font-size: 0.88rem;
  }

  .timeline-panel {
    height: 10.8rem;
  }

  .timeline-body {
    grid-template-columns: 1fr;
  }

  .loop-machine-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .loop-machine-resize-handle {
    display: none;
  }

  .loop-machine-settings {
    border-right: 0;
    border-bottom: 1px solid rgba(126, 192, 250, 0.22);
  }

  .layers-panel {
    max-height: 7.5rem;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }

  .timeline-toolbar input {
    width: 3.5rem;
    font-size: 0.75rem;
  }

  .daw-bottom-dock {
    left: 0.45rem;
    right: 0.45rem;
    top: 0.35rem;
    transform: none;
    grid-template-columns: 1fr;
    gap: 0.26rem;
    justify-items: stretch;
    padding: 0.26rem 0.34rem;
  }

  .daw-dock-tempo,
  .daw-dock-controls,
  .daw-dock-meter {
    border-right: 0;
    padding-right: 0;
  }

  .daw-dock-controls {
    justify-content: center;
  }

  .daw-dock-readout {
    justify-content: center;
    gap: 0.6rem;
  }
}
