.music-page {
  width: min(100% - 32px, 1720px);
}

.music-page .voice-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
}

.music-page .voice-table-wrap {
  height: min(72vh, 760px);
  min-height: 520px;
  overflow: auto;
}

.music-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.music-table thead th:not(.voice-row-head),
.music-table .voice-cell {
  width: calc((100% - 56px) / 6);
  min-width: 0;
}

.music-table .voice-row-head {
  width: 56px;
  min-width: 56px;
}

.music-table .voice-cell {
  height: 120px;
  padding: 12px;
  font-size: 15px;
  line-height: 1.45;
}

.music-color-editor {
  display: grid;
  gap: 10px;
}

.music-color-editor h3 {
  margin: 0;
  color: var(--voice-muted);
  font-size: 1rem;
}

.music-color-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.music-color-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: var(--voice-button-bg);
  color: var(--voice-button-text);
  font-weight: 700;
  cursor: pointer;
}

.music-color-option:hover,
.music-color-option:focus-visible {
  background: var(--voice-button-hover);
  outline: none;
}

.music-color-option.is-selected {
  border-color: var(--voice-link);
  box-shadow: inset 0 0 0 2px var(--voice-link);
}

.music-color-swatch {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.music-color-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.music-color-status {
  margin: 0;
  color: var(--voice-muted);
  font-size: 0.92rem;
}

.music-table .voice-cell {
  cursor: pointer;
}

.music-table .voice-cell.has-music-bg {
  color: var(--music-cell-text);
}

.music-table .voice-cell.has-music-bg a {
  color: var(--music-cell-link);
}

body.tamers-home-popup-open {
  overflow: hidden;
}

.tamers-home-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 12, 24, 0.72);
}

.tamers-home-popup-backdrop[hidden] {
  display: none !important;
}

.tamers-home-popup {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--voice-border);
  background: var(--voice-panel);
  color: var(--voice-text);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  padding: 24px 24px 20px;
}

.tamers-home-popup p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

.music-help-text {
  white-space: pre-line;
}

.tamers-home-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.tamers-home-popup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--voice-border);
  background: var(--voice-button-bg);
  color: var(--voice-button-text);
  font: 600 14px/1 Arial, Helvetica, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.tamers-home-popup-btn:hover,
.tamers-home-popup-btn:focus-visible {
  background: var(--voice-button-hover);
  outline: none;
}

:root[data-theme="dark"] .tamers-home-popup-backdrop {
  background: rgba(3, 7, 16, 0.8);
}

@media (max-width: 900px) {
  .music-page .voice-workspace {
    grid-template-columns: 1fr;
  }

  .music-page .voice-table-wrap {
    height: 68vh;
    min-height: 420px;
  }

  .music-color-presets {
    grid-template-columns: 1fr;
  }

  .music-color-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
