/*
 * Liner notes: neutral black, white, and a single electric blue for what moves or can be clicked.
 * The only other colors on the page are the covers'. A single family, Hanken Grotesk
 * (hosted here, public/fonts/LICENSES.md): hierarchy comes from weight, size
 * and grey.
 */

@font-face {
    font-family: 'Hanken Grotesk';
    src: url('../fonts/hanken-grotesk-variable.woff2') format('woff2');
    font-weight: 400 800;
    font-display: swap;
}

:root {
    color-scheme: dark;

    --bg: #0f1012;
    --raised: #18191c;
    --rule: #26282d;
    --ink: #f3f3f4;
    --ink-dim: #9b9da4;
    --ink-faint: #7a7d85;
    --accent: #4f7dff;
    --accent-deep: #2e4fb0;
    --spotify: #1ed760;

    --font: 'Hanken Grotesk', system-ui, sans-serif;

    /* Perfect fourth scale (1.333), from 1 rem. */
    --step--1: 0.8125rem;
    --step-0: 1rem;
    --step-1: 1.333rem;
    --step-2: 1.777rem;
    --step-3: 2.369rem;

    --gutter: clamp(1rem, 5vw, 2.5rem);
    --measure: 44rem;
}

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

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100svh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.55;
    font-kerning: normal;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration-color: var(--ink-faint);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

a:hover {
    text-decoration-color: var(--accent);
}

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

.page {
    width: 100%;
    max-width: calc(var(--measure) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter) 5rem;
}

/* Header. */

.masthead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding: 1.5rem 0 3rem;
}

.masthead-name {
    font-weight: 750;
    font-size: var(--step-0);
    letter-spacing: -0.01em;
    text-decoration: none;
}

.masthead-end {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: var(--step--1);
}

/* Stands in for a profile photo: the pseudo's initial in a grey disc. */
.avatar {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--raised);
    border: 1px solid var(--rule);
    color: var(--ink-dim);
    font-weight: 700;
    font-size: 0.875rem;
}

/* Burger menu: a native <details>, no script; the panel drops under the button. */
.menu {
    position: relative;
}

.menu-toggle {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
}

.menu-toggle::-webkit-details-marker {
    display: none;
}

.menu-toggle:hover,
.menu[open] .menu-toggle {
    border-color: var(--accent);
}

.menu-bars,
.menu-bars::before,
.menu-bars::after {
    display: block;
    width: 1rem;
    height: 2px;
    background: var(--ink);
    border-radius: 1px;
}

.menu-bars {
    position: relative;
}

.menu-bars::before,
.menu-bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-bars::before {
    top: -5px;
}

.menu-bars::after {
    top: 5px;
}

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 10;
    display: flex;
    flex-direction: column;
    min-width: 13rem;
    padding: 0.5rem 0;
    background: var(--raised);
    border: 1px solid var(--rule);
    border-radius: 0.5rem;
}

.menu-panel a {
    padding: 0.5rem 1rem;
    color: var(--ink);
    text-decoration: none;
}

.menu-panel a:hover,
.menu-panel a:focus-visible {
    color: var(--accent);
}

.menu-panel .menu-account {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule);
}

.menu-panel .menu-logout {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rule);
    color: var(--ink-dim);
}

/* Headings. */

.title {
    margin: 0 0 1rem;
    font-weight: 750;
    font-size: clamp(var(--step-3), 7vw, 3.5rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.subtitle {
    margin: 0 0 2.5rem;
    color: var(--ink-dim);
    max-width: 34rem;
}

/* Login page: the name, large, alone. */

.cover {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100svh;
    padding: 3rem 0;
}

.cover-name {
    margin: 0;
    font-weight: 800;
    font-size: clamp(3.5rem, 15vw, 7.5rem);
    line-height: 0.92;
    letter-spacing: -0.05em;
}

.cover-name span {
    color: var(--accent);
}

.cover-line {
    margin: 1.5rem 0 2.5rem;
    max-width: 24rem;
    font-size: var(--step-1);
    line-height: 1.35;
    color: var(--ink-dim);
}

/* Buttons and fields. */

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    font: inherit;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--ink);
    border-color: var(--ink);
}

.button-quiet {
    background: transparent;
    color: var(--ink);
    border-color: var(--rule);
}

.button-quiet:hover {
    background: transparent;
    border-color: var(--accent);
}

.button svg {
    width: 1.2em;
    height: 1.2em;
    flex: none;
}

.form {
    display: grid;
    gap: 1.25rem;
    max-width: 30rem;
}

.form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--ink-dim);
}

