:root {
    color-scheme: dark;
    --bg: #0a0f1e;
    --bg-soft: #10182b;
    --surface: rgba(18, 28, 51, 0.82);
    --surface-solid: #121c33;
    --surface-elevated: #182541;
    --surface-hover: rgba(91, 124, 255, 0.13);
    --line: rgba(174, 191, 255, 0.12);
    --line-strong: rgba(174, 191, 255, 0.22);
    --text: #f5f7ff;
    --text-soft: #b8c2de;
    --text-muted: #7683a5;
    --accent: #8b7cff;
    --accent-strong: #a697ff;
    --accent-soft: rgba(139, 124, 255, 0.16);
    --cyan: #53d8d2;
    --green: #6ee7b7;
    --danger: #fb7185;
    --warning: #fbbf24;
    --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.42);
    --shadow-glow: 0 0 45px rgba(139, 124, 255, 0.18);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --sidebar-width: 264px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'DM Sans', sans-serif;
}

body.light-theme {
    color-scheme: light;
    --bg: #f4f6fc;
    --bg-soft: #edf0f9;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-solid: #ffffff;
    --surface-elevated: #f7f8fd;
    --surface-hover: rgba(107, 91, 255, 0.1);
    --line: rgba(31, 44, 79, 0.1);
    --line-strong: rgba(31, 44, 79, 0.18);
    --text: #17213b;
    --text-soft: #53617f;
    --text-muted: #8290aa;
    --accent: #6d5df5;
    --accent-strong: #5948e9;
    --accent-soft: rgba(109, 93, 245, 0.12);
    --shadow-sm: 0 10px 30px rgba(59, 70, 110, 0.1);
    --shadow-lg: 0 30px 80px rgba(59, 70, 110, 0.18);
}

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

html {
    min-height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
    touch-action: manipulation;
    overscroll-behavior-y: contain;
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    touch-action: manipulation;
    overscroll-behavior-y: contain;
    transition: background 240ms ease, color 240ms ease;
}

body.no-scroll {
    overflow: hidden;
}

body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* Mode economie d'effets : active automatiquement sur les appareils modestes
   (peux de coeurs / peu de RAM) pour eviter les saccades et les kill du renderer.
   Retire ombres portees lourdes, degrades decoratifs et textures de disque. */
body.perf-lite {
    scroll-behavior: auto;
}

body.perf-lite .topbar,
body.perf-lite .mobile-nav,
body.perf-lite .mini-player,
body.perf-lite .bottom-sheet,
body.perf-lite .queue-sheet,
body.perf-lite .player-sheet,
body.perf-lite .card,
body.perf-lite .hero-card,
body.perf-lite .track-row,
body.perf-lite .smart-mix-card,
body.perf-lite .about-card,
body.perf-lite .toast {
    box-shadow: none !important;
}

body.perf-lite .app-shell {
    background: var(--bg);
}

body.perf-lite .vinyl-disc {
    background: #161b2e;
}

body.perf-lite .playing-bars span {
    animation: none !important;
}

body.perf-lite .visual-glow,
body.perf-lite .full-artwork-glow,
body.perf-lite .sidebar-spotlight::after,
body.perf-lite .hero-card::before,
body.perf-lite .hero-card::after {
    display: none;
}

button,
input {
    color: inherit;
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

input {
    min-width: 0;
    border: 0;
    outline: 0;
}

input::placeholder {
    color: var(--text-muted);
}

img {
    display: block;
    max-width: 100%;
}

ion-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

ion-icon > svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

:focus-visible {
    outline: 3px solid rgba(139, 124, 255, 0.55);
    outline-offset: 3px;
}

::selection {
    background: rgba(139, 124, 255, 0.34);
    color: #fff;
}

[hidden] {
    display: none !important;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 82% 0%, rgba(83, 216, 210, 0.08), transparent 26rem),
        radial-gradient(circle at 42% 100%, rgba(139, 124, 255, 0.08), transparent 32rem),
        var(--bg);
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex: 0 0 var(--sidebar-width);
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    padding: calc(28px + var(--safe-top)) calc(18px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(18px + var(--safe-left));
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(12, 19, 38, 0.98), rgba(10, 15, 30, 0.88));
    border-right: 1px solid var(--line);
    transition: transform 260ms var(--ease), background 240ms ease;
}

body.light-theme .sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 246, 252, 0.9));
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 34px;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff;
    font-size: 22px;
    background: linear-gradient(135deg, var(--accent), #4c7dff);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(100, 90, 245, 0.28);
}

.brand-lockup strong,
.brand-lockup span {
    display: block;
}

.brand-lockup strong {
    font-family: var(--font-display);
    font-size: 1.08rem;
    letter-spacing: -0.03em;
}

.brand-lockup span {
    margin-top: 1px;
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}

.sidebar-label,
.section-eyebrow,
.topbar-kicker {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    line-height: 1.2;
    text-transform: uppercase;
}

.sidebar-label {
    padding: 0 12px 10px;
}

.sidebar-label-spaced {
    margin-top: 30px;
}

.nav-list {
    display: grid;
    gap: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 46px;
    gap: 13px;
    padding: 0 13px;
    color: var(--text-soft);
    background: transparent;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    transition: color 180ms ease, background 180ms ease, transform 180ms var(--ease);
}

.nav-link ion-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: var(--text-muted);
    font-size: 20px;
    text-align: center;
    transition: color 180ms ease, transform 180ms var(--ease);
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-hover);
    transform: translateX(2px);
}

.nav-link:hover ion-icon {
    color: var(--accent-strong);
    transform: scale(1.08);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(100deg, rgba(139, 124, 255, 0.25), rgba(139, 124, 255, 0.08));
    box-shadow: inset 0 0 0 1px rgba(139, 124, 255, 0.16);
}

body.light-theme .nav-link.active {
    color: var(--accent-strong);
}

.nav-link.active ion-icon {
    color: var(--accent-strong);
}

.sidebar-spacer {
    min-height: 32px;
    flex: 1;
}

.sidebar-spotlight {
    position: relative;
    margin: 20px 4px 18px;
    padding: 17px 16px 15px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(139, 124, 255, 0.2), rgba(83, 216, 210, 0.08));
    border: 1px solid rgba(139, 124, 255, 0.18);
    border-radius: 18px;
}

.sidebar-spotlight::after {
    position: absolute;
    right: -25px;
    bottom: -35px;
    width: 100px;
    height: 100px;
    content: '';
    background: radial-gradient(circle, rgba(139, 124, 255, 0.24) 0%, rgba(139, 124, 255, 0.07) 55%, transparent 72%);
    border-radius: 50%;
}

.spotlight-icon {
    display: grid;
    width: 30px;
    height: 30px;
    margin-bottom: 12px;
    place-items: center;
    color: var(--cyan);
    background: rgba(83, 216, 210, 0.12);
    border-radius: 10px;
}

.sidebar-spotlight strong,
.sidebar-spotlight p {
    position: relative;
    z-index: 1;
    display: block;
}

.sidebar-spotlight strong {
    font-size: 0.82rem;
}

.sidebar-spotlight p {
    margin-top: 5px;
    color: var(--text-soft);
    font-size: 0.72rem;
    line-height: 1.45;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    color: var(--accent-strong);
    background: transparent;
    font-size: 0.76rem;
    font-weight: 700;
}

.text-button ion-icon {
    font-size: 15px;
    transition: transform 180ms var(--ease);
}

.text-button:hover ion-icon {
    transform: translateX(3px);
}

.sidebar-spotlight .text-button {
    position: relative;
    z-index: 1;
    margin-top: 12px;
}

.sidebar-settings {
    margin-top: 2px;
}

.content-shell {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    flex: 1;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 86px;
    padding: calc(18px + var(--safe-top)) calc(clamp(20px, 4vw, 56px) + var(--safe-right)) 18px calc(clamp(20px, 4vw, 56px) + var(--safe-left));
    /* Pas de backdrop-filter : sur Android d'entree de gamme, un blur pleine largeur
       sur un element sticky force un flou de tout l'ecran a chaque frame (saccades + GPU OOM).
       Fond 100% opaque : aucun element ne peut transparaitre sous le header. */
    background: var(--bg);
    border-bottom: 1px solid transparent;
}

.topbar-leading,
.topbar-actions,
.topbar-title {
    display: flex;
    align-items: center;
}

.topbar-leading {
    flex: 1 1 auto;
    min-width: 0;
    gap: 14px;
}

