/* The window's main area: a label or artist's catalogue (path, header, filters, releases, an
   opened release, the Related bar) and Explore. Tokens come from .shot in mockup.css. */

.catalogue { display: flex; flex-direction: column; height: 100%; }

/* The spiral so far */
.path { display: flex; flex: none; flex-wrap: nowrap; align-items: center; gap: 28px; min-height: 28px; margin-bottom: 12px; overflow: hidden; }
.path li {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color var(--fast) var(--out), color var(--fast) var(--out), background-color var(--fast) var(--out);
}
.path li:last-child { animation: slide var(--base) var(--out) both; }
.path li + li::before { content: '→'; position: absolute; left: -22px; color: var(--ink-faint); }
.path li i { color: var(--ink-faint); }
.path li[data-on] { color: var(--ink); border-color: var(--amber); }
.path li[data-on] i { color: var(--amber); }
.path li[data-press] { background: var(--s3); }

/* Header: sleeve, name, where the releases come from, how much of it you own */
.cat-h { display: flex; flex: none; align-items: center; gap: 14px; min-height: 48px; margin-bottom: 12px; }
.cat-h:has(.cat-name:empty) { visibility: hidden; }
.cat-cover { width: 48px; height: 48px; flex: none; }
.cat-id { flex: 1; min-width: 0; }
.cat-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; letter-spacing: .02em; }
.cat-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); }
.cat-src { display: flex; gap: 4px; }
.meter { display: none; align-items: center; gap: 8px; color: var(--ink-muted); white-space: nowrap; }
.win[data-meter] .meter { display: flex; animation: rise var(--base) var(--out) both; }
.win[data-meter] :is(.cat-src, .play-results) { display: none; }
.meter .bar { position: relative; width: 88px; height: 6px; background: var(--s3); }
.meter .bar::before { content: ''; position: absolute; inset: 0; width: calc(var(--fill) * 100%); background: var(--amber); transform-origin: left; animation: grow 500ms var(--out) both; }
.meter .count { color: var(--ink); }
.play-results { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; color: var(--amber); white-space: nowrap; border: 1px solid var(--amber); border-radius: 2px; transition: background-color var(--fast) var(--out), color var(--fast) var(--out); }
.win[data-press-play] .play-results { color: var(--s0); background: var(--amber); }