.form input[type='text'],
.form input[type='email'],
.form input[type='password'] {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--raised);
    color: var(--ink);
    font: inherit;
}

.form input[type='text']::placeholder,
.form input[type='email']::placeholder,
.form input[type='password']::placeholder {
    color: var(--ink-faint);
}

.form input[type='text']:focus-visible,
.form input[type='email']:focus-visible,
.form input[type='password']:focus-visible {
    border-color: var(--accent);
    outline-offset: 1px;
}

.form ul {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--accent);
}

.notice {
    margin: 0 0 1.5rem;
    color: var(--accent);
}

/* Playlist list. */

.playlists {
    margin: 2.5rem 0 3rem;
    padding: 0;
    list-style: none;
}

.playlist {
    display: grid;
    grid-template-columns: 1.5rem 4rem 1fr;
    column-gap: 1rem;
    align-items: start;
    padding: 1.1rem 0 1.25rem;
    border-top: 1px solid var(--rule);
}

.playlist-body {
    min-width: 0;
}

/* Each member orders their list: a grip to drag, ↑ ↓ on hover or focus (forms, no script). */
.playlist-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    align-self: start;
    margin-top: 1.1rem;
    color: var(--ink-faint);
}

.playlist-handle form {
    margin: 0;
}

.playlist-grip {
    cursor: grab;
    font-size: 1.1rem;
    line-height: 1;
    letter-spacing: -2px;
    user-select: none;
    touch-action: none;
}

.playlist-move {
    padding: 0.1rem;
    border: 0;
    background: none;
    color: var(--ink-faint);
    font: inherit;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
}

.playlist:hover .playlist-move,
.playlist-move:focus-visible {
    opacity: 1;
}

.playlist-move:hover {
    color: var(--accent);
}

.playlist.is-dragging {
    opacity: 0.5;
}

@media (hover: none) {
    .playlist-move {
        opacity: 1;
    }
}

/* Playlist cover: the Spotify one, or a 2x2 mosaic of track covers, or a drawn disc. */
.playlist-cover {
    position: relative;
    display: grid;
    width: 4rem;
    height: 4rem;
    overflow: hidden;
    border-radius: 4px;
    background: var(--raised);
}

.playlist-cover > img,
.playlist-cover > .track-cover {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
}

.playlist-cover > .track-cover-none {
    border-radius: 50%;
}

.playlist-cover-mosaic {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.playlist-cover-mark {
    position: absolute;
    right: 0.25rem;
    bottom: 0.25rem;
    display: flex;
    width: 1rem;
    height: 1rem;
    color: #fff;
    filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.7));
}

.playlist-cover-mark svg {
    width: 100%;
    height: 100%;
}

.playlist:last-child {
    border-bottom: 1px solid var(--rule);
}

.playlist-name {
    font-weight: 700;
    font-size: var(--step-2);
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.playlist-name:hover {
    color: var(--accent);
}

.playlist-meta {
    margin: 0.3rem 0 0;
    font-size: var(--step--1);
    color: var(--ink-dim);
}

.empty {
    margin: 0 0 2rem;
    font-size: var(--step-1);
    line-height: 1.4;
    color: var(--ink-dim);
}

/*
 * The sync panel: what each source brings, leader dots, then the source.
 * The dots light up as it progresses.
 */

.sync {
    margin: 1.25rem 0 0.5rem;
}

.sync-lead {
    margin: 0 0 1rem;
    max-width: 34rem;
}

.credits {
    display: grid;
    grid-template-columns: 1fr max-content max-content;
    gap: 0 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.credit {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: baseline;
    row-gap: 0.1rem;
    padding: 0.4rem 0;
}

.credit-what {
    grid-column: 1 / -1;
    font-size: var(--step--1);
    color: var(--ink-dim);
}

.credit-leader {
    position: relative;
    height: 0.5em;
    min-width: 2rem;
    background: radial-gradient(circle, var(--rule) 1.1px, transparent 1.6px) left center / 7px 100% repeat-x;
}

.credit-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--done, 0) * 100%);
    background: radial-gradient(circle, var(--accent) 1.3px, transparent 1.8px) left center / 7px 100% repeat-x;
    transition: width 0.8s ease-out;
}

.credit-who {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    font-weight: 650;
    white-space: nowrap;
    text-decoration: none;
}

.credit-who:hover {
    color: var(--accent);
}

.credit-who .spotify-mark svg,
.credit-who .source-icon {
    transform: translateY(0.12em);
}

