/*
 * H&S Music Artist Panel – Release Wizard Tracks overview
 *
 * Trackliste, Quellenauswahl und Track-Quell-Modal.
 * Upload-/Multipart-Verhalten bleibt in app.js; hier liegt nur die Darstellung.
 */

.wizard-tracks-overview {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

.wizard-tracks-overview.has-tracks {
  max-width: none;
}

.wizard-tracks-header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--hs-line-subtle);
}

.wizard-tracks-header h3 {
  margin: 0;
  color: var(--hs-text);
  font-size: 21px;
  line-height: 1.3;
  font-weight: var(--hs-weight-semibold);
  letter-spacing: -.012em;
}

.wizard-tracks-header p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--hs-text-muted);
  font-size: 14px;
  line-height: 1.6;
  font-weight: var(--hs-weight-regular);
}

.wizard-track-empty-state {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 34px 0 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.wizard-track-empty-state > strong {
  color: var(--hs-text);
  font-size: 18px;
  line-height: 1.35;
  font-weight: var(--hs-weight-semibold);
}

.wizard-track-empty-state > span {
  max-width: 560px;
  color: var(--hs-text-muted);
  font-size: 14px;
  line-height: 1.55;
  font-weight: var(--hs-weight-regular);
}

.wizard-track-source-panel {
  width: min(620px, 100%);
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wizard-track-source-panel.has-tracks {
  width: 100%;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--hs-line-subtle);
  grid-template-columns: repeat(2, minmax(0, 220px));
  justify-content: start;
}

.wizard-track-source-card {
  width: 100%;
  justify-content: center;
}

.wizard-track-source-card strong {
  font: inherit;
  font-weight: inherit;
}

.wizard-track-source-icon {
  min-width: 18px;
  color: var(--hs-brand-400);
  font-size: 18px;
  line-height: 1;
  font-weight: var(--hs-weight-semibold);
}

.wizard-track-list {
  min-height: 10px;
  margin-top: 18px;
  border-top: 1px solid var(--hs-line-subtle);
}

.wizard-track-row {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--hs-line-subtle);
  border-radius: 0;
  background: transparent;
}

.wizard-track-row-left {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 11px;
}

.wizard-track-drag-handle {
  width: 22px;
  min-width: 22px;
  display: inline-grid;
  place-items: center;
  color: var(--hs-text-subtle);
  font-size: 15px;
  line-height: 1;
  user-select: none;
}

.wizard-track-number {
  width: 28px;
  min-width: 28px;
  color: var(--hs-text-subtle);
  font-size: 12px;
  line-height: 1;
  font-weight: var(--hs-weight-medium);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.wizard-track-row-main {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 3px;
}

.wizard-track-row-main > span {
  color: var(--hs-text-subtle);
  font-size: 12px;
  line-height: 1.45;
  font-weight: var(--hs-weight-regular);
  overflow-wrap: anywhere;
}

.wizard-track-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--hs-text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: var(--hs-weight-semibold);
  overflow-wrap: anywhere;
}

.wizard-track-explicit-badge {
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 92, 92, .44);
  border-radius: var(--hs-radius-xs);
  background: var(--hs-danger-soft);
  color: #ffb0b0;
  font-size: 10px;
  line-height: 1;
  font-weight: var(--hs-weight-bold);
}

.wizard-track-dolby-badge {
  min-height: 19px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius-xs);
  background: transparent;
  color: var(--hs-text-subtle);
  font-size: 9px;
  line-height: 1;
  font-weight: var(--hs-weight-semibold);
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.wizard-track-dolby-badge.is-ready {
  border-color: rgba(178, 111, 255, .42);
  color: #d8bcff;
}

.wizard-track-dolby-badge.is-warning {
  border-color: var(--hs-line);
  color: var(--hs-text-subtle);
}

.wizard-track-dolby-symbol {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

.wizard-track-row-actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wizard-track-delete-button {
  color: var(--hs-danger);
  font-size: 18px;
}

.wizard-track-delete-button:hover,
.wizard-track-delete-button:focus-visible {
  color: #ff9b9b;
}

.wizard-dolby-upload-error-box {
  position: relative;
  overflow: hidden;
  margin-top: 10px;
  padding-bottom: 13px;
}

.wizard-dolby-upload-error-box::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--hs-danger);
  transform-origin: left center;
  animation: wizardDolbyUploadErrorTimer 8s linear forwards;
}

@keyframes wizardDolbyUploadErrorTimer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}


