
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  transform: translateY(16px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text3); font-size: 20px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }

.toggle {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}

.toggle-track {
  width: 36px; height: 20px;
  background: var(--bg4);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-track.on { background: var(--orange); }

.toggle-thumb {
  position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
}

.toggle-track.on .toggle-thumb { transform: translateX(16px); }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--orange); border-bottom-color: var(--orange); }

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle {
  transition: stroke-dashoffset 1s linear;
  stroke: var(--orange);
  stroke-linecap: round;
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.guild-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.guild-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.guild-name { font-size: 13px; font-weight: 500; }

.track-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
  cursor: pointer;
}

.track-row:hover { background: var(--bg3); }

.track-num {
  width: 20px; text-align: right;
  font-size: 13px; color: var(--text3);
  flex-shrink: 0;
}

.track-thumb-sm {
  width: 40px; height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg3);
  flex-shrink: 0;
}

.drag-handle {
  color: var(--text3); font-size: 16px;
  cursor: grab; padding: 0 4px;
  flex-shrink: 0;
}

.drag-handle:active { cursor: grabbing; }

.waveform {
  display: flex; align-items: flex-end;
  gap: 2px; height: 32px;
}

.waveform-bar {
  width: 3px;
  background: var(--orange);
  border-radius: 2px;
  opacity: 0.7;
  animation: wave 1s ease-in-out infinite;
}

.waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; }
.waveform-bar:nth-child(5) { animation-delay: 0.2s; }
.waveform-bar:nth-child(6) { animation-delay: 0.1s; }
.waveform-bar:nth-child(7) { animation-delay: 0.25s; }
.waveform-bar:nth-child(8) { animation-delay: 0.15s; }

@keyframes wave {
  0%, 100% { height: 6px; }
  50%       { height: 28px; }
}

.waveform.paused .waveform-bar { animation-play-state: paused; height: 12px; opacity: 0.4; }

.upload-progress {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.upload-progress-name { font-size: 13px; font-weight: 500; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-progress-bar { width: 100%; height: 3px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.upload-progress-fill { height: 100%; background: var(--orange); border-radius: 2px; transition: width 0.2s; }
.upload-progress-meta { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--text3); }

.context-menu {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  z-index: 500;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.context-item {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text2);
  display: flex; align-items: center; gap: 8px;
}

.context-item:hover { background: var(--bg3); color: var(--text); }
.context-item.danger { color: #EF4444; }
.context-item.danger:hover { background: rgba(239,68,68,0.1); }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.filter-btn {
  padding: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--orange); color: var(--text); }
.filter-btn.active { background: var(--orange-glow); border-color: var(--orange); color: var(--orange); }
