.archive-index,
.archive-artist-detail,
.archive-song-detail {
  padding-top: 6px;
}

.archive-stats-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.archive-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.archive-tab {
  min-height: 40px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-weight: 700;
}

.archive-tab:hover {
  background: rgba(152, 39, 29, 0.05);
  color: var(--heading);
}

.archive-tab.active {
  background: rgba(152, 39, 29, 0.08);
  color: var(--accent-strong);
}

.archive-controls-panel { margin-bottom: 12px; }

.archive-table .sortable { cursor: pointer; user-select: none; }
.archive-table .sortable.sort-active { color: var(--accent); }

.archive-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.archive-table thead th {
  padding: 16px 18px;
  text-align: left;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 250, 250, 0.98);
}

.archive-table tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(72, 50, 33, 0.08);
  color: var(--text);
  vertical-align: top;
}

.archive-summary-row:hover,
.archive-table tbody tr:hover {
  background: rgba(152, 39, 29, 0.04);
}

.archive-detail-row:hover { background: transparent; }

.archive-table .th-num,
.archive-table .td-num {
  width: 72px;
  text-align: center;
  color: var(--text-dim);
}

.archive-table .th-count,
.archive-table .td-count {
  width: 110px;
  text-align: center;
}

.archive-link {
  font-weight: 800;
  color: var(--heading);
}

.archive-link:hover { color: var(--accent); }

.archive-song-toggle {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font: inherit;
}

.archive-song-toggle-title {
  font-weight: 800;
  color: var(--heading);
}

.archive-song-toggle:hover .archive-song-toggle-title,
.archive-song-toggle.is-open .archive-song-toggle-title {
  color: var(--accent);
}

.archive-detail-cell {
  padding: 0 !important;
  background: rgba(152, 39, 29, 0.03);
}

.archive-run-panel {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.archive-inline-panel {
  border-top: 1px solid rgba(31, 39, 35, 0.08);
}

.archive-run-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.archive-mini-metrics-wrap {
  border-radius: 20px;
  overflow: hidden;
}

.archive-mini-metrics-table thead th,
.archive-mini-metrics-table tbody td {
  padding: 12px 14px;
}

.archive-artist-detail .section-head,
.archive-song-detail .section-head {
  margin-bottom: 16px;
}

.archive-artist-detail .section-head h2,
.archive-song-detail .section-head h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  color: var(--heading);
}

.archive-artist-detail .section-head p,
.archive-song-detail .section-head p {
  margin-top: 6px;
  color: var(--text-muted);
}

.artist-song-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.archive-disclosure {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.archive-disclosure-summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  cursor: pointer;
}

.archive-disclosure-summary::-webkit-details-marker { display: none; }

.archive-disclosure-index {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(152, 39, 29, 0.08);
  color: var(--accent-strong);
  font-weight: 800;
}

.archive-disclosure-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.archive-disclosure-title {
  font-weight: 800;
  color: var(--heading);
}

.archive-disclosure-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.chart-run-graphic-wrap {
  border: 1px solid rgba(31, 39, 35, 0.08);
  border-radius: 20px;
  background: #ffffff;
  overflow: hidden;
}

.chart-run-graphic {
  width: 100%;
  height: auto;
  display: block;
}

.chart-run-grid-line {
  stroke: rgba(31, 39, 35, 0.1);
  stroke-width: 1;
}

.chart-run-axis-label,
.chart-run-point-date {
  fill: var(--text-dim);
  font-size: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.chart-run-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-run-point {
  fill: #ffffff;
  stroke: var(--accent-strong);
  stroke-width: 2;
}

.chart-run-point-label {
  fill: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.detail-actions { margin-bottom: 14px; }

@media (max-width: 860px) {
  .archive-stats-bar { grid-template-columns: 1fr; }
  .archive-disclosure-summary { grid-template-columns: 1fr; }
  .archive-run-summary { flex-direction: column; }

  .archive-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
  }

  .archive-tab {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .archive-table {
    min-width: 680px;
  }

  .archive-table thead th,
  .archive-table tbody td {
    padding: 12px 10px;
  }

  .archive-run-panel {
    padding: 14px;
  }
}

/* Flat black refresh */
.archive-tabs {
  padding: 0;
  border-radius: 0;
  background: var(--surface-strong);
  box-shadow: none;
}

.archive-tab {
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.archive-tab:hover {
  background: #151515;
}

.archive-tab.active {
  background: #111111;
  color: var(--heading);
}

.archive-table thead th {
  background: #0d0d0d;
}

.archive-summary-row:hover,
.archive-table tbody tr:hover {
  background: #121212;
}

.archive-detail-cell {
  background: #101010;
}

.archive-artist-detail .section-head h2,
.archive-song-detail .section-head h2 {
  font-family: var(--font-heading);
}

.chart-run-graphic-wrap {
  background: #0d0d0d;
}

.chart-run-axis-label,
.chart-run-point-date,
.chart-run-point-label {
  font-family: var(--font-body);
}
