/*
 * Public site — a quiet, catalogue-first record collection.
 * Depends on tokens.css, base.css and components.css. Everything here is scoped to public-site classes;
 * core components are only extended through modifier classes owned by this file.
 */

:root {
  --page-max: 1440px;
  --chrome: rgba(10, 10, 10, 0.82);
  --sleeve-edge: rgba(255, 255, 255, 0.06);
  --badge-glass: rgba(10, 10, 10, 0.6);
  --toolbar-h: 72px;
  --row-h: 64px;
  --list-head-h: 36px;
}

[data-theme="light"] {
  --chrome: rgba(255, 255, 255, 0.86);
  --sleeve-edge: rgba(0, 0, 0, 0.06);
  --badge-glass: rgba(23, 23, 23, 0.55);
}

/* ------------------------------------------------------------------ Shell */

.shell {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.site-main {
  flex: 1 0 auto;
}

.site-main:focus {
  outline: none;
}

.boot-error {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: var(--space-6);
}

.collection-sentinel {
  height: 1px;
}

/* ----------------------------------------------------------------- Header */

.site-header__sentinel {
  position: absolute;
  top: 0;
  height: 1px;
  width: 1px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  border-bottom: 1px solid transparent;
  background: var(--bg);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: var(--chrome);
}

@supports (backdrop-filter: blur(1px)) {
  .site-header.is-scrolled {
    backdrop-filter: saturate(1.4) blur(12px);
  }
}

.site-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
  height: var(--header-h);
}

.site-header__brand {
  justify-self: start;
  text-decoration: none;
  overflow: hidden;
  color: var(--fg);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header__search {
  min-width: 0;
}

.site-header__tools {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: var(--space-1);
}

.site-header__link {
  padding: 6px var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  transition: color var(--dur-fast) var(--ease-out);
}

.site-header__link:hover,
.site-header__link[aria-current="page"] {
  color: var(--fg);
}

.site-header__control {
  color: var(--fg-muted);
}

.site-header__control:hover {
  color: var(--fg);
}

.site-header__lang-code {
  font-size: var(--text-xs);
  font-weight: 500;
}

@media (max-width: 719px) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'brand tools' 'search search';
    row-gap: 0;
    height: auto;
    padding-bottom: var(--space-3);
  }

  .site-header__brand {
    grid-area: brand;
    line-height: var(--header-h);
  }

  .site-header__tools {
    grid-area: tools;
  }

  .site-header__search {
    grid-area: search;
  }
}

/* ----------------------------------------------------------------- Search */

.toolbar__search {
  position: relative;
  width: 100%;
}

.toolbar__search .input {
  height: 36px;
  border-color: var(--border);
  background: var(--bg-elev-1);
  font-size: var(--text-sm);
}

.toolbar__search .input:hover {
  border-color: var(--border-strong);
}

@media (pointer: coarse) {
  .toolbar__kbd {
    display: none;
  }
}

/* ---------------------------------------------------------------- Catalog */

.catalog {
  outline: none;
}

.catalog__body {
  padding-bottom: var(--space-16);
}

body.has-player .catalog__body {
  padding-bottom: calc(var(--space-16) + var(--player-h));
}

.catalog__empty {
  padding-block: var(--space-16);
}

.catalog-empty .empty-state__art {
  width: 132px;
  color: var(--fg-subtle);
}

/* ---------------------------------------------------------------- Toolbar */

.toolbar__inner {
  position: relative;
}

.toolbar__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  padding-block: var(--space-8) var(--space-4);
}

.toolbar__heading {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-width: 0;
}

.toolbar__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.toolbar__count {
  color: var(--fg-subtle);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.toolbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.toolbar__filter,
.toolbar__sort {
  gap: 6px;
  color: var(--fg-muted);
}

.toolbar__filter:hover,
.toolbar__sort:hover,
.toolbar__filter[aria-expanded="true"] {
  color: var(--fg);
}

.toolbar__filter-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
}

.toolbar__chevron {
  color: var(--fg-subtle);
}

.toolbar__view {
  box-sizing: border-box;
  height: var(--control-h-sm);
  padding: 2px;
}

.toolbar__view-item {
  width: 32px;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.toolbar__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-4);
}

.toolbar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toolbar__chip {
  min-height: 28px;
  gap: 6px;
  font-size: var(--text-xs);
}

.toolbar__chip-facet {
  color: var(--fg-subtle);
}

.toolbar__clear {
  color: var(--fg-muted);
}

@media (max-width: 719px) {
  .toolbar__bar {
    padding-top: var(--space-5);
  }

  .toolbar__sort-label {
    display: none;
  }

  .toolbar__filter-label {
    display: none;
  }

  .toolbar__filter,
  .toolbar__sort {
    min-width: var(--control-h-sm);
    padding: 0 8px;
  }

  .toolbar__sort .toolbar__chevron {
    display: none;
  }
}