.topbar-title {
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.topbar-title h1 {
    overflow: hidden;
    /* 100% et non 42vw : le titre doit cedrer la place aux boutons plutot que
       de deborder dessus (les noms d'albums et d'artistes sont longs). */
    max-width: 100%;
    width: 100%;
    color: var(--text);
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    letter-spacing: -0.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-kicker {
    font-size: 0.62rem;
}

.topbar-actions {
    gap: 9px;
}

.icon-button,
.primary-button,
.secondary-button,
.filter-chip,
.suggestion-chip,
.add-mode-tab,
.mobile-nav-link,
.mini-action,
.mini-play,
.round-play-button,
.player-control,
.main-play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 13px;
    font-size: 19px;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

.icon-button:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.pwa-install-button {
    color: var(--green);
    background: rgba(110, 231, 183, 0.1);
    border-color: rgba(110, 231, 183, 0.25);
}

.pwa-install-button:hover {
    color: var(--green);
    background: rgba(110, 231, 183, 0.16);
    border-color: rgba(110, 231, 183, 0.45);
}

.subtle-button {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    background: transparent;
    border-color: transparent;
}

.primary-button,
.secondary-button {
    min-height: 42px;
    gap: 8px;
    padding: 0 15px;
    border-radius: 13px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 180ms var(--ease), box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary-button {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #5d7bff);
    box-shadow: 0 10px 24px rgba(103, 90, 245, 0.24);
}

.primary-button:hover {
    box-shadow: 0 14px 30px rgba(103, 90, 245, 0.35);
    transform: translateY(-2px);
}

.secondary-button {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
}

.secondary-button:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.small-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.75rem;
}

.full-width {
    width: 100%;
}

.mobile-menu-button {
    display: none;
}













.search-filters {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.search-filters > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 600;
    list-style: none;
}

.search-filters > summary::-webkit-details-marker {
    display: none;
}

.search-filters > summary ion-icon {
    font-size: 1.05rem;
    color: var(--accent);
}

.filter-badge {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding: 4px 16px 14px;
}

.search-filters > .secondary-button {
    margin: 0 16px 16px;
}

/* --- Page artiste : banniere, photo centree, slogan, bio, tags --- */
.artist-hero {
    position: relative;
    margin-bottom: 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    overflow: hidden;
}

.artist-banner {
    position: relative;
    height: 132px;
    background:
        radial-gradient(120% 140% at 12% 8%, hsl(var(--artist-hue, 258) 72% 46%) 0%, transparent 58%),
        radial-gradient(110% 130% at 88% 12%, hsl(calc(var(--artist-hue, 258) + 62) 68% 40%) 0%, transparent 55%),
        linear-gradient(135deg, hsl(calc(var(--artist-hue, 258) + 18) 58% 22%) 0%, hsl(calc(var(--artist-hue, 258) + 300) 52% 14%) 100%);
}

.artist-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.5;
}

.artist-banner.has-image {
    background-size: cover;
    background-position: center;
}

.artist-banner.has-image::after {
    opacity: 0.15;
}

.artist-hero-main {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 0 20px;
    margin-top: -46px;
}

.artist-photo {
    position: relative;
    z-index: 1;
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 92px;
    height: 92px;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: linear-gradient(150deg, hsl(var(--artist-hue, 258) 70% 52%), hsl(calc(var(--artist-hue, 258) + 58) 62% 32%));
    color: #fff;
    font-size: 2.1rem;
    font-weight: 700;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.artist-photo span {
    text-transform: uppercase;
}

.artist-photo.has-image {
    background-size: cover;
    background-position: center;
}

.artist-photo.has-image span {
    display: none;
}

.artist-identity {
    flex: 1;
    min-width: 0;
    padding-top: 52px;
    padding-bottom: 4px;
}

.artist-identity h2 {
    margin: 0;
    font-size: clamp(1.5rem, 5vw, 2.1rem);
    line-height: 1.15;
}

.artist-slogan {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.95rem;
    font-style: italic;
}

.artist-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.artist-tag {
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-elevated);
    color: var(--text-soft);
    font-size: 0.74rem;
    white-space: nowrap;
}

.artist-tag[data-kind="style"] {
    border-color: color-mix(in srgb, var(--accent) 42%, transparent);
    color: var(--accent);
}

.artist-tag[data-kind="instrument"] {
    border-color: color-mix(in srgb, #21b3a6 42%, transparent);
    color: #21b3a6;
}

.artist-hero-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 20px 0;
    margin-top: 16px;
    border-top: 1px solid var(--line);
}

.artist-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0;
}

.artist-stats > div {
    display: grid;
    gap: 1px;
}

