/* Plain archive: one grotesk, ink on white (or light on near-black), hairlines, one deep-purple accent.
   Besides the accent, league colours are the only hue on the page. */

@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/hanken-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --sidebar: #ffffff;
  --label: #141414;
  --label-2: #5c5c5c;
  --label-3: #6e6e6e;
  --separator: rgba(0, 0, 0, 0.09);
  --border: rgba(0, 0, 0, 0.2);
  --underline: rgba(0, 0, 0, 0.28);
  --fill: rgba(0, 0, 0, 0.04);
  --fill-hover: rgba(0, 0, 0, 0.07);
  --accent: #6d28d9;
  --accent-text: #6d28d9;
  --on-accent: #ffffff;
  --accent-soft: rgba(109, 40, 217, 0.14);
  --chart-muted: #8f8f8f;
  --radius: 8px;
  --sidebar-w: 248px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --bg-elevated: #1c1c1c;
    --sidebar: #121212;
    --label: #ededed;
    --label-2: #a3a3a3;
    --label-3: #8a8a8a;
    --separator: rgba(255, 255, 255, 0.11);
    --border: rgba(255, 255, 255, 0.22);
    --underline: rgba(255, 255, 255, 0.35);
    --fill: rgba(255, 255, 255, 0.05);
    --fill-hover: rgba(255, 255, 255, 0.09);
    --accent: #a78bfa;
    --accent-text: #b9a3fb;
    --on-accent: #121212;
    --accent-soft: rgba(167, 139, 250, 0.2);
    --chart-muted: #6b6b6b;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--fill-hover) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 15px/1.45 "Hanken Grotesk", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
}

::selection { background: var(--accent-soft); color: inherit; }

/* Inline links: accent text with a soft underline. Block links (rows, nav, buttons) stay ink with no underline. */
a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-text) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-color: currentColor; }
.list-row, .nav a, .tabbar a, .brand, .btn, .chip, .crumb, .stat-title a, .rank-list a, .vote-name { text-decoration: none; }
.list-row, .nav a, .tabbar a, .brand, .stat-title a, .rank-list a, .vote-name { color: var(--label); }
.stat-title a:hover, .rank-list a:hover, .vote-name:hover, .crumb:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

button { font: inherit; color: inherit; }

.num { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

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

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 12px 16px;
  background: var(--sidebar);
  border-right: 1px solid var(--separator);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
  color: var(--label);
}
.brand:hover { text-decoration: none; }

.brand-text { display: grid; gap: 2px; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.brand-sub { font-size: 13px; color: var(--label-2); }

.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--label);
  font-size: 14px;
  font-weight: 500;
}
.nav a:hover { background: var(--fill); }
.nav a[aria-current="page"] { font-weight: 700; }
.nav svg { width: 20px; height: 20px; color: var(--label-2); flex: none; }
.nav a[aria-current="page"] svg { color: var(--accent); }

.sidebar-foot {
  margin: auto 10px 0;
  line-height: 1.5;
  font-size: 12px;
  color: var(--label-3);
}

.main {
  min-width: 0;
  padding: 36px clamp(20px, 4vw, 48px) 64px;
  outline: none;
}

.page { max-width: 1120px; }

.tabbar { display: none; }

/* ---------- Page headers ---------- */

.page-head { margin-bottom: 20px; }

.title {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--label-2);
  font-size: 15px;
  max-width: 68ch;
  text-wrap: pretty;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
}
.crumb svg { width: 16px; height: 16px; }

.section { margin-top: 36px; }
.section:first-child { margin-top: 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  row-gap: 2px;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--separator);
}

.section-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-meta { font-size: 13px; color: var(--label-2); white-space: nowrap; }

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

.search {
  position: relative;
  max-width: 680px;
  margin-top: 16px;
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--label-2);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--label);
  font: inherit;
  font-size: 17px;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.search input::placeholder { color: var(--label-2); }
.search input:hover { border-color: var(--label-3); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.search input::-webkit-search-cancel-button { display: none; }

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--label-2);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.search-clear svg { position: static; transform: none; width: 18px; height: 18px; }
.search-clear:hover { color: var(--label); }
.search-clear[hidden] { display: none; }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  margin: -2px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--label);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { background: var(--fill); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--league); }

