/* ==========================================================================
   Neginati Studio — feuille de style unique (clair + sombre automatique)
   Police système, tailles lisibles, cartes sobres, une action principale.
   ========================================================================== */

/* ---------- 1. Jetons ---------- */
:root {
    color-scheme: light dark;

    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --surface-3: #eef0f6;
    --text: #1b1d29;
    --muted: #5d6476;
    --faint: #8a90a0;
    --border: #e2e5ee;
    --border-strong: #cfd4e0;

    --primary: #6d28d9;
    --primary-hover: #5b21b6;
    --primary-text: #6d28d9;
    --primary-soft: #f2ecff;
    --on-primary: #ffffff;

    --success: #15803d;
    --success-soft: #e8f7ee;
    --warning: #a85d00;
    --warning-soft: #fff4e0;
    --danger: #c02626;
    --danger-soft: #fdecec;
    --info: #1d5fd1;
    --info-soft: #e8f0fe;

    --shadow-sm: 0 1px 2px rgba(20, 22, 40, .06);
    --shadow: 0 1px 3px rgba(20, 22, 40, .06), 0 6px 16px rgba(20, 22, 40, .05);
    --shadow-lg: 0 18px 48px rgba(20, 22, 40, .18);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --topbar-h: 64px;
    --sidebar-w: 248px;
    --sidebar-collapsed-w: 72px;
    --content-w: 1180px;
    --gutter: clamp(16px, 3vw, 32px);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1117;
        --surface: #171a22;
        --surface-2: #1c2029;
        --surface-3: #242935;
        --text: #eceef4;
        --muted: #a6acbb;
        --faint: #7b8191;
        --border: #2a2f3b;
        --border-strong: #3a4050;

        --primary: #7c3aed;
        --primary-hover: #8b5cf6;
        --primary-text: #b69cff;
        --primary-soft: #261d3d;

        --success: #4ade80;
        --success-soft: #142a1d;
        --warning: #fbbf24;
        --warning-soft: #2e2410;
        --danger: #f87171;
        --danger-soft: #331a1c;
        --info: #7aa7ff;
        --info-soft: #172338;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 8px 20px rgba(0, 0, 0, .2);
        --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
    }
}

:root[data-theme="dark"] {
    --bg: #0f1117; --surface: #171a22; --surface-2: #1c2029; --surface-3: #242935;
    --text: #eceef4; --muted: #a6acbb; --faint: #7b8191; --border: #2a2f3b; --border-strong: #3a4050;
    --primary: #7c3aed; --primary-hover: #8b5cf6; --primary-text: #b69cff; --primary-soft: #261d3d;
    --success: #4ade80; --success-soft: #142a1d; --warning: #fbbf24; --warning-soft: #2e2410;
    --danger: #f87171; --danger-soft: #331a1c; --info: #7aa7ff; --info-soft: #172338;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 650; line-height: 1.25; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
strong { font-weight: 650; }
small { font-size: .875rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code, pre { font-family: var(--mono); font-size: .9em; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; overflow-x: auto; }
ul, ol { padding-left: 1.25rem; margin: 0 0 .75em; }
dl, dd { margin: 0; }
[hidden] { display: none !important; }

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

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

.skip-link {
    position: absolute; left: 16px; top: -100px; z-index: 1000;
    background: var(--primary); color: var(--on-primary); padding: .6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

/* Petits libellés : jamais en capitales criardes. */
.eyebrow, .neg-kicker, .studio-panel-heading__eyebrow, .studio-create-toolbar__kicker,
.section-nav-label, .sidebar-label, .neg-panel-heading p, .neg-tip-card > p,
.auth-eyebrow, .studio-create-summary__header p {
    display: block;
    margin: 0 0 .25rem;
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--primary-text);
}
/* Les libellés .eyebrow sont écrits en capitales dans les gabarits. */
.eyebrow { text-transform: lowercase; }
.eyebrow::first-letter { text-transform: uppercase; }

.fine-print, .muted, .help-text, .helptext { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.fine-print a { text-decoration: underline; }

/* ---------- 3. Boutons ---------- */
.button, .neg-button, .btn, .auth-button,
button.lyrics-open-button {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 42px; padding: .55rem 1.1rem;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface); color: var(--text);
    font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1.2;
    text-align: center; text-decoration: none; cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}
.button:hover, .neg-button:hover, .btn:hover { background: var(--surface-3); text-decoration: none; }
.button svg, .neg-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.button--primary, .neg-button--primary {
    background: var(--primary); border-color: var(--primary); color: var(--on-primary);
}
.button--primary:hover, .neg-button--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }

.button--secondary {
    background: var(--primary-soft); border-color: transparent; color: var(--primary-text);
}
.button--secondary:hover { background: var(--primary-soft); border-color: var(--primary-text); }

.button--ghost, .neg-button--ghost { background: transparent; }
.button--danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.button--danger-ghost:hover { background: var(--danger-soft); }
.button--small { min-height: 34px; padding: .35rem .8rem; font-size: .875rem; border-radius: 8px; }
.button--large { min-height: 48px; padding: .7rem 1.4rem; font-size: 1rem; }

.button:disabled, .button[aria-disabled="true"], button:disabled {
    opacity: .5; cursor: not-allowed;
}
.button.is-busy, [aria-busy="true"] > .button { cursor: progress; }

.button-group, .card-actions, .version-actions, .form-actions, .neg-hero-actions,
.project-actions, .generation-job-panel__actions {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
}
.button-group form, .card-actions form, .version-actions form, .project-actions form,
.generation-job-panel__actions form { margin: 0; }

.icon-link {
    display: inline-grid; place-items: center; width: 34px; height: 34px;
    border-radius: 8px; border: 1px solid var(--border); color: var(--muted);
}
.icon-link:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }

/* ---------- 4. Formulaires ---------- */
label { font-weight: 600; font-size: .9375rem; }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select, textarea {
    width: 100%;
    min-height: 44px;
    padding: .6rem .8rem;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
select { cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; flex: none; }

.form-field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.form-field > small, .form-field .helptext { color: var(--muted); font-size: .875rem; font-weight: 400; }
.form-field label { margin: 0; }
.form-field--wide, .studio-field--wide { grid-column: 1 / -1; }

.form-grid, .studio-form-grid {
    display: grid; gap: 1rem 1.25rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.studio-form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.errorlist {
    list-style: none; margin: .25rem 0 0; padding: 0;
    color: var(--danger); font-size: .875rem; font-weight: 600;
}
.form-field:has(.errorlist) input, .form-field:has(.errorlist) select, .form-field:has(.errorlist) textarea { border-color: var(--danger); }

.form-alert, .form-note {
    padding: .8rem 1rem; border-radius: var(--radius-sm);
    background: var(--info-soft); color: var(--text); font-size: .9375rem;
    border-left: 3px solid var(--info);
}
.form-note { margin: 1rem 0 .5rem; }
.form-alert--error { background: var(--danger-soft); border-left-color: var(--danger); }

.charge-risk-confirmation, .usage-policy-checkbox {
    display: flex; gap: .65rem; align-items: flex-start;
    padding: .75rem .9rem; margin: .75rem 0;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); font-weight: 400; font-size: .9375rem; cursor: pointer;
}
.charge-risk-confirmation input { margin-top: .2rem; }

.form-error-summary {
    display: flex; gap: 1rem; padding: 1rem 1.25rem; margin-bottom: 1.25rem;
    border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
    border-radius: var(--radius); background: var(--danger-soft);
}
.form-error-summary__icon {
    flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--danger); color: #fff; font-weight: 700;
}
.form-error-summary h2 { font-size: 1.05rem; }
.form-error-summary ul { margin: .5rem 0 0; }
.form-error-summary a { color: var(--danger); }

