/* RATED — app shell: left rail on desktop, bottom tabs on phones; covers carry the color, scores carry the heat. */
:root {
    --vinyl: #141216;      /* page */
    --sleeve: #1d1a21;     /* raised surfaces */
    --groove: #2b2731;     /* lines, inputs */
    --label: #f3efe7;      /* text */
    --dust: #9d97a3;       /* secondary text */
    --gold: #f2c14e;       /* primary action, 10/10 */
    --gold-ink: #241a02;

    --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --step--1: 0.8125rem;
    --step-0: 0.9375rem;
    --step-1: 1.125rem;
    --step-2: 1.5rem;
    --step-3: 2.25rem;
    --step-4: clamp(2.5rem, 5vw + 1rem, 4.25rem);

    --rail: 236px;
    --tabbar: 64px;
    --radius-cover: 6px;
    --radius-ui: 10px;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--vinyl);
    color: var(--label);
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.5;
    font-variation-settings: "wdth" 100;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: env(safe-area-inset-top, 0px);
    z-index: 30;
    background: var(--vinyl);
}
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
/* 16px or more: iPhones zoom into smaller text fields when you tap them */
input, select, textarea { font-size: max(16px, 1em); }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--dust); }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.05; }

/* ---------- display type ---------- */
.display {
    font-variation-settings: "wdth" 62;
    font-weight: 800;
    letter-spacing: -0.005em;
}
.num {
    font-variation-settings: "wdth" 62;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.rail { display: none; }
.topbar {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    background: color-mix(in srgb, var(--vinyl) 92%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--groove);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 22px; width: auto; }
.topbar-account {
    width: 34px; height: 34px; border-radius: 50%;
    border: 0; padding: 0;
    background: var(--groove);
    display: grid; place-items: center;
    font-weight: 700; font-size: var(--step--1);
    text-decoration: none;
}

.view {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-block: 20px calc(var(--tabbar) + 40px + env(safe-area-inset-bottom, 0px));
    max-width: 1180px;
    margin-inline: auto;
    display: grid;
    gap: 40px;
    min-width: 0;
}

.tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    background: color-mix(in srgb, var(--vinyl) 94%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--groove);
}
.tab {
    height: var(--tabbar);
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--dust);
    font-size: 0.6875rem;
    font-weight: 600;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--label); }
.tab-dot { position: relative; }

@media (min-width: 960px) {
    .shell {
        display: grid;
        grid-template-columns: var(--rail) minmax(0, 1fr);
    }
    .topbar, .tabbar { display: none; }
    .rail {
        display: flex;
        flex-direction: column;
        gap: 28px;
        position: sticky;
        top: 0;
        height: 100vh;
        padding: 28px 16px 24px max(16px, env(safe-area-inset-left, 0px));
        border-right: 1px solid var(--groove);
    }
    .rail .brand { padding-left: 12px; }
    .rail .brand img { height: 26px; }
    .rail nav { display: grid; gap: 2px; }
    .rail-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border-radius: var(--radius-ui);
        text-decoration: none;
        color: var(--dust);
        font-weight: 600;
    }
    .rail-link svg { width: 20px; height: 20px; flex: none; }
    .rail-link:hover { color: var(--label); background: var(--sleeve); }
    .rail-link[aria-current="page"] { color: var(--label); background: var(--sleeve); }
    .rail-foot { margin-top: auto; display: grid; gap: 10px; padding-left: 12px; font-size: var(--step--1); }
    .rail-progress { display: grid; gap: 2px; }
    .rail-progress strong { font-size: var(--step-2); line-height: 1; }
    .view { padding-block: 36px 64px; padding-left: 40px; padding-right: max(40px, env(safe-area-inset-right, 0px)); }
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--groove);
    background: transparent;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { border-color: var(--dust); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn-primary:hover { background: color-mix(in srgb, var(--gold) 88%, white); border-color: transparent; }
.btn-quiet { border-color: transparent; color: var(--dust); padding-inline: 10px; }
.btn-quiet:hover { color: var(--label); border-color: transparent; }
.btn[aria-pressed="true"] { background: var(--label); color: var(--vinyl); border-color: var(--label); }
.btn-small { min-height: 34px; padding: 0 14px; font-size: var(--step--1); }
.link-btn { background: none; border: 0; padding: 0; color: var(--dust); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--label); }