.select {
  position: relative;
  display: inline-flex;
}
.select select {
  appearance: none;
  height: 30px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--label);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.select select:hover { background: var(--fill); }
/* The native option list inherits the select's translucent or inverted fill, so give it solid colours. */
.select option { background: var(--bg-elevated); color: var(--label); }
.select.is-set select { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.select svg {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}
.select.is-set svg { color: var(--on-accent); }

.result-note {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--label-2);
}

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

.art {
  --size: 44px;
  width: var(--size);
  height: var(--size);
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: var(--league, #6b6b6b);
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--size) * 0.36);
  letter-spacing: -0.02em;
  user-select: none;
}
.art.xl { --size: 160px; font-size: 44px; }
.art.lg { --size: 72px; }

.avatar {
  --size: 36px;
  width: var(--size);
  height: var(--size);
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--label);
  font-weight: 600;
  font-size: calc(var(--size) * 0.4);
  user-select: none;
}
.avatar.xl { --size: 140px; }

/* ---------- Song list ---------- */

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

.songs-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  box-shadow: 0 1px 0 var(--separator);
  margin-bottom: 4px;
  padding-top: 6px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, 150px) minmax(0, 170px) 64px;
  gap: 14px;
  padding: 0 12px 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--label-3);
}
.songs-head span:last-child { text-align: right; }
.repeat .songs-head { display: none; }

.nw { white-space: nowrap; }

.songs > .song + .song > .song-row { box-shadow: 0 -1px 0 var(--separator); }

.song-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, 150px) minmax(0, 170px) 64px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 7px 12px 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.song-row:hover { background: var(--fill); }
.song.open > .song-row { background: var(--fill-hover); border-radius: 6px 6px 0 0; }

.song-main { min-width: 0; }
.song-sub, .list-title, .list-sub, .list-desc, .song-pts > span { display: block; }

.song-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
}
.song-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.song-sub {
  margin-top: 1px;
  font-size: 13px;
  color: var(--label-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-who, .song-where {
  font-size: 13px;
  color: var(--label-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.song-who { color: var(--label); }

.song-where { display: flex; align-items: center; gap: 6px; }
.song-where .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--league); flex: none; }

.song-pts {
  text-align: right;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
}
.song-pts small { display: block; font-size: 11px; font-weight: 500; color: var(--label-2); }
.song-pts .win { font-weight: 800; color: var(--accent-text); }
.song-pts .win + small { color: var(--accent-text); font-weight: 700; }

.badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--label-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge svg { width: 11px; height: 11px; }

.hidden-flag { color: var(--label-3); font-size: 11px; font-weight: 500; }

/* Expanding detail: height animates via grid rows, content stays visible when open. */
.song-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s var(--ease-out);
}
.song.open > .song-detail { grid-template-rows: 1fr; }
.song-detail > div { overflow: hidden; min-height: 0; }

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 20px 32px;
  margin: 0 0 10px;
  padding: 16px 20px 18px 66px;
  border-radius: 0 0 6px 6px;
  background: var(--fill);
}

.detail-col h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
}