/* ---------- 5. Cartes / panneaux ---------- */
.panel, .neg-panel, .neg-summary-card, .studio-control-panel, .studio-workspace,
.studio-create-summary, .library-toolbar, .project-card, .health-card, .usage-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.panel { padding: clamp(1rem, 2.5vw, 1.5rem); margin-bottom: 1.25rem; }
.panel > h2:first-child, .panel > .eyebrow + h2 { margin-top: 0; }

.section-heading {
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between;
    margin-bottom: 1rem;
}
.section-heading > div:first-child { flex: 1 1 280px; min-width: 0; }
.section-heading p { color: var(--muted); }
.section-heading--compact { margin-bottom: .75rem; align-items: center; }
.section-heading--compact h2 { margin: 0; }

.alert-panel {
    padding: 1rem 1.25rem; margin-bottom: 1.25rem; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface);
}
.alert-panel--error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

/* Statuts */
.card-status, .job-status-badge, .health-badge, .provider-badge, .usage-status,
.final-version-badge, .version-count, .cost-badge, .genre-pill, .version-pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .2rem .65rem; border-radius: 999px;
    font-size: .8125rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
    background: var(--surface-3); color: var(--muted);
}
.card-status { white-space: normal; max-width: 100%; }
.status--draft { background: var(--surface-3); color: var(--muted); }
.status--lyrics_generating, .status--music_generating { background: var(--info-soft); color: var(--info); }
.status--lyrics_ready { background: var(--primary-soft); color: var(--primary-text); }
.status--music_ready, .final-version-badge { background: var(--success-soft); color: var(--success); }
.status--music_qa_pending, .status--music_needs_repair { background: var(--warning-soft); color: var(--warning); }
.status--failed, .job-status-badge--failed { background: var(--danger-soft); color: var(--danger); }
.job-status-badge { background: var(--primary-soft); color: var(--primary-text); }

/* Messages */
.messages { display: grid; gap: .6rem; margin-bottom: 1.25rem; }
.message {
    display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between;
    padding: .8rem 1rem; border-radius: var(--radius);
    background: var(--info-soft); color: var(--text);
    border: 1px solid color-mix(in srgb, var(--info) 25%, transparent);
    font-size: .9375rem;
}
.message--success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.message--warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.message--error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.message-close {
    flex: none; border: 0; background: transparent; color: var(--muted);
    font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 .25rem;
}

/* Progression */
.progress-block { margin: 1rem 0; }
.progress-label { display: flex; justify-content: space-between; font-size: .875rem; color: var(--muted); margin-bottom: .4rem; }
.progress-label strong { color: var(--text); }
.progress-track, .budget-track, .project-card-progress > span {
    display: block; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden;
}
.progress-track > span, .budget-track > span, .budget-track > i, .project-card-progress > span > i {
    display: block; height: 100%; border-radius: inherit; background: var(--primary);
    transition: width .4s ease;
}

/* Listes de définitions (résumés) */
.settings-list, .usage-mini-list, .generation-settings-summary, .version-metadata,
.studio-create-summary__list, .preset-preview__facts {
    display: grid; gap: 0;
}
.settings-list > div, .usage-mini-list > div, .studio-create-summary__list > div,
.generation-settings-summary > div {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9375rem;
}
.settings-list > div:last-child, .usage-mini-list > div:last-child,
.studio-create-summary__list > div:last-child, .generation-settings-summary > div:last-child { border-bottom: 0; }
dt { color: var(--muted); }
dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* États vides */
.empty-state, .neg-empty {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem;
    padding: 3rem 1.5rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
    background: var(--surface); color: var(--muted);
}
.empty-state h2, .neg-empty h3 { color: var(--text); margin: .25rem 0; }
.empty-state p { max-width: 46ch; }
.empty-icon, .neg-empty > span {
    display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-text); font-size: 1.5rem;
}
.empty-state--compact { padding: 1.5rem; }
.neg-empty > a { font-weight: 600; }

/* ---------- 6. Coquille de l’application ---------- */
.app-layout { min-height: 100vh; }

.app-topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 1rem;
    height: var(--topbar-h); padding: 0 var(--gutter);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-brand, .public-brand, .auth-brand {
    display: flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; min-width: 0;
}
.topbar-brand:hover, .public-brand:hover, .auth-brand:hover { text-decoration: none; }
.topbar-brand img, .public-brand img, .auth-brand img { width: 36px; height: 36px; }
.topbar-brand span, .public-brand span, .auth-brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-brand strong, .public-brand strong, .auth-brand-copy strong { font-size: 1.0625rem; }
.topbar-brand small, .public-brand small, .auth-brand-copy small { color: var(--muted); font-size: .8125rem; }

.topbar-title { display: none; }

.topbar-create {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: .4rem;
    min-height: 40px; padding: .45rem 1rem; border-radius: 10px;
    background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: .9375rem;
}
.topbar-create:hover { background: var(--primary-hover); text-decoration: none; }
.topbar-create span { font-size: 1.15rem; line-height: 1; }

.sidebar-toggle {
    order: -1;
    display: none; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); cursor: pointer;
}
.sidebar-toggle > span:not(.sr-only) { display: block; height: 2px; border-radius: 2px; background: var(--text); }

.topbar-profile { position: relative; }
.topbar-profile-trigger {
    display: flex; align-items: center; gap: .55rem; padding: .3rem .5rem .3rem .3rem;
    border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text);
    font: inherit; cursor: pointer;
}
.topbar-profile-trigger:hover, .topbar-profile.is-open .topbar-profile-trigger { background: var(--surface-3); }
.topbar-avatar, .sidebar-avatar {
    display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-text); font-weight: 700; font-size: .9375rem;
}
.topbar-profile-copy { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.topbar-profile-copy strong { font-size: .875rem; }
.topbar-profile-copy small { font-size: .75rem; color: var(--muted); }
.profile-chevron svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; }
.topbar-profile-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
    display: none; min-width: 240px; padding: .4rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.topbar-profile.is-open .topbar-profile-menu { display: block; }
.profile-menu-identity { display: flex; flex-direction: column; padding: .6rem .75rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.profile-menu-identity small { color: var(--muted); overflow-wrap: anywhere; }
.topbar-profile-menu a, .topbar-profile-menu button {
    display: block; width: 100%; padding: .55rem .75rem; border: 0; border-radius: 8px;
    background: transparent; color: var(--text); font: inherit; font-size: .9375rem; text-align: left; cursor: pointer;
}
.topbar-profile-menu a:hover, .topbar-profile-menu button:hover { background: var(--surface-3); text-decoration: none; }
.topbar-profile-menu form { margin: 0; }

/* Barre latérale */
.app-sidebar {
    position: fixed; z-index: 40; top: var(--topbar-h); bottom: 0; left: 0;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--border);
    overflow-y: auto; transition: width .2s ease, transform .2s ease;
}
.sidebar-tools {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .9rem 1rem .25rem;
}
.sidebar-tools strong { font-size: .8125rem; color: var(--muted); font-weight: 600; }
.sidebar-collapse, .sidebar-close {
    display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border);
    border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.2rem;
}
.sidebar-collapse svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.sidebar-close { display: none; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: .5rem .75rem 1rem; flex: 1; }
.sidebar-label { margin: 1rem .5rem .35rem; color: var(--faint); }
.sidebar-nav > .sidebar-label:first-child { margin-top: .25rem; }
.sidebar-link {
    display: flex; align-items: center; gap: .7rem;
    min-height: 42px; padding: .5rem .7rem; border-radius: 10px;
    color: var(--text); font-size: .9375rem; font-weight: 500;
}
.sidebar-link svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-link:hover { background: var(--surface-3); text-decoration: none; }
.sidebar-link.is-active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.sidebar-link.is-active svg { stroke: var(--primary-text); }
.sidebar-link--primary:not(.is-active) svg { stroke: var(--primary-text); }