/* The mark of a data source next to its name (Spotify icon, MetaBrainz icons). */
.source-icon {
    width: 0.9em;
    height: 1em;
    flex: none;
}

.source-icon-deezer {
    width: 1.05em;
}

.source-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    white-space: nowrap;
}

.source-link .source-icon,
.source-link .spotify-mark svg {
    transform: translateY(0.12em);
}

.credit-count {
    justify-self: end;
    min-width: 4.5rem;
    text-align: right;
    font-size: var(--step--1);
    color: var(--ink-dim);
    font-variant-numeric: tabular-nums;
}

.credit[data-state='waiting'] .credit-who {
    color: var(--ink-faint);
    font-weight: 500;
}

.credit[data-state='done'] .credit-who {
    color: var(--ink);
}

/* Source at work with no known total (reading Spotify): the dots scroll. */
.credit[data-state='busy'] .credit-fill {
    width: 100%;
    mask-image: linear-gradient(90deg, transparent, #000 40%, #000 60%, transparent);
    mask-size: 40% 100%;
    mask-repeat: no-repeat;
    animation: leader-sweep 1.6s linear infinite;
}

@keyframes leader-sweep {
    from {
        mask-position: -40% 0;
    }

    to {
        mask-position: 140% 0;
    }
}

.sync-quip {
    min-height: 1.55em;
    margin: 0.9rem 0 0;
    font-size: var(--step--1);
    color: var(--accent);
    transition: opacity 0.4s ease;
}

.sync-quip.is-changing {
    opacity: 0;
}

.sync-failed {
    margin: 0.5rem 0 0;
    color: var(--accent);
}

/* Sync state (running, waiting for its enrichment, paused) and its controls, for whoever added
   the playlist: discreet underlined buttons, "Passer devant" in blue. */
.sync-state {
    margin: 0.35rem 0 0;
    font-size: var(--step--1);
    color: var(--ink-faint);
}

.sync-state strong {
    color: var(--ink-dim);
    font-weight: 600;
}

.sync-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0.9rem 0 0;
    font-size: var(--step--1);
}

.sync-controls form {
    margin: 0;
}

.sync-control {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-dim);
    font: inherit;
    text-decoration: underline;
    text-decoration-color: var(--rule);
    text-underline-offset: 3px;
    cursor: pointer;
}

.sync-control:hover {
    color: var(--accent);
}

.sync-control-prioritize {
    color: var(--accent);
    text-decoration-color: currentColor;
}

/* Playlist page. */

.playlist-head {
    margin-bottom: 2.5rem;
}

.playlist-head-top {
    display: grid;
    grid-template-columns: 8rem 1fr;
    column-gap: 1.25rem;
    align-items: end;
}

.playlist-head-top .playlist-cover {
    width: 8rem;
    height: 8rem;
    margin-bottom: 1.25rem;
    border-radius: 6px;
}

@media (max-width: 30rem) {
    .playlist-head-top {
        grid-template-columns: 1fr;
    }
}

.playlist-head .subtitle {
    margin-bottom: 1.25rem;
}

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

.track {
    display: grid;
    grid-template-columns: 4rem 1fr auto;
    column-gap: 1rem;
    padding: 1rem 0 1.05rem;
    border-top: 1px solid var(--rule);
}

/* The cover; failing that, a disc. */
.track-cover {
    width: 4rem;
    height: 4rem;
    border-radius: 4px;
    object-fit: cover;
    background: var(--raised);
}