/* --------------------------------------------------------- Filter panel */

.filter-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: var(--gutter);
  right: var(--gutter);
  z-index: var(--z-dropdown);
  max-height: calc(100dvh - var(--header-h) - var(--toolbar-h) - var(--space-6));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6) var(--space-8) var(--space-8);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elev-2);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.filter-dropdown.is-open {
  opacity: 1;
  transform: none;
}

.filter-panel {
  display: grid;
  gap: var(--space-8);
}

.filter-dropdown .filter-panel {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-8) var(--space-10);
}

.filter-dropdown .filter-favorites,
.filter-dropdown .filter-section--style {
  grid-column: 1 / -1;
}

.filter-dropdown .filter-section--genre,
.filter-dropdown .filter-section--decade,
.filter-dropdown .filter-section--format {
  grid-column: span 4;
}

@media (max-width: 1023px) {
  .filter-dropdown .filter-section--genre,
  .filter-dropdown .filter-section--decade {
    grid-column: span 6;
  }

  .filter-dropdown .filter-section--format {
    grid-column: 1 / -1;
  }
}

.filter-panel__empty {
  color: var(--fg-muted);
}

.filter-section {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-width: 0;
}

.filter-section__title {
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
}

.filter-section__options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-option {
  min-height: 30px;
  padding: 0 10px;
  font-size: var(--text-xs);
}

.filter-section__more {
  justify-self: start;
  padding: var(--space-1) 0;
  color: var(--fg-muted);
  font-size: var(--text-xs);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.25em;
}

.filter-section__more:hover {
  color: var(--fg);
  text-decoration-color: currentColor;
}

.filter-decades {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: var(--space-1);
}

.filter-decade {
  display: grid;
  grid-template-rows: 44px auto auto;
  justify-items: center;
  gap: 4px;
  padding: 6px 2px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.filter-decade:hover {
  background: var(--surface);
  color: var(--fg);
}

.filter-decade[aria-pressed="true"] {
  border-color: var(--fg-subtle);
  color: var(--fg);
}

.filter-decade:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.filter-decade__plot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 44px;
  border-bottom: 1px solid var(--border-strong);
}

.filter-decade__bar {
  width: min(14px, 46%);
  height: calc(max(var(--share, 0), 0.04) * 100%);
  border-radius: 3px 3px 0 0;
  background: var(--fg-subtle);
  transition: height var(--dur-slow) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.filter-decade:hover .filter-decade__bar {
  background: var(--fg-muted);
}

.filter-decade[aria-pressed="true"] .filter-decade__bar {
  background: var(--accent);
}

.filter-decade__label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  white-space: nowrap;
}

.filter-decade__count {
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.filter-favorites {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.filter-favorites__count {
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
}

.filter-sheet__footer {
  display: flex;
  flex: 1 1 auto;
  gap: var(--space-2);
}

.filter-sheet__footer > .btn {
  flex: 1 1 0;
}

/* ------------------------------------------------------------------- List */

.record-list__head,
.record-row {
  display: grid;
  grid-template-columns:
    48px
    minmax(120px, 1.1fr)
    minmax(140px, 1.4fr)
    minmax(100px, 0.9fr)
    minmax(88px, 0.7fr)
    52px
    64px
    minmax(80px, 0.7fr);
  align-items: center;
  column-gap: var(--space-4);
}

.record-list--added .record-list__head,
.record-list--added .record-row {
  grid-template-columns:
    48px
    minmax(120px, 1.1fr)
    minmax(140px, 1.4fr)
    minmax(100px, 0.9fr)
    minmax(88px, 0.7fr)
    52px
    64px
    minmax(80px, 0.7fr)
    96px;
}

.record-list__head {
  position: sticky;
  top: var(--header-h);
  z-index: 2;
  height: var(--list-head-h);
  padding-inline: var(--space-2);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
}

.record-list__col {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-list__sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin-left: -4px;
  padding: 4px;
  border-radius: var(--radius-xs);
  color: inherit;
  font: inherit;
  transition: color var(--dur-fast) var(--ease-out);
}

.record-list__sort:hover,
.record-list__sort.is-active {
  color: var(--fg);
}

.record-list__arrow {
  display: inline-flex;
  width: 12px;
}

.record-list__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.record-list__item {
  border-bottom: 1px solid var(--border);
  content-visibility: auto;
  contain-intrinsic-size: auto var(--row-h);
}

.record-row {
  min-height: var(--row-h);
  padding: 8px var(--space-2);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  transition: background-color 120ms var(--ease-out);
}

.record-row:hover {
  background: var(--surface-hover);
}

.record-row:focus-visible {
  outline-offset: -2px;
}

.record-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-row__thumb {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--record-color, var(--surface));
}

.record-row__thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--sleeve-edge);
  pointer-events: none;
}