.sidebar-account {
    display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem;
    border-top: 1px solid var(--border);
}
.sidebar-account-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.sidebar-account-copy strong { font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account-copy small { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account form { margin: 0; }
.sidebar-account button {
    display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border);
    border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.sidebar-account button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.sidebar-account button:hover { color: var(--danger); }

.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 35; background: rgba(10, 12, 20, .45);
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }

.app-main { margin-left: var(--sidebar-w); min-height: calc(100vh - var(--topbar-h)); display: flex; flex-direction: column; transition: margin-left .2s ease; }

/* Barre réduite (bureau) */
@media (min-width: 1021px) {
    body.sidebar-collapsed .app-sidebar { width: var(--sidebar-collapsed-w); }
    body.sidebar-collapsed .app-main { margin-left: var(--sidebar-collapsed-w); }
    body.sidebar-collapsed .sidebar-tools strong,
    body.sidebar-collapsed .sidebar-label,
    body.sidebar-collapsed .sidebar-link span,
    body.sidebar-collapsed .sidebar-account-copy,
    body.sidebar-collapsed .sidebar-account form { display: none; }
    body.sidebar-collapsed .sidebar-tools { justify-content: center; padding-inline: 0; }
    body.sidebar-collapsed .sidebar-collapse svg { transform: rotate(180deg); }
    body.sidebar-collapsed .sidebar-link { justify-content: center; padding: .5rem; }
    body.sidebar-collapsed .sidebar-account { justify-content: center; padding-inline: 0; }
}

.page-shell {
    width: 100%; max-width: calc(var(--content-w) + 2 * var(--gutter));
    margin: 0 auto; padding: 1.75rem var(--gutter) 2.5rem; flex: 1;
}
.public-page-shell { max-width: calc(1120px + 2 * var(--gutter)); }

.app-footer {
    display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
    padding: 1.25rem var(--gutter); border-top: 1px solid var(--border);
    color: var(--muted); font-size: .875rem;
}
.app-footer > div { display: flex; gap: .5rem; flex-wrap: wrap; }
.app-footer > div strong { color: var(--text); }
.app-footer nav { display: flex; gap: 1rem; }
.app-footer nav a { color: var(--muted); }

/* Navigation mobile en bas */
.mobile-app-nav { display: none; }

/* En-tête public */
.public-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.public-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: calc(1120px + 2 * var(--gutter)); height: var(--topbar-h); margin: 0 auto; padding: 0 var(--gutter); }
.public-cta { display: inline-flex; align-items: center; min-height: 40px; padding: .45rem 1.1rem; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-weight: 600; }
.public-cta:hover { background: var(--primary-hover); text-decoration: none; }

.public-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .9375rem; }
.public-footer-grid {
    display: grid; gap: 1.5rem; grid-template-columns: 2fr repeat(3, 1fr);
    max-width: calc(1120px + 2 * var(--gutter)); margin: 0 auto; padding: 2rem var(--gutter);
}
.public-footer-grid > div { display: flex; flex-direction: column; gap: .4rem; }
.public-footer-grid strong { color: var(--text); }
.public-footer-grid a { color: var(--muted); }
.public-footer-brand { flex-direction: row !important; gap: .75rem !important; align-items: flex-start; }
.public-footer-brand img { width: 36px; height: 36px; }
.public-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; max-width: calc(1120px + 2 * var(--gutter)); margin: 0 auto; padding: 1rem var(--gutter); border-top: 1px solid var(--border); font-size: .875rem; }

/* Boîte de confirmation */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(10, 12, 20, .55); }
.app-confirm-dialog, .project-delete-dialog, .lyrics-dialog {
    padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface);
    box-shadow: var(--shadow-lg); width: min(480px, calc(100vw - 32px));
}
.app-confirm-dialog__surface, .project-delete-dialog__content {
    display: grid; grid-template-columns: auto 1fr; gap: .9rem 1rem; padding: 1.4rem;
}
.app-confirm-dialog__icon, .project-delete-dialog__icon {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: var(--warning-soft); color: var(--warning); font-weight: 700; font-size: 1.1rem;
}
.project-delete-dialog__icon { background: var(--danger-soft); color: var(--danger); }
.app-confirm-dialog h2, .project-delete-dialog h2 { font-size: 1.1rem; margin-bottom: .35rem; }
.app-confirm-dialog p:not(.eyebrow), .project-delete-dialog p:not(.eyebrow) { color: var(--muted); }
.app-confirm-dialog__actions, .project-delete-dialog__actions {
    grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .6rem; margin-top: .4rem;
}
.app-confirm-dialog__actions .button--danger-ghost { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.project-delete-dialog__actions .button--danger-ghost { background: var(--danger); border-color: var(--danger); color: #fff; }
body.has-open-dialog { overflow: hidden; }

/* ---------- 7. En-têtes de page ---------- */
.page-header, .page-heading, .usage-page-header {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-header > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-header h1 { margin-bottom: .25rem; }
.page-header p:not(.eyebrow) { color: var(--muted); max-width: 70ch; }
.page-header--compact { margin-bottom: 1.25rem; }

/* ---------- 8. Tableau de bord ---------- */
.neg-dashboard {
    display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 320px; align-items: start;
}
.neg-dashboard-main, .neg-dashboard-aside { display: grid; gap: 1.25rem; min-width: 0; }

.neg-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: center;
    padding: clamp(1.25rem, 3vw, 2rem);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-soft), var(--surface) 70%);
    border: 1px solid var(--border);
}
.neg-hero h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); max-width: 22ch; margin-bottom: .5rem; }
.neg-hero h1 br { display: none; }
.neg-hero h1 em, .neg-public-hero h1 em { font-style: normal; color: var(--primary-text); }
.neg-hero-copy > p:not(.neg-kicker):not(.neg-hero-assurance) { color: var(--muted); font-size: 1.0625rem; max-width: 56ch; }
.neg-hero-actions { margin-top: 1.1rem; }
.neg-hero-assurance { margin-top: .9rem; color: var(--muted); font-size: .875rem; }
.neg-hero-assurance span { color: var(--success); font-weight: 700; }
.neg-kicker span { display: none; }
.neg-hero-art {
    display: grid; place-items: center; width: 120px; height: 120px; border-radius: 28px;
    background: var(--primary); color: #fff; box-shadow: var(--shadow);
}
.neg-hero-art .neg-note { font-size: 3.5rem; line-height: 1; }
.neg-orbit, .neg-spark { display: none; }

.neg-panel, .neg-summary-card { padding: 1.25rem; }
.neg-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.neg-panel-heading h2 { margin: 0; }
.neg-panel-heading > a { font-weight: 600; font-size: .9375rem; white-space: nowrap; }

.neg-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; counter-reset: step; }
.neg-steps article {
    position: relative; padding: 1rem; border-radius: var(--radius); background: var(--surface-2);
    border: 1px solid var(--border);
}
.neg-steps article > span {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary); color: var(--on-primary); font-size: .875rem; font-weight: 700; margin-bottom: .6rem;
}
.neg-step-icon { display: none; }
.neg-steps h3 { font-size: 1rem; margin-bottom: .3rem; }
.neg-steps p { color: var(--muted); font-size: .875rem; }