.track-cover-none {
    display: block;
    background:
        radial-gradient(circle, var(--accent-deep) 0 9%, var(--raised) 9.5% 13%, transparent 13.5%),
        repeating-radial-gradient(circle, #141518 0 1.2px, #1b1c20 1.2px 2.6px);
    border-radius: 50%;
}

.track-title {
    margin: 0;
    font-weight: 650;
    font-size: var(--step-1);
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.track-version {
    font-weight: 450;
    color: var(--ink-dim);
}

.track-artists {
    margin: 0.1rem 0 0;
    color: var(--ink-dim);
}

.track-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 1rem;
    margin: 0.45rem 0 0;
    padding: 0;
    list-style: none;
    font-size: var(--step--1);
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

.track-genres {
    color: var(--ink-dim);
}

/* The Spotify logo in dimmed white (allowed by its guidelines), green on hover. */
.track-open {
    align-self: start;
    display: inline-flex;
    padding: 0.4rem;
    margin: -0.2rem -0.4rem 0 0;
    border-radius: 999px;
    color: var(--ink-faint);
}

.track-open svg {
    width: 1.15rem;
    height: 1.15rem;
}

.track-open:hover,
.track-open:focus-visible {
    color: var(--spotify);
    background: var(--raised);
}

.track[data-provisional] .track-cover {
    opacity: 0.6;
}

.track[data-provisional] .track-title,
.track[data-provisional] .track-artists {
    color: var(--ink-dim);
}

.spotify-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.spotify-mark svg {
    width: 1em;
    height: 1em;
    color: var(--spotify);
}

.sources {
    margin: 4rem 0 0;
    font-size: var(--step--1);
    color: var(--ink-faint);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (min-width: 40rem) {
    .credits {
        grid-template-columns: max-content 1fr max-content max-content;
    }

    .credit {
        padding: 0.2rem 0;
    }

    .credit-what {
        grid-column: auto;
        font-size: var(--step-0);
    }
}

@media (max-width: 24rem) {
    .track {
        grid-template-columns: 3rem 1fr auto;
        column-gap: 0.8rem;
    }

    .track-cover {
        width: 3rem;
        height: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .credit-fill,
    .sync-quip {
        transition: none;
    }

    .credit[data-state='busy'] .credit-fill {
        animation: none;
        mask-image: none;
        opacity: 0.5;
    }
}

/* Playlist members and invitation links. */

.members {
    margin: 1.25rem 0 0;
    font-size: var(--step--1);
    color: var(--ink-dim);
}

.members-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 1rem;
    margin: 0;
}

.members-invite {
    display: inline;
}

/* An action that reads as a link: blue, underlined on hover. */
.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
    text-underline-offset: 0.22em;
}

.invitations {
    margin: 1rem 0 0;
    padding: 1rem 1.1rem 1.1rem;
    border: 1px solid var(--rule);
    border-radius: 8px;
}

.invitations-lead {
    margin: 0 0 0.75rem;
    max-width: 34rem;
}

.invitation-links {
    display: grid;
    gap: 0.9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.invitation-field {
    display: flex;
    gap: 0.5rem;
}

.invitation-field input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--raised);
    color: var(--ink);
    font: inherit;
}

.invitation-field .button {
    padding: 0.55rem 1rem;
}

.invitation-expiry {
    display: block;
    margin-top: 0.35rem;
    color: var(--ink-faint);
}

/* Invitation page: laid out like the login page. */

.invitation-title {
    margin: 0;
    max-width: 36rem;
    font-weight: 800;
    font-size: clamp(var(--step-3), 8vw, 4rem);
    line-height: 1;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.invitation .invitation-expiry {
    margin-top: 1rem;
    font-size: var(--step--1);
}

/* Track list: the title leads to the track page, the thread line is the only blue in a row. */

.track-title a {
    text-decoration: none;
}

.track-title a:hover {
    color: var(--accent);
}

.track-threads {
    margin: 0.45rem 0 0;
    font-size: var(--step--1);
    font-weight: 600;
}

.track-threads a {
    color: var(--accent);
    text-decoration: none;
}

.track-threads a:hover {
    text-decoration: underline;
}

/* Track page. */

.back {
    margin: -1.5rem 0 1.5rem;
    font-size: var(--step--1);
    color: var(--ink-dim);
}

.back a {
    text-decoration: none;
}

.back a::before {
    content: '\2190\00a0';
}

.back a:hover {
    color: var(--accent);
}

.track-head {
    display: grid;
    grid-template-columns: 8rem 1fr;
    column-gap: 1.25rem;
    align-items: start;
    margin-bottom: 2.5rem;
}

.track-head .track-cover {
    width: 8rem;
    height: 8rem;
    border-radius: 6px;
}

.track-head .track-cover-none {
    border-radius: 50%;
}

.track-head-title {
    margin: 0;
    font-weight: 750;
    font-size: clamp(var(--step-2), 5vw, var(--step-3));
    line-height: 1.05;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.track-head-open {
    margin-top: 1rem;
}

.track-head[data-provisional] .track-cover {
    opacity: 0.6;
}

/* Account page: one section per connected service. */

.account-password,
.account-spotify {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

.account-heading {
    margin: 0 0 0.75rem;
    font-size: var(--step-1);
    font-weight: 650;
}

.account-state {
    margin: 0 0 0.5rem;
}

.account-help {
    max-width: 36rem;
    margin: 0 0 1.25rem;
    font-size: var(--step--1);
    color: var(--ink-dim);
}

.account-help a {
    color: var(--accent);
}

.account-spotify form {
    margin: 0 0 1.25rem;
}

/* Track list filters: a row of menus above the list, scrolled sideways on a phone; a set filter
   turns blue. Then the count of matching tracks, and the pager under the list. */

.filters {
    margin: 0 0 1.25rem;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.filter {
    appearance: none;
    min-height: 2.25rem;
    padding: 0.35rem 1.9rem 0.35rem 0.85rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239b9da4' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0.8rem center;
    color: var(--ink-dim);
    font: inherit;
    font-size: var(--step--1);
    white-space: nowrap;
    cursor: pointer;
}

.filter option {
    background: var(--raised);
    color: var(--ink);
}

.filter:hover {
    border-color: var(--ink-faint);
}

.filter:focus-visible,
.filter-bpm:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.filter[data-active] {
    border-color: var(--accent);
    color: var(--ink);
}

.filter-bpm {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding-right: 0.85rem;
    background-image: none;
    cursor: auto;
}

.filter-bpm input {
    width: 2.6rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    text-align: center;
    font-variant-numeric: tabular-nums;
    appearance: textfield;
}

.filter-bpm input::-webkit-inner-spin-button,
.filter-bpm input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

.filter-bpm input:focus {
    outline: none;
}

.filter-bpm input::placeholder {
    color: var(--ink-faint);
}

.filter-bpm-dash::before {
    content: '\2013';
}

.filters-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
}

.filters-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    font-size: var(--step--1);
    color: var(--ink-faint);
}

.filters.is-live .filters-submit {
    display: none;
}

.filters-count {
    margin: 0;
    font-size: var(--step--1);
    color: var(--ink-dim);
    font-variant-numeric: tabular-nums;
}

.filters-count a {
    margin-left: 0.75rem;
    color: var(--accent);
    text-decoration: none;
}

.filters-count a:hover {
    text-decoration: underline;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1.5rem;
    margin: 1.5rem 0;
    font-size: var(--step--1);
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

.pager a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.pager a:hover {
    text-decoration: underline;
}

.pager-previous::before {
    content: '\2190\00a0';
}

.pager-next {
    margin-left: auto;
}

.pager-next::after {
    content: '\00a0\2192';
}

/* On a phone the menus scroll sideways, past the gutter, rather than stacking up. */
@media (max-width: 40rem) {
    .filters-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 calc(-1 * var(--gutter));
        padding: 0.2rem var(--gutter) 0.4rem;
        scrollbar-width: none;
    }

    .filters-bar::-webkit-scrollbar {
        display: none;
    }

    .filters-bar > * {
        flex: none;
    }
}

/* Track being listened to (public/js/now-playing.js): a blue rule on its row, a state line, a thin
   progress bar; on a track page, a timeline under the header; a pill when it is off screen. */

.track[data-now-playing] {
    position: relative;
    box-shadow: inset 3px 0 0 var(--accent);
    padding-left: 0.85rem;
    margin-left: -0.85rem;
}

.now-playing-line {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.4rem 0 0;
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.now-playing-time::before {
    content: '\00b7';
    margin-right: 0.45rem;
}

.now-playing-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    width: 0.8rem;
    height: 0.75rem;
}

.now-playing-eq i {
    flex: 1;
    height: 40%;
    background: currentColor;
    border-radius: 1px;
}

[data-now-playing='playing'] .now-playing-eq i {
    animation: now-playing-eq 0.9s ease-in-out infinite alternate;
}

[data-now-playing='playing'] .now-playing-eq i:nth-child(2) {
    animation-delay: -0.3s;
}

[data-now-playing='playing'] .now-playing-eq i:nth-child(3) {
    animation-delay: -0.6s;
}

@keyframes now-playing-eq {
    from {
        height: 25%;
    }

    to {
        height: 100%;
    }
}

.now-playing-bar {
    grid-column: 1 / -1;
    height: 2px;
    margin-top: 0.9rem;
    background: var(--rule);
    border-radius: 1px;
    overflow: hidden;
}

.now-playing-fill {
    display: block;
    height: 100%;
    background: var(--accent);
    transform-origin: left;
    transform: scaleX(var(--progress, 0));
    transition: transform 1s linear;
}

.now-playing-timeline {
    margin: -1.25rem 0 2.5rem;
}

.now-playing-timeline .now-playing-bar {
    position: relative;
    height: 4px;
    margin-top: 0.6rem;
    overflow: visible;
}

.now-playing-timeline .now-playing-fill {
    border-radius: 2px;
}

.now-playing-times {
    display: flex;
    justify-content: space-between;
    margin: 0.4rem 0 0;
    font-size: var(--step--1);
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

.now-playing-pill {
    position: fixed;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    max-width: calc(100vw - 2rem);
    padding: 0.55rem 0.95rem;
    transform: translateX(-50%);
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--raised);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 50%);
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.now-playing-pill[hidden] {
    display: none;
}

.now-playing-pill .now-playing-title {
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}

.now-playing-pill::after {
    content: '\2193';
}

.now-playing-pill[data-target='page']::after {
    content: '\2192';
}

.now-playing-pill:hover,
.now-playing-pill:focus-visible {
    border-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
    [data-now-playing='playing'] .now-playing-eq i {
        animation: none;
        height: 70%;
    }

    .now-playing-fill {
        transition: none;
    }
}

/* Threads: no cards, a rule between threads; replies hang off a thin line. */

.thread {
    padding: 1.5rem 0 1.75rem;
    border-top: 1px solid var(--rule);
}

.thread:last-child {
    border-bottom: 1px solid var(--rule);
}

.thread-title {
    margin: 0 0 0.75rem;
    font-weight: 700;
    font-size: var(--step-1);
    line-height: 1.2;
    letter-spacing: -0.015em;
}

/* The three free fields, read like liner credits: label, dot leaders, value. */
.thread-notes {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.15rem 0.6rem;
    margin: 0 0 1.1rem;
    font-size: var(--step--1);
}

.thread-note {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: baseline;
}

.thread-note dt {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    min-width: 9rem;
    color: var(--ink-dim);
}

.thread-note dt::after {
    content: '';
    flex: 1;
    min-width: 1.5rem;
    height: 0.5em;
    background: radial-gradient(circle, var(--rule) 1.1px, transparent 1.6px) left center / 7px 100% repeat-x;
}

.thread-note dd {
    margin: 0;
    color: var(--ink);
}

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

.message-reply {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--rule);
}

.message-meta {
    margin: 0 0 0.2rem;
    font-size: var(--step--1);
    color: var(--ink-faint);
}

.message-author {
    font-weight: 650;
    color: var(--ink-dim);
}

.message-body {
    max-width: 38rem;
    overflow-wrap: anywhere;
}

.message-deleted {
    margin: 0;
    color: var(--ink-faint);
}

/* A deleted thread: one grey line in its place, between the same rules. */
.thread-deleted {
    margin: 0;
    padding: 1rem 0;
    color: var(--ink-faint);
}

.message-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.35rem;
    font-size: var(--step--1);
}

.message-actions a {
    color: var(--ink-faint);
    text-decoration: none;
}

.message-actions a:hover {
    color: var(--accent);
}

.message-actions .link-button {
    color: var(--ink-faint);
    font-weight: 400;
}

.message-actions .link-button:hover {
    color: var(--accent);
}

.reply-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.6rem;
    max-width: none;
    margin-top: 1.1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--rule);
}