.artist-stats dt {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.artist-stats dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.artist-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.artist-bio {
    max-width: 68ch;
    margin: 16px 20px 20px;
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.65;
}

@media (max-width: 640px) {
    .artist-banner {
        height: 104px;
    }

    .artist-hero-main {
        flex-direction: column;
        align-items: center;
        gap: 0;
        text-align: center;
    }

    .artist-identity {
        width: 100%;
        padding-top: 12px;
    }

    .artist-tags {
        justify-content: center;
    }

    .artist-hero-foot {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .artist-stats {
        justify-content: center;
    }

    .artist-actions {
        justify-content: center;
    }
}
.tag-block {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.tag-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.tag-block-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
}

.tag-block-title ion-icon {
    color: var(--accent);
    font-size: 1rem;
}

.tag-block-count {
    padding: 2px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.tag-block-count:empty {
    display: none;
}

.tag-search {
    display: inline-flex;
    width: auto;
    max-width: 260px;
    margin-bottom: 12px;
}

.tag-group[hidden],
.tag-chip[hidden],
.tag-empty[hidden] {
    display: none;
}

.tag-empty {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tag-editor {
    display: grid;
    gap: 12px;
    margin-bottom: 6px;
}

/* Les groupes restent sur une ligne : les pills fluient librement. */
.tag-group {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-group-label {
    width: 100%;
    margin: 0 0 2px;
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tag-chips {
    display: contents;
}

.tag-chip {
    width: fit-content;
    max-width: 100%;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-elevated);
    color: var(--text-soft);
    font: inherit;
    font-size: 0.76rem;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

/* La vue Administration etait un <details> replie au bas des reglages. C est une
   page a part : plus de resume, plus de marqueur. */
.admin-body {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.admin-block {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.admin-block h3 {
    margin: 0 0 4px;
    font-size: 1.02rem;
}

.admin-block .form-hint {
    margin-bottom: 14px;
}

.account-nav .nav-link {
    margin-top: 2px;
}

.sidebar-label.account-label {
    margin-top: 16px;
}

.account-forgot {
    margin-top: 10px;
    justify-content: center;
}

.profile-form {
    display: block;
    margin: 20px 0 0;
}

/* Editeur d image : apercu, choix de fichier, retrait.
   L apercu compte double : il montre ce qui est enregistre, et il donne une
   cible au bouton de retrait, qui n aurait sinon rien a quoi se rapporter. */
.image-editor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 12px;
    margin-bottom: 6px;
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.image-editor-preview {
    display: grid;
    width: 96px;
    height: 96px;
    flex: none;
    place-items: center;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.image-editor-preview.wide {
    width: 100%;
    height: 110px;
}

.image-editor-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-editor-empty {
    padding: 0 10px;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

.image-editor-actions {
    display: flex;
    min-width: 0;
    flex: 1 1 200px;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.visually-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.image-editor .text-button {
    cursor: pointer;
}

.image-editor .text-button.danger {
    color: var(--danger, #f87171);
}

.image-editor-status {
    flex: 1 1 100%;
    min-height: 1.1em;
    font-size: 0.8rem;
}

.image-editor-status[data-tone="success"] {
    color: var(--success, #4ade80);
}

.image-editor-status[data-tone="error"] {
    color: var(--danger, #f87171);
}

#profile-view .view-header,
#admin-view .view-header {
    margin-bottom: 4px;
}

.profile-block {
    padding: 18px;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.profile-block h2 {
    margin-bottom: 4px;
    font-size: 1.02rem;
}

.profile-block .form-label {
    display: block;
    margin-top: 12px;
}

.profile-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.profile-status {
    font-size: 0.84rem;
}

.profile-status[data-tone="success"] {
    color: var(--success, #4ade80);
}

.profile-status[data-tone="error"] {
    color: var(--danger, #f87171);
}

.admin-panel > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

.admin-panel > summary::-webkit-details-marker {
    display: none;
}

.admin-body {
    display: grid;
    gap: 22px;
    padding: 0 14px 16px;
}

.admin-block h3 {
    margin: 0 0 4px;
    font-size: 0.92rem;
}

.admin-table,
.admin-vocab {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.admin-row-who {
    display: grid;
    min-width: 0;
}

.admin-row-who small {
    color: var(--text-muted);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.admin-role-select {
    width: auto;
    min-width: 140px;
    flex-shrink: 0;
}

.admin-tag-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.admin-profile-form {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.admin-profile-form .form-label {
    margin-top: 6px;
}

.admin-profile-form textarea {
    resize: vertical;
    min-height: 68px;
}

.admin-profile-form button {
    margin-top: 12px;
    justify-self: start;
}

.admin-vocab-group h4 {
    margin: 10px 0 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-vocab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-vocab-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.82rem;
}

.admin-vocab-ar {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.admin-vocab-remove {
    display: inline-flex;
    padding: 2px;
    color: var(--text-muted);
}

.admin-vocab-remove:hover {
    color: var(--danger, #e5484d);
}

.form-feedback[data-tone="error"] {
    color: var(--danger, #e5484d);
}

.form-feedback[data-tone="success"] {
    color: var(--success, #30a46c);
}

@media (max-width: 640px) {
    .admin-row {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-role-select {
        width: 100%;
    }
}

.tag-group-label {
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tag-chips {
    display: contents;
}

.tag-chip {
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-elevated);
    color: var(--text-soft);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.tag-chip:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.tag-chip.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 600;
}

.tag-chip[data-kind="instrument"].is-active {
    border-color: var(--cyan);
    background: color-mix(in srgb, var(--cyan) 16%, transparent);
    color: var(--cyan);
}

.tag-chip[data-kind="mood"].is-active {
    border-color: var(--green);
    background: color-mix(in srgb, var(--green) 16%, transparent);
    color: var(--green);
}

.tag-chip[data-kind="production"].is-active {
    border-color: var(--warning);
    background: color-mix(in srgb, var(--warning) 16%, transparent);
    color: var(--warning);
}

.tag-chip[data-kind="region"].is-active {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 16%, transparent);
    color: var(--danger);
}

.track-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.track-tag {
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-elevated);
    color: var(--text-muted);
    font-size: 0.68rem;
    white-space: nowrap;
}

.track-tag[data-kind="style"] {
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    color: var(--accent-strong);
}

.track-tag[data-kind="instrument"] {
    border-color: color-mix(in srgb, var(--cyan) 35%, transparent);
    color: var(--cyan);
}

body.perf-lite .tag-chip {
    transition: none;
}

.browse-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.browse-tabs .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.browse-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: inherit;
    text-align: center;
    cursor: pointer;
    transition: transform 180ms var(--ease), border-color 180ms ease, background 180ms ease;
}

.browse-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    background: var(--surface-hover);
}

.browse-card-cover {
    display: grid;
    width: 84px;
    height: 84px;
    overflow: hidden;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 1.7rem;
    font-weight: 700;
}

.browse-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.browse-card-cover.round {
    border-radius: 50%;
}

.browse-card-cover.square {
    border-radius: 14px;
}

.browse-card strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.browse-card span {
    color: var(--text-muted);
    font-size: 0.76rem;
}

body.perf-lite .browse-card {
    box-shadow: none;
}

.track-copy .track-artist-link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.track-copy .track-artist-link:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

.album-detail {
    position: relative;
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(120deg, var(--surface), var(--bg-soft));
}

.album-detail-art {
    position: relative;
    display: grid;
    width: 168px;
    height: 168px;
    overflow: hidden;
    place-items: center;
    border-radius: 16px;
    background: var(--surface-elevated);
}

.album-detail-art img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-detail-glow {
    position: absolute;
    inset: 12%;
    background: radial-gradient(circle, var(--accent) 0%, color-mix(in srgb, var(--accent) 40%, transparent) 48%, transparent 72%);
    opacity: 0.3;
}

.album-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.album-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 4px 0 0;
}

.album-detail-meta > div {
    display: flex;
    gap: 6px;
    font-size: 0.78rem;
}

.album-detail-meta dt {
    color: var(--text-muted);
}

.album-detail-meta dd {
    margin: 0;
    font-weight: 600;
}

body.perf-lite .album-detail-glow {
    display: none;
}

@media (max-width: 640px) {
    .album-detail {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .album-detail-art {
        width: min(64vw, 210px);
        height: min(64vw, 210px);
    }

    .album-detail-actions,
    .album-detail-meta {
        justify-content: center;
    }
}

.page-content {
    width: 100%;
    max-width: 1460px;
    flex: 1;
    margin: 0 auto;
    padding: 18px clamp(20px, 4vw, 56px) 138px;
}

/* Reservent la place du contenu async (pistes + mixes) pour eviter que la page
   grandisse de ~950px sous les yeux de l'utilisateur au chargement. */
body.is-booting .smart-mix-grid,
body.is-booting .featured-track-list,
body.is-booting .discovery-track-list {
    min-height: 300px;
}

/* L'animation d'entree n'est plus declaree sur .view : elle est ajoutee a la volee
   par setView() lors d'une navigation reelle. Au demarrage elle ne se joue pas,
   sinon toute la page glisse de 8px vers le haut pendant que le contenu async arrive. */
.view.view-entering {
    animation: view-enter 360ms var(--ease) both;
}

.view[hidden] {
    display: none;
}

@keyframes view-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-card {
    position: relative;
    display: flex;
    min-height: 300px;
    overflow: hidden;
    background: linear-gradient(120deg, rgba(81, 72, 180, 0.36), rgba(29, 50, 93, 0.42) 56%, rgba(29, 99, 104, 0.22));
    border: 1px solid rgba(173, 164, 255, 0.16);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glow);
}

/* Cercles decoratifs du hero : degrade radial plutot que filter: blur(2px).
   Un filtre sur deux elements de 300/360px force un calque GPU repaint a chaque frame. */
.hero-card::before,
.hero-card::after {
    position: absolute;
    content: '';
    pointer-events: none;
    border-radius: 50%;
}

.hero-card::before {
    top: -120px;
    right: 18%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(139, 124, 255, 0.24) 0%, rgba(139, 124, 255, 0.12) 52%, transparent 72%);
}

.hero-card::after {
    right: -70px;
    bottom: -150px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(83, 216, 210, 0.16) 0%, rgba(83, 216, 210, 0.08) 50%, transparent 70%);
}

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 620px;
    padding: clamp(28px, 5vw, 52px);
}

.eyebrow-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    color: #d8d4ff;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.hero-copy h2 {
    margin-top: 18px;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(2.15rem, 5vw, 4.3rem);
    letter-spacing: -0.075em;
    line-height: 0.98;
}

.hero-copy h2 em {
    color: var(--cyan);
    font-style: normal;
}

.hero-copy p {
    max-width: 470px;
    margin-top: 16px;
    color: rgba(239, 241, 255, 0.72);
    font-size: 0.95rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.hero-visual {
    position: absolute;
    top: 50%;
    right: clamp(20px, 8vw, 120px);
    width: 280px;
    height: 280px;
    transform: translateY(-50%);
}

.visual-glow {
    position: absolute;
    inset: 14%;
    background: radial-gradient(circle, rgba(83, 216, 210, 0.26) 0%, rgba(83, 216, 210, 0.1) 48%, transparent 70%);
    border-radius: 50%;
}

.vinyl-disc {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 206px;
    height: 206px;
    place-items: center;
    background: repeating-radial-gradient(circle at 50% 50%, #202338 0 2px, #0b0e1a 3px 5px, #202338 6px 7px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    box-shadow: 20px 28px 50px rgba(0, 0, 0, 0.35), inset -14px -8px 30px rgba(0, 0, 0, 0.55);
    transform: translate(-50%, -50%) rotate(-20deg);
}

.vinyl-disc::after {
    position: absolute;
    width: 68%;
    height: 68%;
    content: '';
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.vinyl-center {
    position: relative;
    z-index: 1;
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border: 6px solid #11152b;
    border-radius: 50%;
    font-size: 23px;
    transform: rotate(20deg);
}

.floating-note {
    position: absolute;
    z-index: 2;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 600;
    text-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.note-one {
    top: 15%;
    right: 4%;
    color: var(--cyan);
    transform: rotate(14deg);
}

.note-two {
    bottom: 11%;
    left: 4%;
    color: var(--accent-strong);
    font-size: 1.7rem;
    transform: rotate(-16deg);
}

.note-three {
    top: 7%;
    left: 18%;
    color: #fff;
    font-size: 3.2rem;
    transform: rotate(8deg);
}

.section-heading,
.view-heading,
.list-heading,
.topline {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.section-heading {
    margin: 34px 0 14px;
}

.demo-heading {
    margin-top: 38px;
}

.featured-track-list {
    margin-bottom: 4px;
}

.discovery-heading {
    align-items: center;
}

.discovery-local-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.discovery-local-badge ion-icon {
    color: var(--cyan);
    font-size: 15px;
}

.smart-mix-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

/* Etagere des styles. Les images viennent de public/covers/styles, peintes par
   FLUX en local : elles sont denses et photographiques, la ou les pochettes de
   morceaux restent geometriques. La carte garde la meme logique que les mixes
   (image a gauche, texte a droite) pour que la page ne raconte pas deux
   Cynematiques. */
.style-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 14px;
    margin: 4px 0 18px;
}

.style-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 9px;
    padding: 0;
    overflow: hidden;
    color: var(--text);
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 180ms var(--ease), border-color 180ms ease, box-shadow 180ms ease;
}

.style-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.style-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.style-card-art {
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    place-items: center;
    overflow: hidden;
    color: var(--text-muted);
    background: var(--surface-elevated);
}

.style-card-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.style-card-art ion-icon {
    width: 30px;
    height: 30px;
}

.style-card-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px 12px;
}

.style-card-copy strong {
    overflow: hidden;
    font-size: 0.92rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.style-card-count {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.style-heading {
    margin-top: 6px;
}

.smart-mix-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    min-height: 76px;
    padding: 12px;
    color: var(--text);
    text-align: left;
    background: linear-gradient(135deg, var(--surface), var(--surface-elevated));
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 180ms var(--ease), border-color 180ms ease, background 180ms ease;
}

.smart-mix-card:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.smart-mix-card:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.smart-mix-card > ion-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 11px;
    font-size: 19px;
}

.smart-mix-copy {
    min-width: 0;
    flex: 1;
}

.smart-mix-copy strong,
.smart-mix-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.smart-mix-copy strong {
    font-size: 0.8rem;
}

.smart-mix-copy span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.67rem;
}

.smart-mix-count {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 700;
}

.discovery-track-list {
    margin-bottom: 4px;
}

.section-heading h2,
.view-heading h2,
.list-heading h3,
.sheet-header h2 {
    font-family: var(--font-display);
    letter-spacing: -0.045em;
}

.section-heading h2 {
    margin-top: 3px;
    font-size: 1.3rem;
}

.view-heading {
    align-items: flex-start;
    margin-bottom: 26px;
}

.view-heading h2 {
    margin-top: 4px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.05;
}

.view-heading p {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.resume-card {
    display: flex;
    align-items: center;
    min-height: 96px;
    gap: 16px;
    padding: 13px 16px 13px 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color 180ms ease, background 180ms ease, transform 180ms var(--ease);
}

.resume-card:hover {
    background: var(--surface-elevated);
    border-color: var(--line-strong);
    transform: translateY(-2px);
}

.resume-art,
.mini-art {
    flex: 0 0 auto;
    overflow: hidden;
    background: linear-gradient(135deg, #40388b, #236c7a);
    border-radius: 14px;
}

.resume-art {
    width: 70px;
    height: 70px;
}

.resume-art img,
.mini-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resume-info {
    min-width: 0;
    flex: 1;
}

.status-label {
    color: var(--cyan);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.resume-info h3 {
    overflow: hidden;
    margin-top: 2px;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resume-info p {
    overflow: hidden;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.round-play-button {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #547aff);
    border-radius: 50%;
    box-shadow: 0 8px 18px rgba(105, 92, 245, 0.28);
    font-size: 21px;
    transition: transform 180ms var(--ease), box-shadow 180ms ease;
}

.round-play-button:hover {
    box-shadow: 0 12px 24px rgba(105, 92, 245, 0.42);
    transform: scale(1.07);
}

.home-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.7fr);
    gap: 20px;
    margin-top: 34px;
}

.home-section-block {
    min-width: 0;
}

.compact-heading {
    margin-top: 0;
}

.insight-card {
    align-self: start;
    padding: 22px;
    background: linear-gradient(145deg, rgba(139, 124, 255, 0.16), rgba(83, 216, 210, 0.06));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.insight-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--green);
    font-size: 0.68rem;
    font-weight: 700;
}

.live-dot::before {
    width: 6px;
    height: 6px;
    content: '';
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(110, 231, 183, 0.12);
}

.insight-card > strong {
    display: block;
    margin-top: 20px;
    font-family: var(--font-display);
    font-size: 3.1rem;
    letter-spacing: -0.08em;
    line-height: 0.9;
}

.insight-label {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.insight-rule {
    height: 1px;
    margin: 20px 0 12px;
    background: var(--line);
}

.insight-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--text-soft);
    font-size: 0.8rem;
}

.insight-stat strong {
    color: var(--text);
    font-family: var(--font-display);
}

.library-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.search-field {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    max-width: 440px;
    min-height: 46px;
    padding: 0 14px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-field:focus-within {
    background: var(--surface-elevated);
    border-color: rgba(139, 124, 255, 0.7);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-field input {
    width: 100%;
    color: var(--text);
    background: transparent;
    font-size: 0.85rem;
}

.large-search {
    max-width: 720px;
    min-height: 58px;
    margin: 12px 0 16px;
    border-radius: 17px;
}

.large-search input {
    font-size: 1rem;
}

.large-search kbd {
    padding: 3px 6px;
    color: var(--text-muted);
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.65rem;
}

.filter-group {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 13px;
}

.filter-chip,
.suggestion-chip {
    min-height: 34px;
    padding: 0 12px;
    color: var(--text-muted);
    background: transparent;
    border-radius: 9px;
    font-size: 0.75rem;
    font-weight: 700;
    transition: color 180ms ease, background 180ms ease;
}

.filter-chip:hover,
.filter-chip.active,
.suggestion-chip:hover {
    color: var(--text);
    background: var(--surface-elevated);
}

.filter-chip.active {
    color: var(--accent-strong);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.drop-zone {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
    padding: 15px 17px;
    background: linear-gradient(100deg, rgba(139, 124, 255, 0.11), rgba(83, 216, 210, 0.05));
    border: 1px dashed rgba(139, 124, 255, 0.34);
    border-radius: var(--radius-md);
    transition: background 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

.drop-zone.drag-over,
.drop-zone:hover {
    background: rgba(139, 124, 255, 0.18);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.drop-zone-icon,
.file-picker-icon,
.empty-art,
.settings-row-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 13px;
}

.drop-zone-icon {
    width: 40px;
    height: 40px;
    font-size: 21px;
}

.drop-zone strong,
.drop-zone span,
.file-picker-card strong,
.file-picker-card span {
    display: block;
}

.drop-zone strong {
    font-size: 0.82rem;
}

.drop-zone span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.drop-zone .secondary-button {
    margin-left: auto;
}

.list-heading {
    align-items: center;
    margin-bottom: 10px;
}

.list-heading h3 {
    font-size: 1rem;
}

.list-heading span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.track-list {
    display: grid;
    gap: 6px;
}

.track-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 66px;
    gap: 12px;
    padding: 7px 8px 7px 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 15px;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

.track-row:hover,
.track-row.is-current {
    background: var(--surface);
    border-color: var(--line);
}

.track-row:hover {
    transform: translateX(2px);
}

.track-main-button {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    padding: 4px;
    color: var(--text);
    background: transparent;
    text-align: left;
}

.track-index {
    width: 22px;
    flex: 0 0 22px;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-align: center;
}

.track-row.is-current .track-index {
    color: var(--accent-strong);
}

.track-cover {
    position: relative;
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #5146a8, #1c7e87);
    border-radius: 12px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.2);
}

.track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-cover .playing-bars {
    display: flex;
    align-items: flex-end;
    height: 16px;
    gap: 2px;
}

.playing-bars span {
    width: 3px;
    background: #fff;
    border-radius: 3px;
    animation: equalize 780ms ease-in-out infinite alternate;
}

.playing-bars span:nth-child(1) { height: 8px; animation-delay: -180ms; }
.playing-bars span:nth-child(2) { height: 15px; animation-delay: -420ms; }
.playing-bars span:nth-child(3) { height: 11px; animation-delay: -80ms; }

@keyframes equalize {
    to { transform: scaleY(0.45); }
}

.track-copy {
    min-width: 0;
}

/* Le bloc ci-dessous s'applique a tous les spans de la piste, donc aux tags.
   On les en exclut : un tag est une pastille a la largeur de son texte, pas
   un bloc pleine largeur. */
.track-copy strong,
.track-copy span:not(.track-tags):not(.track-tag) {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-copy strong {
    font-size: 0.86rem;
}

.track-copy span:not(.track-tags):not(.track-tag) {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.track-description {
    display: -webkit-box !important;
    max-width: 42ch;
    margin-top: 3px !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.3;
}

.compact-track-list .track-description {
    display: none !important;
}

.track-source {
    display: inline-flex !important;
    width: auto !important;
    align-items: center;
    gap: 4px;
    margin-top: 4px !important;
    padding: 2px 6px;
    color: var(--text-muted) !important;
    background: var(--surface-elevated);
    border-radius: 5px;
    font-size: 0.59rem !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.track-source.local {
    color: var(--green) !important;
}

.track-source.remote {
    color: var(--cyan) !important;
}

.track-source.soundcloud {
    color: #ff956f !important;
}

.track-source.youtube {
    color: #ff7b7b !important;
}

.track-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.track-action {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--text-muted);
    background: transparent;
    border-radius: 10px;
    font-size: 17px;
    transition: color 180ms ease, background 180ms ease, transform 180ms var(--ease);
}

.track-action:hover {
    color: var(--text);
    background: var(--surface-elevated);
    transform: scale(1.08);
}

.track-action.favorite.active {
    color: var(--danger);
}

.track-action.play {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.track-action.more {
    display: none;
}

.track-row:hover .track-action.more,
.track-row:focus-within .track-action.more {
    display: grid;
}

.empty-state,
.error-state,
.loading-state {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-art {
    width: 58px;
    height: 58px;
    margin-bottom: 15px;
    color: var(--accent-strong);
    font-size: 25px;
}

.empty-state h3 {
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.empty-state p {
    max-width: 340px;
    margin-top: 6px;
    font-size: 0.82rem;
}

.empty-state .primary-button {
    margin-top: 18px;
}

.loading-state {
    gap: 12px;
    min-height: 220px;
}

.loading-spinner {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Bouton d envoi du lien de reinitialisation : le libelle s efface pour laisser
   place a l indicateur. On masque le texte par largeur nulle plutot que par
   visibility afin que le bouton ne change pas de taille, sinon la mise en page
   saute au moment ou l attente commence. */
#forgot-send {
    position: relative;
    transition: color 160ms ease;
}

#forgot-send::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
    opacity: 0;
    pointer-events: none;
}

#forgot-form[data-attente='true'] #forgot-send {
    color: transparent;
}

#forgot-form[data-attente='true'] #forgot-send::after {
    opacity: 1;
}

/* Un bouton desactive doit l etre visiblement, sinon le clic parait sans
   effet et l utilisateur recommence. Le curseur change aussi. */
#forgot-send:disabled {
    cursor: progress;
    opacity: 0.72;
}

@media (prefers-reduced-motion: reduce) {
    /* Sans animation, la rotation disparait : le texte efface laisserait un
       bouton vide. On garde alors le libelle, et le grisement suffit a dire que
       l action est en cours. */
    #forgot-send::after {
        display: none;
    }

    #forgot-form[data-attente='true'] #forgot-send {
        color: inherit;
    }
}

.error-state {
    gap: 9px;
    color: var(--danger);
}

.error-state ion-icon {
    font-size: 30px;
}

.error-state p {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.empty-inline {
    padding: 18px 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.compact-track-list .track-row {
    min-height: 58px;
}

.compact-track-list .track-cover {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 10px;
}

.compact-track-list .track-copy strong {
    font-size: 0.8rem;
}

.compact-track-list .track-source {
    display: none !important;
}

.search-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.suggestion-chip {
    gap: 6px;
    min-height: 36px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.playlist-card,
.playlist-create-card {
    min-height: 190px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.playlist-card {
    position: relative;
    overflow: hidden;
    text-align: left;
    transition: transform 180ms var(--ease), border-color 180ms ease, background 180ms ease;
}

.playlist-card:hover {
    background: var(--surface-elevated);
    border-color: var(--line-strong);
    transform: translateY(-3px);
}

.playlist-cover {
    display: grid;
    height: 110px;
    place-items: center;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.85);
    background: linear-gradient(135deg, #6156d7, #287e8a);
    border-radius: 13px;
    font-size: 27px;
}

.playlist-card:nth-child(3n) .playlist-cover {
    background: linear-gradient(135deg, #bd5b87, #6545b4);
}

.playlist-card:nth-child(4n) .playlist-cover {
    background: linear-gradient(135deg, #208b92, #4a5ecb);
}

.playlist-card strong,
.playlist-card span {
    display: block;
}

.playlist-card strong {
    font-size: 0.9rem;
}

.playlist-card span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.playlist-picker-list {
    display: grid;
    max-height: 280px;
    gap: 6px;
    margin-bottom: 16px;
    overflow: auto;
}

.playlist-picker-item {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 11px;
    min-height: 54px;
    padding: 7px 10px;
    color: var(--text);
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: 13px;
    text-align: left;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms var(--ease);
}

.playlist-picker-item:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: translateX(2px);
}

.playlist-picker-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 10px;
}

.playlist-picker-copy {
    min-width: 0;
    flex: 1;
}

.playlist-picker-copy strong,
.playlist-picker-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-picker-copy strong {
    font-size: 0.8rem;
}

.playlist-picker-copy small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.playlist-picker-empty {
    padding: 24px 12px;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

.account-button {
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-color: rgba(139, 124, 255, 0.2);
}

.account-button.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.account-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 18px;
    padding: 4px;
    background: var(--surface-elevated);
    border-radius: 13px;
}

.account-mode-tab {
    min-height: 38px;
    color: var(--text-muted);
    background: transparent;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 700;
}

.account-mode-tab.active {
    color: var(--text);
    background: var(--surface-solid);
    box-shadow: var(--shadow-sm);
}

.account-panel {
    display: grid;
    gap: 8px;
}

.account-panel .form-label {
    margin-top: 4px;
}

.account-panel .primary-button {
    margin-top: 9px;
}

.account-footnote {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.45;
    text-align: center;
}

.account-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    text-align: center;
}

.account-avatar {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #3d829b);
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(105, 92, 245, 0.28);
    font-size: 28px;
}

.account-profile strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.account-profile > span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.account-sync-state {
    margin: 4px 0 9px;
    padding: 5px 9px;
    color: var(--green);
    background: rgba(110, 231, 183, 0.1);
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 700;
}

.account-profile .secondary-button {
    margin-top: 4px;
}

.playlist-create-card {
    display: flex;
    min-height: 190px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    color: var(--text-soft);
    background: transparent;
    border: 1px dashed var(--line-strong);
    box-shadow: none;
    text-align: left;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms var(--ease);
}

.playlist-create-card:hover,
.playlist-create-card:focus-visible {
    color: var(--text);
    background: var(--surface);
    border-color: var(--accent);
    transform: translateY(-3px);
}

.playlist-create-icon {
    display: grid;
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    place-items: center;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 12px;
    font-size: 21px;
}

.playlist-create-card strong,
.playlist-create-card span {
    display: block;
}

.playlist-create-card strong {
    font-size: 0.9rem;
}

.playlist-create-card span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.settings-list {
    display: grid;
    gap: 8px;
    max-width: 800px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.settings-row-icon {
    width: 40px;
    height: 40px;
    font-size: 19px;
}

.settings-row > div:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.settings-row strong,
.settings-row span {
    display: block;
}

.settings-row strong {
    font-size: 0.85rem;
}

.settings-row span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.switch {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 25px;
    flex: 0 0 44px;
}

.switch input {
    position: absolute;
    opacity: 0;
}

.switch span {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: var(--surface-elevated);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    transition: background 180ms ease, border-color 180ms ease;
}

.switch span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    content: '';
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 180ms var(--ease), background 180ms ease;
}

.switch input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
}

.switch input:checked + span::after {
    background: #fff;
    transform: translateX(19px);
}

.about-card {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 800px;
    margin-top: 22px;
    padding: 16px;
    background: linear-gradient(110deg, var(--accent-soft), transparent);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.about-logo {
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: 13px;
}

.about-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-card > div:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.about-card strong,
.about-card span {
    display: block;
}

.about-card strong {
    font-family: var(--font-display);
}

.about-card span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.mini-player {
    position: fixed;
    z-index: 40;
    right: 24px;
    bottom: 22px;
    left: calc(var(--sidebar-width) + 24px);
    display: flex;
    align-items: center;
    min-height: 68px;
    gap: 12px;
    padding: 9px 13px 9px 9px;
    background: var(--surface-solid);
    border: 1px solid var(--line-strong);
    border-radius: 19px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
}

.mini-progress {
    position: absolute;
    top: -1px;
    right: 18px;
    left: 18px;
    height: 2px;
    overflow: hidden;
    background: var(--line);
    border-radius: 99px;
}

.mini-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    border-radius: inherit;
    transition: width 120ms linear;
}

.mini-player-info {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 11px;
    padding: 0;
    color: var(--text);
    background: transparent;
    text-align: left;
}

.mini-art {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.mini-copy {
    min-width: 0;
}

.mini-copy strong,
.mini-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-copy strong {
    max-width: min(40vw, 420px);
    font-size: 0.82rem;
}

.mini-copy span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.mini-actions {
    display: flex;
    align-items: center;
    gap: 3px;
}

.mini-action,
.mini-play {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    background: transparent;
    border-radius: 50%;
    font-size: 18px;
}

.mini-action:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.mini-play {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 7px 16px rgba(105, 92, 245, 0.3);
}

.mobile-nav {
    display: none;
}

.modal-backdrop,
.player-overlay,
.queue-overlay {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(4, 7, 18, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
    /* meme raison que .topbar : le voile est deja assez opaque, pas besoin de flouter l'arriere-plan */
}

.modal-backdrop.is-open,
.player-overlay.is-open,
.queue-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet,
.queue-sheet {
    width: min(100%, 560px);
    max-height: min(92vh, 760px);
    overflow: auto;
    padding: 12px 22px max(24px, env(safe-area-inset-bottom));
    background: var(--surface-solid);
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
    box-shadow: var(--shadow-lg);
    transform: translateY(30px);
    transition: transform 320ms var(--ease);
}

.modal-backdrop.is-open .bottom-sheet,
.queue-overlay.is-open .queue-sheet {
    transform: translateY(0);
}

.compact-sheet {
    max-width: 440px;
}

.sheet-handle {
    width: 38px;
    height: 4px;
    margin: 0 auto 22px;
    background: var(--line-strong);
    border-radius: 99px;
}

.sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.sheet-header h2 {
    margin-top: 4px;
    font-size: 1.45rem;
}

.add-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 22px;
    padding: 4px;
    background: var(--surface-elevated);
    border-radius: 13px;
}

.add-mode-tab {
    min-height: 40px;
    gap: 7px;
    color: var(--text-muted);
    background: transparent;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

.add-mode-tab.active {
    color: var(--text);
    background: var(--surface-solid);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.add-panel {
    animation: panel-enter 220ms var(--ease) both;
}

@keyframes panel-enter {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-label {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
}

.form-label span {
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 400;
}

.form-input,
.input-action-row .form-input {
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    color: var(--text);
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: 0;
    font-size: 0.84rem;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.input-action-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.input-action-row .form-input {
    flex: 1;
}

.test-button {
    min-width: 74px;
}

.form-hint {
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.45;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.metadata-editor {
    margin-top: 18px;
    padding: 12px;
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.metadata-editor summary {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
}

.metadata-editor summary ion-icon {
    color: var(--cyan);
    font-size: 17px;
}

.metadata-editor[open] summary {
    margin-bottom: 4px;
}

.metadata-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
}

.metadata-textarea {
    min-height: 82px;
    padding-top: 10px;
    line-height: 1.4;
    resize: vertical;
}

.form-feedback {
    min-height: 22px;
    margin: 13px 0;
    color: var(--text-muted);
    font-size: 0.73rem;
}

.form-feedback.success {
    color: var(--green);
}

.form-feedback.error {
    color: var(--danger);
}

.centered-hint {
    text-align: center;
}

.file-picker-card {
    display: flex;
    min-height: 210px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--text-soft);
    background: linear-gradient(145deg, var(--accent-soft), transparent);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: border-color 180ms ease, background 180ms ease;
}

.file-picker-card:hover,
.file-picker-card:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.file-picker-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 14px;
    font-size: 25px;
}

.file-picker-card strong {
    color: var(--text);
    font-size: 0.95rem;
}

.file-picker-card span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.file-picker-card .secondary-button {
    margin-top: 17px;
}

.player-overlay {
    z-index: 110;
    align-items: flex-end;
}

.queue-overlay {
    z-index: 130;
}

.modal-backdrop#playlist-modal,
.modal-backdrop#playlist-picker-modal {
    z-index: 140;
}

/* Le panneau de partage s'ouvre depuis le lecteur, qui occupe tout l ecran
   en z-index 110. Sans cette regle, la modale s'ouvrait bien mais passait
   DERRIERE le lecteur : le clic ne semblait faire rien. Les autres modales
   declarees au-dessus evitaient le piege, celle-ci avait ete ajoutee ensuite
   et avait herite du z-index general de 100. */
.modal-backdrop#share-modal {
    z-index: 150;
}

.player-sheet {
    width: min(100%, 520px);
    max-height: 100dvh;
    overflow: auto;
    padding: 14px 24px max(26px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 50% 20%, rgba(139, 124, 255, 0.22), transparent 30%),
        var(--surface-solid);
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 30px 30px 0 0;
    box-shadow: var(--shadow-lg);
    transform: translateY(35px);
    transition: transform 360ms var(--ease);
}

.player-overlay.is-open .player-sheet {
    transform: translateY(0);
}

.player-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.external-player-panel {
    display: flex;
    min-height: 420px;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 4px;
    text-align: center;
}

.external-player-status {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.external-provider-badge {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 0 9px;
    color: #ffb09a;
    background: rgba(255, 149, 111, 0.13);
    border: 1px solid rgba(255, 149, 111, 0.2);
    border-radius: 99px;
    font-size: 0.61rem;
    letter-spacing: 0.06em;
}

.external-player-frame {
    width: 100%;
    min-height: 166px;
    overflow: hidden;
    background: #0a0d14;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.external-player-frame.youtube {
    aspect-ratio: 16 / 9;
    min-height: 0;
}

.external-player-frame iframe {
    display: block;
    width: 100%;
    min-height: 166px;
    border: 0;
}

.external-player-frame.youtube iframe {
    min-height: 0;
    height: 100%;
}

.external-player-copy {
    width: 100%;
    margin-top: 20px;
}

.external-player-copy h2 {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    letter-spacing: -0.05em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.external-player-copy p {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.external-player-copy .external-player-description {
    max-width: 52ch;
    margin-top: 7px;
    font-size: 0.74rem;
    line-height: 1.4;
}

.external-source-link {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 0 14px;
    color: var(--text);
    background: var(--surface-elevated);
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
}

.external-source-link:hover {
    background: var(--surface-hover);
    border-color: var(--line-strong);
}

.external-player-note {
    max-width: 390px;
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.45;
}

.audio-player-content {
    display: block;
}

.full-artwork-wrap {
    position: relative;
    display: grid;
    width: min(78vw, 330px);
    height: min(78vw, 330px);
    margin: 30px auto 27px;
    /* stretch (et non center) : avec center, height:100% ne se resout pas et
       l'image deborde de sa boite sur une pochette portrait (recouvre le titre). */
    place-items: stretch;
}

.full-artwork-glow {
    position: absolute;
    inset: 11%;
    background: radial-gradient(circle, var(--accent) 0%, color-mix(in srgb, var(--accent) 45%, transparent) 45%, transparent 72%);
    border-radius: 50%;
    opacity: 0.24;
}

.full-artwork {
    /* Position absolue : garantit que la pochette ne peut pas deborder de son cadre.
       (En flux, height:100% dans une grille de hauteur auto ne se resout pas et une
       pochette portrait deborde de 50%, en recouvrant le titre et les controles.) */
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    /* contain : une pochette non carree reste entierement visible dans le cadre */
    object-fit: contain;
    background: var(--surface-elevated);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: 0 28px 55px rgba(0, 0, 0, 0.4);
}

.full-track-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.full-track-meta > div {
    min-width: 0;
    flex: 1;
}

.full-track-meta h2 {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 5vw, 1.8rem);
    letter-spacing: -0.05em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.full-track-meta p {
    overflow: hidden;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.full-track-meta .full-description {
    display: -webkit-box;
    max-width: 52ch;
    margin-top: 7px;
    line-height: 1.4;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.favorite-round {
    color: var(--text-muted);
    background: var(--surface-elevated);
}

.favorite-round.active {
    color: var(--danger);
    background: rgba(251, 113, 133, 0.12);
}

.full-progress {
    margin-top: 26px;
}

.progress-times {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
}

.range-input {
    width: 100%;
    height: 5px;
    appearance: none;
    background: linear-gradient(90deg, var(--accent) var(--range-progress, 0%), var(--line-strong) var(--range-progress, 0%));
    border-radius: 99px;
    cursor: pointer;
}

.range-input::-webkit-slider-thumb {
    width: 15px;
    height: 15px;
    appearance: none;
    background: #fff;
    border: 3px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.range-input::-moz-range-thumb {
    width: 11px;
    height: 11px;
    background: #fff;
    border: 3px solid var(--accent);
    border-radius: 50%;
}

.full-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 28px;
}

.player-control {
    width: 42px;
    height: 42px;
    color: var(--text-muted);
    background: transparent;
    border-radius: 50%;
    font-size: 21px;
    transition: color 180ms ease, background 180ms ease, transform 180ms var(--ease);
}

.player-control:hover,
.player-control.active {
    color: var(--accent-strong);
    background: var(--accent-soft);
    transform: scale(1.08);
}

.main-play-button {
    width: 68px;
    height: 68px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #507bff);
    border-radius: 50%;
    box-shadow: 0 15px 32px rgba(105, 92, 245, 0.34);
    font-size: 30px;
    transition: transform 180ms var(--ease), box-shadow 180ms ease;
}

.main-play-button:hover {
    box-shadow: 0 18px 38px rgba(105, 92, 245, 0.48);
    transform: scale(1.06);
}

.full-secondary-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 28px;
}

/* Panneau de paroles, sous les controles de lecture. */
.lyrics-panel {
    margin-top: 22px;
    padding: 18px 20px 20px;
    border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
    border-radius: 18px;
    background: var(--surface-soft, rgba(255, 255, 255, 0.03));
}

.lyrics-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.lyrics-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lyrics-translations {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border-radius: 999px;
    background: var(--surface, rgba(0, 0, 0, 0.24));
}

.lyrics-lang-button {
    padding: 4px 11px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted, rgba(255, 255, 255, 0.62));
    font-size: 0.78rem;
    cursor: pointer;
}

.lyrics-lang-button.is-active {
    background: var(--accent, #695cf9);
    color: #fff;
}

.lyrics-panel.is-collapsed .lyrics-body,
.lyrics-panel.is-collapsed .lyrics-translation-note {
    display: none;
}

/* Une seule colonne, defilement interne : les paroles sont plus hautes que
   l'ecran, et un panneau qui pousse la lecture hors de vue oblige a scroller
   pour revenir au bouton de pause. */
.lyrics-body {
    max-height: 46vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.lyrics-line {
    margin: 0 0 8px;
    font-size: 1rem;
    line-height: 1.65;
}

.lyrics-line-text {
    display: block;
}

/* Le refrain est mis en avant par la couleur et la graisse, pas par un cadre :
   un encadre a chaque couplet dessinerait des bandes et casserait la lecture
   verticale du texte. */
.lyrics-line.is-chorus {
    color: var(--accent, #695cf9);
    font-weight: 600;
}

.lyrics-chorus-label {
    display: block;
    margin-bottom: 2px;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.72;
}

.lyrics-translation-note {
    margin: 12px 0 0;
    font-size: 0.78rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.55));
}

/* Edition : l'arabe a cote des traductions, plus courtes que l'original, qui ne
   doivent pas se retrouver etirees pour occuper la meme hauteur. */
.lyrics-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.lyrics-textarea {
    min-height: 190px;
    font-family: inherit;
    line-height: 1.6;
}

.lyrics-translation {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lyrics-hint {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.6;
}

@media (max-width: 720px) {
    .lyrics-fields {
        grid-template-columns: 1fr;
    }

    .lyrics-body {
        max-height: 40vh;
    }
}

.volume-control {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.volume-control .icon-button {
    width: 34px;
    height: 34px;
    background: transparent;
    border-color: transparent;
}

.volume-range {
    max-width: 150px;
}

.queue-sheet {
    position: relative;
    max-width: 480px;
}

.queue-list {
    display: grid;
    gap: 5px;
    max-height: 55vh;
    overflow: auto;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 5px 7px;
    background: transparent;
    border-radius: 12px;
}

.queue-item:hover {
    background: var(--surface-elevated);
}

.queue-item-index {
    width: 22px;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-align: center;
}

.queue-item-copy {
    min-width: 0;
    flex: 1;
}

.queue-item-copy strong,
.queue-item-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-copy strong {
    font-size: 0.8rem;
}

.queue-item-copy span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.queue-remove {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--text-muted);
    background: transparent;
    border-radius: 9px;
}

.queue-remove:hover {
    color: var(--danger);
    background: rgba(251, 113, 133, 0.1);
}

.queue-empty {
    padding: 40px 15px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.82rem;
}

.queue-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.toast-region {
    position: fixed;
    z-index: 200;
    right: 18px;
    bottom: 105px;
    display: grid;
    width: min(360px, calc(100vw - 36px));
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 14px;
    color: var(--text);
    background: var(--surface-solid);
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    box-shadow: var(--shadow-lg);
    font-size: 0.76rem;
    animation: toast-in 300ms var(--ease) both;
}

.toast.success {
    border-color: rgba(110, 231, 183, 0.35);
}

.toast.error {
    border-color: rgba(251, 113, 133, 0.42);
}

.toast ion-icon {
    color: var(--accent-strong);
    font-size: 18px;
}

.toast.success ion-icon {
    color: var(--green);
}

.toast.error ion-icon {
    color: var(--danger);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 1100px) {
    :root {
        --sidebar-width: 232px;
    }

    .hero-visual {
        right: 30px;
        opacity: 0.8;
        transform: translateY(-50%) scale(0.82);
    }

    .home-columns {
        grid-template-columns: minmax(0, 1fr) 260px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        width: min(86vw, 300px);
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        transform: translateX(-105%);
        box-shadow: var(--shadow-lg);
        z-index: 60;
    }

    .sidebar-spacer {
        min-height: 8px;
        flex: 0 0 auto;
    }

    .sidebar-spotlight {
        margin: 10px 4px 8px;
        padding: 12px 14px 10px;
    }

    .sidebar-spotlight::after {
        display: none;
    }

    .spotlight-icon {
        width: 26px;
        height: 26px;
        margin-bottom: 8px;
    }

    .sidebar-spotlight strong {
        font-size: 0.78rem;
    }

    .sidebar-spotlight p {
        font-size: 0.68rem;
        margin-top: 3px;
    }

    .sidebar-spotlight .text-button {
        margin-top: 8px;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .content-shell {
        width: 100%;
    }

    .mobile-menu-button {
        display: grid;
    }

    .topbar {
        min-height: 76px;
        padding: calc(14px + var(--safe-top)) calc(18px + var(--safe-right)) 14px calc(18px + var(--safe-left));
    }

    .topbar-title h1 {
        max-width: 100%;
    }

    .page-content {
        padding: 14px 18px 138px;
    }

    .mini-player {
        right: 14px;
        bottom: 86px;
        left: 14px;
    }

    .mobile-nav {
        position: fixed;
        z-index: 45;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        min-height: calc(68px + env(safe-area-inset-bottom));
        padding: 7px 6px env(safe-area-inset-bottom);
        background: var(--surface-solid);
        border-top: 1px solid var(--line);
        box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.16);
    }

    .mobile-nav-link {
        min-width: 0;
        min-height: 52px;
        flex-direction: column;
        gap: 3px;
        color: var(--text-muted);
        background: transparent;
        border-radius: 12px;
        font-size: 0.58rem;
        font-weight: 700;
    }

    .mobile-nav-link span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav-link ion-icon {
        font-size: 21px;
    }

    .mobile-nav-link.active {
        color: var(--accent-strong);
        background: var(--accent-soft);
    }

    .hero-visual {
        right: -24px;
        opacity: 0.5;
    }
}

@media (max-width: 640px) {
    .topbar {
        min-height: 68px;
        padding: calc(12px + var(--safe-top)) calc(14px + var(--safe-right)) 12px calc(14px + var(--safe-left));
    }

    .topbar-kicker {
        display: none;
    }

    .topbar-title h1 {
        max-width: 100%;
        font-size: 1.08rem;
    }

    .topbar-actions {
        gap: 5px;
    }

    .topbar-actions .icon-button {
        width: 38px;
        height: 38px;
    }

    .topbar-actions #refresh-button {
        display: none;
    }

    .add-button {
        min-width: 38px;
        width: 38px;
        height: 38px;
        padding: 0;
    }

    .add-button span {
        display: none;
    }

    .page-content {
        padding: 10px 14px 132px;
    }

    .hero-card {
        min-height: 360px;
        border-radius: 25px;
    }

    .hero-copy {
        align-self: flex-end;
        max-width: 100%;
        padding: 24px 22px 25px;
    }

    .hero-copy h2 {
        margin-top: 14px;
        font-size: 2.45rem;
    }

    .hero-copy p {
        max-width: 290px;
        font-size: 0.82rem;
    }

    .hero-actions {
        margin-top: 19px;
    }

    .hero-visual {
        top: 5%;
        right: -42px;
        width: 220px;
        height: 220px;
        opacity: 0.46;
        transform: scale(0.8);
    }

    .vinyl-disc {
        width: 170px;
        height: 170px;
    }

    .section-heading {
        align-items: flex-start;
        margin-top: 27px;
    }

    .section-heading h2 {
        font-size: 1.15rem;
    }

    .discovery-local-badge {
        margin-top: 7px;
        font-size: 0.62rem;
    }

    .smart-mix-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .smart-mix-card {
        min-height: 68px;
    }

    .section-heading .text-button {
        margin-top: 7px;
    }

    .resume-card {
        min-height: 84px;
        gap: 11px;
        padding: 9px 10px 9px 9px;
    }

    .resume-art {
        width: 62px;
        height: 62px;
    }

    .resume-info h3 {
        font-size: 0.9rem;
    }

    .resume-info p {
        font-size: 0.72rem;
    }

    .round-play-button {
        width: 42px;
        height: 42px;
    }

    .home-columns {
        display: block;
        margin-top: 27px;
    }

    .insight-card {
        margin-top: 24px;
    }

    .view-heading {
        display: block;
        margin-bottom: 19px;
    }

    .view-heading .primary-button,
    .view-heading .secondary-button {
        margin-top: 16px;
    }

    .library-toolbar {
        display: block;
    }

    .search-field {
        max-width: none;
    }

    .filter-group {
        width: 100%;
        margin-top: 10px;
    }

    .filter-chip {
        flex: 1;
    }

    .drop-zone {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 13px;
    }

    .drop-zone > div:nth-child(2) {
        min-width: calc(100% - 56px);
    }

    .drop-zone .secondary-button {
        width: 100%;
        margin: 2px 0 0;
    }

    .track-row {
        min-height: 62px;
        gap: 5px;
        padding-right: 3px;
    }

    .track-main-button {
        gap: 9px;
    }

    .track-cover {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .track-index {
        width: 17px;
        flex-basis: 17px;
    }

    .track-copy strong {
        max-width: 50vw;
        font-size: 0.8rem;
    }

    .track-copy span:not(.track-tags):not(.track-tag) {
        font-size: 0.68rem;
    }

    .track-action {
        width: 32px;
        height: 32px;
    }

    .track-action.more {
        display: none !important;
    }

    .search-suggestions {
        margin-bottom: 21px;
    }

    .large-search {
        min-height: 52px;
    }

    .large-search kbd {
        display: none;
    }

    .playlist-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .playlist-card,
    .playlist-create-card {
        min-height: 160px;
        padding: 12px;
    }

    .playlist-cover {
        height: 82px;
        margin-bottom: 10px;
    }

    .playlist-card strong,
    .playlist-create-card strong {
        font-size: 0.78rem;
    }

    .playlist-card span,
    .playlist-create-card span {
        font-size: 0.66rem;
    }

    .playlist-create-icon {
        width: 34px;
        height: 34px;
        margin-bottom: 10px;
    }

    .settings-row {
        padding: 13px;
    }

    .settings-row span {
        max-width: 205px;
    }

    .about-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .about-card .secondary-button {
        width: 100%;
        margin-top: 5px;
    }

    .mini-player {
        bottom: 77px;
        min-height: 62px;
        padding-right: 8px;
    }

    .mini-art {
        width: 43px;
        height: 43px;
    }

    .mini-copy strong {
        max-width: 42vw;
        font-size: 0.76rem;
    }

    .mini-copy span {
        font-size: 0.64rem;
    }

    .desktop-only {
        display: none;
    }

    .toast-region {
        right: 12px;
        bottom: 145px;
        width: calc(100vw - 24px);
    }

    .bottom-sheet,
    .player-sheet {
        padding-right: 17px;
        padding-left: 17px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .full-artwork-wrap {
        width: min(74vw, 300px);
        height: min(74vw, 300px);
        margin-top: 23px;
        margin-bottom: 22px;
    }

    .full-controls {
        margin-top: 24px;
    }

    .main-play-button {
        width: 62px;
        height: 62px;
    }

    .full-secondary-controls {
        margin-top: 22px;
    }
}

html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] .sidebar {
    border-right: 0;
    border-left: 1px solid var(--line);
}

html[dir="rtl"] .nav-link,
html[dir="rtl"] .track-main-button,
html[dir="rtl"] .playlist-card,
html[dir="rtl"] .playlist-picker-item,
html[dir="rtl"] .playlist-create-card,
html[dir="rtl"] .smart-mix-card,
html[dir="rtl"] .mini-player-info,
html[dir="rtl"] .settings-row,
html[dir="rtl"] .view-heading,
html[dir="rtl"] .section-heading {
    text-align: right;
}

html[dir="rtl"] .drop-zone .secondary-button {
    margin-right: auto;
    margin-left: 0;
}

html[dir="rtl"] .switch span::after {
    right: 3px;
    left: auto;
}

html[dir="rtl"] .switch input:checked + span::after {
    transform: translateX(-19px);
}

html[dir="rtl"] .mini-player {
    right: calc(var(--sidebar-width) + 24px);
    left: 24px;
}

html[dir="rtl"] .nav-link:hover,
html[dir="rtl"] .track-row:hover,
html[dir="rtl"] .playlist-picker-item:hover {
    transform: translateX(-2px);
}

html[dir="rtl"] .text-button ion-icon[name="arrow-forward-outline"] {
    transform: scaleX(-1);
}

html[dir="rtl"] .full-controls,
html[dir="rtl"] .full-secondary-controls,
html[dir="rtl"] .mini-actions,
html[dir="rtl"] .mobile-nav,
html[dir="rtl"] .progress-times,
html[dir="rtl"] .volume-control,
html[dir="rtl"] .range-input {
    direction: ltr;
}

html[dir="rtl"] .toast-region {
    right: auto;
    left: 18px;
}

html[dir="rtl"] .track-copy strong,
html[dir="rtl"] .track-copy span:not(.track-tags):not(.track-tag),
html[dir="rtl"] .mini-copy strong,
html[dir="rtl"] .mini-copy span,
html[dir="rtl"] .queue-item-copy strong,
html[dir="rtl"] .queue-item-copy span,
html[dir="rtl"] .playlist-card strong,
html[dir="rtl"] .playlist-picker-copy strong,
html[dir="rtl"] .full-track-meta h2,
html[dir="rtl"] .full-track-meta p {
    unicode-bidi: plaintext;
}

html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="password"] {
    direction: ltr;
    text-align: left;
}

.language-select {
    min-width: 112px;
    padding: 8px 30px 8px 10px;
    color: var(--text);
    background: var(--surface-elevated);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

html[dir="rtl"] .language-select {
    direction: rtl;
    padding-right: 10px;
    padding-left: 30px;
}

@media (max-width: 900px) {
    html[dir="rtl"] .sidebar {
        right: 0;
        left: auto;
        transform: translateX(105%);
    }

    html[dir="rtl"] .sidebar.is-open {
        transform: translateX(0);
    }

    html[dir="rtl"] .mini-player {
        right: 14px;
        left: 14px;
    }

    html[dir="rtl"] .toast-region {
        right: auto;
        left: 12px;
    }
}

@media (max-width: 640px) {
    html[dir="rtl"] .language-select {
        min-width: 98px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Fiche morceau : cible des liens partages --- */
.track-detail {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
}

.track-detail-cover {
    overflow: hidden;
    border-radius: 16px;
    background: var(--surface-2);
    aspect-ratio: 1;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.track-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-detail-body {
    min-width: 0;
}

.track-detail-body h3 {
    margin: 0;
    font-size: clamp(1.35rem, 4.5vw, 1.9rem);
    line-height: 1.2;
}

.track-detail-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.track-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 16px 0 0;
}

.track-detail-meta > div {
    display: grid;
    gap: 1px;
}

.track-detail-meta dt {
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.track-detail-meta dd {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
}

.track-detail-description {
    max-width: 66ch;
    margin: 16px 0 0;
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.65;
}

.track-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.share-fallback input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.76rem;
}

@media (max-width: 760px) {
    .track-detail {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 16px;
    }

    .track-detail-cover {
        max-width: 220px;
    }
}

/* Le sprite elague ne contient pas arrow-back : on reutilise arrow-forward pivote.
   Les boutons sans icone existante seendaient vides sans aucune erreur console. */
.back-icon {
    transform: rotate(180deg);
}

/* Dans la fiche morceau, le lien artiste/album est un bouton hors de .track-copy :
   sans remise a zero il herite du fond gris par defaut du navigateur. */
.track-detail-links .track-artist-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.track-detail-links .track-artist-link:hover {
    text-decoration: underline;
}

/* --- Menu d'actions d'une piste (partage, file, edition) --- */
.track-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(4, 6, 14, 0.6);
    backdrop-filter: blur(2px);
}

.track-menu {
    position: fixed;
    z-index: 91;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    animation: track-menu-in 180ms var(--ease);
}

@keyframes track-menu-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

.track-menu-title {
    padding: 8px 10px 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.track-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
    text-align: start;
    cursor: pointer;
}

.track-menu-item ion-icon,
.track-menu-item svg {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 1.15rem;
}

.track-menu-item:hover,
.track-menu-item:focus-visible {
    background: var(--surface-2);
    color: var(--accent);
}

.track-menu-item:hover ion-icon,
.track-menu-item:hover svg,
.track-menu-item:focus-visible ion-icon,
.track-menu-item:focus-visible svg {
    color: var(--accent);
}

body.has-track-menu {
    overflow: hidden;
}

@media (min-width: 760px) {
    .track-menu {
        right: auto;
        left: 50%;
        width: 340px;
        transform: translateX(-50%);
    }
}

/*
 * Densite des lignes sur petit ecran.
 *
 * Titre, description, source et tags empilent la copie sur plus de 180 px et
 * la couverture comme les actions se retrouvent flottant au milieu, ce qui
 * donne l'impression d'une ligne cassee. Sur telephone on ne garde que titre
 * et artiste : la fiche morceau affiche le reste, et le menu donne Partager,
 * la file, l'edition et le telechargement en un geste.
 */
@media (max-width: 640px) {
    /* !important obligatoire : .track-description impose display: -webkit-box
       en important, et sans cela la regle de densite serait ignoree. */
    .track-description,
    .track-source,
    .track-tags {
        display: none !important;
    }
}

/* --- Journal d'incidents (panneau admin) --- */
.admin-badge {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger, #e5484d);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.admin-reports {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.admin-report {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--danger, #e5484d);
    border-radius: 10px;
    background: var(--surface);
}

.admin-report.is-server {
    border-left-color: #f5a524;
}

.admin-report-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.76rem;
}

.admin-report-source,
.admin-report-times {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-report-message {
    margin: 6px 0 4px;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.admin-report-meta {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.admin-report details {
    margin-top: 8px;
}

.admin-report summary {
    color: var(--text-muted);
    font-size: 0.74rem;
    cursor: pointer;
}

.admin-report pre {
    max-height: 180px;
    margin: 8px 0 0;
    padding: 8px;
    border-radius: 8px;
    background: var(--surface-2);
    font-size: 0.68rem;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* ---------------------------------------------------------------- partage rapide
   Grille de 3 colonnes : 9 destinations, donc 3 rangees pleines. La couleur de
   fond porte l'identite du reseau, le glyphe reste currentColor : un seul jeu
   d'icones suffit en theme sombre et en theme clair. */
.share-target {
    margin: 0 0 18px;
    color: var(--text-soft);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.share-target:empty {
    display: none;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 8px;
    padding-bottom: 4px;
}

.share-network {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.share-network-badge {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: #fff;
    font-size: 23px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.16s ease, filter 0.16s ease;
}

.share-network:hover .share-network-badge,
.share-network:focus-visible .share-network-badge {
    transform: translateY(-2px) scale(1.06);
    filter: brightness(1.08);
}

.share-network:active .share-network-badge {
    transform: translateY(0) scale(0.97);
}

.share-network-label {
    color: var(--text-soft);
    font-size: 11.5px;
    line-height: 1.25;
    text-align: center;
}

#share-native-slot:empty {
    display: none;
}

.share-native {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 9px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface-elevated);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .share-network-badge {
        transition: none;
    }
}

/* ------------------------------------------- lecteur : dix secondes et vitesse
   Le bouton de vitesse reste visible en permanence, y compris a x1 : une
   vitesse forcee ne doit jamais pouvoir passer inapercue, c est aussi ce
   qui permet de distinguer un reglage d un defaut de lecture. */
.skip-control {
    position: relative;
    /* Un cran en retrait : ces deux boutons deplacent dans le morceau, ils ne
       changent pas de piste. Sans cette difference, leurs glyphes se
       confondaient avec piste precedente et piste suivante. */
    color: var(--text-muted);
    transform: scale(.88);
}

.skip-control ion-icon {
    font-size: 1.05em;
}

.skip-control .skip-seconds {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .02em;
    padding-top: 1px;
    pointer-events: none;
}

/* Retour bref sur le bouton : confirme l action sans changer d icone. */
.player-control.is-pressed,
.main-play-button.is-playing {
    background: var(--accent-soft);
    color: var(--accent-strong);
    transform: scale(.93);
}

.main-play-button.is-playing {
    box-shadow: 0 0 0 2px var(--accent-soft), 0 10px 30px rgba(0, 0, 0, .28);
}

.icon-button.is-muted {
    color: var(--danger);
    background: rgba(251, 113, 133, .12);
}

.speed-wrap {
    position: relative;
    display: inline-flex;
}

.speed-button {
    width: auto;
    min-width: 46px;
    padding: 0 9px;
    font-size: .74rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
}

/* Vitesse non normale : elle ressort, on ne peut pas l'oublier. */
.speed-button.is-modified {
    color: var(--accent-strong);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.speed-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    z-index: 5;
    display: grid;
    gap: 2px;
    min-width: 116px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface-elevated);
    box-shadow: var(--shadow-lg);
}

.speed-menu[hidden] {
    display: none;
}

.speed-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
    text-align: left;
}

.speed-option:hover {
    background: var(--surface-hover);
}

.speed-option.active {
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-weight: 700;
}

.speed-option .coche {
    font-size: .7rem;
    opacity: .9;
}

@media (prefers-reduced-motion: reduce) {
    .player-control.is-pressed,
    .main-play-button.is-playing {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Notifications et mise a jour
   -------------------------------------------------------------------------- */

/* La pastille est posee sur le bouton, pas dans le flux : elle ne doit jamais
   decaler les icones voisines. On la centre par rapport au bouton et non au
   texte, pour rester correcte en arabe comme en francais. */
.notification-button {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg);
}

.notification-panel {
    position: fixed;
    top: 72px;
    inset-inline-end: 24px;
    z-index: 60;
    width: min(400px, calc(100vw - 32px));
    max-height: min(70vh, 560px);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(8, 10, 26, 0.34);
    animation: panel-enter 180ms ease;
}

.notification-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px 12px;
}

.notification-list {
    display: grid;
    gap: 6px;
}

.notification-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border-radius: 13px;
    background: var(--bg);
}

.notification-item[data-level='attention'] {
    background: color-mix(in srgb, var(--warning) 12%, var(--bg));
}

.notification-item[data-level='alerte'] {
    background: color-mix(in srgb, var(--danger) 12%, var(--bg));
}

.notification-item-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
}

.notification-item[data-level='alerte'] .notification-item-icon {
    background: color-mix(in srgb, var(--danger) 18%, transparent);
    color: var(--danger);
}

.notification-item-body strong {
    display: block;
    font-size: 0.9rem;
}

.notification-item-body p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-line;
}

.notification-item-time {
    color: var(--text-muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.notification-empty {
    padding: 22px 14px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* Banniere de mise a jour. Elle doit se voir sans etre agressive : l'utilisateur
   peut la refermer, et le rechargement n'est propose qu'a son rythme. */
.update-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 24px 0;
    padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    color: var(--text);
}

.update-banner > ion-icon {
    flex: none;
    color: var(--accent);
    font-size: 22px;
}

.update-banner > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.update-banner strong {
    font-size: 0.92rem;
}

.update-banner span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.update-dismiss {
    flex: none;
}

.admin-notification-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.admin-notification-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.admin-notification-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.admin-notification-row strong {
    font-size: 0.88rem;
}

.admin-notification-row p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.admin-notification-meta {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.72rem;
}

@media (max-width: 720px) {
    .notification-panel {
        inset-inline: 12px;
        width: auto;
    }

    .update-banner {
        flex-wrap: wrap;
        margin: 12px 12px 0;
    }
}

/* Onglets de langue dans le formulaire d administration. La langue active doit
   etre distincte sans dependre de la couleur seule : un onglet underline compte
   aussi, sinon le choix n'est pas visible pour qui ne distingue pas bien les
   teintes. */
.notification-language-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.notification-language-tab {
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.notification-language-tab.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Indicateur de langue d un message. Discret mais lisible : il doit tenir dans
   la ligne de date sans la déformer. */
.notification-item-langue {
    display: inline-block;
    margin-inline-start: 7px;
    padding: 1px 5px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: 1px;
}

/* Etat de maintenance dans l administration. Distinct du formulaire : c'est un
   fait constate, pas une saisie, et il doit se lire en un coup d oeil. */
.admin-maintenance-etat {
    margin: 0 0 14px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--text);
    font-size: 0.85rem;
}

.admin-maintenance-etat[data-tone='error'] {
    border-color: color-mix(in srgb, var(--danger) 45%, transparent);
    background: color-mix(in srgb, var(--danger) 12%, transparent);
}

/* La case « prevenir » est une decision a part : elle se lit comme les
   interrupteurs du panneau, pas comme un detail de formulaire. */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.checkbox-row input {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    flex: none;
}

/* Un reglage : etiquette, champ, explication. L'explication est ce qui evite
   d'avoir a deviner — une valeur sans raison affichee est une valeur qu'on ne
   touche pas, par prudence, donc qu'on ne regle jamais. */
.admin-setting-row {
    margin-bottom: 16px;
}

.admin-setting-row .form-hint {
    margin: 5px 0 0;
    font-size: 0.78rem;
    line-height: 1.5;
}

/* Statistiques. Les chiffres sont en grand : c'est ce qu on vient lire, et une
   carte ou le chiffre se fond dans le texte ne sert a rien. */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.stats-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--bg);
}

.stats-card strong {
    font-family: var(--font-display);
    font-size: 1.7rem;
    line-height: 1;
}

.stats-card span {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.stats-ranking {
    display: grid;
    gap: 6px;
    margin: 8px 0 18px;
    padding: 0;
    list-style: none;
    counter-reset: rang;
}

.stats-ranking li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    align-items: baseline;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--bg);
}

.stats-ranking li::before {
    counter-increment: rang;
    content: counter(rang);
    display: inline-block;
    min-width: 18px;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.stats-ranking small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.stats-never {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.stats-never li {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* Etat d installation. Le detail doit etre lisible sans zoom : c est
   exactement l'information que l'utilisateur cherche au moment ou il la cherche. */
#settings-install-state-detail {
    display: block;
    line-height: 1.5;
}

/* Groupes de réglages. Un trait fin suffit : le titre indique le changement de
   nature des champs, il ne doit pas devenir un objet décoratif. */
.admin-settings-groupe {
    margin: 1.75rem 0 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.72;
}

.admin-settings-groupe:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.admin-setting-secret[data-etat="absent"] {
    color: var(--danger, #ff6b6b);
}

.admin-setting-secret[data-etat="configure"] {
    color: var(--success, #4ade80);
}

/* Bloc abonnement. La ligne d'etat peut etre longue — mode, etat, manque — et
   doit rester lisible sans occuper plus de place que necessaire. */
#profile-abonnement-etat {
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

/* Decorations berceuse : etoiles, lune souriante, nuage, etoile filante. */
.style-card-art.berceuse-art {
    position: relative;
}
.berceuse-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.berceuse-decor .etoile {
    position: absolute;
    color: #fff7c2;
    font-size: 12px;
    text-shadow: 0 0 6px rgba(255, 247, 194, 0.9);
    animation: berceuse-twinkle 2.4s ease-in-out infinite;
}
.berceuse-decor .e1 { top: 12%; left: 18%; animation-delay: 0s; }
.berceuse-decor .e2 { top: 22%; right: 16%; font-size: 10px; animation-delay: 0.8s; }
.berceuse-decor .e3 { bottom: 28%; left: 28%; font-size: 9px; animation-delay: 1.6s; }
.berceuse-decor .lune {
    position: absolute;
    top: 8%;
    right: 10%;
    font-size: 22px;
    animation: berceuse-float 4s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(255, 236, 179, 0.8));
}
.berceuse-decor .nuage {
    position: absolute;
    top: 38%;
    left: -20%;
    font-size: 26px;
    color: rgba(255, 255, 255, 0.85);
    animation: berceuse-cloud 9s linear infinite;
}
.berceuse-decor .etoile-filante {
    position: absolute;
    top: 18%;
    left: -10%;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.9));
    transform: rotate(-25deg);
    opacity: 0;
    animation: berceuse-shooting 6s ease-in-out infinite;
}
@keyframes berceuse-twinkle {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.2); }
}
@keyframes berceuse-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes berceuse-cloud {
    0% { transform: translateX(0); opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { transform: translateX(160%); opacity: 0.7; }
}
@keyframes berceuse-shooting {
    0%, 70% { opacity: 0; transform: translate(0, 0) rotate(-25deg); }
    75% { opacity: 1; }
    100% { opacity: 0; transform: translate(140%, 60%) rotate(-25deg); }
}
@media (prefers-reduced-motion: reduce) {
    .berceuse-decor * { animation: none !important; }
}

/* Etoile filante : traverse la carte de gauche a droite. */
.berceuse-decor .etoile-filante {
    top: 14%;
    left: -15%;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.95), rgba(255,255,255,0));
    transform: rotate(-18deg);
    animation: berceuse-shooting 5s ease-in-out infinite;
}
@keyframes berceuse-shooting {
    0%, 60% { opacity: 0; transform: translate(-20%, -10%) rotate(-18deg); }
    65% { opacity: 1; }
    100% { opacity: 0; transform: translate(150%, 60%) rotate(-18deg); }
}

/* Neige d'etoiles : petites etoiles qui tombent comme des flocons. */
.berceuse-decor .etoile-neige {
    position: absolute;
    color: rgba(255, 255, 255, 0.9);
    font-size: 8px;
    text-shadow: 0 0 4px rgba(255, 247, 194, 0.8);
    animation: berceuse-snow 7s linear infinite;
    opacity: 0;
}
.berceuse-decor .n1 { left: 10%; animation-delay: 0s; }
.berceuse-decor .n2 { left: 35%; animation-delay: 1.4s; font-size: 10px; }
.berceuse-decor .n3 { left: 60%; animation-delay: 2.8s; }
.berceuse-decor .n4 { left: 80%; animation-delay: 4.2s; font-size: 9px; }
.berceuse-decor .n5 { left: 50%; animation-delay: 5.6s; font-size: 7px; }
@keyframes berceuse-snow {
    0% { top: -5%; opacity: 0; transform: translateX(0) rotate(0deg); }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 105%; opacity: 0; transform: translateX(12px) rotate(180deg); }
}
