.upload-link {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}
.upload-link:hover {
  text-decoration: none;
}

/* Keep player controls clear of left-edge PDF nav arrows in left-handed mode. */



.musicPanel-audio-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}







.musicPanel-title,
.midi-filename{
  font-size: 14px;
  font-weight: 500;
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.musicPanel-item {
  /*max-width: 400px;*/
  max-width: 30em; /* 400 ÷ 16 = 25em */
  width: 99%;
  margin: 0 auto 8px 0;
  background: rgba(40, 40, 40, 0.80);  
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 3px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: background 0.2s;
  margin-bottom: 0.2rem
}


.musicPanel-item:not(.musicPanel-bottomPinned):hover {
  background: #2a2a2a;
}



.small.text-secondary {
  font-size: 12px;
  font-weight: 500;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.musicPanel-pinBtn,
.musicPanel-closeBtn,
.musicPanel-deleteBtn,
.toggle-channels-btn {
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  color: #ccc;
  opacity: 1;
  transition: opacity 0.2s;
  margin-left: 2px;
}

.musicPanel-pinBtn:hover,
.musicPanel-closeBtn:hover,
.musicPanel-deleteBtn:hover,
.toggle-channels-btn:hover {
  opacity: 1;
}

.musicPanel-deleteBtn:hover {
  color: red;
}

.musicPanel-closeBtn {
  font-size: 18px;
  line-height: 1;
}

.musicPanel-headerActions {
  flex: 0 0 auto;
  white-space: nowrap;
}

.musicPanel-headerActions .musicPanel-pinBtn,
.musicPanel-headerActions .musicPanel-closeBtn {
  width: 20px;
  min-width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
}

.musicPanel-headerActions .musicPanel-closeBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.musicPanel-headerActions .musicPanel-closeBtn svg {
  width: 18px;
  height: 18px;
}

/*@media (min-width: 1200px) {*/
/*    margin-left: 290px;*/
/*    width: calc(100vw - 290px);*/
/*  }*/
/*}*/


/*//-----------------*/

.close-btn {
  background: none;
  color: #aaa;
  border: none;
  font-size: 16px;
  float: right;
  cursor: pointer;
}

.upload-link {
  color: #4da6ff;
  cursor: pointer;
  text-decoration: underline;
}

.upload-link:hover {
  text-decoration: none;
}

.musicPanel-title.clickable {
  cursor: pointer;
}

.music-icon {
  height: 1em;
  width: auto;
  vertical-align: middle;
  margin-right: 6px;
  display: inline-block;
}


/*-- soundCloud ---*/


.musicPanel-item iframe {
  width: 100%;
  max-width: 600px;
  border-radius: 8px;
  margin: 10px 0;
}

.musicPanel-item {
  display: flex;
  justify-content: center;
}


/*----- Recording ----*/

/* Record Music toggle button */
.music-recording {
  display: inline-block;
  margin-left: 6px;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #c33;
  background: #e74c3c; /* red tone */
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.music-recording:hover { background: #c0392b; }
.music-recording:active { transform: scale(0.97); }

/* Match style when "Close" */
.music-recording.close {
  background: #555;
  border-color: #333;
}

/*-------------------*/

.recording-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: 90%;
  background: #111;
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  padding: 16px; /* reduced padding */
  z-index: 12000;
}
.recording-panel.hidden { display: none; }

.recording-header {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-bottom: 8px; /* tighter */
}
.recording-header button {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

.rec-timer {
  text-align: center;
  font-size: 20px;  /* smaller */
  font-weight: bold;
  margin-bottom: 6px;
}

.waveform {
  height: 28px;  /* slimmer */
  background: repeating-linear-gradient(
    to right,
    #444,
    #444 2px,
    transparent 2px,
    transparent 6px
  );
  margin: 0 auto 10px; /* less space */
  border-radius: 4px;
}

.record-btn {
  display: block;
  margin: 6px auto; /* tighter */
  width: 60px;      /* slightly smaller */
  height: 60px;
  border-radius: 50%;
  background: #e74c3c;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}
.record-btn:active { transform: scale(0.95); background: #c0392b; }

.actions {
  display: flex;
  justify-content: space-between;
  margin-top: 8px; /* reduced */
}
.confirm-btn {
  flex: 1;
  margin-right: 6px;
  background: #2ecc71;
  border: none;
  padding: 6px;   /* smaller */
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  font-size: 13px;
}
.cancel-btn {
  flex: 1;
  margin-left: 6px;
  background: #e74c3c;
  border: none;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  font-size: 13px;
}

/* Limit recording panel height on small screens */
#recordingPanel {
  max-height: 75vh;  /* trimmed a bit more */
  overflow-y: auto;
}

/* On very small devices, reduce padding/margins further */
@media (max-height: 700px) {
  #recordingPanel .recording-body {
    padding: 6px;
  }
  #recordingPanel .rec-timer {
    font-size: 18px;
    margin-bottom: 4px;
  }
  #recordingPanel .waveform {
    height: 24px;
    margin: 4px 0 8px;
  }
  #recordingPanel .actions button {
    padding: 5px;
    font-size: 12px;
  }
}


/*----DropBox-----------*/

.music-dropbox-btn {
  display: inline-block;
  margin-left: 6px;
  align-items: center;
  gap: 6px;
  background: #333;
  color: #eee;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.music-dropbox-btn:hover {
  background: #444;
}



/*-----------------------*/

.custom-audio-player {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0px;
  border-radius: 10px;
  /*background: #1e1e1e;*/
  color: #eee;
}

.controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
}