.quote {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.quote cite { display: block; margin-top: 4px; font-style: normal; font-size: 13px; color: var(--label-2); }

.facts { margin: 0 0 14px; display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 13px; }
.facts dt { color: var(--label-2); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn svg { width: 14px; height: 14px; }

.votes { list-style: none; margin: 0; padding: 0; }
.vote {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding: 7px 0;
  border-top: 1px solid var(--separator);
  font-size: 13px;
}
.vote:first-child { border-top: 0; padding-top: 0; }
.vote-name { font-weight: 600; color: var(--label); }
.vote-pts { font-weight: 600; text-align: right; }
.vote-pts.zero { font-weight: 500; color: var(--label-3); }
.vote-pts.neg { color: var(--label); }
.vote-comment { grid-column: 1 / -1; color: var(--label-2); white-space: pre-wrap; overflow-wrap: anywhere; }

.also { list-style: none; margin: 0 0 14px; padding: 0; font-size: 13px; }
.also li { padding: 3px 0; }

.more {
  display: block;
  margin: 12px auto 0;
}

/* ---------- Grouped lists (players, leagues, rounds) ---------- */

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

.list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 8px;
  border-radius: 6px;
  color: var(--label);
}
.list-row:hover { background: var(--fill); }
.list > li + li > .list-row { box-shadow: 0 -1px 0 var(--separator); }
.list > li + li > .list-row:hover { box-shadow: none; }

.list-main { min-width: 0; }
.list-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { margin-top: 1px; font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-desc { margin-top: 3px; font-size: 13px; color: var(--label-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.list-end {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--label-2);
  font-size: 13px;
  text-align: right;
}
.list-end strong { display: block; color: var(--label); font-size: 15px; font-weight: 600; }
.list-end svg { width: 14px; height: 14px; color: var(--label-3); }

.stat-col { min-width: 56px; }

/* ---------- Hero blocks for player / league / round pages ---------- */

.hero {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 32px;
}
.hero-text { min-width: 0; }
.hero .title { font-size: clamp(30px, 4vw, 44px); }
.hero-line {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--label-2);
}
.hero-line b { color: var(--label); font-weight: 600; }
.hero-desc { margin: 10px 0 0; font-size: 15px; max-width: 68ch; white-space: pre-wrap; text-wrap: pretty; }
.hero .actions { margin-top: 16px; }

.split {
  display: grid;
  /* Two columns only when each can hold a readable row (about 360px); otherwise one. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 36px 40px;
}
.section + .split { margin-top: 44px; }
.split > .section { margin-top: 0; }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li {
  display: grid;
  grid-template-columns: 28px 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--separator);
  font-size: 14px;
}
.rank-list .pos { color: var(--label-3); font-weight: 600; text-align: right; }
.rank-list .avatar { --size: 32px; }
.rank-list a { color: var(--label); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .val { font-weight: 600; }
.rank-list .val small { color: var(--label-2); font-weight: 500; }

/* ---------- Fun stats ---------- */

.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li {
  display: grid;
  grid-template-columns: 28px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--separator);
}
.stat-list .pos { color: var(--label-3); font-weight: 600; font-size: 13px; text-align: right; }
.stat-main { min-width: 0; }
.stat-title, .stat-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-title { font-size: 15px; font-weight: 600; }
.stat-title a { color: var(--label); }
.stat-sub { margin-top: 1px; font-size: 13px; color: var(--label-2); }
/* Grey links in stat sub-lines keep a faint underline so they read as links without shouting. */
.stat-sub a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.stat-sub a:hover { color: var(--label); text-decoration-color: currentColor; }
.stat-list .val { font-size: 15px; font-weight: 600; text-align: right; white-space: nowrap; }
.stat-list .val small { font-size: 13px; font-weight: 500; color: var(--label-2); }
.art.sm, .avatar.sm { --size: 36px; }

.see-all {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.see-all svg { width: 14px; height: 14px; }
.see-all:hover { text-decoration: underline; }
.stat-full { max-width: 760px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--label-2);
  cursor: pointer;
}
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }


.chart { margin: 0; max-width: 760px; }

.dev { --plot-h: 190px; }
.dev-plot {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: var(--plot-h);
  margin-left: 64px;
  margin-top: 8px;
}
.dev-base {
  position: absolute;
  left: -4px;
  right: 0;
  bottom: var(--zero);
  height: 1px;
  background: var(--separator);
}
.dev-base span {
  position: absolute;
  right: calc(100% + 8px);
  bottom: -7px;
  width: 56px;
  line-height: 1.1;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  color: var(--label-2);
}
.dev-col { position: relative; outline-offset: -2px; }
.dev-col:hover { background: var(--fill); border-radius: 6px; }
.dev-bar {
  position: absolute;
  left: 50%;
  width: 24px;
  height: var(--h);
  transform: translateX(-50%);
  background: var(--chart-muted);
}
.dev-bar.pos { bottom: var(--zero); border-radius: 4px 4px 0 0; }
.dev-bar.neg { top: calc(100% - var(--zero)); border-radius: 0 0 4px 4px; }
.dev-bar.hl { background: var(--accent); }
.dev-value {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dev-value.pos { bottom: calc(var(--zero) + var(--h) + 4px); }
.dev-value.neg { top: calc(100% - var(--zero) + var(--h) + 4px); }
.dev-tip {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  width: max-content;
  max-width: 200px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--separator);
  font-size: 13px;
  color: var(--label-2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}
.dev-tip b { display: block; color: var(--label); font-weight: 600; }
.dev-col:hover .dev-tip, .dev-col:focus .dev-tip { opacity: 1; transform: translate(-50%, 0); }
.dev-col:first-child .dev-tip { left: 0; transform: none; }
.dev-col:last-child .dev-tip { left: auto; right: 0; transform: none; }
.dev-x {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 8px 0 0 64px;
  font-size: 11px;
  font-weight: 600;
  color: var(--label-2);
  text-align: center;
}
.chart-finding { margin: 16px 0 4px; font-size: 17px; font-weight: 600; }
.chart-note { margin: 0; font-size: 13px; color: var(--label-2); max-width: 68ch; text-wrap: pretty; }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  cursor: pointer;
  color: var(--accent-text);
  font-weight: 600;
}
.chart-table summary::-webkit-details-marker { display: none; }
.chart-table summary svg { width: 14px; height: 14px; transition: transform 0.2s var(--ease-out); }
.chart-table[open] summary svg { transform: rotate(90deg); }
.chart-table table { margin-top: 8px; border-collapse: collapse; }
.chart-table th, .chart-table td { padding: 4px 16px 4px 0; text-align: left; border-bottom: 1px solid var(--separator); }
.chart-table thead th { color: var(--label-2); font-weight: 600; }
.chart-table th[scope="row"] { font-weight: 500; }

/* ---------- Repeats ---------- */

.repeat {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--separator);
}
.repeat-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.repeat-head .list-title { font-size: 17px; }
.repeat-count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  white-space: nowrap;
}
.repeat .songs { margin-left: 58px; }
.repeat .song-row { grid-template-columns: minmax(0, 1fr) minmax(0, 170px) 64px; }
.repeat .detail-body { padding-left: 20px; }