.record-row__thumb .cover-img,
.record-row__thumb .cover-fallback {
  width: 100%;
  height: 100%;
}

.record-row__artist {
  color: var(--fg);
}

.record-row__title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg);
  font-weight: 500;
}

.record-row__title-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-row__fav {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--fg-subtle);
}

.record-row__catno,
.record-row__year {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.record-row__added {
  font-variant-numeric: tabular-nums;
}

.record-row__meta {
  display: none;
}

.record-list__item.is-playing .record-row__title {
  color: var(--signal);
}

.record-row__thumb .now-playing,
.record-card .now-playing {
  position: absolute;
  display: grid;
  place-items: center;
  color: #fff;
}

.record-row__thumb .now-playing {
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.now-playing .eq {
  color: #fff;
}

@media (max-width: 1099px) {
  .record-list__head,
  .record-row,
  .record-list--added .record-list__head,
  .record-list--added .record-row {
    grid-template-columns: 48px minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) 52px 64px;
  }

  .record-list__col--catno,
  .record-list__col--genre,
  .record-list__col--added,
  .record-row__catno,
  .record-row__genre,
  .record-row__added {
    display: none;
  }
}

@media (max-width: 719px) {
  .record-list__head {
    display: none;
  }

  .record-row,
  .record-list--added .record-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb title meta"
      "thumb artist meta";
    column-gap: var(--space-3);
    row-gap: 2px;
    padding-inline: 0;
  }

  .record-row__thumb {
    grid-area: thumb;
  }

  .record-row__title {
    grid-area: title;
    align-self: end;
  }

  .record-row__artist {
    grid-area: artist;
    align-self: start;
    color: var(--fg-muted);
  }

  .record-row__label,
  .record-row__year,
  .record-row__format {
    display: none;
  }

  .record-row > .record-row__meta {
    display: block;
    grid-area: meta;
    color: var(--fg-subtle);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
  }

  .record-row:hover {
    background: none;
  }
}

/* ------------------------------------------------------------------- Grid */

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8) var(--space-4);
  margin: 0;
  padding: var(--space-2) 0 0;
  list-style: none;
}

@media (min-width: 560px) {
  .record-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  .record-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-8) var(--space-6);
  }
}

@media (min-width: 1140px) {
  .record-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .record-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.record-grid__item {
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
}

.record-card {
  display: grid;
  gap: var(--space-3);
  color: var(--fg);
}

.record-card__art {
  position: relative;
  display: block;
}

.record-card__sleeve {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--record-color, var(--surface));
}

.record-card__sleeve::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--sleeve-edge);
  pointer-events: none;
}

.record-card__cover {
  width: 100%;
  height: 100%;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.record-card:hover .record-card__cover {
  opacity: 0.85;
}

.record-card__fav {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--badge-glass);
  color: #fff;
}

.record-card .now-playing {
  left: 8px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--badge-glass);
}

.record-card__body {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: var(--text-sm);
}

.record-card__title,
.record-card__artist,
.record-card__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-card__title {
  font-weight: 500;
}

.record-card__artist {
  color: var(--fg-muted);
}

.record-card__meta {
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.record-grid__item.is-playing .record-card__title {
  color: var(--signal);
}

/* -------------------------------------------------------------- Artwork */

.sleeve-art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.sleeve-art__sleeve {
  fill: var(--bg);
}

.sleeve-art__ghost {
  opacity: 0.75;
}

.sleeve-art__label,
.sleeve-art__edge {
  opacity: 0.5;
}

.sleeve-art__crack {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.sleeve-art__crack-shadow {
  opacity: 0.3;
}

/* ---------------------------------------------------------------- Overlay */

.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  padding: clamp(0px, 3vw, 32px);
}

body.has-player .overlay {
  padding-bottom: calc(var(--player-h) + clamp(0px, 1.5vw, 16px));
}

.overlay__backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  transition: opacity 380ms var(--ease-out);
}

@supports (backdrop-filter: blur(1px)) {
  .overlay__backdrop {
    backdrop-filter: blur(5px) saturate(0.9);
  }
}

.overlay.is-open .overlay__backdrop {
  opacity: 1;
}

.overlay.is-closing .overlay__backdrop {
  transition-duration: 300ms;
}

.overlay__panel {
  position: relative;
  outline: none;
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  transition: opacity 320ms var(--ease-out), transform 520ms var(--ease-out);
}

.overlay.is-open .overlay__panel {
  opacity: 1;
  transform: none;
}

.overlay.is-morphing .overlay__panel {
  transform: none;
}

.overlay.is-closing .overlay__panel {
  opacity: 0;
  transform: translateY(12px) scale(0.99);
  transition-duration: 240ms, 300ms;
}

