*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  touch-action: pan-x pan-y;
}

:root {
  --bg:           #ffffff;
  --bg-header:    rgba(255,255,255,0.85);
  --border:       #e5e5e5;
  --text:         #1d1d1f;
  --text-muted:   #6e6e73;
  --card-bg:      #f0f0f0;
  --input-bg:     #f5f5f7;
  --skeleton-a:   #f2f2f2;
  --skeleton-b:   #e8e8e8;
  --shadow:       rgba(0,0,0,0.14);
  --chip-active-bg: #1d1d1f;
  --chip-active-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #0a0a0a;
    --bg-header:    rgba(10,10,10,0.85);
    --border:       #1f1f1f;
    --text:         #f0f0f0;
    --text-muted:   #6e6e73;
    --card-bg:      #1c1c1e;
    --input-bg:     #1c1c1e;
    --skeleton-a:   #1c1c1e;
    --skeleton-b:   #2c2c2e;
    --shadow:       rgba(0,0,0,0.5);
    --chip-active-bg: #f0f0f0;
    --chip-active-text: #0a0a0a;
  }
}

html {
  overflow-x: hidden;
}

body {
  touch-action: pan-x pan-y;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-top: 70px;
}

/* Header */
header {
  padding: 16px 40px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

@media (prefers-color-scheme: dark) {
  header { border-bottom-color: rgba(255, 255, 255, 0.08); }
}

.header-top {
  display: contents;
}

header .name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.name-short { display: none; }

.name-info {
  position: relative;
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.15s;
  flex-shrink: 0;
  cursor: pointer;
  margin-left: 10px;
  align-self: center;
}

.name-info::before {
  content: '';
  position: absolute;
  inset: -10px;
}

.name-info:hover { opacity: 0.8; }

.name-info--mobile { display: none; }

header .count {
  font-size: 13px;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  gap: 4px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  opacity: 0.45;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  transition: opacity 0.15s, background 0.15s;
}

.nav-link:hover { opacity: 0.7; background: rgba(0, 0, 0, 0.06); }

.nav-link--active { opacity: 1; background: rgba(0, 0, 0, 0.06); }

@media (prefers-color-scheme: dark) {
  .nav-link:hover { opacity: 0.7; background: rgba(255, 255, 255, 0.08); }
  .nav-link--active { opacity: 1; background: rgba(255, 255, 255, 0.08); }
}

.nav-count { display: none; }

/* Hero */
.hero {
  padding: 48px 40px 48px;
}

.hero h1 {
  font-size: clamp(1.1rem, 3.3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
  overflow-wrap: break-word;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
  text-wrap: balance;
}

/* Controls */
.controls {
  padding: 0 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Search */
.search-wrap {
  position: relative;
  flex: 1;
}

.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.search {
  width: 100%;
  padding: 9px 12px 9px 32px;
  background: var(--input-bg);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}

.search::placeholder { color: var(--text-muted); }

/* Sort */
.sort-wrap {
  position: relative;
  flex-shrink: 0;
}

.sort-wrap svg {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  fill: var(--text-muted);
  pointer-events: none;
}

.sort {
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 28px 9px 12px;
  background: var(--input-bg);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

/* Empty state */
.empty {
  grid-column: 1 / -1;
  padding: 48px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* About button */
.about-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  height: 30px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  font-family: inherit;
}

.about-btn:hover { color: var(--text); }

.about-btn-label {
  font-size: 11px;
}

.about-btn-label { display: none; }

/* Stats toggle */
.stats-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  height: 30px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  font-family: inherit;
}

.stats-toggle .count {
  font-size: 11px;
  position: static;
  transform: none;
}

.stats-toggle svg { display: none; }

@media (max-width: 899px) {
  .stats-toggle svg { display: block; }
  .stats-toggle .count { display: none; }
}

.stats-toggle:hover { color: var(--text); }

/* Stats modal */
.stats-modal { max-width: 720px; }

.stats-modal-body {
  padding: 0;
  overflow-y: auto;
  max-height: calc(85dvh - 50px);
}

.stats-modal .stats-section {
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
}
.stats-modal .stats-grid {
  position: relative;
}
.stats-modal .stats-grid::after {
  content: '';
  position: absolute;
  background: rgba(0, 0, 0, 0.05);
}
/* Horizontal divider — sits between row 1 and row 2 */
.stats-modal .stats-section:nth-child(-n+2) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
/* Vertical divider — full height */
.stats-modal .stats-grid::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
}
@media (prefers-color-scheme: dark) {
  .stats-modal .stats-grid::after { background: rgba(255, 255, 255, 0.1); }
  .stats-modal .stats-section:nth-child(-n+2) { border-bottom-color: rgba(255, 255, 255, 0.1); }
}
.stats-modal .vbar-chart { flex: 1; height: auto; min-height: 72px; gap: 4px; }
.stats-modal .vbar-bar { max-width: 14px; border-radius: 2px 2px 1px 1px; }
.stats-modal .vbar-labels { gap: 4px; }
.stats-modal .hbar-track { height: 5px; border-radius: 3px; }
.stats-modal .hbar-fill { border-radius: 3px; }
.stats-modal .hbar-chart { gap: 6px; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
}

.stats-section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Vertical bar chart (decades, added over time) */
.vbar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
}

.vbar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.vbar-count {
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.vbar-bar {
  width: 100%;
  border-radius: 3px 3px 1px 1px;
  min-height: 2px;
  background: var(--bar-color, #007aff);
}

.vbar-labels {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.vbar-labels span {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
}

/* Horizontal bar chart (genres) */
.hbar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hbar-label {
  font-size: 12px;
  width: 90px;
  text-align: left;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hbar-track {
  flex: 1;
  height: 8px;
  background: transparent;
  border-radius: 4px;
  overflow: hidden;
}

.hbar-fill {
  height: 100%;
  background: var(--bar-color, #007aff);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.hbar-count {
  font-size: 11px;
  color: var(--text-muted);
  width: 30px;
  flex-shrink: 0;
}

/* Quick numbers */
.stats-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-number {
  text-align: left;
}

.stat-number .stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-number .stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 5px;
}

@media (max-width: 500px) {
  .stats-modal .stats-grid::after { display: none; }
  .stats-modal .stats-grid::before { display: none; }
  .stats-modal .stats-section {
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }
  .stats-modal .stats-section:last-child {
    border-bottom: none;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) and (prefers-color-scheme: dark) {
  .stats-modal .stats-section {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
}

/* View toggle */
.view-toggle {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  background: var(--input-bg);
  flex-shrink: 0;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.view-btn.active {
  background: var(--chip-active-bg);
  color: var(--chip-active-text);
}

/* List table */
.list-table {
  width: 100%;
  border-collapse: collapse;
  padding: 0;
}

.list-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 12px 8px;
  border-bottom: 1px solid var(--border);
}

.list-table th:last-child {
  text-align: right;
}

.list-table td {
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.list-table td:first-child {
  width: 40px;
}

.list-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.list-table tbody tr:hover {
  background: var(--card-bg);
}

.list-table .list-art {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--card-bg);
  flex-shrink: 0;
}

.list-table .list-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.list-table .list-artist {
  font-weight: 600;
  font-size: 14px;
  text-wrap: balance;
}

.list-table .list-album {
  font-size: 14px;
  color: var(--text-muted);
  text-wrap: balance;
}

.list-table .list-genre,
.list-table .list-year,
.list-table .list-added {
  font-size: 14px;
  color: var(--text-muted);
}

.list-table .list-year,
.list-table .list-added {
  text-align: right;
}

.list-table .list-added,
.list-table th.col-added {
  width: 120px;
  white-space: nowrap;
}

.list-album-year {
  display: none;
  color: var(--text-muted);
}


.list-wrap {
  padding: 4px 0 80px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .list-wrap { padding: 4px 0 40px; }
  .list-table .col-genre,
  .list-table .col-year,
  .list-table .col-added { display: none; }
  .list-album-year { display: inline; }
  .list-table .list-artist,
  .list-table .list-album { width: 50%; }
  .list-table th.col-genre,
  .list-table th.col-year,
  .list-table th.col-added { display: none; }
  .list-table td { padding: 8px 8px; }
  .list-table .list-art { width: 36px; height: 36px; }
}

/* Grid — mobile first */
.grid {
  padding: 4px 16px 60px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 12px;
}

@media (min-width: 600px) {
  .grid {
    padding: 4px 40px 80px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 28px 20px;
  }
}

/* Card */
.card {
  cursor: pointer;
  min-width: 0;
}

.card-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--card-bg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.card:hover .card-art {
  transform: scale(1.04);
  box-shadow: 0 12px 32px var(--shadow);
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-art img.loaded { opacity: 1; }

.card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.card-artist {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta,
.card-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  opacity: 0.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Skeleton */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 10px;
}

.skeleton-text { border-radius: 4px; }

/* Error */
.error {
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Modal */
html:has(dialog[open]) { overflow: hidden; }

dialog {
  border-radius: 24px;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(48px) saturate(180%);
  -webkit-backdrop-filter: blur(48px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: var(--text);
  max-width: 680px;
  width: calc(100% - 32px);
  max-height: calc(100dvh - 48px);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
}

dialog[open] {
  display: block;
}

@media (prefers-color-scheme: dark) {
  dialog {
    background: rgba(28, 28, 32, 0.82);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
      0 32px 80px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.07);
  }
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(60px) saturate(130%);
  -webkit-backdrop-filter: blur(60px) saturate(130%);
}

/* Modal header */
.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

@media (prefers-color-scheme: dark) {
  .modal-header {
    background: rgba(28, 28, 32, 0.96);
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }
}

.modal-header-art {
  display: none;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
  flex-shrink: 0;
}

.modal-header-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-header-info {
  flex: 1;
  min-width: 0;
}

.modal-header-artist {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-header-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Scrollable content area — height = dialog max-height minus header (~58px) */
.modal-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-height: calc(100dvh - 48px - 58px);
}

.modal-inner {
  display: flex;
  gap: 28px;
  padding: 24px 28px 28px;
}

.modal-art {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  flex-shrink: 0;
}

.modal-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-body { flex: 1; min-width: 0; }

.modal-artist {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.modal-rank {
  font-size: 28px;
  font-weight: 700;
  color: #145a23;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

@media (prefers-color-scheme: dark) {
  .modal-rank { color: #1e8a38; }
}

.modal-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.modal-meta .meta-label {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.modal-meta .meta-value { color: var(--text-muted); }

.modal-tracklist {
  border-top: 1px solid var(--border);
  padding-top: 15px;
  padding-bottom: 15px;
}

.track-side {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 10px;
  margin-bottom: 4px;
}

.track-side:first-child { margin-top: 0; }

.track-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0 8px;
  align-items: baseline;
  padding: 2.5px 0;
}

.track-pos {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.track-title {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-dur {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.track-loading {
  font-size: 13px;
  color: var(--text-muted);
  padding: 2px 0;
}

.modal-notes-wrap {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.modal-notes-wrap::before {
  content: "Jorge:";
  display: block;
  font-size: 14px;
  color: #4a4a50;
  margin-bottom: 16px;
}

.modal-notes {
  font-size: 14px;
  line-height: 1.7;
  color: #4a4a50;
  white-space: pre-wrap;
  text-wrap: pretty;
  border-left: 2px solid var(--border);
  padding-left: 16px;
}

@media (prefers-color-scheme: dark) {
  .modal-notes-wrap::before { color: #b0b0ba; }
  .modal-notes { color: #b0b0ba; }
  .modal-tracklist   { border-top-color:  rgba(255, 255, 255, 0.1); }
  .modal-notes-wrap  { border-top-color:  rgba(255, 255, 255, 0.1); }
  .modal-notes       { border-left-color: rgba(255, 255, 255, 0.1); }
}

.modal-discogs-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
}

.modal-discogs-link:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.modal-close:hover { background: rgba(0, 0, 0, 0.13); }
.modal-close { -webkit-tap-highlight-color: transparent; }

@media (prefers-color-scheme: dark) {
  .modal-close        { background: rgba(255, 255, 255, 0.1); }
  .modal-close:hover  { background: rgba(255, 255, 255, 0.18); }
  .modal-discogs-link { border-color: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.6); }
}

/* About modal */
.about-modal { max-width: 420px; }

.about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 14px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.about-header-title {
  font-size: 14px;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .about-header { border-bottom-color: rgba(255, 255, 255, 0.08); }
}

.about-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85dvh - 50px);
}

.about-figure {
  margin: 24px 0 0;
}

.about-photo {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.about-caption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 15px;
  text-align: left;
}

.about-bio {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  text-wrap: balance;
  margin-bottom: 10px;
}

.about-translate {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.6;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  margin-bottom: 20px;
  display: block;
}

.about-translate:hover { opacity: 0.9; }

.about-setup {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
}

.about-setup td {
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.about-setup-label {
  color: var(--text-muted);
  width: 100px;
}

@media (prefers-color-scheme: dark) {
  .about-setup td { border-bottom-color: rgba(255, 255, 255, 0.1); }
}

.about-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.about-links a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  transition: color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.about-links a:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

@media (prefers-color-scheme: dark) {
  .about-links a { border-color: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.6); }
  .about-links a:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
}

/* Content responsive — hero, controls, modal */
@media (max-width: 600px) {
  .hero         { padding: 32px 16px 32px; }
  .hero h1      { font-size: 1.6rem; }
  .hero p       { font-size: 1rem; }
  .controls     { padding: 0 16px 24px; }
  .search       { font-size: 16px; }
  .sort         { font-size: 16px; }
  dialog             { width: calc(100% - 40px); border-radius: 20px; }
  .modal-header      { padding: 12px 14px; }
  .modal-scroll      { max-height: calc(100dvh - 48px - 78px); }
  .modal-header-art  { display: block; }
  .modal-inner       { display: block; padding: 18px 18px 24px; }
  .modal-art         { display: none; }
  .modal-title       { font-size: 22px; margin-bottom: 12px; }
  .modal-meta        { font-size: 14px; }
  .track-title       { white-space: normal; font-size: 13px; }
  .track-pos         { font-size: 12px; }
  .track-dur         { font-size: 12px; }
}

@media (min-width: 1400px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 899px) {
  body          { padding-top: 50px; }
  header        { padding: 0 16px; height: 50px; }
  .header-top   { display: contents; }
  header .name  { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; order: 1; padding-right: 14px; margin-right: 2px; border-right: 1px solid rgba(0, 0, 0, 0.05); align-self: stretch; display: flex; align-items: center; }
  header .count { display: none; }
  .site-nav     { position: static; transform: none; gap: 2px; order: 2; margin-left: 10px; margin-right: auto; }
  .nav-link     { font-size: 13px; padding: 5px 10px; }
  .name-info--desktop { display: none; }
  .name-info--mobile  { display: flex; order: 4; margin-left: auto; margin-right: 0; }
  .header-actions {
    display: flex;
    margin-left: auto;
    order: 3;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    gap: 0;
  }
  .about-btn {
    border: none;
    border-radius: 0;
    padding: 4px 10px;
    border-right: 1px solid var(--border);
  }
  .stats-toggle {
    border: none;
    border-radius: 0;
    padding: 4px 10px;
  }
  .stats-toggle svg { margin-left: -4px; }
}

@media (max-width: 415px) {
  .nav-link { padding: 5px 7px; }
}

@media (max-width: 500px) {
  .name-full  { display: none; }
  .name-short { display: inline; }
}


@media (max-width: 899px) and (prefers-color-scheme: dark) {
  header .name { border-right-color: rgba(255, 255, 255, 0.05); }
}