/* ---------- Empty states ---------- */

.empty {
  max-width: 460px;
  margin: 56px auto;
  text-align: center;
}
.empty svg { width: 44px; height: 44px; color: var(--label-3); }
.empty h2 { margin: 12px 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.empty p { margin: 0; color: var(--label-2); text-wrap: pretty; }

/* ---------- Phone ---------- */

@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }

  .main { padding: 20px 16px calc(92px + env(safe-area-inset-bottom)); }

  .title { font-size: 32px; }

  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--separator);
  }
  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 4px 0;
    color: var(--label-3);
    font-size: 10px;
    font-weight: 500;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--accent-text); }
  .tabbar a[aria-current="page"] svg { color: var(--accent); }
  .tabbar svg { width: 26px; height: 26px; }

  .search { max-width: none; }
  .filters { display: grid; gap: 10px; }
  .filters .chips {
    margin-right: -16px;
    padding-right: 16px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .filters .select { justify-self: start; }
  .songs-head { display: none; }

  .song-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 8px 6px;
  }
  .song-who, .song-where { display: none; }
  .song-sub.where-line { display: block; }
  .songs > .song + .song > .song-row { box-shadow: 0 -1px 0 var(--separator); border-radius: 0; }
  .song.open > .song-row { border-radius: 6px 6px 0 0; }

  .detail-body { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 16px; }

  .list-end .stat-col.optional { display: none; }

  .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .art.xl { --size: 120px; font-size: 36px; }
  .avatar.xl { --size: 104px; }

  .split { grid-template-columns: minmax(0, 1fr); }

  .repeat .songs { margin-left: 0; }
  .repeat .song-row { grid-template-columns: minmax(0, 1fr) auto; }
}

/* Tablet: the sidebar stays, but song rows use the compact phone layout so titles keep their room. */
@media (min-width: 761px) and (max-width: 1024px) {
  .songs-head { display: none; }
  .song-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .song-who, .song-where { display: none; }
  .song-sub.where-line { display: block; }
  .repeat .song-row { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (min-width: 1025px) {
  .song-sub.where-line { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