.player-btn {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: color 0.2s, background 0.2s;
}

.player-btn.big {
  width: 52px;
  height: 52px;
  font-size: 22px;
  background: #333;
  color: #fff;
}

.player-btn:hover {
  color: #4af;
  background: rgba(255,255,255,0.08);
}

.player-btn.with-number .btn-number {
  position: absolute;
  font-size: 10px;
  font-weight: bold;
  color: #4af;
  bottom: 3px;
  right: 3px;
  pointer-events: none;
}

/* 🎵 Progress row scales with environment zoom */
.progress-row {
  display: flex;
  align-items: center;
  gap: 0.5em;             /* 8px → 0.5em */
}

/* --- Progress bar track --- */
.progress-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 0.6em;       /* 7px → 0.4375em */
  background: #444;
  border-radius: 0.1875em; /* 3px → 0.1875em */
  cursor: pointer;
}

/* --- Progress knob --- */
.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0.75em;          /* 12px → 0.75em */
  height: 0.75em;
  border-radius: 50%;
  background: #4af;
  cursor: pointer;
}

/* --- Time labels --- */
.time-labels {
  display: flex;
  gap: 0.375em;           /* 6px → 0.375em */
  font-size: 0.6875em;    /* 11px → 0.6875em */
  color: #aaa;
  font-family: monospace;
}

/* --- Speed selector --- */
.speed-select {
  background: #222;
  border: 1px solid #555;
  color: #eee;
  padding: 0.125em 0.375em; /* 2px 6px → 0.125em 0.375em */
  border-radius: 0.375em;   /* 6px → 0.375em */
  font-size: 0.75em;        /* 12px → 0.75em */
  margin-left: auto;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.speed-select:hover {
  border-color: #4af;
}


.player-btn i[data-lucide="download"] {
  width: 18px;
  height: 18px;
}


/*------- pinn to bottom ------------*/

/* ==============================
   Floating Music Player (progress inside bar)
   ============================== */


.musicPanel-bottomPinned:hover {
  background: #252a34;
}

.musicPanel-bottomPinned .custom-audio-player {
  display: contents !important;
}

.musicPanel-bottomPinned .controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.musicPanel-bottomPinned .player-btn.big {
  width: 36px;
  height: 36px;
  font-size: 16px;
}


/* Progress bar inside the pinned wrapper */
.musicPanel-bottomPinned .progress-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0.5em;               /* 8px → 0.5em */
  opacity: 1;
  pointer-events: auto;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.6875em;      /* 11px ÷ 16px */
}