/* ---------- section heads ---------- */
.section { display: grid; gap: 16px; min-width: 0; }
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.section-head h2 { font-size: var(--step-2); }
.section-head p { margin: 4px 0 0; color: var(--dust); font-size: var(--step--1); }
.page-title { font-size: var(--step-4); }
.page-intro { display: grid; gap: 8px; }
.page-intro p { margin: 0; color: var(--dust); max-width: 60ch; }

/* ---------- covers ---------- */
.cover {
    position: relative;
    aspect-ratio: 1;
    max-width: 100%;
    border-radius: var(--radius-cover);
    overflow: hidden;
    background:
        repeating-radial-gradient(circle at 115% 115%, transparent 0 5px, rgb(255 255 255 / 0.035) 5px 6px),
        linear-gradient(150deg, hsl(var(--h) 38% 30%), hsl(calc(var(--h) + 40) 30% 14%));
    container-type: inline-size;
}
.cover-fallback {
    position: absolute;
    inset: 0;
    padding: 9%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2%;
    color: hsl(var(--h) 40% 90%);
}
.cover-fallback b {
    font-variation-settings: "wdth" 62;
    font-weight: 800;
    font-size: 13cqi;
    line-height: 0.95;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow-wrap: break-word;
    hyphens: auto;
}
.cover-fallback span { font-size: 7cqi; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- album cards ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 24px 16px;
}
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; } }
.card {
    display: grid;
    gap: 10px;
    align-content: start;
    text-decoration: none;
    min-width: 0;
}
.card-meta { display: grid; gap: 1px; min-width: 0; }
.card-title {
    font-weight: 650;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-artist { color: var(--dust); font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-scores { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; margin-top: 4px; font-size: var(--step--1); color: var(--dust); }
.card:hover .card-title { text-decoration: underline; text-underline-offset: 3px; }
.card .cover { transition: transform 0.2s ease; }
.card:hover .cover { transform: translateY(-2px); }

.row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(148px, 172px);
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
    padding-inline: max(16px, env(safe-area-inset-left, 0px));
    scrollbar-width: thin;
}
.row > * { scroll-snap-align: start; }
@media (min-width: 960px) { .row { margin-inline: 0; padding-inline: 0; } }

/* ---------- score marks ---------- */
.score {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.score-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--heat, var(--dust)); align-self: center; flex: none; }
.score b { color: var(--label); font-weight: 650; }
.chip-score {
    display: inline-grid;
    place-items: center;
    min-width: 3.1em;
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--heat) 22%, transparent);
    color: color-mix(in srgb, var(--heat) 70%, var(--label));
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.classic { color: var(--gold); font-weight: 700; font-size: var(--step--1); display: inline-flex; gap: 4px; align-items: center; }