.neg-projects { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.neg-project-card {
    display: flex; gap: .9rem; padding: .9rem; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface-2);
}
.neg-project-cover {
    flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
    width: 76px; min-height: 76px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-text);
    text-align: center;
}
.neg-project-cover:hover { text-decoration: none; }
.neg-project-cover > span { font-size: 1.6rem; line-height: 1; }
.neg-project-cover small { font-size: .7rem; color: var(--muted); padding: 0 .3rem; line-height: 1.2; }
.neg-project-card__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.neg-project-card__topline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem .5rem; align-items: center; font-size: .8125rem; color: var(--muted); }
.neg-project-card h3 { margin: 0; font-size: 1rem; }
.neg-project-card h3 a { color: var(--text); }
.neg-project-card p { color: var(--muted); font-size: .875rem; margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.neg-project-card__outputs, .project-output-badges { display: flex; gap: .35rem; flex-wrap: wrap; }
.neg-project-card__outputs span, .project-output-badges span {
    padding: .1rem .5rem; border-radius: 6px; font-size: .75rem; font-weight: 600;
    background: var(--surface-3); color: var(--faint);
}
.neg-project-card__outputs span.is-ready, .project-output-badges span.is-ready { background: var(--success-soft); color: var(--success); }
.neg-project-resume { font-size: .875rem; font-weight: 600; margin-top: auto; }

.neg-summary-list { display: grid; gap: .5rem; }
.neg-summary-list article { display: flex; align-items: center; gap: .8rem; padding: .6rem .2rem; border-bottom: 1px solid var(--border); }
.neg-summary-list article:last-child { border-bottom: 0; }
.neg-summary-list strong { display: block; font-size: 1.25rem; line-height: 1.2; }
.neg-summary-list small { color: var(--muted); }
.neg-summary-icon {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
    background: var(--primary-soft); color: var(--primary-text); font-size: 1.05rem;
}
.neg-summary-icon--gold { background: var(--warning-soft); color: var(--warning); }
.neg-summary-icon--green { background: var(--success-soft); color: var(--success); }
.neg-summary-icon--violet { background: var(--info-soft); color: var(--info); }

.neg-tip-card {
    padding: 1.25rem; border-radius: var(--radius-lg); background: var(--primary); color: var(--on-primary);
}
.neg-tip-card > span { display: none; }
.neg-tip-card > p { color: rgba(255, 255, 255, .8) !important; }
.neg-tip-card h2 { color: #fff; font-size: 1.1rem; margin: .2rem 0 .8rem; }
.neg-tip-card a { color: #fff; font-weight: 600; text-decoration: underline; }

.neg-security-card {
    display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.25rem;
    border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface);
}
.neg-security-card > span { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--success-soft); color: var(--success); font-weight: 700; }
.neg-security-card small { display: block; color: var(--muted); }

/* Accueil public */
.neg-public-hero {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2rem; align-items: center;
    padding: clamp(1.5rem, 4vw, 3rem) 0;
}
.neg-public-hero h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); line-height: 1.12; margin-bottom: .75rem; }
.neg-public-hero > div > p:not(.neg-kicker):not(.fine-print) { font-size: 1.125rem; color: var(--muted); max-width: 52ch; }
.home-studio-visual {
    margin: 0; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--surface);
    border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; gap: 1rem;
}
.home-studio-heading { display: flex; justify-content: space-between; gap: .5rem; font-size: .8125rem; color: var(--muted); font-weight: 600; }
.home-studio-tag { color: var(--primary-text); }
.home-studio-title { font-size: 1.35rem; font-weight: 650; line-height: 1.3; }
.home-studio-title em { font-style: normal; color: var(--primary-text); }
.home-studio-track { display: grid; grid-template-columns: 96px 1fr; gap: .75rem; align-items: center; font-size: .875rem; color: var(--muted); }
.home-lyric-lines { display: grid; gap: 6px; }
.home-lyric-lines i { display: block; height: 6px; border-radius: 4px; background: var(--surface-3); }
.home-lyric-lines i:nth-child(2) { width: 80%; } .home-lyric-lines i:nth-child(3) { width: 60%; }
.home-wave { display: flex; align-items: center; gap: 3px; height: 36px; }
.home-wave i { flex: 1; height: var(--bar); border-radius: 2px; background: var(--primary); opacity: .75; }
.home-instrument-blocks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.home-instrument-blocks i { height: 18px; border-radius: 4px; background: var(--primary-soft); }
.home-studio-visual figcaption { color: var(--muted); font-size: .875rem; }
.neg-public-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding-bottom: 2rem; }
.neg-public-features article { padding: 1.25rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.neg-public-features span { color: var(--primary-text); font-weight: 700; font-size: .875rem; }
.neg-public-features h2 { font-size: 1.1rem; margin: .4rem 0; }
.neg-public-features p { color: var(--muted); }

/* ---------- 9. Bibliothèque ---------- */
.library-toolbar { padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.library-toolbar__heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: .8rem; }
.library-toolbar__heading h2 { margin: 0; font-size: 1.05rem; }
.library-result-count { color: var(--muted); font-size: .875rem; margin: 0; }
.library-result-count strong { color: var(--text); }
.library-toolbar__controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: .6rem; align-items: center; }
.library-toolbar__controls label { margin: 0; font-weight: 400; }
.library-search { position: relative; display: block; }
.library-search svg { position: absolute; left: .75rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--faint); stroke-width: 2; pointer-events: none; }
.library-search input { padding-left: 2.4rem !important; }

