/* ==========================================================================
   Heardit — design system
   A dark, Spotify-adjacent identity rebuilt on design tokens.
   Everything traces back to the primitives in :root; no stray literals.
   ========================================================================== */

/* --- Self-hosted typeface (font-src 'self'): Manrope, OFL 1.1 --------------- */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400 800; /* variable */
    font-display: swap;
    src: url('../fonts/manrope-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens ---------------------------------------------------------------- */
:root {
    /* Surfaces — a single neutral hue, stepped only by lightness. */
    --bg: #0b0b0d;
    --surface-1: #151517;
    --surface-2: #1d1d20;
    --surface-3: #27272b;
    --control-bg: #0f0f11;   /* inputs are inset: darker than what holds them */
    --control-bg-hover: #131317;

    /* Text — four tiers carry the hierarchy alongside weight. */
    --text-1: #f5f5f6;
    --text-2: #bdbdc2;
    --text-3: #8b8b92;
    --text-4: #5e5e65;

    /* Borders — low-opacity white; present when sought, invisible otherwise. */
    --border-1: rgba(255, 255, 255, 0.07);
    --border-2: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.18);

    /* Brand — the play-button green glow. The one accent. */
    --brand: #1db954;
    --brand-bright: #1ed760;
    --brand-press: #199e48;
    --on-brand: #06210f;
    --brand-soft: rgba(29, 185, 84, 0.14);
    --brand-ring: rgba(29, 185, 84, 0.5);

    /* Destructive — desaturated red, used only for irreversible actions. */
    --danger: #f0616d;
    --danger-bright: #f47d87;
    --danger-soft: rgba(240, 97, 109, 0.13);

    /* Spacing — 4px base. */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* Radius — small for controls, larger as surfaces grow. */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 999px;

    /* Type scale — ~1.25 ratio off a 1rem body. */
    --fs-xs: 0.75rem;
    --fs-sm: 0.8125rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.375rem;
    --fs-2xl: 1.75rem;
    --fs-3xl: 2.25rem;
    --fs-display: 3rem;

    /* Elevation — dark leans on borders; shadows stay quiet. */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 32px -14px rgba(0, 0, 0, 0.7);
    --shadow-pop: 0 16px 40px -12px rgba(0, 0, 0, 0.65);

    /* Motion. */
    --ease: cubic-bezier(0.23, 1, 0.32, 1);
    --dur-1: 120ms;
    --dur-2: 180ms;

    --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        Helvetica, Arial, sans-serif;

    --embed-radius: 12px; /* matches the Spotify iframe corner */
}

/* --- Base ------------------------------------------------------------------ */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    /* A faint green aura at the top — the glow of the "now playing" bar. */
    background-image: radial-gradient(1100px 420px at 50% -160px, rgba(29, 185, 84, 0.10), transparent 70%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-2);
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    color: var(--text-1);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

a {
    color: var(--text-1);
    text-decoration: none;
    transition: color var(--dur-1) var(--ease);
}

a:hover {
    color: var(--brand-bright);
}

:focus-visible {
    outline: 2px solid var(--brand-ring);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

::selection {
    background: var(--brand-soft);
    color: var(--text-1);
}

/* Any dynamic figure gets tabular numerals to prevent reflow. */
.tnum, .score__value, .stat__num, .fader__scale {
    font-variant-numeric: tabular-nums;
}

/* Shared page shell. Each view manages its own inner max-width. */
.page-main {
    width: 100%;
    max-width: 960px;
    margin-inline: auto;
    padding: var(--space-6) var(--space-4) var(--space-8);
}

.section-title {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--text-1);
}

.eyebrow {
    margin: 0 0 var(--space-1);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-3);
}

.muted {
    color: var(--text-3);
}

/* Long-form body copy (the privacy page). */
.prose {
    max-width: 62ch;
    color: var(--text-2);
    line-height: 1.7;
}

.prose p {
    margin: 0 0 var(--space-4);
}

.prose a {
    color: var(--brand);
    font-weight: 600;
}

.prose a:hover {
    color: var(--brand-bright);
}

.empty {
    padding: var(--space-6) var(--space-4);
    text-align: center;
    color: var(--text-3);
    font-size: var(--fs-sm);
    border: 1px dashed var(--border-2);
    border-radius: var(--radius-md);
}

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-1);
}

.topbar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    width: 100%;
    max-width: 1120px;
    margin-inline: auto;
    padding: var(--space-3) var(--space-4);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-1);
    font-weight: 800;
    font-size: var(--fs-lg);
    letter-spacing: -0.02em;
    flex: 0 0 auto;
}

.brand:hover {
    color: var(--text-1);
}