/* Track source modal */
.wizard-track-source-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.82);
}

.wizard-track-source-modal-shell {
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius-md);
  background: var(--hs-surface-1);
}

.wizard-track-source-modal-header {
  flex: 0 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hs-line-subtle);
}

.wizard-track-source-modal-header h2 {
  margin: 0;
  color: var(--hs-text);
  font-size: 20px;
  line-height: 1.25;
  font-weight: var(--hs-weight-semibold);
  letter-spacing: -.012em;
}

.wizard-track-source-modal-main {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.wizard-track-source-back {
  width: fit-content;
  margin: 0 0 18px;
  padding-inline: 0;
}

.wizard-track-source-modal-intro {
  display: grid;
  gap: 6px;
}

.wizard-track-source-modal-intro h3,
.wizard-track-source-modal-main > h3 {
  margin: 0;
  color: var(--hs-text);
  font-size: 19px;
  line-height: 1.3;
  font-weight: var(--hs-weight-semibold);
}

.wizard-track-source-modal-intro p,
.wizard-track-source-modal-main > .small-muted {
  margin: 0;
  max-width: 680px;
  color: var(--hs-text-muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: var(--hs-weight-regular);
}

.wizard-track-source-modal-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.wizard-track-source-modal-choice {
  min-height: 76px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 4px;
  text-align: left;
}

.wizard-track-source-modal-choice strong {
  font: inherit;
  font-weight: var(--hs-weight-semibold);
}

.wizard-track-source-modal-choice span {
  color: var(--hs-text-subtle);
  font-size: 12px;
  line-height: 1.4;
  font-weight: var(--hs-weight-regular);
}

.wizard-track-upload-form {
  width: min(620px, 100%);
  max-width: none;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.wizard-track-upload-dropzone {
  position: relative;
  width: min(720px, 100%);
  min-height: 320px;
  margin-inline: auto;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 38px 28px;
  border: 1px dashed var(--hs-line-strong);
  border-radius: var(--hs-radius-lg);
  background: transparent;
  text-align: center;
  transition:
    border-color var(--hs-duration-fast) var(--hs-ease-standard),
    background-color var(--hs-duration-fast) var(--hs-ease-standard);
}

.wizard-track-upload-dropzone:hover {
  border-color: var(--hs-brand-line);
}

.wizard-track-upload-dropzone.is-drag-over {
  border-color: var(--hs-brand-500);
  background: var(--hs-brand-soft);
}

.wizard-track-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wizard-track-upload-copy {
  display: grid;
  gap: 7px;
  justify-items: center;
}

.wizard-track-upload-mark {
  position: relative;
  width: 54px;
  height: 54px;
  margin-bottom: 8px;
  border: 1px solid var(--hs-brand-line);
  border-radius: var(--hs-radius-lg);
  background: var(--hs-brand-soft);
  font-size: 0;
}

.wizard-track-upload-dropzone:hover .wizard-track-upload-mark,
.wizard-track-upload-dropzone.is-drag-over .wizard-track-upload-mark {
  border-color: var(--hs-brand-500);
}

.wizard-track-upload-mark::before,
.wizard-track-upload-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 2px;
  border-radius: var(--hs-radius-round);
  background: var(--hs-brand-400);
  transform: translate(-50%, -50%);
}

.wizard-track-upload-mark::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.wizard-track-upload-copy strong {
  color: var(--hs-text);
  font-size: 19px;
  line-height: 1.35;
  font-weight: var(--hs-weight-semibold);
}

.wizard-track-upload-hint {
  color: var(--hs-text-muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: var(--hs-weight-regular);
}

.wizard-track-upload-dropzone > .hs-button {
  margin-top: 7px;
}

.wizard-track-upload-queue {
  display: grid;
}

.wizard-track-upload-queue:not(:empty) {
  margin-top: 2px;
  border-top: 1px solid var(--hs-line-subtle);
}

.wizard-track-upload-queue-item {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hs-line-subtle);
}

.wizard-track-upload-queue-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.wizard-track-upload-queue-main strong {
  color: var(--hs-text);
  font-size: 13px;
  line-height: 1.35;
  font-weight: var(--hs-weight-medium);
  overflow-wrap: anywhere;
}

.wizard-track-upload-queue-status {
  color: var(--hs-text-subtle);
  font-size: 11px;
  line-height: 1.4;
}

.wizard-track-upload-queue-status.success {
  color: var(--hs-success);
}

.wizard-track-upload-queue-status.error {
  color: var(--hs-danger);
}

.wizard-track-upload-queue-status.cancelled {
  color: var(--hs-warning);
}

.wizard-track-upload-progress-shell {
  width: 100%;
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: var(--hs-radius-round);
  background: var(--hs-surface-3);
}

.wizard-track-upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--hs-brand-500);
  transition: width var(--hs-duration-fast) linear;
}

