body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background: #111827;
  color: #e5e7eb;
}

/* ------------ Splash screen ------------ */

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0c0f;
  cursor: pointer;
  animation: splash-fade-out 0.5s ease forwards;
  animation-delay: 2.2s;
}

.splash-screen.splash-skip {
  animation: splash-fade-out 0.4s ease forwards;
  animation-delay: 0s;
}

.splash-screen[hidden] {
  display: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  animation: splash-content-in 0.6s ease forwards;
  animation-delay: 0.15s;
}

.splash-disc-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 1.5rem;
}

.splash-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, #1f2937 0 18%, #0b0c0f 19% 22%, #1f2937 23% 100%);
  box-shadow: 0 0 0 2px #374151, 0 12px 32px rgba(0, 0, 0, 0.6);
  transform: scale(0.6) rotate(0deg);
  opacity: 0;
  animation:
    splash-disc-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    splash-disc-spin 6s linear 0.6s infinite;
}

.splash-disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image: repeating-radial-gradient(
    circle at center,
    transparent 0,
    transparent 6px,
    rgba(0, 0, 0, 0.18) 7px,
    transparent 8px
  );
}

.splash-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 22%;
  opacity: 0;
  transform: scale(0.7);
  animation: splash-logo-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.5s;
}

.splash-title {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #f9fafb;
}

.splash-tagline {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  color: #9ca3af;
  letter-spacing: 0.04em;
}

@keyframes splash-content-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splash-disc-in {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-30deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes splash-disc-spin {
  from {
    transform: scale(1) rotate(0deg);
  }
  to {
    transform: scale(1) rotate(360deg);
  }
}

@keyframes splash-logo-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes splash-fade-out {
  from {
    opacity: 1;
    visibility: visible;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-screen {
    animation: splash-fade-out 0.3s ease forwards;
    animation-delay: 0.8s;
  }

  .splash-content,
  .splash-disc,
  .splash-logo {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .splash-disc-wrap {
    width: 120px;
    height: 120px;
  }

  .splash-title {
    font-size: 1.9rem;
  }
}

/* ------------ Onboarding ------------ */

.onboarding-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0c0f;
  overflow-y: auto;
  padding: 2rem 1rem;
}

.onboarding-screen[hidden] {
  display: none;
}

.onboarding-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
  width: 100%;
}

.onboarding-logo {
  width: 72px;
  height: 72px;
  border-radius: 22%;
  margin-bottom: 1rem;
}

.onboarding-title {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f9fafb;
}

.onboarding-tagline {
  margin: 0.4rem 0 1.75rem;
  font-size: 1rem;
  color: #9ca3af;
}

.onboarding-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.onboarding-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.onboarding-option:hover,
.onboarding-option:focus-visible {
  border-color: #caa15a;
  background: #161b27;
  outline: none;
}

.onboarding-option:active {
  transform: scale(0.99);
}

.onboarding-option i {
  font-size: 28px;
  color: #caa15a;
  margin-bottom: 0.25rem;
}

.onboarding-option-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f9fafb;
}

.onboarding-option-desc {
  font-size: 0.85rem;
  color: #9ca3af;
}

@media (max-width: 640px) {
  .onboarding-logo {
    width: 56px;
    height: 56px;
  }

  .onboarding-title {
    font-size: 1.5rem;
  }

  .onboarding-option {
    padding: 1rem 1.25rem;
  }
}

header {
  padding: 1rem 1.5rem;
  background: #020617;
  border-bottom: 1px solid #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.account-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-section[hidden] {
  display: none;
}

.account-email {
  font-size: 0.85rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tagline {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: #9ca3af;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: #020617;
  border-bottom: 1px solid #1f2937;
}

#collectionFilters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

#controls input,
#controls select {
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #374151;
  background: #111827;
  color: #e5e7eb;
}

#controls input:focus,
#controls select:focus {
  outline: none;
  border-color: #caa15a;
}

/* Page nav */
#pageNav {
  display: flex;
  border: 1px solid #374151;
  border-radius: 4px;
  overflow: hidden;
}

#gridDensityControl {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-size: 0.85rem;
  color: #9ca3af;
}

#gridDensityControl select {
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #374151;
  background: #111827;
  color: #e5e7eb;
}