.brand__mark {
    display: block;
    color: var(--brand);
    filter: drop-shadow(0 0 10px rgba(29, 185, 84, 0.5));
}

.brand__word {
    line-height: 1;
}

/* Search — a pill with an inline (self-hosted) SVG magnifier, no external icon. */
.search {
    order: 3;
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    position: relative;
    background: var(--control-bg);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-pill);
    transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.search:focus-within {
    border-color: var(--brand-ring);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.search__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--text-3);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: color var(--dur-1) var(--ease);
}

.search__btn:hover {
    color: var(--text-1);
}

.search__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    padding: 0 var(--space-4) 0 var(--space-1);
    border: 0;
    background: transparent;
    color: var(--text-1);
    font: inherit;
    font-size: var(--fs-sm);
}

.search__input::placeholder {
    color: var(--text-4);
}

.search__input:focus {
    outline: none;
}

/* Auth cluster (from _LoginPartial). */
.nav-auth {
    order: 2;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
    list-style: none;
    margin-block: 0;
    padding: 0;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    color: var(--text-2);
    font-weight: 600;
    font-size: var(--fs-sm);
    max-width: 42vw;
}

.nav-user:hover {
    color: var(--text-1);
    background: var(--surface-2);
    border-color: var(--border-1);
}

.nav-user__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .search {
        order: 2;
        flex: 1 1 auto;
        max-width: 460px;
        margin-inline: var(--space-3);
    }

    .nav-auth {
        order: 3;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0 var(--space-4);
    height: 40px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--dur-2) var(--ease),
        border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease),
        transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.btn:active {
    transform: scale(0.97);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.btn-sm {
    height: 34px;
    padding: 0 var(--space-3);
    font-size: var(--fs-xs);
}

.btn-lg {
    height: 48px;
    padding: 0 var(--space-5);
    font-size: var(--fs-base);
    margin: 0;
}

/* Primary — Spotify's black-on-green pill. */
.btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
    color: var(--on-brand);
}

.btn-primary:hover {
    background-color: var(--brand-bright);
    border-color: var(--brand-bright);
    color: var(--on-brand);
    transform: scale(1.02);
}

.btn-primary:active {
    background-color: var(--brand-press);
    border-color: var(--brand-press);
    transform: scale(0.97);
}