.wizard-track-upload-queue-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
}

.wizard-track-existing-list {
  margin-top: 18px;
  border-top: 1px solid var(--hs-line-subtle);
}

.wizard-track-existing-item {
  display: grid;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hs-line-subtle);
}

.wizard-track-existing-select {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  border: 0;
  border-radius: var(--hs-radius-sm);
  background: transparent;
  color: var(--hs-text);
  text-align: left;
  cursor: pointer;
}

.wizard-track-existing-select:hover,
.wizard-track-existing-select:focus-visible {
  background: transparent;
  color: var(--hs-text);
}

.wizard-track-existing-select:focus-visible,
.wizard-track-existing-version:focus-visible {
  outline: 2px solid var(--hs-brand-500);
  outline-offset: 2px;
}

.wizard-track-existing-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.wizard-track-existing-copy strong,
.wizard-track-existing-version strong {
  color: var(--hs-text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: var(--hs-weight-semibold);
}

.wizard-track-existing-copy span,
.wizard-track-existing-copy small,
.wizard-track-existing-version small,
.wizard-track-source-empty {
  color: var(--hs-text-subtle);
  font-size: 12px;
  line-height: 1.45;
  font-weight: var(--hs-weight-regular);
}

.wizard-track-existing-cover {
  width: 64px;
  height: 64px;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--hs-line-subtle);
  border-radius: var(--hs-radius-sm);
  background: var(--hs-surface-2);
  color: var(--hs-text-subtle);
  font-size: 18px;
}

.wizard-track-existing-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.wizard-track-existing-cover.is-small {
  width: 42px;
  height: 42px;
  border-radius: var(--hs-radius-xs);
  font-size: 13px;
}

.wizard-track-existing-source {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
}

.wizard-track-existing-source > span {
  color: var(--hs-text-muted);
  font-weight: var(--hs-weight-semibold);
}

.wizard-track-existing-source > span::after {
  content: ":";
}

.wizard-track-existing-versions-toggle {
  justify-self: start;
  margin-left: 110px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--hs-text-muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  font-weight: var(--hs-weight-semibold);
  text-align: left;
  cursor: pointer;
}

.wizard-track-existing-versions-toggle:hover,
.wizard-track-existing-versions-toggle:focus-visible {
  color: var(--hs-text);
}

.wizard-track-existing-versions-toggle:focus-visible {
  outline: 2px solid var(--hs-brand-500);
  outline-offset: 3px;
  border-radius: var(--hs-radius-xs);
}

.wizard-track-existing-versions-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--hs-duration-fast) var(--hs-ease-standard);
}

.wizard-track-existing-versions-toggle[aria-expanded="true"]
.wizard-track-existing-versions-chevron {
  transform: translateY(2px) rotate(225deg);
}

.wizard-track-existing-versions {
  margin-left: 110px;
  display: grid;
  padding: 8px 0 0 16px;
  border-left: 1px solid var(--hs-line-subtle);
}

.wizard-track-existing-versions-label {
  margin-bottom: 2px;
  color: var(--hs-text-subtle);
  font-size: 11px;
  line-height: 1.4;
  font-weight: var(--hs-weight-medium);
}

.wizard-track-existing-version {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--hs-line-subtle);
  background: transparent;
  color: var(--hs-text);
  text-align: left;
  cursor: pointer;
}

.wizard-track-existing-version:last-child {
  border-bottom: 0;
}

.wizard-track-existing-version > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.wizard-track-existing-version:hover strong,
.wizard-track-existing-version:focus-visible strong {
  color: var(--hs-brand-400);
}

.wizard-track-source-empty {
  padding: 18px 0;
}

