/* ===========================================================
   Stem Player — identità "banco mixer": pannelli scuri, LED
   azzurre per lo stato dei canali, cifre in monospazio.
   =========================================================== */

:root {
  --bg: #0e141f;
  --panel: #141c29;
  --panel-raised: #1a2433;
  --line: #2a3646;
  --text: #eaf1f8;
  --text-dim: #93a6ba;
  --text-faint: #5c6d80;

  --accent: #4fa8e0;
  --accent-dim: #2c5878;
  --solo: #e8b23d;
  --mute: #e2544a;
  --teal: #5fb3a3;

  --radius: 10px;
  --font-display: "Big Shoulders Display", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

/* L'attributo [hidden] va sempre rispettato anche quando un selettore più
   specifico (es. display:flex su .stage__placeholder) verrebbe altrimenti
   applicato dopo di lui nel foglio di stile. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-user-select: none;
  user-select: none;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(79, 168, 224, 0.06), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(95, 179, 163, 0.04), transparent 45%);
}

button {
  font-family: inherit;
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===================== Sidebar ===================== */

.sidebar {
  width: 340px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar__header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--line);
}

.sidebar__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.sidebar__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 0.92;
  letter-spacing: 0.01em;
  margin: 8px 0 0;
  color: var(--text);
}

.sidebar__close-btn {
  display: none;
}

.song-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 10px;
  /* scrollbar in tema con la palette dell'app invece di quella di sistema */
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.song-list::-webkit-scrollbar {
  width: 9px;
}

.song-list::-webkit-scrollbar-track {
  background: transparent;
}

.song-list::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 5px;
  border: 2px solid var(--panel);
}

.song-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.song-list__empty {
  color: var(--text-faint);
  font-size: 13px;
  padding: 12px;
}

.song-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-dim);
  padding: 11px 14px;
  margin-bottom: 4px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.song-item:hover {
  background: var(--panel-raised);
  color: var(--text);
}

.song-item__index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  width: 20px;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.song-item__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-item__duration {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.song-item.is-active {
  background: var(--panel-raised);
  border-color: var(--accent-dim);
  color: var(--text);
}

.song-item.is-active .song-item__index {
  color: var(--accent);
}

.song-item.is-disabled,
.song-item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.song-item.is-disabled:hover,
.song-item:disabled:hover {
  background: transparent;
  color: var(--text-dim);
}

.song-item.is-disabled .song-item__duration {
  font-style: italic;
  letter-spacing: 0.04em;
}

.sidebar__footer {
  flex-shrink: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ===================== Stage ===================== */

.stage {
  flex: 1;
  overflow-y: auto;
  padding: 40px 48px 80px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) var(--bg);
}

.stage::-webkit-scrollbar {
  width: 10px;
}

.stage::-webkit-scrollbar-track {
  background: var(--bg);
}

.stage::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 5px;
  border: 2px solid var(--bg);
}

.stage::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.stage__placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-faint);
  text-align: center;
}

.stage__placeholder-mark {
  font-size: 30px;
  color: var(--accent-dim);
}

.stage__header {
  margin-bottom: 24px;
}

.stage__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.stage__title-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.stage__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 46px;
  line-height: 1;
  margin: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage__details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(79, 168, 224, 0.08);
  border: 1px solid rgba(79, 168, 224, 0.25);
  border-radius: 16px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  line-height: 1;
}

.stage__details-toggle:hover {
  background: rgba(79, 168, 224, 0.18);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.stage__details-toggle[aria-expanded="true"] {
  background: var(--accent);
  color: #0b121c;
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(79, 168, 224, 0.4);
}

.stage__details-toggle[aria-expanded="true"] .stage__details-chevron {
  transform: rotate(180deg);
}

.stage__details-chevron {
  transition: transform 0.2s ease;
}

/* ===================== Box Dettagli Brano ===================== */

.song-details-box {
  background: linear-gradient(180deg, rgba(26, 36, 51, 0.95) 0%, rgba(18, 26, 38, 0.95) 100%);
  border: 1px solid #2e4057;
  border-radius: var(--radius);
  padding: 16px 20px 18px;
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  animation: slideDownFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.song-details-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(46, 64, 87, 0.6);
}

.song-details-box__title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.song-details-box__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: rgba(79, 168, 224, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(79, 168, 224, 0.25);
}

.song-details-box__hint {
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
  user-select: none;
}

.song-details-box__close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.song-details-box__close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.song-details-box__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.song-details-box__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.song-details-box__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.song-details-box__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  user-select: none;
}