.btn-primary:focus,
.btn-primary:focus-visible {
    background-color: var(--brand);
    border-color: var(--brand);
    color: var(--on-brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Ghost — quiet secondary action. */
.btn-ghost {
    background-color: transparent;
    border-color: var(--border-2);
    color: var(--text-1);
}

.btn-ghost:hover {
    background-color: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text-1);
}

/* Ghost-danger — destructive, but restrained until hovered. */
.btn-ghost-danger {
    background-color: transparent;
    border-color: transparent;
    color: var(--text-3);
}

.btn-ghost-danger:hover {
    background-color: var(--danger-soft);
    border-color: transparent;
    color: var(--danger-bright);
}

.btn-block {
    width: 100%;
}

/* Disabled — neutral and clearly inert, overriding Bootstrap's default blue. */
.btn:disabled,
.btn[disabled],
.btn-primary:disabled,
.btn-primary.disabled {
    background-color: var(--surface-3);
    border-color: transparent;
    color: var(--text-4);
    opacity: 1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Bootstrap link-buttons used in the nav. */
.btn-link {
    background: none;
    border: none;
    color: var(--text-2);
    font: inherit;
    cursor: pointer;
}

.btn-link:hover {
    color: var(--text-1);
}

/* ==========================================================================
   Surfaces / cards
   ========================================================================== */
.panel {
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.card {
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    color: var(--text-2);
}

/* ==========================================================================
   Score chip — the signature. A critic's decimal, in brand green.
   ========================================================================== */
.score {
    display: inline-flex;
    align-items: baseline;
    gap: 0.1em;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: -0.02em;
    line-height: 1;
}

.score__value {
    font-size: 1em;
}

.score__scale {
    font-size: 0.5em;
    font-weight: 700;
    color: var(--text-3);
    letter-spacing: 0;
}

.score--chip {
    flex: 0 0 auto;
    justify-content: center;
    min-width: 58px;
    padding: var(--space-2) var(--space-2);
    font-size: var(--fs-xl);
    background: var(--brand-soft);
    border: 1px solid rgba(29, 185, 84, 0.28);
    border-radius: var(--radius-sm);
}

.score--hero {
    font-size: var(--fs-3xl);
}

.score--input {
    font-size: var(--fs-xl);
}

/* ==========================================================================
   Avatar — initials, album-art rounded square. Replaces remote placeholders.
   ========================================================================== */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: linear-gradient(145deg, var(--surface-3), var(--surface-2));
    color: var(--text-1);
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--border-2);
    overflow: hidden;
    user-select: none;
}

.avatar--xs {
    width: 26px;
    height: 26px;
    font-size: 0.6875rem;
    border-radius: var(--radius-xs);
}

.avatar--sm {
    width: 42px;
    height: 42px;
    font-size: var(--fs-base);
    border-radius: var(--radius-sm);
}

.avatar--xl {
    width: 96px;
    height: 96px;
    font-size: var(--fs-3xl);
    border-radius: var(--radius-lg);
}

/* A green sheen so the avatar reads as part of the identity, not a gray box. */
.avatar--brand {
    background: linear-gradient(150deg, rgba(29, 185, 84, 0.28), var(--surface-2) 62%);
    color: var(--text-1);
}

/* ==========================================================================
   Feed (Home / Search) — playable embeds in a rhythmic grid
   ========================================================================== */
.feed__head {
    margin-bottom: var(--space-5);
}

.feed__title {
    font-size: var(--fs-3xl);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.feed__sub {
    margin: var(--space-1) 0 0;
    color: var(--text-3);
    font-size: var(--fs-sm);
}

.feed {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 720px) {
    .feed {
        grid-template-columns: repeat(2, 1fr);
    }
}

.track {
    display: flex;
    flex-direction: column;
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

.track:hover {
    border-color: var(--border-2);
    transform: translateY(-2px);
}

.track__player {
    position: relative;
    height: 152px; /* fixed slot: cover and player share it, so the swap never shifts the card */
    border-radius: var(--embed-radius);
    overflow: hidden;
    line-height: 0;
    background: var(--surface-2);
}

.track iframe {
    display: block;
    width: 100%;
    border: 0;
}
/* The player boots behind the cover and fades in once it has rendered (site.js). */
.track__player iframe {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--dur-2) var(--ease);
}
.track__player.is-playing iframe {
    opacity: 1;
}
.track__player .cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: opacity 240ms var(--ease), background-color var(--dur-2) var(--ease);
}
.track__player.is-playing .cover {
    opacity: 0;
    pointer-events: none;
}
.track__player.is-loading .cover {
    cursor: progress;
}
.track__player.is-loading .cover__play svg {
    display: none;
}
.track__player.is-loading .cover__play::after {
    content: "";
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid rgba(6, 33, 15, .35);
    border-top-color: var(--on-brand);
    animation: cover-spin 800ms linear infinite;
}
@keyframes cover-spin {
    to { transform: rotate(360deg); }
}

/* Cover facade: album art + play, in the 152px slot the embed will take once clicked.
   The art is a Spotify CDN image (img-src https:), the player is not loaded until then. */
.cover {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 152px;
    padding: var(--space-3);
    background: var(--surface-2);
    color: var(--text-1);
    text-decoration: none;
    line-height: 1.25;
    overflow: hidden;
    transition: background-color var(--dur-2) var(--ease);
}
.cover:hover {
    background: var(--surface-3);
    color: var(--text-1);
}
.cover:focus-visible {
    outline: 3px solid var(--brand-soft);
    outline-offset: -3px;
}
.cover__art {
    flex: 0 0 auto;
    width: 128px;
    height: 128px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}
.cover__art--blank {
    display: block;
    background: linear-gradient(135deg, var(--surface-3), var(--control-bg));
}
.cover__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}
.cover__name {
    font-weight: 700;
    font-size: var(--fs-base);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cover__artists {
    color: var(--text-3);
    font-size: var(--fs-sm);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cover__play {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-pill);
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: 0 6px 20px rgba(29, 185, 84, .35);
    transition: transform var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease);
}
.cover__play svg {
    margin-left: 2px; /* optical centre for the triangle */
}
.cover:hover .cover__play {
    background: var(--brand-bright);
    transform: scale(1.06);
}
.cover:active .cover__play {
    transform: scale(0.97);
}
@media (max-width: 400px) {
    .cover__art { width: 104px; height: 104px; }
}
@media (prefers-reduced-motion: reduce) {
    .cover:hover .cover__play,
    .cover:active .cover__play { transform: none; }
    .track__player iframe,
    .track__player .cover { transition: none; }
    .track__player.is-loading .cover__play::after { animation-duration: 1.6s; }
}

/* Footer row: save on the left, reviews on the right. Both sit below the embed rather than over it,
   so the player stays fully interactive (no click-blocking overlay). */
.track__foot {
    display: flex;
    align-items: stretch;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.track__reviews {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 600;
    font-size: var(--fs-sm);
    background: var(--surface-2);
    border: 1px solid transparent;
    transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease),
        border-color var(--dur-2) var(--ease);
}