/* ---------- chips / filters ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--groove);
    background: transparent;
    color: var(--dust);
    font-size: var(--step--1);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.chip:hover { color: var(--label); }
.chip[aria-pressed="true"] { background: var(--label); color: var(--vinyl); border-color: var(--label); }
.select {
    min-height: 34px;
    padding: 0 30px 0 12px;
    border-radius: 999px;
    border: 1px solid var(--groove);
    background: var(--vinyl) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%239d97a3' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    font-size: var(--step--1);
    font-weight: 600;
}
.browse-controls { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.more { justify-self: center; }

/* ---------- discover hero ---------- */
.hero {
    display: grid;
    gap: 20px;
    align-items: end;
}
.hero-cover { width: min(78%, 320px); margin-inline: auto; box-shadow: 0 24px 60px -24px hsl(var(--h) 60% 30% / 0.6); }
.hero-text { display: grid; gap: 12px; min-width: 0; justify-items: center; text-align: center; }
.hero-kicker { color: var(--gold); font-weight: 650; font-size: var(--step--1); }
.hero-title { font-size: var(--step-4); line-height: 0.95; }
.hero-artist { font-size: var(--step-1); color: var(--dust); text-decoration: none; }
.hero-artist:hover { color: var(--label); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.hero-text .progress { width: min(100%, 320px); }
.progress { height: 4px; border-radius: 2px; background: var(--groove); overflow: hidden; max-width: 320px; }
.progress span { display: block; height: 100%; background: var(--gold); }
@media (min-width: 720px) {
    .hero { grid-template-columns: auto minmax(0, 1fr); gap: 32px; }
    .hero-cover { width: 280px; margin-inline: 0; }
    .hero-text { justify-items: start; text-align: left; }
    .hero-actions { justify-content: flex-start; }
}

/* ---------- artists ---------- */
.avatar {
    --size: 100%;
    aspect-ratio: 1;
    width: var(--size);
    max-width: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: linear-gradient(150deg, hsl(var(--h) 30% 32%), hsl(calc(var(--h) + 40) 25% 16%));
    display: grid;
    place-items: center;
    container-type: inline-size;
    flex: none;
}
.avatar > span { font-variation-settings: "wdth" 62; font-weight: 800; font-size: 38cqi; color: hsl(var(--h) 40% 88%); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.artist-card { display: grid; gap: 10px; justify-items: center; text-align: center; text-decoration: none; min-width: 0; }
.artist-card .card-title { max-width: 100%; }
.row-artists { grid-auto-columns: minmax(112px, 128px); }

/* ---------- album page ---------- */
.back { justify-self: start; margin-left: -10px; margin-bottom: -24px; }
.album-head { display: grid; gap: 20px; }
.album-head .cover { width: min(72%, 300px); justify-self: center; }
.album-info { display: grid; gap: 14px; align-content: end; min-width: 0; }
.album-title { font-size: var(--step-4); line-height: 0.95; }
.album-artist { font-size: var(--step-1); font-weight: 600; text-decoration: none; }
.album-artist:hover { text-decoration: underline; text-underline-offset: 4px; }
.facts { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--dust); font-size: var(--step--1); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 0.75rem; color: var(--dust); border: 1px solid var(--groove); border-radius: 999px; padding: 2px 10px; text-decoration: none; }
.tag:hover { color: var(--label); }
@media (min-width: 720px) {
    .album-head { grid-template-columns: 320px minmax(0, 1fr); gap: 36px; }
    .album-head .cover { width: 320px; justify-self: start; }
}

.trio {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--groove);
    border-bottom: 1px solid var(--groove);
}
.trio > div { padding: 14px 0; display: grid; gap: 2px; min-width: 0; }
.trio > div + div { padding-left: 16px; border-left: 1px solid var(--groove); }
.trio dt { color: var(--dust); font-size: var(--step--1); }
.trio dd { margin: 0; display: grid; gap: 4px; align-content: start; }
.trio .num { font-size: var(--step-3); line-height: 1; color: var(--heat, var(--label)); }
.trio .empty { font-size: var(--step-0); color: var(--dust); height: 2.25rem; display: flex; align-items: center; line-height: 1.2; }
.trio small { color: var(--dust); font-size: 0.75rem; }
.album-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* tracklist */
.tracks-head {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-ui);
    background: var(--sleeve);
}
.tracks-status { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tracks-status strong { font-weight: 650; }
.tracks-status .hint { color: var(--dust); font-size: var(--step--1); }
.tracks-head .progress { max-width: none; }
.done-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.done-note .num { font-size: var(--step-3); line-height: 1; color: var(--heat); }

.tracks { list-style: none; margin: 0; padding: 0; display: grid; }
.tracks-cols {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) 4.2rem;
    gap: 12px;
    padding: 0 12px 8px;
    color: var(--dust);
    font-size: 0.75rem;
}
.tracks-cols span:nth-child(n+3) { text-align: right; }
.track { border-bottom: 1px solid var(--groove); }
.track-head {
    width: 100%;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) 4.2rem;
    gap: 12px;
    align-items: center;
    min-height: 56px;
    padding: 8px 12px;
    background: none;
    border: 0;
    text-align: left;
    border-radius: 8px;
}
.track-head:hover { background: var(--sleeve); }
.track-no { color: var(--dust); font-variant-numeric: tabular-nums; }
.track-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-you { justify-self: end; }
.track-rate { color: var(--dust); font-size: var(--step--1); font-weight: 600; }
.track-head:hover .track-rate { color: var(--gold); }
.track-all { justify-self: end; color: var(--dust); font-variant-numeric: tabular-nums; font-size: var(--step--1); }
.track.is-open { background: var(--sleeve); border-radius: var(--radius-ui); border-bottom-color: transparent; margin-block: 6px; }
.track.is-open .track-head:hover { background: none; }

