:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5f6672;
  --border: #e2e5ea;
  --accent: #00b84a; /* 초록 계열 포인트 */
  --error-bg: #fff2f2;
  --error-text: #a3201b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --text: #eceef2;
    --muted: #9aa1ad;
    --border: #2b2f37;
    --accent: #3ddc7f;
    --error-bg: #2a1616;
    --error-text: #ff9a94;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.6;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 40px 16px 56px; }

.eyebrow { margin: 0; color: var(--accent); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; }
h1 { margin: 4px 0 8px; font-size: 1.9rem; }
h2 { margin: 0 0 14px; font-size: 1.1rem; }
.sub { margin: 0 0 28px; color: var(--muted); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.status { color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status.error {
  display: block;
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 10px;
  padding: 12px 14px;
}
.retry {
  margin-top: 10px;
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.insight { margin: 0; }
.insight .meta { display: block; margin-top: 10px; color: var(--muted); }

.songs { list-style: none; margin: 0; padding: 0; }
.songs li {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.songs li:first-child { border-top: 0; }
.rank { width: 2ch; text-align: right; font-weight: 800; font-size: 1.15rem; color: var(--accent); flex: none; }
.info { display: flex; flex-direction: column; min-width: 0; }
.title { font-weight: 600; overflow-wrap: anywhere; }
.artist { color: var(--muted); font-size: 0.9rem; }

.artists { list-style: none; margin: 0; padding: 0; }
.artists li {
  display: grid;
  grid-template-columns: minmax(0, 11rem) 1fr 3.2rem;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.artists .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artists .track { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.artists .bar { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.artists .count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.more { margin: 12px 0 0; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 480px) {
  .artists li { grid-template-columns: minmax(0, 7.5rem) 1fr 2.8rem; gap: 8px; }
}

footer { margin-top: 24px; color: var(--muted); font-size: 0.85rem; }
footer a { color: var(--accent); }