.project-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.project-card { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.project-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.project-card-cover {
    position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem;
    min-height: 84px; padding: .8rem; background: linear-gradient(135deg, var(--primary-soft), var(--surface-2));
}
.music-glyph { position: absolute; right: 1rem; bottom: .5rem; font-size: 2rem; color: var(--primary-text); opacity: .35; }
.genre-pill { background: var(--surface); color: var(--text); }
.version-pill { background: var(--success-soft); color: var(--success); }
.project-card-body { display: flex; flex-direction: column; gap: .55rem; padding: 1rem; flex: 1; }
.project-card-body > .card-status { align-self: flex-start; }
.project-card-body h2 { margin: 0; font-size: 1.05rem; }
.project-card-body h2 a { color: var(--text); }
.project-card-body > p { color: var(--muted); font-size: .9rem; margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; color: var(--muted); font-size: .8125rem; }
.project-card-progress { display: flex; align-items: center; gap: .6rem; }
.project-card-progress > span { flex: 1; }
.project-card-progress strong { font-size: .8125rem; color: var(--muted); font-weight: 600; }
.card-actions { margin-top: auto; padding-top: .4rem; }

/* ---------- 10. Formulaire de création ---------- */
.studio-create-form > .fine-print { order: 9; }
.studio-create-toolbar {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem;
}
.studio-create-toolbar h1 { margin-bottom: .2rem; }
.studio-create-toolbar p:not(.studio-create-toolbar__kicker) { color: var(--muted); }

.studio-create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.studio-create-main { display: grid; gap: 1.25rem; min-width: 0; }

.studio-control-panel, .studio-workspace { padding: clamp(1rem, 2.5vw, 1.5rem); }
.studio-panel-heading { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; }
.studio-panel-heading__step {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: var(--on-primary); font-size: .8125rem; font-weight: 700;
}
.studio-panel-heading h2 { margin: 0 0 .2rem; }
.studio-panel-heading p:not(.studio-panel-heading__eyebrow) { color: var(--muted); font-size: .9375rem; }

.studio-mode-list, .lyrics-source-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.studio-mode-option, .lyrics-source-option {
    position: relative; display: flex; gap: .75rem; align-items: flex-start;
    padding: 1rem; border: 1.5px solid var(--border); border-radius: var(--radius);
    background: var(--surface); cursor: pointer; font-weight: 400;
    transition: border-color .15s, background-color .15s;
}
.studio-mode-option:hover, .lyrics-source-option:hover { border-color: var(--border-strong); }
.studio-mode-option.is-selected, .lyrics-source-option.is-selected,
.studio-mode-option:has(input:checked), .lyrics-source-option:has(input:checked) {
    border-color: var(--primary); background: var(--primary-soft);
}
.studio-mode-option__radio, .lyrics-source-option__radio { padding-top: .15rem; }
.studio-mode-option__icon, .lyrics-source-option__icon {
    display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px;
    background: var(--surface-3); color: var(--primary-text); font-size: 1.05rem;
}
.studio-mode-option.is-selected .studio-mode-option__icon, .lyrics-source-option.is-selected .lyrics-source-option__icon { background: var(--surface); }
.studio-mode-option__content, .lyrics-source-option > span:last-child { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1; }
.studio-mode-option strong, .lyrics-source-option strong { font-size: 1rem; }
.studio-mode-option small, .lyrics-source-option small { color: var(--muted); font-size: .875rem; line-height: 1.45; }
.studio-mode-option__tag {
    position: absolute; top: .7rem; right: .8rem; padding: .1rem .5rem; border-radius: 6px;
    background: var(--surface-3); color: var(--muted); font-size: .75rem; font-weight: 600;
}
.studio-mode-option[data-mode-value="automatic"] .studio-mode-option__tag { background: var(--success-soft); color: var(--success); }
.studio-mode-option .studio-mode-option__content { padding-right: 5.5rem; }

.studio-tabs {
    display: flex; gap: .25rem; padding: .25rem; margin-bottom: 1.25rem;
    background: var(--surface-3); border-radius: 12px; overflow-x: auto;
}
.studio-tabs button {
    flex: 1; min-height: 38px; padding: .4rem .9rem; border: 0; border-radius: 9px;
    background: transparent; color: var(--muted); font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.studio-tabs button.is-active, .studio-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.lyrics-source-panel {
    display: grid; gap: 1rem; padding: 1rem; border-radius: var(--radius);
    background: var(--surface-2); border: 1px solid var(--border);
}
.lyrics-source-panel__heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.lyrics-source-panel__heading h3 { margin: 0; }
.lyrics-source-panel__duration { font-size: .8125rem; color: var(--muted); padding: .15rem .55rem; border-radius: 6px; background: var(--surface-3); white-space: nowrap; }
.provided-lyrics-workspace { display: grid; gap: .75rem; }
.provided-lyrics-workspace textarea { min-height: 220px; }

.lyrics-duration-preview, .studio-auto-note {
    display: flex; gap: .75rem; align-items: flex-start;
    padding: .8rem 1rem; border-radius: var(--radius-sm);
    background: var(--info-soft); font-size: .9rem;
}
.lyrics-duration-preview strong, .studio-auto-note strong { display: block; margin-bottom: .15rem; }
.lyrics-duration-preview span, .studio-auto-note p { color: var(--muted); }
.lyrics-duration-preview.is-ready { background: var(--success-soft); }
.studio-auto-note { margin-top: 1.25rem; background: var(--primary-soft); }
.studio-auto-note > span { color: var(--primary-text); font-size: 1.2rem; }

.studio-catalog-status { font-size: .8125rem; color: var(--muted); }
.studio-catalog-field--genre.is-catalog-locked select { opacity: .6; }
.studio-catalog-field--genre.is-catalog-ready .studio-catalog-status { color: var(--success); }
.studio-catalog-field--genre.is-catalog-all .studio-catalog-status { color: var(--primary-text); }

details.studio-advanced, .studio-section-card, .detail-more {
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
details.studio-advanced { padding: 0 1rem; }
details.studio-advanced > summary, .detail-more > summary {
    padding: .85rem 0; cursor: pointer; font-weight: 600; font-size: .9375rem; color: var(--text); list-style: none;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
details.studio-advanced > summary::-webkit-details-marker, .detail-more > summary::-webkit-details-marker,
.studio-section-card > summary::-webkit-details-marker { display: none; }
details.studio-advanced > summary::after, .detail-more > summary::after {
    content: ""; width: 9px; height: 9px; flex: none; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg); transition: transform .15s; margin-right: 4px;
}
details[open].studio-advanced > summary::after, details[open].detail-more > summary::after { transform: rotate(-135deg); }
details.studio-advanced[open] { padding-bottom: 1rem; }
.studio-advanced__grid { display: grid !important; gap: 1rem !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; margin-top: .25rem !important; }

.detail-more { padding: 0 1rem; margin-top: 1rem; }
.detail-more[open] { padding-bottom: 1rem; }
.detail-more > summary { color: var(--muted); }

.studio-preset-box {
    display: grid; gap: .9rem; padding: 1rem; margin-bottom: 1.25rem;
    border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border);
}
.studio-preset-box__heading p { color: var(--muted); font-size: .9rem; }
.studio-preset-box__controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: end; }
.preset-preview { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: .9rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.preset-preview__category { font-size: .8125rem; color: var(--primary-text); font-weight: 600; }
.preset-preview h3 { margin: .15rem 0; }
.preset-preview p { color: var(--muted); font-size: .9rem; }
.preset-preview__facts { grid-template-columns: repeat(3, auto); gap: .25rem 1rem; align-content: start; }
.preset-preview__facts div { display: flex; flex-direction: column; }
.preset-preview__facts dt { font-size: .75rem; }
.preset-preview__facts dd { text-align: left; font-size: .9rem; }
.preset-feedback { font-size: .875rem; color: var(--success); margin: 0; }
.preset-feedback:empty { display: none; }

.instrument-presets { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.instrument-presets button {
    min-height: 32px; padding: .25rem .75rem; border: 1px solid var(--border-strong); border-radius: 999px;
    background: var(--surface); color: var(--text); font: inherit; font-size: .8125rem; cursor: pointer;
}
.instrument-presets button:hover { border-color: var(--primary); }
.instrument-presets button.is-added { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }

.studio-section-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; margin-bottom: .75rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.studio-section-toolbar strong { display: block; font-size: .9375rem; }
.studio-section-toolbar small { color: var(--muted); }
.studio-section-toolbar .is-error { color: var(--danger); }
.studio-section-list { display: grid; gap: .6rem; }
.studio-section-card > summary {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .75rem; align-items: center;
    padding: .8rem 1rem; cursor: pointer; list-style: none;
}
.studio-section-card__number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); font-size: .8125rem; font-weight: 700; }
.studio-section-card__title { display: flex; flex-direction: column; min-width: 0; }
.studio-section-card__title small { color: var(--muted); }
.studio-section-card__status { font-size: .8125rem; color: var(--muted); padding: .1rem .5rem; border-radius: 6px; background: var(--surface-3); }
.studio-section-card__status.is-configured { background: var(--primary-soft); color: var(--primary-text); }
.studio-section-card__chevron { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.studio-section-card[open] .studio-section-card__chevron { transform: rotate(-135deg); }
.studio-section-card__body { padding: 0 1rem 1rem; border-top: 1px solid var(--border); }
.studio-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; padding-top: 1rem; }
.studio-section-field { display: flex; flex-direction: column; gap: .35rem; }
.studio-section-field > span { font-size: .875rem; }
.studio-section-field small { color: var(--muted); font-weight: 400; }
.studio-section-field--wide { grid-column: 1 / -1; }
.studio-section-field textarea { min-height: 70px; }
.studio-section-card__actions { display: flex; justify-content: flex-end; margin-top: .9rem; }

.studio-create-summary { position: sticky; top: calc(var(--topbar-h) + 16px); padding: 1.25rem; display: grid; gap: 1rem; }
.studio-create-summary__header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.studio-create-summary__header p { margin: 0; font-size: 1rem; color: var(--text); font-weight: 650; }
.studio-create-summary__header span { font-size: .8125rem; color: var(--primary-text); font-weight: 600; text-align: right; }
.studio-create-summary__list > div { font-size: .875rem; padding: .45rem 0; }
.studio-create-summary__note { padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: .875rem; }
.studio-create-submit, .studio-create-cancel { width: 100%; }
.studio-mobile-actions { display: none; }

/* Mode automatique : on cache les réglages personnalisés */
.lyrics-editor-form .form-field textarea { min-height: 420px; font-size: 1rem; line-height: 1.7; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.editor-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.editor-guide { position: sticky; top: calc(var(--topbar-h) + 16px); }
.check-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.check-list li { position: relative; padding-left: 1.5rem; color: var(--muted); font-size: .9375rem; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 700; }

/* ---------- 11. Page projet ---------- */
.project-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; align-items: start;
    padding: clamp(1.1rem, 3vw, 1.6rem); margin-bottom: 1rem;
    border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.project-hero-main { min-width: 0; }
.project-kicker { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .7rem; }
.project-kicker > span:not(.card-status) { font-size: .8125rem; color: var(--muted); padding: .2rem .6rem; border-radius: 999px; background: var(--surface-3); }
.project-hero h1 { margin-bottom: .3rem; overflow-wrap: anywhere; }
.project-hero-main > p:not(.project-state-summary) { color: var(--muted); }
.project-state-summary {
    display: inline-flex; align-items: center; gap: .5rem; margin-top: .6rem !important;
    padding: .45rem .8rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary-text);
    font-weight: 600; font-size: .9375rem;
}

.project-action-dock { display: flex; flex-direction: column; gap: .5rem; min-width: 220px; }
.project-action-control {
    display: flex; align-items: center; gap: .65rem; width: 100%;
    min-height: 44px; padding: .5rem .9rem; border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.project-action-control:hover { background: var(--surface-3); text-decoration: none; }
.project-action-control svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.project-action-control span { display: flex; flex-direction: column; line-height: 1.2; }
.project-action-control strong { font-size: .9375rem; }
.project-action-control small { font-size: .75rem; color: var(--muted); }
.project-action-control--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); min-height: 52px; }
.project-action-control--primary:hover { background: var(--primary-hover); }
.project-action-control--primary small { color: rgba(255, 255, 255, .8); }
.project-action-control--danger { color: var(--danger); }
.project-action-control--danger small { color: var(--muted); }
.project-action-control--quiet { border-color: transparent; background: transparent; }