/* --- Slider track --- */
.musicPanel-bottomPinned .progress-bar {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 36px;
  border-radius: 0.3em;  /* 3px → 0.1875em */
  background: transparent;
  cursor: pointer;
}

.musicPanel-bottomPinned .progress-bar::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 4px;
  background: #777e89;
}

.musicPanel-bottomPinned .progress-bar::-moz-range-track {
  height: 6px;
  border-radius: 4px;
  background: #777e89;
}

/* --- Slider knob --- */
.musicPanel-bottomPinned .progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  /*background: #fff;*/
  background: #4af;
    /*border: 1px solid rgba(0, 0, 0, 0.4);*/
  border: none; /* or transparent */
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4) inset;  
}

.musicPanel-bottomPinned .progress-bar::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #4af;
}

/* --- Time labels --- */
.musicPanel-bottomPinned .time-labels {
  display: flex;
  gap: 4px;
  white-space: nowrap;
  font-family: monospace;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.8);
}

.musicPanel-bottomPinned .duration::before {
  content: "/";
  margin-right: 4px;
  opacity: 0.5;
}

/* --- Speed selector --- */
.musicPanel-bottomPinned .speed-select {
  background: rgba(255, 255, 255, 0.15);
  border: 0 solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.125em 0.375em; /* 2px 6px → 0.125em 0.375em */
  border-radius: 0.25em;    /* 4px → 0.25em */
  font-size: 0.75em;        /* 12px ÷ 16px */
}




/* Unpin button for pinned player */
.musicPanel-unpinBtn {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 20000;
}

.musicPanel-unpinBtn:hover {
  opacity: 1;
  color: #4af; /* light accent color on hover */
}


.musicPanel-floating,
.musicPanel-floating .midi-player-wrapper {
  overflow: hidden;   /* no scrollbars ever */
}



.musicPanel-floating {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 2.625em; /* instead of 42px */
  max-height: calc(100vh - 60px); /* fits viewport */
  z-index: 9999;
  background: rgba(40, 40, 40, 0.8);
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  padding: 8px;
  cursor: move;
  overflow: hidden;
}

.musicPanel-dockVideo .musicPlayerBox {
  height: auto !important;
  min-height: 200px !important;
  aspect-ratio: 16 / 9;
}

.musicPanel-dockVideo iframe {
  display: block;
}

.musicPanel-bottomPinned[data-type].musicPanel-videoSource .musicPanel-voices,
.musicPanel-bottomPinned[data-type].musicPanel-videoSource .musicPanel-metronome {
  display: none;
}

.musicPanel-floating.musicPanel-maximized {
  left: 50% !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  width: min(960px, calc(100vw - 32px)) !important;
  max-width: none;
}

.musicPanel-floating.musicPanel-maximized .musicPlayerBox {
  width: 100%;
  max-width: none;
  height: min(56.25vw, 65vh, 540px) !important;
  max-height: none;
}

.musicPanel-floating.musicPanel-maximized iframe {
  max-width: none;
}

.musicPanel-floating[data-type="embed"] .musicPlayerBox {
  position: relative;
  resize: none !important;
  width: 100%;
  max-width: none;
}

.musicPanel-floating.musicPanel-resized {
  max-width: calc(100vw - 16px);
}

.musicPanel-floating.musicPanel-resized iframe {
  max-width: none;
}

