:root {
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --border: #E5E5E8;
  --text: #18181B;
  --text-secondary: #71717A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, .brand {
  font-family: 'General Sans', -apple-system, sans-serif;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.container h1 {
  font-size: 24px;
  margin: 0 0 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 16px;
}

.back-link:hover {
  color: var(--text);
}

.category-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.category-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 150ms;
}

.category-row:last-child { border-bottom: none; }
.category-row:hover { background: var(--bg); }

.category-row .count {
  font-size: 13px;
  color: var(--text-secondary);
}

.category-notes {
  color: var(--text-secondary);
  font-size: 14px;
  margin: -8px 0 20px;
  white-space: pre-wrap;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 48px 16px;
  font-size: 14px;
}

.ranked-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ranked-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.item-rank {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.item-body {
  min-width: 0;
}

.item-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.item-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 6px 0;
  font-size: 13px;
}

.item-fields div {
  display: flex;
  gap: 4px;
}

.item-fields dt {
  color: var(--text-secondary);
}

.item-fields dd {
  margin: 0;
}

.item-notes {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 6px 0 0;
  white-space: pre-wrap;
}
