/* ==========================================================================
   TuneTable — layout & components
   ========================================================================== */

/* ── Layout ─────────────────────────────────────────────────────────── */
.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }
.wrap--narrow { width: min(100% - var(--gutter) * 2, 880px); margin-inline: auto; }
.page { padding-block: clamp(2rem, 1rem + 3vw, 4rem) 6rem; }
.stack > * + * { margin-top: var(--stack, 1rem); }
.row { display: flex; align-items: center; gap: var(--gap, .75rem); }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.section { margin-top: clamp(3.5rem, 2rem + 4vw, 6rem); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; padding-bottom: 1rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: var(--t-xl); }
.section-head .kicker { margin-bottom: .6rem; display: flex; }
.section-head__link { font-size: var(--t-sm); color: var(--paper-3); display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; transition: color var(--dur-1); }
.section-head__link:hover { color: var(--paper); }
.rule { height: 1px; background: var(--line); border: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: clamp(2rem, 1rem + 3vw, 4rem); align-items: start; }
/* Grid items default to min-width:auto, so one long unbreakable title can push a column past the page edge. */
.split > * { min-width: 0; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }

/* ── Top bar ────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  background: color-mix(in oklab, var(--ink-0) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { height: 100%; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.32rem; font-weight: 500; letter-spacing: -.03em; white-space: nowrap; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__mark .platter { transform-origin: 16px 16px; transition: transform 1.2s var(--ease-out); }
.brand:hover .brand__mark .platter { transform: rotate(200deg); }
/* The mark takes its colours from the theme. */
.brand__rim { stroke: var(--paper); }
.brand__label { fill: var(--accent); }
.brand__shine { stroke: var(--accent-ink); }
.brand__hole { fill: var(--ink-0); }
.brand__arm { stroke: var(--brass); }
.brand__pivot { fill: var(--brass); }
.brand em { font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 1; color: var(--hi); }
.nav { display: flex; gap: .2rem; margin-left: .5rem; }
.nav a {
  position: relative;
  padding: .5rem .8rem; border-radius: var(--r-full);
  font-size: var(--t-sm); font-weight: 500; color: var(--paper-2);
  transition: color var(--dur-1), background var(--dur-1);
}
.nav a:hover { color: var(--paper); background: var(--ink-2); }
.nav a[aria-current="page"] { color: var(--paper); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.nav a.nav__mod { color: var(--brass); }
.topbar__end { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.search-trigger {
  display: inline-flex; align-items: center; gap: .6rem;
  height: 38px; padding: 0 .55rem 0 .85rem; min-width: 230px;
  border: 1px solid var(--line-2); border-radius: var(--r-full);
  background: var(--ink-1); color: var(--paper-3); font-size: var(--t-sm);
  transition: border-color var(--dur-1), color var(--dur-1), background var(--dur-1);
}
.search-trigger:hover { border-color: var(--line-3); color: var(--paper-2); background: var(--ink-2); }
.search-trigger kbd { margin-left: auto; }
kbd {
  display: inline-flex; align-items: center; gap: 2px;
  font: 500 .6875rem/1 var(--font-mono); color: var(--paper-3);
  padding: .3rem .42rem; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--ink-2); box-shadow: 0 1px 0 var(--line-2);
}
/* Colour theme switch: a split disc, accent against brass, like a light/dark toggle with three positions. */
.theme-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid var(--line-2); border-radius: 50%; background: var(--ink-1);
  transition: border-color var(--dur-1), background var(--dur-1);
}
.theme-btn:hover { border-color: var(--line-3); background: var(--ink-2); }
.theme-dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  background: conic-gradient(from 135deg, var(--accent) 0 50%, var(--brass) 0);
  box-shadow: 0 0 0 2px var(--ink-3);
  transition: transform var(--dur-3) var(--ease-spring);
}
.theme-btn:hover .theme-dot { transform: rotate(180deg); }
.nav__theme { display: none; }
.topbar .menu-btn { display: none; }
@media (max-width: 1080px) { .search-trigger { min-width: 0; } .search-trigger span, .search-trigger kbd { display: none; } }
.nav__extra { display: none; }
@media (max-width: 860px) {
  /* The menu opens as a sheet under the top bar, over a dimmed page. */
  .nav { display: none; position: fixed; top: var(--topbar-h); left: 0; right: 0; margin: 0; flex-direction: column; gap: 0; padding: .5rem var(--gutter) 1.25rem;
    background: var(--ink-1); border-bottom: 1px solid var(--line-2); box-shadow: 0 0 0 100vmax rgba(5, 4, 3, .6); animation: sheet-down var(--dur-2) var(--ease-out); }
  .nav.is-open { display: flex; }
  .nav a { padding: .85rem .25rem; border-radius: 0; font: 400 var(--t-lg)/1.2 var(--font-display); color: var(--paper); border-bottom: 1px solid var(--line); }
  .nav a:hover { background: none; color: var(--hi); }
  .nav a[aria-current="page"] { color: var(--hi); }
  .nav a[aria-current="page"]::after { display: none; }
  .nav__extra { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; padding-top: 1rem; }
  .nav__extra a, .nav__extra button { padding: .3rem 0; border: 0; font: 450 var(--t-sm)/1.4 var(--font-sans); color: var(--paper-3); }
  .nav__extra a:hover, .nav__extra button:hover { color: var(--paper); }
  .topbar .menu-btn { display: inline-flex; }
  .theme-btn { display: none; }
  .nav__theme { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .85rem .25rem; border: 0; border-bottom: 1px solid var(--line);
    font: 400 var(--t-lg)/1.2 var(--font-display); color: var(--paper); text-align: left; }
  .nav__theme .theme-dot { width: 18px; height: 18px; }
}
@keyframes sheet-down { from { opacity: 0; transform: translateY(-8px); } }