.musicPanel-resizeGrip {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  z-index: 1;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(135deg, transparent 55%, #aaa 55% 60%, transparent 60% 72%, #aaa 72% 77%, transparent 77%);
}


:root {
  --tw-music-dock-height: 80px;
}

.musicPanel-bottomPinned {
  --tw-music-dock-height: calc(80px * var(--tw-dock-zoom, 1));
  box-sizing: border-box;
  position: fixed;
  left: 0;
  width: 100%;
  max-width: none;
  transform: none;
  bottom: var(--app-footer-height, 40px);
  top: auto;
  height: var(--tw-music-dock-height);
  min-height: 0;
  display: block;
  background: linear-gradient(rgba(32, 35, 41, 0.94), rgba(32, 35, 41, 0.94)) var(--skin-accent-soft, #2e3b43);
  color: #f5f7fb;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.24);
  border-top: 1px solid var(--skin-accent, #4a7cff);
  border-radius: 0;
  z-index: 10080;
  padding: 0;
  margin: 0 !important;
  overflow: visible;
  transition: none;
  touch-action: pan-x;
}

.musicPanel-bottomPinned::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--tw-header-pattern, none);
  background-size: var(--tw-header-pattern-size, auto);
  background-repeat: var(--tw-header-pattern-repeat, repeat);
  background-position: center bottom;
  opacity: 0.18;
}

.musicPanel-bottomPinned[data-type="empty"]:not(.musicPanel-videoSource) .musicPlayerBox :is(button, input, select) {
  opacity: 0.35;
  cursor: default;
}

.musicPanel-bottomPinned.musicPanel-autohidden {
  visibility: hidden;
  pointer-events: none;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.musicPanel-bottomPinned.musicPanel-autohidden::before {
  display: none;
}

.musicPanel-bottomPinned.musicPanel-autohidden .controls-row .player-btn.big {
  visibility: visible;
  pointer-events: auto;
  opacity: 0.15;
}

.musicPanel-bottomPinned.musicPanel-autohidden .controls-row .player-btn.big:hover,
.musicPanel-bottomPinned.musicPanel-autohidden .controls-row .player-btn.big:focus-visible {
  opacity: 0.5;
}

.musicPanel-bottomPinned .musicPanel-header {
  display: contents !important;
}

.musicPanel-bottomPinned .musicPanel-menuBtn {
  position: absolute;
  top: 4px;
  left: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #c8d2e2;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.musicPanel-bottomPinned .musicPanel-menuBtn svg {
  width: 20px;
  height: 20px;
}

.musicPanel-bottomPinned .musicPanel-menuBtn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #edf3ff;
}

.musicPanel-bottomPinned .musicPanel-title {
  position: absolute;
  top: calc(var(--tw-music-dock-height) - 34px);
  left: auto;
  right: 12px;
  height: 10px;
  min-width: 0;
  max-width: var(--tw-title-space, calc(50% - 180px));
  text-align: right;
  font-size: 9px !important;
  line-height: 10px;
  color: #abb3c0;
  pointer-events: none;
}

.musicPanel-bottomPinned .musicPanel-audioIcon {
  display: none;
}

.musicPanel-bottomPinned .musicPanel-headerActions {
  position: absolute;
  top: 6px;
  right: 12px;
}

.musicPanel-bottomPinned .controls-row {
  position: absolute;
  top: calc((var(--tw-music-dock-height) - 63px) / 2);
  left: 50%;
  transform: translateX(-50%) scale(min(var(--tw-dock-zoom, 1), var(--tw-dock-controls-max-zoom, 1.75)));
  height: 40px;
  width: max-content;
  gap: 4px;
  z-index: 1;
}

.musicPanel-bottomPinned .player-btn {
  width: 40px !important;
  height: 40px !important;
  padding: 4px;
}

.musicPanel-bottomPinned .player-btn.big {
  width: 52px !important;
  height: 52px !important;
  flex-shrink: 0;
  background: #343840;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(100, 161, 255, 0.28), 0 0 16px rgba(74, 124, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.musicPanel-bottomPinned .player-btn.big svg {
  fill: none;
  stroke-width: 2;
}

.musicPanel-bottomPinned .player-btn.big:hover {
  background: #414b5f;
  color: #8cb7ff;
}

.musicPanel-bottomPinned .player-btn svg {
  width: 26px;
  height: 26px;
}

.musicPanel-bottomPinned .controls-row > .player-btn:not(.big):not(.loop-btn) svg {
  transform: scale(0.9);
}

.musicPanel-bottomPinned .progress-row {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  width: auto;
  height: 20px;
  min-width: 0;
}

.musicPanel-bottomPinned .controls-row > .loop-btn {
  flex: 0 0 28px;
  width: 28px !important;
  height: 36px !important;
  margin: 0 4px;
  padding: 2px;
}

.musicPanel-item .loop-btn.is-active {
  background: rgba(98, 223, 172, 0.12);
  box-shadow: inset 0 0 0 1px rgba(98, 223, 172, 0.3);
}

.musicPanel-bottomPinned .player-btn:focus-visible,
.musicPanel-bottomPinned .musicPanel-menuBtn:focus-visible,
.musicPanel-bottomPinned .progress-bar:focus-visible {
  outline: 2px solid #8cb7ff;
  outline-offset: 1px;
}

.musicPanel-bottomPinned .speed-select {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  min-width: 42px;
  height: 20px !important;
  padding: 0 14px 0 4px !important;
  border: none;
  border-radius: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23abb3c0' stroke-width='1.5'/%3E%3C/svg%3E") right 3px center / 8px 5px no-repeat;
  box-shadow: none;
  color: #c8d2e2;
  font-size: 10px !important;
  text-align: center;
  cursor: pointer;
}

.musicPanel-bottomPinned .speed-select:hover,
.musicPanel-bottomPinned .speed-select:focus-visible {
  color: #edf3ff;
}

.musicPanel-bottomPinned .speed-select:focus-visible {
  outline: 1px solid #8cb7ff;
  outline-offset: 1px;
}

.musicPanel-midiDock {
  display: none;
}

.musicPanel-bottomPinned[data-type="midi"] .midi-player-wrapper {
  display: none;
}

.musicPanel-bottomPinned .musicPanel-midiDock {
  display: contents;
}

.musicPanel-voices {
  display: none;
}

.musicPanel-bottomPinned .musicPanel-voices {
  position: absolute;
  top: 4px;
  left: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: var(--tw-voice-space, calc(100% - 120px));
  min-height: 24px;
  box-sizing: border-box;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: thin;
  z-index: 2;
}

.musicPanel-bottomPinned .musicPanel-voices button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-sizing: border-box;
  min-height: calc(20px * var(--tw-dock-zoom, 1));
  padding: calc(2px * var(--tw-dock-zoom, 1)) calc(8px * var(--tw-dock-zoom, 1));
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.78);
  color: #e2e8f0;
  font-size: calc(9px * var(--tw-dock-zoom, 1));
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.musicPanel-bottomPinned .musicPanel-voicePercent {
  font-size: calc(8px * var(--tw-dock-zoom, 1));
  opacity: 0.74;
}