.view-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  background: #111827;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.85rem;
}

.view-btn + .view-btn {
  border-left: 1px solid #374151;
}

.view-btn:hover {
  color: #e5e7eb;
}

.view-btn.active {
  background: #caa15a;
  color: #1a1408;
}

.view-btn:focus-visible {
  outline: 2px solid #caa15a;
  outline-offset: 2px;
}

/* Add Record button */
.add-record-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  border: 1px solid #caa15a;
  background: #8a6a2f;
  color: #f9fafb;
  font-size: 0.85rem;
  cursor: pointer;
}

.add-record-btn:hover {
  background: #a9823f;
}

.add-record-btn:focus-visible {
  outline: 2px solid #e8d4a8;
  outline-offset: 2px;
}

/* ------------ Modal ------------ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.25rem;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.modal-close:hover {
  color: #e5e7eb;
}

/* ------------ Auth ------------ */

.auth-modal {
  max-width: 380px;
}

.link-btn {
  background: none;
  border: none;
  color: #caa15a;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  text-decoration: underline;
}

.link-btn:hover {
  color: #e8d4a8;
}

.auth-toggle-text {
  text-align: center;
  font-size: 0.85rem;
  color: #9ca3af;
  margin: 1rem 0 0;
}

#authForm .form-actions {
  justify-content: stretch;
}

#authForm .btn-primary {
  width: 100%;
}

.form-row {
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-row label {
  font-size: 0.8rem;
  color: #9ca3af;
}

.form-row input,
.form-row textarea {
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #374151;
  background: #0b1220;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 0.9rem;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #caa15a;
}

.form-row-split {
  flex-direction: row;
  gap: 0.75rem;
}

.form-row-split > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin: -0.25rem 0 0.75rem;
}

.scan-section {
  margin-bottom: 1rem;
  text-align: center;
}

#scannerWrap {
  margin-top: 0.5rem;
}

#scannerVideo {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}

#scannerVideo video {
  width: 100%;
  display: block;
}

#wishScannerVideo {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}

#wishScannerVideo video {
  width: 100%;
  display: block;
}

/* ------------ Wishlist ------------ */

#wishlistSection {
  padding: 0 1.5rem 1.5rem;
}

#wishlistGrid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, auto-fill), minmax(var(--grid-min, 180px), 1fr));
  gap: 1.25rem;
}

.wishlist-card {
  cursor: default;
}

.price-wrap {
  margin-top: 0.4rem;
}

.price-list {
  font-size: 0.75rem;
  color: #d1d5db;
  margin-bottom: 0.3rem;
}

.price-row {
  line-height: 1.4;
}

.price-checked {
  font-size: 0.7rem;
  color: #6b7280;
  margin-bottom: 0.3rem;
}

.price-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.wishlist-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.wishlist-actions .btn-primary,
.wishlist-actions .btn-danger {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
}

.form-status {
  min-height: 1.2rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.form-status-error {
  color: #f87171;
}

.form-status-success {
  color: #4ade80;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-primary,
.btn-secondary {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: #8a6a2f;
  color: #f9fafb;
  border-color: #caa15a;
}

.btn-primary:hover {
  background: #a9823f;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: #9ca3af;
  border-color: #374151;
}

.btn-secondary:hover {
  color: #e5e7eb;
  border-color: #6b7280;
}

.import-preview {
  background: #0b1220;
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
}

.import-column-map {
  font-size: 0.75rem;
  color: #9ca3af;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.25rem 0.75rem;
  margin-top: 0.4rem;
}

.import-column-map span.mapped {
  color: #d1d5db;
}

.import-column-map span.unmapped {
  color: #6b7280;
  font-style: italic;
}

.btn-danger {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid #7f1d1d;
  background: transparent;
  color: #f87171;
}

.btn-danger:hover {
  background: #7f1d1d;
  color: #fff;
}

.btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-actions-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Clickable cards/rows */
.record-card {
  cursor: pointer;
}

/* Detail modal cover preview */
.detail-cover-wrap {
  width: 140px;
  margin: 0 auto 0.75rem;
}

.detail-cover-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.detail-cover-img[hidden] {
  display: none;
}

.detail-cover-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
}

.detail-rating-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.cover-upload-controls {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cover-upload-label {
  display: inline-block;
}

#status {
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

/* ------------ At a Glance ------------ */

#atAGlanceSection {
  padding: 1rem 1.5rem 0;
}

#atAGlanceSection h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f9fafb;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.chart-card {
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 0.75rem;
}