@media (max-width: 720px) {
  .wizard-tracks-overview {
    max-width: none;
  }

  .wizard-track-source-modal-backdrop {
    padding: 12px;
  }

  .wizard-track-source-modal-shell {
    max-height: calc(100dvh - 24px);
  }

  .wizard-track-source-modal-header {
    padding: 14px 16px;
  }

  .wizard-track-source-modal-main {
    padding: 18px 16px 20px;
  }

  .wizard-track-source-modal-choices {
    grid-template-columns: 1fr;
  }

  .wizard-track-upload-dropzone {
    min-height: 250px;
    padding: 30px 18px;
  }

  .wizard-track-upload-mark {
    width: 50px;
    height: 50px;
  }

  .wizard-track-source-panel,
  .wizard-track-source-panel.has-tracks {
    grid-template-columns: 1fr;
  }

  .wizard-track-source-panel.has-tracks {
    justify-content: stretch;
  }

  .wizard-track-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .wizard-track-row-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .wizard-track-source-modal-backdrop {
    padding: 0;
  }

  .wizard-track-source-modal-shell {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .wizard-track-source-modal-header {
    min-height: 64px;
    padding: 12px 14px;
  }

  .wizard-track-source-modal-main {
    padding: 18px 14px calc(24px + env(safe-area-inset-bottom));
  }

  .wizard-track-upload-dropzone {
    min-height: 220px;
    padding: 26px 16px;
    border-radius: var(--hs-radius-md);
  }

  .wizard-track-upload-queue-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .wizard-track-upload-queue-actions {
    justify-content: flex-start;
  }

  .wizard-tracks-header h3 {
    font-size: 19px;
  }

  .wizard-track-empty-state {
    padding-top: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-dolby-upload-error-box::after {
    animation: none;
  }

  .wizard-track-upload-dropzone,
  .wizard-track-upload-progress-bar {
    transition: none;
  }
}


/* Existing-track multi selection */

.wizard-track-existing-check {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--hs-line-strong);
  border-radius: var(--hs-radius-xs);
  color: var(--hs-text);
  font-size: 12px;
  line-height: 1;
  font-weight: var(--hs-weight-bold);
}

.wizard-track-existing-item.is-selected
.wizard-track-existing-check,
.wizard-track-existing-item.is-imported
.wizard-track-existing-check {
  border-color: var(--hs-brand-line);
  background: var(--hs-brand-500);
  color: var(--hs-text-on-brand, #fff);
}

.wizard-track-existing-item.is-imported {
  opacity: .56;
}

.wizard-track-existing-actions {
  position: sticky;
  bottom: -24px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  margin-bottom: -24px;
  padding: 14px 0 24px;
  border-top: 1px solid var(--hs-line-subtle);
  background: var(--hs-surface-1);
}

.wizard-track-existing-actions > span {
  color: var(--hs-text-muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: var(--hs-weight-regular);
}

@media (max-width: 720px) {
  .wizard-track-existing-select {
    grid-template-columns: 22px 52px minmax(0, 1fr);
    gap: 10px;
  }

  .wizard-track-existing-cover {
    width: 52px;
    height: 52px;
  }

  .wizard-track-existing-cover.is-small {
    width: 40px;
    height: 40px;
  }

  .wizard-track-existing-versions-toggle,
  .wizard-track-existing-versions {
    margin-left: 94px;
  }

  .wizard-track-existing-versions {
    padding-left: 12px;
  }

  .wizard-track-existing-actions {
    bottom: -24px;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .wizard-track-existing-actions .hs-button {
    width: 100%;
  }
}

/* Abgeleitete Track-Metadaten-Konflikte nach Änderungen an Release-Grundinfos. */
.wizard-track-artist-reconcile-notice,
.wizard-track-language-reconcile-notice {
  margin-top: 18px;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--hs-line-subtle);
  border-bottom: 1px solid var(--hs-line-subtle);
}

.wizard-track-artist-reconcile-notice > div,
.wizard-track-language-reconcile-notice > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.wizard-track-artist-reconcile-notice strong,
.wizard-track-language-reconcile-notice strong {
  color: var(--hs-text);
  font-size: 14px;
  line-height: 1.4;
  font-weight: var(--hs-weight-semibold);
}

.wizard-track-artist-reconcile-notice span,
.wizard-track-language-reconcile-notice span {
  color: var(--hs-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.wizard-track-artist-warning-badge {
  min-height: 19px;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(255, 159, 67, .42);
  border-radius: var(--hs-radius-xs);
  background: var(--hs-warning-soft);
  color: var(--hs-warning);
  font-size: 10px;
  line-height: 1.2;
  font-weight: var(--hs-weight-semibold);
}

@media (max-width: 640px) {
  .wizard-track-artist-reconcile-notice,
  .wizard-track-language-reconcile-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .wizard-track-artist-reconcile-notice .hs-button,
  .wizard-track-language-reconcile-notice .hs-button {
    width: 100%;
    justify-content: center;
  }
}
