:root {
  font-size: 16px;
  --danger: #ffb3aa;
}
:root[data-theme="light"] {
  --danger: #a12620;
}
html {
  scroll-behavior: smooth;
}
.brand img {
  width: 40px;
  height: 40px;
}
.brand {
  font-size: 23px;
  gap: 10px;
  letter-spacing: -0.7px;
}
.brand span {
  font-size: 22px;
  font-weight: 750;
}
aside {
  width: 242px;
  padding: 28px 18px;
}
main {
  margin-left: 242px;
  padding: 36px 40px;
  max-width: 1700px;
}
nav {
  margin-top: 16px;
}
nav button {
  font-size: 14px;
  min-height: 46px;
}
button,
input,
select {
  font-size: 14px;
}
button:not(.item-main) {
  min-height: 44px;
}
h1 {
  font-size: clamp(36px, 4.3vw, 62px);
  letter-spacing: -2px;
}
h2 {
  font-size: clamp(26px, 3vw, 38px);
}
h3 {
  font-size: 19px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.3px;
}
.muted,
small {
  color: var(--muted);
}
header p,
.settings-intro p,
.panel p {
  font-size: 14px;
}
.header-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}
#connection {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
#connection button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.badge {
  color: var(--accentInk);
  font-size: 14px;
}
.primary {
  font-size: 14px;
  padding: 12px 20px;
}
#status:empty {
  display: none;
}
#status {
  margin: 16px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  background: var(--surface);
}
.error,
.danger {
  color: var(--danger) !important;
}
#status.error {
  border-color: var(--danger);
  border-left-width: 4px;
}
.operation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface2);
  padding: 16px;
  border-radius: 12px;
  margin: 16px 0;
}
.operation button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 16px;
}
#welcome,
.era-story {
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(
      ellipse at top right,
      color-mix(in srgb, var(--accent) 5%, transparent),
      transparent 60%
    ),
    var(--surface2);
  margin: 12px 0 28px;
}
.era-story h2 {
  line-height: 1.16;
  margin: 12px 0;
}
.era-story p {
  max-width: 650px;
}
.era-story button:not(.primary),
#welcome button:not(.primary) {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 8px;
}
.era-pills {
  display: flex;
  flex-wrap: wrap;
  margin-top: 20px;
}
.era-pills button {
  margin: 4px !important;
}
.toolbar {
  flex-wrap: wrap;
  gap: 18px;
}
.filters {
  flex-wrap: wrap;
  align-items: end;
}
.filters label {
  font-size: 13px;
}
input,
select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  max-width: 100%;
}
.date-filter {
  position: relative;
}
.date-filter[open] {
  padding: 8px;
  background: var(--surface2);
  border-radius: 10px;
}
.date-filter label {
  display: inline-grid;
}
.grid {
  gap: 20px;
}
.panel {
  padding: 24px;
  margin-bottom: 20px;
}
.panel h3 {
  margin-bottom: 15px;
}
.item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}
.item-main {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  border-radius: 8px;
}
.item-main:hover b {
  color: var(--accentInk);
}
.row-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.row-info b {
  font-size: 15px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.row-info small {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.rank {
  font-size: 13px;
  min-width: 22px;
}
.value {
  font-size: 14px;
  white-space: nowrap;
}
.value small {
  display: block;
  font-size: 12px;
}
.avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface2);
  font-size: 24px;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.artist-avatar {
  border-radius: 50%;
}
.avatar {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 6%, var(--surface2)),
    var(--surface2)
  );
  border: 1px solid var(--line);
  color: var(--muted);
  position: relative;
}
.art-placeholder {
  width: 82%;
  height: 82%;
}
.artist-avatar[data-art-kind="cover"] {
  border-radius: 10px;
}
.avatar img {
  display: block;
  object-fit: contain;
}
.art-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent,
    color-mix(in srgb, var(--text) 8%, transparent),
    transparent
  );
  transform: translateX(-100%);
  animation: artwork-shimmer 1.4s ease-in-out infinite;
}
@keyframes artwork-shimmer {
  to {
    transform: translateX(100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .art-loading::after {
    animation: none;
    transform: none;
  }
}
.artwork-context {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 16px;
}
.artwork-context button {
  color: var(--accentInk);
  padding: 3px 0;
  text-decoration: underline;
}
.spotify-link.era-art-link {
  width: auto;
  float: right;
  margin: 0 0 18px 24px;
}
.era-art {
  width: 112px;
  height: 112px;
}
@media (max-width: 600px) {
  .era-art-link {
    margin-left: 12px;
  }
  .era-art {
    width: 72px;
    height: 72px;
  }
  .artwork-context {
    font-size: 12px;
  }
}
.hero-art {
  width: 104px;
  height: 104px;
  flex-basis: 104px;
  font-size: 50px;
}
.artist-identity h2 {
  margin-bottom: 12px;
}
.artist-identity {
  gap: 24px;
}
.artist-tabs {
  display: flex;
  gap: 10px;
  margin: 24px 0;
}
.artist-tabs button {
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
}
.artist-tabs button.active {
  background: var(--action);
  color: var(--actionText);
}
.spotify-link {
  font-size: 20px;
  width: 32px;
  min-height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.stat strong {
  font-size: 25px;
}
.summary-stats {
  margin: 24px 0;
  border-top: 1px solid var(--line);
}
summary {
  font-size: 14px;
}
.insight-grid strong {
  font-size: 24px;
}
.insight-grid p {
  font-size: 14px;
}
.month-list {
  display: grid;
  gap: 9px;
}
.month-bar {
  display: grid;
  grid-template-columns: 90px 1fr 90px;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-radius: 8px;
  min-height: 38px !important;
}
.month-bar:hover {
  background: var(--surface2);
}
.month-bar i {
  display: block;
  min-height: 9px;
  border-radius: 10px;
  background: var(--dataFill);
  width: var(--width);
}
.month-bar small {
  text-align: right;
  font-size: 13px;
}
.guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.guide article {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.guide b {
  color: var(--accentInk);
}
.guide h3 {
  margin: 20px 0 10px;
}
.guide p {
  font-size: 14px;
}
.guide button,
.panel > button,
.playlist-actions button:not(.primary) {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 16px;
  margin: 8px 8px 8px 0;
}
.playlist-actions p,
.playlist-actions small {
  font-size: 14px;
}
.playlist-actions {
  align-items: start;
}
.search-box {
  margin: 18px 0;
}
#search {
  width: 100%;
  font-size: 16px;
}
footer,
footer a,
.aside-bottom {
  font-size: 13px;
}
.pagination {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.pagination button {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.table-scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  font-size: 14px;
  width: 100%;
}
th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
caption {
  text-align: left;
  padding: 14px 0;
}
.heatmap > span {
  font-size: 11px;
}
.heatmap {
  min-width: 550px;
}
.heat-cell {
  height: 25px;
}
dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  max-width: min(640px, calc(100vw - 30px));
  padding: 30px;
  max-height: 85vh;
  overflow: auto;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #0009;
}
dialog p {
  font-size: 15px;
}
dialog button {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 12px 8px 0 0;
}
dialog label {
  display: block;
  margin: 16px 0;
}
dialog input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  margin-top: 8px;
}
#report-image img {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
}
.settings-intro ~ .grid button {
  font-size: 14px;
}
.settings-intro ~ .grid a {
  display: inline-block;
  margin: 10px 0;
}
.setting-row {
  font-size: 14px;
}
.empty,
.empty p {
  font-size: 15px;
}
.legal {
  max-width: 850px;
  margin: 40px auto;
  padding: 30px;
}
.legal main {
  margin: 0;
  padding: 0;
}
.legal h1 {
  font-size: 36px;
}
.legal p {
  font-size: 16px;
}
.legal aside {
  display: none;
}
@media (max-width: 1100px) {
  aside {
    width: 205px;
  }
  main {
    margin-left: 205px;
    padding: 28px;
  }
  .grid,
  .guide {
    grid-template-columns: 1fr;
  }
  .header-actions {
    justify-items: start;
  }
  .insight-grid {
    gap: 10px;
  }
  .panel {
    padding: 20px;
  }
}
@media (max-width: 760px) {
  aside {
    position: static;
    width: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  nav {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
  }
  nav button {
    font-size: 12px;
    text-align: center;
    padding: 8px 4px;
    min-height: 44px;
    white-space: normal;
  }
  .aside-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0 0;
    padding: 0;
    gap: 10px;
  }
  .aside-bottom p {
    margin: 0;
  }
  main {
    margin: 0;
    padding: 24px 16px;
  }
  header {
    margin-bottom: 20px;
    gap: 16px;
  }
  h1 {
    font-size: 42px;
  }
  .header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .header-actions .primary {
    padding: 11px 16px;
  }
  #connection {
    font-size: 12px;
  }
  #connection button {
    font-size: 12px;
  }
  .era-story,
  #welcome {
    padding: 25px;
  }
  .era-story h2 {
    font-size: 29px;
  }
  .toolbar {
    display: block;
  }
  .toolbar h2 {
    margin-bottom: 16px;
  }
  .filters {
    display: flex;
    gap: 10px;
  }
  .filters label {
    flex: 1;
    min-width: 95px;
  }
  .filters select {
    width: 100%;
    min-width: 0;
    font-size: 14px;
  }
  .date-filter {
    width: 100%;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 18px;
  }
  .insight-grid {
    grid-template-columns: 1fr;
  }
  .insight-grid article {
    padding: 18px;
  }
  .item {
    gap: 7px;
  }
  .item-main {
    gap: 9px;
  }
  .avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
  .rank {
    min-width: 17px;
  }
  .row-info b {
    font-size: 14px;
  }
  .row-info small {
    font-size: 12px;
  }
  .value {
    font-size: 13px;
  }
  .value small {
    font-size: 11px;
  }
  .spotify-link {
    width: 24px;
  }
  .hero-art {
    width: 80px;
    height: 80px;
    flex-basis: 80px;
  }
  .artist-identity {
    gap: 16px;
    align-items: center;
  }
  .artist-identity h2 {
    font-size: 29px;
  }
  .artist-identity p {
    font-size: 14px;
  }
  .artist-tabs button {
    padding: 9px 16px;
  }
  .month-bar {
    grid-template-columns: 75px 1fr 75px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    padding: 15px;
  }
  .stat strong {
    font-size: 20px;
  }
  .guide {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 22px;
  }
  .playlist-actions {
    display: block;
  }
  .playlist-actions small {
    display: block;
  }
  .operation {
    font-size: 14px;
  }
  footer {
    font-size: 12px;
  }
}
@media (max-width: 760px) {
  aside {
    position: relative;
  }
  .aside-bottom p {
    display: none;
  }
  .aside-bottom {
    position: absolute;
    top: 15px;
    right: 18px;
    margin: 0;
    font-size: 12px;
  }
  .has-archive header h1 {
    font-size: 28px;
    letter-spacing: -0.8px;
    margin: 0;
  }
  .has-archive header h1 br {
    display: none;
  }
  .has-archive header .eyebrow {
    display: none;
  }
  .has-archive header > div:first-child {
    width: 100%;
  }
  .has-archive header p {
    font-size: 13px;
  }
  .has-archive header {
    gap: 12px;
  }
  .has-archive .toolbar h2 {
    font-size: 24px;
  }
  .has-archive .era-story {
    padding: 22px;
  }
  .has-archive .era-story h2 {
    font-size: 26px;
  }
  .has-archive .era-pills {
    margin-top: 8px;
  }
  .has-archive .era-pills button {
    padding: 5px 12px;
  }
  .hero-art + .spotify-link {
    margin-left: 6px;
  }
}
#dashboard[aria-busy="true"] #content {
  pointer-events: auto;
  opacity: 0.8;
}
.timeline .month-bar {
  width: 100%;
  grid-template-columns: 80px minmax(0, 1fr) 110px;
}
.timeline .month-bar b {
  font-size: 13px;
  text-align: right;
  font-weight: 500;
}
.timeline .month-bar i {
  max-width: 100%;
  width: auto;
}
.artist-identity .spotify-link {
  display: inline-grid;
  font-size: 16px;
  width: auto;
  padding: 0 8px;
}
.search-head {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 22px 0;
}
.search-head input {
  flex: 1;
  min-width: min(260px, 100%);
}
.search-head label,
.search-head span {
  font-size: 14px;
}
@media (max-width: 760px) {
  .timeline .month-bar {
    grid-template-columns: 72px minmax(0, 1fr) 96px;
  }
  .search-head label {
    width: 100%;
  }
}