.reply-form > div {
    flex: 1 1 18rem;
}

.reply-form p {
    margin: 0;
}

.form textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--raised);
    color: var(--ink);
    font: inherit;
    line-height: 1.5;
    resize: vertical;
}

.form textarea::placeholder {
    color: var(--ink-faint);
}

.form textarea:focus-visible {
    border-color: var(--accent);
    outline-offset: 1px;
}

.thread-new {
    margin-top: 2rem;
}

.thread-new summary {
    list-style: none;
}

.thread-new summary::-webkit-details-marker {
    display: none;
}

.thread-new[open] summary {
    margin-bottom: 1.5rem;
}

.thread-form {
    max-width: 38rem;
}

@media (max-width: 30rem) {
    .track-head {
        grid-template-columns: 5rem 1fr;
        column-gap: 1rem;
    }

    .track-head .track-cover {
        width: 5rem;
        height: 5rem;
    }

    .thread-notes {
        grid-template-columns: 1fr;
    }

    .thread-note dt {
        min-width: 0;
    }

    .thread-note dt::after {
        display: none;
    }
}

/* Stats page: lists "à la Canard PC" (label, bar, count and share) and the BPM curve. */

.stats-back {
    margin: 0 0 1rem;
    font-size: var(--step--1);
}

.stats-back a,
.playlist-stats-link a {
    color: var(--accent);
    text-decoration: none;
}