@media (max-width: 700px) {
  .musicPanel-bottomPinned .musicPanel-voicePercent {
    display: none;
  }
}

.musicPanel-bottomPinned .musicPanel-voices button.is-active {
  border-color: rgba(251, 146, 60, 0.72);
  background: rgba(249, 115, 22, 0.24);
  color: #fff7ed;
}

.musicPanel-bottomPinned .musicPanel-voices button:focus-visible {
  outline: 2px solid #8cb7ff;
  outline-offset: 1px;
}

.musicPanel-bottomPinned .musicPanel-metronome {
  flex: 0 0 auto;
  height: 20px;
  padding: 0 5px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  color: #c8d2e2;
  font-size: 10px;
  cursor: pointer;
}

.musicPanel-bottomPinned.musicPanel-filtersWrapped .musicPanel-voices {
  width: var(--tw-voice-space);
  flex-wrap: wrap;
  row-gap: 4px;
}

.musicPanel-bottomPinned.musicPanel-filtersWrapped[data-type="midi"] .musicPanel-voices {
  display: grid;
  grid-template-rows: repeat(2, calc(20px * var(--tw-dock-zoom, 1)));
  grid-auto-flow: column;
  grid-auto-columns: max-content;
}

.musicPanel-bottomPinned.musicPanel-filtersWrapped[data-type="midi"] .musicPanel-voices button:first-child {
  grid-column: 1;
  grid-row: 1;
}

.musicPanel-bottomPinned.musicPanel-filtersWrapped[data-type="midi"] .musicPanel-voices button:last-child {
  grid-column: 1;
  grid-row: 2;
}