.song-details-box__input,
.song-details-box__textarea {
  background: #0d1420;
  border: 1px solid #27384c;
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: all 0.2s ease;
  outline: none;
  width: 100%;
}

.song-details-box__textarea {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  resize: vertical;
  min-height: 85px;
}

/* Sola lettura: stile pulito e cursor pointer per dblclick */
.song-details-box__input[readonly],
.song-details-box__textarea[readonly] {
  background: rgba(13, 20, 32, 0.6);
  border-color: rgba(39, 56, 76, 0.6);
  color: #d1dfed;
  cursor: pointer;
}

.song-details-box__input[readonly]:hover,
.song-details-box__textarea[readonly]:hover {
  border-color: var(--accent-dim);
  background: rgba(13, 20, 32, 0.9);
}

/* Modalità modifica: bordi accentati e focus evidenziato */
.song-details-box.is-editing .song-details-box__input:not([readonly]),
.song-details-box.is-editing .song-details-box__textarea:not([readonly]) {
  background: #121c2b;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 168, 224, 0.2);
  color: #ffffff;
  cursor: text;
}

.song-details-box.is-editing .song-details-box__input:focus,
.song-details-box.is-editing .song-details-box__textarea:focus {
  border-color: #6bbef2;
  box-shadow: 0 0 0 3px rgba(79, 168, 224, 0.35);
}

.song-details-box__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(46, 64, 87, 0.6);
}

.song-details-box__edit-indicator {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #4fa8e0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.song-details-box__btn-group {
  display: flex;
  gap: 10px;
}

.song-details-btn {
  padding: 7px 18px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.song-details-btn--cancel {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--text-dim);
}

.song-details-btn--cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.song-details-btn--save {
  background: var(--accent);
  color: #0b1420;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(79, 168, 224, 0.3);
}

.song-details-btn--save:hover {
  background: #6fc3f7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 168, 224, 0.45);
}

/* ===================== Password Modal ===================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 18, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: #151e2b;
  border: 1px solid #2e3e52;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.modal__icon-wrap {
  background: rgba(79, 168, 224, 0.15);
  color: var(--accent);
  padding: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}

.modal__subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

.modal__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal__input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal__input {
  background: #0d141e;
  border: 1px solid #2c3c50;
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.modal__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 168, 224, 0.25);
}

.modal__error {
  font-size: 12px;
  color: #ff6b6b;
  font-family: var(--font-mono);
  animation: shake 0.3s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.modal__btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.modal__btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--text-dim);
}

.modal__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal__btn--primary {
  background: var(--accent);
  color: #0b1420;
  font-weight: 600;
}

.modal__btn--primary:hover {
  background: #6fc3f7;
  box-shadow: 0 4px 12px rgba(79, 168, 224, 0.35);
}

/* ===================== Sezione 1: trasporto ===================== */