.stats-back a:hover,
.playlist-stats-link a:hover {
    text-decoration: underline;
}

.playlist-stats-link {
    margin: 0.75rem 0 0;
    font-size: var(--step--1);
}

.stat {
    margin: 0;
    padding: 1.75rem 0 2rem;
    border-top: 1px solid var(--rule);
}

.stat-heading {
    margin: 0 0 0.35rem;
    font-weight: 700;
    font-size: var(--step-1);
    letter-spacing: -0.015em;
}

.stat-basis {
    margin: 0 0 1.25rem;
    font-size: var(--step--1);
    color: var(--ink-faint);
}

.stat-bars {
    display: grid;
    grid-template-columns: auto minmax(6rem, 11rem) 1fr 6.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--step--1);
}

/* Each row shares the list's columns: flag (or "?" of an uncommon label), label, rail, value. */
.stat-bars > li {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
}

.stat-bar {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template-columns: subgrid;
    align-items: center;
    padding: 0.2rem 0;
}

.stat-bar .stat-icon {
    grid-column: 1;
    margin-right: 0.4rem;
}

.stat-bar .stat-label {
    grid-column: 2;
    padding-right: 0.75rem;
}

.stat-bar .stat-rail {
    grid-column: 3;
    margin-right: 0.75rem;
}