.track__reviews:hover {
    background: var(--surface-3);
    color: var(--text-1);
    border-color: var(--border-1);
}

.track__reviews svg {
    transition: transform var(--dur-2) var(--ease);
}

.track__reviews:hover svg {
    transform: translateX(3px);
}

/* Save — the queue toggle. Same weight as the reviews link beside it, brand-coloured once it's on. */
.save {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 100%;
    padding: var(--space-2) var(--space-3);
    appearance: none;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid transparent;
    color: var(--text-2);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease),
        border-color var(--dur-2) var(--ease);
}

.save:hover {
    background: var(--surface-3);
    color: var(--text-1);
    border-color: var(--border-1);
}

.save:focus-visible {
    outline: 2px solid var(--brand-ring);
    outline-offset: 2px;
}

.save.is-saved {
    color: var(--brand);
}

.save.is-saved:hover {
    color: var(--brand-bright);
}

/* ==========================================================================
   Song page
   ========================================================================== */
.song {
    max-width: 720px;
    margin-inline: auto;
}

.song__player {
    border-radius: var(--embed-radius);
    overflow: hidden;
    line-height: 0;
    box-shadow: var(--shadow-md);
}

.song__player iframe {
    display: block;
    width: 100%;
    border: 0;
}

.song__body {
    margin-top: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

/* Average-rating banner */
.rating-summary {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
}

.rating-summary__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rating-summary__label {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}

.rating-summary__count {
    color: var(--text-2);
    font-size: var(--fs-sm);
}

/* Review composer */
.composer {
    padding: var(--space-5);
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.composer__title {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text-1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.form-actions.is-center {
    justify-content: center;
}

/* ==========================================================================
   Rating meter — discrete 1–10 "level" control (rising green bars).
   Bars, keyboard, and the hidden-input binding are driven by site.js.
   ========================================================================== */
.rating-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.fader__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.fader__label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-2);
}

.fader__scale {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-xs);
    color: var(--text-4);
}

.rating-readout {
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-4);
    letter-spacing: -0.01em;
}

.rating-readout.is-rated {
    font-size: var(--fs-lg);
    font-weight: 800;
    color: var(--brand);
}

.meter {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 46px;
    padding: 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    outline: none;
    touch-action: manipulation;
}

.meter:focus-visible {
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.meter .bar {
    flex: 1;
    min-width: 0;
    border-radius: 3px;
    background: var(--surface-3);
    transition: background-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}

.meter .bar.on {
    background: var(--brand);
}

.meter .bar.on.hot {
    background: var(--brand-bright);
    box-shadow: 0 0 12px rgba(29, 185, 84, 0.55);
}

.meter .bar.preview {
    background: color-mix(in srgb, var(--brand) 45%, var(--surface-3));
}

@media (prefers-reduced-motion: reduce) {
    .meter .bar { transition: none; }
}

/* ==========================================================================
   Review card
   ========================================================================== */
.reviews {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.review {
    background: var(--surface-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.review__head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.review__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.review__song {
    color: var(--text-1);
    font-weight: 700;
    font-size: var(--fs-md);
    line-height: 1.25;
}

.review__song:hover {
    color: var(--brand-bright);
}

.review__by {
    font-size: var(--fs-sm);
    color: var(--text-3);
}

.review__by a {
    color: var(--text-2);
    font-weight: 600;
}

.review__by a:hover {
    color: var(--brand-bright);
}

.review__body {
    margin: var(--space-3) 0 0;
    color: var(--text-2);
    font-size: var(--fs-base);
    line-height: 1.6;
    white-space: pre-wrap;
}

.review__actions {
    flex: 0 0 auto;
}

.review__foot {
    display: flex;
    margin-top: var(--space-3);
}

/* Like — quiet until it's yours, then it wears the brand colour. */
.like {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    margin-left: calc(var(--space-2) * -1);
    appearance: none;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text-3);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}

.like:hover {
    background: var(--surface-3);
    color: var(--text-1);
}

.like:focus-visible {
    outline: 2px solid var(--brand-ring);
    outline-offset: 2px;
}

.like.is-liked {
    color: var(--brand);
}

.like.is-liked:hover {
    color: var(--brand-bright);
}

/* ==========================================================================
   Profile / Follow
   ========================================================================== */
.profile,
.follows {
    max-width: 720px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.profile__banner {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4) var(--space-5);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(600px 200px at 12% -40%, rgba(29, 185, 84, 0.20), transparent 70%),
        var(--surface-1);
    border: 1px solid var(--border-1);
    overflow: hidden;
}

.profile__id {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    margin-right: auto;
}

.profile__name {
    font-size: var(--fs-2xl);
    font-weight: 800;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.profile__stats {
    display: flex;
    gap: var(--space-5);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-1);
}

.stat:hover {
    color: var(--text-1);
}

.stat:hover .stat__num {
    color: var(--brand-bright);
}

.stat__num {
    font-size: var(--fs-xl);
    font-weight: 800;
    color: var(--text-1);
    transition: color var(--dur-1) var(--ease);
}

.stat__label {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}

.profile__action {
    flex: 0 0 auto;
}

.profile__section {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Tabs (Follow) — an underline, not a filled block. */
.tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--border-1);
    margin-bottom: var(--space-4);
}

.tab {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: var(--space-3) var(--space-3);
    color: var(--text-3);
    font: inherit;
    font-weight: 600;
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}

.tab:hover {
    color: var(--text-1);
}

.tab.active {
    color: var(--text-1);
    border-bottom-color: var(--brand);
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.user-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border-1);
    color: var(--text-1);
    transition: background-color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}

.user-row:hover {
    background: var(--surface-3);
    border-color: var(--border-2);
    color: var(--text-1);
}

.user-row__name {
    font-weight: 700;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-row__chev {
    color: var(--text-4);
    flex: 0 0 auto;
}

/* ==========================================================================
   Forms (auth pages, composer)
   ========================================================================== */
.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.field__label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-2);
}

