:root { color-scheme: dark; }

* { box-sizing: border-box; }

body {
  background: #121212;
  color: #eee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
}

.site-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #262626;
}
.site-header .brand {
  color: #eee;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.site-header .tool-name {
  color: #9aa0a6;
  font-size: 0.95rem;
}

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

h1 { font-size: 1.4rem; margin-bottom: 4px; }
.subtitle { color: #9aa0a6; margin-top: 0; margin-bottom: 24px; font-size: 0.9rem; }

/* ---- form page ---- */
.lookup-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  background: #1c1c1c;
  padding: 18px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.lookup-form label {
  display: block;
  font-size: 0.8rem;
  color: #9aa0a6;
  margin-bottom: 4px;
}
.lookup-form input {
  background: #121212;
  border: 1px solid #333;
  color: #eee;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.95rem;
}
.lookup-form input#user_id { width: 220px; }
.lookup-form button {
  background: #5ec8f2;
  border: none;
  color: #0b1b22;
  font-weight: 600;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 0.95rem;
  cursor: pointer;
}
.lookup-form button:hover { background: #7ed4f5; }

.error {
  background: #ff808022;
  border: 1px solid #ff808066;
  color: #ff9b9b;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.hint { color: #6b7075; font-size: 0.82rem; }
.loading-note { color: #7fb2ff; font-size: 0.85rem; margin-top: -6px; }

.info-section {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #262626;
}
.info-section h2 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: #eee;
}
.info-section ul {
  margin: 0;
  padding-left: 20px;
  color: #b8bcc0;
  font-size: 0.88rem;
  line-height: 1.6;
}
.info-section li { margin-bottom: 6px; }
.info-section li:last-child { margin-bottom: 0; }
.info-section strong { color: #eee; }

/* ---- results page ---- */
.meta-line { color: #9aa0a6; font-size: 0.9rem; margin-bottom: 24px; }
.meta-line a { color: #7fb2ff; }

h2.month {
  font-size: 1.05rem;
  margin: 28px 0 12px;
  border-bottom: 1px solid #2a2a2a;
  padding-bottom: 6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #1c1c1c;
  border-radius: 10px;
  padding: 8px;
  min-width: 0;
}
.tile.today { background: #3a2560; }
.tile a { display: block; }

.today-note {
  color: #d3aeff;
  font-weight: 600;
  font-size: 0.72rem;
  margin-top: 4px;
}

.cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: #2a2a2a;
  margin-bottom: 6px;
}
.cover.broken { visibility: hidden; }

.row1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.badge {
  color: #111;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
}
.tag {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

.title {
  font-size: 0.88rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.title a { color: #eee; text-decoration: none; }
.title a:hover { text-decoration: underline; }
.artist { color: #9aa0a6; font-size: 0.8rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date { color: #6b7075; font-size: 0.72rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.empty { color: #9aa0a6; font-style: italic; }

/* ---- report builder ---- */
.report-bar {
  background: #121212;
  padding: 10px 0 14px;
  margin-bottom: 6px;
}
body.selecting .report-bar {
  position: sticky;
  top: 0;
  z-index: 20;
}
.report-btn {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #eee;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.88rem;
  cursor: pointer;
}
.report-btn:hover:not(:disabled) { background: #333; }
.report-btn:disabled { opacity: 0.45; cursor: not-allowed; }
#report-generate:not(:disabled) { background: #5ec8f2; border-color: #5ec8f2; color: #0b1b22; font-weight: 600; }

.report-idle { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.report-idle[hidden] { display: none; }
.report-note {
  flex: 1 1 320px;
  margin: 0;
  color: #9aa0a6;
  font-size: 0.82rem;
  line-height: 1.5;
}
.report-note a { color: #7fb2ff; }

.select-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.select-controls[hidden] { display: none; }
.select-hint { color: #9aa0a6; font-size: 0.85rem; }
.select-count { color: #eee; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: none; color: #7fb2ff; cursor: pointer; font-size: 0.85rem; padding: 4px; }
.link-btn:hover { text-decoration: underline; }

.select-mark {
  display: none;
  position: absolute;
  top: 12px; left: 12px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid #eee;
  color: transparent;
  font-size: 0.8rem;
  line-height: 18px;
  text-align: center;
  z-index: 2;
}
body.selecting .tile { cursor: pointer; }
body.selecting .select-mark { display: block; }
body.selecting .tile a { cursor: pointer; }
.tile.selected { outline: 2px solid #5ec8f2; }
.tile.selected .select-mark { background: #5ec8f2; border-color: #5ec8f2; color: #0b1b22; }

/* ---- lookup progress ---- */
.progress-card { background: #1c1c1c; border-radius: 10px; padding: 18px; }
.progress-text { margin: 0 0 10px; font-size: 0.95rem; }
.progress-track { background: #2a2a2a; border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { background: #5ec8f2; height: 100%; width: 4%; transition: width 0.4s ease; }
.progress-note { color: #6b7075; font-size: 0.82rem; margin: 12px 0 0; }
.error a { color: #ffd0d0; }