.overlay.is-closing.is-morphing .overlay__panel {
  transform: none;
}

/* ----------------------------------------------------------------- Detail */

.detail__panel {
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  height: 100%;
  max-height: 960px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elev-1);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

.detail__tint {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(var(--record-color-rgb, 120 120 120) / 0.1), transparent 320px);
  pointer-events: none;
}

[data-theme="light"] .detail__tint {
  opacity: 0.7;
}

.detail__bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
}

.detail__nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.detail__position {
  min-width: 84px;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-mono);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.detail__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.detail__content {
  padding: clamp(20px, 4.5vw, 56px) clamp(20px, 4.5vw, 56px) clamp(40px, 6vw, 72px);
}

.detail__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  align-items: end;
}

@media (min-width: 760px) {
  .detail__head {
    grid-template-columns: minmax(240px, 42%) minmax(0, 1fr);
    gap: clamp(36px, 5vw, 64px);
  }
}

.detail__art {
  position: relative;
  width: 78%;
  max-width: 440px;
}

.detail__disc {
  position: absolute;
  top: 3%;
  left: 3%;
  width: 94%;
  aspect-ratio: 1;
  transform: translateX(0);
  transition: transform 700ms var(--ease-out);
}

.detail__head.is-playing .detail__disc {
  transform: translateX(28%);
}

.detail__sleeve {
  position: relative;
  z-index: 1;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--record-color, var(--surface));
  box-shadow: var(--shadow-cover);
}

.detail__sleeve::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--sleeve-edge);
  pointer-events: none;
}

.detail__placeholder,
.detail__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail__intro {
  display: grid;
  align-content: end;
  gap: var(--space-4);
  min-width: 0;
}

.detail__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
}

.detail__wishlist {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  color: var(--fg);
  font-size: var(--text-xs);
  font-weight: 500;
}

.detail__favorite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
}

.detail__favorite .icon {
  color: var(--fg);
}

.detail__title {
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  hyphens: auto;
}

.detail__artist {
  color: var(--fg-muted);
  font-size: var(--text-md);
  line-height: var(--leading-snug);
}

.detail__artist-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.22em;
}

.detail__artist-link:hover {
  color: var(--fg);
  text-decoration-color: currentColor;
}

.detail__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.detail__play {
  min-width: 156px;
}

.detail__listen .icon {
  color: var(--fg-subtle);
}

.detail__action-skeleton {
  width: 156px;
  height: var(--control-h);
}

.detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--space-1) 0 0;
  padding: 0;
  list-style: none;
}

.detail__tag {
  min-height: 28px;
  font-size: var(--text-xs);
}

.detail__tag--genre {
  color: var(--fg);
}

.detail__body {
  display: grid;
  gap: clamp(40px, 5vw, 64px);
  margin-top: clamp(36px, 5vw, 64px);
}

.detail__columns {
  display: grid;
  gap: clamp(36px, 4vw, 56px);
}

@media (min-width: 900px) {
  .detail__columns {
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
    align-items: start;
  }

  .detail__facts {
    position: sticky;
    top: var(--space-6);
  }
}

.detail__main {
  min-width: 0;
}

.detail__facts {
  display: grid;
  gap: var(--space-6);
  min-width: 0;
}

.detail__facts-list {
  margin: 0;
}

.detail__fact {
  display: grid;
  grid-template-columns: minmax(104px, 40%) minmax(0, 1fr);
  gap: var(--space-3);
  padding-block: 11px;
  border-top: 1px solid var(--border);
}

.detail__fact:last-child {
  border-bottom: 1px solid var(--border);
}

.detail__fact dt {
  padding-top: 3px;
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
}

.detail__fact dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
  margin: 0;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.detail__fact-sub {
  flex-basis: 100%;
  color: var(--fg-muted);
  font-size: var(--text-xs);
}

.detail__fact-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.22em;
}

.detail__fact-link:hover {
  text-decoration-color: currentColor;
}

.detail__mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}