/* the fader: the one rating control in the app */
.rater {
    display: grid;
    gap: 14px;
    padding: 4px 16px 18px;
}
.rater-top { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.rater-num {
    font-variation-settings: "wdth" 62;
    font-weight: 800;
    font-size: 4rem;
    line-height: 0.85;
    font-variant-numeric: tabular-nums;
    color: var(--heat);
    transition: color 0.15s;
}
.rater-word { color: var(--heat); font-size: var(--step-1); font-weight: 700; line-height: 1.2; padding-bottom: 2px; text-align: right; transition: color 0.15s; }
.rater-word small { display: block; color: var(--dust); font-size: var(--step--1); font-weight: 500; }
.fader { position: relative; padding-top: 4px; }
.fader input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 44px;
    background: transparent;
    margin: 0;
    touch-action: pan-y;
}
.fader input::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 5px;
    background:
        linear-gradient(to right, var(--heat) 0 var(--fill), transparent var(--fill)),
        linear-gradient(to right, rgb(229 72 77 / 0.28), rgb(247 104 56 / 0.28) 30%, rgb(250 150 60 / 0.28) 50%, rgb(214 214 80 / 0.28) 60%, rgb(150 216 96 / 0.28) 70%, rgb(62 214 128 / 0.28) 80%, rgb(40 208 190 / 0.28) 90%, rgb(242 193 78 / 0.35) 95%),
        var(--groove);
}
.fader input::-moz-range-track { height: 10px; border-radius: 5px; background: linear-gradient(to right, rgb(229 72 77 / 0.28), rgb(250 150 60 / 0.28) 50%, rgb(150 216 96 / 0.28) 70%, rgb(40 208 190 / 0.28) 90%, rgb(242 193 78 / 0.35) 95%), var(--groove); }
.fader input::-moz-range-progress { height: 10px; border-radius: 5px; background: var(--heat); }
.fader input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px; height: 30px; margin-top: -10px;
    border-radius: 50%;
    background: var(--label);
    border: 4px solid var(--vinyl);
    box-shadow: 0 0 0 2px var(--heat);
}
.fader input::-moz-range-thumb {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--label);
    border: 4px solid var(--vinyl);
    box-shadow: 0 0 0 2px var(--heat);
}
.fader-ticks {
    display: flex;
    justify-content: space-between;
    padding-inline: 11px;
    color: var(--dust);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
    margin-top: -6px;
}
.fader-ticks button { background: none; border: 0; padding: 4px 0; width: 1.4em; margin-inline: -0.7em; text-align: center; color: inherit; }
.fader-ticks button:hover { color: var(--label); }
.rater-actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.rater-actions .btn-primary { flex: 1 1 auto; max-width: 260px; margin-left: auto; }

.clear-zone { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: var(--step--1); }

/* ---------- lists (people, activity) ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--groove);
}
.list-item .avatar { --size: 44px; }
.list-item .cover { width: 48px; border-radius: 4px; }
.list-main { min-width: 0; display: grid; gap: 1px; }
.list-main a { text-decoration: none; font-weight: 600; }
.list-main a:hover { text-decoration: underline; text-underline-offset: 3px; }
.list-sub { color: var(--dust); font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-item { grid-template-columns: 44px minmax(0, 1fr) auto; }
.activity-text { line-height: 1.4; }
.activity-text a { font-weight: 600; text-decoration: none; }
.activity-text a:hover { text-decoration: underline; text-underline-offset: 3px; }
.example-badge { font-size: 0.6875rem; color: var(--dust); border: 1px dashed var(--groove); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }

.two-col { display: grid; gap: 40px; }
@media (min-width: 1080px) { .two-col { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }

/* ---------- search ---------- */
.search-field {
    position: relative;
    display: flex;
    align-items: center;
}
.search-field svg { position: absolute; left: 16px; width: 20px; height: 20px; color: var(--dust); pointer-events: none; }
.search-field input {
    width: 100%;
    min-height: 56px;
    padding: 0 16px 0 48px;
    border-radius: var(--radius-ui);
    border: 1px solid var(--groove);
    background: var(--sleeve);
    font-size: var(--step-1);
}
.search-field input::placeholder { color: var(--dust); }
.search-field input:focus { outline: none; border-color: var(--dust); }