/* Account menu */
.account { position: relative; }
.account__btn { display: inline-flex; border-radius: 50%; transition: box-shadow var(--dur-1); }
.account__btn:hover { box-shadow: 0 0 0 3px var(--line-2); }
.popover {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  min-width: 240px; padding: .4rem;
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--shadow-3);
  transform-origin: top right;
  animation: pop var(--dur-2) var(--ease-out);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.popover__head { padding: .7rem .75rem .8rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; }
.popover a, .popover button.menu-item {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .55rem .75rem; border-radius: var(--r-sm);
  font-size: var(--t-sm); color: var(--paper-2); text-align: left;
}
.popover a:hover, .popover button.menu-item:hover { background: var(--ink-3); color: var(--paper); }
.popover hr { border: 0; height: 1px; background: var(--line); margin: .35rem 0; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: var(--h); padding: 0 1.05rem;
  border-radius: var(--r-full); border: 1px solid var(--line-2);
  background: var(--ink-2); color: var(--paper);
  font-size: var(--t-sm); font-weight: 550; letter-spacing: -.005em; white-space: nowrap;
  transition: background var(--dur-1), border-color var(--dur-1), transform var(--dur-1), color var(--dur-1), box-shadow var(--dur-2);
  user-select: none;
}
.btn:hover { background: var(--ink-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn--primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.btn--primary:hover { background: var(--accent-2); border-color: transparent; }
.btn--paper { background: var(--paper); color: var(--ink-0); border-color: transparent; }
.btn--paper:hover { background: var(--paper-hover); border-color: transparent; }
.btn--ghost { background: transparent; }
.btn--quiet { background: transparent; border-color: transparent; color: var(--paper-2); }
.btn--quiet:hover { background: var(--ink-2); border-color: transparent; color: var(--paper); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: rgba(239,111,95,.1); border-color: rgba(239,111,95,.35); }
.btn--sm { --h: 32px; padding: 0 .8rem; font-size: var(--t-xs); }
.btn--lg { --h: 50px; padding: 0 1.5rem; font-size: var(--t-base); }
.btn--icon { width: var(--h); padding: 0; }
.btn.is-on { border-color: var(--accent-line); color: var(--hi); background: var(--accent-soft); }

/* ── Chips, badges ──────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  height: 26px; padding: 0 .65rem;
  border: 1px solid var(--line-2); border-radius: var(--r-full);
  font: 500 var(--t-xs)/1 var(--font-sans); letter-spacing: 0;
  color: var(--paper-2); white-space: nowrap;
}
.chip--accent { color: var(--hi); border-color: var(--accent-line); background: var(--accent-soft); }
.chip--brass { color: var(--brass); border-color: var(--brass-line); background: var(--brass-soft); }
a.chip:hover { border-color: var(--line-3); color: var(--paper); }
.role { display: inline-flex; align-items: center; gap: .3rem; font: 550 .6875rem/1 var(--font-sans); padding: .3rem .5rem; border-radius: var(--r-full); }
.role .i { width: 11px; height: 11px; stroke-width: 2.2; }
.role--Moderator { color: var(--brass); background: var(--brass-soft); box-shadow: inset 0 0 0 1px var(--brass-line-2); }
.role--Verified { color: var(--hi); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.role--Unverified { color: var(--paper-3); background: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ── Avatar (generative initials) ───────────────────────────────────── */
.avatar {
  --s: 36px;
  width: var(--s); height: var(--s); flex: none;
  border-radius: 50%; overflow: hidden; position: relative;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 120% at 25% 15%, hsl(var(--h, 20) 55% 62%), hsl(calc(var(--h, 20) + 30) 45% 32%) 70%);
  color: hsl(var(--h, 20) 40% 12%);
  font: 600 calc(var(--s) * .36)/1 var(--font-sans); letter-spacing: -.02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.avatar img, .avatar .mark { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar--xs { --s: 22px; } .avatar--sm { --s: 28px; } .avatar--lg { --s: 56px; } .avatar--xl { --s: 112px; }

/* ── Sleeves: cover art with a generative typographic fallback ──────── */
.sleeve {
  --size: 100%;
  position: relative; width: var(--size); aspect-ratio: 1; flex: none;
  border-radius: 3px; overflow: hidden; isolation: isolate;
  background: var(--sl-bg, #3a2a20); color: var(--sl-fg, #f3e6cf);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 18px 30px -18px rgba(0,0,0,.9), 0 4px 10px -4px rgba(0,0,0,.6);
  container-type: inline-size;
}
.sleeve img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.sleeve__art { position: absolute; inset: 0; z-index: 0; }
.sleeve__type { position: absolute; inset: 8%; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; }
.sleeve__title { font-family: var(--font-display); font-weight: 500; font-size: clamp(9px, 13cqi, 46px); line-height: .95; letter-spacing: -.03em; font-variation-settings: "SOFT" 80, "WONK" 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sleeve__by { font: 500 clamp(5px, 5.2cqi, 13px)/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; opacity: .78; }
/* Gloss & ring-wear so even real covers look like printed card */
.sleeve::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 38%, rgba(255,255,255,.035) 39%, transparent 41%),
    linear-gradient(125deg, rgba(255,255,255,.14), transparent 32%, transparent 70%, rgba(0,0,0,.18));
  mix-blend-mode: soft-light;
}
/* Eight curated duotones */
.sleeve[data-pal="0"] { --sl-bg: #5b1f1a; --sl-fg: #f2dcc2; --sl-ac: #e7a35a; }
.sleeve[data-pal="1"] { --sl-bg: #d7a848; --sl-fg: #1e1710; --sl-ac: #7a2c17; }
.sleeve[data-pal="2"] { --sl-bg: #173b3d; --sl-fg: #f4c9a5; --sl-ac: #e46f43; }
.sleeve[data-pal="3"] { --sl-bg: #24331f; --sl-fg: #e9e0c8; --sl-ac: #b9c778; }
.sleeve[data-pal="4"] { --sl-bg: #22306a; --sl-fg: #f1e5cf; --sl-ac: #f08f6a; }
.sleeve[data-pal="5"] { --sl-bg: #b9502c; --sl-fg: #1b100a; --sl-ac: #f3d7a6; }
.sleeve[data-pal="6"] { --sl-bg: #4a2440; --sl-fg: #f1c6c2; --sl-ac: #e9a35c; }
.sleeve[data-pal="7"] { --sl-bg: #1d1b18; --sl-fg: #efe3cf; --sl-ac: #ff6a3d; }
/* Four patterns */
.sleeve[data-pat="0"] .sleeve__art { background: repeating-radial-gradient(circle at 78% 82%, transparent 0 7%, color-mix(in oklab, var(--sl-ac) 70%, transparent) 7% 7.6%); }
.sleeve[data-pat="1"] .sleeve__art { background: radial-gradient(circle at 72% 70%, var(--sl-ac) 0 26%, transparent 26.4%), radial-gradient(circle at 72% 70%, transparent 0 34%, color-mix(in oklab, var(--sl-ac) 45%, transparent) 34% 35%, transparent 35.5%); }
.sleeve[data-pat="2"] .sleeve__art { background: repeating-linear-gradient(-20deg, transparent 0 9%, color-mix(in oklab, var(--sl-ac) 55%, transparent) 9% 10.5%); mask: linear-gradient(transparent 40%, #000 75%); }
.sleeve[data-pat="3"] .sleeve__art { background: radial-gradient(color-mix(in oklab, var(--sl-ac) 80%, transparent) 1.4px, transparent 1.8px) 0 0 / 9% 9%; mask: radial-gradient(circle at 80% 80%, #000 20%, transparent 62%); }

/* ── Release card ───────────────────────────────────────────────────── */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--min, 170px), 1fr)); gap: clamp(1rem, .5rem + 1.6vw, 1.75rem) clamp(.9rem, .5rem + 1.2vw, 1.4rem); }
.card { position: relative; display: block; }
.card__sleeve { position: relative; transform-style: preserve-3d; transition: transform var(--dur-3) var(--ease-out); }
.card__sleeve .sleeve { transition: box-shadow var(--dur-3) var(--ease-out); }
.card:hover .card__sleeve { transform: translateY(-4px); }
.card:hover .card__sleeve .sleeve { box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 28px 40px -20px rgba(0,0,0,.95), 0 8px 16px -6px rgba(0,0,0,.6); }
/* A record peeking out of the sleeve on hover */
.card__sleeve::before {
  content: ""; position: absolute; z-index: -1; top: 4%; left: 4%; width: 92%; aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, #1a1814 0 5%, var(--accent) 5.4% 15%, #0d0c0a 15.4% 16%, transparent 16.2%),
    repeating-radial-gradient(circle, #121110 0 1px, #1b1a17 1.2px 2.4px);
  box-shadow: 0 6px 18px rgba(0,0,0,.5);
  transition: transform var(--dur-3) var(--ease-out);
}
.card:hover .card__sleeve::before { transform: translateX(22%) rotate(40deg); }
.card__body { margin-top: .8rem; display: grid; grid-template-columns: 1fr auto; gap: .1rem .6rem; align-items: start; }
.card__title { font-weight: 560; font-size: var(--t-sm); line-height: 1.3; color: var(--paper); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__sub { grid-column: 1; font-size: var(--t-xs); color: var(--paper-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__sub a:hover { color: var(--paper); }
.card__artist { position: relative; z-index: 5; }
.grid-cards--sm { --min: 150px; }
.card__aside { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: end; gap: .35rem; }
.card__check { position: absolute; top: .5rem; right: .5rem; z-index: 5; opacity: 0; transform: scale(.85); transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-spring); }
.card:hover .card__check, .card__check:has(.check.is-on), .card__check:focus-within { opacity: 1; transform: none; }
.card__link { position: absolute; inset: 0; z-index: 4; }
.card__link:focus-visible { outline-offset: 4px; border-radius: 4px; }

/* ── Score pill & dial ──────────────────────────────────────────────── */
.score {
  display: inline-flex; align-items: baseline; gap: .15rem;
  font: 600 var(--t-sm)/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--brass);
}
.score small { font-size: .62em; color: var(--paper-4); font-weight: 500; }
.score--lg { display: flex; margin-top: .35rem; font-family: var(--font-display); font-weight: 380; font-size: 3.6rem; letter-spacing: -.04em; font-variation-settings: "SOFT" 60; }
.score--none { color: var(--paper-4); }

.dial { --v: 0; display: flex; flex-direction: column; gap: .55rem; width: 100%; user-select: none; }
.dial__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.dial__value { font: 400 1.9rem/1 var(--font-display); letter-spacing: -.03em; color: var(--brass); min-width: 2.2ch; font-variant-numeric: tabular-nums; }
.dial__value.is-empty { color: var(--paper-4); }
.dial__track {
  position: relative; display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px;
  height: 34px; padding: 0; cursor: pointer; touch-action: none;
}
.dial__seg { border-radius: 2px; background: var(--ink-4); transform-origin: bottom; transition: background var(--dur-1), transform var(--dur-2) var(--ease-spring); }
.dial__seg:nth-child(even) { margin-right: 2px; }
.dial__seg.is-lit { background: linear-gradient(to top, color-mix(in oklab, var(--brass) 70%, #000), var(--brass)); }
.dial__seg.is-hover { background: color-mix(in oklab, var(--brass) 45%, var(--ink-4)); }
.dial__track:hover .dial__seg.is-hover-edge, .dial__seg.is-edge { transform: scaleY(1.18); }
.dial__scale { display: flex; justify-content: space-between; font: 500 .625rem/1 var(--font-mono); color: var(--paper-4); }
.dial__clear { font-size: var(--t-xs); color: var(--paper-3); }
.dial__clear:hover { color: var(--paper); }
.dial[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ── Listened check (circular) ──────────────────────────────────────── */
.check {
  --s: 28px;
  position: relative; display: inline-grid; place-items: center;
  width: var(--s); height: var(--s); flex: none; border-radius: 50%;
  border: 1.5px solid var(--line-3);
  background: color-mix(in oklab, var(--ink-0) 70%, transparent);
  backdrop-filter: blur(6px);
  color: var(--accent-ink);
  transition: background var(--dur-2), border-color var(--dur-2), transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2);
}
.check:hover { border-color: var(--paper-2); transform: scale(1.06); }
.check svg { width: 58%; height: 58%; stroke: currentColor; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset var(--dur-3) var(--ease-out) 60ms; }
.check.is-on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.check.is-on svg { stroke-dashoffset: 0; }
.check.is-pop { animation: checkpop var(--dur-3) var(--ease-spring); }
@keyframes checkpop { 40% { transform: scale(1.22); } }
.check--sm { --s: 20px; border-width: 1.3px; }
.check--lg { --s: 44px; border-width: 2px; }
.check-label { display: inline-flex; align-items: center; gap: .65rem; padding: .3rem .9rem .3rem .3rem; border-radius: var(--r-full); border: 1px solid var(--line-2); font-size: var(--t-sm); font-weight: 550; color: var(--paper-2); transition: border-color var(--dur-1), color var(--dur-1); }
.check-label:hover { border-color: var(--line-3); color: var(--paper); }
.check-label:has(.is-on) { color: var(--paper); border-color: var(--accent-line); }

/* ── Sound bars (compact) & meters (large) ─────────────────────────── */
.bars { display: inline-flex; align-items: end; gap: 3px; height: 22px; }
.bars span { width: 5px; border-radius: 2px; background: var(--c); height: calc(var(--v) * 10%); min-height: 3px; opacity: .9; }
.bars--empty span { background: var(--ink-4); height: 30%; }
.bars span:nth-child(1) { --c: var(--energy); } .bars span:nth-child(2) { --c: var(--valence); } .bars span:nth-child(3) { --c: var(--density); }

.meters { display: grid; gap: 1.1rem; }
.meter { display: grid; grid-template-columns: 7.5rem 1fr 3rem; align-items: center; gap: 1rem; }
.meter__label { display: flex; flex-direction: column; gap: .2rem; }
.meter__label b { font-weight: 600; font-size: var(--t-sm); display: flex; align-items: center; gap: .45rem; }
.meter__label b::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.meter__label span { font: 400 var(--t-xs)/1.2 var(--font-sans); color: var(--paper-3); }
.meter__track { position: relative; height: 10px; border-radius: var(--r-full); background: repeating-linear-gradient(90deg, var(--ink-3) 0 calc(10% - 2px), transparent calc(10% - 2px) 10%); }
.meter__fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 10%); border-radius: var(--r-full); background: linear-gradient(90deg, color-mix(in oklab, var(--c) 30%, transparent), var(--c)); box-shadow: 0 0 18px -2px color-mix(in oklab, var(--c) 60%, transparent); transition: width var(--dur-3) var(--ease-out); }
.meter__value { font: 500 var(--t-md)/1 var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.meter--energy { --c: var(--energy); } .meter--valence { --c: var(--valence); } .meter--density { --c: var(--density); }

/* ── Panels ─────────────────────────────────────────────────────────── */
.panel { background: var(--ink-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.1rem, .8rem + 1vw, 1.6rem); }
.panel--flush { padding: 0; overflow: hidden; }
.panel__title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.panel__title h3 { font-size: var(--t-lg); font-weight: 450; }
.panel + .panel { margin-top: 1rem; }

/* ── Track list ─────────────────────────────────────────────────────── */
.tracks { border-top: 1px solid var(--line); }
.section-head + .tracks { border-top: 0; }
.track {
  position: relative;
  display: grid; grid-template-columns: 28px 30px minmax(0, 1fr) auto auto auto; align-items: center; gap: .9rem;
  padding: .7rem .6rem; border-bottom: 1px solid var(--line);
  transition: background var(--dur-1);
}
.track:hover { background: linear-gradient(90deg, transparent, var(--ink-1) 20%, var(--ink-1) 80%, transparent); }
.track__n { font: 500 var(--t-xs)/1 var(--font-mono); color: var(--paper-4); text-align: right; font-variant-numeric: tabular-nums; }
.track__title { min-width: 0; font-weight: 520; font-size: var(--t-base); }
.track__title a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__title a:hover { color: var(--hi); }
.track__title small { display: block; font: 400 var(--t-xs)/1.3 var(--font-sans); color: var(--paper-3); margin-top: .15rem; }
.track__dur { font: 400 var(--t-xs)/1 var(--font-mono); color: var(--paper-3); min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.track__mine { min-width: 2.6em; text-align: right; }
.track.is-pick::before { content: ""; position: absolute; left: -12px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--accent); }
@media (max-width: 640px) { .track { grid-template-columns: 22px 24px minmax(0,1fr) auto; } .track .bars, .track__mine { display: none; } }

/* ── Reviews ────────────────────────────────────────────────────────── */
.review { display: grid; grid-template-columns: auto 1fr; gap: .9rem 1rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.review:first-child { padding-top: .2rem; }
.review__head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; font-size: var(--t-sm); }
.review__head b { font-weight: 600; }
.review__body { grid-column: 2; color: var(--paper-2); line-height: 1.7; font-size: var(--t-base); text-wrap: pretty; }
.review__body.is-quote { font-family: var(--font-display); font-size: var(--t-md); font-weight: 380; color: var(--paper); line-height: 1.55; }
.review__foot { grid-column: 2; display: flex; align-items: center; gap: 1rem; font-size: var(--t-xs); color: var(--paper-3); }
.review__subject { grid-column: 2; display: flex; align-items: center; gap: .75rem; margin-bottom: .2rem; }
.review.is-hidden { opacity: .5; }
.like { display: inline-flex; align-items: center; gap: .35rem; color: var(--paper-3); font: 500 var(--t-xs)/1 var(--font-mono); padding: .3rem .5rem; margin: -.3rem -.5rem; border-radius: var(--r-full); transition: color var(--dur-1), background var(--dur-1); }
.like:hover { color: var(--paper); background: var(--ink-2); }
.like .i { width: 14px; height: 14px; }
.like.is-on { color: var(--hi); }
.like.is-on .i { fill: currentColor; }

/* ── Activity ───────────────────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; }
.act { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: start; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.act__text { font-size: var(--t-sm); color: var(--paper-2); line-height: 1.5; }
.act__text b, .act__text a.strong { color: var(--paper); font-weight: 580; }
.act__text a:hover { color: var(--hi); }
.act__quote { margin-top: .5rem; padding-left: .8rem; border-left: 2px solid var(--line-2); color: var(--paper-3); font-size: var(--t-sm); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.act__time { font: 400 var(--t-xs)/1 var(--font-sans); color: var(--paper-4); white-space: nowrap; margin-top: .4rem; }
.act__sleeve { width: 44px; }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: .45rem; padding: .9rem .9rem; font-size: var(--t-sm); font-weight: 550; color: var(--paper-3); white-space: nowrap; transition: color var(--dur-1); }
.tabs a:hover { color: var(--paper); }
.tabs a[aria-current="page"] { color: var(--paper); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: .9rem; right: .9rem; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.tabs a .count { font: 500 var(--t-xs)/1 var(--font-sans); color: var(--paper-4); }

/* ── Stats ──────────────────────────────────────────────────────────── */
.stats { display: flex; flex-wrap: wrap; gap: clamp(1.25rem, 1rem + 2vw, 3rem); }
.stat { display: flex; flex-direction: column; gap: .3rem; }
.stat b { font: 380 var(--t-xl)/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font: 450 var(--t-xs)/1.2 var(--font-sans); color: var(--paper-3); }
a.stat:hover b { color: var(--hi); }

/* ── Histogram ──────────────────────────────────────────────────────── */
.histo { display: grid; grid-template-columns: repeat(11, 1fr); align-items: end; gap: 4px; height: 76px; }
.histo span { position: relative; background: var(--ink-4); border-radius: 2px 2px 0 0; min-height: 2px; height: calc(var(--p) * 1%); transition: background var(--dur-1); }
.histo span.is-hi { background: var(--brass); }
.histo span:hover { background: var(--paper-2); }
.histo span:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: .25rem .45rem; border-radius: 6px; background: var(--paper); color: var(--ink-0); font: 500 .625rem/1 var(--font-mono); white-space: nowrap; }
.histo-scale { display: flex; justify-content: space-between; margin-top: .45rem; font: 500 .625rem/1 var(--font-mono); color: var(--paper-4); }

/* ── Forms ──────────────────────────────────────────────────────────── */
.field { display: grid; gap: .45rem; }
.field + .field { margin-top: 1.1rem; }
.field label, .label { font-size: var(--t-sm); font-weight: 550; color: var(--paper-2); }
.field .hint { font-size: var(--t-xs); color: var(--paper-3); }
.field .error, .validation-summary-errors, .field-validation-error { font-size: var(--t-xs); color: var(--danger); }
.validation-summary-errors ul { padding-left: 1rem; }
.input, .textarea, .select {
  width: 100%; min-height: 44px; padding: .65rem .9rem;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--ink-1); color: var(--paper);
  transition: border-color var(--dur-1), box-shadow var(--dur-1), background var(--dur-1);
}
.input::placeholder, .textarea::placeholder { color: var(--paper-4); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--line-3); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--ink-2); }
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.textarea--prose { font-family: var(--font-display); font-size: var(--t-md); font-weight: 380; }
.input--prefix { position: relative; display: flex; align-items: center; }
/* Password fields carry a show/hide eye; 44px so it's easy to hit with a thumb. */
.pw { position: relative; display: block; }
.pw > .input { width: 100%; padding-right: 3.1rem; }
.pw > .input::-ms-reveal { display: none; }
.pw__toggle { position: absolute; top: 50%; right: .2rem; width: 44px; height: 44px; transform: translateY(-50%); display: grid; place-items: center; border-radius: var(--r-sm); color: var(--paper-3); }
.pw__toggle:hover, .pw__toggle[aria-pressed="true"] { color: var(--paper); }
.pw__toggle .i { width: 18px; height: 18px; }
.input--prefix > span { position: absolute; left: .9rem; color: var(--paper-3); font-family: var(--font-mono); pointer-events: none; }
.input--prefix > .input { padding-left: 1.9rem; }
.switch { display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; font-size: var(--t-sm); color: var(--paper-2); }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: var(--r-full); background: var(--ink-4); position: relative; transition: background var(--dur-2); cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper-2); transition: transform var(--dur-2) var(--ease-spring), background var(--dur-2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); background: var(--accent-ink); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-full); background: var(--ink-2); border: 1px solid var(--line); }
.segmented a, .segmented button { padding: .42rem .9rem; border-radius: var(--r-full); font-size: var(--t-xs); font-weight: 600; color: var(--paper-3); transition: color var(--dur-1), background var(--dur-1); }
.segmented a:hover, .segmented button:hover { color: var(--paper); }
.segmented [aria-current="page"], .segmented [aria-pressed="true"] { background: var(--ink-4); color: var(--paper); box-shadow: var(--shadow-1); }

/* ── Dialogs ────────────────────────────────────────────────────────── */
dialog.sheet { margin: auto; width: min(560px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); border-radius: var(--r-xl); background: var(--ink-1); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); overflow: auto; }
dialog.sheet[open] { animation: sheet-in var(--dur-3) var(--ease-out); }
dialog.sheet::backdrop { background: rgba(6, 5, 4, .62); backdrop-filter: blur(6px); animation: fade var(--dur-2); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.sheet__head { display: flex; align-items: start; gap: 1rem; padding: 1.4rem 1.5rem 0; }
.sheet__head h2 { font-size: var(--t-xl); }
.sheet__body { padding: 1.25rem 1.5rem; }
.sheet__foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.5rem 1.4rem; border-top: 1px solid var(--line); }
.sheet__close { margin-left: auto; }

/* ── Toasts ─────────────────────────────────────────────────────────── */
.toasts { position: fixed; z-index: 10050; left: 50%; bottom: 1.5rem; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
/* As a top-layer popover it would otherwise get the browser's centred-box defaults. :where() keeps these at the
   same weight as .toasts, so the left/bottom placements below (phones, open player) still apply. */
.toasts:where([popover]) { top: auto; right: auto; margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible; width: max-content; height: auto; max-width: calc(100vw - 32px); }
.toasts:where([popover]:not(:popover-open)) { display: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem .7rem .8rem; border-radius: var(--r-full); background: var(--paper); color: var(--ink-0); font-size: var(--t-sm); font-weight: 550; box-shadow: var(--shadow-3); animation: toast-in var(--dur-3) var(--ease-spring); }
.toast .i { width: 16px; height: 16px; }
.toast--error { background: var(--danger); color: #1d0705; }
.toast.is-out { animation: toast-out var(--dur-2) ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ── Empty states ───────────────────────────────────────────────────── */
.empty { display: grid; place-items: center; text-align: center; gap: .9rem; padding: clamp(2.5rem, 2rem + 4vw, 5rem) 1rem; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--paper-3); }
.empty__disc { width: 88px; height: 88px; border-radius: 50%; background: radial-gradient(circle, var(--ink-0) 0 6%, var(--ink-4) 6.5% 18%, var(--ink-1) 18.5% 19.5%, transparent 20%), repeating-radial-gradient(circle, var(--ink-2) 0 1px, var(--ink-1) 1.3px 3px); box-shadow: inset 0 0 0 1px var(--line-2); animation: spin 9s linear infinite; }
.empty h3 { font-size: var(--t-lg); color: var(--paper); font-weight: 450; }
.empty p { max-width: 42ch; font-size: var(--t-sm); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Skeleton & sync ────────────────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--ink-2) 20%, var(--ink-3) 40%, var(--ink-2) 60%) 0 0 / 300% 100%; animation: shimmer 1.6s linear infinite; border-radius: var(--r-xs); }
@keyframes shimmer { to { background-position: -150% 0; } }
.sync { display: inline-flex; align-items: center; gap: .55rem; padding: .4rem .8rem .4rem .55rem; border-radius: var(--r-full); background: var(--ink-2); border: 1px solid var(--line); font: 500 var(--t-xs)/1 var(--font-sans); color: var(--paper-3); }
.sync::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-3); border-top-color: var(--accent); animation: spin .9s linear infinite; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.colophon { margin-top: 6rem; border-top: 1px solid var(--line); padding: 3rem 0 2.5rem; color: var(--paper-3); font-size: var(--t-sm); }
.colophon__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.colophon h4 { font: 550 var(--t-sm)/1 var(--font-sans); color: var(--paper-3); margin-bottom: 1rem; }
.colophon ul { list-style: none; padding: 0; display: grid; gap: .55rem; }
.colophon a:hover { color: var(--paper); }
.colophon__tag { font-family: var(--font-display); font-size: var(--t-lg); color: var(--paper-2); font-weight: 380; max-width: 26ch; line-height: 1.3; margin-top: 1rem; font-style: italic; font-variation-settings: "SOFT" 100; }
.colophon__base { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font: 400 var(--t-xs)/1.4 var(--font-sans); color: var(--paper-4); }
.colophon__base a { text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 2px; }
@media (max-width: 760px) { .colophon__grid { grid-template-columns: 1fr 1fr; } }

/* ── Reveal on scroll & 3D tilt ─────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: calc(var(--i, 0) * 60ms); }
.reveal.is-in { opacity: 1; transform: none; }
[data-tilt] { transform-style: preserve-3d; transition: transform var(--dur-3) var(--ease-out); will-change: transform; }
[data-tilt] .glare { position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: inherit; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.22), transparent 55%); opacity: 0; transition: opacity var(--dur-2); mix-blend-mode: soft-light; }
[data-tilt]:hover .glare { opacity: 1; }

/* ── Tables (mod) ───────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th { text-align: left; font: 500 var(--t-xs)/1 var(--font-sans); color: var(--paper-3); padding: .9rem .9rem; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: .85rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--ink-1); }
.table .cell-user { display: flex; align-items: center; gap: .7rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--ink-1); }
.table-wrap .table tr:last-child td { border-bottom: 0; }

/* ── Page heads: a plain title, one line of help, actions on the right ── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.25rem 2rem; margin-bottom: 2.25rem; }
.page-head__title { font: 380 var(--t-3xl)/1 var(--font-display); letter-spacing: -.035em; }
.page-head__tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.page-head__sub { margin-top: .75rem; max-width: 62ch; color: var(--paper-2); font-size: var(--t-md); line-height: 1.55; text-wrap: pretty; }
.section-head h2 .count, h2 .count { margin-left: .4rem; font: 450 var(--t-sm)/1 var(--font-sans); color: var(--paper-3); vertical-align: .2em; }

/* ── Phone tab bar ───────────────────────────────────────────────────── */
.tabbar { display: none; }
@media (max-width: 760px) {
  :root { --tabbar-h: 60px; --topbar-h: 56px; }
  .tabbar {
    position: fixed; z-index: 80; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in oklab, var(--ink-0) 88%, transparent);
    backdrop-filter: saturate(140%) blur(18px); -webkit-backdrop-filter: saturate(140%) blur(18px);
    border-top: 1px solid var(--line);
  }
  .tabbar > a, .tabbar > button { position: relative; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--paper-3); font: 550 .6875rem/1 var(--font-sans); -webkit-tap-highlight-color: transparent; }
  .tabbar .i { width: 22px; height: 22px; }
  .tabbar .avatar { --s: 24px; }
  .tabbar [aria-current="page"] { color: var(--paper); }
  .tabbar [aria-current="page"] .i { stroke: var(--accent); }
  .tabbar [aria-current="page"] .avatar { box-shadow: 0 0 0 2px var(--ink-0), 0 0 0 3.5px var(--accent); }
  .tabbar__count { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: var(--r-full); background: var(--accent); color: var(--accent-ink); font: 700 .625rem/1 var(--font-mono); }
  .tabbar__count[hidden] { display: none; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .topbar .search-trigger, .topbar .account { display: none; }
  .toasts { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
}

/* ── Feed: days, bundles, people ─────────────────────────────────────── */
.feed-day { margin: 2rem 0 .2rem; font: 500 var(--t-sm)/1 var(--font-sans); color: var(--paper-3); }
.feed-day:first-child { margin-top: 0; }
.act__covers { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .65rem; }
.act__covers li { width: 56px; }
.act__covers a { position: relative; display: block; }
.act__badge { position: absolute; right: -5px; bottom: -5px; padding: .16rem .32rem; border-radius: var(--r-xs); background: var(--ink-0); box-shadow: 0 0 0 1px var(--line-2); font-size: .6875rem; }
.act__more { display: grid; place-items: center; height: 56px; color: var(--paper-3); font-size: var(--t-xs); }
.feed-more { display: flex; justify-content: center; padding: 1.75rem 0; }
.people__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.people__row:last-child { border-bottom: 0; }
.people__who b { display: block; font-weight: 580; font-size: var(--t-sm); }