.detail__grades {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail__grade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.detail__grade:hover,
.detail__grade[aria-expanded="true"] {
  border-color: var(--fg-subtle);
  background: var(--surface);
}

.detail__grade-kind {
  color: var(--fg-subtle);
}

.detail__grade-value {
  font-family: var(--font-mono);
  font-weight: 500;
}

.detail__stars {
  display: inline-flex;
  gap: 2px;
  color: var(--fg);
}

.detail__stars .icon--star {
  color: var(--fg-subtle);
}

.detail__market {
  display: grid;
  gap: 4px;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgb(var(--record-color-rgb, 108 103 95) / 0.05);
}

.detail__market-title,
.detail__aside-title {
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
}

.detail__market-value {
  margin-top: var(--space-1);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.detail__market-source {
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

.detail__market-meta,
.detail__market-updated {
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.04em;
}

.detail__market-meta:empty {
  display: none;
}

.detail__facts-pending {
  display: grid;
  gap: var(--space-1);
}

.detail__sources {
  display: grid;
  gap: var(--space-2);
}

.detail__sources-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail__source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--fg-muted);
  font-size: var(--text-sm);
  text-decoration: none;
}

.detail__source:hover {
  color: var(--fg);
}

.detail__section {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.detail__section-title {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.3;
}

.detail__extras {
  display: grid;
  gap: var(--space-6);
  max-width: 860px;
}

.detail__prose {
  display: grid;
  gap: var(--space-3);
  max-width: 68ch;
  color: var(--fg-muted);
  font-size: var(--text-md);
  line-height: 1.65;
}

.detail__prose--small {
  padding-bottom: var(--space-5);
  font-size: var(--text-sm);
}

.detail__disclosure {
  border-top: 1px solid var(--border);
}

.detail__disclosure:last-child {
  border-bottom: 1px solid var(--border);
}

.detail__summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

.detail__summary::-webkit-details-marker {
  display: none;
}

.detail__summary .icon {
  margin-left: auto;
  color: var(--fg-subtle);
  transition: transform var(--dur-base) var(--ease-out);
}

.detail__disclosure[open] > .detail__summary .icon {
  transform: rotate(180deg);
}

.detail__summary:focus-visible {
  outline-offset: -2px;
}

.detail__summary-count {
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
}

.detail__credits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: var(--space-4) var(--space-6);
  margin: 0;
  padding-bottom: var(--space-6);
}

.detail__credit dt {
  color: var(--fg-subtle);
  font-size: var(--text-xs);
}

.detail__credit dd {
  margin: 2px 0 0;
  font-size: var(--text-sm);
}

.detail__video-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail__video {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
}

.detail__video-button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.detail__video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
  transition: opacity var(--dur-base) var(--ease-out), transform 700ms var(--ease-out);
}

.detail__video-button:hover .detail__video-thumb {
  opacity: 1;
  transform: scale(1.03);
}

.detail__video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: auto;
  border-radius: 50%;
  background: rgba(12, 11, 10, 0.62);
  color: #f2ede4;
  transition: transform var(--dur-base) var(--ease-spring), background-color var(--dur-fast) var(--ease-out);
}

.detail__video-button:hover .detail__video-play {
  background: var(--accent);
  color: var(--accent-fg);
  transform: scale(1.06);
}

.detail__video-title {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  padding: var(--space-6) var(--space-3) var(--space-2);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: #f2ede4;
  font-size: var(--text-xs);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail__video-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.detail__gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail__gallery-item {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--record-color, var(--surface));
}

.detail__gallery-img {
  transition: transform 600ms var(--ease-out);
}

.detail__gallery-item:hover .detail__gallery-img {
  transform: scale(1.04);
}

.detail__error {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--fg-muted);
}

.detail__error > .icon {
  color: var(--warning);
}

.detail__error > div {
  flex: 1 1 200px;
}

.detail__error-title {
  color: var(--fg);
  font-weight: 500;
}

.detail__error-text {
  font-size: var(--text-sm);
}

.detail__missing {
  display: grid;
  justify-items: start;
  gap: var(--space-4);
  max-width: 560px;
  padding-block: clamp(32px, 10vh, 120px);
}

.detail__missing-text {
  color: var(--fg-muted);
}

.detail__head--skeleton .detail__sleeve {
  width: 100%;
  border-radius: var(--radius-xs);
}

.detail__skeleton-line {
  height: 14px;
}

.detail__skeleton-title {
  width: 140px;
  height: 22px;
}

/* Grade explanation popover and gallery lightbox */
.popover.popover--raised {
  z-index: calc(var(--z-modal) + 1);
}

.grade-popover {
  max-width: 300px;
  padding: var(--space-3) var(--space-4);
}

.grade-info__title {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
}

.grade-info__code {
  font-family: var(--font-mono);
  color: var(--fg-subtle);
}