.transport {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 70px;
  padding: 14px 24px;
  background: linear-gradient(180deg, #253449 0%, #162232 100%);
  border-bottom: 1px solid #384b64;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
  z-index: 5;
}

.transport__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* Button group: raggruppa controlli uniti con divisori */
.btn-group {
  display: inline-flex;
  align-items: stretch;
  background: #131d2b;
  border: 1px solid #2e3f56;
  border-radius: 8px;
  overflow: hidden;
  height: 38px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.btn-group__btn {
  border: none;
  background: transparent;
  border-radius: 0;
  border-right: 1px solid #243346;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-group__btn:last-child {
  border-right: none;
}

.btn-group__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.transport__icon-btn {
  width: 38px;
  height: 100%;
  flex-shrink: 0;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.transport__icon-btn:not(:disabled):hover {
  color: var(--accent);
  background: #223246;
}

.transport__play {
  width: 68px;
  height: 100%;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.transport__play:not(:disabled):hover {
  background: #223246;
  color: #6ac0f7;
}

.transport__play:not(:disabled):active {
  background: #192434;
}

.transport__play.is-playing {
  background: #23864f;
  color: #ffffff;
  box-shadow: none;
}

.transport__play.is-playing:not(:disabled):hover {
  background: #299658;
  color: #ffffff;
}

.transport__play.is-playing:not(:disabled):active {
  background: #1c6b3e;
  color: #ffffff;
}

.transport__time {
  width: 140px;
  height: 38px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  background: #04070d;
  border: 1px solid #1a2636;
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.transport__time-sep {
  color: #4f647d;
  margin: 0 7px;
}

.transport__right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
}

.transport__views {
  display: flex;
  align-items: center;
}

.transport__view-group {
  height: 38px;
  border-radius: 8px;
}

.transport__view-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 100%;
  color: var(--text-dim);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.transport__view-btn:not(.is-active):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.transport__view-btn.is-active {
  background: var(--accent);
  color: #0b121c;
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(79, 168, 224, 0.35);
}

.transport__view-btn.is-active:hover {
  background: #6ec0f5;
  color: #081018;
}

.transport__view-btn.is-active svg {
  color: #0b121c;
}

.transport__view-btn.is-active:hover svg {
  color: #081018;
}

.transport__downloads {
  display: flex;
  align-items: center;
}

/* ===================== Dropdown Download ===================== */

.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0 14px;
  height: 38px;
  border-radius: 8px;
  background: #131d2b;
  border: 1px solid #2e3f56;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.dropdown__trigger:hover,
.dropdown.is-open .dropdown__trigger {
  color: #fff;
  background: #223246;
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}

.dropdown__trigger svg {
  color: var(--accent);
  flex-shrink: 0;
}

.dropdown__arrow {
  color: var(--text-faint) !important;
  transition: transform 0.2s ease;
}

.dropdown.is-open .dropdown__arrow {
  transform: rotate(180deg);
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
}

.dropdown__item:hover,
.dropdown__item:focus-visible {
  background: #22303f;
  color: var(--text);
}

.dropdown__item svg {
  color: var(--accent);
  fill: currentColor;
  flex-shrink: 0;
}

.dropdown__item svg path {
  fill: currentColor;
}

.dropdown__item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dropdown__item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dropdown__item-desc {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* Slider volume personalizzato: la regolazione si attiva ESCLUSIVAMENTE
   partendo dal pallino (thumb), sia su desktop che su smartphone, evitando
   salti accidentali di volume quando si tocca o clicca la barra esterna. */
.vol-slider {
  position: relative;
  flex: 1;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: default;
  touch-action: pan-y;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.vol-slider:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.vol-slider__track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  pointer-events: none;
}

.vol-slider__fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 2px;
  pointer-events: none;
}

.vol-slider__thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #14110f;
  box-shadow: 0 0 0 1px var(--accent-dim);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  z-index: 2;
}

/* Touch area invisibile per facilitare il grab con il dito su smartphone (38px x 38px) */
.vol-slider__thumb::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
}

.vol-slider__thumb.is-dragging {
  cursor: grabbing;
  box-shadow: 0 0 0 3px rgba(79, 168, 224, 0.4);
}

/* ===================== Sezione 2: pannello tracce (timeline + forme d'onda) ===================== */

.tracks-panel {
  position: relative;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.tracks-panel__corner {
  grid-column: 1;
  grid-row: 2;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #101723;
  height: 30px;
}

/* ===================== Vista Lyrics ===================== */

/* In vista Lyrics, le tracce a sinistra (.track-head con volume, mute, solo) 
   e la barra del tempo in alto (.tracks-panel__ruler con la playhead) rimangono visibili.
   Vengono nascoste unicamente le forme d'onda (.track-wave), sostituite dal pannello dei testi. */
.tracks-panel.is-lyrics-view .track-wave {
  display: none !important;
}

.tracks-panel.is-lyrics-view .tracks-panel__playhead {
  grid-column: 2;
  grid-row: 2;
  height: 30px;
}

.tracks-panel.is-lyrics-view .tracks-panel__playhead-line {
  display: block;
}

.lyrics-panel {
  grid-column: 2;
  grid-row: 3 / span 100;
  min-height: 320px;
  max-height: 560px;
  overflow-y: auto;
  padding: 32px 36px;
  background: linear-gradient(180deg, #111a27 0%, #0d141f 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-user-select: text;
  user-select: text;
}

.lyrics-panel::-webkit-scrollbar {
  width: 8px;
}

.lyrics-panel::-webkit-scrollbar-track {
  background: transparent;
}

.lyrics-panel::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 4px;
}

.lyrics-panel::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.lyrics-panel__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 260px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
}

.lyrics-panel__spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(79, 168, 224, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.lyrics-panel__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 260px;
  color: var(--text-faint);
  text-align: center;
  font-size: 14px;
}

.lyrics-panel__empty svg {
  color: var(--accent-dim);
  opacity: 0.6;
}

.lyrics-panel__body {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lyrics-panel__view {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  cursor: default;
}

.lyrics-panel__content {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 2.1;
  color: #eaf1f8;
  text-align: center;
  white-space: pre-line;
  letter-spacing: 0.015em;
  width: 100%;
  user-select: text;
}

.lyrics-panel__edit {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lyrics-panel__textarea {
  width: 100%;
  min-height: 280px;
  max-height: 480px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  color: #eaf1f8;
  background: #090e16;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 18px 20px;
  resize: vertical;
  outline: none;
  box-shadow: 0 0 12px rgba(79, 168, 224, 0.2);
}

.lyrics-panel__textarea:focus {
  border-color: #72c0f3;
  box-shadow: 0 0 16px rgba(79, 168, 224, 0.35);
}

.lyrics-panel__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lyrics-panel__edit-indicator {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #f59e0b;
  letter-spacing: 0.04em;
}

.lyrics-panel__btn-group {
  display: flex;
  gap: 10px;
}

.lyrics-panel__add-btn {
  margin-top: 10px;
}

.tracks-panel__ruler {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  height: 30px;
  border-bottom: 1px solid var(--line);
}

.tracks-ruler__tick {
  position: absolute;
  top: 50%;
  transform: translate(0, -50%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
  padding-left: 6px;
  border-left: 1px solid var(--line);
  height: 12px;
  display: flex;
  align-items: center;
  z-index: 1;
}

/* Riempimento progressivo del righello: cresce mano a mano che avanza la riproduzione */
.tracks-ruler__progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(to right, rgba(79, 168, 224, 0.40), rgba(79, 168, 224, 0.20));
  pointer-events: none;
  z-index: 0;
  transition: width 80ms linear;
}

/* Overlay che copre tutta l'area delle forme d'onda (tutte le righe, colonna
   2): mostra la linea di posizione e cattura i click/trascinamenti per fare
   seek, senza dover replicare la logica su ogni singola riga. */
.tracks-panel__playhead {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  height: 30px;
  cursor: pointer;
  touch-action: none;
  z-index: 10;
}

.tracks-panel__playhead-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(79, 168, 224, 0.7);
  pointer-events: none;
}

.tracks-panel__playhead-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--accent);
}

.track-head {
  grid-column: 1;
  padding: 12px 14px;
  border-bottom: 2px solid var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.track-head__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-head__name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
  letter-spacing: 0.01em;
}

.track-head__switches {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.track-head__fader {
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-head__fader .vol-slider {
  flex: 1;
}

/* Riquadro della forma d'onda: colore per traccia, condiviso tra sfondo e
   tracciato tramite la custom property --track-color. */
.track-wave {
  grid-column: 2;
  position: relative;
  min-height: 76px;
  border-bottom: 2px solid var(--bg);
  background: var(--panel-raised);
  background: color-mix(in srgb, var(--track-color) 9%, var(--panel-raised));
  transition: background 0.25s ease;
}

.track-wave.is-muted {
  background: #111822;
}

.track-head:nth-last-child(2),
.track-wave:last-child {
  border-bottom: none;
}

.track-wave__wrap {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  overflow: hidden;
}

.track-wave__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.track-wave__path {
  fill: var(--track-color);
  opacity: 0.9;
  transition: fill 0.25s ease, opacity 0.25s ease;
}

.track-wave.is-muted .track-wave__path {
  fill: #3e4e63;
  opacity: 0.45;
}

/* Indicatore di livello del segnale (sotto al volume): risponde in tempo
   reale al segnale audio post-fader dello stem (riflette mute/solo). */
.channel__meter {
  height: 5px;
  border-radius: 3px;
  background: #04070d;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.channel__meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 60ms linear, background-color 120ms ease;
}

.channel__vol-value {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  min-width: 30px;
  text-align: right;
}

/* Mute/Solo: bottoni piccoli, in cima alla testata della traccia, a fianco del nome. */
.chip {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  color: var(--text);
}

.chip--mute.is-on {
  background: rgba(226, 84, 74, 0.16);
  border-color: var(--mute);
  color: var(--mute);
}

.chip--solo.is-on {
  background: rgba(232, 178, 61, 0.16);
  border-color: var(--solo);
  color: var(--solo);
}

/* ===================== Sezione 3: allegati ===================== */

.attachments {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.attachments__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 12px;
  font-weight: 500;
}

.attachments__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attachments__empty {
  color: var(--text-faint);
  font-size: 13px;
  margin: 0;
}

.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s ease;
}

.attachment-link:hover {
  color: var(--text);
  border-color: var(--teal);
}

.attachment-link svg {
  color: var(--teal);
  flex-shrink: 0;
}

/* ===================== Toast ===================== */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-raised);
  border: 1px solid var(--accent-dim);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ===================== Mobile top bar / hamburger ===================== */

.mobile-topbar {
  display: none;
  /* visibile solo sotto il breakpoint mobile */
  align-items: center;
  gap: 12px;
  margin: -4px 0 16px;
}

.mobile-menu-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-menu-btn:hover {
  border-color: var(--accent-dim);
}

.mobile-topbar__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-topbar__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-topbar__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-topbar__dropdown {
  position: relative;
}

.dropdown__menu--right {
  right: 0;
  left: auto;
}

.mobile-details-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-details-btn:hover {
  border-color: var(--accent);
  background: rgba(79, 168, 224, 0.15);
}

.mobile-details-btn[aria-expanded="true"] {
  background: var(--accent);
  color: #0b121c;
  border-color: var(--accent);
}

.transport__mobile-views {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 14, 0.6);
  z-index: 35;
  touch-action: none;
  overscroll-behavior: none;
}