.stat-bar .stat-value {
    grid-column: 4;
}

.stat-bars .language-search {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    margin-right: 0.4rem;
}

.stat-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.stat-rail {
    height: 0.6rem;
    border-radius: 0 4px 4px 0;
    background: var(--rule);
    overflow: hidden;
}

.stat-fill {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
}

a.stat-bar {
    margin: 0 -0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: inherit;
    text-decoration: none;
}

a.stat-bar:hover .stat-label,
a.stat-bar:focus-visible .stat-label {
    color: var(--accent);
    text-decoration: underline;
}

a.stat-bar:hover {
    background: var(--raised);
}

a.stat-bar:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 0;
}

.stat-value {
    text-align: right;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 30rem) {
    .stat-bars {
        grid-template-columns: auto minmax(0, 1fr) 5.5rem;
    }

    .stat-bar {
        row-gap: 0.25rem;
    }

    .stat-bar .stat-value {
        grid-column: 3;
        grid-row: 1;
    }

    .stat-bar .stat-rail {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-right: 0;
    }

    .stat-bars .language-search {
        align-self: start;
        margin-top: 0.2rem;
    }
}

.bpm-chart {
    position: relative;
    margin: 0;
}

.bpm-chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    touch-action: pan-y;
    cursor: pointer;
}

.bpm-chart svg:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.bpm-grid {
    stroke: var(--rule);
    stroke-width: 1;
}

.bpm-chart [hidden] {
    display: none;
}

.bpm-axis {
    fill: var(--ink-faint);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.bpm-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.bpm-isolated {
    fill: var(--accent);
}

.bpm-cursor {
    stroke: var(--ink-dim);
    stroke-width: 1;
}

.bpm-dot {
    fill: var(--accent);
    stroke: var(--bg);
    stroke-width: 2;
}

.bpm-tooltip {
    position: absolute;
    top: -2.25rem;
    margin: 0;
    padding: 0.3rem 0.6rem;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: var(--step--1);
    background: var(--raised);
    border: 1px solid var(--rule);
    border-radius: 4px;
    pointer-events: none;
}

/* My threads: my messages under each thread; a three-line preview or in full. */

.view-switch {
    display: inline-flex;
    margin: 0 0 1.5rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    overflow: hidden;
}

.view-switch[hidden] {
    display: none;
}

.view-switch-option {
    padding: 0.35rem 0.9rem;
    border: 0;
    background: none;
    color: var(--ink-dim);
    font: inherit;
    font-size: var(--step--1);
    cursor: pointer;
}

.view-switch-option[aria-pressed="true"] {
    background: var(--raised);
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--accent);
}

.my-message {
    margin: 0.75rem 0 0;
    padding: 0 0 0 0.9rem;
    border-left: 1px solid var(--rule);
}

.my-message-date {
    margin: 0 0 0.2rem;
    font-size: var(--step--1);
    color: var(--ink-faint);
}

.my-message-body {
    overflow-wrap: anywhere;
}

.my-threads[data-view="preview"] .my-message-body {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

/* Footer of every page, and the consent line under the sign-in buttons. */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 4rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    font-size: var(--step--1);
    color: var(--ink-faint);
}

.site-footer a,
.legal-consent a {
    color: var(--ink-dim);
}

.site-footer a:hover,
.legal-consent a:hover {
    color: var(--accent);
}

.legal-consent {
    max-width: 24rem;
    margin: 1.25rem 0 0;
    font-size: var(--step--1);
    color: var(--ink-faint);
}

/* Legal notice and privacy policy: plain reading, sections between rules, the kept data as
   credits (what, then why and how long). */

.legal section {
    padding: 1.5rem 0 0.5rem;
    border-top: 1px solid var(--rule);
}