/* ---------- profile ---------- */
.profile-head { display: grid; gap: 18px; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.profile-head .avatar { --size: 84px; }
.profile-name { font-size: var(--step-3); }
.profile-sub { color: var(--dust); font-size: var(--step--1); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.name-form { display: flex; gap: 8px; flex-wrap: wrap; }
.input {
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-ui);
    border: 1px solid var(--groove);
    background: var(--sleeve);
    min-width: 0;
}
.input:focus { outline: none; border-color: var(--dust); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--groove); border-radius: var(--radius-ui); overflow: hidden; }
.stats > div { background: var(--vinyl); padding: 14px 16px; display: grid; gap: 2px; }
.stats dt { color: var(--dust); font-size: var(--step--1); }
.stats dd { margin: 0; font-size: var(--step-3); line-height: 1; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--groove); overflow: hidden; touch-action: manipulation; }
.tabs button { flex: none; }
.tabs button {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 10px 12px;
    margin-bottom: 0;
    color: var(--dust);
    font-weight: 650;
    white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--label); border-bottom-color: var(--gold); }

.note {
    padding: 16px;
    border-radius: var(--radius-ui);
    border: 1px solid var(--groove);
    display: grid;
    gap: 10px;
    font-size: var(--step--1);
    color: var(--dust);
}
.note strong { color: var(--label); font-size: var(--step-0); }
.note .btn { justify-self: start; }

.empty-state { display: grid; gap: 12px; justify-items: start; padding: 28px 0; color: var(--dust); max-width: 44ch; }
.empty-state strong { color: var(--label); font-size: var(--step-1); }

/* ---------- sheet (account) ---------- */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    top: var(--vvt, 0px);
    bottom: auto;
    height: var(--vvh, 100%);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 40;
    background: rgb(8 6 10 / 0.7);
    display: grid;
    place-items: end center;
    padding: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
}
.sheet {
    width: min(100%, 420px);
    background: var(--sleeve);
    border-radius: 16px 16px 0 0;
    padding: 24px max(20px, env(safe-area-inset-left, 0px)) calc(24px + env(safe-area-inset-bottom, 0px));
    display: grid;
    gap: 16px;
    max-height: 100%;
    overflow-y: auto;
}
@media (min-width: 640px) {
    .sheet-backdrop { place-items: center; }
    .sheet { border-radius: 16px; padding-bottom: 24px; }
}
.sheet h2 { font-size: var(--step-2); }
.sheet p { margin: 0; color: var(--dust); font-size: var(--step--1); }
.sheet form { display: grid; gap: 12px; }
.sheet label { display: grid; gap: 6px; font-size: var(--step--1); font-weight: 600; }
.sheet .input { width: 100%; }
.sheet-switch { font-size: var(--step--1); color: var(--dust); }
.form-error { color: #f08a7b; font-size: var(--step--1); min-height: 1.2em; }

/* ---------- toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 12px);
    z-index: 50;
    background: var(--label);
    color: var(--vinyl);
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 650;
    font-size: var(--step--1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { bottom: 24px; left: calc(50% + var(--rail) / 2); } }

.pop { animation: pop 0.45s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }

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

.artist-hero { width: min(50%, 180px); justify-self: center; }
@media (min-width: 720px) { .artist-hero { width: 260px; justify-self: start; } }
.list-item > a, .artist-card, .card { text-decoration: none; }

/* ---------- share sheet ---------- */
.share-sheet { gap: 14px; max-height: 100vh; overflow-y: auto; }
.share-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-buttons .btn:only-child { grid-column: 1 / -1; }
.share-preview {
    display: grid;
    place-items: center;
    min-height: 200px;
}
.share-preview img,
.share-preview video {
    height: min(52vh, 520px);
    width: auto;
    max-width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: contain;
    border-radius: 12px;
    background: var(--vinyl);
    border: 1px solid var(--groove);
}
.share-wait {
    display: grid;
    gap: 12px;
    width: min(100%, 280px);
    aspect-ratio: 9 / 16;
    max-height: 52vh;
    align-content: center;
    justify-items: center;
    padding: 24px;
    text-align: center;
    color: var(--dust);
    font-size: var(--step--1);
    border: 1px dashed var(--groove);
    border-radius: 12px;
}
.share-wait .progress { width: 100%; }
.share-help { min-height: 1.2em; }

/* tabs: count as a quiet number so four tabs fit a phone */
.tabs button .count { color: var(--dust); font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .tabs { gap: 0; justify-content: space-between; } .tabs button { padding: 10px 6px; font-size: var(--step--1); } }

/* toast above an open sheet instead of over its buttons */
body:has(.sheet-backdrop) .toast { bottom: auto; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -12px); }
body:has(.sheet-backdrop) .toast.show { transform: translate(-50%, 0); }