/* Filters: the field, sort, the Filters panel and the chips it leaves behind */
.filters { position: relative; z-index: 2; display: flex; flex: none; align-items: center; gap: 8px; height: 32px; margin-bottom: 8px; white-space: nowrap; }
.filter-field, .sort, .add-filter, .chip { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; color: var(--ink-muted); border: 1px solid var(--line); border-radius: 2px; }
.filter-field { width: 200px; color: var(--ink-faint); }
.filter-field kbd { margin-left: auto; height: 16px; font-size: 10px; }
.win[data-filters-open] .add-filter { color: var(--ink); border-color: var(--amber); }
.chip { display: none; color: var(--ink); background: var(--s3); animation: rise var(--base) var(--out) both; }
.win[data-hide-owned] .chip[data-chip="owned"] { display: inline-flex; }
.shown { margin-left: auto; color: var(--ink-faint); }
.panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 316px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 220px;
  padding: 10px;
  background: var(--s1);
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / .8);
  opacity: 0;
  transform: translateY(-4px);
  visibility: hidden;
  transition: opacity var(--base) var(--out), transform var(--base) var(--out), visibility 0s var(--base);
}
.win[data-filters-open] .panel { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.panel-h { margin-bottom: 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.switch { display: flex; align-items: center; gap: 10px; height: 28px; color: var(--ink-muted); }
.switch i { position: relative; width: 24px; height: 14px; background: var(--s3); border-radius: 7px; transition: background-color var(--fast) var(--out); }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; background: var(--ink-faint); border-radius: 50%; transition: transform var(--fast) var(--out), background-color var(--fast) var(--out); }
.win[data-hide-owned] .switch[data-switch="owned"] { color: var(--ink); }
.win[data-hide-owned] .switch[data-switch="owned"] i { background: var(--amber); }
.win[data-hide-owned] .switch[data-switch="owned"] i::after { background: var(--s0); transform: translateX(10px); }

/* Releases: Discogs and Bandcamp in one list, scrolled by the tour */
.cols, .rows > li:not(.detail) { display: grid; grid-template-columns: 28px minmax(0, 1fr) 64px 80px 44px 108px; align-items: center; column-gap: 12px; }
.cols { flex: none; height: 28px; color: var(--ink-faint); border-bottom: 1px solid var(--line); }
.list { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.rows { transform: translateY(calc(var(--scroll, 0) * var(--row) * -1)); transition: transform 420ms var(--out); }
.rows > li:not(.detail) {
  height: var(--row);
  padding-right: 12px;
  border-bottom: 1px solid var(--line);
  animation: rise var(--base) var(--out) both;
  animation-delay: calc(var(--i) * 25ms);
  transition: height var(--base) var(--out), opacity var(--base) var(--out), background-color var(--fast) var(--out);
}
.win[data-hide-owned] .rows > li[data-owned] { height: 0; overflow: hidden; opacity: 0; border-bottom-width: 0; }
.rows .mark { display: grid; place-items: center; color: var(--amber); opacity: 0; transition: opacity var(--fast) var(--out); }
.rows .rel { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rows .rel .cover { width: var(--thumb); height: var(--thumb); flex: none; }
.rows .rel div { min-width: 0; }
.rows .rel b, .rows .rel span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .rel b { font-size: 13px; }
.rows .rel span, .rows .catno, .rows .year { color: var(--ink-muted); }
.rows .src, .rows .tags { display: flex; gap: 4px; }
.rows .tags { justify-content: flex-end; align-items: center; }
.rows > li[data-sel] { background: var(--s3); box-shadow: inset 2px 0 0 var(--amber); }
.rows > li[data-now] { background: var(--s-playing); }
.rows > li[data-now] .mark { opacity: 1; }
.rows > li[data-saved] .heart, .d-tracks li[data-liked] .heart { color: var(--amber); }
.rows > li[data-saved] .heart path, .d-tracks li[data-liked] .heart path { fill: currentColor; }
.scrollbar { position: absolute; top: 4px; right: 2px; bottom: 4px; width: 4px; }
.scrollbar i { position: absolute; left: 0; width: 4px; top: calc(var(--thumb-at, 0) * 100%); height: calc(var(--thumb-size, 1) * 100%); background: var(--line-strong); border-radius: 2px; transition: top 420ms var(--out); }

/* An opened release */
.detail { padding: 8px 12px 10px 40px; background: var(--s1); border-bottom: 1px solid var(--line); animation: rise var(--base) var(--out) both; }
.d-bar { display: flex; align-items: center; gap: 6px; height: 32px; margin-bottom: 4px; white-space: nowrap; }
.d-act { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; color: var(--ink-muted); border: 1px solid var(--line); border-radius: 2px; transition: color var(--fast) var(--out), background-color var(--fast) var(--out); }
.d-act[data-on] { color: var(--s0); background: var(--amber); border-color: var(--amber); }
.d-prev { color: var(--ink-faint); }
.shops { display: flex; gap: 10px; margin-left: auto; color: var(--ink-muted); }
.shops-h { color: var(--ink-faint); }
.d-tracks li { display: grid; grid-template-columns: 16px 28px minmax(0, 1fr) auto 44px 16px; align-items: center; column-gap: 10px; height: 28px; color: var(--ink-muted); }
.d-tracks .t-play { color: var(--amber); opacity: 0; }
.d-tracks i { color: var(--ink-faint); }
.d-tracks .t-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-tracks .t-len { text-align: right; }
.d-tracks li[data-now] { color: var(--ink); }
.d-tracks li[data-now] i, .d-tracks li[data-now] .t-play { color: var(--amber); opacity: 1; }

/* The Related bar, and Spin */
.related { display: flex; flex: none; align-items: center; gap: 10px; height: 48px; border-top: 1px solid var(--line); white-space: nowrap; }
.rel-h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.rel-list { display: flex; flex: 1; gap: 6px; min-width: 0; overflow: hidden; }
.rel-list li { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 28px; padding: 0 10px; color: var(--ink-muted); border: 1px solid var(--line); border-radius: 2px; transition: color var(--fast) var(--out), border-color var(--fast) var(--out), background-color var(--fast) var(--out); }
.rel-list li[data-on] { color: var(--ink); background: var(--s3); border-color: var(--amber); }
.rel-spin { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; color: var(--amber); border: 1px solid var(--amber); border-radius: 2px; transition: color var(--fast) var(--out), background-color var(--fast) var(--out); }
.win[data-press-spin] .rel-spin { color: var(--s0); background: var(--amber); }

/* Explore: replaces the catalogue while the view is "explore" */
.explore { display: none; }
.win[data-view="explore"] .catalogue { display: none; }
.win[data-view="explore"] .explore { display: flex; flex-direction: column; gap: 14px; animation: rise var(--base) var(--out) both; }
.x-h { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.scan { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; text-transform: none; color: var(--ink-faint); }
.x-meta { margin-bottom: 6px; color: var(--ink-muted); }
.shares li { display: grid; grid-template-columns: minmax(0, 1fr) 140px 64px; align-items: center; column-gap: 12px; height: 24px; padding: 0 8px; transition: background-color var(--fast) var(--out); }
.shares li[data-on] { background: var(--s3); box-shadow: inset 2px 0 0 var(--amber); }
.shares .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shares .bar { position: relative; height: 6px; background: var(--s3); }
.shares .bar::before { content: ''; position: absolute; inset: 0; width: calc(var(--fill) * 100%); background: var(--amber); transform-origin: left; animation: grow 400ms var(--out) both; }
.shares .count { text-align: right; color: var(--ink-muted); }
.x-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; font-size: 11px; color: var(--ink-muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; }
.seg > * { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; }
.seg b { color: var(--ink); background: var(--s3); }
.toggle { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 2px; }
.spin { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--amber); }
.spin kbd { height: 16px; font-size: 10px; color: var(--amber); border-color: var(--amber); }
.near-list li { display: flex; flex-direction: column; justify-content: center; gap: 2px; height: 46px; padding: 0 8px; border-bottom: 1px solid var(--line); animation: rise var(--base) var(--out) both; animation-delay: calc(var(--i) * 40ms); transition: background-color var(--fast) var(--out); }
.near-list li[data-on] { background: var(--s3); box-shadow: inset 2px 0 0 var(--amber); }
.near-list .line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.near-list .line b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-list .kind { color: var(--ink-faint); }
.near-list .reason { font-size: 11px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Settings › Collection: each source counting its releases in, while the view is "collection" */
.collection { display: none; }
.win[data-view="collection"] :is(.catalogue, .explore) { display: none; }
.win[data-view="collection"] .collection { display: block; animation: rise var(--base) var(--out) both; }
.sources { margin-top: 8px; border-top: 1px solid var(--line); }
.sources li { display: grid; grid-template-columns: minmax(0, 1fr) 160px 104px 72px; align-items: center; column-gap: 16px; height: 56px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.sources div { min-width: 0; }
.sources b, .sources div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sources div span { font-size: 11px; color: var(--ink-muted); }
.sources .bar { position: relative; height: 6px; background: var(--s3); }
.sources .bar::before { content: ''; position: absolute; inset: 0; width: calc(var(--fill) * 100%); background: var(--amber); }
.sources .count { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.sources .state { color: var(--ink-faint); }
.sources li[data-state="running"] .state { color: var(--amber); }
.sources li[data-state="done"] .state { color: var(--ink); }