.workflow, .project-section-nav, .studio-tabs { scrollbar-width: none; }
.workflow::-webkit-scrollbar, .project-section-nav::-webkit-scrollbar, .studio-tabs::-webkit-scrollbar { display: none; }
.workflow {
    display: flex; align-items: center; gap: .5rem; padding: .9rem 1.1rem; margin-bottom: 1rem;
    border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); overflow-x: auto;
}
.workflow-step { display: flex; align-items: center; gap: .6rem; flex: none; color: var(--muted); }
.workflow-step > span {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid var(--border-strong); font-weight: 700; font-size: .875rem; background: var(--surface);
}
.workflow-step strong { display: block; font-size: .9rem; color: var(--text); line-height: 1.2; }
.workflow-step small { font-size: .75rem; }
.workflow-step.is-complete > span { background: var(--success); border-color: var(--success); color: #fff; }
.workflow-step.is-current > span { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
.workflow-line { flex: 1; min-width: 24px; height: 2px; background: var(--border); }
.workflow-line.is-complete { background: var(--success); }

.project-section-nav {
    display: flex; align-items: center; gap: .3rem; margin-bottom: 1.25rem; overflow-x: auto;
    padding-bottom: 2px;
}
.project-section-nav .section-nav-label { margin: 0 .3rem 0 0; color: var(--muted); text-transform: none; white-space: nowrap; }
.project-section-nav a {
    padding: .35rem .8rem; border-radius: 999px; color: var(--muted); font-size: .875rem; font-weight: 600; white-space: nowrap;
}
.project-section-nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.project-section-nav a.is-active { background: var(--text); color: var(--bg); }

.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.studio-main { min-width: 0; }
.studio-sidebar { display: grid; gap: 1.25rem; align-items: start; position: sticky; top: calc(var(--topbar-h) + 16px); }
.studio-sidebar .panel { margin-bottom: 0; }

/* Travail en cours / candidat */
.generation-job-panel { border-left: 4px solid var(--primary); }
.generation-job-panel--failed { border-left-color: var(--danger); }
.generation-job-panel__header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: start; }
.generation-job-panel__icon {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    background: var(--primary-soft); color: var(--primary-text); font-size: 1.3rem;
}
.generation-job-panel--failed .generation-job-panel__icon { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
#generation-status .generation-job-panel__icon { animation: spin 2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.generation-job-panel__header h2 { margin: 0 0 .2rem; }
.generation-job-panel__header p:not(.eyebrow):not(.fine-print) { color: var(--muted); }
.generation-job-panel__state { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.job-connection-status { font-size: .75rem; color: var(--success); }
.job-connection-status[data-connection-state="reconnecting"] { color: var(--warning); }
.job-connection-status[data-connection-state="offline"] { color: var(--danger); }
.job-background-note { color: var(--muted); font-size: .875rem; }

.music-candidate-review { display: grid; gap: .75rem; margin-top: 1rem; padding: 1rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.music-candidate-review audio { width: 100%; }
.candidate-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.candidate-actions form { margin: 0; }
@media (max-width: 640px) {
    .candidate-actions, .candidate-actions form { flex-direction: column; align-items: stretch; width: 100%; }
    .candidate-actions .button { width: 100%; }
}
.music-candidate-review form { display: grid; gap: .5rem; justify-items: start; }

audio { width: 100%; height: 44px; border-radius: 10px; }

.action-panel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.action-panel-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--primary); color: var(--on-primary); font-size: 1.3rem; }
.action-panel p:not(.eyebrow) { color: var(--muted); }

.prose-lead { font-size: 1.0625rem; color: var(--text); }

.lyrics-fit-panel {
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem; margin-bottom: 1.25rem; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border);
}
.lyrics-fit-panel h2 { font-size: 1.05rem; margin: 0 0 .15rem; }
.lyrics-fit-panel p:not(.eyebrow) { color: var(--muted); font-size: .9rem; }
.lyrics-fit-panel__stats { display: flex; flex-wrap: wrap; gap: .35rem; }
.lyrics-fit-panel__stats span { padding: .2rem .6rem; border-radius: 999px; background: var(--surface-3); font-size: .8125rem; color: var(--muted); font-weight: 600; }

.lyrics-card-layout { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: start; }
.lyrics-card-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); }
.lyrics-card-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--primary-text); stroke-width: 1.8; stroke-linejoin: round; }
.lyrics-card-structure { color: var(--muted); font-size: .875rem; }
.lyrics-card-preview { padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .9375rem; line-height: 1.65; white-space: normal; }
.lyrics-open-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.lyrics-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.lyrics-dialog__surface { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.lyrics-dialog__header { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem .75rem; }
.lyrics-dialog__header p:not(.eyebrow) { color: var(--muted); font-size: .875rem; }
.lyrics-dialog__close { flex: none; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.lyrics-dialog__toolbar { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.4rem 1rem; border-bottom: 1px solid var(--border); }
.lyrics-dialog__toolbar form { margin: 0; }
.lyrics-tool-action {
    display: flex; align-items: center; gap: .5rem; min-height: 40px; padding: .35rem .8rem;
    border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text);
    font: inherit; text-align: left; cursor: pointer;
}
.lyrics-tool-action:hover { background: var(--surface-3); text-decoration: none; }
.lyrics-tool-action svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lyrics-tool-action span { display: flex; flex-direction: column; line-height: 1.15; }
.lyrics-tool-action strong { font-size: .875rem; }
.lyrics-tool-action small { font-size: .75rem; color: var(--muted); }
.lyrics-tool-action--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.lyrics-tool-action--primary small { color: rgba(255, 255, 255, .8); }
.lyrics-tool-action--primary:hover { background: var(--primary-hover); }
.lyrics-tool-action--warning { color: var(--warning); }
.lyrics-dialog__body { padding: 1.25rem 1.4rem; overflow-y: auto; }
.lyrics-display { font-size: 1.0625rem; line-height: 1.8; }
.lyrics-display p { margin-bottom: 1.1em; }
.lyrics-dialog__footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.4rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .8125rem; }