.input,
textarea.input,
.form-control {
    width: 100%;
    padding: 0 var(--space-3);
    height: 44px;
    background: var(--control-bg);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    font-family: inherit;
    font-size: var(--fs-base);
    transition: border-color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease),
        box-shadow var(--dur-2) var(--ease);
}

textarea.input,
textarea.form-control {
    height: auto;
    padding: var(--space-3);
    line-height: 1.55;
    resize: vertical;
    min-height: 96px;
}

.input::placeholder,
.form-control::placeholder {
    color: var(--text-4);
}

.input:hover,
.form-control:hover {
    background: var(--control-bg-hover);
}

.input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--brand-ring);
    background: var(--control-bg-hover);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.field__error,
.text-danger {
    color: var(--danger-bright);
    font-size: var(--fs-sm);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-2);
    font-size: var(--fs-sm);
    cursor: pointer;
    user-select: none;
}

.check__box,
.form-check-input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    background: var(--control-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}

.check__box::before,
.form-check-input::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transform-origin: center;
    transition: transform var(--dur-1) var(--ease);
    background: var(--on-brand);
    clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 18%, 84% 4%, 40% 68%);
}

.check__box:checked,
.form-check-input:checked {
    background: var(--brand);
    border-color: var(--brand);
}

.check__box:checked::before,
.form-check-input:checked::before {
    transform: scale(1);
}

.check__box:focus-visible,
.form-check-input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ==========================================================================
   Auth (Login / Register / Logout)
   ========================================================================== */
.auth {
    width: 100%;
    max-width: 420px;
    margin: var(--space-7) auto 0;
}