/* ---------- friends on an album, comparing with a friend ---------- */
.friend-scores { display: flex; gap: 8px; flex-wrap: wrap; }
.friend-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 4px;
    border: 1px solid var(--groove);
    border-radius: 999px;
    text-decoration: none;
    font-size: var(--step--1);
    font-weight: 600;
}
.friend-score:hover { border-color: var(--dust); }
.friend-score .avatar { --size: 26px; }
.friend-score .chip-score { height: 24px; border-radius: 999px; min-width: 2.8em; font-size: 0.8125rem; }
.compare-item { grid-template-columns: auto minmax(0, 1fr) auto; }
.compare-scores { display: flex; gap: 8px; }
.compare-scores > span { display: grid; justify-items: center; gap: 2px; }
.compare-scores small { color: var(--dust); font-size: 0.6875rem; max-width: 4.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-follow { margin-top: 10px; }

/* Everyone column appears once RATED users have rated tracks */
.tracks-cols.has-all, .tracks.has-all .track-head { grid-template-columns: 2rem minmax(0, 1fr) 4.2rem 4.4rem; }

/* ---------- stats and charts ---------- */
.bar-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--groove);
}
.bar-row > a { flex: none; text-decoration: none; }
.bar-row .avatar { --size: 44px; }
.bar-row .cover { width: 48px; border-radius: 4px; }
.bar-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.bar-text { display: grid; min-width: 0; line-height: 1.3; }
.bar-text > a, .bar-text > span:first-child { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bar-text > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bar-track { height: 6px; border-radius: 999px; background: var(--groove); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: var(--heat); }
.chart-rank { flex: none; width: 1.6em; text-align: center; color: var(--dust); font-weight: 800; font-size: var(--step-1); font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 62; }
.chart-rank.first { color: var(--gold); }
.chart-controls { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 8px; }
.genre-link { color: var(--label); text-decoration: none; font-weight: 600; }
.genre-link:hover { text-decoration: underline; }

.stats-share { margin: 16px 0 0; }
.stats.taste { margin-top: 16px; }
.stats.taste dd { font-size: var(--step-2); font-weight: 800; font-variation-settings: "wdth" 62; line-height: 1.1; overflow-wrap: anywhere; }
.stats.taste dd a { text-decoration: none; }
.stats.taste dd a:hover { text-decoration: underline; text-underline-offset: 3px; }
.taste-sub { color: var(--dust); font-size: var(--step--1); line-height: 1.35; }
.stats-block { margin-top: 32px; }
.stats-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 8px; }
.stats-head h3 { font-size: var(--step-1); }
.stats-head p { margin: 0; color: var(--dust); font-size: var(--step--1); }
.histogram { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 180px; align-items: end; padding-top: 8px; }
.histo-col { height: 100%; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; }
.histo-col .histo-bar { align-self: end; width: 100%; min-height: 3px; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--heat) 80%, transparent); }
.histo-n { font-size: var(--step--1); color: var(--label); font-weight: 700; font-variant-numeric: tabular-nums; min-height: 1.4em; }
.histo-label { font-size: var(--step--1); color: var(--dust); font-variant-numeric: tabular-nums; }
.take-up { color: hsl(130 50% 62%); }
.take-down { color: hsl(8 70% 66%); }

/* ---------- safety: report, block, delete ---------- */
.profile-safety { display: flex; gap: 16px; margin-top: 10px; font-size: var(--step--1); }
.danger-link { color: #f08a7b; }
.btn-danger { background: #c9473a; border-color: #c9473a; color: #fff; }
.sheet-note { margin: 0; color: var(--dust); font-size: var(--step--1); }
.sheet-note a, .legal-links a { color: var(--label); }
.report-reasons { display: grid; gap: 10px; }
.report-reason { display: flex !important; gap: 10px; align-items: center; font-weight: 500 !important; font-size: var(--step-0) !important; }
.report-reason input { width: 20px; height: 20px; accent-color: var(--gold); }
.report-more textarea { padding: 10px 14px; min-height: 80px; resize: vertical; }
.legal-links { display: flex; gap: 16px; justify-content: center; margin: 28px 0 8px; font-size: var(--step--1); color: var(--dust); }

.edition-note { margin: 6px 0 0; color: var(--dust); font-size: var(--step--1); line-height: 1.45; }
.edition-note a { color: var(--label); }
