:root {
  color-scheme: light dark;
  --border: #ddd;
  --muted: #666;
  --danger: #b00020;
}

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 1.5rem;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 1.4rem;
  margin: 0;
}

.hidden {
  display: none !important;
}

form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

input[type="text"], input[type="url"], input[type="search"] {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

.search-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;
}

button {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 6px;
  background: #1a73e8;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.link-btn {
  background: none;
  color: #1a73e8;
  padding: 0;
  font-size: 0.9rem;
  text-decoration: underline;
}

.error {
  color: var(--danger);
}

.whoami {
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.content-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.stats, .content-spacer {
  flex: 0 0 200px;
}

#track-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 560px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (max-width: 700px) {
  .content-row {
    flex-direction: column;
  }

  .stats, .content-spacer {
    flex: 1;
  }

  .content-spacer {
    display: none;
  }

  #track-list {
    max-width: none;
  }
}

.track {
  display: flex;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem;
  align-items: center;
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-tile {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}

.stat-tile .value {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-tile .label {
  font-size: 0.75rem;
  color: var(--muted);
}

.stat-per-member {
  flex-basis: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
}

.stat-per-member .label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.stat-per-member ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

.track img {
  width: 90px;
  height: 68px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.track-body {
  flex: 1;
  min-width: 0;
}

.track-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.impersonation-note {
  font-size: 0.85rem;
  color: var(--danger);
  font-style: italic;
}

.track-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-end;
}

.vote-btn {
  background: #eee;
  color: #333;
}

.vote-btn.voted {
  background: #b00020;
  color: white;
}

.delete-btn {
  background: none;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: underline;
  padding: 0;
}