.avatar {
  position: relative;
}
.avatar[data-art-kind="portrait"] img {
  object-fit: cover;
}
.cover-badge {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 8px;
  line-height: 12px;
  background: #111c;
  color: white;
}
.hero-art .cover-badge {
  font-size: 10px;
}

.source-switch {
  display: flex;
  gap: 5px;
  margin: 16px 0 22px;
  background: var(--surface);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.source-switch a {
  flex: 1;
  text-align: center;
  padding: 9px 5px;
  font-size: 12px;
  text-decoration: none;
  border-radius: 8px;
  color: var(--muted);
}
.source-switch [aria-current="page"] {
  background: var(--accent);
  color: var(--accentText);
  font-weight: 700;
}
.search-field {
  display: block;
  margin: 20px 0;
  font-size: 13px;
  color: var(--muted);
}
.search-field input {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
}
@media (max-width: 760px) {
  .source-switch {
    margin: 10px 0;
  }
  .filters input[type="date"] {
    max-width: 145px;
  }
}

@media (max-width: 760px) {
  .source-youtube .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 12px;
  }
  .source-youtube .filters label {
    min-width: 0;
  }
  .source-youtube .filters input,
  .source-youtube .filters select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

/* Provider colours sit on neutral surfaces; text uses contrast-safe accents. */
.source-switch [aria-current="page"] {
  background: var(--action);
  color: var(--actionText);
}
.source-switch a:hover {
  background: var(--surface2);
  color: var(--text);
}
.source-switch [aria-current="page"]:hover {
  background: var(--action);
  color: var(--actionText);
}
.primary,
.import-button {
  border-radius: 24px;
  box-shadow: 0 2px 8px #0002;
}
.primary:hover,
.import-button:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 14px #0003;
}
nav button.active {
  background: var(--surface2);
  color: var(--text);
  font-weight: 700;
}
.panel,
.stat {
  box-shadow: var(--shadow);
}
.item-main:hover {
  background: var(--surface2);
}
input:hover,
select:hover {
  border-color: var(--muted);
}
header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.brand img {
  border-radius: 12px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  .art-loading::after {
    display: none;
  }
  button.row:hover {
    padding-left: 0;
  }
}