.production-panel .section-heading { margin-bottom: .75rem; }
.production-review-notice { padding: .7rem 1rem; border-radius: var(--radius-sm); background: var(--warning-soft); font-size: .9375rem; }
.generation-cost-preview { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.generation-cost-preview > div { display: flex; gap: .8rem; min-width: 0; flex: 1; }
.generation-cost-preview > div > div { min-width: 0; flex: 1; display: grid; gap: .5rem; }
.generation-cost-preview p { margin: 0; font-size: .9375rem; }
.generation-cost-preview__icon { display: none; }
.generation-settings-summary { margin: .25rem 0; padding: .25rem .9rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.cost-badge { display: none; }
.credit-price {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .9rem;
    padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--primary-soft);
}
.credit-price strong { font-size: 1.15rem; color: var(--primary-text); }
.credit-price span { color: var(--muted); font-size: .9rem; }
.lyrics-check-ok { color: var(--success); font-weight: 600; }
.production-note { margin-top: .5rem; font-size: .9rem; }
.production-note strong { display: block; margin-bottom: .2rem; }
.production-note p { color: var(--muted); }

.audio-result { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem; align-items: center; border-left: 4px solid var(--success); }
.audio-result-cover {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
    width: 96px; height: 96px; border-radius: 16px; background: var(--success-soft); color: var(--success);
}
.audio-result-cover span { font-size: .8125rem; font-weight: 700; }
.audio-result-cover strong { font-size: 2rem; line-height: 1; }
.audio-result-content { display: grid; gap: .6rem; min-width: 0; }
.audio-result-content h2 { margin: 0; }
.audio-result-content p:not(.eyebrow) { color: var(--muted); }

.version-list { display: grid; gap: .75rem; }
.version-card { padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); display: grid; gap: .75rem; }
.version-card.is-selected { border-color: var(--success); background: var(--success-soft); }
.version-card-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.version-title-group { display: flex; align-items: center; gap: .75rem; }
.version-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: .875rem; }
.version-info { display: flex; flex-direction: column; line-height: 1.25; }
.version-info span { font-size: .8125rem; color: var(--muted); }
.version-metadata { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.version-metadata div { display: flex; flex-direction: column; }
.version-metadata dt { font-size: .75rem; }
.version-metadata dd { text-align: left; font-size: .875rem; }
.version-protection-note { font-size: .8125rem; color: var(--muted); }

.settings-card h2, .usage-mini-card h2, .instrumentation-card h2 { font-size: 1.05rem; }
.instrumentation-card p:not(.eyebrow):not(.fine-print) { font-size: .9375rem; }

/* ---------- 12. Pages secondaires ---------- */
.account-settings-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-settings-grid { align-items: start; }
.account-settings-grid .panel { margin-bottom: 0; }
.account-settings-grid form { display: grid; gap: 1rem; justify-items: start; }
.account-settings-grid form .form-field { width: 100%; }
.account-security-row { display: grid; gap: .35rem; justify-items: start; padding: .9rem 0; border-bottom: 1px solid var(--border); }
.account-security-row:last-child { border-bottom: 0; padding-bottom: 0; }
.account-security-row h3 { margin: 0; font-size: 1rem; }
.account-security-row p { margin: 0; color: var(--muted); font-size: .9375rem; overflow-wrap: anywhere; }
.account-security-row form { margin: 0; }

.legal-page { max-width: 820px; margin: 0 auto; }
.legal-hero { margin-bottom: 1.5rem; }
.legal-content { padding: clamp(1.1rem, 3vw, 2rem); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.legal-content h2 { margin-top: 1.5rem; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { color: var(--muted); }

/* Santé du système */
.health-summary { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; margin-bottom: 1.25rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.health-summary__label { font-weight: 650; }
.health-summary--ok, .health-summary--healthy { border-left: 4px solid var(--success); }
.health-summary--warning, .health-summary--degraded { border-left: 4px solid var(--warning); }
.health-summary--error, .health-summary--critical, .health-summary--unhealthy { border-left: 4px solid var(--danger); }
.health-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 1.25rem; }
.health-card { padding: 1.1rem; }
.health-card__header { display: flex; justify-content: space-between; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.health-card__header h2, .health-card__header h3 { margin: 0; font-size: 1rem; }
.health-badge--ok, .health-badge--healthy { background: var(--success-soft); color: var(--success); }
.health-badge--warning, .health-badge--degraded { background: var(--warning-soft); color: var(--warning); }
.health-badge--error, .health-badge--critical { background: var(--danger-soft); color: var(--danger); }
.health-metrics { display: grid; gap: .25rem; color: var(--muted); font-size: .875rem; }
.health-heading { margin-bottom: 1rem; }
.maintenance-commands { display: grid; gap: .5rem; }

/* Suivi technique */
.usage-admin-page { display: grid; gap: 1.25rem; }
.usage-summary-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.usage-stat-card { padding: 1rem 1.1rem; display: grid; gap: .2rem; }
.usage-stat-card__label { color: var(--muted); font-size: .875rem; }
.usage-stat-card strong { font-size: 1.4rem; }
.usage-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.usage-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.usage-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.usage-table th, .usage-table td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.usage-table th { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.usage-table tr:last-child td { border-bottom: 0; }
.usage-error-row td { background: var(--danger-soft); }
.usage-status--success, .provider-badge--openai { background: var(--success-soft); color: var(--success); }
.usage-status--failed, .usage-status--error { background: var(--danger-soft); color: var(--danger); }
.usage-status--uncertain { background: var(--warning-soft); color: var(--warning); }
.provider-badge--elevenlabs { background: var(--primary-soft); color: var(--primary-text); }
.budget-progress-list { display: grid; gap: 1rem; }
.budget-progress__heading { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; margin-bottom: .35rem; }
.usage-policy-form { display: grid; gap: 1rem; }
.usage-rate-list { display: grid; gap: .4rem; font-size: .9rem; }

/* Admin Django : formulaire de crédits (hérite du thème admin) */

/* ---------- 13. Pages d’authentification ---------- */
.auth-body { background: var(--bg); }
.auth-site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.auth-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.auth-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 1120px; height: var(--topbar-h); margin: 0 auto; padding: 0 var(--gutter); }
.auth-nav { display: flex; align-items: center; gap: 1rem; font-size: .9375rem; }
.auth-nav a { color: var(--muted); font-weight: 600; }
.auth-nav form { margin: 0; }
.auth-nav button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.auth-main {
    flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center; width: 100%; max-width: 1120px; margin: 0 auto; padding: clamp(1.5rem, 5vw, 3.5rem) var(--gutter);
}
.auth-showcase { position: relative; }
.auth-showcase-glow, .auth-wave { display: none; }
.auth-showcase h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.6rem); line-height: 1.15; margin: .3rem 0 .75rem; max-width: 18ch; }
.auth-showcase-content > p { color: var(--muted); font-size: 1.0625rem; max-width: 48ch; }
.auth-feature-list { display: grid; gap: .9rem; margin-top: 1.5rem; }
.auth-feature { display: flex; gap: .8rem; align-items: flex-start; }
.auth-feature-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); }
.auth-feature-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--primary-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-feature > span:last-child { display: flex; flex-direction: column; }
.auth-feature small { color: var(--muted); }
.auth-form-zone { display: grid; gap: 1rem; }
.auth-messages { display: grid; gap: .5rem; }
.auth-message { display: flex; gap: .6rem; align-items: center; padding: .7rem .9rem; border-radius: 10px; background: var(--info-soft); font-size: .9375rem; }
.auth-message--error { background: var(--danger-soft); }
.auth-message--success { background: var(--success-soft); }
.auth-message-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.auth-card { padding: clamp(1.25rem, 4vw, 2rem); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.auth-card-brand { margin-bottom: 1rem; }
.auth-card-brand img { width: 44px; height: 44px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .4rem; }
.auth-card-content > p { color: var(--muted); }
.auth-card-content form { display: grid; gap: .9rem; margin-top: 1rem; }
.auth-card-content form p { display: grid; gap: .35rem; margin: 0; }
.auth-card-content form label { font-size: .9375rem; }
.auth-card-content form .helptext, .auth-card-content form ul:not(.errorlist) { color: var(--muted); font-size: .8125rem; }
.auth-card-content button[type="submit"], .auth-card-content .button--primary {
    width: 100%; min-height: 46px; border: 0; border-radius: 10px; background: var(--primary); color: var(--on-primary);
    font: inherit; font-weight: 600; cursor: pointer;
}
.auth-card-content button[type="submit"]:hover { background: var(--primary-hover); }
.auth-card-content input[type="checkbox"] { display: inline-block; vertical-align: middle; margin-right: .4rem; }
.auth-card-content a { font-weight: 600; }
.auth-security-note { display: flex; gap: .7rem; align-items: flex-start; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.auth-security-note svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--success); stroke-width: 1.8; }
.auth-security-note p { display: flex; flex-direction: column; margin: 0; font-size: .875rem; }
.auth-security-note span { color: var(--muted); }
.auth-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; max-width: 1120px; width: 100%; margin: 0 auto; padding: 1.25rem var(--gutter); color: var(--muted); font-size: .875rem; border-top: 1px solid var(--border); }
.auth-footer nav { display: flex; gap: 1rem; }
.auth-footer a { color: var(--muted); }