.chart-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #d1d5db;
}

.chart-canvas-wrap {
  position: relative;
  height: 200px;
}

.active-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1.5rem 0.75rem;
}

.active-filters-bar[hidden] {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #8a6a2f;
  color: #f9fafb;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  border: none;
}

.filter-chip button {
  background: none;
  border: none;
  color: #f9fafb;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0;
  line-height: 1;
}

.filter-chip.clear-all {
  background: #374151;
  color: #e5e7eb;
  cursor: pointer;
}

/* ------------ Card grid ------------ */

#cardSection {
  padding: 0 1.5rem 1.5rem;
}

#cardGrid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, auto-fill), minmax(var(--grid-min, 150px), 1fr));
  gap: 1.25rem;
}

.record-card {
  display: flex;
  flex-direction: column;
}

.cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 0.5rem;
  overflow: hidden;
  border-radius: 4px;
}

/* Vinyl disc peeking out from behind the cover - signature touch */
.vinyl-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #0a0a0a 0 6%, transparent 6.5%),
    repeating-radial-gradient(
      circle at center,
      #15171c 0px,
      #15171c 2px,
      #1f2228 2px,
      #1f2228 4px
    );
  box-shadow: inset 0 0 0 10px #0b0c0f;
  transform: translateX(6%);
  z-index: 0;
}

.cover-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  background: #1f2937;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #161a22;
  border: 1px dashed #374151;
  overflow: hidden;
}

.cover-placeholder[hidden] {
  display: none;
}

.cover-placeholder img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  opacity: 0.12;
}

