:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid #0b1220;
}

.topbar h1 {
  font-size: 1.15rem;
  margin: 0;
}

.playback {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.playback .speed {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.playback select {
  background: #0b1220;
  color: var(--text);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
}

.clock {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  color: var(--text);
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  min-width: 84px;
  width: 92px;
  text-align: center;
  font-family: inherit;
}

.clock:focus {
  outline: none;
  border-color: var(--accent);
}

.seek {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 320px;
  accent-color: var(--accent);
  cursor: pointer;
}

.seek:disabled {
  cursor: default;
  opacity: 0.5;
}

.mover {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid #2563eb;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.upload {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  color: var(--muted);
  max-width: 260px;
}

.file-label input {
  display: none;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  background: var(--accent-hover);
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100% - 58px);
}

.sidebar {
  background: var(--panel);
  padding: 1rem;
  overflow-y: auto;
  border-right: 1px solid #0b1220;
}

.sidebar h2 {
  margin-top: 0;
  font-size: 1rem;
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.track-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.track-list li.active {
  border-color: var(--accent);
}

.track-list .name {
  flex: 1;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

.track-list .swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 2px solid #64748b;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
}

.track-list .del {
  background: transparent;
  color: var(--danger);
  padding: 0.1rem 0.4rem;
  font-size: 1rem;
}

.stats {
  margin-top: 1.25rem;
  border-top: 1px solid #334155;
  padding-top: 0.75rem;
}

.stats dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.85rem;
}

.stats dt {
  color: var(--muted);
}

.stats dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.map {
  height: 100%;
}

.toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  border: 1px solid #334155;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 1000;
}

.toast.error {
  border-color: var(--danger);
  color: #fecaca;
}