.auth__card {
    padding: var(--space-6);
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.auth__head {
    text-align: center;
    margin-bottom: var(--space-5);
}

.auth__title {
    font-size: var(--fs-2xl);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth__sub {
    margin: var(--space-2) 0 0;
    color: var(--text-3);
    font-size: var(--fs-sm);
}

.auth__foot {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-1);
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--text-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.auth__foot a {
    color: var(--brand);
    font-weight: 600;
}

.auth__foot a:hover {
    color: var(--brand-bright);
}

/* Validation summary block */
.validation-summary-errors ul {
    margin: 0;
    padding-left: var(--space-4);
}

/* ==========================================================================
   Error / status page
   ========================================================================== */
.state {
    max-width: 520px;
    margin: var(--space-8) auto 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.state__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--brand-soft);
    color: var(--brand);
}

.state__title {
    font-size: var(--fs-2xl);
    font-weight: 800;
}

.state__text {
    color: var(--text-3);
    font-size: var(--fs-base);
}

.state__req {
    font-size: var(--fs-xs);
    color: var(--text-4);
}

.state__req code {
    color: var(--text-2);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ==========================================================================
   Score — compact variant (feed cards)
   ========================================================================== */
.score--mini {
    font-size: var(--fs-base);
    gap: 0.08em;
}

.score--mini .score__scale {
    font-size: 0.55em;
}

/* ==========================================================================
   Feed card — review activity in the footer
   ========================================================================== */
.track__stat {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.track__stat .count {
    color: var(--text-3);
    font-weight: 600;
}

.track__prompt {
    color: var(--text-3);
    font-weight: 600;
}

.track__cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    color: var(--text-2);
    font-weight: 700;
}

.track__reviews:hover .track__cta {
    color: var(--text-1);
}

/* ==========================================================================
   Pager — two links, no page numbers (nothing here counts its rows)
   ========================================================================== */
.pager {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

/* With only a "next" link, keep it on the right where the pair would have put it. */
.pager > :only-child {
    margin-left: auto;
}

/* ==========================================================================
   Flash message (post/update/delete confirmation)
   ========================================================================== */
.flash {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    background: var(--brand-soft);
    border: 1px solid rgba(29, 185, 84, 0.3);
    border-radius: var(--radius-md);
    color: var(--text-1);
    font-size: var(--fs-sm);
    font-weight: 600;
    transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

.flash.is-leaving {
    opacity: 0;
    transform: translateY(-6px);
}

/* Rejected input — same shape, destructive palette. */
.flash--error {
    background: var(--danger-soft);
    border-color: rgba(240, 97, 109, 0.32);
}

.flash__icon {
    display: inline-flex;
    color: var(--brand);
    flex: 0 0 auto;
}

.flash--error .flash__icon {
    color: var(--danger);
}

.flash__text {
    flex: 1 1 auto;
}

.flash__close {
    flex: 0 0 auto;
    background: none;
    border: 0;
    color: var(--text-3);
    cursor: pointer;
    padding: 2px;
    line-height: 0;
    border-radius: var(--radius-xs);
}

.flash__close:hover {
    color: var(--text-1);
}

/* ==========================================================================
   Your review summary + composer edit mode
   ========================================================================== */
.your-review {
    padding: var(--space-4) var(--space-5);
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
}

.your-review__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.your-review__label {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}

.your-review__actions {
    display: flex;
    gap: var(--space-2);
}

.your-review__body {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.your-review__text {
    margin: 0;
    color: var(--text-2);
    line-height: 1.6;
    white-space: pre-wrap;
}

.composer__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* ==========================================================================
   Reviews header + sort control + meta
   ========================================================================== */
.reviews-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}

.sort {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--surface-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-pill);
}

.sort__btn {
    appearance: none;
    background: none;
    border: 0;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    color: var(--text-3);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.sort__btn:hover {
    color: var(--text-1);
}

.sort__btn.active {
    background: var(--surface-3);
    color: var(--text-1);
}

.review__time {
    color: var(--text-4);
    font-size: var(--fs-xs);
    white-space: nowrap;
}

.review__edited {
    color: var(--text-4);
    font-size: var(--fs-xs);
    font-style: italic;
}

/* ==========================================================================
   Song page actions (queue + favorites)
   ========================================================================== */
.song__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.song__pinned {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    color: var(--brand);
    font-size: var(--fs-sm);
    font-weight: 600;
}

/* ==========================================================================
   Search sections (listeners above tracks)
   ========================================================================== */
.search__section + .search__section {
    margin-top: var(--space-6);
}

.search__section .section-title {
    margin-bottom: var(--space-3);
}

/* ==========================================================================
   Profile bio + favorites
   ========================================================================== */
.profile__bio {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.profile__bio-text {
    margin: 0;
    color: var(--text-2);
    font-size: var(--fs-base);
    max-width: 60ch;
}

/* Disclosure — a native <details>, so the edit form costs no script. */
.disclosure__summary {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: var(--space-1) var(--space-2);
    margin-left: calc(var(--space-2) * -1);
    border-radius: var(--radius-sm);
    color: var(--text-3);
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    transition: color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}

.disclosure__summary::-webkit-details-marker {
    display: none;
}

.disclosure__summary:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

.disclosure__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.disclosure__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.favorites {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

@media (min-width: 640px) {
    .favorites {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* The remove button floats over its tile, so the tile itself stays one big link. */
.favorite {
    position: relative;
}

.favorite__tile {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.favorite__art {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-1);
    background: var(--surface-2);
    transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

.favorite__tile:hover .favorite__art {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.favorite__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.favorite__title {
    color: var(--text-1);
    font-size: var(--fs-sm);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite__artist {
    color: var(--text-3);
    font-size: var(--fs-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite__remove {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    appearance: none;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--bg) 76%, transparent);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--text-2);
    cursor: pointer;
    transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.favorite__remove:hover {
    background: var(--danger-soft);
    color: var(--danger-bright);
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .btn:active,
    .track:hover {
        transform: none;
    }
}

/* ==========================================================================
   Homepage dashboard: stacked sections, each a preview with a "See all"
   ========================================================================== */
.home {
    display: flex;
    flex-direction: column;
    gap: var(--space-7);
}
.home-section {
    min-width: 0;
}
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.section-head__text {
    min-width: 0;
}
.section-head .section-title {
    margin: 0;
}
.section-head__sub {
    margin: var(--space-1) 0 0;
    color: var(--text-3);
    font-size: var(--fs-sm);
}
.section-head__all {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: var(--fs-sm);
    font-weight: 700;
    white-space: nowrap;
    transition: color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease);
}
.section-head__all:hover {
    color: var(--text-1);
    background: var(--surface-2);
}
.section-head__all svg {
    transition: transform var(--dur-2) var(--ease);
}
.section-head__all:hover svg {
    transform: translateX(2px);
}

/* Shelf: a single row of album tiles that scrolls sideways. Six fit on desktop with the
   rest a swipe away; about two and a half show on a phone so the overflow is obvious. */
.shelf {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * var(--space-3)) / 2.4);
    gap: var(--space-3);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
    padding-bottom: var(--space-2);
    margin: 0;
    list-style: none;
}
@media (min-width: 640px) {
    .shelf { grid-auto-columns: calc((100% - 3 * var(--space-3)) / 4); }
}
@media (min-width: 900px) {
    .shelf { grid-auto-columns: calc((100% - 5 * var(--space-3)) / 6); }
}
.shelf__item {
    min-width: 0;
    scroll-snap-align: start;
}
.shelf-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    color: var(--text-1);
    text-decoration: none;
}
.shelf-tile:hover {
    color: var(--text-1);
}
.shelf-tile:focus-visible {
    outline: none;
}
.shelf-tile__art-wrap {
    position: relative;
    display: block;
    margin-bottom: var(--space-2);
}
.shelf-tile__art {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-1);
    background: var(--surface-2);
    transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.shelf-tile__art--blank {
    background: linear-gradient(135deg, var(--surface-3), var(--control-bg));
}
.shelf-tile:hover .shelf-tile__art {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}
.shelf-tile:focus-visible .shelf-tile__art {
    box-shadow: 0 0 0 3px var(--brand-soft);
    border-color: var(--brand-ring);
}
.shelf-tile__score {
    position: absolute;
    left: var(--space-2);
    bottom: var(--space-2);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(6px);
}
.shelf-tile__title,
.shelf-tile__artist {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.shelf-tile__title {
    font-size: var(--fs-sm);
    font-weight: 700;
}
.shelf-tile__artist {
    color: var(--text-3);
    font-size: var(--fs-xs);
    font-weight: 600;
}

/* Friends section before you follow anyone: a nudge, not an empty box. */
.prompt-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-1);
    background:
        radial-gradient(120% 140% at 0% 0%, var(--brand-soft), transparent 60%),
        var(--surface-1);
}
.prompt-card__text {
    margin: 0;
    max-width: 52ch;
    color: var(--text-2);
    font-size: var(--fs-sm);
    line-height: 1.6;
}

/* "‹ Home" above the See-all pages. */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-bottom: var(--space-3);
    color: var(--text-3);
    font-size: var(--fs-sm);
    font-weight: 700;
    transition: color var(--dur-2) var(--ease);
}
.back-link:hover {
    color: var(--text-1);
}

@media (prefers-reduced-motion: reduce) {
    .shelf-tile:hover .shelf-tile__art,
    .section-head__all:hover svg { transform: none; }
}

/* ==========================================================================
   Accounts: photos, account menu, verification bar, auth extras, settings
   ========================================================================== */
.avatar--photo {
    object-fit: cover;
    background: var(--surface-2);
    padding: 0;
}
.avatar--xxs {
    width: 18px;
    height: 18px;
    font-size: 0.5625rem;
    border-radius: 5px;
}
.review__author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}

/* Account menu: a <details> disclosure in the topbar. */
.menu {
    position: relative;
}
.menu > summary {
    list-style: none;
    cursor: pointer;
}
.menu > summary::-webkit-details-marker {
    display: none;
}
.menu__chev {
    flex: 0 0 auto;
    color: var(--text-3);
    transition: transform var(--dur-2) var(--ease);
}
.menu[open] .menu__chev {
    transform: rotate(180deg);
}
.menu[open] > .nav-user {
    color: var(--text-1);
    background: var(--surface-2);
    border-color: var(--border-1);
}
.menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    min-width: 190px;
    padding: var(--space-1);
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}
.menu__panel form {
    margin: 0;
}
.menu__item {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-2);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.menu__item:hover,
.menu__item:focus-visible {
    background: var(--surface-3);
    color: var(--text-1);
    outline: none;
}
.menu__item--button {
    border-top: 1px solid var(--border-1);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    margin-top: var(--space-1);
    padding-top: calc(var(--space-2) + 2px);
}

/* Unverified accounts: one quiet line under the topbar. */
.verify-bar {
    border-bottom: 1px solid var(--border-1);
    background: color-mix(in srgb, var(--brand) 9%, var(--bg));
}
.verify-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    max-width: 1120px;
    margin: 0 auto;
    padding: var(--space-2) var(--space-4);
}
.verify-bar__text {
    color: var(--text-2);
    font-size: var(--fs-sm);
}
.verify-bar__text strong {
    color: var(--text-1);
}
.verify-bar form {
    margin: 0;
}

/* Auth pages. */
.auth__providers {
    margin-bottom: var(--space-4);
}
.btn-provider {
    background: var(--text-1);
    color: #1f1f1f;
    border-color: transparent;
    gap: var(--space-3);
}
.btn-provider:hover {
    background: #ffffff;
    color: #1f1f1f;
}
.auth__divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
    color: var(--text-4);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.auth__divider::before,
.auth__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-1);
}
.auth__note {
    margin: 0 0 var(--space-4);
    color: var(--text-3);
    font-size: var(--fs-sm);
    line-height: 1.6;
    text-align: center;
}
.auth__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--brand-soft);
    color: var(--brand);
}
.auth__sub strong {
    color: var(--text-1);
    font-weight: 600;
    overflow-wrap: anywhere;
}
.form-error.validation-summary-valid {
    display: none;
}
.form-error {
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
    color: var(--danger-bright);
    font-size: var(--fs-sm);
}
.form-error ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.field__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
}
.field__link {
    color: var(--brand);
    font-size: var(--fs-sm);
    font-weight: 600;
}
.field__link:hover {
    color: var(--brand-bright);
}
.field__hint {
    color: var(--text-3);
    font-size: var(--fs-xs);
    line-height: 1.5;
}
.field__error:empty {
    display: none;
}