aside > .eyebrow {
  margin: 16px 12px 12px;
}

@media (min-width: 761px) {
  aside > .brand,
  aside > .eyebrow,
  .source-switch,
  .aside-bottom {
    flex-shrink: 0;
  }
  aside nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    align-content: start;
    gap: 4px;
    margin-top: 12px;
  }
  aside nav button {
    min-height: 44px;
    padding: 11px 15px;
  }
  .aside-bottom {
    margin-top: 16px;
    padding: 12px 11px 0;
  }
  .source-switch {
    margin: 12px 0 0;
  }
  .source-switch a {
    white-space: nowrap;
    font-size: 11px;
  }
}

#status {
  color: var(--text);
}
.source-switch a {
  min-height: 44px;
  display: grid;
  place-items: center;
}
@media (max-width: 760px) {
  nav button.active {
    box-shadow: inset 0 -2px var(--accent);
  }
  nav button {
    overflow-wrap: anywhere;
  }
  .source-youtube nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 360px) {
  .brand span {
    font-size: 18px;
  }
}

/* One shared hierarchy: totals, favourites, rankings, then deeper analysis. */
.has-archive header h1 {
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.14;
  letter-spacing: -0.035em;
  margin: 10px 0;
}
.has-archive header h1 br {
  display: none;
}
.has-archive header {
  gap: 20px;
  align-items: center;
  padding-bottom: 20px;
}
.has-archive header .eyebrow {
  font-size: 11px;
}
.toolbar {
  align-items: center;
  gap: 16px;
}
.rewind-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 22px;
}
.rewind-numbers article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px;
  min-width: 0;
}
.rewind-numbers small {
  display: block;
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
}
.rewind-numbers strong {
  display: block;
  font-size: clamp(23px, 2.3vw, 36px);
  letter-spacing: -0.04em;
  margin: 7px 0;
  line-height: 1.2;
}
.rewind-numbers span {
  font-size: 12px;
  color: var(--muted);
}
.favourites-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.favourite-card {
  display: flex;
  gap: 24px;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--line);
  padding: 26px;
  border-radius: 22px;
  min-width: 0;
}
.favourite-card > div:last-child {
  min-width: 0;
}
.favourite-card h3 {
  font-size: clamp(20px, 2vw, 30px);
  margin: 4px 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.favourite-card p:not(.eyebrow) {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 16px;
}
.favourite-art {
  flex: 0 0 110px;
}
.favourite-art .avatar {
  width: 110px;
  height: 110px;
  border-radius: 16px;
}
.favourite-card .eyebrow {
  font-size: 10px;
}
.top-rankings .panel {
  padding: 24px;
}
.top-rankings .row {
  padding: 12px 0;
}
.top-rankings .row-info b {
  font-size: 14px;
}
.top-rankings .value {
  font-size: 13px;
}
.see-all {
  color: var(--accentInk);
  margin-top: 16px;
  font-weight: 650;
  min-height: 44px;
}
.rewind-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 20px 0;
  font-size: 13px;
}
.deep-heading {
  margin: 36px 0 20px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
/* Shared yearly rewind: compact cards, comparable meters, readable numbers. */
.yearly-timeline {
  margin-top: 24px;
}
.yearly-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.yearly-heading h3 {
  margin: 5px 0 0;
}
.yearly-heading .eyebrow {
  font-size: 10px;
  margin: 0;
}
.timeline-unit {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.timeline-highlight {
  font-size: 13px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface2);
  border-radius: 0 8px 8px 0;
}
.yearly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.yearly-grid .year-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  text-align: left;
  padding: 18px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.year-card:hover {
  border-color: var(--accent);
}
.year-card[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.year-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.year-card-heading b {
  font-size: 15px;
}
.year-card-heading > span {
  font-size: 10px;
  color: var(--muted);
}
.year-card.peak-year .year-card-heading > span {
  color: var(--accentInk);
}
.year-card strong {
  font-size: 23px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.year-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.year-meter {
  height: 6px;
  background: var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.year-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.source-combined .year-meter i {
  background: #aebcc6;
}
@media (max-width: 520px) {
  .yearly-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .yearly-grid .year-card {
    padding: 13px;
    gap: 10px;
  }
  .year-card strong {
    font-size: 19px;
  }
  .yearly-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
.deep-heading h2 {
  font-size: 28px;
  margin: 6px 0;
}
.deep-heading p {
  margin: 4px 0;
}
.compact-attribution {
  font-size: 11px;
  margin-bottom: 14px;
}
.metric-notes {
  margin: 28px 0;
  color: var(--muted);
  font-size: 13px;
}
.combine-link {
  display: block;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.match-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.match-row > div {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.match-row small,
.match-option small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.match-row p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0;
}
.match-row button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 44px;
}
.match-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.match-option:hover {
  background: var(--surface2);
}
.button-link {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
}
.favourite-art .artist-avatar:not([data-art-kind="cover"]) {
  border-radius: 50%;
}
.source-youtube .favourite-art .avatar img,
.source-combined .favourite-art .avatar img {
  object-fit: cover;
}
.rewind-numbers strong {
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .rewind-numbers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rewind-numbers article:first-child {
    grid-column: 1 / -1;
  }
  .rewind-numbers small,
  .rewind-numbers span {
    font-size: 12px;
  }
  .match-row {
    flex-wrap: wrap;
    padding: 14px 0;
  }
  .match-row .avatar {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }
  .match-row > div {
    min-width: 180px;
  }
  .aside-bottom .combine-link {
    display: none;
  }
}
:root[data-provider="combined"] {
  --accent: #1ed760;
  --accentInk: #62e893;
  --accentText: #102419;
  --dataFill: #1ed760;
  --action: #f1f4f2;
  --actionText: #151515;
}
:root[data-provider="combined"][data-theme="light"] {
  --accentInk: #14743a;
  --dataFill: #14743a;
  --action: #202522;
  --actionText: #fff;
}
@media (max-width: 760px) {
  aside {
    padding: 14px 16px 10px;
  }
  aside nav,
  .source-youtube nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    margin-top: 10px;
    padding-bottom: 5px;
  }
  aside nav button {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 44px;
    padding: 9px 14px;
    overflow-wrap: normal;
  }
  .source-switch {
    margin-top: 12px;
    padding: 4px;
  }
  .has-archive header h1 {
    font-size: 24px;
  }
  .has-archive header h1 em {
    display: none;
  }
  .has-archive header {
    margin-bottom: 12px;
    padding-bottom: 16px;
  }
  .source-combined.has-archive .header-actions {
    display: none;
  }
  .toolbar {
    margin: 14px 0 20px;
  }
  .toolbar h2 {
    margin: 0 0 12px;
  }
  .compact-attribution {
    gap: 4px;
    font-size: 11px;
    margin: 0 0 12px;
  }
  .rewind-numbers article {
    padding: 14px;
  }
}
@media (max-width: 1100px) {
  .favourite-card {
    gap: 14px;
    padding: 20px;
  }
  .favourite-art {
    flex-basis: 80px;
  }
  .favourite-art .avatar {
    width: 80px;
    height: 80px;
  }
}
@media (max-width: 760px) {
  .rewind-numbers {
    gap: 8px;
  }
  .rewind-numbers article {
    padding: 14px 10px;
    border-radius: 14px;
  }
  .rewind-numbers strong {
    font-size: 22px;
  }
  .rewind-numbers small,
  .rewind-numbers span {
    font-size: 10px;
  }
  .favourites-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .favourite-art {
    flex-basis: 88px;
  }
  .favourite-art .avatar {
    width: 88px;
    height: 88px;
  }
  .top-rankings .panel {
    padding: 18px;
  }
  .deep-heading {
    margin-top: 44px;
  }
  .rewind-tools {
    flex-wrap: wrap;
  }
  .has-archive header h1 {
    font-size: 28px;
  }
}

/* Paired service colours frame the shared archive; surfaces stay neutral. */

.source-combined .brand b {
  color: var(--text);
}
.source-combined header h1 em {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 12px;
  text-decoration-thickness: 3px;
}
.source-combined header {
  border-image: linear-gradient(
      90deg,
      #1ed760,
      #1ed760 35%,
      #ff454e 65%,
      #ff454e
    )
    1;
}
.source-combined .favourite-card {
  background: var(--surface2);
  border-top: 2px solid #1ed760;
}
.source-combined .favourite-card:nth-child(2) {
  border-top-color: #ff454e;
}
.platform-balance {
  margin: -8px 0 28px;
}
.platform-balance-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}
.platform-balance-labels b {
  color: var(--text);
  margin-left: 6px;
}
.platform-balance-labels span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  background: #1ed760;
}
.platform-balance-labels .youtube-source::before {
  background: #ff454e;
}
.platform-balance-bar {
  appearance: none;
  display: block;
  width: 100%;
  height: 5px;
  margin-top: 10px;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  background: #ff454e;
}
.platform-balance-bar::-webkit-progress-bar {
  background: #ff454e;
}
.platform-balance-bar::-webkit-progress-value {
  background: #1ed760;
}
.platform-balance-bar::-moz-progress-bar {
  background: #1ed760;
}
/* Crop landscape thumbnails in every tile, including rankings and details. */
.avatar img[data-thumbnail] {
  object-fit: cover;
  object-position: center;
}
@media (max-width: 760px) {
  .source-combined header h1 em {
    text-underline-offset: 5px;
  }
}
.platform-counts .spotify-source::before,
.platform-counts .youtube-source::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: 5px;
  background: #1ed760;
}
.platform-counts .youtube-source::before {
  background: #ff454e;
}

.source-combined nav button.active {
  border-left-color: var(--text);
}
.source-combined .see-all,
.source-combined .date-filter summary {
  color: var(--text);
}
:root[data-provider="combined"][data-theme="light"]
  .platform-balance-labels
  .spotify-source::before,
:root[data-provider="combined"][data-theme="light"]
  .platform-counts
  .spotify-source::before {
  background: #14743a;
}
:root[data-provider="combined"][data-theme="light"]
  .platform-balance-labels
  .youtube-source::before,
:root[data-provider="combined"][data-theme="light"]
  .platform-counts
  .youtube-source::before {
  background: #c62233;
}
.platform-balance-bar::-webkit-progress-value {
  border-right: 2px solid var(--surface);
}
:root[data-provider="combined"][data-theme="light"] .platform-balance-bar,
:root[data-provider="combined"][data-theme="light"]
  .platform-balance-bar::-webkit-progress-bar {
  background: #c62233;
}
:root[data-provider="combined"][data-theme="light"]
  .platform-balance-bar::-webkit-progress-value,
:root[data-provider="combined"][data-theme="light"]
  .platform-balance-bar::-moz-progress-bar {
  background: #14743a;
}

.source-combined .platform-counts {
  white-space: normal;
}
@media (max-width: 480px) {
  .source-combined .platform-counts span {
    display: block;
  }
  .source-combined .row .value {
    max-width: 108px;
    white-space: normal;
  }
}
.platform-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px 10px;
}
:root[data-provider="combined"][data-theme="light"] .platform-balance-bar {
  background: #c62233;
}
:root[data-provider="combined"][data-theme="light"]
  .platform-balance-bar::-webkit-progress-bar {
  background: #c62233;
}
:root[data-provider="combined"][data-theme="light"]
  .platform-balance-bar::-webkit-progress-value {
  background: #14743a;
}
:root[data-provider="combined"][data-theme="light"]
  .platform-balance-bar::-moz-progress-bar {
  background: #14743a;
}
/* A small glass capsule, drawn in CSS so it stays crisp on every screen. */
.combined-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  margin: 12px 0 16px;
  padding: 12px 14px;
  position: relative;
  z-index: 0;
  border: 1px solid #adb6b382;
  border-radius: 22px;
  color: #fff;
  text-decoration: none;
  background:
    linear-gradient(180deg, #ffffff17 0%, transparent 44%, #00000030 100%),
    radial-gradient(ellipse at 0% 30%, #117b3e 0%, transparent 68%),
    radial-gradient(ellipse at 100% 50%, #9d2435 0%, transparent 66%), #171e20;
  box-shadow:
    inset 0 1px 1px #ffffff55,
    inset 0 -2px 2px #0008,
    0 4px 10px #0003;
  transition:
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}
.combined-entry::before {
  content: none;
  position: absolute;
  inset: 3px;
  border: 1px solid #ffffff22;
  border-radius: 18px;
  pointer-events: none;
}
.combined-entry::after {
  content: none;
  position: absolute;
  inset: 1px 16px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, #fff8, transparent);
  pointer-events: none;
}
.combined-entry-copy {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.combined-entry-copy b {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.combined-entry-copy small {
  color: #f0f4f1;
  font-size: 10px;
  line-height: 1.3;
}
.combined-entry-mark {
  position: static;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  filter: none;
}
.combined-entry:hover {
  border-color: #dce5df;
  box-shadow:
    inset 0 1px 1px #fff6,
    0 0 15px #1ed76018,
    5px 0 15px #ff454e18,
    0 5px 12px #0004;
  transform: translateY(-1px);
}
.combined-entry[aria-current="page"] {
  border-color: #eff5f0;
  box-shadow:
    inset 0 1px 1px #fff7,
    0 0 0 2px var(--surface),
    0 0 0 3px #7e8d83;
}
.combined-entry:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}
.source-switch {
  border-radius: 16px;
}
.source-switch a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  border-radius: 11px;
  min-height: 44px;
}
.source-switch img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.source-switch [aria-current="page"] {
  background: var(--surface2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
.source-switch [aria-current="page"]:hover {
  background: var(--surface2);
  color: var(--text);
}
.era-picker {
  margin: 0 0 24px;
}
.era-picker > div:first-child {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}
.era-picker small,
.selection-caption {
  color: var(--muted);
  font-size: 12px;
}
.era-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.era-chips button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 8px 14px;
  background: var(--surface);
  font-size: 12px;
}
.era-chips button[aria-pressed="true"] {
  background: var(--surface2);
  border-color: var(--text);
}
.ranking-explainer {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 13px;
}
.ranking-explainer strong {
  color: var(--text);
}
.rhythm-stories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.rhythm-stories article {
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.rhythm-stories span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.6px;
}
.rhythm-stories h3 {
  font-size: 23px;
  margin: 10px 0;
}
.rhythm-stories p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.playlist-launch {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 18px 0;
}
.playlist-launch p {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
}
.nerd-details {
  margin: 28px 0;
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 16px;
}
.nerd-details > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}
.source-combined .cover-badge {
  display: none;
}
@media (max-width: 760px) {
  .combined-entry {
    min-height: 54px;
    margin: 8px 0 6px;
    padding: 9px 14px;
  }
  .combined-entry-copy small {
    font-size: 11px;
  }
  .rhythm-stories {
    grid-template-columns: 1fr;
  }
  .era-picker > div:first-child {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .combined-entry {
    transition: none;
  }
  .combined-entry:hover {
    transform: none;
  }
}
.transfer-entry {
  display: block;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 12px;
  margin: 4px 0 12px;
}
.source-switch {
  padding: 4px;
  gap: 4px;
}
.source-switch a {
  padding: 8px 5px;
}
.source-switch img {
  width: 16px;
  height: 16px;
}
.source-switch a[href="./"] {
  background: linear-gradient(145deg, #1ed76014, transparent);
  border: 1px solid #1ed76030;
  color: var(--text);
}
.source-switch a[href="youtube.html"] {
  background: linear-gradient(145deg, #ff454e14, transparent);
  border: 1px solid #ff454e30;
  color: var(--text);
}
.source-switch a[href="./"][aria-current="page"] {
  background: #1ed76022;
  border-color: #1ed760;
}
.source-switch a[href="youtube.html"][aria-current="page"] {
  background: #ff454e22;
  border-color: #ff454e;
}
.source-switch a:hover {
  filter: brightness(1.15);
}
.platform-counts {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
@media (forced-colors: active) {
  .combined-entry {
    border: 2px solid ButtonText;
    background: Canvas;
    color: CanvasText;
  }
  .combined-entry-copy small {
    color: CanvasText;
  }
  .combined-entry-mark {
    filter: none;
  }
}
@media (max-width: 760px) {
  .transfer-entry {
    display: none;
  }
}
.era-picker > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--text);
  font-size: 13px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  width: fit-content;
  background: var(--surface);
}
.era-picker > summary::before {
  content: "+";
  font-size: 20px;
  color: var(--muted);
}
.era-picker[open] > summary::before {
  content: "−";
}
.era-picker > summary span {
  color: var(--muted);
  font-size: 12px;
}
.era-picker[open] .era-chips {
  margin-top: 12px;
}
.source-combined .header-actions {
  display: none;
}
.source-combined .row .value small.platform-counts {
  display: flex;
  gap: 5px 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