.grade-info__text {
  margin-top: 6px;
  color: var(--fg-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.lightbox-modal .modal__body {
  padding: 0 var(--space-4) var(--space-4);
}

.lightbox__stage {
  display: grid;
  place-items: center;
  min-height: min(56vh, 560px);
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
}

.lightbox__img {
  max-width: 100%;
  max-height: min(72vh, 900px);
  object-fit: contain;
  background: var(--record-color, transparent);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.lightbox__img.is-loaded {
  opacity: 1;
}

.lightbox__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.lightbox__counter {
  min-width: 64px;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 759px) {
  .overlay.detail,
  .overlay.insights {
    padding: 0;
  }

  body.has-player .overlay.detail,
  body.has-player .overlay.insights {
    padding-bottom: var(--player-h);
  }

  .detail__panel,
  .insights__panel {
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .detail__art {
    width: 74%;
  }
}

/* -------------------------------------------------------------- Tracklist */

.tracklist {
  display: grid;
  gap: var(--space-4);
}

.tracklist__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.tracklist__summary {
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.tracklist__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

.tracklist__status.is-searching::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--border-strong);
  border-top-color: var(--fg);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.tracklist__groups {
  display: grid;
  gap: var(--space-8);
}

.tracklist__side {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-strong);
  color: var(--fg);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
}

.tracklist__side-time {
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}

.tracklist__rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tracklist__row {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: 50px;
  padding: 6px var(--space-2) 6px 0;
  border-bottom: 1px solid var(--border);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.tracklist__row.is-playable {
  cursor: pointer;
}

.tracklist__row.is-playable:hover {
  background: var(--surface);
}

.tracklist__row.is-current {
  background: linear-gradient(90deg, var(--accent-soft), transparent 75%);
}

.tracklist__lead {
  position: relative;
  display: grid;
  align-items: center;
  height: 34px;
}

.tracklist__pos {
  padding-left: var(--space-2);
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  transition: opacity var(--dur-fast) var(--ease-out);
}

.tracklist__play {
  position: absolute;
  top: 50%;
  left: 2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--fg-inverse);
  opacity: 0;
  transform: translateY(-50%) scale(0.9);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.tracklist__lead .eq {
  position: absolute;
  top: 50%;
  left: 11px;
  transform: translateY(-50%);
  transition: opacity var(--dur-fast) var(--ease-out);
}

.tracklist__row.is-playable:hover .tracklist__play,
.tracklist__play:focus-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.tracklist__row.is-playable:hover .tracklist__pos,
.tracklist__row.is-playable:hover .eq,
.tracklist__row:focus-within .tracklist__pos,
.tracklist__row:focus-within .eq,
.tracklist__row.is-current .tracklist__pos {
  opacity: 0;
}

@media (hover: none) {
  .tracklist__row.is-playable .tracklist__play {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    background: transparent;
    color: var(--fg);
    box-shadow: inset 0 0 0 1px var(--border-strong);
  }

  .tracklist__row.is-playable .tracklist__pos,
  .tracklist__row.is-current .tracklist__play {
    opacity: 0;
  }
}

.tracklist__main {
  display: grid;
  min-width: 0;
}

.tracklist__title {
  font-size: var(--text-base);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tracklist__row.is-current .tracklist__title {
  font-weight: 500;
}

.tracklist__artists {
  color: var(--fg-muted);
  font-size: var(--text-xs);
}

.tracklist__dur {
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.tracklist__heading {
  padding: var(--space-5) 0 var(--space-2) calc(44px + var(--space-3));
  border-bottom: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}

.tracklist__empty {
  color: var(--fg-muted);
}

.tracklist--skeleton .tracklist__row {
  cursor: default;
}

.tracklist__skeleton-pos {
  width: 22px;
  margin-left: var(--space-2);
}

.tracklist__skeleton-title {
  height: 12px;
}

.tracklist__skeleton-time {
  width: 32px;
}

/* ----------------------------------------------------------------- Player */

.player {
  position: fixed;
  right: var(--scrollbar-comp, 0px);
  bottom: 0;
  left: 0;
  z-index: calc(var(--z-overlay) + 2);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border-strong);
  background: var(--chrome-strong);
  box-shadow: 0 -12px 32px -16px rgba(0, 0, 0, 0.5);
  visibility: hidden;
  transform: translateY(calc(100% + 1px));
  transition: transform 520ms var(--ease-out), visibility 0s linear 520ms;
}

@supports (backdrop-filter: blur(1px)) {
  .player {
    backdrop-filter: saturate(1.5) blur(20px);
  }
}

.player.is-visible {
  visibility: visible;
  transform: none;
  transition: transform 520ms var(--ease-out), visibility 0s;
}

body.has-player .site-footer {
  padding-bottom: calc(var(--space-12) + var(--player-h));
}

.player__line {
  position: absolute;
  top: -1px;
  right: 0;
  left: 0;
  height: 2px;
  pointer-events: none;
}

.player__line-fill {
  display: block;
  height: 100%;
  background: var(--signal);
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
}

.player__inner {
  display: grid;
  grid-template-columns: 48px minmax(140px, 1fr) auto minmax(200px, 1.3fr) auto;
  align-items: center;
  gap: var(--space-4);
  max-width: var(--page-max);
  height: var(--player-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.player__cover {
  display: block;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: var(--radius-xs);
  background: var(--record-color, var(--surface));
  box-shadow: var(--shadow-sm);
}

.player__cover:focus-visible {
  outline-offset: 3px;
}

.player__meta {
  min-width: 0;
}

.player__title,
.player__sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__title {
  font-size: var(--text-sm);
  font-weight: 500;
}

.player__sub {
  color: var(--fg-muted);
  font-size: var(--text-xs);
}

.player__controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.player__toggle {
  width: 44px;
  min-height: 44px;
  border-radius: 50%;
}

.player__timeline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
}

.player__time {
  min-width: 34px;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
}

.player__time--total {
  text-align: right;
}

.player__extras {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.player__badge {
  color: var(--fg-subtle);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.player__volume {
  display: flex;
  align-items: center;
  gap: 2px;
}

.player__volume-range {
  width: 84px;
}

.player.is-error .player__title {
  color: var(--fg-muted);
}

/* Range inputs (scrub + volume) */
.player__scrub,
.player__volume-range {
  --fill: var(--fg);
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.player__scrub {
  --value: var(--progress, 0);
}

.player__volume-range {
  --value: var(--level, 0);
}

.player__scrub:focus-visible,
.player__volume-range:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.player__scrub::-webkit-slider-runnable-track,
.player__volume-range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--fill) calc(var(--value) * 100%), var(--border-strong) 0);
}

.player__scrub::-moz-range-track,
.player__volume-range::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: var(--border-strong);
}

.player__scrub::-moz-range-progress,
.player__volume-range::-moz-range-progress {
  height: 3px;
  border-radius: 3px;
  background: var(--fill);
}

.player__scrub::-webkit-slider-thumb,
.player__volume-range::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}

.player__scrub::-moz-range-thumb,
.player__volume-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transform: scale(0);
  transition: transform var(--dur-fast) var(--ease-out);
}

.player__scrub:hover::-webkit-slider-thumb,
.player__scrub:focus-visible::-webkit-slider-thumb,
.player__scrub:active::-webkit-slider-thumb,
.player__volume-range:hover::-webkit-slider-thumb,
.player__volume-range:focus-visible::-webkit-slider-thumb {
  transform: scale(1);
}

.player__scrub:hover::-moz-range-thumb,
.player__scrub:focus-visible::-moz-range-thumb,
.player__scrub:active::-moz-range-thumb,
.player__volume-range:hover::-moz-range-thumb,
.player__volume-range:focus-visible::-moz-range-thumb {
  transform: scale(1);
}

.player.is-playing .player__scrub {
  --fill: var(--signal);
}

@media (hover: none), (pointer: coarse) {
  .player__volume {
    display: none;
  }
}

@media (max-width: 899px) {
  .player__inner {
    grid-template-columns: 48px minmax(0, 1fr) auto auto;
  }

  .player__timeline {
    position: absolute;
    top: -11px;
    right: 0;
    left: 0;
    display: block;
  }

  .player__time {
    display: none;
  }

  .player__scrub {
    display: block;
    width: 100%;
  }

  .player__scrub::-webkit-slider-runnable-track {
    height: 2px;
    border-radius: 0;
  }

  .player__scrub::-moz-range-track,
  .player__scrub::-moz-range-progress {
    height: 2px;
    border-radius: 0;
  }

  .player__scrub::-webkit-slider-thumb {
    margin-top: -5px;
  }

  .player__line,
  .player__badge {
    display: none;
  }
}

@media (max-width: 479px) {
  .player__inner {
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
    gap: var(--space-3);
  }

  .player__cover {
    width: 44px;
    height: 44px;
  }

  .player__prev {
    display: none;
  }
}

/* --------------------------------------------------------------- Insights */

.insights__panel {
  display: flex;
  flex-direction: column;
  width: min(1240px, 100%);
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}

.insights__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-3) var(--space-2) clamp(20px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
}

.insights__eyebrow {
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
}

.insights__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.insights__content {
  display: grid;
  gap: clamp(32px, 4vw, 56px);
  padding: clamp(20px, 4vw, 40px) clamp(20px, 4vw, 40px) clamp(40px, 5vw, 64px);
}

.insights__title {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.insights__title em {
  color: var(--fg-muted);
  font-style: normal;
}

.insights__lede {
  max-width: 56ch;
  margin-top: var(--space-5);
  color: var(--fg-muted);
  font-size: var(--text-md);
}

.insights__value {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev-1);
}

.insights__value-label {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}

.insights__value-amount {
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.insights__value-note {
  color: var(--fg-subtle);
  font-size: var(--text-xs);
}

.insights__figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: var(--space-6) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.insights__figure {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-strong);
}

.insights__figure-value {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.insights__figure-value--text {
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.2;
}

.insights__figure-label {
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
}

.insights__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(44px, 5vw, 72px) clamp(32px, 4vw, 64px);
}

.insights__section {
  min-width: 0;
}

.insights__section--wide {
  grid-column: 1 / -1;
}

.insights__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-strong);
}