body.drawer-open .stage {
  overflow: hidden;
  touch-action: none;
}

/* ===================== Responsive ===================== */

@media (max-width: 760px) {
  .app {
    height: 100vh;
  }

  .mobile-topbar {
    display: flex;
    margin: 0 0 24px;
  }

  /* la sidebar diventa un drawer che scorre da sinistra sopra il contenuto */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    width: 84%;
    max-width: 320px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 12px 0 28px rgba(0, 0, 0, 0.4);
    overscroll-behavior: contain;
  }

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

  .sidebar__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 20px 18px;
    gap: 12px;
  }

  .sidebar__close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel-raised);
    color: var(--text-dim);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  .sidebar__close-btn:hover {
    color: var(--text);
    background: #25364a;
    border-color: var(--accent-dim);
  }

  .stage {
    padding: 14px 6px 48px;
  }

  .mobile-topbar {
    display: flex;
    margin: 0 0 20px;
    padding: 0 4px;
  }

  /* Nasconde l'header desktop (titolo duplicato e eyebrow) per compattare l'altezza */
  .stage__header {
    display: none;
  }

  /* Box dettagli su smartphone: campo NOTE ancora più grande e BPM/Tonalità verticali */
  .song-details-box {
    padding: 14px 10px 16px;
    margin-bottom: 14px;
  }

  .song-details-box__textarea {
    min-height: 165px;
    font-size: 14px;
  }

  .song-details-box__row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Trasporto: compatto, comandi + tempo ridotto (+15% larghezza OLED) + selettore vista + download */
  .transport {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 6px;
    padding: 10px 4px;
  }

  .transport__controls {
    flex: 0 0 auto;
    justify-content: center;
  }

  /* Display OLED su smartphone con margine a SX e DX */
  .transport__time {
    flex: 0 0 auto;
    width: 120px;
    min-width: 120px;
    height: 34px;
    font-size: 13px;
    padding: 0 10px;
    margin: 0 8px;
    border-radius: 6px;
  }

  .transport__time-sep {
    margin: 0 4px;
  }

  .transport__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
  }

  .transport__views {
    flex: 0 0 auto;
  }

  .transport__view-group {
    height: 34px;
    border-radius: 6px;
  }

  /* 3 pulsanti a dx del display: +2px di padding laterale (da 34px a 38px) */
  .transport__view-btn {
    width: 38px;
    padding: 0 2px;
    justify-content: center;
  }

  .transport__view-label {
    display: none !important;
  }

  .transport__downloads {
    flex: 0 0 auto;
  }

  .transport__dl-btn {
    width: 38px;
    height: 34px;
    padding: 0 2px;
    justify-content: center;
    border-radius: 6px;
  }

  .transport__dl-label {
    display: none !important;
  }

  .dropdown__arrow {
    display: none !important;
  }

  .btn-group {
    height: 34px;
    border-radius: 6px;
  }

  .transport__icon-btn {
    width: 34px;
  }

  .transport__play {
    width: 40px;
  }

  /* Pannello tracce a 1 singola colonna per smartphone */
  .tracks-panel {
    grid-template-columns: 1fr;
    margin-bottom: 20px;
  }

  /* Togli il selettore testuale stems/lyrics su smartphone */
  .tracks-panel__corner {
    display: none !important;
  }

  /* Barra del tempo in alto subito dopo i controlli di trasporto */
  .tracks-panel__ruler {
    grid-column: 1;
    grid-row: 2;
    height: 24px;
    border-bottom: 1px solid var(--line);
  }

  .tracks-panel__playhead {
    grid-column: 1;
    grid-row: 2;
    height: 24px;
  }

  .tracks-panel.is-lyrics-view .tracks-panel__playhead {
    grid-column: 1;
    grid-row: 2;
    height: 24px;
  }

  /* Su smartphone in modalità lyrics spariscono completamente i controlli delle tracce: esce solo il testo */
  .tracks-panel.is-lyrics-view .track-head,
  .tracks-panel.is-lyrics-view .track-wave {
    display: none !important;
  }

  .tracks-panel.is-lyrics-view .lyrics-panel {
    grid-column: 1;
    grid-row: 3;
    padding: 24px 18px;
    max-height: 480px;
  }

  .tracks-panel.is-lyrics-view .lyrics-panel__content {
    font-size: 15px;
    line-height: 1.9;
  }

  .tracks-ruler__tick {
    font-size: 9.5px;
    padding-left: 4px;
  }

  /* 1° riga stem: proporzione tra [M][S] Nome a sx e Volume + Vu-meter a dx */
  .track-head {
    grid-column: 1;
    display: grid;
    grid-template-columns: minmax(125px, 1.1fr) minmax(120px, 155px);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 3px 8px;
    padding: 9px 8px 5px;
    border-right: none;
    border-bottom: none;
    background: var(--panel-raised);
    background: color-mix(in srgb, var(--track-color) 9%, var(--panel-raised));
  }

  .track-head__top {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .track-head__switches {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
  }

  .track-head__name {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
  }

  .track-head__fader {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .channel__meter {
    grid-column: 2;
    grid-row: 2;
    height: 4px;
    margin-right: 28px;
    /* allineato sotto lo slider prima del numero volume */
  }

  .channel__vol-value {
    min-width: 22px;
    font-size: 10.5px;
    flex-shrink: 0;
  }

  .chip {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  /* 2° riga stem: Waveform sottile e compatta */
  .track-wave {
    grid-column: 1;
    min-height: 28px;
    height: 28px;
    border-bottom: 2px solid var(--bg);
  }

  .track-wave:last-child {
    border-bottom: none;
  }
}

/* ===================== Tablet / iPad Portrait (in verticale) ===================== */
/* In verticale: nascondi la setlist nell'hamburger menu drawer, ma lascia la visualizzazione del main come da PC */
@media (min-width: 761px) and (max-width: 1024px) and (orientation: portrait),
(min-width: 761px) and (max-width: 920px) {
  .app {
    height: 100vh;
  }

  .mobile-topbar {
    display: flex;
    margin: 0 0 20px;
    padding: 0 4px;
  }

  .stage__header {
    display: none;
  }

  /* La sidebar diventa un drawer scorrevole da sinistra */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    width: 320px;
    max-width: 80%;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 12px 0 28px rgba(0, 0, 0, 0.4);
    overscroll-behavior: contain;
  }

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

  .sidebar__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 20px 18px;
    gap: 12px;
  }

  .sidebar__close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel-raised);
    color: var(--text-dim);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  .stage {
    padding: 16px 16px 48px;
  }

  /* Main: visualizzazione PC a 2 colonne intatta */
  .tracks-panel {
    display: grid;
    grid-template-columns: 220px 1fr;
    margin-bottom: 24px;
  }

  .tracks-panel__corner {
    display: flex !important;
  }

  .tracks-panel__ruler {
    grid-column: 2;
    grid-row: 2;
    height: 30px;
    border-bottom: 1px solid var(--line);
  }

  .tracks-panel__playhead {
    grid-column: 2;
    grid-row: 2;
    height: 30px;
    position: relative;
    cursor: pointer;
    touch-action: none;
    z-index: 10;
  }

  .tracks-panel.is-lyrics-view .tracks-panel__corner {
    grid-column: 1;
    grid-row: 2;
    display: flex !important;
  }

  .tracks-panel.is-lyrics-view .tracks-panel__ruler {
    grid-column: 2;
    grid-row: 2;
    height: 30px;
  }

  .tracks-panel.is-lyrics-view .tracks-panel__playhead {
    grid-column: 2;
    grid-row: 2;
    height: 30px;
  }

  .tracks-panel.is-lyrics-view .track-head {
    grid-column: 1;
    display: flex !important;
  }

  .tracks-panel.is-lyrics-view .track-wave {
    display: none !important;
  }

  .tracks-panel.is-lyrics-view .lyrics-panel {
    grid-column: 2;
    grid-row: 3 / span 100;
    padding: 24px 20px;
  }

  .track-head {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    border-right: 1px solid var(--line);
    border-bottom: 2px solid var(--bg);
    background: var(--panel-raised);
    background: color-mix(in srgb, var(--track-color) 9%, var(--panel-raised));
  }

  .track-head__top {
    grid-column: auto;
    grid-row: auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .track-head__fader {
    grid-column: auto;
    grid-row: auto;
    display: flex;
    align-items: center;
  }

  .channel__meter {
    grid-column: auto;
    grid-row: auto;
    margin-right: 0;
  }

  .track-wave {
    grid-column: 2;
    min-height: 80px;
    height: 100%;
    border-bottom: 2px solid var(--bg);
  }

  .transport {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 12px 18px;
  }

  .transport__controls {
    flex: 0 0 auto;
  }

  .transport__time {
    flex: 0 0 auto;
    width: auto;
    min-width: 130px;
    height: 38px;
    font-size: 14px;
    padding: 0 16px;
    margin: 0;
  }

  .transport__right {
    flex: 0 0 auto;
  }

  .transport__view-btn {
    width: auto;
    padding: 0 14px;
  }

  .transport__view-label {
    display: inline !important;
  }

  .transport__dl-btn {
    width: auto;
    padding: 0 14px;
  }

  .transport__dl-label {
    display: inline !important;
  }

  .dropdown__arrow {
    display: inline !important;
  }

  .song-details-box__row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===================== Tablet / iPad Landscape (in orizzontale) ===================== */
@media (min-width: 761px) and (max-width: 1366px) and (orientation: landscape),
       (min-width: 921px) and (max-width: 1200px) {
  .transport {
    gap: 30px;
    padding: 12px 18px;
  }

  .tracks-panel {
    grid-template-columns: 220px 1fr;
  }
}

/* Focus visibile per accessibilità da tastiera */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}