/* ────────────────────────────────────────────────────────────────────────── */

.np-dash {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.np-dash-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  padding: 28px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  align-items: center;
}

.np-dash-hero-cover {
  width: 260px;
  height: 260px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.np-dash-hero-cover .np-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.np-dash-hero-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.np-dash-hero-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.np-dash-hero-sub {
  font-size: 15px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.np-dash-hero-sub .np-link { color: inherit; }
.np-dash-hero-sub .np-link:hover { color: var(--accent); }

.np-dash-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.np-badge-hires {
  background: color-mix(in srgb, var(--highlight) 30%, transparent);
  color: var(--highlight);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.np-dash-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.np-dash-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.np-dash-icon-btn:hover {
  color: var(--accent);
  background: var(--bg-hover);
}
.np-dash-network-btn.is-loved {
  color: var(--accent);
}

.np-stars-inline {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  margin-left: 4px;
}

.np-dash-hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.85;
}

/* Last.fm stats pulled up into the hero */
.np-dash-hero-network {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
}
.np-dash-hero-network-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.np-dash-hero-network-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.np-dash-hero-network-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.np-dash-hero-network-scope {
  font-weight: 600;
  color: var(--text-primary);
}
.np-dash-hero-network-sep {
  color: var(--text-muted);
  padding: 0 2px;
}
.np-dash-hero-network-dot {
  color: var(--text-muted);
  padding: 0 3px;
}
.np-dash-hero-network-you {
  color: var(--accent);
  font-weight: 600;
}

/* Widget layout toolbar (layout / hidden-cards menu) */
.np-dash-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -4px;
}
.np-dash-toolbar-menu-wrap {
  position: relative;
}
.np-dash-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.np-dash-toolbar-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.np-dash-toolbar-badge {
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  min-width: 14px;
  text-align: center;
  line-height: 1.3;
}
.np-dash-toolbar-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 220px;
  background: var(--menu-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.np-dash-toolbar-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 6px 8px 4px;
}
.np-dash-toolbar-empty {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.np-dash-toolbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 12.5px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background 0.1s;
}
.np-dash-toolbar-item:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.np-dash-toolbar-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--border-subtle);
}

/* Widget wrapper — makes each card a psyDnD drag source */
.np-dash-card-wrap {
  position: relative;
  cursor: grab;
}
.np-dash-col.is-dnd-active .np-dash-card-wrap {
  transition: transform 0.15s;
}
.np-dash-col.is-drop-target {
  background: var(--bg-hover);
  border-radius: var(--radius-lg);
  outline: 1px dashed var(--border);
  outline-offset: 4px;
}

.np-dash-toolbar-item-label { flex: 1; min-width: 0; }
.np-dash-toolbar-item.is-hidden .np-dash-toolbar-item-label { opacity: 0.55; }

/* Drop indicator — accent line between cards while dragging */
.np-dash-drop-indicator {
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
  margin: -8px 0;
}

/* Empty column placeholder */
.np-dash-col-empty {
  padding: 28px 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  font-style: italic;
}

/* Two flex columns — left stack, right stack */
.np-dash-grid {
  display: flex;
  gap: 18px;
  align-items: stretch; /* equal-height columns so drops below the last card still hit the column */
}

.np-dash-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* Ensures the area below the last card still belongs to this column — needed
     so the user can drop a card "at the very bottom" even when the other
     column is taller. */
  min-height: 120px;
}

.np-dash-card {
  min-width: 0;
}

/* Expanded bio grows the card naturally instead of turning into a scroll box */
.np-dash-artist-text .np-bio-text.expanded {
  max-height: none;
  overflow: visible;
}

/* Artist card */
.np-artist-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.np-artist-tab {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.np-artist-tab.is-active {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--text-primary);
}

.np-dash-artist-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.np-dash-artist-image {
  width: 92px;
  height: 92px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.np-dash-artist-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.np-dash-artist-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.np-dash-similar {
  margin-top: 4px;
}

.np-dash-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.np-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.np-chip:hover {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--text-primary);
}

/* Album card meta line */
.np-dash-album-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.np-dash-album-name {
  font-weight: 600;
  color: var(--text-primary);
}
.np-dash-album-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