.musicPanel-bottomPinned.musicPanel-filtersRow:not(.musicPanel-videoSource) {
  --tw-voice-row-height: max(18px, calc(12px * var(--tw-dock-zoom, 1)));
  height: calc(var(--tw-music-dock-height) + var(--tw-voice-row-height) + var(--tw-dock-label-space, 0px));
}

.musicPanel-bottomPinned.musicPanel-filtersRow:not(.musicPanel-videoSource) .controls-row {
  top: var(--tw-dock-controls-top);
}

.musicPanel-bottomPinned.musicPanel-filtersRow:not(.musicPanel-videoSource) .musicPanel-title {
  top: calc(var(--tw-voice-row-height) + var(--tw-music-dock-height) + var(--tw-dock-label-space, 0px) - 38px);
}

.musicPanel-bottomPinned.musicPanel-filtersRow .musicPanel-voices {
  left: 36px;
  right: 64px;
  width: auto;
  max-width: none;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.musicPanel-bottomPinned.musicPanel-filtersRow .musicPanel-voices button {
  max-width: 100%;
}

.musicPanel-bottomPinned .musicPanel-voices button > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .musicPanel-bottomPinned .controls-row {
    gap: clamp(4px, 2vw, 10px);
    max-width: calc(100% - 24px);
  }

  .musicPanel-bottomPinned .controls-row .player-btn {
    min-width: 0;
    width: 36px !important;
    height: 36px !important;
    padding: 2px;
  }

  .musicPanel-bottomPinned .controls-row .player-btn.big {
    width: 44px !important;
    height: 44px !important;
  }

  .musicPanel-bottomPinned .controls-row > .loop-btn {
    flex-basis: 24px;
    width: 24px !important;
    margin: 0;
  }

  .musicPanel-bottomPinned .controls-row > .player-btn:nth-child(2),
  .musicPanel-bottomPinned .controls-row > .player-btn:nth-child(6) {
    width: 24px !important;
    padding: 0;
  }

  .musicPanel-bottomPinned .controls-row > .player-btn:nth-child(2) svg,
  .musicPanel-bottomPinned .controls-row > .player-btn:nth-child(6) svg {
    width: 22px;
    height: 22px;
  }

  .musicPanel-bottomPinned .controls-row .player-btn svg {
    max-width: 100%;
  }
}




/* Hide delete + download when pinned (either bottom or floating) */
.musicPanel-bottomPinned .musicPanel-deleteBtn,
.musicPanel-floating .musicPanel-deleteBtn,
.musicPanel-bottomPinned .player-btn[title="Download"],
.musicPanel-floating .player-btn[title="Download"] {
  display: none !important;
}



/* Re-enable controls inside pinned player */
.musicPanel-floating button,
.musicPanel-floating input,
.musicPanel-floating select,
.musicPanel-bottomPinned button,
.musicPanel-bottomPinned input,
.musicPanel-bottomPinned select {
  pointer-events: auto !important;
}


/* ðŸŽš Speed selector text visibility across themes */
.speed-select {
  color: #555;              /* soft neutral gray text */
  background: transparent;  /* keep same surface */
  border: 1px solid rgba(120,120,120,0.4);
  border-radius: 4px;
  font-size: 12px;
  padding: 2px 4px;
}

/* Options in dropdown: readable on any system menu */
.speed-select option {
  color: #000;              /* force black in dropdown list */
  background: #fff;
}

/* When pinned (translucent background), slightly brighten */
.musicPanel-floating .speed-select,
.musicPanel-bottomPinned .speed-select {
  color: #ccc;              /* lighter gray against transparent surface */
  border-color: rgba(200,200,200,0.4);
}

.musicPanel-floating .speed-select option,
.musicPanel-bottomPinned .speed-select option {
  color: #000;
  background: #fff;
}



.musicPanel-bottomPinned .musicPlayerBox {
  width: 100%;
  max-width: none;
}

.musicPanel-floating .musicPlayerBox {
  width: auto;
  max-width: 30em; /* optional cap for floating window */
}



/*----------------------*/


/* Google Picker must appear above panels/modals */
.picker-dialog,
.picker-dialog-bg,
.goog-inline-block,
.goog-modalpopup {
z-index: 3000;
}