.signup-form { display: grid; gap: .9rem; }
.signup-field { display: grid; gap: .35rem; }
.signup-help, .signup-verification-note { color: var(--muted); font-size: .875rem; }
.signup-error-summary { padding: .8rem 1rem; border-radius: 10px; background: var(--danger-soft); }
.signup-consent { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.signup-password-toggle { border: 0; background: none; color: var(--primary-text); font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- 14. Adaptation écran ---------- */
/* ---------- 15. Creator helpers ---------- */
.topic-ideas { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .5rem; }
.topic-ideas > span { font-size: .8125rem; color: var(--muted); font-weight: 600; }
.topic-ideas button {
    min-height: 32px; padding: .25rem .75rem; border: 1px solid var(--border-strong); border-radius: 999px;
    background: var(--surface); color: var(--text); font: inherit; font-size: .8125rem; cursor: pointer;
}
.topic-ideas button:hover { border-color: var(--primary); color: var(--primary-text); }
.reject-reasons { display: grid; gap: .35rem; margin: .75rem 0; padding: 0; border: 0; }
.reject-reasons legend { margin-bottom: .35rem; font-weight: 600; font-size: .9375rem; }
.reject-reasons label { display: flex; gap: .55rem; align-items: center; font-weight: 400; font-size: .9375rem; cursor: pointer; }
.card-audio { width: 100%; height: 36px; }

@media (max-width: 1180px) {
    .neg-dashboard { grid-template-columns: minmax(0, 1fr); }
    .neg-dashboard-aside { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
    .neg-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .studio-layout { grid-template-columns: minmax(0, 1fr); }
    .studio-sidebar { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
    .usage-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1020px) {
    .sidebar-toggle { display: inline-flex; }
    .app-sidebar { transform: translateX(-100%); width: min(300px, 86vw); top: 0; z-index: 60; box-shadow: var(--shadow-lg); }
    .app-sidebar.is-open { transform: translateX(0); }
    .sidebar-collapse { display: none; }
    .sidebar-close { display: grid; }
    .app-main { margin-left: 0; }
    .studio-create-layout, .editor-layout { grid-template-columns: minmax(0, 1fr); }
    .studio-create-summary { position: static; }
    .studio-create-summary .studio-create-submit, .studio-create-summary .studio-create-cancel { display: none; }
    .studio-mobile-actions {
        position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
        margin: 1.25rem calc(-1 * var(--gutter)) 0; padding: .75rem var(--gutter);
        background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(8px);
        border-top: 1px solid var(--border);
    }
    .studio-mobile-actions > div { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
    .studio-mobile-actions small { color: var(--muted); }
    .project-hero { grid-template-columns: minmax(0, 1fr); }
    .project-action-dock { flex-direction: row; flex-wrap: wrap; min-width: 0; }
    .project-action-dock .project-action-control { width: auto; flex: 1 1 160px; }
    .project-action-dock .project-action-control--primary { flex-basis: 100%; }
    .editor-guide { position: static; }
}

@media (max-width: 760px) {
    :root { --topbar-h: 58px; }
    body.app-body { padding-bottom: 68px; }
    .topbar-brand small, .topbar-profile-copy, .profile-chevron, .topbar-create { display: none; }
    .topbar-profile { margin-left: auto; }
    .page-shell { padding-top: 1.25rem; }

    .mobile-app-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
        height: 64px; padding: 0 .25rem env(safe-area-inset-bottom);
        background: var(--surface); border-top: 1px solid var(--border);
    }
    .mobile-app-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: .6875rem; font-weight: 600; }
    .mobile-app-nav a:hover { text-decoration: none; }
    .mobile-app-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-app-nav a.is-active { color: var(--primary-text); }
    .mobile-app-nav__create > span {
        display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
        background: var(--primary); color: var(--on-primary); font-size: 1.5rem; line-height: 1;
    }
    .mobile-app-nav__create small { font-size: .6875rem; }
    .studio-mobile-actions { bottom: 64px; }

    .form-grid, .studio-form-grid, .studio-form-grid--three, .studio-section-grid,
    .studio-mode-list, .lyrics-source-options, .account-settings-grid, .studio-advanced__grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .studio-preset-box__controls, .preset-preview { grid-template-columns: minmax(0, 1fr); }
    .library-toolbar__controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .library-search { grid-column: 1 / -1; }
    .neg-hero { grid-template-columns: minmax(0, 1fr); }
    .neg-hero-art { display: none; }
    .neg-project-cover { display: none; }
    .neg-steps { grid-template-columns: minmax(0, 1fr); }
    .neg-public-hero, .neg-public-features, .auth-main { grid-template-columns: minmax(0, 1fr); }
    .auth-feature-list { display: none; }
    .public-footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .public-footer-brand { grid-column: 1 / -1; }
    .generation-job-panel__header { grid-template-columns: minmax(0, 1fr); }
    .generation-job-panel__state { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
    .generation-job-panel__header > .job-status-badge { grid-column: 1 / -1; grid-row: 1; justify-self: start; }
    .generation-job-panel__header > .generation-job-panel__icon { display: none; }
    .action-panel, .lyrics-card-layout { grid-template-columns: minmax(0, 1fr); }
    .action-panel-icon, .lyrics-card-icon { display: none; }
    .audio-result { grid-template-columns: minmax(0, 1fr); }
    .audio-result-cover { display: none; }
    .version-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .generation-cost-preview { flex-direction: column; }
    .workflow-step small { display: none; }
    .button-group > .button, .button-group > form, .button-group > form .button { flex: 1 1 auto; }
    .lyrics-dialog__footer { flex-direction: column; align-items: stretch; }
    .studio-mode-option .studio-mode-option__content { padding-right: 0; padding-top: 1.4rem; }
    .project-action-dock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .project-action-dock .project-action-control--primary { grid-column: 1 / -1; }
    .project-action-dock .project-action-control:not(.project-action-control--primary) {
        flex-direction: column; justify-content: center; gap: .25rem; padding: .55rem .25rem; text-align: center;
    }
    .project-action-dock .project-action-control:not(.project-action-control--primary) small { display: none; }
    .project-action-dock .project-action-control:not(.project-action-control--primary) strong { font-size: .8125rem; }
    .project-action-control--quiet { border-color: var(--border-strong); }
}

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

@media print {
    .app-topbar, .app-sidebar, .mobile-app-nav, .app-footer, .project-action-dock, .project-section-nav { display: none !important; }
    .app-main { margin: 0; }
    body { background: #fff; color: #000; }
}