.record-card:hover .cover-img {
  transform: translateX(-8%) rotate(-3deg);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.record-card:hover .vinyl-disc {
  animation: spin 4s linear infinite;
}

@keyframes spin {
  from {
    transform: translateX(6%) rotate(0deg);
  }
  to {
    transform: translateX(6%) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover-img,
  .vinyl-disc {
    transition: none;
    animation: none;
  }
  .record-card:hover .cover-img {
    transform: none;
  }
}

.record-info {
  font-size: 0.85rem;
}

.record-artist {
  font-weight: 600;
  color: #f9fafb;
}

.record-album {
  color: #d1d5db;
  font-style: italic;
}

.record-meta {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Rating controls */
.rating-controls {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.rating-btn {
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #374151;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1.4;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rating-btn:hover {
  border-color: #6b7280;
  color: #e5e7eb;
}

.rating-btn:focus-visible {
  outline: 2px solid #caa15a;
  outline-offset: 2px;
}

.rating-btn.rating-love.active {
  background: #f43f5e;
  border-color: #f43f5e;
  color: #fff;
}

.rating-btn.rating-like.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.rating-btn.rating-neutral.active {
  background: #6b7280;
  border-color: #6b7280;
  color: #fff;
}

.rating-btn.rating-dislike.active {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

/* ------------ Home ------------ */

.home-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-areas:
    "stats stats"
    "spotlight recent"
    "spotlight wishlist"
    "recommendations recommendations";
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.home-card {
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.home-card h2 {
  margin: 0 0 0.8rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f9fafb;
}

.home-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.home-card-header h2 {
  margin: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #374151;
  background: #111827;
  color: #caa15a;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
  border-color: #caa15a;
  color: #e8d4a8;
}

.icon-btn:active {
  transform: rotate(180deg);
}

.home-stats {
  grid-area: stats;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 110px;
  padding: 0.9rem 1rem;
  border-radius: 6px;
  border: 1px solid #1f2937;
  background: #0b1220;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.stat:hover,
.stat:focus-visible {
  border-color: #caa15a;
  background: #111827;
  outline: none;
}

.stat-value {
  font-size: 2.1rem;
  font-weight: 700;
  color: #caa15a;
}

.stat-value.stat-value-text {
  font-size: 1.3rem;
}

.stat-label {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.2rem;
}

/* Chart card highlight (from stat click navigation) */
.chart-card.highlight {
  border-color: #caa15a;
  box-shadow: 0 0 0 3px rgba(202, 161, 90, 0.35);
}

/* Spotlight */
.home-spotlight {
  grid-area: spotlight;
}

.spotlight-content {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

.spotlight-cover-wrap {
  width: min(240px, 45%);
  flex-shrink: 0;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
}

.spotlight-info {
  font-size: 1.1rem;
  flex: 1;
  min-width: 200px;
}

.spotlight-artist {
  font-weight: 700;
  color: #f9fafb;
  font-size: 1.5rem;
}

.spotlight-album {
  color: #d1d5db;
  font-style: italic;
  font-size: 1.15rem;
  margin-top: 0.15rem;
}

.spotlight-meta {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

.spotlight-description {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #9ca3af;
  line-height: 1.4;
}

.home-recent {
  grid-area: recent;
}

.home-wishlist-highlight {
  grid-area: wishlist;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.spotlight-action-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.spotlight-song-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #caa15a;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 0.45rem 0.8rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.spotlight-song-link:hover {
  border-color: #caa15a;
  color: #e8d4a8;
}

.spotlight-wiki-result {
  max-width: 480px;
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: #d1d5db;
  line-height: 1.4;
}

.spotlight-wiki-result a {
  color: #caa15a;
  text-decoration: none;
}

.spotlight-wiki-result a:hover {
  color: #e8d4a8;
}

.spotlight-wiki-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.spotlight-error {
  font-size: 0.8rem;
  color: #f87171;
}

/* Mini list (recent / wishlist highlights) */
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mini-list-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  border-radius: 4px;
  padding: 0.4rem;
  transition: background-color 0.15s ease;
}

.mini-list-item:hover {
  background: #111827;
}

.mini-cover-wrap {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.mini-cover-wrap img,
.mini-cover-wrap .cover-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-info {
  font-size: 0.88rem;
  overflow: hidden;
}

.mini-artist {
  font-weight: 600;
  color: #f9fafb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-album {
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-hint {
  font-size: 0.82rem;
  color: #6b7280;
}

/* Recommendations */
.home-recommendations {
  grid-area: recommendations;
}

.home-recommendations .field-hint {
  margin-top: 0;
}

.home-recommendations .btn-primary {
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
}

.recommendations-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.recommendation-card {
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.recommendation-artist {
  font-weight: 600;
  color: #f9fafb;
  font-size: 0.9rem;
}

.recommendation-album {
  color: #d1d5db;
  font-style: italic;
  font-size: 0.85rem;
}

.recommendation-reason {
  font-size: 0.78rem;
  color: #9ca3af;
  flex-grow: 1;
}

.recommendation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.recommendation-actions .btn-secondary {
  align-self: flex-start;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.recommendation-song-wrap:not(:empty) {
  margin-top: 0.2rem;
}

.recommendation-song-link {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
}

@media (max-width: 640px) {
  header {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }

  .account-section {
    width: 100%;
    justify-content: space-between;
  }

  .account-email {
    max-width: 60%;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  h1 {
    font-size: 1.3rem;
  }

  .tagline {
    font-size: 0.7rem;
  }

  #controls {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
    gap: 0.6rem;
  }

  #pageNav {
    width: 100%;
  }

  #pageNav .view-btn {
    flex: 1;
    text-align: center;
  }

  #collectionFilters {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  #collectionFilters input,
  #collectionFilters select {
    width: 100%;
  }

  #gridDensityControl {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  #gridDensityControl select {
    flex: 1;
    max-width: 160px;
  }

  .add-record-btn,
  #importBtn,
  #findAllDiscogsBtn {
    width: 100%;
    text-align: center;
  }

  #status {
    padding: 0.5rem 1rem;
  }

  .active-filters-bar {
    padding: 0 1rem 0.6rem;
  }

  #atAGlanceSection {
    padding: 0.75rem 1rem 0;
  }

  #atAGlanceSection h2 {
    font-size: 1rem;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-canvas-wrap {
    height: 170px;
  }

  #cardSection,
  #wishlistSection {
    padding: 0 1rem 1rem;
  }

  .home-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "stats"
      "spotlight"
      "recent"
      "wishlist"
      "recommendations";
    padding: 0.75rem 1rem;
  }

  .spotlight-cover-wrap {
    width: min(160px, 45%);
  }
}