.legal h2 {
    margin: 0 0 0.75rem;
    font-size: var(--step-1);
    font-weight: 650;
}

.legal p,
.legal li,
.legal dd {
    max-width: 38rem;
    line-height: 1.55;
}

.legal p {
    margin: 0 0 1rem;
}

.legal a {
    color: var(--accent);
}

.legal-address {
    color: var(--ink-dim);
}

.legal-data {
    margin: 0 0 1rem;
}

.legal-data div {
    padding: 0.75rem 0;
}

.legal-data div + div {
    border-top: 1px dashed var(--rule);
}

.legal-data dt {
    font-weight: 650;
}

.legal-data dd {
    margin: 0.2rem 0 0;
    color: var(--ink-dim);
}

.legal-data .legal-data-how-long {
    font-size: var(--step--1);
    color: var(--ink-faint);
}

.legal-terms {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.legal-terms li {
    margin: 0 0 0.6rem;
}

.legal-terms ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.legal-see {
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    color: var(--ink-dim);
}

/* Flag of a language tied to one country (Intl\DisplayNames): an emoji, in the system's colour font. */
.flag {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    font-style: normal;
}

/* "Mode d'emploi" next to "Inviter quelqu'un": quieter than the action itself. */
.members-guide {
    font-size: var(--step--1);
    color: var(--ink-dim);
}

.members-guide:hover {
    color: var(--accent);
}

.cover-about {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
}

.cover-about:hover {
    text-decoration: underline;
}

/* How it works (/a-propos) and the invitation guide (/aide/inviter): numbered steps, big blue
   figures in the margin; an invented thread drawn like a real one, in a raised frame. */

.about-steps {
    counter-reset: step;
    margin: 0 0 2.5rem;
    padding: 0;
    list-style: none;
}

.about-steps li {
    counter-increment: step;
    position: relative;
    max-width: 36rem;
    padding: 0 0 1.5rem 3rem;
}

.about-steps li::before {
    content: counter(step);
    position: absolute;
    top: -0.2rem;
    left: 0;
    font-weight: 800;
    font-size: var(--step-2);
    line-height: 1;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.about-steps h2 {
    margin: 0 0 0.35rem;
    font-size: var(--step-1);
    font-weight: 650;
}

.about-steps p {
    margin: 0;
    color: var(--ink-dim);
    line-height: 1.5;
}

.about-example {
    margin: 0 0 2.5rem;
    padding: 1.25rem 1.25rem 0.5rem;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--raised);
}

.about-example figcaption {
    margin: 0 0 1rem;
    font-size: var(--step--1);
    color: var(--ink-faint);
}

.about-example-track {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1rem;
}

.about-example-track p {
    margin: 0;
}

.about-example .thread {
    padding: 0 0 0.75rem;
    border: 0;
}

.about-example .track-head-title {
    font-size: var(--step-1);
    font-weight: 700;
}

.about-more {
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

.about-more h2 {
    margin: 0 0 0.75rem;
    font-size: var(--step-1);
    font-weight: 650;
}

.about-more p,
.about-note {
    max-width: 38rem;
    margin: 0 0 1rem;
    line-height: 1.55;
    color: var(--ink-dim);
}

.about-more a:not(.source-link) {
    color: var(--accent);
}

.about-start {
    margin: 2rem 0 0;
}

/* "?" after an uncommon language: a web search, in a new tab. A small ringed figure. */
.language-search {
    display: inline-grid;
    place-items: center;
    width: 1.1rem;
    height: 1.1rem;
    border: 1px solid var(--rule);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ink-dim);
    text-decoration: none;
    vertical-align: 0.1em;
}

.language-search:hover,
.language-search:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

/* Mon compte, email + password: the form folded under "Changer…" once chosen; on /login, the
   same fold under the Spotify button. */
.account-change summary,
.login-password summary {
    cursor: pointer;
    color: var(--accent);
    font-size: var(--step--1);
}

.account-change[open] summary,
.login-password[open] summary {
    margin-bottom: 1.25rem;
}

.account-change {
    margin: 0 0 1.25rem;
}

.login-password {
    max-width: 24rem;
    margin: 1.5rem 0 0;
}

.form .help-text {
    margin-top: 0.35rem;
    font-size: var(--step--1);
    color: var(--ink-faint);
}

.account-saved {
    margin: 0 0 0.75rem;
}

/* Error pages (templates/bundles/TwigBundle/Exception/error.html.twig): the code, small and grey. */
.error-code {
    margin: -1.5rem 0 2rem;
    font-size: var(--step--1);
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}
