/* ============================================================
   Lately — Swiss / International Typographic Style
   Lexend · strict grid · restrained palette · flush-left
   A Last.fm dashboard. Shares the visual language of GitGud.
   ============================================================ */

:root {
  --bg:        #f4f3ee;   /* warm off-white paper */
  --bg-card:   #ffffff;
  --ink:       #0a0a0a;   /* near-black */
  --ink-2:     #45464a;
  --muted:     #76787d;
  --line:      #0a0a0a;   /* hairlines are black in Swiss style */
  --line-soft: #d9d8d2;
  --accent:    #ff3b30;   /* single red accent */
  --accent-ink:#ffffff;
  --good:      #1a7f37;
  --bad:       #cf222e;

  --maxw: 1120px;
  --gut: 28px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
iconify-icon { display: inline-block; vertical-align: -0.125em; }
::selection { background: var(--accent); color: #fff; }
[hidden] { display: none !important; }

/* ---- top bar ---- */
.topbar { border-bottom: 1.5px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 14px var(--gut); display: flex; align-items: baseline; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: -.02em; width: 28px; height: 28px; display: grid; place-items: center; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-sub { color: var(--muted); font-size: 13px; font-weight: 400; letter-spacing: .02em; text-transform: uppercase; margin-left: auto; }

/* ---- layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut) 80px; }

/* ---- masthead ---- */
.masthead { padding: 70px 0 56px; border-bottom: 1.5px solid var(--line); position: relative; }
.masthead-no { font-size: 13px; font-weight: 600; letter-spacing: .14em; color: var(--accent); margin-bottom: 22px; }
.masthead-title { font-size: clamp(40px, 8vw, 92px); font-weight: 800; letter-spacing: -.045em; line-height: .96; margin: 0 0 26px; max-width: 14ch; }
.masthead-lead { font-size: clamp(15px, 2vw, 19px); color: var(--ink-2); max-width: 58ch; margin: 0 0 38px; line-height: 1.55; }

/* ---- search ---- */
.searchbar { display: flex; align-items: stretch; border: 1.5px solid var(--line); background: var(--bg-card); max-width: 560px; }
.searchbar-inline { max-width: 480px; margin-top: 4px; }
.searchbar .at { display: grid; place-items: center; width: 50px; font-size: 22px; font-weight: 600; color: var(--muted); border-right: 1.5px solid var(--line-soft); }
.searchbar input { flex: 1; border: none; outline: none; background: none; font-family: inherit; font-size: 19px; font-weight: 500; padding: 16px 14px; color: var(--ink); min-width: 0; }
.searchbar input::placeholder { color: #b3b2ac; }
.searchbar button { border: none; cursor: pointer; background: var(--ink); color: #fff; font-family: inherit; font-size: 16px; font-weight: 600; padding: 0 26px; display: inline-flex; align-items: center; gap: 8px; transition: background .15s; }
.searchbar button:hover { background: var(--accent); }
.searchbar button:disabled { opacity: .55; cursor: default; }

.examples { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.examples-label { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.chip { font-family: inherit; cursor: pointer; background: none; border: 1.5px solid var(--line-soft); color: var(--ink-2); font-size: 13px; font-weight: 500; padding: 6px 12px; transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }

/* ---- tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 1.5px solid var(--line); margin-top: 4px; flex-wrap: wrap; }
.tab { font-family: inherit; cursor: pointer; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-size: 15px; font-weight: 600; padding: 18px 22px 15px; text-decoration: none; transition: color .15s, border-color .15s; display: inline-flex; align-items: center; gap: 7px; margin-bottom: -1.5px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-live { margin-left: auto; color: var(--accent); }
.tab-live:hover { color: #fff; background: var(--accent); }

/* ---- loader / error / empty ---- */
.loader { display: flex; align-items: center; gap: 14px; color: var(--muted); margin-top: 50px; font-size: 15px; font-weight: 500; }
.spin { width: 20px; height: 20px; border: 2.5px solid var(--line-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Richer page loader: three equalizer bars pulsing, matching the live theme.
   Used while a screen's covers are being preloaded before reveal. */
#loader.loader { gap: 16px; }
.loader-eq { display: inline-flex; align-items: flex-end; gap: 4px; height: 26px; }
.loader-eq i { width: 5px; height: 100%; background: var(--accent); border-radius: 2px; transform-origin: bottom; animation: loadeq 1s ease-in-out infinite; }
.loader-eq i:nth-child(2){ animation-delay: .15s; background: var(--ink); }
.loader-eq i:nth-child(3){ animation-delay: .3s; }
.loader-eq i:nth-child(4){ animation-delay: .45s; background: var(--ink); }
@keyframes loadeq { 0%,100%{ transform: scaleY(.3); } 50%{ transform: scaleY(1); } }

/* Dimmed-content + spinner overlay for modal/compare bodies while their covers
   preload. Content stays in place (no layout jump) but is held back visually. */
.detail-loading { position: relative; }
.detail-loading > * { opacity: .25; pointer-events: none; }
.detail-loading::after {
  content: ""; position: absolute; top: 32px; left: 50%; width: 26px; height: 26px;
  margin-left: -13px; border: 3px solid var(--line-soft); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; opacity: 1 !important;
}

/* New images fade in when swapped in after the reveal cap. */
.art.art-fade { animation: artfade .35s ease both; }
@keyframes artfade { from { opacity: 0; } to { opacity: 1; } }

/* Small ⚠ marker pinned to the corner of an image spot that failed to load. */
.art-warn {
  position: absolute; top: 3px; right: 3px; z-index: 2;
  font-size: 11px; line-height: 1; color: #fff;
  background: var(--bad, #e0245e); padding: 2px 3px; border-radius: 3px;
  pointer-events: none; opacity: .92;
}
.error { margin-top: 40px; padding: 20px 22px; border: 1.5px solid var(--bad); color: var(--bad); font-weight: 500; background: #fff; }
.empty { color: var(--muted); font-size: 15px; padding: 6px 0; }
.lead { font-size: clamp(15px, 2vw, 18px); color: var(--ink-2); max-width: 56ch; margin: 0 0 20px; }

/* ============================================================
   Blocks
   ============================================================ */
.block { border-bottom: 1.5px solid var(--line); padding: 46px 0; }
.block:last-child { border-bottom: 0; }
.block-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 28px; }
.block-no { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--accent); flex-shrink: 0; min-width: 22px; }
.block-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.block-note { margin-left: auto; font-size: 13px; color: var(--muted); }
.block-note .ext { color: var(--accent); text-decoration: none; }
.block-note .ext:hover { text-decoration: underline; }

/* ---- identity ---- */
.identity { display: grid; grid-template-columns: 120px 1fr; gap: 28px; align-items: start; }
.identity-avatar { width: 120px; height: 120px; object-fit: cover; border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center; }
.identity-main h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.04; margin: 0; }
.identity-handle { color: var(--muted); font-size: 16px; font-weight: 500; margin-top: 4px; }
.hire { border: 1.5px solid var(--good); color: var(--good); font-size: 12px; font-weight: 600; padding: 1px 8px; vertical-align: middle; }

/* ---- now playing (overview) ---- */
.np { display: flex; align-items: center; gap: 16px; border: 1.5px solid var(--line); background: var(--bg-card); padding: 14px 16px; margin-top: 20px; max-width: 560px; }
.np.np-live { border-color: var(--accent); }
.np .art, .np .art-ph { width: 56px; height: 56px; flex-shrink: 0; }
.np-meta { min-width: 0; flex: 1; }
.np-tag { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.np-live .np-tag { color: var(--accent); }
.np-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-loved { color: var(--accent); font-size: 20px; }
.np-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.35;transform:scale(.7)} }

/* ---- statgrid ---- */
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1.5px solid var(--line); border-left: 1.5px solid var(--line); margin-top: 30px; }
.statgrid .cell { border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); padding: 18px 18px 16px; min-width: 0; }
.statgrid .cell b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.statgrid .cell b.b-text { font-size: 19px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statgrid .cell span { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---- album/artist art ----
   Every art slot — real <img> and the <span> placeholder alike — is a fixed
   square box with cover-fit, so a category's images all read at one size no
   matter what dimensions Last.fm hands back. */
.art, .art-ph { width: 64px; height: 64px; object-fit: cover; border: 1.5px solid var(--line); background: #fff; display: block; flex-shrink: 0; }
.art-ph { display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; font-size: 22px; }

/* ---- card row (top artists/albums) ---- */
.card-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
/* min-width:0 + overflow:hidden stop a wide intrinsic image (or nowrap title)
   from blowing the grid column past its 1fr share — that was making the square
   tiles come out at different widths, hence different heights. */
.tile { text-decoration: none; display: block; min-width: 0; overflow: hidden; }
/* fixed square frame — aspect-ratio:1/1 (with the padding-top:100% fallback for
   old engines) keeps every tile square. The real evenness fix is min-width:0 on
   .card-row's columns and .tile above: without it a wide intrinsic image blew
   the grid column past its 1fr share, so equal-width squares came out unequal. */
.tile-art { display: block; position: relative; width: 100%; aspect-ratio: 1 / 1; background: #fff; border: 1.5px solid var(--line); overflow: hidden; }
.tile-art::before { content: ""; display: block; padding-top: 100%; }
.tile-art .art, .tile-art .art-ph { position: absolute; inset: 0; width: 100% !important; height: 100% !important; min-width: 0; min-height: 0; max-width: none; max-height: none; border: 0; object-fit: cover; font-size: clamp(28px, 5vw, 44px); aspect-ratio: auto !important; }
.tile-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile:hover .tile-title { color: var(--accent); }
.tile-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- ranked list (top tracks) ---- */
.ranklist { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--line); }
.ranklist li { display: grid; grid-template-columns: 30px 44px 1fr 120px auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1.5px solid var(--line-soft); }
.rank-no { font-size: 14px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.ranklist .art, .ranklist .art-ph { width: 44px; height: 44px; }
.rank-meta { min-width: 0; }
.rank-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 8px; background: #e7e6e0; }
.rank-fill { display: block; height: 100%; width: 0; background: var(--ink); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.rank-plays { font-size: 15px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- recent feed ---- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.feed-act { color: var(--ink); font-weight: 600; }
.feed-love { color: var(--accent); }
.feed-when { margin-left: auto; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.feed iconify-icon { color: var(--muted); font-size: 15px; }

/* ============================================================
   Charts
   ============================================================ */
.act-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.act-sub { display: flex; align-items: baseline; gap: 10px; font-size: 15px; font-weight: 700; margin: 0 0 18px; flex-wrap: wrap; }
.act-sub span { font-size: 12px; font-weight: 500; color: var(--muted); }

/* listening clock */
.clock-wrap { display: flex; justify-content: center; }
.clock-wrap svg { width: 100%; max-width: 280px; height: auto; }
.clock-ring { fill: none; stroke: var(--line-soft); stroke-width: 1; }
.clock-spoke { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.clock-spoke.hot { stroke: var(--accent); }
.clock-hub { fill: var(--ink); }
.clock-tick { font-size: 11px; font-weight: 700; fill: var(--muted); }

/* weekday histogram */
.hist { display: flex; align-items: flex-end; gap: 10px; height: 160px; border-bottom: 1.5px solid var(--line); }
.hist .day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; }
.hist .day-bar { width: 100%; background: var(--ink); min-height: 3px; transition: height .7s cubic-bezier(.2,.8,.2,1); }
.hist .day-bar.hot { background: var(--accent); }
.hist .day span { font-size: 12px; font-weight: 700; color: var(--muted); }

/* genre donut */
.donut-wrap { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; }
.donut { width: 200px; height: 200px; transform: rotate(-90deg); }
.donut-seg { transition: stroke-dasharray .8s cubic-bezier(.2,.8,.2,1); }
.donut text { transform: rotate(90deg); transform-origin: 90px 90px; }
.donut-c1 { font-size: 14px; font-weight: 700; fill: var(--ink); }
.donut-c2 { font-size: 13px; font-weight: 600; fill: var(--accent); }
.genre-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; }
.gl { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.gl i { width: 12px; height: 12px; }
.gl b { font-variant-numeric: tabular-nums; }

/* ---- wrap hero ---- */
.tf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.tf-chip { font-family: inherit; cursor: pointer; background: none; border: 1.5px solid var(--line-soft); color: var(--ink-2); font-size: 13px; font-weight: 500; padding: 7px 15px; transition: all .15s; }
.tf-chip:hover { border-color: var(--ink); color: var(--ink); }
.tf-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.wrap-hero { border: 1.5px solid var(--line); background: var(--ink); color: #fff; padding: 40px 36px; }
.wrap-hero-no { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.wrap-hero-title { font-size: clamp(32px, 6vw, 64px); font-weight: 800; letter-spacing: -.04em; line-height: 1; margin: 0; }
.wrap-hero-sub { font-size: 15px; color: #b9b9b9; margin: 16px 0 0; }
.statgrid-text .cell { padding-top: 16px; }
.tf-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }

/* ---- loved grid ---- */
.loved-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1.5px solid var(--line); border-left: 1.5px solid var(--line); }
.loved-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); text-decoration: none; min-width: 0; }
.loved-card .art, .loved-card .art-ph { width: 52px; height: 52px; flex-shrink: 0; }
.loved-meta { min-width: 0; }
.loved-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loved-card:hover .loved-title { color: var(--accent); }
.loved-artist { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loved-when { font-size: 12px; color: var(--accent); margin-top: 2px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 26px; }
.pager-pos { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt { font-family: inherit; cursor: pointer; background: none; border: 1.5px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; padding: 8px 16px; display: inline-flex; align-items: center; gap: 7px; transition: all .15s; }
.opt:hover { background: var(--ink); color: #fff; }

/* ---- compare ---- */
.cmp-score { border: 1.5px solid var(--line); background: var(--bg-card); padding: 32px; text-align: center; }
.cmp-faces { display: flex; align-items: center; justify-content: center; gap: 32px; }
.cmp-face { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cmp-face .art, .cmp-face .art-ph { width: 84px; height: 84px; border-radius: 50%; }
.cmp-face span { font-size: 15px; font-weight: 700; }
.cmp-pct { line-height: 1; }
.cmp-pct b { display: block; font-size: 56px; font-weight: 900; letter-spacing: -.04em; color: var(--accent); }
.cmp-pct small { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cmp-verdict { font-size: clamp(18px, 2.6vw, 26px); font-weight: 700; letter-spacing: -.02em; margin: 24px 0 18px; }
.cmp-meter { height: 10px; background: #e7e6e0; max-width: 420px; margin: 0 auto; }
.cmp-meter-fill { height: 100%; width: 0; background: var(--accent); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.cmp-h { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 36px 0 16px; }
.cmp-bars { display: flex; flex-direction: column; gap: 10px; }
.cmp-bar-row { display: grid; grid-template-columns: 1fr 180px 1fr; align-items: center; gap: 16px; }
.cmp-bar-name { text-align: center; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-bar-side { display: flex; align-items: center; gap: 10px; }
.cmp-bar-side.l { justify-content: flex-end; }
.cmp-bar-side b { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 40px; }
.cmp-bar-side.l b { text-align: left; }
.cmp-bar-side.r b { text-align: right; }
.cmp-bar-fill { height: 12px; width: 0; background: var(--ink); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.cmp-bar-side.l .cmp-bar-fill { background: var(--accent); }
.cmp-only { margin-top: 8px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.notelist { list-style: none; margin: 0; padding: 0; }
.notelist li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.notelist li::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; background: var(--ink); }
.notelist.roast li::before { background: var(--accent); }

/* ---- footer ---- */
.foot { border-top: 1.5px solid var(--line); }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 28px var(--gut); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot-by { font-weight: 600; color: var(--ink-2); }
.foot-by a { color: var(--accent); text-decoration: none; }
.foot-by a:hover { text-decoration: underline; }

/* ============================================================
   LIVE MODE (fullscreen now-playing)
   ============================================================ */
.live-body { background: #000; color: #fff; overflow: hidden; height: 100vh; height: 100dvh; }
.live-bg { position: fixed; inset: -8%; background-size: cover; background-position: center; filter: blur(60px) saturate(1.4) brightness(.6); transform: scale(1.2); transition: background-image .8s ease; z-index: 0; }
.live-scrim { position: fixed; inset: 0; background: radial-gradient(circle at 30% 30%, rgba(0,0,0,.25), rgba(0,0,0,.82)); z-index: 1; }
.live { position: relative; z-index: 2; height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6vh 6vw; }
.live-status { position: fixed; top: 22px; left: 26px; z-index: 3; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.7); display: flex; align-items: center; gap: 9px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }

.live-stage { display: flex; align-items: center; gap: clamp(28px, 5vw, 72px); max-width: 1100px; width: 100%; opacity: 0; }
.live-stage.in { animation: livein .6s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes livein { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
.live-art-wrap { position: relative; flex-shrink: 0; }
.live-art { width: clamp(180px, 34vw, 420px); aspect-ratio: 1; object-fit: cover; box-shadow: 0 30px 80px rgba(0,0,0,.6); border-radius: 4px; }
.live-loved { position: absolute; top: 14px; right: 14px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 3px; }
.live-meta { min-width: 0; }
.live-now { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.live-title { font-size: clamp(34px, 6vw, 84px); font-weight: 800; letter-spacing: -.04em; line-height: 1; margin: 0; }
.live-artist { font-size: clamp(20px, 3vw, 38px); font-weight: 500; letter-spacing: -.02em; margin: 16px 0 0; color: rgba(255,255,255,.86); }
.live-album { font-size: clamp(14px, 1.6vw, 20px); color: rgba(255,255,255,.5); margin-top: 10px; }

/* equaliser */
.live-eq { display: flex; align-items: flex-end; gap: 6px; height: 40px; margin-top: 30px; }
.live-eq i { width: 8px; background: var(--accent); height: 30%; animation: eq 1s ease-in-out infinite; }
.live-eq i:nth-child(2){ animation-delay:.2s } .live-eq i:nth-child(3){ animation-delay:.45s }
.live-eq i:nth-child(4){ animation-delay:.1s } .live-eq i:nth-child(5){ animation-delay:.35s }
@keyframes eq { 0%,100%{ height:25% } 50%{ height:100% } }

/* ---- live progress bar + offset nudge ---- */
.live-progress { margin-top: 28px; max-width: 460px; }
.pb-track { height: 6px; background: rgba(255,255,255,.18); border-radius: 3px; cursor: pointer; overflow: hidden; }
.pb-track:hover { height: 8px; }
.pb-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .25s linear; }
.pb-row { display: flex; align-items: center; gap: 14px; margin-top: 9px; }
.pb-time { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; min-width: 38px; }
.pb-row .pb-time:last-child { text-align: right; margin-left: auto; }
.pb-nudge { display: inline-flex; align-items: center; gap: 8px; }
.pb-btn { width: 26px; height: 26px; border: 1.5px solid rgba(255,255,255,.3); background: rgba(255,255,255,.06); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; border-radius: 4px; transition: all .15s; }
.pb-btn:hover { background: var(--accent); border-color: var(--accent); }
.pb-off { font-size: 12px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; }
/* when the position is an estimate (we never saw the track start), make the
   fill read as provisional and tag it — click the bar to set it exactly. */
.live-progress.estimated .pb-fill { background: repeating-linear-gradient(90deg, var(--accent) 0 8px, rgba(255,59,48,.4) 8px 16px); }
.live-progress.estimated .pb-cur { color: rgba(255,255,255,.55); }
.live-progress.estimated .pb-track::after { content: "estimated — click to set"; position: absolute; font-size: 10px; letter-spacing: .04em; color: rgba(255,255,255,.4); margin-top: 10px; }
.live-progress { position: relative; }

.live-idle { position: relative; z-index: 2; text-align: center; }
.live-idle-mark { width: 88px; height: 88px; margin: 0 auto 24px; background: var(--accent); color: #fff; font-weight: 800; font-size: 34px; display: grid; place-items: center; }
.live-idle p { font-size: 22px; color: rgba(255,255,255,.7); font-weight: 500; }

.live-ctl { position: fixed; z-index: 4; bottom: 22px; width: 42px; height: 42px; border: 1.5px solid rgba(255,255,255,.3); background: rgba(0,0,0,.3); color: #fff; font-size: 18px; cursor: pointer; display: grid; place-items: center; text-decoration: none; transition: all .15s; }
.live-exit { right: 22px; } .live-fs { right: 76px; } .live-ly { right: 130px; }
.live-ctl:hover { background: var(--accent); border-color: var(--accent); }
.live-ly.off { opacity: .45; }

/* ---- live lyrics panel ---- */
.live-lyrics { position: relative; z-index: 2; width: 100%; max-width: 760px; margin: clamp(24px, 4vh, 48px) auto 0; text-align: center; }
.live-lyrics-tag { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.45); margin-bottom: 14px; }
.live-lyrics-body { max-height: 34vh; overflow-y: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent); padding: 6vh 0; }
.live-lyrics-body::-webkit-scrollbar { display: none; }
.ly-line { font-size: clamp(17px, 2.3vw, 26px); font-weight: 600; letter-spacing: -.01em; line-height: 1.5; padding: 5px 0; transition: color .3s, opacity .3s, transform .3s; }
/* plain lyrics: steady, readable */
.live-lyrics.plain .ly-line { color: rgba(255,255,255,.78); }
.live-lyrics.plain .ly-inst { color: rgba(255,255,255,.4); font-style: italic; }
/* synced lyrics: dim upcoming, fade past, spotlight the active line */
.live-lyrics.synced .ly-line { color: rgba(255,255,255,.3); }
.live-lyrics.synced .ly-line.past { color: rgba(255,255,255,.22); }
.live-lyrics.synced .ly-line.on { color: #fff; transform: scale(1.04); text-shadow: 0 2px 24px rgba(0,0,0,.5); }
.live-empty { height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: #fff; }
.live-empty form { display: flex; gap: 10px; }
.live-empty input { font-family: inherit; font-size: 18px; padding: 12px 16px; border: 1.5px solid #fff; background: #000; color: #fff; }
.live-empty button { font-family: inherit; font-size: 16px; font-weight: 600; padding: 12px 22px; background: var(--accent); color: #fff; border: none; cursor: pointer; }

/* ============================================================
   Detail overlay (drill into album / artist / track)
   ============================================================ */
.tile[role="button"], .rl-row[role="button"], .tl-row[role="button"] { cursor: pointer; }
.rl-row:hover .rank-title, .tl-row:hover .tl-name { color: var(--accent); }
.rank-sub[data-artistlink] { cursor: pointer; }
.rank-sub[data-artistlink]:hover { color: var(--accent); text-decoration: underline; }
.rl-art .art, .rl-art .art-ph { width: 44px; height: 44px; }

body.detail-open { overflow: hidden; }
/* desktop: vertically centred with a slight top/bottom breathing offset */
.detail { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: center; padding: 4vh 16px; }
.detail[hidden] { display: none !important; }
.detail-scrim { position: absolute; inset: 0; background: rgba(10,10,10,.55); backdrop-filter: blur(3px); }
.detail-panel { position: relative; z-index: 1; background: var(--bg); width: min(760px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: 0 30px 90px rgba(0,0,0,.4); border: 1.5px solid var(--line); animation: detailin .25s cubic-bezier(.2,.8,.2,1); }
@keyframes detailin { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-close { position: sticky; top: 0; float: right; margin: 14px 14px 0 0; width: 38px; height: 38px; border: 1.5px solid var(--line); background: var(--bg-card); color: var(--ink); font-size: 16px; cursor: pointer; z-index: 2; transition: all .15s; }
.detail-close:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.detail-body { padding: 30px 34px 48px; }

.detail-head { display: grid; grid-template-columns: 130px 1fr; gap: 24px; align-items: start; padding-bottom: 26px; border-bottom: 1.5px solid var(--line); }
.detail-art { display: block; width: 130px; height: 130px; }
.detail-art .art, .detail-art .art-ph { width: 130px; height: 130px; }
.detail-artist .detail-art, .detail-artist .detail-art .art, .detail-artist .detail-art .art-ph { border-radius: 50%; }
.detail-kind { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.detail-title { font-size: clamp(24px, 4vw, 38px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0 0; }
.detail-sub { font-size: 15px; color: var(--ink-2); margin-top: 8px; }
.detail-link { cursor: pointer; font-weight: 600; }
.detail-link:hover { color: var(--accent); text-decoration: underline; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.detail-ext { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; margin-top: 14px; }
.detail-ext:hover { text-decoration: underline; }

.detail-stats { display: grid; grid-template-columns: repeat(2, 1fr); border-left: 1.5px solid var(--line); }
.detail-stats .ds { border-right: 1.5px solid var(--line); border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); padding: 13px 15px; min-width: 0; }
/* Fluid size so six-figure counts (e.g. 679,850 scrobbles) fit the narrow
   two-up cells instead of being clipped to "679,…". */
.detail-stats .ds b { display: block; font-size: clamp(15px, 2.4vw, 24px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-stats .ds span { display: block; margin-top: 7px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* three grouped stat blocks: You / Average listener / General */
.stat-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 26px 0; }
.stat-group-h { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.stat-group:nth-child(2) .stat-group-h { color: var(--ink-2); }
.stat-group:nth-child(3) .stat-group-h { color: var(--muted); }

.detail-sortbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.sortbtn { font-family: inherit; cursor: pointer; background: none; border: 1.5px solid var(--line-soft); color: var(--ink-2); font-size: 12.5px; font-weight: 600; padding: 6px 13px; transition: all .15s; }
.sortbtn:hover { border-color: var(--ink); }
.sortbtn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.tracklist { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1.5px solid var(--line); }
.tl-row { display: grid; grid-template-columns: 30px 1fr 130px auto; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1.5px solid var(--line-soft); cursor: pointer; }
.tl-rank { font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.tl-meta { min-width: 0; }
.tl-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-dur { font-size: 12px; color: var(--muted); }
.tl-bar { height: 8px; background: #e7e6e0; }
.tl-fill { display: block; height: 100%; background: var(--ink); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.tl-row:hover .tl-fill { background: var(--accent); }
.tl-plays { font-size: 15px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; min-width: 44px; }
.tl-global { color: var(--ink-2); font-weight: 600; }
.detail-h { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 30px 0 16px; }
.detail-bio { font-size: 15px; line-height: 1.6; color: var(--ink-2); margin: 22px 0 0; }
.detail-albums { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .stat-groups { grid-template-columns: 1fr; gap: 14px; }
  .detail-albums { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  :root { --gut: 20px; }
  .act-cols, .cols-2, .donut-wrap { grid-template-columns: 1fr; gap: 30px; }
  .card-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ranklist li { grid-template-columns: 26px 40px 1fr auto; }
  .rank-bar { display: none; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; }
  .tab-live { margin-left: 0; }
}
@media (max-width: 600px) {
  .masthead { padding: 44px 0 36px; }
  .brand-sub { display: none; }
  .tab { padding: 13px 13px 10px; font-size: 14px; }
  .identity { grid-template-columns: 76px 1fr; gap: 18px; }
  .identity-avatar, .identity-avatar .art, .identity-avatar .art-ph { width: 76px; height: 76px; }
  .statgrid, .card-row, .loved-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .np { flex-wrap: wrap; }
  .cmp-bar-row { grid-template-columns: 1fr 78px 1fr; gap: 8px; }
  .cmp-faces { gap: 16px; flex-wrap: wrap; }
  .cmp-face .art, .cmp-face .art-ph { width: 64px; height: 64px; }
  .tl-row { grid-template-columns: 26px 1fr auto; }
  .tl-bar { display: none; }
  .detail-head { grid-template-columns: 84px 1fr; gap: 16px; }
  .detail-art, .detail-art .art, .detail-art .art-ph { width: 84px; height: 84px; }
  .detail-albums { grid-template-columns: repeat(2, 1fr); }
  /* live mode stacks; lyrics + progress stay readable */
  .live { padding: 8vh 6vw 4vh; }
  .live-stage { flex-direction: column; text-align: center; gap: 22px; }
  .live-meta { width: 100%; }
  .live-progress { margin-left: auto; margin-right: auto; }
  .live-eq { justify-content: center; }
  /* detail modal becomes a true fullscreen sheet on phones */
  .detail { padding: 0; align-items: stretch; }
  .detail-panel { width: 100%; max-height: 100vh; max-height: 100dvh; height: 100vh; height: 100dvh; border: 0; }
  .detail-body { padding: 22px 18px 40px; }
}
@media (max-width: 380px) {
  .statgrid, .card-row, .loved-grid, .detail-albums { grid-template-columns: 1fr 1fr; }
  .detail-stats { grid-template-columns: 1fr 1fr; }
  .masthead-title { font-size: clamp(32px, 12vw, 48px); }
}