/* Password with a Show/Hide toggle inside the field. */
.password {
    position: relative;
}
.password .input {
    padding-right: 64px;
}
.password__toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 10px;
    border: 0;
    border-radius: var(--radius-xs);
    background: none;
    color: var(--text-3);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 700;
    cursor: pointer;
}
.password__toggle:hover,
.password__toggle:focus-visible {
    color: var(--text-1);
    background: var(--surface-3);
    outline: none;
}

/* Settings. */
.settings {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.settings .feed__head {
    margin-bottom: var(--space-2);
}
.settings__card {
    padding: var(--space-5);
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
}
.settings__card--danger {
    border-color: color-mix(in srgb, var(--danger) 28%, var(--border-1));
}
.settings__title {
    margin: 0 0 var(--space-3);
    font-size: var(--fs-lg);
    font-weight: 700;
}
.settings__hint {
    margin: var(--space-2) 0 0;
    color: var(--text-3);
    font-size: var(--fs-sm);
    line-height: 1.6;
}
.settings__photo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
}
.settings__photo-body {
    flex: 1 1 240px;
    min-width: 0;
}
.settings__photo-body .settings__hint {
    margin-top: 0;
}
.settings__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
}
.settings__actions form {
    margin: 0;
}
.settings__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    min-height: 34px;
}
.settings__value {
    color: var(--text-1);
    font-weight: 600;
    overflow-wrap: anywhere;
}
.settings__push {
    margin: 0 0 0 auto;
}
.settings__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.settings__more {
    margin-top: var(--space-3);
}
.settings__more > summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.settings__more > summary::-webkit-details-marker {
    display: none;
}
.settings__more > summary::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform var(--dur-2) var(--ease);
}
.settings__more[open] > summary::after {
    transform: rotate(-135deg) translateY(-2px);
}
.settings__more > summary:hover {
    color: var(--text-1);
}
.settings__form {
    margin-top: var(--space-4);
}
.settings__form .field:last-of-type {
    margin-bottom: var(--space-3);
}
.settings__logout {
    display: flex;
    justify-content: center;
    margin: var(--space-2) 0 0;
}
.pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 700;
}
.pill--ok {
    background: var(--brand-soft);
    color: var(--brand);
}
.pill--warn {
    background: var(--danger-soft);
    color: var(--danger-bright);
}
.btn-danger {
    background: var(--danger);
    border-color: transparent;
    color: #2a0409;
}
.btn-danger:hover {
    background: var(--danger-bright);
    color: #2a0409;
}

/* File input dressed as a button; the real input stays keyboard-focusable. */
.file-button {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.file-button input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.file-button:focus-within {
    box-shadow: 0 0 0 3px var(--brand-soft);
}

@media (prefers-reduced-motion: reduce) {
    .menu__chev,
    .settings__more > summary::after { transition: none; }
}

/* Footer: one quiet line, mainly so the privacy policy is a click away from every page. */
.site-foot {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-4) var(--space-6);
    color: var(--text-4);
    font-size: var(--fs-xs);
}
.site-foot a {
    color: var(--text-3);
    font-weight: 600;
}
.site-foot a:hover {
    color: var(--text-1);
}