.insights__section-title {
  font-size: var(--text-base);
  font-weight: 600;
}

.insights__section-note {
  color: var(--fg-subtle);
  font-size: var(--text-xs);
}

.insights__empty {
  display: grid;
  justify-items: start;
  gap: var(--space-5);
  color: var(--fg-muted);
}

.insights__empty-art {
  width: 168px;
  color: var(--fg-subtle);
}

/* Ranked horizontal bars: one neutral series, value at the tip, accent only on interaction. */
.bars {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bars__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'name value'
    'track track';
  align-items: baseline;
  gap: 6px var(--space-3);
  margin-inline: calc(var(--space-2) * -1);
  padding: var(--space-2) var(--space-2) 10px;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.bars--ranked .bars__row {
  grid-template-columns: 26px minmax(0, 1fr) auto;
  grid-template-areas:
    'rank name value'
    '. track track';
}

a.bars__row:hover {
  background: var(--surface);
}

.bars__rank {
  grid-area: rank;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
}

.bars__name {
  grid-area: name;
  overflow: hidden;
  font-size: var(--text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bars__value {
  grid-area: value;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.bars__track {
  grid-area: track;
  display: block;
  align-self: center;
  height: 6px;
}

.bars__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0 3px 3px 0;
  background: var(--fg-muted);
  transition:
    width 900ms var(--ease-out) calc(var(--i, 0) * 40ms + 120ms),
    background-color var(--dur-fast) var(--ease-out);
}

.insights.is-animated .bars__fill {
  width: calc(var(--value, 0) * 100%);
}

a.bars__row:hover .bars__fill,
a.bars__row:focus-visible .bars__fill {
  background: var(--accent);
}

/* Vertical columns: decades and additions per year. */
.histogram {
  display: grid;
  grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr));
  align-items: end;
  height: 240px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.histogram__item {
  height: 100%;
  min-width: 0;
}

.histogram__col {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: 6px;
  height: 100%;
  padding-top: var(--space-2);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}

a.histogram__col:hover {
  background: var(--surface);
}

.histogram__value {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
}

.histogram__plot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-bottom: 1px solid var(--border-strong);
}

.histogram__bar {
  width: min(58%, 24px);
  height: 0;
  border-radius: 4px 4px 0 0;
  background: var(--fg-muted);
  transition:
    height 900ms var(--ease-out) calc(var(--i, 0) * 45ms + 120ms),
    background-color var(--dur-fast) var(--ease-out);
}

.insights.is-animated .histogram__bar {
  height: calc(var(--value, 0) * 100%);
}

a.histogram__col:hover .histogram__bar,
a.histogram__col:focus-visible .histogram__bar {
  background: var(--accent);
}

.histogram__label {
  padding-bottom: var(--space-1);
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  white-space: nowrap;
}

@media (max-width: 559px) {
  .histogram {
    height: 200px;
  }

  .histogram__value {
    font-size: 9px;
  }
}

/* -------------------------------------------------------------- Not found */

.not-found {
  display: grid;
  align-items: center;
  min-height: calc(100dvh - var(--header-h) - 220px);
  padding-block: clamp(48px, 10vw, 128px);
}

.not-found__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}

