/* Song lists (web/js/lists) and page layout (web/js/pages). Tokens only. */

/* ---- Pages ---- */
.pg { animation: pg-in var(--t-fast) var(--ease); }
@keyframes pg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pg-greeting { margin: var(--sp-5) 0 var(--sp-4); font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.pg-section h2 { margin: var(--sp-5) 0 var(--sp-2); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.pg-loading, .pg-state { padding: var(--sp-5) 0; }
.pg-state h2 { margin-bottom: var(--sp-2); }
.pg-desc { margin: 0 0 var(--sp-4); }

.pg-hero { display: flex; align-items: flex-end; gap: var(--sp-5); padding: var(--sp-6) 0 var(--sp-4); }
.pg-hero-art { flex: none; width: 232px; box-shadow: var(--shadow-art); }
.pg-liked-art { display: grid; place-items: center; width: 232px; height: 232px; border-radius: var(--r-art); background: linear-gradient(135deg, #450af5, #c4efd9); color: #fff; }
.pg-hero-text { min-width: 0; }
.pg-kind { font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.pg-title { margin: var(--sp-1) 0 var(--sp-3); font-size: clamp(32px, 6vw, 72px); font-weight: var(--fw-black); line-height: 1.05; letter-spacing: -.02em; overflow-wrap: anywhere; }
.pg-meta { color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.pg-actions { display: flex; align-items: center; gap: var(--sp-4); margin: var(--sp-2) 0 var(--sp-4); }

/* ---- Song list ---- */
.tl { --tl-pad: var(--sp-4); }
.tl-head, .tl-row { display: grid; grid-template-columns: 40px minmax(0, 6fr) 132px; align-items: center; column-gap: var(--sp-4); padding: 0 var(--tl-pad); }
.tl.has-album .tl-head, .tl.has-album .tl-row { grid-template-columns: 40px minmax(0, 4fr) minmax(0, 3fr) 132px; }
.tl.has-album.has-date .tl-head, .tl.has-album.has-date .tl-row { grid-template-columns: 40px minmax(0, 4fr) minmax(0, 3fr) minmax(0, 2fr) 132px; }
.tl.has-date:not(.has-album) .tl-head, .tl.has-date:not(.has-album) .tl-row { grid-template-columns: 40px minmax(0, 6fr) minmax(0, 2fr) 132px; }
.tl-head { position: sticky; top: 0; z-index: var(--z-sticky); height: 36px; margin-bottom: var(--sp-2); border-bottom: 1px solid var(--raised); background: var(--panel); color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-medium); letter-spacing: .02em; }
.tl-head .tl-idx { justify-content: center; }
.tl-head .tl-end { justify-content: flex-end; padding-right: var(--sp-3); }

.tl-row { position: relative; border-radius: var(--r-art); color: var(--muted); outline: 0; user-select: none; }
.tl-row:hover { background: var(--raised); }
.tl-row.selected { background: var(--highlight); }
.tl-row:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.tl-window { position: absolute; left: 0; right: 0; }

.tl-idx { display: grid; place-items: center; position: relative; width: 40px; height: 100%; font-variant-numeric: tabular-nums; }
.tl-num { display: grid; place-items: center; }
.tl-playbtn { position: absolute; inset: 0; display: none; place-items: center; padding: 0; border: 0; background: none; color: var(--text); }
.tl-row:hover .tl-num, .tl-row:focus-within .tl-num { display: none; }
.tl-row:hover .tl-playbtn, .tl-row:focus-within .tl-playbtn { display: grid; }

.tl-title { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.tl-title > .ui-img { flex: none; }
.tl-titles { min-width: 0; }
.tl-name { overflow: hidden; color: var(--text); font-size: var(--fs-md); text-overflow: ellipsis; white-space: nowrap; }
.tl-row.current .tl-name { color: var(--accent); }
.tl-artists, .tl-album, .tl-date { overflow: hidden; font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.tl-row:hover .tl-artists, .tl-row:hover .tl-album { color: var(--text); }
.tl-explicit { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 6px; border-radius: 2px; background: var(--muted); color: var(--panel); font-size: 10px; font-weight: var(--fw-bold); vertical-align: 1px; }

.tl-end { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-1); }
.tl-time { min-width: 40px; text-align: right; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.tl-heart, .tl-more { opacity: 0; }
.tl-row:hover .tl-heart, .tl-row:hover .tl-more, .tl-row:focus-within .tl-heart, .tl-row:focus-within .tl-more, .tl-heart.on, .tl-more:focus-visible { opacity: 1; }
.tl-more-state { padding: var(--sp-4); color: var(--muted); font-size: var(--fs-sm); text-align: center; min-height: 48px; }
.tl-empty { padding: var(--sp-5); color: var(--muted); }

/* Narrow panels (the right panel can squeeze the list): drop columns by the list's own width. */
@container (max-width: 760px) {
  .tl.has-album.has-date .tl-head, .tl.has-album.has-date .tl-row { grid-template-columns: 40px minmax(0, 4fr) minmax(0, 3fr) 132px; }
  .tl.has-date:not(.has-album) .tl-head, .tl.has-date:not(.has-album) .tl-row { grid-template-columns: 40px minmax(0, 1fr) 132px; }
  .tl-date { display: none; }
}
@container (max-width: 560px) {
  .tl.has-album .tl-head, .tl.has-album .tl-row { grid-template-columns: 40px minmax(0, 1fr) 132px; }
  .tl-album { display: none; }
  .pg-hero-art, .pg-liked-art { width: 160px; height: auto; }
  .pg-liked-art { height: 160px; }
}
@container (max-width: 420px) {
  .tl { --tl-pad: var(--sp-2); }
  .tl-head, .tl-row, .tl.has-album .tl-head, .tl.has-album .tl-row { grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: var(--sp-2); }
  .tl-idx { width: 28px; }
  .tl-time { display: none; }
  .tl-heart, .tl-more { opacity: 1; }
  .pg-hero { flex-direction: column; align-items: flex-start; }
}
@media (hover: none) { .tl-heart, .tl-more { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pg { animation: none; } }