/* Top songs card */
.np-dash-top-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.np-dash-top-row {
  display: grid;
  grid-template-columns: 28px 1fr auto 16px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
}
.np-dash-top-row:hover {
  background: var(--bg-hover);
}
.np-dash-top-row.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.np-dash-top-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.np-dash-top-row.active .np-dash-top-rank {
  color: var(--accent);
}
.np-dash-top-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.np-dash-top-title {
  font-size: 13px;
  color: var(--text-primary);
}
.np-dash-top-row.active .np-dash-top-title {
  color: var(--accent);
  font-weight: 600;
}
.np-dash-top-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.np-dash-top-dur {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.np-dash-top-play {
  color: var(--text-muted);
  transition: color 0.15s;
}
.np-dash-top-row:hover .np-dash-top-play {
  color: var(--accent);
}
.np-dash-top-credit {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Info-only tracklist inside the dashboard: no cursor, no hover background */
.np-dash-card .np-album-track { cursor: default; }
.np-dash-card .np-album-track:hover:not(.active) { background: transparent; }

/* Tracklist expand toggle */
.np-dash-tracklist-more {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
  padding: 6px 8px;
  align-self: flex-start;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.np-dash-tracklist-more:hover { opacity: 1; }

/* Hero age + ReplayGain badge */
.np-dash-hero-age {
  font-style: italic;
  opacity: 0.65;
}

/* Discography grid — compact contact-sheet of covers, title/year shown on hover via tooltip */
.np-dash-disc-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}
.np-dash-disc-tile {
  cursor: pointer;
  min-width: 0;
  transition: transform 0.15s;
}
.np-dash-disc-tile:hover { transform: none; }
.np-dash-disc-cover {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-hover);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  position: relative;
}
.np-dash-disc-tile.active .np-dash-disc-cover {
  box-shadow: 0 0 0 2px var(--accent), 0 3px 10px rgba(0, 0, 0, 0.4);
}
.np-dash-disc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.np-dash-disc-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* Last.fm stats */
.np-dash-stats-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.np-dash-stats-row + .np-dash-stats-row {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.np-dash-stats-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.np-dash-stats-values {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.np-dash-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 60px;
}
.np-dash-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.np-dash-stat-you .np-dash-stat-value {
  color: var(--accent);
}
.np-dash-stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: lowercase;
}
.np-dash-stats-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Responsive: single column on narrow viewports */
@media (max-width: 900px) {
  .np-dash-grid { flex-direction: column; }
  .np-dash-hero { grid-template-columns: 1fr; }
  .np-dash-hero-cover { width: 180px; height: 180px; margin: 0 auto; }
  .np-dash-hero-title { font-size: 24px; }
}

/* Prefer container-based adaptation (main-content width can be narrow on desktop). */
@container (max-width: 900px) {
  .np-dash-grid {
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
  }

  .np-dash-col {
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    gap: 14px;
  }

  .np-dash-card-wrap {
    display: block;
    width: 100%;
  }

  .np-dash-card,
  .np-info-card {
    min-width: 0;
    overflow: hidden;
  }

  .np-dash-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
    align-items: stretch;
  }

  .np-dash-hero-cover {
    width: 180px;
    height: 180px;
    margin: 0 auto;
  }

  .np-dash-hero-body {
    gap: 10px;
  }

  .np-dash-hero-title {
    font-size: 24px;
    line-height: 1.2;
    overflow-wrap: break-word;
  }

  .np-dash-hero-sub,
  .np-dash-hero-network-row {
    font-size: 13px;
  }

  .np-dash-hero-actions {
    flex-wrap: wrap;
  }
}

@container (max-width: 760px) {
  .np-main__viewport {
    padding: 16px 14px 24px;
    gap: 12px;
  }

  .np-dash {
    gap: 12px;
  }

  .np-dash-hero {
    padding: 14px;
    gap: 12px;
  }

  .np-dash-hero-cover {
    width: 150px;
    height: 150px;
  }

  .np-dash-hero-title {
    font-size: 21px;
    overflow-wrap: anywhere;
  }

  .np-dash-hero-sub {
    gap: 5px;
  }

  .np-dash-hero-network {
    padding: 10px 11px;
  }

  .np-info-card {
    padding: 14px 15px;
  }

  .np-card-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .np-dash-col {
    gap: 12px;
  }
}

.app-shell[data-mobile] .np-dash-grid { flex-direction: column; }
.app-shell[data-mobile] .np-dash-hero { grid-template-columns: 1fr; }
.app-shell[data-mobile] .np-dash-hero-cover { width: 160px; height: 160px; margin: 0 auto; }
.app-shell[data-mobile] .np-dash-hero-title { font-size: 22px; }
.app-shell[data-mobile] .np-dash-artist-body { flex-direction: column; }
.app-shell[data-mobile] .np-dash-artist-image { width: 72px; height: 72px; }
.app-shell[data-mobile] .np-dash-disc-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .np-dash-disc-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .np-dash-disc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .np-dash-stats-values { gap: 16px; }
  .np-dash-stat-value { font-size: 18px; }
}