@media (min-width: 860px) {
  .not-found__inner {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }
}

.not-found__art {
  max-width: 280px;
  color: var(--fg-subtle);
}

.not-found__eyebrow {
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
}

.not-found__title {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.not-found__code {
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
}

.not-found__headline {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.15;
}

.not-found__text {
  max-width: 46ch;
  margin-top: var(--space-4);
  color: var(--fg-muted);
  font-size: var(--text-md);
}

.not-found__home {
  margin-top: var(--space-8);
}

/* ----------------------------------------------------------------- Footer */

.site-footer {
  padding-block: var(--space-6) var(--space-8);
  border-top: 1px solid var(--border);
}

body.has-player .site-footer {
  padding-bottom: calc(var(--space-8) + var(--player-h));
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-5);
  color: var(--fg-subtle);
  font-size: var(--text-xs);
}

.site-footer__link {
  color: var(--fg-muted);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em;
}

.site-footer__link:hover {
  color: var(--fg);
}

.site-footer__shortcuts {
  margin-left: auto;
  color: var(--fg-subtle);
  font-size: var(--text-xs);
  transition: color var(--dur-fast) var(--ease-out);
}

.site-footer__shortcuts:hover {
  color: var(--fg);
}

@media (pointer: coarse) {
  .site-footer__shortcuts {
    display: none;
  }
}



.shortcuts {
  display: grid;
  margin: 0;
}

.shortcuts__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: 10px;
  border-bottom: 1px solid var(--border);
}

.shortcuts__row:last-child {
  border-bottom: 0;
}

.shortcuts__keys {
  display: flex;
  gap: var(--space-1);
  order: 2;
}

.shortcuts__label {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

/* --------------------------------------------------------- Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .detail__disc {
    transition: none;
  }
}
