:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #121212;
  --raised: #1f1f1f;
  --line: #333333;
  --ink: #ffffff;
  --muted: #b3b3b3;
  --accent: #1ed760;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: #000000;
}

.header-inner, main {
  width: min(100% - 3rem, 72rem);
  margin-inline: auto;
}

.header-inner {
  min-height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  padding-block: .6rem;
}

.account-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.wordmark {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -.015em;
}

.mark {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: .5rem;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.mark i { width: 2px; height: 8px; border-radius: 2px; background: #000000; }
.mark i:nth-child(2) { height: 15px; }
.mark i:nth-child(3) { height: 11px; }

main { padding-block: clamp(2rem, 6vw, 4.5rem); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 5.1vw, 3.2rem); line-height: 1.2; letter-spacing: -.045em; }
h2 { font-size: 1rem; line-height: 1.5; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.55rem; }
#period { margin-top: .6rem; }
#period, .updated { color: var(--muted); font-size: .9rem; }
.updated { white-space: nowrap; font-variant-numeric: tabular-nums; }

.cards { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 3.2vw, 1.7rem); }
.metric { margin-top: .35rem; color: var(--muted); }
.metric strong { font-size: clamp(2rem, 6vw, 3.5rem); color: var(--ink); font-weight: 730; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.plot { height: clamp(11rem, 28vw, 16rem); margin-top: 1rem; position: relative; }
.plot canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.chart-selection { margin-top: .6rem; min-height: 1.5em; color: var(--muted); font-size: .85rem; }
.chart-data { padding-top: .75rem; margin-top: .45rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.chart-data summary { width: fit-content; padding-block: .2rem; cursor: pointer; }
table { border-collapse: collapse; width: 100%; margin-top: .65rem; }
th, td { padding: .4rem .3rem; text-align: start; border-bottom: 1px solid var(--line); }
td { color: var(--ink); }
th:last-child, td:last-child { text-align: end; font-variant-numeric: tabular-nums; }

.ranking { margin: .85rem 0 0; padding: 0; list-style: none; }
.ranking li {
  display: grid;
  grid-template-columns: 1.65rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  padding: .7rem 0;
}
.ranking li + li { border-top: 1px solid var(--line); }
.rank { display: grid; place-items: center; height: 1.65rem; background: var(--raised); color: var(--accent); border-radius: .4rem; font-size: .79rem; font-weight: 700; }
.artist-name { font-weight: 650; overflow-wrap: anywhere; }
.artist-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { color: var(--muted); font-size: .9rem; margin-top: .9rem; }

.status-panel { max-width: 36rem; margin: 1rem auto; padding: clamp(1.25rem, 5.5vw, 2.4rem); }
.status-panel h1 { font-size: clamp(1.4rem, 4vw, 2rem); }
.status-panel p { color: var(--muted); line-height: 1.7; margin-top: .7rem; }
.status-panel .button { margin-top: 1.25rem; }
.button {
  border: 1px solid transparent;
  border-radius: .55rem;
  background: var(--accent);
  color: #000000;
  font-weight: 700;
  padding: .65rem .9rem;
  cursor: pointer;
  min-height: 2.75rem;
}
.button:hover { filter: brightness(1.1); }
.button:disabled { opacity: .65; cursor: wait; }
.button-secondary { background: transparent; border-color: var(--line); color: var(--ink); font-size: .85rem; white-space: nowrap; }

@media (max-width: 47rem) {
  .cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 34rem) {
  .header-inner, main { width: calc(100% - 1.5rem); }
  .intro { display: block; }
  .updated { margin-top: .45rem; }
}

.page-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.page-nav button { border: 1px solid var(--line); padding: .65rem 1.1rem; background: transparent; color: var(--muted); border-radius: 2rem; cursor: pointer; }
.page-nav button[aria-current] { color: #000000; background: var(--accent); border-color: var(--accent); }
#page > h1 { margin-bottom: 1.5rem; }
#page > .muted { margin: 1rem 0; }
.section { margin-top: 1.1rem; min-width: 0; }
.section h2 { font-size: 1.2rem; margin-bottom: .8rem; }
.section h3 { margin: 1rem 0 .6rem; font-size: 1rem; }
.muted { color: var(--muted); font-size: .85rem; line-height: 1.6; overflow-wrap: anywhere; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 1rem; margin: 1rem 0; }
.metric-card { padding: 1rem; border-radius: .6rem; background: var(--raised); min-width: 0; }
.metric-card strong { display: block; font-size: clamp(1.2rem, 2.5vw, 1.9rem); margin: .3rem 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; max-height: 40rem; margin-top: .8rem; }
.table-wrap th { background: var(--panel); position: sticky; top: 0; }
.table-wrap td { vertical-align: middle; font-size: .9rem; min-width: 5rem; }
.table-wrap th { font-size: .8rem; }
.table-wrap td:first-child { min-width: 3rem; }
.table-wrap td:last-child { white-space: nowrap; }
.image-name { display: flex; align-items: center; gap: .7rem; min-width: 9rem; }
.artwork { width: 2.7rem; height: 2.7rem; object-fit: cover; border-radius: .35rem; flex: 0 0 auto; }
.placeholder { display: grid; place-items: center; background: var(--raised); color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin: 1rem 0; }
.filters label { display: flex; flex-direction: column; gap: .4rem; color: var(--muted); font-size: .85rem; }
.filters select, .filters input { padding: .65rem; min-height: 2.75rem; border-radius: .4rem; border: 1px solid var(--line); background: var(--panel); color: var(--ink); max-width: 100%; font: inherit; }
.filters input[type=number] { width: 8rem; }
.filters input:disabled { opacity: .4; }
.filters input[type=checkbox] { width: 1.3rem; min-height: 1.3rem; }
.horizontal-bars { display: grid; gap: .6rem; margin-block: 1rem; }
.horizontal-bars label { display: grid; grid-template-columns: minmax(10rem, 1fr) 2fr; gap: 1rem; align-items: center; font-size: .85rem; overflow-wrap: anywhere; }
.horizontal-bars meter { width: 100%; height: 1rem; accent-color: var(--accent); }
.heatmap { font-size: .75rem; }
.heatmap th { min-width: 2rem; }
.heatmap th:first-child { min-width: 9rem; position: sticky; left: 0; }
.heatmap td { text-align: center; min-width: 2rem; padding: .5rem .3rem; }
.heat-0 { background: #121212; }.heat-1 { background: #17482a; }.heat-2 { background: #166b35; }.heat-3 { background: #1aa34a; color: #000000; }.heat-4 { background: #1ed760; color: #000000; }
details { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
summary { cursor: pointer; color: var(--muted); padding-block: .25rem; }
.comment-card { display: flex; gap: 1rem; align-items: start; margin-block: 1rem; padding: 1rem; background: var(--raised); border-radius: .6rem; }
.comment-card h3 { margin-top: 0; }.comment-text { margin-top: .6rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.persona-image { width: 4rem; height: 4rem; flex: 0 0 auto; border-radius: 50%; object-fit: cover; }
.persona-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .7rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 34rem) { .horizontal-bars label { grid-template-columns: 1fr; gap: .2rem; } .filters { gap: .7rem; } .comment-card { padding: .8rem; gap: .7rem; } .persona-image { width: 3rem; height: 3rem; } }
